eslint 8.38.0 → 8.40.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 (301) hide show
  1. package/README.md +3 -7
  2. package/lib/config/flat-config-schema.js +57 -35
  3. package/lib/eslint/flat-eslint.js +56 -16
  4. package/lib/linter/linter.js +7 -35
  5. package/lib/rules/accessor-pairs.js +2 -2
  6. package/lib/rules/array-bracket-newline.js +2 -2
  7. package/lib/rules/array-bracket-spacing.js +2 -2
  8. package/lib/rules/array-callback-return.js +2 -2
  9. package/lib/rules/array-element-newline.js +2 -2
  10. package/lib/rules/arrow-body-style.js +2 -2
  11. package/lib/rules/arrow-parens.js +2 -2
  12. package/lib/rules/arrow-spacing.js +2 -2
  13. package/lib/rules/block-scoped-var.js +2 -2
  14. package/lib/rules/block-spacing.js +2 -2
  15. package/lib/rules/brace-style.js +2 -2
  16. package/lib/rules/callback-return.js +2 -2
  17. package/lib/rules/camelcase.js +2 -2
  18. package/lib/rules/capitalized-comments.js +2 -2
  19. package/lib/rules/class-methods-use-this.js +2 -2
  20. package/lib/rules/comma-dangle.js +2 -2
  21. package/lib/rules/comma-spacing.js +2 -2
  22. package/lib/rules/comma-style.js +2 -2
  23. package/lib/rules/complexity.js +1 -1
  24. package/lib/rules/computed-property-spacing.js +2 -2
  25. package/lib/rules/consistent-return.js +3 -3
  26. package/lib/rules/consistent-this.js +2 -2
  27. package/lib/rules/constructor-super.js +1 -1
  28. package/lib/rules/curly.js +2 -2
  29. package/lib/rules/default-case-last.js +1 -1
  30. package/lib/rules/default-case.js +2 -2
  31. package/lib/rules/default-param-last.js +1 -1
  32. package/lib/rules/dot-location.js +2 -2
  33. package/lib/rules/dot-notation.js +2 -2
  34. package/lib/rules/eol-last.js +2 -2
  35. package/lib/rules/eqeqeq.js +2 -2
  36. package/lib/rules/for-direction.js +1 -1
  37. package/lib/rules/func-call-spacing.js +2 -2
  38. package/lib/rules/func-name-matching.js +1 -1
  39. package/lib/rules/func-names.js +2 -2
  40. package/lib/rules/func-style.js +1 -1
  41. package/lib/rules/function-call-argument-newline.js +2 -2
  42. package/lib/rules/function-paren-newline.js +2 -2
  43. package/lib/rules/generator-star-spacing.js +2 -2
  44. package/lib/rules/getter-return.js +2 -2
  45. package/lib/rules/global-require.js +2 -2
  46. package/lib/rules/grouped-accessor-pairs.js +2 -2
  47. package/lib/rules/guard-for-in.js +1 -1
  48. package/lib/rules/handle-callback-err.js +2 -2
  49. package/lib/rules/id-blacklist.js +2 -2
  50. package/lib/rules/id-denylist.js +2 -2
  51. package/lib/rules/id-length.js +3 -36
  52. package/lib/rules/id-match.js +2 -2
  53. package/lib/rules/implicit-arrow-linebreak.js +2 -2
  54. package/lib/rules/indent-legacy.js +2 -2
  55. package/lib/rules/indent.js +2 -2
  56. package/lib/rules/init-declarations.js +1 -1
  57. package/lib/rules/jsx-quotes.js +1 -1
  58. package/lib/rules/key-spacing.js +4 -10
  59. package/lib/rules/keyword-spacing.js +2 -2
  60. package/lib/rules/line-comment-position.js +2 -2
  61. package/lib/rules/linebreak-style.js +2 -2
  62. package/lib/rules/lines-around-comment.js +2 -2
  63. package/lib/rules/lines-around-directive.js +2 -2
  64. package/lib/rules/lines-between-class-members.js +2 -2
  65. package/lib/rules/logical-assignment-operators.js +2 -2
  66. package/lib/rules/max-classes-per-file.js +1 -1
  67. package/lib/rules/max-depth.js +1 -1
  68. package/lib/rules/max-len.js +2 -2
  69. package/lib/rules/max-lines-per-function.js +2 -2
  70. package/lib/rules/max-lines.js +2 -2
  71. package/lib/rules/max-nested-callbacks.js +1 -1
  72. package/lib/rules/max-params.js +2 -2
  73. package/lib/rules/max-statements-per-line.js +2 -2
  74. package/lib/rules/max-statements.js +1 -1
  75. package/lib/rules/multiline-comment-style.js +2 -2
  76. package/lib/rules/multiline-ternary.js +2 -2
  77. package/lib/rules/new-cap.js +2 -2
  78. package/lib/rules/new-parens.js +2 -2
  79. package/lib/rules/newline-after-var.js +2 -2
  80. package/lib/rules/newline-before-return.js +2 -2
  81. package/lib/rules/newline-per-chained-call.js +2 -2
  82. package/lib/rules/no-alert.js +2 -2
  83. package/lib/rules/no-array-constructor.js +1 -1
  84. package/lib/rules/no-async-promise-executor.js +2 -2
  85. package/lib/rules/no-await-in-loop.js +1 -1
  86. package/lib/rules/no-bitwise.js +1 -1
  87. package/lib/rules/no-buffer-constructor.js +1 -1
  88. package/lib/rules/no-caller.js +1 -1
  89. package/lib/rules/no-case-declarations.js +1 -1
  90. package/lib/rules/no-catch-shadow.js +2 -2
  91. package/lib/rules/no-class-assign.js +2 -2
  92. package/lib/rules/no-compare-neg-zero.js +1 -1
  93. package/lib/rules/no-cond-assign.js +2 -2
  94. package/lib/rules/no-confusing-arrow.js +2 -2
  95. package/lib/rules/no-console.js +2 -2
  96. package/lib/rules/no-const-assign.js +2 -2
  97. package/lib/rules/no-constant-binary-expression.js +2 -2
  98. package/lib/rules/no-constant-condition.js +2 -2
  99. package/lib/rules/no-constructor-return.js +1 -1
  100. package/lib/rules/no-continue.js +1 -1
  101. package/lib/rules/no-control-regex.js +1 -1
  102. package/lib/rules/no-debugger.js +1 -1
  103. package/lib/rules/no-delete-var.js +1 -1
  104. package/lib/rules/no-div-regex.js +2 -2
  105. package/lib/rules/no-dupe-args.js +2 -2
  106. package/lib/rules/no-dupe-class-members.js +1 -1
  107. package/lib/rules/no-dupe-else-if.js +2 -2
  108. package/lib/rules/no-dupe-keys.js +1 -1
  109. package/lib/rules/no-duplicate-case.js +2 -2
  110. package/lib/rules/no-duplicate-imports.js +1 -1
  111. package/lib/rules/no-else-return.js +2 -2
  112. package/lib/rules/no-empty-character-class.js +1 -1
  113. package/lib/rules/no-empty-function.js +2 -2
  114. package/lib/rules/no-empty-pattern.js +1 -1
  115. package/lib/rules/no-empty-static-block.js +2 -2
  116. package/lib/rules/no-empty.js +2 -2
  117. package/lib/rules/no-eq-null.js +1 -1
  118. package/lib/rules/no-eval.js +2 -2
  119. package/lib/rules/no-ex-assign.js +2 -2
  120. package/lib/rules/no-extend-native.js +2 -2
  121. package/lib/rules/no-extra-bind.js +2 -2
  122. package/lib/rules/no-extra-boolean-cast.js +2 -2
  123. package/lib/rules/no-extra-label.js +2 -2
  124. package/lib/rules/no-extra-parens.js +2 -2
  125. package/lib/rules/no-extra-semi.js +3 -3
  126. package/lib/rules/no-fallthrough.js +3 -3
  127. package/lib/rules/no-floating-decimal.js +2 -2
  128. package/lib/rules/no-func-assign.js +2 -2
  129. package/lib/rules/no-global-assign.js +2 -2
  130. package/lib/rules/no-implicit-coercion.js +2 -2
  131. package/lib/rules/no-implicit-globals.js +2 -2
  132. package/lib/rules/no-implied-eval.js +2 -2
  133. package/lib/rules/no-import-assign.js +2 -2
  134. package/lib/rules/no-inline-comments.js +2 -2
  135. package/lib/rules/no-inner-declarations.js +1 -1
  136. package/lib/rules/no-invalid-regexp.js +1 -1
  137. package/lib/rules/no-invalid-this.js +2 -2
  138. package/lib/rules/no-irregular-whitespace.js +2 -2
  139. package/lib/rules/no-iterator.js +1 -1
  140. package/lib/rules/no-label-var.js +2 -2
  141. package/lib/rules/no-labels.js +1 -1
  142. package/lib/rules/no-lone-blocks.js +3 -3
  143. package/lib/rules/no-lonely-if.js +4 -5
  144. package/lib/rules/no-loop-func.js +2 -2
  145. package/lib/rules/no-loss-of-precision.js +1 -1
  146. package/lib/rules/no-magic-numbers.js +1 -1
  147. package/lib/rules/no-misleading-character-class.js +2 -2
  148. package/lib/rules/no-mixed-operators.js +2 -2
  149. package/lib/rules/no-mixed-requires.js +1 -1
  150. package/lib/rules/no-mixed-spaces-and-tabs.js +2 -2
  151. package/lib/rules/no-multi-assign.js +1 -1
  152. package/lib/rules/no-multi-spaces.js +2 -2
  153. package/lib/rules/no-multi-str.js +1 -1
  154. package/lib/rules/no-multiple-empty-lines.js +2 -2
  155. package/lib/rules/no-native-reassign.js +2 -2
  156. package/lib/rules/no-negated-condition.js +1 -1
  157. package/lib/rules/no-negated-in-lhs.js +1 -1
  158. package/lib/rules/no-nested-ternary.js +1 -1
  159. package/lib/rules/no-new-func.js +2 -2
  160. package/lib/rules/no-new-native-nonconstructor.js +2 -2
  161. package/lib/rules/no-new-object.js +2 -2
  162. package/lib/rules/no-new-require.js +1 -1
  163. package/lib/rules/no-new-symbol.js +2 -2
  164. package/lib/rules/no-new-wrappers.js +1 -1
  165. package/lib/rules/no-new.js +1 -1
  166. package/lib/rules/no-nonoctal-decimal-escape.js +2 -2
  167. package/lib/rules/no-obj-calls.js +2 -2
  168. package/lib/rules/no-octal-escape.js +1 -1
  169. package/lib/rules/no-octal.js +1 -1
  170. package/lib/rules/no-param-reassign.js +2 -2
  171. package/lib/rules/no-path-concat.js +1 -1
  172. package/lib/rules/no-plusplus.js +1 -1
  173. package/lib/rules/no-process-env.js +1 -1
  174. package/lib/rules/no-process-exit.js +1 -1
  175. package/lib/rules/no-promise-executor-return.js +2 -2
  176. package/lib/rules/no-proto.js +1 -1
  177. package/lib/rules/no-prototype-builtins.js +1 -1
  178. package/lib/rules/no-redeclare.js +2 -2
  179. package/lib/rules/no-regex-spaces.js +2 -2
  180. package/lib/rules/no-restricted-exports.js +2 -2
  181. package/lib/rules/no-restricted-globals.js +2 -2
  182. package/lib/rules/no-restricted-imports.js +2 -2
  183. package/lib/rules/no-restricted-modules.js +1 -1
  184. package/lib/rules/no-restricted-properties.js +1 -1
  185. package/lib/rules/no-restricted-syntax.js +1 -1
  186. package/lib/rules/no-return-assign.js +2 -2
  187. package/lib/rules/no-return-await.js +3 -3
  188. package/lib/rules/no-script-url.js +1 -1
  189. package/lib/rules/no-self-assign.js +2 -2
  190. package/lib/rules/no-self-compare.js +2 -2
  191. package/lib/rules/no-sequences.js +2 -2
  192. package/lib/rules/no-setter-return.js +2 -2
  193. package/lib/rules/no-shadow-restricted-names.js +2 -2
  194. package/lib/rules/no-shadow.js +2 -2
  195. package/lib/rules/no-spaced-func.js +2 -2
  196. package/lib/rules/no-sparse-arrays.js +1 -1
  197. package/lib/rules/no-sync.js +1 -1
  198. package/lib/rules/no-tabs.js +2 -2
  199. package/lib/rules/no-template-curly-in-string.js +1 -1
  200. package/lib/rules/no-ternary.js +1 -1
  201. package/lib/rules/no-this-before-super.js +1 -1
  202. package/lib/rules/no-throw-literal.js +1 -1
  203. package/lib/rules/no-trailing-spaces.js +2 -2
  204. package/lib/rules/no-undef-init.js +2 -2
  205. package/lib/rules/no-undef.js +2 -2
  206. package/lib/rules/no-undefined.js +2 -2
  207. package/lib/rules/no-underscore-dangle.js +2 -2
  208. package/lib/rules/no-unexpected-multiline.js +2 -2
  209. package/lib/rules/no-unmodified-loop-condition.js +2 -2
  210. package/lib/rules/no-unneeded-ternary.js +2 -2
  211. package/lib/rules/no-unreachable-loop.js +1 -1
  212. package/lib/rules/no-unreachable.js +2 -2
  213. package/lib/rules/no-unsafe-finally.js +1 -1
  214. package/lib/rules/no-unsafe-negation.js +2 -2
  215. package/lib/rules/no-unsafe-optional-chaining.js +1 -1
  216. package/lib/rules/no-unused-expressions.js +6 -8
  217. package/lib/rules/no-unused-labels.js +2 -2
  218. package/lib/rules/no-unused-private-class-members.js +1 -1
  219. package/lib/rules/no-unused-vars.js +2 -2
  220. package/lib/rules/no-use-before-define.js +2 -2
  221. package/lib/rules/no-useless-backreference.js +2 -2
  222. package/lib/rules/no-useless-call.js +2 -2
  223. package/lib/rules/no-useless-catch.js +1 -1
  224. package/lib/rules/no-useless-computed-key.js +2 -2
  225. package/lib/rules/no-useless-concat.js +2 -2
  226. package/lib/rules/no-useless-constructor.js +1 -1
  227. package/lib/rules/no-useless-escape.js +2 -2
  228. package/lib/rules/no-useless-rename.js +2 -2
  229. package/lib/rules/no-useless-return.js +2 -2
  230. package/lib/rules/no-var.js +2 -2
  231. package/lib/rules/no-void.js +1 -1
  232. package/lib/rules/no-warning-comments.js +2 -2
  233. package/lib/rules/no-whitespace-before-property.js +2 -2
  234. package/lib/rules/no-with.js +1 -1
  235. package/lib/rules/nonblock-statement-body-position.js +2 -2
  236. package/lib/rules/object-curly-newline.js +2 -2
  237. package/lib/rules/object-curly-spacing.js +4 -4
  238. package/lib/rules/object-property-newline.js +2 -2
  239. package/lib/rules/object-shorthand.js +2 -2
  240. package/lib/rules/one-var-declaration-per-line.js +1 -1
  241. package/lib/rules/one-var.js +2 -2
  242. package/lib/rules/operator-assignment.js +2 -2
  243. package/lib/rules/operator-linebreak.js +2 -2
  244. package/lib/rules/padded-blocks.js +2 -2
  245. package/lib/rules/padding-line-between-statements.js +4 -4
  246. package/lib/rules/prefer-arrow-callback.js +2 -2
  247. package/lib/rules/prefer-const.js +2 -2
  248. package/lib/rules/prefer-destructuring.js +2 -2
  249. package/lib/rules/prefer-exponentiation-operator.js +2 -2
  250. package/lib/rules/prefer-named-capture-group.js +2 -2
  251. package/lib/rules/prefer-numeric-literals.js +2 -2
  252. package/lib/rules/prefer-object-has-own.js +2 -2
  253. package/lib/rules/prefer-object-spread.js +2 -3
  254. package/lib/rules/prefer-promise-reject-errors.js +2 -2
  255. package/lib/rules/prefer-reflect.js +1 -1
  256. package/lib/rules/prefer-regex-literals.js +2 -2
  257. package/lib/rules/prefer-rest-params.js +2 -2
  258. package/lib/rules/prefer-spread.js +2 -2
  259. package/lib/rules/prefer-template.js +2 -2
  260. package/lib/rules/quote-props.js +2 -2
  261. package/lib/rules/quotes.js +2 -2
  262. package/lib/rules/radix.js +2 -2
  263. package/lib/rules/require-atomic-updates.js +2 -2
  264. package/lib/rules/require-await.js +2 -2
  265. package/lib/rules/require-jsdoc.js +2 -2
  266. package/lib/rules/require-unicode-regexp.js +2 -2
  267. package/lib/rules/require-yield.js +1 -1
  268. package/lib/rules/rest-spread-spacing.js +2 -2
  269. package/lib/rules/semi-spacing.js +2 -2
  270. package/lib/rules/semi-style.js +2 -2
  271. package/lib/rules/semi.js +30 -5
  272. package/lib/rules/sort-imports.js +2 -2
  273. package/lib/rules/sort-keys.js +2 -2
  274. package/lib/rules/sort-vars.js +2 -2
  275. package/lib/rules/space-before-blocks.js +2 -2
  276. package/lib/rules/space-before-function-paren.js +2 -2
  277. package/lib/rules/space-in-parens.js +2 -2
  278. package/lib/rules/space-infix-ops.js +2 -2
  279. package/lib/rules/space-unary-ops.js +2 -2
  280. package/lib/rules/spaced-comment.js +2 -2
  281. package/lib/rules/strict.js +1 -1
  282. package/lib/rules/switch-colon-spacing.js +2 -2
  283. package/lib/rules/symbol-description.js +2 -2
  284. package/lib/rules/template-curly-spacing.js +2 -2
  285. package/lib/rules/template-tag-spacing.js +2 -2
  286. package/lib/rules/unicode-bom.js +2 -2
  287. package/lib/rules/use-isnan.js +1 -1
  288. package/lib/rules/valid-jsdoc.js +2 -2
  289. package/lib/rules/valid-typeof.js +3 -3
  290. package/lib/rules/vars-on-top.js +1 -1
  291. package/lib/rules/wrap-iife.js +2 -2
  292. package/lib/rules/wrap-regex.js +4 -5
  293. package/lib/rules/yield-star-spacing.js +2 -2
  294. package/lib/rules/yoda.js +3 -3
  295. package/lib/shared/string-utils.js +39 -1
  296. package/lib/source-code/source-code.js +47 -4
  297. package/lib/source-code/token-store/utils.js +21 -16
  298. package/messages/invalid-rule-options.js +17 -0
  299. package/messages/invalid-rule-severity.js +13 -0
  300. package/messages/shared.js +18 -0
  301. package/package.json +6 -6
