Skip to content

Commit

Permalink
convert .eslintrc.json to current config format
Browse files Browse the repository at this point in the history
Eslint deprecated the existing config format in 2022 and
expects the new format by default starting with Version 9.0.0

Signed-off-by: Matthias Aßhauer <[email protected]>
  • Loading branch information
rimrul committed Apr 10, 2024
1 parent 1035f5b commit 0c6c84b
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 20 deletions.
19 changes: 0 additions & 19 deletions .eslintrc.json

This file was deleted.

25 changes: 25 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
const js = require("@eslint/js")
const jest = require("eslint-plugin-jest")
const globals = require("globals")

module.exports = [
js.configs.recommended,
{
plugins: {
jest: jest
},
languageOptions: {
ecmaVersion: 12,
sourceType: "module",
globals: {
...globals.node,
...globals.es6,
...globals.jest
}
},
rules: {
indent: ["error", 4],
"no-trailing-spaces": "error"
}
}
]
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"jest": "^29.7.0"
},
"scripts": {
"lint": "eslint -c .eslintrc.json '**/*.js'",
"lint": "eslint -c eslint.config.js '**/*.js'",
"test": "jest"
}
}

0 comments on commit 0c6c84b

Please sign in to comment.