-
-
Notifications
You must be signed in to change notification settings - Fork 774
Expand file tree
/
Copy patheslint.config.mjs
More file actions
87 lines (85 loc) · 2.58 KB
/
eslint.config.mjs
File metadata and controls
87 lines (85 loc) · 2.58 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
80
81
82
83
84
85
86
87
// @ts-check
import eslintPluginReact from "eslint-plugin-react";
import js from "@eslint/js";
import globals from "globals";
/** @type {import("eslint").Linter.Config[]} */
const config = [
js.configs.recommended,
eslintPluginReact.configs.flat.recommended,
{
files: ["**/*.js", "**/*.jsx"],
languageOptions: {
parserOptions: {
ecmaFeatures: {
jsx: true,
arrowFunctions: true,
blockBindings: true,
classes: true,
defaultParams: true,
destructuring: true,
forOf: true,
generators: true,
modules: true,
objectLiteralComputedProperties: true,
regexUFlag: true,
regexYFlag: true,
spread: true,
superInFunctions: false,
templateStrings: true
},
ecmaVersion: 2018,
sourceType: "module",
},
globals: {
__: false,
Promise: false,
VERSION: false,
...globals.browser,
}
}
},
{
ignores: [
"dist/",
"node_modules/",
]
},
{
files: ["src/**/*.js", "src/**/*.jsx"],
languageOptions: {
globals: {
document: "readonly",
window: "readonly",
navigator: "readonly",
setTimeout: "readonly",
}
}
},
{
settings: {
react: {
version: "detect"
}
}
},
{
rules: {
"semi": "error",
"no-var": "error",
"quotes": ["warn", "double" ],
"indent": ["warn", 4, {"SwitchCase": 1}],
"no-unused-vars": "warn",
"no-console": "warn",
"keyword-spacing": "warn",
"eqeqeq": "warn",
"space-before-function-paren": ["warn", { "anonymous": "always", "named": "never" }],
"space-before-blocks": "warn",
"no-multiple-empty-lines": "warn",
"react/jsx-equals-spacing": ["warn", "never"],
"react/prop-types": "warn",
"id-match": ["error", "^([A-Za-z0-9_])+$", {"properties": true}],
"no-useless-escape": "off",
},
}
];
export default config;