Skip to content

Commit 0c6c84b

Browse files
committed
convert .eslintrc.json to current config format
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 <mha1993@live.de>
1 parent 1035f5b commit 0c6c84b

3 files changed

Lines changed: 26 additions & 20 deletions

File tree

.eslintrc.json

Lines changed: 0 additions & 19 deletions
This file was deleted.

eslint.config.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
const js = require("@eslint/js")
2+
const jest = require("eslint-plugin-jest")
3+
const globals = require("globals")
4+
5+
module.exports = [
6+
js.configs.recommended,
7+
{
8+
plugins: {
9+
jest: jest
10+
},
11+
languageOptions: {
12+
ecmaVersion: 12,
13+
sourceType: "module",
14+
globals: {
15+
...globals.node,
16+
...globals.es6,
17+
...globals.jest
18+
}
19+
},
20+
rules: {
21+
indent: ["error", 4],
22+
"no-trailing-spaces": "error"
23+
}
24+
}
25+
]

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"jest": "^29.7.0"
66
},
77
"scripts": {
8-
"lint": "eslint -c .eslintrc.json '**/*.js'",
8+
"lint": "eslint -c eslint.config.js '**/*.js'",
99
"test": "jest"
1010
}
1111
}

0 commit comments

Comments
 (0)