Skip to content

Commit

Permalink
Migrate to ESLint 9 w/ flat config
Browse files Browse the repository at this point in the history
Closes #856
  • Loading branch information
carhartl committed Apr 9, 2024
1 parent 2eca98a commit f30a5f2
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 20 deletions.
1 change: 0 additions & 1 deletion .eslintignore

This file was deleted.

13 changes: 0 additions & 13 deletions .eslintrc.json

This file was deleted.

30 changes: 30 additions & 0 deletions eslint.config.mjs
@@ -0,0 +1,30 @@
import globals from 'globals'
import js from '@eslint/js'

const languageOptions = {
globals: {
...globals.browser
}
}
export default [
{
ignores: ['dist/*']
},
{
...js.configs.recommended,
files: ['**/*.js'],
ignores: ['examples/**/src/*.js'],
languageOptions: {
...languageOptions,
sourceType: 'commonjs'
}
},
{
...js.configs.recommended,
files: ['**/*.mjs'],
languageOptions: {
...languageOptions,
ecmaVersion: 2021
}
}
]
6 changes: 3 additions & 3 deletions package.json
Expand Up @@ -30,8 +30,8 @@
"test": "grunt test",
"format": "prettier --write .",
"format:check": "prettier --check .",
"lint": "eslint --ext .js,.mjs --fix .",
"lint:check": "eslint --ext .js,.mjs .",
"lint": "eslint --fix .",
"lint:check": "eslint .",
"dist": "rm -rf dist/* && rollup -c",
"release": "release-it"
},
Expand All @@ -48,7 +48,7 @@
"devDependencies": {
"@rollup/plugin-terser": "^0.4.4",
"browserstack-runner": "github:browserstack/browserstack-runner#1e85e559951bdf97ffe2a7c744ee67ca83589fde",
"eslint": "^8.43.0",
"eslint": "^9.0.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-html": "^8.0.0",
"eslint-plugin-markdown": "^4.0.1",
Expand Down
2 changes: 1 addition & 1 deletion src/api.mjs
Expand Up @@ -65,7 +65,7 @@ function init(converter, defaultAttributes) {
if (name === found) {
break
}
} catch (e) {
} catch {
// Do nothing...
}
}
Expand Down
1 change: 0 additions & 1 deletion test/tests.js
Expand Up @@ -251,7 +251,6 @@ QUnit.test('String primitive', function (assert) {
})

QUnit.test('String object', function (assert) {
// eslint-disable-next-line no-new-wrappers
Cookies.set('c', new String('v'))
assert.strictEqual(Cookies.get('c'), 'v', 'should write value')
})
Expand Down
2 changes: 1 addition & 1 deletion test/utils.js
Expand Up @@ -53,7 +53,7 @@
)
callback(result.value, iframeDocument.cookie)
done()
} catch (e) {
} catch {
// Do nothing...
}
})
Expand Down

0 comments on commit f30a5f2

Please sign in to comment.