@zayne-labs/eslint-config 0.10.2 → 0.10.3

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.
@@ -1 +1 @@
1
- {"version":3,"file":"src-DwSufEpw.js","names":["evk","variable","variable","ref","ref","ref","noEmptyEffect","noAdjustStateOnPropChange","noResetAllStateOnPropChange","noEventHandler","noPassLiveStateToParent","noPassDataToParent","noManageParent","noInitializeState","noChainStateUpdates","noDerivedState"],"sources":["../../../node_modules/.pnpm/eslint-visitor-keys@2.1.0/node_modules/eslint-visitor-keys/lib/visitor-keys.json","../../../node_modules/.pnpm/eslint-visitor-keys@2.1.0/node_modules/eslint-visitor-keys/lib/index.js","../../../node_modules/.pnpm/eslint-utils@3.0.0_eslint@9.36.0_jiti@2.5.1_/node_modules/eslint-utils/index.mjs","../../../node_modules/.pnpm/eslint-plugin-react-you-might-not-need-an-effect@0.5.3_eslint@9.36.0_jiti@2.5.1_/node_modules/eslint-plugin-react-you-might-not-need-an-effect/src/util/ast.js","../../../node_modules/.pnpm/eslint-plugin-react-you-might-not-need-an-effect@0.5.3_eslint@9.36.0_jiti@2.5.1_/node_modules/eslint-plugin-react-you-might-not-need-an-effect/src/util/react.js","../../../node_modules/.pnpm/eslint-plugin-react-you-might-not-need-an-effect@0.5.3_eslint@9.36.0_jiti@2.5.1_/node_modules/eslint-plugin-react-you-might-not-need-an-effect/src/no-empty-effect.js","../../../node_modules/.pnpm/eslint-plugin-react-you-might-not-need-an-effect@0.5.3_eslint@9.36.0_jiti@2.5.1_/node_modules/eslint-plugin-react-you-might-not-need-an-effect/src/no-adjust-state-on-prop-change.js","../../../node_modules/.pnpm/eslint-plugin-react-you-might-not-need-an-effect@0.5.3_eslint@9.36.0_jiti@2.5.1_/node_modules/eslint-plugin-react-you-might-not-need-an-effect/src/no-reset-all-state-on-prop-change.js","../../../node_modules/.pnpm/eslint-plugin-react-you-might-not-need-an-effect@0.5.3_eslint@9.36.0_jiti@2.5.1_/node_modules/eslint-plugin-react-you-might-not-need-an-effect/src/no-event-handler.js","../../../node_modules/.pnpm/eslint-plugin-react-you-might-not-need-an-effect@0.5.3_eslint@9.36.0_jiti@2.5.1_/node_modules/eslint-plugin-react-you-might-not-need-an-effect/src/no-pass-live-state-to-parent.js","../../../node_modules/.pnpm/eslint-plugin-react-you-might-not-need-an-effect@0.5.3_eslint@9.36.0_jiti@2.5.1_/node_modules/eslint-plugin-react-you-might-not-need-an-effect/src/no-initialize-state.js","../../../node_modules/.pnpm/eslint-plugin-react-you-might-not-need-an-effect@0.5.3_eslint@9.36.0_jiti@2.5.1_/node_modules/eslint-plugin-react-you-might-not-need-an-effect/src/no-chain-state-updates.js","../../../node_modules/.pnpm/eslint-plugin-react-you-might-not-need-an-effect@0.5.3_eslint@9.36.0_jiti@2.5.1_/node_modules/eslint-plugin-react-you-might-not-need-an-effect/src/no-derived-state.js","../../../node_modules/.pnpm/eslint-plugin-react-you-might-not-need-an-effect@0.5.3_eslint@9.36.0_jiti@2.5.1_/node_modules/eslint-plugin-react-you-might-not-need-an-effect/src/no-pass-data-to-parent.js","../../../node_modules/.pnpm/eslint-plugin-react-you-might-not-need-an-effect@0.5.3_eslint@9.36.0_jiti@2.5.1_/node_modules/eslint-plugin-react-you-might-not-need-an-effect/src/no-manage-parent.js","../../../node_modules/.pnpm/eslint-plugin-react-you-might-not-need-an-effect@0.5.3_eslint@9.36.0_jiti@2.5.1_/node_modules/eslint-plugin-react-you-might-not-need-an-effect/src/util/javascript.js","../../../node_modules/.pnpm/eslint-plugin-react-you-might-not-need-an-effect@0.5.3_eslint@9.36.0_jiti@2.5.1_/node_modules/eslint-plugin-react-you-might-not-need-an-effect/src/index.js"],"sourcesContent":["{\n \"AssignmentExpression\": [\n \"left\",\n \"right\"\n ],\n \"AssignmentPattern\": [\n \"left\",\n \"right\"\n ],\n \"ArrayExpression\": [\n \"elements\"\n ],\n \"ArrayPattern\": [\n \"elements\"\n ],\n \"ArrowFunctionExpression\": [\n \"params\",\n \"body\"\n ],\n \"AwaitExpression\": [\n \"argument\"\n ],\n \"BlockStatement\": [\n \"body\"\n ],\n \"BinaryExpression\": [\n \"left\",\n \"right\"\n ],\n \"BreakStatement\": [\n \"label\"\n ],\n \"CallExpression\": [\n \"callee\",\n \"arguments\"\n ],\n \"CatchClause\": [\n \"param\",\n \"body\"\n ],\n \"ChainExpression\": [\n \"expression\"\n ],\n \"ClassBody\": [\n \"body\"\n ],\n \"ClassDeclaration\": [\n \"id\",\n \"superClass\",\n \"body\"\n ],\n \"ClassExpression\": [\n \"id\",\n \"superClass\",\n \"body\"\n ],\n \"ConditionalExpression\": [\n \"test\",\n \"consequent\",\n \"alternate\"\n ],\n \"ContinueStatement\": [\n \"label\"\n ],\n \"DebuggerStatement\": [],\n \"DoWhileStatement\": [\n \"body\",\n \"test\"\n ],\n \"EmptyStatement\": [],\n \"ExportAllDeclaration\": [\n \"exported\",\n \"source\"\n ],\n \"ExportDefaultDeclaration\": [\n \"declaration\"\n ],\n \"ExportNamedDeclaration\": [\n \"declaration\",\n \"specifiers\",\n \"source\"\n ],\n \"ExportSpecifier\": [\n \"exported\",\n \"local\"\n ],\n \"ExpressionStatement\": [\n \"expression\"\n ],\n \"ExperimentalRestProperty\": [\n \"argument\"\n ],\n \"ExperimentalSpreadProperty\": [\n \"argument\"\n ],\n \"ForStatement\": [\n \"init\",\n \"test\",\n \"update\",\n \"body\"\n ],\n \"ForInStatement\": [\n \"left\",\n \"right\",\n \"body\"\n ],\n \"ForOfStatement\": [\n \"left\",\n \"right\",\n \"body\"\n ],\n \"FunctionDeclaration\": [\n \"id\",\n \"params\",\n \"body\"\n ],\n \"FunctionExpression\": [\n \"id\",\n \"params\",\n \"body\"\n ],\n \"Identifier\": [],\n \"IfStatement\": [\n \"test\",\n \"consequent\",\n \"alternate\"\n ],\n \"ImportDeclaration\": [\n \"specifiers\",\n \"source\"\n ],\n \"ImportDefaultSpecifier\": [\n \"local\"\n ],\n \"ImportExpression\": [\n \"source\"\n ],\n \"ImportNamespaceSpecifier\": [\n \"local\"\n ],\n \"ImportSpecifier\": [\n \"imported\",\n \"local\"\n ],\n \"JSXAttribute\": [\n \"name\",\n \"value\"\n ],\n \"JSXClosingElement\": [\n \"name\"\n ],\n \"JSXElement\": [\n \"openingElement\",\n \"children\",\n \"closingElement\"\n ],\n \"JSXEmptyExpression\": [],\n \"JSXExpressionContainer\": [\n \"expression\"\n ],\n \"JSXIdentifier\": [],\n \"JSXMemberExpression\": [\n \"object\",\n \"property\"\n ],\n \"JSXNamespacedName\": [\n \"namespace\",\n \"name\"\n ],\n \"JSXOpeningElement\": [\n \"name\",\n \"attributes\"\n ],\n \"JSXSpreadAttribute\": [\n \"argument\"\n ],\n \"JSXText\": [],\n \"JSXFragment\": [\n \"openingFragment\",\n \"children\",\n \"closingFragment\"\n ],\n \"Literal\": [],\n \"LabeledStatement\": [\n \"label\",\n \"body\"\n ],\n \"LogicalExpression\": [\n \"left\",\n \"right\"\n ],\n \"MemberExpression\": [\n \"object\",\n \"property\"\n ],\n \"MetaProperty\": [\n \"meta\",\n \"property\"\n ],\n \"MethodDefinition\": [\n \"key\",\n \"value\"\n ],\n \"NewExpression\": [\n \"callee\",\n \"arguments\"\n ],\n \"ObjectExpression\": [\n \"properties\"\n ],\n \"ObjectPattern\": [\n \"properties\"\n ],\n \"PrivateIdentifier\": [],\n \"Program\": [\n \"body\"\n ],\n \"Property\": [\n \"key\",\n \"value\"\n ],\n \"PropertyDefinition\": [\n \"key\",\n \"value\"\n ],\n \"RestElement\": [\n \"argument\"\n ],\n \"ReturnStatement\": [\n \"argument\"\n ],\n \"SequenceExpression\": [\n \"expressions\"\n ],\n \"SpreadElement\": [\n \"argument\"\n ],\n \"Super\": [],\n \"SwitchStatement\": [\n \"discriminant\",\n \"cases\"\n ],\n \"SwitchCase\": [\n \"test\",\n \"consequent\"\n ],\n \"TaggedTemplateExpression\": [\n \"tag\",\n \"quasi\"\n ],\n \"TemplateElement\": [],\n \"TemplateLiteral\": [\n \"quasis\",\n \"expressions\"\n ],\n \"ThisExpression\": [],\n \"ThrowStatement\": [\n \"argument\"\n ],\n \"TryStatement\": [\n \"block\",\n \"handler\",\n \"finalizer\"\n ],\n \"UnaryExpression\": [\n \"argument\"\n ],\n \"UpdateExpression\": [\n \"argument\"\n ],\n \"VariableDeclaration\": [\n \"declarations\"\n ],\n \"VariableDeclarator\": [\n \"id\",\n \"init\"\n ],\n \"WhileStatement\": [\n \"test\",\n \"body\"\n ],\n \"WithStatement\": [\n \"object\",\n \"body\"\n ],\n \"YieldExpression\": [\n \"argument\"\n ]\n}\n","/**\n * @author Toru Nagashima <https://github.com/mysticatea>\n * See LICENSE file in root directory for full license.\n */\n\"use strict\";\n\nconst KEYS = require(\"./visitor-keys.json\");\n\n// Types.\nconst NODE_TYPES = Object.freeze(Object.keys(KEYS));\n\n// Freeze the keys.\nfor (const type of NODE_TYPES) {\n Object.freeze(KEYS[type]);\n}\nObject.freeze(KEYS);\n\n// List to ignore keys.\nconst KEY_BLACKLIST = new Set([\n \"parent\",\n \"leadingComments\",\n \"trailingComments\"\n]);\n\n/**\n * Check whether a given key should be used or not.\n * @param {string} key The key to check.\n * @returns {boolean} `true` if the key should be used.\n */\nfunction filterKey(key) {\n return !KEY_BLACKLIST.has(key) && key[0] !== \"_\";\n}\n\n//------------------------------------------------------------------------------\n// Public interfaces\n//------------------------------------------------------------------------------\n\nmodule.exports = Object.freeze({\n\n /**\n * Visitor keys.\n * @type {{ [type: string]: string[] | undefined }}\n */\n KEYS,\n\n /**\n * Get visitor keys of a given node.\n * @param {Object} node The AST node to get keys.\n * @returns {string[]} Visitor keys of the node.\n */\n getKeys(node) {\n return Object.keys(node).filter(filterKey);\n },\n\n // Disable valid-jsdoc rule because it reports syntax error on the type of @returns.\n // eslint-disable-next-line valid-jsdoc\n /**\n * Make the union set with `KEYS` and given keys.\n * @param {Object} additionalKeys The additional keys.\n * @returns {{ [type: string]: string[] | undefined }} The union set.\n */\n unionWith(additionalKeys) {\n const retv = Object.assign({}, KEYS);\n\n for (const type of Object.keys(additionalKeys)) {\n if (retv.hasOwnProperty(type)) {\n const keys = new Set(additionalKeys[type]);\n\n for (const key of retv[type]) {\n keys.add(key);\n }\n\n retv[type] = Object.freeze(Array.from(keys));\n } else {\n retv[type] = Object.freeze(Array.from(additionalKeys[type]));\n }\n }\n\n return Object.freeze(retv);\n }\n});\n","/*! @author Toru Nagashima <https://github.com/mysticatea> */\nimport evk from 'eslint-visitor-keys';\n\n/**\n * Get the innermost scope which contains a given location.\n * @param {Scope} initialScope The initial scope to search.\n * @param {Node} node The location to search.\n * @returns {Scope} The innermost scope.\n */\nfunction getInnermostScope(initialScope, node) {\n const location = node.range[0];\n\n let scope = initialScope;\n let found = false;\n do {\n found = false;\n for (const childScope of scope.childScopes) {\n const range = childScope.block.range;\n\n if (range[0] <= location && location < range[1]) {\n scope = childScope;\n found = true;\n break\n }\n }\n } while (found)\n\n return scope\n}\n\n/**\n * Find the variable of a given name.\n * @param {Scope} initialScope The scope to start finding.\n * @param {string|Node} nameOrNode The variable name to find. If this is a Node object then it should be an Identifier node.\n * @returns {Variable|null} The found variable or null.\n */\nfunction findVariable(initialScope, nameOrNode) {\n let name = \"\";\n let scope = initialScope;\n\n if (typeof nameOrNode === \"string\") {\n name = nameOrNode;\n } else {\n name = nameOrNode.name;\n scope = getInnermostScope(scope, nameOrNode);\n }\n\n while (scope != null) {\n const variable = scope.set.get(name);\n if (variable != null) {\n return variable\n }\n scope = scope.upper;\n }\n\n return null\n}\n\n/**\n * Negate the result of `this` calling.\n * @param {Token} token The token to check.\n * @returns {boolean} `true` if the result of `this(token)` is `false`.\n */\nfunction negate0(token) {\n return !this(token) //eslint-disable-line no-invalid-this\n}\n\n/**\n * Creates the negate function of the given function.\n * @param {function(Token):boolean} f - The function to negate.\n * @returns {function(Token):boolean} Negated function.\n */\nfunction negate(f) {\n return negate0.bind(f)\n}\n\n/**\n * Checks if the given token is a PunctuatorToken with the given value\n * @param {Token} token - The token to check.\n * @param {string} value - The value to check.\n * @returns {boolean} `true` if the token is a PunctuatorToken with the given value.\n */\nfunction isPunctuatorTokenWithValue(token, value) {\n return token.type === \"Punctuator\" && token.value === value\n}\n\n/**\n * Checks if the given token is an arrow token or not.\n * @param {Token} token - The token to check.\n * @returns {boolean} `true` if the token is an arrow token.\n */\nfunction isArrowToken(token) {\n return isPunctuatorTokenWithValue(token, \"=>\")\n}\n\n/**\n * Checks if the given token is a comma token or not.\n * @param {Token} token - The token to check.\n * @returns {boolean} `true` if the token is a comma token.\n */\nfunction isCommaToken(token) {\n return isPunctuatorTokenWithValue(token, \",\")\n}\n\n/**\n * Checks if the given token is a semicolon token or not.\n * @param {Token} token - The token to check.\n * @returns {boolean} `true` if the token is a semicolon token.\n */\nfunction isSemicolonToken(token) {\n return isPunctuatorTokenWithValue(token, \";\")\n}\n\n/**\n * Checks if the given token is a colon token or not.\n * @param {Token} token - The token to check.\n * @returns {boolean} `true` if the token is a colon token.\n */\nfunction isColonToken(token) {\n return isPunctuatorTokenWithValue(token, \":\")\n}\n\n/**\n * Checks if the given token is an opening parenthesis token or not.\n * @param {Token} token - The token to check.\n * @returns {boolean} `true` if the token is an opening parenthesis token.\n */\nfunction isOpeningParenToken(token) {\n return isPunctuatorTokenWithValue(token, \"(\")\n}\n\n/**\n * Checks if the given token is a closing parenthesis token or not.\n * @param {Token} token - The token to check.\n * @returns {boolean} `true` if the token is a closing parenthesis token.\n */\nfunction isClosingParenToken(token) {\n return isPunctuatorTokenWithValue(token, \")\")\n}\n\n/**\n * Checks if the given token is an opening square bracket token or not.\n * @param {Token} token - The token to check.\n * @returns {boolean} `true` if the token is an opening square bracket token.\n */\nfunction isOpeningBracketToken(token) {\n return isPunctuatorTokenWithValue(token, \"[\")\n}\n\n/**\n * Checks if the given token is a closing square bracket token or not.\n * @param {Token} token - The token to check.\n * @returns {boolean} `true` if the token is a closing square bracket token.\n */\nfunction isClosingBracketToken(token) {\n return isPunctuatorTokenWithValue(token, \"]\")\n}\n\n/**\n * Checks if the given token is an opening brace token or not.\n * @param {Token} token - The token to check.\n * @returns {boolean} `true` if the token is an opening brace token.\n */\nfunction isOpeningBraceToken(token) {\n return isPunctuatorTokenWithValue(token, \"{\")\n}\n\n/**\n * Checks if the given token is a closing brace token or not.\n * @param {Token} token - The token to check.\n * @returns {boolean} `true` if the token is a closing brace token.\n */\nfunction isClosingBraceToken(token) {\n return isPunctuatorTokenWithValue(token, \"}\")\n}\n\n/**\n * Checks if the given token is a comment token or not.\n * @param {Token} token - The token to check.\n * @returns {boolean} `true` if the token is a comment token.\n */\nfunction isCommentToken(token) {\n return [\"Block\", \"Line\", \"Shebang\"].includes(token.type)\n}\n\nconst isNotArrowToken = negate(isArrowToken);\nconst isNotCommaToken = negate(isCommaToken);\nconst isNotSemicolonToken = negate(isSemicolonToken);\nconst isNotColonToken = negate(isColonToken);\nconst isNotOpeningParenToken = negate(isOpeningParenToken);\nconst isNotClosingParenToken = negate(isClosingParenToken);\nconst isNotOpeningBracketToken = negate(isOpeningBracketToken);\nconst isNotClosingBracketToken = negate(isClosingBracketToken);\nconst isNotOpeningBraceToken = negate(isOpeningBraceToken);\nconst isNotClosingBraceToken = negate(isClosingBraceToken);\nconst isNotCommentToken = negate(isCommentToken);\n\n/**\n * Get the `(` token of the given function node.\n * @param {Node} node - The function node to get.\n * @param {SourceCode} sourceCode - The source code object to get tokens.\n * @returns {Token} `(` token.\n */\nfunction getOpeningParenOfParams(node, sourceCode) {\n return node.id\n ? sourceCode.getTokenAfter(node.id, isOpeningParenToken)\n : sourceCode.getFirstToken(node, isOpeningParenToken)\n}\n\n/**\n * Get the location of the given function node for reporting.\n * @param {Node} node - The function node to get.\n * @param {SourceCode} sourceCode - The source code object to get tokens.\n * @returns {string} The location of the function node for reporting.\n */\nfunction getFunctionHeadLocation(node, sourceCode) {\n const parent = node.parent;\n let start = null;\n let end = null;\n\n if (node.type === \"ArrowFunctionExpression\") {\n const arrowToken = sourceCode.getTokenBefore(node.body, isArrowToken);\n\n start = arrowToken.loc.start;\n end = arrowToken.loc.end;\n } else if (\n parent.type === \"Property\" ||\n parent.type === \"MethodDefinition\" ||\n parent.type === \"PropertyDefinition\"\n ) {\n start = parent.loc.start;\n end = getOpeningParenOfParams(node, sourceCode).loc.start;\n } else {\n start = node.loc.start;\n end = getOpeningParenOfParams(node, sourceCode).loc.start;\n }\n\n return {\n start: { ...start },\n end: { ...end },\n }\n}\n\n/* globals globalThis, global, self, window */\n\nconst globalObject =\n typeof globalThis !== \"undefined\"\n ? globalThis\n : typeof self !== \"undefined\"\n ? self\n : typeof window !== \"undefined\"\n ? window\n : typeof global !== \"undefined\"\n ? global\n : {};\n\nconst builtinNames = Object.freeze(\n new Set([\n \"Array\",\n \"ArrayBuffer\",\n \"BigInt\",\n \"BigInt64Array\",\n \"BigUint64Array\",\n \"Boolean\",\n \"DataView\",\n \"Date\",\n \"decodeURI\",\n \"decodeURIComponent\",\n \"encodeURI\",\n \"encodeURIComponent\",\n \"escape\",\n \"Float32Array\",\n \"Float64Array\",\n \"Function\",\n \"Infinity\",\n \"Int16Array\",\n \"Int32Array\",\n \"Int8Array\",\n \"isFinite\",\n \"isNaN\",\n \"isPrototypeOf\",\n \"JSON\",\n \"Map\",\n \"Math\",\n \"NaN\",\n \"Number\",\n \"Object\",\n \"parseFloat\",\n \"parseInt\",\n \"Promise\",\n \"Proxy\",\n \"Reflect\",\n \"RegExp\",\n \"Set\",\n \"String\",\n \"Symbol\",\n \"Uint16Array\",\n \"Uint32Array\",\n \"Uint8Array\",\n \"Uint8ClampedArray\",\n \"undefined\",\n \"unescape\",\n \"WeakMap\",\n \"WeakSet\",\n ]),\n);\nconst callAllowed = new Set(\n [\n Array.isArray,\n typeof BigInt === \"function\" ? BigInt : undefined,\n Boolean,\n Date,\n Date.parse,\n decodeURI,\n decodeURIComponent,\n encodeURI,\n encodeURIComponent,\n escape,\n isFinite,\n isNaN,\n isPrototypeOf,\n ...Object.getOwnPropertyNames(Math)\n .map((k) => Math[k])\n .filter((f) => typeof f === \"function\"),\n Number,\n Number.isFinite,\n Number.isNaN,\n Number.parseFloat,\n Number.parseInt,\n Object,\n Object.entries,\n Object.is,\n Object.isExtensible,\n Object.isFrozen,\n Object.isSealed,\n Object.keys,\n Object.values,\n parseFloat,\n parseInt,\n RegExp,\n String,\n String.fromCharCode,\n String.fromCodePoint,\n String.raw,\n Symbol.for,\n Symbol.keyFor,\n unescape,\n ].filter((f) => typeof f === \"function\"),\n);\nconst callPassThrough = new Set([\n Object.freeze,\n Object.preventExtensions,\n Object.seal,\n]);\n\n/**\n * Get the property descriptor.\n * @param {object} object The object to get.\n * @param {string|number|symbol} name The property name to get.\n */\nfunction getPropertyDescriptor(object, name) {\n let x = object;\n while ((typeof x === \"object\" || typeof x === \"function\") && x !== null) {\n const d = Object.getOwnPropertyDescriptor(x, name);\n if (d) {\n return d\n }\n x = Object.getPrototypeOf(x);\n }\n return null\n}\n\n/**\n * Check if a property is getter or not.\n * @param {object} object The object to check.\n * @param {string|number|symbol} name The property name to check.\n */\nfunction isGetter(object, name) {\n const d = getPropertyDescriptor(object, name);\n return d != null && d.get != null\n}\n\n/**\n * Get the element values of a given node list.\n * @param {Node[]} nodeList The node list to get values.\n * @param {Scope|undefined} initialScope The initial scope to find variables.\n * @returns {any[]|null} The value list if all nodes are constant. Otherwise, null.\n */\nfunction getElementValues(nodeList, initialScope) {\n const valueList = [];\n\n for (let i = 0; i < nodeList.length; ++i) {\n const elementNode = nodeList[i];\n\n if (elementNode == null) {\n valueList.length = i + 1;\n } else if (elementNode.type === \"SpreadElement\") {\n const argument = getStaticValueR(elementNode.argument, initialScope);\n if (argument == null) {\n return null\n }\n valueList.push(...argument.value);\n } else {\n const element = getStaticValueR(elementNode, initialScope);\n if (element == null) {\n return null\n }\n valueList.push(element.value);\n }\n }\n\n return valueList\n}\n\nconst operations = Object.freeze({\n ArrayExpression(node, initialScope) {\n const elements = getElementValues(node.elements, initialScope);\n return elements != null ? { value: elements } : null\n },\n\n AssignmentExpression(node, initialScope) {\n if (node.operator === \"=\") {\n return getStaticValueR(node.right, initialScope)\n }\n return null\n },\n\n //eslint-disable-next-line complexity\n BinaryExpression(node, initialScope) {\n if (node.operator === \"in\" || node.operator === \"instanceof\") {\n // Not supported.\n return null\n }\n\n const left = getStaticValueR(node.left, initialScope);\n const right = getStaticValueR(node.right, initialScope);\n if (left != null && right != null) {\n switch (node.operator) {\n case \"==\":\n return { value: left.value == right.value } //eslint-disable-line eqeqeq\n case \"!=\":\n return { value: left.value != right.value } //eslint-disable-line eqeqeq\n case \"===\":\n return { value: left.value === right.value }\n case \"!==\":\n return { value: left.value !== right.value }\n case \"<\":\n return { value: left.value < right.value }\n case \"<=\":\n return { value: left.value <= right.value }\n case \">\":\n return { value: left.value > right.value }\n case \">=\":\n return { value: left.value >= right.value }\n case \"<<\":\n return { value: left.value << right.value }\n case \">>\":\n return { value: left.value >> right.value }\n case \">>>\":\n return { value: left.value >>> right.value }\n case \"+\":\n return { value: left.value + right.value }\n case \"-\":\n return { value: left.value - right.value }\n case \"*\":\n return { value: left.value * right.value }\n case \"/\":\n return { value: left.value / right.value }\n case \"%\":\n return { value: left.value % right.value }\n case \"**\":\n return { value: Math.pow(left.value, right.value) }\n case \"|\":\n return { value: left.value | right.value }\n case \"^\":\n return { value: left.value ^ right.value }\n case \"&\":\n return { value: left.value & right.value }\n\n // no default\n }\n }\n\n return null\n },\n\n CallExpression(node, initialScope) {\n const calleeNode = node.callee;\n const args = getElementValues(node.arguments, initialScope);\n\n if (args != null) {\n if (calleeNode.type === \"MemberExpression\") {\n if (calleeNode.property.type === \"PrivateIdentifier\") {\n return null\n }\n const object = getStaticValueR(calleeNode.object, initialScope);\n if (object != null) {\n if (\n object.value == null &&\n (object.optional || node.optional)\n ) {\n return { value: undefined, optional: true }\n }\n const property = getStaticPropertyNameValue(\n calleeNode,\n initialScope,\n );\n\n if (property != null) {\n const receiver = object.value;\n const methodName = property.value;\n if (callAllowed.has(receiver[methodName])) {\n return { value: receiver[methodName](...args) }\n }\n if (callPassThrough.has(receiver[methodName])) {\n return { value: args[0] }\n }\n }\n }\n } else {\n const callee = getStaticValueR(calleeNode, initialScope);\n if (callee != null) {\n if (callee.value == null && node.optional) {\n return { value: undefined, optional: true }\n }\n const func = callee.value;\n if (callAllowed.has(func)) {\n return { value: func(...args) }\n }\n if (callPassThrough.has(func)) {\n return { value: args[0] }\n }\n }\n }\n }\n\n return null\n },\n\n ConditionalExpression(node, initialScope) {\n const test = getStaticValueR(node.test, initialScope);\n if (test != null) {\n return test.value\n ? getStaticValueR(node.consequent, initialScope)\n : getStaticValueR(node.alternate, initialScope)\n }\n return null\n },\n\n ExpressionStatement(node, initialScope) {\n return getStaticValueR(node.expression, initialScope)\n },\n\n Identifier(node, initialScope) {\n if (initialScope != null) {\n const variable = findVariable(initialScope, node);\n\n // Built-in globals.\n if (\n variable != null &&\n variable.defs.length === 0 &&\n builtinNames.has(variable.name) &&\n variable.name in globalObject\n ) {\n return { value: globalObject[variable.name] }\n }\n\n // Constants.\n if (variable != null && variable.defs.length === 1) {\n const def = variable.defs[0];\n if (\n def.parent &&\n def.parent.kind === \"const\" &&\n // TODO(mysticatea): don't support destructuring here.\n def.node.id.type === \"Identifier\"\n ) {\n return getStaticValueR(def.node.init, initialScope)\n }\n }\n }\n return null\n },\n\n Literal(node) {\n //istanbul ignore if : this is implementation-specific behavior.\n if ((node.regex != null || node.bigint != null) && node.value == null) {\n // It was a RegExp/BigInt literal, but Node.js didn't support it.\n return null\n }\n return { value: node.value }\n },\n\n LogicalExpression(node, initialScope) {\n const left = getStaticValueR(node.left, initialScope);\n if (left != null) {\n if (\n (node.operator === \"||\" && Boolean(left.value) === true) ||\n (node.operator === \"&&\" && Boolean(left.value) === false) ||\n (node.operator === \"??\" && left.value != null)\n ) {\n return left\n }\n\n const right = getStaticValueR(node.right, initialScope);\n if (right != null) {\n return right\n }\n }\n\n return null\n },\n\n MemberExpression(node, initialScope) {\n if (node.property.type === \"PrivateIdentifier\") {\n return null\n }\n const object = getStaticValueR(node.object, initialScope);\n if (object != null) {\n if (object.value == null && (object.optional || node.optional)) {\n return { value: undefined, optional: true }\n }\n const property = getStaticPropertyNameValue(node, initialScope);\n\n if (property != null && !isGetter(object.value, property.value)) {\n return { value: object.value[property.value] }\n }\n }\n return null\n },\n\n ChainExpression(node, initialScope) {\n const expression = getStaticValueR(node.expression, initialScope);\n if (expression != null) {\n return { value: expression.value }\n }\n return null\n },\n\n NewExpression(node, initialScope) {\n const callee = getStaticValueR(node.callee, initialScope);\n const args = getElementValues(node.arguments, initialScope);\n\n if (callee != null && args != null) {\n const Func = callee.value;\n if (callAllowed.has(Func)) {\n return { value: new Func(...args) }\n }\n }\n\n return null\n },\n\n ObjectExpression(node, initialScope) {\n const object = {};\n\n for (const propertyNode of node.properties) {\n if (propertyNode.type === \"Property\") {\n if (propertyNode.kind !== \"init\") {\n return null\n }\n const key = getStaticPropertyNameValue(\n propertyNode,\n initialScope,\n );\n const value = getStaticValueR(propertyNode.value, initialScope);\n if (key == null || value == null) {\n return null\n }\n object[key.value] = value.value;\n } else if (\n propertyNode.type === \"SpreadElement\" ||\n propertyNode.type === \"ExperimentalSpreadProperty\"\n ) {\n const argument = getStaticValueR(\n propertyNode.argument,\n initialScope,\n );\n if (argument == null) {\n return null\n }\n Object.assign(object, argument.value);\n } else {\n return null\n }\n }\n\n return { value: object }\n },\n\n SequenceExpression(node, initialScope) {\n const last = node.expressions[node.expressions.length - 1];\n return getStaticValueR(last, initialScope)\n },\n\n TaggedTemplateExpression(node, initialScope) {\n const tag = getStaticValueR(node.tag, initialScope);\n const expressions = getElementValues(\n node.quasi.expressions,\n initialScope,\n );\n\n if (tag != null && expressions != null) {\n const func = tag.value;\n const strings = node.quasi.quasis.map((q) => q.value.cooked);\n strings.raw = node.quasi.quasis.map((q) => q.value.raw);\n\n if (func === String.raw) {\n return { value: func(strings, ...expressions) }\n }\n }\n\n return null\n },\n\n TemplateLiteral(node, initialScope) {\n const expressions = getElementValues(node.expressions, initialScope);\n if (expressions != null) {\n let value = node.quasis[0].value.cooked;\n for (let i = 0; i < expressions.length; ++i) {\n value += expressions[i];\n value += node.quasis[i + 1].value.cooked;\n }\n return { value }\n }\n return null\n },\n\n UnaryExpression(node, initialScope) {\n if (node.operator === \"delete\") {\n // Not supported.\n return null\n }\n if (node.operator === \"void\") {\n return { value: undefined }\n }\n\n const arg = getStaticValueR(node.argument, initialScope);\n if (arg != null) {\n switch (node.operator) {\n case \"-\":\n return { value: -arg.value }\n case \"+\":\n return { value: +arg.value } //eslint-disable-line no-implicit-coercion\n case \"!\":\n return { value: !arg.value }\n case \"~\":\n return { value: ~arg.value }\n case \"typeof\":\n return { value: typeof arg.value }\n\n // no default\n }\n }\n\n return null\n },\n});\n\n/**\n * Get the value of a given node if it's a static value.\n * @param {Node} node The node to get.\n * @param {Scope|undefined} initialScope The scope to start finding variable.\n * @returns {{value:any}|{value:undefined,optional?:true}|null} The static value of the node, or `null`.\n */\nfunction getStaticValueR(node, initialScope) {\n if (node != null && Object.hasOwnProperty.call(operations, node.type)) {\n return operations[node.type](node, initialScope)\n }\n return null\n}\n\n/**\n * Get the static value of property name from a MemberExpression node or a Property node.\n * @param {Node} node The node to get.\n * @param {Scope} [initialScope] The scope to start finding variable. Optional. If the node is a computed property node and this scope was given, this checks the computed property name by the `getStringIfConstant` function with the scope, and returns the value of it.\n * @returns {{value:any}|{value:undefined,optional?:true}|null} The static value of the property name of the node, or `null`.\n */\nfunction getStaticPropertyNameValue(node, initialScope) {\n const nameNode = node.type === \"Property\" ? node.key : node.property;\n\n if (node.computed) {\n return getStaticValueR(nameNode, initialScope)\n }\n\n if (nameNode.type === \"Identifier\") {\n return { value: nameNode.name }\n }\n\n if (nameNode.type === \"Literal\") {\n if (nameNode.bigint) {\n return { value: nameNode.bigint }\n }\n return { value: String(nameNode.value) }\n }\n\n return null\n}\n\n/**\n * Get the value of a given node if it's a static value.\n * @param {Node} node The node to get.\n * @param {Scope} [initialScope] The scope to start finding variable. Optional. If this scope was given, this tries to resolve identifier references which are in the given node as much as possible.\n * @returns {{value:any}|{value:undefined,optional?:true}|null} The static value of the node, or `null`.\n */\nfunction getStaticValue(node, initialScope = null) {\n try {\n return getStaticValueR(node, initialScope)\n } catch (_error) {\n return null\n }\n}\n\n/**\n * Get the value of a given node if it's a literal or a template literal.\n * @param {Node} node The node to get.\n * @param {Scope} [initialScope] The scope to start finding variable. Optional. If the node is an Identifier node and this scope was given, this checks the variable of the identifier, and returns the value of it if the variable is a constant.\n * @returns {string|null} The value of the node, or `null`.\n */\nfunction getStringIfConstant(node, initialScope = null) {\n // Handle the literals that the platform doesn't support natively.\n if (node && node.type === \"Literal\" && node.value === null) {\n if (node.regex) {\n return `/${node.regex.pattern}/${node.regex.flags}`\n }\n if (node.bigint) {\n return node.bigint\n }\n }\n\n const evaluated = getStaticValue(node, initialScope);\n return evaluated && String(evaluated.value)\n}\n\n/**\n * Get the property name from a MemberExpression node or a Property node.\n * @param {Node} node The node to get.\n * @param {Scope} [initialScope] The scope to start finding variable. Optional. If the node is a computed property node and this scope was given, this checks the computed property name by the `getStringIfConstant` function with the scope, and returns the value of it.\n * @returns {string|null} The property name of the node.\n */\nfunction getPropertyName(node, initialScope) {\n switch (node.type) {\n case \"MemberExpression\":\n if (node.computed) {\n return getStringIfConstant(node.property, initialScope)\n }\n if (node.property.type === \"PrivateIdentifier\") {\n return null\n }\n return node.property.name\n\n case \"Property\":\n case \"MethodDefinition\":\n case \"PropertyDefinition\":\n if (node.computed) {\n return getStringIfConstant(node.key, initialScope)\n }\n if (node.key.type === \"Literal\") {\n return String(node.key.value)\n }\n if (node.key.type === \"PrivateIdentifier\") {\n return null\n }\n return node.key.name\n\n // no default\n }\n\n return null\n}\n\n/**\n * Get the name and kind of the given function node.\n * @param {ASTNode} node - The function node to get.\n * @param {SourceCode} [sourceCode] The source code object to get the code of computed property keys.\n * @returns {string} The name and kind of the function node.\n */\n// eslint-disable-next-line complexity\nfunction getFunctionNameWithKind(node, sourceCode) {\n const parent = node.parent;\n const tokens = [];\n const isObjectMethod = parent.type === \"Property\" && parent.value === node;\n const isClassMethod =\n parent.type === \"MethodDefinition\" && parent.value === node;\n const isClassFieldMethod =\n parent.type === \"PropertyDefinition\" && parent.value === node;\n\n // Modifiers.\n if (isClassMethod || isClassFieldMethod) {\n if (parent.static) {\n tokens.push(\"static\");\n }\n if (parent.key.type === \"PrivateIdentifier\") {\n tokens.push(\"private\");\n }\n }\n if (node.async) {\n tokens.push(\"async\");\n }\n if (node.generator) {\n tokens.push(\"generator\");\n }\n\n // Kinds.\n if (isObjectMethod || isClassMethod) {\n if (parent.kind === \"constructor\") {\n return \"constructor\"\n }\n if (parent.kind === \"get\") {\n tokens.push(\"getter\");\n } else if (parent.kind === \"set\") {\n tokens.push(\"setter\");\n } else {\n tokens.push(\"method\");\n }\n } else if (isClassFieldMethod) {\n tokens.push(\"method\");\n } else {\n if (node.type === \"ArrowFunctionExpression\") {\n tokens.push(\"arrow\");\n }\n tokens.push(\"function\");\n }\n\n // Names.\n if (isObjectMethod || isClassMethod || isClassFieldMethod) {\n if (parent.key.type === \"PrivateIdentifier\") {\n tokens.push(`#${parent.key.name}`);\n } else {\n const name = getPropertyName(parent);\n if (name) {\n tokens.push(`'${name}'`);\n } else if (sourceCode) {\n const keyText = sourceCode.getText(parent.key);\n if (!keyText.includes(\"\\n\")) {\n tokens.push(`[${keyText}]`);\n }\n }\n }\n } else if (node.id) {\n tokens.push(`'${node.id.name}'`);\n } else if (\n parent.type === \"VariableDeclarator\" &&\n parent.id &&\n parent.id.type === \"Identifier\"\n ) {\n tokens.push(`'${parent.id.name}'`);\n } else if (\n (parent.type === \"AssignmentExpression\" ||\n parent.type === \"AssignmentPattern\") &&\n parent.left &&\n parent.left.type === \"Identifier\"\n ) {\n tokens.push(`'${parent.left.name}'`);\n }\n\n return tokens.join(\" \")\n}\n\nconst typeConversionBinaryOps = Object.freeze(\n new Set([\n \"==\",\n \"!=\",\n \"<\",\n \"<=\",\n \">\",\n \">=\",\n \"<<\",\n \">>\",\n \">>>\",\n \"+\",\n \"-\",\n \"*\",\n \"/\",\n \"%\",\n \"|\",\n \"^\",\n \"&\",\n \"in\",\n ]),\n);\nconst typeConversionUnaryOps = Object.freeze(new Set([\"-\", \"+\", \"!\", \"~\"]));\n\n/**\n * Check whether the given value is an ASTNode or not.\n * @param {any} x The value to check.\n * @returns {boolean} `true` if the value is an ASTNode.\n */\nfunction isNode(x) {\n return x !== null && typeof x === \"object\" && typeof x.type === \"string\"\n}\n\nconst visitor = Object.freeze(\n Object.assign(Object.create(null), {\n $visit(node, options, visitorKeys) {\n const { type } = node;\n\n if (typeof this[type] === \"function\") {\n return this[type](node, options, visitorKeys)\n }\n\n return this.$visitChildren(node, options, visitorKeys)\n },\n\n $visitChildren(node, options, visitorKeys) {\n const { type } = node;\n\n for (const key of visitorKeys[type] || evk.getKeys(node)) {\n const value = node[key];\n\n if (Array.isArray(value)) {\n for (const element of value) {\n if (\n isNode(element) &&\n this.$visit(element, options, visitorKeys)\n ) {\n return true\n }\n }\n } else if (\n isNode(value) &&\n this.$visit(value, options, visitorKeys)\n ) {\n return true\n }\n }\n\n return false\n },\n\n ArrowFunctionExpression() {\n return false\n },\n AssignmentExpression() {\n return true\n },\n AwaitExpression() {\n return true\n },\n BinaryExpression(node, options, visitorKeys) {\n if (\n options.considerImplicitTypeConversion &&\n typeConversionBinaryOps.has(node.operator) &&\n (node.left.type !== \"Literal\" || node.right.type !== \"Literal\")\n ) {\n return true\n }\n return this.$visitChildren(node, options, visitorKeys)\n },\n CallExpression() {\n return true\n },\n FunctionExpression() {\n return false\n },\n ImportExpression() {\n return true\n },\n MemberExpression(node, options, visitorKeys) {\n if (options.considerGetters) {\n return true\n }\n if (\n options.considerImplicitTypeConversion &&\n node.computed &&\n node.property.type !== \"Literal\"\n ) {\n return true\n }\n return this.$visitChildren(node, options, visitorKeys)\n },\n MethodDefinition(node, options, visitorKeys) {\n if (\n options.considerImplicitTypeConversion &&\n node.computed &&\n node.key.type !== \"Literal\"\n ) {\n return true\n }\n return this.$visitChildren(node, options, visitorKeys)\n },\n NewExpression() {\n return true\n },\n Property(node, options, visitorKeys) {\n if (\n options.considerImplicitTypeConversion &&\n node.computed &&\n node.key.type !== \"Literal\"\n ) {\n return true\n }\n return this.$visitChildren(node, options, visitorKeys)\n },\n PropertyDefinition(node, options, visitorKeys) {\n if (\n options.considerImplicitTypeConversion &&\n node.computed &&\n node.key.type !== \"Literal\"\n ) {\n return true\n }\n return this.$visitChildren(node, options, visitorKeys)\n },\n UnaryExpression(node, options, visitorKeys) {\n if (node.operator === \"delete\") {\n return true\n }\n if (\n options.considerImplicitTypeConversion &&\n typeConversionUnaryOps.has(node.operator) &&\n node.argument.type !== \"Literal\"\n ) {\n return true\n }\n return this.$visitChildren(node, options, visitorKeys)\n },\n UpdateExpression() {\n return true\n },\n YieldExpression() {\n return true\n },\n }),\n);\n\n/**\n * Check whether a given node has any side effect or not.\n * @param {Node} node The node to get.\n * @param {SourceCode} sourceCode The source code object.\n * @param {object} [options] The option object.\n * @param {boolean} [options.considerGetters=false] If `true` then it considers member accesses as the node which has side effects.\n * @param {boolean} [options.considerImplicitTypeConversion=false] If `true` then it considers implicit type conversion as the node which has side effects.\n * @param {object} [options.visitorKeys=evk.KEYS] The keys to traverse nodes. Use `context.getSourceCode().visitorKeys`.\n * @returns {boolean} `true` if the node has a certain side effect.\n */\nfunction hasSideEffect(\n node,\n sourceCode,\n { considerGetters = false, considerImplicitTypeConversion = false } = {},\n) {\n return visitor.$visit(\n node,\n { considerGetters, considerImplicitTypeConversion },\n sourceCode.visitorKeys || evk.KEYS,\n )\n}\n\n/**\n * Get the left parenthesis of the parent node syntax if it exists.\n * E.g., `if (a) {}` then the `(`.\n * @param {Node} node The AST node to check.\n * @param {SourceCode} sourceCode The source code object to get tokens.\n * @returns {Token|null} The left parenthesis of the parent node syntax\n */\nfunction getParentSyntaxParen(node, sourceCode) {\n const parent = node.parent;\n\n switch (parent.type) {\n case \"CallExpression\":\n case \"NewExpression\":\n if (parent.arguments.length === 1 && parent.arguments[0] === node) {\n return sourceCode.getTokenAfter(\n parent.callee,\n isOpeningParenToken,\n )\n }\n return null\n\n case \"DoWhileStatement\":\n if (parent.test === node) {\n return sourceCode.getTokenAfter(\n parent.body,\n isOpeningParenToken,\n )\n }\n return null\n\n case \"IfStatement\":\n case \"WhileStatement\":\n if (parent.test === node) {\n return sourceCode.getFirstToken(parent, 1)\n }\n return null\n\n case \"ImportExpression\":\n if (parent.source === node) {\n return sourceCode.getFirstToken(parent, 1)\n }\n return null\n\n case \"SwitchStatement\":\n if (parent.discriminant === node) {\n return sourceCode.getFirstToken(parent, 1)\n }\n return null\n\n case \"WithStatement\":\n if (parent.object === node) {\n return sourceCode.getFirstToken(parent, 1)\n }\n return null\n\n default:\n return null\n }\n}\n\n/**\n * Check whether a given node is parenthesized or not.\n * @param {number} times The number of parantheses.\n * @param {Node} node The AST node to check.\n * @param {SourceCode} sourceCode The source code object to get tokens.\n * @returns {boolean} `true` if the node is parenthesized the given times.\n */\n/**\n * Check whether a given node is parenthesized or not.\n * @param {Node} node The AST node to check.\n * @param {SourceCode} sourceCode The source code object to get tokens.\n * @returns {boolean} `true` if the node is parenthesized.\n */\nfunction isParenthesized(\n timesOrNode,\n nodeOrSourceCode,\n optionalSourceCode,\n) {\n let times, node, sourceCode, maybeLeftParen, maybeRightParen;\n if (typeof timesOrNode === \"number\") {\n times = timesOrNode | 0;\n node = nodeOrSourceCode;\n sourceCode = optionalSourceCode;\n if (!(times >= 1)) {\n throw new TypeError(\"'times' should be a positive integer.\")\n }\n } else {\n times = 1;\n node = timesOrNode;\n sourceCode = nodeOrSourceCode;\n }\n\n if (\n node == null ||\n // `CatchClause.param` can't be parenthesized, example `try {} catch (error) {}`\n (node.parent.type === \"CatchClause\" && node.parent.param === node)\n ) {\n return false\n }\n\n maybeLeftParen = maybeRightParen = node;\n do {\n maybeLeftParen = sourceCode.getTokenBefore(maybeLeftParen);\n maybeRightParen = sourceCode.getTokenAfter(maybeRightParen);\n } while (\n maybeLeftParen != null &&\n maybeRightParen != null &&\n isOpeningParenToken(maybeLeftParen) &&\n isClosingParenToken(maybeRightParen) &&\n // Avoid false positive such as `if (a) {}`\n maybeLeftParen !== getParentSyntaxParen(node, sourceCode) &&\n --times > 0\n )\n\n return times === 0\n}\n\n/**\n * @author Toru Nagashima <https://github.com/mysticatea>\n * See LICENSE file in root directory for full license.\n */\n\nconst placeholder = /\\$(?:[$&`']|[1-9][0-9]?)/gu;\n\n/** @type {WeakMap<PatternMatcher, {pattern:RegExp,escaped:boolean}>} */\nconst internal = new WeakMap();\n\n/**\n * Check whether a given character is escaped or not.\n * @param {string} str The string to check.\n * @param {number} index The location of the character to check.\n * @returns {boolean} `true` if the character is escaped.\n */\nfunction isEscaped(str, index) {\n let escaped = false;\n for (let i = index - 1; i >= 0 && str.charCodeAt(i) === 0x5c; --i) {\n escaped = !escaped;\n }\n return escaped\n}\n\n/**\n * Replace a given string by a given matcher.\n * @param {PatternMatcher} matcher The pattern matcher.\n * @param {string} str The string to be replaced.\n * @param {string} replacement The new substring to replace each matched part.\n * @returns {string} The replaced string.\n */\nfunction replaceS(matcher, str, replacement) {\n const chunks = [];\n let index = 0;\n\n /** @type {RegExpExecArray} */\n let match = null;\n\n /**\n * @param {string} key The placeholder.\n * @returns {string} The replaced string.\n */\n function replacer(key) {\n switch (key) {\n case \"$$\":\n return \"$\"\n case \"$&\":\n return match[0]\n case \"$`\":\n return str.slice(0, match.index)\n case \"$'\":\n return str.slice(match.index + match[0].length)\n default: {\n const i = key.slice(1);\n if (i in match) {\n return match[i]\n }\n return key\n }\n }\n }\n\n for (match of matcher.execAll(str)) {\n chunks.push(str.slice(index, match.index));\n chunks.push(replacement.replace(placeholder, replacer));\n index = match.index + match[0].length;\n }\n chunks.push(str.slice(index));\n\n return chunks.join(\"\")\n}\n\n/**\n * Replace a given string by a given matcher.\n * @param {PatternMatcher} matcher The pattern matcher.\n * @param {string} str The string to be replaced.\n * @param {(...strs[])=>string} replace The function to replace each matched part.\n * @returns {string} The replaced string.\n */\nfunction replaceF(matcher, str, replace) {\n const chunks = [];\n let index = 0;\n\n for (const match of matcher.execAll(str)) {\n chunks.push(str.slice(index, match.index));\n chunks.push(String(replace(...match, match.index, match.input)));\n index = match.index + match[0].length;\n }\n chunks.push(str.slice(index));\n\n return chunks.join(\"\")\n}\n\n/**\n * The class to find patterns as considering escape sequences.\n */\nclass PatternMatcher {\n /**\n * Initialize this matcher.\n * @param {RegExp} pattern The pattern to match.\n * @param {{escaped:boolean}} options The options.\n */\n constructor(pattern, { escaped = false } = {}) {\n if (!(pattern instanceof RegExp)) {\n throw new TypeError(\"'pattern' should be a RegExp instance.\")\n }\n if (!pattern.flags.includes(\"g\")) {\n throw new Error(\"'pattern' should contains 'g' flag.\")\n }\n\n internal.set(this, {\n pattern: new RegExp(pattern.source, pattern.flags),\n escaped: Boolean(escaped),\n });\n }\n\n /**\n * Find the pattern in a given string.\n * @param {string} str The string to find.\n * @returns {IterableIterator<RegExpExecArray>} The iterator which iterate the matched information.\n */\n *execAll(str) {\n const { pattern, escaped } = internal.get(this);\n let match = null;\n let lastIndex = 0;\n\n pattern.lastIndex = 0;\n while ((match = pattern.exec(str)) != null) {\n if (escaped || !isEscaped(str, match.index)) {\n lastIndex = pattern.lastIndex;\n yield match;\n pattern.lastIndex = lastIndex;\n }\n }\n }\n\n /**\n * Check whether the pattern is found in a given string.\n * @param {string} str The string to check.\n * @returns {boolean} `true` if the pattern was found in the string.\n */\n test(str) {\n const it = this.execAll(str);\n const ret = it.next();\n return !ret.done\n }\n\n /**\n * Replace a given string.\n * @param {string} str The string to be replaced.\n * @param {(string|((...strs:string[])=>string))} replacer The string or function to replace. This is the same as the 2nd argument of `String.prototype.replace`.\n * @returns {string} The replaced string.\n */\n [Symbol.replace](str, replacer) {\n return typeof replacer === \"function\"\n ? replaceF(this, String(str), replacer)\n : replaceS(this, String(str), String(replacer))\n }\n}\n\nconst IMPORT_TYPE = /^(?:Import|Export(?:All|Default|Named))Declaration$/u;\nconst has = Function.call.bind(Object.hasOwnProperty);\n\nconst READ = Symbol(\"read\");\nconst CALL = Symbol(\"call\");\nconst CONSTRUCT = Symbol(\"construct\");\nconst ESM = Symbol(\"esm\");\n\nconst requireCall = { require: { [CALL]: true } };\n\n/**\n * Check whether a given variable is modified or not.\n * @param {Variable} variable The variable to check.\n * @returns {boolean} `true` if the variable is modified.\n */\nfunction isModifiedGlobal(variable) {\n return (\n variable == null ||\n variable.defs.length !== 0 ||\n variable.references.some((r) => r.isWrite())\n )\n}\n\n/**\n * Check if the value of a given node is passed through to the parent syntax as-is.\n * For example, `a` and `b` in (`a || b` and `c ? a : b`) are passed through.\n * @param {Node} node A node to check.\n * @returns {boolean} `true` if the node is passed through.\n */\nfunction isPassThrough(node) {\n const parent = node.parent;\n\n switch (parent && parent.type) {\n case \"ConditionalExpression\":\n return parent.consequent === node || parent.alternate === node\n case \"LogicalExpression\":\n return true\n case \"SequenceExpression\":\n return parent.expressions[parent.expressions.length - 1] === node\n case \"ChainExpression\":\n return true\n\n default:\n return false\n }\n}\n\n/**\n * The reference tracker.\n */\nclass ReferenceTracker {\n /**\n * Initialize this tracker.\n * @param {Scope} globalScope The global scope.\n * @param {object} [options] The options.\n * @param {\"legacy\"|\"strict\"} [options.mode=\"strict\"] The mode to determine the ImportDeclaration's behavior for CJS modules.\n * @param {string[]} [options.globalObjectNames=[\"global\",\"globalThis\",\"self\",\"window\"]] The variable names for Global Object.\n */\n constructor(\n globalScope,\n {\n mode = \"strict\",\n globalObjectNames = [\"global\", \"globalThis\", \"self\", \"window\"],\n } = {},\n ) {\n this.variableStack = [];\n this.globalScope = globalScope;\n this.mode = mode;\n this.globalObjectNames = globalObjectNames.slice(0);\n }\n\n /**\n * Iterate the references of global variables.\n * @param {object} traceMap The trace map.\n * @returns {IterableIterator<{node:Node,path:string[],type:symbol,info:any}>} The iterator to iterate references.\n */\n *iterateGlobalReferences(traceMap) {\n for (const key of Object.keys(traceMap)) {\n const nextTraceMap = traceMap[key];\n const path = [key];\n const variable = this.globalScope.set.get(key);\n\n if (isModifiedGlobal(variable)) {\n continue\n }\n\n yield* this._iterateVariableReferences(\n variable,\n path,\n nextTraceMap,\n true,\n );\n }\n\n for (const key of this.globalObjectNames) {\n const path = [];\n const variable = this.globalScope.set.get(key);\n\n if (isModifiedGlobal(variable)) {\n continue\n }\n\n yield* this._iterateVariableReferences(\n variable,\n path,\n traceMap,\n false,\n );\n }\n }\n\n /**\n * Iterate the references of CommonJS modules.\n * @param {object} traceMap The trace map.\n * @returns {IterableIterator<{node:Node,path:string[],type:symbol,info:any}>} The iterator to iterate references.\n */\n *iterateCjsReferences(traceMap) {\n for (const { node } of this.iterateGlobalReferences(requireCall)) {\n const key = getStringIfConstant(node.arguments[0]);\n if (key == null || !has(traceMap, key)) {\n continue\n }\n\n const nextTraceMap = traceMap[key];\n const path = [key];\n\n if (nextTraceMap[READ]) {\n yield {\n node,\n path,\n type: READ,\n info: nextTraceMap[READ],\n };\n }\n yield* this._iteratePropertyReferences(node, path, nextTraceMap);\n }\n }\n\n /**\n * Iterate the references of ES modules.\n * @param {object} traceMap The trace map.\n * @returns {IterableIterator<{node:Node,path:string[],type:symbol,info:any}>} The iterator to iterate references.\n */\n *iterateEsmReferences(traceMap) {\n const programNode = this.globalScope.block;\n\n for (const node of programNode.body) {\n if (!IMPORT_TYPE.test(node.type) || node.source == null) {\n continue\n }\n const moduleId = node.source.value;\n\n if (!has(traceMap, moduleId)) {\n continue\n }\n const nextTraceMap = traceMap[moduleId];\n const path = [moduleId];\n\n if (nextTraceMap[READ]) {\n yield { node, path, type: READ, info: nextTraceMap[READ] };\n }\n\n if (node.type === \"ExportAllDeclaration\") {\n for (const key of Object.keys(nextTraceMap)) {\n const exportTraceMap = nextTraceMap[key];\n if (exportTraceMap[READ]) {\n yield {\n node,\n path: path.concat(key),\n type: READ,\n info: exportTraceMap[READ],\n };\n }\n }\n } else {\n for (const specifier of node.specifiers) {\n const esm = has(nextTraceMap, ESM);\n const it = this._iterateImportReferences(\n specifier,\n path,\n esm\n ? nextTraceMap\n : this.mode === \"legacy\"\n ? { default: nextTraceMap, ...nextTraceMap }\n : { default: nextTraceMap },\n );\n\n if (esm) {\n yield* it;\n } else {\n for (const report of it) {\n report.path = report.path.filter(exceptDefault);\n if (\n report.path.length >= 2 ||\n report.type !== READ\n ) {\n yield report;\n }\n }\n }\n }\n }\n }\n }\n\n /**\n * Iterate the references for a given variable.\n * @param {Variable} variable The variable to iterate that references.\n * @param {string[]} path The current path.\n * @param {object} traceMap The trace map.\n * @param {boolean} shouldReport = The flag to report those references.\n * @returns {IterableIterator<{node:Node,path:string[],type:symbol,info:any}>} The iterator to iterate references.\n */\n *_iterateVariableReferences(variable, path, traceMap, shouldReport) {\n if (this.variableStack.includes(variable)) {\n return\n }\n this.variableStack.push(variable);\n try {\n for (const reference of variable.references) {\n if (!reference.isRead()) {\n continue\n }\n const node = reference.identifier;\n\n if (shouldReport && traceMap[READ]) {\n yield { node, path, type: READ, info: traceMap[READ] };\n }\n yield* this._iteratePropertyReferences(node, path, traceMap);\n }\n } finally {\n this.variableStack.pop();\n }\n }\n\n /**\n * Iterate the references for a given AST node.\n * @param rootNode The AST node to iterate references.\n * @param {string[]} path The current path.\n * @param {object} traceMap The trace map.\n * @returns {IterableIterator<{node:Node,path:string[],type:symbol,info:any}>} The iterator to iterate references.\n */\n //eslint-disable-next-line complexity\n *_iteratePropertyReferences(rootNode, path, traceMap) {\n let node = rootNode;\n while (isPassThrough(node)) {\n node = node.parent;\n }\n\n const parent = node.parent;\n if (parent.type === \"MemberExpression\") {\n if (parent.object === node) {\n const key = getPropertyName(parent);\n if (key == null || !has(traceMap, key)) {\n return\n }\n\n path = path.concat(key); //eslint-disable-line no-param-reassign\n const nextTraceMap = traceMap[key];\n if (nextTraceMap[READ]) {\n yield {\n node: parent,\n path,\n type: READ,\n info: nextTraceMap[READ],\n };\n }\n yield* this._iteratePropertyReferences(\n parent,\n path,\n nextTraceMap,\n );\n }\n return\n }\n if (parent.type === \"CallExpression\") {\n if (parent.callee === node && traceMap[CALL]) {\n yield { node: parent, path, type: CALL, info: traceMap[CALL] };\n }\n return\n }\n if (parent.type === \"NewExpression\") {\n if (parent.callee === node && traceMap[CONSTRUCT]) {\n yield {\n node: parent,\n path,\n type: CONSTRUCT,\n info: traceMap[CONSTRUCT],\n };\n }\n return\n }\n if (parent.type === \"AssignmentExpression\") {\n if (parent.right === node) {\n yield* this._iterateLhsReferences(parent.left, path, traceMap);\n yield* this._iteratePropertyReferences(parent, path, traceMap);\n }\n return\n }\n if (parent.type === \"AssignmentPattern\") {\n if (parent.right === node) {\n yield* this._iterateLhsReferences(parent.left, path, traceMap);\n }\n return\n }\n if (parent.type === \"VariableDeclarator\") {\n if (parent.init === node) {\n yield* this._iterateLhsReferences(parent.id, path, traceMap);\n }\n }\n }\n\n /**\n * Iterate the references for a given Pattern node.\n * @param {Node} patternNode The Pattern node to iterate references.\n * @param {string[]} path The current path.\n * @param {object} traceMap The trace map.\n * @returns {IterableIterator<{node:Node,path:string[],type:symbol,info:any}>} The iterator to iterate references.\n */\n *_iterateLhsReferences(patternNode, path, traceMap) {\n if (patternNode.type === \"Identifier\") {\n const variable = findVariable(this.globalScope, patternNode);\n if (variable != null) {\n yield* this._iterateVariableReferences(\n variable,\n path,\n traceMap,\n false,\n );\n }\n return\n }\n if (patternNode.type === \"ObjectPattern\") {\n for (const property of patternNode.properties) {\n const key = getPropertyName(property);\n\n if (key == null || !has(traceMap, key)) {\n continue\n }\n\n const nextPath = path.concat(key);\n const nextTraceMap = traceMap[key];\n if (nextTraceMap[READ]) {\n yield {\n node: property,\n path: nextPath,\n type: READ,\n info: nextTraceMap[READ],\n };\n }\n yield* this._iterateLhsReferences(\n property.value,\n nextPath,\n nextTraceMap,\n );\n }\n return\n }\n if (patternNode.type === \"AssignmentPattern\") {\n yield* this._iterateLhsReferences(patternNode.left, path, traceMap);\n }\n }\n\n /**\n * Iterate the references for a given ModuleSpecifier node.\n * @param {Node} specifierNode The ModuleSpecifier node to iterate references.\n * @param {string[]} path The current path.\n * @param {object} traceMap The trace map.\n * @returns {IterableIterator<{node:Node,path:string[],type:symbol,info:any}>} The iterator to iterate references.\n */\n *_iterateImportReferences(specifierNode, path, traceMap) {\n const type = specifierNode.type;\n\n if (type === \"ImportSpecifier\" || type === \"ImportDefaultSpecifier\") {\n const key =\n type === \"ImportDefaultSpecifier\"\n ? \"default\"\n : specifierNode.imported.name;\n if (!has(traceMap, key)) {\n return\n }\n\n path = path.concat(key); //eslint-disable-line no-param-reassign\n const nextTraceMap = traceMap[key];\n if (nextTraceMap[READ]) {\n yield {\n node: specifierNode,\n path,\n type: READ,\n info: nextTraceMap[READ],\n };\n }\n yield* this._iterateVariableReferences(\n findVariable(this.globalScope, specifierNode.local),\n path,\n nextTraceMap,\n false,\n );\n\n return\n }\n\n if (type === \"ImportNamespaceSpecifier\") {\n yield* this._iterateVariableReferences(\n findVariable(this.globalScope, specifierNode.local),\n path,\n traceMap,\n false,\n );\n return\n }\n\n if (type === \"ExportSpecifier\") {\n const key = specifierNode.local.name;\n if (!has(traceMap, key)) {\n return\n }\n\n path = path.concat(key); //eslint-disable-line no-param-reassign\n const nextTraceMap = traceMap[key];\n if (nextTraceMap[READ]) {\n yield {\n node: specifierNode,\n path,\n type: READ,\n info: nextTraceMap[READ],\n };\n }\n }\n }\n}\n\nReferenceTracker.READ = READ;\nReferenceTracker.CALL = CALL;\nReferenceTracker.CONSTRUCT = CONSTRUCT;\nReferenceTracker.ESM = ESM;\n\n/**\n * This is a predicate function for Array#filter.\n * @param {string} name A name part.\n * @param {number} index The index of the name.\n * @returns {boolean} `false` if it's default.\n */\nfunction exceptDefault(name, index) {\n return !(index === 1 && name === \"default\")\n}\n\nvar index = {\n CALL,\n CONSTRUCT,\n ESM,\n findVariable,\n getFunctionHeadLocation,\n getFunctionNameWithKind,\n getInnermostScope,\n getPropertyName,\n getStaticValue,\n getStringIfConstant,\n hasSideEffect,\n isArrowToken,\n isClosingBraceToken,\n isClosingBracketToken,\n isClosingParenToken,\n isColonToken,\n isCommaToken,\n isCommentToken,\n isNotArrowToken,\n isNotClosingBraceToken,\n isNotClosingBracketToken,\n isNotClosingParenToken,\n isNotColonToken,\n isNotCommaToken,\n isNotCommentToken,\n isNotOpeningBraceToken,\n isNotOpeningBracketToken,\n isNotOpeningParenToken,\n isNotSemicolonToken,\n isOpeningBraceToken,\n isOpeningBracketToken,\n isOpeningParenToken,\n isParenthesized,\n isSemicolonToken,\n PatternMatcher,\n READ,\n ReferenceTracker,\n};\n\nexport default index;\nexport { CALL, CONSTRUCT, ESM, PatternMatcher, READ, ReferenceTracker, findVariable, getFunctionHeadLocation, getFunctionNameWithKind, getInnermostScope, getPropertyName, getStaticValue, getStringIfConstant, hasSideEffect, isArrowToken, isClosingBraceToken, isClosingBracketToken, isClosingParenToken, isColonToken, isCommaToken, isCommentToken, isNotArrowToken, isNotClosingBraceToken, isNotClosingBracketToken, isNotClosingParenToken, isNotColonToken, isNotCommaToken, isNotCommentToken, isNotOpeningBraceToken, isNotOpeningBracketToken, isNotOpeningParenToken, isNotSemicolonToken, isOpeningBraceToken, isOpeningBracketToken, isOpeningParenToken, isParenthesized, isSemicolonToken };\n//# sourceMappingURL=index.mjs.map\n","import { findVariable } from \"eslint-utils\";\n\nexport const traverse = (context, node, visit, visited = new Set()) => {\n if (visited.has(node)) {\n return;\n }\n\n visited.add(node);\n visit(node);\n\n (context.sourceCode.visitorKeys[node.type] || [])\n .map((key) => node[key])\n // Some `visitorKeys` are optional, e.g. `IfStatement.alternate`.\n .filter(Boolean)\n // Can be an array, like `CallExpression.arguments`\n .flatMap((child) => (Array.isArray(child) ? child : [child]))\n // Can rarely be `null`, e.g. `ArrayPattern.elements[1]` when an element is skipped - `const [a, , b] = arr`\n .filter(Boolean)\n // Check it's a valid AST node\n .filter((child) => typeof child.type === \"string\")\n .forEach((child) => traverse(context, child, visit, visited));\n};\n\nexport const findDownstreamNodes = (context, topNode, type) => {\n const nodes = [];\n traverse(context, topNode, (node) => {\n if (node.type === type) {\n nodes.push(node);\n }\n });\n return nodes;\n};\n\nexport const getUpstreamVariables = (\n context,\n variable,\n filter,\n visited = new Set(),\n) => {\n if (visited.has(variable)) {\n return [];\n }\n\n visited.add(variable);\n\n const upstreamVariables = variable.defs\n // TODO: https://github.com/NickvanDyke/eslint-plugin-react-you-might-not-need-an-effect/issues/34\n // `init` covers for arrow functions; also needs `body` to descend into function declarations\n // But then for function parameters (including props), `def.node.body` is the body of the function that they belong to,\n // so we get *all* the downstream refs in it...\n // We only want to descend when we're traversing up the function itself; no its parameters.\n // Probably similar logic to in `getUpstreamReactVariables`.\n .filter((def) => !!def.node.init)\n .filter((def) => filter(def.node))\n .flatMap((def) => getDownstreamRefs(context, def.node.init))\n .map((ref) => ref.resolved)\n // I think this only happens when:\n // 1. There's genuinely no variable, i.e. `node` is a literal\n // 2. Import statement is missing\n // 3. ESLint globals are misconfigured\n .filter(Boolean)\n .flatMap((variable) =>\n getUpstreamVariables(context, variable, filter, visited),\n );\n\n // Ultimately return only leaf variables\n return upstreamVariables.length === 0 ? [variable] : upstreamVariables;\n};\n\nexport const getDownstreamRefs = (context, node) =>\n findDownstreamNodes(context, node, \"Identifier\")\n .map((identifier) => getRef(context, identifier))\n .filter(Boolean);\n\nconst getRef = (context, identifier) =>\n findVariable(\n context.sourceCode.getScope(identifier),\n identifier,\n )?.references.find((ref) => ref.identifier === identifier);\n\nexport const getCallExpr = (ref, current = ref.identifier.parent) => {\n if (current.type === \"CallExpression\") {\n // We've reached the top - confirm that the ref is the (eventual) callee, as opposed to an argument.\n let node = ref.identifier;\n while (node.parent.type === \"MemberExpression\") {\n node = node.parent;\n }\n\n if (current.callee === node) {\n return current;\n }\n }\n\n if (current.type === \"MemberExpression\") {\n return getCallExpr(ref, current.parent);\n }\n\n return undefined;\n};\n","import { getUpstreamVariables, getDownstreamRefs, getCallExpr } from \"./ast.js\";\n\nexport const isReactFunctionalComponent = (node) =>\n (node.type === \"FunctionDeclaration\" ||\n (node.type === \"VariableDeclarator\" &&\n (node.init.type === \"ArrowFunctionExpression\" ||\n node.init.type === \"CallExpression\"))) &&\n node.id.type === \"Identifier\" &&\n node.id.name[0].toUpperCase() === node.id.name[0];\n\n// NOTE: Returns false for known pure HOCs -- `memo` and `forwardRef`.\n// Basically this is meant to detect custom HOCs that may have side effects, particularly when using their props.\n// TODO: Will not detect when they define the component normally and then export it wrapped in the HOC.\n// e.g. `const MyComponent = (props) => {...}; export default memo(MyComponent);`\nexport const isReactFunctionalHOC = (node) =>\n node.type === \"VariableDeclarator\" &&\n node.init &&\n node.init.type === \"CallExpression\" &&\n node.init.callee.type === \"Identifier\" &&\n ![\"memo\", \"forwardRef\"].includes(node.init.callee.name) &&\n node.init.arguments.length > 0 &&\n (node.init.arguments[0].type === \"ArrowFunctionExpression\" ||\n node.init.arguments[0].type === \"FunctionExpression\") &&\n node.id.type === \"Identifier\" &&\n node.id.name[0].toUpperCase() === node.id.name[0];\n\nexport const isCustomHook = (node) =>\n (node.type === \"FunctionDeclaration\" ||\n (node.type === \"VariableDeclarator\" &&\n node.init &&\n (node.init.type === \"ArrowFunctionExpression\" ||\n node.init.type === \"FunctionExpression\"))) &&\n node.id.type === \"Identifier\" &&\n node.id.name.startsWith(\"use\") &&\n node.id.name[3] === node.id.name[3].toUpperCase();\n\nexport const isUseState = (node) =>\n node.type === \"VariableDeclarator\" &&\n node.init &&\n node.init.type === \"CallExpression\" &&\n node.init.callee.name === \"useState\" &&\n node.id.type === \"ArrayPattern\" &&\n // Not sure its usecase, but may just have the setter\n (node.id.elements.length === 1 || node.id.elements.length === 2) &&\n node.id.elements.every((el) => {\n // Apparently skipping the state element is a valid use.\n // I suppose technically the state can still be read via setter callback.\n return !el || el.type === \"Identifier\";\n });\n\nexport const isPropDef = (def) => {\n const declaringNode =\n def.node.type === \"ArrowFunctionExpression\"\n ? def.node.parent.type === \"CallExpression\"\n ? def.node.parent.parent\n : def.node.parent\n : def.node;\n return (\n def.type === \"Parameter\" &&\n ((isReactFunctionalComponent(declaringNode) &&\n !isReactFunctionalHOC(declaringNode)) ||\n isCustomHook(declaringNode))\n );\n};\n\nexport const isUseRef = (node) =>\n node.type === \"VariableDeclarator\" &&\n node.init &&\n node.init.type === \"CallExpression\" &&\n node.init.callee.name === \"useRef\" &&\n node.id.type === \"Identifier\";\n\n// NOTE: Does not include `useLayoutEffect`.\n// When used correctly, it interacts with the DOM = external system = (probably) valid effect.\n// When used incorrectly, it's probably too difficult to accurately analyze anyway.\nexport const isUseEffect = (node) =>\n node.type === \"CallExpression\" &&\n ((node.callee.type === \"Identifier\" && node.callee.name === \"useEffect\") ||\n (node.callee.type === \"MemberExpression\" &&\n node.callee.object.name === \"React\" &&\n node.callee.property.name === \"useEffect\"));\n\n// NOTE: When `MemberExpression` (even nested ones), a `Reference` is only the root object, not the function.\nexport const getEffectFnRefs = (context, node) => {\n if (!isUseEffect(node) || node.arguments.length < 1) {\n return undefined;\n }\n\n const effectFn = node.arguments[0];\n if (\n effectFn.type !== \"ArrowFunctionExpression\" &&\n effectFn.type !== \"FunctionExpression\"\n ) {\n return undefined;\n }\n\n return getDownstreamRefs(context, effectFn);\n};\n\nexport function getEffectDepsRefs(context, node) {\n if (!isUseEffect(node) || node.arguments.length < 2) {\n return undefined;\n }\n\n const depsArr = node.arguments[1];\n if (depsArr.type !== \"ArrayExpression\") {\n return undefined;\n }\n\n return getDownstreamRefs(context, depsArr);\n}\n\n// NOTE: These return true for MemberExpressions *on* state, like `list.concat()`.\n// Arguably preferable, as mutating the state is functionally the same as calling the setter.\n// (Even though that is not recommended and should be prevented by a different rule).\n// And in the case of a prop, we can't differentiate state mutations from callbacks anyway.\nexport const isStateSetter = (context, ref) =>\n getCallExpr(ref) !== undefined && isState(context, ref);\nexport const isPropCallback = (context, ref) =>\n getCallExpr(ref) !== undefined && isProp(context, ref);\n\n// NOTE: Global variables (like `JSON` in `JSON.stringify()`) have an empty `defs`; fortunately `[].some() === false`.\n// Also, I'm not sure so far when `defs.length > 1`... haven't seen it with shadowed variables or even redeclared variables with `var`.\nexport const isState = (context, ref) =>\n getUpstreamReactVariables(context, ref.resolved).notEmptyEvery((variable) =>\n variable.defs.some((def) => isUseState(def.node)),\n );\n// Returns false for props of HOCs like `withRouter` because they usually have side effects.\nexport const isProp = (context, ref) =>\n getUpstreamReactVariables(context, ref.resolved).notEmptyEvery((variable) =>\n variable.defs.some((def) => isPropDef(def)),\n );\nexport const isRef = (context, ref) =>\n getUpstreamReactVariables(context, ref.resolved).notEmptyEvery((variable) =>\n variable.defs.some((def) => isUseRef(def.node)),\n );\n\n// TODO: Surely can be simplified/re-use other functions.\n// Needs a better API too so we can more easily get names etc. for messages.\nexport const getUseStateNode = (context, ref) => {\n return getUpstreamReactVariables(context, ref.resolved)\n .find((variable) => variable.defs.some((def) => isUseState(def.node)))\n ?.defs.find((def) => isUseState(def.node))?.node;\n};\n\n/**\n * Walks up the AST until a `useEffect` call, returning `false` if never found, or finds any of the following on the way:\n * - An async function\n * - A function declaration, which may be called at an arbitrary later time\n * - A function passed as a callback to another function or `new` - event handler, `setTimeout`, `Promise.then()` `new ResizeObserver()`, etc.\n *\n * Otherwise returns `true`.\n *\n * Inspired by https://eslint-react.xyz/docs/rules/hooks-extra-no-direct-set-state-in-use-effect\n */\nexport const isImmediateCall = (node) => {\n if (!node.parent) {\n // Reached the top of the program without finding a `useEffect`\n return false;\n } else if (isUseEffect(node.parent)) {\n return true;\n } else if (\n // Obviously not immediate if async. I think this never occurs in isolation from the below conditions? But just in case for now.\n node.async ||\n // Inside a named or anonymous function that may be called later, either as a callback or by the developer.\n // Note while we return false for *this* call, we may still return true for a call to the function containing this call.\n node.type === \"FunctionDeclaration\" ||\n node.type === \"FunctionExpression\" ||\n node.type === \"ArrowFunctionExpression\"\n ) {\n return false;\n } else {\n // Keep going up\n return isImmediateCall(node.parent);\n }\n};\n\nexport const isArgsAllLiterals = (context, callExpr) =>\n callExpr.arguments\n .flatMap((arg) => getDownstreamRefs(context, arg))\n .flatMap((ref) => getUpstreamReactVariables(context, ref.resolved))\n .length === 0;\n\nexport const getUpstreamReactVariables = (context, variable) =>\n getUpstreamVariables(\n context,\n variable,\n // Stop at the *usage* of `useState` - don't go up to the `useState` variable.\n // Not needed for props - they don't go \"too far\".\n // We could remove this and check for the `useState` variable instead,\n // but then all our tests need to import it so we can traverse up to it.\n // And would need to change `getUseStateNode()` too?\n // TODO: Could probably organize these filters better.\n (node) => !isUseState(node),\n ).filter((variable) =>\n variable.defs.every(\n (def) =>\n isPropDef(def) ||\n // Ignore variables declared inside an anonymous function, like in `array.map()`.\n def.type !== \"Parameter\",\n ),\n );\n","import { isUseEffect, getEffectFnRefs } from \"./util/react.js\";\n\n/**\n * @type {import(\"eslint\").Rule.RuleModule}\n */\nexport default {\n meta: {\n type: \"suggestion\",\n docs: {\n description: \"Disallow empty effects.\",\n },\n schema: [],\n messages: {\n avoidEmptyEffect: \"This effect is empty and could be removed.\",\n },\n },\n create: (context) => ({\n CallExpression: (node) => {\n if (!isUseEffect(node)) return;\n\n if (\n node.arguments?.length === 0 ||\n getEffectFnRefs(context, node)?.length === 0\n ) {\n // Hopefully it's obvious the effect can be removed.\n // More a follow-up for once they fix/remove other issues.\n context.report({\n node,\n messageId: \"avoidEmptyEffect\",\n });\n }\n },\n }),\n};\n","import { getCallExpr } from \"./util/ast.js\";\nimport {\n getEffectDepsRefs,\n getEffectFnRefs,\n isArgsAllLiterals,\n isImmediateCall,\n isProp,\n isStateSetter,\n} from \"./util/react.js\";\n\n/**\n * @type {import(\"eslint\").Rule.RuleModule}\n */\nexport default {\n meta: {\n type: \"suggestion\",\n docs: {\n description: \"Disallow adjusting state in an effect when a prop changes.\",\n url: \"https://react.dev/learn/you-might-not-need-an-effect#adjusting-some-state-when-a-prop-changes\",\n },\n schema: [],\n messages: {\n avoidAdjustingStateWhenAPropChanges:\n \"Avoid adjusting state when a prop changes. Instead, adjust the state directly during render, or refactor your state to avoid this need entirely.\",\n },\n },\n create: (context) => ({\n CallExpression: (node) => {\n const effectFnRefs = getEffectFnRefs(context, node);\n const depsRefs = getEffectDepsRefs(context, node);\n if (!effectFnRefs || !depsRefs) return;\n\n const isAllDepsProps = depsRefs.notEmptyEvery((ref) =>\n isProp(context, ref),\n );\n\n effectFnRefs\n .filter((ref) => isStateSetter(context, ref))\n .filter((ref) => isImmediateCall(ref.identifier))\n .forEach((ref) => {\n const callExpr = getCallExpr(ref);\n\n if (isAllDepsProps && isArgsAllLiterals(context, callExpr)) {\n context.report({\n node: callExpr,\n messageId: \"avoidAdjustingStateWhenAPropChanges\",\n });\n }\n });\n },\n }),\n};\n","import { getCallExpr, traverse } from \"./util/ast.js\";\nimport {\n getEffectFnRefs,\n getEffectDepsRefs,\n isStateSetter,\n isProp,\n getUseStateNode,\n isUseState,\n isReactFunctionalComponent,\n isReactFunctionalHOC,\n isCustomHook,\n} from \"./util/react.js\";\n\n/**\n * @type {import(\"eslint\").Rule.RuleModule}\n */\nexport default {\n meta: {\n type: \"suggestion\",\n docs: {\n description:\n \"Disallow resetting all state in an effect when a prop changes.\",\n url: \"https://react.dev/learn/you-might-not-need-an-effect#resetting-all-state-when-a-prop-changes\",\n },\n schema: [],\n messages: {\n avoidResettingAllStateWhenAPropChanges:\n 'Avoid resetting all state when a prop changes. If \"{{prop}}\" is a key, pass it as `key` instead so React will reset the component.',\n },\n },\n create: (context) => ({\n CallExpression: (node) => {\n const effectFnRefs = getEffectFnRefs(context, node);\n const depsRefs = getEffectDepsRefs(context, node);\n if (!effectFnRefs || !depsRefs) return;\n\n const propUsedToResetAllState = findPropUsedToResetAllState(\n context,\n effectFnRefs,\n depsRefs,\n node,\n );\n\n if (propUsedToResetAllState) {\n context.report({\n node: node,\n messageId: \"avoidResettingAllStateWhenAPropChanges\",\n data: { prop: propUsedToResetAllState.identifier.name },\n });\n }\n },\n }),\n};\n\nconst findPropUsedToResetAllState = (\n context,\n effectFnRefs,\n depsRefs,\n useEffectNode,\n) => {\n const stateSetterRefs = effectFnRefs.filter((ref) =>\n isStateSetter(context, ref),\n );\n\n const isAllStateReset =\n stateSetterRefs.length > 0 &&\n stateSetterRefs.every((ref) => isSetStateToInitialValue(context, ref)) &&\n stateSetterRefs.length ===\n countUseStates(context, findContainingNode(useEffectNode));\n\n return isAllStateReset\n ? depsRefs.find((ref) => isProp(context, ref))\n : undefined;\n};\n\nconst isSetStateToInitialValue = (context, setterRef) => {\n const setStateToValue = getCallExpr(setterRef).arguments[0];\n const stateInitialValue = getUseStateNode(context, setterRef).init\n .arguments[0];\n\n // `useState()` (with no args) defaults to `undefined`,\n // so ommitting the arg is equivalent to passing `undefined`.\n // Technically this would false positive if they shadowed\n // `undefined` in only one of the scopes (only possible via `var`),\n // but I hope no one would do that.\n const isUndefined = (node) => node === undefined || node.name === \"undefined\";\n if (isUndefined(setStateToValue) && isUndefined(stateInitialValue)) {\n return true;\n }\n\n // `sourceCode.getText()` returns the entire file when passed null/undefined - let's short circuit that\n if (setStateToValue === null && stateInitialValue === null) {\n return true;\n } else if (\n (setStateToValue && !stateInitialValue) ||\n (!setStateToValue && stateInitialValue)\n ) {\n return false;\n }\n\n // TODO: This is one of the few times we compare just the immediate nodes,\n // not upstream variables - that seems pretty complicated here?\n // At the least, upstream functions would have to return literals for us to consider too, not just variables...\n return (\n context.sourceCode.getText(setStateToValue) ===\n context.sourceCode.getText(stateInitialValue)\n );\n};\n\nconst countUseStates = (context, componentNode) => {\n if (!componentNode) {\n return 0;\n }\n\n let count = 0;\n\n traverse(context, componentNode, (node) => {\n // TODO: Could optimize by not descending into nested functions/components, since hooks must be at the top level.\n if (isUseState(node)) {\n count++;\n }\n });\n\n return count;\n};\n\n// Returns the component or custom hook that contains the `useEffect` node.\n// WARNING: Per the `isReactFunctionalComponent` etc. internals, this will return undefined for some non-idiomatic component definitions.\n// e.g. `function buildComponent(arg1, arg2) { return <div />; }`\n// Not sure we can account for that without introducing false positives, and those are rare and arguably bad practice.\nconst findContainingNode = (node) => {\n if (!node) {\n return undefined;\n } else if (\n isReactFunctionalComponent(node) ||\n isReactFunctionalHOC(node) ||\n isCustomHook(node)\n ) {\n return node;\n } else {\n return findContainingNode(node.parent);\n }\n};\n","import { getEffectFnRefs, getEffectDepsRefs } from \"./util/react.js\";\nimport { findDownstreamNodes, getDownstreamRefs } from \"./util/ast.js\";\nimport { isState } from \"./util/react.js\";\n\n/**\n * @type {import(\"eslint\").Rule.RuleModule}\n */\nexport default {\n meta: {\n type: \"suggestion\",\n docs: {\n description: \"Disallow using state and an effect as an event handler.\",\n url: \"https://react.dev/learn/you-might-not-need-an-effect#sharing-logic-between-event-handlers\",\n },\n schema: [],\n messages: {\n avoidEventHandler:\n \"Avoid using state and effects as an event handler. Instead, call the event handling code directly when the event occurs.\",\n },\n },\n create: (context) => ({\n CallExpression: (node) => {\n const effectFnRefs = getEffectFnRefs(context, node);\n const depsRefs = getEffectDepsRefs(context, node);\n if (!effectFnRefs || !depsRefs) return;\n\n // TODO: Can we also flag this when the deps are internal, and the body calls internal stuff?\n // That'd overlap with other rules though... maybe just useRefs?\n\n findDownstreamNodes(context, node, \"IfStatement\")\n .filter((ifNode) => !ifNode.alternate)\n .filter((ifNode) =>\n getDownstreamRefs(context, ifNode.test)\n // TODO: Should flag props too, but maybe with a different message?\n .notEmptyEvery((ref) => isState(context, ref)),\n )\n .forEach((ifNode) => {\n context.report({\n node: ifNode.test,\n messageId: \"avoidEventHandler\",\n });\n });\n },\n }),\n};\n","import {\n getEffectFnRefs,\n getEffectDepsRefs,\n isImmediateCall,\n isPropCallback,\n isState,\n} from \"./util/react.js\";\nimport { getCallExpr, getDownstreamRefs } from \"./util/ast.js\";\n\n/**\n * @type {import(\"eslint\").Rule.RuleModule}\n */\nexport default {\n meta: {\n type: \"suggestion\",\n docs: {\n description:\n \"Disallow passing live state to parent components in an effect.\",\n url: \"https://react.dev/learn/you-might-not-need-an-effect#notifying-parent-components-about-state-changes\",\n },\n schema: [],\n messages: {\n avoidPassingLiveStateToParent:\n \"Avoid passing live state to parents in an effect. Instead, lift the state to the parent and pass it down to the child as a prop.\",\n },\n },\n create: (context) => ({\n CallExpression: (node) => {\n const effectFnRefs = getEffectFnRefs(context, node);\n const depsRefs = getEffectDepsRefs(context, node);\n if (!effectFnRefs || !depsRefs) return;\n\n effectFnRefs\n .filter((ref) => isPropCallback(context, ref))\n .filter((ref) => isImmediateCall(ref.identifier))\n .forEach((ref) => {\n const callExpr = getCallExpr(ref);\n const isStateInArgs = callExpr.arguments\n .flatMap((arg) => getDownstreamRefs(context, arg))\n .some((ref) => isState(context, ref));\n\n if (isStateInArgs) {\n context.report({\n node: callExpr,\n messageId: \"avoidPassingLiveStateToParent\",\n });\n }\n });\n },\n }),\n};\n","import { getCallExpr } from \"./util/ast.js\";\nimport {\n getEffectDepsRefs,\n getEffectFnRefs,\n getUseStateNode,\n isImmediateCall,\n isStateSetter,\n} from \"./util/react.js\";\n\n/**\n * @type {import(\"eslint\").Rule.RuleModule}\n */\nexport default {\n meta: {\n type: \"suggestion\",\n docs: {\n description: \"Disallow initializing state in an effect.\",\n },\n schema: [],\n messages: {\n avoidInitializingState:\n 'Avoid initializing state in an effect. Instead, pass \"{{state}}\"\\'s initial value to its `useState`.',\n },\n },\n create: (context) => ({\n CallExpression: (node) => {\n const effectFnRefs = getEffectFnRefs(context, node);\n const depsRefs = getEffectDepsRefs(context, node);\n if (!effectFnRefs || !depsRefs) return;\n\n // TODO: Should this length check account for the setter in the deps? exhaustive-deps doesn't warn one way or the other\n if (depsRefs.length > 0) return;\n\n effectFnRefs\n .filter((ref) => isStateSetter(context, ref))\n .filter((ref) => isImmediateCall(ref.identifier))\n .forEach((ref) => {\n const useStateNode = getUseStateNode(context, ref);\n const stateName = (\n useStateNode.id.elements[0] ?? useStateNode.id.elements[1]\n )?.name;\n\n context.report({\n node: getCallExpr(ref),\n messageId: \"avoidInitializingState\",\n data: { state: stateName },\n });\n });\n },\n }),\n};\n","import { getCallExpr } from \"./util/ast.js\";\nimport {\n getEffectDepsRefs,\n getEffectFnRefs,\n isArgsAllLiterals,\n isImmediateCall,\n isState,\n isStateSetter,\n} from \"./util/react.js\";\n\n/**\n * @type {import(\"eslint\").Rule.RuleModule}\n */\nexport default {\n meta: {\n type: \"suggestion\",\n docs: {\n description: \"Disallow chaining state changes in an effect.\",\n url: \"https://react.dev/learn/you-might-not-need-an-effect#chains-of-computations\",\n },\n schema: [],\n messages: {\n avoidChainingStateUpdates:\n \"Avoid chaining state changes. When possible, update all relevant state simultaneously.\",\n },\n },\n create: (context) => ({\n CallExpression: (node) => {\n const effectFnRefs = getEffectFnRefs(context, node);\n const depsRefs = getEffectDepsRefs(context, node);\n if (!effectFnRefs || !depsRefs) return;\n\n const isAllDepsState = depsRefs.notEmptyEvery((ref) =>\n isState(context, ref),\n );\n\n effectFnRefs\n .filter((ref) => isStateSetter(context, ref))\n .filter((ref) => isImmediateCall(ref.identifier))\n .forEach((ref) => {\n const callExpr = getCallExpr(ref);\n\n if (isAllDepsState && isArgsAllLiterals(context, callExpr)) {\n context.report({\n node: callExpr,\n messageId: \"avoidChainingStateUpdates\",\n });\n }\n });\n },\n }),\n};\n","import {\n getEffectFnRefs,\n getEffectDepsRefs,\n isImmediateCall,\n isStateSetter,\n getUseStateNode,\n isProp,\n getUpstreamReactVariables,\n isState,\n} from \"./util/react.js\";\nimport { getCallExpr, getDownstreamRefs } from \"./util/ast.js\";\n\n/**\n * @type {import('eslint').Rule.RuleModule}\n */\nexport default {\n meta: {\n type: \"suggestion\",\n docs: {\n description: \"Disallow storing derived state in an effect.\",\n url: \"https://react.dev/learn/you-might-not-need-an-effect#updating-state-based-on-props-or-state\",\n },\n schema: [],\n messages: {\n avoidDerivedState:\n 'Avoid storing derived state. Compute \"{{state}}\" directly during render, optionally with `useMemo` if it\\'s expensive.',\n },\n },\n create: (context) => ({\n CallExpression: (node) => {\n const effectFnRefs = getEffectFnRefs(context, node);\n const depsRefs = getEffectDepsRefs(context, node);\n if (!effectFnRefs || !depsRefs) return;\n\n effectFnRefs\n .filter((ref) => isStateSetter(context, ref))\n .filter((ref) => isImmediateCall(ref.identifier))\n .forEach((ref) => {\n const callExpr = getCallExpr(ref);\n const useStateNode = getUseStateNode(context, ref);\n const stateName = (\n useStateNode.id.elements[0] ?? useStateNode.id.elements[1]\n )?.name;\n\n const argsRefs = callExpr.arguments.flatMap((arg) =>\n getDownstreamRefs(context, arg),\n );\n const isAllArgsInternal = argsRefs.notEmptyEvery(\n (ref) => isState(context, ref) || isProp(context, ref),\n );\n\n const argsUpstreamVars = argsRefs.flatMap((ref) =>\n getUpstreamReactVariables(context, ref.resolved),\n );\n const depsUpstreamVars = depsRefs.flatMap((ref) =>\n getUpstreamReactVariables(context, ref.resolved),\n );\n const isAllArgsInDeps = argsUpstreamVars.notEmptyEvery((argVar) =>\n depsUpstreamVars.some((depVar) => argVar.name === depVar.name),\n );\n const isValueAlwaysInSync = isAllArgsInDeps && countCalls(ref) === 1;\n\n if (isAllArgsInternal || isValueAlwaysInSync) {\n context.report({\n node: callExpr,\n messageId: \"avoidDerivedState\",\n data: { state: stateName },\n });\n }\n });\n },\n }),\n};\n\nconst countCalls = (ref) =>\n ref.resolved.references.filter(\n (ref) => ref.identifier.parent.type === \"CallExpression\",\n ).length;\n","import {\n getEffectFnRefs,\n getEffectDepsRefs,\n isPropCallback,\n isState,\n isRef,\n isProp,\n} from \"./util/react.js\";\nimport { getCallExpr, getDownstreamRefs } from \"./util/ast.js\";\n\n/**\n * @type {import(\"eslint\").Rule.RuleModule}\n */\nexport default {\n meta: {\n type: \"suggestion\",\n docs: {\n description: \"Disallow passing data to parents in an effect.\",\n url: \"https://react.dev/learn/you-might-not-need-an-effect#passing-data-to-the-parent\",\n },\n schema: [],\n messages: {\n avoidPassingDataToParent:\n \"Avoid passing data to parents in an effect. Instead, let the parent fetch the data itself and pass it down to the child as a prop.\",\n },\n },\n create: (context) => ({\n CallExpression: (node) => {\n const effectFnRefs = getEffectFnRefs(context, node);\n const depsRefs = getEffectDepsRefs(context, node);\n if (!effectFnRefs || !depsRefs) return;\n\n effectFnRefs\n .filter((ref) => isPropCallback(context, ref))\n // We don't check `isDirectCall` because it shouldn't matter - passing data to the parent is passing data to the parent.\n .forEach((ref) => {\n const callExpr = getCallExpr(ref);\n\n if (\n callExpr.arguments\n .flatMap((arg) => getDownstreamRefs(context, arg))\n .notEmptyEvery(\n (ref) =>\n !isState(context, ref) &&\n !isProp(context, ref) &&\n !isRef(context, ref),\n )\n ) {\n context.report({\n node: callExpr,\n messageId: \"avoidPassingDataToParent\",\n });\n }\n });\n },\n }),\n};\n","import { getEffectFnRefs, getEffectDepsRefs } from \"./util/react.js\";\nimport { isProp } from \"./util/react.js\";\n\n/**\n * @type {import(\"eslint\").Rule.RuleModule}\n */\nexport default {\n meta: {\n type: \"problem\",\n docs: {\n description: \"Disallow effects that only use props.\",\n },\n schema: [],\n messages: {\n avoidManagingParent:\n \"This effect only uses props. Consider lifting the logic up to the parent.\",\n },\n },\n create: (context) => ({\n CallExpression: (node) => {\n const effectFnRefs = getEffectFnRefs(context, node);\n const depsRefs = getEffectDepsRefs(context, node);\n if (!effectFnRefs || !depsRefs) return;\n\n if (effectFnRefs.length === 0) return;\n\n if (effectFnRefs.concat(depsRefs).every((ref) => isProp(context, ref))) {\n context.report({\n node,\n messageId: \"avoidManagingParent\",\n });\n }\n },\n }),\n};\n","// Wraps `Array.every()` to return false for empty arrays.\nArray.prototype.notEmptyEvery = function (predicate) {\n return this.length > 0 && this.every(predicate);\n};\n","import noEmptyEffect from \"./no-empty-effect.js\";\nimport noAdjustStateOnPropChange from \"./no-adjust-state-on-prop-change.js\";\nimport noResetAllStateOnPropChange from \"./no-reset-all-state-on-prop-change.js\";\nimport noEventHandler from \"./no-event-handler.js\";\nimport noPassLiveStateToParent from \"./no-pass-live-state-to-parent.js\";\nimport noInitializeState from \"./no-initialize-state.js\";\nimport noChainStateUpdates from \"./no-chain-state-updates.js\";\nimport noDerivedState from \"./no-derived-state.js\";\nimport noPassDataToParent from \"./no-pass-data-to-parent.js\";\nimport noManageParent from \"./no-manage-parent.js\";\nimport globals from \"globals\";\nimport \"./util/javascript.js\";\n\n/**\n * @type {import(\"eslint\").ESLint.Plugin}\n */\nconst plugin = {\n meta: {\n name: \"react-you-might-not-need-an-effect\",\n },\n configs: {},\n rules: {\n \"no-empty-effect\": noEmptyEffect,\n \"no-adjust-state-on-prop-change\": noAdjustStateOnPropChange,\n \"no-reset-all-state-on-prop-change\": noResetAllStateOnPropChange,\n \"no-event-handler\": noEventHandler,\n \"no-pass-live-state-to-parent\": noPassLiveStateToParent,\n \"no-pass-data-to-parent\": noPassDataToParent,\n \"no-manage-parent\": noManageParent,\n \"no-initialize-state\": noInitializeState,\n \"no-chain-state-updates\": noChainStateUpdates,\n \"no-derived-state\": noDerivedState,\n },\n};\n\nconst recommendedRules = Object.keys(plugin.rules).reduce((acc, ruleName) => {\n acc[plugin.meta.name + \"/\" + ruleName] = \"warn\";\n return acc;\n}, {});\nconst languageOptions = {\n globals: {\n // NOTE: Required so we can resolve global references to their upstream global variables\n ...globals.browser,\n },\n parserOptions: {\n ecmaFeatures: {\n jsx: true,\n },\n },\n};\n\nObject.assign(plugin.configs, {\n // flat config format\n recommended: {\n files: [\"**/*.{js,jsx,mjs,cjs,ts,tsx,mts,cts}\"],\n plugins: {\n // Object.assign above so we can reference `plugin` here\n [plugin.meta.name]: plugin,\n },\n rules: recommendedRules,\n languageOptions,\n },\n \"legacy-recommended\": {\n plugins: [plugin.meta.name],\n rules: recommendedRules,\n ...languageOptions,\n },\n});\n\nexport default plugin;\n"],"x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAAA;EACI,wBAAwB,CACpB,QACA,QACH;EACD,qBAAqB,CACjB,QACA,QACH;EACD,mBAAmB,CACf,WACH;EACD,gBAAgB,CACZ,WACH;EACD,2BAA2B,CACvB,UACA,OACH;EACD,mBAAmB,CACf,WACH;EACD,kBAAkB,CACd,OACH;EACD,oBAAoB,CAChB,QACA,QACH;EACD,kBAAkB,CACd,QACH;EACD,kBAAkB,CACd,UACA,YACH;EACD,eAAe,CACX,SACA,OACH;EACD,mBAAmB,CACf,aACH;EACD,aAAa,CACT,OACH;EACD,oBAAoB;GAChB;GACA;GACA;GACH;EACD,mBAAmB;GACf;GACA;GACA;GACH;EACD,yBAAyB;GACrB;GACA;GACA;GACH;EACD,qBAAqB,CACjB,QACH;EACD,qBAAqB,EAAE;EACvB,oBAAoB,CAChB,QACA,OACH;EACD,kBAAkB,EAAE;EACpB,wBAAwB,CACpB,YACA,SACH;EACD,4BAA4B,CACxB,cACH;EACD,0BAA0B;GACtB;GACA;GACA;GACH;EACD,mBAAmB,CACf,YACA,QACH;EACD,uBAAuB,CACnB,aACH;EACD,4BAA4B,CACxB,WACH;EACD,8BAA8B,CAC1B,WACH;EACD,gBAAgB;GACZ;GACA;GACA;GACA;GACH;EACD,kBAAkB;GACd;GACA;GACA;GACH;EACD,kBAAkB;GACd;GACA;GACA;GACH;EACD,uBAAuB;GACnB;GACA;GACA;GACH;EACD,sBAAsB;GAClB;GACA;GACA;GACH;EACD,cAAc,EAAE;EAChB,eAAe;GACX;GACA;GACA;GACH;EACD,qBAAqB,CACjB,cACA,SACH;EACD,0BAA0B,CACtB,QACH;EACD,oBAAoB,CAChB,SACH;EACD,4BAA4B,CACxB,QACH;EACD,mBAAmB,CACf,YACA,QACH;EACD,gBAAgB,CACZ,QACA,QACH;EACD,qBAAqB,CACjB,OACH;EACD,cAAc;GACV;GACA;GACA;GACH;EACD,sBAAsB,EAAE;EACxB,0BAA0B,CACtB,aACH;EACD,iBAAiB,EAAE;EACnB,uBAAuB,CACnB,UACA,WACH;EACD,qBAAqB,CACjB,aACA,OACH;EACD,qBAAqB,CACjB,QACA,aACH;EACD,sBAAsB,CAClB,WACH;EACD,WAAW,EAAE;EACb,eAAe;GACX;GACA;GACA;GACH;EACD,WAAW,EAAE;EACb,oBAAoB,CAChB,SACA,OACH;EACD,qBAAqB,CACjB,QACA,QACH;EACD,oBAAoB,CAChB,UACA,WACH;EACD,gBAAgB,CACZ,QACA,WACH;EACD,oBAAoB,CAChB,OACA,QACH;EACD,iBAAiB,CACb,UACA,YACH;EACD,oBAAoB,CAChB,aACH;EACD,iBAAiB,CACb,aACH;EACD,qBAAqB,EAAE;EACvB,WAAW,CACP,OACH;EACD,YAAY,CACR,OACA,QACH;EACD,sBAAsB,CAClB,OACA,QACH;EACD,eAAe,CACX,WACH;EACD,mBAAmB,CACf,WACH;EACD,sBAAsB,CAClB,cACH;EACD,iBAAiB,CACb,WACH;EACD,SAAS,EAAE;EACX,mBAAmB,CACf,gBACA,QACH;EACD,cAAc,CACV,QACA,aACH;EACD,4BAA4B,CACxB,OACA,QACH;EACD,mBAAmB,EAAE;EACrB,mBAAmB,CACf,UACA,cACH;EACD,kBAAkB,EAAE;EACpB,kBAAkB,CACd,WACH;EACD,gBAAgB;GACZ;GACA;GACA;GACH;EACD,mBAAmB,CACf,WACH;EACD,oBAAoB,CAChB,WACH;EACD,uBAAuB,CACnB,eACH;EACD,sBAAsB,CAClB,MACA,OACH;EACD,kBAAkB,CACd,QACA,OACH;EACD,iBAAiB,CACb,UACA,OACH;EACD,mBAAmB,CACf,WACH;EACJ;;;;;;CC1RD,MAAM;CAGN,MAAM,aAAa,OAAO,OAAO,OAAO,KAAK,KAAK,CAAC;AAGnD,MAAK,MAAM,QAAQ,WACf,QAAO,OAAO,KAAK,MAAM;AAE7B,QAAO,OAAO,KAAK;CAGnB,MAAM,gBAAgB,IAAI,IAAI;EAC1B;EACA;EACA;EACH,CAAC;;;;;;CAOF,SAAS,UAAU,KAAK;AACpB,SAAO,CAAC,cAAc,IAAI,IAAI,IAAI,IAAI,OAAO;;AAOjD,QAAO,UAAU,OAAO,OAAO;EAM3B;EAOA,QAAQ,MA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M,CAAC,QAAQ,KAAK,aAAa;AAC3E,KAAI,OAAO,KAAK,OAAO,MAAM,YAAY;AACzC,QAAO;GACN,EAAE,CAAC;AACN,MAAM,kBAAkB;CACtB,SAAS,EAEP,GAAG,QAAQ,SACZ;CACD,eAAe,EACb,cAAc,EACZ,KAAK,MACN,EACF;CACF;AAED,OAAO,OAAO,OAAO,SAAS;CAE5B,aAAa;EACX,OAAO,CAAC,uCAAuC;EAC/C,SAAS,GAEN,OAAO,KAAK,OAAO,QACrB;EACD,OAAO;EACP;EACD;CACD,sBAAsB;EACpB,SAAS,CAAC,OAAO,KAAK,KAAK;EAC3B,OAAO;EACP,GAAG;EACJ;CACF,CAAC;AAEF,kBAAe"}
1
+ {"version":3,"file":"src-ZlDTU7nv.js","names":["evk","variable","variable","ref","ref","ref","noEmptyEffect","noAdjustStateOnPropChange","noResetAllStateOnPropChange","noEventHandler","noPassLiveStateToParent","noPassDataToParent","noManageParent","noInitializeState","noChainStateUpdates","noDerivedState"],"sources":["../../../node_modules/.pnpm/eslint-visitor-keys@2.1.0/node_modules/eslint-visitor-keys/lib/visitor-keys.json","../../../node_modules/.pnpm/eslint-visitor-keys@2.1.0/node_modules/eslint-visitor-keys/lib/index.js","../../../node_modules/.pnpm/eslint-utils@3.0.0_eslint@9.36.0_jiti@2.6.0_/node_modules/eslint-utils/index.mjs","../../../node_modules/.pnpm/eslint-plugin-react-you-might-not-need-an-effect@0.5.4_eslint@9.36.0_jiti@2.6.0_/node_modules/eslint-plugin-react-you-might-not-need-an-effect/src/util/ast.js","../../../node_modules/.pnpm/eslint-plugin-react-you-might-not-need-an-effect@0.5.4_eslint@9.36.0_jiti@2.6.0_/node_modules/eslint-plugin-react-you-might-not-need-an-effect/src/util/react.js","../../../node_modules/.pnpm/eslint-plugin-react-you-might-not-need-an-effect@0.5.4_eslint@9.36.0_jiti@2.6.0_/node_modules/eslint-plugin-react-you-might-not-need-an-effect/src/no-empty-effect.js","../../../node_modules/.pnpm/eslint-plugin-react-you-might-not-need-an-effect@0.5.4_eslint@9.36.0_jiti@2.6.0_/node_modules/eslint-plugin-react-you-might-not-need-an-effect/src/no-adjust-state-on-prop-change.js","../../../node_modules/.pnpm/eslint-plugin-react-you-might-not-need-an-effect@0.5.4_eslint@9.36.0_jiti@2.6.0_/node_modules/eslint-plugin-react-you-might-not-need-an-effect/src/no-reset-all-state-on-prop-change.js","../../../node_modules/.pnpm/eslint-plugin-react-you-might-not-need-an-effect@0.5.4_eslint@9.36.0_jiti@2.6.0_/node_modules/eslint-plugin-react-you-might-not-need-an-effect/src/no-event-handler.js","../../../node_modules/.pnpm/eslint-plugin-react-you-might-not-need-an-effect@0.5.4_eslint@9.36.0_jiti@2.6.0_/node_modules/eslint-plugin-react-you-might-not-need-an-effect/src/no-pass-live-state-to-parent.js","../../../node_modules/.pnpm/eslint-plugin-react-you-might-not-need-an-effect@0.5.4_eslint@9.36.0_jiti@2.6.0_/node_modules/eslint-plugin-react-you-might-not-need-an-effect/src/no-initialize-state.js","../../../node_modules/.pnpm/eslint-plugin-react-you-might-not-need-an-effect@0.5.4_eslint@9.36.0_jiti@2.6.0_/node_modules/eslint-plugin-react-you-might-not-need-an-effect/src/no-chain-state-updates.js","../../../node_modules/.pnpm/eslint-plugin-react-you-might-not-need-an-effect@0.5.4_eslint@9.36.0_jiti@2.6.0_/node_modules/eslint-plugin-react-you-might-not-need-an-effect/src/no-derived-state.js","../../../node_modules/.pnpm/eslint-plugin-react-you-might-not-need-an-effect@0.5.4_eslint@9.36.0_jiti@2.6.0_/node_modules/eslint-plugin-react-you-might-not-need-an-effect/src/no-pass-data-to-parent.js","../../../node_modules/.pnpm/eslint-plugin-react-you-might-not-need-an-effect@0.5.4_eslint@9.36.0_jiti@2.6.0_/node_modules/eslint-plugin-react-you-might-not-need-an-effect/src/no-manage-parent.js","../../../node_modules/.pnpm/eslint-plugin-react-you-might-not-need-an-effect@0.5.4_eslint@9.36.0_jiti@2.6.0_/node_modules/eslint-plugin-react-you-might-not-need-an-effect/src/util/javascript.js","../../../node_modules/.pnpm/eslint-plugin-react-you-might-not-need-an-effect@0.5.4_eslint@9.36.0_jiti@2.6.0_/node_modules/eslint-plugin-react-you-might-not-need-an-effect/src/index.js"],"sourcesContent":["{\n \"AssignmentExpression\": [\n \"left\",\n \"right\"\n ],\n \"AssignmentPattern\": [\n \"left\",\n \"right\"\n ],\n \"ArrayExpression\": [\n \"elements\"\n ],\n \"ArrayPattern\": [\n \"elements\"\n ],\n \"ArrowFunctionExpression\": [\n \"params\",\n \"body\"\n ],\n \"AwaitExpression\": [\n \"argument\"\n ],\n \"BlockStatement\": [\n \"body\"\n ],\n \"BinaryExpression\": [\n \"left\",\n \"right\"\n ],\n \"BreakStatement\": [\n \"label\"\n ],\n \"CallExpression\": [\n \"callee\",\n \"arguments\"\n ],\n \"CatchClause\": [\n \"param\",\n \"body\"\n ],\n \"ChainExpression\": [\n \"expression\"\n ],\n \"ClassBody\": [\n \"body\"\n ],\n \"ClassDeclaration\": [\n \"id\",\n \"superClass\",\n \"body\"\n ],\n \"ClassExpression\": [\n \"id\",\n \"superClass\",\n \"body\"\n ],\n \"ConditionalExpression\": [\n \"test\",\n \"consequent\",\n \"alternate\"\n ],\n \"ContinueStatement\": [\n \"label\"\n ],\n \"DebuggerStatement\": [],\n \"DoWhileStatement\": [\n \"body\",\n \"test\"\n ],\n \"EmptyStatement\": [],\n \"ExportAllDeclaration\": [\n \"exported\",\n \"source\"\n ],\n \"ExportDefaultDeclaration\": [\n \"declaration\"\n ],\n \"ExportNamedDeclaration\": [\n \"declaration\",\n \"specifiers\",\n \"source\"\n ],\n \"ExportSpecifier\": [\n \"exported\",\n \"local\"\n ],\n \"ExpressionStatement\": [\n \"expression\"\n ],\n \"ExperimentalRestProperty\": [\n \"argument\"\n ],\n \"ExperimentalSpreadProperty\": [\n \"argument\"\n ],\n \"ForStatement\": [\n \"init\",\n \"test\",\n \"update\",\n \"body\"\n ],\n \"ForInStatement\": [\n \"left\",\n \"right\",\n \"body\"\n ],\n \"ForOfStatement\": [\n \"left\",\n \"right\",\n \"body\"\n ],\n \"FunctionDeclaration\": [\n \"id\",\n \"params\",\n \"body\"\n ],\n \"FunctionExpression\": [\n \"id\",\n \"params\",\n \"body\"\n ],\n \"Identifier\": [],\n \"IfStatement\": [\n \"test\",\n \"consequent\",\n \"alternate\"\n ],\n \"ImportDeclaration\": [\n \"specifiers\",\n \"source\"\n ],\n \"ImportDefaultSpecifier\": [\n \"local\"\n ],\n \"ImportExpression\": [\n \"source\"\n ],\n \"ImportNamespaceSpecifier\": [\n \"local\"\n ],\n \"ImportSpecifier\": [\n \"imported\",\n \"local\"\n ],\n \"JSXAttribute\": [\n \"name\",\n \"value\"\n ],\n \"JSXClosingElement\": [\n \"name\"\n ],\n \"JSXElement\": [\n \"openingElement\",\n \"children\",\n \"closingElement\"\n ],\n \"JSXEmptyExpression\": [],\n \"JSXExpressionContainer\": [\n \"expression\"\n ],\n \"JSXIdentifier\": [],\n \"JSXMemberExpression\": [\n \"object\",\n \"property\"\n ],\n \"JSXNamespacedName\": [\n \"namespace\",\n \"name\"\n ],\n \"JSXOpeningElement\": [\n \"name\",\n \"attributes\"\n ],\n \"JSXSpreadAttribute\": [\n \"argument\"\n ],\n \"JSXText\": [],\n \"JSXFragment\": [\n \"openingFragment\",\n \"children\",\n \"closingFragment\"\n ],\n \"Literal\": [],\n \"LabeledStatement\": [\n \"label\",\n \"body\"\n ],\n \"LogicalExpression\": [\n \"left\",\n \"right\"\n ],\n \"MemberExpression\": [\n \"object\",\n \"property\"\n ],\n \"MetaProperty\": [\n \"meta\",\n \"property\"\n ],\n \"MethodDefinition\": [\n \"key\",\n \"value\"\n ],\n \"NewExpression\": [\n \"callee\",\n \"arguments\"\n ],\n \"ObjectExpression\": [\n \"properties\"\n ],\n \"ObjectPattern\": [\n \"properties\"\n ],\n \"PrivateIdentifier\": [],\n \"Program\": [\n \"body\"\n ],\n \"Property\": [\n \"key\",\n \"value\"\n ],\n \"PropertyDefinition\": [\n \"key\",\n \"value\"\n ],\n \"RestElement\": [\n \"argument\"\n ],\n \"ReturnStatement\": [\n \"argument\"\n ],\n \"SequenceExpression\": [\n \"expressions\"\n ],\n \"SpreadElement\": [\n \"argument\"\n ],\n \"Super\": [],\n \"SwitchStatement\": [\n \"discriminant\",\n \"cases\"\n ],\n \"SwitchCase\": [\n \"test\",\n \"consequent\"\n ],\n \"TaggedTemplateExpression\": [\n \"tag\",\n \"quasi\"\n ],\n \"TemplateElement\": [],\n \"TemplateLiteral\": [\n \"quasis\",\n \"expressions\"\n ],\n \"ThisExpression\": [],\n \"ThrowStatement\": [\n \"argument\"\n ],\n \"TryStatement\": [\n \"block\",\n \"handler\",\n \"finalizer\"\n ],\n \"UnaryExpression\": [\n \"argument\"\n ],\n \"UpdateExpression\": [\n \"argument\"\n ],\n \"VariableDeclaration\": [\n \"declarations\"\n ],\n \"VariableDeclarator\": [\n \"id\",\n \"init\"\n ],\n \"WhileStatement\": [\n \"test\",\n \"body\"\n ],\n \"WithStatement\": [\n \"object\",\n \"body\"\n ],\n \"YieldExpression\": [\n \"argument\"\n ]\n}\n","/**\n * @author Toru Nagashima <https://github.com/mysticatea>\n * See LICENSE file in root directory for full license.\n */\n\"use strict\";\n\nconst KEYS = require(\"./visitor-keys.json\");\n\n// Types.\nconst NODE_TYPES = Object.freeze(Object.keys(KEYS));\n\n// Freeze the keys.\nfor (const type of NODE_TYPES) {\n Object.freeze(KEYS[type]);\n}\nObject.freeze(KEYS);\n\n// List to ignore keys.\nconst KEY_BLACKLIST = new Set([\n \"parent\",\n \"leadingComments\",\n \"trailingComments\"\n]);\n\n/**\n * Check whether a given key should be used or not.\n * @param {string} key The key to check.\n * @returns {boolean} `true` if the key should be used.\n */\nfunction filterKey(key) {\n return !KEY_BLACKLIST.has(key) && key[0] !== \"_\";\n}\n\n//------------------------------------------------------------------------------\n// Public interfaces\n//------------------------------------------------------------------------------\n\nmodule.exports = Object.freeze({\n\n /**\n * Visitor keys.\n * @type {{ [type: string]: string[] | undefined }}\n */\n KEYS,\n\n /**\n * Get visitor keys of a given node.\n * @param {Object} node The AST node to get keys.\n * @returns {string[]} Visitor keys of the node.\n */\n getKeys(node) {\n return Object.keys(node).filter(filterKey);\n },\n\n // Disable valid-jsdoc rule because it reports syntax error on the type of @returns.\n // eslint-disable-next-line valid-jsdoc\n /**\n * Make the union set with `KEYS` and given keys.\n * @param {Object} additionalKeys The additional keys.\n * @returns {{ [type: string]: string[] | undefined }} The union set.\n */\n unionWith(additionalKeys) {\n const retv = Object.assign({}, KEYS);\n\n for (const type of Object.keys(additionalKeys)) {\n if (retv.hasOwnProperty(type)) {\n const keys = new Set(additionalKeys[type]);\n\n for (const key of retv[type]) {\n keys.add(key);\n }\n\n retv[type] = Object.freeze(Array.from(keys));\n } else {\n retv[type] = Object.freeze(Array.from(additionalKeys[type]));\n }\n }\n\n return Object.freeze(retv);\n }\n});\n","/*! @author Toru Nagashima <https://github.com/mysticatea> */\nimport evk from 'eslint-visitor-keys';\n\n/**\n * Get the innermost scope which contains a given location.\n * @param {Scope} initialScope The initial scope to search.\n * @param {Node} node The location to search.\n * @returns {Scope} The innermost scope.\n */\nfunction getInnermostScope(initialScope, node) {\n const location = node.range[0];\n\n let scope = initialScope;\n let found = false;\n do {\n found = false;\n for (const childScope of scope.childScopes) {\n const range = childScope.block.range;\n\n if (range[0] <= location && location < range[1]) {\n scope = childScope;\n found = true;\n break\n }\n }\n } while (found)\n\n return scope\n}\n\n/**\n * Find the variable of a given name.\n * @param {Scope} initialScope The scope to start finding.\n * @param {string|Node} nameOrNode The variable name to find. If this is a Node object then it should be an Identifier node.\n * @returns {Variable|null} The found variable or null.\n */\nfunction findVariable(initialScope, nameOrNode) {\n let name = \"\";\n let scope = initialScope;\n\n if (typeof nameOrNode === \"string\") {\n name = nameOrNode;\n } else {\n name = nameOrNode.name;\n scope = getInnermostScope(scope, nameOrNode);\n }\n\n while (scope != null) {\n const variable = scope.set.get(name);\n if (variable != null) {\n return variable\n }\n scope = scope.upper;\n }\n\n return null\n}\n\n/**\n * Negate the result of `this` calling.\n * @param {Token} token The token to check.\n * @returns {boolean} `true` if the result of `this(token)` is `false`.\n */\nfunction negate0(token) {\n return !this(token) //eslint-disable-line no-invalid-this\n}\n\n/**\n * Creates the negate function of the given function.\n * @param {function(Token):boolean} f - The function to negate.\n * @returns {function(Token):boolean} Negated function.\n */\nfunction negate(f) {\n return negate0.bind(f)\n}\n\n/**\n * Checks if the given token is a PunctuatorToken with the given value\n * @param {Token} token - The token to check.\n * @param {string} value - The value to check.\n * @returns {boolean} `true` if the token is a PunctuatorToken with the given value.\n */\nfunction isPunctuatorTokenWithValue(token, value) {\n return token.type === \"Punctuator\" && token.value === value\n}\n\n/**\n * Checks if the given token is an arrow token or not.\n * @param {Token} token - The token to check.\n * @returns {boolean} `true` if the token is an arrow token.\n */\nfunction isArrowToken(token) {\n return isPunctuatorTokenWithValue(token, \"=>\")\n}\n\n/**\n * Checks if the given token is a comma token or not.\n * @param {Token} token - The token to check.\n * @returns {boolean} `true` if the token is a comma token.\n */\nfunction isCommaToken(token) {\n return isPunctuatorTokenWithValue(token, \",\")\n}\n\n/**\n * Checks if the given token is a semicolon token or not.\n * @param {Token} token - The token to check.\n * @returns {boolean} `true` if the token is a semicolon token.\n */\nfunction isSemicolonToken(token) {\n return isPunctuatorTokenWithValue(token, \";\")\n}\n\n/**\n * Checks if the given token is a colon token or not.\n * @param {Token} token - The token to check.\n * @returns {boolean} `true` if the token is a colon token.\n */\nfunction isColonToken(token) {\n return isPunctuatorTokenWithValue(token, \":\")\n}\n\n/**\n * Checks if the given token is an opening parenthesis token or not.\n * @param {Token} token - The token to check.\n * @returns {boolean} `true` if the token is an opening parenthesis token.\n */\nfunction isOpeningParenToken(token) {\n return isPunctuatorTokenWithValue(token, \"(\")\n}\n\n/**\n * Checks if the given token is a closing parenthesis token or not.\n * @param {Token} token - The token to check.\n * @returns {boolean} `true` if the token is a closing parenthesis token.\n */\nfunction isClosingParenToken(token) {\n return isPunctuatorTokenWithValue(token, \")\")\n}\n\n/**\n * Checks if the given token is an opening square bracket token or not.\n * @param {Token} token - The token to check.\n * @returns {boolean} `true` if the token is an opening square bracket token.\n */\nfunction isOpeningBracketToken(token) {\n return isPunctuatorTokenWithValue(token, \"[\")\n}\n\n/**\n * Checks if the given token is a closing square bracket token or not.\n * @param {Token} token - The token to check.\n * @returns {boolean} `true` if the token is a closing square bracket token.\n */\nfunction isClosingBracketToken(token) {\n return isPunctuatorTokenWithValue(token, \"]\")\n}\n\n/**\n * Checks if the given token is an opening brace token or not.\n * @param {Token} token - The token to check.\n * @returns {boolean} `true` if the token is an opening brace token.\n */\nfunction isOpeningBraceToken(token) {\n return isPunctuatorTokenWithValue(token, \"{\")\n}\n\n/**\n * Checks if the given token is a closing brace token or not.\n * @param {Token} token - The token to check.\n * @returns {boolean} `true` if the token is a closing brace token.\n */\nfunction isClosingBraceToken(token) {\n return isPunctuatorTokenWithValue(token, \"}\")\n}\n\n/**\n * Checks if the given token is a comment token or not.\n * @param {Token} token - The token to check.\n * @returns {boolean} `true` if the token is a comment token.\n */\nfunction isCommentToken(token) {\n return [\"Block\", \"Line\", \"Shebang\"].includes(token.type)\n}\n\nconst isNotArrowToken = negate(isArrowToken);\nconst isNotCommaToken = negate(isCommaToken);\nconst isNotSemicolonToken = negate(isSemicolonToken);\nconst isNotColonToken = negate(isColonToken);\nconst isNotOpeningParenToken = negate(isOpeningParenToken);\nconst isNotClosingParenToken = negate(isClosingParenToken);\nconst isNotOpeningBracketToken = negate(isOpeningBracketToken);\nconst isNotClosingBracketToken = negate(isClosingBracketToken);\nconst isNotOpeningBraceToken = negate(isOpeningBraceToken);\nconst isNotClosingBraceToken = negate(isClosingBraceToken);\nconst isNotCommentToken = negate(isCommentToken);\n\n/**\n * Get the `(` token of the given function node.\n * @param {Node} node - The function node to get.\n * @param {SourceCode} sourceCode - The source code object to get tokens.\n * @returns {Token} `(` token.\n */\nfunction getOpeningParenOfParams(node, sourceCode) {\n return node.id\n ? sourceCode.getTokenAfter(node.id, isOpeningParenToken)\n : sourceCode.getFirstToken(node, isOpeningParenToken)\n}\n\n/**\n * Get the location of the given function node for reporting.\n * @param {Node} node - The function node to get.\n * @param {SourceCode} sourceCode - The source code object to get tokens.\n * @returns {string} The location of the function node for reporting.\n */\nfunction getFunctionHeadLocation(node, sourceCode) {\n const parent = node.parent;\n let start = null;\n let end = null;\n\n if (node.type === \"ArrowFunctionExpression\") {\n const arrowToken = sourceCode.getTokenBefore(node.body, isArrowToken);\n\n start = arrowToken.loc.start;\n end = arrowToken.loc.end;\n } else if (\n parent.type === \"Property\" ||\n parent.type === \"MethodDefinition\" ||\n parent.type === \"PropertyDefinition\"\n ) {\n start = parent.loc.start;\n end = getOpeningParenOfParams(node, sourceCode).loc.start;\n } else {\n start = node.loc.start;\n end = getOpeningParenOfParams(node, sourceCode).loc.start;\n }\n\n return {\n start: { ...start },\n end: { ...end },\n }\n}\n\n/* globals globalThis, global, self, window */\n\nconst globalObject =\n typeof globalThis !== \"undefined\"\n ? globalThis\n : typeof self !== \"undefined\"\n ? self\n : typeof window !== \"undefined\"\n ? window\n : typeof global !== \"undefined\"\n ? global\n : {};\n\nconst builtinNames = Object.freeze(\n new Set([\n \"Array\",\n \"ArrayBuffer\",\n \"BigInt\",\n \"BigInt64Array\",\n \"BigUint64Array\",\n \"Boolean\",\n \"DataView\",\n \"Date\",\n \"decodeURI\",\n \"decodeURIComponent\",\n \"encodeURI\",\n \"encodeURIComponent\",\n \"escape\",\n \"Float32Array\",\n \"Float64Array\",\n \"Function\",\n \"Infinity\",\n \"Int16Array\",\n \"Int32Array\",\n \"Int8Array\",\n \"isFinite\",\n \"isNaN\",\n \"isPrototypeOf\",\n \"JSON\",\n \"Map\",\n \"Math\",\n \"NaN\",\n \"Number\",\n \"Object\",\n \"parseFloat\",\n \"parseInt\",\n \"Promise\",\n \"Proxy\",\n \"Reflect\",\n \"RegExp\",\n \"Set\",\n \"String\",\n \"Symbol\",\n \"Uint16Array\",\n \"Uint32Array\",\n \"Uint8Array\",\n \"Uint8ClampedArray\",\n \"undefined\",\n \"unescape\",\n \"WeakMap\",\n \"WeakSet\",\n ]),\n);\nconst callAllowed = new Set(\n [\n Array.isArray,\n typeof BigInt === \"function\" ? BigInt : undefined,\n Boolean,\n Date,\n Date.parse,\n decodeURI,\n decodeURIComponent,\n encodeURI,\n encodeURIComponent,\n escape,\n isFinite,\n isNaN,\n isPrototypeOf,\n ...Object.getOwnPropertyNames(Math)\n .map((k) => Math[k])\n .filter((f) => typeof f === \"function\"),\n Number,\n Number.isFinite,\n Number.isNaN,\n Number.parseFloat,\n Number.parseInt,\n Object,\n Object.entries,\n Object.is,\n Object.isExtensible,\n Object.isFrozen,\n Object.isSealed,\n Object.keys,\n Object.values,\n parseFloat,\n parseInt,\n RegExp,\n String,\n String.fromCharCode,\n String.fromCodePoint,\n String.raw,\n Symbol.for,\n Symbol.keyFor,\n unescape,\n ].filter((f) => typeof f === \"function\"),\n);\nconst callPassThrough = new Set([\n Object.freeze,\n Object.preventExtensions,\n Object.seal,\n]);\n\n/**\n * Get the property descriptor.\n * @param {object} object The object to get.\n * @param {string|number|symbol} name The property name to get.\n */\nfunction getPropertyDescriptor(object, name) {\n let x = object;\n while ((typeof x === \"object\" || typeof x === \"function\") && x !== null) {\n const d = Object.getOwnPropertyDescriptor(x, name);\n if (d) {\n return d\n }\n x = Object.getPrototypeOf(x);\n }\n return null\n}\n\n/**\n * Check if a property is getter or not.\n * @param {object} object The object to check.\n * @param {string|number|symbol} name The property name to check.\n */\nfunction isGetter(object, name) {\n const d = getPropertyDescriptor(object, name);\n return d != null && d.get != null\n}\n\n/**\n * Get the element values of a given node list.\n * @param {Node[]} nodeList The node list to get values.\n * @param {Scope|undefined} initialScope The initial scope to find variables.\n * @returns {any[]|null} The value list if all nodes are constant. Otherwise, null.\n */\nfunction getElementValues(nodeList, initialScope) {\n const valueList = [];\n\n for (let i = 0; i < nodeList.length; ++i) {\n const elementNode = nodeList[i];\n\n if (elementNode == null) {\n valueList.length = i + 1;\n } else if (elementNode.type === \"SpreadElement\") {\n const argument = getStaticValueR(elementNode.argument, initialScope);\n if (argument == null) {\n return null\n }\n valueList.push(...argument.value);\n } else {\n const element = getStaticValueR(elementNode, initialScope);\n if (element == null) {\n return null\n }\n valueList.push(element.value);\n }\n }\n\n return valueList\n}\n\nconst operations = Object.freeze({\n ArrayExpression(node, initialScope) {\n const elements = getElementValues(node.elements, initialScope);\n return elements != null ? { value: elements } : null\n },\n\n AssignmentExpression(node, initialScope) {\n if (node.operator === \"=\") {\n return getStaticValueR(node.right, initialScope)\n }\n return null\n },\n\n //eslint-disable-next-line complexity\n BinaryExpression(node, initialScope) {\n if (node.operator === \"in\" || node.operator === \"instanceof\") {\n // Not supported.\n return null\n }\n\n const left = getStaticValueR(node.left, initialScope);\n const right = getStaticValueR(node.right, initialScope);\n if (left != null && right != null) {\n switch (node.operator) {\n case \"==\":\n return { value: left.value == right.value } //eslint-disable-line eqeqeq\n case \"!=\":\n return { value: left.value != right.value } //eslint-disable-line eqeqeq\n case \"===\":\n return { value: left.value === right.value }\n case \"!==\":\n return { value: left.value !== right.value }\n case \"<\":\n return { value: left.value < right.value }\n case \"<=\":\n return { value: left.value <= right.value }\n case \">\":\n return { value: left.value > right.value }\n case \">=\":\n return { value: left.value >= right.value }\n case \"<<\":\n return { value: left.value << right.value }\n case \">>\":\n return { value: left.value >> right.value }\n case \">>>\":\n return { value: left.value >>> right.value }\n case \"+\":\n return { value: left.value + right.value }\n case \"-\":\n return { value: left.value - right.value }\n case \"*\":\n return { value: left.value * right.value }\n case \"/\":\n return { value: left.value / right.value }\n case \"%\":\n return { value: left.value % right.value }\n case \"**\":\n return { value: Math.pow(left.value, right.value) }\n case \"|\":\n return { value: left.value | right.value }\n case \"^\":\n return { value: left.value ^ right.value }\n case \"&\":\n return { value: left.value & right.value }\n\n // no default\n }\n }\n\n return null\n },\n\n CallExpression(node, initialScope) {\n const calleeNode = node.callee;\n const args = getElementValues(node.arguments, initialScope);\n\n if (args != null) {\n if (calleeNode.type === \"MemberExpression\") {\n if (calleeNode.property.type === \"PrivateIdentifier\") {\n return null\n }\n const object = getStaticValueR(calleeNode.object, initialScope);\n if (object != null) {\n if (\n object.value == null &&\n (object.optional || node.optional)\n ) {\n return { value: undefined, optional: true }\n }\n const property = getStaticPropertyNameValue(\n calleeNode,\n initialScope,\n );\n\n if (property != null) {\n const receiver = object.value;\n const methodName = property.value;\n if (callAllowed.has(receiver[methodName])) {\n return { value: receiver[methodName](...args) }\n }\n if (callPassThrough.has(receiver[methodName])) {\n return { value: args[0] }\n }\n }\n }\n } else {\n const callee = getStaticValueR(calleeNode, initialScope);\n if (callee != null) {\n if (callee.value == null && node.optional) {\n return { value: undefined, optional: true }\n }\n const func = callee.value;\n if (callAllowed.has(func)) {\n return { value: func(...args) }\n }\n if (callPassThrough.has(func)) {\n return { value: args[0] }\n }\n }\n }\n }\n\n return null\n },\n\n ConditionalExpression(node, initialScope) {\n const test = getStaticValueR(node.test, initialScope);\n if (test != null) {\n return test.value\n ? getStaticValueR(node.consequent, initialScope)\n : getStaticValueR(node.alternate, initialScope)\n }\n return null\n },\n\n ExpressionStatement(node, initialScope) {\n return getStaticValueR(node.expression, initialScope)\n },\n\n Identifier(node, initialScope) {\n if (initialScope != null) {\n const variable = findVariable(initialScope, node);\n\n // Built-in globals.\n if (\n variable != null &&\n variable.defs.length === 0 &&\n builtinNames.has(variable.name) &&\n variable.name in globalObject\n ) {\n return { value: globalObject[variable.name] }\n }\n\n // Constants.\n if (variable != null && variable.defs.length === 1) {\n const def = variable.defs[0];\n if (\n def.parent &&\n def.parent.kind === \"const\" &&\n // TODO(mysticatea): don't support destructuring here.\n def.node.id.type === \"Identifier\"\n ) {\n return getStaticValueR(def.node.init, initialScope)\n }\n }\n }\n return null\n },\n\n Literal(node) {\n //istanbul ignore if : this is implementation-specific behavior.\n if ((node.regex != null || node.bigint != null) && node.value == null) {\n // It was a RegExp/BigInt literal, but Node.js didn't support it.\n return null\n }\n return { value: node.value }\n },\n\n LogicalExpression(node, initialScope) {\n const left = getStaticValueR(node.left, initialScope);\n if (left != null) {\n if (\n (node.operator === \"||\" && Boolean(left.value) === true) ||\n (node.operator === \"&&\" && Boolean(left.value) === false) ||\n (node.operator === \"??\" && left.value != null)\n ) {\n return left\n }\n\n const right = getStaticValueR(node.right, initialScope);\n if (right != null) {\n return right\n }\n }\n\n return null\n },\n\n MemberExpression(node, initialScope) {\n if (node.property.type === \"PrivateIdentifier\") {\n return null\n }\n const object = getStaticValueR(node.object, initialScope);\n if (object != null) {\n if (object.value == null && (object.optional || node.optional)) {\n return { value: undefined, optional: true }\n }\n const property = getStaticPropertyNameValue(node, initialScope);\n\n if (property != null && !isGetter(object.value, property.value)) {\n return { value: object.value[property.value] }\n }\n }\n return null\n },\n\n ChainExpression(node, initialScope) {\n const expression = getStaticValueR(node.expression, initialScope);\n if (expression != null) {\n return { value: expression.value }\n }\n return null\n },\n\n NewExpression(node, initialScope) {\n const callee = getStaticValueR(node.callee, initialScope);\n const args = getElementValues(node.arguments, initialScope);\n\n if (callee != null && args != null) {\n const Func = callee.value;\n if (callAllowed.has(Func)) {\n return { value: new Func(...args) }\n }\n }\n\n return null\n },\n\n ObjectExpression(node, initialScope) {\n const object = {};\n\n for (const propertyNode of node.properties) {\n if (propertyNode.type === \"Property\") {\n if (propertyNode.kind !== \"init\") {\n return null\n }\n const key = getStaticPropertyNameValue(\n propertyNode,\n initialScope,\n );\n const value = getStaticValueR(propertyNode.value, initialScope);\n if (key == null || value == null) {\n return null\n }\n object[key.value] = value.value;\n } else if (\n propertyNode.type === \"SpreadElement\" ||\n propertyNode.type === \"ExperimentalSpreadProperty\"\n ) {\n const argument = getStaticValueR(\n propertyNode.argument,\n initialScope,\n );\n if (argument == null) {\n return null\n }\n Object.assign(object, argument.value);\n } else {\n return null\n }\n }\n\n return { value: object }\n },\n\n SequenceExpression(node, initialScope) {\n const last = node.expressions[node.expressions.length - 1];\n return getStaticValueR(last, initialScope)\n },\n\n TaggedTemplateExpression(node, initialScope) {\n const tag = getStaticValueR(node.tag, initialScope);\n const expressions = getElementValues(\n node.quasi.expressions,\n initialScope,\n );\n\n if (tag != null && expressions != null) {\n const func = tag.value;\n const strings = node.quasi.quasis.map((q) => q.value.cooked);\n strings.raw = node.quasi.quasis.map((q) => q.value.raw);\n\n if (func === String.raw) {\n return { value: func(strings, ...expressions) }\n }\n }\n\n return null\n },\n\n TemplateLiteral(node, initialScope) {\n const expressions = getElementValues(node.expressions, initialScope);\n if (expressions != null) {\n let value = node.quasis[0].value.cooked;\n for (let i = 0; i < expressions.length; ++i) {\n value += expressions[i];\n value += node.quasis[i + 1].value.cooked;\n }\n return { value }\n }\n return null\n },\n\n UnaryExpression(node, initialScope) {\n if (node.operator === \"delete\") {\n // Not supported.\n return null\n }\n if (node.operator === \"void\") {\n return { value: undefined }\n }\n\n const arg = getStaticValueR(node.argument, initialScope);\n if (arg != null) {\n switch (node.operator) {\n case \"-\":\n return { value: -arg.value }\n case \"+\":\n return { value: +arg.value } //eslint-disable-line no-implicit-coercion\n case \"!\":\n return { value: !arg.value }\n case \"~\":\n return { value: ~arg.value }\n case \"typeof\":\n return { value: typeof arg.value }\n\n // no default\n }\n }\n\n return null\n },\n});\n\n/**\n * Get the value of a given node if it's a static value.\n * @param {Node} node The node to get.\n * @param {Scope|undefined} initialScope The scope to start finding variable.\n * @returns {{value:any}|{value:undefined,optional?:true}|null} The static value of the node, or `null`.\n */\nfunction getStaticValueR(node, initialScope) {\n if (node != null && Object.hasOwnProperty.call(operations, node.type)) {\n return operations[node.type](node, initialScope)\n }\n return null\n}\n\n/**\n * Get the static value of property name from a MemberExpression node or a Property node.\n * @param {Node} node The node to get.\n * @param {Scope} [initialScope] The scope to start finding variable. Optional. If the node is a computed property node and this scope was given, this checks the computed property name by the `getStringIfConstant` function with the scope, and returns the value of it.\n * @returns {{value:any}|{value:undefined,optional?:true}|null} The static value of the property name of the node, or `null`.\n */\nfunction getStaticPropertyNameValue(node, initialScope) {\n const nameNode = node.type === \"Property\" ? node.key : node.property;\n\n if (node.computed) {\n return getStaticValueR(nameNode, initialScope)\n }\n\n if (nameNode.type === \"Identifier\") {\n return { value: nameNode.name }\n }\n\n if (nameNode.type === \"Literal\") {\n if (nameNode.bigint) {\n return { value: nameNode.bigint }\n }\n return { value: String(nameNode.value) }\n }\n\n return null\n}\n\n/**\n * Get the value of a given node if it's a static value.\n * @param {Node} node The node to get.\n * @param {Scope} [initialScope] The scope to start finding variable. Optional. If this scope was given, this tries to resolve identifier references which are in the given node as much as possible.\n * @returns {{value:any}|{value:undefined,optional?:true}|null} The static value of the node, or `null`.\n */\nfunction getStaticValue(node, initialScope = null) {\n try {\n return getStaticValueR(node, initialScope)\n } catch (_error) {\n return null\n }\n}\n\n/**\n * Get the value of a given node if it's a literal or a template literal.\n * @param {Node} node The node to get.\n * @param {Scope} [initialScope] The scope to start finding variable. Optional. If the node is an Identifier node and this scope was given, this checks the variable of the identifier, and returns the value of it if the variable is a constant.\n * @returns {string|null} The value of the node, or `null`.\n */\nfunction getStringIfConstant(node, initialScope = null) {\n // Handle the literals that the platform doesn't support natively.\n if (node && node.type === \"Literal\" && node.value === null) {\n if (node.regex) {\n return `/${node.regex.pattern}/${node.regex.flags}`\n }\n if (node.bigint) {\n return node.bigint\n }\n }\n\n const evaluated = getStaticValue(node, initialScope);\n return evaluated && String(evaluated.value)\n}\n\n/**\n * Get the property name from a MemberExpression node or a Property node.\n * @param {Node} node The node to get.\n * @param {Scope} [initialScope] The scope to start finding variable. Optional. If the node is a computed property node and this scope was given, this checks the computed property name by the `getStringIfConstant` function with the scope, and returns the value of it.\n * @returns {string|null} The property name of the node.\n */\nfunction getPropertyName(node, initialScope) {\n switch (node.type) {\n case \"MemberExpression\":\n if (node.computed) {\n return getStringIfConstant(node.property, initialScope)\n }\n if (node.property.type === \"PrivateIdentifier\") {\n return null\n }\n return node.property.name\n\n case \"Property\":\n case \"MethodDefinition\":\n case \"PropertyDefinition\":\n if (node.computed) {\n return getStringIfConstant(node.key, initialScope)\n }\n if (node.key.type === \"Literal\") {\n return String(node.key.value)\n }\n if (node.key.type === \"PrivateIdentifier\") {\n return null\n }\n return node.key.name\n\n // no default\n }\n\n return null\n}\n\n/**\n * Get the name and kind of the given function node.\n * @param {ASTNode} node - The function node to get.\n * @param {SourceCode} [sourceCode] The source code object to get the code of computed property keys.\n * @returns {string} The name and kind of the function node.\n */\n// eslint-disable-next-line complexity\nfunction getFunctionNameWithKind(node, sourceCode) {\n const parent = node.parent;\n const tokens = [];\n const isObjectMethod = parent.type === \"Property\" && parent.value === node;\n const isClassMethod =\n parent.type === \"MethodDefinition\" && parent.value === node;\n const isClassFieldMethod =\n parent.type === \"PropertyDefinition\" && parent.value === node;\n\n // Modifiers.\n if (isClassMethod || isClassFieldMethod) {\n if (parent.static) {\n tokens.push(\"static\");\n }\n if (parent.key.type === \"PrivateIdentifier\") {\n tokens.push(\"private\");\n }\n }\n if (node.async) {\n tokens.push(\"async\");\n }\n if (node.generator) {\n tokens.push(\"generator\");\n }\n\n // Kinds.\n if (isObjectMethod || isClassMethod) {\n if (parent.kind === \"constructor\") {\n return \"constructor\"\n }\n if (parent.kind === \"get\") {\n tokens.push(\"getter\");\n } else if (parent.kind === \"set\") {\n tokens.push(\"setter\");\n } else {\n tokens.push(\"method\");\n }\n } else if (isClassFieldMethod) {\n tokens.push(\"method\");\n } else {\n if (node.type === \"ArrowFunctionExpression\") {\n tokens.push(\"arrow\");\n }\n tokens.push(\"function\");\n }\n\n // Names.\n if (isObjectMethod || isClassMethod || isClassFieldMethod) {\n if (parent.key.type === \"PrivateIdentifier\") {\n tokens.push(`#${parent.key.name}`);\n } else {\n const name = getPropertyName(parent);\n if (name) {\n tokens.push(`'${name}'`);\n } else if (sourceCode) {\n const keyText = sourceCode.getText(parent.key);\n if (!keyText.includes(\"\\n\")) {\n tokens.push(`[${keyText}]`);\n }\n }\n }\n } else if (node.id) {\n tokens.push(`'${node.id.name}'`);\n } else if (\n parent.type === \"VariableDeclarator\" &&\n parent.id &&\n parent.id.type === \"Identifier\"\n ) {\n tokens.push(`'${parent.id.name}'`);\n } else if (\n (parent.type === \"AssignmentExpression\" ||\n parent.type === \"AssignmentPattern\") &&\n parent.left &&\n parent.left.type === \"Identifier\"\n ) {\n tokens.push(`'${parent.left.name}'`);\n }\n\n return tokens.join(\" \")\n}\n\nconst typeConversionBinaryOps = Object.freeze(\n new Set([\n \"==\",\n \"!=\",\n \"<\",\n \"<=\",\n \">\",\n \">=\",\n \"<<\",\n \">>\",\n \">>>\",\n \"+\",\n \"-\",\n \"*\",\n \"/\",\n \"%\",\n \"|\",\n \"^\",\n \"&\",\n \"in\",\n ]),\n);\nconst typeConversionUnaryOps = Object.freeze(new Set([\"-\", \"+\", \"!\", \"~\"]));\n\n/**\n * Check whether the given value is an ASTNode or not.\n * @param {any} x The value to check.\n * @returns {boolean} `true` if the value is an ASTNode.\n */\nfunction isNode(x) {\n return x !== null && typeof x === \"object\" && typeof x.type === \"string\"\n}\n\nconst visitor = Object.freeze(\n Object.assign(Object.create(null), {\n $visit(node, options, visitorKeys) {\n const { type } = node;\n\n if (typeof this[type] === \"function\") {\n return this[type](node, options, visitorKeys)\n }\n\n return this.$visitChildren(node, options, visitorKeys)\n },\n\n $visitChildren(node, options, visitorKeys) {\n const { type } = node;\n\n for (const key of visitorKeys[type] || evk.getKeys(node)) {\n const value = node[key];\n\n if (Array.isArray(value)) {\n for (const element of value) {\n if (\n isNode(element) &&\n this.$visit(element, options, visitorKeys)\n ) {\n return true\n }\n }\n } else if (\n isNode(value) &&\n this.$visit(value, options, visitorKeys)\n ) {\n return true\n }\n }\n\n return false\n },\n\n ArrowFunctionExpression() {\n return false\n },\n AssignmentExpression() {\n return true\n },\n AwaitExpression() {\n return true\n },\n BinaryExpression(node, options, visitorKeys) {\n if (\n options.considerImplicitTypeConversion &&\n typeConversionBinaryOps.has(node.operator) &&\n (node.left.type !== \"Literal\" || node.right.type !== \"Literal\")\n ) {\n return true\n }\n return this.$visitChildren(node, options, visitorKeys)\n },\n CallExpression() {\n return true\n },\n FunctionExpression() {\n return false\n },\n ImportExpression() {\n return true\n },\n MemberExpression(node, options, visitorKeys) {\n if (options.considerGetters) {\n return true\n }\n if (\n options.considerImplicitTypeConversion &&\n node.computed &&\n node.property.type !== \"Literal\"\n ) {\n return true\n }\n return this.$visitChildren(node, options, visitorKeys)\n },\n MethodDefinition(node, options, visitorKeys) {\n if (\n options.considerImplicitTypeConversion &&\n node.computed &&\n node.key.type !== \"Literal\"\n ) {\n return true\n }\n return this.$visitChildren(node, options, visitorKeys)\n },\n NewExpression() {\n return true\n },\n Property(node, options, visitorKeys) {\n if (\n options.considerImplicitTypeConversion &&\n node.computed &&\n node.key.type !== \"Literal\"\n ) {\n return true\n }\n return this.$visitChildren(node, options, visitorKeys)\n },\n PropertyDefinition(node, options, visitorKeys) {\n if (\n options.considerImplicitTypeConversion &&\n node.computed &&\n node.key.type !== \"Literal\"\n ) {\n return true\n }\n return this.$visitChildren(node, options, visitorKeys)\n },\n UnaryExpression(node, options, visitorKeys) {\n if (node.operator === \"delete\") {\n return true\n }\n if (\n options.considerImplicitTypeConversion &&\n typeConversionUnaryOps.has(node.operator) &&\n node.argument.type !== \"Literal\"\n ) {\n return true\n }\n return this.$visitChildren(node, options, visitorKeys)\n },\n UpdateExpression() {\n return true\n },\n YieldExpression() {\n return true\n },\n }),\n);\n\n/**\n * Check whether a given node has any side effect or not.\n * @param {Node} node The node to get.\n * @param {SourceCode} sourceCode The source code object.\n * @param {object} [options] The option object.\n * @param {boolean} [options.considerGetters=false] If `true` then it considers member accesses as the node which has side effects.\n * @param {boolean} [options.considerImplicitTypeConversion=false] If `true` then it considers implicit type conversion as the node which has side effects.\n * @param {object} [options.visitorKeys=evk.KEYS] The keys to traverse nodes. Use `context.getSourceCode().visitorKeys`.\n * @returns {boolean} `true` if the node has a certain side effect.\n */\nfunction hasSideEffect(\n node,\n sourceCode,\n { considerGetters = false, considerImplicitTypeConversion = false } = {},\n) {\n return visitor.$visit(\n node,\n { considerGetters, considerImplicitTypeConversion },\n sourceCode.visitorKeys || evk.KEYS,\n )\n}\n\n/**\n * Get the left parenthesis of the parent node syntax if it exists.\n * E.g., `if (a) {}` then the `(`.\n * @param {Node} node The AST node to check.\n * @param {SourceCode} sourceCode The source code object to get tokens.\n * @returns {Token|null} The left parenthesis of the parent node syntax\n */\nfunction getParentSyntaxParen(node, sourceCode) {\n const parent = node.parent;\n\n switch (parent.type) {\n case \"CallExpression\":\n case \"NewExpression\":\n if (parent.arguments.length === 1 && parent.arguments[0] === node) {\n return sourceCode.getTokenAfter(\n parent.callee,\n isOpeningParenToken,\n )\n }\n return null\n\n case \"DoWhileStatement\":\n if (parent.test === node) {\n return sourceCode.getTokenAfter(\n parent.body,\n isOpeningParenToken,\n )\n }\n return null\n\n case \"IfStatement\":\n case \"WhileStatement\":\n if (parent.test === node) {\n return sourceCode.getFirstToken(parent, 1)\n }\n return null\n\n case \"ImportExpression\":\n if (parent.source === node) {\n return sourceCode.getFirstToken(parent, 1)\n }\n return null\n\n case \"SwitchStatement\":\n if (parent.discriminant === node) {\n return sourceCode.getFirstToken(parent, 1)\n }\n return null\n\n case \"WithStatement\":\n if (parent.object === node) {\n return sourceCode.getFirstToken(parent, 1)\n }\n return null\n\n default:\n return null\n }\n}\n\n/**\n * Check whether a given node is parenthesized or not.\n * @param {number} times The number of parantheses.\n * @param {Node} node The AST node to check.\n * @param {SourceCode} sourceCode The source code object to get tokens.\n * @returns {boolean} `true` if the node is parenthesized the given times.\n */\n/**\n * Check whether a given node is parenthesized or not.\n * @param {Node} node The AST node to check.\n * @param {SourceCode} sourceCode The source code object to get tokens.\n * @returns {boolean} `true` if the node is parenthesized.\n */\nfunction isParenthesized(\n timesOrNode,\n nodeOrSourceCode,\n optionalSourceCode,\n) {\n let times, node, sourceCode, maybeLeftParen, maybeRightParen;\n if (typeof timesOrNode === \"number\") {\n times = timesOrNode | 0;\n node = nodeOrSourceCode;\n sourceCode = optionalSourceCode;\n if (!(times >= 1)) {\n throw new TypeError(\"'times' should be a positive integer.\")\n }\n } else {\n times = 1;\n node = timesOrNode;\n sourceCode = nodeOrSourceCode;\n }\n\n if (\n node == null ||\n // `CatchClause.param` can't be parenthesized, example `try {} catch (error) {}`\n (node.parent.type === \"CatchClause\" && node.parent.param === node)\n ) {\n return false\n }\n\n maybeLeftParen = maybeRightParen = node;\n do {\n maybeLeftParen = sourceCode.getTokenBefore(maybeLeftParen);\n maybeRightParen = sourceCode.getTokenAfter(maybeRightParen);\n } while (\n maybeLeftParen != null &&\n maybeRightParen != null &&\n isOpeningParenToken(maybeLeftParen) &&\n isClosingParenToken(maybeRightParen) &&\n // Avoid false positive such as `if (a) {}`\n maybeLeftParen !== getParentSyntaxParen(node, sourceCode) &&\n --times > 0\n )\n\n return times === 0\n}\n\n/**\n * @author Toru Nagashima <https://github.com/mysticatea>\n * See LICENSE file in root directory for full license.\n */\n\nconst placeholder = /\\$(?:[$&`']|[1-9][0-9]?)/gu;\n\n/** @type {WeakMap<PatternMatcher, {pattern:RegExp,escaped:boolean}>} */\nconst internal = new WeakMap();\n\n/**\n * Check whether a given character is escaped or not.\n * @param {string} str The string to check.\n * @param {number} index The location of the character to check.\n * @returns {boolean} `true` if the character is escaped.\n */\nfunction isEscaped(str, index) {\n let escaped = false;\n for (let i = index - 1; i >= 0 && str.charCodeAt(i) === 0x5c; --i) {\n escaped = !escaped;\n }\n return escaped\n}\n\n/**\n * Replace a given string by a given matcher.\n * @param {PatternMatcher} matcher The pattern matcher.\n * @param {string} str The string to be replaced.\n * @param {string} replacement The new substring to replace each matched part.\n * @returns {string} The replaced string.\n */\nfunction replaceS(matcher, str, replacement) {\n const chunks = [];\n let index = 0;\n\n /** @type {RegExpExecArray} */\n let match = null;\n\n /**\n * @param {string} key The placeholder.\n * @returns {string} The replaced string.\n */\n function replacer(key) {\n switch (key) {\n case \"$$\":\n return \"$\"\n case \"$&\":\n return match[0]\n case \"$`\":\n return str.slice(0, match.index)\n case \"$'\":\n return str.slice(match.index + match[0].length)\n default: {\n const i = key.slice(1);\n if (i in match) {\n return match[i]\n }\n return key\n }\n }\n }\n\n for (match of matcher.execAll(str)) {\n chunks.push(str.slice(index, match.index));\n chunks.push(replacement.replace(placeholder, replacer));\n index = match.index + match[0].length;\n }\n chunks.push(str.slice(index));\n\n return chunks.join(\"\")\n}\n\n/**\n * Replace a given string by a given matcher.\n * @param {PatternMatcher} matcher The pattern matcher.\n * @param {string} str The string to be replaced.\n * @param {(...strs[])=>string} replace The function to replace each matched part.\n * @returns {string} The replaced string.\n */\nfunction replaceF(matcher, str, replace) {\n const chunks = [];\n let index = 0;\n\n for (const match of matcher.execAll(str)) {\n chunks.push(str.slice(index, match.index));\n chunks.push(String(replace(...match, match.index, match.input)));\n index = match.index + match[0].length;\n }\n chunks.push(str.slice(index));\n\n return chunks.join(\"\")\n}\n\n/**\n * The class to find patterns as considering escape sequences.\n */\nclass PatternMatcher {\n /**\n * Initialize this matcher.\n * @param {RegExp} pattern The pattern to match.\n * @param {{escaped:boolean}} options The options.\n */\n constructor(pattern, { escaped = false } = {}) {\n if (!(pattern instanceof RegExp)) {\n throw new TypeError(\"'pattern' should be a RegExp instance.\")\n }\n if (!pattern.flags.includes(\"g\")) {\n throw new Error(\"'pattern' should contains 'g' flag.\")\n }\n\n internal.set(this, {\n pattern: new RegExp(pattern.source, pattern.flags),\n escaped: Boolean(escaped),\n });\n }\n\n /**\n * Find the pattern in a given string.\n * @param {string} str The string to find.\n * @returns {IterableIterator<RegExpExecArray>} The iterator which iterate the matched information.\n */\n *execAll(str) {\n const { pattern, escaped } = internal.get(this);\n let match = null;\n let lastIndex = 0;\n\n pattern.lastIndex = 0;\n while ((match = pattern.exec(str)) != null) {\n if (escaped || !isEscaped(str, match.index)) {\n lastIndex = pattern.lastIndex;\n yield match;\n pattern.lastIndex = lastIndex;\n }\n }\n }\n\n /**\n * Check whether the pattern is found in a given string.\n * @param {string} str The string to check.\n * @returns {boolean} `true` if the pattern was found in the string.\n */\n test(str) {\n const it = this.execAll(str);\n const ret = it.next();\n return !ret.done\n }\n\n /**\n * Replace a given string.\n * @param {string} str The string to be replaced.\n * @param {(string|((...strs:string[])=>string))} replacer The string or function to replace. This is the same as the 2nd argument of `String.prototype.replace`.\n * @returns {string} The replaced string.\n */\n [Symbol.replace](str, replacer) {\n return typeof replacer === \"function\"\n ? replaceF(this, String(str), replacer)\n : replaceS(this, String(str), String(replacer))\n }\n}\n\nconst IMPORT_TYPE = /^(?:Import|Export(?:All|Default|Named))Declaration$/u;\nconst has = Function.call.bind(Object.hasOwnProperty);\n\nconst READ = Symbol(\"read\");\nconst CALL = Symbol(\"call\");\nconst CONSTRUCT = Symbol(\"construct\");\nconst ESM = Symbol(\"esm\");\n\nconst requireCall = { require: { [CALL]: true } };\n\n/**\n * Check whether a given variable is modified or not.\n * @param {Variable} variable The variable to check.\n * @returns {boolean} `true` if the variable is modified.\n */\nfunction isModifiedGlobal(variable) {\n return (\n variable == null ||\n variable.defs.length !== 0 ||\n variable.references.some((r) => r.isWrite())\n )\n}\n\n/**\n * Check if the value of a given node is passed through to the parent syntax as-is.\n * For example, `a` and `b` in (`a || b` and `c ? a : b`) are passed through.\n * @param {Node} node A node to check.\n * @returns {boolean} `true` if the node is passed through.\n */\nfunction isPassThrough(node) {\n const parent = node.parent;\n\n switch (parent && parent.type) {\n case \"ConditionalExpression\":\n return parent.consequent === node || parent.alternate === node\n case \"LogicalExpression\":\n return true\n case \"SequenceExpression\":\n return parent.expressions[parent.expressions.length - 1] === node\n case \"ChainExpression\":\n return true\n\n default:\n return false\n }\n}\n\n/**\n * The reference tracker.\n */\nclass ReferenceTracker {\n /**\n * Initialize this tracker.\n * @param {Scope} globalScope The global scope.\n * @param {object} [options] The options.\n * @param {\"legacy\"|\"strict\"} [options.mode=\"strict\"] The mode to determine the ImportDeclaration's behavior for CJS modules.\n * @param {string[]} [options.globalObjectNames=[\"global\",\"globalThis\",\"self\",\"window\"]] The variable names for Global Object.\n */\n constructor(\n globalScope,\n {\n mode = \"strict\",\n globalObjectNames = [\"global\", \"globalThis\", \"self\", \"window\"],\n } = {},\n ) {\n this.variableStack = [];\n this.globalScope = globalScope;\n this.mode = mode;\n this.globalObjectNames = globalObjectNames.slice(0);\n }\n\n /**\n * Iterate the references of global variables.\n * @param {object} traceMap The trace map.\n * @returns {IterableIterator<{node:Node,path:string[],type:symbol,info:any}>} The iterator to iterate references.\n */\n *iterateGlobalReferences(traceMap) {\n for (const key of Object.keys(traceMap)) {\n const nextTraceMap = traceMap[key];\n const path = [key];\n const variable = this.globalScope.set.get(key);\n\n if (isModifiedGlobal(variable)) {\n continue\n }\n\n yield* this._iterateVariableReferences(\n variable,\n path,\n nextTraceMap,\n true,\n );\n }\n\n for (const key of this.globalObjectNames) {\n const path = [];\n const variable = this.globalScope.set.get(key);\n\n if (isModifiedGlobal(variable)) {\n continue\n }\n\n yield* this._iterateVariableReferences(\n variable,\n path,\n traceMap,\n false,\n );\n }\n }\n\n /**\n * Iterate the references of CommonJS modules.\n * @param {object} traceMap The trace map.\n * @returns {IterableIterator<{node:Node,path:string[],type:symbol,info:any}>} The iterator to iterate references.\n */\n *iterateCjsReferences(traceMap) {\n for (const { node } of this.iterateGlobalReferences(requireCall)) {\n const key = getStringIfConstant(node.arguments[0]);\n if (key == null || !has(traceMap, key)) {\n continue\n }\n\n const nextTraceMap = traceMap[key];\n const path = [key];\n\n if (nextTraceMap[READ]) {\n yield {\n node,\n path,\n type: READ,\n info: nextTraceMap[READ],\n };\n }\n yield* this._iteratePropertyReferences(node, path, nextTraceMap);\n }\n }\n\n /**\n * Iterate the references of ES modules.\n * @param {object} traceMap The trace map.\n * @returns {IterableIterator<{node:Node,path:string[],type:symbol,info:any}>} The iterator to iterate references.\n */\n *iterateEsmReferences(traceMap) {\n const programNode = this.globalScope.block;\n\n for (const node of programNode.body) {\n if (!IMPORT_TYPE.test(node.type) || node.source == null) {\n continue\n }\n const moduleId = node.source.value;\n\n if (!has(traceMap, moduleId)) {\n continue\n }\n const nextTraceMap = traceMap[moduleId];\n const path = [moduleId];\n\n if (nextTraceMap[READ]) {\n yield { node, path, type: READ, info: nextTraceMap[READ] };\n }\n\n if (node.type === \"ExportAllDeclaration\") {\n for (const key of Object.keys(nextTraceMap)) {\n const exportTraceMap = nextTraceMap[key];\n if (exportTraceMap[READ]) {\n yield {\n node,\n path: path.concat(key),\n type: READ,\n info: exportTraceMap[READ],\n };\n }\n }\n } else {\n for (const specifier of node.specifiers) {\n const esm = has(nextTraceMap, ESM);\n const it = this._iterateImportReferences(\n specifier,\n path,\n esm\n ? nextTraceMap\n : this.mode === \"legacy\"\n ? { default: nextTraceMap, ...nextTraceMap }\n : { default: nextTraceMap },\n );\n\n if (esm) {\n yield* it;\n } else {\n for (const report of it) {\n report.path = report.path.filter(exceptDefault);\n if (\n report.path.length >= 2 ||\n report.type !== READ\n ) {\n yield report;\n }\n }\n }\n }\n }\n }\n }\n\n /**\n * Iterate the references for a given variable.\n * @param {Variable} variable The variable to iterate that references.\n * @param {string[]} path The current path.\n * @param {object} traceMap The trace map.\n * @param {boolean} shouldReport = The flag to report those references.\n * @returns {IterableIterator<{node:Node,path:string[],type:symbol,info:any}>} The iterator to iterate references.\n */\n *_iterateVariableReferences(variable, path, traceMap, shouldReport) {\n if (this.variableStack.includes(variable)) {\n return\n }\n this.variableStack.push(variable);\n try {\n for (const reference of variable.references) {\n if (!reference.isRead()) {\n continue\n }\n const node = reference.identifier;\n\n if (shouldReport && traceMap[READ]) {\n yield { node, path, type: READ, info: traceMap[READ] };\n }\n yield* this._iteratePropertyReferences(node, path, traceMap);\n }\n } finally {\n this.variableStack.pop();\n }\n }\n\n /**\n * Iterate the references for a given AST node.\n * @param rootNode The AST node to iterate references.\n * @param {string[]} path The current path.\n * @param {object} traceMap The trace map.\n * @returns {IterableIterator<{node:Node,path:string[],type:symbol,info:any}>} The iterator to iterate references.\n */\n //eslint-disable-next-line complexity\n *_iteratePropertyReferences(rootNode, path, traceMap) {\n let node = rootNode;\n while (isPassThrough(node)) {\n node = node.parent;\n }\n\n const parent = node.parent;\n if (parent.type === \"MemberExpression\") {\n if (parent.object === node) {\n const key = getPropertyName(parent);\n if (key == null || !has(traceMap, key)) {\n return\n }\n\n path = path.concat(key); //eslint-disable-line no-param-reassign\n const nextTraceMap = traceMap[key];\n if (nextTraceMap[READ]) {\n yield {\n node: parent,\n path,\n type: READ,\n info: nextTraceMap[READ],\n };\n }\n yield* this._iteratePropertyReferences(\n parent,\n path,\n nextTraceMap,\n );\n }\n return\n }\n if (parent.type === \"CallExpression\") {\n if (parent.callee === node && traceMap[CALL]) {\n yield { node: parent, path, type: CALL, info: traceMap[CALL] };\n }\n return\n }\n if (parent.type === \"NewExpression\") {\n if (parent.callee === node && traceMap[CONSTRUCT]) {\n yield {\n node: parent,\n path,\n type: CONSTRUCT,\n info: traceMap[CONSTRUCT],\n };\n }\n return\n }\n if (parent.type === \"AssignmentExpression\") {\n if (parent.right === node) {\n yield* this._iterateLhsReferences(parent.left, path, traceMap);\n yield* this._iteratePropertyReferences(parent, path, traceMap);\n }\n return\n }\n if (parent.type === \"AssignmentPattern\") {\n if (parent.right === node) {\n yield* this._iterateLhsReferences(parent.left, path, traceMap);\n }\n return\n }\n if (parent.type === \"VariableDeclarator\") {\n if (parent.init === node) {\n yield* this._iterateLhsReferences(parent.id, path, traceMap);\n }\n }\n }\n\n /**\n * Iterate the references for a given Pattern node.\n * @param {Node} patternNode The Pattern node to iterate references.\n * @param {string[]} path The current path.\n * @param {object} traceMap The trace map.\n * @returns {IterableIterator<{node:Node,path:string[],type:symbol,info:any}>} The iterator to iterate references.\n */\n *_iterateLhsReferences(patternNode, path, traceMap) {\n if (patternNode.type === \"Identifier\") {\n const variable = findVariable(this.globalScope, patternNode);\n if (variable != null) {\n yield* this._iterateVariableReferences(\n variable,\n path,\n traceMap,\n false,\n );\n }\n return\n }\n if (patternNode.type === \"ObjectPattern\") {\n for (const property of patternNode.properties) {\n const key = getPropertyName(property);\n\n if (key == null || !has(traceMap, key)) {\n continue\n }\n\n const nextPath = path.concat(key);\n const nextTraceMap = traceMap[key];\n if (nextTraceMap[READ]) {\n yield {\n node: property,\n path: nextPath,\n type: READ,\n info: nextTraceMap[READ],\n };\n }\n yield* this._iterateLhsReferences(\n property.value,\n nextPath,\n nextTraceMap,\n );\n }\n return\n }\n if (patternNode.type === \"AssignmentPattern\") {\n yield* this._iterateLhsReferences(patternNode.left, path, traceMap);\n }\n }\n\n /**\n * Iterate the references for a given ModuleSpecifier node.\n * @param {Node} specifierNode The ModuleSpecifier node to iterate references.\n * @param {string[]} path The current path.\n * @param {object} traceMap The trace map.\n * @returns {IterableIterator<{node:Node,path:string[],type:symbol,info:any}>} The iterator to iterate references.\n */\n *_iterateImportReferences(specifierNode, path, traceMap) {\n const type = specifierNode.type;\n\n if (type === \"ImportSpecifier\" || type === \"ImportDefaultSpecifier\") {\n const key =\n type === \"ImportDefaultSpecifier\"\n ? \"default\"\n : specifierNode.imported.name;\n if (!has(traceMap, key)) {\n return\n }\n\n path = path.concat(key); //eslint-disable-line no-param-reassign\n const nextTraceMap = traceMap[key];\n if (nextTraceMap[READ]) {\n yield {\n node: specifierNode,\n path,\n type: READ,\n info: nextTraceMap[READ],\n };\n }\n yield* this._iterateVariableReferences(\n findVariable(this.globalScope, specifierNode.local),\n path,\n nextTraceMap,\n false,\n );\n\n return\n }\n\n if (type === \"ImportNamespaceSpecifier\") {\n yield* this._iterateVariableReferences(\n findVariable(this.globalScope, specifierNode.local),\n path,\n traceMap,\n false,\n );\n return\n }\n\n if (type === \"ExportSpecifier\") {\n const key = specifierNode.local.name;\n if (!has(traceMap, key)) {\n return\n }\n\n path = path.concat(key); //eslint-disable-line no-param-reassign\n const nextTraceMap = traceMap[key];\n if (nextTraceMap[READ]) {\n yield {\n node: specifierNode,\n path,\n type: READ,\n info: nextTraceMap[READ],\n };\n }\n }\n }\n}\n\nReferenceTracker.READ = READ;\nReferenceTracker.CALL = CALL;\nReferenceTracker.CONSTRUCT = CONSTRUCT;\nReferenceTracker.ESM = ESM;\n\n/**\n * This is a predicate function for Array#filter.\n * @param {string} name A name part.\n * @param {number} index The index of the name.\n * @returns {boolean} `false` if it's default.\n */\nfunction exceptDefault(name, index) {\n return !(index === 1 && name === \"default\")\n}\n\nvar index = {\n CALL,\n CONSTRUCT,\n ESM,\n findVariable,\n getFunctionHeadLocation,\n getFunctionNameWithKind,\n getInnermostScope,\n getPropertyName,\n getStaticValue,\n getStringIfConstant,\n hasSideEffect,\n isArrowToken,\n isClosingBraceToken,\n isClosingBracketToken,\n isClosingParenToken,\n isColonToken,\n isCommaToken,\n isCommentToken,\n isNotArrowToken,\n isNotClosingBraceToken,\n isNotClosingBracketToken,\n isNotClosingParenToken,\n isNotColonToken,\n isNotCommaToken,\n isNotCommentToken,\n isNotOpeningBraceToken,\n isNotOpeningBracketToken,\n isNotOpeningParenToken,\n isNotSemicolonToken,\n isOpeningBraceToken,\n isOpeningBracketToken,\n isOpeningParenToken,\n isParenthesized,\n isSemicolonToken,\n PatternMatcher,\n READ,\n ReferenceTracker,\n};\n\nexport default index;\nexport { CALL, CONSTRUCT, ESM, PatternMatcher, READ, ReferenceTracker, findVariable, getFunctionHeadLocation, getFunctionNameWithKind, getInnermostScope, getPropertyName, getStaticValue, getStringIfConstant, hasSideEffect, isArrowToken, isClosingBraceToken, isClosingBracketToken, isClosingParenToken, isColonToken, isCommaToken, isCommentToken, isNotArrowToken, isNotClosingBraceToken, isNotClosingBracketToken, isNotClosingParenToken, isNotColonToken, isNotCommaToken, isNotCommentToken, isNotOpeningBraceToken, isNotOpeningBracketToken, isNotOpeningParenToken, isNotSemicolonToken, isOpeningBraceToken, isOpeningBracketToken, isOpeningParenToken, isParenthesized, isSemicolonToken };\n//# sourceMappingURL=index.mjs.map\n","import { findVariable } from \"eslint-utils\";\n\nexport const traverse = (context, node, visit, visited = new Set()) => {\n if (visited.has(node)) {\n return;\n }\n\n visited.add(node);\n visit(node);\n\n (context.sourceCode.visitorKeys[node.type] || [])\n .map((key) => node[key])\n // Some `visitorKeys` are optional, e.g. `IfStatement.alternate`.\n .filter(Boolean)\n // Can be an array, like `CallExpression.arguments`\n .flatMap((child) => (Array.isArray(child) ? child : [child]))\n // Can rarely be `null`, e.g. `ArrayPattern.elements[1]` when an element is skipped - `const [a, , b] = arr`\n .filter(Boolean)\n // Check it's a valid AST node\n .filter((child) => typeof child.type === \"string\")\n .forEach((child) => traverse(context, child, visit, visited));\n};\n\nexport const findDownstreamNodes = (context, topNode, type) => {\n const nodes = [];\n traverse(context, topNode, (node) => {\n if (node.type === type) {\n nodes.push(node);\n }\n });\n return nodes;\n};\n\nexport const getUpstreamVariables = (\n context,\n variable,\n filter,\n visited = new Set(),\n) => {\n if (visited.has(variable)) {\n return [];\n }\n\n visited.add(variable);\n\n const upstreamVariables = variable.defs\n // TODO: https://github.com/NickvanDyke/eslint-plugin-react-you-might-not-need-an-effect/issues/34\n // `init` covers for arrow functions; also needs `body` to descend into function declarations\n // But then for function parameters (including props), `def.node.body` is the body of the function that they belong to,\n // so we get *all* the downstream refs in it...\n // We only want to descend when we're traversing up the function itself; no its parameters.\n // Probably similar logic to in `getUpstreamReactVariables`.\n .filter((def) => !!def.node.init)\n .filter((def) => filter(def.node))\n .flatMap((def) => getDownstreamRefs(context, def.node.init))\n .map((ref) => ref.resolved)\n // I think this only happens when:\n // 1. There's genuinely no variable, i.e. `node` is a literal\n // 2. Import statement is missing\n // 3. ESLint globals are misconfigured\n .filter(Boolean)\n .flatMap((variable) =>\n getUpstreamVariables(context, variable, filter, visited),\n );\n\n // Ultimately return only leaf variables\n return upstreamVariables.length === 0 ? [variable] : upstreamVariables;\n};\n\nexport const getDownstreamRefs = (context, node) =>\n findDownstreamNodes(context, node, \"Identifier\")\n .map((identifier) => getRef(context, identifier))\n .filter(Boolean);\n\nconst getRef = (context, identifier) =>\n findVariable(\n context.sourceCode.getScope(identifier),\n identifier,\n )?.references.find((ref) => ref.identifier === identifier);\n\nexport const getCallExpr = (ref, current = ref.identifier.parent) => {\n if (current.type === \"CallExpression\") {\n // We've reached the top - confirm that the ref is the (eventual) callee, as opposed to an argument.\n let node = ref.identifier;\n while (node.parent.type === \"MemberExpression\") {\n node = node.parent;\n }\n\n if (current.callee === node) {\n return current;\n }\n }\n\n if (current.type === \"MemberExpression\") {\n return getCallExpr(ref, current.parent);\n }\n\n return undefined;\n};\n","import { getUpstreamVariables, getDownstreamRefs, getCallExpr } from \"./ast.js\";\n\nexport const isReactFunctionalComponent = (node) =>\n (node.type === \"FunctionDeclaration\" ||\n (node.type === \"VariableDeclarator\" &&\n (node.init.type === \"ArrowFunctionExpression\" ||\n node.init.type === \"CallExpression\"))) &&\n node.id.type === \"Identifier\" &&\n node.id.name[0].toUpperCase() === node.id.name[0];\n\n// NOTE: Returns false for known pure HOCs -- `memo` and `forwardRef`.\n// Basically this is meant to detect custom HOCs that may have side effects, particularly when using their props.\n// TODO: Will not detect when they define the component normally and then export it wrapped in the HOC.\n// e.g. `const MyComponent = (props) => {...}; export default memo(MyComponent);`\nexport const isReactFunctionalHOC = (node) =>\n node.type === \"VariableDeclarator\" &&\n node.init &&\n node.init.type === \"CallExpression\" &&\n node.init.callee.type === \"Identifier\" &&\n ![\"memo\", \"forwardRef\"].includes(node.init.callee.name) &&\n node.init.arguments.length > 0 &&\n (node.init.arguments[0].type === \"ArrowFunctionExpression\" ||\n node.init.arguments[0].type === \"FunctionExpression\") &&\n node.id.type === \"Identifier\" &&\n node.id.name[0].toUpperCase() === node.id.name[0];\n\nexport const isCustomHook = (node) =>\n (node.type === \"FunctionDeclaration\" ||\n (node.type === \"VariableDeclarator\" &&\n node.init &&\n (node.init.type === \"ArrowFunctionExpression\" ||\n node.init.type === \"FunctionExpression\"))) &&\n node.id.type === \"Identifier\" &&\n node.id.name.startsWith(\"use\") &&\n node.id.name[3] === node.id.name[3].toUpperCase();\n\nexport const isUseState = (node) =>\n node.type === \"VariableDeclarator\" &&\n node.init &&\n node.init.type === \"CallExpression\" &&\n node.init.callee.name === \"useState\" &&\n node.id.type === \"ArrayPattern\" &&\n // Not sure its usecase, but may just have the setter\n (node.id.elements.length === 1 || node.id.elements.length === 2) &&\n node.id.elements.every((el) => {\n // Apparently skipping the state element is a valid use.\n // I suppose technically the state can still be read via setter callback.\n return !el || el.type === \"Identifier\";\n });\n\n// While it *could* be an anti-pattern or unnecessary, effects *are* meant to synchronize systems.\n// So we presume that a \"subscription effect\" is usually valid, or at least may be more readable.\n// TODO: We might be able to use this more granularly, e.g. ignore state setters inside a subscription effect,\n// instead of ignoring the whole effect...? But it'd have to be more complicated, like also ignore the same state setters called in the body.\nexport const hasCleanup = (node) => {\n const effectFn = node.arguments[0];\n return (\n (effectFn.type === \"ArrowFunctionExpression\" ||\n effectFn.type === \"FunctionExpression\") &&\n effectFn.body.type === \"BlockStatement\" &&\n effectFn.body.body.some(\n (stmt) => stmt.type === \"ReturnStatement\" && stmt.argument,\n )\n );\n};\n\nexport const isPropDef = (def) => {\n const declaringNode =\n def.node.type === \"ArrowFunctionExpression\"\n ? def.node.parent.type === \"CallExpression\"\n ? def.node.parent.parent\n : def.node.parent\n : def.node;\n return (\n def.type === \"Parameter\" &&\n ((isReactFunctionalComponent(declaringNode) &&\n !isReactFunctionalHOC(declaringNode)) ||\n isCustomHook(declaringNode))\n );\n};\n\nexport const isUseRef = (node) =>\n node.type === \"VariableDeclarator\" &&\n node.init &&\n node.init.type === \"CallExpression\" &&\n node.init.callee.name === \"useRef\" &&\n node.id.type === \"Identifier\";\n\n// NOTE: Does not include `useLayoutEffect`.\n// When used correctly, it interacts with the DOM = external system = (probably) valid effect.\n// When used incorrectly, it's probably too difficult to accurately analyze anyway.\nexport const isUseEffect = (node) =>\n node.type === \"CallExpression\" &&\n ((node.callee.type === \"Identifier\" && node.callee.name === \"useEffect\") ||\n (node.callee.type === \"MemberExpression\" &&\n node.callee.object.name === \"React\" &&\n node.callee.property.name === \"useEffect\"));\n\n// NOTE: When `MemberExpression` (even nested ones), a `Reference` is only the root object, not the function.\nexport const getEffectFnRefs = (context, node) => {\n if (!isUseEffect(node) || node.arguments.length < 1) {\n return undefined;\n }\n\n const effectFn = node.arguments[0];\n if (\n effectFn.type !== \"ArrowFunctionExpression\" &&\n effectFn.type !== \"FunctionExpression\"\n ) {\n return undefined;\n }\n\n return getDownstreamRefs(context, effectFn);\n};\n\nexport function getEffectDepsRefs(context, node) {\n if (!isUseEffect(node) || node.arguments.length < 2) {\n return undefined;\n }\n\n const depsArr = node.arguments[1];\n if (depsArr.type !== \"ArrayExpression\") {\n return undefined;\n }\n\n return getDownstreamRefs(context, depsArr);\n}\n\n// NOTE: These return true for MemberExpressions *on* state, like `list.concat()`.\n// Arguably preferable, as mutating the state is functionally the same as calling the setter.\n// (Even though that is not recommended and should be prevented by a different rule).\n// And in the case of a prop, we can't differentiate state mutations from callbacks anyway.\nexport const isStateSetter = (context, ref) =>\n getCallExpr(ref) !== undefined && isState(context, ref);\nexport const isPropCallback = (context, ref) =>\n getCallExpr(ref) !== undefined && isProp(context, ref);\n\n// NOTE: Global variables (like `JSON` in `JSON.stringify()`) have an empty `defs`; fortunately `[].some() === false`.\n// Also, I'm not sure so far when `defs.length > 1`... haven't seen it with shadowed variables or even redeclared variables with `var`.\nexport const isState = (context, ref) =>\n getUpstreamReactVariables(context, ref.resolved).notEmptyEvery((variable) =>\n variable.defs.some((def) => isUseState(def.node)),\n );\n// Returns false for props of HOCs like `withRouter` because they usually have side effects.\nexport const isProp = (context, ref) =>\n getUpstreamReactVariables(context, ref.resolved).notEmptyEvery((variable) =>\n variable.defs.some((def) => isPropDef(def)),\n );\nexport const isRef = (context, ref) =>\n getUpstreamReactVariables(context, ref.resolved).notEmptyEvery((variable) =>\n variable.defs.some((def) => isUseRef(def.node)),\n );\n\n// TODO: Surely can be simplified/re-use other functions.\n// Needs a better API too so we can more easily get names etc. for messages.\nexport const getUseStateNode = (context, ref) => {\n return getUpstreamReactVariables(context, ref.resolved)\n .find((variable) => variable.defs.some((def) => isUseState(def.node)))\n ?.defs.find((def) => isUseState(def.node))?.node;\n};\n\n/**\n * Walks up the AST until a `useEffect` call, returning `false` if never found, or finds any of the following on the way:\n * - An async function\n * - A function declaration, which may be called at an arbitrary later time\n * - A function passed as a callback to another function or `new` - event handler, `setTimeout`, `Promise.then()` `new ResizeObserver()`, etc.\n *\n * Otherwise returns `true`.\n *\n * Inspired by https://eslint-react.xyz/docs/rules/hooks-extra-no-direct-set-state-in-use-effect\n */\nexport const isImmediateCall = (node) => {\n if (!node.parent) {\n // Reached the top of the program without finding a `useEffect`\n return false;\n } else if (isUseEffect(node.parent)) {\n return true;\n } else if (\n // Obviously not immediate if async. I think this never occurs in isolation from the below conditions? But just in case for now.\n node.async ||\n // Inside a named or anonymous function that may be called later, either as a callback or by the developer.\n // Note while we return false for *this* call, we may still return true for a call to the function containing this call.\n node.type === \"FunctionDeclaration\" ||\n node.type === \"FunctionExpression\" ||\n node.type === \"ArrowFunctionExpression\"\n ) {\n return false;\n } else {\n // Keep going up\n return isImmediateCall(node.parent);\n }\n};\n\nexport const isArgsAllLiterals = (context, callExpr) =>\n callExpr.arguments\n .flatMap((arg) => getDownstreamRefs(context, arg))\n .flatMap((ref) => getUpstreamReactVariables(context, ref.resolved))\n .length === 0;\n\nexport const getUpstreamReactVariables = (context, variable) =>\n getUpstreamVariables(\n context,\n variable,\n // Stop at the *usage* of `useState` - don't go up to the `useState` variable.\n // Not needed for props - they don't go \"too far\".\n // We could remove this and check for the `useState` variable instead,\n // but then all our tests need to import it so we can traverse up to it.\n // And would need to change `getUseStateNode()` too?\n // TODO: Could probably organize these filters better.\n (node) => !isUseState(node),\n ).filter((variable) =>\n variable.defs.every(\n (def) =>\n isPropDef(def) ||\n // Ignore variables declared inside an anonymous function, like in `array.map()`.\n def.type !== \"Parameter\",\n ),\n );\n","import { isUseEffect, getEffectFnRefs } from \"./util/react.js\";\n\n/**\n * @type {import(\"eslint\").Rule.RuleModule}\n */\nexport default {\n meta: {\n type: \"suggestion\",\n docs: {\n description: \"Disallow empty effects.\",\n },\n schema: [],\n messages: {\n avoidEmptyEffect: \"This effect is empty and could be removed.\",\n },\n },\n create: (context) => ({\n CallExpression: (node) => {\n if (!isUseEffect(node)) return;\n\n if (\n node.arguments?.length === 0 ||\n getEffectFnRefs(context, node)?.length === 0\n ) {\n // Hopefully it's obvious the effect can be removed.\n // More a follow-up for once they fix/remove other issues.\n context.report({\n node,\n messageId: \"avoidEmptyEffect\",\n });\n }\n },\n }),\n};\n","import { getCallExpr } from \"./util/ast.js\";\nimport {\n getEffectDepsRefs,\n getEffectFnRefs,\n isArgsAllLiterals,\n isImmediateCall,\n isProp,\n isStateSetter,\n} from \"./util/react.js\";\n\n/**\n * @type {import(\"eslint\").Rule.RuleModule}\n */\nexport default {\n meta: {\n type: \"suggestion\",\n docs: {\n description: \"Disallow adjusting state in an effect when a prop changes.\",\n url: \"https://react.dev/learn/you-might-not-need-an-effect#adjusting-some-state-when-a-prop-changes\",\n },\n schema: [],\n messages: {\n avoidAdjustingStateWhenAPropChanges:\n \"Avoid adjusting state when a prop changes. Instead, adjust the state directly during render, or refactor your state to avoid this need entirely.\",\n },\n },\n create: (context) => ({\n CallExpression: (node) => {\n const effectFnRefs = getEffectFnRefs(context, node);\n const depsRefs = getEffectDepsRefs(context, node);\n if (!effectFnRefs || !depsRefs) return;\n\n const isAllDepsProps = depsRefs.notEmptyEvery((ref) =>\n isProp(context, ref),\n );\n\n effectFnRefs\n .filter((ref) => isStateSetter(context, ref))\n .filter((ref) => isImmediateCall(ref.identifier))\n .forEach((ref) => {\n const callExpr = getCallExpr(ref);\n\n // TODO: Flag non-literals too? e.g. I think this is the correct warning for https://github.com/getsentry/sentry/pull/100177/files#diff-cf3aceaba5cdab4553d92644581e23d54914923199d31807fe090e0d49b786caR97\n if (isAllDepsProps && isArgsAllLiterals(context, callExpr)) {\n context.report({\n node: callExpr,\n messageId: \"avoidAdjustingStateWhenAPropChanges\",\n });\n }\n });\n },\n }),\n};\n","import { getCallExpr, traverse } from \"./util/ast.js\";\nimport {\n getEffectFnRefs,\n getEffectDepsRefs,\n isStateSetter,\n isProp,\n getUseStateNode,\n isUseState,\n isReactFunctionalComponent,\n isReactFunctionalHOC,\n isCustomHook,\n} from \"./util/react.js\";\n\n/**\n * @type {import(\"eslint\").Rule.RuleModule}\n */\nexport default {\n meta: {\n type: \"suggestion\",\n docs: {\n description:\n \"Disallow resetting all state in an effect when a prop changes.\",\n url: \"https://react.dev/learn/you-might-not-need-an-effect#resetting-all-state-when-a-prop-changes\",\n },\n schema: [],\n messages: {\n avoidResettingAllStateWhenAPropChanges:\n 'Avoid resetting all state when a prop changes. If \"{{prop}}\" is a key, pass it as `key` instead so React will reset the component.',\n },\n },\n create: (context) => ({\n CallExpression: (node) => {\n const effectFnRefs = getEffectFnRefs(context, node);\n const depsRefs = getEffectDepsRefs(context, node);\n if (!effectFnRefs || !depsRefs) return;\n\n const propUsedToResetAllState = findPropUsedToResetAllState(\n context,\n effectFnRefs,\n depsRefs,\n node,\n );\n\n if (propUsedToResetAllState) {\n context.report({\n node: node,\n messageId: \"avoidResettingAllStateWhenAPropChanges\",\n data: { prop: propUsedToResetAllState.identifier.name },\n });\n }\n },\n }),\n};\n\nconst findPropUsedToResetAllState = (\n context,\n effectFnRefs,\n depsRefs,\n useEffectNode,\n) => {\n const stateSetterRefs = effectFnRefs.filter((ref) =>\n isStateSetter(context, ref),\n );\n\n const isAllStateReset =\n stateSetterRefs.length > 0 &&\n stateSetterRefs.every((ref) => isSetStateToInitialValue(context, ref)) &&\n stateSetterRefs.length ===\n countUseStates(context, findContainingNode(useEffectNode));\n\n return isAllStateReset\n ? depsRefs.find((ref) => isProp(context, ref))\n : undefined;\n};\n\nconst isSetStateToInitialValue = (context, setterRef) => {\n const setStateToValue = getCallExpr(setterRef).arguments[0];\n const stateInitialValue = getUseStateNode(context, setterRef).init\n .arguments[0];\n\n // `useState()` (with no args) defaults to `undefined`,\n // so ommitting the arg is equivalent to passing `undefined`.\n // Technically this would false positive if they shadowed\n // `undefined` in only one of the scopes (only possible via `var`),\n // but I hope no one would do that.\n const isUndefined = (node) => node === undefined || node.name === \"undefined\";\n if (isUndefined(setStateToValue) && isUndefined(stateInitialValue)) {\n return true;\n }\n\n // `sourceCode.getText()` returns the entire file when passed null/undefined - let's short circuit that\n if (setStateToValue === null && stateInitialValue === null) {\n return true;\n } else if (\n (setStateToValue && !stateInitialValue) ||\n (!setStateToValue && stateInitialValue)\n ) {\n return false;\n }\n\n // TODO: This is one of the few times we compare just the immediate nodes,\n // not upstream variables - that seems pretty complicated here?\n // At the least, upstream functions would have to return literals for us to consider too, not just variables...\n return (\n context.sourceCode.getText(setStateToValue) ===\n context.sourceCode.getText(stateInitialValue)\n );\n};\n\nconst countUseStates = (context, componentNode) => {\n if (!componentNode) {\n return 0;\n }\n\n let count = 0;\n\n traverse(context, componentNode, (node) => {\n // TODO: Could optimize by not descending into nested functions/components, since hooks must be at the top level.\n if (isUseState(node)) {\n count++;\n }\n });\n\n return count;\n};\n\n// Returns the component or custom hook that contains the `useEffect` node.\n// WARNING: Per the `isReactFunctionalComponent` etc. internals, this will return undefined for some non-idiomatic component definitions.\n// e.g. `function buildComponent(arg1, arg2) { return <div />; }`\n// Not sure we can account for that without introducing false positives, and those are rare and arguably bad practice.\nconst findContainingNode = (node) => {\n if (!node) {\n return undefined;\n } else if (\n isReactFunctionalComponent(node) ||\n isReactFunctionalHOC(node) ||\n isCustomHook(node)\n ) {\n return node;\n } else {\n return findContainingNode(node.parent);\n }\n};\n","import {\n getEffectFnRefs,\n getEffectDepsRefs,\n hasCleanup,\n} from \"./util/react.js\";\nimport { findDownstreamNodes, getDownstreamRefs } from \"./util/ast.js\";\nimport { isState } from \"./util/react.js\";\n\n/**\n * @type {import(\"eslint\").Rule.RuleModule}\n */\nexport default {\n meta: {\n type: \"suggestion\",\n docs: {\n description: \"Disallow using state and an effect as an event handler.\",\n url: \"https://react.dev/learn/you-might-not-need-an-effect#sharing-logic-between-event-handlers\",\n },\n schema: [],\n messages: {\n avoidEventHandler:\n \"Avoid using state and effects as an event handler. Instead, call the event handling code directly when the event occurs.\",\n },\n },\n create: (context) => ({\n CallExpression: (node) => {\n const effectFnRefs = getEffectFnRefs(context, node);\n const depsRefs = getEffectDepsRefs(context, node);\n if (!effectFnRefs || !depsRefs) return;\n if (hasCleanup(node)) return;\n\n // TODO: Can we also flag this when the deps are internal, and the body calls internal stuff?\n // That'd overlap with other rules though... maybe just useRefs?\n\n findDownstreamNodes(context, node, \"IfStatement\")\n .filter((ifNode) => !ifNode.alternate)\n .filter((ifNode) =>\n getDownstreamRefs(context, ifNode.test)\n // TODO: Should flag props too, but maybe with a different message?\n .notEmptyEvery((ref) => isState(context, ref)),\n )\n .forEach((ifNode) => {\n context.report({\n node: ifNode.test,\n messageId: \"avoidEventHandler\",\n });\n });\n },\n }),\n};\n","import {\n getEffectFnRefs,\n getEffectDepsRefs,\n isImmediateCall,\n isPropCallback,\n isState,\n} from \"./util/react.js\";\nimport { getCallExpr, getDownstreamRefs } from \"./util/ast.js\";\n\n/**\n * @type {import(\"eslint\").Rule.RuleModule}\n */\nexport default {\n meta: {\n type: \"suggestion\",\n docs: {\n description:\n \"Disallow passing live state to parent components in an effect.\",\n url: \"https://react.dev/learn/you-might-not-need-an-effect#notifying-parent-components-about-state-changes\",\n },\n schema: [],\n messages: {\n avoidPassingLiveStateToParent:\n \"Avoid passing live state to parents in an effect. Instead, lift the state to the parent and pass it down to the child as a prop.\",\n },\n },\n create: (context) => ({\n CallExpression: (node) => {\n const effectFnRefs = getEffectFnRefs(context, node);\n const depsRefs = getEffectDepsRefs(context, node);\n if (!effectFnRefs || !depsRefs) return;\n\n effectFnRefs\n .filter((ref) => isPropCallback(context, ref))\n .filter((ref) => isImmediateCall(ref.identifier))\n .forEach((ref) => {\n const callExpr = getCallExpr(ref);\n const isStateInArgs = callExpr.arguments\n .flatMap((arg) => getDownstreamRefs(context, arg))\n .some((ref) => isState(context, ref));\n\n if (isStateInArgs) {\n context.report({\n node: callExpr,\n messageId: \"avoidPassingLiveStateToParent\",\n });\n }\n });\n },\n }),\n};\n","import { getCallExpr } from \"./util/ast.js\";\nimport {\n getEffectDepsRefs,\n getEffectFnRefs,\n getUseStateNode,\n isImmediateCall,\n isStateSetter,\n} from \"./util/react.js\";\n\n/**\n * @type {import(\"eslint\").Rule.RuleModule}\n */\nexport default {\n meta: {\n type: \"suggestion\",\n docs: {\n description: \"Disallow initializing state in an effect.\",\n },\n schema: [],\n messages: {\n avoidInitializingState:\n 'Avoid initializing state in an effect. Instead, pass \"{{state}}\"\\'s initial value to its `useState`.',\n },\n },\n create: (context) => ({\n CallExpression: (node) => {\n const effectFnRefs = getEffectFnRefs(context, node);\n const depsRefs = getEffectDepsRefs(context, node);\n if (!effectFnRefs || !depsRefs) return;\n\n // TODO: Should this length check account for the setter in the deps? exhaustive-deps doesn't warn one way or the other\n if (depsRefs.length > 0) return;\n\n effectFnRefs\n .filter((ref) => isStateSetter(context, ref))\n .filter((ref) => isImmediateCall(ref.identifier))\n .forEach((ref) => {\n const useStateNode = getUseStateNode(context, ref);\n const stateName = (\n useStateNode.id.elements[0] ?? useStateNode.id.elements[1]\n )?.name;\n\n context.report({\n node: getCallExpr(ref),\n messageId: \"avoidInitializingState\",\n data: { state: stateName },\n });\n });\n },\n }),\n};\n","import { getCallExpr } from \"./util/ast.js\";\nimport {\n getEffectDepsRefs,\n getEffectFnRefs,\n hasCleanup,\n isArgsAllLiterals,\n isImmediateCall,\n isState,\n isStateSetter,\n} from \"./util/react.js\";\n\n/**\n * @type {import(\"eslint\").Rule.RuleModule}\n */\nexport default {\n meta: {\n type: \"suggestion\",\n docs: {\n description: \"Disallow chaining state changes in an effect.\",\n url: \"https://react.dev/learn/you-might-not-need-an-effect#chains-of-computations\",\n },\n schema: [],\n messages: {\n avoidChainingStateUpdates:\n \"Avoid chaining state changes. When possible, update all relevant state simultaneously.\",\n },\n },\n create: (context) => ({\n CallExpression: (node) => {\n const effectFnRefs = getEffectFnRefs(context, node);\n const depsRefs = getEffectDepsRefs(context, node);\n if (!effectFnRefs || !depsRefs) return;\n if (hasCleanup(node)) return;\n\n // TODO: Should filter out setters before checking?\n // exhaustive-deps doesn't enforce one way or the other.\n const isAllDepsState = depsRefs.notEmptyEvery((ref) =>\n isState(context, ref),\n );\n\n effectFnRefs\n .filter((ref) => isStateSetter(context, ref))\n .filter((ref) => isImmediateCall(ref.identifier))\n .forEach((ref) => {\n const callExpr = getCallExpr(ref);\n\n if (isAllDepsState && isArgsAllLiterals(context, callExpr)) {\n context.report({\n node: callExpr,\n messageId: \"avoidChainingStateUpdates\",\n });\n }\n });\n },\n }),\n};\n","import {\n getEffectFnRefs,\n getEffectDepsRefs,\n isImmediateCall,\n isStateSetter,\n getUseStateNode,\n isProp,\n getUpstreamReactVariables,\n isState,\n hasCleanup,\n} from \"./util/react.js\";\nimport { getCallExpr, getDownstreamRefs } from \"./util/ast.js\";\n\n/**\n * @type {import('eslint').Rule.RuleModule}\n */\nexport default {\n meta: {\n type: \"suggestion\",\n docs: {\n description: \"Disallow storing derived state in an effect.\",\n url: \"https://react.dev/learn/you-might-not-need-an-effect#updating-state-based-on-props-or-state\",\n },\n schema: [],\n messages: {\n avoidDerivedState:\n 'Avoid storing derived state. Compute \"{{state}}\" directly during render, optionally with `useMemo` if it\\'s expensive.',\n },\n },\n create: (context) => ({\n CallExpression: (node) => {\n const effectFnRefs = getEffectFnRefs(context, node);\n const depsRefs = getEffectDepsRefs(context, node);\n if (!effectFnRefs || !depsRefs) return;\n if (hasCleanup(node)) return;\n\n effectFnRefs\n .filter((ref) => isStateSetter(context, ref))\n .filter((ref) => isImmediateCall(ref.identifier))\n .forEach((ref) => {\n const callExpr = getCallExpr(ref);\n const useStateNode = getUseStateNode(context, ref);\n const stateName = (\n useStateNode.id.elements[0] ?? useStateNode.id.elements[1]\n )?.name;\n\n const argsRefs = callExpr.arguments.flatMap((arg) =>\n getDownstreamRefs(context, arg),\n );\n const isAllArgsInternal = argsRefs.notEmptyEvery(\n (ref) => isState(context, ref) || isProp(context, ref),\n );\n\n const argsUpstreamVars = argsRefs.flatMap((ref) =>\n getUpstreamReactVariables(context, ref.resolved),\n );\n const depsUpstreamVars = depsRefs.flatMap((ref) =>\n getUpstreamReactVariables(context, ref.resolved),\n );\n const isAllArgsInDeps = argsUpstreamVars.notEmptyEvery((argVar) =>\n depsUpstreamVars.some((depVar) => argVar.name === depVar.name),\n );\n const isValueAlwaysInSync = isAllArgsInDeps && countCalls(ref) === 1;\n\n if (isAllArgsInternal || isValueAlwaysInSync) {\n context.report({\n node: callExpr,\n messageId: \"avoidDerivedState\",\n data: { state: stateName },\n });\n }\n });\n },\n }),\n};\n\nconst countCalls = (ref) =>\n ref.resolved.references.filter(\n (ref) => ref.identifier.parent.type === \"CallExpression\",\n ).length;\n","import {\n getEffectFnRefs,\n getEffectDepsRefs,\n isPropCallback,\n isState,\n isRef,\n isProp,\n hasCleanup,\n} from \"./util/react.js\";\nimport { getCallExpr, getDownstreamRefs } from \"./util/ast.js\";\n\n/**\n * @type {import(\"eslint\").Rule.RuleModule}\n */\nexport default {\n meta: {\n type: \"suggestion\",\n docs: {\n description: \"Disallow passing data to parents in an effect.\",\n url: \"https://react.dev/learn/you-might-not-need-an-effect#passing-data-to-the-parent\",\n },\n schema: [],\n messages: {\n avoidPassingDataToParent:\n \"Avoid passing data to parents in an effect. Instead, let the parent fetch the data itself and pass it down to the child as a prop.\",\n },\n },\n create: (context) => ({\n CallExpression: (node) => {\n const effectFnRefs = getEffectFnRefs(context, node);\n const depsRefs = getEffectDepsRefs(context, node);\n if (!effectFnRefs || !depsRefs) return;\n if (hasCleanup(node)) return;\n\n effectFnRefs\n .filter((ref) => isPropCallback(context, ref))\n // We don't check `isDirectCall` because it shouldn't matter; passing data to the parent is passing data to the parent.\n // And misuses are often indirect, e.g. retrieving and passing up external data in a Promise chain.\n .forEach((ref) => {\n const callExpr = getCallExpr(ref);\n\n if (\n callExpr.arguments\n .flatMap((arg) => getDownstreamRefs(context, arg))\n .notEmptyEvery(\n (ref) =>\n !isState(context, ref) &&\n !isProp(context, ref) &&\n // TODO: Should warn to use `forwardRef` instead?\n // https://github.com/NickvanDyke/eslint-plugin-react-you-might-not-need-an-effect/issues/22\n !isRef(context, ref),\n )\n ) {\n context.report({\n node: callExpr,\n messageId: \"avoidPassingDataToParent\",\n });\n }\n });\n },\n }),\n};\n","import { getEffectFnRefs, getEffectDepsRefs } from \"./util/react.js\";\nimport { isProp } from \"./util/react.js\";\n\n/**\n * @type {import(\"eslint\").Rule.RuleModule}\n */\nexport default {\n meta: {\n type: \"problem\",\n docs: {\n description: \"Disallow effects that only use props.\",\n },\n schema: [],\n messages: {\n avoidManagingParent:\n \"This effect only uses props. Consider lifting the logic up to the parent.\",\n },\n },\n create: (context) => ({\n CallExpression: (node) => {\n const effectFnRefs = getEffectFnRefs(context, node);\n const depsRefs = getEffectDepsRefs(context, node);\n if (!effectFnRefs || !depsRefs) return;\n\n if (effectFnRefs.length === 0) return;\n\n if (effectFnRefs.concat(depsRefs).every((ref) => isProp(context, ref))) {\n context.report({\n node,\n messageId: \"avoidManagingParent\",\n });\n }\n },\n }),\n};\n","// Wraps `Array.every()` to return false for empty arrays.\nArray.prototype.notEmptyEvery = function (predicate) {\n return this.length > 0 && this.every(predicate);\n};\n","import noEmptyEffect from \"./no-empty-effect.js\";\nimport noAdjustStateOnPropChange from \"./no-adjust-state-on-prop-change.js\";\nimport noResetAllStateOnPropChange from \"./no-reset-all-state-on-prop-change.js\";\nimport noEventHandler from \"./no-event-handler.js\";\nimport noPassLiveStateToParent from \"./no-pass-live-state-to-parent.js\";\nimport noInitializeState from \"./no-initialize-state.js\";\nimport noChainStateUpdates from \"./no-chain-state-updates.js\";\nimport noDerivedState from \"./no-derived-state.js\";\nimport noPassDataToParent from \"./no-pass-data-to-parent.js\";\nimport noManageParent from \"./no-manage-parent.js\";\nimport globals from \"globals\";\nimport \"./util/javascript.js\";\n\n/**\n * @type {import(\"eslint\").ESLint.Plugin}\n */\nconst plugin = {\n meta: {\n name: \"react-you-might-not-need-an-effect\",\n },\n configs: {},\n rules: {\n \"no-empty-effect\": noEmptyEffect,\n \"no-adjust-state-on-prop-change\": noAdjustStateOnPropChange,\n \"no-reset-all-state-on-prop-change\": noResetAllStateOnPropChange,\n \"no-event-handler\": noEventHandler,\n \"no-pass-live-state-to-parent\": noPassLiveStateToParent,\n \"no-pass-data-to-parent\": noPassDataToParent,\n \"no-manage-parent\": noManageParent,\n \"no-initialize-state\": noInitializeState,\n \"no-chain-state-updates\": noChainStateUpdates,\n \"no-derived-state\": noDerivedState,\n },\n};\n\nconst recommendedRules = Object.keys(plugin.rules).reduce((acc, ruleName) => {\n acc[plugin.meta.name + \"/\" + ruleName] = \"warn\";\n return acc;\n}, {});\nconst languageOptions = {\n globals: {\n // NOTE: Required so we can resolve global references to their upstream global variables\n ...globals.browser,\n },\n parserOptions: {\n ecmaFeatures: {\n jsx: true,\n },\n },\n};\n\nObject.assign(plugin.configs, {\n // flat config format\n recommended: {\n files: [\"**/*.{js,jsx,mjs,cjs,ts,tsx,mts,cts}\"],\n plugins: {\n // Object.assign above so we can reference `plugin` here\n [plugin.meta.name]: plugin,\n },\n rules: recommendedRules,\n languageOptions,\n },\n \"legacy-recommended\": {\n plugins: [plugin.meta.name],\n rules: recommendedRules,\n ...languageOptions,\n },\n});\n\nexport default plugin;\n"],"x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAAA;EACI,wBAAwB,CACpB,QACA,QACH;EACD,qBAAqB,CACjB,QACA,QACH;EACD,mBAAmB,CACf,WACH;EACD,gBAAgB,CACZ,WACH;EACD,2BAA2B,CACvB,UACA,OACH;EACD,mBAAmB,CACf,WACH;EACD,kBAAkB,CACd,OACH;EACD,oBAAoB,CAChB,QACA,QACH;EACD,kBAAkB,CACd,QACH;EACD,kBAAkB,CACd,UACA,YACH;EACD,eAAe,CACX,SACA,OACH;EACD,mBAAmB,CACf,aACH;EACD,aAAa,CACT,OACH;EACD,oBAAoB;GAChB;GACA;GACA;GACH;EACD,mBAAmB;GACf;GACA;GACA;GACH;EACD,yBAAyB;GACrB;GACA;GACA;GACH;EACD,qBAAqB,CACjB,QACH;EACD,qBAAqB,EAAE;EACvB,oBAAoB,CAChB,QACA,OACH;EACD,kBAAkB,EAAE;EACpB,wBAAwB,CACpB,YACA,SACH;EACD,4BAA4B,CACxB,cACH;EACD,0BAA0B;GACtB;GACA;GACA;GACH;EACD,mBAAmB,CACf,YACA,QACH;EACD,uBAAuB,CACnB,aACH;EACD,4BAA4B,CACxB,WACH;EACD,8BAA8B,CAC1B,WACH;EACD,gBAAgB;GACZ;GACA;GACA;GACA;GACH;EACD,kBAAkB;GACd;GACA;GACA;GACH;EACD,kBAAkB;GACd;GACA;GACA;GACH;EACD,uBAAuB;GACnB;GACA;GACA;GACH;EACD,sBAAsB;GAClB;GACA;GACA;GACH;EACD,cAAc,EAAE;EAChB,eAAe;GACX;GACA;GACA;GACH;EACD,qBAAqB,CACjB,cACA,SACH;EACD,0BAA0B,CACtB,QACH;EACD,oBAAoB,CAChB,SACH;EACD,4BAA4B,CACxB,QACH;EACD,mBAAmB,CACf,YACA,QACH;EACD,gBAAgB,CACZ,QACA,QACH;EACD,qBAAqB,CACjB,OACH;EACD,cAAc;GACV;GACA;GACA;GACH;EACD,sBAAsB,EAAE;EACxB,0BAA0B,CACtB,aACH;EACD,iBAAiB,EAAE;EACnB,uBAAuB,CACnB,UACA,WACH;EACD,qBAAqB,CACjB,aACA,OACH;EACD,qBAAqB,CACjB,QACA,aACH;EACD,sBAAsB,CAClB,WACH;EACD,WAAW,EAAE;EACb,eAAe;GACX;GACA;GACA;GACH;EACD,WAAW,EAAE;EACb,oBAAoB,CAChB,SACA,OACH;EACD,qBAAqB,CACjB,QACA,Q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