-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheslint.config.js
68 lines (67 loc) · 1.63 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
// eslint.config.js
const jsxA11y = require('eslint-plugin-jsx-a11y');
module.exports = [
{
files: ["**/*.{js,mjs,cjs,jsx}"],
languageOptions: {
ecmaVersion: 2020,
sourceType: "module",
parser: require("@babel/eslint-parser"),
parserOptions: {
requireConfigFile: false,
babelOptions: {
presets: [
require.resolve("@babel/preset-react"),
require.resolve("@babel/preset-env")
]
}
}
},
plugins: {
'jsx-a11y': jsxA11y,
},
rules: {
"no-unused-vars": "warn",
"import/extensions": "off",
"linebreak-style": "off",
"import/prefer-default-export": "off",
"max-len": ["error", 250],
"no-multiple-empty-lines": [
"error",
{
max: 1,
maxEOF: 1
}
],
"no-underscore-dangle": [
"error",
{
allow: ["_d", "_dh", "_h", "_id", "_m", "_n", "_t", "_text"]
}
],
"object-curly-newline": "off",
"jsx-a11y/click-events-have-key-events": "off",
"jsx-a11y/alt-text": "off",
"jsx-a11y/no-autofocus": "off",
"jsx-a11y/no-static-element-interactions": "off",
"jsx-a11y/anchor-is-valid": [
"error",
{
components: ["Link"],
specialLink: ["to", "hrefLeft", "hrefRight"],
aspects: ["noHref", "invalidHref", "preferButton"]
}
]
}
},
{
// Global rules for all files
rules: {
"no-underscore-dangle": "off",
"quotes": "off",
"no-unused-vars": "off",
"max-len": "off",
"no-undef": "off",
}
}
];