mirror of
https://github.com/john-okeefe/foliate-js.git
synced 2026-09-09 11:29: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')
|
const recindex = img.getAttribute('recindex')
|
||||||
try {
|
try {
|
||||||
img.src = await this.loadRecindex(recindex)
|
img.src = await this.loadRecindex(recindex)
|
||||||
} catch (e) {
|
} catch {
|
||||||
console.warn(`Failed to load image ${recindex}`)
|
console.warn(`Failed to load image ${recindex}`)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -795,7 +795,7 @@ class MOBI6 {
|
|||||||
try {
|
try {
|
||||||
media.src = await this.loadRecindex(mediarecindex)
|
media.src = await this.loadRecindex(mediarecindex)
|
||||||
if (recindex) media.poster = await this.loadRecindex(recindex)
|
if (recindex) media.poster = await this.loadRecindex(recindex)
|
||||||
} catch (e) {
|
} catch {
|
||||||
console.warn(`Failed to load media ${mediarecindex}`)
|
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"
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -67,11 +67,6 @@ export class View extends HTMLElement {
|
|||||||
#tocProgress
|
#tocProgress
|
||||||
#pageProgress
|
#pageProgress
|
||||||
#searchResults = new Map()
|
#searchResults = new Map()
|
||||||
#ssml
|
|
||||||
#speechDoc
|
|
||||||
#speechRanges
|
|
||||||
#speechGranularity
|
|
||||||
#lastSpeechMark
|
|
||||||
isFixedLayout = false
|
isFixedLayout = false
|
||||||
lastLocation
|
lastLocation
|
||||||
history = new History()
|
history = new History()
|
||||||
|
|||||||
Reference in New Issue
Block a user