eslint-config-isaacscript 1.0.65 → 1.0.68

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/README.md +2 -2
  2. package/base.js +7 -103
  3. package/jsdoc.js +65 -0
  4. package/package.json +1 -1
package/README.md CHANGED
@@ -1,7 +1,7 @@
1
- [![npm version](https://img.shields.io/npm/v/eslint-config-isaacscript.svg)](https://www.npmjs.com/package/eslint-config-isaacscript)
2
-
3
1
  # eslint-config-isaacscript
4
2
 
3
+ [![npm version](https://img.shields.io/npm/v/eslint-config-isaacscript.svg)](https://www.npmjs.com/package/eslint-config-isaacscript)
4
+
5
5
  This is a helper configuration for ESLint that is intended to be used in IsaacScript projects.
6
6
 
7
7
  Please see the [IsaacScript webpage](https://isaacscript.github.io/) for more information.
package/base.js CHANGED
@@ -22,41 +22,15 @@ module.exports = {
22
22
  "plugin:@typescript-eslint/recommended",
23
23
  "plugin:@typescript-eslint/recommended-requiring-type-checking",
24
24
 
25
- // This provides rules for max comment length that the "--fix" flag can fix
26
- "plugin:comment-length-2/recommended",
27
-
28
- // This provides a version of the "eqeqeq" rule that the "--fix" flag can fix
29
- // https://github.com/Zamiell/eslint-plugin-eqeqeq-fix
30
- "plugin:eqeqeq-fix/recommended",
25
+ // This provides extra miscellaneous rules to keep code safe
26
+ "plugin:isaacscript/recommended",
31
27
 
32
28
  // Find unused "eslint-disable" comments
33
29
  // https://github.com/mysticatea/eslint-plugin-eslint-comments
34
30
  "plugin:eslint-comments/recommended",
35
31
 
36
- // Lint JSDoc style comments
37
- // https://github.com/gajus/eslint-plugin-jsdoc
38
- "plugin:jsdoc/recommended",
39
-
40
- // This prevents declaring arrays without a type
41
- // https://github.com/Zamiell/eslint-plugin-no-array-any
42
- "plugin:no-array-any/recommended",
43
-
44
- // This prevents implicit iteration of Maps and Sets,
45
- // which is helpful to prevent bugs when refactoring
46
- // https://github.com/Zamiell/eslint-plugin-no-implicit-map-set-loops
47
- "plugin:no-implicit-map-set-loops/recommended",
48
-
49
- // This prevents declaring variables without a type
50
- // https://github.com/Zamiell/eslint-plugin-no-let-any
51
- "plugin:no-let-any/recommended",
52
-
53
- // This provides a version of the "no-template-curly-in-string" that the "--fix" flag can fix
54
- // https://github.com/Zamiell/eslint-plugin-no-template-curly-in-string-fix
55
- "plugin:no-template-curly-in-string-fix/recommended",
56
-
57
- // This prevents void return types on unexported functions
58
- // https://github.com/Zamiell/eslint-plugin-no-void-return-type
59
- "plugin:no-void-return-type/recommended",
32
+ // This provides rules to lint JSDoc comments
33
+ "./jsdoc",
60
34
 
61
35
  // Disable any ESLint rules that conflict with Prettier
62
36
  // (otherwise, we will have unfixable ESLint errors)
@@ -81,7 +55,7 @@ module.exports = {
81
55
  // Documentation:
82
56
  // https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/array-type.md
83
57
  // Not defined in the parent configs
84
- // Prefer the "[]string" syntax over "Array<string>"
58
+ // Prefer the "string[]" syntax over "Array<string>"
85
59
  "@typescript-eslint/array-type": ["warn", { default: "array-simple" }],
86
60
 
87
61
  // Documentation:
@@ -146,13 +120,14 @@ module.exports = {
146
120
  // Defined at:
147
121
  // https://github.com/airbnb/javascript/blob/master/packages/eslint-config-airbnb-base/rules/variables.js
148
122
  // We want to lint unused arguments (the default is "after-used")
149
- // We also want to ignore function arguments that start with an underscore
123
+ // We also want to ignore arguments/variables that start with an underscore
150
124
  // This matches the behavior of the TypeScript compiler flag "--noUnusedLocals"
151
125
  "@typescript-eslint/no-unused-vars": [
152
126
  "warn",
153
127
  {
154
128
  args: "all",
155
129
  argsIgnorePattern: "^_",
130
+ varsIgnorePattern: "^_",
156
131
  },
157
132
  ],
158
133
 
@@ -261,77 +236,6 @@ module.exports = {
261
236
  // https://basarat.gitbook.io/typescript/main-1/defaultisbad
262
237
  "import/prefer-default-export": "off",
263
238
 
264
- // Documentation:
265
- // https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-check-tag-names
266
- // Defined at:
267
- // https://github.com/gajus/eslint-plugin-jsdoc/blob/master/src/index.js
268
- // Allow the use of TypeScriptToLua compiler annotations as documented here:
269
- // https://typescripttolua.github.io/docs/advanced/compiler-annotations
270
- "jsdoc/check-tag-names": [
271
- "warn",
272
- {
273
- definedTags: [
274
- "category", // Used in TypeDoc
275
- "hidden", // Used in TypeDoc
276
- "internal", // Used by TypeScript
277
- "noResolution", // Used in TypeScriptToLua as a compiler annotation
278
- "noSelf", // Used in TypeScriptToLua as a compiler annotation
279
- ],
280
- },
281
- ],
282
-
283
- // Documentation:
284
- // https://github.com/gajus/eslint-plugin-jsdoc#user-content-eslint-plugin-jsdoc-rules-match-description
285
- // Not defined in parent configs
286
- // Needed for catching superfluous leading and trailing newlines as documented here:
287
- // https://github.com/gajus/eslint-plugin-jsdoc/issues/847
288
- "jsdoc/match-description": [
289
- "warn",
290
- {
291
- matchDescription: "^\\S[\\s\\S]*\\S$",
292
- contexts: [
293
- {
294
- comment: "JsdocBlock[endLine!=0]:not(:has(JsdocTag))",
295
- },
296
- ],
297
- },
298
- ],
299
-
300
- // Documentation:
301
- // https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-require-jsdoc
302
- // Defined at:
303
- // https://github.com/gajus/eslint-plugin-jsdoc/blob/master/src/index.js
304
- // Do not require JSDoc comments for every function, as that is excessive
305
- "jsdoc/require-jsdoc": "off",
306
-
307
- // Documentation:
308
- // https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-require-param
309
- // Defined at:
310
- // https://github.com/gajus/eslint-plugin-jsdoc/blob/master/src/index.js
311
- // Do not require parameters for every function, as that is excessive when using TypeScript
312
- "jsdoc/require-param": "off",
313
-
314
- // Documentation:
315
- // https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-require-param-type
316
- // Defined at:
317
- // https://github.com/gajus/eslint-plugin-jsdoc/blob/master/src/index.js
318
- // Since we are using TypeScript, requiring parameter types would be superfluous
319
- "jsdoc/require-param-type": "off",
320
-
321
- // Documentation:
322
- // https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-require-returns
323
- // Defined at:
324
- // https://github.com/gajus/eslint-plugin-jsdoc/blob/master/src/index.js
325
- // Do not require return listing for every function, as that is excessive when using TypeScript
326
- "jsdoc/require-returns": "off",
327
-
328
- // Documentation:
329
- // https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-require-returns-type
330
- // Defined at:
331
- // https://github.com/gajus/eslint-plugin-jsdoc/blob/master/src/index.js
332
- // Since we are using TypeScript, requiring parameter types would be superfluous
333
- "jsdoc/require-returns-type": "off",
334
-
335
239
  // Documentation:
336
240
  // https://eslint.org/docs/rules/no-console
337
241
  // Defined at:
package/jsdoc.js ADDED
@@ -0,0 +1,65 @@
1
+ // This is a shared configuration file for ESLint
2
+ // https://eslint.org/docs/user-guide/configuring
3
+ module.exports = {
4
+ plugins: [
5
+ // Lint JSDoc style comments
6
+ // https://github.com/gajus/eslint-plugin-jsdoc
7
+ "jsdoc",
8
+ ],
9
+
10
+ rules: {
11
+ // jsdoc/check-access - Not needed in TypeScript.
12
+ // jsdoc/check-alignment - Overlaps with `isaacscript-limit-jsdoc-comments`.
13
+ // jsdoc/check-examples - Not worth it since some ESLint rules may not apply to examples.
14
+ // jsdoc/check-indentation - Overlaps with `isaacscript-limit-jsdoc-comments`.
15
+ // jsdoc/check-line-alignment - This is not a common formatting scheme in the wild. It's also
16
+ // not recommended by the plugin.
17
+
18
+ // Documentation:
19
+ // https://github.com/gajus/eslint-plugin-jsdoc#check-param-names
20
+ // Ensures that parameter names in JSDoc match those in the function declaration.
21
+ "jsdoc/check-param-names": "warn",
22
+
23
+ // jsdoc/check-property-names - Not needed in TypeScript.
24
+ // jsdoc/check-syntax - Not needed in TypeScript.
25
+
26
+ // Documentation:
27
+ // https://github.com/gajus/eslint-plugin-jsdoc#check-tag-names
28
+ // Allow the use of TypeScriptToLua compiler annotations as documented here:
29
+ // https://typescripttolua.github.io/docs/advanced/compiler-annotations
30
+ "jsdoc/check-tag-names": [
31
+ "warn",
32
+ {
33
+ definedTags: [
34
+ "category", // Used in TypeDoc
35
+ "hidden", // Used in TypeDoc
36
+ "internal", // Used by TypeScript
37
+ "noResolution", // Used in TypeScriptToLua as a compiler annotation
38
+ "noSelf", // Used in TypeScriptToLua as a compiler annotation
39
+ ],
40
+ },
41
+ ],
42
+
43
+ // jsdoc/check-types - Not needed in TypeScript.
44
+
45
+ // Documentation:
46
+ // https://github.com/gajus/eslint-plugin-jsdoc#check-values
47
+ // Validates the content of some uncommon JSDoc tags
48
+ "jsdoc/check-values": "warn",
49
+
50
+ // Documentation:
51
+ // https://github.com/gajus/eslint-plugin-jsdoc#check-values
52
+ // Validates the content of some uncommon JSDoc tags
53
+ "jsdoc/empty-tags": "warn",
54
+
55
+ // Documentation:
56
+ // https://github.com/gajus/eslint-plugin-jsdoc#implements-on-classes
57
+ // Reports issues with incorrect usage of @implements
58
+ "jsdoc/implements-on-classes": "warn",
59
+
60
+ // Documentation:
61
+ // https://github.com/gajus/eslint-plugin-jsdoc#match-description
62
+ // JSDoc comments should always be full sentences
63
+ "jsdoc/match-description": ["warn"],
64
+ },
65
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-config-isaacscript",
3
- "version": "1.0.65",
3
+ "version": "1.0.68",
4
4
  "description": "An ESLint config for IsaacScript projects.",
5
5
  "repository": {
6
6
  "type": "git",