mirror of
https://github.com/john-okeefe/foliate-js.git
synced 2026-09-09 11:29:14 -04:00
Add .eslintrc.json
And fix issues
This commit is contained in:
@@ -0,0 +1,24 @@
|
|||||||
|
{
|
||||||
|
"root": true,
|
||||||
|
"env": {
|
||||||
|
"es2022": true,
|
||||||
|
"browser": true
|
||||||
|
},
|
||||||
|
"parserOptions": {
|
||||||
|
"ecmaVersion": 2022,
|
||||||
|
"sourceType": "module"
|
||||||
|
},
|
||||||
|
"extends": "eslint:recommended",
|
||||||
|
"rules": {
|
||||||
|
"semi": ["error", "never"],
|
||||||
|
"indent": ["warn", 4, { "flatTernaryExpressions": true, "SwitchCase": 1 }],
|
||||||
|
"quotes": ["warn", "single"],
|
||||||
|
"comma-dangle": ["warn", "always-multiline"],
|
||||||
|
"no-trailing-spaces": "warn",
|
||||||
|
"no-unused-vars": "warn",
|
||||||
|
"no-console": ["warn", { "allow": ["debug", "warn", "error", "assert"] }],
|
||||||
|
"no-constant-condition": ["error", { "checkLoops": false }],
|
||||||
|
"no-empty": ["error", { "allowEmptyCatch": true }]
|
||||||
|
},
|
||||||
|
"reportUnusedDisableDirectives": true
|
||||||
|
}
|
||||||
@@ -248,7 +248,7 @@ export const makeFB2 = async blob => {
|
|||||||
modified: getDate($('document-info date')),
|
modified: getDate($('document-info date')),
|
||||||
description: annotation ? converter.convert(annotation,
|
description: annotation ? converter.convert(annotation,
|
||||||
{ annotation: ['div', SECTION] }).innerHTML : null,
|
{ annotation: ['div', SECTION] }).innerHTML : null,
|
||||||
subject: $$('title-info genre').map(getElementText)
|
subject: $$('title-info genre').map(getElementText),
|
||||||
}
|
}
|
||||||
book.getCover = () => fetch(getImageSrc($('coverpage image')))
|
book.getCover = () => fetch(getImageSrc($('coverpage image')))
|
||||||
.then(res => res.blob())
|
.then(res => res.blob())
|
||||||
|
|||||||
Reference in New Issue
Block a user