eslint-plugin-unicorn 45.0.0 → 45.0.1

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 (61) hide show
  1. package/package.json +4 -4
  2. package/rules/catch-error-name.js +1 -1
  3. package/rules/consistent-function-scoping.js +1 -1
  4. package/rules/empty-brace-spaces.js +1 -1
  5. package/rules/error-message.js +1 -1
  6. package/rules/explicit-length-check.js +1 -1
  7. package/rules/fix/add-parenthesizes-to-return-or-throw-expression.js +1 -1
  8. package/rules/fix/append-argument.js +1 -1
  9. package/rules/fix/remove-argument.js +1 -1
  10. package/rules/import-style.js +1 -1
  11. package/rules/no-array-callback-reference.js +1 -1
  12. package/rules/no-array-for-each.js +1 -1
  13. package/rules/no-array-method-this-argument.js +1 -1
  14. package/rules/no-array-push-push.js +1 -1
  15. package/rules/no-for-loop.js +1 -1
  16. package/rules/no-invalid-remove-event-listener.js +1 -1
  17. package/rules/no-lonely-if.js +1 -1
  18. package/rules/no-nested-ternary.js +1 -1
  19. package/rules/no-new-array.js +1 -1
  20. package/rules/no-new-buffer.js +1 -1
  21. package/rules/no-static-only-class.js +1 -1
  22. package/rules/no-thenable.js +1 -1
  23. package/rules/no-unreadable-array-destructuring.js +1 -1
  24. package/rules/no-useless-spread.js +21 -3
  25. package/rules/no-useless-undefined.js +1 -1
  26. package/rules/no-zero-fractions.js +1 -1
  27. package/rules/prefer-add-event-listener.js +1 -1
  28. package/rules/prefer-array-find.js +1 -1
  29. package/rules/prefer-at.js +1 -1
  30. package/rules/prefer-default-parameters.js +1 -1
  31. package/rules/prefer-dom-node-remove.js +1 -1
  32. package/rules/prefer-export-from.js +1 -1
  33. package/rules/prefer-json-parse-buffer.js +1 -1
  34. package/rules/prefer-math-trunc.js +1 -1
  35. package/rules/prefer-module.js +1 -1
  36. package/rules/prefer-native-coercion-functions.js +1 -1
  37. package/rules/prefer-object-from-entries.js +1 -1
  38. package/rules/prefer-optional-catch-binding.js +1 -1
  39. package/rules/prefer-prototype-methods.js +1 -1
  40. package/rules/prefer-reflect-apply.js +1 -1
  41. package/rules/prefer-regexp-test.js +1 -1
  42. package/rules/prefer-set-has.js +1 -1
  43. package/rules/prefer-set-size.js +1 -1
  44. package/rules/prefer-spread.js +1 -1
  45. package/rules/prefer-string-replace-all.js +1 -1
  46. package/rules/prefer-string-slice.js +1 -1
  47. package/rules/prefer-string-starts-ends-with.js +1 -1
  48. package/rules/prefer-switch.js +1 -1
  49. package/rules/prefer-ternary.js +1 -1
  50. package/rules/prefer-top-level-await.js +1 -1
  51. package/rules/relative-url-style.js +1 -1
  52. package/rules/shared/simple-array-search-rule.js +1 -1
  53. package/rules/switch-case-braces.js +1 -1
  54. package/rules/utils/get-call-expression-arguments-text.js +1 -1
  55. package/rules/utils/get-switch-case-head-location.js +1 -1
  56. package/rules/utils/global-reference-tracker.js +1 -1
  57. package/rules/utils/is-function-self-used-inside.js +1 -1
  58. package/rules/utils/is-new-expression-with-parentheses.js +1 -1
  59. package/rules/utils/is-number.js +1 -1
  60. package/rules/utils/is-same-reference.js +1 -1
  61. package/rules/utils/parentheses.js +1 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-plugin-unicorn",
