-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy path.eslintrc
183 lines (183 loc) · 4.62 KB
/
.eslintrc
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
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
{
"parser": "@typescript-eslint/parser", // Specifies the ESLint parser
"parserOptions": {
"project": "./tsconfig.json",
// Allows for the parsing of modern ECMAScript features
// "ecmaVersion": 2020, // TODO: rm if not needed
"ecmaVersion": 2018, // Allows for the parsing of modern ECMAScript features
"sourceType": "module", // Allows for the use of imports
"jsx": true,
"import/resolver": {
"node": {
"paths": ["src"],
"extensions": [".js", ".jsx", ".ts", ".tsx"]
}
},
"ecmaFeatures": {
"jsx": true // Allows for the parsing of JSX
}
},
"settings": {
// "ecmascript": 6, // TODO: rm if not needed
"react": {
// Tells eslint-plugin-react to automatically detect the version of React
"version": "detect"
}
},
"extends": [
"airbnb-typescript",
"airbnb/hooks",
"react-app",
"prettier/react",
"plugin:jest/recommended",
"plugin:react/recommended",
"plugin:@typescript-eslint/recommended",
// Uses eslint-config-prettier to disable ESLint rules from
// @typescript-eslint/eslint-plugin that would conflict with prettier
"prettier/@typescript-eslint",
// Enables eslint-plugin-prettier and eslint-config-prettier. This will
// display prettier errors as ESLint errors. Make sure this is always the
// last configuration in the extends array.
"plugin:prettier/recommended"
],
"ignorePatterns": ["scratch", "src/serviceWorker.ts", "build"],
"rules": {
"array-bracket-newline": [
"error",
{
"multiline": true
}
],
"comma-dangle": ["error", "only-multiline"],
"comma-spacing": "error",
"comma-style": ["error", "last"],
"dot-location": ["error", "property"],
"new-cap": ["error", { "newIsCapExceptions": ["jsPDF"] }],
"no-multi-spaces": "error",
"no-multiple-empty-lines": [
"error",
{
"max": 1,
"maxEOF": 1,
"maxBOF": 0
}
],
"no-whitespace-before-property": "error",
"no-trailing-spaces": "error",
"object-curly-newline": [
"error",
{
"consistent": true
}
],
"object-curly-spacing": ["error", "always"],
"object-property-newline": [
"error",
{
"allowAllPropertiesOnSameLine": true
}
],
"one-var-declaration-per-line": ["error", "initializations"],
"operator-linebreak": ["error", "after"],
"padded-blocks": ["error", "never"],
"padding-line-between-statements": [
"error",
{
"blankLine": "always",
"prev": "multiline-block-like",
"next": ["multiline-block-like"]
},
{
"blankLine": "never",
"prev": "var",
"next": "var"
},
{
"blankLine": "always",
"prev": "var",
"next": "block-like"
},
{
"blankLine": "always",
"prev": "*",
"next": "return"
},
{
"blankLine": "always",
"prev": "*",
"next": "function"
},
{
"blankLine": "always",
"prev": "function",
"next": "*"
},
{
"blankLine": "never",
"prev": "*",
"next": "empty"
},
{
"blankLine": "always",
"prev": "directive",
"next": "*"
}
],
"prettier/prettier": [
"error",
{
"singleQuote": true,
"printWidth": 80,
"trailingComma": "es5"
}
],
// CRED: https://bit.ly/2HtgMDY ...if it doesn't work, try:
// https://bit.ly/2HtdGzT
"import/no-extraneous-dependencies": [
"error",
{
"devDependencies": true,
"packageDir": "./"
}
],
"quote-props": ["error", "as-needed"],
"jsx-quotes": ["error", "prefer-double"],
"space-before-blocks": "error",
"space-before-function-paren": [
"error",
{
"anonymous": "never",
"named": "never",
"asyncArrow": "always"
}
],
"space-unary-ops": "error",
"react/jsx-filename-extension": [
1,
{
"extensions": [".js", ".jsx", ".ts", ".tsx"]
}
],
"react/no-danger": 0,
"no-underscore-dangle": 0,
"react/prop-types": 0,
"react/jsx-props-no-spreading": 0,
"react/no-unescaped-entities": [
"error",
{
"forbid": [">", "}"]
}
],
"react/jsx-wrap-multilines": [
0,
{
"prop": "parens-new-line"
}
],
"import/imports-first": ["error", "absolute-first"],
"import/newline-after-import": "error",
"import/extensions": 0,
"import/prefer-default-export": 0,
"@typescript-eslint/no-unused-vars": ["error"]
}
}