eslint 6.3.0 → 6.6.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.
Files changed (189) hide show
  1. package/CHANGELOG.md +126 -0
  2. package/README.md +11 -10
  3. package/bin/eslint.js +38 -12
  4. package/lib/cli-engine/cascading-config-array-factory.js +2 -1
  5. package/lib/cli-engine/cli-engine.js +11 -11
  6. package/lib/cli-engine/config-array/config-array.js +0 -4
  7. package/lib/cli-engine/config-array/config-dependency.js +2 -0
  8. package/lib/cli-engine/config-array/override-tester.js +4 -2
  9. package/lib/cli-engine/config-array-factory.js +7 -1
  10. package/lib/cli-engine/file-enumerator.js +5 -3
  11. package/lib/cli-engine/formatters/html.js +1 -0
  12. package/lib/cli-engine/ignored-paths.js +4 -3
  13. package/lib/cli-engine/lint-result-cache.js +0 -1
  14. package/lib/cli.js +13 -12
  15. package/lib/init/autoconfig.js +1 -11
  16. package/lib/init/config-file.js +0 -1
  17. package/lib/init/config-initializer.js +0 -1
  18. package/lib/init/config-rule.js +3 -7
  19. package/lib/init/npm-utils.js +1 -6
  20. package/lib/linter/code-path-analysis/code-path-analyzer.js +24 -38
  21. package/lib/linter/code-path-analysis/code-path-segment.js +17 -25
  22. package/lib/linter/code-path-analysis/code-path-state.js +40 -81
  23. package/lib/linter/code-path-analysis/code-path.js +10 -11
  24. package/lib/linter/code-path-analysis/debug-helpers.js +9 -13
  25. package/lib/linter/code-path-analysis/fork-context.js +23 -34
  26. package/lib/linter/code-path-analysis/id-generator.js +2 -2
  27. package/lib/linter/linter.js +121 -96
  28. package/lib/linter/node-event-generator.js +3 -2
  29. package/lib/options.js +6 -0
  30. package/lib/rule-tester/rule-tester.js +7 -10
  31. package/lib/rules/accessor-pairs.js +59 -19
  32. package/lib/rules/array-bracket-newline.js +12 -15
  33. package/lib/rules/array-bracket-spacing.js +12 -12
  34. package/lib/rules/array-callback-return.js +6 -11
  35. package/lib/rules/array-element-newline.js +5 -8
  36. package/lib/rules/arrow-parens.js +0 -1
  37. package/lib/rules/block-scoped-var.js +3 -3
  38. package/lib/rules/block-spacing.js +4 -4
  39. package/lib/rules/capitalized-comments.js +2 -9
  40. package/lib/rules/class-methods-use-this.js +3 -3
  41. package/lib/rules/comma-dangle.js +15 -23
  42. package/lib/rules/comma-spacing.js +1 -1
  43. package/lib/rules/computed-property-spacing.js +28 -11
  44. package/lib/rules/consistent-return.js +4 -5
  45. package/lib/rules/consistent-this.js +5 -5
  46. package/lib/rules/constructor-super.js +14 -16
  47. package/lib/rules/curly.js +3 -5
  48. package/lib/rules/default-param-last.js +62 -0
  49. package/lib/rules/dot-location.js +11 -12
  50. package/lib/rules/eqeqeq.js +7 -19
  51. package/lib/rules/func-names.js +6 -6
  52. package/lib/rules/function-call-argument-newline.js +5 -5
  53. package/lib/rules/generator-star-spacing.js +4 -9
  54. package/lib/rules/getter-return.js +4 -7
  55. package/lib/rules/indent-legacy.js +1 -1
  56. package/lib/rules/indent.js +46 -8
  57. package/lib/rules/index.js +3 -0
  58. package/lib/rules/init-declarations.js +2 -2
  59. package/lib/rules/jsx-quotes.js +1 -1
  60. package/lib/rules/keyword-spacing.js +32 -56
  61. package/lib/rules/lines-around-directive.js +1 -1
  62. package/lib/rules/max-len.js +0 -5
  63. package/lib/rules/max-statements-per-line.js +3 -7
  64. package/lib/rules/multiline-ternary.js +3 -3
  65. package/lib/rules/new-parens.js +5 -1
  66. package/lib/rules/newline-after-var.js +6 -7
  67. package/lib/rules/newline-before-return.js +8 -9
  68. package/lib/rules/newline-per-chained-call.js +2 -4
  69. package/lib/rules/no-class-assign.js +2 -2
  70. package/lib/rules/no-compare-neg-zero.js +1 -2
  71. package/lib/rules/no-confusing-arrow.js +2 -2
  72. package/lib/rules/no-console.js +4 -8
  73. package/lib/rules/no-const-assign.js +1 -1
  74. package/lib/rules/no-dupe-args.js +1 -1
  75. package/lib/rules/no-dupe-class-members.js +3 -4
  76. package/lib/rules/no-dupe-keys.js +6 -5
  77. package/lib/rules/no-duplicate-imports.js +14 -18
  78. package/lib/rules/no-else-return.js +0 -8
  79. package/lib/rules/no-empty-function.js +2 -4
  80. package/lib/rules/no-eval.js +10 -18
  81. package/lib/rules/no-ex-assign.js +1 -1
  82. package/lib/rules/no-extra-bind.js +12 -13
  83. package/lib/rules/no-extra-boolean-cast.js +1 -3
  84. package/lib/rules/no-extra-label.js +13 -10
  85. package/lib/rules/no-extra-parens.js +32 -17
  86. package/lib/rules/no-extra-semi.js +5 -6
  87. package/lib/rules/no-fallthrough.js +6 -6
  88. package/lib/rules/no-func-assign.js +3 -3
  89. package/lib/rules/no-global-assign.js +4 -4
  90. package/lib/rules/no-implicit-coercion.js +10 -10
  91. package/lib/rules/no-implied-eval.js +0 -1
  92. package/lib/rules/no-import-assign.js +238 -0
  93. package/lib/rules/no-invalid-this.js +1 -3
  94. package/lib/rules/no-labels.js +3 -6
  95. package/lib/rules/no-lone-blocks.js +7 -2
  96. package/lib/rules/no-loop-func.js +6 -11
  97. package/lib/rules/no-magic-numbers.js +6 -6
  98. package/lib/rules/no-misleading-character-class.js +14 -7
  99. package/lib/rules/no-mixed-operators.js +13 -22
  100. package/lib/rules/no-mixed-requires.js +0 -1
  101. package/lib/rules/no-multi-spaces.js +1 -1
  102. package/lib/rules/no-native-reassign.js +4 -4
  103. package/lib/rules/no-obj-calls.js +29 -9
  104. package/lib/rules/no-octal-escape.js +14 -8
  105. package/lib/rules/no-param-reassign.js +28 -7
  106. package/lib/rules/no-redeclare.js +1 -1
  107. package/lib/rules/no-regex-spaces.js +105 -45
  108. package/lib/rules/no-restricted-imports.js +11 -11
  109. package/lib/rules/no-self-assign.js +18 -18
  110. package/lib/rules/no-sequences.js +5 -5
  111. package/lib/rules/no-shadow.js +1 -4
  112. package/lib/rules/no-tabs.js +8 -2
  113. package/lib/rules/no-this-before-super.js +12 -13
  114. package/lib/rules/no-trailing-spaces.js +19 -7
  115. package/lib/rules/no-undef-init.js +7 -1
  116. package/lib/rules/no-unmodified-loop-condition.js +16 -29
  117. package/lib/rules/no-unneeded-ternary.js +3 -3
  118. package/lib/rules/no-unreachable.js +7 -7
  119. package/lib/rules/no-unsafe-finally.js +4 -7
  120. package/lib/rules/no-unsafe-negation.js +34 -19
  121. package/lib/rules/no-unused-expressions.js +11 -7
  122. package/lib/rules/no-unused-labels.js +3 -6
  123. package/lib/rules/no-unused-vars.js +22 -29
  124. package/lib/rules/no-use-before-define.js +10 -15
  125. package/lib/rules/no-useless-call.js +4 -4
  126. package/lib/rules/no-useless-concat.js +4 -4
  127. package/lib/rules/no-useless-constructor.js +14 -22
  128. package/lib/rules/no-useless-escape.js +3 -5
  129. package/lib/rules/no-useless-rename.js +32 -20
  130. package/lib/rules/no-useless-return.js +11 -17
  131. package/lib/rules/no-var.js +12 -25
  132. package/lib/rules/no-warning-comments.js +0 -1
  133. package/lib/rules/no-whitespace-before-property.js +3 -3
  134. package/lib/rules/object-curly-newline.js +7 -10
  135. package/lib/rules/object-curly-spacing.js +14 -15
  136. package/lib/rules/object-shorthand.js +36 -10
  137. package/lib/rules/one-var-declaration-per-line.js +2 -2
  138. package/lib/rules/operator-assignment.js +22 -1
  139. package/lib/rules/padded-blocks.js +1 -1
  140. package/lib/rules/padding-line-between-statements.js +0 -16
  141. package/lib/rules/prefer-arrow-callback.js +6 -6
  142. package/lib/rules/prefer-const.js +13 -21
  143. package/lib/rules/prefer-destructuring.js +1 -7
  144. package/lib/rules/prefer-named-capture-group.js +3 -16
  145. package/lib/rules/prefer-numeric-literals.js +35 -3
  146. package/lib/rules/prefer-object-spread.js +7 -7
  147. package/lib/rules/prefer-regex-literals.js +125 -0
  148. package/lib/rules/prefer-rest-params.js +3 -6
  149. package/lib/rules/prefer-spread.js +4 -4
  150. package/lib/rules/prefer-template.js +5 -6
  151. package/lib/rules/quote-props.js +1 -1
  152. package/lib/rules/quotes.js +11 -6
  153. package/lib/rules/radix.js +5 -10
  154. package/lib/rules/require-await.js +2 -5
  155. package/lib/rules/require-yield.js +2 -2
  156. package/lib/rules/rest-spread-spacing.js +1 -1
  157. package/lib/rules/sort-imports.js +3 -4
  158. package/lib/rules/sort-keys.js +1 -3
  159. package/lib/rules/space-before-blocks.js +1 -2
  160. package/lib/rules/space-before-function-paren.js +12 -1
  161. package/lib/rules/space-in-parens.js +81 -75
  162. package/lib/rules/space-infix-ops.js +5 -5
  163. package/lib/rules/spaced-comment.js +15 -18
  164. package/lib/rules/strict.js +2 -4
  165. package/lib/rules/symbol-description.js +1 -2
  166. package/lib/rules/template-curly-spacing.js +2 -2
  167. package/lib/rules/use-isnan.js +104 -6
  168. package/lib/rules/utils/ast-utils.js +53 -81
  169. package/lib/rules/utils/fix-tracker.js +0 -6
  170. package/lib/rules/utils/lazy-loading-rule-map.js +0 -1
  171. package/lib/rules/vars-on-top.js +11 -11
  172. package/lib/shared/config-ops.js +2 -2
  173. package/lib/shared/logging.js +2 -0
  174. package/lib/shared/runtime-info.js +163 -0
  175. package/lib/shared/traverser.js +2 -0
  176. package/lib/source-code/source-code.js +11 -12
  177. package/lib/source-code/token-store/backward-token-comment-cursor.js +5 -5
  178. package/lib/source-code/token-store/backward-token-cursor.js +5 -5
  179. package/lib/source-code/token-store/cursors.js +17 -19
  180. package/lib/source-code/token-store/decorative-cursor.js +1 -1
  181. package/lib/source-code/token-store/filter-cursor.js +2 -2
  182. package/lib/source-code/token-store/forward-token-comment-cursor.js +5 -5
  183. package/lib/source-code/token-store/forward-token-cursor.js +5 -5
  184. package/lib/source-code/token-store/index.js +86 -92
  185. package/lib/source-code/token-store/limit-cursor.js +2 -2
  186. package/lib/source-code/token-store/padded-token-cursor.js +7 -7
  187. package/lib/source-code/token-store/skip-cursor.js +2 -2
  188. package/lib/source-code/token-store/utils.js +9 -13
  189. package/package.json +8 -5