3
- "version": "45.0.0",
3
+ "version": "45.0.1",
4
4
  "description": "More than 100 powerful ESLint rules",
5
5
  "license": "MIT",
6
6
  "repository": "sindresorhus/eslint-plugin-unicorn",
@@ -47,18 +47,18 @@
47
47
  ],
48
48
  "dependencies": {
49
49
  "@babel/helper-validator-identifier": "^7.19.1",
50
+ "@eslint-community/eslint-utils": "^4.1.0",
50
51
  "ci-info": "^3.6.1",
51
52
  "clean-regexp": "^1.0.0",
52
- "eslint-utils": "^3.0.0",
53
53
  "esquery": "^1.4.0",
54
54
  "indent-string": "^4.0.0",
55
55
  "is-builtin-module": "^3.2.0",
56
- "jsesc": "3.0.2",
56
+ "jsesc": "^3.0.2",
57
57
  "lodash": "^4.17.21",
58
58
  "pluralize": "^8.0.0",
59
59
  "read-pkg-up": "^7.0.1",
60
60
  "regexp-tree": "^0.1.24",
61
- "regjsparser": "0.9.1",
61
+ "regjsparser": "^0.9.1",
62
62
  "safe-regex": "^2.1.1",
63
63
  "semver": "^7.3.8",
64
64
  "strip-indent": "^3.0.0"
@@ -1,5 +1,5 @@
1
1
  'use strict';
2
- const {findVariable} = require('eslint-utils');
2
+ const {findVariable} = require('@eslint-community/eslint-utils');
3
3
  const avoidCapture = require('./utils/avoid-capture.js');
4
4
  const {renameVariable} = require('./fix/index.js');
5
5
  const {matches, methodCallSelector} = require('./selectors/index.js');
@@ -1,5 +1,5 @@
1
1
  'use strict';
2
- const {getFunctionHeadLocation, getFunctionNameWithKind} = require('eslint-utils');
2
+ const {getFunctionHeadLocation, getFunctionNameWithKind} = require('@eslint-community/eslint-utils');
3
3
  const getReferences = require('./utils/get-references.js');
4
4
  const {isNodeMatches} = require('./utils/is-node-matches.js');
5
5
 
@@ -1,5 +1,5 @@
1
1
  'use strict';
2
- const {isOpeningBraceToken} = require('eslint-utils');
2
+ const {isOpeningBraceToken} = require('@eslint-community/eslint-utils');
3
3
  const {matches} = require('./selectors/index.js');
4
4
 
5
5
  const MESSAGE_ID = 'empty-brace-spaces';
@@ -1,5 +1,5 @@
1
1
  'use strict';
2
- const {getStaticValue} = require('eslint-utils');
2
+ const {getStaticValue} = require('@eslint-community/eslint-utils');
3
3
  const isShadowed = require('./utils/is-shadowed.js');
4
4
  const {callOrNewExpressionSelector} = require('./selectors/index.js');
5
5
 
@@ -1,5 +1,5 @@
1
1
  'use strict';
2
- const {isParenthesized, getStaticValue} = require('eslint-utils');
2
+ const {isParenthesized, getStaticValue} = require('@eslint-community/eslint-utils');
3
3
  const {checkVueTemplate} = require('./utils/rule.js');
4
4
  const isLogicalExpression = require('./utils/is-logical-expression.js');
5
5
  const {isBooleanNode, getBooleanAncestor} = require('./utils/boolean.js');
@@ -1,5 +1,5 @@
1
1
  'use strict';
2
- const {isSemicolonToken} = require('eslint-utils');
2
+ const {isSemicolonToken} = require('@eslint-community/eslint-utils');
3
3
 
4
4
  function * addParenthesizesToReturnOrThrowExpression(fixer, node, sourceCode) {
5
5
  if (node.type !== 'ReturnStatement' && node.type !== 'ThrowStatement') {
@@ -1,5 +1,5 @@
1
1
  'use strict';
2
- const {isCommaToken} = require('eslint-utils');
2
+ const {isCommaToken} = require('@eslint-community/eslint-utils');
3
3
 
4
4
  function appendArgument(fixer, node, text, sourceCode) {
5
5
  // This function should also work for `NewExpression`
@@ -1,5 +1,5 @@
1
1
  'use strict';
2
- const {isCommaToken} = require('eslint-utils');
2
+ const {isCommaToken} = require('@eslint-community/eslint-utils');
3
3
  const {getParentheses} = require('../utils/parentheses.js');
4
4
 
5
5
  function removeArgument(fixer, node, sourceCode) {
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
  const {defaultsDeep} = require('lodash');
3
- const {getStringIfConstant} = require('eslint-utils');
3
+ const {getStringIfConstant} = require('@eslint-community/eslint-utils');
4
4
  const {callExpressionSelector} = require('./selectors/index.js');
5
5
 
6
6
  const MESSAGE_ID = 'importStyle';
@@ -1,5 +1,5 @@
1
1
  'use strict';
2
- const {isParenthesized} = require('eslint-utils');
2
+ const {isParenthesized} = require('@eslint-community/eslint-utils');
3
3
  const {methodCallSelector, notFunctionSelector} = require('./selectors/index.js');
4
4
  const {isNodeMatches} = require('./utils/is-node-matches.js');
5
5
 
@@ -6,7 +6,7 @@ const {
6
6
  isClosingParenToken,
7
7
  findVariable,
8
8
  hasSideEffect,
9
- } = require('eslint-utils');
9
+ } = require('@eslint-community/eslint-utils');
10
10
  const {methodCallSelector, referenceIdentifierSelector} = require('./selectors/index.js');
11
11
  const {extendFixRange} = require('./fix/index.js');
12
12
  const needsSemicolon = require('./utils/needs-semicolon.js');
@@ -1,5 +1,5 @@
1
1
  'use strict';
2
- const {hasSideEffect} = require('eslint-utils');
2
+ const {hasSideEffect} = require('@eslint-community/eslint-utils');
3
3
  const {methodCallSelector, notFunctionSelector} = require('./selectors/index.js');
4
4
  const {removeArgument} = require('./fix/index.js');
5
5
  const {getParentheses, getParenthesizedText} = require('./utils/parentheses.js');
@@ -1,5 +1,5 @@
1
1
  'use strict';
2
- const {hasSideEffect, isCommaToken, isSemicolonToken} = require('eslint-utils');
2
+ const {hasSideEffect, isCommaToken, isSemicolonToken} = require('@eslint-community/eslint-utils');
3
3
  const {methodCallSelector} = require('./selectors/index.js');
4
4
  const getCallExpressionArgumentsText = require('./utils/get-call-expression-arguments-text.js');
5
5
  const isSameReference = require('./utils/is-same-reference.js');
@@ -1,5 +1,5 @@
1
1
  'use strict';
2
- const {isClosingParenToken, getStaticValue} = require('eslint-utils');
2
+ const {isClosingParenToken, getStaticValue} = require('@eslint-community/eslint-utils');
3
3
  const avoidCapture = require('./utils/avoid-capture.js');
4
4
  const getScopes = require('./utils/get-scopes.js');
5
5
  const singular = require('./utils/singular.js');
@@ -1,5 +1,5 @@
1
1
  'use strict';
2
- const {getFunctionHeadLocation} = require('eslint-utils');
2
+ const {getFunctionHeadLocation} = require('@eslint-community/eslint-utils');
3
3
  const getDocumentationUrl = require('./utils/get-documentation-url.js');
4
4
  const {methodCallSelector, matches} = require('./selectors/index.js');
5
5
 
@@ -1,5 +1,5 @@
1
1
  'use strict';
2
- const {isParenthesized, isNotSemicolonToken} = require('eslint-utils');
2
+ const {isParenthesized, isNotSemicolonToken} = require('@eslint-community/eslint-utils');
3
3
  const needsSemicolon = require('./utils/needs-semicolon.js');
4
4
  const {removeSpacesAfter} = require('./fix/index.js');
5
5
  const {matches} = require('./selectors/index.js');
@@ -1,5 +1,5 @@
1
1
  'use strict';
2
- const {isParenthesized} = require('eslint-utils');
2
+ const {isParenthesized} = require('@eslint-community/eslint-utils');
3
3
 
4
4
  const MESSAGE_ID_TOO_DEEP = 'too-deep';
5
5
  const MESSAGE_ID_SHOULD_PARENTHESIZED = 'should-parenthesized';
@@ -1,5 +1,5 @@
1
1
  'use strict';
2
- const {isParenthesized, getStaticValue} = require('eslint-utils');
2
+ const {isParenthesized, getStaticValue} = require('@eslint-community/eslint-utils');
3
3
  const needsSemicolon = require('./utils/needs-semicolon.js');
4
4
  const {newExpressionSelector} = require('./selectors/index.js');
5
5
  const isNumber = require('./utils/is-number.js');
@@ -1,5 +1,5 @@
1
1
  'use strict';
2
- const {getStaticValue} = require('eslint-utils');
2
+ const {getStaticValue} = require('@eslint-community/eslint-utils');
3
3
  const {newExpressionSelector} = require('./selectors/index.js');
4
4
  const {switchNewExpressionToCallExpression} = require('./fix/index.js');
5
5
  const isNumber = require('./utils/is-number.js');
@@ -1,5 +1,5 @@
1
1
  'use strict';
2
- const {isSemicolonToken} = require('eslint-utils');
2
+ const {isSemicolonToken} = require('@eslint-community/eslint-utils');
3
3
  const getClassHeadLocation = require('./utils/get-class-head-location.js');
4
4
  const assertToken = require('./utils/assert-token.js');
5
5
  const {removeSpacesAfter} = require('./fix/index.js');
@@ -1,5 +1,5 @@
1
1
  'use strict';
2
- const {getStaticValue, getPropertyName} = require('eslint-utils');
2
+ const {getStaticValue, getPropertyName} = require('@eslint-community/eslint-utils');
3
3
  const {methodCallSelector} = require('./selectors/index.js');
4
4
 
5
5
  const MESSAGE_ID_OBJECT = 'no-thenable-object';
@@ -1,5 +1,5 @@
1
1
  'use strict';
2
- const {isParenthesized} = require('eslint-utils');
2
+ const {isParenthesized} = require('@eslint-community/eslint-utils');
3
3
  const shouldAddParenthesesToMemberExpressionObject = require('./utils/should-add-parentheses-to-member-expression-object.js');
4
4
  const {fixSpaceAroundKeyword} = require('./fix/index.js');
5
5
 
@@ -1,5 +1,5 @@
1
1
  'use strict';
2
- const {isCommaToken} = require('eslint-utils');
2
+ const {isCommaToken} = require('@eslint-community/eslint-utils');
3
3
  const {
4
4
  matches,
5
5
  newExpressionSelector,
@@ -15,6 +15,7 @@ const isOnSameLine = require('./utils/is-on-same-line.js');
15
15
  const {
16
16
  isParenthesized,
17
17
  } = require('./utils/parentheses.js');
18
+ const {isNewExpression} = require('./ast/index.js');
18
19
 
19
20
  const SPREAD_IN_LIST = 'spread-in-list';
20
21
  const ITERABLE_TO_ARRAY = 'iterable-to-array';
@@ -279,11 +280,28 @@ const create = context => {
279
280
  },
280
281
  [uselessArrayCloneSelector](node) {
281
282
  const arrayExpression = node.parent.parent;
282
- return {
283
+ const problem = {
283
284
  node: arrayExpression,
284
285
  messageId: CLONE_ARRAY,
285
- fix: fixer => unwrapSingleArraySpread(fixer, arrayExpression, sourceCode),
286
286
  };
287
+
288
+ if (
289
+ // `[...new Array(1)]` -> `new Array(1)` is not safe to fix since there are holes
290
+ isNewExpression(node, {name: 'Array'})
291
+ // `[...foo.slice(1)]` -> `foo.slice(1)` is not safe to fix since `foo` can be a string
292
+ || (
293
+ node.type === 'CallExpression'
294
+ && node.callee.type === 'MemberExpression'
295
+ && node.callee.property.type === 'Identifier'
296
+ && node.callee.property.name === 'slice'
297
+ )
298
+ ) {
299
+ return problem;
300
+ }
301
+
302
+ return Object.assign(problem, {
303
+ fix: fixer => unwrapSingleArraySpread(fixer, arrayExpression, sourceCode),
304
+ });
287
305
  },
288
306
  };
289
307
  };
@@ -1,5 +1,5 @@
1
1
  'use strict';
2
- const {isCommaToken} = require('eslint-utils');
2
+ const {isCommaToken} = require('@eslint-community/eslint-utils');
3
3
  const {replaceNodeOrTokenAndSpacesBefore} = require('./fix/index.js');
4
4
  const {isUndefined} = require('./ast/index.js');
5
5
 
@@ -1,5 +1,5 @@
1
1
  'use strict';
2
- const {isParenthesized} = require('eslint-utils');
2
+ const {isParenthesized} = require('@eslint-community/eslint-utils');
3
3
  const needsSemicolon = require('./utils/needs-semicolon.js');
4
4
  const {isDecimalInteger} = require('./utils/numeric.js');
5
5
  const toLocation = require('./utils/to-location.js');
@@ -1,5 +1,5 @@
1
1
  'use strict';
2
- const {isParenthesized} = require('eslint-utils');
2
+ const {isParenthesized} = require('@eslint-community/eslint-utils');
3
3
  const eventTypes = require('./shared/dom-events.js');
4
4
  const {STATIC_REQUIRE_SOURCE_SELECTOR} = require('./selectors/index.js');
5
5
  const {isUndefined, isNullLiteral} = require('./ast/index.js');
@@ -1,5 +1,5 @@
1
1
  'use strict';
2
- const {isParenthesized, findVariable} = require('eslint-utils');
2
+ const {isParenthesized, findVariable} = require('@eslint-community/eslint-utils');
3
3
  const {
4
4
  not,
5
5
  methodCallSelector,
@@ -1,5 +1,5 @@
1
1
  'use strict';
2
- const {isOpeningBracketToken, isClosingBracketToken, getStaticValue} = require('eslint-utils');
2
+ const {isOpeningBracketToken, isClosingBracketToken, getStaticValue} = require('@eslint-community/eslint-utils');
3
3
  const {
4
4
  isParenthesized,
5
5
  getParenthesizedRange,
@@ -1,5 +1,5 @@
1
1
  'use strict';
2
- const {findVariable} = require('eslint-utils');
2
+ const {findVariable} = require('@eslint-community/eslint-utils');
3
3
 
4
4
  const MESSAGE_ID = 'preferDefaultParameters';
5
5
  const MESSAGE_ID_SUGGEST = 'preferDefaultParametersSuggest';
@@ -1,5 +1,5 @@
1
1
  'use strict';
2
- const {isParenthesized, hasSideEffect} = require('eslint-utils');
2
+ const {isParenthesized, hasSideEffect} = require('@eslint-community/eslint-utils');
3
3
  const {methodCallSelector, notDomNodeSelector} = require('./selectors/index.js');
4
4
  const needsSemicolon = require('./utils/needs-semicolon.js');
5
5
  const isValueNotUsable = require('./utils/is-value-not-usable.js');
@@ -3,7 +3,7 @@ const {
3
3
  isCommaToken,
4
4
  isOpeningBraceToken,
5
5
  isClosingBraceToken,
6
- } = require('eslint-utils');
6
+ } = require('@eslint-community/eslint-utils');
7
7
 
8
8
  const MESSAGE_ID_ERROR = 'error';
9
9
  const MESSAGE_ID_SUGGESTION = 'suggestion';
@@ -1,5 +1,5 @@
1
1
  'use strict';
2
- const {findVariable, getStaticValue, getPropertyName} = require('eslint-utils');
2
+ const {findVariable, getStaticValue, getPropertyName} = require('@eslint-community/eslint-utils');
3
3
  const {methodCallSelector} = require('./selectors/index.js');
4
4
  const {removeArgument} = require('./fix/index.js');
5
5
 
@@ -1,5 +1,5 @@
1
1
  'use strict';
2
- const {hasSideEffect} = require('eslint-utils');
2
+ const {hasSideEffect} = require('@eslint-community/eslint-utils');
3
3
  const {fixSpaceAroundKeyword} = require('./fix/index.js');
4
4
 
5
5
  const ERROR_BITWISE = 'error-bitwise';
@@ -1,5 +1,5 @@
1
1
  'use strict';
2
- const {isOpeningParenToken} = require('eslint-utils');
2
+ const {isOpeningParenToken} = require('@eslint-community/eslint-utils');
3
3
  const isShadowed = require('./utils/is-shadowed.js');
4
4
  const assertToken = require('./utils/assert-token.js');
5
5
  const {referenceIdentifierSelector} = require('./selectors/index.js');
@@ -1,5 +1,5 @@
1
1
  'use strict';
2
- const {getFunctionHeadLocation, getFunctionNameWithKind} = require('eslint-utils');
2
+ const {getFunctionHeadLocation, getFunctionNameWithKind} = require('@eslint-community/eslint-utils');
3
3
  const {not} = require('./selectors/index.js');
4
4
 
5
5
  const MESSAGE_ID = 'prefer-native-coercion-functions';
@@ -1,5 +1,5 @@
1
1
  'use strict';
2
- const {isCommaToken, isArrowToken, isClosingParenToken} = require('eslint-utils');
2
+ const {isCommaToken, isArrowToken, isClosingParenToken} = require('@eslint-community/eslint-utils');
3
3
  const getDocumentationUrl = require('./utils/get-documentation-url.js');
4
4
  const {matches, methodCallSelector} = require('./selectors/index.js');
5
5
  const {removeParentheses} = require('./fix/index.js');
@@ -1,5 +1,5 @@
1
1
  'use strict';
2
- const {isOpeningParenToken, isClosingParenToken} = require('eslint-utils');
2
+ const {isOpeningParenToken, isClosingParenToken} = require('@eslint-community/eslint-utils');
3
3
  const assertToken = require('./utils/assert-token.js');
4
4
 
5
5
  const MESSAGE_ID_WITH_NAME = 'with-name';
@@ -1,5 +1,5 @@
1
1
  'use strict';
2
- const {getPropertyName} = require('eslint-utils');
2
+ const {getPropertyName} = require('@eslint-community/eslint-utils');
3
3
  const {
4
4
  methodCallSelector,
5
5
  emptyObjectSelector,
@@ -1,5 +1,5 @@
1
1
  'use strict';
2
- const {getPropertyName} = require('eslint-utils');
2
+ const {getPropertyName} = require('@eslint-community/eslint-utils');
3
3
  const {not, methodCallSelector} = require('./selectors/index.js');
4
4
  const {isNullLiteral} = require('./ast/index.js');
5
5
 
@@ -1,5 +1,5 @@
1
1
  'use strict';
2
- const {isParenthesized, getStaticValue} = require('eslint-utils');
2
+ const {isParenthesized, getStaticValue} = require('@eslint-community/eslint-utils');
3
3
  const {checkVueTemplate} = require('./utils/rule.js');
4
4
  const {methodCallSelector} = require('./selectors/index.js');
5
5
  const {isRegexLiteral, isNewExpression} = require('./ast/index.js');
@@ -1,5 +1,5 @@
1
1
  'use strict';
2
- const {findVariable} = require('eslint-utils');
2
+ const {findVariable} = require('@eslint-community/eslint-utils');
3
3
  const getVariableIdentifiers = require('./utils/get-variable-identifiers.js');
4
4
  const {
5
5
  matches,
@@ -1,5 +1,5 @@
1
1
  'use strict';
2
- const {findVariable} = require('eslint-utils');
2
+ const {findVariable} = require('@eslint-community/eslint-utils');
3
3
  const {memberExpressionSelector} = require('./selectors/index.js');
4
4
  const {fixSpaceAroundKeyword} = require('./fix/index.js');
5
5
  const {isNewExpression} = require('./ast/index.js');
@@ -1,5 +1,5 @@
1
1
  'use strict';
2
- const {isParenthesized, getStaticValue, isCommaToken, hasSideEffect} = require('eslint-utils');
2
+ const {isParenthesized, getStaticValue, isCommaToken, hasSideEffect} = require('@eslint-community/eslint-utils');
3
3
  const {methodCallSelector} = require('./selectors/index.js');
4
4
  const needsSemicolon = require('./utils/needs-semicolon.js');
5
5
  const {getParenthesizedRange, getParenthesizedText} = require('./utils/parentheses.js');
@@ -1,5 +1,5 @@
1
1
  'use strict';
2
- const {getStaticValue} = require('eslint-utils');
2
+ const {getStaticValue} = require('@eslint-community/eslint-utils');
3
3
  const {parse: parseRegExp} = require('regjsparser');
4
4
  const escapeString = require('./utils/escape-string.js');
5
5
  const {methodCallSelector} = require('./selectors/index.js');
@@ -1,5 +1,5 @@
1
1
  'use strict';
2
- const {getStaticValue} = require('eslint-utils');
2
+ const {getStaticValue} = require('@eslint-community/eslint-utils');
3
3
  const {getParenthesizedText, getParenthesizedRange} = require('./utils/parentheses.js');
4
4
  const {methodCallSelector} = require('./selectors/index.js');
5
5
  const isNumber = require('./utils/is-number.js');
@@ -1,5 +1,5 @@
1
1
  'use strict';
2
- const {isParenthesized, getStaticValue} = require('eslint-utils');
2
+ const {isParenthesized, getStaticValue} = require('@eslint-community/eslint-utils');
3
3
  const {methodCallSelector} = require('./selectors/index.js');
4
4
  const escapeString = require('./utils/escape-string.js');
5
5
  const shouldAddParenthesesToMemberExpressionObject = require('./utils/should-add-parentheses-to-member-expression-object.js');
@@ -1,5 +1,5 @@
1
1
  'use strict';
2
- const {hasSideEffect} = require('eslint-utils');
2
+ const {hasSideEffect} = require('@eslint-community/eslint-utils');
3
3
  const isSameReference = require('./utils/is-same-reference.js');
4
4
  const getIndentString = require('./utils/get-indent-string.js');
5
5
 
@@ -1,5 +1,5 @@
1
1
  'use strict';
2
- const {isParenthesized} = require('eslint-utils');
2
+ const {isParenthesized} = require('@eslint-community/eslint-utils');
3
3
  const avoidCapture = require('./utils/avoid-capture.js');
4
4
  const needsSemicolon = require('./utils/needs-semicolon.js');
5
5
  const isSameReference = require('./utils/is-same-reference.js');
@@ -1,5 +1,5 @@
1
1
  'use strict';
2
- const {findVariable, getFunctionHeadLocation} = require('eslint-utils');
2
+ const {findVariable, getFunctionHeadLocation} = require('@eslint-community/eslint-utils');
3
3
  const {matches, not, memberExpressionSelector} = require('./selectors/index.js');
4
4
 
5
5
  const ERROR_PROMISE = 'promise';
@@ -1,5 +1,5 @@
1
1
  'use strict';
2
- const {getStaticValue} = require('eslint-utils');
2
+ const {getStaticValue} = require('@eslint-community/eslint-utils');
3
3
  const {newExpressionSelector} = require('./selectors/index.js');
4
4
  const {replaceStringLiteral} = require('./fix/index.js');
5
5
 
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const {hasSideEffect, isParenthesized, findVariable} = require('eslint-utils');
3
+ const {hasSideEffect, isParenthesized, findVariable} = require('@eslint-community/eslint-utils');
4
4
  const {matches, methodCallSelector} = require('../selectors/index.js');
5
5
  const isFunctionSelfUsedInside = require('../utils/is-function-self-used-inside.js');
6
6
 
@@ -1,5 +1,5 @@
1
1
  'use strict';
2
- const {isColonToken} = require('eslint-utils');
2
+ const {isColonToken} = require('@eslint-community/eslint-utils');
3
3
  const getSwitchCaseHeadLocation = require('./utils/get-switch-case-head-location.js');
4
4
  const getIndentString = require('./utils/get-indent-string.js');
5
5
  const {replaceNodeOrTokenAndSpacesBefore} = require('./fix/index.js');
@@ -1,5 +1,5 @@
1
1
  'use strict';
2
- const {isOpeningParenToken} = require('eslint-utils');
2
+ const {isOpeningParenToken} = require('@eslint-community/eslint-utils');
3
3
 
4
4
  /**
5
5
  Get the text of the arguments list of `CallExpression`.
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const {isColonToken} = require('eslint-utils');
3
+ const {isColonToken} = require('@eslint-community/eslint-utils');
4
4
 
5
5
  /**
6
6
  @typedef {line: number, column: number} Position
@@ -1,5 +1,5 @@
1
1
  'use strict';
2
- const {ReferenceTracker} = require('eslint-utils');
2
+ const {ReferenceTracker} = require('@eslint-community/eslint-utils');
3
3
 
4
4
  const createTraceMap = (object, type) => {
5
5
  let map = {[type]: true};
@@ -1,5 +1,5 @@
1
1
  'use strict';
2
- const {findVariable} = require('eslint-utils');
2
+ const {findVariable} = require('@eslint-community/eslint-utils');
3
3
 
4
4
  const getReferences = (scope, nodeOrName) => {
5
5
  const {references = []} = findVariable(scope, nodeOrName) || {};
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const {isOpeningParenToken, isClosingParenToken} = require('eslint-utils');
3
+ const {isOpeningParenToken, isClosingParenToken} = require('@eslint-community/eslint-utils');
4
4
 
5
5
  /**
6
6
  Determine if a constructor function is newed-up with parens.
@@ -1,5 +1,5 @@
1
1
  'use strict';
2
- const {getStaticValue} = require('eslint-utils');
2
+ const {getStaticValue} = require('@eslint-community/eslint-utils');
3
3
  const {isNumberLiteral} = require('../ast/index.js');
4
4
 
5
5
  const isStaticProperties = (node, object, properties) =>
@@ -1,5 +1,5 @@
1
1
  'use strict';
2
- const {getStaticValue} = require('eslint-utils');
2
+ const {getStaticValue} = require('@eslint-community/eslint-utils');
3
3
 
4
4
  // Copied from https://github.com/eslint/eslint/blob/94ba68d76a6940f68ff82eea7332c6505f93df76/lib/rules/utils/ast-utils.js#L392
5
5
 
@@ -1,5 +1,5 @@
1
1
  'use strict';
2
- const {isParenthesized, isOpeningParenToken, isClosingParenToken} = require('eslint-utils');
2
+ const {isParenthesized, isOpeningParenToken, isClosingParenToken} = require('@eslint-community/eslint-utils');
3
3
 
4
4
  /*
5
5
  Get how many times the node is parenthesized.