-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.eslintrc.cjs
97 lines (97 loc) · 2.91 KB
/
.eslintrc.cjs
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
91
92
93
94
95
96
97
/** @type {import('eslint').Linter.Config} */
module.exports = {
root: true,
env: {
es6: true,
},
extends: ["eslint:recommended", "next/core-web-vitals", "next/typescript", "prettier"],
parser: "@typescript-eslint/parser",
plugins: ["@typescript-eslint", "react", "unused-imports", "prettier"],
parserOptions: {
tsconfigRootDir: __dirname,
sourceType: "module",
project: "./tsconfig.json",
},
ignorePatterns: [".eslintrc.cjs", "*.mjs", "*.cjs"],
globals: {
vi: true,
},
settings: {
"jsx-a11y": {
polymorphicPropName: "as",
components: {
BodyLong: "p",
BodyShort: "p",
Button: "button",
CheckboxGroup: "fieldset",
Checkbox: "input",
Chips: "ul",
Heading: "h",
Icon: "svg",
IconButton: "button",
Image: "img",
Input: "input",
Link: "a",
List: "ul",
ListItem: "li",
NextImage: "img",
NextLink: "a",
Pagination: "nav",
RadioGroup: "fieldset",
Radio: "input",
Select: "select",
TextField: "input",
Textarea: "textarea",
Tooltip: "button",
},
},
},
rules: {
"no-underscore-dangle": "off",
"import/prefer-default-export": "off",
"react/jsx-no-bind": "off",
"react/no-unescaped-entities": "off",
"prettier/prettier": "error",
"react/react-in-jsx-scope": "off",
"react/jsx-props-no-spreading": "off",
"react/forbid-prop-types": "off",
"object-shorthand": "off",
"no-use-before-define": "off",
"@typescript-eslint/no-use-before-define": "off",
// defaultProps rule to be deprecated on function components
// https://github.com/reactjs/rfcs/pull/107
"react/jsx-pascal-case": [
2,
{
ignore: ["UNSAFE_Combobox"],
},
],
"react/require-default-props": [
"error",
{
ignoreFunctionalComponents: true,
},
],
"unused-imports/no-unused-imports": "error",
"unused-imports/no-unused-vars": [
"warn",
{
vars: "all",
varsIgnorePattern: "^_",
args: "after-used",
argsIgnorePattern: "^_",
},
],
singleQuote: "off",
},
overrides: [
{
// enable the rule specifically for TypeScript files
files: ["*.ts", "*.mts", "*.cts", "*.tsx"],
parserOptions: {
project: "./tsconfig.json",
},
extends: ["next/typescript"],
},
],
};