@@ -42,9 +42,9 @@ const OCTAL_ESCAPE_PATTERN = /^(?:[^\\]|\\[^0-7]|\\0(?![0-9]))*\\(?:[1-7]|0[0-9]
42
42
 
43
43
  /**
44
44
  * Checks reference if is non initializer and writable.
45
- * @param {Reference} reference - A reference to check.
46
- * @param {int} index - The index of the reference in the references.
47
- * @param {Reference[]} references - The array that the reference belongs to.
45
+ * @param {Reference} reference A reference to check.
46
+ * @param {int} index The index of the reference in the references.
47
+ * @param {Reference[]} references The array that the reference belongs to.
48
48
  * @returns {boolean} Success/Failure
49
49
  * @private
50
50
  */
@@ -68,8 +68,7 @@ function isModifyingReference(reference, index, references) {
68
68
 
69
69
  /**
70
70
  * Checks whether the given string starts with uppercase or not.
71
- *
72
- * @param {string} s - The string to check.
71
+ * @param {string} s The string to check.
73
72
  * @returns {boolean} `true` if the string starts with uppercase.
74
73
  */
75
74
  function startsWithUpperCase(s) {
@@ -78,7 +77,7 @@ function startsWithUpperCase(s) {
78
77
 
79
78
  /**
80
79
  * Checks whether or not a node is a constructor.
81
- * @param {ASTNode} node - A function node to check.
80
+ * @param {ASTNode} node A function node to check.
82
81
  * @returns {boolean} Wehether or not a node is a constructor.
83
82
  */
84
83
  function isES5Constructor(node) {
@@ -87,7 +86,7 @@ function isES5Constructor(node) {
87
86
 
88
87
  /**
89
88
  * Finds a function node from ancestors of a node.
90
- * @param {ASTNode} node - A start node to find.
89
+ * @param {ASTNode} node A start node to find.
91
90
  * @returns {Node|null} A found function node.
92
91
  */
93
92
  function getUpperFunction(node) {
@@ -106,8 +105,7 @@ function getUpperFunction(node) {
106
105
  * - ArrowFunctionExpression
107
106
  * - FunctionDeclaration
108
107
  * - FunctionExpression
109
- *
110
- * @param {ASTNode|null} node - A node to check.
108
+ * @param {ASTNode|null} node A node to check.
111
109
  * @returns {boolean} `true` if the node is a function node.
112
110
  */
113
111
  function isFunction(node) {
@@ -123,8 +121,7 @@ function isFunction(node) {
123
121
  * - ForOfStatement
124
122
  * - ForStatement
125
123
  * - WhileStatement
126
- *
127
- * @param {ASTNode|null} node - A node to check.
124
+ * @param {ASTNode|null} node A node to check.
128
125
  * @returns {boolean} `true` if the node is a loop node.
129
126
  */
130
127
  function isLoop(node) {
@@ -133,8 +130,7 @@ function isLoop(node) {
133
130
 
134
131
  /**
135
132
  * Checks whether the given node is in a loop or not.
136
- *
137
- * @param {ASTNode} node - The node to check.
133
+ * @param {ASTNode} node The node to check.
138
134
  * @returns {boolean} `true` if the node is in a loop.
139
135
  */
140
136
  function isInLoop(node) {
@@ -149,7 +145,7 @@ function isInLoop(node) {
149
145
 
150
146
  /**
151
147
  * Checks whether or not a node is `null` or `undefined`.
152
- * @param {ASTNode} node - A node to check.
148
+ * @param {ASTNode} node A node to check.
153
149
  * @returns {boolean} Whether or not the node is a `null` or `undefined`.
154
150
  * @public
155
151
  */
@@ -163,7 +159,7 @@ function isNullOrUndefined(node) {
163
159
 
164
160
  /**
165
161
  * Checks whether or not a node is callee.
166
- * @param {ASTNode} node - A node to check.
162
+ * @param {ASTNode} node A node to check.
167
163
  * @returns {boolean} Whether or not the node is callee.
168
164
  */
169
165
  function isCallee(node) {
@@ -172,7 +168,7 @@ function isCallee(node) {
172
168
 
173
169
  /**
174
170
  * Checks whether or not a node is `Reflect.apply`.
175
- * @param {ASTNode} node - A node to check.
171
+ * @param {ASTNode} node A node to check.
176
172
  * @returns {boolean} Whether or not the node is a `Reflect.apply`.
177
173
  */
178
174
  function isReflectApply(node) {
@@ -188,7 +184,7 @@ function isReflectApply(node) {
188
184
 
189
185
  /**
190
186
  * Checks whether or not a node is `Array.from`.
191
- * @param {ASTNode} node - A node to check.
187
+ * @param {ASTNode} node A node to check.
192
188
  * @returns {boolean} Whether or not the node is a `Array.from`.
193
189
  */
194
190
  function isArrayFromMethod(node) {
@@ -204,7 +200,7 @@ function isArrayFromMethod(node) {
204
200
 
205
201
  /**
206
202
  * Checks whether or not a node is a method which has `thisArg`.
207
- * @param {ASTNode} node - A node to check.
203
+ * @param {ASTNode} node A node to check.
208
204
  * @returns {boolean} Whether or not the node is a method which has `thisArg`.
209
205
  */
210
206
  function isMethodWhichHasThisArg(node) {
@@ -223,7 +219,7 @@ function isMethodWhichHasThisArg(node) {
223
219
 
224
220
  /**
225
221
  * Creates the negate function of the given function.
226
- * @param {Function} f - The function to negate.
222
+ * @param {Function} f The function to negate.
227
223
  * @returns {Function} Negated function.
228
224
  */
229
225
  function negate(f) {
@@ -232,8 +228,8 @@ function negate(f) {
232
228
 
233
229
  /**
234
230
  * Checks whether or not a node has a `@this` tag in its comments.
235
- * @param {ASTNode} node - A node to check.
236
- * @param {SourceCode} sourceCode - A SourceCode instance to get comments.
231
+ * @param {ASTNode} node A node to check.
232
+ * @param {SourceCode} sourceCode A SourceCode instance to get comments.
237
233
  * @returns {boolean} Whether or not the node has a `@this` tag in its comments.
238
234
  */
239
235
  function hasJSDocThisTag(node, sourceCode) {
@@ -268,8 +264,7 @@ function isParenthesised(sourceCode, node) {
268
264
 
269
265
  /**
270
266
  * Checks if the given token is an arrow token or not.
271
- *
272
- * @param {Token} token - The token to check.
267
+ * @param {Token} token The token to check.
273
268
  * @returns {boolean} `true` if the token is an arrow token.
274
269
  */
275
270
  function isArrowToken(token) {
@@ -278,8 +273,7 @@ function isArrowToken(token) {
278
273
 
279
274
  /**
280
275
  * Checks if the given token is a comma token or not.
281
- *
282
- * @param {Token} token - The token to check.
276
+ * @param {Token} token The token to check.
283
277
  * @returns {boolean} `true` if the token is a comma token.
284
278
  */
285
279
  function isCommaToken(token) {
@@ -288,8 +282,7 @@ function isCommaToken(token) {
288
282
 
289
283
  /**
290
284
  * Checks if the given token is a dot token or not.
291
- *
292
- * @param {Token} token - The token to check.
285
+ * @param {Token} token The token to check.
293
286
  * @returns {boolean} `true` if the token is a dot token.
294
287
  */
295
288
  function isDotToken(token) {
@@ -298,8 +291,7 @@ function isDotToken(token) {
298
291
 
299
292
  /**
300
293
  * Checks if the given token is a semicolon token or not.
301
- *
302
- * @param {Token} token - The token to check.
294
+ * @param {Token} token The token to check.
303
295
  * @returns {boolean} `true` if the token is a semicolon token.
304
296
  */
305
297
  function isSemicolonToken(token) {
@@ -308,8 +300,7 @@ function isSemicolonToken(token) {
308
300
 
309
301
  /**
310
302
  * Checks if the given token is a colon token or not.
311
- *
312
- * @param {Token} token - The token to check.
303
+ * @param {Token} token The token to check.
313
304
  * @returns {boolean} `true` if the token is a colon token.
314
305
  */
315
306
  function isColonToken(token) {
@@ -318,8 +309,7 @@ function isColonToken(token) {
318
309
 
319
310
  /**
320
311
  * Checks if the given token is an opening parenthesis token or not.
321
- *
322
- * @param {Token} token - The token to check.
312
+ * @param {Token} token The token to check.
323
313
  * @returns {boolean} `true` if the token is an opening parenthesis token.
324
314
  */
325
315
  function isOpeningParenToken(token) {
@@ -328,8 +318,7 @@ function isOpeningParenToken(token) {
328
318
 
329
319
  /**
330
320
  * Checks if the given token is a closing parenthesis token or not.
331
- *
332
- * @param {Token} token - The token to check.
321
+ * @param {Token} token The token to check.
333
322
  * @returns {boolean} `true` if the token is a closing parenthesis token.
334
323
  */
335
324
  function isClosingParenToken(token) {
@@ -338,8 +327,7 @@ function isClosingParenToken(token) {
338
327
 
339
328
  /**
340
329
  * Checks if the given token is an opening square bracket token or not.
341
- *
342
- * @param {Token} token - The token to check.
330
+ * @param {Token} token The token to check.
343
331
  * @returns {boolean} `true` if the token is an opening square bracket token.
344
332
  */
345
333
  function isOpeningBracketToken(token) {
@@ -348,8 +336,7 @@ function isOpeningBracketToken(token) {
348
336
 
349
337
  /**
350
338
  * Checks if the given token is a closing square bracket token or not.
351
- *
352
- * @param {Token} token - The token to check.
339
+ * @param {Token} token The token to check.
353
340
  * @returns {boolean} `true` if the token is a closing square bracket token.
354
341
  */
355
342
  function isClosingBracketToken(token) {
@@ -358,8 +345,7 @@ function isClosingBracketToken(token) {
358
345
 
359
346
  /**
360
347
  * Checks if the given token is an opening brace token or not.
361
- *
362
- * @param {Token} token - The token to check.
348
+ * @param {Token} token The token to check.
363
349
  * @returns {boolean} `true` if the token is an opening brace token.
364
350
  */
365
351
  function isOpeningBraceToken(token) {
@@ -368,8 +354,7 @@ function isOpeningBraceToken(token) {
368
354
 
369
355
  /**
370
356
  * Checks if the given token is a closing brace token or not.
371
- *
372
- * @param {Token} token - The token to check.
357
+ * @param {Token} token The token to check.
373
358
  * @returns {boolean} `true` if the token is a closing brace token.
374
359
  */
375
360
  function isClosingBraceToken(token) {
@@ -378,8 +363,7 @@ function isClosingBraceToken(token) {
378
363
 
379
364
  /**
380
365
  * Checks if the given token is a comment token or not.
381
- *
382
- * @param {Token} token - The token to check.
366
+ * @param {Token} token The token to check.
383
367
  * @returns {boolean} `true` if the token is a comment token.
384
368
  */
385
369
  function isCommentToken(token) {
@@ -388,8 +372,7 @@ function isCommentToken(token) {
388
372
 
389
373
  /**
390
374
  * Checks if the given token is a keyword token or not.
391
- *
392
- * @param {Token} token - The token to check.
375
+ * @param {Token} token The token to check.
393
376
  * @returns {boolean} `true` if the token is a keyword token.
394
377
  */
395
378
  function isKeywordToken(token) {
@@ -398,9 +381,8 @@ function isKeywordToken(token) {
398
381
 
399
382
  /**
400
383
  * Gets the `(` token of the given function node.
401
- *
402
- * @param {ASTNode} node - The function node to get.
403
- * @param {SourceCode} sourceCode - The source code object to get tokens.
384
+ * @param {ASTNode} node The function node to get.
385
+ * @param {SourceCode} sourceCode The source code object to get tokens.
404
386
  * @returns {Token} `(` token.
405
387
  */
406
388
  function getOpeningParenOfParams(node, sourceCode) {
@@ -411,9 +393,9 @@ function getOpeningParenOfParams(node, sourceCode) {
411
393
 
412
394
  /**
413
395
  * Checks whether or not the tokens of two given nodes are same.
414
- * @param {ASTNode} left - A node 1 to compare.
415
- * @param {ASTNode} right - A node 2 to compare.
416
- * @param {SourceCode} sourceCode - The ESLint source code object.
396
+ * @param {ASTNode} left A node 1 to compare.
397
+ * @param {ASTNode} right A node 2 to compare.
398
+ * @param {SourceCode} sourceCode The ESLint source code object.
417
399
  * @returns {boolean} the source code for the given node.
418
400
  */
419
401
  function equalTokens(left, right, sourceCode) {
@@ -447,8 +429,8 @@ module.exports = {
447
429
 
448
430
  /**
449
431
  * Determines whether two adjacent tokens are on the same line.
450
- * @param {Object} left - The left token object.
451
- * @param {Object} right - The right token object.
432
+ * @param {Object} left The left token object.
433
+ * @param {Object} right The right token object.
452
434
  * @returns {boolean} Whether or not the tokens are on the same line.
453
435
  * @public
454
436
  */
@@ -494,7 +476,7 @@ module.exports = {
494
476
 
495
477
  /**
496
478
  * Checks whether or not a given node is a string literal.
497
- * @param {ASTNode} node - A node to check.
479
+ * @param {ASTNode} node A node to check.
498
480
  * @returns {boolean} `true` if the node is a string literal.
499
481
  */
500
482
  isStringLiteral(node) {
@@ -514,8 +496,7 @@ module.exports = {
514
496
  * - ForStatement
515
497
  * - SwitchStatement
516
498
  * - WhileStatement
517
- *
518
- * @param {ASTNode} node - A node to check.
499
+ * @param {ASTNode} node A node to check.
519
500
  * @returns {boolean} `true` if the node is breakable.
520
501
  */
521
502
  isBreakableStatement(node) {
@@ -524,7 +505,7 @@ module.exports = {
524
505
 
525
506
  /**
526
507
  * Gets references which are non initializer and writable.
527
- * @param {Reference[]} references - An array of references.
508
+ * @param {Reference[]} references An array of references.
528
509
  * @returns {Reference[]} An array of only references which are non initializer and writable.
529
510
  * @public
530
511
  */
@@ -568,7 +549,6 @@ module.exports = {
568
549
  * consequent;
569
550
  *
570
551
  * When taking this `IfStatement`, returns `consequent;` statement.
571
- *
572
552
  * @param {ASTNode} A node to get.
573
553
  * @returns {ASTNode|null} The trailing statement's node.
574
554
  */
@@ -576,9 +556,8 @@ module.exports = {
576
556
 
577
557
  /**
578
558
  * Finds the variable by a given name in a given scope and its upper scopes.
579
- *
580
- * @param {eslint-scope.Scope} initScope - A scope to start find.
581
- * @param {string} name - A variable name to find.
559
+ * @param {eslint-scope.Scope} initScope A scope to start find.
560
+ * @param {string} name A variable name to find.
582
561
  * @returns {eslint-scope.Variable|null} A found variable or `null`.
583
562
  */
584
563
  getVariableByName(initScope, name) {
@@ -613,9 +592,8 @@ module.exports = {
613
592
  * - The location is not on an ES2015 class.
614
593
  * - Its `bind`/`call`/`apply` method is not called directly.
615
594
  * - The function is not a callback of array methods (such as `.forEach()`) if `thisArg` is given.
616
- *
617
- * @param {ASTNode} node - A function node to check.
618
- * @param {SourceCode} sourceCode - A SourceCode instance to get comments.
595
+ * @param {ASTNode} node A function node to check.
596
+ * @param {SourceCode} sourceCode A SourceCode instance to get comments.
619
597
  * @returns {boolean} The function node is the default `this` binding.
620
598
  */
621
599
  isDefaultThisBinding(node, sourceCode) {
@@ -861,8 +839,7 @@ module.exports = {
861
839
 
862
840
  /**
863
841
  * Checks whether the given node is an empty block node or not.
864
- *
865
- * @param {ASTNode|null} node - The node to check.
842
+ * @param {ASTNode|null} node The node to check.
866
843
  * @returns {boolean} `true` if the node is an empty block.
867
844
  */
868
845
  isEmptyBlock(node) {
@@ -871,8 +848,7 @@ module.exports = {
871
848
 
872
849
  /**
873
850
  * Checks whether the given node is an empty function node or not.
874
- *
875
- * @param {ASTNode|null} node - The node to check.
851
+ * @param {ASTNode|null} node The node to check.
876
852
  * @returns {boolean} `true` if the node is an empty function.
877
853
  */
878
854
  isEmptyFunction(node) {
@@ -906,8 +882,7 @@ module.exports = {
906
882
  * let a = {["a" + "b"]: 1} // => null
907
883
  * let a = {[tag`b`]: 1} // => null
908
884
  * let a = {[`${b}`]: 1} // => null
909
- *
910
- * @param {ASTNode} node - The node to get.
885
+ * @param {ASTNode} node The node to get.
911
886
  * @returns {string|null} The property name if static. Otherwise, null.
912
887
  */
913
888
  getStaticPropertyName(node) {
@@ -950,7 +925,7 @@ module.exports = {
950
925
 
951
926
  /**
952
927
  * Get directives from directive prologue of a Program or Function node.
953
- * @param {ASTNode} node - The node to check.
928
+ * @param {ASTNode} node The node to check.
954
929
  * @returns {ASTNode[]} The directives found in the directive prologue.
955
930
  */
956
931
  getDirectivePrologue(node) {
@@ -989,7 +964,7 @@ module.exports = {
989
964
  /**
990
965
  * Determines whether this node is a decimal integer literal. If a node is a decimal integer literal, a dot added
991
966
  * after the node will be parsed as a decimal point, rather than a property-access dot.
992
- * @param {ASTNode} node - The node to check.
967
+ * @param {ASTNode} node The node to check.
993
968
  * @returns {boolean} `true` if this node is a decimal integer.
994
969
  * @example
995
970
  *
@@ -1011,7 +986,7 @@ module.exports = {
1011
986
  /**
1012
987
  * Determines whether this token is a decimal integer numeric token.
1013
988
  * This is similar to isDecimalInteger(), but for tokens.
1014
- * @param {Token} token - The token to check.
989
+ * @param {Token} token The token to check.
1015
990
  * @returns {boolean} `true` if this token is a decimal integer.
1016
991
  */
1017
992
  isDecimalIntegerNumericToken(token) {
@@ -1063,8 +1038,7 @@ module.exports = {
1063
1038
  * - `class A { static async foo() {} }` .... `static async method 'foo'`
1064
1039
  * - `class A { static get foo() {} }` ...... `static getter 'foo'`
1065
1040
  * - `class A { static set foo(a) {} }` ..... `static setter 'foo'`
1066
- *
1067
- * @param {ASTNode} node - The function node to get.
1041
+ * @param {ASTNode} node The function node to get.
1068
1042
  * @returns {string} The name and kind of the function node.
1069
1043
  */
1070
1044
  getFunctionNameWithKind(node) {
@@ -1198,9 +1172,8 @@ module.exports = {
1198
1172
  * ^^^^^^^^^^^^^^
1199
1173
  * - `class A { static set foo(a) {} }`
1200
1174
  * ^^^^^^^^^^^^^^
1201
- *
1202
- * @param {ASTNode} node - The function node to get.
1203
- * @param {SourceCode} sourceCode - The source code object to get tokens.
1175
+ * @param {ASTNode} node The function node to get.
1176
+ * @param {SourceCode} sourceCode The source code object to get tokens.
1204
1177
  * @returns {string} The location of the function node for reporting.
1205
1178
  */
1206
1179
  getFunctionHeadLoc(node, sourceCode) {
@@ -1384,7 +1357,6 @@ module.exports = {
1384
1357
  * "\00", "\01" ... "\09"
1385
1358
  *
1386
1359
  * "\0", when not followed by a digit, is not an octal escape sequence.
1387
- *
1388
1360
  * @param {string} rawString A string in its raw representation.
1389
1361
  * @returns {boolean} `true` if the string contains at least one octal escape sequence.
1390
1362
  */
@@ -23,7 +23,6 @@ class FixTracker {
23
23
 
24
24
  /**
25
25
  * Create a new FixTracker.
26
- *
27
26
  * @param {ruleFixer} fixer A ruleFixer instance.
28
27
  * @param {SourceCode} sourceCode A SourceCode object for the current code.
29
28
  */
@@ -36,7 +35,6 @@ class FixTracker {
36
35
  /**
37
36
  * Mark the given range as "retained", meaning that other fixes may not
38
37
  * may not modify this region in the same pass.
39
- *
40
38
  * @param {int[]} range The range to retain.
41
39
  * @returns {FixTracker} The same RuleFixer, for chained calls.
42
40
  */
@@ -50,7 +48,6 @@ class FixTracker {
50
48
  * mark it as retained, meaning that other fixes may not modify it in this
51
49
  * pass. This is useful for avoiding conflicts in fixes that modify control
52
50
  * flow.
53
- *
54
51
  * @param {ASTNode} node The node to use as a starting point.
55
52
  * @returns {FixTracker} The same RuleFixer, for chained calls.
56
53
  */
@@ -65,7 +62,6 @@ class FixTracker {
65
62
  * range as retained, meaning that other fixes may not modify it in this
66
63
  * pass. This is useful for avoiding conflicts in fixes that make a small
67
64
  * change to the code where the AST should not be changed.
68
- *
69
65
  * @param {ASTNode|Token} nodeOrToken The node or token to use as a starting
70
66
  * point. The token to the left and right are use in the range.
71
67
  * @returns {FixTracker} The same RuleFixer, for chained calls.
@@ -80,7 +76,6 @@ class FixTracker {
80
76
  /**
81
77
  * Create a fix command that replaces the given range with the given text,
82
78
  * accounting for any retained ranges.
83
- *
84
79
  * @param {int[]} range The range to remove in the fix.
85
80
  * @param {string} text The text to insert in place of the range.
86
81
  * @returns {Object} The fix command.
@@ -108,7 +103,6 @@ class FixTracker {
108
103
  /**
109
104
  * Create a fix command that removes the given node or token, accounting for
110
105
  * any retained ranges.
111
- *
112
106
  * @param {ASTNode|Token} nodeOrToken The node or token to remove.
113
107
  * @returns {Object} The fix command.
114
108
  */
@@ -10,7 +10,6 @@ const debug = require("debug")("eslint:rules");
10
10
 
11
11
  /**
12
12
  * The `Map` object that loads each rule when it's accessed.
13
- *
14
13
  * @example
15
14
  * const rules = new LazyLoadingRuleMap([
16
15
  * ["eqeqeq", () => require("eqeqeq")],
@@ -32,8 +32,9 @@ module.exports = {
32
32
  // Helpers
33
33
  //--------------------------------------------------------------------------
34
34
 
35
+ // eslint-disable-next-line jsdoc/require-description
35
36
  /**
36
- * @param {ASTNode} node - any node
37
+ * @param {ASTNode} node any node
37
38
  * @returns {boolean} whether the given node structurally represents a directive
38
39
  */
39
40
  function looksLikeDirective(node) {
@@ -43,7 +44,7 @@ module.exports = {
43
44
 
44
45
  /**
45
46
  * Check to see if its a ES6 import declaration
46
- * @param {ASTNode} node - any node
47
+ * @param {ASTNode} node any node
47
48
  * @returns {boolean} whether the given node represents a import declaration
48
49
  */
49
50
  function looksLikeImport(node) {
@@ -53,8 +54,7 @@ module.exports = {
53
54
 
54
55
  /**
55
56
  * Checks whether a given node is a variable declaration or not.
56
- *
57
- * @param {ASTNode} node - any node
57
+ * @param {ASTNode} node any node
58
58
  * @returns {boolean} `true` if the node is a variable declaration.
59
59
  */
60
60
  function isVariableDeclaration(node) {
@@ -70,8 +70,8 @@ module.exports = {
70
70
 
71
71
  /**
72
72
  * Checks whether this variable is on top of the block body
73
- * @param {ASTNode} node - The node to check
74
- * @param {ASTNode[]} statements - collection of ASTNodes for the parent node block
73
+ * @param {ASTNode} node The node to check
74
+ * @param {ASTNode[]} statements collection of ASTNodes for the parent node block
75
75
  * @returns {boolean} True if var is on top otherwise false
76
76
  */
77
77
  function isVarOnTop(node, statements) {
@@ -99,8 +99,8 @@ module.exports = {
99
99
 
100
100
  /**
101
101
  * Checks whether variable is on top at the global level
102
- * @param {ASTNode} node - The node to check
103
- * @param {ASTNode} parent - Parent of the node
102
+ * @param {ASTNode} node The node to check
103
+ * @param {ASTNode} parent Parent of the node
104
104
  * @returns {void}
105
105
  */
106
106
  function globalVarCheck(node, parent) {
@@ -111,9 +111,9 @@ module.exports = {
111
111
 
112
112
  /**
113
113
  * Checks whether variable is on top at functional block scope level
114
- * @param {ASTNode} node - The node to check
115
- * @param {ASTNode} parent - Parent of the node
116
- * @param {ASTNode} grandParent - Parent of the node's parent
114
+ * @param {ASTNode} node The node to check
115
+ * @param {ASTNode} parent Parent of the node
116
+ * @param {ASTNode} grandParent Parent of the node's parent
117
117
  * @returns {void}
118
118
  */
119
119
  function blockScopeVarCheck(node, parent, grandParent) {
@@ -77,7 +77,7 @@ module.exports = {
77
77
 
78
78
  /**
79
79
  * Checks whether a given config has valid severity or not.
80
- * @param {number|string|Array} ruleConfig - The configuration for an individual rule.
80
+ * @param {number|string|Array} ruleConfig The configuration for an individual rule.
81
81
  * @returns {boolean} `true` if the configuration has valid severity.
82
82
  */
83
83
  isValidSeverity(ruleConfig) {
@@ -91,7 +91,7 @@ module.exports = {
91
91
 
92
92
  /**
93
93
  * Checks whether every rule of a given config has valid severity or not.
94
- * @param {Object} config - The configuration for rules.
94
+ * @param {Object} config The configuration for rules.
95
95
  * @returns {boolean} `true` if the configuration has valid severity.
96
96
  */
97
97
  isEverySeverityValid(config) {
@@ -12,6 +12,7 @@ module.exports = {
12
12
 
13
13
  /**
14
14
  * Cover for console.log
15
+ * @param {...any} args The elements to log.
15
16
  * @returns {void}
16
17
  */
17
18
  info(...args) {
@@ -20,6 +21,7 @@ module.exports = {
20
21
 
21
22
  /**
22
23
  * Cover for console.error
24
+ * @param {...any} args The elements to log.
23
25
  * @returns {void}
24
26
  */
25
27
  error(...args) {