-
-
Notifications
You must be signed in to change notification settings - Fork 3k
/
eslint.config.js
90 lines (88 loc) · 2.42 KB
/
eslint.config.js
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
80
81
82
83
84
85
86
87
88
89
90
import globals from "./server/node_modules/globals/index.js"
import eslintRecommended from "./server/node_modules/@eslint/js/src/index.js"
import eslintConfigPrettier from "./server/node_modules/eslint-config-prettier/index.js"
import prettier from "./server/node_modules/eslint-plugin-prettier/eslint-plugin-prettier.js"
import react from "./server/node_modules/eslint-plugin-react/index.js"
import reactRefresh from "./server/node_modules/eslint-plugin-react-refresh/index.js"
import reactHooks from "./server/node_modules/eslint-plugin-react-hooks/index.js"
import ftFlow from "./server/node_modules/eslint-plugin-ft-flow/dist/index.js"
import hermesParser from "./server/node_modules/hermes-eslint/dist/index.js"
const reactRecommended = react.configs.recommended
const jsxRuntime = react.configs["jsx-runtime"]
export default [
eslintRecommended.configs.recommended,
eslintConfigPrettier,
{
ignores: ["**/*.test.js"],
languageOptions: {
parser: hermesParser,
parserOptions: {
ecmaFeatures: { jsx: true }
},
ecmaVersion: 2020,
sourceType: "module",
globals: {
...globals.browser,
...globals.es2020,
...globals.node
}
},
linterOptions: { reportUnusedDisableDirectives: true },
settings: { react: { version: "18.2" } },
plugins: {
ftFlow,
react,
"jsx-runtime": jsxRuntime,
"react-hooks": reactHooks,
prettier
},
rules: {
...reactRecommended.rules,
...reactHooks.configs.recommended.rules,
...ftFlow.recommended,
"no-unused-vars": "warn",
"no-undef": "warn",
"no-empty": "warn",
"no-extra-boolean-cast": "warn",
"prettier/prettier": "warn"
}
},
{
files: ["frontend/src/**/*.js"],
plugins: {
ftFlow,
prettier
},
rules: {
"prettier/prettier": "warn"
}
},
{
files: [
"server/endpoints/**/*.js",
"server/models/**/*.js",
"server/swagger/**/*.js",
"server/utils/**/*.js",
"server/index.js"
],
rules: {
"no-undef": "warn"
}
},
{
files: ["frontend/src/**/*.jsx"],
plugins: {
ftFlow,
react,
"jsx-runtime": jsxRuntime,
"react-hooks": reactHooks,
"react-refresh": reactRefresh,
prettier
},
rules: {
...jsxRuntime.rules,
"react/prop-types": "off", // FIXME
"react-refresh/only-export-components": "warn"
}
}
]