@wildpastry/eslint-config 1.0.5 → 1.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.
Files changed (4) hide show
  1. package/.eslintrc +245 -413
  2. package/README.md +29 -1
  3. package/index.js +320 -9
  4. package/package.json +2 -2
package/.eslintrc CHANGED
@@ -1,492 +1,324 @@
1
1
  /* KEY:
2
-
3
2
  * DONE = Checked and accepted rule
4
-
5
3
  * DONE - CUSTOMISED = Accepted rule but changed default behaviour
6
-
7
4
  * DONE - OFF = Disabled rule
8
-
9
5
  */
10
-
11
6
  {
12
7
  "root": true,
13
8
 
14
- "ignorePatterns": ["projects/**/*", "cypress/*"],
9
+ "ignorePatterns": ["cypress/*"],
15
10
 
16
11
  "overrides": [
17
12
  {
18
- "plugins": ["react"],
19
-
20
- "files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
21
-
22
- "parserOptions": {
23
- "project": ["**/tsconfig.json"],
24
- "sourceType": "module",
25
- "createDefaultProgram": true,
26
- "ecmaFeatures": {
27
- "jsx": true
28
- }
29
- },
30
-
31
13
  "extends": [
32
14
  "eslint:recommended",
33
-
34
15
  "plugin:@typescript-eslint/recommended",
35
-
36
16
  "plugin:@typescript-eslint/recommended-requiring-type-checking"
37
-
38
17
  ],
39
18
 
40
- "rules": {
41
- "react/jsx-uses-react": 1, // DONE
42
-
43
- "react/jsx-uses-vars": 1, // DONE
44
-
45
- "@typescript-eslint/no-inferrable-types": 0, // DONE - OFF
46
-
47
- "@typescript-eslint/no-unsafe-assignment": 0, // DONE - OFF
48
-
49
- "@typescript-eslint/no-unsafe-member-access": 0, // DONE - OFF
50
-
51
- "array-callback-return": 0, //enforce `return` statements in callbacks of array methods // DONE - OFF
52
-
53
- "no-await-in-loop": 0, //disallow `await` inside of loops // DONE - OFF
54
-
55
- "no-constructor-return": 0, //disallow returning value from constructor // DONE - OFF
56
-
57
- "no-duplicate-imports": 1, //disallow duplicate module imports // DONE
58
-
59
- "no-promise-executor-return": 0, //disallow returning values from Promise executor functions // DONE - OFF
60
-
61
- "no-self-compare": 1, //disallow comparisons where both sides are exactly the same // DONE
62
-
63
- "no-template-curly-in-string": 0, //disallow template literal placeholder syntax in regular strings // DONE - OFF
64
-
65
- "no-unmodified-loop-condition": 1, //disallow unmodified loop conditions // DONE
66
-
67
- "no-unreachable-loop": 1, //disallow loops with a body that allows only one iteration // DONE
68
-
69
- "no-use-before-define": 0, //disallow the use of variables before they are defined // DONE - OFF
70
-
71
- "require-atomic-updates": 1, //disallow assignments that can lead to race conditions due to usage of `await` or `yield` // DONE
72
-
73
- "accessor-pairs": 0, //enforce getter and setter pairs in objects and classes // DONE - OFF
74
-
75
- "arrow-body-style": 0, //require braces around arrow function bodies // DONE - OFF
76
-
77
- "block-scoped-var": 1, //enforce the use of variables within the scope they are defined // DONE
78
-
79
- "camelcase": 1, //enforce camelcase naming convention // DONE
80
-
81
- "capitalized-comments": 1, //enforce or disallow capitalization of the first letter of a comment // DONE
82
-
83
- "class-methods-use-this": 0, //enforce that class methods utilize `this` // DONE
84
-
85
- "complexity": 1, //enforce a maximum cyclomatic complexity allowed in a program // DONE
86
-
87
- "consistent-return": 1, //require `return` statements to either always or never specify values // DONE
88
-
89
- "consistent-this": 1, //enforce consistent naming when capturing the current execution context // DONE
90
-
91
- "curly": 1, //enforce consistent brace style for all control statements // DONE
92
-
93
- "default-case": 1, //require `default` cases in `switch` statements // DONE
94
-
95
- "default-case-last": 1, //enforce default clauses in switch statements to be last // DONE
96
-
97
- "default-param-last": 1, //enforce default parameters to be last // DONE
98
-
99
- "dot-notation": 1, //enforce dot notation whenever possible // DONE
100
-
101
- "eqeqeq": 1, //require the use of `===` and `!==` // DONE
102
-
103
- "func-name-matching": 1, //require function names to match the name of the variable or property to which they are assigned // DONE
104
-
105
- "func-names": 1, //require or disallow named `function` expressions // DONE
106
-
107
- "func-style": 0, //enforce the consistent use of either `function` declarations or expressions // DONE - OFF
108
-
109
- "grouped-accessor-pairs": 1, //require grouped accessor pairs in object literals and classes // DONE
110
-
111
- "guard-for-in": 1, //require `for-in` loops to include an `if` statement // DONE
112
-
113
- "id-denylist": 1, //disallow specified identifiers // DONE
114
-
115
- "id-length": 0, //enforce minimum and maximum identifier lengths // DONE - OFF
116
-
117
- "id-match": 1, //require identifiers to match a specified regular expression // DONE
118
-
119
- "init-declarations": 0, //require or disallow initialization in variable declarations // DONE - OFF
120
-
121
- "max-classes-per-file": 1, //enforce a maximum number of classes per file // DONE
122
-
123
- "max-depth": 1, //enforce a maximum depth that blocks can be nested // DONE
124
-
125
- "max-lines": ["warn", { "max": 600, "skipBlankLines": true }], //enforce a maximum number of lines per file // DONE - CUSTOMISED
126
-
127
- "max-lines-per-function": ["warn", { "max": 300 }], //enforce a maximum number of lines of code in a function // DONE - CUSTOMISED
128
-
129
- "max-nested-callbacks": 1, //enforce a maximum depth that callbacks can be nested // DONE
130
-
131
- "max-params": ["warn", { "max": 7 }], //enforce a maximum number of parameters in function definitions // DONE - CUSTOMISED
132
-
133
- "max-statements": ["warn", { "max": 20 }], //enforce a maximum number of statements allowed in function blocks // DONE - CUSTOMISED
134
-
135
- "multiline-comment-style": 1, //enforce a particular style for multiline comments // DONE
136
-
137
- "new-cap": 0, //require constructor names to begin with a capital letter // DONE - OFF
138
-
139
- "no-alert": 1, //disallow the use of `alert`, `confirm`, and `prompt` // DONE
140
-
141
- "no-array-constructor": 1, //disallow `Array` constructors // DONE
142
-
143
- "no-bitwise": 1, //disallow bitwise operators // DONE
144
-
145
- "no-caller": 1, //disallow the use of `arguments.caller` or `arguments.callee` // DONE
146
-
147
- "no-case-declarations": 1, //disallow lexical declarations in case clauses // DONE
148
-
149
- "no-confusing-arrow": 1, //disallow arrow functions where they could be confused with comparisons // DONE
150
-
151
- "no-console": 1, //disallow the use of `console` // DONE
152
-
153
- "no-continue": 1, //disallow `continue` statements // DONE
154
-
155
- "no-delete-var": 1, //disallow deleting variables // DONE
156
-
157
- "no-div-regex": 1, //disallow division operators explicitly at the beginning of regular expressions // DONE
158
-
159
- "no-else-return": 1, //disallow `else` blocks after `return` statements in `if` statements // DONE
160
-
161
- "no-empty": 1, //disallow empty block statements // DONE
162
-
163
- "no-empty-function": ["error", { "allow": ["constructors"] }], //disallow empty functions // DONE - CUSTOMISED
164
-
165
- "no-eq-null": 1, //disallow `null` comparisons without type-checking operators // DONE
166
-
167
- "no-eval": 1, //disallow the use of `eval()` // DONE
168
-
169
- "no-extend-native": 1, //disallow extending native types // DONE
170
-
171
- "no-extra-bind": 1, //disallow unnecessary calls to `.bind()` // DONE
172
-
173
- "no-extra-boolean-cast": 1, //disallow unnecessary boolean casts // DONE
174
-
175
- "no-extra-label": 1, //disallow unnecessary labels // DONE
176
-
177
- "no-extra-semi": 1, //disallow unnecessary semicolons // DONE
178
-
179
- "no-floating-decimal": 1, //disallow leading or trailing decimal points in numeric literals // DONE
180
-
181
- "no-global-assign": 1, //disallow assignments to native objects or read-only global variables // DONE
182
-
183
- "no-implicit-coercion": 1, //disallow shorthand type conversions // DONE
184
-
185
- "no-implicit-globals": 1, //disallow declarations in the global scope // DONE
186
-
187
- "no-implied-eval": 1, //disallow the use of `eval()`-like methods // DONE
188
-
189
- "no-inline-comments": 1, //disallow inline comments after code // DONE
190
-
191
- "no-invalid-this": 1, //disallow `this` keywords outside of classes or class-like objects // DONE
192
-
193
- "no-iterator": 1, //disallow the use of the `__iterator__` property // DONE
194
-
195
- "no-label-var": 1, //disallow labels that share a name with a variable // DONE
196
-
197
- "no-labels": 1, //disallow labeled statements // DONE
198
-
199
- "no-lone-blocks": 1, //disallow unnecessary nested blocks // DONE
200
-
201
- "no-lonely-if": 1, //disallow `if` statements as the only statement in `else` blocks // DONE
202
-
203
- "no-loop-func": 1, //disallow function declarations that contain unsafe references inside loop statements // DONE
204
-
205
- "no-magic-numbers": 0, //disallow magic numbers // Comment, this rule seems to be hard to satisfy. // DONE
206
-
207
- "no-mixed-operators": 1, //disallow mixed binary operators // DONE
208
-
209
- "no-multi-assign": 1, //disallow use of chained assignment expressions // DONE
210
-
211
- "no-multi-str": 1, //disallow multiline strings // DONE
212
-
213
- "no-negated-condition": 1, //disallow negated conditions // DONE
214
-
215
- "no-nested-ternary": 1, //disallow nested ternary expressions // DONE
216
-
217
- "no-new": 1, //disallow `new` operators outside of assignments or comparisons // DONE
218
-
219
- "no-new-func": 1, //disallow `new` operators with the `Function` object // DONE
220
-
221
- "no-new-object": 1, //disallow `Object` constructors // DONE
222
-
223
- "no-new-wrappers": 1, //disallow `new` operators with the `String`, `Number`, and `Boolean` objects // DONE
224
-
225
- "no-nonoctal-decimal-escape": 1, //disallow `\8` and `\9` escape sequences in string literals // DONE
226
-
227
- "no-octal": 1, //disallow octal literals // DONE
228
-
229
- "no-octal-escape": 1, //disallow octal escape sequences in string literals // DONE
230
-
231
- "no-param-reassign": 1, //disallow reassigning `function` parameters // DONE
232
-
233
- "no-plusplus": 1, //disallow the unary operators `++` and `--` // DONE
234
-
235
- "no-proto": 1, //disallow the use of the `__proto__` property // DONE
236
-
237
- "no-redeclare": 1, //disallow variable redeclaration // DONE
238
-
239
- "no-regex-spaces": 1, //disallow multiple spaces in regular expressions // DONE
240
-
241
- "no-restricted-exports": 1, //disallow specified names in exports // DONE
242
-
243
- "no-restricted-globals": 1, //disallow specified global variables // DONE
244
-
245
- "no-restricted-imports": 1, //disallow specified modules when loaded by `import` // DONE
246
-
247
- "no-restricted-properties": 1, //disallow certain properties on certain objects // DONE
248
-
249
- "no-restricted-syntax": 1, //disallow specified syntax // DONE
250
-
251
- "no-return-assign": 1, //disallow assignment operators in `return` statements // DONE
252
-
253
- "no-return-await": 1, //disallow unnecessary `return await` // DONE
254
-
255
- "no-script-url": 1, //disallow `javascript:` urls // DONE
256
-
257
- "no-sequences": 1, //disallow comma operators // DONE
258
-
259
- "no-shadow": 0, //disallow variable declarations from shadowing variables declared in the outer scope // DONE
260
-
261
- "no-shadow-restricted-names": 1, //disallow identifiers from shadowing restricted names // DONE
262
-
263
- "no-ternary": 0, //disallow ternary operators // DONE - OFF
264
-
265
- "no-throw-literal": 1, //disallow throwing literals as exceptions // DONE
266
-
267
- "no-undef-init": 1, //disallow initializing variables to `undefined` // DONE
268
-
269
- "no-undefined": 0, //disallow the use of `undefined` as an identifier // DONE
270
-
271
- "no-underscore-dangle": 0, //disallow dangling underscores in identifiers // DONE
272
-
273
- "no-unneeded-ternary": 0, //disallow ternary operators when simpler alternatives exist // DONE - OFF
274
-
275
- "no-unused-expressions": 0, //disallow unused expressions // DONE - OFF
276
-
277
- "no-unused-labels": 1, //disallow unused labels // DONE
278
-
279
- "no-useless-call": 1, //disallow unnecessary calls to `.call()` and `.apply()` // DONE
280
-
281
- "no-useless-catch": 1, //disallow unnecessary `catch` clauses // DONE
282
-
283
- "no-useless-computed-key": 1, //disallow unnecessary computed property keys in objects and classes // DONE
284
-
285
- "no-useless-concat": 1, //disallow unnecessary concatenation of literals or template literals // DONE
286
-
287
- "no-useless-constructor": 0, //disallow unnecessary constructors // DONE
288
-
289
- "no-useless-escape": 1, //disallow unnecessary escape characters // DONE
290
-
291
- "no-useless-rename": 1, //disallow renaming import, export, and destructured assignments to the same name // DONE
292
-
293
- "no-useless-return": 1, //disallow redundant return statements // DONE
294
-
295
- "no-var": 1, //require `let` or `const` instead of `var` // DONE
296
-
297
- "no-void": ["error", { "allowAsStatement": true }], //disallow `void` operators // DONE - CUSTOMISED
298
-
299
- "no-warning-comments": 1, //disallow specified warning terms in comments // DONE
300
-
301
- "no-with": 1, //disallow `with` statements // DONE
302
-
303
- "object-shorthand": 0, //require or disallow method and property shorthand syntax for object literals // DONE
304
-
305
- "one-var": 0, //enforce variables to be declared either together or separately in functions // DONE
306
-
307
- "one-var-declaration-per-line": 1, //require or disallow newlines around variable declarations // DONE
308
-
309
- "operator-assignment": 1, //require or disallow assignment operator shorthand where possible // DONE
310
-
311
- "prefer-arrow-callback": 1, //require using arrow functions for callbacks // DONE
312
-
313
- "prefer-const": 1, //require `const` declarations for variables that are never reassigned after declared // DONE
314
-
315
- "prefer-destructuring": 0, //require destructuring from arrays and/or objects // DONE - OFF
316
-
317
- "prefer-exponentiation-operator": 1, //disallow the use of `Math.pow` in favor of the `**` operator // DONE
318
-
319
- "prefer-named-capture-group": 1, //enforce using named capture group in regular expression // DONE
320
-
321
- "prefer-numeric-literals": 1, //disallow `parseInt()` and `Number.parseInt()` in favor of binary, octal, and hexadecimal literals // DONE
322
-
323
- "prefer-object-spread": 1, //disallow using Object.assign with an object literal as the first argument and prefer the use of object spread instead. // DONE
324
-
325
- "prefer-promise-reject-errors": 1, //require using Error objects as Promise rejection reasons // DONE
326
-
327
- "prefer-regex-literals": 1, //disallow use of the `RegExp` constructor in favor of regular expression literals // DONE
328
-
329
- "prefer-rest-params": 1, //require rest parameters instead of `arguments` // DONE
330
-
331
- "prefer-spread": 1, //require spread operators instead of `.apply()` // DONE
332
-
333
- "prefer-template": 1, //require template literals instead of string concatenation // DONE
334
-
335
- "quote-props": 0, //require quotes around object literal property names // DONE
336
-
337
- "radix": 1, //enforce the consistent use of the radix argument when using `parseInt()` // DONE
338
-
339
- "require-await": 1, //disallow async functions which have no `await` expression // DONE
340
-
341
- "require-unicode-regexp": 1, //enforce the use of `u` flag on RegExp // DONE
342
-
343
- "require-yield": 1, //require generator functions to contain `yield` // DONE
344
-
345
- "sort-imports": 1, //enforce sorted import declarations within modules // DONE
346
-
347
- "sort-keys": 0, //require object keys to be sorted // DONE
348
-
349
- "sort-vars": 1, //require variables within the same declaration block to be sorted // DONE
350
-
351
- "spaced-comment": 1, //enforce consistent spacing after the `//` or `/*` in a comment // DONE
352
-
353
- "strict": 1, //require or disallow strict mode directives // DONE
354
-
355
- "symbol-description": 1, //require symbol descriptions // DONE
19
+ "env": {
20
+ "browser": true,
21
+ "node": true,
22
+ "es6": true
23
+ },
356
24
 
357
- "vars-on-top": 1, //require `var` declarations be placed at the top of their containing scope // DONE
25
+ "plugins": ["react"],
358
26
 
359
- "yoda": 1, //require or disallow "Yoda" conditions // DONE
27
+ "files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
360
28
 
361
- // Layout & Formatting: https://eslint.org/docs/rules/
29
+ "ecmaFeatures": {
30
+ "arrowFunctions": true,
31
+ "binaryLiterals": true,
32
+ "blockBindings": true,
33
+ "classes": true,
34
+ "defaultParams": true,
35
+ "destructuring": true,
36
+ "forOf": true,
37
+ "generators": true,
38
+ "modules": true,
39
+ "objectLiteralComputedProperties": true,
40
+ "objectLiteralDuplicateProperties": true,
41
+ "objectLiteralShorthandMethods": true,
42
+ "objectLiteralShorthandProperties": true,
43
+ "octalLiterals": true,
44
+ "regexUFlag": true,
45
+ "regexYFlag": true,
46
+ "spread": true,
47
+ "superInFunctions": true,
48
+ "templateStrings": true,
49
+ "unicodeCodePointEscapes": true,
50
+ "globalReturn": true,
51
+ "jsx": true
52
+ },
362
53
 
54
+ "rules": {
55
+ "no-inferrable-types": 0, // disallow explicit type declarations for variables or parameters initialized to a number, string, or boolean // DONE - OFF
56
+ "no-unsafe-assignment": 0, // disallow assigning a value with type any to variables and properties // DONE - OFF
57
+ "no-unsafe-member-access": 0, //disallow member access on a value with type any // DONE - OFF
58
+ "array-callback-return": 0, // enforce `return` statements in callbacks of array methods // DONE - OFF
59
+ "no-await-in-loop": 0, // disallow `await` inside of loops // DONE - OFF
60
+ "no-constructor-return": 0, // disallow returning value from constructor // DONE - OFF
61
+ "no-duplicate-imports": 1, // disallow duplicate module imports // DONE
62
+ "no-promise-executor-return": 0, // disallow returning values from Promise executor functions // DONE - OFF
63
+ "no-self-compare": 1, // disallow comparisons where both sides are exactly the same // DONE
64
+ "no-template-curly-in-string": 0, // disallow template literal placeholder syntax in regular strings // DONE - OFF
65
+ "no-unmodified-loop-condition": 1, // disallow unmodified loop conditions // DONE
66
+ "no-unreachable-loop": 1, // disallow loops with a body that allows only one iteration // DONE
67
+ "no-use-before-define": 0, // disallow the use of variables before they are defined // DONE - OFF
68
+ "require-atomic-updates": 1, // disallow assignments that can lead to race conditions due to usage of `await` or `yield` // DONE
69
+ "accessor-pairs": 0, // enforce getter and setter pairs in objects and classes // DONE - OFF
70
+ "arrow-body-style": 0, // require braces around arrow function bodies // DONE - OFF
71
+ "block-scoped-var": 1, // enforce the use of variables within the scope they are defined // DONE
72
+ "camelcase": 1, // enforce camelcase naming convention // DONE
73
+ "capitalized-comments": 1, // enforce or disallow capitalization of the first letter of a comment // DONE
74
+ "class-methods-use-this": 0, // enforce that class methods utilize `this` // DONE
75
+ "complexity": 0, // enforce a maximum cyclomatic complexity allowed in a program // DONE - OFF
76
+ "consistent-return": 1, // require `return` statements to either always or never specify values // DONE
77
+ "consistent-this": 1, // enforce consistent naming when capturing the current execution context // DONE
78
+ "curly": 1, // enforce consistent brace style for all control statements // DONE
79
+ "default-case": 1, // require `default` cases in `switch` statements // DONE
80
+ "default-case-last": 1, // enforce default clauses in switch statements to be last // DONE
81
+ "default-param-last": 1, // enforce default parameters to be last // DONE
82
+ "dot-notation": 1, // enforce dot notation whenever possible // DONE
83
+ "eqeqeq": 1, // require the use of `===` and `!==` // DONE
84
+ "func-name-matching": 1, // require function names to match the name of the variable or property to which they are assigned // DONE
85
+ "func-names": 1, // require or disallow named `function` expressions // DONE
86
+ "func-style": 0, // enforce the consistent use of either `function` declarations or expressions // DONE - OFF
87
+ "grouped-accessor-pairs": 1, // require grouped accessor pairs in object literals and classes // DONE
88
+ "guard-for-in": 1, // require `for-in` loops to include an `if` statement // DONE
89
+ "id-denylist": 1, // disallow specified identifiers // DONE
90
+ "id-length": 0, // enforce minimum and maximum identifier lengths // DONE - OFF
91
+ "id-match": 1, // require identifiers to match a specified regular expression // DONE
92
+ "init-declarations": 0, // require or disallow initialization in variable declarations // DONE - OFF
93
+ "max-classes-per-file": 1, // enforce a maximum number of classes per file // DONE
94
+ "max-depth": [1, 3], // enforce a maximum depth that blocks can be nested // DONE
95
+ "max-lines": [1, { "max": 600, "skipBlankLines": true }], // enforce a maximum number of lines per file // DONE - CUSTOMISED
96
+ "max-lines-per-function": [1, { "max": 300 }], // enforce a maximum number of lines of code in a function // DONE - CUSTOMISED
97
+ "max-nested-callbacks": 1, // enforce a maximum depth that callbacks can be nested // DONE
98
+ "max-params": [1, { "max": 7 }], // enforce a maximum number of parameters in function definitions // DONE - CUSTOMISED
99
+ "max-statements": [1, { "max": 20 }], // enforce a maximum number of statements allowed in function blocks // DONE - CUSTOMISED
100
+ "multiline-comment-style": 1, // enforce a particular style for multiline comments // DONE
101
+ "new-cap": 0, // require constructor names to begin with a capital letter // DONE - OFF
102
+ "no-alert": 1, // disallow the use of `alert`, `confirm`, and `prompt` // DONE
103
+ "no-array-constructor": 1, // disallow `Array` constructors // DONE
104
+ "no-bitwise": 1, // disallow bitwise operators // DONE
105
+ "no-caller": 1, // disallow the use of `arguments.caller` or `arguments.callee` // DONE
106
+ "no-case-declarations": 1, // disallow lexical declarations in case clauses // DONE
107
+ "no-confusing-arrow": 1, // disallow arrow functions where they could be confused with comparisons // DONE
108
+ "no-console": 1, // disallow the use of `console` // DONE
109
+ "no-continue": 1, // disallow `continue` statements // DONE
110
+ "no-delete-var": 1, // disallow deleting variables // DONE
111
+ "no-div-regex": 1, // disallow division operators explicitly at the beginning of regular expressions // DONE
112
+ "no-else-return": 1, // disallow `else` blocks after `return` statements in `if` statements // DONE
113
+ "no-empty": 1, // disallow empty block statements // DONE
114
+ "no-empty-function": [1, { "allow": ["constructors"] }], // disallow empty functions // DONE - CUSTOMISED
115
+ "no-eq-null": 1, // disallow `null` comparisons without type-checking operators // DONE
116
+ "no-eval": 1, // disallow the use of `eval()` // DONE
117
+ "no-extend-native": 1, // disallow extending native types // DONE
118
+ "no-extra-bind": 1, // disallow unnecessary calls to `.bind()` // DONE
119
+ "no-extra-boolean-cast": 1, // disallow unnecessary boolean casts // DONE
120
+ "no-extra-label": 1, // disallow unnecessary labels // DONE
121
+ "no-extra-semi": 1, // disallow unnecessary semicolons // DONE
122
+ "no-floating-decimal": 1, // disallow leading or trailing decimal points in numeric literals // DONE
123
+ "no-global-assign": 1, // disallow assignments to native objects or read-only global variables // DONE
124
+ "no-implicit-coercion": 1, // disallow shorthand type conversions // DONE
125
+ "no-implicit-globals": 1, // disallow declarations in the global scope // DONE
126
+ "no-implied-eval": 1, // disallow the use of `eval()`-like methods // DONE
127
+ "no-inline-comments": 1, // disallow inline comments after code // DONE
128
+ "no-invalid-this": 1, // disallow `this` keywords outside of classes or class-like objects // DONE
129
+ "no-iterator": 1, // disallow the use of the `__iterator__` property // DONE
130
+ "no-label-var": 1, // disallow labels that share a name with a variable // DONE
131
+ "no-labels": 1, // disallow labeled statements // DONE
132
+ "no-lone-blocks": 1, // disallow unnecessary nested blocks // DONE
133
+ "no-lonely-if": 1, // disallow `if` statements as the only statement in `else` blocks // DONE
134
+ "no-loop-func": 1, // disallow function declarations that contain unsafe references inside loop statements // DONE
135
+ "no-magic-numbers": 0, // disallow magic numbers // Comment, this rule seems to be hard to satisfy. // DONE
136
+ "no-mixed-operators": 1, // disallow mixed binary operators // DONE
137
+ "no-multi-assign": 1, // disallow use of chained assignment expressions // DONE
138
+ "no-multi-str": 1, // disallow multiline strings // DONE
139
+ "no-negated-condition": 1, // disallow negated conditions // DONE
140
+ "no-nested-ternary": 1, // disallow nested ternary expressions // DONE
141
+ "no-new": 1, // disallow `new` operators outside of assignments or comparisons // DONE
142
+ "no-new-func": 1, // disallow `new` operators with the `Function` object // DONE
143
+ "no-new-object": 1, // disallow `Object` constructors // DONE
144
+ "no-new-wrappers": 1, // disallow `new` operators with the `String`, `Number`, and `Boolean` objects // DONE
145
+ "no-nonoctal-decimal-escape": 1, // disallow `\8` and `\9` escape sequences in string literals // DONE
146
+ "no-octal": 1, // disallow octal literals // DONE
147
+ "no-octal-escape": 1, // disallow octal escape sequences in string literals // DONE
148
+ "no-param-reassign": 1, // disallow reassigning `function` parameters // DONE
149
+ "no-plusplus": 0, // disallow the unary operators `++` and `--` // DONE - OFF
150
+ "no-proto": 1, // disallow the use of the `__proto__` property // DONE
151
+ "no-redeclare": 1, // disallow variable redeclaration // DONE
152
+ "no-regex-spaces": 1, // disallow multiple spaces in regular expressions // DONE
153
+ "no-restricted-exports": 1, // disallow specified names in exports // DONE
154
+ "no-restricted-globals": 1, // disallow specified global variables // DONE
155
+ "no-restricted-imports": 1, // disallow specified modules when loaded by `import` // DONE
156
+ "no-restricted-properties": 1, // disallow certain properties on certain objects // DONE
157
+ "no-restricted-syntax": 1, // disallow specified syntax // DONE
158
+ "no-return-assign": 1, // disallow assignment operators in `return` statements // DONE
159
+ "no-return-await": 1, // disallow unnecessary `return await` // DONE
160
+ "no-script-url": 1, // disallow `javascript:` urls // DONE
161
+ "no-sequences": 1, // disallow comma operators // DONE
162
+ "no-shadow": 0, // disallow variable declarations from shadowing variables declared in the outer scope // DONE
163
+ "no-shadow-restricted-names": 1, // disallow identifiers from shadowing restricted names // DONE
164
+ "no-ternary": 0, // disallow ternary operators // DONE - OFF
165
+ "no-throw-literal": 1, // disallow throwing literals as exceptions // DONE
166
+ "no-undef-init": 1, // disallow initializing variables to `undefined` // DONE
167
+ "no-undefined": 0, // disallow the use of `undefined` as an identifier // DONE
168
+ "no-underscore-dangle": 0, // disallow dangling underscores in identifiers // DONE
169
+ "no-unneeded-ternary": 0, // disallow ternary operators when simpler alternatives exist // DONE - OFF
170
+ "no-unused-expressions": 0, // disallow unused expressions // DONE - OFF
171
+ "no-unused-labels": 1, // disallow unused labels // DONE
172
+ "no-useless-call": 1, // disallow unnecessary calls to `.call()` and `.apply()` // DONE
173
+ "no-useless-catch": 1, // disallow unnecessary `catch` clauses // DONE
174
+ "no-useless-computed-key": 1, // disallow unnecessary computed property keys in objects and classes // DONE
175
+ "no-useless-concat": 1, // disallow unnecessary concatenation of literals or template literals // DONE
176
+ "no-useless-constructor": 0, // disallow unnecessary constructors // DONE
177
+ "no-useless-escape": 1, // disallow unnecessary escape characters // DONE
178
+ "no-useless-rename": 1, // disallow renaming import, export, and destructured assignments to the same name // DONE
179
+ "no-useless-return": 1, // disallow redundant return statements // DONE
180
+ "no-var": 1, // require `let` or `const` instead of `var` // DONE
181
+ "no-void": [1, { "allowAsStatement": true }], // disallow `void` operators // DONE - CUSTOMISED
182
+ "no-warning-comments": 1, // disallow specified warning terms in comments // DONE
183
+ "no-with": 1, // disallow `with` statements // DONE
184
+ "object-shorthand": 0, // require or disallow method and property shorthand syntax for object literals // DONE
185
+ "one-var": 0, // enforce variables to be declared either together or separately in functions // DONE
186
+ "one-var-declaration-per-line": 1, // require or disallow newlines around variable declarations // DONE
187
+ "operator-assignment": 1, // require or disallow assignment operator shorthand where possible // DONE
188
+ "prefer-arrow-callback": 1, // require using arrow functions for callbacks // DONE
189
+ "prefer-const": 1, // require `const` declarations for variables that are never reassigned after declared // DONE
190
+ "prefer-destructuring": 0, // require destructuring from arrays and/or objects // DONE - OFF
191
+ "prefer-exponentiation-operator": 1, // disallow the use of `Math.pow` in favor of the `**` operator // DONE
192
+ "prefer-named-capture-group": 1, // enforce using named capture group in regular expression // DONE
193
+ "prefer-numeric-literals": 1, // disallow `parseInt()` and `Number.parseInt()` in favor of binary, octal, and hexadecimal literals // DONE
194
+ "prefer-object-spread": 1, // disallow using Object.assign with an object literal as the first argument and prefer the use of object spread instead. // DONE
195
+ "prefer-promise-reject-errors": 1, // require using Error objects as Promise rejection reasons // DONE
196
+ "prefer-regex-literals": 1, // disallow use of the `RegExp` constructor in favor of regular expression literals // DONE
197
+ "prefer-rest-params": 1, // require rest parameters instead of `arguments` // DONE
198
+ "prefer-spread": 1, // require spread operators instead of `.apply()` // DONE
199
+ "prefer-template": 1, // require template literals instead of string concatenation // DONE
200
+ "quote-props": 0, // require quotes around object literal property names // DONE
201
+ "radix": 1, // enforce the consistent use of the radix argument when using `parseInt()` // DONE
202
+ "require-await": 1, // disallow async functions which have no `await` expression // DONE
203
+ "require-unicode-regexp": 1, // enforce the use of `u` flag on RegExp // DONE
204
+ "require-yield": 1, // require generator functions to contain `yield` // DONE
205
+ "sort-imports": 1, // enforce sorted import declarations within modules // DONE
206
+ "sort-keys": 0, // require object keys to be sorted // DONE
207
+ "sort-vars": 1, // require variables within the same declaration block to be sorted // DONE
208
+ "spaced-comment": 1, // enforce consistent spacing after the `//` or `/*` in a comment // DONE
209
+ "strict": 0, // require or disallow strict mode directives // DONE - OFF
210
+ "symbol-description": 1, // require symbol descriptions // DONE
211
+ "vars-on-top": 1, // require `var` declarations be placed at the top of their containing scope // DONE
212
+ "yoda": 1, // require or disallow "Yoda" conditions // DONE
363
213
  "array-bracket-newline": 1, // enforce linebreaks after opening and before closing array brackets // DONE
364
-
365
214
  "array-bracket-spacing": 1, // enforce consistent spacing inside array brackets // DONE
366
-
367
215
  "array-element-newline": 0, // enforce line breaks after each array element // DONE - OFF
368
-
369
216
  "arrow-parens": 1, // require parentheses around arrow function arguments // DONE
370
-
371
217
  "arrow-spacing": 1, // enforce consistent spacing before and after the arrow in arrow functions // DONE
372
-
373
218
  "block-spacing": 1, // disallow or enforce spaces inside of blocks after opening block and before closing block // DONE
374
-
375
219
  "brace-style": 1, // enforce consistent brace style for blocks // DONE
376
-
377
220
  "comma-dangle": 1, // require or disallow trailing commas // DONE
378
-
379
221
  "comma-spacing": 1, // enforce consistent spacing before and after commas // DONE
380
-
381
222
  "comma-style": 1, // enforce consistent comma style // DONE
382
-
383
223
  "computed-property-spacing": 1, // enforce consistent spacing inside computed property brackets // DONE
384
-
385
224
  "dot-location": 0, // enforce consistent newlines before and after dots // DONE
386
-
387
225
  "eol-last": 1, // require or disallow newline at the end of files // DONE
388
-
389
226
  "func-call-spacing": 1, // require or disallow spacing between function identifiers and their invocations // DONE
390
-
391
- "function-call-argument-newline": ["warn", "consistent"], // enforce line breaks between arguments of a function call // DONE - CUSTOMISED
392
-
393
- "function-paren-newline": ["warn", "multiline-arguments"], // enforce consistent line breaks inside function parentheses // DONE
394
-
227
+ "function-call-argument-newline": [1, "consistent"], // enforce line breaks between arguments of a function call // DONE - CUSTOMISED
228
+ "function-paren-newline": [1, "multiline-arguments"], // enforce consistent line breaks inside function parentheses // DONE
395
229
  "generator-star-spacing": 1, // enforce consistent spacing around `*` operators in generator functions // DONE
396
-
397
230
  "implicit-arrow-linebreak": 1, // enforce the location of arrow function bodies // DONE
398
-
399
- "indent": ["warn", 2], // enforce consistent indentation. second value is number of spaces // DONE
400
-
231
+ "indent": [1, 2], // enforce consistent indentation. second value is number of spaces // DONE
401
232
  "jsx-quotes": 1, // enforce the consistent use of either double or single quotes in JSX attributes // DONE
402
-
403
233
  "key-spacing": 1, // enforce consistent spacing between keys and values in object literal properties // DONE
404
-
405
234
  "keyword-spacing": 1, // enforce consistent spacing before and after keywords // DONE
406
-
407
235
  "line-comment-position": 1, // enforce position of line comments // DONE
408
-
409
236
  "linebreak-style": 0, // enforce consistent linebreak style // OFF
410
-
411
237
  "lines-around-comment": 1, // require empty lines around comments // DONE
412
-
413
238
  "lines-between-class-members": 0, // require or disallow an empty line between class members // DONE
414
-
415
- "max-len": [
416
- 1,
417
- { "code": 140, "ignoreUrls": true, "ignorePattern": "^import .*" }
418
- ], // enforce a maximum line length // DONE - CUSTOMISED
419
-
239
+ "max-len": [1, { "code": 140, "ignoreUrls": true, "ignorePattern": "^import .*" }], // enforce a maximum line length // DONE - CUSTOMISED
420
240
  "max-statements-per-line": 1, // enforce a maximum number of statements allowed per line // DONE
421
-
422
241
  "multiline-ternary": 0, // enforce newlines between operands of ternary expressions // DONE - OFF
423
-
424
242
  "new-parens": 1, // enforce or disallow parentheses when invoking a constructor with no arguments // DONE
425
-
426
243
  "newline-per-chained-call": 1, // require a newline after each call in a method chain // DONE
427
-
428
244
  "no-extra-parens": 0, // disallow unnecessary parentheses // DONE - OFF
429
-
430
245
  "no-mixed-spaces-and-tabs": 1, // disallow mixed spaces and tabs for indentation // DONE
431
-
432
246
  "no-multi-spaces": 1, // disallow multiple spaces // DONE
433
-
434
247
  "no-multiple-empty-lines": 1, // disallow multiple empty lines // DONE
435
-
436
248
  "no-tabs": 1, // disallow all tabs // DONE
437
-
438
249
  "no-trailing-spaces": 1, // disallow trailing whitespace at the end of lines // DONE
439
-
440
250
  "no-whitespace-before-property": 1, // disallow whitespace before properties // DONE
441
-
442
251
  "nonblock-statement-body-position": 1, // enforce the location of single-line statements // DONE
443
-
444
252
  "object-curly-newline": 1, // enforce consistent line breaks after opening and before closing braces // DONE
445
-
446
- "object-curly-spacing": ["warn", "always"], // enforce consistent spacing inside braces // DONE
447
-
253
+ "object-curly-spacing": [1, "always"], // enforce consistent spacing inside braces // DONE
448
254
  "object-property-newline": 0, // enforce placing object properties on separate lines // DONE - OFF
449
-
450
255
  "operator-linebreak": 1, // enforce consistent linebreak style for operators // DONE
451
-
452
256
  "padded-blocks": 0, // require or disallow padding within blocks // DONE
453
-
454
257
  "padding-line-between-statements": 1, // require or disallow padding lines between statements // DONE
455
-
456
- "quotes": ["warn", "single"], // enforce the consistent use of either backticks, double, or single quotes // DONE
457
-
258
+ "quotes": [1, "single"], // enforce the consistent use of either backticks, double, or single quotes // DONE
458
259
  "rest-spread-spacing": 1, // enforce spacing between rest and spread operators and their expressions // DONE
459
-
460
260
  "semi": 1, // require or disallow semicolons instead of ASI // DONE
461
-
462
261
  "semi-spacing": 1, // enforce consistent spacing before and after semicolons // DONE
463
-
464
262
  "semi-style": 1, // enforce location of semicolons // DONE
465
-
466
263
  "space-before-blocks": 1, // enforce consistent spacing before blocks // DONE
467
-
468
264
  "space-before-function-paren": 0, // enforce consistent spacing before `function` definition opening parenthesis // DONE
469
-
470
265
  "space-in-parens": 1, // enforce consistent spacing inside parentheses // DONE
471
-
472
266
  "space-infix-ops": 1, // require spacing around infix operators // DONE
473
-
474
267
  "space-unary-ops": 1, // enforce consistent spacing before or after unary operators // DONE
475
-
476
268
  "switch-colon-spacing": 1, // enforce spacing around colons of switch statements // DONE
477
-
478
269
  "template-curly-spacing": 1, // require or disallow spacing around embedded expressions of template strings // DONE
479
-
480
270
  "template-tag-spacing": 1, // require or disallow spacing between template tags and their literals // DONE
481
-
482
271
  "unicode-bom": 1, // require or disallow Unicode byte order mark (BOM) // DONE
483
-
484
272
  "wrap-iife": 1, // require parentheses around immediate `function` invocations // DONE
485
-
486
273
  "wrap-regex": 1, // require parenthesis around regex literals // DONE
487
-
488
- "yield-star-spacing": 1 // require or disallow spacing around the `*` in `yield*` expressions // DONE
274
+ "yield-star-spacing": 1, // require or disallow spacing around the `*` in `yield*` expressions // DONE
275
+ "no-cond-assign": 1, // disallow assignment in conditional expressions // DONE
276
+ "no-constant-condition": 1, // disallow use of constant expressions in conditions // DONE
277
+ "no-control-regex": 1, // disallow control characters in regular expressions // DONE
278
+ "no-debugger": 0, // disallow use of debugger // DONE - OFF
279
+ "no-dupe-args": 1, // disallow duplicate arguments in functions // DONE
280
+ "no-dupe-keys": 1, // disallow duplicate keys when creating object literals // DONE
281
+ "no-duplicate-case": 1, // disallow a duplicate case label // DONE
282
+ "no-empty-class": 1, // disallow the use of empty character classes in regular expressions // DONE
283
+ "no-ex-assign": 1, // disallow assigning to the exception in a catch block // DONE
284
+ "no-func-assign": 1, // disallow overwriting functions written as function declarations // DONE
285
+ "no-inner-declarations": 1, // disallow function or variable declarations in nested blocks // DONE
286
+ "no-invalid-regexp": 1, // disallow invalid regular expression strings in the RegExp constructor // DONE
287
+ "no-irregular-whitespace": 1, // disallow irregular whitespace outside of strings and comments // DONE
288
+ "no-negated-in-lhs": 1, // disallow negation of the left operand of an in expression // DONE
289
+ "no-obj-calls": 1, // disallow the use of object properties of the global object (Math and JSON) as functions // DONE
290
+ "no-reserved-keys": 1, // disallow reserved words being used as object literal keys // DONE
291
+ "no-sparse-arrays": 1, // disallow sparse arrays // DONE
292
+ "no-unreachable": 1, // disallow unreachable statements after a return, throw, continue, or break statement // DONE
293
+ "use-isnan": 1, // disallow comparisons with the value NaN // DONE
294
+ "valid-jsdoc": 1, // ensure JSDoc comments are valid // DONE
295
+ "valid-typeof": 1, // ensure that the results of typeof are compared against a valid string // DONE
296
+ "no-catch-shadow": 1, // disallow the catch clause parameter name being the same as a variable in the outer scope // DONE
297
+ "no-unused-vars": 1, // disallow declaration of variables that are not used in the code // DONE
298
+ "newline-after-var": 0, // allow/disallow an empty newline after var statement // DONE - OFF
299
+ "no-spaced-func": 1, // disallow space between function identifier and application // DONE
300
+ "no-wrap-func": 1, // disallow wrapping of non-IIFE statements in parens // DONE
301
+ "space-after-keywords": [1, "always"], // require a space after certain keywords // DONE
302
+ "space-in-brackets": [1, "never"], // require or disallow spaces inside brackets // DONE
303
+ "space-return-throw-case": [1, "always"], // require a space after return, throw, and case // DONE
304
+ "spaced-line-comment": [1, "always"], // require or disallow a space immediately following the // in a line comment // DONE
305
+
306
+ // React specific
307
+ "react/display-name": 0, // prevent missing displayName in a React component definition // DONE - OFF
308
+ "react/jsx-quotes": [1, "double", "avoid-escape"], // Enforce quote style for JSX attributes // DONE
309
+ "react/jsx-no-undef": 1, // disallow undeclared variables in JSX // DONE
310
+ "react/jsx-sort-props": 0, // enforce props alphabetical sorting // DONE - OFF
311
+ "react/jsx-uses-react": 1, // prevent React to be incorrectly marked as unused // DONE
312
+ "react/jsx-uses-vars": 1, // prevent variables used in JSX to be incorrectly marked as unused // DONE
313
+ "react/no-did-mount-set-state": 1, // prevent usage of setState in componentDidMount // DONE
314
+ "react/no-did-update-set-state": 1, // prevent usage of setState in componentDidUpdate // DONE
315
+ "react/no-multi-comp": 0, // prevent multiple component definition per file // DONE - OFF
316
+ "react/no-unknown-property": 1, // prevent usage of unknown DOM property // DONE
317
+ "react/prop-types": 1, // prevent missing props validation in a React component definition // DONE
318
+ "react/react-in-jsx-scope": 1, // prevent missing React when using JSX // DONE
319
+ "react/self-closing-comp": 1, // prevent extra closing tags for components without children // DONE
320
+ "react/wrap-multilines": 1 // prevent missing parentheses around multilines JSX // DONE
489
321
  }
490
322
  }
491
323
  ]
492
- }
324
+ }
package/README.md CHANGED
@@ -1,3 +1,31 @@
1
1
  # ESLintConfig
