Skip to content

Commit 5d1346e

Browse files
committed
deps: Migrating to the new version of eslint
1 parent 5822ac5 commit 5d1346e

File tree

3 files changed

+308
-446
lines changed

3 files changed

+308
-446
lines changed

eslint.config.js

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
const {
2+
defineConfig,
3+
globalIgnores,
4+
} = require("eslint/config");
5+
6+
const globals = require("globals");
7+
const js = require("@eslint/js");
8+
9+
const {
10+
FlatCompat,
11+
} = require("@eslint/eslintrc");
12+
13+
const compat = new FlatCompat({
14+
baseDirectory: __dirname,
15+
recommendedConfig: js.configs.recommended,
16+
allConfig: js.configs.all
17+
});
18+
19+
module.exports = defineConfig([{
20+
languageOptions: {
21+
globals: {
22+
...globals.browser,
23+
...globals.node,
24+
},
25+
26+
sourceType: "commonjs",
27+
ecmaVersion: "latest",
28+
parserOptions: {},
29+
},
30+
31+
extends: compat.extends("eslint:recommended", "plugin:prettier/recommended"),
32+
33+
rules: {
34+
indent: "off",
35+
semi: ["error", "always"],
36+
"arrow-body-style": ["error", "as-needed"],
37+
38+
"prettier/prettier": ["error", {
39+
singleQuote: true,
40+
parser: "flow",
41+
tabWidth: 4,
42+
endOfLine: "lf",
43+
}],
44+
},
45+
}, {
46+
files: ["*/*.js"],
47+
}, globalIgnores(["**/.eslintrc.js"])]);

0 commit comments

Comments
 (0)