Skip to content

Commit 1597441

Browse files
committed
new format for eslint config
1 parent 1048ff3 commit 1597441

File tree

2 files changed

+43
-1
lines changed

2 files changed

+43
-1
lines changed

src/js/eslint.config.js

-1
This file was deleted.

src/js/eslint.config.mjs

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
import react from "eslint-plugin-react";
2+
import globals from "globals";
3+
import path from "node:path";
4+
import { fileURLToPath } from "node:url";
5+
import js from "@eslint/js";
6+
import { FlatCompat } from "@eslint/eslintrc";
7+
8+
const __filename = fileURLToPath(import.meta.url);
9+
const __dirname = path.dirname(__filename);
10+
const compat = new FlatCompat({
11+
baseDirectory: __dirname,
12+
recommendedConfig: js.configs.recommended,
13+
allConfig: js.configs.all,
14+
});
15+
16+
export default [
17+
...compat.extends("eslint:recommended", "plugin:react/recommended"),
18+
{
19+
plugins: {
20+
react,
21+
},
22+
23+
languageOptions: {
24+
globals: {
25+
...globals.browser,
26+
...globals.node,
27+
},
28+
29+
ecmaVersion: "latest",
30+
sourceType: "module",
31+
},
32+
33+
settings: {
34+
react: {
35+
version: "18.2.0",
36+
},
37+
},
38+
39+
rules: {
40+
"react/prop-types": "off",
41+
},
42+
},
43+
];

0 commit comments

Comments
 (0)