-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy patheslint.config.mjs
58 lines (57 loc) · 1.47 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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
import js from "@eslint/js"
import tsParser from "@typescript-eslint/parser"
import tsPlugin from "typescript-eslint"
import reactPlugin from "eslint-plugin-react"
import prettierPluginRecommended from "eslint-plugin-prettier/recommended"
import globals from "globals"
import confusingBrowserGlobals from "confusing-browser-globals"
export default [
js.configs.recommended,
prettierPluginRecommended,
{
files: ["**/*.{js,jsx,mjs,cjs,ts,tsx}"],
plugins: {
react: reactPlugin,
typescript: tsPlugin,
},
rules: {
...reactPlugin.configs.recommended.rules,
...reactPlugin.configs["jsx-runtime"].rules,
...tsPlugin.configs.recommended.rules,
"no-unused-vars": ["error", { varsIgnorePattern: "^_", argsIgnorePattern: "^_" }],
},
languageOptions: {
parser: tsParser,
globals: {
...globals.node,
},
},
settings: {
react: {
version: "detect",
},
},
},
{
files: ["src/client/**/*.{js,jsx,mjs,cjs,ts,tsx}"],
languageOptions: {
globals: {
...globals.browser,
...reactPlugin.configs.recommended.globals,
VENUS_INFLUX_LOADER_ADMIN_API_PORT: true,
VENUS_INFLUX_LOADER_BUILD_VERSION: true,
},
},
rules: {
"no-restricted-globals": ["error"].concat(confusingBrowserGlobals),
},
},
{
files: ["src/server/**/*.{js,jsx,mjs,cjs,ts,tsx}"],
languageOptions: {
globals: {
...globals.node,
},
},
},
]