eslint-config-airbnb-extended 0.9.3 → 0.10.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/dist/@types/index.d.ts +8 -7
- package/dist/configs/base/config.js +2 -0
- package/dist/configs/base/configExtended.js +1 -2
- package/dist/configs/base/recommended.js +2 -0
- package/dist/configs/base/typescript.js +2 -0
- package/dist/configs/react/config.js +8 -6
- package/dist/configs/react/configExtended.js +9 -0
- package/dist/configs/react/recommended.js +15 -5
- package/dist/configs/typescript/config.js +4 -0
- package/dist/helpers/getStylisticLegacyConfig.js +26 -0
- package/dist/index.js +1 -1
- package/dist/plugins/index.js +3 -0
- package/dist/plugins/stylisticPlugin.js +13 -0
- package/dist/rules/index.js +1 -1
- package/dist/rules/{react.js → react/react.js} +4 -4
- package/dist/rules/react/reactStylistic.js +93 -0
- package/dist/rules/style.js +1 -1
- package/dist/rules/stylistic.js +232 -237
- package/dist/rules/stylisticPlus.js +14 -0
- package/dist/rules/typescript/typescriptBase.js +4 -1
- package/dist/rules/typescript/typescriptEslint.js +0 -61
- package/dist/rules/typescript/typescriptStylistic.js +147 -0
- package/dist/rules/typescript/typescriptStylisticPlus.js +14 -0
- package/package.json +10 -5
- /package/dist/rules/{react-hooks.js → react/reactHooks.js} +0 -0
- /package/dist/rules/{react-jsx-a11y.js → react/reactJsxA11y.js} +0 -0
- /package/dist/rules/{reactStrict.js → react/reactStrict.js} +0 -0
package/dist/rules/stylistic.js
CHANGED
|
@@ -1,37 +1,45 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.deprecatedStylisticRules = void 0;
|
|
3
4
|
const stylisticRules = {
|
|
4
5
|
name: 'airbnb/config/stylistic',
|
|
5
6
|
rules: {
|
|
6
7
|
// enforce line breaks after opening and before closing array brackets
|
|
7
|
-
// https://eslint.
|
|
8
|
-
|
|
9
|
-
'array-bracket-newline': ['off', 'consistent'], // object option alternative: { multiline: true, minItems: 3 }
|
|
8
|
+
// https://eslint.style/rules/js/array-bracket-newline
|
|
9
|
+
'@stylistic/array-bracket-newline': 'off',
|
|
10
10
|
// enforce spacing inside array brackets
|
|
11
|
-
|
|
11
|
+
// https://eslint.style/rules/js/array-bracket-spacing
|
|
12
|
+
'@stylistic/array-bracket-spacing': ['error', 'never'],
|
|
12
13
|
// enforce line breaks between array elements
|
|
13
|
-
// https://eslint.
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
// https://eslint.style/rules/js/array-element-newline
|
|
15
|
+
'@stylistic/array-element-newline': 'off',
|
|
16
|
+
// require parens in arrow function arguments
|
|
17
|
+
// https://eslint.style/rules/js/arrow-parens
|
|
18
|
+
'@stylistic/arrow-parens': ['error', 'always'],
|
|
19
|
+
// require space before/after arrow function's arrow
|
|
20
|
+
// https://eslint.style/rules/js/arrow-spacing
|
|
21
|
+
'@stylistic/arrow-spacing': [
|
|
22
|
+
'error',
|
|
17
23
|
{
|
|
18
|
-
|
|
19
|
-
|
|
24
|
+
before: true,
|
|
25
|
+
after: true,
|
|
20
26
|
},
|
|
21
27
|
],
|
|
22
28
|
// enforce spacing inside single-line blocks
|
|
23
|
-
// https://eslint.
|
|
24
|
-
'block-spacing': ['error', 'always'],
|
|
29
|
+
// https://eslint.style/rules/js/block-spacing
|
|
30
|
+
'@stylistic/block-spacing': ['error', 'always'],
|
|
25
31
|
// enforce one true brace style
|
|
26
|
-
|
|
32
|
+
// https://eslint.style/rules/js/brace-style
|
|
33
|
+
'@stylistic/brace-style': [
|
|
27
34
|
'error',
|
|
28
35
|
'1tbs',
|
|
29
36
|
{
|
|
30
|
-
allowSingleLine:
|
|
37
|
+
allowSingleLine: false,
|
|
31
38
|
},
|
|
32
39
|
],
|
|
33
40
|
// require trailing commas in multiline object literals
|
|
34
|
-
|
|
41
|
+
// https://eslint.style/rules/js/comma-dangle
|
|
42
|
+
'@stylistic/comma-dangle': [
|
|
35
43
|
'error',
|
|
36
44
|
{
|
|
37
45
|
arrays: 'always-multiline',
|
|
@@ -39,10 +47,13 @@ const stylisticRules = {
|
|
|
39
47
|
imports: 'always-multiline',
|
|
40
48
|
exports: 'always-multiline',
|
|
41
49
|
functions: 'always-multiline',
|
|
50
|
+
importAttributes: 'never',
|
|
51
|
+
dynamicImports: 'never',
|
|
42
52
|
},
|
|
43
53
|
],
|
|
44
54
|
// enforce spacing before and after comma
|
|
45
|
-
|
|
55
|
+
// https://eslint.style/rules/js/comma-spacing
|
|
56
|
+
'@stylistic/comma-spacing': [
|
|
46
57
|
'error',
|
|
47
58
|
{
|
|
48
59
|
before: false,
|
|
@@ -50,65 +61,52 @@ const stylisticRules = {
|
|
|
50
61
|
},
|
|
51
62
|
],
|
|
52
63
|
// enforce one true comma style
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
FunctionDeclaration: false,
|
|
63
|
-
FunctionExpression: false,
|
|
64
|
-
ImportDeclaration: false,
|
|
65
|
-
ObjectExpression: false,
|
|
66
|
-
ObjectPattern: false,
|
|
67
|
-
VariableDeclaration: false,
|
|
68
|
-
NewExpression: false,
|
|
69
|
-
},
|
|
64
|
+
// https://eslint.style/rules/js/comma-style
|
|
65
|
+
'@stylistic/comma-style': ['error', 'last'],
|
|
66
|
+
// disallow padding inside computed properties
|
|
67
|
+
// https://eslint.style/rules/js/computed-property-spacing
|
|
68
|
+
'@stylistic/computed-property-spacing': [
|
|
69
|
+
'error',
|
|
70
|
+
'never',
|
|
71
|
+
{
|
|
72
|
+
enforceForClassMembers: true,
|
|
70
73
|
},
|
|
71
74
|
],
|
|
72
|
-
//
|
|
73
|
-
|
|
75
|
+
// enforces consistent newlines before or after dots
|
|
76
|
+
// https://eslint.style/rules/js/dot-location
|
|
77
|
+
'@stylistic/dot-location': ['error', 'property'],
|
|
74
78
|
// enforce newline at the end of file, with no multiple empty lines
|
|
75
|
-
|
|
79
|
+
// https://eslint.style/rules/js/eol-last
|
|
80
|
+
'@stylistic/eol-last': ['error', 'always'],
|
|
81
|
+
// enforce line breaks between arguments of a function call.
|
|
82
|
+
// https://eslint.style/rules/js/function-call-argument-newline
|
|
83
|
+
'@stylistic/function-call-argument-newline': ['error', 'consistent'],
|
|
76
84
|
// enforce spacing between functions and their invocations
|
|
77
|
-
// https://eslint.
|
|
78
|
-
'
|
|
79
|
-
// https://eslint.org/docs/latest/rules/function-call-argument-newline
|
|
80
|
-
'function-call-argument-newline': ['error', 'consistent'],
|
|
85
|
+
// https://eslint.style/rules/js/function-call-spacing
|
|
86
|
+
'@stylistic/function-call-spacing': ['error', 'never'],
|
|
81
87
|
// require line breaks inside function parentheses if there are line breaks between parameters
|
|
82
|
-
// https://eslint.
|
|
83
|
-
'function-paren-newline': ['error', 'multiline-arguments'],
|
|
88
|
+
// https://eslint.style/rules/js/function-paren-newline
|
|
89
|
+
'@stylistic/function-paren-newline': ['error', 'multiline-arguments'],
|
|
90
|
+
// enforce the spacing around the * in generator functions
|
|
91
|
+
// https://eslint.style/rules/js/generator-star-spacing
|
|
92
|
+
'@stylistic/generator-star-spacing': [
|
|
93
|
+
'error',
|
|
94
|
+
{
|
|
95
|
+
before: false,
|
|
96
|
+
after: true,
|
|
97
|
+
anonymous: 'after',
|
|
98
|
+
method: 'after',
|
|
99
|
+
},
|
|
100
|
+
],
|
|
84
101
|
// Enforce the location of arrow function bodies with implicit returns
|
|
85
|
-
// https://eslint.
|
|
86
|
-
'implicit-arrow-linebreak': ['error', 'beside'],
|
|
102
|
+
// https://eslint.style/rules/js/implicit-arrow-linebreak
|
|
103
|
+
'@stylistic/implicit-arrow-linebreak': ['error', 'beside'],
|
|
87
104
|
// this option sets a specific tab width for your code
|
|
88
|
-
// https://eslint.
|
|
89
|
-
indent: [
|
|
105
|
+
// https://eslint.style/rules/js/indent
|
|
106
|
+
'@stylistic/indent': [
|
|
90
107
|
'error',
|
|
91
108
|
2,
|
|
92
109
|
{
|
|
93
|
-
SwitchCase: 1,
|
|
94
|
-
VariableDeclarator: 1,
|
|
95
|
-
outerIIFEBody: 1,
|
|
96
|
-
// MemberExpression: null,
|
|
97
|
-
FunctionDeclaration: {
|
|
98
|
-
parameters: 1,
|
|
99
|
-
body: 1,
|
|
100
|
-
},
|
|
101
|
-
FunctionExpression: {
|
|
102
|
-
parameters: 1,
|
|
103
|
-
body: 1,
|
|
104
|
-
},
|
|
105
|
-
CallExpression: {
|
|
106
|
-
arguments: 1,
|
|
107
|
-
},
|
|
108
|
-
ArrayExpression: 1,
|
|
109
|
-
ObjectExpression: 1,
|
|
110
|
-
ImportDeclaration: 1,
|
|
111
|
-
flatTernaryExpressions: false,
|
|
112
110
|
// list derived from https://github.com/benjamn/ast-types/blob/HEAD/def/jsx.js
|
|
113
111
|
ignoredNodes: [
|
|
114
112
|
'JSXElement',
|
|
@@ -128,14 +126,41 @@ const stylisticRules = {
|
|
|
128
126
|
'JSXEmptyExpression',
|
|
129
127
|
'JSXSpreadChild',
|
|
130
128
|
],
|
|
129
|
+
SwitchCase: 1,
|
|
130
|
+
VariableDeclarator: 1,
|
|
131
|
+
outerIIFEBody: 1,
|
|
132
|
+
MemberExpression: 1,
|
|
133
|
+
FunctionDeclaration: {
|
|
134
|
+
parameters: 1,
|
|
135
|
+
body: 1,
|
|
136
|
+
},
|
|
137
|
+
FunctionExpression: {
|
|
138
|
+
parameters: 1,
|
|
139
|
+
body: 1,
|
|
140
|
+
},
|
|
141
|
+
StaticBlock: {
|
|
142
|
+
body: 1,
|
|
143
|
+
},
|
|
144
|
+
CallExpression: {
|
|
145
|
+
arguments: 1,
|
|
146
|
+
},
|
|
147
|
+
ArrayExpression: 1,
|
|
148
|
+
ObjectExpression: 1,
|
|
149
|
+
ImportDeclaration: 1,
|
|
150
|
+
flatTernaryExpressions: false,
|
|
151
|
+
offsetTernaryExpressions: false,
|
|
152
|
+
offsetTernaryExpressionsOffsetCallExpressions: true,
|
|
131
153
|
ignoreComments: false,
|
|
154
|
+
tabLength: 2,
|
|
132
155
|
},
|
|
133
156
|
],
|
|
134
157
|
// specify whether double or single quotes should be used in JSX attributes
|
|
135
|
-
// https://eslint.
|
|
136
|
-
|
|
158
|
+
// https://eslint.style/rules/js/jsx-quotes
|
|
159
|
+
// Off due to react rule
|
|
160
|
+
'@stylistic/jsx-quotes': 'off',
|
|
137
161
|
// enforces spacing between keys and values in object literal properties
|
|
138
|
-
|
|
162
|
+
// https://eslint.style/rules/js/key-spacing
|
|
163
|
+
'@stylistic/key-spacing': [
|
|
139
164
|
'error',
|
|
140
165
|
{
|
|
141
166
|
beforeColon: false,
|
|
@@ -143,46 +168,27 @@ const stylisticRules = {
|
|
|
143
168
|
},
|
|
144
169
|
],
|
|
145
170
|
// require a space before & after certain keywords
|
|
146
|
-
|
|
171
|
+
// https://eslint.style/rules/js/keyword-spacing
|
|
172
|
+
'@stylistic/keyword-spacing': [
|
|
147
173
|
'error',
|
|
148
174
|
{
|
|
149
175
|
before: true,
|
|
150
176
|
after: true,
|
|
151
|
-
overrides: {
|
|
152
|
-
return: { after: true },
|
|
153
|
-
throw: { after: true },
|
|
154
|
-
case: { after: true },
|
|
155
|
-
},
|
|
156
|
-
},
|
|
157
|
-
],
|
|
158
|
-
// enforce position of line comments
|
|
159
|
-
// https://eslint.org/docs/latest/rules/line-comment-position
|
|
160
|
-
// TODO: enable?
|
|
161
|
-
'line-comment-position': [
|
|
162
|
-
'off',
|
|
163
|
-
{
|
|
164
|
-
position: 'above',
|
|
165
|
-
ignorePattern: '',
|
|
166
|
-
applyDefaultPatterns: true,
|
|
177
|
+
overrides: {},
|
|
167
178
|
},
|
|
168
179
|
],
|
|
180
|
+
// enforce the position of line comments
|
|
181
|
+
// https://eslint.style/rules/js/line-comment-position
|
|
182
|
+
'@stylistic/line-comment-position': 'off',
|
|
169
183
|
// disallow mixed 'LF' and 'CRLF' as linebreaks
|
|
170
|
-
// https://eslint.
|
|
171
|
-
'linebreak-style': ['error', 'unix'],
|
|
184
|
+
// https://eslint.style/rules/js/linebreak-style
|
|
185
|
+
'@stylistic/linebreak-style': ['error', 'unix'],
|
|
172
186
|
// enforces empty lines around comments
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
// https://eslint.org/docs/latest/rules/lines-around-directive
|
|
176
|
-
'lines-around-directive': [
|
|
177
|
-
'error',
|
|
178
|
-
{
|
|
179
|
-
before: 'always',
|
|
180
|
-
after: 'always',
|
|
181
|
-
},
|
|
182
|
-
],
|
|
187
|
+
// https://eslint.style/rules/js/lines-around-comment
|
|
188
|
+
'@stylistic/lines-around-comment': 'off',
|
|
183
189
|
// require or disallow an empty line between class members
|
|
184
|
-
// https://eslint.
|
|
185
|
-
'lines-between-class-members': [
|
|
190
|
+
// https://eslint.style/rules/js/lines-between-class-members
|
|
191
|
+
'@stylistic/lines-between-class-members': [
|
|
186
192
|
'error',
|
|
187
193
|
'always',
|
|
188
194
|
{
|
|
@@ -190,48 +196,61 @@ const stylisticRules = {
|
|
|
190
196
|
},
|
|
191
197
|
],
|
|
192
198
|
// specify the maximum length of a line in your program
|
|
193
|
-
// https://eslint.
|
|
194
|
-
'max-len': [
|
|
199
|
+
// https://eslint.style/rules/js/max-len
|
|
200
|
+
'@stylistic/max-len': [
|
|
195
201
|
'error',
|
|
196
|
-
100,
|
|
197
|
-
2,
|
|
198
202
|
{
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
ignoreRegExpLiterals: true,
|
|
202
|
-
ignoreStrings: true,
|
|
203
|
-
ignoreTemplateLiterals: true,
|
|
203
|
+
code: 100,
|
|
204
|
+
tabWidth: 2,
|
|
204
205
|
},
|
|
205
206
|
],
|
|
206
207
|
// restrict the number of statements per line
|
|
207
|
-
// https://eslint.
|
|
208
|
-
'max-statements-per-line': [
|
|
208
|
+
// https://eslint.style/rules/js/max-statements-per-line
|
|
209
|
+
'@stylistic/max-statements-per-line': [
|
|
210
|
+
'error',
|
|
211
|
+
{
|
|
212
|
+
max: 1,
|
|
213
|
+
},
|
|
214
|
+
],
|
|
209
215
|
// enforce a particular style for multiline comments
|
|
210
|
-
// https://eslint.
|
|
211
|
-
'multiline-comment-style':
|
|
216
|
+
// https://eslint.style/rules/js/multiline-comment-style
|
|
217
|
+
'@stylistic/multiline-comment-style': 'off',
|
|
212
218
|
// require multiline ternary
|
|
213
|
-
// https://eslint.
|
|
214
|
-
|
|
215
|
-
'multiline-ternary': ['off', 'never'],
|
|
219
|
+
// https://eslint.style/rules/js/multiline-ternary
|
|
220
|
+
'@stylistic/multiline-ternary': 'off',
|
|
216
221
|
// disallow the omission of parentheses when invoking a constructor with no arguments
|
|
217
|
-
// https://eslint.
|
|
218
|
-
'new-parens': 'error',
|
|
219
|
-
// allow/disallow an empty newline after var statement
|
|
220
|
-
'newline-after-var': 'off',
|
|
221
|
-
// https://eslint.org/docs/latest/rules/newline-before-return
|
|
222
|
-
'newline-before-return': 'off',
|
|
222
|
+
// https://eslint.style/rules/js/new-parens
|
|
223
|
+
'@stylistic/new-parens': 'error',
|
|
223
224
|
// enforces new line after each method call in the chain to make it
|
|
224
225
|
// more readable and easy to maintain
|
|
225
|
-
// https://eslint.
|
|
226
|
-
'newline-per-chained-call': [
|
|
226
|
+
// https://eslint.style/rules/js/newline-per-chained-call
|
|
227
|
+
'@stylistic/newline-per-chained-call': [
|
|
227
228
|
'error',
|
|
228
229
|
{
|
|
229
230
|
ignoreChainWithDepth: 4,
|
|
230
231
|
},
|
|
231
232
|
],
|
|
233
|
+
// disallow arrow functions where they could be confused with comparisons
|
|
234
|
+
// https://eslint.style/rules/js/no-confusing-arrow
|
|
235
|
+
'@stylistic/no-confusing-arrow': [
|
|
236
|
+
'error',
|
|
237
|
+
{
|
|
238
|
+
allowParens: true,
|
|
239
|
+
onlyOneSimpleParam: false,
|
|
240
|
+
},
|
|
241
|
+
],
|
|
242
|
+
// disallow unnecessary parentheses
|
|
243
|
+
// https://eslint.style/rules/js/no-extra-parens
|
|
244
|
+
'@stylistic/no-extra-parens': 'off',
|
|
245
|
+
// disallow unnecessary semicolons
|
|
246
|
+
// https://eslint.style/rules/js/no-extra-semi
|
|
247
|
+
'@stylistic/no-extra-semi': 'error',
|
|
248
|
+
// disallow the use of leading or trailing decimal points in numeric literals
|
|
249
|
+
// https://eslint.style/rules/js/no-floating-decimal
|
|
250
|
+
'@stylistic/no-floating-decimal': 'error',
|
|
232
251
|
// disallow un-paren'd mixes of different operators
|
|
233
|
-
// https://eslint.
|
|
234
|
-
'no-mixed-operators': [
|
|
252
|
+
// https://eslint.style/rules/js/no-mixed-operators
|
|
253
|
+
'@stylistic/no-mixed-operators': [
|
|
235
254
|
'error',
|
|
236
255
|
{
|
|
237
256
|
// the list of arithmetic groups disallows mixing `%` and `**`
|
|
@@ -251,18 +270,19 @@ const stylisticRules = {
|
|
|
251
270
|
},
|
|
252
271
|
],
|
|
253
272
|
// disallow mixed spaces and tabs for indentation
|
|
254
|
-
|
|
273
|
+
// https://eslint.style/rules/js/no-mixed-spaces-and-tabs
|
|
274
|
+
'@stylistic/no-mixed-spaces-and-tabs': 'error',
|
|
255
275
|
// disallow use of multiple spaces
|
|
256
|
-
// https://eslint.
|
|
257
|
-
'no-multi-spaces': [
|
|
276
|
+
// https://eslint.style/rules/js/no-multi-spaces
|
|
277
|
+
'@stylistic/no-multi-spaces': [
|
|
258
278
|
'error',
|
|
259
279
|
{
|
|
260
280
|
ignoreEOLComments: false,
|
|
261
281
|
},
|
|
262
282
|
],
|
|
263
283
|
// disallow multiple empty lines, only one newline at the end, and no new lines at the beginning
|
|
264
|
-
// https://eslint.
|
|
265
|
-
'no-multiple-empty-lines': [
|
|
284
|
+
// https://eslint.style/rules/js/no-multiple-empty-lines
|
|
285
|
+
'@stylistic/no-multiple-empty-lines': [
|
|
266
286
|
'error',
|
|
267
287
|
{
|
|
268
288
|
max: 1,
|
|
@@ -270,13 +290,17 @@ const stylisticRules = {
|
|
|
270
290
|
maxEOF: 0,
|
|
271
291
|
},
|
|
272
292
|
],
|
|
273
|
-
// disallow space between function identifier and application
|
|
274
|
-
// deprecated in favor of func-call-spacing
|
|
275
|
-
'no-spaced-func': 'off',
|
|
276
293
|
// disallow tab characters entirely
|
|
277
|
-
|
|
294
|
+
// https://eslint.style/rules/js/no-tabs
|
|
295
|
+
'@stylistic/no-tabs': [
|
|
296
|
+
'error',
|
|
297
|
+
{
|
|
298
|
+
allowIndentationTabs: false,
|
|
299
|
+
},
|
|
300
|
+
],
|
|
278
301
|
// disallow trailing whitespace at the end of lines
|
|
279
|
-
|
|
302
|
+
// https://eslint.style/rules/js/no-trailing-spaces
|
|
303
|
+
'@stylistic/no-trailing-spaces': [
|
|
280
304
|
'error',
|
|
281
305
|
{
|
|
282
306
|
skipBlankLines: false,
|
|
@@ -284,11 +308,11 @@ const stylisticRules = {
|
|
|
284
308
|
},
|
|
285
309
|
],
|
|
286
310
|
// disallow whitespace before properties
|
|
287
|
-
// https://eslint.
|
|
288
|
-
'no-whitespace-before-property': 'error',
|
|
311
|
+
// https://eslint.style/rules/js/no-whitespace-before-property
|
|
312
|
+
'@stylistic/no-whitespace-before-property': 'error',
|
|
289
313
|
// enforce the location of single-line statements
|
|
290
|
-
// https://eslint.
|
|
291
|
-
'nonblock-statement-body-position': [
|
|
314
|
+
// https://eslint.style/rules/js/nonblock-statement-body-position
|
|
315
|
+
'@stylistic/nonblock-statement-body-position': [
|
|
292
316
|
'error',
|
|
293
317
|
'beside',
|
|
294
318
|
{
|
|
@@ -296,8 +320,8 @@ const stylisticRules = {
|
|
|
296
320
|
},
|
|
297
321
|
],
|
|
298
322
|
// enforce line breaks between braces
|
|
299
|
-
// https://eslint.
|
|
300
|
-
'object-curly-newline': [
|
|
323
|
+
// https://eslint.style/rules/js/object-curly-newline
|
|
324
|
+
'@stylistic/object-curly-newline': [
|
|
301
325
|
'error',
|
|
302
326
|
{
|
|
303
327
|
ObjectExpression: {
|
|
@@ -323,21 +347,22 @@ const stylisticRules = {
|
|
|
323
347
|
},
|
|
324
348
|
],
|
|
325
349
|
// require padding inside curly braces
|
|
326
|
-
|
|
350
|
+
// https://eslint.style/rules/js/object-curly-spacing
|
|
351
|
+
'@stylistic/object-curly-spacing': ['error', 'always'],
|
|
327
352
|
// enforce "same line" or "multiple line" on object properties.
|
|
328
|
-
// https://eslint.
|
|
329
|
-
'object-property-newline': [
|
|
353
|
+
// https://eslint.style/rules/js/object-property-newline
|
|
354
|
+
'@stylistic/object-property-newline': [
|
|
330
355
|
'error',
|
|
331
356
|
{
|
|
332
357
|
allowAllPropertiesOnSameLine: true,
|
|
333
358
|
},
|
|
334
359
|
],
|
|
335
360
|
// require a newline around variable declaration
|
|
336
|
-
// https://eslint.
|
|
337
|
-
'one-var-declaration-per-line': ['error', 'always'],
|
|
361
|
+
// https://eslint.style/rules/js/one-var-declaration-per-line
|
|
362
|
+
'@stylistic/one-var-declaration-per-line': ['error', 'always'],
|
|
338
363
|
// Requires operator at the beginning of the line in multiline statements
|
|
339
|
-
// https://eslint.
|
|
340
|
-
'operator-linebreak': [
|
|
364
|
+
// https://eslint.style/rules/js/operator-linebreak
|
|
365
|
+
'@stylistic/operator-linebreak': [
|
|
341
366
|
'error',
|
|
342
367
|
'before',
|
|
343
368
|
{
|
|
@@ -345,7 +370,8 @@ const stylisticRules = {
|
|
|
345
370
|
},
|
|
346
371
|
],
|
|
347
372
|
// disallow padding within blocks
|
|
348
|
-
|
|
373
|
+
// https://eslint.style/rules/js/padded-blocks
|
|
374
|
+
'@stylistic/padded-blocks': [
|
|
349
375
|
'error',
|
|
350
376
|
{
|
|
351
377
|
blocks: 'never',
|
|
@@ -357,11 +383,15 @@ const stylisticRules = {
|
|
|
357
383
|
},
|
|
358
384
|
],
|
|
359
385
|
// Require or disallow padding lines between statements
|
|
360
|
-
// https://eslint.
|
|
361
|
-
'padding-line-between-statements':
|
|
386
|
+
// https://eslint.style/rules/js/padding-line-between-statements
|
|
387
|
+
'@stylistic/padding-line-between-statements': [
|
|
388
|
+
'error',
|
|
389
|
+
{ blankLine: 'always', prev: 'directive', next: '*' },
|
|
390
|
+
{ blankLine: 'any', prev: 'directive', next: 'directive' },
|
|
391
|
+
],
|
|
362
392
|
// require quotes around object literal property names
|
|
363
|
-
// https://eslint.
|
|
364
|
-
'quote-props': [
|
|
393
|
+
// https://eslint.style/rules/js/quote-props
|
|
394
|
+
'@stylistic/quote-props': [
|
|
365
395
|
'error',
|
|
366
396
|
'as-needed',
|
|
367
397
|
{
|
|
@@ -371,17 +401,23 @@ const stylisticRules = {
|
|
|
371
401
|
},
|
|
372
402
|
],
|
|
373
403
|
// specify whether double or single quotes should be used
|
|
374
|
-
quotes
|
|
404
|
+
// https://eslint.style/rules/js/quotes
|
|
405
|
+
'@stylistic/quotes': [
|
|
375
406
|
'error',
|
|
376
407
|
'single',
|
|
377
408
|
{
|
|
378
409
|
avoidEscape: true,
|
|
379
410
|
},
|
|
380
411
|
],
|
|
412
|
+
// enforce spacing between object rest-spread
|
|
413
|
+
// https://eslint.style/rules/js/rest-spread-spacing
|
|
414
|
+
'@stylistic/rest-spread-spacing': ['error', 'never'],
|
|
381
415
|
// require or disallow use of semicolons instead of ASI
|
|
382
|
-
semi
|
|
416
|
+
// https://eslint.style/rules/js/semi
|
|
417
|
+
'@stylistic/semi': ['error', 'always'],
|
|
383
418
|
// enforce spacing before and after semicolons
|
|
384
|
-
|
|
419
|
+
// https://eslint.style/rules/js/semi-spacing
|
|
420
|
+
'@stylistic/semi-spacing': [
|
|
385
421
|
'error',
|
|
386
422
|
{
|
|
387
423
|
before: false,
|
|
@@ -389,13 +425,14 @@ const stylisticRules = {
|
|
|
389
425
|
},
|
|
390
426
|
],
|
|
391
427
|
// Enforce location of semicolons
|
|
392
|
-
// https://eslint.
|
|
393
|
-
'semi-style': ['error', 'last'],
|
|
428
|
+
// https://eslint.style/rules/js/semi-style
|
|
429
|
+
'@stylistic/semi-style': ['error', 'last'],
|
|
394
430
|
// require or disallow space before blocks
|
|
395
|
-
|
|
431
|
+
// https://eslint.style/rules/js/space-before-blocks
|
|
432
|
+
'@stylistic/space-before-blocks': 'error',
|
|
396
433
|
// require or disallow space before function opening parenthesis
|
|
397
|
-
// https://eslint.
|
|
398
|
-
'space-before-function-paren': [
|
|
434
|
+
// https://eslint.style/rules/js/space-before-function-paren
|
|
435
|
+
'@stylistic/space-before-function-paren': [
|
|
399
436
|
'error',
|
|
400
437
|
{
|
|
401
438
|
anonymous: 'always',
|
|
@@ -404,12 +441,19 @@ const stylisticRules = {
|
|
|
404
441
|
},
|
|
405
442
|
],
|
|
406
443
|
// require or disallow spaces inside parentheses
|
|
407
|
-
|
|
444
|
+
// https://eslint.style/rules/js/space-in-parens
|
|
445
|
+
'@stylistic/space-in-parens': ['error', 'never'],
|
|
408
446
|
// require spaces around operators
|
|
409
|
-
|
|
447
|
+
// https://eslint.style/rules/js/space-infix-ops
|
|
448
|
+
'@stylistic/space-infix-ops': [
|
|
449
|
+
'error',
|
|
450
|
+
{
|
|
451
|
+
int32Hint: false,
|
|
452
|
+
},
|
|
453
|
+
],
|
|
410
454
|
// Require or disallow spaces before/after unary operators
|
|
411
|
-
// https://eslint.
|
|
412
|
-
'space-unary-ops': [
|
|
455
|
+
// https://eslint.style/rules/js/space-unary-ops
|
|
456
|
+
'@stylistic/space-unary-ops': [
|
|
413
457
|
'error',
|
|
414
458
|
{
|
|
415
459
|
words: true,
|
|
@@ -418,8 +462,8 @@ const stylisticRules = {
|
|
|
418
462
|
},
|
|
419
463
|
],
|
|
420
464
|
// require or disallow a space immediately following the // or /* in a comment
|
|
421
|
-
// https://eslint.
|
|
422
|
-
'spaced-comment': [
|
|
465
|
+
// https://eslint.style/rules/js/spaced-comment
|
|
466
|
+
'@stylistic/spaced-comment': [
|
|
423
467
|
'error',
|
|
424
468
|
'always',
|
|
425
469
|
{
|
|
@@ -435,20 +479,23 @@ const stylisticRules = {
|
|
|
435
479
|
},
|
|
436
480
|
],
|
|
437
481
|
// Enforce spacing around colons of switch statements
|
|
438
|
-
// https://eslint.
|
|
439
|
-
'switch-colon-spacing': [
|
|
482
|
+
// https://eslint.style/rules/js/switch-colon-spacing
|
|
483
|
+
'@stylistic/switch-colon-spacing': [
|
|
440
484
|
'error',
|
|
441
485
|
{
|
|
442
486
|
after: true,
|
|
443
487
|
before: false,
|
|
444
488
|
},
|
|
445
489
|
],
|
|
490
|
+
// enforce usage of spacing in template strings
|
|
491
|
+
// https://eslint.style/rules/js/template-curly-spacing
|
|
492
|
+
'@stylistic/template-curly-spacing': ['error', 'never'],
|
|
446
493
|
// Require or disallow spacing between template tags and their literals
|
|
447
|
-
// https://eslint.
|
|
448
|
-
'template-tag-spacing': ['error', 'never'],
|
|
494
|
+
// https://eslint.style/rules/js/template-tag-spacing
|
|
495
|
+
'@stylistic/template-tag-spacing': ['error', 'never'],
|
|
449
496
|
// require immediate function invocation to be wrapped in parentheses
|
|
450
|
-
// https://eslint.
|
|
451
|
-
'wrap-iife': [
|
|
497
|
+
// https://eslint.style/rules/js/wrap-iife
|
|
498
|
+
'@stylistic/wrap-iife': [
|
|
452
499
|
'error',
|
|
453
500
|
'outside',
|
|
454
501
|
{
|
|
@@ -456,71 +503,19 @@ const stylisticRules = {
|
|
|
456
503
|
},
|
|
457
504
|
],
|
|
458
505
|
// require regex literals to be wrapped in parentheses
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
// https://eslint.org/docs/rules/no-floating-decimal
|
|
462
|
-
'no-floating-decimal': 'error',
|
|
463
|
-
// enforces consistent newlines before or after dots
|
|
464
|
-
// https://eslint.org/docs/rules/dot-location
|
|
465
|
-
'dot-location': ['error', 'property'],
|
|
466
|
-
// disallow unnecessary semicolons
|
|
467
|
-
'no-extra-semi': 'error',
|
|
468
|
-
// disallow unnecessary parentheses
|
|
469
|
-
// https://eslint.org/docs/rules/no-extra-parens
|
|
470
|
-
'no-extra-parens': [
|
|
471
|
-
'off',
|
|
472
|
-
'all',
|
|
473
|
-
{
|
|
474
|
-
conditionalAssign: true,
|
|
475
|
-
nestedBinaryExpressions: false,
|
|
476
|
-
returnAssign: false,
|
|
477
|
-
ignoreJSX: 'all', // delegate to eslint-plugin-react
|
|
478
|
-
enforceForArrowConditionals: false,
|
|
479
|
-
},
|
|
480
|
-
],
|
|
481
|
-
// enforce usage of spacing in template strings
|
|
482
|
-
// https://eslint.org/docs/rules/template-curly-spacing
|
|
483
|
-
'template-curly-spacing': 'error',
|
|
506
|
+
// https://eslint.style/rules/js/wrap-regex
|
|
507
|
+
'@stylistic/wrap-regex': 'off',
|
|
484
508
|
// enforce spacing around the * in yield* expressions
|
|
485
|
-
// https://eslint.
|
|
486
|
-
'yield-star-spacing': ['error', 'after'],
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
allowParens: true,
|
|
496
|
-
},
|
|
497
|
-
],
|
|
498
|
-
// enforce the spacing around the * in generator functions
|
|
499
|
-
// https://eslint.org/docs/rules/generator-star-spacing
|
|
500
|
-
'generator-star-spacing': [
|
|
501
|
-
'error',
|
|
502
|
-
{
|
|
503
|
-
before: false,
|
|
504
|
-
after: true,
|
|
505
|
-
},
|
|
506
|
-
],
|
|
507
|
-
// require parens in arrow function arguments
|
|
508
|
-
// https://eslint.org/docs/rules/arrow-parens
|
|
509
|
-
'arrow-parens': ['error', 'always'],
|
|
510
|
-
// require space before/after arrow function's arrow
|
|
511
|
-
// https://eslint.org/docs/rules/arrow-spacing
|
|
512
|
-
'arrow-spacing': [
|
|
513
|
-
'error',
|
|
514
|
-
{
|
|
515
|
-
before: true,
|
|
516
|
-
after: true,
|
|
517
|
-
},
|
|
518
|
-
],
|
|
519
|
-
// Replace Airbnb 'lines-between-class-members' rule with '@typescript-eslint' version
|
|
520
|
-
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/lines-between-class-members.md
|
|
521
|
-
// 'lines-between-class-members': 'off',
|
|
522
|
-
// '@typescript-eslint/lines-between-class-members':
|
|
523
|
-
// stylisticRules.rules['lines-between-class-members'],
|
|
509
|
+
// https://eslint.style/rules/js/yield-star-spacing
|
|
510
|
+
'@stylistic/yield-star-spacing': ['error', 'after'],
|
|
511
|
+
},
|
|
512
|
+
};
|
|
513
|
+
exports.deprecatedStylisticRules = {
|
|
514
|
+
name: 'airbnb/config/stylistic/deprecated',
|
|
515
|
+
rules: {
|
|
516
|
+
// enforce spacing between functions and their invocations
|
|
517
|
+
// https://eslint.style/rules/js/function-call-spacing
|
|
518
|
+
'@stylistic/func-call-spacing': 'off',
|
|
524
519
|
},
|
|
525
520
|
};
|
|
526
521
|
exports.default = stylisticRules;
|