eslint-config-isaacscript 1.0.66 → 1.0.69

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 +5 -112
  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,9 +22,6 @@ 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
25
  // This provides extra miscellaneous rules to keep code safe
29
26
  "plugin:isaacscript/recommended",
30
27
 
@@ -32,18 +29,8 @@ module.exports = {
32
29
  // https://github.com/mysticatea/eslint-plugin-eslint-comments
33
30
  "plugin:eslint-comments/recommended",
34
31
 
35
- // Lint JSDoc style comments
36
- // https://github.com/gajus/eslint-plugin-jsdoc
37
- "plugin:jsdoc/recommended",
38
-
39
- // This prevents implicit iteration of Maps and Sets,
40
- // which is helpful to prevent bugs when refactoring
41
- // https://github.com/Zamiell/eslint-plugin-no-implicit-map-set-loops
42
- "plugin:no-implicit-map-set-loops/recommended",
43
-
44
- // This prevents void return types on unexported functions
45
- // https://github.com/Zamiell/eslint-plugin-no-void-return-type
46
- "plugin:no-void-return-type/recommended",
32
+ // This provides rules to lint JSDoc comments
33
+ "./jsdoc",
47
34
 
48
35
  // Disable any ESLint rules that conflict with Prettier
49
36
  // (otherwise, we will have unfixable ESLint errors)
@@ -68,7 +55,7 @@ module.exports = {
68
55
  // Documentation:
69
56
  // https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/array-type.md
70
57
  // Not defined in the parent configs
71
- // Prefer the "[]string" syntax over "Array<string>"
58
+ // Prefer the "string[]" syntax over "Array<string>"
72
59
  "@typescript-eslint/array-type": ["warn", { default: "array-simple" }],
73
60
 
74
61
  // Documentation:
@@ -133,13 +120,14 @@ module.exports = {
133
120
  // Defined at:
134
121
  // https://github.com/airbnb/javascript/blob/master/packages/eslint-config-airbnb-base/rules/variables.js
135
122
  // We want to lint unused arguments (the default is "after-used")
136
- // 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
137
124
  // This matches the behavior of the TypeScript compiler flag "--noUnusedLocals"
138
125
  "@typescript-eslint/no-unused-vars": [
139
126
  "warn",
140
127
  {
141
128
  args: "all",
142
129
  argsIgnorePattern: "^_",
130
+ varsIgnorePattern: "^_",
143
131
  },
144
132
  ],
145
133
 
@@ -189,30 +177,6 @@ module.exports = {
189
177
  },
190
178
  ],
191
179
 
192
- // Documentation:
193
- // https://github.com/lasselupe33/eslint-plugin-comment-length
194
- // Defined at:
195
- // https://github.com/lasselupe33/eslint-plugin-comment-length/blob/master/rules/src/index.ts
196
- // Auto-fix long comments. We specify 100 to match the ruler and the Airbnb style guide.
197
- "comment-length-2/limit-multi-line-comments": [
198
- "warn",
199
- {
200
- maxLength: 100,
201
- },
202
- ],
203
-
204
- // Documentation:
205
- // https://github.com/lasselupe33/eslint-plugin-comment-length
206
- // Defined at:
207
- // https://github.com/lasselupe33/eslint-plugin-comment-length/blob/master/rules/src/index.ts
208
- // Auto-fix long comments. We specify 100 to match the ruler and the Airbnb style guide.
209
- "comment-length-2/limit-single-line-comments": [
210
- "warn",
211
- {
212
- maxLength: 100,
213
- },
214
- ],
215
-
216
180
  // Documentation:
217
181
  // https://github.com/mysticatea/eslint-plugin-eslint-comments/blob/master/docs/rules/disable-enable-pair.md
218
182
  // Defined at:
@@ -248,77 +212,6 @@ module.exports = {
248
212
  // https://basarat.gitbook.io/typescript/main-1/defaultisbad
249
213
  "import/prefer-default-export": "off",
250
214
 
251
- // Documentation:
252
- // https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-check-tag-names
253
- // Defined at:
254
- // https://github.com/gajus/eslint-plugin-jsdoc/blob/master/src/index.js
255
- // Allow the use of TypeScriptToLua compiler annotations as documented here:
256
- // https://typescripttolua.github.io/docs/advanced/compiler-annotations
257
- "jsdoc/check-tag-names": [
258
- "warn",
259
- {
260
- definedTags: [
261
- "category", // Used in TypeDoc
262
- "hidden", // Used in TypeDoc
263
- "internal", // Used by TypeScript
264
- "noResolution", // Used in TypeScriptToLua as a compiler annotation
265
- "noSelf", // Used in TypeScriptToLua as a compiler annotation
266
- ],
267
- },
268
- ],
269
-
270
- // Documentation:
271
- // https://github.com/gajus/eslint-plugin-jsdoc#user-content-eslint-plugin-jsdoc-rules-match-description
272
- // Not defined in parent configs
273
- // Needed for catching superfluous leading and trailing newlines as documented here:
274
- // https://github.com/gajus/eslint-plugin-jsdoc/issues/847
275
- "jsdoc/match-description": [
276
- "warn",
277
- {
278
- matchDescription: "^\\S[\\s\\S]*\\S$",
279
- contexts: [
280
- {
281
- comment: "JsdocBlock[endLine!=0]:not(:has(JsdocTag))",
282
- },
283
- ],
284
- },
285
- ],
286
-
287
- // Documentation:
288
- // https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-require-jsdoc
289
- // Defined at:
290
- // https://github.com/gajus/eslint-plugin-jsdoc/blob/master/src/index.js
291
- // Do not require JSDoc comments for every function, as that is excessive
292
- "jsdoc/require-jsdoc": "off",
293
-
294
- // Documentation:
295
- // https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-require-param
296
- // Defined at:
297
- // https://github.com/gajus/eslint-plugin-jsdoc/blob/master/src/index.js
298
- // Do not require parameters for every function, as that is excessive when using TypeScript
299
- "jsdoc/require-param": "off",
300
-
301
- // Documentation:
302
- // https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-require-param-type
303
- // Defined at:
304
- // https://github.com/gajus/eslint-plugin-jsdoc/blob/master/src/index.js
305
- // Since we are using TypeScript, requiring parameter types would be superfluous
306
- "jsdoc/require-param-type": "off",
307
-
308
- // Documentation:
309
- // https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-require-returns
310
- // Defined at:
311
- // https://github.com/gajus/eslint-plugin-jsdoc/blob/master/src/index.js
312
- // Do not require return listing for every function, as that is excessive when using TypeScript
313
- "jsdoc/require-returns": "off",
314
-
315
- // Documentation:
316
- // https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-require-returns-type
317
- // Defined at:
318
- // https://github.com/gajus/eslint-plugin-jsdoc/blob/master/src/index.js
319
- // Since we are using TypeScript, requiring parameter types would be superfluous
320
- "jsdoc/require-returns-type": "off",
321
-
322
215
  // Documentation:
323
216
  // https://eslint.org/docs/rules/no-console
324
217
  // 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.66",
3
+ "version": "1.0.69",
4
4
  "description": "An ESLint config for IsaacScript projects.",
5
5
  "repository": {
6
6
  "type": "git",