eslint 8.39.0 → 8.41.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 (308) hide show
  1. package/README.md +4 -3
  2. package/lib/cli-engine/cli-engine.js +3 -1
  3. package/lib/cli.js +2 -28
  4. package/lib/config/default-config.js +1 -1
  5. package/lib/config/flat-config-schema.js +57 -35
  6. package/lib/eslint/eslint-helpers.js +8 -7
  7. package/lib/eslint/flat-eslint.js +101 -46
  8. package/lib/linter/apply-disable-directives.js +11 -1
  9. package/lib/linter/config-comment-parser.js +9 -2
  10. package/lib/linter/linter.js +20 -11
  11. package/lib/linter/report-translator.js +4 -19
  12. package/lib/rules/accessor-pairs.js +2 -2
  13. package/lib/rules/array-bracket-newline.js +2 -2
  14. package/lib/rules/array-bracket-spacing.js +2 -2
  15. package/lib/rules/array-callback-return.js +2 -2
  16. package/lib/rules/array-element-newline.js +2 -2
  17. package/lib/rules/arrow-body-style.js +2 -2
  18. package/lib/rules/arrow-parens.js +2 -2
  19. package/lib/rules/arrow-spacing.js +2 -2
  20. package/lib/rules/block-scoped-var.js +2 -2
  21. package/lib/rules/block-spacing.js +2 -2
  22. package/lib/rules/brace-style.js +2 -2
  23. package/lib/rules/callback-return.js +2 -2
  24. package/lib/rules/camelcase.js +2 -2
  25. package/lib/rules/capitalized-comments.js +2 -2
  26. package/lib/rules/class-methods-use-this.js +2 -2
  27. package/lib/rules/comma-dangle.js +2 -2
  28. package/lib/rules/comma-spacing.js +2 -2
  29. package/lib/rules/comma-style.js +2 -2
  30. package/lib/rules/complexity.js +1 -1
  31. package/lib/rules/computed-property-spacing.js +2 -2
  32. package/lib/rules/consistent-return.js +3 -3
  33. package/lib/rules/consistent-this.js +2 -2
  34. package/lib/rules/constructor-super.js +1 -1
  35. package/lib/rules/curly.js +2 -2
  36. package/lib/rules/default-case-last.js +1 -1
  37. package/lib/rules/default-case.js +2 -2
  38. package/lib/rules/default-param-last.js +1 -1
  39. package/lib/rules/dot-location.js +2 -2
  40. package/lib/rules/dot-notation.js +2 -2
  41. package/lib/rules/eol-last.js +2 -2
  42. package/lib/rules/eqeqeq.js +2 -2
  43. package/lib/rules/for-direction.js +1 -1
  44. package/lib/rules/func-call-spacing.js +2 -2
  45. package/lib/rules/func-name-matching.js +1 -1
  46. package/lib/rules/func-names.js +2 -2
  47. package/lib/rules/func-style.js +1 -1
  48. package/lib/rules/function-call-argument-newline.js +2 -2
  49. package/lib/rules/function-paren-newline.js +2 -2
  50. package/lib/rules/generator-star-spacing.js +2 -2
  51. package/lib/rules/getter-return.js +2 -2
  52. package/lib/rules/global-require.js +2 -2
  53. package/lib/rules/grouped-accessor-pairs.js +2 -2
  54. package/lib/rules/guard-for-in.js +1 -1
  55. package/lib/rules/handle-callback-err.js +2 -2
  56. package/lib/rules/id-blacklist.js +2 -2
  57. package/lib/rules/id-denylist.js +2 -2
  58. package/lib/rules/id-length.js +3 -36
  59. package/lib/rules/id-match.js +2 -2
  60. package/lib/rules/implicit-arrow-linebreak.js +2 -2
  61. package/lib/rules/indent-legacy.js +2 -2
  62. package/lib/rules/indent.js +40 -56
  63. package/lib/rules/init-declarations.js +1 -1
  64. package/lib/rules/jsx-quotes.js +1 -1
  65. package/lib/rules/key-spacing.js +4 -10
  66. package/lib/rules/keyword-spacing.js +2 -2
  67. package/lib/rules/line-comment-position.js +2 -2
  68. package/lib/rules/linebreak-style.js +2 -2
  69. package/lib/rules/lines-around-comment.js +2 -2
  70. package/lib/rules/lines-around-directive.js +2 -2
  71. package/lib/rules/lines-between-class-members.js +2 -2
  72. package/lib/rules/logical-assignment-operators.js +2 -2
  73. package/lib/rules/max-classes-per-file.js +1 -1
  74. package/lib/rules/max-depth.js +1 -1
  75. package/lib/rules/max-len.js +2 -2
  76. package/lib/rules/max-lines-per-function.js +2 -2
  77. package/lib/rules/max-lines.js +2 -2
  78. package/lib/rules/max-nested-callbacks.js +1 -1
  79. package/lib/rules/max-params.js +2 -2
  80. package/lib/rules/max-statements-per-line.js +2 -2
  81. package/lib/rules/max-statements.js +1 -1
  82. package/lib/rules/multiline-comment-style.js +2 -2
  83. package/lib/rules/multiline-ternary.js +2 -2
  84. package/lib/rules/new-cap.js +2 -2
  85. package/lib/rules/new-parens.js +2 -2
  86. package/lib/rules/newline-after-var.js +2 -2
  87. package/lib/rules/newline-before-return.js +2 -2
  88. package/lib/rules/newline-per-chained-call.js +2 -2
  89. package/lib/rules/no-alert.js +2 -2
  90. package/lib/rules/no-array-constructor.js +1 -1
  91. package/lib/rules/no-async-promise-executor.js +2 -2
  92. package/lib/rules/no-await-in-loop.js +1 -1
  93. package/lib/rules/no-bitwise.js +1 -1
  94. package/lib/rules/no-buffer-constructor.js +1 -1
  95. package/lib/rules/no-caller.js +1 -1
  96. package/lib/rules/no-case-declarations.js +1 -1
  97. package/lib/rules/no-catch-shadow.js +2 -2
  98. package/lib/rules/no-class-assign.js +2 -2
  99. package/lib/rules/no-compare-neg-zero.js +1 -1
  100. package/lib/rules/no-cond-assign.js +2 -2
  101. package/lib/rules/no-confusing-arrow.js +2 -2
  102. package/lib/rules/no-console.js +2 -2
  103. package/lib/rules/no-const-assign.js +2 -2
  104. package/lib/rules/no-constant-binary-expression.js +2 -2
  105. package/lib/rules/no-constant-condition.js +2 -2
  106. package/lib/rules/no-constructor-return.js +1 -1
  107. package/lib/rules/no-continue.js +1 -1
  108. package/lib/rules/no-control-regex.js +1 -1
  109. package/lib/rules/no-debugger.js +1 -1
  110. package/lib/rules/no-delete-var.js +1 -1
  111. package/lib/rules/no-div-regex.js +2 -2
  112. package/lib/rules/no-dupe-args.js +2 -2
  113. package/lib/rules/no-dupe-class-members.js +1 -1
  114. package/lib/rules/no-dupe-else-if.js +2 -2
  115. package/lib/rules/no-dupe-keys.js +1 -1
  116. package/lib/rules/no-duplicate-case.js +2 -2
  117. package/lib/rules/no-duplicate-imports.js +1 -1
  118. package/lib/rules/no-else-return.js +2 -2
  119. package/lib/rules/no-empty-character-class.js +1 -1
  120. package/lib/rules/no-empty-function.js +2 -2
  121. package/lib/rules/no-empty-pattern.js +1 -1
  122. package/lib/rules/no-empty-static-block.js +2 -2
  123. package/lib/rules/no-empty.js +2 -2
  124. package/lib/rules/no-eq-null.js +1 -1
  125. package/lib/rules/no-eval.js +2 -2
  126. package/lib/rules/no-ex-assign.js +2 -2
  127. package/lib/rules/no-extend-native.js +2 -2
  128. package/lib/rules/no-extra-bind.js +2 -2
  129. package/lib/rules/no-extra-boolean-cast.js +2 -2
  130. package/lib/rules/no-extra-label.js +2 -2
  131. package/lib/rules/no-extra-parens.js +2 -2
  132. package/lib/rules/no-extra-semi.js +3 -3
  133. package/lib/rules/no-fallthrough.js +3 -3
  134. package/lib/rules/no-floating-decimal.js +2 -2
  135. package/lib/rules/no-func-assign.js +2 -2
  136. package/lib/rules/no-global-assign.js +2 -2
  137. package/lib/rules/no-implicit-coercion.js +2 -2
  138. package/lib/rules/no-implicit-globals.js +2 -2
  139. package/lib/rules/no-implied-eval.js +2 -2
  140. package/lib/rules/no-import-assign.js +2 -2
  141. package/lib/rules/no-inline-comments.js +2 -2
  142. package/lib/rules/no-inner-declarations.js +1 -1
  143. package/lib/rules/no-invalid-regexp.js +1 -1
  144. package/lib/rules/no-invalid-this.js +2 -2
  145. package/lib/rules/no-irregular-whitespace.js +2 -2
  146. package/lib/rules/no-iterator.js +1 -1
  147. package/lib/rules/no-label-var.js +2 -2
  148. package/lib/rules/no-labels.js +1 -1
  149. package/lib/rules/no-lone-blocks.js +2 -2
  150. package/lib/rules/no-lonely-if.js +2 -2
  151. package/lib/rules/no-loop-func.js +2 -2
  152. package/lib/rules/no-loss-of-precision.js +1 -1
  153. package/lib/rules/no-magic-numbers.js +1 -1
  154. package/lib/rules/no-misleading-character-class.js +2 -2
  155. package/lib/rules/no-mixed-operators.js +2 -2
  156. package/lib/rules/no-mixed-requires.js +1 -1
  157. package/lib/rules/no-mixed-spaces-and-tabs.js +2 -2
  158. package/lib/rules/no-multi-assign.js +1 -1
  159. package/lib/rules/no-multi-spaces.js +2 -2
  160. package/lib/rules/no-multi-str.js +1 -1
  161. package/lib/rules/no-multiple-empty-lines.js +2 -2
  162. package/lib/rules/no-native-reassign.js +2 -2
  163. package/lib/rules/no-negated-condition.js +1 -1
  164. package/lib/rules/no-negated-in-lhs.js +1 -1
  165. package/lib/rules/no-nested-ternary.js +1 -1
  166. package/lib/rules/no-new-func.js +2 -2
  167. package/lib/rules/no-new-native-nonconstructor.js +2 -2
  168. package/lib/rules/no-new-object.js +2 -2
  169. package/lib/rules/no-new-require.js +1 -1
  170. package/lib/rules/no-new-symbol.js +2 -2
  171. package/lib/rules/no-new-wrappers.js +1 -1
  172. package/lib/rules/no-new.js +1 -1
  173. package/lib/rules/no-nonoctal-decimal-escape.js +2 -2
  174. package/lib/rules/no-obj-calls.js +2 -2
  175. package/lib/rules/no-octal-escape.js +1 -1
  176. package/lib/rules/no-octal.js +1 -1
  177. package/lib/rules/no-param-reassign.js +2 -2
  178. package/lib/rules/no-path-concat.js +1 -1
  179. package/lib/rules/no-plusplus.js +1 -1
  180. package/lib/rules/no-process-env.js +1 -1
  181. package/lib/rules/no-process-exit.js +1 -1
  182. package/lib/rules/no-promise-executor-return.js +2 -2
  183. package/lib/rules/no-proto.js +1 -1
  184. package/lib/rules/no-prototype-builtins.js +1 -1
  185. package/lib/rules/no-redeclare.js +2 -2
  186. package/lib/rules/no-regex-spaces.js +2 -2
  187. package/lib/rules/no-restricted-exports.js +2 -2
  188. package/lib/rules/no-restricted-globals.js +2 -2
  189. package/lib/rules/no-restricted-imports.js +2 -2
  190. package/lib/rules/no-restricted-modules.js +1 -1
  191. package/lib/rules/no-restricted-properties.js +1 -1
  192. package/lib/rules/no-restricted-syntax.js +1 -1
  193. package/lib/rules/no-return-assign.js +2 -2
  194. package/lib/rules/no-return-await.js +3 -3
  195. package/lib/rules/no-script-url.js +1 -1
  196. package/lib/rules/no-self-assign.js +2 -2
  197. package/lib/rules/no-self-compare.js +2 -2
  198. package/lib/rules/no-sequences.js +2 -2
  199. package/lib/rules/no-setter-return.js +2 -2
  200. package/lib/rules/no-shadow-restricted-names.js +2 -2
  201. package/lib/rules/no-shadow.js +2 -2
  202. package/lib/rules/no-spaced-func.js +2 -2
  203. package/lib/rules/no-sparse-arrays.js +1 -1
  204. package/lib/rules/no-sync.js +1 -1
  205. package/lib/rules/no-tabs.js +2 -2
  206. package/lib/rules/no-template-curly-in-string.js +1 -1
  207. package/lib/rules/no-ternary.js +1 -1
  208. package/lib/rules/no-this-before-super.js +1 -1
  209. package/lib/rules/no-throw-literal.js +1 -1
  210. package/lib/rules/no-trailing-spaces.js +2 -2
  211. package/lib/rules/no-undef-init.js +2 -2
  212. package/lib/rules/no-undef.js +2 -2
  213. package/lib/rules/no-undefined.js +2 -2
  214. package/lib/rules/no-underscore-dangle.js +2 -2
  215. package/lib/rules/no-unexpected-multiline.js +2 -2
  216. package/lib/rules/no-unmodified-loop-condition.js +2 -2
  217. package/lib/rules/no-unneeded-ternary.js +2 -2
  218. package/lib/rules/no-unreachable-loop.js +1 -1
  219. package/lib/rules/no-unreachable.js +2 -2
  220. package/lib/rules/no-unsafe-finally.js +1 -1
  221. package/lib/rules/no-unsafe-negation.js +2 -2
  222. package/lib/rules/no-unsafe-optional-chaining.js +1 -1
  223. package/lib/rules/no-unused-expressions.js +1 -1
  224. package/lib/rules/no-unused-labels.js +2 -2
  225. package/lib/rules/no-unused-private-class-members.js +1 -1
  226. package/lib/rules/no-unused-vars.js +2 -2
  227. package/lib/rules/no-use-before-define.js +2 -2
  228. package/lib/rules/no-useless-backreference.js +2 -2
  229. package/lib/rules/no-useless-call.js +2 -2
  230. package/lib/rules/no-useless-catch.js +1 -1
  231. package/lib/rules/no-useless-computed-key.js +2 -2
  232. package/lib/rules/no-useless-concat.js +2 -2
  233. package/lib/rules/no-useless-constructor.js +1 -1
  234. package/lib/rules/no-useless-escape.js +2 -2
  235. package/lib/rules/no-useless-rename.js +2 -2
  236. package/lib/rules/no-useless-return.js +2 -2
  237. package/lib/rules/no-var.js +2 -2
  238. package/lib/rules/no-void.js +1 -1
  239. package/lib/rules/no-warning-comments.js +2 -2
  240. package/lib/rules/no-whitespace-before-property.js +2 -2
  241. package/lib/rules/no-with.js +1 -1
  242. package/lib/rules/nonblock-statement-body-position.js +2 -2
  243. package/lib/rules/object-curly-newline.js +2 -2
  244. package/lib/rules/object-curly-spacing.js +4 -4
  245. package/lib/rules/object-property-newline.js +2 -2
  246. package/lib/rules/object-shorthand.js +2 -2
  247. package/lib/rules/one-var-declaration-per-line.js +1 -1
  248. package/lib/rules/one-var.js +2 -2
  249. package/lib/rules/operator-assignment.js +2 -2
  250. package/lib/rules/operator-linebreak.js +2 -2
  251. package/lib/rules/padded-blocks.js +2 -2
  252. package/lib/rules/padding-line-between-statements.js +4 -4
  253. package/lib/rules/prefer-arrow-callback.js +2 -2
  254. package/lib/rules/prefer-const.js +2 -2
  255. package/lib/rules/prefer-destructuring.js +2 -2
  256. package/lib/rules/prefer-exponentiation-operator.js +2 -2
  257. package/lib/rules/prefer-named-capture-group.js +2 -2
  258. package/lib/rules/prefer-numeric-literals.js +2 -2
  259. package/lib/rules/prefer-object-has-own.js +2 -2
  260. package/lib/rules/prefer-object-spread.js +2 -2
  261. package/lib/rules/prefer-promise-reject-errors.js +2 -2
  262. package/lib/rules/prefer-reflect.js +1 -1
  263. package/lib/rules/prefer-regex-literals.js +2 -2
  264. package/lib/rules/prefer-rest-params.js +2 -2
  265. package/lib/rules/prefer-spread.js +2 -2
  266. package/lib/rules/prefer-template.js +2 -2
  267. package/lib/rules/quote-props.js +2 -2
  268. package/lib/rules/quotes.js +2 -2
  269. package/lib/rules/radix.js +2 -2
  270. package/lib/rules/require-atomic-updates.js +2 -2
  271. package/lib/rules/require-await.js +2 -2
  272. package/lib/rules/require-jsdoc.js +2 -2
  273. package/lib/rules/require-unicode-regexp.js +2 -2
  274. package/lib/rules/require-yield.js +1 -1
  275. package/lib/rules/rest-spread-spacing.js +2 -2
  276. package/lib/rules/semi-spacing.js +2 -2
  277. package/lib/rules/semi-style.js +2 -2
  278. package/lib/rules/semi.js +30 -5
  279. package/lib/rules/sort-imports.js +2 -2
  280. package/lib/rules/sort-keys.js +2 -2
  281. package/lib/rules/sort-vars.js +2 -2
  282. package/lib/rules/space-before-blocks.js +2 -2
  283. package/lib/rules/space-before-function-paren.js +2 -2
  284. package/lib/rules/space-in-parens.js +2 -2
  285. package/lib/rules/space-infix-ops.js +2 -2
  286. package/lib/rules/space-unary-ops.js +2 -2
  287. package/lib/rules/spaced-comment.js +2 -2
  288. package/lib/rules/strict.js +1 -1
  289. package/lib/rules/switch-colon-spacing.js +2 -2
  290. package/lib/rules/symbol-description.js +2 -2
  291. package/lib/rules/template-curly-spacing.js +2 -2
  292. package/lib/rules/template-tag-spacing.js +2 -2
  293. package/lib/rules/unicode-bom.js +2 -2
  294. package/lib/rules/use-isnan.js +1 -1
  295. package/lib/rules/valid-jsdoc.js +2 -2
  296. package/lib/rules/valid-typeof.js +2 -2
  297. package/lib/rules/vars-on-top.js +1 -1
  298. package/lib/rules/wrap-iife.js +2 -2
  299. package/lib/rules/wrap-regex.js +2 -2
  300. package/lib/rules/yield-star-spacing.js +2 -2
  301. package/lib/rules/yoda.js +2 -2
  302. package/lib/shared/string-utils.js +39 -1
  303. package/lib/shared/types.js +6 -2
  304. package/lib/unsupported-api.js +2 -1
  305. package/messages/invalid-rule-options.js +17 -0
  306. package/messages/invalid-rule-severity.js +13 -0
  307. package/messages/shared.js +18 -0
  308. package/package.json +6 -7
