eslint-config-prettier 9.0.0 → 9.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/cli.js +5 -3
- package/bin/validators.js +23 -0
- package/index.js +99 -107
- package/package.json +1 -1
package/bin/cli.js
CHANGED
|
@@ -9,9 +9,11 @@ const prettier = require("../prettier");
|
|
|
9
9
|
// Require locally installed eslint, for `npx eslint-config-prettier` support
|
|
10
10
|
// with no local eslint-config-prettier installation.
|
|
11
11
|
const localRequire = (request) =>
|
|
12
|
-
require(
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
require(
|
|
13
|
+
require.resolve(request, {
|
|
14
|
+
paths: [process.cwd(), ...require.resolve.paths("eslint")],
|
|
15
|
+
})
|
|
16
|
+
);
|
|
15
17
|
|
|
16
18
|
let experimentalApi = {};
|
|
17
19
|
try {
|
package/bin/validators.js
CHANGED
|
@@ -48,6 +48,29 @@ module.exports = {
|
|
|
48
48
|
return Boolean(firstOption && firstOption.allowIndentationTabs);
|
|
49
49
|
},
|
|
50
50
|
|
|
51
|
+
"unicorn/template-indent"({ options }) {
|
|
52
|
+
if (options.length === 0) {
|
|
53
|
+
return false;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
const { comments = [], tags = [] } = options[0] || {};
|
|
57
|
+
|
|
58
|
+
return (
|
|
59
|
+
Array.isArray(comments) &&
|
|
60
|
+
Array.isArray(tags) &&
|
|
61
|
+
!(
|
|
62
|
+
comments.includes("GraphQL") ||
|
|
63
|
+
comments.includes("HTML") ||
|
|
64
|
+
tags.includes("css") ||
|
|
65
|
+
tags.includes("graphql") ||
|
|
66
|
+
tags.includes("gql") ||
|
|
67
|
+
tags.includes("html") ||
|
|
68
|
+
tags.includes("markdown") ||
|
|
69
|
+
tags.includes("md")
|
|
70
|
+
)
|
|
71
|
+
);
|
|
72
|
+
},
|
|
73
|
+
|
|
51
74
|
"vue/html-self-closing"({ options }) {
|
|
52
75
|
if (options.length === 0) {
|
|
53
76
|
return false;
|
package/index.js
CHANGED
|
@@ -2,84 +2,24 @@
|
|
|
2
2
|
|
|
3
3
|
const includeDeprecated = !process.env.ESLINT_CONFIG_PRETTIER_NO_DEPRECATED;
|
|
4
4
|
|
|
5
|
+
const specialRule = 0;
|
|
6
|
+
|
|
5
7
|
module.exports = {
|
|
6
8
|
rules: {
|
|
7
9
|
// The following rules can be used in some cases. See the README for more
|
|
8
|
-
// information.
|
|
9
|
-
// script can distinguish them.
|
|
10
|
-
|
|
11
|
-
"
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
"@typescript-eslint/quotes": 0,
|
|
20
|
-
"babel/quotes": 0,
|
|
21
|
-
"vue/html-self-closing": 0,
|
|
22
|
-
"vue/max-len": 0,
|
|
10
|
+
// information. These are marked with `0` instead of `"off"` so that a
|
|
11
|
+
// script can distinguish them. Note that there are a few more of these
|
|
12
|
+
// in the deprecated section below.
|
|
13
|
+
"curly": specialRule,
|
|
14
|
+
"no-unexpected-multiline": specialRule,
|
|
15
|
+
"@typescript-eslint/lines-around-comment": specialRule,
|
|
16
|
+
"@typescript-eslint/quotes": specialRule,
|
|
17
|
+
"babel/quotes": specialRule,
|
|
18
|
+
"unicorn/template-indent": specialRule,
|
|
19
|
+
"vue/html-self-closing": specialRule,
|
|
20
|
+
"vue/max-len": specialRule,
|
|
23
21
|
|
|
24
22
|
// The rest are rules that you never need to enable when using Prettier.
|
|
25
|
-
"array-bracket-newline": "off",
|
|
26
|
-
"array-bracket-spacing": "off",
|
|
27
|
-
"array-element-newline": "off",
|
|
28
|
-
"arrow-parens": "off",
|
|
29
|
-
"arrow-spacing": "off",
|
|
30
|
-
"block-spacing": "off",
|
|
31
|
-
"brace-style": "off",
|
|
32
|
-
"comma-dangle": "off",
|
|
33
|
-
"comma-spacing": "off",
|
|
34
|
-
"comma-style": "off",
|
|
35
|
-
"computed-property-spacing": "off",
|
|
36
|
-
"dot-location": "off",
|
|
37
|
-
"eol-last": "off",
|
|
38
|
-
"func-call-spacing": "off",
|
|
39
|
-
"function-call-argument-newline": "off",
|
|
40
|
-
"function-paren-newline": "off",
|
|
41
|
-
"generator-star-spacing": "off",
|
|
42
|
-
"implicit-arrow-linebreak": "off",
|
|
43
|
-
"indent": "off",
|
|
44
|
-
"jsx-quotes": "off",
|
|
45
|
-
"key-spacing": "off",
|
|
46
|
-
"keyword-spacing": "off",
|
|
47
|
-
"linebreak-style": "off",
|
|
48
|
-
"max-statements-per-line": "off",
|
|
49
|
-
"multiline-ternary": "off",
|
|
50
|
-
"newline-per-chained-call": "off",
|
|
51
|
-
"new-parens": "off",
|
|
52
|
-
"no-extra-parens": "off",
|
|
53
|
-
"no-extra-semi": "off",
|
|
54
|
-
"no-floating-decimal": "off",
|
|
55
|
-
"no-mixed-spaces-and-tabs": "off",
|
|
56
|
-
"no-multi-spaces": "off",
|
|
57
|
-
"no-multiple-empty-lines": "off",
|
|
58
|
-
"no-trailing-spaces": "off",
|
|
59
|
-
"no-whitespace-before-property": "off",
|
|
60
|
-
"nonblock-statement-body-position": "off",
|
|
61
|
-
"object-curly-newline": "off",
|
|
62
|
-
"object-curly-spacing": "off",
|
|
63
|
-
"object-property-newline": "off",
|
|
64
|
-
"one-var-declaration-per-line": "off",
|
|
65
|
-
"operator-linebreak": "off",
|
|
66
|
-
"padded-blocks": "off",
|
|
67
|
-
"quote-props": "off",
|
|
68
|
-
"rest-spread-spacing": "off",
|
|
69
|
-
"semi": "off",
|
|
70
|
-
"semi-spacing": "off",
|
|
71
|
-
"semi-style": "off",
|
|
72
|
-
"space-before-blocks": "off",
|
|
73
|
-
"space-before-function-paren": "off",
|
|
74
|
-
"space-in-parens": "off",
|
|
75
|
-
"space-infix-ops": "off",
|
|
76
|
-
"space-unary-ops": "off",
|
|
77
|
-
"switch-colon-spacing": "off",
|
|
78
|
-
"template-curly-spacing": "off",
|
|
79
|
-
"template-tag-spacing": "off",
|
|
80
|
-
"wrap-iife": "off",
|
|
81
|
-
"wrap-regex": "off",
|
|
82
|
-
"yield-star-spacing": "off",
|
|
83
23
|
"@babel/object-curly-spacing": "off",
|
|
84
24
|
"@babel/semi": "off",
|
|
85
25
|
"@typescript-eslint/block-spacing": "off",
|
|
@@ -172,51 +112,103 @@ module.exports = {
|
|
|
172
112
|
"vue/template-curly-spacing": "off",
|
|
173
113
|
|
|
174
114
|
...(includeDeprecated && {
|
|
115
|
+
// Removed in version 0.10.0.
|
|
116
|
+
// https://eslint.org/docs/latest/rules/space-unary-word-ops
|
|
117
|
+
"space-unary-word-ops": "off",
|
|
118
|
+
|
|
175
119
|
// Removed in version 1.0.0.
|
|
176
|
-
// https://
|
|
120
|
+
// https://github.com/eslint/eslint/issues/1898
|
|
177
121
|
"generator-star": "off",
|
|
178
|
-
// Deprecated since version 4.0.0.
|
|
179
|
-
// https://github.com/eslint/eslint/pull/8286
|
|
180
|
-
"indent-legacy": "off",
|
|
181
|
-
// Removed in version 2.0.0.
|
|
182
|
-
// https://eslint.org/docs/latest/rules/no-arrow-condition
|
|
183
|
-
"no-arrow-condition": "off",
|
|
184
|
-
// Removed in version 1.0.0.
|
|
185
|
-
// https://eslint.org/docs/latest/rules/no-comma-dangle
|
|
186
122
|
"no-comma-dangle": "off",
|
|
187
|
-
// Removed in version 1.0.0.
|
|
188
|
-
// https://eslint.org/docs/latest/rules/no-reserved-keys
|
|
189
123
|
"no-reserved-keys": "off",
|
|
190
|
-
// Removed in version 1.0.0.
|
|
191
|
-
// https://eslint.org/docs/latest/rules/no-space-before-semi
|
|
192
124
|
"no-space-before-semi": "off",
|
|
193
|
-
// Deprecated since version 3.3.0.
|
|
194
|
-
// https://eslint.org/docs/rules/no-spaced-func
|
|
195
|
-
"no-spaced-func": "off",
|
|
196
|
-
// Removed in version 1.0.0.
|
|
197
|
-
// https://eslint.org/docs/latest/rules/no-wrap-func
|
|
198
125
|
"no-wrap-func": "off",
|
|
199
|
-
// Removed in version 1.0.0.
|
|
200
|
-
// https://eslint.org/docs/latest/rules/space-after-function-name
|
|
201
126
|
"space-after-function-name": "off",
|
|
202
|
-
// Removed in version 2.0.0.
|
|
203
|
-
// https://eslint.org/docs/latest/rules/space-after-keywords
|
|
204
|
-
"space-after-keywords": "off",
|
|
205
|
-
// Removed in version 1.0.0.
|
|
206
|
-
// https://eslint.org/docs/latest/rules/space-before-function-parentheses
|
|
207
127
|
"space-before-function-parentheses": "off",
|
|
208
|
-
// Removed in version 2.0.0.
|
|
209
|
-
// https://eslint.org/docs/latest/rules/space-before-keywords
|
|
210
|
-
"space-before-keywords": "off",
|
|
211
|
-
// Removed in version 1.0.0.
|
|
212
|
-
// https://eslint.org/docs/latest/rules/space-in-brackets
|
|
213
128
|
"space-in-brackets": "off",
|
|
129
|
+
|
|
214
130
|
// Removed in version 2.0.0.
|
|
215
|
-
// https://
|
|
131
|
+
// https://github.com/eslint/eslint/issues/5032
|
|
132
|
+
"no-arrow-condition": "off",
|
|
133
|
+
"space-after-keywords": "off",
|
|
134
|
+
"space-before-keywords": "off",
|
|
216
135
|
"space-return-throw-case": "off",
|
|
217
|
-
|
|
218
|
-
//
|
|
219
|
-
|
|
136
|
+
|
|
137
|
+
// Deprecated since version 3.3.0.
|
|
138
|
+
// https://eslint.org/docs/rules/no-spaced-func
|
|
139
|
+
"no-spaced-func": "off",
|
|
140
|
+
|
|
141
|
+
// Deprecated since version 4.0.0.
|
|
142
|
+
// https://github.com/eslint/eslint/pull/8286
|
|
143
|
+
"indent-legacy": "off",
|
|
144
|
+
|
|
145
|
+
// Deprecated since version 8.53.0.
|
|
146
|
+
// 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",
|
|
211
|
+
|
|
220
212
|
// Deprecated since version 7.0.0.
|
|
221
213
|
// https://github.com/yannickcr/eslint-plugin-react/blob/master/CHANGELOG.md#700---2017-05-06
|
|
222
214
|
"react/jsx-space-before-closing": "off",
|