@soleil-se/eslint-config 6.2.6 → 6.3.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/CHANGELOG.md CHANGED
@@ -7,7 +7,11 @@ All changes in this repository are noted here.
7
7
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
8
8
  and the project uses [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
9
9
 
10
- ## [6.2.6] - 2025-05-23
10
+ ## [6.3.0] - 2026-01-15
11
+
12
+ * Migrate to `@stylistic/eslint-plugin` for stylistic rules.
13
+
14
+ ## [6.2.6] - 2025-05-26
11
15
 
12
16
  * Add node globals to node config.
13
17
  * Turn off `no-console` and `no-process-exit` in node config.
package/config/base.js CHANGED
@@ -1,5 +1,6 @@
1
1
  import globals from 'globals';
2
2
  import importPlugin from 'eslint-plugin-import';
3
+ import stylistic from '@stylistic/eslint-plugin';
3
4
  import jsRules from '../rules/js/index.js';
4
5
 
5
6
  export default function base() {
@@ -16,7 +17,7 @@ export default function base() {
16
17
  },
17
18
  },
18
19
  ignores: ['dist', 'node_modules', 'prettier.config.js'],
19
- plugins: { import: importPlugin },
20
+ plugins: { import: importPlugin, '@stylistic': stylistic },
20
21
  rules: jsRules,
21
22
  settings: {
22
23
  svelte: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@soleil-se/eslint-config",
3
- "version": "6.2.6",
3
+ "version": "6.3.0",
4
4
  "description": "ESLint configuration for Sitevision apps and projects.",
5
5
  "keywords": [
6
6
  "eslint",
@@ -22,18 +22,21 @@
22
22
  "./typescript": "./typescript.js",
23
23
  "./config/base": "./config/base.js",
24
24
  "./config/svelte": "./config/svelte.js",
25
- "./rules/js":"./rules/js/index.js",
26
- "./rules/svelte":"./rules/svelte/index.js"
25
+ "./rules/js": "./rules/js/index.js",
26
+ "./rules/svelte": "./rules/svelte/index.js"
27
27
  },
28
28
  "dependencies": {
29
- "eslint-config-prettier": "^10.1.1",
30
- "eslint-plugin-import": "^2.31.0",
31
- "eslint-plugin-svelte": "^3.4.0",
32
- "globals": "^16.0.0"
29
+ "@stylistic/eslint-plugin": "^5.7.0",
30
+ "eslint-config-prettier": "^10.1.8",
31
+ "eslint-plugin-import": "^2.32.0",
32
+ "eslint-plugin-svelte": "^3.14.0",
33
+ "globals": "^17.0.0"
33
34
  },
34
35
  "devDependencies": {
35
- "eslint": "^9.23.0",
36
- "svelte": "^5.25.3"
36
+ "eslint": "^9.39.2",
37
+ "eslint-import-resolver-typescript": "^4.4.4",
38
+ "svelte": "^5.46.3",
39
+ "typescript-eslint": "^8.53.0"
37
40
  },
38
41
  "peerDependencies": {
39
42
  "eslint": ">= 9"
@@ -45,8 +45,8 @@ export default {
45
45
  'dot-notation': ['error', { allowKeywords: true }],
46
46
 
47
47
  // enforces consistent newlines before or after dots
48
- // https://eslint.org/docs/rules/dot-location
49
- 'dot-location': ['error', 'property'],
48
+ // https://eslint.style/rules/dot-location
49
+ '@stylistic/dot-location': ['error', 'property'],
50
50
 
51
51
  // require the use of === and !==
52
52
  // https://eslint.org/docs/rules/eqeqeq
@@ -133,8 +133,8 @@ export default {
133
133
  'no-fallthrough': 'error',
134
134
 
135
135
  // disallow the use of leading or trailing decimal points in numeric literals
136
- // https://eslint.org/docs/rules/no-floating-decimal
137
- 'no-floating-decimal': 'error',
136
+ // https://eslint.style/rules/no-floating-decimal
137
+ '@stylistic/no-floating-decimal': 'error',
138
138
 
139
139
  // disallow reassignments of native objects or read-only globals
140
140
  // https://eslint.org/docs/rules/no-global-assign
@@ -191,8 +191,8 @@ export default {
191
191
  }],
192
192
 
193
193
  // disallow use of multiple spaces
194
- // https://eslint.org/docs/rules/no-multi-spaces
195
- 'no-multi-spaces': ['error', {
194
+ // https://eslint.style/rules/no-multi-spaces
195
+ '@stylistic/no-multi-spaces': ['error', {
196
196
  ignoreEOLComments: false,
197
197
  }],
198
198
 
@@ -67,8 +67,8 @@ export default {
67
67
  'no-extra-boolean-cast': 'error',
68
68
 
69
69
  // disallow unnecessary parentheses
70
- // https://eslint.org/docs/rules/no-extra-parens
71
- 'no-extra-parens': ['off', 'all', {
70
+ // https://eslint.style/rules/no-extra-parens
71
+ '@stylistic/no-extra-parens': ['off', 'all', {
72
72
  conditionalAssign: true,
73
73
  nestedBinaryExpressions: false,
74
74
  returnAssign: false,
@@ -77,7 +77,8 @@ export default {
77
77
  }],
78
78
 
79
79
  // disallow unnecessary semicolons
80
- 'no-extra-semi': 'error',
80
+ // https://eslint.style/rules/no-extra-semi
81
+ '@stylistic/no-extra-semi': 'error',
81
82
 
82
83
  // disallow overwriting functions written as function declarations
83
84
  'no-func-assign': 'error',
package/rules/js/es6.js CHANGED
@@ -7,19 +7,19 @@ export default {
7
7
  }],
8
8
 
9
9
  // require parens in arrow function arguments
10
- // https://eslint.org/docs/rules/arrow-parens
11
- 'arrow-parens': ['error', 'always'],
10
+ // https://eslint.style/rules/arrow-parens
11
+ '@stylistic/arrow-parens': ['error', 'always'],
12
12
 
13
13
  // require space before/after arrow function's arrow
14
- // https://eslint.org/docs/rules/arrow-spacing
15
- 'arrow-spacing': ['error', { before: true, after: true }],
14
+ // https://eslint.style/rules/arrow-spacing
15
+ '@stylistic/arrow-spacing': ['error', { before: true, after: true }],
16
16
 
17
17
  // verify super() callings in constructors
18
18
  'constructor-super': 'error',
19
19
 
20
20
  // enforce the spacing around the * in generator functions
21
- // https://eslint.org/docs/rules/generator-star-spacing
22
- 'generator-star-spacing': ['error', { before: false, after: true }],
21
+ // https://eslint.style/rules/generator-star-spacing
22
+ '@stylistic/generator-star-spacing': ['error', { before: false, after: true }],
23
23
 
24
24
  // disallow modifying variables of class declarations
25
25
  // https://eslint.org/docs/rules/no-class-assign
@@ -144,8 +144,8 @@ export default {
144
144
  'require-yield': 'error',
145
145
 
146
146
  // enforce spacing between object rest-spread
147
- // https://eslint.org/docs/rules/rest-spread-spacing
148
- 'rest-spread-spacing': ['error', 'never'],
147
+ // https://eslint.style/rules/rest-spread-spacing
148
+ '@stylistic/rest-spread-spacing': ['error', 'never'],
149
149
 
150
150
  // import sorting
151
151
  // https://eslint.org/docs/rules/sort-imports
@@ -161,10 +161,10 @@ export default {
161
161
  'symbol-description': 'error',
162
162
 
163
163
  // enforce usage of spacing in template strings
164
- // https://eslint.org/docs/rules/template-curly-spacing
165
- 'template-curly-spacing': 'error',
164
+ // https://eslint.style/rules/template-curly-spacing
165
+ '@stylistic/template-curly-spacing': 'error',
166
166
 
167
167
  // enforce spacing around the * in yield* expressions
168
- // https://eslint.org/docs/rules/yield-star-spacing
169
- 'yield-star-spacing': ['error', 'after'],
168
+ // https://eslint.style/rules/yield-star-spacing
169
+ '@stylistic/yield-star-spacing': ['error', 'after'],
170
170
  };
package/rules/js/style.js CHANGED
@@ -1,23 +1,10 @@
1
1
  export default {
2
- // enforce line breaks after opening and before closing array brackets
3
- // https://eslint.org/docs/rules/array-bracket-newline
4
- 'array-bracket-newline': ['off', 'consistent'], // object option alternative: { multiline: true, minItems: 3 }
5
-
6
- // enforce line breaks between array elements
7
- // https://eslint.org/docs/rules/array-element-newline
8
- 'array-element-newline': ['off', { multiline: true, minItems: 3 }],
9
-
10
- // enforce spacing inside array brackets
11
- 'array-bracket-spacing': ['error', 'never'],
12
-
13
- // enforce spacing inside single-line blocks
14
- // https://eslint.org/docs/rules/block-spacing
15
- 'block-spacing': ['error', 'always'],
16
-
17
- // enforce one true brace style
18
- 'brace-style': ['error', '1tbs', { allowSingleLine: true }],
2
+ // ==============================================
3
+ // CORE ESLINT RULES
4
+ // ==============================================
19
5
 
20
6
  // require camel case names
7
+ // https://eslint.org/docs/rules/camelcase
21
8
  camelcase: ['error', { properties: 'never', ignoreDestructuring: false }],
22
9
 
23
10
  // enforce or disallow capitalization of the first letter of a comment
@@ -35,51 +22,10 @@ export default {
35
22
  },
36
23
  }],
37
24
 
38
- // require trailing commas in multiline object literals
39
- 'comma-dangle': ['error', {
40
- arrays: 'always-multiline',
41
- objects: 'always-multiline',
42
- imports: 'always-multiline',
43
- exports: 'always-multiline',
44
- functions: 'always-multiline',
45
- }],
46
-
47
- // enforce spacing before and after comma
48
- 'comma-spacing': ['error', { before: false, after: true }],
49
-
50
- // enforce one true comma style
51
- 'comma-style': ['error', 'last', {
52
- exceptions: {
53
- ArrayExpression: false,
54
- ArrayPattern: false,
55
- ArrowFunctionExpression: false,
56
- CallExpression: false,
57
- FunctionDeclaration: false,
58
- FunctionExpression: false,
59
- ImportDeclaration: false,
60
- ObjectExpression: false,
61
- ObjectPattern: false,
62
- VariableDeclaration: false,
63
- NewExpression: false,
64
- },
65
- }],
66
-
67
- // disallow padding inside computed properties
68
- 'computed-property-spacing': ['error', 'never'],
69
-
70
25
  // enforces consistent naming when capturing the current execution context
26
+ // https://eslint.org/docs/rules/consistent-this
71
27
  'consistent-this': 'off',
72
28
 
73
- // enforce newline at the end of file, with no multiple empty lines
74
- 'eol-last': ['error', 'always'],
75
-
76
- // https://eslint.org/docs/rules/function-call-argument-newline
77
- 'function-call-argument-newline': ['error', 'consistent'],
78
-
79
- // enforce spacing between functions and their invocations
80
- // https://eslint.org/docs/rules/func-call-spacing
81
- 'func-call-spacing': ['error', 'never'],
82
-
83
29
  // requires function names to match the name of the variable or property to which they are
84
30
  // assigned
85
31
  // https://eslint.org/docs/rules/func-name-matching
@@ -97,95 +43,19 @@ export default {
97
43
  // TODO: enable
98
44
  'func-style': ['off', 'expression'],
99
45
 
100
- // require line breaks inside function parentheses if there are line breaks between parameters
101
- // https://eslint.org/docs/rules/function-paren-newline
102
- 'function-paren-newline': ['error', 'multiline-arguments'],
103
-
104
46
  // disallow specified identifiers
105
47
  // https://eslint.org/docs/rules/id-denylist
106
48
  'id-denylist': 'off',
107
49
 
108
50
  // this option enforces minimum and maximum identifier lengths
109
51
  // (variable names, property names etc.)
52
+ // https://eslint.org/docs/rules/id-length
110
53
  'id-length': 'off',
111
54
 
112
55
  // require identifiers to match the provided regular expression
56
+ // https://eslint.org/docs/rules/id-match
113
57
  'id-match': 'off',
114
58
 
115
- // Enforce the location of arrow function bodies with implicit returns
116
- // https://eslint.org/docs/rules/implicit-arrow-linebreak
117
- 'implicit-arrow-linebreak': ['error', 'beside'],
118
-
119
- // this option sets a specific tab width for your code
120
- // https://eslint.org/docs/rules/indent
121
- indent: ['error', 2, {
122
- SwitchCase: 1,
123
- VariableDeclarator: 1,
124
- outerIIFEBody: 1,
125
- // MemberExpression: null,
126
- FunctionDeclaration: {
127
- parameters: 1,
128
- body: 1,
129
- },
130
- FunctionExpression: {
131
- parameters: 1,
132
- body: 1,
133
- },
134
- CallExpression: {
135
- arguments: 1,
136
- },
137
- ArrayExpression: 1,
138
- ObjectExpression: 1,
139
- ImportDeclaration: 1,
140
- flatTernaryExpressions: false,
141
- ignoreComments: false,
142
- }],
143
-
144
- // specify whether double or single quotes should be used in JSX attributes
145
- // https://eslint.org/docs/rules/jsx-quotes
146
- 'jsx-quotes': ['off', 'prefer-double'],
147
-
148
- // enforces spacing between keys and values in object literal properties
149
- 'key-spacing': ['error', { beforeColon: false, afterColon: true }],
150
-
151
- // require a space before & after certain keywords
152
- 'keyword-spacing': ['error', {
153
- before: true,
154
- after: true,
155
- overrides: {
156
- return: { after: true },
157
- throw: { after: true },
158
- case: { after: true },
159
- },
160
- }],
161
-
162
- // enforce position of line comments
163
- // https://eslint.org/docs/rules/line-comment-position
164
- // TODO: enable?
165
- 'line-comment-position': ['off', {
166
- position: 'above',
167
- ignorePattern: '',
168
- applyDefaultPatterns: true,
169
- }],
170
-
171
- // disallow mixed 'LF' and 'CRLF' as linebreaks
172
- // https://eslint.org/docs/rules/linebreak-style
173
- 'linebreak-style': ['error', 'unix'],
174
-
175
- // require or disallow an empty line between class members
176
- // https://eslint.org/docs/rules/lines-between-class-members
177
- 'lines-between-class-members': ['error', 'always', { exceptAfterSingleLine: false }],
178
-
179
- // enforces empty lines around comments
180
- 'lines-around-comment': 'off',
181
-
182
- // require or disallow newlines around directives
183
- // https://eslint.org/docs/rules/lines-around-directive
184
- 'lines-around-directive': ['error', {
185
- before: 'always',
186
- after: 'always',
187
- }],
188
-
189
59
  // Require or disallow logical assignment logical operator shorthand
190
60
  // https://eslint.org/docs/latest/rules/logical-assignment-operators
191
61
  // TODO, semver-major: enable
@@ -194,19 +64,9 @@ export default {
194
64
  }],
195
65
 
196
66
  // specify the maximum depth that blocks can be nested
67
+ // https://eslint.org/docs/rules/max-depth
197
68
  'max-depth': ['off', 4],
198
69
 
199
- // specify the maximum length of a line in your program
200
- // MODIFIED FROM AIRBNB
201
- // https://eslint.org/docs/rules/max-len
202
- 'max-len': ['error', 100, 2, {
203
- ignoreUrls: true,
204
- ignoreComments: true,
205
- ignoreRegExpLiterals: true,
206
- ignoreStrings: true,
207
- ignoreTemplateLiterals: true,
208
- }],
209
-
210
70
  // specify the max number of lines in a file
211
71
  // https://eslint.org/docs/rules/max-lines
212
72
  'max-lines': ['off', {
@@ -225,28 +85,19 @@ export default {
225
85
  }],
226
86
 
227
87
  // specify the maximum depth callbacks can be nested
88
+ // https://eslint.org/docs/rules/max-nested-callbacks
228
89
  'max-nested-callbacks': 'off',
229
90
 
230
91
  // limits the number of parameters that can be used in the function declaration.
92
+ // https://eslint.org/docs/rules/max-params
231
93
  'max-params': ['off', 3],
232
94
 
233
95
  // specify the maximum number of statement allowed in a function
96
+ // https://eslint.org/docs/rules/max-statements
234
97
  'max-statements': ['off', 10],
235
98
 
236
- // restrict the number of statements per line
237
- // https://eslint.org/docs/rules/max-statements-per-line
238
- 'max-statements-per-line': ['off', { max: 1 }],
239
-
240
- // enforce a particular style for multiline comments
241
- // https://eslint.org/docs/rules/multiline-comment-style
242
- 'multiline-comment-style': ['off', 'starred-block'],
243
-
244
- // require multiline ternary
245
- // https://eslint.org/docs/rules/multiline-ternary
246
- // TODO: enable?
247
- 'multiline-ternary': ['off', 'never'],
248
-
249
99
  // require a capital letter for constructors
100
+ // https://eslint.org/docs/rules/new-cap
250
101
  'new-cap': ['error', {
251
102
  newIsCap: true,
252
103
  newIsCapExceptions: [],
@@ -254,22 +105,16 @@ export default {
254
105
  capIsNewExceptions: ['Immutable.Map', 'Immutable.Set', 'Immutable.List'],
255
106
  }],
256
107
 
257
- // disallow the omission of parentheses when invoking a constructor with no arguments
258
- // https://eslint.org/docs/rules/new-parens
259
- 'new-parens': 'error',
260
-
261
108
  // allow/disallow an empty newline after var statement
109
+ // https://eslint.org/docs/rules/newline-after-var
262
110
  'newline-after-var': 'off',
263
111
 
112
+ // require newline before return
264
113
  // https://eslint.org/docs/rules/newline-before-return
265
114
  'newline-before-return': 'off',
266
115
 
267
- // enforces new line after each method call in the chain to make it
268
- // more readable and easy to maintain
269
- // https://eslint.org/docs/rules/newline-per-chained-call
270
- 'newline-per-chained-call': ['error', { ignoreChainWithDepth: 4 }],
271
-
272
116
  // disallow use of the Array constructor
117
+ // https://eslint.org/docs/rules/no-array-constructor
273
118
  'no-array-constructor': 'error',
274
119
 
275
120
  // disallow use of bitwise operators
@@ -281,50 +126,27 @@ export default {
281
126
  'no-continue': 'error',
282
127
 
283
128
  // disallow comments inline after code
129
+ // https://eslint.org/docs/rules/no-inline-comments
284
130
  'no-inline-comments': 'off',
285
131
 
286
132
  // disallow if as the only statement in an else block
287
133
  // https://eslint.org/docs/rules/no-lonely-if
288
134
  'no-lonely-if': 'error',
289
135
 
290
- // disallow un-paren'd mixes of different operators
291
- // https://eslint.org/docs/rules/no-mixed-operators
292
- 'no-mixed-operators': ['error', {
293
- // the list of arithmetic groups disallows mixing `%` and `**`
294
- // with other arithmetic operators.
295
- groups: [
296
- ['%', '**'],
297
- ['%', '+'],
298
- ['%', '-'],
299
- ['%', '*'],
300
- ['%', '/'],
301
- ['/', '*'],
302
- ['&', '|', '<<', '>>', '>>>'],
303
- ['==', '!=', '===', '!=='],
304
- ['&&', '||'],
305
- ],
306
- allowSamePrecedence: false,
307
- }],
308
-
309
- // disallow mixed spaces and tabs for indentation
310
- 'no-mixed-spaces-and-tabs': 'error',
311
-
312
136
  // disallow use of chained assignment expressions
313
137
  // https://eslint.org/docs/rules/no-multi-assign
314
138
  'no-multi-assign': ['error'],
315
139
 
316
- // disallow multiple empty lines, only one newline at the end, and no new lines at the beginning
317
- // https://eslint.org/docs/rules/no-multiple-empty-lines
318
- 'no-multiple-empty-lines': ['error', { max: 1, maxBOF: 0, maxEOF: 0 }],
319
-
320
140
  // disallow negated conditions
321
141
  // https://eslint.org/docs/rules/no-negated-condition
322
142
  'no-negated-condition': 'off',
323
143
 
324
144
  // disallow nested ternary expressions
145
+ // https://eslint.org/docs/rules/no-nested-ternary
325
146
  'no-nested-ternary': 'error',
326
147
 
327
148
  // disallow use of the Object constructor
149
+ // https://eslint.org/docs/rules/no-new-object
328
150
  'no-new-object': 'error',
329
151
 
330
152
  // disallow use of unary operators, ++ and --
@@ -355,20 +177,13 @@ export default {
355
177
 
356
178
  // disallow space between function identifier and application
357
179
  // deprecated in favor of func-call-spacing
180
+ // https://eslint.org/docs/rules/no-spaced-func
358
181
  'no-spaced-func': 'off',
359
182
 
360
- // disallow tab characters entirely
361
- 'no-tabs': 'error',
362
-
363
183
  // disallow the use of ternary operators
184
+ // https://eslint.org/docs/rules/no-ternary
364
185
  'no-ternary': 'off',
365
186
 
366
- // disallow trailing whitespace at the end of lines
367
- 'no-trailing-spaces': ['error', {
368
- skipBlankLines: false,
369
- ignoreComments: false,
370
- }],
371
-
372
187
  // disallow dangling underscores in identifiers
373
188
  // https://eslint.org/docs/rules/no-underscore-dangle
374
189
  'no-underscore-dangle': ['error', {
@@ -383,21 +198,270 @@ export default {
383
198
  // https://eslint.org/docs/rules/no-unneeded-ternary
384
199
  'no-unneeded-ternary': ['error', { defaultAssignment: false }],
385
200
 
201
+ // allow just one var statement per function
202
+ // https://eslint.org/docs/rules/one-var
203
+ 'one-var': ['error', 'never'],
204
+
205
+ // require assignment operator shorthand where possible or prohibit it entirely
206
+ // https://eslint.org/docs/rules/operator-assignment
207
+ 'operator-assignment': ['error', 'always'],
208
+
209
+ // Disallow the use of Math.pow in favor of the ** operator
210
+ // https://eslint.org/docs/rules/prefer-exponentiation-operator
211
+ 'prefer-exponentiation-operator': 'error',
212
+
213
+ // Prefer use of an object spread over Object.assign
214
+ // https://eslint.org/docs/rules/prefer-object-spread
215
+ 'prefer-object-spread': 'error',
216
+
217
+ // do not require jsdoc
218
+ // https://eslint.org/docs/rules/require-jsdoc
219
+ 'require-jsdoc': 'off',
220
+
221
+ // requires object keys to be sorted
222
+ // https://eslint.org/docs/rules/sort-keys
223
+ 'sort-keys': ['off', 'asc', { caseSensitive: false, natural: true }],
224
+
225
+ // sort variables within the same declaration block
226
+ // https://eslint.org/docs/rules/sort-vars
227
+ 'sort-vars': 'off',
228
+
229
+ // require or disallow the Unicode Byte Order Mark
230
+ // https://eslint.org/docs/rules/unicode-bom
231
+ 'unicode-bom': ['error', 'never'],
232
+
233
+ // ==============================================
234
+ // @STYLISTIC RULES
235
+ // ==============================================
236
+
237
+ // enforce line breaks after opening and before closing array brackets
238
+ // https://eslint.style/rules/array-bracket-newline
239
+ '@stylistic/array-bracket-newline': ['off', 'consistent'], // object option alternative: { multiline: true, minItems: 3 }
240
+
241
+ // enforce line breaks between array elements
242
+ // https://eslint.style/rules/array-element-newline
243
+ '@stylistic/array-element-newline': ['off', { multiline: true, minItems: 3 }],
244
+
245
+ // enforce spacing inside array brackets
246
+ // https://eslint.style/rules/array-bracket-spacing
247
+ '@stylistic/array-bracket-spacing': ['error', 'never'],
248
+
249
+ // enforce spacing inside single-line blocks
250
+ // https://eslint.style/rules/block-spacing
251
+ '@stylistic/block-spacing': ['error', 'always'],
252
+
253
+ // enforce one true brace style
254
+ // https://eslint.style/rules/brace-style
255
+ '@stylistic/brace-style': ['error', '1tbs', { allowSingleLine: true }],
256
+
257
+ // require trailing commas in multiline object literals
258
+ // https://eslint.style/rules/comma-dangle
259
+ '@stylistic/comma-dangle': ['error', {
260
+ arrays: 'always-multiline',
261
+ objects: 'always-multiline',
262
+ imports: 'always-multiline',
263
+ exports: 'always-multiline',
264
+ functions: 'always-multiline',
265
+ }],
266
+
267
+ // enforce spacing before and after comma
268
+ // https://eslint.style/rules/comma-spacing
269
+ '@stylistic/comma-spacing': ['error', { before: false, after: true }],
270
+
271
+ // enforce one true comma style
272
+ // https://eslint.style/rules/comma-style
273
+ '@stylistic/comma-style': ['error', 'last', {
274
+ exceptions: {
275
+ ArrayExpression: false,
276
+ ArrayPattern: false,
277
+ ArrowFunctionExpression: false,
278
+ CallExpression: false,
279
+ FunctionDeclaration: false,
280
+ FunctionExpression: false,
281
+ ImportDeclaration: false,
282
+ ObjectExpression: false,
283
+ ObjectPattern: false,
284
+ VariableDeclaration: false,
285
+ NewExpression: false,
286
+ },
287
+ }],
288
+
289
+ // disallow padding inside computed properties
290
+ // https://eslint.style/rules/computed-property-spacing
291
+ '@stylistic/computed-property-spacing': ['error', 'never'],
292
+
293
+ // enforce newline at the end of file, with no multiple empty lines
294
+ // https://eslint.style/rules/eol-last
295
+ '@stylistic/eol-last': ['error', 'always'],
296
+
297
+ // enforce function call argument newline
298
+ // https://eslint.style/rules/function-call-argument-newline
299
+ '@stylistic/function-call-argument-newline': ['error', 'consistent'],
300
+
301
+ // enforce spacing between functions and their invocations
302
+ // https://eslint.style/rules/function-call-spacing
303
+ '@stylistic/function-call-spacing': ['error', 'never'],
304
+
305
+ // require line breaks inside function parentheses if there are line breaks between parameters
306
+ // https://eslint.style/rules/function-paren-newline
307
+ '@stylistic/function-paren-newline': ['error', 'multiline-arguments'],
308
+
309
+ // Enforce the location of arrow function bodies with implicit returns
310
+ // https://eslint.style/rules/implicit-arrow-linebreak
311
+ '@stylistic/implicit-arrow-linebreak': ['error', 'beside'],
312
+
313
+ // this option sets a specific tab width for your code
314
+ // https://eslint.style/rules/indent
315
+ '@stylistic/indent': ['error', 2, {
316
+ SwitchCase: 1,
317
+ VariableDeclarator: 1,
318
+ outerIIFEBody: 1,
319
+ // MemberExpression: null,
320
+ FunctionDeclaration: {
321
+ parameters: 1,
322
+ body: 1,
323
+ },
324
+ FunctionExpression: {
325
+ parameters: 1,
326
+ body: 1,
327
+ },
328
+ CallExpression: {
329
+ arguments: 1,
330
+ },
331
+ ArrayExpression: 1,
332
+ ObjectExpression: 1,
333
+ ImportDeclaration: 1,
334
+ flatTernaryExpressions: false,
335
+ ignoreComments: false,
336
+ }],
337
+
338
+ // specify whether double or single quotes should be used in JSX attributes
339
+ // https://eslint.style/rules/jsx-quotes
340
+ '@stylistic/jsx-quotes': ['off', 'prefer-double'],
341
+
342
+ // enforces spacing between keys and values in object literal properties
343
+ // https://eslint.style/rules/key-spacing
344
+ '@stylistic/key-spacing': ['error', { beforeColon: false, afterColon: true }],
345
+
346
+ // require a space before & after certain keywords
347
+ // https://eslint.style/rules/keyword-spacing
348
+ '@stylistic/keyword-spacing': ['error', {
349
+ before: true,
350
+ after: true,
351
+ overrides: {
352
+ return: { after: true },
353
+ throw: { after: true },
354
+ case: { after: true },
355
+ },
356
+ }],
357
+
358
+ // enforce position of line comments
359
+ // https://eslint.style/rules/line-comment-position
360
+ '@stylistic/line-comment-position': ['off', {
361
+ position: 'above',
362
+ ignorePattern: '',
363
+ applyDefaultPatterns: true,
364
+ }],
365
+
366
+ // disallow mixed 'LF' and 'CRLF' as linebreaks
367
+ // https://eslint.style/rules/linebreak-style
368
+ '@stylistic/linebreak-style': ['error', 'unix'],
369
+
370
+ // require or disallow an empty line between class members
371
+ // https://eslint.style/rules/lines-between-class-members
372
+ '@stylistic/lines-between-class-members': ['error', 'always', { exceptAfterSingleLine: false }],
373
+
374
+ // enforces empty lines around comments
375
+ // https://eslint.style/rules/lines-around-comment
376
+ '@stylistic/lines-around-comment': 'off',
377
+
378
+ // specify the maximum length of a line in your program
379
+ // MODIFIED FROM AIRBNB
380
+ // https://eslint.style/rules/max-len
381
+ '@stylistic/max-len': ['error', 100, 2, {
382
+ ignoreUrls: true,
383
+ ignoreComments: true,
384
+ ignoreRegExpLiterals: true,
385
+ ignoreStrings: true,
386
+ ignoreTemplateLiterals: true,
387
+ }],
388
+
389
+ // restrict the number of statements per line
390
+ // https://eslint.style/rules/max-statements-per-line
391
+ '@stylistic/max-statements-per-line': ['off', { max: 1 }],
392
+
393
+ // enforce a particular style for multiline comments
394
+ // https://eslint.style/rules/multiline-comment-style
395
+ '@stylistic/multiline-comment-style': ['off', 'starred-block'],
396
+
397
+ // require multiline ternary
398
+ // https://eslint.style/rules/multiline-ternary
399
+ // TODO: enable?
400
+ '@stylistic/multiline-ternary': ['off', 'never'],
401
+
402
+ // disallow the omission of parentheses when invoking a constructor with no arguments
403
+ // https://eslint.style/rules/new-parens
404
+ '@stylistic/new-parens': 'error',
405
+
406
+ // enforces new line after each method call in the chain to make it
407
+ // more readable and easy to maintain
408
+ // https://eslint.style/rules/newline-per-chained-call
409
+ '@stylistic/newline-per-chained-call': ['error', { ignoreChainWithDepth: 4 }],
410
+
411
+ // disallow un-paren'd mixes of different operators
412
+ // https://eslint.style/rules/no-mixed-operators
413
+ '@stylistic/no-mixed-operators': ['error', {
414
+ // the list of arithmetic groups disallows mixing `%` and `**`
415
+ // with other arithmetic operators.
416
+ groups: [
417
+ ['%', '**'],
418
+ ['%', '+'],
419
+ ['%', '-'],
420
+ ['%', '*'],
421
+ ['%', '/'],
422
+ ['/', '*'],
423
+ ['&', '|', '<<', '>>', '>>>'],
424
+ ['==', '!=', '===', '!=='],
425
+ ['&&', '||'],
426
+ ],
427
+ allowSamePrecedence: false,
428
+ }],
429
+
430
+ // disallow mixed spaces and tabs for indentation
431
+ // https://eslint.style/rules/no-mixed-spaces-and-tabs
432
+ '@stylistic/no-mixed-spaces-and-tabs': 'error',
433
+
434
+ // disallow multiple empty lines, only one newline at the end, and no new lines at the beginning
435
+ // https://eslint.style/rules/no-multiple-empty-lines
436
+ '@stylistic/no-multiple-empty-lines': ['error', { max: 1, maxBOF: 0, maxEOF: 0 }],
437
+
438
+ // disallow tab characters entirely
439
+ // https://eslint.style/rules/no-tabs
440
+ '@stylistic/no-tabs': 'error',
441
+
442
+ // disallow trailing whitespace at the end of lines
443
+ // https://eslint.style/rules/no-trailing-spaces
444
+ '@stylistic/no-trailing-spaces': ['error', {
445
+ skipBlankLines: false,
446
+ ignoreComments: false,
447
+ }],
448
+
386
449
  // disallow whitespace before properties
387
- // https://eslint.org/docs/rules/no-whitespace-before-property
388
- 'no-whitespace-before-property': 'error',
450
+ // https://eslint.style/rules/no-whitespace-before-property
451
+ '@stylistic/no-whitespace-before-property': 'error',
389
452
 
390
453
  // enforce the location of single-line statements
391
- // https://eslint.org/docs/rules/nonblock-statement-body-position
392
- 'nonblock-statement-body-position': ['error', 'beside', { overrides: {} }],
454
+ // https://eslint.style/rules/nonblock-statement-body-position
455
+ '@stylistic/nonblock-statement-body-position': ['error', 'beside', { overrides: {} }],
393
456
 
394
457
  // require padding inside curly braces
395
- 'object-curly-spacing': ['error', 'always'],
458
+ // https://eslint.style/rules/object-curly-spacing
459
+ '@stylistic/object-curly-spacing': ['error', 'always'],
396
460
 
397
461
  // enforce line breaks between braces
398
462
  // MODIFIED FROM AIRBNB
399
- // https://eslint.org/docs/rules/object-curly-newline
400
- 'object-curly-newline': ['error', {
463
+ // https://eslint.style/rules/object-curly-newline
464
+ '@stylistic/object-curly-newline': ['error', {
401
465
  ObjectExpression: { minProperties: 8, multiline: true, consistent: true },
402
466
  ObjectPattern: { minProperties: 8, multiline: true, consistent: true },
403
467
  ImportDeclaration: { minProperties: 8, multiline: true, consistent: true },
@@ -405,28 +469,22 @@ export default {
405
469
  }],
406
470
 
407
471
  // enforce "same line" or "multiple line" on object properties.
408
- // https://eslint.org/docs/rules/object-property-newline
409
- 'object-property-newline': ['error', {
472
+ // https://eslint.style/rules/object-property-newline
473
+ '@stylistic/object-property-newline': ['error', {
410
474
  allowAllPropertiesOnSameLine: true,
411
475
  }],
412
476
 
413
- // allow just one var statement per function
414
- 'one-var': ['error', 'never'],
415
-
416
477
  // require a newline around variable declaration
417
- // https://eslint.org/docs/rules/one-var-declaration-per-line
418
- 'one-var-declaration-per-line': ['error', 'always'],
419
-
420
- // require assignment operator shorthand where possible or prohibit it entirely
421
- // https://eslint.org/docs/rules/operator-assignment
422
- 'operator-assignment': ['error', 'always'],
478
+ // https://eslint.style/rules/one-var-declaration-per-line
479
+ '@stylistic/one-var-declaration-per-line': ['error', 'always'],
423
480
 
424
481
  // Requires operator at the beginning of the line in multiline statements
425
- // https://eslint.org/docs/rules/operator-linebreak
426
- 'operator-linebreak': ['error', 'before', { overrides: { '=': 'none' } }],
482
+ // https://eslint.style/rules/operator-linebreak
483
+ '@stylistic/operator-linebreak': ['error', 'before', { overrides: { '=': 'none' } }],
427
484
 
428
485
  // disallow padding within blocks
429
- 'padded-blocks': ['error', {
486
+ // https://eslint.style/rules/padded-blocks
487
+ '@stylistic/padded-blocks': ['error', {
430
488
  blocks: 'never',
431
489
  classes: 'never',
432
490
  switches: 'never',
@@ -435,64 +493,57 @@ export default {
435
493
  }],
436
494
 
437
495
  // Require or disallow padding lines between statements
438
- // https://eslint.org/docs/rules/padding-line-between-statements
439
- 'padding-line-between-statements': 'off',
440
-
441
- // Disallow the use of Math.pow in favor of the ** operator
442
- // https://eslint.org/docs/rules/prefer-exponentiation-operator
443
- 'prefer-exponentiation-operator': 'error',
444
-
445
- // Prefer use of an object spread over Object.assign
446
- // https://eslint.org/docs/rules/prefer-object-spread
447
- 'prefer-object-spread': 'error',
496
+ // https://eslint.style/rules/padding-line-between-statements
497
+ '@stylistic/padding-line-between-statements': [
498
+ 'error',
499
+ // Require blank lines before and after directive statements (replaces lines-around-directive)
500
+ { blankLine: 'always', prev: '*', next: 'directive' },
501
+ { blankLine: 'always', prev: 'directive', next: '*' },
502
+ ],
448
503
 
449
504
  // require quotes around object literal property names
450
- // https://eslint.org/docs/rules/quote-props.html
451
- 'quote-props': ['error', 'as-needed', { keywords: false, unnecessary: true, numbers: false }],
505
+ // https://eslint.style/rules/quote-props
506
+ '@stylistic/quote-props': ['error', 'as-needed', { keywords: false, unnecessary: true, numbers: false }],
452
507
 
453
508
  // specify whether double or single quotes should be used
454
- quotes: ['error', 'single', { avoidEscape: true }],
455
-
456
- // do not require jsdoc
457
- // https://eslint.org/docs/rules/require-jsdoc
458
- 'require-jsdoc': 'off',
509
+ // https://eslint.style/rules/quotes
510
+ '@stylistic/quotes': ['error', 'single', { avoidEscape: true }],
459
511
 
460
512
  // require or disallow use of semicolons instead of ASI
461
- semi: ['error', 'always'],
513
+ // https://eslint.style/rules/semi
514
+ '@stylistic/semi': ['error', 'always'],
462
515
 
463
516
  // enforce spacing before and after semicolons
464
- 'semi-spacing': ['error', { before: false, after: true }],
517
+ // https://eslint.style/rules/semi-spacing
518
+ '@stylistic/semi-spacing': ['error', { before: false, after: true }],
465
519
 
466
520
  // Enforce location of semicolons
467
- // https://eslint.org/docs/rules/semi-style
468
- 'semi-style': ['error', 'last'],
469
-
470
- // requires object keys to be sorted
471
- 'sort-keys': ['off', 'asc', { caseSensitive: false, natural: true }],
472
-
473
- // sort variables within the same declaration block
474
- 'sort-vars': 'off',
521
+ // https://eslint.style/rules/semi-style
522
+ '@stylistic/semi-style': ['error', 'last'],
475
523
 
476
524
  // require or disallow space before blocks
477
- 'space-before-blocks': 'error',
525
+ // https://eslint.style/rules/space-before-blocks
526
+ '@stylistic/space-before-blocks': 'error',
478
527
 
479
528
  // require or disallow space before function opening parenthesis
480
- // https://eslint.org/docs/rules/space-before-function-paren
481
- 'space-before-function-paren': ['error', {
529
+ // https://eslint.style/rules/space-before-function-paren
530
+ '@stylistic/space-before-function-paren': ['error', {
482
531
  anonymous: 'always',
483
532
  named: 'never',
484
533
  asyncArrow: 'always',
485
534
  }],
486
535
 
487
536
  // require or disallow spaces inside parentheses
488
- 'space-in-parens': ['error', 'never'],
537
+ // https://eslint.style/rules/space-in-parens
538
+ '@stylistic/space-in-parens': ['error', 'never'],
489
539
 
490
540
  // require spaces around operators
491
- 'space-infix-ops': 'error',
541
+ // https://eslint.style/rules/space-infix-ops
542
+ '@stylistic/space-infix-ops': 'error',
492
543
 
493
544
  // Require or disallow spaces before/after unary operators
494
- // https://eslint.org/docs/rules/space-unary-ops
495
- 'space-unary-ops': ['error', {
545
+ // https://eslint.style/rules/space-unary-ops
546
+ '@stylistic/space-unary-ops': ['error', {
496
547
  words: true,
497
548
  nonwords: false,
498
549
  overrides: {
@@ -500,8 +551,8 @@ export default {
500
551
  }],
501
552
 
502
553
  // require or disallow a space immediately following the // or /* in a comment
503
- // https://eslint.org/docs/rules/spaced-comment
504
- 'spaced-comment': ['error', 'always', {
554
+ // https://eslint.style/rules/spaced-comment
555
+ '@stylistic/spaced-comment': ['error', 'always', {
505
556
  line: {
506
557
  exceptions: ['-', '+'],
507
558
  markers: ['=', '!', '/'], // space here to support sprockets directives, slash for TS /// comments
@@ -514,17 +565,14 @@ export default {
514
565
  }],
515
566
 
516
567
  // Enforce spacing around colons of switch statements
517
- // https://eslint.org/docs/rules/switch-colon-spacing
518
- 'switch-colon-spacing': ['error', { after: true, before: false }],
568
+ // https://eslint.style/rules/switch-colon-spacing
569
+ '@stylistic/switch-colon-spacing': ['error', { after: true, before: false }],
519
570
 
520
571
  // Require or disallow spacing between template tags and their literals
521
- // https://eslint.org/docs/rules/template-tag-spacing
522
- 'template-tag-spacing': ['error', 'never'],
523
-
524
- // require or disallow the Unicode Byte Order Mark
525
- // https://eslint.org/docs/rules/unicode-bom
526
- 'unicode-bom': ['error', 'never'],
572
+ // https://eslint.style/rules/template-tag-spacing
573
+ '@stylistic/template-tag-spacing': ['error', 'never'],
527
574
 
528
575
  // require regex literals to be wrapped in parentheses
529
- 'wrap-regex': 'off',
576
+ // https://eslint.style/rules/wrap-regex
577
+ '@stylistic/wrap-regex': 'off',
530
578
  };