eslint-config-isaacscript 4.0.9 → 4.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.
- package/base-eslint.js +14 -7
- package/base-no-autofix.js +12 -0
- package/mod.js +1 -1
- package/package.json +1 -1
package/base-eslint.js
CHANGED
|
@@ -119,15 +119,15 @@ const SUGGESTIONS = {
|
|
|
119
119
|
"class-methods-use-this": "off",
|
|
120
120
|
|
|
121
121
|
/**
|
|
122
|
-
* Disabled since cyclomatic complexity is not a good enough general indicator of code complexity
|
|
122
|
+
* Disabled since cyclomatic complexity is not a good enough general indicator of code complexity
|
|
123
|
+
* and leads to too many false positives.
|
|
123
124
|
*/
|
|
124
125
|
complexity: "off",
|
|
125
126
|
|
|
126
127
|
/** Disabled since this is handled by the `noImplicitReturns` TypeScript compiler flag. */
|
|
127
128
|
"consistent-return": "off",
|
|
128
129
|
|
|
129
|
-
|
|
130
|
-
"consistent-this": "off",
|
|
130
|
+
"consistent-this": "error",
|
|
131
131
|
|
|
132
132
|
/**
|
|
133
133
|
* Always requiring curly braces can partially ward against [Apple-style if statement
|
|
@@ -138,8 +138,8 @@ const SUGGESTIONS = {
|
|
|
138
138
|
curly: ["error", "all"],
|
|
139
139
|
|
|
140
140
|
/**
|
|
141
|
-
* Disabled since it
|
|
142
|
-
*
|
|
141
|
+
* Disabled since it would cause the `@typescript-eslint/switch-exhaustiveness-check` rule to not
|
|
142
|
+
* work properly.
|
|
143
143
|
*/
|
|
144
144
|
"default-case": "off",
|
|
145
145
|
|
|
@@ -157,7 +157,10 @@ const SUGGESTIONS = {
|
|
|
157
157
|
"func-name-matching": "error",
|
|
158
158
|
"func-names": "error",
|
|
159
159
|
|
|
160
|
-
/**
|
|
160
|
+
/**
|
|
161
|
+
* Disabled since it is common in the TypeScript ecosystem to use both function forms, depending
|
|
162
|
+
* on the situation.
|
|
163
|
+
*/
|
|
161
164
|
"func-style": "off",
|
|
162
165
|
|
|
163
166
|
"grouped-accessor-pairs": "error",
|
|
@@ -239,7 +242,11 @@ const SUGGESTIONS = {
|
|
|
239
242
|
*/
|
|
240
243
|
"no-console": "off",
|
|
241
244
|
|
|
242
|
-
/**
|
|
245
|
+
/**
|
|
246
|
+
* Disabled because proper use of continues can reduce indentation for long blocks of code in the
|
|
247
|
+
* same way as the [early return
|
|
248
|
+
* pattern](https://medium.com/swlh/return-early-pattern-3d18a41bba8).
|
|
249
|
+
*/
|
|
243
250
|
"no-continue": "off",
|
|
244
251
|
|
|
245
252
|
"no-delete-var": "error",
|
package/base-no-autofix.js
CHANGED
|
@@ -10,7 +10,19 @@ const config = {
|
|
|
10
10
|
plugins: ["no-autofix"],
|
|
11
11
|
|
|
12
12
|
rules: {
|
|
13
|
+
/**
|
|
14
|
+
* It is common during development to comment out code after an [early
|
|
15
|
+
* return](https://medium.com/swlh/return-early-pattern-3d18a41bba8). In these cases, the
|
|
16
|
+
* auto-fixer is harmful, since it would require us to manually go put the return statement back
|
|
17
|
+
* after uncommenting the code.
|
|
18
|
+
*/
|
|
13
19
|
"no-autofix/no-useless-return": "error",
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* It is common during development to comment out code that modifies a `let` variable. In these
|
|
23
|
+
* cases, the auto-fixer is harmful, since it would require us to manually go change the `const`
|
|
24
|
+
* back to a `let` after uncommenting the code.
|
|
25
|
+
*/
|
|
14
26
|
"no-autofix/prefer-const": "error",
|
|
15
27
|
},
|
|
16
28
|
};
|
package/mod.js
CHANGED
|
@@ -7,7 +7,7 @@ const config = {
|
|
|
7
7
|
extends: [
|
|
8
8
|
/**
|
|
9
9
|
* The IsaacScript mod config extends the base configuration:
|
|
10
|
-
* https://github.com/IsaacScript/isaacscript/blob/main/packages/eslint-config-isaacscript/base.js
|
|
10
|
+
* https://github.com/IsaacScript/isaacscript/blob/main/packages/eslint-config-isaacscript/configs/base.js
|
|
11
11
|
* (Normal TypeScript projects would just use the base configuration directly.)
|
|
12
12
|
*/
|
|
13
13
|
"./base",
|