@wildpastry/eslint-config 1.7.9 → 1.8.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/.eslintrc +230 -228
- package/.prettierrc +19 -0
- package/README.md +121 -29
- package/index.js +294 -305
- package/package.json +1 -1
package/.eslintrc
CHANGED
|
@@ -56,158 +56,155 @@
|
|
|
56
56
|
},
|
|
57
57
|
|
|
58
58
|
"rules": {
|
|
59
|
-
// Code
|
|
60
|
-
"
|
|
61
|
-
"no-
|
|
62
|
-
"no-
|
|
63
|
-
"
|
|
64
|
-
"no-
|
|
65
|
-
"no-
|
|
66
|
-
"no-
|
|
67
|
-
"no-
|
|
68
|
-
"no-
|
|
69
|
-
"no-
|
|
70
|
-
"
|
|
71
|
-
"
|
|
72
|
-
"
|
|
73
|
-
"
|
|
74
|
-
"
|
|
75
|
-
"
|
|
76
|
-
"
|
|
77
|
-
"
|
|
78
|
-
"
|
|
79
|
-
"
|
|
80
|
-
"
|
|
81
|
-
"
|
|
82
|
-
"
|
|
83
|
-
"
|
|
84
|
-
"
|
|
85
|
-
"
|
|
86
|
-
"
|
|
87
|
-
"
|
|
88
|
-
"
|
|
89
|
-
"
|
|
90
|
-
"
|
|
91
|
-
"
|
|
92
|
-
"
|
|
93
|
-
"
|
|
94
|
-
"
|
|
95
|
-
"
|
|
96
|
-
"
|
|
97
|
-
"max-
|
|
98
|
-
"max-
|
|
99
|
-
"max-
|
|
100
|
-
"max-
|
|
101
|
-
"
|
|
102
|
-
"
|
|
103
|
-
"
|
|
104
|
-
"
|
|
105
|
-
"
|
|
106
|
-
"no-
|
|
107
|
-
"no-
|
|
108
|
-
"no-
|
|
109
|
-
"no-
|
|
110
|
-
"no-
|
|
111
|
-
"no-
|
|
112
|
-
"no-
|
|
113
|
-
"no-
|
|
114
|
-
"no-
|
|
115
|
-
"no-
|
|
116
|
-
"no-
|
|
117
|
-
"no-
|
|
118
|
-
"no-
|
|
119
|
-
"no-
|
|
120
|
-
"no-
|
|
121
|
-
"no-
|
|
122
|
-
"no-
|
|
123
|
-
"no-
|
|
124
|
-
"no-
|
|
125
|
-
"no-
|
|
126
|
-
"no-
|
|
127
|
-
"no-
|
|
128
|
-
"no-
|
|
129
|
-
"no-
|
|
130
|
-
"no-
|
|
131
|
-
"no-
|
|
132
|
-
"no-
|
|
133
|
-
"no-
|
|
134
|
-
"no-
|
|
135
|
-
"no-
|
|
136
|
-
"no-
|
|
137
|
-
"no-
|
|
138
|
-
"no-
|
|
139
|
-
"no-
|
|
140
|
-
"no-
|
|
141
|
-
"no-new": 1, // disallow `new` operators
|
|
142
|
-
"no-
|
|
143
|
-
"no-
|
|
144
|
-
"no-
|
|
145
|
-
"no-
|
|
146
|
-
"no-
|
|
147
|
-
"no-
|
|
148
|
-
"no-
|
|
149
|
-
"no-
|
|
150
|
-
"no-
|
|
151
|
-
"no-
|
|
152
|
-
"no-
|
|
153
|
-
"no-restricted-
|
|
154
|
-
"no-restricted-
|
|
155
|
-
"no-
|
|
156
|
-
"no-
|
|
157
|
-
"no-
|
|
158
|
-
"no-
|
|
159
|
-
"no-
|
|
160
|
-
"no-
|
|
161
|
-
"no-
|
|
162
|
-
"no-
|
|
163
|
-
"no-
|
|
164
|
-
"no-
|
|
165
|
-
"no-
|
|
166
|
-
"no-
|
|
167
|
-
"no-
|
|
168
|
-
"no-
|
|
169
|
-
"no-
|
|
170
|
-
"no-
|
|
171
|
-
"no-
|
|
172
|
-
"no-useless-
|
|
173
|
-
"no-useless-
|
|
174
|
-
"no-useless-
|
|
175
|
-
"no-useless-
|
|
176
|
-
"no-useless-
|
|
177
|
-
"no-
|
|
178
|
-
"no-
|
|
179
|
-
"no-
|
|
180
|
-
"no-
|
|
181
|
-
"
|
|
182
|
-
"
|
|
183
|
-
"
|
|
184
|
-
"
|
|
185
|
-
"
|
|
186
|
-
"
|
|
187
|
-
"prefer-
|
|
188
|
-
"prefer-
|
|
189
|
-
"prefer-
|
|
190
|
-
"prefer-
|
|
191
|
-
"prefer-
|
|
192
|
-
"prefer-
|
|
193
|
-
"prefer-
|
|
194
|
-
"prefer-
|
|
195
|
-
"prefer-
|
|
196
|
-
"
|
|
197
|
-
"
|
|
198
|
-
"
|
|
199
|
-
"
|
|
200
|
-
"
|
|
201
|
-
"
|
|
202
|
-
"
|
|
203
|
-
"
|
|
204
|
-
"
|
|
205
|
-
"
|
|
206
|
-
"
|
|
207
|
-
"
|
|
208
|
-
"symbol-description": 1, // require symbol descriptions // DONE
|
|
209
|
-
"vars-on-top": 1, // require `var` declarations be placed at the top of their containing scope // DONE
|
|
210
|
-
"yoda": 1, // require or disallow "Yoda" conditions // DONE
|
|
59
|
+
// Modern Code Quality Rules
|
|
60
|
+
"array-callback-return": 1, // enforce `return` statements in callbacks of array methods - ENABLED for better code quality
|
|
61
|
+
"no-await-in-loop": 1, // disallow `await` inside of loops - ENABLED to prevent performance issues
|
|
62
|
+
"no-constructor-return": 1, // disallow returning value from constructor - ENABLED for correctness
|
|
63
|
+
"no-duplicate-imports": 1, // disallow duplicate module imports
|
|
64
|
+
"no-promise-executor-return": 1, // disallow returning values from Promise executor functions - ENABLED for correctness
|
|
65
|
+
"no-self-compare": 1, // disallow comparisons where both sides are exactly the same
|
|
66
|
+
"no-template-curly-in-string": 1, // disallow template literal placeholder syntax in regular strings - ENABLED to catch common mistakes
|
|
67
|
+
"no-unmodified-loop-condition": 1, // disallow unmodified loop conditions
|
|
68
|
+
"no-unreachable-loop": 1, // disallow loops with a body that allows only one iteration
|
|
69
|
+
"no-use-before-define": 0, // disallow the use of variables before they are defined - OFF for hoisting flexibility
|
|
70
|
+
"require-atomic-updates": 1, // disallow assignments that can lead to race conditions due to usage of `await` or `yield`
|
|
71
|
+
"accessor-pairs": 0, // enforce getter and setter pairs in objects and classes - OFF
|
|
72
|
+
"arrow-body-style": 0, // require braces around arrow function bodies - OFF
|
|
73
|
+
"block-scoped-var": 1, // enforce the use of variables within the scope they are defined
|
|
74
|
+
"camelcase": 1, // enforce camelcase naming convention
|
|
75
|
+
"capitalized-comments": 0, // enforce or disallow capitalization of the first letter of a comment - OFF for flexibility
|
|
76
|
+
"class-methods-use-this": 0, // enforce that class methods utilize `this` - OFF
|
|
77
|
+
"complexity": 0, // enforce a maximum cyclomatic complexity allowed in a program - OFF
|
|
78
|
+
"consistent-return": 1, // require `return` statements to either always or never specify values
|
|
79
|
+
"consistent-this": 1, // enforce consistent naming when capturing the current execution context
|
|
80
|
+
"default-case": 1, // require `default` cases in `switch` statements
|
|
81
|
+
"default-case-last": 1, // enforce default clauses in switch statements to be last
|
|
82
|
+
"default-param-last": 1, // enforce default parameters to be last - ENABLED for modern practices
|
|
83
|
+
"dot-notation": 1, // enforce dot notation whenever possible
|
|
84
|
+
"eqeqeq": 1, // require the use of `===` and `!==`
|
|
85
|
+
"func-name-matching": 1, // require function names to match the name of the variable or property to which they are assigned
|
|
86
|
+
"func-names": 0, // require or disallow named `function` expressions - OFF for flexibility
|
|
87
|
+
"func-style": 0, // enforce the consistent use of either `function` declarations or expressions - OFF
|
|
88
|
+
"grouped-accessor-pairs": 1, // require grouped accessor pairs in object literals and classes
|
|
89
|
+
"guard-for-in": 1, // require `for-in` loops to include an `if` statement
|
|
90
|
+
"id-denylist": 0, // disallow specified identifiers - OFF
|
|
91
|
+
"id-length": 0, // enforce minimum and maximum identifier lengths - OFF
|
|
92
|
+
"id-match": 0, // require identifiers to match a specified regular expression - OFF
|
|
93
|
+
"init-declarations": 0, // require or disallow initialization in variable declarations - OFF
|
|
94
|
+
"max-classes-per-file": 1, // enforce a maximum number of classes per file
|
|
95
|
+
"max-depth": [1, 4], // enforce a maximum depth that blocks can be nested - UPDATED to 4 for modern practices
|
|
96
|
+
"max-lines": [1, { "max": 1000, "skipBlankLines": true }], // enforce a maximum number of lines per file - UPDATED to 1000
|
|
97
|
+
"max-lines-per-function": [1, { "max": 300 }], // enforce a maximum number of lines of code in a function - UPDATED to 300
|
|
98
|
+
"max-nested-callbacks": [1, 4], // enforce a maximum depth that callbacks can be nested - UPDATED to 4
|
|
99
|
+
"max-params": [1, { "max": 5 }], // enforce a maximum number of parameters in function definitions - UPDATED to 5
|
|
100
|
+
"max-statements": [1, { "max": 30 }], // enforce a maximum number of statements allowed in function blocks - UPDATED to 30
|
|
101
|
+
"multiline-comment-style": 0, // enforce a particular style for multiline comments - OFF
|
|
102
|
+
"new-cap": 0, // require constructor names to begin with a capital letter - OFF
|
|
103
|
+
"no-alert": 1, // disallow the use of `alert`, `confirm`, and `prompt`
|
|
104
|
+
"no-array-constructor": 1, // disallow `Array` constructors
|
|
105
|
+
"no-bitwise": 0, // disallow bitwise operators - OFF for flexibility
|
|
106
|
+
"no-caller": 1, // disallow the use of `arguments.caller` or `arguments.callee`
|
|
107
|
+
"no-case-declarations": 1, // disallow lexical declarations in case clauses
|
|
108
|
+
"no-console": 1, // disallow the use of `console`
|
|
109
|
+
"no-continue": 0, // disallow `continue` statements - OFF for flexibility
|
|
110
|
+
"no-delete-var": 1, // disallow deleting variables
|
|
111
|
+
"no-div-regex": 1, // disallow division operators explicitly at the beginning of regular expressions
|
|
112
|
+
"no-else-return": 1, // disallow `else` blocks after `return` statements in `if` statements
|
|
113
|
+
"no-empty": 1, // disallow empty block statements
|
|
114
|
+
"no-empty-function": [1, { "allow": ["constructors"] }], // disallow empty functions
|
|
115
|
+
"no-eq-null": 1, // disallow `null` comparisons without type-checking operators
|
|
116
|
+
"no-eval": 1, // disallow the use of `eval()`
|
|
117
|
+
"no-extend-native": 1, // disallow extending native types
|
|
118
|
+
"no-extra-bind": 1, // disallow unnecessary calls to `.bind()`
|
|
119
|
+
"no-extra-boolean-cast": 1, // disallow unnecessary boolean casts
|
|
120
|
+
"no-extra-label": 1, // disallow unnecessary labels
|
|
121
|
+
"no-global-assign": 1, // disallow assignments to native objects or read-only global variables
|
|
122
|
+
"no-implicit-coercion": 1, // disallow shorthand type conversions
|
|
123
|
+
"no-implicit-globals": 1, // disallow declarations in the global scope
|
|
124
|
+
"no-implied-eval": 1, // disallow the use of `eval()`-like methods
|
|
125
|
+
"no-inline-comments": 0, // disallow inline comments after code - OFF for flexibility
|
|
126
|
+
"no-invalid-this": 1, // disallow `this` keywords outside of classes or class-like objects
|
|
127
|
+
"no-iterator": 1, // disallow the use of the `__iterator__` property
|
|
128
|
+
"no-label-var": 1, // disallow labels that share a name with a variable
|
|
129
|
+
"no-labels": 1, // disallow labeled statements
|
|
130
|
+
"no-lone-blocks": 1, // disallow unnecessary nested blocks
|
|
131
|
+
"no-lonely-if": 1, // disallow `if` statements as the only statement in `else` blocks
|
|
132
|
+
"no-loop-func": 1, // disallow function declarations that contain unsafe references inside loop statements
|
|
133
|
+
"no-magic-numbers": 0, // disallow magic numbers - OFF as it's often too restrictive
|
|
134
|
+
"no-multi-assign": 1, // disallow use of chained assignment expressions
|
|
135
|
+
"no-multi-str": 1, // disallow multiline strings
|
|
136
|
+
"no-negated-condition": 0, // disallow negated conditions - OFF for flexibility
|
|
137
|
+
"no-nested-ternary": 1, // disallow nested ternary expressions
|
|
138
|
+
"no-new": 1, // disallow `new` operators outside of assignments or comparisons
|
|
139
|
+
"no-new-func": 1, // disallow `new` operators with the `Function` object, // disallow `new` operators with the `Function` object // DONE
|
|
140
|
+
"no-new-object": 1, // disallow `Object` constructors
|
|
141
|
+
"no-new-wrappers": 1, // disallow `new` operators with the `String`, `Number`, and `Boolean` objects
|
|
142
|
+
"no-nonoctal-decimal-escape": 1, // disallow `\8` and `\9` escape sequences in string literals
|
|
143
|
+
"no-octal": 1, // disallow octal literals
|
|
144
|
+
"no-octal-escape": 1, // disallow octal escape sequences in string literals
|
|
145
|
+
"no-param-reassign": 1, // disallow reassigning `function` parameters
|
|
146
|
+
"no-plusplus": 0, // disallow the unary operators `++` and `--` - OFF
|
|
147
|
+
"no-proto": 1, // disallow the use of the `__proto__` property
|
|
148
|
+
"no-redeclare": 1, // disallow variable redeclaration
|
|
149
|
+
"no-regex-spaces": 1, // disallow multiple spaces in regular expressions
|
|
150
|
+
"no-restricted-exports": 0, // disallow specified names in exports - OFF
|
|
151
|
+
"no-restricted-globals": 0, // disallow specified global variables - OFF
|
|
152
|
+
"no-restricted-imports": 0, // disallow specified modules when loaded by `import` - OFF
|
|
153
|
+
"no-restricted-properties": 0, // disallow certain properties on certain objects - OFF
|
|
154
|
+
"no-restricted-syntax": 0, // disallow specified syntax - OFF
|
|
155
|
+
"no-return-assign": 1, // disallow assignment operators in `return` statements
|
|
156
|
+
"no-return-await": 1, // disallow unnecessary `return await`
|
|
157
|
+
"no-script-url": 1, // disallow `javascript:` urls
|
|
158
|
+
"no-sequences": 1, // disallow comma operators
|
|
159
|
+
"no-shadow": 0, // disallow variable declarations from shadowing variables declared in the outer scope - OFF
|
|
160
|
+
"no-shadow-restricted-names": 1, // disallow identifiers from shadowing restricted names
|
|
161
|
+
"no-ternary": 0, // disallow ternary operators - OFF
|
|
162
|
+
"no-throw-literal": 1, // disallow throwing literals as exceptions
|
|
163
|
+
"no-undef-init": 1, // disallow initializing variables to `undefined`
|
|
164
|
+
"no-undefined": 0, // disallow the use of `undefined` as an identifier - OFF
|
|
165
|
+
"no-underscore-dangle": 0, // disallow dangling underscores in identifiers - OFF
|
|
166
|
+
"no-unneeded-ternary": 1, // disallow ternary operators when simpler alternatives exist - ENABLED
|
|
167
|
+
"no-unused-expressions": 0, // disallow unused expressions - OFF
|
|
168
|
+
"no-unused-labels": 1, // disallow unused labels
|
|
169
|
+
"no-useless-call": 1, // disallow unnecessary calls to `.call()` and `.apply()`
|
|
170
|
+
"no-useless-catch": 1, // disallow unnecessary `catch` clauses
|
|
171
|
+
"no-useless-computed-key": 1, // disallow unnecessary computed property keys in objects and classes
|
|
172
|
+
"no-useless-concat": 1, // disallow unnecessary concatenation of literals or template literals
|
|
173
|
+
"no-useless-constructor": 1, // disallow unnecessary constructors - ENABLED
|
|
174
|
+
"no-useless-escape": 1, // disallow unnecessary escape characters
|
|
175
|
+
"no-useless-rename": 1, // disallow renaming import, export, and destructured assignments to the same name
|
|
176
|
+
"no-useless-return": 1, // disallow redundant return statements
|
|
177
|
+
"no-var": 1, // require `let` or `const` instead of `var`
|
|
178
|
+
"no-void": [1, { "allowAsStatement": true }], // disallow `void` operators
|
|
179
|
+
"no-warning-comments": 0, // disallow specified warning terms in comments - OFF
|
|
180
|
+
"no-with": 1, // disallow `with` statements
|
|
181
|
+
"object-shorthand": 1, // require or disallow method and property shorthand syntax for object literals - ENABLED
|
|
182
|
+
"one-var": 0, // enforce variables to be declared either together or separately in functions - OFF
|
|
183
|
+
"operator-assignment": 1, // require or disallow assignment operator shorthand where possible
|
|
184
|
+
"prefer-arrow-callback": 1, // require using arrow functions for callbacks
|
|
185
|
+
"prefer-const": 1, // require `const` declarations for variables that are never reassigned after declared
|
|
186
|
+
"prefer-destructuring": 0, // require destructuring from arrays and/or objects - OFF
|
|
187
|
+
"prefer-exponentiation-operator": 1, // disallow the use of `Math.pow` in favor of the `**` operator
|
|
188
|
+
"prefer-named-capture-group": 0, // enforce using named capture group in regular expression - OFF for flexibility
|
|
189
|
+
"prefer-numeric-literals": 1, // disallow `parseInt()` and `Number.parseInt()` in favor of binary, octal, and hexadecimal literals
|
|
190
|
+
"prefer-object-spread": 1, // disallow using Object.assign with an object literal as the first argument and prefer the use of object spread instead
|
|
191
|
+
"prefer-promise-reject-errors": 1, // require using Error objects as Promise rejection reasons
|
|
192
|
+
"prefer-regex-literals": 1, // disallow use of the `RegExp` constructor in favor of regular expression literals
|
|
193
|
+
"prefer-rest-params": 1, // require rest parameters instead of `arguments`
|
|
194
|
+
"prefer-spread": 1, // require spread operators instead of `.apply()`
|
|
195
|
+
"prefer-template": 1, // require template literals instead of string concatenation
|
|
196
|
+
"radix": 1, // enforce the consistent use of the radix argument when using `parseInt()`
|
|
197
|
+
"require-await": 1, // disallow async functions which have no `await` expression
|
|
198
|
+
"require-unicode-regexp": 0, // enforce the use of `u` flag on RegExp - OFF for compatibility
|
|
199
|
+
"require-yield": 1, // require generator functions to contain `yield`
|
|
200
|
+
"sort-imports": 0, // enforce sorted import declarations within modules - OFF for flexibility
|
|
201
|
+
"sort-keys": 0, // require object keys to be sorted - OFF
|
|
202
|
+
"sort-vars": 0, // require variables within the same declaration block to be sorted - OFF
|
|
203
|
+
"spaced-comment": 1, // enforce consistent spacing after the `//` or `/*` in a comment
|
|
204
|
+
"strict": 0, // require or disallow strict mode directives - OFF
|
|
205
|
+
"symbol-description": 1, // require symbol descriptions
|
|
206
|
+
"vars-on-top": 0, // require `var` declarations be placed at the top of their containing scope - OFF
|
|
207
|
+
"yoda": 1, // require or disallow "Yoda" conditions
|
|
211
208
|
|
|
212
209
|
// Top level formatting (These rules are turned off in eslint because they are still being applied using [prettier/prettier])
|
|
213
210
|
"curly": 0, // enforce consistent brace style for all control statements // DONE - OFF
|
|
@@ -288,84 +285,89 @@
|
|
|
288
285
|
"wrap-regex": 0, // require parenthesis around regex literals // DONE - OFF
|
|
289
286
|
"yield-star-spacing": 0, // require or disallow spacing around the `*` in `yield*` expressions // DONE - OFF
|
|
290
287
|
|
|
291
|
-
//
|
|
292
|
-
"line-comment-position":
|
|
293
|
-
"lines-between-class-members": 0, // require or disallow an empty line between class members
|
|
294
|
-
"max-len": [1, { "code":
|
|
295
|
-
"max-statements-per-line": 1, // enforce a maximum number of statements allowed per line
|
|
296
|
-
"padding-line-between-statements":
|
|
297
|
-
"no-cond-assign": 1, // disallow assignment in conditional expressions
|
|
298
|
-
"no-constant-condition": 1, // disallow use of constant expressions in conditions
|
|
299
|
-
"no-control-regex": 1, // disallow control characters in regular expressions
|
|
300
|
-
"no-debugger":
|
|
301
|
-
"no-dupe-args": 1, // disallow duplicate arguments in functions
|
|
302
|
-
"no-dupe-keys": 1, // disallow duplicate keys when creating object literals
|
|
303
|
-
"no-duplicate-case": 1, // disallow a duplicate case label
|
|
304
|
-
"no-ex-assign": 1, // disallow assigning to the exception in a catch block
|
|
305
|
-
"no-func-assign": 1, // disallow overwriting functions written as function declarations
|
|
306
|
-
"no-inner-declarations": 1, // disallow function or variable declarations in nested blocks
|
|
307
|
-
"no-invalid-regexp": 1, // disallow invalid regular expression strings in the RegExp constructor
|
|
308
|
-
"no-irregular-whitespace": 1, // disallow irregular whitespace outside of strings and comments
|
|
309
|
-
"no-
|
|
310
|
-
"no-
|
|
311
|
-
"no-
|
|
312
|
-
"
|
|
313
|
-
"
|
|
314
|
-
"
|
|
315
|
-
"
|
|
316
|
-
"no-catch-shadow": 1, // disallow the catch clause parameter name being the same as a variable in the outer scope // DONE
|
|
317
|
-
"no-unused-vars": 1, // disallow declaration of variables that are not used in the code // DONE
|
|
318
|
-
"newline-after-var": 0, // allow/disallow an empty newline after var statement // DONE - OFF
|
|
319
|
-
"no-spaced-func": 1, // disallow space between function identifier and application // DONE
|
|
320
|
-
"array-bracket-spacing": [0, "always"], // enforces consistent spacing inside array brackets // DONE - CUSTOMISED
|
|
288
|
+
// Core ESLint Rules
|
|
289
|
+
"line-comment-position": 0, // enforce position of line comments - OFF
|
|
290
|
+
"lines-between-class-members": 0, // require or disallow an empty line between class members - OFF
|
|
291
|
+
"max-len": [1, { "code": 100, "ignoreUrls": true, "ignoreComments": true, "ignorePattern": "^.*['\"].{10,}['\"].*$" }], // enforce a maximum line length - UPDATED to 100
|
|
292
|
+
"max-statements-per-line": 1, // enforce a maximum number of statements allowed per line
|
|
293
|
+
"padding-line-between-statements": 0, // require or disallow padding lines between statements - OFF
|
|
294
|
+
"no-cond-assign": 1, // disallow assignment in conditional expressions
|
|
295
|
+
"no-constant-condition": 1, // disallow use of constant expressions in conditions
|
|
296
|
+
"no-control-regex": 1, // disallow control characters in regular expressions
|
|
297
|
+
"no-debugger": 1, // disallow use of debugger - ENABLED for production
|
|
298
|
+
"no-dupe-args": 1, // disallow duplicate arguments in functions
|
|
299
|
+
"no-dupe-keys": 1, // disallow duplicate keys when creating object literals
|
|
300
|
+
"no-duplicate-case": 1, // disallow a duplicate case label
|
|
301
|
+
"no-ex-assign": 1, // disallow assigning to the exception in a catch block
|
|
302
|
+
"no-func-assign": 1, // disallow overwriting functions written as function declarations
|
|
303
|
+
"no-inner-declarations": 1, // disallow function or variable declarations in nested blocks
|
|
304
|
+
"no-invalid-regexp": 1, // disallow invalid regular expression strings in the RegExp constructor
|
|
305
|
+
"no-irregular-whitespace": 1, // disallow irregular whitespace outside of strings and comments
|
|
306
|
+
"no-obj-calls": 1, // disallow the use of object properties of the global object (Math and JSON) as functions
|
|
307
|
+
"no-sparse-arrays": 1, // disallow sparse arrays
|
|
308
|
+
"no-unreachable": 1, // disallow unreachable statements after a return, throw, continue, or break statement
|
|
309
|
+
"use-isnan": 1, // disallow comparisons with the value NaN
|
|
310
|
+
"valid-typeof": 1, // ensure that the results of typeof are compared against a valid string
|
|
311
|
+
"no-unused-vars": 1, // disallow declaration of variables that are not used in the code
|
|
312
|
+
"array-bracket-spacing": 0, // enforce consistent spacing inside array brackets - OFF
|
|
321
313
|
|
|
322
|
-
//
|
|
323
|
-
"@typescript-eslint/no-unused-vars": [1, { "argsIgnorePattern": "^_" }], //
|
|
324
|
-
"@typescript-eslint/
|
|
325
|
-
"@typescript-eslint/
|
|
326
|
-
"@typescript-eslint/
|
|
327
|
-
"@typescript-eslint/
|
|
328
|
-
"@typescript-eslint/
|
|
329
|
-
|
|
330
|
-
"@typescript-eslint/
|
|
331
|
-
"@typescript-eslint/
|
|
332
|
-
"@typescript-eslint/
|
|
333
|
-
"@typescript-eslint/
|
|
334
|
-
"@typescript-eslint/
|
|
335
|
-
"@typescript-eslint/
|
|
336
|
-
"@typescript-eslint/
|
|
337
|
-
"@typescript-eslint/
|
|
338
|
-
"@typescript-eslint/
|
|
339
|
-
"@typescript-eslint/
|
|
314
|
+
// TypeScript ESLint Rules
|
|
315
|
+
"@typescript-eslint/no-unused-vars": [1, { "argsIgnorePattern": "^_" }], // disallow unused variables with underscore prefix exception
|
|
316
|
+
"@typescript-eslint/no-explicit-any": 1, // disallow usage of the any type - ENABLED for better type safety
|
|
317
|
+
"@typescript-eslint/prefer-nullish-coalescing": 1, // prefer nullish coalescing operator - ENABLED for modern practices
|
|
318
|
+
"@typescript-eslint/prefer-optional-chain": 1, // prefer optional chaining - ENABLED for modern practices
|
|
319
|
+
"@typescript-eslint/no-non-null-assertion": 1, // disallow non-null assertions - ENABLED for safety
|
|
320
|
+
"@typescript-eslint/consistent-type-imports": 1, // enforce consistent usage of type imports - ENABLED
|
|
321
|
+
// TypeScript formatting rules (disabled - handled by Prettier)
|
|
322
|
+
"@typescript-eslint/brace-style": 0, // OFF
|
|
323
|
+
"@typescript-eslint/comma-dangle": 0, // OFF
|
|
324
|
+
"@typescript-eslint/comma-spacing": 0, // OFF
|
|
325
|
+
"@typescript-eslint/func-call-spacing": 0, // OFF
|
|
326
|
+
"@typescript-eslint/indent": 0, // OFF
|
|
327
|
+
"@typescript-eslint/keyword-spacing": 0, // OFF
|
|
328
|
+
"@typescript-eslint/member-delimiter-style": 0, // OFF
|
|
329
|
+
"@typescript-eslint/no-extra-parens": 0, // OFF
|
|
330
|
+
"@typescript-eslint/no-extra-semi": 0, // OFF
|
|
331
|
+
"@typescript-eslint/object-curly-spacing": 0, // OFF
|
|
332
|
+
"@typescript-eslint/semi": 0, // OFF
|
|
333
|
+
"@typescript-eslint/space-before-blocks": 0, // OFF
|
|
334
|
+
"@typescript-eslint/space-before-function-paren": 0, // OFF
|
|
335
|
+
"@typescript-eslint/space-infix-ops": 0, // OFF
|
|
336
|
+
"@typescript-eslint/type-annotation-spacing": 0, // OFF
|
|
337
|
+
"@typescript-eslint/quotes": 0, // OFF
|
|
340
338
|
|
|
341
|
-
// React
|
|
342
|
-
"react/display-name": 0, // prevent missing displayName in a React component definition
|
|
343
|
-
"react/jsx-no-undef": 1, // disallow undeclared variables in JSX
|
|
344
|
-
"react/jsx-sort-props": 0, // enforce props alphabetical sorting
|
|
345
|
-
"react/jsx-uses-react":
|
|
346
|
-
"react/jsx-uses-vars": 1, // prevent variables used in JSX to be incorrectly marked as unused
|
|
347
|
-
"react/no-did-mount-set-state":
|
|
348
|
-
"react/no-did-update-set-state":
|
|
349
|
-
"react/no-multi-comp": 0, // prevent multiple component definition per file
|
|
350
|
-
"react/no-unknown-property": 1, // prevent usage of unknown DOM property
|
|
351
|
-
"react/prop-types":
|
|
352
|
-
"react/react-in-jsx-scope": 0, // prevent missing React when using JSX
|
|
353
|
-
"react/self-closing-comp": 1, // prevent extra closing tags for components without children
|
|
354
|
-
"react/
|
|
355
|
-
"react/jsx-
|
|
356
|
-
"react/jsx-
|
|
357
|
-
|
|
358
|
-
"react/jsx-
|
|
359
|
-
"react/jsx-
|
|
360
|
-
"react/jsx-
|
|
361
|
-
"react/jsx-
|
|
362
|
-
"react/jsx-
|
|
363
|
-
"react/jsx-
|
|
364
|
-
"react/jsx-
|
|
365
|
-
"react/jsx-
|
|
366
|
-
"react/jsx-props
|
|
367
|
-
"react/jsx-
|
|
368
|
-
"react/jsx-
|
|
339
|
+
// React Rules
|
|
340
|
+
"react/display-name": 0, // prevent missing displayName in a React component definition - OFF
|
|
341
|
+
"react/jsx-no-undef": 1, // disallow undeclared variables in JSX
|
|
342
|
+
"react/jsx-sort-props": 0, // enforce props alphabetical sorting - OFF
|
|
343
|
+
"react/jsx-uses-react": 0, // prevent React to be incorrectly marked as unused - OFF for React 17+
|
|
344
|
+
"react/jsx-uses-vars": 1, // prevent variables used in JSX to be incorrectly marked as unused
|
|
345
|
+
"react/no-did-mount-set-state": 0, // prevent usage of setState in componentDidMount - OFF (deprecated)
|
|
346
|
+
"react/no-did-update-set-state": 0, // prevent usage of setState in componentDidUpdate - OFF (deprecated)
|
|
347
|
+
"react/no-multi-comp": 0, // prevent multiple component definition per file - OFF
|
|
348
|
+
"react/no-unknown-property": 1, // prevent usage of unknown DOM property
|
|
349
|
+
"react/prop-types": 0, // prevent missing props validation in a React component definition - OFF for TypeScript projects
|
|
350
|
+
"react/react-in-jsx-scope": 0, // prevent missing React when using JSX - OFF for React 17+
|
|
351
|
+
"react/self-closing-comp": 1, // prevent extra closing tags for components without children
|
|
352
|
+
"react/hook-use-state": 1, // enforce destructuring and symmetric naming of useState hook value and setter variables - ENABLED
|
|
353
|
+
"react/jsx-no-leaked-render": 1, // prevent problematic leaked values from being rendered - ENABLED
|
|
354
|
+
"react/jsx-no-useless-fragment": 1, // disallow unnecessary fragments - ENABLED
|
|
355
|
+
// React formatting rules (disabled - handled by Prettier)
|
|
356
|
+
"react/jsx-child-element-spacing": 0, // OFF
|
|
357
|
+
"react/jsx-closing-bracket-location": 0, // OFF
|
|
358
|
+
"react/jsx-closing-tag-location": 0, // OFF
|
|
359
|
+
"react/jsx-curly-newline": 0, // OFF
|
|
360
|
+
"react/jsx-curly-spacing": 0, // OFF
|
|
361
|
+
"react/jsx-equals-spacing": 0, // OFF
|
|
362
|
+
"react/jsx-first-prop-new-line": 0, // OFF
|
|
363
|
+
"react/jsx-indent": 0, // OFF
|
|
364
|
+
"react/jsx-indent-props": 0, // OFF
|
|
365
|
+
"react/jsx-max-props-per-line": 0, // OFF
|
|
366
|
+
"react/jsx-newline": 0, // OFF
|
|
367
|
+
"react/jsx-one-expression-per-line": 0, // OFF
|
|
368
|
+
"react/jsx-props-no-multi-spaces": 0, // OFF
|
|
369
|
+
"react/jsx-tag-spacing": 0, // OFF
|
|
370
|
+
"react/jsx-wrap-multilines": 0, // OFF
|
|
369
371
|
|
|
370
372
|
// Prettier specific
|
|
371
373
|
"prettier/prettier": 1
|
package/.prettierrc
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"arrowParens": "always",
|
|
3
|
+
"bracketSameLine": true,
|
|
4
|
+
"bracketSpacing": true,
|
|
5
|
+
"embeddedLanguageFormatting": "auto",
|
|
6
|
+
"endOfLine": "auto",
|
|
7
|
+
"htmlWhitespaceSensitivity": "strict",
|
|
8
|
+
"insertPragma": false,
|
|
9
|
+
"jsxSingleQuote": true,
|
|
10
|
+
"printWidth": 80,
|
|
11
|
+
"proseWrap": "preserve",
|
|
12
|
+
"quoteProps": "consistent",
|
|
13
|
+
"requirePragma": false,
|
|
14
|
+
"semi": true,
|
|
15
|
+
"singleQuote": true,
|
|
16
|
+
"tabWidth": 2,
|
|
17
|
+
"trailingComma": "none",
|
|
18
|
+
"useTabs": false
|
|
19
|
+
}
|