eslint-config-isaacscript 3.7.1 → 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 CHANGED
@@ -1,8 +1,10 @@
1
- // This is a shared configuration file for ESLint:
2
- // https://eslint.org/docs/latest/user-guide/configuring
3
- // This config only contains modifications to the built-in rules from the ESLint tool.
4
- // https://eslint.org/docs/latest/rules/
5
- module.exports = {
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
@@ -133,16 +135,6 @@ module.exports = {
133
135
  },
134
136
  ],
135
137
 
136
- /**
137
- * Documentation:
138
- * https://eslint.org/docs/latest/rules/no-unused-expressions
139
- *
140
- * Not defined in parent configs.
141
- *
142
- * An unused expression which has no effect on the state of the program indicates a logic error.
143
- */
144
- "no-unused-expressions": "warn",
145
-
146
138
  /**
147
139
  * Documentation:
148
140
  * https://eslint.org/docs/latest/rules/prefer-destructuring
@@ -289,3 +281,5 @@ module.exports = {
289
281
  // class-methods-use-this
290
282
  },
291
283
  };
284
+
285
+ module.exports = config;
package/base-jsdoc.js CHANGED
@@ -1,14 +1,11 @@
1
- // This is a shared configuration file for ESLint:
2
- // https://eslint.org/docs/latest/user-guide/configuring
3
- // This config contains only rules from the "jsdoc" ESLint plugin.
4
- module.exports = {
5
- plugins: [
6
- /**
7
- * Lint JSDoc style comments:
8
- * https://github.com/gajus/eslint-plugin-jsdoc
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.
@@ -237,15 +234,7 @@ module.exports = {
237
234
  // - jsdoc/require-yields-check - It's overboard to document every yield.
238
235
  // - jsdoc/sort-tags - Not very useful since there are typically only `@param` and `@return`
239
236
  // tags.
240
-
241
- /**
242
- * Documentation:
243
- * https://github.com/gajus/eslint-plugin-jsdoc#tag-lines
244
- *
245
- * Enforces no lines between tags.
246
- */
247
- "jsdoc/tag-lines": "warn",
248
-
237
+ // - jsdoc/tag-lines - Not needed with `isaacscript/format-jsdoc-comments`.
249
238
  // - jsdoc/valid-types - Not needed in TypeScript.
250
239
  },
251
240
 
@@ -259,3 +248,5 @@ module.exports = {
259
248
  },
260
249
  ],
261
250
  };
251
+
252
+ module.exports = config;
@@ -1,8 +1,21 @@
1
- // This is a shared configuration file for ESLint:
2
- // https://eslint.org/docs/latest/user-guide/configuring
3
- // This config only contains modifications to the built-in rules from the "@typescript-eslint"
4
- // plugin.
5
- module.exports = {
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:
@@ -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
- // This is a shared configuration file for ESLint:
2
- // https://eslint.org/docs/latest/user-guide/configuring
3
- // This config is meant to be used as a base for all TypeScript projects.
4
- module.exports = {
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
- // This is a shared configuration file for ESLint:
2
- // https://eslint.org/docs/latest/user-guide/configuring
3
- // This config is meant to be used as a base for IsaacScript mods.
4
- module.exports = {
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
- // This is a shared configuration file for ESLint:
6
- // https://eslint.org/docs/latest/user-guide/configuring
7
- module.exports = {
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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-config-isaacscript",
3
- "version": "3.7.1",
3
+ "version": "3.7.2",
4
4
  "description": "A sharable ESLint config for TypeScript and IsaacScript projects.",
5
5
  "keywords": [
6
6
  "eslint",