@sarj/eslint-plugin 19.0.0 → 19.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/dist/effects.js +2 -0
- package/dist/jsdoc-js.js +66 -0
- package/dist/node-test.js +8 -0
- package/dist/playwright.js +5 -0
- package/dist/query.js +5 -0
- package/dist/react-correctness.js +124 -0
- package/dist/react-js.js +9 -0
- package/dist/regexp.js +38 -0
- package/dist/security.js +8 -0
- package/dist/testing-library.js +12 -0
- package/dist/unicorn-js.js +2230 -0
- package/package.json +46 -18
package/dist/query.js
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import {createRequire as sarjCreateRequire} from "node:module";const require=sarjCreateRequire(import.meta.url);
|
|
2
|
+
var br=Object.create;var Oe=Object.defineProperty;var vr=Object.getOwnPropertyDescriptor;var Sr=Object.getOwnPropertyNames;var Tr=Object.getPrototypeOf,xr=Object.prototype.hasOwnProperty;var C=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(r){throw t=0,r}},Cr=(e,t)=>{for(var r in t)Oe(e,r,{get:t[r],enumerable:!0})},Ie=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Sr(t))!xr.call(e,i)&&i!==r&&Oe(e,i,{get:()=>t[i],enumerable:!(n=vr(t,i))||n.enumerable});return e},me=(e,t,r)=>(Ie(e,t,"default"),r&&Ie(r,t,"default")),we=(e,t,r)=>(r=e!=null?br(Tr(e)):{},Ie(t||!e||!e.__esModule?Oe(r,"default",{value:e,enumerable:!0}):r,e));var ke=C(ee=>{"use strict";Object.defineProperty(ee,"__esModule",{value:!0});ee.AST_TOKEN_TYPES=ee.AST_NODE_TYPES=void 0;var et;(function(e){e.AccessorProperty="AccessorProperty",e.ArrayExpression="ArrayExpression",e.ArrayPattern="ArrayPattern",e.ArrowFunctionExpression="ArrowFunctionExpression",e.AssignmentExpression="AssignmentExpression",e.AssignmentPattern="AssignmentPattern",e.AwaitExpression="AwaitExpression",e.BinaryExpression="BinaryExpression",e.BlockStatement="BlockStatement",e.BreakStatement="BreakStatement",e.CallExpression="CallExpression",e.CatchClause="CatchClause",e.ChainExpression="ChainExpression",e.ClassBody="ClassBody",e.ClassDeclaration="ClassDeclaration",e.ClassExpression="ClassExpression",e.ConditionalExpression="ConditionalExpression",e.ContinueStatement="ContinueStatement",e.DebuggerStatement="DebuggerStatement",e.Decorator="Decorator",e.DoWhileStatement="DoWhileStatement",e.EmptyStatement="EmptyStatement",e.ExportAllDeclaration="ExportAllDeclaration",e.ExportDefaultDeclaration="ExportDefaultDeclaration",e.ExportNamedDeclaration="ExportNamedDeclaration",e.ExportSpecifier="ExportSpecifier",e.ExpressionStatement="ExpressionStatement",e.ForInStatement="ForInStatement",e.ForOfStatement="ForOfStatement",e.ForStatement="ForStatement",e.FunctionDeclaration="FunctionDeclaration",e.FunctionExpression="FunctionExpression",e.Identifier="Identifier",e.IfStatement="IfStatement",e.ImportAttribute="ImportAttribute",e.ImportDeclaration="ImportDeclaration",e.ImportDefaultSpecifier="ImportDefaultSpecifier",e.ImportExpression="ImportExpression",e.ImportNamespaceSpecifier="ImportNamespaceSpecifier",e.ImportSpecifier="ImportSpecifier",e.JSXAttribute="JSXAttribute",e.JSXClosingElement="JSXClosingElement",e.JSXClosingFragment="JSXClosingFragment",e.JSXElement="JSXElement",e.JSXEmptyExpression="JSXEmptyExpression",e.JSXExpressionContainer="JSXExpressionContainer",e.JSXFragment="JSXFragment",e.JSXIdentifier="JSXIdentifier",e.JSXMemberExpression="JSXMemberExpression",e.JSXNamespacedName="JSXNamespacedName",e.JSXOpeningElement="JSXOpeningElement",e.JSXOpeningFragment="JSXOpeningFragment",e.JSXSpreadAttribute="JSXSpreadAttribute",e.JSXSpreadChild="JSXSpreadChild",e.JSXText="JSXText",e.LabeledStatement="LabeledStatement",e.Literal="Literal",e.LogicalExpression="LogicalExpression",e.MemberExpression="MemberExpression",e.MetaProperty="MetaProperty",e.MethodDefinition="MethodDefinition",e.NewExpression="NewExpression",e.ObjectExpression="ObjectExpression",e.ObjectPattern="ObjectPattern",e.PrivateIdentifier="PrivateIdentifier",e.Program="Program",e.Property="Property",e.PropertyDefinition="PropertyDefinition",e.RestElement="RestElement",e.ReturnStatement="ReturnStatement",e.SequenceExpression="SequenceExpression",e.SpreadElement="SpreadElement",e.StaticBlock="StaticBlock",e.Super="Super",e.SwitchCase="SwitchCase",e.SwitchStatement="SwitchStatement",e.TaggedTemplateExpression="TaggedTemplateExpression",e.TemplateElement="TemplateElement",e.TemplateLiteral="TemplateLiteral",e.ThisExpression="ThisExpression",e.ThrowStatement="ThrowStatement",e.TryStatement="TryStatement",e.UnaryExpression="UnaryExpression",e.UpdateExpression="UpdateExpression",e.VariableDeclaration="VariableDeclaration",e.VariableDeclarator="VariableDeclarator",e.WhileStatement="WhileStatement",e.WithStatement="WithStatement",e.YieldExpression="YieldExpression",e.TSAbstractAccessorProperty="TSAbstractAccessorProperty",e.TSAbstractKeyword="TSAbstractKeyword",e.TSAbstractMethodDefinition="TSAbstractMethodDefinition",e.TSAbstractPropertyDefinition="TSAbstractPropertyDefinition",e.TSAnyKeyword="TSAnyKeyword",e.TSArrayType="TSArrayType",e.TSAsExpression="TSAsExpression",e.TSAsyncKeyword="TSAsyncKeyword",e.TSBigIntKeyword="TSBigIntKeyword",e.TSBooleanKeyword="TSBooleanKeyword",e.TSCallSignatureDeclaration="TSCallSignatureDeclaration",e.TSClassImplements="TSClassImplements",e.TSConditionalType="TSConditionalType",e.TSConstructorType="TSConstructorType",e.TSConstructSignatureDeclaration="TSConstructSignatureDeclaration",e.TSDeclareFunction="TSDeclareFunction",e.TSDeclareKeyword="TSDeclareKeyword",e.TSEmptyBodyFunctionExpression="TSEmptyBodyFunctionExpression",e.TSEnumBody="TSEnumBody",e.TSEnumDeclaration="TSEnumDeclaration",e.TSEnumMember="TSEnumMember",e.TSExportAssignment="TSExportAssignment",e.TSExportKeyword="TSExportKeyword",e.TSExternalModuleReference="TSExternalModuleReference",e.TSFunctionType="TSFunctionType",e.TSImportEqualsDeclaration="TSImportEqualsDeclaration",e.TSImportType="TSImportType",e.TSIndexedAccessType="TSIndexedAccessType",e.TSIndexSignature="TSIndexSignature",e.TSInferType="TSInferType",e.TSInstantiationExpression="TSInstantiationExpression",e.TSInterfaceBody="TSInterfaceBody",e.TSInterfaceDeclaration="TSInterfaceDeclaration",e.TSInterfaceHeritage="TSInterfaceHeritage",e.TSIntersectionType="TSIntersectionType",e.TSIntrinsicKeyword="TSIntrinsicKeyword",e.TSLiteralType="TSLiteralType",e.TSMappedType="TSMappedType",e.TSMethodSignature="TSMethodSignature",e.TSModuleBlock="TSModuleBlock",e.TSModuleDeclaration="TSModuleDeclaration",e.TSNamedTupleMember="TSNamedTupleMember",e.TSNamespaceExportDeclaration="TSNamespaceExportDeclaration",e.TSNeverKeyword="TSNeverKeyword",e.TSNonNullExpression="TSNonNullExpression",e.TSNullKeyword="TSNullKeyword",e.TSNumberKeyword="TSNumberKeyword",e.TSObjectKeyword="TSObjectKeyword",e.TSOptionalType="TSOptionalType",e.TSParameterProperty="TSParameterProperty",e.TSPrivateKeyword="TSPrivateKeyword",e.TSPropertySignature="TSPropertySignature",e.TSProtectedKeyword="TSProtectedKeyword",e.TSPublicKeyword="TSPublicKeyword",e.TSQualifiedName="TSQualifiedName",e.TSReadonlyKeyword="TSReadonlyKeyword",e.TSRestType="TSRestType",e.TSSatisfiesExpression="TSSatisfiesExpression",e.TSStaticKeyword="TSStaticKeyword",e.TSStringKeyword="TSStringKeyword",e.TSSymbolKeyword="TSSymbolKeyword",e.TSTemplateLiteralType="TSTemplateLiteralType",e.TSThisType="TSThisType",e.TSTupleType="TSTupleType",e.TSTypeAliasDeclaration="TSTypeAliasDeclaration",e.TSTypeAnnotation="TSTypeAnnotation",e.TSTypeAssertion="TSTypeAssertion",e.TSTypeLiteral="TSTypeLiteral",e.TSTypeOperator="TSTypeOperator",e.TSTypeParameter="TSTypeParameter",e.TSTypeParameterDeclaration="TSTypeParameterDeclaration",e.TSTypeParameterInstantiation="TSTypeParameterInstantiation",e.TSTypePredicate="TSTypePredicate",e.TSTypeQuery="TSTypeQuery",e.TSTypeReference="TSTypeReference",e.TSUndefinedKeyword="TSUndefinedKeyword",e.TSUnionType="TSUnionType",e.TSUnknownKeyword="TSUnknownKeyword",e.TSVoidKeyword="TSVoidKeyword"})(et||(ee.AST_NODE_TYPES=et={}));var tt;(function(e){e.Boolean="Boolean",e.Identifier="Identifier",e.JSXIdentifier="JSXIdentifier",e.PrivateIdentifier="PrivateIdentifier",e.JSXText="JSXText",e.Keyword="Keyword",e.Null="Null",e.Numeric="Numeric",e.Punctuator="Punctuator",e.RegularExpression="RegularExpression",e.String="String",e.Template="Template",e.Block="Block",e.Line="Line"})(tt||(ee.AST_TOKEN_TYPES=tt={}))});var nt=C(rt=>{"use strict";Object.defineProperty(rt,"__esModule",{value:!0})});var st=C(it=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0})});var ot=C(K=>{"use strict";var Ir=K&&K.__createBinding||(Object.create?(function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}):(function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]})),Or=K&&K.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),wr=K&&K.__importStar||(function(){var e=function(t){return e=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},e(t)};return function(t){if(t&&t.__esModule)return t;var r={};if(t!=null)for(var n=e(t),i=0;i<n.length;i++)n[i]!=="default"&&Ir(r,t,n[i]);return Or(r,t),r}})();Object.defineProperty(K,"__esModule",{value:!0});K.TSESTree=void 0;K.TSESTree=wr(ke())});var ut=C(P=>{"use strict";var kr=P&&P.__createBinding||(Object.create?(function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}):(function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]})),je=P&&P.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&kr(t,e,r)};Object.defineProperty(P,"__esModule",{value:!0});P.AST_TOKEN_TYPES=P.AST_NODE_TYPES=void 0;var at=ke();Object.defineProperty(P,"AST_NODE_TYPES",{enumerable:!0,get:function(){return at.AST_NODE_TYPES}});Object.defineProperty(P,"AST_TOKEN_TYPES",{enumerable:!0,get:function(){return at.AST_TOKEN_TYPES}});je(nt(),P);je(st(),P);je(ot(),P)});var Ee=C(V=>{"use strict";Object.defineProperty(V,"__esModule",{value:!0});V.TSESTree=V.AST_TOKEN_TYPES=V.AST_NODE_TYPES=void 0;var Re=ut();Object.defineProperty(V,"AST_NODE_TYPES",{enumerable:!0,get:function(){return Re.AST_NODE_TYPES}});Object.defineProperty(V,"AST_TOKEN_TYPES",{enumerable:!0,get:function(){return Re.AST_TOKEN_TYPES}});Object.defineProperty(V,"TSESTree",{enumerable:!0,get:function(){return Re.TSESTree}})});var lt=C(oe=>{"use strict";Object.defineProperty(oe,"__esModule",{value:!0});var se={ArrayExpression:["elements"],ArrayPattern:["elements"],ArrowFunctionExpression:["params","body"],AssignmentExpression:["left","right"],AssignmentPattern:["left","right"],AwaitExpression:["argument"],BinaryExpression:["left","right"],BlockStatement:["body"],BreakStatement:["label"],CallExpression:["callee","arguments"],CatchClause:["param","body"],ChainExpression:["expression"],ClassBody:["body"],ClassDeclaration:["id","superClass","body"],ClassExpression:["id","superClass","body"],ConditionalExpression:["test","consequent","alternate"],ContinueStatement:["label"],DebuggerStatement:[],DoWhileStatement:["body","test"],EmptyStatement:[],ExperimentalRestProperty:["argument"],ExperimentalSpreadProperty:["argument"],ExportAllDeclaration:["exported","source"],ExportDefaultDeclaration:["declaration"],ExportNamedDeclaration:["declaration","specifiers","source"],ExportSpecifier:["exported","local"],ExpressionStatement:["expression"],ForInStatement:["left","right","body"],ForOfStatement:["left","right","body"],ForStatement:["init","test","update","body"],FunctionDeclaration:["id","params","body"],FunctionExpression:["id","params","body"],Identifier:[],IfStatement:["test","consequent","alternate"],ImportDeclaration:["specifiers","source"],ImportDefaultSpecifier:["local"],ImportExpression:["source"],ImportNamespaceSpecifier:["local"],ImportSpecifier:["imported","local"],JSXAttribute:["name","value"],JSXClosingElement:["name"],JSXClosingFragment:[],JSXElement:["openingElement","children","closingElement"],JSXEmptyExpression:[],JSXExpressionContainer:["expression"],JSXFragment:["openingFragment","children","closingFragment"],JSXIdentifier:[],JSXMemberExpression:["object","property"],JSXNamespacedName:["namespace","name"],JSXOpeningElement:["name","attributes"],JSXOpeningFragment:[],JSXSpreadAttribute:["argument"],JSXSpreadChild:["expression"],JSXText:[],LabeledStatement:["label","body"],Literal:[],LogicalExpression:["left","right"],MemberExpression:["object","property"],MetaProperty:["meta","property"],MethodDefinition:["key","value"],NewExpression:["callee","arguments"],ObjectExpression:["properties"],ObjectPattern:["properties"],PrivateIdentifier:[],Program:["body"],Property:["key","value"],PropertyDefinition:["key","value"],RestElement:["argument"],ReturnStatement:["argument"],SequenceExpression:["expressions"],SpreadElement:["argument"],StaticBlock:["body"],Super:[],SwitchCase:["test","consequent"],SwitchStatement:["discriminant","cases"],TaggedTemplateExpression:["tag","quasi"],TemplateElement:[],TemplateLiteral:["quasis","expressions"],ThisExpression:[],ThrowStatement:["argument"],TryStatement:["block","handler","finalizer"],UnaryExpression:["argument"],UpdateExpression:["argument"],VariableDeclaration:["declarations"],VariableDeclarator:["id","init"],WhileStatement:["test","body"],WithStatement:["object","body"],YieldExpression:["argument"]},jr=Object.keys(se);for(let e of jr)Object.freeze(se[e]);Object.freeze(se);var Rr=new Set(["parent","leadingComments","trailingComments"]);function Er(e){return!Rr.has(e)&&e[0]!=="_"}function Pr(e){return Object.keys(e).filter(Er)}function Mr(e){let t=Object.assign({},se);for(let r of Object.keys(e))if(Object.prototype.hasOwnProperty.call(t,r)){let n=new Set(e[r]);for(let i of t[r])n.add(i);t[r]=Object.freeze(Array.from(n))}else t[r]=Object.freeze(Array.from(e[r]));return Object.freeze(t)}oe.KEYS=se;oe.getKeys=Pr;oe.unionWith=Mr});var ne=C(v=>{"use strict";Object.defineProperty(v,"__esModule",{value:!0});var gt=lt();function Me(e,t){let r=t.range[0],n=e,i=!1;do{i=!1;for(let s of n.childScopes){let a=s.block.range;if(a[0]<=r&&r<a[1]){n=s,i=!0;break}}}while(i);return n}function te(e,t){let r="",n=e;for(typeof t=="string"?r=t:(r=t.name,n=Me(n,t));n!=null;){let i=n.set.get(r);if(i!=null)return i;n=n.upper}return null}function N(e){return t=>!e(t)}function Q(e,t){return e.type==="Punctuator"&&e.value===t}function be(e){return Q(e,"=>")}function Fe(e){return Q(e,",")}function Be(e){return Q(e,";")}function Ne(e){return Q(e,":")}function $(e){return Q(e,"(")}function ve(e){return Q(e,")")}function qe(e){return Q(e,"[")}function Ae(e){return Q(e,"]")}function Ke(e){return Q(e,"{")}function Qe(e){return Q(e,"}")}function De(e){return["Block","Line","Shebang"].includes(e.type)}var ht=N(be),bt=N(Fe),vt=N(Be),St=N(Ne),Tt=N($),xt=N(ve),Ct=N(qe),It=N(Ae),Ot=N(Ke),wt=N(Qe),kt=N(De);function ct(e,t){return e.id?t.getTokenAfter(e.id,$):t.getFirstToken(e,$)}function jt(e,t){let r=e.parent,n=null,i=null;if(e.type==="ArrowFunctionExpression"){let s=t.getTokenBefore(e.body,be);n=s.loc.start,i=s.loc.end}else r&&(r.type==="Property"||r.type==="MethodDefinition"||r.type==="PropertyDefinition")?(n=r.loc.start,i=ct(e,t).loc.start):(n=e.loc.start,i=ct(e,t).loc.start);return{start:{...n},end:{...i}}}var Rt=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{},Fr=Object.freeze(new Set(["Array","ArrayBuffer","BigInt","BigInt64Array","BigUint64Array","Boolean","DataView","Date","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","Float32Array","Float64Array","Function","Infinity","Int16Array","Int32Array","Int8Array","isFinite","isNaN","isPrototypeOf","JSON","Map","Math","NaN","Number","Object","parseFloat","parseInt","Promise","Proxy","Reflect","RegExp","Set","String","Symbol","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray","undefined","unescape","WeakMap","WeakSet"])),Pe=new Set([Array.isArray,Array.of,Array.prototype.at,Array.prototype.concat,Array.prototype.entries,Array.prototype.every,Array.prototype.filter,Array.prototype.find,Array.prototype.findIndex,Array.prototype.flat,Array.prototype.includes,Array.prototype.indexOf,Array.prototype.join,Array.prototype.keys,Array.prototype.lastIndexOf,Array.prototype.slice,Array.prototype.some,Array.prototype.toString,Array.prototype.values,typeof BigInt=="function"?BigInt:void 0,Boolean,Date,Date.parse,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,escape,isFinite,isNaN,isPrototypeOf,Map,Map.prototype.entries,Map.prototype.get,Map.prototype.has,Map.prototype.keys,Map.prototype.values,...Object.getOwnPropertyNames(Math).filter(e=>e!=="random").map(e=>Math[e]).filter(e=>typeof e=="function"),Number,Number.isFinite,Number.isNaN,Number.parseFloat,Number.parseInt,Number.prototype.toExponential,Number.prototype.toFixed,Number.prototype.toPrecision,Number.prototype.toString,Object,Object.entries,Object.is,Object.isExtensible,Object.isFrozen,Object.isSealed,Object.keys,Object.values,parseFloat,parseInt,RegExp,Set,Set.prototype.entries,Set.prototype.has,Set.prototype.keys,Set.prototype.values,String,String.fromCharCode,String.fromCodePoint,String.raw,String.prototype.at,String.prototype.charAt,String.prototype.charCodeAt,String.prototype.codePointAt,String.prototype.concat,String.prototype.endsWith,String.prototype.includes,String.prototype.indexOf,String.prototype.lastIndexOf,String.prototype.normalize,String.prototype.padEnd,String.prototype.padStart,String.prototype.slice,String.prototype.startsWith,String.prototype.substr,String.prototype.substring,String.prototype.toLowerCase,String.prototype.toString,String.prototype.toUpperCase,String.prototype.trim,String.prototype.trimEnd,String.prototype.trimLeft,String.prototype.trimRight,String.prototype.trimStart,Symbol.for,Symbol.keyFor,unescape].filter(e=>typeof e=="function")),pt=new Set([Object.freeze,Object.preventExtensions,Object.seal]),Br=[[Map,new Set(["size"])],[RegExp,new Set(["dotAll","flags","global","hasIndices","ignoreCase","multiline","source","sticky","unicode"])],[Set,new Set(["size"])]];function Nr(e,t){let r=e;for(;(typeof r=="object"||typeof r=="function")&&r!==null;){let n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=Object.getPrototypeOf(r)}return null}function qr(e,t){let r=Nr(e,t);return r!=null&&r.get!=null}function ae(e,t){let r=[];for(let n=0;n<e.length;++n){let i=e[n];if(i==null)r.length=n+1;else if(i.type==="SpreadElement"){let s=T(i.argument,t);if(s==null)return null;r.push(...s.value)}else{let s=T(i,t);if(s==null)return null;r.push(s.value)}}return r}function Ar(e){return e!=null&&e.defs.length===0&&Fr.has(e.name)&&e.name in Rt}function Kr(e){if(e.defs.length!==1)return!1;let t=e.defs[0];return!!(t.parent&&t.type==="Variable"&&(t.parent.kind==="const"||Qr(e)))}function Qr(e){let t=e.references,r=t.filter(i=>i.init).length,n=t.filter(i=>i.isReadOnly()).length;return r===1&&n+r===t.length}function Dr(e,t){for(let n of e.references){let i=n.identifier;for(;i&&i.parent&&i.parent.type==="MemberExpression";)i=i.parent;if(!(!i||!i.parent)){if(i.parent.type==="AssignmentExpression"&&i.parent.left===i||i.parent.type==="UpdateExpression"&&i.parent.argument===i)return!0;if(i.parent.type==="CallExpression"&&i.parent.callee===i&&i.type==="MemberExpression"){let s=ge(i,t);if(r(s))return!0}}}return!1;function r(n){if(n==null||n.value==null)return!1;let i=n.value;return i==="copyWithin"||i==="fill"||i==="pop"||i==="push"||i==="reverse"||i==="shift"||i==="sort"||i==="splice"||i==="unshift"}}var ft=Object.freeze({ArrayExpression(e,t){let r=ae(e.elements,t);return r!=null?{value:r}:null},AssignmentExpression(e,t){return e.operator==="="?T(e.right,t):null},BinaryExpression(e,t){if(e.operator==="in"||e.operator==="instanceof")return null;let r=T(e.left,t),n=T(e.right,t);if(r!=null&&n!=null)switch(e.operator){case"==":return{value:r.value==n.value};case"!=":return{value:r.value!=n.value};case"===":return{value:r.value===n.value};case"!==":return{value:r.value!==n.value};case"<":return{value:r.value<n.value};case"<=":return{value:r.value<=n.value};case">":return{value:r.value>n.value};case">=":return{value:r.value>=n.value};case"<<":return{value:r.value<<n.value};case">>":return{value:r.value>>n.value};case">>>":return{value:r.value>>>n.value};case"+":return{value:r.value+n.value};case"-":return{value:r.value-n.value};case"*":return{value:r.value*n.value};case"/":return{value:r.value/n.value};case"%":return{value:r.value%n.value};case"**":return{value:r.value**n.value};case"|":return{value:r.value|n.value};case"^":return{value:r.value^n.value};case"&":return{value:r.value&n.value}}return null},CallExpression(e,t){let r=e.callee,n=ae(e.arguments,t);if(n!=null)if(r.type==="MemberExpression"){if(r.property.type==="PrivateIdentifier")return null;let i=T(r.object,t);if(i!=null){if(i.value==null&&(i.optional||e.optional))return{value:void 0,optional:!0};let s=ge(r,t);if(s!=null){let a=i.value,l=s.value;if(Pe.has(a[l]))return{value:a[l](...n)};if(pt.has(a[l]))return{value:n[0]}}}}else{let i=T(r,t);if(i!=null){if(i.value==null&&e.optional)return{value:void 0,optional:!0};let s=i.value;if(Pe.has(s))return{value:s(...n)};if(pt.has(s))return{value:n[0]}}}return null},ConditionalExpression(e,t){let r=T(e.test,t);return r!=null?r.value?T(e.consequent,t):T(e.alternate,t):null},ExpressionStatement(e,t){return T(e.expression,t)},Identifier(e,t){if(t!=null){let r=te(t,e);if(r!=null){if(Ar(r))return{value:Rt[r.name]};if(Kr(r)){let n=r.defs[0];if(n.node.id.type==="Identifier"){let i=T(n.node.init,t);return i&&typeof i.value=="object"&&i.value!==null&&Dr(r,t)?null:i}}}}return null},Literal(e){let t=e;return(t.regex!=null||t.bigint!=null)&&t.value==null?null:{value:t.value}},LogicalExpression(e,t){let r=T(e.left,t);if(r!=null){if(e.operator==="||"&&r.value||e.operator==="&&"&&!r.value||e.operator==="??"&&r.value!=null)return r;let n=T(e.right,t);if(n!=null)return n}return null},MemberExpression(e,t){if(e.property.type==="PrivateIdentifier")return null;let r=T(e.object,t);if(r!=null){if(r.value==null&&(r.optional||e.optional))return{value:void 0,optional:!0};let n=ge(e,t);if(n!=null){if(!qr(r.value,n.value))return{value:r.value[n.value]};for(let[i,s]of Br)if(r.value instanceof i&&s.has(n.value))return{value:r.value[n.value]}}}return null},ChainExpression(e,t){let r=T(e.expression,t);return r!=null?{value:r.value}:null},NewExpression(e,t){let r=T(e.callee,t),n=ae(e.arguments,t);if(r!=null&&n!=null){let i=r.value;if(Pe.has(i))return{value:new i(...n)}}return null},ObjectExpression(e,t){let r={};for(let n of e.properties)if(n.type==="Property"){if(n.kind!=="init")return null;let i=ge(n,t),s=T(n.value,t);if(i==null||s==null)return null;r[i.value]=s.value}else if(n.type==="SpreadElement"||n.type==="ExperimentalSpreadProperty"){let i=T(n.argument,t);if(i==null)return null;Object.assign(r,i.value)}else return null;return{value:r}},SequenceExpression(e,t){let r=e.expressions[e.expressions.length-1];return T(r,t)},TaggedTemplateExpression(e,t){let r=T(e.tag,t),n=ae(e.quasi.expressions,t);if(r!=null&&n!=null){let i=r.value,s=e.quasi.quasis.map(a=>a.value.cooked);if(s.raw=e.quasi.quasis.map(a=>a.value.raw),i===String.raw)return{value:i(s,...n)}}return null},TemplateLiteral(e,t){let r=ae(e.expressions,t);if(r!=null){let n=e.quasis[0].value.cooked;for(let i=0;i<r.length;++i)n+=r[i],n+=e.quasis[i+1].value.cooked;return{value:n}}return null},UnaryExpression(e,t){if(e.operator==="delete")return null;if(e.operator==="void")return{value:void 0};let r=T(e.argument,t);if(r!=null)switch(e.operator){case"-":return{value:-r.value};case"+":return{value:+r.value};case"!":return{value:!r.value};case"~":return{value:~r.value};case"typeof":return{value:typeof r.value}}return null},TSAsExpression(e,t){return T(e.expression,t)},TSSatisfiesExpression(e,t){return T(e.expression,t)},TSTypeAssertion(e,t){return T(e.expression,t)},TSNonNullExpression(e,t){return T(e.expression,t)},TSInstantiationExpression(e,t){return T(e.expression,t)}});function T(e,t){return e!=null&&Object.hasOwnProperty.call(ft,e.type)?ft[e.type](e,t):null}function ge(e,t){let r=e.type==="Property"?e.key:e.property;return e.computed?T(r,t):r.type==="Identifier"?{value:r.name}:r.type==="Literal"?r.bigint?{value:r.bigint}:{value:String(r.value)}:null}function Le(e,t=null){try{return T(e,t)}catch{return null}}function ue(e,t=null){if(e&&e.type==="Literal"&&e.value===null){let n=e;if(n.regex)return`/${n.regex.pattern}/${n.regex.flags}`;if(n.bigint)return n.bigint}let r=Le(e,t);if(r)try{return String(r.value)}catch{}return null}function le(e,t){switch(e.type){case"MemberExpression":return e.computed?ue(e.property,t):e.property.type==="PrivateIdentifier"?null:e.property.name;case"Property":case"MethodDefinition":case"PropertyDefinition":return e.computed?ue(e.key,t):e.key.type==="Literal"?String(e.key.value):e.key.type==="PrivateIdentifier"?null:e.key.name}return null}function Et(e,t){let r=e.parent;if(!r)return"";let n=[],i=r.type==="Property"&&r.value===e,s=r.type==="MethodDefinition"&&r.value===e,a=r.type==="PropertyDefinition"&&r.value===e;if((s||a)&&(r.static&&n.push("static"),r.key.type==="PrivateIdentifier"&&n.push("private")),e.async&&n.push("async"),e.generator&&n.push("generator"),i||s){if(r.kind==="constructor")return"constructor";r.kind==="get"?n.push("getter"):r.kind==="set"?n.push("setter"):n.push("method")}else a?n.push("method"):(e.type==="ArrowFunctionExpression"&&n.push("arrow"),n.push("function"));if(i||s||a)if(r.key.type==="PrivateIdentifier")n.push(`#${r.key.name}`);else{let l=le(r);if(l)n.push(`'${l}'`);else if(t){let u=t.getText(r.key);u.includes(`
|
|
3
|
+
`)||n.push(`[${u}]`)}}else Lr(e)?n.push(`'${e.id.name}'`):r.type==="VariableDeclarator"&&r.id&&r.id.type==="Identifier"?n.push(`'${r.id.name}'`):(r.type==="AssignmentExpression"||r.type==="AssignmentPattern")&&r.left&&r.left.type==="Identifier"?n.push(`'${r.left.name}'`):r.type==="ExportDefaultDeclaration"&&r.declaration===e&&n.push("'default'");return n.join(" ")}function Lr(e){return!!e.id}var Ur=Object.freeze(new Set(["==","!=","<","<=",">",">=","<<",">>",">>>","+","-","*","/","%","|","^","&","in"])),Wr=Object.freeze(new Set(["-","+","!","~"]));function yt(e){return e!==null&&typeof e=="object"&&typeof e.type=="string"}var Vr=Object.freeze(Object.assign(Object.create(null),{$visit(e,t,r){let{type:n}=e;return typeof this[n]=="function"?this[n](e,t,r):this.$visitChildren(e,t,r)},$visitChildren(e,t,r){let{type:n}=e;for(let i of r[n]||gt.getKeys(e)){let s=e[i];if(Array.isArray(s)){for(let a of s)if(yt(a)&&this.$visit(a,t,r))return!0}else if(yt(s)&&this.$visit(s,t,r))return!0}return!1},ArrowFunctionExpression(){return!1},AssignmentExpression(){return!0},AwaitExpression(){return!0},BinaryExpression(e,t,r){return t.considerImplicitTypeConversion&&Ur.has(e.operator)&&(e.left.type!=="Literal"||e.right.type!=="Literal")?!0:this.$visitChildren(e,t,r)},CallExpression(){return!0},FunctionExpression(){return!1},ImportExpression(){return!0},MemberExpression(e,t,r){return t.considerGetters||t.considerImplicitTypeConversion&&e.computed&&e.property.type!=="Literal"?!0:this.$visitChildren(e,t,r)},MethodDefinition(e,t,r){return t.considerImplicitTypeConversion&&e.computed&&e.key.type!=="Literal"?!0:this.$visitChildren(e,t,r)},NewExpression(){return!0},Property(e,t,r){return t.considerImplicitTypeConversion&&e.computed&&e.key.type!=="Literal"?!0:this.$visitChildren(e,t,r)},PropertyDefinition(e,t,r){return t.considerImplicitTypeConversion&&e.computed&&e.key.type!=="Literal"?!0:this.$visitChildren(e,t,r)},UnaryExpression(e,t,r){return e.operator==="delete"||t.considerImplicitTypeConversion&&Wr.has(e.operator)&&e.argument.type!=="Literal"?!0:this.$visitChildren(e,t,r)},UpdateExpression(){return!0},YieldExpression(){return!0}}));function Pt(e,t,r={}){let{considerGetters:n=!1,considerImplicitTypeConversion:i=!1}=r;return Vr.$visit(e,{considerGetters:n,considerImplicitTypeConversion:i},t.visitorKeys||gt.KEYS)}function $r(e,t){let r=e.parent;if(!r)return null;switch(r.type){case"CallExpression":case"NewExpression":return r.arguments.length===1&&r.arguments[0]===e?t.getTokenAfter(r.typeArguments||r.typeParameters||r.callee,$):null;case"DoWhileStatement":return r.test===e?t.getTokenAfter(r.body,$):null;case"IfStatement":case"WhileStatement":return r.test===e?t.getFirstToken(r,1):null;case"ImportExpression":return r.source===e?t.getFirstToken(r,1):null;case"SwitchStatement":return r.discriminant===e?t.getFirstToken(r,1):null;case"WithStatement":return r.object===e?t.getFirstToken(r,1):null;default:return null}}function Mt(e,t,r){let n,i,s,a,l;if(typeof e=="number"){if(n=e|0,i=t,s=r,!(n>=1))throw new TypeError("'times' should be a positive integer.")}else n=1,i=e,s=t;if(i==null||i.parent==null||i.parent.type==="CatchClause"&&i.parent.param===i)return!1;a=l=i;do a=s.getTokenBefore(a),l=s.getTokenAfter(l);while(a!=null&&l!=null&&$(a)&&ve(l)&&a!==$r(i,s)&&--n>0);return n===0}var Jr=/\$(?:[$&`']|[1-9][0-9]?)/gu,dt=new WeakMap;function Xr(e,t){let r=!1;for(let n=t-1;n>=0&&e.charCodeAt(n)===92;--n)r=!r;return r}function Hr(e,t,r){let n=[],i=0;function s(a,l){switch(a){case"$$":return"$";case"$&":return l[0];case"$`":return t.slice(0,l.index);case"$'":return t.slice(l.index+l[0].length);default:{let u=a.slice(1);return u in l?l[u]:a}}}for(let a of e.execAll(t))n.push(t.slice(i,a.index)),n.push(r.replace(Jr,l=>s(l,a))),i=a.index+a[0].length;return n.push(t.slice(i)),n.join("")}function zr(e,t,r){let n=[],i=0;for(let s of e.execAll(t))n.push(t.slice(i,s.index)),n.push(String(r(...s,s.index,s.input))),i=s.index+s[0].length;return n.push(t.slice(i)),n.join("")}var he=class{constructor(t,r={}){let{escaped:n=!1}=r;if(!(t instanceof RegExp))throw new TypeError("'pattern' should be a RegExp instance.");if(!t.flags.includes("g"))throw new Error("'pattern' should contains 'g' flag.");dt.set(this,{pattern:new RegExp(t.source,t.flags),escaped:!!n})}*execAll(t){let{pattern:r,escaped:n}=dt.get(this),i=null,s=0;for(r.lastIndex=0;(i=r.exec(t))!=null;)(n||!Xr(t,i.index))&&(s=r.lastIndex,yield i,r.lastIndex=s)}test(t){return!this.execAll(t).next().done}[Symbol.replace](t,r){return typeof r=="function"?zr(this,String(t),r):Hr(this,String(t),String(r))}},_r=/^(?:Import|Export(?:All|Default|Named))Declaration$/u;function Gr(e){return _r.test(e.type)&&e.source!=null}var H=Function.call.bind(Object.hasOwnProperty),x=Symbol("read"),z=Symbol("call"),re=Symbol("construct"),Se=Symbol("esm"),Zr={require:{[z]:!0}};function mt(e){return e==null||e.defs.length!==0||e.references.some(t=>t.isWrite())}function Yr(e){let t=e.parent;if(t)switch(t.type){case"ConditionalExpression":return t.consequent===e||t.alternate===e;case"LogicalExpression":return!0;case"SequenceExpression":return t.expressions[t.expressions.length-1]===e;case"ChainExpression":return!0;case"TSAsExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":case"TSNonNullExpression":case"TSInstantiationExpression":return!0;default:return!1}return!1}var J=class{constructor(t,r={}){let{mode:n="strict",globalObjectNames:i=["global","globalThis","self","window"]}=r;this.variableStack=[],this.globalScope=t,this.mode=n,this.globalObjectNames=i.slice(0)}*iterateGlobalReferences(t){for(let r of Object.keys(t)){let n=t[r],i=[r],s=this.globalScope.set.get(r);mt(s)||(yield*this._iterateVariableReferences(s,i,n,!0))}for(let r of this.globalObjectNames){let n=[],i=this.globalScope.set.get(r);mt(i)||(yield*this._iterateVariableReferences(i,n,t,!1))}}*iterateCjsReferences(t){for(let{node:r}of this.iterateGlobalReferences(Zr)){let n=ue(r.arguments[0]);if(n==null||!H(t,n))continue;let i=t[n],s=[n];i[x]&&(yield{node:r,path:s,type:x,info:i[x]}),yield*this._iteratePropertyReferences(r,s,i)}}*iterateEsmReferences(t){let r=this.globalScope.block;for(let n of r.body){if(!Gr(n))continue;let i=n.source.value;if(!H(t,i))continue;let s=t[i],a=[i];if(s[x]&&(yield{node:n,path:a,type:x,info:s[x]}),n.type==="ExportAllDeclaration")for(let l of Object.keys(s)){let u=s[l];u[x]&&(yield{node:n,path:a.concat(l),type:x,info:u[x]})}else for(let l of n.specifiers){let u=H(s,Se),p=this._iterateImportReferences(l,a,u?s:this.mode==="legacy"?{default:s,...s}:{default:s});if(u)yield*p;else for(let y of p)y.path=y.path.filter(en),(y.path.length>=2||y.type!==x)&&(yield y)}}}*iteratePropertyReferences(t,r){yield*this._iteratePropertyReferences(t,[],r)}*_iterateVariableReferences(t,r,n,i){if(!this.variableStack.includes(t)){this.variableStack.push(t);try{for(let s of t.references){if(!s.isRead())continue;let a=s.identifier;i&&n[x]&&(yield{node:a,path:r,type:x,info:n[x]}),yield*this._iteratePropertyReferences(a,r,n)}}finally{this.variableStack.pop()}}}*_iteratePropertyReferences(t,r,n){let i=t;for(;Yr(i);)i=i.parent;let s=i.parent;if(s){if(s.type==="MemberExpression"){if(s.object===i){let a=le(s);if(a==null||!H(n,a))return;r=r.concat(a);let l=n[a];l[x]&&(yield{node:s,path:r,type:x,info:l[x]}),yield*this._iteratePropertyReferences(s,r,l)}return}if(s.type==="CallExpression"){s.callee===i&&n[z]&&(yield{node:s,path:r,type:z,info:n[z]});return}if(s.type==="NewExpression"){s.callee===i&&n[re]&&(yield{node:s,path:r,type:re,info:n[re]});return}if(s.type==="AssignmentExpression"){s.right===i&&(yield*this._iterateLhsReferences(s.left,r,n),yield*this._iteratePropertyReferences(s,r,n));return}if(s.type==="AssignmentPattern"){s.right===i&&(yield*this._iterateLhsReferences(s.left,r,n));return}s.type==="VariableDeclarator"&&s.init===i&&(yield*this._iterateLhsReferences(s.id,r,n))}}*_iterateLhsReferences(t,r,n){if(t.type==="Identifier"){let i=te(this.globalScope,t);i!=null&&(yield*this._iterateVariableReferences(i,r,n,!1));return}if(t.type==="ObjectPattern"){for(let i of t.properties){let s=le(i);if(s==null||!H(n,s))continue;let a=r.concat(s),l=n[s];l[x]&&(yield{node:i,path:a,type:x,info:l[x]}),yield*this._iterateLhsReferences(i.value,a,l)}return}t.type==="AssignmentPattern"&&(yield*this._iterateLhsReferences(t.left,r,n))}*_iterateImportReferences(t,r,n){let i=t.type;if(i==="ImportSpecifier"||i==="ImportDefaultSpecifier"){let s=i==="ImportDefaultSpecifier"?"default":t.imported.type==="Identifier"?t.imported.name:t.imported.value;if(!H(n,s))return;r=r.concat(s);let a=n[s];a[x]&&(yield{node:t,path:r,type:x,info:a[x]}),yield*this._iterateVariableReferences(te(this.globalScope,t.local),r,a,!1);return}if(i==="ImportNamespaceSpecifier"){yield*this._iterateVariableReferences(te(this.globalScope,t.local),r,n,!1);return}if(i==="ExportSpecifier"){let s=t.local.type==="Identifier"?t.local.name:t.local.value;if(!H(n,s))return;r=r.concat(s);let a=n[s];a[x]&&(yield{node:t,path:r,type:x,info:a[x]})}}};J.READ=x;J.CALL=z;J.CONSTRUCT=re;J.ESM=Se;function en(e,t){return!(t===1&&e==="default")}var tn={CALL:z,CONSTRUCT:re,ESM:Se,findVariable:te,getFunctionHeadLocation:jt,getFunctionNameWithKind:Et,getInnermostScope:Me,getPropertyName:le,getStaticValue:Le,getStringIfConstant:ue,hasSideEffect:Pt,isArrowToken:be,isClosingBraceToken:Qe,isClosingBracketToken:Ae,isClosingParenToken:ve,isColonToken:Ne,isCommaToken:Fe,isCommentToken:De,isNotArrowToken:ht,isNotClosingBraceToken:wt,isNotClosingBracketToken:It,isNotClosingParenToken:xt,isNotColonToken:St,isNotCommaToken:bt,isNotCommentToken:kt,isNotOpeningBraceToken:Ot,isNotOpeningBracketToken:Ct,isNotOpeningParenToken:Tt,isNotSemicolonToken:vt,isOpeningBraceToken:Ke,isOpeningBracketToken:qe,isOpeningParenToken:$,isParenthesized:Mt,isSemicolonToken:Be,PatternMatcher:he,READ:x,ReferenceTracker:J};v.CALL=z;v.CONSTRUCT=re;v.ESM=Se;v.PatternMatcher=he;v.READ=x;v.ReferenceTracker=J;v.default=tn;v.findVariable=te;v.getFunctionHeadLocation=jt;v.getFunctionNameWithKind=Et;v.getInnermostScope=Me;v.getPropertyName=le;v.getStaticValue=Le;v.getStringIfConstant=ue;v.hasSideEffect=Pt;v.isArrowToken=be;v.isClosingBraceToken=Qe;v.isClosingBracketToken=Ae;v.isClosingParenToken=ve;v.isColonToken=Ne;v.isCommaToken=Fe;v.isCommentToken=De;v.isNotArrowToken=ht;v.isNotClosingBraceToken=wt;v.isNotClosingBracketToken=It;v.isNotClosingParenToken=xt;v.isNotColonToken=St;v.isNotCommaToken=bt;v.isNotCommentToken=kt;v.isNotOpeningBraceToken=Ot;v.isNotOpeningBracketToken=Ct;v.isNotOpeningParenToken=Tt;v.isNotSemicolonToken=vt;v.isOpeningBraceToken=Ke;v.isOpeningBracketToken=qe;v.isOpeningParenToken=$;v.isParenthesized=Mt;v.isSemicolonToken=Be});var Ft=C(O=>{"use strict";var rn=O&&O.__createBinding||(Object.create?(function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}):(function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]})),nn=O&&O.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),sn=O&&O.__importStar||(function(){var e=function(t){return e=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},e(t)};return function(t){if(t&&t.__esModule)return t;var r={};if(t!=null)for(var n=e(t),i=0;i<n.length;i++)n[i]!=="default"&&rn(r,t,n[i]);return nn(r,t),r}})();Object.defineProperty(O,"__esModule",{value:!0});O.isParenthesized=O.hasSideEffect=O.getStringIfConstant=O.getStaticValue=O.getPropertyName=O.getFunctionNameWithKind=O.getFunctionHeadLocation=void 0;var _=sn(ne());O.getFunctionHeadLocation=_.getFunctionHeadLocation;O.getFunctionNameWithKind=_.getFunctionNameWithKind;O.getPropertyName=_.getPropertyName;O.getStaticValue=_.getStaticValue;O.getStringIfConstant=_.getStringIfConstant;O.hasSideEffect=_.hasSideEffect;O.isParenthesized=_.isParenthesized});var Bt=C(D=>{"use strict";var on=D&&D.__createBinding||(Object.create?(function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}):(function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]})),an=D&&D.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),un=D&&D.__importStar||(function(){var e=function(t){return e=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},e(t)};return function(t){if(t&&t.__esModule)return t;var r={};if(t!=null)for(var n=e(t),i=0;i<n.length;i++)n[i]!=="default"&&on(r,t,n[i]);return an(r,t),r}})();Object.defineProperty(D,"__esModule",{value:!0});D.PatternMatcher=void 0;var ln=un(ne());D.PatternMatcher=ln.PatternMatcher});var Nt=C(f=>{"use strict";var cn=f&&f.__createBinding||(Object.create?(function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}):(function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]})),pn=f&&f.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),fn=f&&f.__importStar||(function(){var e=function(t){return e=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},e(t)};return function(t){if(t&&t.__esModule)return t;var r={};if(t!=null)for(var n=e(t),i=0;i<n.length;i++)n[i]!=="default"&&cn(r,t,n[i]);return pn(r,t),r}})();Object.defineProperty(f,"__esModule",{value:!0});f.isNotSemicolonToken=f.isSemicolonToken=f.isNotOpeningParenToken=f.isOpeningParenToken=f.isNotOpeningBracketToken=f.isOpeningBracketToken=f.isNotOpeningBraceToken=f.isOpeningBraceToken=f.isNotCommentToken=f.isCommentToken=f.isNotCommaToken=f.isCommaToken=f.isNotColonToken=f.isColonToken=f.isNotClosingParenToken=f.isClosingParenToken=f.isNotClosingBracketToken=f.isClosingBracketToken=f.isNotClosingBraceToken=f.isClosingBraceToken=f.isNotArrowToken=f.isArrowToken=void 0;var w=fn(ne());f.isArrowToken=w.isArrowToken;f.isNotArrowToken=w.isNotArrowToken;f.isClosingBraceToken=w.isClosingBraceToken;f.isNotClosingBraceToken=w.isNotClosingBraceToken;f.isClosingBracketToken=w.isClosingBracketToken;f.isNotClosingBracketToken=w.isNotClosingBracketToken;f.isClosingParenToken=w.isClosingParenToken;f.isNotClosingParenToken=w.isNotClosingParenToken;f.isColonToken=w.isColonToken;f.isNotColonToken=w.isNotColonToken;f.isCommaToken=w.isCommaToken;f.isNotCommaToken=w.isNotCommaToken;f.isCommentToken=w.isCommentToken;f.isNotCommentToken=w.isNotCommentToken;f.isOpeningBraceToken=w.isOpeningBraceToken;f.isNotOpeningBraceToken=w.isNotOpeningBraceToken;f.isOpeningBracketToken=w.isOpeningBracketToken;f.isNotOpeningBracketToken=w.isNotOpeningBracketToken;f.isOpeningParenToken=w.isOpeningParenToken;f.isNotOpeningParenToken=w.isNotOpeningParenToken;f.isSemicolonToken=w.isSemicolonToken;f.isNotSemicolonToken=w.isNotSemicolonToken});var qt=C(L=>{"use strict";var yn=L&&L.__createBinding||(Object.create?(function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}):(function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]})),dn=L&&L.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),mn=L&&L.__importStar||(function(){var e=function(t){return e=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},e(t)};return function(t){if(t&&t.__esModule)return t;var r={};if(t!=null)for(var n=e(t),i=0;i<n.length;i++)n[i]!=="default"&&yn(r,t,n[i]);return dn(r,t),r}})();Object.defineProperty(L,"__esModule",{value:!0});L.ReferenceTracker=void 0;var ce=mn(ne()),Ei=ce.ReferenceTracker.READ,Pi=ce.ReferenceTracker.CALL,Mi=ce.ReferenceTracker.CONSTRUCT,Fi=ce.ReferenceTracker.ESM;L.ReferenceTracker=ce.ReferenceTracker});var Kt=C(F=>{"use strict";var gn=F&&F.__createBinding||(Object.create?(function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}):(function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]})),hn=F&&F.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),bn=F&&F.__importStar||(function(){var e=function(t){return e=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},e(t)};return function(t){if(t&&t.__esModule)return t;var r={};if(t!=null)for(var n=e(t),i=0;i<n.length;i++)n[i]!=="default"&&gn(r,t,n[i]);return hn(r,t),r}})();Object.defineProperty(F,"__esModule",{value:!0});F.getInnermostScope=F.findVariable=void 0;var At=bn(ne());F.findVariable=At.findVariable;F.getInnermostScope=At.getInnermostScope});var Qt=C(q=>{"use strict";var vn=q&&q.__createBinding||(Object.create?(function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}):(function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]})),pe=q&&q.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&vn(t,e,r)};Object.defineProperty(q,"__esModule",{value:!0});pe(Ft(),q);pe(Bt(),q);pe(Nt(),q);pe(qt(),q);pe(Kt(),q)});var Ue=C(M=>{"use strict";Object.defineProperty(M,"__esModule",{value:!0});M.isNotTokenOfTypeWithConditions=M.isTokenOfTypeWithConditions=M.isNodeOfTypeWithConditions=M.isNodeOfTypes=M.isNodeOfType=void 0;var Sn=e=>t=>t?.type===e;M.isNodeOfType=Sn;var Tn=e=>t=>!!t&&e.includes(t.type);M.isNodeOfTypes=Tn;var xn=(e,t)=>{let r=Object.entries(t);return n=>n?.type===e&&r.every(([i,s])=>n[i]===s)};M.isNodeOfTypeWithConditions=xn;var Cn=(e,t)=>{let r=Object.entries(t);return n=>n?.type===e&&r.every(([i,s])=>n[i]===s)};M.isTokenOfTypeWithConditions=Cn;var In=(e,t)=>r=>!(0,M.isTokenOfTypeWithConditions)(e,t)(r);M.isNotTokenOfTypeWithConditions=In});var Dt=C(fe=>{"use strict";Object.defineProperty(fe,"__esModule",{value:!0});fe.LINEBREAK_MATCHER=void 0;fe.isTokenOnSameLine=On;fe.LINEBREAK_MATCHER=/\r\n|[\r\n\u2028\u2029]/;function On(e,t){return e.loc.end.line===t.loc.start.line}});var Wt=C(m=>{"use strict";Object.defineProperty(m,"__esModule",{value:!0});m.isLoop=m.isImportKeyword=m.isTypeKeyword=m.isAwaitKeyword=m.isAwaitExpression=m.isIdentifier=m.isConstructor=m.isClassOrTypeElement=m.isTSConstructorType=m.isTSFunctionType=m.isFunctionOrFunctionType=m.isFunctionType=m.isFunction=m.isVariableDeclarator=m.isTypeAssertion=m.isLogicalOrOperator=m.isOptionalCallExpression=m.isNotNonNullAssertionPunctuator=m.isNonNullAssertionPunctuator=m.isNotOptionalChainPunctuator=m.isOptionalChainPunctuator=void 0;m.isSetter=wn;var g=Ee(),k=Ue();m.isOptionalChainPunctuator=(0,k.isTokenOfTypeWithConditions)(g.AST_TOKEN_TYPES.Punctuator,{value:"?."});m.isNotOptionalChainPunctuator=(0,k.isNotTokenOfTypeWithConditions)(g.AST_TOKEN_TYPES.Punctuator,{value:"?."});m.isNonNullAssertionPunctuator=(0,k.isTokenOfTypeWithConditions)(g.AST_TOKEN_TYPES.Punctuator,{value:"!"});m.isNotNonNullAssertionPunctuator=(0,k.isNotTokenOfTypeWithConditions)(g.AST_TOKEN_TYPES.Punctuator,{value:"!"});m.isOptionalCallExpression=(0,k.isNodeOfTypeWithConditions)(g.AST_NODE_TYPES.CallExpression,{optional:!0});m.isLogicalOrOperator=(0,k.isNodeOfTypeWithConditions)(g.AST_NODE_TYPES.LogicalExpression,{operator:"||"});m.isTypeAssertion=(0,k.isNodeOfTypes)([g.AST_NODE_TYPES.TSAsExpression,g.AST_NODE_TYPES.TSTypeAssertion]);m.isVariableDeclarator=(0,k.isNodeOfType)(g.AST_NODE_TYPES.VariableDeclarator);var Lt=[g.AST_NODE_TYPES.ArrowFunctionExpression,g.AST_NODE_TYPES.FunctionDeclaration,g.AST_NODE_TYPES.FunctionExpression];m.isFunction=(0,k.isNodeOfTypes)(Lt);var Ut=[g.AST_NODE_TYPES.TSCallSignatureDeclaration,g.AST_NODE_TYPES.TSConstructorType,g.AST_NODE_TYPES.TSConstructSignatureDeclaration,g.AST_NODE_TYPES.TSDeclareFunction,g.AST_NODE_TYPES.TSEmptyBodyFunctionExpression,g.AST_NODE_TYPES.TSFunctionType,g.AST_NODE_TYPES.TSMethodSignature];m.isFunctionType=(0,k.isNodeOfTypes)(Ut);m.isFunctionOrFunctionType=(0,k.isNodeOfTypes)([...Lt,...Ut]);m.isTSFunctionType=(0,k.isNodeOfType)(g.AST_NODE_TYPES.TSFunctionType);m.isTSConstructorType=(0,k.isNodeOfType)(g.AST_NODE_TYPES.TSConstructorType);m.isClassOrTypeElement=(0,k.isNodeOfTypes)([g.AST_NODE_TYPES.PropertyDefinition,g.AST_NODE_TYPES.FunctionExpression,g.AST_NODE_TYPES.MethodDefinition,g.AST_NODE_TYPES.TSAbstractPropertyDefinition,g.AST_NODE_TYPES.TSAbstractMethodDefinition,g.AST_NODE_TYPES.TSEmptyBodyFunctionExpression,g.AST_NODE_TYPES.TSIndexSignature,g.AST_NODE_TYPES.TSCallSignatureDeclaration,g.AST_NODE_TYPES.TSConstructSignatureDeclaration,g.AST_NODE_TYPES.TSMethodSignature,g.AST_NODE_TYPES.TSPropertySignature]);m.isConstructor=(0,k.isNodeOfTypeWithConditions)(g.AST_NODE_TYPES.MethodDefinition,{kind:"constructor"});function wn(e){return!!e&&(e.type===g.AST_NODE_TYPES.MethodDefinition||e.type===g.AST_NODE_TYPES.Property)&&e.kind==="set"}m.isIdentifier=(0,k.isNodeOfType)(g.AST_NODE_TYPES.Identifier);m.isAwaitExpression=(0,k.isNodeOfType)(g.AST_NODE_TYPES.AwaitExpression);m.isAwaitKeyword=(0,k.isTokenOfTypeWithConditions)(g.AST_TOKEN_TYPES.Identifier,{value:"await"});m.isTypeKeyword=(0,k.isTokenOfTypeWithConditions)(g.AST_TOKEN_TYPES.Identifier,{value:"type"});m.isImportKeyword=(0,k.isTokenOfTypeWithConditions)(g.AST_TOKEN_TYPES.Keyword,{value:"import"});m.isLoop=(0,k.isNodeOfTypes)([g.AST_NODE_TYPES.DoWhileStatement,g.AST_NODE_TYPES.ForStatement,g.AST_NODE_TYPES.ForInStatement,g.AST_NODE_TYPES.ForOfStatement,g.AST_NODE_TYPES.WhileStatement])});var Vt=C(U=>{"use strict";var kn=U&&U.__createBinding||(Object.create?(function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}):(function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]})),Te=U&&U.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&kn(t,e,r)};Object.defineProperty(U,"__esModule",{value:!0});Te(Qt(),U);Te(Ue(),U);Te(Dt(),U);Te(Wt(),U)});var Ve=C(xe=>{"use strict";Object.defineProperty(xe,"__esModule",{value:!0});xe.isObjectNotArray=We;xe.deepMerge=$t;function We(e){return typeof e=="object"&&e!=null&&!Array.isArray(e)}function $t(e={},t={}){let r=new Set([...Object.keys(e),...Object.keys(t)]);return Object.fromEntries([...r].map(n=>{let i=n in e,s=n in t,a=e[n],l=t[n],u;return i&&s?We(a)&&We(l)?u=$t(a,l):u=l:i?u=a:u=l,[n,u]}))}});var Xe=C(Je=>{"use strict";Object.defineProperty(Je,"__esModule",{value:!0});Je.applyDefault=jn;var $e=Ve();function jn(e,t){let r=structuredClone(e);return t==null||r.forEach((n,i)=>{if(t[i]!==void 0){let s=t[i];(0,$e.isObjectNotArray)(s)&&(0,$e.isObjectNotArray)(n)?r[i]=(0,$e.deepMerge)(n,s):r[i]=s}}),r}});var Jt=C(He=>{"use strict";Object.defineProperty(He,"__esModule",{value:!0});He.parserSeemsToBeTSESLint=Rn;function Rn(e){return!!e&&/(?:typescript-eslint|\.\.)[\w/\\]*parser/.test(e)}});var Ht=C(ze=>{"use strict";Object.defineProperty(ze,"__esModule",{value:!0});ze.getParserServices=Fn;var En=Jt(),Pn="You have used a rule which requires type information, but don't have parserOptions set to generate type information for this file. See https://tseslint.com/typed-linting for enabling linting with type information.",Mn='Note: detected a parser other than @typescript-eslint/parser. Make sure the parser is configured to forward "parserOptions.project" to @typescript-eslint/parser.';function Fn(e,t=!1){let r=e.parserPath||e.languageOptions.parser?.meta?.name;return(e.sourceCode.parserServices?.esTreeNodeToTSNodeMap==null||e.sourceCode.parserServices.tsNodeToESTreeNodeMap==null)&&Xt(r),e.sourceCode.parserServices.program==null&&!t&&Xt(r),e.sourceCode.parserServices}function Xt(e){let t=[Pn,`Parser: ${e||"(unknown)"}`,!(0,En.parserSeemsToBeTSESLint)(e)&&Mn].filter(Boolean);throw new Error(t.join(`
|
|
4
|
+
`))}});var _t=C(zt=>{"use strict";Object.defineProperty(zt,"__esModule",{value:!0})});var Gt=C(ye=>{"use strict";Object.defineProperty(ye,"__esModule",{value:!0});ye.NullThrowsReasons=void 0;ye.nullThrows=Bn;ye.NullThrowsReasons={MissingParent:"Expected node to have a parent.",MissingToken:(e,t)=>`Expected to find a ${e} for the ${t}.`};function Bn(e,t){if(e==null)throw new Error(`Non-null Assertion Failed: ${t}`);return e}});var er=C(_e=>{"use strict";Object.defineProperty(_e,"__esModule",{value:!0});_e.RuleCreator=Zt;var Nn=Xe();function Zt(e){return function({meta:r,name:n,...i}){return Yt({meta:{...r,docs:{...r.docs,url:e(n)}},name:n,...i})}}function Yt({create:e,defaultOptions:t,meta:r,name:n}){let i=r.defaultOptions??t??[];return{create(s){let a=(0,Nn.applyDefault)(i,s.options);return e(s,a)},defaultOptions:t,meta:r,name:n}}Zt.withoutDocs=function(t){return Yt(t)}});var tr=C(B=>{"use strict";var qn=B&&B.__createBinding||(Object.create?(function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}):(function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]})),ie=B&&B.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&qn(t,e,r)};Object.defineProperty(B,"__esModule",{value:!0});ie(Xe(),B);ie(Ve(),B);ie(Ht(),B);ie(_t(),B);ie(Gt(),B);ie(er(),B)});var o={};Cr(o,{ASTUtils:()=>An,ESLintUtils:()=>W});me(o,we(Ee()));var An=we(Vt()),W=we(tr());function Kn(e,t){return e.filter((r,n,i)=>i.findIndex(s=>t(r)===t(s))===n)}var b={isNodeOfOneOf(e,t){return t.includes(e.type)},isIdentifier(e){return e.type===o.AST_NODE_TYPES.Identifier},isIdentifierWithName(e,t){return b.isIdentifier(e)&&e.name===t},isIdentifierWithOneOfNames(e,t){return b.isIdentifier(e)&&t.includes(e.name)},isProperty(e){return e.type===o.AST_NODE_TYPES.Property},isObjectExpression(e){return e.type===o.AST_NODE_TYPES.ObjectExpression},isPropertyWithIdentifierKey(e,t){return b.isProperty(e)&&b.isIdentifierWithName(e.key,t)},findPropertyWithIdentifierKey(e,t){return e.find(r=>b.isPropertyWithIdentifierKey(r,t))},traverseUpOnly(e,t){let r=e.parent;return r!==void 0&&t.includes(r.type)?b.traverseUpOnly(r,t):e},traverseUpMemberExpression(e){let t=e.parent;return t!==void 0&&(t.type===o.AST_NODE_TYPES.MemberExpression&&t.object===e||t.type===o.AST_NODE_TYPES.ChainExpression||t.type===o.AST_NODE_TYPES.TSNonNullExpression)?b.traverseUpMemberExpression(t):e},isDeclaredInNode(e){let{functionNode:t,reference:r,scopeManager:n}=e,i=n.acquire(t);return i===null?!1:i.set.has(r.identifier.name)},getExternalRefs(e){let{scopeManager:t,sourceCode:r,node:n}=e,i=t.acquire(n);if(i===null)return[];let s=u=>{let p=[...u.references];for(let y of u.childScopes)p.push(...s(y));return p},a=s(i).filter(u=>u.isRead()&&!i.set.has(u.identifier.name)).map(u=>{let p=b.traverseUpMemberExpression(u.identifier),y=p.parent,S=y!==void 0&&y.type===o.AST_NODE_TYPES.MemberExpression&&y.computed&&y.property===p&&y.parent.type===o.AST_NODE_TYPES.CallExpression&&y.parent.callee===y?p:b.traverseUpOnly(u.identifier,[o.AST_NODE_TYPES.MemberExpression,o.AST_NODE_TYPES.Identifier]);return{variable:u,node:S,text:r.getText(S)}}),l=new Set([...i.set.values()].map(u=>r.getText(u.identifiers[0])));return Kn(a.filter(u=>u.variable.resolved===null||!l.has(u.text)),u=>u.text).map(u=>u.variable)},isValidReactComponentOrHookName(e){return e!=null&&/^(use|[A-Z])/.test(e.name)},getFunctionAncestor(e,t){for(let r of e.getAncestors(t))if(b.isNodeOfOneOf(r,[o.AST_NODE_TYPES.FunctionDeclaration,o.AST_NODE_TYPES.FunctionExpression,o.AST_NODE_TYPES.ArrowFunctionExpression])||r.parent?.type===o.AST_NODE_TYPES.VariableDeclarator&&r.parent.id.type===o.AST_NODE_TYPES.Identifier&&b.isNodeOfOneOf(r,[o.AST_NODE_TYPES.FunctionDeclaration,o.AST_NODE_TYPES.FunctionExpression,o.AST_NODE_TYPES.ArrowFunctionExpression]))return r},getReferencedExpressionByIdentifier(e){let{node:t,context:r}=e,n=r.sourceCode??r.getSourceCode(),i=(r.sourceCode.getScope(t)?n.getScope(t):r.getScope()).references.find(s=>s.identifier===t)?.resolved?.defs[0]?.node;return i?.type!==o.AST_NODE_TYPES.VariableDeclarator?null:i.init}},G=e=>`https://tanstack.com/query/latest/docs/eslint/${e}`;function Z(e){return(t,r)=>{let n=[],i={isSpecificTanstackQueryImport(u,p){return!!n.find(y=>y.type===o.TSESTree.AST_NODE_TYPES.ImportSpecifier&&y.parent.type===o.TSESTree.AST_NODE_TYPES.ImportDeclaration&&y.parent.source.value===p?u.name===y.local.name:!1)},isTanstackQueryImport(u){return!!n.find(p=>p.type===o.TSESTree.AST_NODE_TYPES.ImportSpecifier?u.name===p.local.name:!1)}},s={ImportDeclaration(u){u.specifiers.length>0&&(u.importKind==="value"||u.importKind===void 0)&&u.source.value.startsWith("@tanstack/")&&u.source.value.endsWith("-query")&&n.push(...u.specifiers)}},a=e(t,r,i),l={};return new Set(Object.keys(s).concat(Object.keys(a))).forEach(u=>{l[u]=p=>{u in s&&s[u]?.(p);let y=a[u];if(y)return y(p)}}),l}}var j={isRelevantReference(e){let{sourceCode:t,reference:r,scopeManager:n,node:i,filename:s}=e,a=b.getFunctionAncestor(t,i),l=n.acquire(i);if(l===null||r.isValueReference===!1)return!1;let u=r.resolved?.scope??null;for(;u!==null;){if(u===l)return!1;u=u.upper}if(a!==void 0){if(!b.isDeclaredInNode({scopeManager:n,reference:r,functionNode:a}))return!1}else{if(!s.endsWith(".vue"))return!1;let p=r.resolved?.defs[0],y=p===void 0,S=p?.type==="ImportBinding";if(y||S)return!1}return r.identifier.name!=="undefined"&&!j.isFunctionCallTarget(r.identifier)&&r.identifier.parent.type!==o.AST_NODE_TYPES.NewExpression&&!j.isInstanceOfKind(r.identifier.parent)},isFunctionCallTarget(e){let t=b.traverseUpMemberExpression(e);return t.parent!==void 0&&t.parent.type===o.AST_NODE_TYPES.CallExpression&&t.parent.callee===t},computeFilteredMissingPaths(e){let{requiredRefs:t,allowlistedVariables:r,existingRootIdentifiers:n,existingFullPaths:i}=e,s=new Set;for(let{root:a,path:l,allowlistedByType:u}of t)n.has(a)||r.has(a)||i.has(l)||u||s.add(l);for(let a of s){let l=a.split(".")[0];l!==a&&l!==void 0&&s.has(l)&&s.delete(a)}return Array.from(s)},collectQueryKeyDeps(e){let{sourceCode:t,scopeManager:r,queryKeyNode:n}=e,i=new Set,s=new Set,a=t.visitorKeys;function l(h){let I=j.normalizeChain(h);i.add(I),s.add(I)}function u(h){let I=j.normalizeChain(h);s.add(I)}function p(h){if(h){if(h.coversRootMembers){l(h.root);return}u(h.path)}}function y(h){let I=a[h.type]??[];for(let E of I){let A=h[E];if(Array.isArray(A)){for(let c of A)j.isNode(c)&&S(c);continue}j.isNode(A)&&S(A)}}function S(h){if(h){switch(h.type){case o.AST_NODE_TYPES.Identifier:p(j.computeRefPath({identifier:h,sourceCode:t}));return;case o.AST_NODE_TYPES.ArrowFunctionExpression:case o.AST_NODE_TYPES.FunctionExpression:for(let I of j.collectExternalRefsInFunction({functionNode:h,scopeManager:r}))I.identifier.type===o.AST_NODE_TYPES.Identifier&&p(j.computeRefPath({identifier:I.identifier,sourceCode:t}));return;case o.AST_NODE_TYPES.Property:S(h.value);return;case o.AST_NODE_TYPES.MemberExpression:h.parent.type===o.AST_NODE_TYPES.CallExpression&&h.parent.callee===h&&h.object.type===o.AST_NODE_TYPES.Identifier?l(h.object.name):S(h.object);return;case o.AST_NODE_TYPES.CallExpression:switch(h.arguments.forEach(I=>S(I)),h.callee.type){case o.AST_NODE_TYPES.Identifier:case o.AST_NODE_TYPES.MemberExpression:case o.AST_NODE_TYPES.ChainExpression:case o.AST_NODE_TYPES.TSNonNullExpression:S(h.callee)}return}y(h)}}return S(n),{roots:i,paths:s}},isNode(e){return typeof e=="object"&&e!==null&&"type"in e&&typeof e.type=="string"},variableIsAllowlistedByType(e){let{allowlistedTypes:t,variable:r}=e;if(t.size===0||!r)return!1;for(let n of r.identifiers)if(n.typeAnnotation){let i=new Set;j.collectTypeIdentifiers(n.typeAnnotation.typeAnnotation,i);for(let s of i)if(t.has(s))return!0}return!1},isInstanceOfKind(e){return e.type===o.AST_NODE_TYPES.BinaryExpression&&e.operator==="instanceof"},normalizeChain(e){return e.replace(/(?:\?(\.)|!)/g,"$1").replace(/\s+/g,"")},computeRefPath(e){let{identifier:t,sourceCode:r}=e,n=b.traverseUpMemberExpression(t),i=j.normalizeChain(r.getText(n)),s=n.parent,a=i,l=i===t.name;if(s&&s.type===o.AST_NODE_TYPES.CallExpression&&s.callee===n){let p=i.split(".");p.length>1&&(a=p.slice(0,-1).join(".")),l=!1}a=a.split(".")[0]===""?t.name:a;let u=a.split(".")[0];return{path:a,root:u??t.name,coversRootMembers:l&&a===u}},collectExternalRefsInFunction(e){let{functionNode:t,scopeManager:r}=e,n=r.acquire(t);if(n===null)return[];let i=[];function s(a){for(let l of a.references){if(!l.isRead()||l.resolved===null)continue;let u=l.resolved.scope,p=!1;for(;u!==null;){if(u===n){p=!0;break}u=u.upper}p||i.push(l)}for(let l of a.childScopes)s(l)}return s(n),i},collectTypeIdentifiers(e,t){switch(e.type){case o.AST_NODE_TYPES.TSTypeReference:e.typeName.type===o.AST_NODE_TYPES.Identifier&&t.add(e.typeName.name);break;case o.AST_NODE_TYPES.TSUnionType:case o.AST_NODE_TYPES.TSIntersectionType:e.types.forEach(r=>j.collectTypeIdentifiers(r,t));break;case o.AST_NODE_TYPES.TSArrayType:j.collectTypeIdentifiers(e.elementType,t);break;case o.AST_NODE_TYPES.TSTupleType:e.elementTypes.forEach(r=>j.collectTypeIdentifiers(r,t))}},getQueryFnNodes(e){return e.value.type!==o.AST_NODE_TYPES.ConditionalExpression?[e.value]:e.value.consequent.type===o.AST_NODE_TYPES.Identifier&&e.value.consequent.name==="skipToken"?[e.value.alternate]:e.value.alternate.type===o.AST_NODE_TYPES.Identifier&&e.value.alternate.name==="skipToken"?[e.value.consequent]:[e.value.consequent,e.value.alternate]}},Qn="queryKey",Dn="queryFn",nr="exhaustive-deps",Ln=W.RuleCreator(G)({name:nr,meta:{type:"problem",docs:{description:"Exhaustive deps rule for useQuery",recommended:"error"},messages:{missingDeps:"The following dependencies are missing in your queryKey: {{deps}}",fixTo:"Fix to {{result}}"},hasSuggestions:!0,schema:[{type:"object",properties:{allowlist:{type:"object",properties:{variables:{type:"array",items:{type:"string"}},types:{type:"array",items:{type:"string"}}},additionalProperties:!1}},additionalProperties:!1}]},defaultOptions:[],create:Z(e=>({ObjectExpression:t=>{let r=e.sourceCode.scopeManager,n=b.findPropertyWithIdentifierKey(t.properties,Qn),i=b.findPropertyWithIdentifierKey(t.properties,Dn);if(r===null||n===void 0||i===void 0||!b.isNodeOfOneOf(i.value,[o.AST_NODE_TYPES.ArrowFunctionExpression,o.AST_NODE_TYPES.FunctionExpression,o.AST_NODE_TYPES.ConditionalExpression]))return;let s=Wn(n.value,e),a=j.getQueryFnNodes(i),l=a.flatMap(c=>b.getExternalRefs({scopeManager:r,sourceCode:e.sourceCode,node:c})).filter(c=>a.some(d=>j.isRelevantReference({sourceCode:e.sourceCode,reference:c,scopeManager:r,node:d,filename:e.filename}))),u=e.options.at(0),p=new Set(u?.allowlist?.variables??[]),y=new Set(u?.allowlist?.types??[]),S=l.flatMap(c=>{if(c.identifier.type!==o.AST_NODE_TYPES.Identifier)return[];let d=j.computeRefPath({identifier:c.identifier,sourceCode:e.sourceCode});return d===null?[]:[{...d,allowlistedByType:j.variableIsAllowlistedByType({allowlistedTypes:y,variable:c.resolved??null})}]});if(S.length===0)return;let h=j.collectQueryKeyDeps({sourceCode:e.sourceCode,scopeManager:r,queryKeyNode:s}),I=j.computeFilteredMissingPaths({requiredRefs:S,allowlistedVariables:p,existingRootIdentifiers:h.roots,existingFullPaths:h.paths});if(I.length===0)return;let E=I.join(", "),A=Un({queryKeyNode:s,missingPaths:I,missingAsText:E,sourceCode:e.sourceCode});e.report({node:t,messageId:"missingDeps",data:{deps:E},suggest:A})}}))});function Un(e){let{queryKeyNode:t,missingPaths:r,missingAsText:n,sourceCode:i}=e;if(t.type!==o.AST_NODE_TYPES.ArrayExpression)return[];let s=i.getLastToken(t);if(!s)return[];let a=`[${[...t.elements.filter(u=>u!==null).map(u=>i.getText(u)),...r].join(", ")}]`;if(t.elements.length===0)return[{messageId:"fixTo",data:{result:a},fix:u=>u.replaceText(t,a)}];let l=i.getTokenBefore(s)?.value===","?" ":", ";return[{messageId:"fixTo",data:{result:a},fix:u=>u.insertTextBefore(s,`${l}${n}`)}]}function Wn(e,t){let r=new Set;for(let n=0;n<256;++n){if(r.has(e))return e;switch(r.add(e),e.type){case o.AST_NODE_TYPES.TSAsExpression:e=e.expression;break;case o.AST_NODE_TYPES.Identifier:{let i=b.getReferencedExpressionByIdentifier({context:t,node:e});if(i==null)return e;e=i;break}default:return e}}return e}var ir="stable-query-client",Vn=W.RuleCreator(G)({name:ir,meta:{type:"problem",docs:{description:"Makes sure that QueryClient is stable",recommended:"error"},messages:{unstable:["QueryClient is not stable. It should be either extracted from the component or wrapped in React.useState.","See https://tkdodo.eu/blog/react-query-fa-qs#2-the-queryclient-is-not-stable"].join(`
|
|
5
|
+
`),fixTo:"Fix to {{result}}"},hasSuggestions:!0,fixable:"code",schema:[]},defaultOptions:[],create:Z((e,t,r)=>({NewExpression:n=>{if(n.callee.type!==o.AST_NODE_TYPES.Identifier||n.callee.name!=="QueryClient"||!r.isSpecificTanstackQueryImport(n.callee,"@tanstack/react-query"))return;let i=e.sourceCode.getAncestors(n).reverse().find(l=>b.isNodeOfOneOf(l,[o.AST_NODE_TYPES.FunctionDeclaration,o.AST_NODE_TYPES.FunctionExpression,o.AST_NODE_TYPES.ArrowFunctionExpression])),s=i?.parent.type===o.AST_NODE_TYPES.VariableDeclarator&&i.parent.id.type===o.AST_NODE_TYPES.Identifier?i.parent.id:i?.id,a=i?.async===!0;!b.isValidReactComponentOrHookName(s)||a||e.report({node:n.parent.type===o.AST_NODE_TYPES.VariableDeclarator?n.parent:n,messageId:"unstable",fix:(()=>{let{parent:l}=n;if(l.type!==o.AST_NODE_TYPES.VariableDeclarator||l.id.type!==o.AST_NODE_TYPES.Identifier)return;let u=(e.sourceCode??e.getSourceCode()).getText(n),p=l.id.name;return y=>y.replaceTextRange([l.range[0],l.range[1]],`[${p}] = React.useState(() => ${u})`)})()})}}))}),rr=new Set(["UseBaseQueryResult","UseQueryResult","UseSuspenseQueryResult","DefinedUseQueryResult","UseInfiniteQueryResult","UseSuspenseInfiniteQueryResult","DefinedUseInfiniteQueryResult","QueryObserverResult","InfiniteQueryObserverResult"]);function sr(e){if(e.aliasSymbol&&rr.has(e.aliasSymbol.name))return!0;let t=e.getSymbol();return t&&rr.has(t.name)?!0:e.isUnion()&&e.types.some(sr)}var de={isObjectRestDestructuring(e){return e.type!==o.AST_NODE_TYPES.ObjectPattern?!1:e.properties.some(t=>t.type===o.AST_NODE_TYPES.RestElement)},isQueryResultCall(e,t){if(!t?.program||!t.esTreeNodeToTSNodeMap)return!1;let r=t.program.getTypeChecker(),n=t.esTreeNodeToTSNodeMap.get(e.callee);return r.getTypeAtLocation(n).getCallSignatures().some(i=>sr(i.getReturnType()))}},or="no-rest-destructuring",$n=["useQuery","useQueries","useInfiniteQuery","useSuspenseQuery","useSuspenseQueries","useSuspenseInfiniteQuery"],Jn=W.RuleCreator(G)({name:or,meta:{type:"problem",docs:{description:"Disallows rest destructuring in queries",recommended:"warn"},messages:{objectRestDestructure:"Object rest destructuring on a query will observe all changes to the query, leading to excessive re-renders."},schema:[]},defaultOptions:[],create:Z((e,t,r)=>{let n=new Set;return{CallExpression:i=>{if(i.parent.type!==o.AST_NODE_TYPES.VariableDeclarator)return;let s=i.parent.id;if(!(b.isIdentifierWithOneOfNames(i.callee,$n)&&r.isTanstackQueryImport(i.callee))&&(!(s.type===o.AST_NODE_TYPES.Identifier||de.isObjectRestDestructuring(s))||!de.isQueryResultCall(i,e.sourceCode.parserServices)))return;let a=b.isIdentifier(i.callee)?i.callee.name:null;if(a!=="useQueries"&&a!=="useSuspenseQueries"){if(de.isObjectRestDestructuring(s))return e.report({node:i.parent,messageId:"objectRestDestructure"});s.type===o.AST_NODE_TYPES.Identifier&&n.add(s.name);return}if(s.type!==o.AST_NODE_TYPES.ArrayPattern){s.type===o.AST_NODE_TYPES.Identifier&&n.add(s.name);return}s.elements.forEach(l=>{l!==null&&de.isObjectRestDestructuring(l)&&e.report({node:l,messageId:"objectRestDestructure"})})},VariableDeclarator:i=>{i.init?.type===o.AST_NODE_TYPES.Identifier&&n.has(i.init.name)&&de.isObjectRestDestructuring(i.id)&&e.report({node:i,messageId:"objectRestDestructure"})},SpreadElement:i=>{i.argument.type===o.AST_NODE_TYPES.Identifier&&n.has(i.argument.name)&&e.report({node:i,messageId:"objectRestDestructure"})}}})}),ar="no-unstable-deps",Ge=["useEffect","useCallback","useMemo"],Xn=["useMutation","useQuery","useSuspenseQuery","useQueries","useSuspenseQueries","useInfiniteQuery","useSuspenseInfiniteQuery"],Hn=W.RuleCreator(G)({name:ar,meta:{type:"problem",docs:{description:"Disallow putting the result of query hooks directly in a React hook dependency array",recommended:"error"},messages:{noUnstableDeps:"The result of {{queryHook}} is not referentially stable, so don't pass it directly into the dependencies array of {{reactHook}}. Instead, destructure the return value of {{queryHook}} and pass the destructured values into the dependency array of {{reactHook}}."},schema:[]},defaultOptions:[],create:Z((e,t,r)=>{let n=Object.create(null),i=Object.create(null),s=Object.create(null),a=[],l=[];function u(c){if(c.callee.type==="Identifier"){let d=c.callee.name;if(Ge.includes(d)||d in s)return d}else if(c.callee.type==="MemberExpression"&&c.callee.object.type==="Identifier"&&c.callee.object.name==="React"&&c.callee.property.type==="Identifier"&&Ge.includes(c.callee.property.name))return c.callee.property.name}function p(c,d){if(c.type===o.AST_NODE_TYPES.Identifier)n[c.name]=d;else if(c.type===o.AST_NODE_TYPES.ArrayPattern)for(let R of c.elements)R!==null&&(R.type===o.AST_NODE_TYPES.Identifier?n[R.name]=d:R.type===o.AST_NODE_TYPES.RestElement&&R.argument.type===o.AST_NODE_TYPES.Identifier&&(n[R.argument.name]=d))}function y(c){return/^use[A-Z0-9]/.test(c)}function S(c){if(c.arguments.length===0)return!1;let d=c.arguments[0];return!d||d.type!==o.AST_NODE_TYPES.ObjectExpression?!1:d.properties.some(R=>R.type===o.AST_NODE_TYPES.Property&&R.key.type===o.AST_NODE_TYPES.Identifier&&R.key.name==="combine")}function h(c){if(!(c.callee.type!==o.AST_NODE_TYPES.Identifier||!Xn.includes(c.callee.name)||!r.isTanstackQueryImport(c.callee))&&!((c.callee.name==="useQueries"||c.callee.name==="useSuspenseQueries")&&S(c)))return c.callee.name}function I(c){let d=h(c);if(d!==void 0)return d;if(c.callee.type===o.AST_NODE_TYPES.Identifier)return i[c.callee.name]}function E(c){if(c.type===o.AST_NODE_TYPES.CallExpression)return h(c);if(c.type!==o.AST_NODE_TYPES.BlockStatement)return;let d=c.body.filter(Ce=>Ce.type===o.AST_NODE_TYPES.ReturnStatement);if(d.length!==1)return;let R=d[0]?.argument;if(R?.type===o.AST_NODE_TYPES.CallExpression)return h(R)}function A(c,d){d.elements.forEach(R=>{if(R!==null&&R.type===o.AST_NODE_TYPES.Identifier&&n[R.name]!==void 0){let Ce=n[R.name];e.report({node:R,messageId:"noUnstableDeps",data:{queryHook:Ce,reactHook:c}})}})}return{ImportDeclaration(c){c.specifiers.length>0&&c.importKind==="value"&&c.source.value==="react"&&c.specifiers.forEach(d=>{d.type===o.AST_NODE_TYPES.ImportSpecifier&&d.imported.type===o.AST_NODE_TYPES.Identifier&&Ge.includes(d.imported.name)&&(s[d.local.name]=d.imported.name)})},FunctionDeclaration(c){if(c.id===null||!y(c.id.name))return;let d=E(c.body);d!==void 0&&(i[c.id.name]=d)},VariableDeclarator(c){if(c.id.type===o.AST_NODE_TYPES.Identifier&&y(c.id.name)&&c.init!==null&&(c.init.type===o.AST_NODE_TYPES.ArrowFunctionExpression||c.init.type===o.AST_NODE_TYPES.FunctionExpression)){let d=E(c.init.body);d!==void 0&&(i[c.id.name]=d)}c.init!==null&&c.init.type===o.AST_NODE_TYPES.CallExpression&&a.push(c)},CallExpression:c=>{let d=u(c);d!==void 0&&c.arguments.length>1&&c.arguments[1]?.type===o.AST_NODE_TYPES.ArrayExpression&&l.push({reactHook:d,depsArray:c.arguments[1]})},"Program:exit"(){a.forEach(c=>{if(c.init?.type!==o.AST_NODE_TYPES.CallExpression)return;let d=I(c.init);d!==void 0&&p(c.id,d)}),l.forEach(({reactHook:c,depsArray:d})=>{A(c,d)})}}})});function zn(e,t,r){let n=(p,y)=>{for(let S=0;S<y.length;S++)if(y[S]?.includes(p))return S;return null},i=t.reduce((p,[y,S])=>[...p,y,S],[]),s=e.filter(p=>n(p[r],i)!==null),a=!1,l=s.sort((p,y)=>{let S=p[r],h=y[r],I=n(S,i),E=n(h,i);return I!==null&&E!==null&&I!==E?I-E:0}).values(),u=e.map(p=>{if(n(p[r],i)!==null){let y=l.next().value;return y[r]!==p[r]&&(a=!0),y}return p});return a?u:null}var _n=W.RuleCreator(G);function ur(e,t,r){let n=new Set(t);function i(s){return n.has(s)}return _n({...e,create:Z(s=>({CallExpression(a){if(a.callee.type!==o.AST_NODE_TYPES.Identifier)return;let l=a.callee.name;if(!i(l))return;let u=a.arguments[0];if(u===void 0||u.type!=="ObjectExpression")return;let p=u.properties;if(p.length<2)return;let y=zn(p.flatMap((S,h)=>S.type===o.AST_NODE_TYPES.Property&&S.key.type===o.AST_NODE_TYPES.Identifier?{name:S.key.name,property:S}:{name:`_property_${h}`,property:S}),r,"name");y!==null&&s.report({node:u,data:{function:a.callee.name},messageId:"invalidOrder",fix(S){let h=s.sourceCode,I=y.reduce((E,A,c)=>{let d="";return c<p.length-1&&(d=h.getText().slice(p[c].range[1],p[c+1].range[0])),E+h.getText(A.property)+d},"");return S.replaceTextRange([p[0].range[0],p.at(-1).range[1]],I)}})}}))})}var Gn=["infiniteQueryOptions","useInfiniteQuery","useSuspenseInfiniteQuery"],Zn=[[["queryFn"],["getPreviousPageParam","getNextPageParam"]]],lr="infinite-query-property-order",Yn=ur({name:lr,meta:{type:"problem",docs:{description:"Ensure correct order of inference sensitive properties for infinite queries",recommended:"error"},messages:{invalidOrder:"Invalid order of properties for `{{function}}`."},schema:[],hasSuggestions:!0,fixable:"code"},defaultOptions:[]},Gn,Zn),cr="no-void-query-fn",ei=W.RuleCreator(G)({name:cr,meta:{type:"problem",docs:{description:"Ensures queryFn returns a non-undefined value",recommended:"error"},messages:{noVoidReturn:"queryFn must return a non-undefined value"},schema:[]},defaultOptions:[],create:Z(e=>({Property(t){if(!b.isObjectExpression(t.parent)||!b.isIdentifierWithName(t.key,"queryFn"))return;let r=e.sourceCode.parserServices;if(!r||!r.esTreeNodeToTSNodeMap||!r.program)return;let n=r.program.getTypeChecker(),i=r.esTreeNodeToTSNodeMap.get(t.value),s=n.getTypeAtLocation(i);if(s.getCallSignatures().length>0){let a=s.getCallSignatures()[0]?.getReturnType();if(!a)return;pr(n,a)&&e.report({node:t.value,messageId:"noVoidReturn"})}}}))});function pr(e,t){let r=e.getAwaitedType(t);if(!r)return!1;if(r.isUnion())return r.types.some(i=>pr(e,i));let n=e.typeToString(r);return n==="void"||n==="undefined"}var ti=["useMutation"],ri=[[["onMutate"],["onError","onSettled"]]],fr="mutation-property-order",ni=ur({name:fr,meta:{type:"problem",docs:{description:"Ensure correct order of inference-sensitive properties in useMutation()",recommended:"error"},messages:{invalidOrder:"Invalid order of properties for `{{function}}`."},schema:[],hasSuggestions:!0,fixable:"code"},defaultOptions:[]},ti,ri),yr="prefer-query-options",ii=["useQuery","useInfiniteQuery","useSuspenseQuery","useSuspenseInfiniteQuery","usePrefetchQuery","usePrefetchInfiniteQuery"],si=["useQueries","useSuspenseQueries"],oi=["useIsFetching"],ai=["fetchQuery","prefetchQuery","fetchInfiniteQuery","prefetchInfiniteQuery","ensureQueryData","ensureInfiniteQueryData"],ui=["getQueryData","setQueryData","getQueryState","setQueryDefaults","getQueryDefaults"],li=["invalidateQueries","cancelQueries","refetchQueries","removeQueries","resetQueries","isFetching","getQueriesData","setQueriesData"],ci=["queryOptions","infiniteQueryOptions"],pi=W.RuleCreator(G)({name:yr,meta:{type:"problem",docs:{description:"Prefer using queryOptions() to co-locate queryKey and queryFn",recommended:"strict"},messages:{preferQueryOptions:"Prefer using queryOptions() or infiniteQueryOptions() to co-locate queryKey and queryFn.",preferQueryOptionsQueryKey:"Prefer referencing a queryKey from a queryOptions() result instead of typing it manually."},schema:[]},defaultOptions:[],create:Z((e,t,r)=>{function n(s){b.isObjectExpression(s)&&fi(s)&&e.report({node:s,messageId:"preferQueryOptions"})}function i(s){b.isObjectExpression(s)&&yi(s)&&e.report({node:s,messageId:"preferQueryOptionsQueryKey"})}return{CallExpression:s=>{if(b.isIdentifier(s.callee)){let u=Ze(e,r,s.callee);if(u===null||ci.includes(u))return;let p=s.arguments[0];if(p===void 0)return;if(ii.includes(u)){n(p);return}if(si.includes(u)&&b.isObjectExpression(p)){let y=b.findPropertyWithIdentifierKey(p.properties,"queries")?.value;y!==void 0&&di(y).forEach(S=>{n(S)});return}oi.includes(u)&&i(p);return}if(s.callee.type!==o.AST_NODE_TYPES.MemberExpression||!b.isIdentifier(s.callee.property)||!mi(s.callee.object,e,r))return;let a=s.callee.property.name,l=s.arguments[0];if(l!==void 0){if(ai.includes(a)){n(l);return}if(ui.includes(a)&&dr(l)){e.report({node:l,messageId:"preferQueryOptionsQueryKey"});return}li.includes(a)&&i(l)}}}})});function fi(e){return b.findPropertyWithIdentifierKey(e.properties,"queryKey")!==void 0||b.findPropertyWithIdentifierKey(e.properties,"queryFn")!==void 0}function yi(e){let t=b.findPropertyWithIdentifierKey(e.properties,"queryKey")?.value;return t!==void 0&&dr(t)}function dr(e){return mr(e).type===o.AST_NODE_TYPES.ArrayExpression}function X(e){return b.isObjectExpression(e)?[e]:e.type===o.AST_NODE_TYPES.ArrowFunctionExpression||e.type===o.AST_NODE_TYPES.FunctionExpression?X(e.body):e.type===o.AST_NODE_TYPES.BlockStatement?e.body.flatMap(t=>t.type===o.AST_NODE_TYPES.ReturnStatement&&t.argument!==null?X(t.argument):[]):e.type===o.AST_NODE_TYPES.ConditionalExpression?[...X(e.consequent),...X(e.alternate)]:e.type===o.AST_NODE_TYPES.LogicalExpression?[...X(e.left),...X(e.right)]:e.type===o.AST_NODE_TYPES.SequenceExpression?e.expressions.flatMap(t=>X(t)):[]}function di(e){if(e.type===o.AST_NODE_TYPES.ArrayExpression)return e.elements.flatMap(t=>t!==null&&b.isObjectExpression(t)?[t]:[]);if(e.type===o.AST_NODE_TYPES.CallExpression&&e.callee.type===o.AST_NODE_TYPES.MemberExpression&&b.isIdentifierWithName(e.callee.property,"map")){let t=e.arguments[0];if(t?.type===o.AST_NODE_TYPES.ArrowFunctionExpression||t?.type===o.AST_NODE_TYPES.FunctionExpression)return X(t)}return[]}function mi(e,t,r){let n=gi(e,t);return n.type===o.AST_NODE_TYPES.CallExpression&&b.isIdentifier(n.callee)?Ze(t,r,n.callee)==="useQueryClient":n.type===o.AST_NODE_TYPES.NewExpression&&b.isIdentifier(n.callee)?Ze(t,r,n.callee)==="QueryClient":!1}function Ze(e,t,r){if(!t.isTanstackQueryImport(r))return null;let n=e.sourceCode.getScope(r).references.find(i=>i.identifier===r)?.resolved?.defs[0]?.node;return n?.type!==o.AST_NODE_TYPES.ImportSpecifier||n.imported.type!==o.AST_NODE_TYPES.Identifier?null:n.imported.name}function gi(e,t){let r=new Set;for(;!r.has(e);){if(r.add(e),e.type===o.AST_NODE_TYPES.ChainExpression){e=e.expression;continue}if(e=mr(e),e.type!==o.AST_NODE_TYPES.Identifier)return e;let n=b.getReferencedExpressionByIdentifier({context:t,node:e});if(n===null)return e;e=n}return e}function mr(e){for(;e.type===o.AST_NODE_TYPES.TSAsExpression||e.type===o.AST_NODE_TYPES.TSSatisfiesExpression||e.type===o.AST_NODE_TYPES.TSTypeAssertion;)e=e.expression;return e}var gr={[nr]:Ln,[ir]:Vn,[or]:Jn,[ar]:Hn,[lr]:Yn,[cr]:ei,[fr]:ni,[yr]:pi};var Ye={"@tanstack/query/exhaustive-deps":"error","@tanstack/query/no-rest-destructuring":"warn","@tanstack/query/stable-query-client":"error","@tanstack/query/no-unstable-deps":"error","@tanstack/query/infinite-query-property-order":"error","@tanstack/query/no-void-query-fn":"error","@tanstack/query/mutation-property-order":"error"},hr={...Ye,"@tanstack/query/prefer-query-options":"error"},Y={meta:{name:"@tanstack/eslint-plugin-query"},configs:{recommended:{plugins:["@tanstack/query"],rules:Ye},recommendedStrict:{plugins:["@tanstack/query"],rules:hr},"flat/recommended":[{name:"tanstack/query/flat/recommended",plugins:{"@tanstack/query":{}},rules:Ye}],"flat/recommended-strict":[{name:"tanstack/query/flat/recommended-strict",plugins:{"@tanstack/query":{}},rules:hr}]},rules:gr};Y.configs["flat/recommended"][0].plugins["@tanstack/query"]=Y;Y.configs["flat/recommended-strict"][0].plugins["@tanstack/query"]=Y;var hi=Object.fromEntries(["exhaustive-deps","prefer-query-options"].map(e=>{if(!Y.rules[e])throw new Error("Missing upstream rule: "+e);return[e,Y.rules[e]]})),ts={meta:{name:"@tanstack/eslint-plugin-query",version:"5.106.1"},rules:hi};export{ts as default};
|