-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.js
123 lines (123 loc) · 3.2 KB
/
.eslintrc.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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
module.exports = {
parser: "@typescript-eslint/parser",
parserOptions: {
project: "./tsconfig.json",
tsconfigRootDir: __dirname,
sourceType: "module",
},
plugins: ["jest", "@typescript-eslint"],
extends: [
"airbnb",
"plugin:jest/recommended",
"plugin:@typescript-eslint/recommended",
"plugin:react-hooks/recommended",
],
root: true,
env: {
node: true,
jest: true,
browser: true,
},
ignorePatterns: [".eslintrc.js", "out/", "next.config.js", "next-sitemap.js"],
rules: {
// unnecessary in React 17+
"react/react-in-jsx-scope": "off",
"react/jsx-uses-react": "off",
// JSX in TypeScript
"react/jsx-filename-extension": [1, { extensions: [".tsx", ".jsx"] }],
"@typescript-eslint/ban-ts-comment": "off",
"@typescript-eslint/interface-name-prefix": "off",
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
// easier to work with jsx matching indents
"operator-linebreak": [
1,
"before",
{ overrides: { "?": "after", ":": "ignore" } },
],
// we use typescript to check, disabled as eslint not ignoring import type
"import/named": 0,
"no-unused-vars": 0,
// duplicated with eslint, typescript is smarter when imported as type
"@typescript-eslint/no-unused-vars": [
1,
{
vars: "all",
args: "after-used",
argsIgnorePattern:
"^attributes$|^props$|^i$|^k$|^v$|^req$|^res$|^index$|^key$|^sys$",
ignoreRestSiblings: false,
varsIgnorePattern:
"|^from$|^map$|^tap$|^flatMap$|^toArray$|FormattedMessage|logger|Locale|_",
},
],
"import/no-cycle": 0,
"jsx-a11y/no-static-element-interactions": 0,
"jsx-a11y/accessible-emoji": 0,
"jsx-a11y/alt-text": 0,
"no-useless-constructor": 0,
"no-empty-function": [0, { allow: ["constructors"] }],
"comma-dangle": [
1,
{
functions: "never",
},
],
"jsx-a11y/anchor-is-valid": [
0,
{
components: ["Link"],
specialLink: ["to"],
},
],
"prefer-destructuring": 0,
"prefer-rest-params": 0,
"no-nested-ternary": 0,
"import/first": 1,
"func-names": 0,
"no-multi-assign": 0,
"no-unused-expressions": 1,
semi: 2,
"import/no-unresolved": 0,
"import/extensions": 0,
"jsx-a11y/href-no-hash": 0,
quotes: [1, "single"],
"prefer-const": 1,
"no-param-reassign": [
2,
{
props: false,
},
],
"import/no-named-as-default": 0,
"no-underscore-dangle": 0,
"import/prefer-default-export": 1,
"function-paren-newline": 0,
"no-shadow": 0,
"consistent-return": 0,
"no-debugger": 0,
"max-len": [
1,
{
code: 160,
ignoreComments: true,
ignoreStrings: true,
ignoreTemplateLiterals: true,
ignoreRegExpLiterals: true,
},
],
"quote-props": 0,
"no-return-assign": 0,
"jsx-a11y/click-events-have-key-events": 1,
"dot-notation": 0,
"lines-between-class-members": 0,
},
overrides: [
{
files: ["*.test.ts", "*.stories.ts"],
rules: {
"no-console": 0,
},
},
],
};