generated from RENCI/react-starter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheslint.config.mjs
36 lines (33 loc) · 1.2 KB
/
eslint.config.mjs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import globals from "globals";
import react from "eslint-plugin-react";
// this bit fixes the collision with the React definition of react
react["configs"]["recommended"].plugins = { react };
react["configs"]["recommended"].languageOptions = { parserOptions: react["configs"]["recommended"].parserOptions };
// remove this because we are going to create it properly below
delete react["configs"]["recommended"].parserOptions;
export default [
react["configs"]["recommended"],
{
plugins: { react },
files: ["src/**/*.js*"],
ignores: ["**/*.config.js", "dist/**/*", "build/**/*", "node_modules/**/*"],
settings: { react: {version: "18.2.0"} },
languageOptions: {
sourceType: "module",
parserOptions: { ecmaFeatures: { jsx: true } },
globals: { ...globals.node, ...globals.browser }
},
rules: {
"no-unused-vars": "warn",
"no-undef": "warn",
"semi": "warn",
"prefer-const": "warn",
"no-dupe-args": "warn",
"no-dupe-keys": "warn",
"react/display-name": "off",
"react/no-is-mounted": "off"
// ,"no-console": ["error", { allow: ["warn", "error"] }]
},
linterOptions: { reportUnusedDisableDirectives: "error" }
}
];