@@ -17,7 +17,7 @@ module.exports = {
17
17
  docs: {
18
18
  description: "Disallow unused labels",
19
19
  recommended: true,
20
- url: "https://eslint.org/docs/rules/no-unused-labels"
20
+ url: "https://eslint.org/docs/latest/rules/no-unused-labels"
21
21
  },
22
22
 
23
23
  schema: [],
@@ -30,7 +30,7 @@ module.exports = {
30
30
  },
31
31
 
32
32
  create(context) {
33
- const sourceCode = context.getSourceCode();
33
+ const sourceCode = context.sourceCode;
34
34
  let scopeInfo = null;
35
35
 
36
36
  /**
@@ -17,7 +17,7 @@ module.exports = {
17
17
  docs: {
18
18
  description: "Disallow unused private class members",
19
19
  recommended: false,
20
- url: "https://eslint.org/docs/rules/no-unused-private-class-members"
20
+ url: "https://eslint.org/docs/latest/rules/no-unused-private-class-members"
21
21
  },
22
22
 
23
23
  schema: [],
@@ -35,7 +35,7 @@ module.exports = {
35
35
  docs: {
36
36
  description: "Disallow unused variables",
37
37
  recommended: true,
38
- url: "https://eslint.org/docs/rules/no-unused-vars"
38
+ url: "https://eslint.org/docs/latest/rules/no-unused-vars"
39
39
  },
40
40
 
41
41
  schema: [
@@ -84,7 +84,7 @@ module.exports = {
84
84
  },
85
85
 
86
86
  create(context) {
87
- const sourceCode = context.getSourceCode();
87
+ const sourceCode = context.sourceCode;
88
88
 
89
89
  const REST_PROPERTY_TYPE = /^(?:RestElement|(?:Experimental)?RestProperty)$/u;
90
90
 
@@ -228,7 +228,7 @@ module.exports = {
228
228
  docs: {
229
229
  description: "Disallow the use of variables before they are defined",
230
230
  recommended: false,
231
- url: "https://eslint.org/docs/rules/no-use-before-define"
231
+ url: "https://eslint.org/docs/latest/rules/no-use-before-define"
232
232
  },
233
233
 
234
234
  schema: [
@@ -258,7 +258,7 @@ module.exports = {
258
258
 
259
259
  create(context) {
260
260
  const options = parseOptions(context.options[0]);
261
- const sourceCode = context.getSourceCode();
261
+ const sourceCode = context.sourceCode;
262
262
 
263
263
  /**
264
264
  * Determines whether a given reference should be checked.
@@ -66,7 +66,7 @@ module.exports = {
66
66
  docs: {
67
67
  description: "Disallow useless backreferences in regular expressions",
68
68
  recommended: true,
69
- url: "https://eslint.org/docs/rules/no-useless-backreference"
69
+ url: "https://eslint.org/docs/latest/rules/no-useless-backreference"
70
70
  },
71
71
 
72
72
  schema: [],
@@ -82,7 +82,7 @@ module.exports = {
82
82
 
83
83
  create(context) {
84
84
 
85
- const sourceCode = context.getSourceCode();
85
+ const sourceCode = context.sourceCode;
86
86
 
87
87
  /**
88
88
  * Checks and reports useless backreferences in the given regular expression.
@@ -57,7 +57,7 @@ module.exports = {
57
57
  docs: {
58
58
  description: "Disallow unnecessary calls to `.call()` and `.apply()`",
59
59
  recommended: false,
60
- url: "https://eslint.org/docs/rules/no-useless-call"
60
+ url: "https://eslint.org/docs/latest/rules/no-useless-call"
61
61
  },
62
62
 
63
63
  schema: [],
@@ -68,7 +68,7 @@ module.exports = {
68
68
  },
69
69
 
70
70
  create(context) {
71
- const sourceCode = context.getSourceCode();
71
+ const sourceCode = context.sourceCode;
72
72
 
73
73
  return {
74
74
  CallExpression(node) {
@@ -17,7 +17,7 @@ module.exports = {
17
17
  docs: {
18
18
  description: "Disallow unnecessary `catch` clauses",
19
19
  recommended: true,
20
- url: "https://eslint.org/docs/rules/no-useless-catch"
20
+ url: "https://eslint.org/docs/latest/rules/no-useless-catch"
21
21
  },
22
22
 
23
23
  schema: [],
@@ -93,7 +93,7 @@ module.exports = {
93
93
  docs: {
94
94
  description: "Disallow unnecessary computed property keys in objects and classes",
95
95
  recommended: false,
96
- url: "https://eslint.org/docs/rules/no-useless-computed-key"
96
+ url: "https://eslint.org/docs/latest/rules/no-useless-computed-key"
97
97
  },
98
98
 
99
99
  schema: [{
@@ -113,7 +113,7 @@ module.exports = {
113
113
  }
114
114
  },
115
115
  create(context) {
116
- const sourceCode = context.getSourceCode();
116
+ const sourceCode = context.sourceCode;
117
117
  const enforceForClassMembers = context.options[0] && context.options[0].enforceForClassMembers;
118
118
 
119
119
  /**
@@ -72,7 +72,7 @@ module.exports = {
72
72
  docs: {
73
73
  description: "Disallow unnecessary concatenation of literals or template literals",
74
74
  recommended: false,
75
- url: "https://eslint.org/docs/rules/no-useless-concat"
75
+ url: "https://eslint.org/docs/latest/rules/no-useless-concat"
76
76
  },
77
77
 
78
78
  schema: [],
@@ -83,7 +83,7 @@ module.exports = {
83
83
  },
84
84
 
85
85
  create(context) {
86
- const sourceCode = context.getSourceCode();
86
+ const sourceCode = context.sourceCode;
87
87
 
88
88
  return {
89
89
  BinaryExpression(node) {
@@ -140,7 +140,7 @@ module.exports = {
140
140
  docs: {
141
141
  description: "Disallow unnecessary constructors",
142
142
  recommended: false,
143
- url: "https://eslint.org/docs/rules/no-useless-constructor"
143
+ url: "https://eslint.org/docs/latest/rules/no-useless-constructor"
144
144
  },
145
145
 
146
146
  schema: [],
@@ -86,7 +86,7 @@ module.exports = {
86
86
  docs: {
87
87
  description: "Disallow unnecessary escape characters",
88
88
  recommended: true,
89
- url: "https://eslint.org/docs/rules/no-useless-escape"
89
+ url: "https://eslint.org/docs/latest/rules/no-useless-escape"
90
90
  },
91
91
 
92
92
  hasSuggestions: true,
@@ -101,7 +101,7 @@ module.exports = {
101
101
  },
102
102
 
103
103
  create(context) {
104
- const sourceCode = context.getSourceCode();
104
+ const sourceCode = context.sourceCode;
105
105
 
106
106
  /**
107
107
  * Reports a node
@@ -23,7 +23,7 @@ module.exports = {
23
23
  docs: {
24
24
  description: "Disallow renaming import, export, and destructured assignments to the same name",
25
25
  recommended: false,
26
- url: "https://eslint.org/docs/rules/no-useless-rename"
26
+ url: "https://eslint.org/docs/latest/rules/no-useless-rename"
27
27
  },
28
28
 
29
29
  fixable: "code",
@@ -46,7 +46,7 @@ module.exports = {
46
46
  },
47
47
 
48
48
  create(context) {
49
- const sourceCode = context.getSourceCode(),
49
+ const sourceCode = context.sourceCode,
50
50
  options = context.options[0] || {},
51
51
  ignoreDestructuring = options.ignoreDestructuring === true,
52
52
  ignoreImport = options.ignoreImport === true,
@@ -69,7 +69,7 @@ module.exports = {
69
69
  docs: {
70
70
  description: "Disallow redundant return statements",
71
71
  recommended: false,
72
- url: "https://eslint.org/docs/rules/no-useless-return"
72
+ url: "https://eslint.org/docs/latest/rules/no-useless-return"
73
73
  },
74
74
 
75
75
  fixable: "code",
@@ -83,7 +83,7 @@ module.exports = {
83
83
  create(context) {
84
84
  const segmentInfoMap = new WeakMap();
85
85
  const usedUnreachableSegments = new WeakSet();
86
- const sourceCode = context.getSourceCode();
86
+ const sourceCode = context.sourceCode;
87
87
  let scopeInfo = null;
88
88
 
89
89
  /**
@@ -187,7 +187,7 @@ module.exports = {
187
187
  docs: {
188
188
  description: "Require `let` or `const` instead of `var`",
189
189
  recommended: false,
190
- url: "https://eslint.org/docs/rules/no-var"
190
+ url: "https://eslint.org/docs/latest/rules/no-var"
191
191
  },
192
192
 
193
193
  schema: [],
@@ -199,7 +199,7 @@ module.exports = {
199
199
  },
200
200
 
201
201
  create(context) {
202
- const sourceCode = context.getSourceCode();
202
+ const sourceCode = context.sourceCode;
203
203
 
204
204
  /**
205
205
  * Checks whether the variables which are defined by the given declarator node have their references in TDZ.
@@ -16,7 +16,7 @@ module.exports = {
16
16
  docs: {
17
17
  description: "Disallow `void` operators",
18
18
  recommended: false,
19
- url: "https://eslint.org/docs/rules/no-void"
19
+ url: "https://eslint.org/docs/latest/rules/no-void"
20
20
  },
21
21
 
22
22
  messages: {
@@ -22,7 +22,7 @@ module.exports = {
22
22
  docs: {
23
23
  description: "Disallow specified warning terms in comments",
24
24
  recommended: false,
25
- url: "https://eslint.org/docs/rules/no-warning-comments"
25
+ url: "https://eslint.org/docs/latest/rules/no-warning-comments"
26
26
  },
27
27
 
28
28
  schema: [
@@ -58,7 +58,7 @@ module.exports = {
58
58
  },
59
59
 
60
60
  create(context) {
61
- const sourceCode = context.getSourceCode(),
61
+ const sourceCode = context.sourceCode,
62
62
  configuration = context.options[0] || {},
63
63
  warningTerms = configuration.terms || ["todo", "fixme", "xxx"],
64
64
  location = configuration.location || "start",
@@ -22,7 +22,7 @@ module.exports = {
22
22
  docs: {
23
23
  description: "Disallow whitespace before properties",
24
24
  recommended: false,
25
- url: "https://eslint.org/docs/rules/no-whitespace-before-property"
25
+ url: "https://eslint.org/docs/latest/rules/no-whitespace-before-property"
26
26
  },
27
27
 
28
28
  fixable: "whitespace",
@@ -34,7 +34,7 @@ module.exports = {
34
34
  },
35
35
 
36
36
  create(context) {
37
- const sourceCode = context.getSourceCode();
37
+ const sourceCode = context.sourceCode;
38
38
 
39
39
  //--------------------------------------------------------------------------
40
40
  // Helpers
@@ -17,7 +17,7 @@ module.exports = {
17
17
  docs: {
18
18
  description: "Disallow `with` statements",
19
19
  recommended: true,
20
- url: "https://eslint.org/docs/rules/no-with"
20
+ url: "https://eslint.org/docs/latest/rules/no-with"
21
21
  },
22
22
 
23
23
  schema: [],
@@ -18,7 +18,7 @@ module.exports = {
18
18
  docs: {
19
19
  description: "Enforce the location of single-line statements",
20
20
  recommended: false,
21
- url: "https://eslint.org/docs/rules/nonblock-statement-body-position"
21
+ url: "https://eslint.org/docs/latest/rules/nonblock-statement-body-position"
22
22
  },
23
23
 
24
24
  fixable: "whitespace",
@@ -49,7 +49,7 @@ module.exports = {
49
49
  },
50
50
 
51
51
  create(context) {
52
- const sourceCode = context.getSourceCode();
52
+ const sourceCode = context.sourceCode;
53
53
 
54
54
  //----------------------------------------------------------------------
55
55
  // Helpers
@@ -152,7 +152,7 @@ module.exports = {
152
152
  docs: {
153
153
  description: "Enforce consistent line breaks after opening and before closing braces",
154
154
  recommended: false,
155
- url: "https://eslint.org/docs/rules/object-curly-newline"
155
+ url: "https://eslint.org/docs/latest/rules/object-curly-newline"
156
156
  },
157
157
 
158
158
  fixable: "whitespace",
@@ -185,7 +185,7 @@ module.exports = {
185
185
  },
186
186
 
187
187
  create(context) {
188
- const sourceCode = context.getSourceCode();
188
+ const sourceCode = context.sourceCode;
189
189
  const normalizedOptions = normalizeOptions(context.options[0]);
190
190
 
191
191
  /**
@@ -18,7 +18,7 @@ module.exports = {
18
18
  docs: {
19
19
  description: "Enforce consistent spacing inside braces",
20
20
  recommended: false,
21
- url: "https://eslint.org/docs/rules/object-curly-spacing"
21
+ url: "https://eslint.org/docs/latest/rules/object-curly-spacing"
22
22
  },
23
23
 
24
24
  fixable: "whitespace",
@@ -51,7 +51,7 @@ module.exports = {
51
51
 
52
52
  create(context) {
53
53
  const spaced = context.options[0] === "always",
54
- sourceCode = context.getSourceCode();
54
+ sourceCode = context.sourceCode;
55
55
 
56
56
  /**
57
57
  * Determines whether an option is set, relative to the spacing option.
@@ -81,7 +81,7 @@ module.exports = {
81
81
  * @returns {void}
82
82
  */
83
83
  function reportNoBeginningSpace(node, token) {
84
- const nextToken = context.getSourceCode().getTokenAfter(token, { includeComments: true });
84
+ const nextToken = context.sourceCode.getTokenAfter(token, { includeComments: true });
85
85
 
86
86
  context.report({
87
87
  node,
@@ -103,7 +103,7 @@ module.exports = {
103
103
  * @returns {void}
104
104
  */
105
105
  function reportNoEndingSpace(node, token) {
106
- const previousToken = context.getSourceCode().getTokenBefore(token, { includeComments: true });
106
+ const previousToken = context.sourceCode.getTokenBefore(token, { includeComments: true });
107
107
 
108
108
  context.report({
109
109
  node,
@@ -17,7 +17,7 @@ module.exports = {
17
17
  docs: {
18
18
  description: "Enforce placing object properties on separate lines",
19
19
  recommended: false,
20
- url: "https://eslint.org/docs/rules/object-property-newline"
20
+ url: "https://eslint.org/docs/latest/rules/object-property-newline"
21
21
  },
22
22
 
23
23
  schema: [
@@ -53,7 +53,7 @@ module.exports = {
53
53
  ? "propertiesOnNewlineAll"
54
54
  : "propertiesOnNewline";
55
55
 
56
- const sourceCode = context.getSourceCode();
56
+ const sourceCode = context.sourceCode;
57
57
 
58
58
  return {
59
59
  ObjectExpression(node) {
@@ -30,7 +30,7 @@ module.exports = {
30
30
  docs: {
31
31
  description: "Require or disallow method and property shorthand syntax for object literals",
32
32
  recommended: false,
33
- url: "https://eslint.org/docs/rules/object-shorthand"
33
+ url: "https://eslint.org/docs/latest/rules/object-shorthand"
34
34
  },
35
35
 
36
36
  fixable: "code",
@@ -123,7 +123,7 @@ module.exports = {
123
123
  : null;
124
124
  const AVOID_QUOTES = PARAMS.avoidQuotes;
125
125
  const AVOID_EXPLICIT_RETURN_ARROWS = !!PARAMS.avoidExplicitReturnArrows;
126
- const sourceCode = context.getSourceCode();
126
+ const sourceCode = context.sourceCode;
127
127
 
128
128
  //--------------------------------------------------------------------------
129
129
  // Helpers
@@ -16,7 +16,7 @@ module.exports = {
16
16
  docs: {
17
17
  description: "Require or disallow newlines around variable declarations",
18
18
  recommended: false,
19
- url: "https://eslint.org/docs/rules/one-var-declaration-per-line"
19
+ url: "https://eslint.org/docs/latest/rules/one-var-declaration-per-line"
20
20
  },
21
21
 
22
22
  schema: [
@@ -36,7 +36,7 @@ module.exports = {
36
36
  docs: {
37
37
  description: "Enforce variables to be declared either together or separately in functions",
38
38
  recommended: false,
39
- url: "https://eslint.org/docs/rules/one-var"
39
+ url: "https://eslint.org/docs/latest/rules/one-var"
40
40
  },
41
41
 
42
42
  fixable: "code",
@@ -121,7 +121,7 @@ module.exports = {
121
121
  }
122
122
  }
123
123
 
124
- const sourceCode = context.getSourceCode();
124
+ const sourceCode = context.sourceCode;
125
125
 
126
126
  //--------------------------------------------------------------------------
127
127
  // Helpers
@@ -65,7 +65,7 @@ module.exports = {
65
65
  docs: {
66
66
  description: "Require or disallow assignment operator shorthand where possible",
67
67
  recommended: false,
68
- url: "https://eslint.org/docs/rules/operator-assignment"
68
+ url: "https://eslint.org/docs/latest/rules/operator-assignment"
69
69
  },
70
70
 
71
71
  schema: [
@@ -83,7 +83,7 @@ module.exports = {
83
83
 
84
84
  create(context) {
85
85
 
86
- const sourceCode = context.getSourceCode();
86
+ const sourceCode = context.sourceCode;
87
87
 
88
88
  /**
89
89
  * Returns the operator token of an AssignmentExpression or BinaryExpression
@@ -23,7 +23,7 @@ module.exports = {
23
23
  docs: {
24
24
  description: "Enforce consistent linebreak style for operators",
25
25
  recommended: false,
26
- url: "https://eslint.org/docs/rules/operator-linebreak"
26
+ url: "https://eslint.org/docs/latest/rules/operator-linebreak"
27
27
  },
28
28
 
29
29
  schema: [
@@ -69,7 +69,7 @@ module.exports = {
69
69
  styleOverrides[":"] = "before";
70
70
  }
71
71
 
72
- const sourceCode = context.getSourceCode();
72
+ const sourceCode = context.sourceCode;
73
73
 
74
74
  //--------------------------------------------------------------------------
75
75
  // Helpers
@@ -23,7 +23,7 @@ module.exports = {
23
23
  docs: {
24
24
  description: "Require or disallow padding within blocks",
25
25
  recommended: false,
26
- url: "https://eslint.org/docs/rules/padded-blocks"
26
+ url: "https://eslint.org/docs/latest/rules/padded-blocks"
27
27
  },
28
28
 
29
29
  fixable: "whitespace",
@@ -96,7 +96,7 @@ module.exports = {
96
96
  options.allowSingleLineBlocks = exceptOptions.allowSingleLineBlocks === true;
97
97
  }
98
98
 
99
- const sourceCode = context.getSourceCode();
99
+ const sourceCode = context.sourceCode;
100
100
 
101
101
  /**
102
102
  * Gets the open brace token from a given node.
@@ -253,7 +253,7 @@ function verifyForNever(context, _, nextNode, paddingLines) {
253
253
  const nextToken = paddingLines[0][1];
254
254
  const start = prevToken.range[1];
255
255
  const end = nextToken.range[0];
256
- const text = context.getSourceCode().text
256
+ const text = context.sourceCode.text
257
257
  .slice(start, end)
258
258
  .replace(PADDING_LINE_SEQUENCE, replacerToRemovePaddingLines);
259
259
 
@@ -284,7 +284,7 @@ function verifyForAlways(context, prevNode, nextNode, paddingLines) {
284
284
  node: nextNode,
285
285
  messageId: "expectedBlankLine",
286
286
  fix(fixer) {
287
- const sourceCode = context.getSourceCode();
287
+ const sourceCode = context.sourceCode;
288
288
  let prevToken = getActualLastToken(sourceCode, prevNode);
289
289
  const nextToken = sourceCode.getFirstTokenBetween(
290
290
  prevToken,
@@ -433,7 +433,7 @@ module.exports = {
433
433
  docs: {
434
434
  description: "Require or disallow padding lines between statements",
435
435
  recommended: false,
436
- url: "https://eslint.org/docs/rules/padding-line-between-statements"
436
+ url: "https://eslint.org/docs/latest/rules/padding-line-between-statements"
437
437
  },
438
438
 
439
439
  fixable: "whitespace",
@@ -475,7 +475,7 @@ module.exports = {
475
475
  },
476
476
 
477
477
  create(context) {
478
- const sourceCode = context.getSourceCode();
478
+ const sourceCode = context.sourceCode;
479
479
  const configureList = context.options || [];
480
480
  let scopeInfo = null;
481
481
 
@@ -153,7 +153,7 @@ module.exports = {
153
153
  docs: {
154
154
  description: "Require using arrow functions for callbacks",
155
155
  recommended: false,
156
- url: "https://eslint.org/docs/rules/prefer-arrow-callback"
156
+ url: "https://eslint.org/docs/latest/rules/prefer-arrow-callback"
157
157
  },
158
158
 
159
159
  schema: [
@@ -185,7 +185,7 @@ module.exports = {
185
185
 
186
186
  const allowUnboundThis = options.allowUnboundThis !== false; // default to true
187
187
  const allowNamedFunctions = options.allowNamedFunctions;
188
- const sourceCode = context.getSourceCode();
188
+ const sourceCode = context.sourceCode;
189
189
 
190
190
  /*
191
191
  * {Array<{this: boolean, super: boolean, meta: boolean}>}
@@ -334,7 +334,7 @@ module.exports = {
334
334
  docs: {
335
335
  description: "Require `const` declarations for variables that are never reassigned after declared",
336
336
  recommended: false,
337
- url: "https://eslint.org/docs/rules/prefer-const"
337
+ url: "https://eslint.org/docs/latest/rules/prefer-const"
338
338
  },
339
339
 
340
340
  fixable: "code",
@@ -356,7 +356,7 @@ module.exports = {
356
356
 
357
357
  create(context) {
358
358
  const options = context.options[0] || {};
359
- const sourceCode = context.getSourceCode();
359
+ const sourceCode = context.sourceCode;
360
360
  const shouldMatchAnyDestructuredVariable = options.destructuring !== "all";
361
361
  const ignoreReadBeforeAssign = options.ignoreReadBeforeAssign === true;
362
362
  const variables = [];
@@ -28,7 +28,7 @@ module.exports = {
28
28
  docs: {
29
29
  description: "Require destructuring from arrays and/or objects",
30
30
  recommended: false,
31
- url: "https://eslint.org/docs/rules/prefer-destructuring"
31
+ url: "https://eslint.org/docs/latest/rules/prefer-destructuring"
32
32
  },
33
33
 
34
34
  fixable: "code",
@@ -190,7 +190,7 @@ module.exports = {
190
190
  */
191
191
  function fixIntoObjectDestructuring(fixer, node) {
192
192
  const rightNode = node.init;
193
- const sourceCode = context.getSourceCode();
193
+ const sourceCode = context.sourceCode;
194
194
 
195
195
  // Don't fix if that would remove any comments. Only comments inside `rightNode.object` can be preserved.
196
196
  if (sourceCode.getCommentsInside(node).length > sourceCode.getCommentsInside(rightNode.object).length) {
@@ -92,7 +92,7 @@ module.exports = {
92
92
  docs: {
93
93
  description: "Disallow the use of `Math.pow` in favor of the `**` operator",
94
94
  recommended: false,
95
- url: "https://eslint.org/docs/rules/prefer-exponentiation-operator"
95
+ url: "https://eslint.org/docs/latest/rules/prefer-exponentiation-operator"
96
96
  },
97
97
 
98
98
  schema: [],
@@ -104,7 +104,7 @@ module.exports = {
104
104
  },
105
105
 
106
106
  create(context) {
107
- const sourceCode = context.getSourceCode();
107
+ const sourceCode = context.sourceCode;
108
108
 
109
109
  /**
110
110
  * Reports the given node.
@@ -90,7 +90,7 @@ module.exports = {
90
90
  docs: {
91
91
  description: "Enforce using named capture group in regular expression",
92
92
  recommended: false,
93
- url: "https://eslint.org/docs/rules/prefer-named-capture-group"
93
+ url: "https://eslint.org/docs/latest/rules/prefer-named-capture-group"
94
94
  },
95
95
 
96
96
  hasSuggestions: true,
@@ -105,7 +105,7 @@ module.exports = {
105
105
  },
106
106
 
107
107
  create(context) {
108
- const sourceCode = context.getSourceCode();
108
+ const sourceCode = context.sourceCode;
109
109
 
110
110
  /**
111
111
  * Function to check regular expression.
@@ -47,7 +47,7 @@ module.exports = {
47
47
  docs: {
48
48
  description: "Disallow `parseInt()` and `Number.parseInt()` in favor of binary, octal, and hexadecimal literals",
49
49
  recommended: false,
50
- url: "https://eslint.org/docs/rules/prefer-numeric-literals"
50
+ url: "https://eslint.org/docs/latest/rules/prefer-numeric-literals"
51
51
  },
52
52
 
53
53
  schema: [],
@@ -60,7 +60,7 @@ module.exports = {
60
60
  },
61
61
 
62
62
  create(context) {
63
- const sourceCode = context.getSourceCode();
63
+ const sourceCode = context.sourceCode;
64
64
 
65
65
  //----------------------------------------------------------------------
66
66
  // Public