mirror of
https://github.com/john-okeefe/foliate-js.git
synced 2026-09-09 03:19:14 -04:00
Migrate to ESLint 9 and fix linting issues
This commit is contained in:
@@ -1,24 +0,0 @@
|
||||
{
|
||||
"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
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
import js from '@eslint/js'
|
||||
import globals from 'globals'
|
||||
|
||||
export default [js.configs.recommended, { ignores: ['vendor'] }, {
|
||||
languageOptions: {
|
||||
globals: globals.browser,
|
||||
},
|
||||
linterOptions: {
|
||||
reportUnusedDisableDirectives: true,
|
||||
},
|
||||
rules: {
|
||||
semi: ['error', 'never'],
|
||||
indent: ['warn', 4, { flatTernaryExpressions: true, SwitchCase: 1 }],
|
||||
quotes: ['warn', 'single', { avoidEscape: true }],
|
||||
'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 }],
|
||||
},
|
||||
}]
|
||||
@@ -785,7 +785,7 @@ class MOBI6 {
|
||||
const recindex = img.getAttribute('recindex')
|
||||
try {
|
||||
img.src = await this.loadRecindex(recindex)
|
||||
} catch (e) {
|
||||
} catch {
|
||||
console.warn(`Failed to load image ${recindex}`)
|
||||
}
|
||||
}
|
||||
@@ -795,7 +795,7 @@ class MOBI6 {
|
||||
try {
|
||||
media.src = await this.loadRecindex(mediarecindex)
|
||||
if (recindex) media.poster = await this.loadRecindex(recindex)
|
||||
} catch (e) {
|
||||
} catch {
|
||||
console.warn(`Failed to load media ${mediarecindex}`)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
{
|
||||
"name": "foliate",
|
||||
"version": "0.0.0",
|
||||
"description": "Render e-books in the browser",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/johnfactotum/foliate-js.git"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/johnfactotum/foliate-js/issues"
|
||||
},
|
||||
"homepage": "https://github.com/johnfactotum/foliate-js#readme",
|
||||
"author": "John Factotum",
|
||||
"license": "MIT",
|
||||
"type": "module",
|
||||
"exports": {
|
||||
"./*.js": "./*.js"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@eslint/js": "^9.1.0",
|
||||
"globals": "^15.0.0"
|
||||
},
|
||||
"keywords": [
|
||||
"ebook",
|
||||
"reader",
|
||||
"epub",
|
||||
"cfi",
|
||||
"mobi",
|
||||
"azw",
|
||||
"azw3",
|
||||
"fb2",
|
||||
"cbz",
|
||||
"dictd",
|
||||
"stardict",
|
||||
"opds"
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user