Skip to content

Commit

Permalink
Migrate to ESLint 9 and fix linting issues
Browse files Browse the repository at this point in the history
  • Loading branch information
johnfactotum committed Apr 23, 2024
1 parent 04b8789 commit 5600b6c
Show file tree
Hide file tree
Showing 5 changed files with 61 additions and 31 deletions.
24 changes: 0 additions & 24 deletions .eslintrc.json

This file was deleted.

22 changes: 22 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -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 }],
},
}]
4 changes: 2 additions & 2 deletions mobi.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}`)
}
}
Expand All @@ -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}`)
}
}
Expand Down
37 changes: 37 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -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"
]
}
5 changes: 0 additions & 5 deletions view.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,6 @@ export class View extends HTMLElement {
#tocProgress
#pageProgress
#searchResults = new Map()
#ssml
#speechDoc
#speechRanges
#speechGranularity
#lastSpeechMark
isFixedLayout = false
lastLocation
history = new History()
Expand Down

0 comments on commit 5600b6c

Please sign in to comment.