-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy patheslint.config.js
More file actions
79 lines (75 loc) · 2.08 KB
/
eslint.config.js
File metadata and controls
79 lines (75 loc) · 2.08 KB
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
import globals from "globals";
import js from "@eslint/js";
import { defineConfig, globalIgnores } from "eslint/config";
import importPlugin from "eslint-plugin-import";
import eslintConfigPrettier from "eslint-config-prettier/flat";
import eslintConfigs from "@dr.pogodin/eslint-configs";
import babelEslintParser from "@babel/eslint-parser";
export default defineConfig([
// run on all js and jsx files in the static directory and subdirectories
{ files: ["**/*.js", "**/*.jsx"] },
globalIgnores([
"**/node_modules",
"baselayer",
"static/build",
"eslint.config.js",
"rspack.config.js",
"doc",
]),
{
languageOptions: {
parser: babelEslintParser,
parserOptions: {
requireConfigFile: false,
babelOptions: {
presets: ["@babel/preset-env", "@babel/preset-react"],
},
ecmaFeatures: {
jsx: true,
},
},
globals: {
...globals.browser,
},
},
},
js.configs.recommended,
importPlugin.flatConfigs.recommended,
eslintConfigs.configs.javascript,
eslintConfigs.configs.react,
{
rules: {
"@babel/new-cap": "off",
camelcase: "off",
"default-param-last": "off", // otherwise complains for all reducers
"jsx-a11y/click-events-have-key-events": "off",
"jsx-a11y/label-has-associated-control": "off",
"jsx-a11y/control-has-associated-label": "off",
"no-param-reassign": "off",
"no-unused-vars": "off",
"no-unsafe-optional-chaining": "off",
"no-useless-escape": "off",
"no-constant-binary-expression": "warn",
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "warn",
"react/jsx-wrap-multilines": "off",
"react/jsx-one-expression-per-line": "off",
"react/jsx-props-no-spreading": "off",
"react/jsx-curly-newline": "off",
"sort-keys": "off",
},
},
{
settings: {
"import/resolver": {
webpack: {
config: "rspack.config.js",
},
},
react: {
version: "detect",
},
},
},
eslintConfigPrettier,
]);