2
2
 
3
- Shareable ESLint configuration settings exported as an npm package.
3
+ Shareable ESLint configuration settings. No errors, only warnings.
4
+
5
+ ## Prerequisites
6
+
7
+ - Install the official ESLint extension in your IDE
8
+ - Navigate to the root directory of your project
9
+
10
+ ## Installation and usage
11
+
12
+ ### Step One
13
+
14
+ ```
15
+ terminal > cd > project root
16
+ ```
17
+ ### Step Two
18
+
19
+ ```
20
+ npm(or yarn) i @wildpastry/eslint-config@latest
21
+ ```
22
+ ### Step Three
23
+
24
+ ```
25
+ create new .eslintrc file (or modify existing)
26
+ ```
27
+ ### Step Four
28
+
29
+ ```
30
+ add { "extends": "@wildpastry/eslint-config" }
31
+ ```
package/index.js CHANGED
@@ -1,13 +1,324 @@
1
1
  module.exports = {
2
- globals: {
3
- MyGlobal: true,
4
- },
2
+ /* KEY:
3
+ * DONE = Checked and accepted rule
4
+ * DONE - CUSTOMISED = Accepted rule but changed default behaviour
5
+ * DONE - OFF = Disabled rule
6
+ */
7
+ "root": true,
5
8
 
6
- rules: {
7
- semi: [2, 'always'],
8
- },
9
+ "ignorePatterns": ["cypress/*"],
9
10
 
10
- printMsg: function () {
11
- console.log('This is a message from the demo package');
12
- },
11
+ "overrides": [
12
+ {
13
+ "extends": [
14
+ "eslint:recommended",
15
+ "plugin:@typescript-eslint/recommended",
16
+ "plugin:@typescript-eslint/recommended-requiring-type-checking"
17
+ ],
18
+
19
+ "env": {
20
+ "browser": true,
21
+ "node": true,
22
+ "es6": true
23
+ },
24
+
25
+ "plugins": ["react"],
26
+
27
+ "files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
28
+
29
+ "ecmaFeatures": {
30
+ "arrowFunctions": true,
31
+ "binaryLiterals": true,
32
+ "blockBindings": true,
33
+ "classes": true,
34
+ "defaultParams": true,
35
+ "destructuring": true,
36
+ "forOf": true,
37
+ "generators": true,
38
+ "modules": true,
39
+ "objectLiteralComputedProperties": true,
40
+ "objectLiteralDuplicateProperties": true,
41
+ "objectLiteralShorthandMethods": true,
42
+ "objectLiteralShorthandProperties": true,
43
+ "octalLiterals": true,
44
+ "regexUFlag": true,
45
+ "regexYFlag": true,
46
+ "spread": true,
47
+ "superInFunctions": true,
48
+ "templateStrings": true,
49
+ "unicodeCodePointEscapes": true,
50
+ "globalReturn": true,
51
+ "jsx": true
52
+ },
53
+
54
+ "rules": {
55
+ "no-inferrable-types": 0, // disallow explicit type declarations for variables or parameters initialized to a number, string, or boolean // DONE - OFF
56
+ "no-unsafe-assignment": 0, // disallow assigning a value with type any to variables and properties // DONE - OFF
57
+ "no-unsafe-member-access": 0, //disallow member access on a value with type any // DONE - OFF
58
+ "array-callback-return": 0, // enforce `return` statements in callbacks of array methods // DONE - OFF
59
+ "no-await-in-loop": 0, // disallow `await` inside of loops // DONE - OFF
60
+ "no-constructor-return": 0, // disallow returning value from constructor // DONE - OFF
61
+ "no-duplicate-imports": 1, // disallow duplicate module imports // DONE
62
+ "no-promise-executor-return": 0, // disallow returning values from Promise executor functions // DONE - OFF
63
+ "no-self-compare": 1, // disallow comparisons where both sides are exactly the same // DONE
64
+ "no-template-curly-in-string": 0, // disallow template literal placeholder syntax in regular strings // DONE - OFF
65
+ "no-unmodified-loop-condition": 1, // disallow unmodified loop conditions // DONE
66
+ "no-unreachable-loop": 1, // disallow loops with a body that allows only one iteration // DONE
67
+ "no-use-before-define": 0, // disallow the use of variables before they are defined // DONE - OFF
68
+ "require-atomic-updates": 1, // disallow assignments that can lead to race conditions due to usage of `await` or `yield` // DONE
69
+ "accessor-pairs": 0, // enforce getter and setter pairs in objects and classes // DONE - OFF
70
+ "arrow-body-style": 0, // require braces around arrow function bodies // DONE - OFF
71
+ "block-scoped-var": 1, // enforce the use of variables within the scope they are defined // DONE
72
+ "camelcase": 1, // enforce camelcase naming convention // DONE
73
+ "capitalized-comments": 1, // enforce or disallow capitalization of the first letter of a comment // DONE
74
+ "class-methods-use-this": 0, // enforce that class methods utilize `this` // DONE
75
+ "complexity": 0, // enforce a maximum cyclomatic complexity allowed in a program // DONE - OFF
76
+ "consistent-return": 1, // require `return` statements to either always or never specify values // DONE
77
+ "consistent-this": 1, // enforce consistent naming when capturing the current execution context // DONE
78
+ "curly": 1, // enforce consistent brace style for all control statements // DONE
79
+ "default-case": 1, // require `default` cases in `switch` statements // DONE
80
+ "default-case-last": 1, // enforce default clauses in switch statements to be last // DONE
81
+ "default-param-last": 1, // enforce default parameters to be last // DONE
82
+ "dot-notation": 1, // enforce dot notation whenever possible // DONE
83
+ "eqeqeq": 1, // require the use of `===` and `!==` // DONE
84
+ "func-name-matching": 1, // require function names to match the name of the variable or property to which they are assigned // DONE
85
+ "func-names": 1, // require or disallow named `function` expressions // DONE
86
+ "func-style": 0, // enforce the consistent use of either `function` declarations or expressions // DONE - OFF
87
+ "grouped-accessor-pairs": 1, // require grouped accessor pairs in object literals and classes // DONE
88
+ "guard-for-in": 1, // require `for-in` loops to include an `if` statement // DONE
89
+ "id-denylist": 1, // disallow specified identifiers // DONE
90
+ "id-length": 0, // enforce minimum and maximum identifier lengths // DONE - OFF
91
+ "id-match": 1, // require identifiers to match a specified regular expression // DONE
92
+ "init-declarations": 0, // require or disallow initialization in variable declarations // DONE - OFF
93
+ "max-classes-per-file": 1, // enforce a maximum number of classes per file // DONE
94
+ "max-depth": [1, 3], // enforce a maximum depth that blocks can be nested // DONE
95
+ "max-lines": [1, { "max": 600, "skipBlankLines": true }], // enforce a maximum number of lines per file // DONE - CUSTOMISED
96
+ "max-lines-per-function": [1, { "max": 300 }], // enforce a maximum number of lines of code in a function // DONE - CUSTOMISED
97
+ "max-nested-callbacks": 1, // enforce a maximum depth that callbacks can be nested // DONE
98
+ "max-params": [1, { "max": 7 }], // enforce a maximum number of parameters in function definitions // DONE - CUSTOMISED
99
+ "max-statements": [1, { "max": 20 }], // enforce a maximum number of statements allowed in function blocks // DONE - CUSTOMISED
100
+ "multiline-comment-style": 1, // enforce a particular style for multiline comments // DONE
101
+ "new-cap": 0, // require constructor names to begin with a capital letter // DONE - OFF
102
+ "no-alert": 1, // disallow the use of `alert`, `confirm`, and `prompt` // DONE
103
+ "no-array-constructor": 1, // disallow `Array` constructors // DONE
104
+ "no-bitwise": 1, // disallow bitwise operators // DONE
105
+ "no-caller": 1, // disallow the use of `arguments.caller` or `arguments.callee` // DONE
106
+ "no-case-declarations": 1, // disallow lexical declarations in case clauses // DONE
107
+ "no-confusing-arrow": 1, // disallow arrow functions where they could be confused with comparisons // DONE
108
+ "no-console": 1, // disallow the use of `console` // DONE
109
+ "no-continue": 1, // disallow `continue` statements // DONE
110
+ "no-delete-var": 1, // disallow deleting variables // DONE
111
+ "no-div-regex": 1, // disallow division operators explicitly at the beginning of regular expressions // DONE
112
+ "no-else-return": 1, // disallow `else` blocks after `return` statements in `if` statements // DONE
113
+ "no-empty": 1, // disallow empty block statements // DONE
114
+ "no-empty-function": [1, { "allow": ["constructors"] }], // disallow empty functions // DONE - CUSTOMISED
115
+ "no-eq-null": 1, // disallow `null` comparisons without type-checking operators // DONE
116
+ "no-eval": 1, // disallow the use of `eval()` // DONE
117
+ "no-extend-native": 1, // disallow extending native types // DONE
118
+ "no-extra-bind": 1, // disallow unnecessary calls to `.bind()` // DONE
119
+ "no-extra-boolean-cast": 1, // disallow unnecessary boolean casts // DONE
120
+ "no-extra-label": 1, // disallow unnecessary labels // DONE
121
+ "no-extra-semi": 1, // disallow unnecessary semicolons // DONE
122
+ "no-floating-decimal": 1, // disallow leading or trailing decimal points in numeric literals // DONE
123
+ "no-global-assign": 1, // disallow assignments to native objects or read-only global variables // DONE
124
+ "no-implicit-coercion": 1, // disallow shorthand type conversions // DONE
125
+ "no-implicit-globals": 1, // disallow declarations in the global scope // DONE
126
+ "no-implied-eval": 1, // disallow the use of `eval()`-like methods // DONE
127
+ "no-inline-comments": 1, // disallow inline comments after code // DONE
128
+ "no-invalid-this": 1, // disallow `this` keywords outside of classes or class-like objects // DONE
129
+ "no-iterator": 1, // disallow the use of the `__iterator__` property // DONE
130
+ "no-label-var": 1, // disallow labels that share a name with a variable // DONE
131
+ "no-labels": 1, // disallow labeled statements // DONE
132
+ "no-lone-blocks": 1, // disallow unnecessary nested blocks // DONE
133
+ "no-lonely-if": 1, // disallow `if` statements as the only statement in `else` blocks // DONE
134
+ "no-loop-func": 1, // disallow function declarations that contain unsafe references inside loop statements // DONE
135
+ "no-magic-numbers": 0, // disallow magic numbers // Comment, this rule seems to be hard to satisfy. // DONE
136
+ "no-mixed-operators": 1, // disallow mixed binary operators // DONE
137
+ "no-multi-assign": 1, // disallow use of chained assignment expressions // DONE
138
+ "no-multi-str": 1, // disallow multiline strings // DONE
139
+ "no-negated-condition": 1, // disallow negated conditions // DONE
140
+ "no-nested-ternary": 1, // disallow nested ternary expressions // DONE
141
+ "no-new": 1, // disallow `new` operators outside of assignments or comparisons // DONE
142
+ "no-new-func": 1, // disallow `new` operators with the `Function` object // DONE
143
+ "no-new-object": 1, // disallow `Object` constructors // DONE
144
+ "no-new-wrappers": 1, // disallow `new` operators with the `String`, `Number`, and `Boolean` objects // DONE
145
+ "no-nonoctal-decimal-escape": 1, // disallow `\8` and `\9` escape sequences in string literals // DONE
146
+ "no-octal": 1, // disallow octal literals // DONE
147
+ "no-octal-escape": 1, // disallow octal escape sequences in string literals // DONE
148
+ "no-param-reassign": 1, // disallow reassigning `function` parameters // DONE
149
+ "no-plusplus": 0, // disallow the unary operators `++` and `--` // DONE - OFF
150
+ "no-proto": 1, // disallow the use of the `__proto__` property // DONE
151
+ "no-redeclare": 1, // disallow variable redeclaration // DONE
152
+ "no-regex-spaces": 1, // disallow multiple spaces in regular expressions // DONE
153
+ "no-restricted-exports": 1, // disallow specified names in exports // DONE
154
+ "no-restricted-globals": 1, // disallow specified global variables // DONE
155
+ "no-restricted-imports": 1, // disallow specified modules when loaded by `import` // DONE
156
+ "no-restricted-properties": 1, // disallow certain properties on certain objects // DONE
157
+ "no-restricted-syntax": 1, // disallow specified syntax // DONE
158
+ "no-return-assign": 1, // disallow assignment operators in `return` statements // DONE
159
+ "no-return-await": 1, // disallow unnecessary `return await` // DONE
160
+ "no-script-url": 1, // disallow `javascript:` urls // DONE
161
+ "no-sequences": 1, // disallow comma operators // DONE
162
+ "no-shadow": 0, // disallow variable declarations from shadowing variables declared in the outer scope // DONE
163
+ "no-shadow-restricted-names": 1, // disallow identifiers from shadowing restricted names // DONE
164
+ "no-ternary": 0, // disallow ternary operators // DONE - OFF
165
+ "no-throw-literal": 1, // disallow throwing literals as exceptions // DONE
166
+ "no-undef-init": 1, // disallow initializing variables to `undefined` // DONE
167
+ "no-undefined": 0, // disallow the use of `undefined` as an identifier // DONE
168
+ "no-underscore-dangle": 0, // disallow dangling underscores in identifiers // DONE
169
+ "no-unneeded-ternary": 0, // disallow ternary operators when simpler alternatives exist // DONE - OFF
170
+ "no-unused-expressions": 0, // disallow unused expressions // DONE - OFF
171
+ "no-unused-labels": 1, // disallow unused labels // DONE
172
+ "no-useless-call": 1, // disallow unnecessary calls to `.call()` and `.apply()` // DONE
173
+ "no-useless-catch": 1, // disallow unnecessary `catch` clauses // DONE
174
+ "no-useless-computed-key": 1, // disallow unnecessary computed property keys in objects and classes // DONE
175
+ "no-useless-concat": 1, // disallow unnecessary concatenation of literals or template literals // DONE
176
+ "no-useless-constructor": 0, // disallow unnecessary constructors // DONE
177
+ "no-useless-escape": 1, // disallow unnecessary escape characters // DONE
178
+ "no-useless-rename": 1, // disallow renaming import, export, and destructured assignments to the same name // DONE
179
+ "no-useless-return": 1, // disallow redundant return statements // DONE
180
+ "no-var": 1, // require `let` or `const` instead of `var` // DONE
181
+ "no-void": [1, { "allowAsStatement": true }], // disallow `void` operators // DONE - CUSTOMISED
182
+ "no-warning-comments": 1, // disallow specified warning terms in comments // DONE
183
+ "no-with": 1, // disallow `with` statements // DONE
184
+ "object-shorthand": 0, // require or disallow method and property shorthand syntax for object literals // DONE
185
+ "one-var": 0, // enforce variables to be declared either together or separately in functions // DONE
186
+ "one-var-declaration-per-line": 1, // require or disallow newlines around variable declarations // DONE
187
+ "operator-assignment": 1, // require or disallow assignment operator shorthand where possible // DONE
188
+ "prefer-arrow-callback": 1, // require using arrow functions for callbacks // DONE
189
+ "prefer-const": 1, // require `const` declarations for variables that are never reassigned after declared // DONE
190
+ "prefer-destructuring": 0, // require destructuring from arrays and/or objects // DONE - OFF
191
+ "prefer-exponentiation-operator": 1, // disallow the use of `Math.pow` in favor of the `**` operator // DONE
192
+ "prefer-named-capture-group": 1, // enforce using named capture group in regular expression // DONE
193
+ "prefer-numeric-literals": 1, // disallow `parseInt()` and `Number.parseInt()` in favor of binary, octal, and hexadecimal literals // DONE
194
+ "prefer-object-spread": 1, // disallow using Object.assign with an object literal as the first argument and prefer the use of object spread instead. // DONE
195
+ "prefer-promise-reject-errors": 1, // require using Error objects as Promise rejection reasons // DONE
196
+ "prefer-regex-literals": 1, // disallow use of the `RegExp` constructor in favor of regular expression literals // DONE
197
+ "prefer-rest-params": 1, // require rest parameters instead of `arguments` // DONE
198
+ "prefer-spread": 1, // require spread operators instead of `.apply()` // DONE
199
+ "prefer-template": 1, // require template literals instead of string concatenation // DONE
200
+ "quote-props": 0, // require quotes around object literal property names // DONE
201
+ "radix": 1, // enforce the consistent use of the radix argument when using `parseInt()` // DONE
202
+ "require-await": 1, // disallow async functions which have no `await` expression // DONE
203
+ "require-unicode-regexp": 1, // enforce the use of `u` flag on RegExp // DONE
204
+ "require-yield": 1, // require generator functions to contain `yield` // DONE
205
+ "sort-imports": 1, // enforce sorted import declarations within modules // DONE
206
+ "sort-keys": 0, // require object keys to be sorted // DONE
207
+ "sort-vars": 1, // require variables within the same declaration block to be sorted // DONE
208
+ "spaced-comment": 1, // enforce consistent spacing after the `//` or `/*` in a comment // DONE
209
+ "strict": 0, // require or disallow strict mode directives // DONE - OFF
210
+ "symbol-description": 1, // require symbol descriptions // DONE
211
+ "vars-on-top": 1, // require `var` declarations be placed at the top of their containing scope // DONE
212
+ "yoda": 1, // require or disallow "Yoda" conditions // DONE
213
+ "array-bracket-newline": 1, // enforce linebreaks after opening and before closing array brackets // DONE
214
+ "array-bracket-spacing": 1, // enforce consistent spacing inside array brackets // DONE
215
+ "array-element-newline": 0, // enforce line breaks after each array element // DONE - OFF
216
+ "arrow-parens": 1, // require parentheses around arrow function arguments // DONE
217
+ "arrow-spacing": 1, // enforce consistent spacing before and after the arrow in arrow functions // DONE
218
+ "block-spacing": 1, // disallow or enforce spaces inside of blocks after opening block and before closing block // DONE
219
+ "brace-style": 1, // enforce consistent brace style for blocks // DONE
220
+ "comma-dangle": 1, // require or disallow trailing commas // DONE
221
+ "comma-spacing": 1, // enforce consistent spacing before and after commas // DONE
222
+ "comma-style": 1, // enforce consistent comma style // DONE
223
+ "computed-property-spacing": 1, // enforce consistent spacing inside computed property brackets // DONE
224
+ "dot-location": 0, // enforce consistent newlines before and after dots // DONE
225
+ "eol-last": 1, // require or disallow newline at the end of files // DONE
226
+ "func-call-spacing": 1, // require or disallow spacing between function identifiers and their invocations // DONE
227
+ "function-call-argument-newline": [1, "consistent"], // enforce line breaks between arguments of a function call // DONE - CUSTOMISED
228
+ "function-paren-newline": [1, "multiline-arguments"], // enforce consistent line breaks inside function parentheses // DONE
229
+ "generator-star-spacing": 1, // enforce consistent spacing around `*` operators in generator functions // DONE
230
+ "implicit-arrow-linebreak": 1, // enforce the location of arrow function bodies // DONE
231
+ "indent": [1, 2], // enforce consistent indentation. second value is number of spaces // DONE
232
+ "jsx-quotes": 1, // enforce the consistent use of either double or single quotes in JSX attributes // DONE
233
+ "key-spacing": 1, // enforce consistent spacing between keys and values in object literal properties // DONE
234
+ "keyword-spacing": 1, // enforce consistent spacing before and after keywords // DONE
235
+ "line-comment-position": 1, // enforce position of line comments // DONE
236
+ "linebreak-style": 0, // enforce consistent linebreak style // OFF
237
+ "lines-around-comment": 1, // require empty lines around comments // DONE
238
+ "lines-between-class-members": 0, // require or disallow an empty line between class members // DONE
239
+ "max-len": [1, { "code": 140, "ignoreUrls": true, "ignorePattern": "^import .*" }], // enforce a maximum line length // DONE - CUSTOMISED
240
+ "max-statements-per-line": 1, // enforce a maximum number of statements allowed per line // DONE
241
+ "multiline-ternary": 0, // enforce newlines between operands of ternary expressions // DONE - OFF
242
+ "new-parens": 1, // enforce or disallow parentheses when invoking a constructor with no arguments // DONE
243
+ "newline-per-chained-call": 1, // require a newline after each call in a method chain // DONE
244
+ "no-extra-parens": 0, // disallow unnecessary parentheses // DONE - OFF
245
+ "no-mixed-spaces-and-tabs": 1, // disallow mixed spaces and tabs for indentation // DONE
246
+ "no-multi-spaces": 1, // disallow multiple spaces // DONE
247
+ "no-multiple-empty-lines": 1, // disallow multiple empty lines // DONE
248
+ "no-tabs": 1, // disallow all tabs // DONE
249
+ "no-trailing-spaces": 1, // disallow trailing whitespace at the end of lines // DONE
250
+ "no-whitespace-before-property": 1, // disallow whitespace before properties // DONE
251
+ "nonblock-statement-body-position": 1, // enforce the location of single-line statements // DONE
252
+ "object-curly-newline": 1, // enforce consistent line breaks after opening and before closing braces // DONE
253
+ "object-curly-spacing": [1, "always"], // enforce consistent spacing inside braces // DONE
254
+ "object-property-newline": 0, // enforce placing object properties on separate lines // DONE - OFF
255
+ "operator-linebreak": 1, // enforce consistent linebreak style for operators // DONE
256
+ "padded-blocks": 0, // require or disallow padding within blocks // DONE
257
+ "padding-line-between-statements": 1, // require or disallow padding lines between statements // DONE
258
+ "quotes": [1, "single"], // enforce the consistent use of either backticks, double, or single quotes // DONE
259
+ "rest-spread-spacing": 1, // enforce spacing between rest and spread operators and their expressions // DONE
260
+ "semi": 1, // require or disallow semicolons instead of ASI // DONE
261
+ "semi-spacing": 1, // enforce consistent spacing before and after semicolons // DONE
262
+ "semi-style": 1, // enforce location of semicolons // DONE
263
+ "space-before-blocks": 1, // enforce consistent spacing before blocks // DONE
264
+ "space-before-function-paren": 0, // enforce consistent spacing before `function` definition opening parenthesis // DONE
265
+ "space-in-parens": 1, // enforce consistent spacing inside parentheses // DONE
266
+ "space-infix-ops": 1, // require spacing around infix operators // DONE
267
+ "space-unary-ops": 1, // enforce consistent spacing before or after unary operators // DONE
268
+ "switch-colon-spacing": 1, // enforce spacing around colons of switch statements // DONE
269
+ "template-curly-spacing": 1, // require or disallow spacing around embedded expressions of template strings // DONE
270
+ "template-tag-spacing": 1, // require or disallow spacing between template tags and their literals // DONE
271
+ "unicode-bom": 1, // require or disallow Unicode byte order mark (BOM) // DONE
272
+ "wrap-iife": 1, // require parentheses around immediate `function` invocations // DONE
273
+ "wrap-regex": 1, // require parenthesis around regex literals // DONE
274
+ "yield-star-spacing": 1, // require or disallow spacing around the `*` in `yield*` expressions // DONE
275
+ "no-cond-assign": 1, // disallow assignment in conditional expressions // DONE
276
+ "no-constant-condition": 1, // disallow use of constant expressions in conditions // DONE
277
+ "no-control-regex": 1, // disallow control characters in regular expressions // DONE
278
+ "no-debugger": 0, // disallow use of debugger // DONE - OFF
279
+ "no-dupe-args": 1, // disallow duplicate arguments in functions // DONE
280
+ "no-dupe-keys": 1, // disallow duplicate keys when creating object literals // DONE
281
+ "no-duplicate-case": 1, // disallow a duplicate case label // DONE
282
+ "no-empty-class": 1, // disallow the use of empty character classes in regular expressions // DONE
283
+ "no-ex-assign": 1, // disallow assigning to the exception in a catch block // DONE
284
+ "no-func-assign": 1, // disallow overwriting functions written as function declarations // DONE
285
+ "no-inner-declarations": 1, // disallow function or variable declarations in nested blocks // DONE
286
+ "no-invalid-regexp": 1, // disallow invalid regular expression strings in the RegExp constructor // DONE
287
+ "no-irregular-whitespace": 1, // disallow irregular whitespace outside of strings and comments // DONE
288
+ "no-negated-in-lhs": 1, // disallow negation of the left operand of an in expression // DONE
289
+ "no-obj-calls": 1, // disallow the use of object properties of the global object (Math and JSON) as functions // DONE
290
+ "no-reserved-keys": 1, // disallow reserved words being used as object literal keys // DONE
291
+ "no-sparse-arrays": 1, // disallow sparse arrays // DONE
292
+ "no-unreachable": 1, // disallow unreachable statements after a return, throw, continue, or break statement // DONE
293
+ "use-isnan": 1, // disallow comparisons with the value NaN // DONE
294
+ "valid-jsdoc": 1, // ensure JSDoc comments are valid // DONE
295
+ "valid-typeof": 1, // ensure that the results of typeof are compared against a valid string // DONE
296
+ "no-catch-shadow": 1, // disallow the catch clause parameter name being the same as a variable in the outer scope // DONE
297
+ "no-unused-vars": 1, // disallow declaration of variables that are not used in the code // DONE
298
+ "newline-after-var": 0, // allow/disallow an empty newline after var statement // DONE - OFF
299
+ "no-spaced-func": 1, // disallow space between function identifier and application // DONE
300
+ "no-wrap-func": 1, // disallow wrapping of non-IIFE statements in parens // DONE
301
+ "space-after-keywords": [1, "always"], // require a space after certain keywords // DONE
302
+ "space-in-brackets": [1, "never"], // require or disallow spaces inside brackets // DONE
303
+ "space-return-throw-case": [1, "always"], // require a space after return, throw, and case // DONE
304
+ "spaced-line-comment": [1, "always"], // require or disallow a space immediately following the // in a line comment // DONE
305
+
306
+ // React specific
307
+ "react/display-name": 0, // prevent missing displayName in a React component definition // DONE - OFF
308
+ "react/jsx-quotes": [1, "double", "avoid-escape"], // Enforce quote style for JSX attributes // DONE
309
+ "react/jsx-no-undef": 1, // disallow undeclared variables in JSX // DONE
310
+ "react/jsx-sort-props": 0, // enforce props alphabetical sorting // DONE - OFF
311
+ "react/jsx-uses-react": 1, // prevent React to be incorrectly marked as unused // DONE
312
+ "react/jsx-uses-vars": 1, // prevent variables used in JSX to be incorrectly marked as unused // DONE
313
+ "react/no-did-mount-set-state": 1, // prevent usage of setState in componentDidMount // DONE
314
+ "react/no-did-update-set-state": 1, // prevent usage of setState in componentDidUpdate // DONE
315
+ "react/no-multi-comp": 0, // prevent multiple component definition per file // DONE - OFF
316
+ "react/no-unknown-property": 1, // prevent usage of unknown DOM property // DONE
317
+ "react/prop-types": 1, // prevent missing props validation in a React component definition // DONE
318
+ "react/react-in-jsx-scope": 1, // prevent missing React when using JSX // DONE
319
+ "react/self-closing-comp": 1, // prevent extra closing tags for components without children // DONE
320
+ "react/wrap-multilines": 1 // prevent missing parentheses around multilines JSX // DONE
321
+ }
322
+ }
323
+ ]
13
324
  };
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@wildpastry/eslint-config",
3
- "version": "1.0.5",
3
+ "version": "1.1.0",
4
4
  "description": "ESLint configuration file",
5
5
  "main": "index.js",
6
6
  "scripts": {
7
- "test": "echo \"Error: no test specified\" && exit 1"
7
+ "publish": "npm publish --access public"
8
8
  },
9
9
  "repository": {
10
10
  "type": "git",