@@ -41,7 +41,7 @@ module.exports = {
41
41
  docs: {
42
42
  description: "Disallow multiple spaces in regular expressions",
43
43
  recommended: true,
44
- url: "https://eslint.org/docs/rules/no-regex-spaces"
44
+ url: "https://eslint.org/docs/latest/rules/no-regex-spaces"
45
45
  },
46
46
 
47
47
  schema: [],
@@ -54,7 +54,7 @@ module.exports = {
54
54
 
55
55
  create(context) {
56
56
 
57
- const sourceCode = context.getSourceCode();
57
+ const sourceCode = context.sourceCode;
58
58
 
59
59
  /**
60
60
  * Validate regular expression
@@ -23,7 +23,7 @@ module.exports = {
23
23
  docs: {
24
24
  description: "Disallow specified names in exports",
25
25
  recommended: false,
26
- url: "https://eslint.org/docs/rules/no-restricted-exports"
26
+ url: "https://eslint.org/docs/latest/rules/no-restricted-exports"
27
27
  },
28
28
 
29
29
  schema: [{
@@ -99,7 +99,7 @@ module.exports = {
99
99
 
100
100
  const restrictedNames = new Set(context.options[0] && context.options[0].restrictedNamedExports);
101
101
  const restrictDefaultExports = context.options[0] && context.options[0].restrictDefaultExports;
102
- const sourceCode = context.getSourceCode();
102
+ const sourceCode = context.sourceCode;
103
103
 
104
104
  /**
105
105
  * Checks and reports given exported name.
@@ -16,7 +16,7 @@ module.exports = {
16
16
  docs: {
17
17
  description: "Disallow specified global variables",
18
18
  recommended: false,
19
- url: "https://eslint.org/docs/rules/no-restricted-globals"
19
+ url: "https://eslint.org/docs/latest/rules/no-restricted-globals"
20
20
  },
21
21
 
22
22
  schema: {
@@ -50,7 +50,7 @@ module.exports = {
50
50
 
51
51
  create(context) {
52
52
 
53
- const sourceCode = context.getSourceCode();
53
+ const sourceCode = context.sourceCode;
54
54
 
55
55
  // If no globals are restricted, we don't need to do anything
56
56
  if (context.options.length === 0) {
@@ -98,7 +98,7 @@ module.exports = {
98
98
  docs: {
99
99
  description: "Disallow specified modules when loaded by `import`",
100
100
  recommended: false,
101
- url: "https://eslint.org/docs/rules/no-restricted-imports"
101
+ url: "https://eslint.org/docs/latest/rules/no-restricted-imports"
102
102
  },
103
103
 
104
104
  messages: {
@@ -147,7 +147,7 @@ module.exports = {
147
147
  },
148
148
 
149
149
  create(context) {
150
- const sourceCode = context.getSourceCode();
150
+ const sourceCode = context.sourceCode;
151
151
  const options = Array.isArray(context.options) ? context.options : [];
152
152
  const isPathAndPatternsObject =
153
153
  typeof options[0] === "object" &&
@@ -51,7 +51,7 @@ module.exports = {
51
51
  docs: {
52
52
  description: "Disallow specified modules when loaded by `require`",
53
53
  recommended: false,
54
- url: "https://eslint.org/docs/rules/no-restricted-modules"
54
+ url: "https://eslint.org/docs/latest/rules/no-restricted-modules"
55
55
  },
56
56
 
57
57
  schema: {
@@ -19,7 +19,7 @@ module.exports = {
19
19
  docs: {
20
20
  description: "Disallow certain properties on certain objects",
21
21
  recommended: false,
22
- url: "https://eslint.org/docs/rules/no-restricted-properties"
22
+ url: "https://eslint.org/docs/latest/rules/no-restricted-properties"
23
23
  },
24
24
 
25
25
  schema: {
@@ -16,7 +16,7 @@ module.exports = {
16
16
  docs: {
17
17
  description: "Disallow specified syntax",
18
18
  recommended: false,
19
- url: "https://eslint.org/docs/rules/no-restricted-syntax"
19
+ url: "https://eslint.org/docs/latest/rules/no-restricted-syntax"
20
20
  },
21
21
 
22
22
  schema: {
@@ -28,7 +28,7 @@ module.exports = {
28
28
  docs: {
29
29
  description: "Disallow assignment operators in `return` statements",
30
30
  recommended: false,
31
- url: "https://eslint.org/docs/rules/no-return-assign"
31
+ url: "https://eslint.org/docs/latest/rules/no-return-assign"
32
32
  },
33
33
 
34
34
  schema: [
@@ -45,7 +45,7 @@ module.exports = {
45
45
 
46
46
  create(context) {
47
47
  const always = (context.options[0] || "except-parens") !== "except-parens";
48
- const sourceCode = context.getSourceCode();
48
+ const sourceCode = context.sourceCode;
49
49
 
50
50
  return {
51
51
  AssignmentExpression(node) {
@@ -21,7 +21,7 @@ module.exports = {
21
21
 
22
22
  recommended: false,
23
23
 
24
- url: "https://eslint.org/docs/rules/no-return-await"
24
+ url: "https://eslint.org/docs/latest/rules/no-return-await"
25
25
  },
26
26
 
27
27
  fixable: null,
@@ -44,14 +44,14 @@ module.exports = {
44
44
  */
45
45
  function reportUnnecessaryAwait(node) {
46
46
  context.report({
47
- node: context.getSourceCode().getFirstToken(node),
47
+ node: context.sourceCode.getFirstToken(node),
48
48
  loc: node.loc,
49
49
  messageId: "redundantUseOfAwait",
50
50
  suggest: [
51
51
  {
52
52
  messageId: "removeAwait",
53
53
  fix(fixer) {
54
- const sourceCode = context.getSourceCode();
54
+ const sourceCode = context.sourceCode;
55
55
  const [awaitToken, tokenAfterAwait] = sourceCode.getFirstTokens(node, 2);
56
56
 
57
57
  const areAwaitAndAwaitedExpressionOnTheSameLine = awaitToken.loc.start.line === tokenAfterAwait.loc.start.line;
@@ -20,7 +20,7 @@ module.exports = {
20
20
  docs: {
21
21
  description: "Disallow `javascript:` urls",
22
22
  recommended: false,
23
- url: "https://eslint.org/docs/rules/no-script-url"
23
+ url: "https://eslint.org/docs/latest/rules/no-script-url"
24
24
  },
25
25
 
26
26
  schema: [],
@@ -132,7 +132,7 @@ module.exports = {
132
132
  docs: {
133
133
  description: "Disallow assignments where both sides are exactly the same",
134
134
  recommended: true,
135
- url: "https://eslint.org/docs/rules/no-self-assign"
135
+ url: "https://eslint.org/docs/latest/rules/no-self-assign"
136
136
  },
137
137
 
138
138
  schema: [
@@ -154,7 +154,7 @@ module.exports = {
154
154
  },
155
155
 
156
156
  create(context) {
157
- const sourceCode = context.getSourceCode();
157
+ const sourceCode = context.sourceCode;
158
158
  const [{ props = true } = {}] = context.options;
159
159
 
160
160
  /**
@@ -18,7 +18,7 @@ module.exports = {
18
18
  docs: {
19
19
  description: "Disallow comparisons where both sides are exactly the same",
20
20
  recommended: false,
21
- url: "https://eslint.org/docs/rules/no-self-compare"
21
+ url: "https://eslint.org/docs/latest/rules/no-self-compare"
22
22
  },
23
23
 
24
24
  schema: [],
@@ -29,7 +29,7 @@ module.exports = {
29
29
  },
30
30
 
31
31
  create(context) {
32
- const sourceCode = context.getSourceCode();
32
+ const sourceCode = context.sourceCode;
33
33
 
34
34
  /**
35
35
  * Determines whether two nodes are composed of the same tokens.
@@ -31,7 +31,7 @@ module.exports = {
31
31
  docs: {
32
32
  description: "Disallow comma operators",
33
33
  recommended: false,
34
- url: "https://eslint.org/docs/rules/no-sequences"
34
+ url: "https://eslint.org/docs/latest/rules/no-sequences"
35
35
  },
36
36
 
37
37
  schema: [{
@@ -51,7 +51,7 @@ module.exports = {
51
51
 
52
52
  create(context) {
53
53
  const options = Object.assign({}, DEFAULT_OPTIONS, context.options[0]);
54
- const sourceCode = context.getSourceCode();
54
+ const sourceCode = context.sourceCode;
55
55
 
56
56
  /**
57
57
  * Parts of the grammar that are required to have parens.
@@ -144,7 +144,7 @@ module.exports = {
144
144
  docs: {
145
145
  description: "Disallow returning values from setters",
146
146
  recommended: true,
147
- url: "https://eslint.org/docs/rules/no-setter-return"
147
+ url: "https://eslint.org/docs/latest/rules/no-setter-return"
148
148
  },
149
149
 
150
150
  schema: [],
@@ -156,7 +156,7 @@ module.exports = {
156
156
 
157
157
  create(context) {
158
158
  let funcInfo = null;
159
- const sourceCode = context.getSourceCode();
159
+ const sourceCode = context.sourceCode;
160
160
 
161
161
  /**
162
162
  * Creates and pushes to the stack a function info object for the given function node.
@@ -29,7 +29,7 @@ module.exports = {
29
29
  docs: {
30
30
  description: "Disallow identifiers from shadowing restricted names",
31
31
  recommended: true,
32
- url: "https://eslint.org/docs/rules/no-shadow-restricted-names"
32
+ url: "https://eslint.org/docs/latest/rules/no-shadow-restricted-names"
33
33
  },
34
34
 
35
35
  schema: [],
@@ -43,7 +43,7 @@ module.exports = {
43
43
 
44
44
 
45
45
  const RESTRICTED = new Set(["undefined", "NaN", "Infinity", "arguments", "eval"]);
46
- const sourceCode = context.getSourceCode();
46
+ const sourceCode = context.sourceCode;
47
47
 
48
48
  return {
49
49
  "VariableDeclaration, :function, CatchClause"(node) {
@@ -32,7 +32,7 @@ module.exports = {
32
32
  docs: {
33
33
  description: "Disallow variable declarations from shadowing variables declared in the outer scope",
34
34
  recommended: false,
35
- url: "https://eslint.org/docs/rules/no-shadow"
35
+ url: "https://eslint.org/docs/latest/rules/no-shadow"
36
36
  },
37
37
 
38
38
  schema: [
@@ -67,7 +67,7 @@ module.exports = {
67
67
  allow: (context.options[0] && context.options[0].allow) || [],
68
68
  ignoreOnInitialization: context.options[0] && context.options[0].ignoreOnInitialization
69
69
  };
70
- const sourceCode = context.getSourceCode();
70
+ const sourceCode = context.sourceCode;
71
71
 
72
72
  /**
73
73
  * Checks whether or not a given location is inside of the range of a given node.
@@ -18,7 +18,7 @@ module.exports = {
18
18
  docs: {
19
19
  description: "Disallow spacing between function identifiers and their applications (deprecated)",
20
20
  recommended: false,
21
- url: "https://eslint.org/docs/rules/no-spaced-func"
21
+ url: "https://eslint.org/docs/latest/rules/no-spaced-func"
22
22
  },
23
23
 
24
24
  deprecated: true,
@@ -35,7 +35,7 @@ module.exports = {
35
35
 
36
36
  create(context) {
37
37
 
38
- const sourceCode = context.getSourceCode();
38
+ const sourceCode = context.sourceCode;
39
39
 
40
40
  /**
41
41
  * Check if open space is present in a function name
@@ -16,7 +16,7 @@ module.exports = {
16
16
  docs: {
17
17
  description: "Disallow sparse arrays",
18
18
  recommended: true,
19
- url: "https://eslint.org/docs/rules/no-sparse-arrays"
19
+ url: "https://eslint.org/docs/latest/rules/no-sparse-arrays"
20
20
  },
21
21
 
22
22
  schema: [],
@@ -22,7 +22,7 @@ module.exports = {
22
22
  docs: {
23
23
  description: "Disallow synchronous methods",
24
24
  recommended: false,
25
- url: "https://eslint.org/docs/rules/no-sync"
25
+ url: "https://eslint.org/docs/latest/rules/no-sync"
26
26
  },
27
27
 
28
28
  schema: [
@@ -24,7 +24,7 @@ module.exports = {
24
24
  docs: {
25
25
  description: "Disallow all tabs",
26
26
  recommended: false,
27
- url: "https://eslint.org/docs/rules/no-tabs"
27
+ url: "https://eslint.org/docs/latest/rules/no-tabs"
28
28
  },
29
29
  schema: [{
30
30
  type: "object",
@@ -43,7 +43,7 @@ module.exports = {
43
43
  },
44
44
 
45
45
  create(context) {
46
- const sourceCode = context.getSourceCode();
46
+ const sourceCode = context.sourceCode;
47
47
  const allowIndentationTabs = context.options && context.options[0] && context.options[0].allowIndentationTabs;
48
48
 
49
49
  return {
@@ -16,7 +16,7 @@ module.exports = {
16
16
  docs: {
17
17
  description: "Disallow template literal placeholder syntax in regular strings",
18
18
  recommended: false,
19
- url: "https://eslint.org/docs/rules/no-template-curly-in-string"
19
+ url: "https://eslint.org/docs/latest/rules/no-template-curly-in-string"
20
20
  },
21
21
 
22
22
  schema: [],
@@ -17,7 +17,7 @@ module.exports = {
17
17
  docs: {
18
18
  description: "Disallow ternary operators",
19
19
  recommended: false,
20
- url: "https://eslint.org/docs/rules/no-ternary"
20
+ url: "https://eslint.org/docs/latest/rules/no-ternary"
21
21
  },
22
22
 
23
23
  schema: [],
@@ -42,7 +42,7 @@ module.exports = {
42
42
  docs: {
43
43
  description: "Disallow `this`/`super` before calling `super()` in constructors",
44
44
  recommended: true,
45
- url: "https://eslint.org/docs/rules/no-this-before-super"
45
+ url: "https://eslint.org/docs/latest/rules/no-this-before-super"
46
46
  },
47
47
 
48
48
  schema: [],
@@ -19,7 +19,7 @@ module.exports = {
19
19
  docs: {
20
20
  description: "Disallow throwing literals as exceptions",
21
21
  recommended: false,
22
- url: "https://eslint.org/docs/rules/no-throw-literal"
22
+ url: "https://eslint.org/docs/latest/rules/no-throw-literal"
23
23
  },
24
24
 
25
25
  schema: [],
@@ -22,7 +22,7 @@ module.exports = {
22
22
  docs: {
23
23
  description: "Disallow trailing whitespace at the end of lines",
24
24
  recommended: false,
25
- url: "https://eslint.org/docs/rules/no-trailing-spaces"
25
+ url: "https://eslint.org/docs/latest/rules/no-trailing-spaces"
26
26
  },
27
27
 
28
28
  fixable: "whitespace",
@@ -50,7 +50,7 @@ module.exports = {
50
50
  },
51
51
 
52
52
  create(context) {
53
- const sourceCode = context.getSourceCode();
53
+ const sourceCode = context.sourceCode;
54
54
 
55
55
  const BLANK_CLASS = "[ \t\u00a0\u2000-\u200b\u3000]",
56
56
  SKIP_BLANK = `^${BLANK_CLASS}*$`,
@@ -19,7 +19,7 @@ module.exports = {
19
19
  docs: {
20
20
  description: "Disallow initializing variables to `undefined`",
21
21
  recommended: false,
22
- url: "https://eslint.org/docs/rules/no-undef-init"
22
+ url: "https://eslint.org/docs/latest/rules/no-undef-init"
23
23
  },
24
24
 
25
25
  schema: [],
@@ -32,7 +32,7 @@ module.exports = {
32
32
 
33
33
  create(context) {
34
34
 
35
- const sourceCode = context.getSourceCode();
35
+ const sourceCode = context.sourceCode;
36
36
 
37
37
  return {
38
38
 
@@ -31,7 +31,7 @@ module.exports = {
31
31
  docs: {
32
32
  description: "Disallow the use of undeclared variables unless mentioned in `/*global */` comments",
33
33
  recommended: true,
34
- url: "https://eslint.org/docs/rules/no-undef"
34
+ url: "https://eslint.org/docs/latest/rules/no-undef"
35
35
  },
36
36
 
37
37
  schema: [
@@ -54,7 +54,7 @@ module.exports = {
54
54
  create(context) {
55
55
  const options = context.options[0];
56
56
  const considerTypeOf = options && options.typeof === true || false;
57
- const sourceCode = context.getSourceCode();
57
+ const sourceCode = context.sourceCode;
58
58
 
59
59
  return {
60
60
  "Program:exit"(node) {
@@ -16,7 +16,7 @@ module.exports = {
16
16
  docs: {
17
17
  description: "Disallow the use of `undefined` as an identifier",
18
18
  recommended: false,
19
- url: "https://eslint.org/docs/rules/no-undefined"
19
+ url: "https://eslint.org/docs/latest/rules/no-undefined"
20
20
  },
21
21
 
22
22
  schema: [],
@@ -28,7 +28,7 @@ module.exports = {
28
28
 
29
29
  create(context) {
30
30
 
31
- const sourceCode = context.getSourceCode();
31
+ const sourceCode = context.sourceCode;
32
32
 
33
33
  /**
34
34
  * Report an invalid "undefined" identifier node.
@@ -17,7 +17,7 @@ module.exports = {
17
17
  docs: {
18
18
  description: "Disallow dangling underscores in identifiers",
19
19
  recommended: false,
20
- url: "https://eslint.org/docs/rules/no-underscore-dangle"
20
+ url: "https://eslint.org/docs/latest/rules/no-underscore-dangle"
21
21
  },
22
22
 
23
23
  schema: [
@@ -84,7 +84,7 @@ module.exports = {
84
84
  const allowFunctionParams = typeof options.allowFunctionParams !== "undefined" ? options.allowFunctionParams : true;
85
85
  const allowInArrayDestructuring = typeof options.allowInArrayDestructuring !== "undefined" ? options.allowInArrayDestructuring : true;
86
86
  const allowInObjectDestructuring = typeof options.allowInObjectDestructuring !== "undefined" ? options.allowInObjectDestructuring : true;
87
- const sourceCode = context.getSourceCode();
87
+ const sourceCode = context.sourceCode;
88
88
 
89
89
  //-------------------------------------------------------------------------
90
90
  // Helpers
@@ -22,7 +22,7 @@ module.exports = {
22
22
  docs: {
23
23
  description: "Disallow confusing multiline expressions",
24
24
  recommended: true,
25
- url: "https://eslint.org/docs/rules/no-unexpected-multiline"
25
+ url: "https://eslint.org/docs/latest/rules/no-unexpected-multiline"
26
26
  },
27
27
 
28
28
  schema: [],
@@ -38,7 +38,7 @@ module.exports = {
38
38
 
39
39
  const REGEX_FLAG_MATCHER = /^[gimsuy]+$/u;
40
40
 
41
- const sourceCode = context.getSourceCode();
41
+ const sourceCode = context.sourceCode;
42
42
 
43
43
  /**
44
44
  * Check to see if there is a newline between the node and the following open bracket
@@ -164,7 +164,7 @@ module.exports = {
164
164
  docs: {
165
165
  description: "Disallow unmodified loop conditions",
166
166
  recommended: false,
167
- url: "https://eslint.org/docs/rules/no-unmodified-loop-condition"
167
+ url: "https://eslint.org/docs/latest/rules/no-unmodified-loop-condition"
168
168
  },
169
169
 
170
170
  schema: [],
@@ -175,7 +175,7 @@ module.exports = {
175
175
  },
176
176
 
177
177
  create(context) {
178
- const sourceCode = context.getSourceCode();
178
+ const sourceCode = context.sourceCode;
179
179
  let groupMap = null;
180
180
 
181
181
  /**
@@ -31,7 +31,7 @@ module.exports = {
31
31
  docs: {
32
32
  description: "Disallow ternary operators when simpler alternatives exist",
33
33
  recommended: false,
34
- url: "https://eslint.org/docs/rules/no-unneeded-ternary"
34
+ url: "https://eslint.org/docs/latest/rules/no-unneeded-ternary"
35
35
  },
36
36
 
37
37
  schema: [
@@ -58,7 +58,7 @@ module.exports = {
58
58
  create(context) {
59
59
  const options = context.options[0] || {};
60
60
  const defaultAssignment = options.defaultAssignment !== false;
61
- const sourceCode = context.getSourceCode();
61
+ const sourceCode = context.sourceCode;
62
62
 
63
63
  /**
64
64
  * Test if the node is a boolean literal
@@ -61,7 +61,7 @@ module.exports = {
61
61
  docs: {
62
62
  description: "Disallow loops with a body that allows only one iteration",
63
63
  recommended: false,
64
- url: "https://eslint.org/docs/rules/no-unreachable-loop"
64
+ url: "https://eslint.org/docs/latest/rules/no-unreachable-loop"
65
65
  },
66
66
 
67
67
  schema: [{
@@ -113,7 +113,7 @@ module.exports = {
113
113
  docs: {
114
114
  description: "Disallow unreachable code after `return`, `throw`, `continue`, and `break` statements",
115
115
  recommended: true,
116
- url: "https://eslint.org/docs/rules/no-unreachable"
116
+ url: "https://eslint.org/docs/latest/rules/no-unreachable"
117
117
  },
118
118
 
119
119
  schema: [],
@@ -130,7 +130,7 @@ module.exports = {
130
130
  let constructorInfo = null;
131
131
 
132
132
  /** @type {ConsecutiveRange} */
133
- const range = new ConsecutiveRange(context.getSourceCode());
133
+ const range = new ConsecutiveRange(context.sourceCode);
134
134
 
135
135
  /**
136
136
  * Reports a given node if it's unreachable.
@@ -26,7 +26,7 @@ module.exports = {
26
26
  docs: {
27
27
  description: "Disallow control flow statements in `finally` blocks",
28
28
  recommended: true,
29
- url: "https://eslint.org/docs/rules/no-unsafe-finally"
29
+ url: "https://eslint.org/docs/latest/rules/no-unsafe-finally"
30
30
  },
31
31
 
32
32
  schema: [],
@@ -54,7 +54,7 @@ module.exports = {
54
54
  docs: {
55
55
  description: "Disallow negating the left operand of relational operators",
56
56
  recommended: true,
57
- url: "https://eslint.org/docs/rules/no-unsafe-negation"
57
+ url: "https://eslint.org/docs/latest/rules/no-unsafe-negation"
58
58
  },
59
59
 
60
60
  hasSuggestions: true,
@@ -82,7 +82,7 @@ module.exports = {
82
82
  },
83
83
 
84
84
  create(context) {
85
- const sourceCode = context.getSourceCode();
85
+ const sourceCode = context.sourceCode;
86
86
  const options = context.options[0] || {};
87
87
  const enforceForOrderingRelations = options.enforceForOrderingRelations === true;
88
88
 
@@ -26,7 +26,7 @@ module.exports = {
26
26
  docs: {
27
27
  description: "Disallow use of optional chaining in contexts where the `undefined` value is not allowed",
28
28
  recommended: true,
29
- url: "https://eslint.org/docs/rules/no-unsafe-optional-chaining"
29
+ url: "https://eslint.org/docs/latest/rules/no-unsafe-optional-chaining"
30
30
  },
31
31
  schema: [{
32
32
  type: "object",
@@ -32,7 +32,7 @@ module.exports = {
32
32
  docs: {
33
33
  description: "Disallow unused expressions",
34
34
  recommended: false,
35
- url: "https://eslint.org/docs/rules/no-unused-expressions"
35
+ url: "https://eslint.org/docs/latest/rules/no-unused-expressions"
36
36
  },
37
37
 
38
38
  schema: [
@@ -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