eslint-config-isaacscript 3.7.0 → 3.7.2
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 +10 -22
- package/base-jsdoc.js +16 -21
- package/base-typescript-eslint.js +25 -6
- package/base.js +8 -16
- package/mod.js +8 -4
- package/monorepo.js +8 -3
- package/package.json +1 -1
package/base-eslint.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
/**
|
|
2
|
+
* This ESLint config only contains built-in rules from ESLint itself:
|
|
3
|
+
* https://eslint.org/docs/latest/rules/
|
|
4
|
+
*
|
|
5
|
+
* @type {import("eslint").Linter.Config}
|
|
6
|
+
*/
|
|
7
|
+
const config = {
|
|
6
8
|
rules: {
|
|
7
9
|
// -----------------
|
|
8
10
|
// Possible Problems
|
|
@@ -112,8 +114,7 @@ module.exports = {
|
|
|
112
114
|
* Defined at:
|
|
113
115
|
* https://github.com/airbnb/javascript/blob/master/packages/eslint-config-airbnb-base/rules/style.js
|
|
114
116
|
*
|
|
115
|
-
* - We
|
|
116
|
-
* - We add a selector for "empty" invocations of the "array.push()" method.
|
|
117
|
+
* - We remove the `ForOfStatement` selector, since they are commonly used.
|
|
117
118
|
*/
|
|
118
119
|
"no-restricted-syntax": [
|
|
119
120
|
"warn",
|
|
@@ -132,23 +133,8 @@ module.exports = {
|
|
|
132
133
|
message:
|
|
133
134
|
"`with` is disallowed in strict mode because it makes code impossible to predict and optimize.",
|
|
134
135
|
},
|
|
135
|
-
{
|
|
136
|
-
selector:
|
|
137
|
-
"CallExpression[callee.property.name='push'][arguments.length=0]",
|
|
138
|
-
message: "push must always be called with at least one argument.",
|
|
139
|
-
},
|
|
140
136
|
],
|
|
141
137
|
|
|
142
|
-
/**
|
|
143
|
-
* Documentation:
|
|
144
|
-
* https://eslint.org/docs/latest/rules/no-unused-expressions
|
|
145
|
-
*
|
|
146
|
-
* Not defined in parent configs.
|
|
147
|
-
*
|
|
148
|
-
* An unused expression which has no effect on the state of the program indicates a logic error.
|
|
149
|
-
*/
|
|
150
|
-
"no-unused-expressions": "warn",
|
|
151
|
-
|
|
152
138
|
/**
|
|
153
139
|
* Documentation:
|
|
154
140
|
* https://eslint.org/docs/latest/rules/prefer-destructuring
|
|
@@ -295,3 +281,5 @@ module.exports = {
|
|
|
295
281
|
// class-methods-use-this
|
|
296
282
|
},
|
|
297
283
|
};
|
|
284
|
+
|
|
285
|
+
module.exports = config;
|
package/base-jsdoc.js
CHANGED
|
@@ -1,14 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
*/
|
|
10
|
-
"jsdoc",
|
|
11
|
-
],
|
|
1
|
+
/**
|
|
2
|
+
* This ESLint config only contains rules from `eslint-plugin-jsdoc`:
|
|
3
|
+
* https://github.com/gajus/eslint-plugin-jsdoc
|
|
4
|
+
*
|
|
5
|
+
* @type {import("eslint").Linter.Config}
|
|
6
|
+
*/
|
|
7
|
+
const config = {
|
|
8
|
+
plugins: ["jsdoc"],
|
|
12
9
|
|
|
13
10
|
/**
|
|
14
11
|
* Instead of using the recommended config, we specifically turn on every rule that is useful.
|
|
@@ -65,10 +62,14 @@ module.exports = {
|
|
|
65
62
|
"noSelf",
|
|
66
63
|
"noSelfInFile",
|
|
67
64
|
|
|
68
|
-
// Ignore tags used in ts-json-schema-generator
|
|
65
|
+
// Ignore tags used in `ts-json-schema-generator`:
|
|
69
66
|
// https://github.com/vega/ts-json-schema-generator
|
|
70
67
|
"minimum",
|
|
71
68
|
"maximum",
|
|
69
|
+
|
|
70
|
+
// Ignore tags used in `eslint-plugin-isaacscript`:
|
|
71
|
+
// https://github.com/IsaacScript/isaacscript/blob/main/packages/eslint-plugin-isaacscript/docs/rules/require-variadic-function-argument.md
|
|
72
|
+
"allowEmptyVariadic",
|
|
72
73
|
],
|
|
73
74
|
},
|
|
74
75
|
],
|
|
@@ -233,15 +234,7 @@ module.exports = {
|
|
|
233
234
|
// - jsdoc/require-yields-check - It's overboard to document every yield.
|
|
234
235
|
// - jsdoc/sort-tags - Not very useful since there are typically only `@param` and `@return`
|
|
235
236
|
// tags.
|
|
236
|
-
|
|
237
|
-
/**
|
|
238
|
-
* Documentation:
|
|
239
|
-
* https://github.com/gajus/eslint-plugin-jsdoc#tag-lines
|
|
240
|
-
*
|
|
241
|
-
* Enforces no lines between tags.
|
|
242
|
-
*/
|
|
243
|
-
"jsdoc/tag-lines": "warn",
|
|
244
|
-
|
|
237
|
+
// - jsdoc/tag-lines - Not needed with `isaacscript/format-jsdoc-comments`.
|
|
245
238
|
// - jsdoc/valid-types - Not needed in TypeScript.
|
|
246
239
|
},
|
|
247
240
|
|
|
@@ -255,3 +248,5 @@ module.exports = {
|
|
|
255
248
|
},
|
|
256
249
|
],
|
|
257
250
|
};
|
|
251
|
+
|
|
252
|
+
module.exports = config;
|
|
@@ -1,8 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
/**
|
|
2
|
+
* This config only contains rules from `@typescript-eslint` plugin.
|
|
3
|
+
*
|
|
4
|
+
* @type {import("eslint").Linter.Config}
|
|
5
|
+
*/
|
|
6
|
+
const config = {
|
|
7
|
+
/** This plugin has three separate configs that are recommended to extend from. */
|
|
8
|
+
extends: [
|
|
9
|
+
// https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/recommended.ts
|
|
10
|
+
"plugin:@typescript-eslint/recommended",
|
|
11
|
+
|
|
12
|
+
// https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/recommended-requiring-type-checking.ts
|
|
13
|
+
"plugin:@typescript-eslint/recommended-requiring-type-checking",
|
|
14
|
+
|
|
15
|
+
// https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/strict.ts
|
|
16
|
+
"plugin:@typescript-eslint/strict",
|
|
17
|
+
],
|
|
18
|
+
|
|
6
19
|
rules: {
|
|
7
20
|
/**
|
|
8
21
|
* Documentation:
|
|
@@ -140,7 +153,7 @@ module.exports = {
|
|
|
140
153
|
* Defined at:
|
|
141
154
|
* https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/strict.ts
|
|
142
155
|
*
|
|
143
|
-
* This can modify the type of boolean declarations to
|
|
156
|
+
* This can modify the type of boolean declarations to `boolean | undefined`, which is undesired
|
|
144
157
|
* in some circumstances:
|
|
145
158
|
* https://github.com/typescript-eslint/typescript-eslint/issues/5269
|
|
146
159
|
*/
|
|
@@ -166,6 +179,10 @@ module.exports = {
|
|
|
166
179
|
},
|
|
167
180
|
],
|
|
168
181
|
|
|
182
|
+
// This is part of the recommended config, but we turn it off because of this issue:
|
|
183
|
+
// https://github.com/typescript-eslint/typescript-eslint/issues/7067
|
|
184
|
+
"@typescript-eslint/no-unsafe-enum-comparison": "off",
|
|
185
|
+
|
|
169
186
|
/**
|
|
170
187
|
* Documentation:
|
|
171
188
|
* https://typescript-eslint.io/rules/restrict-template-expressions
|
|
@@ -228,3 +245,5 @@ module.exports = {
|
|
|
228
245
|
},
|
|
229
246
|
],
|
|
230
247
|
};
|
|
248
|
+
|
|
249
|
+
module.exports = config;
|
package/base.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
/**
|
|
2
|
+
* This ESLint config is meant to be used as a base for all TypeScript projects.
|
|
3
|
+
*
|
|
4
|
+
* @type {import("eslint").Linter.Config}
|
|
5
|
+
*/
|
|
6
|
+
const config = {
|
|
5
7
|
extends: [
|
|
6
8
|
/**
|
|
7
9
|
* The linter base is the Airbnb style guide, which is the most popular JavaScript style guide
|
|
@@ -20,18 +22,6 @@ module.exports = {
|
|
|
20
22
|
*/
|
|
21
23
|
"airbnb-typescript/base",
|
|
22
24
|
|
|
23
|
-
/**
|
|
24
|
-
* We extend the Airbnb rules with the "recommended", "recommended-requiring-type-checking", and
|
|
25
|
-
* "strict" rules from the "typescript-eslint" plugin, which is also recommended by Matt
|
|
26
|
-
* Turnbull, the author of "airbnb-typescript/base":
|
|
27
|
-
* https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/recommended.ts
|
|
28
|
-
* https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/recommended-requiring-type-checking.ts
|
|
29
|
-
* https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/strict.ts
|
|
30
|
-
*/
|
|
31
|
-
"plugin:@typescript-eslint/recommended",
|
|
32
|
-
"plugin:@typescript-eslint/recommended-requiring-type-checking",
|
|
33
|
-
"plugin:@typescript-eslint/strict",
|
|
34
|
-
|
|
35
25
|
/**
|
|
36
26
|
* This provides extra miscellaneous rules to keep code safe:
|
|
37
27
|
* https://github.com/IsaacScript/isaacscript/tree/main/packages/eslint-plugin-isaacscript
|
|
@@ -382,3 +372,5 @@ module.exports = {
|
|
|
382
372
|
},
|
|
383
373
|
],
|
|
384
374
|
};
|
|
375
|
+
|
|
376
|
+
module.exports = config;
|
package/mod.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
/**
|
|
2
|
+
* This config is meant to be used as a base for IsaacScript mods (or TypeScriptToLua projects).
|
|
3
|
+
*
|
|
4
|
+
* @type {import("eslint").Linter.Config}
|
|
5
|
+
*/
|
|
6
|
+
const config = {
|
|
5
7
|
extends: [
|
|
6
8
|
/**
|
|
7
9
|
* The IsaacScript mod config extends the base configuration:
|
|
@@ -228,3 +230,5 @@ module.exports = {
|
|
|
228
230
|
],
|
|
229
231
|
},
|
|
230
232
|
};
|
|
233
|
+
|
|
234
|
+
module.exports = config;
|
package/monorepo.js
CHANGED
|
@@ -2,9 +2,12 @@ const path = require("node:path");
|
|
|
2
2
|
|
|
3
3
|
const REPO_ROOT = path.join(__dirname, "..", "..", "..");
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
/**
|
|
6
|
+
* This config is meant to be used in the IsaacScript monorepo.
|
|
7
|
+
*
|
|
8
|
+
* @type {import("eslint").Linter.Config}
|
|
9
|
+
*/
|
|
10
|
+
const config = {
|
|
8
11
|
plugins: ["@nrwl/nx"],
|
|
9
12
|
|
|
10
13
|
// From:
|
|
@@ -43,3 +46,5 @@ module.exports = {
|
|
|
43
46
|
],
|
|
44
47
|
},
|
|
45
48
|
};
|
|
49
|
+
|
|
50
|
+
module.exports = config;
|