@adobe/eslint-config-helix 2.0.9 → 3.0.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/rules/style.js ADDED
@@ -0,0 +1,537 @@
1
+ /*
2
+ * Copyright 2024 Adobe. All rights reserved.
3
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License. You may obtain a copy
5
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
6
+ *
7
+ * Unless required by applicable law or agreed to in writing, software distributed under
8
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ * OF ANY KIND, either express or implied. See the License for the specific language
10
+ * governing permissions and limitations under the License.
11
+ */
12
+ export default {
13
+ rules: {
14
+ // enforce line breaks after opening and before closing array brackets
15
+ // https://eslint.org/docs/rules/array-bracket-newline
16
+ // TODO: enable? semver-major
17
+ 'array-bracket-newline': ['off', 'consistent'], // object option alternative: { multiline: true, minItems: 3 }
18
+
19
+ // enforce line breaks between array elements
20
+ // https://eslint.org/docs/rules/array-element-newline
21
+ // TODO: enable? semver-major
22
+ 'array-element-newline': ['off', { multiline: true, minItems: 3 }],
23
+
24
+ // enforce spacing inside array brackets
25
+ 'array-bracket-spacing': ['error', 'never'],
26
+
27
+ // enforce spacing inside single-line blocks
28
+ // https://eslint.org/docs/rules/block-spacing
29
+ 'block-spacing': ['error', 'always'],
30
+
31
+ // enforce one true brace style
32
+ 'brace-style': ['error', '1tbs', { allowSingleLine: true }],
33
+
34
+ // require camel case names
35
+ camelcase: ['error', { properties: 'never', ignoreDestructuring: false }],
36
+
37
+ // enforce or disallow capitalization of the first letter of a comment
38
+ // https://eslint.org/docs/rules/capitalized-comments
39
+ 'capitalized-comments': ['off', 'never', {
40
+ line: {
41
+ ignorePattern: '.*',
42
+ ignoreInlineComments: true,
43
+ ignoreConsecutiveComments: true,
44
+ },
45
+ block: {
46
+ ignorePattern: '.*',
47
+ ignoreInlineComments: true,
48
+ ignoreConsecutiveComments: true,
49
+ },
50
+ }],
51
+
52
+ // require trailing commas in multiline object literals
53
+ 'comma-dangle': ['error', {
54
+ arrays: 'always-multiline',
55
+ objects: 'always-multiline',
56
+ imports: 'always-multiline',
57
+ exports: 'always-multiline',
58
+ functions: 'always-multiline',
59
+ }],
60
+
61
+ // enforce spacing before and after comma
62
+ 'comma-spacing': ['error', { before: false, after: true }],
63
+
64
+ // enforce one true comma style
65
+ 'comma-style': ['error', 'last', {
66
+ exceptions: {
67
+ ArrayExpression: false,
68
+ ArrayPattern: false,
69
+ ArrowFunctionExpression: false,
70
+ CallExpression: false,
71
+ FunctionDeclaration: false,
72
+ FunctionExpression: false,
73
+ ImportDeclaration: false,
74
+ ObjectExpression: false,
75
+ ObjectPattern: false,
76
+ VariableDeclaration: false,
77
+ NewExpression: false,
78
+ },
79
+ }],
80
+
81
+ // disallow padding inside computed properties
82
+ 'computed-property-spacing': ['error', 'never'],
83
+
84
+ // enforces consistent naming when capturing the current execution context
85
+ 'consistent-this': 'off',
86
+
87
+ // enforce newline at the end of file, with no multiple empty lines
88
+ 'eol-last': ['error', 'always'],
89
+
90
+ // https://eslint.org/docs/rules/function-call-argument-newline
91
+ 'function-call-argument-newline': ['error', 'consistent'],
92
+
93
+ // enforce spacing between functions and their invocations
94
+ // https://eslint.org/docs/rules/func-call-spacing
95
+ 'func-call-spacing': ['error', 'never'],
96
+
97
+ // requires function names to match the name of the variable or property to which they are
98
+ // assigned
99
+ // https://eslint.org/docs/rules/func-name-matching
100
+ 'func-name-matching': ['off', 'always', {
101
+ includeCommonJSModuleExports: false,
102
+ considerPropertyDescriptor: true,
103
+ }],
104
+
105
+ // require function expressions to have a name
106
+ // https://eslint.org/docs/rules/func-names
107
+ 'func-names': 'warn',
108
+
109
+ // enforces use of function declarations or expressions
110
+ // https://eslint.org/docs/rules/func-style
111
+ // TODO: enable
112
+ 'func-style': ['off', 'expression'],
113
+
114
+ // require line breaks inside function parentheses if there are line breaks between parameters
115
+ // https://eslint.org/docs/rules/function-paren-newline
116
+ 'function-paren-newline': ['error', 'multiline-arguments'],
117
+
118
+ // disallow specified identifiers
119
+ // https://eslint.org/docs/rules/id-denylist
120
+ 'id-denylist': 'off',
121
+
122
+ // this option enforces minimum and maximum identifier lengths
123
+ // (variable names, property names etc.)
124
+ 'id-length': 'off',
125
+
126
+ // require identifiers to match the provided regular expression
127
+ 'id-match': 'off',
128
+
129
+ // Enforce the location of arrow function bodies with implicit returns
130
+ // https://eslint.org/docs/rules/implicit-arrow-linebreak
131
+ 'implicit-arrow-linebreak': ['error', 'beside'],
132
+
133
+ // this option sets a specific tab width for your code
134
+ // https://eslint.org/docs/rules/indent
135
+ indent: ['error', 2, {
136
+ SwitchCase: 1,
137
+ VariableDeclarator: 1,
138
+ outerIIFEBody: 1,
139
+ // MemberExpression: null,
140
+ FunctionDeclaration: {
141
+ parameters: 1,
142
+ body: 1,
143
+ },
144
+ FunctionExpression: {
145
+ parameters: 1,
146
+ body: 1,
147
+ },
148
+ CallExpression: {
149
+ arguments: 1,
150
+ },
151
+ ArrayExpression: 1,
152
+ ObjectExpression: 1,
153
+ ImportDeclaration: 1,
154
+ flatTernaryExpressions: false,
155
+ // list derived from https://github.com/benjamn/ast-types/blob/HEAD/def/jsx.js
156
+ ignoredNodes: ['JSXElement', 'JSXElement > *', 'JSXAttribute', 'JSXIdentifier', 'JSXNamespacedName', 'JSXMemberExpression', 'JSXSpreadAttribute', 'JSXExpressionContainer', 'JSXOpeningElement', 'JSXClosingElement', 'JSXFragment', 'JSXOpeningFragment', 'JSXClosingFragment', 'JSXText', 'JSXEmptyExpression', 'JSXSpreadChild'],
157
+ ignoreComments: false,
158
+ }],
159
+
160
+ // specify whether double or single quotes should be used in JSX attributes
161
+ // https://eslint.org/docs/rules/jsx-quotes
162
+ 'jsx-quotes': ['off', 'prefer-double'],
163
+
164
+ // enforces spacing between keys and values in object literal properties
165
+ 'key-spacing': ['error', { beforeColon: false, afterColon: true }],
166
+
167
+ // require a space before & after certain keywords
168
+ 'keyword-spacing': ['error', {
169
+ before: true,
170
+ after: true,
171
+ overrides: {
172
+ return: { after: true },
173
+ throw: { after: true },
174
+ case: { after: true },
175
+ },
176
+ }],
177
+
178
+ // enforce position of line comments
179
+ // https://eslint.org/docs/rules/line-comment-position
180
+ // TODO: enable?
181
+ 'line-comment-position': ['off', {
182
+ position: 'above',
183
+ ignorePattern: '',
184
+ applyDefaultPatterns: true,
185
+ }],
186
+
187
+ // disallow mixed 'LF' and 'CRLF' as linebreaks
188
+ // https://eslint.org/docs/rules/linebreak-style
189
+ 'linebreak-style': ['error', 'unix'],
190
+
191
+ // require or disallow an empty line between class members
192
+ // https://eslint.org/docs/rules/lines-between-class-members
193
+ 'lines-between-class-members': ['error', 'always', { exceptAfterSingleLine: false }],
194
+
195
+ // enforces empty lines around comments
196
+ 'lines-around-comment': 'off',
197
+
198
+ // require or disallow newlines around directives
199
+ // https://eslint.org/docs/rules/lines-around-directive
200
+ 'lines-around-directive': ['error', {
201
+ before: 'always',
202
+ after: 'always',
203
+ }],
204
+
205
+ // specify the maximum depth that blocks can be nested
206
+ 'max-depth': ['off', 4],
207
+
208
+ // specify the maximum length of a line in your program
209
+ // https://eslint.org/docs/rules/max-len
210
+ 'max-len': ['error', 100, 2, {
211
+ ignoreUrls: true,
212
+ ignoreComments: false,
213
+ ignoreRegExpLiterals: true,
214
+ ignoreStrings: true,
215
+ ignoreTemplateLiterals: true,
216
+ }],
217
+
218
+ // specify the max number of lines in a file
219
+ // https://eslint.org/docs/rules/max-lines
220
+ 'max-lines': ['off', {
221
+ max: 300,
222
+ skipBlankLines: true,
223
+ skipComments: true,
224
+ }],
225
+
226
+ // enforce a maximum function length
227
+ // https://eslint.org/docs/rules/max-lines-per-function
228
+ 'max-lines-per-function': ['off', {
229
+ max: 50,
230
+ skipBlankLines: true,
231
+ skipComments: true,
232
+ IIFEs: true,
233
+ }],
234
+
235
+ // specify the maximum depth callbacks can be nested
236
+ 'max-nested-callbacks': 'off',
237
+
238
+ // limits the number of parameters that can be used in the function declaration.
239
+ 'max-params': ['off', 3],
240
+
241
+ // specify the maximum number of statement allowed in a function
242
+ 'max-statements': ['off', 10],
243
+
244
+ // restrict the number of statements per line
245
+ // https://eslint.org/docs/rules/max-statements-per-line
246
+ 'max-statements-per-line': ['off', { max: 1 }],
247
+
248
+ // enforce a particular style for multiline comments
249
+ // https://eslint.org/docs/rules/multiline-comment-style
250
+ 'multiline-comment-style': ['off', 'starred-block'],
251
+
252
+ // require multiline ternary
253
+ // https://eslint.org/docs/rules/multiline-ternary
254
+ // TODO: enable?
255
+ 'multiline-ternary': ['off', 'never'],
256
+
257
+ // require a capital letter for constructors
258
+ 'new-cap': ['error', {
259
+ newIsCap: true,
260
+ newIsCapExceptions: [],
261
+ capIsNew: false,
262
+ capIsNewExceptions: ['Immutable.Map', 'Immutable.Set', 'Immutable.List'],
263
+ }],
264
+
265
+ // disallow the omission of parentheses when invoking a constructor with no arguments
266
+ // https://eslint.org/docs/rules/new-parens
267
+ 'new-parens': 'error',
268
+
269
+ // allow/disallow an empty newline after var statement
270
+ 'newline-after-var': 'off',
271
+
272
+ // https://eslint.org/docs/rules/newline-before-return
273
+ 'newline-before-return': 'off',
274
+
275
+ // enforces new line after each method call in the chain to make it
276
+ // more readable and easy to maintain
277
+ // https://eslint.org/docs/rules/newline-per-chained-call
278
+ 'newline-per-chained-call': ['error', { ignoreChainWithDepth: 4 }],
279
+
280
+ // disallow use of the Array constructor
281
+ 'no-array-constructor': 'error',
282
+
283
+ // disallow use of bitwise operators
284
+ // https://eslint.org/docs/rules/no-bitwise
285
+ 'no-bitwise': 'error',
286
+
287
+ // disallow use of the continue statement
288
+ // https://eslint.org/docs/rules/no-continue
289
+ 'no-continue': 'error',
290
+
291
+ // disallow comments inline after code
292
+ 'no-inline-comments': 'off',
293
+
294
+ // disallow if as the only statement in an else block
295
+ // https://eslint.org/docs/rules/no-lonely-if
296
+ 'no-lonely-if': 'error',
297
+
298
+ // disallow un-paren'd mixes of different operators
299
+ // https://eslint.org/docs/rules/no-mixed-operators
300
+ 'no-mixed-operators': ['error', {
301
+ // the list of arithmetic groups disallows mixing `%` and `**`
302
+ // with other arithmetic operators.
303
+ groups: [
304
+ ['%', '**'],
305
+ ['%', '+'],
306
+ ['%', '-'],
307
+ ['%', '*'],
308
+ ['%', '/'],
309
+ ['/', '*'],
310
+ ['&', '|', '<<', '>>', '>>>'],
311
+ ['==', '!=', '===', '!=='],
312
+ ['&&', '||'],
313
+ ],
314
+ allowSamePrecedence: false,
315
+ }],
316
+
317
+ // disallow mixed spaces and tabs for indentation
318
+ 'no-mixed-spaces-and-tabs': 'error',
319
+
320
+ // disallow use of chained assignment expressions
321
+ // https://eslint.org/docs/rules/no-multi-assign
322
+ 'no-multi-assign': ['error'],
323
+
324
+ // disallow multiple empty lines, only one newline at the end, and no new lines at the beginning
325
+ // https://eslint.org/docs/rules/no-multiple-empty-lines
326
+ 'no-multiple-empty-lines': ['error', { max: 1, maxBOF: 0, maxEOF: 0 }],
327
+
328
+ // disallow negated conditions
329
+ // https://eslint.org/docs/rules/no-negated-condition
330
+ 'no-negated-condition': 'off',
331
+
332
+ // disallow nested ternary expressions
333
+ 'no-nested-ternary': 'error',
334
+
335
+ // disallow use of the Object constructor
336
+ 'no-new-object': 'error',
337
+
338
+ // disallow use of unary operators, ++ and --
339
+ // https://eslint.org/docs/rules/no-plusplus
340
+ 'no-plusplus': 'error',
341
+
342
+ // disallow certain syntax forms
343
+ // https://eslint.org/docs/rules/no-restricted-syntax
344
+ 'no-restricted-syntax': [
345
+ 'error',
346
+ {
347
+ selector: 'ForInStatement',
348
+ message: 'for..in loops iterate over the entire prototype chain, which is virtually never what you want. Use Object.{keys,values,entries}, and iterate over the resulting array.',
349
+ },
350
+ {
351
+ selector: 'ForOfStatement',
352
+ message: 'iterators/generators require regenerator-runtime, which is too heavyweight for this guide to allow them. Separately, loops should be avoided in favor of array iterations.',
353
+ },
354
+ {
355
+ selector: 'LabeledStatement',
356
+ message: 'Labels are a form of GOTO; using them makes code confusing and hard to maintain and understand.',
357
+ },
358
+ {
359
+ selector: 'WithStatement',
360
+ message: '`with` is disallowed in strict mode because it makes code impossible to predict and optimize.',
361
+ },
362
+ ],
363
+
364
+ // disallow space between function identifier and application
365
+ 'no-spaced-func': 'error',
366
+
367
+ // disallow tab characters entirely
368
+ 'no-tabs': 'error',
369
+
370
+ // disallow the use of ternary operators
371
+ 'no-ternary': 'off',
372
+
373
+ // disallow trailing whitespace at the end of lines
374
+ 'no-trailing-spaces': ['error', {
375
+ skipBlankLines: false,
376
+ ignoreComments: false,
377
+ }],
378
+
379
+ // disallow dangling underscores in identifiers
380
+ // https://eslint.org/docs/rules/no-underscore-dangle
381
+ 'no-underscore-dangle': ['error', {
382
+ allow: [],
383
+ allowAfterThis: false,
384
+ allowAfterSuper: false,
385
+ enforceInMethodNames: true,
386
+ }],
387
+
388
+ // disallow the use of Boolean literals in conditional expressions
389
+ // also, prefer `a || b` over `a ? a : b`
390
+ // https://eslint.org/docs/rules/no-unneeded-ternary
391
+ 'no-unneeded-ternary': ['error', { defaultAssignment: false }],
392
+
393
+ // disallow whitespace before properties
394
+ // https://eslint.org/docs/rules/no-whitespace-before-property
395
+ 'no-whitespace-before-property': 'error',
396
+
397
+ // enforce the location of single-line statements
398
+ // https://eslint.org/docs/rules/nonblock-statement-body-position
399
+ 'nonblock-statement-body-position': ['error', 'beside', { overrides: {} }],
400
+
401
+ // require padding inside curly braces
402
+ 'object-curly-spacing': ['error', 'always'],
403
+
404
+ // enforce line breaks between braces
405
+ // https://eslint.org/docs/rules/object-curly-newline
406
+ 'object-curly-newline': ['error', {
407
+ ObjectExpression: { minProperties: 4, multiline: true, consistent: true },
408
+ ObjectPattern: { minProperties: 4, multiline: true, consistent: true },
409
+ ImportDeclaration: { minProperties: 4, multiline: true, consistent: true },
410
+ ExportDeclaration: { minProperties: 4, multiline: true, consistent: true },
411
+ }],
412
+
413
+ // enforce "same line" or "multiple line" on object properties.
414
+ // https://eslint.org/docs/rules/object-property-newline
415
+ 'object-property-newline': ['error', {
416
+ allowAllPropertiesOnSameLine: true,
417
+ }],
418
+
419
+ // allow just one var statement per function
420
+ 'one-var': ['error', 'never'],
421
+
422
+ // require a newline around variable declaration
423
+ // https://eslint.org/docs/rules/one-var-declaration-per-line
424
+ 'one-var-declaration-per-line': ['error', 'always'],
425
+
426
+ // require assignment operator shorthand where possible or prohibit it entirely
427
+ // https://eslint.org/docs/rules/operator-assignment
428
+ 'operator-assignment': ['error', 'always'],
429
+
430
+ // Requires operator at the beginning of the line in multiline statements
431
+ // https://eslint.org/docs/rules/operator-linebreak
432
+ 'operator-linebreak': ['error', 'before', { overrides: { '=': 'none' } }],
433
+
434
+ // disallow padding within blocks
435
+ 'padded-blocks': ['error', {
436
+ blocks: 'never',
437
+ classes: 'never',
438
+ switches: 'never',
439
+ }, {
440
+ allowSingleLineBlocks: true,
441
+ }],
442
+
443
+ // Require or disallow padding lines between statements
444
+ // https://eslint.org/docs/rules/padding-line-between-statements
445
+ 'padding-line-between-statements': 'off',
446
+
447
+ // Disallow the use of Math.pow in favor of the ** operator
448
+ // https://eslint.org/docs/rules/prefer-exponentiation-operator
449
+ 'prefer-exponentiation-operator': 'error',
450
+
451
+ // Prefer use of an object spread over Object.assign
452
+ // https://eslint.org/docs/rules/prefer-object-spread
453
+ 'prefer-object-spread': 'error',
454
+
455
+ // require quotes around object literal property names
456
+ // https://eslint.org/docs/rules/quote-props.html
457
+ 'quote-props': ['error', 'as-needed', { keywords: false, unnecessary: true, numbers: false }],
458
+
459
+ // specify whether double or single quotes should be used
460
+ quotes: ['error', 'single', { avoidEscape: true }],
461
+
462
+ // do not require jsdoc
463
+ // https://eslint.org/docs/rules/require-jsdoc
464
+ 'require-jsdoc': 'off',
465
+
466
+ // require or disallow use of semicolons instead of ASI
467
+ semi: ['error', 'always'],
468
+
469
+ // enforce spacing before and after semicolons
470
+ 'semi-spacing': ['error', { before: false, after: true }],
471
+
472
+ // Enforce location of semicolons
473
+ // https://eslint.org/docs/rules/semi-style
474
+ 'semi-style': ['error', 'last'],
475
+
476
+ // requires object keys to be sorted
477
+ 'sort-keys': ['off', 'asc', { caseSensitive: false, natural: true }],
478
+
479
+ // sort variables within the same declaration block
480
+ 'sort-vars': 'off',
481
+
482
+ // require or disallow space before blocks
483
+ 'space-before-blocks': 'error',
484
+
485
+ // require or disallow space before function opening parenthesis
486
+ // https://eslint.org/docs/rules/space-before-function-paren
487
+ 'space-before-function-paren': ['error', {
488
+ anonymous: 'always',
489
+ named: 'never',
490
+ asyncArrow: 'always',
491
+ }],
492
+
493
+ // require or disallow spaces inside parentheses
494
+ 'space-in-parens': ['error', 'never'],
495
+
496
+ // require spaces around operators
497
+ 'space-infix-ops': 'error',
498
+
499
+ // Require or disallow spaces before/after unary operators
500
+ // https://eslint.org/docs/rules/space-unary-ops
501
+ 'space-unary-ops': ['error', {
502
+ words: true,
503
+ nonwords: false,
504
+ overrides: {
505
+ },
506
+ }],
507
+
508
+ // require or disallow a space immediately following the // or /* in a comment
509
+ // https://eslint.org/docs/rules/spaced-comment
510
+ 'spaced-comment': ['error', 'always', {
511
+ line: {
512
+ exceptions: ['-', '+'],
513
+ markers: ['=', '!', '/'], // space here to support sprockets directives, slash for TS /// comments
514
+ },
515
+ block: {
516
+ exceptions: ['-', '+'],
517
+ markers: ['=', '!', ':', '::'], // space here to support sprockets directives and flow comment types
518
+ balanced: true,
519
+ },
520
+ }],
521
+
522
+ // Enforce spacing around colons of switch statements
523
+ // https://eslint.org/docs/rules/switch-colon-spacing
524
+ 'switch-colon-spacing': ['error', { after: true, before: false }],
525
+
526
+ // Require or disallow spacing between template tags and their literals
527
+ // https://eslint.org/docs/rules/template-tag-spacing
528
+ 'template-tag-spacing': ['error', 'never'],
529
+
530
+ // require or disallow the Unicode Byte Order Mark
531
+ // https://eslint.org/docs/rules/unicode-bom
532
+ 'unicode-bom': ['error', 'never'],
533
+
534
+ // require regex literals to be wrapped in parentheses
535
+ 'wrap-regex': 'off',
536
+ },
537
+ };
@@ -0,0 +1,68 @@
1
+ /*
2
+ * Copyright 2024 Adobe. All rights reserved.
3
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License. You may obtain a copy
5
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
6
+ *
7
+ * Unless required by applicable law or agreed to in writing, software distributed under
8
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ * OF ANY KIND, either express or implied. See the License for the specific language
10
+ * governing permissions and limitations under the License.
11
+ */
12
+ export default {
13
+ rules: {
14
+ // enforce or disallow variable initializations at definition
15
+ 'init-declarations': 'off',
16
+
17
+ // disallow the catch clause parameter name being the same as a variable in the outer scope
18
+ 'no-catch-shadow': 'off',
19
+
20
+ // disallow deletion of variables
21
+ 'no-delete-var': 'error',
22
+
23
+ // disallow labels that share a name with a variable
24
+ // https://eslint.org/docs/rules/no-label-var
25
+ 'no-label-var': 'error',
26
+
27
+ // disallow specific globals
28
+ 'no-restricted-globals': [
29
+ 'error',
30
+ {
31
+ name: 'isFinite',
32
+ message:
33
+ 'Use Number.isFinite instead https://github.com/airbnb/javascript#standard-library--isfinite',
34
+ },
35
+ {
36
+ name: 'isNaN',
37
+ message:
38
+ 'Use Number.isNaN instead https://github.com/airbnb/javascript#standard-library--isnan',
39
+ },
40
+ ], /* .concat(confusingBrowserGlobals.map((g) => ({
41
+ name: g,
42
+ message: `Use window.${g} instead. https://github.com/facebook/create-react-app/blob/HEAD/packages/confusing-browser-globals/README.md`,
43
+ }))), */
44
+
45
+ // disallow declaration of variables already declared in the outer scope
46
+ 'no-shadow': 'error',
47
+
48
+ // disallow shadowing of names such as arguments
49
+ 'no-shadow-restricted-names': 'error',
50
+
51
+ // disallow use of undeclared variables unless mentioned in a /*global */ block
52
+ 'no-undef': 'error',
53
+
54
+ // disallow use of undefined when initializing variables
55
+ 'no-undef-init': 'error',
56
+
57
+ // disallow use of undefined variable
58
+ // https://eslint.org/docs/rules/no-undefined
59
+ // TODO: enable?
60
+ 'no-undefined': 'off',
61
+
62
+ // disallow declaration of variables that are not used in the code
63
+ 'no-unused-vars': ['error', { vars: 'all', args: 'after-used', ignoreRestSiblings: true }],
64
+
65
+ // disallow use of variables before they are defined
66
+ 'no-use-before-define': ['error', { functions: true, classes: true, variables: true }],
67
+ },
68
+ };