@@ -4,6 +4,22 @@ const includeDeprecated = !process.env.ESLINT_CONFIG_PRETTIER_NO_DEPRECATED;
4
4
5
5
const specialRule = 0 ;
6
6
7
+ const disableRulesInCoreAndStylistic = (
8
+ corePrefix ,
9
+ stylisticPrefix ,
10
+ regularRules ,
11
+ specialRules
12
+ ) =>
13
+ Object . fromEntries (
14
+ [ corePrefix , "@stylistic/" , `@stylistic/${ stylisticPrefix } /` ] . flatMap (
15
+ ( prefix ) =>
16
+ [
17
+ ...regularRules . map ( ( rule ) => [ rule , "off" ] ) ,
18
+ ...specialRules . map ( ( rule ) => [ rule , specialRule ] ) ,
19
+ ] . map ( ( [ rule , severity ] ) => [ prefix + rule , severity ] )
20
+ )
21
+ ) ;
22
+
7
23
module . exports = {
8
24
rules : {
9
25
// The following rules can be used in some cases. See the README for more
@@ -12,8 +28,6 @@ module.exports = {
12
28
// in the deprecated section below.
13
29
"curly" : specialRule ,
14
30
"no-unexpected-multiline" : specialRule ,
15
- "@typescript-eslint/lines-around-comment" : specialRule ,
16
- "@typescript-eslint/quotes" : specialRule ,
17
31
"babel/quotes" : specialRule ,
18
32
"unicorn/template-indent" : specialRule ,
19
33
"vue/html-self-closing" : specialRule ,
@@ -22,23 +36,30 @@ module.exports = {
22
36
// The rest are rules that you never need to enable when using Prettier.
23
37
"@babel/object-curly-spacing" : "off" ,
24
38
"@babel/semi" : "off" ,
25
- "@typescript-eslint/block-spacing" : "off" ,
26
- "@typescript-eslint/brace-style" : "off" ,
27
- "@typescript-eslint/comma-dangle" : "off" ,
28
- "@typescript-eslint/comma-spacing" : "off" ,
29
- "@typescript-eslint/func-call-spacing" : "off" ,
30
- "@typescript-eslint/indent" : "off" ,
31
- "@typescript-eslint/key-spacing" : "off" ,
32
- "@typescript-eslint/keyword-spacing" : "off" ,
33
- "@typescript-eslint/member-delimiter-style" : "off" ,
34
- "@typescript-eslint/no-extra-parens" : "off" ,
35
- "@typescript-eslint/no-extra-semi" : "off" ,
36
- "@typescript-eslint/object-curly-spacing" : "off" ,
37
- "@typescript-eslint/semi" : "off" ,
38
- "@typescript-eslint/space-before-blocks" : "off" ,
39
- "@typescript-eslint/space-before-function-paren" : "off" ,
40
- "@typescript-eslint/space-infix-ops" : "off" ,
41
- "@typescript-eslint/type-annotation-spacing" : "off" ,
39
+ ...disableRulesInCoreAndStylistic (
40
+ "@typescript-eslint/" ,
41
+ "ts" ,
42
+ [
43
+ "block-spacing" ,
44
+ "brace-style" ,
45
+ "comma-dangle" ,
46
+ "comma-spacing" ,
47
+ "func-call-spacing" ,
48
+ "indent" ,
49
+ "key-spacing" ,
50
+ "keyword-spacing" ,
51
+ "member-delimiter-style" ,
52
+ "no-extra-parens" ,
53
+ "no-extra-semi" ,
54
+ "object-curly-spacing" ,
55
+ "semi" ,
56
+ "space-before-blocks" ,
57
+ "space-before-function-paren" ,
58
+ "space-infix-ops" ,
59
+ "type-annotation-spacing" ,
60
+ ] ,
61
+ [ "lines-around-comment" , "quotes" ]
62
+ ) ,
42
63
"babel/object-curly-spacing" : "off" ,
43
64
"babel/semi" : "off" ,
44
65
"flowtype/boolean-style" : "off" ,
@@ -52,21 +73,28 @@ module.exports = {
52
73
"flowtype/space-before-generic-bracket" : "off" ,
53
74
"flowtype/space-before-type-colon" : "off" ,
54
75
"flowtype/union-intersection-spacing" : "off" ,
55
- "react/jsx-child-element-spacing" : "off" ,
56
- "react/jsx-closing-bracket-location" : "off" ,
57
- "react/jsx-closing-tag-location" : "off" ,
58
- "react/jsx-curly-newline" : "off" ,
59
- "react/jsx-curly-spacing" : "off" ,
60
- "react/jsx-equals-spacing" : "off" ,
61
- "react/jsx-first-prop-new-line" : "off" ,
62
- "react/jsx-indent" : "off" ,
63
- "react/jsx-indent-props" : "off" ,
64
- "react/jsx-max-props-per-line" : "off" ,
65
- "react/jsx-newline" : "off" ,
66
- "react/jsx-one-expression-per-line" : "off" ,
67
- "react/jsx-props-no-multi-spaces" : "off" ,
68
- "react/jsx-tag-spacing" : "off" ,
69
- "react/jsx-wrap-multilines" : "off" ,
76
+ ...disableRulesInCoreAndStylistic (
77
+ "react/" ,
78
+ "jsx" ,
79
+ [
80
+ "jsx-child-element-spacing" ,
81
+ "jsx-closing-bracket-location" ,
82
+ "jsx-closing-tag-location" ,
83
+ "jsx-curly-newline" ,
84
+ "jsx-curly-spacing" ,
85
+ "jsx-equals-spacing" ,
86
+ "jsx-first-prop-new-line" ,
87
+ "jsx-indent" ,
88
+ "jsx-indent-props" ,
89
+ "jsx-max-props-per-line" ,
90
+ "jsx-newline" ,
91
+ "jsx-one-expression-per-line" ,
92
+ "jsx-props-no-multi-spaces" ,
93
+ "jsx-tag-spacing" ,
94
+ "jsx-wrap-multilines" ,
95
+ ] ,
96
+ [ ]
97
+ ) ,
70
98
"standard/array-bracket-even-spacing" : "off" ,
71
99
"standard/computed-property-even-spacing" : "off" ,
72
100
"standard/object-curly-even-spacing" : "off" ,
@@ -144,70 +172,78 @@ module.exports = {
144
172
145
173
// Deprecated since version 8.53.0.
146
174
// https://eslint.org/blog/2023/10/deprecating-formatting-rules/
147
- "array-bracket-newline" : "off" ,
148
- "array-bracket-spacing" : "off" ,
149
- "array-element-newline" : "off" ,
150
- "arrow-parens" : "off" ,
151
- "arrow-spacing" : "off" ,
152
- "block-spacing" : "off" ,
153
- "brace-style" : "off" ,
154
- "comma-dangle" : "off" ,
155
- "comma-spacing" : "off" ,
156
- "comma-style" : "off" ,
157
- "computed-property-spacing" : "off" ,
158
- "dot-location" : "off" ,
159
- "eol-last" : "off" ,
160
- "func-call-spacing" : "off" ,
161
- "function-call-argument-newline" : "off" ,
162
- "function-paren-newline" : "off" ,
163
- "generator-star-spacing" : "off" ,
164
- "implicit-arrow-linebreak" : "off" ,
165
- "indent" : "off" ,
166
- "jsx-quotes" : "off" ,
167
- "key-spacing" : "off" ,
168
- "keyword-spacing" : "off" ,
169
- "linebreak-style" : "off" ,
170
- "lines-around-comment" : specialRule ,
171
- "max-len" : specialRule ,
172
- "max-statements-per-line" : "off" ,
173
- "multiline-ternary" : "off" ,
174
- "new-parens" : "off" ,
175
- "newline-per-chained-call" : "off" ,
176
- "no-confusing-arrow" : specialRule ,
177
- "no-extra-parens" : "off" ,
178
- "no-extra-semi" : "off" ,
179
- "no-floating-decimal" : "off" ,
180
- "no-mixed-operators" : specialRule ,
181
- "no-mixed-spaces-and-tabs" : "off" ,
182
- "no-multi-spaces" : "off" ,
183
- "no-multiple-empty-lines" : "off" ,
184
- "no-tabs" : specialRule ,
185
- "no-trailing-spaces" : "off" ,
186
- "no-whitespace-before-property" : "off" ,
187
- "nonblock-statement-body-position" : "off" ,
188
- "object-curly-newline" : "off" ,
189
- "object-curly-spacing" : "off" ,
190
- "object-property-newline" : "off" ,
191
- "one-var-declaration-per-line" : "off" ,
192
- "operator-linebreak" : "off" ,
193
- "padded-blocks" : "off" ,
194
- "quote-props" : "off" ,
195
- "quotes" : specialRule ,
196
- "rest-spread-spacing" : "off" ,
197
- "semi" : "off" ,
198
- "semi-spacing" : "off" ,
199
- "semi-style" : "off" ,
200
- "space-before-blocks" : "off" ,
201
- "space-before-function-paren" : "off" ,
202
- "space-in-parens" : "off" ,
203
- "space-infix-ops" : "off" ,
204
- "space-unary-ops" : "off" ,
205
- "switch-colon-spacing" : "off" ,
206
- "template-curly-spacing" : "off" ,
207
- "template-tag-spacing" : "off" ,
208
- "wrap-iife" : "off" ,
209
- "wrap-regex" : "off" ,
210
- "yield-star-spacing" : "off" ,
175
+ ...disableRulesInCoreAndStylistic (
176
+ "" ,
177
+ "js" ,
178
+ [
179
+ "array-bracket-newline" ,
180
+ "array-bracket-spacing" ,
181
+ "array-element-newline" ,
182
+ "arrow-parens" ,
183
+ "arrow-spacing" ,
184
+ "block-spacing" ,
185
+ "brace-style" ,
186
+ "comma-dangle" ,
187
+ "comma-spacing" ,
188
+ "comma-style" ,
189
+ "computed-property-spacing" ,
190
+ "dot-location" ,
191
+ "eol-last" ,
192
+ "func-call-spacing" ,
193
+ "function-call-argument-newline" ,
194
+ "function-paren-newline" ,
195
+ "generator-star-spacing" ,
196
+ "implicit-arrow-linebreak" ,
197
+ "indent" ,
198
+ "jsx-quotes" ,
199
+ "key-spacing" ,
200
+ "keyword-spacing" ,
201
+ "linebreak-style" ,
202
+ "max-statements-per-line" ,
203
+ "multiline-ternary" ,
204
+ "new-parens" ,
205
+ "newline-per-chained-call" ,
206
+ "no-extra-parens" ,
207
+ "no-extra-semi" ,
208
+ "no-floating-decimal" ,
209
+ "no-mixed-spaces-and-tabs" ,
210
+ "no-multi-spaces" ,
211
+ "no-multiple-empty-lines" ,
212
+ "no-trailing-spaces" ,
213
+ "no-whitespace-before-property" ,
214
+ "nonblock-statement-body-position" ,
215
+ "object-curly-newline" ,
216
+ "object-curly-spacing" ,
217
+ "object-property-newline" ,
218
+ "one-var-declaration-per-line" ,
219
+ "operator-linebreak" ,
220
+ "padded-blocks" ,
221
+ "quote-props" ,
222
+ "rest-spread-spacing" ,
223
+ "semi" ,
224
+ "semi-spacing" ,
225
+ "semi-style" ,
226
+ "space-before-blocks" ,
227
+ "space-before-function-paren" ,
228
+ "space-in-parens" ,
229
+ "space-infix-ops" ,
230
+ "space-unary-ops" ,
231
+ "switch-colon-spacing" ,
232
+ "template-curly-spacing" ,
233
+ "template-tag-spacing" ,
234
+ "wrap-iife" ,
235
+ "wrap-regex" ,
236
+ "yield-star-spacing" ,
237
+ ] ,
238
+ [
239
+ "lines-around-comment" ,
240
+ "max-len" ,
241
+ "no-confusing-arrow" ,
242
+ "no-mixed-operators" ,
243
+ "no-tabs" ,
244
+ "quotes" ,
245
+ ]
246
+ ) ,
211
247
212
248
// Deprecated since version 7.0.0.
213
249
// https://github.com/yannickcr/eslint-plugin-react/blob/master/CHANGELOG.md#700---2017-05-06
0 commit comments