forked from toptal/keycodes
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.eslintrc.json
166 lines (166 loc) · 4.5 KB
/
.eslintrc.json
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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
{
"parser": "@typescript-eslint/parser",
"env": {
"browser": true,
"es2021": true,
"node": true,
"jest": true
},
"extends": [
"next",
"next/core-web-vitals",
"eslint:recommended",
"standard",
"prettier",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:react/recommended"
],
"globals": {
"BASE_API_URL": "readonly",
"BASE_URL": "readonly",
"page": "writable"
},
"parserOptions": {
"ecmaFeatures": {
"jsx": true
},
"ecmaVersion": 12,
"sourceType": "module"
},
"plugins": [
"react",
"@typescript-eslint",
"react-hooks",
"prettier",
"standard",
"import",
"jest"
],
"rules": {
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": ["error"],
"react/react-in-jsx-scope": "off",
"prettier/prettier": "error",
"no-console": "warn",
"jsx-quotes": ["error", "prefer-double"],
"arrow-parens": ["error", "as-needed"],
"react/jsx-uses-react": "error",
"react/jsx-uses-vars": "error",
"react/jsx-key": ["error", { "checkFragmentShorthand": true }],
"react/no-direct-mutation-state": "error",
"react/no-redundant-should-component-update": "error",
"react/no-typos": "error",
"react/no-this-in-sfc": "error",
"react/no-unknown-property": "error",
"react/self-closing-comp": "error",
"react/require-render-return": "error",
"react/void-dom-elements-no-children": "error",
"react/jsx-closing-bracket-location": "error",
"react/jsx-equals-spacing": "error",
"react/jsx-wrap-multilines": [
"error",
{
"declaration": "parens-new-line",
"assignment": "parens-new-line",
"return": "parens-new-line",
"arrow": "parens-new-line",
"logical": "parens-new-line",
"condition": "parens",
"prop": "parens"
}
],
"react/jsx-tag-spacing": "error",
"react/jsx-props-no-multi-spaces": "error",
"react/jsx-curly-brace-presence": "error",
"react/jsx-max-props-per-line": [
"error",
{
"maximum": 1,
"when": "multiline"
}
],
"space-in-parens": ["error", "never"],
"import/order": [
"error",
{
"newlines-between": "always",
"groups": [
"builtin",
"external",
"unknown",
"parent",
"sibling",
"index"
],
"pathGroups": [
{
"pattern": "~/{components,pages}/**",
"group": "unknown",
"position": "after"
}
]
}
],
"import/no-cycle": "error",
"import/first": "error",
"import/no-useless-path-segments": "error",
"import/no-duplicates": "error",
"import/no-unresolved": "error",
"import/newline-after-import": "error",
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "warn",
"space-before-blocks": "error",
"comma-spacing": ["error", { "before": false, "after": true }],
"arrow-spacing": ["error", { "before": true, "after": true }],
"keyword-spacing": ["error", { "before": true, "after": true }],
"no-template-curly-in-string": "off",
"standard/no-callback-literal": "off",
"no-prototype-builtins": "off",
"import/no-webpack-loader-syntax": "off", // to suppress warnings related to using svg-react-loader
"curly": ["error", "all"],
"padding-line-between-statements": [
"error",
{ "blankLine": "always", "prev": "*", "next": "return" },
{ "blankLine": "always", "prev": ["const", "let"], "next": "*" },
{
"blankLine": "any",
"prev": ["const", "let"],
"next": ["const", "let"]
},
{
"blankLine": "always",
"prev": "multiline-expression",
"next": "multiline-expression"
}
],
"@typescript-eslint/no-var-requires": "off",
"jest/no-disabled-tests": "warn",
"jest/no-focused-tests": "error",
"jest/no-identical-title": "error",
"jest/prefer-to-have-length": "warn",
"jest/valid-expect": "error",
"jest/lowercase-name": [
"error",
{
"ignore": ["describe"]
}
]
},
"settings": {
"react": {
"version": "detect"
},
"import/resolver": {
"webpack": true,
"alias": [["~", "./"]],
"typescript": {
"alwaysTryTypes": true,
"project": ["./tsconfig.json", "./test/tsconfig.json"]
}
},
"import/parsers": {
"@typescript-eslint/parser": [".ts", ".tsx"]
}
}
}