@ls-stack/extended-lint 0.71.0 → 0.72.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.
@@ -1,7 +1,7 @@
1
- "use strict";var oi=Object.create;var lt=Object.defineProperty;var ai=Object.getOwnPropertyDescriptor;var li=Object.getOwnPropertyNames;var pi=Object.getPrototypeOf,ci=Object.prototype.hasOwnProperty;var ui=(e,t)=>{for(var r in t)lt(e,r,{get:t[r],enumerable:!0})},$n=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of li(t))!ci.call(e,s)&&s!==r&&lt(e,s,{get:()=>t[s],enumerable:!(n=ai(t,s))||n.enumerable});return e};var xe=(e,t,r)=>(r=e!=null?oi(pi(e)):{},$n(t||!e||!e.__esModule?lt(r,"default",{value:e,enumerable:!0}):r,e)),fi=e=>$n(lt({},"__esModule",{value:!0}),e);var Pa={};ui(Pa,{extendedLintPlugin:()=>Ra});module.exports=fi(Pa);var ce=require("@typescript-eslint/utils"),v=require("zod/v4");var _n=require("@typescript-eslint/utils"),Un=xe(require("zod/v4"));function _(e){let r=_n.ESLintUtils.RuleCreator(n=>`https://github.com/lucasols/extended-lint#${n}`)(e);return{name:e.name,rule:r}}function $(e){return Un.toJSONSchema(e)}var mi=v.z.object({disallow:v.z.array(v.z.object({selector:v.z.string(),message:v.z.string(),replace:v.z.optional(v.z.union([v.z.string(),v.z.object({regex:v.z.string(),with:v.z.string()})])),replaceType:v.z.optional(v.z.enum(["suggestion","autofix"]))})).optional(),disallowFnCalls:v.z.optional(v.z.array(v.z.object({fn:v.z.string(),withArgs:v.z.optional(v.z.array(v.z.object({atIndex:v.z.number(),value:v.z.union([v.z.string(),v.z.number(),v.z.boolean()])}))),message:v.z.string(),replaceWith:v.z.optional(v.z.string()),ignoreRegex:v.z.optional(v.z.string())}))),__dev_simulateFileName:v.z.optional(v.z.string()),mustMatchSyntax:v.z.optional(v.z.array(v.z.object({includeRegex:v.z.string(),mustCallFn:v.z.optional(v.z.array(v.z.object({anyCall:v.z.array(v.z.object({fn:v.z.string(),withArgs:v.z.array(v.z.object({atIndex:v.z.number(),literal:v.z.union([v.z.string(),v.z.number(),v.z.boolean()])}))})),message:v.z.optional(v.z.string())}))),mustMatchSelector:v.z.optional(v.z.array(v.z.object({selector:v.z.string(),message:v.z.string()}))),mustHaveExport:v.z.optional(v.z.array(v.z.object({name:v.z.string(),type:v.z.enum(["function","variable","any"]).default("any"),message:v.z.string()})))})))}),wt=_({name:"advanced-no-restricted-syntax",meta:{type:"suggestion",docs:{description:"Disallow specific syntax patterns"},schema:[$(mi)],messages:{default:"{{message}}"},fixable:"code",hasSuggestions:!0},defaultOptions:[{disallow:[]}],create(e,[t]){let r={},{mustMatchSyntax:n,__dev_simulateFileName:s,disallow:o,disallowFnCalls:i}=t,p=s??e.filename,a=[],c=new Map,g=new Set,S=new Map,l=new Set,E=new Map;function f(u){for(let d of u.specifiers)d.type===ce.AST_NODE_TYPES.ImportSpecifier&&d.imported.type===ce.AST_NODE_TYPES.Identifier&&d.imported.name!==d.local.name&&E.set(d.local.name,d.imported.name)}function h(u){if(u.declaration){if(u.declaration.type===ce.AST_NODE_TYPES.FunctionDeclaration&&u.declaration.id){let d=u.declaration.id.name;for(let A of Array.from(l)){let[I,P]=A.split(":");I===d&&(P==="function"||P==="any")&&l.delete(A)}}else if(u.declaration.type===ce.AST_NODE_TYPES.VariableDeclaration){for(let d of u.declaration.declarations)if(d.id.type===ce.AST_NODE_TYPES.Identifier){let A=d.id.name;for(let I of Array.from(l)){let[P,k]=I.split(":");P===A&&(k==="variable"||k==="any")&&l.delete(I)}}}}for(let d of u.specifiers)if(d.exported.type===ce.AST_NODE_TYPES.Identifier){let A=d.exported.name;for(let I of Array.from(l)){let[P,k]=I.split(":");P===A&&k==="any"&&l.delete(I)}}}function T(u){u.id.type===ce.AST_NODE_TYPES.Identifier&&u.init?.type===ce.AST_NODE_TYPES.Identifier&&E.set(u.id.name,u.init.name)}function m(u){return E.get(u)??u}function b(u,d){return m(u)===d||u===d}for(let{includeRegex:u,mustCallFn:d,mustMatchSelector:A,mustHaveExport:I}of n??[]){let k=function(H){let K=H;for(let{name:ne,value:oe}of P??[])K=K.replaceAll(ne,oe);return K};var x=k;let P=yi(p,new RegExp(u));if(P){for(let{anyCall:H,message:K}of d??[]){let ne=`Expected file to call the function: ${H.map(({fn:oe})=>oe).join(" or ")}`;g.add(ne),a.push(oe=>{let{callee:Z}=oe;if(Z.type===ce.AST_NODE_TYPES.Identifier){for(let{fn:de,withArgs:Ae}of H)if(Z.name===de){g.delete(ne);for(let ue of Ae){let Ie=oe.arguments[ue.atIndex],Te=typeof ue.literal=="string"?k(ue.literal):ue.literal;if(!Ie){e.report({node:oe,messageId:"default",data:{message:`Missing argument with value "${Te}" at index ${ue.atIndex}${K?`: ${k(K)}`:""}`}});continue}if(Ie.type!==ce.AST_NODE_TYPES.Literal){e.report({node:Ie,messageId:"default",data:{message:`Argument at position ${ue.atIndex} should the literal "${Te}"${K?`: ${k(K)}`:""}`}});continue}Ie.value!==Te&&e.report({node:Ie,messageId:"default",data:{message:`Argument should have the value "${Te}"${K?`: ${k(K)}`:""}`},fix:ze=>ze.replaceText(Ie,typeof Te=="string"?`'${Te}'`:String(Te))})}break}}})}for(let{selector:H,message:K}of A??[])S.set(H,k(K)),c.set(k(H),()=>{S.delete(H)});for(let{name:H,type:K,message:ne}of I??[]){let oe=k(H),Z=k(ne);l.add(`${oe}:${K}:${Z}`)}}}for(let{fn:u,withArgs:d,message:A,replaceWith:I,ignoreRegex:P}of i??[])P&&new RegExp(P).test(p)||a.push(k=>{let{callee:H}=k;if(H.type!==ce.AST_NODE_TYPES.Identifier||!b(H.name,u))return;if(d)for(let ne of d){let oe=k.arguments[ne.atIndex];if(!oe){e.report({node:k,messageId:"default",data:{message:`Missing argument with value "${ne.value}" at index ${ne.atIndex}: ${A}`}});return}if(oe.type!==ce.AST_NODE_TYPES.Literal||oe.value!==ne.value)return}let K=ne=>I?ne.replaceText(k,I):null;e.report({node:k,messageId:"default",data:{message:A},suggest:I?[{messageId:"default",data:{message:`Replace with "${I}"`},fix:K}]:void 0})});function C(u,d){let A=r[u];A?r[u]=I=>{A(I),d(I)}:r[u]=d}for(let{selector:u,message:d,replace:A,replaceType:I="suggestion"}of o??[]){if(u==="CallExpression"){a.push(P=>{y(A,P,d,I)});continue}r[u]=P=>{y(A,P,d,I)}}if(c.size>0)for(let[u,d]of c)C(u,d);return a.length>0&&(r.CallExpression=u=>{if(u.type===ce.AST_NODE_TYPES.CallExpression)for(let d of a)d(u)}),r.ImportDeclaration=u=>{u.type===ce.AST_NODE_TYPES.ImportDeclaration&&f(u)},r.ExportNamedDeclaration=u=>{u.type===ce.AST_NODE_TYPES.ExportNamedDeclaration&&h(u)},r.VariableDeclarator=u=>{u.type===ce.AST_NODE_TYPES.VariableDeclarator&&T(u)},r["Program:exit"]=u=>{for(let d of g)e.report({node:u,messageId:"default",data:{message:d}});for(let[,d]of S)e.report({node:u,messageId:"default",data:{message:d}});for(let d of l){let[A,I,P]=d.split(":");e.report({node:u,messageId:"default",data:{message:`Missing required export "${A}" of type ${I}: ${P}`}})}},r;function y(u,d,A,I){let P=k=>{if(!u)return null;if(typeof u=="string")return k.replaceText(d,u);{let H=new RegExp(u.regex),K=e.sourceCode.getText(d);return k.replaceText(d,K.replace(H,u.with))}};e.report({node:d,messageId:"default",data:{message:A},fix:u&&I==="autofix"?P:void 0,suggest:u&&I==="suggestion"?[{messageId:"default",data:{message:`Replace with "${typeof u=="string"?u:u.with}"`},fix:P}]:void 0})}}});function yi(e,t){let r=[],n=t.exec(e);if(!n)return null;let[s,...o]=n;r.push({name:"$0_lowercase",value:s.toLowerCase()}),r.push({name:"$0_capitalize",value:zn(s)}),r.push({name:"$0_uncapitalize",value:Wn(s)}),r.push({name:"$0",value:s});for(let i=0;i<o.length;i++){let p=`$${i+1}`,a=o[i];a!==void 0&&(r.push({name:`${p}_lowercase`,value:a.toLowerCase()}),r.push({name:`${p}_capitalize`,value:zn(a)}),r.push({name:`${p}_uncapitalize`,value:Wn(a)}),r.push({name:p,value:a}))}return r}function zn(e){return e.charAt(0).toUpperCase()+e.slice(1)}function Wn(e){return e.charAt(0).toLowerCase()+e.slice(1)}var X=require("@typescript-eslint/utils"),Me=require("zod/v4");var di=X.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),Vn="collapse-simple-objs-in-one-line",gi=Me.z.object({maxLineLength:Me.z.number().optional(),maxProperties:Me.z.number().optional(),nestedObjMaxLineLength:Me.z.number().optional(),nestedObjMaxProperties:Me.z.number().optional(),ignoreTypesWithSuffix:Me.z.array(Me.z.string()).optional()}),Si=di({name:Vn,meta:{type:"suggestion",fixable:"code",docs:{description:"Format simple objects and types in one line"},messages:{singleLineProp:"Object/type should be written in a single line"},schema:[$(gi)]},defaultOptions:[{}],create(e,[t]){let r=e.sourceCode,n=t.ignoreTypesWithSuffix??[],s=t.maxProperties??2,o=t.nestedObjMaxLineLength??t.maxLineLength,i=t.nestedObjMaxProperties??3;function p(c){if(c.type===X.AST_NODE_TYPES.ObjectExpression){let g=c.parent.type===X.AST_NODE_TYPES.Property,S=g?i:s,l=c.properties.length;if(l>S)return!1;if(l===1){let f=c.properties[0];return!f||f.type===X.AST_NODE_TYPES.Property&&f.value.type===X.AST_NODE_TYPES.ObjectExpression||f.type===X.AST_NODE_TYPES.Property&&f.value.type===X.AST_NODE_TYPES.ArrayExpression&&!f.value.elements.every(T=>T&&Rt(T))?!1:{text:r.getText(f),isNested:g,propsSize:l}}let E=[];for(let f of c.properties){if(f.type===X.AST_NODE_TYPES.Property&&!Rt(f.value))return!1;E.push(r.getText(f))}return{text:E.join(", "),isNested:g,propsSize:l}}else{let g=c.parent.parent?.type===X.AST_NODE_TYPES.TSPropertySignature,S=g?i:s,l=c.members.length;if(l>S)return!1;if(n.length>0&&c.parent.type===X.AST_NODE_TYPES.TSTypeAliasDeclaration){let f=c.parent.id.name;if(n.some(h=>f.endsWith(h)))return!1}if(l===1){let f=c.members[0];return!f||f.type===X.AST_NODE_TYPES.TSPropertySignature&&f.typeAnnotation?.typeAnnotation.type===X.AST_NODE_TYPES.TSTypeLiteral?!1:{text:r.getText(f),isNested:g,propsSize:1}}if(c.parent.type===X.AST_NODE_TYPES.TSIntersectionType||c.parent.type===X.AST_NODE_TYPES.TSUnionType&&c.parent.types[0]!==c)return!1;let E=[];for(let f of c.members){if(f.type!==X.AST_NODE_TYPES.TSPropertySignature)return!1;let h=f.typeAnnotation?.typeAnnotation;if(!h||h.type===X.AST_NODE_TYPES.TSTypeLiteral||!Jn(h))return!1;if(h.type===X.AST_NODE_TYPES.TSTypeReference&&h.typeArguments){if(h.typeArguments.params.length>1)return!1;let m=h.typeArguments.params[0];if(!m||!Jn(m))return!1}let T=r.getText(f).trim();(T.endsWith(";")||T.endsWith(","))&&(T=T.slice(0,-1)),E.push(T)}return{text:E.join("; "),isNested:g,propsSize:l}}}function a(c){if(c.loc.start.line===c.loc.end.line)return;if(c.parent.type!==X.AST_NODE_TYPES.JSXExpressionContainer){let h=0,T=!1,m=r.getTokenAfter(c,{filter:C=>C.type!==X.AST_TOKEN_TYPES.Punctuator||T?!0:C.value===","?(h++,!1):C.value===";"?(h++,T=!0,!1):C.value===")"||C.value==="}"?(h++,!1):!0});if(h>4)return;let b=m?.type===X.AST_TOKEN_TYPES.Template&&m.value.startsWith(`}
2
- `);if(m?.loc.start.line===c.loc.end.line&&!b)return}let g=p(c);if(!g)return;let S=g.text;if(S.includes(`
3
- `)||r.getCommentsInside(c).length>0)return;S.endsWith(";")&&(S=S.slice(0,-1));let l=`{ ${S} }`,E=hi(r,c),f=g.isNested&&g.propsSize>2?o:t.maxLineLength;f&&l.length+E.length+Ti(c,r)>f||e.report({node:c,messageId:"singleLineProp",fix:h=>h.replaceText(c,l)})}return{TSTypeLiteral:a,ObjectExpression:a}}});function Jn(e){return e.type===X.AST_NODE_TYPES.TSLiteralType||e.type===X.AST_NODE_TYPES.TSTypeReference||e.type===X.AST_NODE_TYPES.TSNumberKeyword||e.type===X.AST_NODE_TYPES.TSStringKeyword||e.type===X.AST_NODE_TYPES.TSBooleanKeyword||e.type===X.AST_NODE_TYPES.TSNullKeyword||e.type===X.AST_NODE_TYPES.TSUndefinedKeyword}function Rt(e,t){return!!(e.type===X.AST_NODE_TYPES.Literal||e.type===X.AST_NODE_TYPES.Identifier||e.type===X.AST_NODE_TYPES.TemplateLiteral||e.type===X.AST_NODE_TYPES.TaggedTemplateExpression||!t&&e.type===X.AST_NODE_TYPES.ArrayExpression&&e.elements.every(r=>r&&Rt(r,!0)))}function Ti(e,t){let r=t.getLastToken(e);if(!r)return 0;let n=t.text.indexOf(`
4
- `,r.range[1]);return(n!==-1?n:t.text.length)-r.range[1]}function hi(e,t){return e.text.slice(t.range[0]-t.loc.start.column,t.range[0])}var Pt={name:Vn,rule:Si};var Ei=/eslint +react-compiler\/react-compiler: +\["error/,Hn={meta:{type:"suggestion",docs:{description:"verifies the list of dependencies for Hooks like useEffect and similar",recommended:!0,url:"https://github.com/facebook/react/issues/14920"},fixable:"code",hasSuggestions:!0,schema:[{type:"object",additionalProperties:!1,ignoreIfReactCompilerIsEnabled:!1,enableDangerousAutofixThisMayCauseInfiniteLoops:!1,properties:{additionalHooks:{type:"string"},ignoreIfReactCompilerIsEnabled:{type:"boolean"},enableDangerousAutofixThisMayCauseInfiniteLoops:{type:"boolean"}}}]},create(e){let t=!1,r=typeof e.getSource=="function"?m=>r(m):m=>e.sourceCode.getText(m),n=typeof e.getScope=="function"?()=>n():m=>e.sourceCode.getScope(m),s=e.options&&e.options[0]&&e.options[0].additionalHooks?new RegExp(e.options[0].additionalHooks):void 0,o=e.options&&e.options[0]&&e.options[0].enableDangerousAutofixThisMayCauseInfiniteLoops||!1,i={additionalHooks:s,enableDangerousAutofixThisMayCauseInfiniteLoops:o};function p(m){o&&Array.isArray(m.suggest)&&m.suggest.length>0&&(m.fix=m.suggest[0].fix),e.report(m)}let a=e.getSourceCode().scopeManager,c=new WeakMap,g=new WeakSet,S=new WeakMap,l=new WeakMap,E=new WeakSet;function f(m,b){return function(C){if(b.has(C))return b.get(C);let y=m(C);return b.set(C,y),y}}function h(m,b,C,y,x){x&&m.async&&p({node:m,message:`Effect callbacks are synchronous to prevent race conditions. Put the async function inside:
1
+ "use strict";var ai=Object.create;var ft=Object.defineProperty;var li=Object.getOwnPropertyDescriptor;var pi=Object.getOwnPropertyNames;var ci=Object.getPrototypeOf,ui=Object.prototype.hasOwnProperty;var fi=(e,t)=>{for(var r in t)ft(e,r,{get:t[r],enumerable:!0})},zn=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of pi(t))!ui.call(e,o)&&o!==r&&ft(e,o,{get:()=>t[o],enumerable:!(n=li(t,o))||n.enumerable});return e};var ke=(e,t,r)=>(r=e!=null?ai(ci(e)):{},zn(t||!e||!e.__esModule?ft(r,"default",{value:e,enumerable:!0}):r,e)),mi=e=>zn(ft({},"__esModule",{value:!0}),e);var va={};fi(va,{extendedLintPlugin:()=>Pa});module.exports=mi(va);var ge=require("@typescript-eslint/utils"),O=require("zod/v4");var Wn=require("@typescript-eslint/utils"),Jn=ke(require("zod/v4"));function H(e){let r=Wn.ESLintUtils.RuleCreator(n=>`https://github.com/lucasols/extended-lint#${n}`)(e);return{name:e.name,rule:r}}function V(e){return Jn.toJSONSchema(e)}var di=O.z.object({disallow:O.z.array(O.z.object({selector:O.z.string(),message:O.z.string(),replace:O.z.optional(O.z.union([O.z.string(),O.z.object({regex:O.z.string(),with:O.z.string()})])),replaceType:O.z.optional(O.z.enum(["suggestion","autofix"]))})).optional(),disallowFnCalls:O.z.optional(O.z.array(O.z.object({fn:O.z.string(),withArgs:O.z.optional(O.z.array(O.z.object({atIndex:O.z.number(),value:O.z.union([O.z.string(),O.z.number(),O.z.boolean()])}))),message:O.z.string(),replaceWith:O.z.optional(O.z.string()),ignoreRegex:O.z.optional(O.z.string())}))),__dev_simulateFileName:O.z.optional(O.z.string()),mustMatchSyntax:O.z.optional(O.z.array(O.z.object({includeRegex:O.z.string(),mustCallFn:O.z.optional(O.z.array(O.z.object({anyCall:O.z.array(O.z.object({fn:O.z.string(),withArgs:O.z.array(O.z.object({atIndex:O.z.number(),literal:O.z.union([O.z.string(),O.z.number(),O.z.boolean()])}))})),message:O.z.optional(O.z.string())}))),mustMatchSelector:O.z.optional(O.z.array(O.z.object({selector:O.z.string(),message:O.z.string()}))),mustHaveExport:O.z.optional(O.z.array(O.z.object({name:O.z.string(),type:O.z.enum(["function","variable","any"]).default("any"),message:O.z.string()})))})))}),kt=H({name:"advanced-no-restricted-syntax",meta:{type:"suggestion",docs:{description:"Disallow specific syntax patterns"},schema:[V(di)],messages:{default:"{{message}}"},fixable:"code",hasSuggestions:!0},defaultOptions:[{disallow:[]}],create(e,[t]){let r={},{mustMatchSyntax:n,__dev_simulateFileName:o,disallow:s,disallowFnCalls:i}=t,p=o??e.filename,a=[],c=new Map,d=new Set,y=new Map,l=new Set,h=new Map;function u(T){for(let A of T.specifiers)A.type===ge.AST_NODE_TYPES.ImportSpecifier&&A.imported.type===ge.AST_NODE_TYPES.Identifier&&A.imported.name!==A.local.name&&h.set(A.local.name,A.imported.name)}function S(T){if(T.declaration){if(T.declaration.type===ge.AST_NODE_TYPES.FunctionDeclaration&&T.declaration.id){let A=T.declaration.id.name;for(let R of Array.from(l)){let[P,L]=R.split(":");P===A&&(L==="function"||L==="any")&&l.delete(R)}}else if(T.declaration.type===ge.AST_NODE_TYPES.VariableDeclaration){for(let A of T.declaration.declarations)if(A.id.type===ge.AST_NODE_TYPES.Identifier){let R=A.id.name;for(let P of Array.from(l)){let[L,C]=P.split(":");L===R&&(C==="variable"||C==="any")&&l.delete(P)}}}}for(let A of T.specifiers)if(A.exported.type===ge.AST_NODE_TYPES.Identifier){let R=A.exported.name;for(let P of Array.from(l)){let[L,C]=P.split(":");L===R&&C==="any"&&l.delete(P)}}}function g(T){T.id.type===ge.AST_NODE_TYPES.Identifier&&T.init?.type===ge.AST_NODE_TYPES.Identifier&&h.set(T.id.name,T.init.name)}function f(T){return h.get(T)??T}function E(T,A){return f(T)===A||T===A}for(let{includeRegex:T,mustCallFn:A,mustMatchSelector:R,mustHaveExport:P}of n??[]){let C=function(I){let F=I;for(let{name:N,value:te}of L??[])F=F.replaceAll(N,te);return F};var b=C;let L=yi(p,new RegExp(T));if(L){for(let{anyCall:I,message:F}of A??[]){let N=`Expected file to call the function: ${I.map(({fn:te})=>te).join(" or ")}`;d.add(N),a.push(te=>{let{callee:z}=te;if(z.type===ge.AST_NODE_TYPES.Identifier){for(let{fn:ie,withArgs:M}of I)if(z.name===ie){d.delete(N);for(let W of M){let X=te.arguments[W.atIndex],ne=typeof W.literal=="string"?C(W.literal):W.literal;if(!X){e.report({node:te,messageId:"default",data:{message:`Missing argument with value "${ne}" at index ${W.atIndex}${F?`: ${C(F)}`:""}`}});continue}if(X.type!==ge.AST_NODE_TYPES.Literal){e.report({node:X,messageId:"default",data:{message:`Argument at position ${W.atIndex} should the literal "${ne}"${F?`: ${C(F)}`:""}`}});continue}X.value!==ne&&e.report({node:X,messageId:"default",data:{message:`Argument should have the value "${ne}"${F?`: ${C(F)}`:""}`},fix:le=>le.replaceText(X,typeof ne=="string"?`'${ne}'`:String(ne))})}break}}})}for(let{selector:I,message:F}of R??[])y.set(I,C(F)),c.set(C(I),()=>{y.delete(I)});for(let{name:I,type:F,message:N}of P??[]){let te=C(I),z=C(N);l.add(`${te}:${F}:${z}`)}}}for(let{fn:T,withArgs:A,message:R,replaceWith:P,ignoreRegex:L}of i??[])L&&new RegExp(L).test(p)||a.push(C=>{let{callee:I}=C;if(I.type!==ge.AST_NODE_TYPES.Identifier||!E(I.name,T))return;if(A)for(let N of A){let te=C.arguments[N.atIndex];if(!te){e.report({node:C,messageId:"default",data:{message:`Missing argument with value "${N.value}" at index ${N.atIndex}: ${R}`}});return}if(te.type!==ge.AST_NODE_TYPES.Literal||te.value!==N.value)return}let F=N=>P?N.replaceText(C,P):null;e.report({node:C,messageId:"default",data:{message:R},suggest:P?[{messageId:"default",data:{message:`Replace with "${P}"`},fix:F}]:void 0})});function x(T,A){let R=r[T];R?r[T]=P=>{R(P),A(P)}:r[T]=A}for(let{selector:T,message:A,replace:R,replaceType:P="suggestion"}of s??[]){if(T==="CallExpression"){a.push(L=>{m(R,L,A,P)});continue}r[T]=L=>{m(R,L,A,P)}}if(c.size>0)for(let[T,A]of c)x(T,A);return a.length>0&&(r.CallExpression=T=>{if(T.type===ge.AST_NODE_TYPES.CallExpression)for(let A of a)A(T)}),r.ImportDeclaration=T=>{T.type===ge.AST_NODE_TYPES.ImportDeclaration&&u(T)},r.ExportNamedDeclaration=T=>{T.type===ge.AST_NODE_TYPES.ExportNamedDeclaration&&S(T)},r.VariableDeclarator=T=>{T.type===ge.AST_NODE_TYPES.VariableDeclarator&&g(T)},r["Program:exit"]=T=>{for(let A of d)e.report({node:T,messageId:"default",data:{message:A}});for(let[,A]of y)e.report({node:T,messageId:"default",data:{message:A}});for(let A of l){let[R,P,L]=A.split(":");e.report({node:T,messageId:"default",data:{message:`Missing required export "${R}" of type ${P}: ${L}`}})}},r;function m(T,A,R,P){let L=C=>{if(!T)return null;if(typeof T=="string")return C.replaceText(A,T);{let I=new RegExp(T.regex),F=e.sourceCode.getText(A);return C.replaceText(A,F.replace(I,T.with))}};e.report({node:A,messageId:"default",data:{message:R},fix:T&&P==="autofix"?L:void 0,suggest:T&&P==="suggestion"?[{messageId:"default",data:{message:`Replace with "${typeof T=="string"?T:T.with}"`},fix:L}]:void 0})}}});function yi(e,t){let r=[],n=t.exec(e);if(!n)return null;let[o,...s]=n;r.push({name:"$0_lowercase",value:o.toLowerCase()}),r.push({name:"$0_capitalize",value:Vn(o)}),r.push({name:"$0_uncapitalize",value:Xn(o)}),r.push({name:"$0",value:o});for(let i=0;i<s.length;i++){let p=`$${i+1}`,a=s[i];a!==void 0&&(r.push({name:`${p}_lowercase`,value:a.toLowerCase()}),r.push({name:`${p}_capitalize`,value:Vn(a)}),r.push({name:`${p}_uncapitalize`,value:Xn(a)}),r.push({name:p,value:a}))}return r}function Vn(e){return e.charAt(0).toUpperCase()+e.slice(1)}function Xn(e){return e.charAt(0).toLowerCase()+e.slice(1)}var K=require("@typescript-eslint/utils"),Je=require("zod/v4");var gi=K.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),Bn="collapse-simple-objs-in-one-line",Si=Je.z.object({maxLineLength:Je.z.number().optional(),maxProperties:Je.z.number().optional(),nestedObjMaxLineLength:Je.z.number().optional(),nestedObjMaxProperties:Je.z.number().optional(),ignoreTypesWithSuffix:Je.z.array(Je.z.string()).optional()}),Ti=gi({name:Bn,meta:{type:"suggestion",fixable:"code",docs:{description:"Format simple objects and types in one line"},messages:{singleLineProp:"Object/type should be written in a single line"},schema:[V(Si)]},defaultOptions:[{}],create(e,[t]){let r=e.sourceCode,n=t.ignoreTypesWithSuffix??[],o=t.maxProperties??2,s=t.nestedObjMaxLineLength??t.maxLineLength,i=t.nestedObjMaxProperties??3;function p(c){if(c.type===K.AST_NODE_TYPES.ObjectExpression){let d=c.parent.type===K.AST_NODE_TYPES.Property,y=d?i:o,l=c.properties.length;if(l>y)return!1;if(l===1){let u=c.properties[0];return!u||u.type===K.AST_NODE_TYPES.Property&&u.value.type===K.AST_NODE_TYPES.ObjectExpression||u.type===K.AST_NODE_TYPES.Property&&u.value.type===K.AST_NODE_TYPES.ArrayExpression&&!u.value.elements.every(g=>g&&Ot(g))?!1:{text:r.getText(u),isNested:d,propsSize:l}}let h=[];for(let u of c.properties){if(u.type===K.AST_NODE_TYPES.Property&&!Ot(u.value))return!1;h.push(r.getText(u))}return{text:h.join(", "),isNested:d,propsSize:l}}else{let d=c.parent.parent?.type===K.AST_NODE_TYPES.TSPropertySignature,y=d?i:o,l=c.members.length;if(l>y)return!1;if(n.length>0&&c.parent.type===K.AST_NODE_TYPES.TSTypeAliasDeclaration){let u=c.parent.id.name;if(n.some(S=>u.endsWith(S)))return!1}if(l===1){let u=c.members[0];return!u||u.type===K.AST_NODE_TYPES.TSPropertySignature&&u.typeAnnotation?.typeAnnotation.type===K.AST_NODE_TYPES.TSTypeLiteral?!1:{text:r.getText(u),isNested:d,propsSize:1}}if(c.parent.type===K.AST_NODE_TYPES.TSIntersectionType||c.parent.type===K.AST_NODE_TYPES.TSUnionType&&c.parent.types[0]!==c)return!1;let h=[];for(let u of c.members){if(u.type!==K.AST_NODE_TYPES.TSPropertySignature)return!1;let S=u.typeAnnotation?.typeAnnotation;if(!S||S.type===K.AST_NODE_TYPES.TSTypeLiteral||!Hn(S))return!1;if(S.type===K.AST_NODE_TYPES.TSTypeReference&&S.typeArguments){if(S.typeArguments.params.length>1)return!1;let f=S.typeArguments.params[0];if(!f||!Hn(f))return!1}let g=r.getText(u).trim();(g.endsWith(";")||g.endsWith(","))&&(g=g.slice(0,-1)),h.push(g)}return{text:h.join("; "),isNested:d,propsSize:l}}}function a(c){if(c.loc.start.line===c.loc.end.line)return;if(c.parent.type!==K.AST_NODE_TYPES.JSXExpressionContainer){let S=0,g=!1,f=r.getTokenAfter(c,{filter:x=>x.type!==K.AST_TOKEN_TYPES.Punctuator||g?!0:x.value===","?(S++,!1):x.value===";"?(S++,g=!0,!1):x.value===")"||x.value==="}"?(S++,!1):!0});if(S>4)return;let E=f?.type===K.AST_TOKEN_TYPES.Template&&f.value.startsWith(`}
2
+ `);if(f?.loc.start.line===c.loc.end.line&&!E)return}let d=p(c);if(!d)return;let y=d.text;if(y.includes(`
3
+ `)||r.getCommentsInside(c).length>0)return;y.endsWith(";")&&(y=y.slice(0,-1));let l=`{ ${y} }`,h=Ei(r,c),u=d.isNested&&d.propsSize>2?s:t.maxLineLength;u&&l.length+h.length+hi(c,r)>u||e.report({node:c,messageId:"singleLineProp",fix:S=>S.replaceText(c,l)})}return{TSTypeLiteral:a,ObjectExpression:a}}});function Hn(e){return e.type===K.AST_NODE_TYPES.TSLiteralType||e.type===K.AST_NODE_TYPES.TSTypeReference||e.type===K.AST_NODE_TYPES.TSNumberKeyword||e.type===K.AST_NODE_TYPES.TSStringKeyword||e.type===K.AST_NODE_TYPES.TSBooleanKeyword||e.type===K.AST_NODE_TYPES.TSNullKeyword||e.type===K.AST_NODE_TYPES.TSUndefinedKeyword}function Ot(e,t){return!!(e.type===K.AST_NODE_TYPES.Literal||e.type===K.AST_NODE_TYPES.Identifier||e.type===K.AST_NODE_TYPES.TemplateLiteral||e.type===K.AST_NODE_TYPES.TaggedTemplateExpression||!t&&e.type===K.AST_NODE_TYPES.ArrayExpression&&e.elements.every(r=>r&&Ot(r,!0)))}function hi(e,t){let r=t.getLastToken(e);if(!r)return 0;let n=t.text.indexOf(`
4
+ `,r.range[1]);return(n!==-1?n:t.text.length)-r.range[1]}function Ei(e,t){return e.text.slice(t.range[0]-t.loc.start.column,t.range[0])}var Nt={name:Bn,rule:Ti};var bi=/eslint +react-compiler\/react-compiler: +\["error/,qn={meta:{type:"suggestion",docs:{description:"verifies the list of dependencies for Hooks like useEffect and similar",recommended:!0,url:"https://github.com/facebook/react/issues/14920"},fixable:"code",hasSuggestions:!0,schema:[{type:"object",additionalProperties:!1,ignoreIfReactCompilerIsEnabled:!1,enableDangerousAutofixThisMayCauseInfiniteLoops:!1,properties:{additionalHooks:{type:"string"},ignoreIfReactCompilerIsEnabled:{type:"boolean"},enableDangerousAutofixThisMayCauseInfiniteLoops:{type:"boolean"}}}]},create(e){let t=!1,r=typeof e.getSource=="function"?f=>r(f):f=>e.sourceCode.getText(f),n=typeof e.getScope=="function"?()=>n():f=>e.sourceCode.getScope(f),o=e.options&&e.options[0]&&e.options[0].additionalHooks?new RegExp(e.options[0].additionalHooks):void 0,s=e.options&&e.options[0]&&e.options[0].enableDangerousAutofixThisMayCauseInfiniteLoops||!1,i={additionalHooks:o,enableDangerousAutofixThisMayCauseInfiniteLoops:s};function p(f){s&&Array.isArray(f.suggest)&&f.suggest.length>0&&(f.fix=f.suggest[0].fix),e.report(f)}let a=e.getSourceCode().scopeManager,c=new WeakMap,d=new WeakSet,y=new WeakMap,l=new WeakMap,h=new WeakSet;function u(f,E){return function(x){if(E.has(x))return E.get(x);let m=f(x);return E.set(x,m),m}}function S(f,E,x,m,b){b&&f.async&&p({node:f,message:`Effect callbacks are synchronous to prevent race conditions. Put the async function inside:
5
5
 
6
6
  useEffect(() => {
7
7
  async function fetchData() {
@@ -12,41 +12,44 @@ useEffect(() => {
12
12
  fetchData();
13
13
  }, [someId]); // Or [] if effect doesn't need props or state
14
14
 
15
- Learn more about data fetching with Hooks: https://reactjs.org/link/hooks-data-fetching`});let u=a.acquire(m),d=new Set,A=null;{let w=u.upper;for(;w&&(d.add(w),w.type!=="function");)w=w.upper;if(!w)return;A=w}let I=Array.isArray;function P(w){if(!I(w.defs))return!1;let R=w.defs[0];if(R==null||R.node.type!=="VariableDeclarator")return!1;let O=R.node.init;if(O==null)return!1;for(;O.type==="TSAsExpression";)O=O.expression;let D=R.node.parent;if(D==null&&(Ft(A.block,R.node.id),D=R.node.parent,D==null))return!1;if(D.kind==="const"&&O.type==="Literal"&&(typeof O.value=="string"||typeof O.value=="number"||O.value===null))return!0;if(O.type!=="CallExpression")return!1;let M=O.callee;if(M.type==="MemberExpression"&&M.object.name==="React"&&M.property!=null&&!M.computed&&(M=M.property),M.type!=="Identifier")return!1;let L=R.node.id,{name:z}=M;if(z==="useRef"&&L.type==="Identifier")return!0;if(Ii(M)&&L.type==="Identifier"){for(let W of w.references)W!==L&&E.add(W.identifier);return!0}else if(z==="useState"||z==="useReducer"){if(L.type==="ArrayPattern"&&L.elements.length===2&&I(w.identifiers)){if(L.elements[1]===w.identifiers[0]){if(z==="useState"){let W=w.references,he=0;for(let Fe=0;Fe<W.length;Fe++){if(W[Fe].isWrite()&&he++,he>1)return!1;c.set(W[Fe].identifier,L.elements[0])}}return!0}else if(L.elements[0]===w.identifiers[0]){if(z==="useState"){let W=w.references;for(let he=0;he<W.length;he++)g.add(W[he].identifier)}return!1}}}else if(z==="useTransition"&&L.type==="ArrayPattern"&&L.elements.length===2&&Array.isArray(w.identifiers)&&L.elements[1]===w.identifiers[0])return!0;return!1}function k(w){if(!I(w.defs))return!1;let R=w.defs[0];if(R==null||R.node==null||R.node.id==null)return!1;let O=R.node,D=A.childScopes,M=null,L;for(L=0;L<D.length;L++){let z=D[L],W=z.block;if(O.type==="FunctionDeclaration"&&W===O||O.type==="VariableDeclarator"&&W.parent===O){M=z;break}}if(M==null)return!1;for(L=0;L<M.through.length;L++){let z=M.through[L];if(z.resolved!=null&&d.has(z.resolved.scope)&&!H(z.resolved))return!1}return!0}let H=f(P,S),K=f(k,l),ne=new Map;function oe(w){let R=w.from,O=!1;for(;R.block!==m;)R.type==="function"&&(O=R.block.parent!=null&&R.block.parent.type==="ReturnStatement"),R=R.upper;return O}let Z=new Map,de=new Map;Ae(u);function Ae(w){for(let R of w.references){if(!R.resolved||!d.has(R.resolved.scope))continue;let O=Ft(m,R.identifier),D=Bn(O),M=Oe(D,de);if(x&&D.type==="Identifier"&&(D.parent.type==="MemberExpression"||D.parent.type==="OptionalMemberExpression")&&!D.parent.computed&&D.parent.property.type==="Identifier"&&D.parent.property.name==="current"&&oe(R)&&ne.set(M,{reference:R,dependencyNode:D}),D.parent.type==="TSTypeQuery"||D.parent.type==="TSTypeReference")continue;let L=R.resolved.defs[0];if(L!=null&&!(L.node!=null&&L.node.init===m.parent)&&L.type!=="TypeParameter")if(Z.has(M))Z.get(M).references.push(R);else{let z=R.resolved,W=H(z)||K(z);Z.set(M,{isStable:W,references:[R]})}}for(let R of w.childScopes)Ae(R)}ne.forEach(({reference:w,dependencyNode:R},O)=>{let D=w.resolved.references,M=!1;for(let L=0;L<D.length;L++){let{identifier:z}=D[L],{parent:W}=z;if(W!=null&&W.type==="MemberExpression"&&!W.computed&&W.property.type==="Identifier"&&W.property.name==="current"&&W.parent.type==="AssignmentExpression"&&W.parent.left===W){M=!0;break}}M||p({node:R.parent.property,message:`The ref value '${O}.current' will likely have changed by the time this effect cleanup function runs. If this ref points to a node rendered by React, copy '${O}.current' to a variable inside the effect, and use that variable in the cleanup function.`})});let ue=new Set;function Ie(w,R){ue.has(R)||(ue.add(R),p({node:w,message:`Assignments to the '${R}' variable from inside React Hook ${r(C)} will be lost after each render. To preserve the value over time, store it in a useRef Hook and keep the mutable value in the '.current' property. Otherwise, you can move this variable directly inside ${r(C)}.`}))}let Te=new Set;if(Z.forEach(({isStable:w,references:R},O)=>{w&&Te.add(O),R.forEach(D=>{D.writeExpr&&Ie(D.writeExpr,O)})}),ue.size>0)return;if(!b){let w=null;if(Z.forEach(({isStable:R,references:O},D)=>{w||O.forEach(M=>{if(w)return;let L=M.identifier;if(!c.has(L))return;let W=M.from;for(;W.type!=="function";)W=W.upper;W.block===m&&(w=D)})}),w){let{suggestedDependencies:R}=vt({dependencies:Z,declaredDependencies:[],stableDependencies:Te,externalDependencies:new Set,isEffect:!0});p({node:C,message:`React Hook ${y} contains a call to '${w}'. Without a list of dependencies, this can lead to an infinite chain of updates. To fix this, pass [`+R.join(", ")+`] as a second argument to the ${y} Hook.`,suggest:[{desc:`Add dependencies array: [${R.join(", ")}]`,fix(O){return O.insertTextAfter(m,`, [${R.join(", ")}]`)}}]})}return}let ze=[],Ke=new Set;b.type!=="ArrayExpression"?p({node:b,message:`React Hook ${r(C)} was passed a dependency list that is not an array literal. This means we can't statically verify whether you've passed the correct dependencies.`}):b.elements.forEach(w=>{if(w===null)return;if(w.type==="SpreadElement"){p({node:w,message:`React Hook ${r(C)} has a spread element in its dependency array. This means we can't statically verify whether you've passed the correct dependencies.`});return}E.has(w)&&p({node:w,message:`Functions returned from \`useEffectEvent\` must not be included in the dependency array. Remove \`${r(w)}\` from the list.`,suggest:[{desc:`Remove the dependency \`${r(w)}\``,fix(M){return M.removeRange(w.range)}}]});let R;try{R=Oe(w,de)}catch(M){if(/Unsupported node type/.test(M.message)){w.type==="Literal"?Z.has(w.value)?p({node:w,message:`The ${w.raw} literal is not a valid dependency because it never changes. Did you mean to include ${w.value} in the array instead?`}):p({node:w,message:`The ${w.raw} literal is not a valid dependency because it never changes. You can safely remove it.`}):p({node:w,message:`React Hook ${r(C)} has a complex expression in the dependency array. Extract it to a separate variable so it can be statically checked.`});return}else throw M}let O=w;for(;O.type==="MemberExpression"||O.type==="OptionalMemberExpression"||O.type==="ChainExpression";)O=O.object||O.expression.object;let D=!A.through.some(M=>M.identifier===O);ze.push({key:R,node:w}),D||Ke.add(R)});let{suggestedDependencies:ni,unnecessaryDependencies:ot,missingDependencies:Le,duplicateDependencies:jn}=vt({dependencies:Z,declaredDependencies:ze,stableDependencies:Te,externalDependencies:Ke,isEffect:x}),at=ni;if(jn.size+Le.size+ot.size===0){if(t)return;bi({declaredDependencies:ze,declaredDependenciesNode:b,componentScope:A,scope:u}).forEach(({construction:R,isUsedOutsideOfHook:O,depType:D})=>{let M=D==="function"?"useCallback":"useMemo",L=D==="function"?"definition":"initialization",z=`wrap the ${L} of '${R.name.name}' in its own ${M}() Hook.`,W=O?`To fix this, ${z}`:`Move it inside the ${y} callback. Alternatively, ${z}`,he=D==="conditional"||D==="logical expression"?"could make":"makes",Fe=`The '${R.name.name}' ${D} ${he} the dependencies of ${y} Hook (at line ${b.loc.start.line}) change on every render. ${W}`,Ln;O&&R.type==="Variable"&&D==="function"&&(Ln=[{desc:`Wrap the ${L} of '${R.name.name}' in its own ${M}() Hook.`,fix(Mn){let[ii,si]=M==="useMemo"?["useMemo(() => { return ","; })"]:["useCallback(",")"];return[Mn.insertTextBefore(R.node.init,ii),Mn.insertTextAfter(R.node.init,si)]}}]),p({node:R.node,message:Fe,suggest:Ln})});return}!x&&Le.size>0&&(at=vt({dependencies:Z,declaredDependencies:[],stableDependencies:Te,externalDependencies:Ke,isEffect:x}).suggestedDependencies);function ri(){if(ze.length===0)return!0;let w=ze.map(O=>O.key),R=w.slice().sort();return w.join(",")===R.join(",")}ri()&&at.sort();function At(w){let R=w.split("."),O="";for(let D=0;D<R.length;D++){if(D!==0){let M=R.slice(0,D+1).join("."),L=de.get(M)===!0;O+=L?"?.":"."}O+=R[D]}return O}function It(w,R,O,D){return w.size===0?null:(w.size>1?"":R+" ")+O+" "+(w.size>1?"dependencies":"dependency")+": "+Ci(Array.from(w).sort().map(M=>"'"+At(M)+"'"))+`. Either ${D} ${w.size>1?"them":"it"} or remove the dependency array.`}let be="";if(ot.size>0){let w=null;if(Array.from(ot.keys()).forEach(R=>{w===null&&R.endsWith(".current")&&(w=R)}),w!==null)be=` Mutable values like '${w}' aren't valid dependencies because mutating them doesn't re-render the component.`;else if(Ke.size>0){let R=Array.from(Ke)[0];u.set.has(R)||(be=` Outer scope values like '${R}' aren't valid dependencies because mutating them doesn't re-render the component.`)}}if(!be&&Le.has("props")){let w=Z.get("props");if(w==null)return;let R=w.references;if(!Array.isArray(R))return;let O=!0;for(let D=0;D<R.length;D++){let M=R[D],L=Ft(A.block,M.identifier);if(!L){O=!1;break}let z=L.parent;if(z==null){O=!1;break}if(z.type!=="MemberExpression"&&z.type!=="OptionalMemberExpression"){O=!1;break}}O&&(be=` However, 'props' will change when *any* prop changes, so the preferred fix is to destructure the 'props' object outside of the ${y} call and refer to those specific props inside ${r(C)}.`)}if(!be&&Le.size>0){let w=null;Le.forEach(R=>{if(w)return;let O=A.set.get(R),D=Z.get(R);if(D.references[0].resolved!==O)return;let M=O.defs[0];if(M==null||M.name==null||M.type!=="Parameter")return;let L=!1,z;for(let W=0;W<D.references.length;W++)if(z=D.references[W].identifier,z!=null&&z.parent!=null&&(z.parent.type==="CallExpression"||z.parent.type==="OptionalCallExpression")&&z.parent.callee===z){L=!0;break}L&&(w=R)}),w!==null&&(be=` If '${w}' changes too often, find the parent component that defines it and wrap that definition in useCallback.`)}if(!be&&Le.size>0){let w=null;if(Le.forEach(R=>{if(w!==null)return;let D=Z.get(R).references,M,L;for(let z=0;z<D.length;z++){for(M=D[z].identifier,L=M.parent;L!=null&&L!==A.block;){if(L.type==="CallExpression"){let W=c.get(L.callee);if(W!=null){if(W.name===R)w={missingDep:R,setter:L.callee.name,form:"updater"};else if(g.has(M))w={missingDep:R,setter:L.callee.name,form:"reducer"};else{let he=D[z].resolved;if(he!=null){let Fe=he.defs[0];Fe!=null&&Fe.type==="Parameter"&&(w={missingDep:R,setter:L.callee.name,form:"inlineReducer"})}}break}}L=L.parent}if(w!==null)break}}),w!==null)switch(w.form){case"reducer":be=` You can also replace multiple useState variables with useReducer if '${w.setter}' needs the current value of '${w.missingDep}'.`;break;case"inlineReducer":be=` If '${w.setter}' needs the current value of '${w.missingDep}', you can also switch to useReducer instead of useState and read '${w.missingDep}' in the reducer.`;break;case"updater":be=` You can also do a functional update '${w.setter}(${w.missingDep.slice(0,1)} => ...)' if you only need '${w.missingDep}' in the '${w.setter}' call.`;break;default:throw new Error("Unknown case.")}}p({node:b,message:`React Hook ${r(C)} has `+(It(Le,"a","missing","include")||It(ot,"an","unnecessary","exclude")||It(jn,"a","duplicate","omit"))+be,suggest:[{desc:`Update the dependencies array to be: [${at.map(At).join(", ")}]`,fix(w){return w.replaceText(b,`[${at.map(At).join(", ")}]`)}}]})}function T(m){let b=xi(m.callee,i);if(b===-1)return;let C=m.arguments[b],y=m.callee,x=Yn(y).name,u=m.arguments[b+1],d=/Effect($|[^a-z])/g.test(x);if(!C){p({node:y,message:`React Hook ${x} requires an effect callback. Did you forget to pass a callback to the hook?`});return}if(!(t&&!d)){if(!u&&!d){(x==="useMemo"||x==="useCallback")&&p({node:y,message:`React Hook ${x} does nothing when called with only one argument. Did you forget to pass an array of dependencies?`});return}switch(C.type){case"FunctionExpression":case"ArrowFunctionExpression":h(C,u,y,x,d);return;case"Identifier":if(!u||u.elements&&u.elements.some(P=>P&&P.type==="Identifier"&&P.name===C.name))return;let A=n(m).set.get(C.name);if(A==null||A.defs==null)return;let I=A.defs[0];if(!I||!I.node||I.type!=="Variable"&&I.type!=="FunctionName")break;switch(I.node.type){case"FunctionDeclaration":h(I.node,u,y,x,d);return;case"VariableDeclarator":let P=I.node.init;if(!P)break;switch(P.type){case"ArrowFunctionExpression":case"FunctionExpression":h(P,u,y,x,d);return}break}break;default:p({node:y,message:`React Hook ${x} received a function whose dependencies are unknown. Pass an inline function instead.`});return}p({node:y,message:`React Hook ${x} has a missing dependency: '${C.name}'. Either include it or remove the dependency array.`,suggest:[{desc:`Update the dependencies array to be: [${C.name}]`,fix(A){return A.replaceText(u,`[${C.name}]`)}}]})}}if(e.options[0]?.ignoreIfReactCompilerIsEnabled){for(let m of e.sourceCode.getAllComments())if(Ei.test(m.value))return t=!0,{CallExpression:b=>T(b,!0)}}return{CallExpression:m=>T(m)}}};function vt({dependencies:e,declaredDependencies:t,stableDependencies:r,externalDependencies:n,isEffect:s}){let o=i();function i(){return{isUsed:!1,isSatisfiedRecursively:!1,isSubtreeUsed:!1,children:new Map}}e.forEach((h,T)=>{let m=p(o,T);m.isUsed=!0,a(o,T,b=>{b.isSubtreeUsed=!0})}),t.forEach(({key:h})=>{let T=p(o,h);T.isSatisfiedRecursively=!0}),r.forEach(h=>{let T=p(o,h);T.isSatisfiedRecursively=!0});function p(h,T){let m=T.split("."),b=h;for(let C of m){let y=b.children.get(C);y||(y=i(),b.children.set(C,y)),b=y}return b}function a(h,T,m){let b=T.split("."),C=h;for(let y of b){let x=C.children.get(y);if(!x)return;m(x),C=x}}let c=new Set,g=new Set;S(o,c,g,h=>h);function S(h,T,m,b){h.children.forEach((C,y)=>{let x=b(y);if(C.isSatisfiedRecursively){C.isSubtreeUsed&&m.add(x);return}if(C.isUsed){T.add(x);return}S(C,T,m,u=>x+"."+u)})}let l=[],E=new Set,f=new Set;return t.forEach(({key:h})=>{g.has(h)?l.indexOf(h)===-1?l.push(h):f.add(h):E.add(h)}),c.forEach(h=>{l.push(h)}),{suggestedDependencies:l,unnecessaryDependencies:E,duplicateDependencies:f,missingDependencies:c}}function $e(e){switch(e.type){case"ObjectExpression":return"object";case"ArrayExpression":return"array";case"ArrowFunctionExpression":case"FunctionExpression":return"function";case"ClassExpression":return"class";case"ConditionalExpression":return $e(e.consequent)!=null||$e(e.alternate)!=null?"conditional":null;case"LogicalExpression":return $e(e.left)!=null||$e(e.right)!=null?"logical expression":null;case"JSXFragment":return"JSX fragment";case"JSXElement":return"JSX element";case"AssignmentExpression":return $e(e.right)!=null?"assignment expression":null;case"NewExpression":return"object construction";case"Literal":return e.value instanceof RegExp?"regular expression":null;case"TypeCastExpression":return $e(e.expression);case"TSAsExpression":return $e(e.expression)}return null}function bi({declaredDependencies:e,declaredDependenciesNode:t,componentScope:r,scope:n}){let s=e.map(({key:i})=>{let p=r.variables.find(c=>c.name===i);if(p==null)return null;let a=p.defs[0];if(a==null)return null;if(a.type==="Variable"&&a.node.type==="VariableDeclarator"&&a.node.id.type==="Identifier"&&a.node.init!=null){let c=$e(a.node.init);if(c!=null)return[p,c]}return a.type==="FunctionName"&&a.node.type==="FunctionDeclaration"?[p,"function"]:a.type==="ClassName"&&a.node.type==="ClassDeclaration"?[p,"class"]:null}).filter(Boolean);function o(i){let p=!1;for(let a=0;a<i.references.length;a++){let c=i.references[a];if(c.writeExpr){if(p)return!0;p=!0;continue}let g=c.from;for(;g!==n&&g!=null;)g=g.upper;if(g!==n&&!qn(t,c.identifier))return!0}return!1}return s.map(([i,p])=>({construction:i.defs[0],depType:p,isUsedOutsideOfHook:o(i)}))}function Bn(e){return(e.parent.type==="MemberExpression"||e.parent.type==="OptionalMemberExpression")&&e.parent.object===e&&e.parent.property.name!=="current"&&!e.parent.computed&&!(e.parent.parent!=null&&(e.parent.parent.type==="CallExpression"||e.parent.parent.type==="OptionalCallExpression")&&e.parent.parent.callee===e.parent)?Bn(e.parent):e.type==="MemberExpression"&&e.parent&&e.parent.type==="AssignmentExpression"&&e.parent.left===e?e.object:e}function kt(e,t,r){t&&(e.optional?t.has(r)||t.set(r,!0):t.has(r)||t.set(r,!1))}function Oe(e,t){if(e.type==="Identifier"||e.type==="JSXIdentifier"){let r=e.name;return t&&t.set(r,!1),r}else if(e.type==="MemberExpression"&&!e.computed){let r=Oe(e.object,t),n=Oe(e.property,null),s=`${r}.${n}`;return kt(e,t,s),s}else if(e.type==="OptionalMemberExpression"&&!e.computed){let r=Oe(e.object,t),n=Oe(e.property,null),s=`${r}.${n}`;return kt(e,t,s),s}else if(e.type==="ChainExpression"&&!e.computed){let r=e.expression;if(r.type==="CallExpression")throw new Error(`Unsupported node type: ${r.type}`);let n=Oe(r.object,t),s=Oe(r.property,null),o=`${n}.${s}`;return kt(r,t,o),o}else throw new Error(`Unsupported node type: ${e.type}`)}function Yn(e,t){return e.type==="MemberExpression"&&e.object.type==="Identifier"&&e.object.name==="React"&&e.property.type==="Identifier"&&!e.computed?e.property:e}function xi(e,t){let r=Yn(e);if(r.type!=="Identifier")return-1;switch(r.name){case"useEffect":case"useLayoutEffect":case"useCallback":case"useMemo":return 0;case"useImperativeHandle":return 1;default:if(r===e&&t&&t.additionalHooks){let n;try{n=Oe(r,null)}catch(s){if(/Unsupported node type/.test(s.message))return 0;throw s}return t.additionalHooks.test(n)?0:-1}else return-1}}function Ft(e,t){let r=[e],n=null;for(;r.length;){if(n=r.shift(),Ai(n,t))return n;if(qn(n,t))for(let[s,o]of Object.entries(n))s!=="parent"&&(Xn(o)?(o.parent=n,r.push(o)):Array.isArray(o)&&o.forEach(i=>{Xn(i)&&(i.parent=n,r.push(i))}))}return null}function Ci(e){let t="";for(let r=0;r<e.length;r++)t+=e[r],r===0&&e.length===2?t+=" and ":r===e.length-2&&e.length>2?t+=", and ":r<e.length-1&&(t+=", ");return t}function Xn(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&typeof e.type=="string"}function Ai(e,t){return(e.type==="Identifier"||e.type==="JSXIdentifier")&&e.type===t.type&&e.name===t.name&&e.range[0]===t.range[0]&&e.range[1]===t.range[1]}function qn(e,t){return e.range[0]<=t.range[0]&&e.range[1]>=t.range[1]}function Ii(e){return!1}var te=require("@typescript-eslint/utils"),ae=xe(require("typescript")),Qn=require("zod/v4");var Ot=require("@typescript-eslint/utils");function He(e,t,r=1/0){if(r!==0&&e.parent)return e.type===t?e:He(e.parent,t,r===1/0?r:r-1)}function*Nt(e){yield e,e.parent&&(yield*Nt(e.parent))}function Dt(e,t){for(let r of e){let n=t(r);if(n!=null&&n!==!1)return n}}function Gn(e,t,r){let s=r.getDeclaredVariables(e).find(o=>o.name===t||o.identifiers[0]?.parent.type===Ot.AST_NODE_TYPES.Property&&o.identifiers[0].parent.key.type===Ot.AST_NODE_TYPES.Identifier&&o.identifiers[0].parent.key.name===t);return s?s.references.filter(o=>!o.init):[]}function Zn(e){return e===null||typeof e!="object"||!("type"in e)?!1:typeof e.type=="string"}function wi(e,t){return e[t]}function we(e,t,r){let n=r.visitorKeys,s=new Set;function o(i){if(s.has(i))return!1;if(s.add(i),t(i)===!0)return!0;let a=n[i.type];if(a)for(let c of a){let g=wi(i,c);if(g){if(Array.isArray(g)){for(let S of g)if(Zn(S)&&o(S))return!0}else if(Zn(g)&&o(g))return!0}}return!1}o(e)}var Ri=te.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),Kn="improved-no-unnecessary-condition",Pi=Qn.z.object({}),vi=["string","number","bigint","boolean","symbol","undefined","object","function","never"],ki=new Set(vi),jt={name:Kn,rule:Ri({name:Kn,meta:{type:"suggestion",docs:{description:"Extends checks of `no-unnecessary-condition` rule"},messages:{unnecessaryTypeofCondition:'This condition is unnecessary. The type of "{{name}}" is always "{{type}}".',alwaysFalseTypeofCondition:'This condition will always be false. The type of "{{name}}" is "{{actualType}}" so the condition has no overlap with "{{conditionType}}".',unnecessaryStartsWithCondition:"This startsWith check is unnecessary as it always evaluates to true.",alwaysFalseStartsWithCondition:"This startsWith check will always be false.",unnecessaryEndsWithCondition:"This endsWith check is unnecessary as it always evaluates to true.",alwaysFalseEndsWithCondition:"This endsWith check will always be false.",unnecessaryIncludesCondition:"This includes check is unnecessary as it always evaluates to true.",alwaysFalseIncludesCondition:"This includes check will always be false.",unnecessaryLengthCondition:"This length comparison is unnecessary as it always evaluates to true.",alwaysFalseLengthCondition:"This length comparison will always be false."},schema:[$(Pi)]},defaultOptions:[{}],create(e){let t=te.ESLintUtils.getParserServices(e,!0),r=t.program?.getTypeChecker();if(!r||!t.program)throw new Error("TypeScript services or program not available");function n(l){return l.type===te.AST_NODE_TYPES.UnaryExpression&&l.operator==="typeof"}function s(l){return l.flags&ae.default.TypeFlags.Any||l.flags&ae.default.TypeFlags.Unknown?null:l.flags&ae.default.TypeFlags.StringLike?["string"]:l.flags&ae.default.TypeFlags.NumberLike?["number"]:l.flags&ae.default.TypeFlags.BigIntLike?["bigint"]:l.flags&ae.default.TypeFlags.BooleanLike?["boolean"]:l.flags&ae.default.TypeFlags.ESSymbolLike?["symbol"]:l.flags&ae.default.TypeFlags.Undefined||l.flags&ae.default.TypeFlags.Void?["undefined"]:l.flags&ae.default.TypeFlags.Null?["object"]:l.getCallSignatures().length>0?["function"]:l.flags&ae.default.TypeFlags.Object?l.getProperties().length===0?["string","number","bigint","boolean","symbol","object","function"]:["object"]:l.flags&ae.default.TypeFlags.NonPrimitive?["object"]:l.flags&ae.default.TypeFlags.Never?["never"]:null}function o(l){if(!r)return null;let E=t.esTreeNodeToTSNodeMap.get(l),f=r.getTypeAtLocation(E.expression);if(f.flags&ae.default.TypeFlags.Any||f.flags&ae.default.TypeFlags.Unknown)return null;let h=[];if(f.isUnion()){for(let m of f.types){let b=s(m);if(b)h.push(...b);else return null}return h}let T=s(f);return T?(h.push(...T),h):null}function i(l){if(!(l.operator==="==="||l.operator==="!=="))return;let f=null,h=null;if(n(l.left)?(f=l.left,h=l.right.type===te.AST_NODE_TYPES.Literal&&typeof l.right.value=="string"?l.right.value:null):n(l.right)&&(f=l.right,h=l.left.type===te.AST_NODE_TYPES.Literal&&typeof l.left.value=="string"?l.left.value:null),!f||!h||!Fi(h,ki))return;let T=o(f);if(!T)return;let m=l.operator==="!==",b=T.includes(h);T.length===1?b&&!m?e.report({node:l,messageId:"unnecessaryTypeofCondition",data:{name:Be(f,e),type:h}}):!b&&m?e.report({node:l,messageId:"unnecessaryTypeofCondition",data:{name:Be(f,e),type:Array.from(T)[0]}}):!b&&!m?e.report({node:l,messageId:"alwaysFalseTypeofCondition",data:{name:Be(f,e),actualType:pt(T),conditionType:h}}):b&&m&&e.report({node:l,messageId:"alwaysFalseTypeofCondition",data:{name:Be(f,e),actualType:pt(T),conditionType:h}}):!b&&!m?e.report({node:l,messageId:"alwaysFalseTypeofCondition",data:{name:Be(f,e),actualType:pt(T),conditionType:h}}):!b&&m&&e.report({node:l,messageId:"unnecessaryTypeofCondition",data:{name:Be(f,e),type:pt(T)}})}function p(l){if(l.flags&ae.default.TypeFlags.Any||l.flags&ae.default.TypeFlags.Unknown)return null;if(l.isUnion()){let E=[];for(let f of l.types)if(f.flags&ae.default.TypeFlags.StringLiteral){let h=f.value;E.push(h)}else return null;return E}return l.flags&ae.default.TypeFlags.StringLiteral?[l.value]:null}function a(l){if(!r)return null;let E=t.esTreeNodeToTSNodeMap.get(l),f=r.getTypeAtLocation(E),h=p(f);if(h)return h;let T=r.getSymbolAtLocation(E);if(T){let m=r.getTypeOfSymbolAtLocation(T,E),b=p(m);if(b)return b}return null}function c(l){let E=e.sourceCode.ast,f=null;return we(E,h=>{if(h.type===te.AST_NODE_TYPES.VariableDeclarator&&h.id.type===te.AST_NODE_TYPES.Identifier&&h.id.name===l.name&&h.id.typeAnnotation){let T=h.id.typeAnnotation.typeAnnotation;if(T.type===te.AST_NODE_TYPES.TSUnionType){let m=[];for(let b of T.types)if(b.type===te.AST_NODE_TYPES.TSLiteralType&&b.literal.type===te.AST_NODE_TYPES.Literal&&typeof b.literal.value=="string")m.push(b.literal.value);else return!0;return f=m,!0}if(T.type===te.AST_NODE_TYPES.TSLiteralType&&T.literal.type===te.AST_NODE_TYPES.Literal&&typeof T.literal.value=="string")return f=[T.literal.value],!0}return!1},e.sourceCode),f}function g(l){if(l.callee.type!==te.AST_NODE_TYPES.MemberExpression||l.callee.property.type!==te.AST_NODE_TYPES.Identifier||l.callee.computed)return;let E=l.callee.property.name;if(E!=="startsWith"&&E!=="endsWith"&&E!=="includes"||l.arguments.length!==1)return;let[f]=l.arguments;if(!f||f.type!==te.AST_NODE_TYPES.Literal||typeof f.value!="string")return;let h=l.callee.object,T=a(h);if(!T&&h.type===te.AST_NODE_TYPES.Identifier&&(T=c(h)),!T||T.length===0)return;let m=f.value;if(E==="includes"&&T.length>1)return;let b=0,C=0;for(let y of T)if((E==="startsWith"?y.startsWith(m):E==="endsWith"?y.endsWith(m):y.includes(m))?b++:C++,b>0&&C>0)return;if(b>0&&C===0){let y=E==="startsWith"?"unnecessaryStartsWithCondition":E==="endsWith"?"unnecessaryEndsWithCondition":"unnecessaryIncludesCondition";e.report({node:l,messageId:y})}else if(C>0&&b===0){let y=E==="startsWith"?"alwaysFalseStartsWithCondition":E==="endsWith"?"alwaysFalseEndsWithCondition":"alwaysFalseIncludesCondition";e.report({node:l,messageId:y})}}function S(l){if(!new Set(["===","!==",">",">=","<","<="]).has(l.operator))return;function f(x){if(x.type!==te.AST_NODE_TYPES.MemberExpression||x.computed||x.property.type!==te.AST_NODE_TYPES.Identifier||x.property.name!=="length")return null;let u=x.object,d=a(u);if(!d||d.length===0)return null;let A=[];for(let I of d)A.push(I.length);return{values:A}}let h=f(l.left),T=f(l.right),m=null,b=null;if(h?l.right.type===te.AST_NODE_TYPES.Literal&&typeof l.right.value=="number"&&(m=h.values,b=l.right.value):T&&l.left.type===te.AST_NODE_TYPES.Literal&&typeof l.left.value=="number"&&(m=T.values,b=l.left.value),!m||b===null)return;let C=0,y=0;for(let x of m){let u=!1;if(l.operator==="==="?u=x===b:l.operator==="!=="?u=x!==b:l.operator===">"?u=x>b:l.operator===">="?u=x>=b:l.operator==="<"?u=x<b:l.operator==="<="&&(u=x<=b),u?C++:y++,C>0&&y>0)return}C>0&&y===0?e.report({node:l,messageId:"unnecessaryLengthCondition"}):y>0&&C===0&&e.report({node:l,messageId:"alwaysFalseLengthCondition"})}return{BinaryExpression(l){i(l),S(l)},CallExpression:g}}})};function pt(e){return Array.from(new Set(e)).join(" | ")||"never"}function Be(e,t){let r=e.argument;return r.type===te.AST_NODE_TYPES.Identifier?r.name:t.sourceCode.getText(r)}function Fi(e,t){return t.has(e)}var ut=require("@typescript-eslint/utils"),ct=require("zod/v4");var Oi=ut.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),er="no-call-with-explicit-generics",Ni=ct.z.object({functions:ct.z.array(ct.z.string())}),Di=Oi({name:er,meta:{type:"problem",docs:{description:"Enforce calling configured functions with inferred generics only"},messages:{noExplicitGenerics:"Function '{{ functionName }}' should be called with inferred generics (remove the explicit type parameters)"},schema:[$(Ni)]},defaultOptions:[{functions:[]}],create(e,[t]){let r=new Set(t.functions);return{CallExpression(n){let{callee:s}=n;s.type===ut.AST_NODE_TYPES.Identifier&&r.has(s.name)&&n.typeArguments&&e.report({node:n,messageId:"noExplicitGenerics",data:{functionName:s.name}})}}}}),Lt={name:er,rule:Di};var We=require("@typescript-eslint/utils"),ji=We.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),tr="no-call-with-inferred-generics",Li=ji({name:tr,meta:{type:"problem",docs:{description:"Disable calling configured functions with infered generics"},messages:{missingGenericDeclaration:"Function '{{ functionName }}' should be called with at least {{ minGenerics }} generic(s) (ex: `fn<Generic>()`) defined",anyUsedInGenerics:"Function '{{ functionName }}' should not be called with 'any' in generics"},schema:[{type:"object",properties:{functions:{type:"array",items:{type:"object",properties:{name:{type:"string"},minGenerics:{type:"number"},allowAny:{type:"boolean"},disallowTypes:{type:"array",items:{type:"string"}}},required:["name"]}},anyAliases:{type:"array",items:{type:"string"}}},required:["functions"]}]},defaultOptions:[{functions:[]}],create(e,[t]){let r=new Map(t.functions.map(n=>[n.name,n]));return{CallExpression(n){let{callee:s}=n;if(s.type!==We.AST_NODE_TYPES.Identifier)return;let o=r.get(s.name);if(!o)return;let{minGenerics:i=1,allowAny:p,disallowTypes:a=t.disallowTypes}=o;(n.typeArguments?.params.length||0)<(i||0)&&e.report({node:n,messageId:"missingGenericDeclaration",data:{functionName:s.name,minGenerics:i||0}}),!(p&&!a)&&n.typeArguments?.params.some(g=>!p&&g.type===We.AST_NODE_TYPES.TSAnyKeyword||a&&g.type===We.AST_NODE_TYPES.TSTypeReference&&g.typeName.type===We.AST_NODE_TYPES.Identifier&&a.includes(g.typeName.name))&&e.report({node:n,messageId:"anyUsedInGenerics",data:{functionName:s.name}})}}}}),Mt={name:tr,rule:Li};var ir=require("@typescript-eslint/utils"),Mi=ir.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),sr="no-commented-out-code",$i=["function ","class ","interface ","type ","enum ","namespace ","import ","export ","const ","let ","var ","return ","throw ","break","continue","try {","catch (","finally {","async ","await ","case ","switch (","while (","for (","default:"],_i=/^\s*return\s+/,Ui=/\w=("|'|`)/,zi=/\w+:\s*('|"|`)/,Wi=/\[['"][^'"]*['"]\]:\s*('|"|`|[^'"`\s])/,Ji=/\w+-\w+:/,Vi=/\w+_\w+:/,Xi=/\?\s+\w/,Hi=/:\s+\w/,Bi=/^\s*('|"|`)[^'"]*('|"|`),?\s*$/,Yi=/^\s*\d+[,}]/,qi=/^\s*\[[^\]]*\][,}]/,Zi=/^\s*\{[^}]*\}[,}]/,Gi=/\.\w+\(/,Ki=/\[\w+\]/,Qi=/^\s*(['"`]).+?\1\s*:/,es=/^<[A-Z]\w*(\s|>|\/)/,ts=/^<[a-z]+(\s|>|\/)/,ns=/<[A-Z]\w*(\s.*)?>/,rs=/<\/[A-Z]\w*>/,is=/<[a-z]+(\s.*)?>/,ss=/<\/[a-z]+>/,os=/^\s*[*\s]*$/,as=/^[a-zA-Z]/,ls=/^[A-Z][A-Za-z]*(?:\s+\d+)?(?:\s+[a-z]+)*:\s+[A-Za-z]/,ps=/```[\s\S]*?```/g,cs=/`[^`]*`/g,nr=/[a-zA-Z0-9]/,us=/\.[A-Za-z_][A-Za-z0-9_]*\(/,fs=/[{}[\]()`=<>]/,ms=/:\s*(['"`[{(]|\w+\s*=>)/,ys=/\bif\s*\(|\belse\b|=>/,re={returnStatement:_i,stringAssignment:Ui,objectPropertyWithQuotes:zi,computedPropertyAssignment:Wi,kebabCaseProperty:Ji,snakeCaseProperty:Vi,ternaryOperator:Xi,colonWithWord:Hi,quotedString:Bi,numberWithComma:Yi,arrayWithComma:qi,objectWithComma:Zi,methodCall:Gi,arrayAccess:Ki,quotedPropertyKey:Qi,jsxSelfClosing:es,jsxElement:ts,jsxOpeningTag:ns,jsxClosingTag:rs,htmlOpeningTag:is,htmlClosingTag:ss,jsdocComment:os};function ds(e){if(e.includes(":")){let r=e.split(":")[0]?.trim();if(r&&as.test(r)&&r.includes(" "))return!0}let t=e.trim();return t.length===0||us.test(t)||fs.test(t)||ms.test(t)||ys.test(t)?!1:!!(t.includes(":")&&ls.test(t))}var gs=[") {","return;",re.returnStatement,"if (","else {","else if (","/>","</","< ","},",": {"," } = ","={",re.stringAssignment,");",re.objectPropertyWithQuotes,re.computedPropertyAssignment,re.kebabCaseProperty,re.snakeCaseProperty,"&&","||","()",re.ternaryOperator,re.colonWithWord,re.quotedString,re.numberWithComma,re.arrayWithComma,re.objectWithComma,re.methodCall,re.arrayAccess,"?.(","??","=>",re.quotedPropertyKey],Ss=["/>","</",re.jsxSelfClosing,re.jsxElement,re.jsxOpeningTag,re.jsxClosingTag,re.htmlOpeningTag,re.htmlClosingTag],rr=["INFO:","TODO:","DOCS:","FIX:","FIXME:","HACK:","NOTE:","WARNING:","WARN:","BUG:","ISSUE:","TEMP:","TEMPORARY:","XXX:","REVIEW:","eslint"],Ts=Mi({name:sr,meta:{type:"problem",docs:{description:"Disallow commented code"},messages:{commentedOutCode:"Commented code is not allowed. Detected pattern: `{{ wrongPattern }}` Use a comment starting with one of these prefixes if you want to keep this code commented out: {{ allowedPrefixes }}"},schema:[]},defaultOptions:[],create(e){function t(n,s){if(n.startsWith("/"))return!1;let o=n.trimStart();if(n.startsWith("*")||o.startsWith("eslint-disable")||n.includes("@deprecated")||n.includes("@example")||n.includes("@param")||n.includes("@returns")||n.includes("@throws")||n.includes("typescript-eslint")||n.includes("@ts-")||n.includes("prettier-ignore")||re.jsdocComment.test(n))return!1;for(let i of rr)if(o.startsWith(i))return!1;if(n.includes("https://")||ds(o))return!1;if(s==="Block"){for(let i of Ss)if(typeof i=="string"){if(n.includes(i))return{wrongPattern:i}}else if(i.test(n))return{wrongPattern:`regex(${i.toString()})`};return!1}for(let i of $i)if(o.startsWith(i))return{wrongPattern:i};for(let i of gs)if(typeof i=="string"){if(n.includes(i))return{wrongPattern:i}}else if(i.test(n))return{wrongPattern:`regex(${i.toString()})`};return!1}function r(n,s){let o=n,i=o.trim();if(i.startsWith("`")&&(i.endsWith("`,")||i.endsWith("`;")||i.endsWith("`")))return o;if(s==="Block"&&o.includes("```")){let c=o.split(ps);c.some(S=>nr.test(S))&&(o=c.join(""))}if(!o.includes("`"))return o;let p=o.split(cs);return p.some(c=>nr.test(c))?p.join(""):o}return{Program(){let s=e.sourceCode.getAllComments();for(let o of s){let i=r(o.value,o.type),p=t(i,o.type);p&&e.report({node:o,messageId:"commentedOutCode",data:{wrongPattern:p.wrongPattern,allowedPrefixes:rr.join(", ")}})}}}}}),$t={name:sr,rule:Ts};var ft=require("@typescript-eslint/utils"),hs=ft.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),or="no-default-export",Es=hs({name:or,meta:{type:"problem",docs:{description:"Disallow default exports"},schema:[],messages:{noDefaultExport:"Default exports are not allowed, use named exports instead."}},defaultOptions:[],create(e){return{ExportDefaultDeclaration(t){e.report({node:t,messageId:"noDefaultExport"})},ExportNamedDeclaration(t){for(let r of t.specifiers)r.exported.type===ft.TSESTree.AST_NODE_TYPES.Identifier&&r.exported.name==="default"&&e.report({node:t,messageId:"noDefaultExport"})}}}}),_t={name:or,rule:Es};var ar=require("@typescript-eslint/utils"),bs=ar.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),lr="no-leaked-text-in-jsx",xs=[",",";","[","]","(",")"],Cs=bs({name:lr,meta:{type:"problem",docs:{description:"Prevents leaking of text in JSX that should be wrapped in an expression container"},messages:{leakedTextInJSX:'Text "{{ text }}" should be wrapped in a JSX expression container.'},schema:[],fixable:"code"},defaultOptions:[],create(e){return{JSXText(t){let r=t.value.trim();if(!r)return;let n="";xs.includes(r)?n=r:r.includes("&&")?n="&&":r.includes("||")?n="||":r.endsWith("? (")&&(n="? ("),n&&e.report({node:t,messageId:"leakedTextInJSX",data:{text:n}})}}}}),Ut={name:lr,rule:Cs};var _e=require("@typescript-eslint/utils"),As=_e.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),cr="no-non-camel-case-functions",Is=/^(\$?[a-z][a-zA-Z0-9]*)$/;function pr(e){if(e.typeName.type!==_e.AST_NODE_TYPES.TSQualifiedName)return!1;let{left:t,right:r}=e.typeName;return t.type===_e.AST_NODE_TYPES.Identifier&&t.name==="JSX"&&r.name==="Element"}var ws=As({name:cr,meta:{type:"suggestion",docs:{description:"Enforce camelCase naming convention for function declarations"},schema:[],messages:{nonCamelCaseFunction:'Function name "{{functionName}}" should be in camelCase format. If this fn is a React component and can\'t use the `FC` type, add a explicit "JSX.Element" return type to it'}},defaultOptions:[],create(e){return{FunctionDeclaration(t){if(t.id&&!Is.test(t.id.name)){let r=t.returnType?.typeAnnotation;if(r&&(r.type===_e.AST_NODE_TYPES.TSTypeReference?pr(r):r.type===_e.AST_NODE_TYPES.TSUnionType&&r.types.some(s=>s.type===_e.AST_NODE_TYPES.TSTypeReference&&pr(s))))return;e.report({node:t.id,messageId:"nonCamelCaseFunction",data:{functionName:t.id.name}})}}}}}),zt={name:cr,rule:ws};var q=require("@typescript-eslint/utils");var Rs=q.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),ur="no-optional-root-props",Ps=Rs({name:ur,meta:{type:"problem",docs:{description:"Prevents usage of optional properties at the root of a type if that type is a local type alias or interface referenced only once"},messages:{optionalNotAllowed:'Optional property "{{ propertyName }}" is not allowed on a local type used only once. Use `prop: undefined | ...` instead.',suggestion:"Use `prop: undefined | ...` instead."},hasSuggestions:!0,schema:[]},defaultOptions:[],create(e){function t(n){let o=e.sourceCode.getDeclaredVariables(n)[0];if(!o||o.references.length!==1)return!1;let i=o.references[0];if(!i)return!1;for(let p of Nt(i.identifier)){if("returnType"in p||p.type===q.TSESTree.AST_NODE_TYPES.ExportNamedDeclaration)return!1;let a=p.parent;if(!a)return!1;if(a.type===q.TSESTree.AST_NODE_TYPES.TSTypeParameterInstantiation&&a.parent.type===q.TSESTree.AST_NODE_TYPES.TSTypeReference&&a.parent.typeName.type===q.TSESTree.AST_NODE_TYPES.Identifier&&a.parent.typeName.name==="FC"){let g=He(a.parent.parent,q.TSESTree.AST_NODE_TYPES.VariableDeclaration,4);if(!g)return!1;let S=mt(g,e.sourceCode);return S?!(S.parent.type===q.TSESTree.AST_NODE_TYPES.CallExpression&&S.parent.callee.type===q.TSESTree.AST_NODE_TYPES.Identifier&&S.parent.callee.name==="memo"):!1}if(p.type===q.TSESTree.AST_NODE_TYPES.AssignmentPattern)return!1;if(a.type===q.TSESTree.AST_NODE_TYPES.ArrowFunctionExpression){let c=He(a,q.TSESTree.AST_NODE_TYPES.VariableDeclaration);return c?!!mt(c,e.sourceCode):!1}if(a.type===q.TSESTree.AST_NODE_TYPES.FunctionDeclaration)return!!mt(a,e.sourceCode)}return!1}function r(n){n.key.type!==q.TSESTree.AST_NODE_TYPES.Identifier||!n.optional||e.report({node:n.key,messageId:"optionalNotAllowed",data:{propertyName:n.key.name},suggest:[{messageId:"suggestion",fix:s=>{let o=He(n,q.TSESTree.AST_NODE_TYPES.TSPropertySignature);if(!o)return null;let i=e.sourceCode.getText(o);return s.replaceText(o,i.replace("?:",": undefined |"))}}]})}return{TSTypeAliasDeclaration(n){if(n.typeAnnotation.type===q.TSESTree.AST_NODE_TYPES.TSTypeLiteral&&!(yt(n)||!t(n)))for(let s of n.typeAnnotation.members)s.type===q.TSESTree.AST_NODE_TYPES.TSPropertySignature&&r(s)},TSInterfaceDeclaration(n){if(!(yt(n)||!t(n)))for(let s of n.body.body)s.type===q.TSESTree.AST_NODE_TYPES.TSPropertySignature&&r(s)},TSTypeReference(n){if(n.typeName.type!==q.TSESTree.AST_NODE_TYPES.Identifier||n.typeName.name!=="FC"||!n.typeArguments?.params[0])return;let s=n.typeArguments.params[0];if(s.type!==q.TSESTree.AST_NODE_TYPES.TSTypeLiteral)return;let o=He(n.parent,q.TSESTree.AST_NODE_TYPES.VariableDeclaration,4);if(!o)return;let i=mt(o,e.sourceCode);if(!(!i||i.parent.type===q.TSESTree.AST_NODE_TYPES.CallExpression&&i.parent.callee.type===q.TSESTree.AST_NODE_TYPES.Identifier&&i.parent.callee.name==="memo"))for(let a of s.members)a.type===q.TSESTree.AST_NODE_TYPES.TSPropertySignature&&r(a)}}}});function yt(e){return e?e.parent?.type===q.TSESTree.AST_NODE_TYPES.ExportNamedDeclaration||e.parent?.type===q.TSESTree.AST_NODE_TYPES.ExportDefaultDeclaration:!1}function mt(e,t){if(yt(e))return;let r;if(e.type===q.TSESTree.AST_NODE_TYPES.VariableDeclaration){if(e.declarations.length!==1)return;e.declarations[0].id.type===q.TSESTree.AST_NODE_TYPES.Identifier&&(r=e.declarations[0].id)}else{if(!e.id)return;r=e.id}if(!r)return;let n=t.getScope(e);e.type===q.TSESTree.AST_NODE_TYPES.FunctionDeclaration&&n.upper&&(n=n.upper);let s=n.variables.find(i=>i.identifiers.includes(r));if(!s)return;let o=s.references.filter(i=>i.identifier!==r);if(!(o.length!==1||!o[0])&&!yt(o[0].identifier.parent.parent))return o[0].identifier}var Wt={name:ur,rule:Ps};var Qe=require("@typescript-eslint/utils");var et=_({name:"no-reexport",meta:{type:"problem",docs:{description:"Disallow re-exports to prevent indirection"},schema:[],messages:{noReexport:"Re-exports are not allowed. Use direct exports only."}},defaultOptions:[],create(e){let t=new Set;function r(n){return n?n.type===Qe.AST_NODE_TYPES.Identifier?t.has(n.name):n.type===Qe.AST_NODE_TYPES.MemberExpression?r(n.object):!1:!1}return{ImportDeclaration(n){for(let s of n.specifiers)t.add(s.local.name)},ExportNamedDeclaration(n){if(n.source){e.report({node:n,messageId:"noReexport"});return}if(n.declaration?.type===Qe.AST_NODE_TYPES.VariableDeclaration)for(let s of n.declaration.declarations)r(s.init)&&e.report({node:n,messageId:"noReexport"});n.specifiers.length>0&&e.report({node:n,messageId:"noReexport"})},ExportDefaultDeclaration(n){n.declaration.type===Qe.AST_NODE_TYPES.Identifier&&t.has(n.declaration.name)&&e.report({node:n,messageId:"noReexport"})},ExportAllDeclaration(n){e.report({node:n,messageId:"noReexport"})}}}});var fr=require("@typescript-eslint/utils"),dt=xe(require("path")),Ne=require("zod/v4");var vs=fr.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),mr="no-relative-imports",ks=Ne.z.object({find:Ne.z.string(),replacement:Ne.z.string()}),Fs=Ne.z.object({aliases:Ne.z.array(ks),rootDir:Ne.z.string().optional(),allowNotFoundAliases:Ne.z.boolean().optional(),_dev_simulateFileName:Ne.z.string().optional()}),Os=vs({name:mr,meta:{type:"problem",fixable:"code",docs:{description:"Prevent relative imports and auto-fix them using configured aliases"},messages:{noRelativeImports:"Relative imports are not allowed. Use one of the valid aliases in tsconfig.json instead.",noRelativeImportsWithAlias:'Relative imports are not allowed. Use the "{{ alias }}" alias instead.'},schema:[$(Fs)]},defaultOptions:[{aliases:[],rootDir:void 0}],create(e,[t]){let r=t._dev_simulateFileName??e.filename;function n(i){return i.startsWith(".")||i.startsWith("..")}function s(i,p){let a=dt.default.dirname(p);return dt.default.resolve(a,i)}function o(i){let p=t.rootDir??process.cwd(),a=dt.default.relative(p,i);if(a.startsWith("."))return null;a.startsWith("/")||(a=`/${a}`);for(let{find:c,replacement:g}of t.aliases)if(a.startsWith(g)){let S=a.replace(g,c);return{alias:c,newPath:S}}return null}return{ImportDeclaration(i){let p=i.source.value;if(!n(p))return;let a=s(p,r),c=o(a);!c&&t.allowNotFoundAliases||e.report({node:i,messageId:c?"noRelativeImportsWithAlias":"noRelativeImports",data:{alias:c?.alias},fix:c?g=>g.replaceText(i.source,`'${c.newPath}'`):void 0})}}}}),Jt={name:mr,rule:Os};var ie=require("@typescript-eslint/utils"),Vt=require("zod/v4");var Ns=Vt.z.object({customMessage:Vt.z.string().optional()}),Xt=_({name:"no-static-style-prop",meta:{type:"problem",docs:{description:"Prevent using static style props in JSX, only dynamic values should be allowed"},schema:[$(Ns)],messages:{noStaticStyleProp:"Static style props are not allowed use css instead.{{customMessage}}"}},defaultOptions:[{}],create(e,[t]){function r(n){switch(n.type){case ie.AST_NODE_TYPES.Literal:return!0;case ie.AST_NODE_TYPES.ObjectExpression:return n.properties.every(s=>s.type===ie.AST_NODE_TYPES.Property?s.computed||s.value.type===ie.AST_NODE_TYPES.Identifier&&s.key.type===ie.AST_NODE_TYPES.Identifier&&s.key.name===s.value.name?!1:r(s.value):!1);case ie.AST_NODE_TYPES.ArrayExpression:return n.elements.every(s=>s?s.type===ie.AST_NODE_TYPES.SpreadElement?!1:r(s):!0);case ie.AST_NODE_TYPES.TemplateLiteral:return n.expressions.length===0;case ie.AST_NODE_TYPES.ConditionalExpression:case ie.AST_NODE_TYPES.LogicalExpression:case ie.AST_NODE_TYPES.BinaryExpression:case ie.AST_NODE_TYPES.UnaryExpression:case ie.AST_NODE_TYPES.CallExpression:case ie.AST_NODE_TYPES.MemberExpression:case ie.AST_NODE_TYPES.Identifier:case ie.AST_NODE_TYPES.ArrowFunctionExpression:case ie.AST_NODE_TYPES.FunctionExpression:return!1;default:return!1}}return{JSXAttribute(n){if(n.name.type===ie.AST_NODE_TYPES.JSXIdentifier&&n.name.name==="style"&&n.value){let s=null;n.value.type===ie.AST_NODE_TYPES.JSXExpressionContainer?n.value.expression.type!==ie.AST_NODE_TYPES.JSXEmptyExpression&&(s=n.value.expression):n.value.type===ie.AST_NODE_TYPES.Literal&&(s=n.value),s&&r(s)&&e.report({node:n,messageId:"noStaticStyleProp",data:{customMessage:t.customMessage?` ${t.customMessage}`:""}})}}}}});var tt=require("@typescript-eslint/utils"),Je=xe(require("zod/v4"));var Ds=Je.object({alternativeMsgs:Je.object({inArrayFind:Je.string().optional(),inArrayFilter:Je.string().optional()}).optional(),__dev_simulateFileName:Je.string().optional()});function js(e){return e.typeAnnotation.type!==tt.AST_NODE_TYPES.TSTypePredicate?!1:e.typeAnnotation.asserts===!1}var Ls=/(typeGuards|type-guards)\.(ts|tsx)$/;function Ms(e){return Ls.test(e)}function $s(e){let t=e.parent;for(;t;){if(t.type===tt.AST_NODE_TYPES.CallExpression&&t.callee.type===tt.AST_NODE_TYPES.MemberExpression&&t.callee.property.type===tt.AST_NODE_TYPES.Identifier){let r=t.callee.property.name;if(r==="filter"||r==="find")return{method:r}}t=t.parent}return null}var Ht=_({name:"no-type-guards",meta:{type:"problem",docs:{description:"Disallow type guards unless in *.typeGuards.(ts|tsx) or *.type-guards.(ts|tsx) files"},messages:{typeGuardNotAllowed:"Check if the type guard can be inferred by typescript, in most cases it can, e.g. `.filter((nullable) => nullable !== null)`. If not, type guards are only allowed in *.typeGuards.(ts|tsx) or *.type-guards.(ts|tsx) files",useFilterWithTypeCheck:"{{message}}",useFindWithTypeCheck:"{{message}}"},schema:[$(Ds)],hasSuggestions:!0},defaultOptions:[{}],create(e,[t]){let r=t.__dev_simulateFileName??e.filename;if(Ms(r))return{};function n(s){if(!js(s))return;let o=$s(s);if(t.alternativeMsgs&&o){let i=o.method==="filter"?t.alternativeMsgs.inArrayFilter:t.alternativeMsgs.inArrayFind;if(i){let p=o.method==="filter"?"useFilterWithTypeCheck":"useFindWithTypeCheck";e.report({node:s,messageId:p,data:{message:i}});return}}e.report({node:s,messageId:"typeGuardNotAllowed"})}return{"FunctionDeclaration > :matches(TSTypeAnnotation)":n,"ArrowFunctionExpression > :matches(TSTypeAnnotation)":n,"MethodDefinition > FunctionExpression > :matches(TSTypeAnnotation)":n}}});var Ve=require("@typescript-eslint/utils");var _s="no-unnecessary-async-on-jsx-props";function Us(e){if(e.body.type!==Ve.AST_NODE_TYPES.BlockStatement)return!1;let t=e.body.body;if(t.length!==1)return!1;let r=t[0];return!r||r.type!==Ve.AST_NODE_TYPES.ExpressionStatement?!1:r.expression.type===Ve.AST_NODE_TYPES.AwaitExpression}var Bt=_({name:_s,meta:{type:"suggestion",fixable:"code",docs:{description:"Disallow unnecessary async/await in JSX props where a single await provides no benefit"},messages:{unnecessaryAsyncInJsxProp:"Unnecessary async/await in JSX prop. The single await expression provides no benefit here."},schema:[]},defaultOptions:[],create(e){function t(r){Us(r)&&e.report({node:r,messageId:"unnecessaryAsyncInJsxProp",fix(n){let s=e.sourceCode,o=[],i=s.getFirstToken(r,a=>a.value==="async");if(i){let a=s.getTokenAfter(i);a?o.push(n.replaceTextRange([i.range[0],a.range[0]],"")):o.push(n.remove(i))}function p(a){if(a.type===Ve.AST_NODE_TYPES.AwaitExpression){let c=s.getFirstToken(a);if(c&&c.value==="await"){let g=s.getTokenAfter(c);g?o.push(n.replaceTextRange([c.range[0],g.range[0]],"")):o.push(n.remove(c))}}if(a.type===Ve.AST_NODE_TYPES.BlockStatement)for(let c of a.body)p(c);else a.type===Ve.AST_NODE_TYPES.ExpressionStatement&&p(a.expression)}return p(r.body),o}})}return{"JSXAttribute ArrowFunctionExpression[async=true]":t,"JSXAttribute FunctionExpression[async=true]":t}}});var De=require("@typescript-eslint/utils"),Yt=xe(require("typescript")),Ye=xe(require("zod/v4"));var zs=De.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),yr="no-unnecessary-casting",Ws=Ye.default.object({additionalCastFunctions:Ye.default.array(Ye.default.object({name:Ye.default.string(),expectedType:Ye.default.enum(["string","number"])})).optional()}),qt={name:yr,rule:zs({name:yr,meta:{type:"suggestion",docs:{description:"Prevents unnecessary Number and String castings"},messages:{unnecessaryNumberCasting:"Unnecessary Number() casting on a value already of number type",unnecessaryStringCasting:"Unnecessary String() casting on a value already of string type",unnecessaryCustomCasting:"Unnecessary {{name}}() casting on a value already of {{type}} type"},schema:[$(Ws)],fixable:"code"},defaultOptions:[{}],create(e){let r=e.options[0].additionalCastFunctions||[],n=[{name:"Number",expectedType:"number"},{name:"String",expectedType:"string"},...r],s=De.ESLintUtils.getParserServices(e,!0),o=s.program?.getTypeChecker();if(!o||!s.program)throw new Error("TypeScript services or program not available");function i(g,S){switch(g.type){case De.AST_NODE_TYPES.Literal:return S==="number"?typeof g.value=="number":typeof g.value=="string";case De.AST_NODE_TYPES.TemplateLiteral:return S==="string";case De.AST_NODE_TYPES.UnaryExpression:return S==="number"?g.operator==="+"||g.operator==="-"||g.operator==="~":!1;default:return!1}}function p(g,S){return S==="number"?!!(g.flags&Yt.TypeFlags.NumberLike):!!(g.flags&Yt.TypeFlags.StringLike)}function a(g,S){return l=>l.replaceText(g,e.sourceCode.getText(S))}function c(g){if(!o||g.arguments.length!==1)return;let S=g.arguments[0];if(!S||S.type===De.AST_NODE_TYPES.SpreadElement)return;let{callee:l}=g;if(l.type!==De.AST_NODE_TYPES.Identifier)return;let E=l.name,f=n.find(T=>T.name===E);if(!f)return;if(i(S,f.expectedType)||p(o.getTypeAtLocation(s.esTreeNodeToTSNodeMap.get(S)),f.expectedType)){let T,m;E==="Number"?T="unnecessaryNumberCasting":E==="String"?T="unnecessaryStringCasting":(T="unnecessaryCustomCasting",m={name:f.name,type:f.expectedType}),e.report({node:g,messageId:T,...m?{data:m}:{},fix:a(g,S)})}}return{CallExpression:c}}})};var ge=require("@typescript-eslint/utils"),gt=xe(require("zod/v4"));var Js=gt.object({ignoreWithDescription:gt.string().optional()}),Zt=_({name:"no-unnecessary-describe",meta:{type:"suggestion",docs:{description:"Disallow unnecessary describe blocks that wrap all tests in a file"},messages:{unnecessaryDescribe:"Describe blocks that solely wrap all tests in the file are unnecessary, they just add unnecessary nesting to the code. The file itself should be enough to group tests. Remove it.",removeDescribe:"Remove the describe block"},hasSuggestions:!0,schema:[$(Js)]},defaultOptions:[{}],create(e,[t]){let r=e.getSourceCode(),n=r.ast;function s(a){let c=a.arguments[0];return c&&c.type===ge.AST_NODE_TYPES.Literal&&typeof c.value=="string"?c.value:null}function o(a){return!a||!t.ignoreWithDescription?!1:new RegExp(t.ignoreWithDescription).test(a)}function i(a){return a.length!==1?!1:n.body.filter(g=>{if(g.type===ge.AST_NODE_TYPES.ExpressionStatement){let S=g.expression;if(S.type===ge.AST_NODE_TYPES.CallExpression&&S.callee.type===ge.AST_NODE_TYPES.Identifier){let l=S.callee.name;return["test","it","beforeEach","afterEach","beforeAll","afterAll"].includes(l)}}return!1}).length===0}function p(a){let c=a.arguments[1];if(c&&(c.type===ge.AST_NODE_TYPES.FunctionExpression||c.type===ge.AST_NODE_TYPES.ArrowFunctionExpression)&&c.body.type===ge.AST_NODE_TYPES.BlockStatement){let g=c.body.body;return g.length===0?"":g.map(l=>r.text.slice(l.range[0],l.range[1])).join(`
15
+ Learn more about data fetching with Hooks: https://reactjs.org/link/hooks-data-fetching`});let T=a.acquire(f),A=new Set,R=null;{let w=T.upper;for(;w&&(A.add(w),w.type!=="function");)w=w.upper;if(!w)return;R=w}let P=Array.isArray;function L(w){if(!P(w.defs))return!1;let v=w.defs[0];if(v==null||v.node.type!=="VariableDeclarator")return!1;let j=v.node.init;if(j==null)return!1;for(;j.type==="TSAsExpression";)j=j.expression;let _=v.node.parent;if(_==null&&(Lt(R.block,v.node.id),_=v.node.parent,_==null))return!1;if(_.kind==="const"&&j.type==="Literal"&&(typeof j.value=="string"||typeof j.value=="number"||j.value===null))return!0;if(j.type!=="CallExpression")return!1;let J=j.callee;if(J.type==="MemberExpression"&&J.object.name==="React"&&J.property!=null&&!J.computed&&(J=J.property),J.type!=="Identifier")return!1;let U=v.node.id,{name:Y}=J;if(Y==="useRef"&&U.type==="Identifier")return!0;if(wi(J)&&U.type==="Identifier"){for(let q of w.references)q!==U&&h.add(q.identifier);return!0}else if(Y==="useState"||Y==="useReducer"){if(U.type==="ArrayPattern"&&U.elements.length===2&&P(w.identifiers)){if(U.elements[1]===w.identifiers[0]){if(Y==="useState"){let q=w.references,Pe=0;for(let $e=0;$e<q.length;$e++){if(q[$e].isWrite()&&Pe++,Pe>1)return!1;c.set(q[$e].identifier,U.elements[0])}}return!0}else if(U.elements[0]===w.identifiers[0]){if(Y==="useState"){let q=w.references;for(let Pe=0;Pe<q.length;Pe++)d.add(q[Pe].identifier)}return!1}}}else if(Y==="useTransition"&&U.type==="ArrayPattern"&&U.elements.length===2&&Array.isArray(w.identifiers)&&U.elements[1]===w.identifiers[0])return!0;return!1}function C(w){if(!P(w.defs))return!1;let v=w.defs[0];if(v==null||v.node==null||v.node.id==null)return!1;let j=v.node,_=R.childScopes,J=null,U;for(U=0;U<_.length;U++){let Y=_[U],q=Y.block;if(j.type==="FunctionDeclaration"&&q===j||j.type==="VariableDeclarator"&&q.parent===j){J=Y;break}}if(J==null)return!1;for(U=0;U<J.through.length;U++){let Y=J.through[U];if(Y.resolved!=null&&A.has(Y.resolved.scope)&&!I(Y.resolved))return!1}return!0}let I=u(L,y),F=u(C,l),N=new Map;function te(w){let v=w.from,j=!1;for(;v.block!==f;)v.type==="function"&&(j=v.block.parent!=null&&v.block.parent.type==="ReturnStatement"),v=v.upper;return j}let z=new Map,ie=new Map;M(T);function M(w){for(let v of w.references){if(!v.resolved||!A.has(v.resolved.scope))continue;let j=Lt(f,v.identifier),_=Zn(j),J=_e(_,ie);if(b&&_.type==="Identifier"&&(_.parent.type==="MemberExpression"||_.parent.type==="OptionalMemberExpression")&&!_.parent.computed&&_.parent.property.type==="Identifier"&&_.parent.property.name==="current"&&te(v)&&N.set(J,{reference:v,dependencyNode:_}),_.parent.type==="TSTypeQuery"||_.parent.type==="TSTypeReference")continue;let U=v.resolved.defs[0];if(U!=null&&!(U.node!=null&&U.node.init===f.parent)&&U.type!=="TypeParameter")if(z.has(J))z.get(J).references.push(v);else{let Y=v.resolved,q=I(Y)||F(Y);z.set(J,{isStable:q,references:[v]})}}for(let v of w.childScopes)M(v)}N.forEach(({reference:w,dependencyNode:v},j)=>{let _=w.resolved.references,J=!1;for(let U=0;U<_.length;U++){let{identifier:Y}=_[U],{parent:q}=Y;if(q!=null&&q.type==="MemberExpression"&&!q.computed&&q.property.type==="Identifier"&&q.property.name==="current"&&q.parent.type==="AssignmentExpression"&&q.parent.left===q){J=!0;break}}J||p({node:v.parent.property,message:`The ref value '${j}.current' will likely have changed by the time this effect cleanup function runs. If this ref points to a node rendered by React, copy '${j}.current' to a variable inside the effect, and use that variable in the cleanup function.`})});let W=new Set;function X(w,v){W.has(v)||(W.add(v),p({node:w,message:`Assignments to the '${v}' variable from inside React Hook ${r(x)} will be lost after each render. To preserve the value over time, store it in a useRef Hook and keep the mutable value in the '.current' property. Otherwise, you can move this variable directly inside ${r(x)}.`}))}let ne=new Set;if(z.forEach(({isStable:w,references:v},j)=>{w&&ne.add(j),v.forEach(_=>{_.writeExpr&&X(_.writeExpr,j)})}),W.size>0)return;if(!E){let w=null;if(z.forEach(({isStable:v,references:j},_)=>{w||j.forEach(J=>{if(w)return;let U=J.identifier;if(!c.has(U))return;let q=J.from;for(;q.type!=="function";)q=q.upper;q.block===f&&(w=_)})}),w){let{suggestedDependencies:v}=Dt({dependencies:z,declaredDependencies:[],stableDependencies:ne,externalDependencies:new Set,isEffect:!0});p({node:x,message:`React Hook ${m} contains a call to '${w}'. Without a list of dependencies, this can lead to an infinite chain of updates. To fix this, pass [`+v.join(", ")+`] as a second argument to the ${m} Hook.`,suggest:[{desc:`Add dependencies array: [${v.join(", ")}]`,fix(j){return j.insertTextAfter(f,`, [${v.join(", ")}]`)}}]})}return}let le=[],Ce=new Set;E.type!=="ArrayExpression"?p({node:E,message:`React Hook ${r(x)} was passed a dependency list that is not an array literal. This means we can't statically verify whether you've passed the correct dependencies.`}):E.elements.forEach(w=>{if(w===null)return;if(w.type==="SpreadElement"){p({node:w,message:`React Hook ${r(x)} has a spread element in its dependency array. This means we can't statically verify whether you've passed the correct dependencies.`});return}h.has(w)&&p({node:w,message:`Functions returned from \`useEffectEvent\` must not be included in the dependency array. Remove \`${r(w)}\` from the list.`,suggest:[{desc:`Remove the dependency \`${r(w)}\``,fix(J){return J.removeRange(w.range)}}]});let v;try{v=_e(w,ie)}catch(J){if(/Unsupported node type/.test(J.message)){w.type==="Literal"?z.has(w.value)?p({node:w,message:`The ${w.raw} literal is not a valid dependency because it never changes. Did you mean to include ${w.value} in the array instead?`}):p({node:w,message:`The ${w.raw} literal is not a valid dependency because it never changes. You can safely remove it.`}):p({node:w,message:`React Hook ${r(x)} has a complex expression in the dependency array. Extract it to a separate variable so it can be statically checked.`});return}else throw J}let j=w;for(;j.type==="MemberExpression"||j.type==="OptionalMemberExpression"||j.type==="ChainExpression";)j=j.object||j.expression.object;let _=!R.through.some(J=>J.identifier===j);le.push({key:v,node:w}),_||Ce.add(v)});let{suggestedDependencies:Ie,unnecessaryDependencies:Ae,missingDependencies:Se,duplicateDependencies:ut}=Dt({dependencies:z,declaredDependencies:le,stableDependencies:ne,externalDependencies:Ce,isEffect:b}),rt=Ie;if(ut.size+Se.size+Ae.size===0){if(t)return;xi({declaredDependencies:le,declaredDependenciesNode:E,componentScope:R,scope:T}).forEach(({construction:v,isUsedOutsideOfHook:j,depType:_})=>{let J=_==="function"?"useCallback":"useMemo",U=_==="function"?"definition":"initialization",Y=`wrap the ${U} of '${v.name.name}' in its own ${J}() Hook.`,q=j?`To fix this, ${Y}`:`Move it inside the ${m} callback. Alternatively, ${Y}`,Pe=_==="conditional"||_==="logical expression"?"could make":"makes",$e=`The '${v.name.name}' ${_} ${Pe} the dependencies of ${m} Hook (at line ${E.loc.start.line}) change on every render. ${q}`,_n;j&&v.type==="Variable"&&_==="function"&&(_n=[{desc:`Wrap the ${U} of '${v.name.name}' in its own ${J}() Hook.`,fix(Un){let[oi,si]=J==="useMemo"?["useMemo(() => { return ","; })"]:["useCallback(",")"];return[Un.insertTextBefore(v.node.init,oi),Un.insertTextAfter(v.node.init,si)]}}]),p({node:v.node,message:$e,suggest:_n})});return}!b&&Se.size>0&&(rt=Dt({dependencies:z,declaredDependencies:[],stableDependencies:ne,externalDependencies:Ce,isEffect:b}).suggestedDependencies);function Re(){if(le.length===0)return!0;let w=le.map(j=>j.key),v=w.slice().sort();return w.join(",")===v.join(",")}Re()&&rt.sort();function vt(w){let v=w.split("."),j="";for(let _=0;_<v.length;_++){if(_!==0){let J=v.slice(0,_+1).join("."),U=ie.get(J)===!0;j+=U?"?.":"."}j+=v[_]}return j}function Ft(w,v,j,_){return w.size===0?null:(w.size>1?"":v+" ")+j+" "+(w.size>1?"dependencies":"dependency")+": "+Ii(Array.from(w).sort().map(J=>"'"+vt(J)+"'"))+`. Either ${_} ${w.size>1?"them":"it"} or remove the dependency array.`}let Fe="";if(Ae.size>0){let w=null;if(Array.from(Ae.keys()).forEach(v=>{w===null&&v.endsWith(".current")&&(w=v)}),w!==null)Fe=` Mutable values like '${w}' aren't valid dependencies because mutating them doesn't re-render the component.`;else if(Ce.size>0){let v=Array.from(Ce)[0];T.set.has(v)||(Fe=` Outer scope values like '${v}' aren't valid dependencies because mutating them doesn't re-render the component.`)}}if(!Fe&&Se.has("props")){let w=z.get("props");if(w==null)return;let v=w.references;if(!Array.isArray(v))return;let j=!0;for(let _=0;_<v.length;_++){let J=v[_],U=Lt(R.block,J.identifier);if(!U){j=!1;break}let Y=U.parent;if(Y==null){j=!1;break}if(Y.type!=="MemberExpression"&&Y.type!=="OptionalMemberExpression"){j=!1;break}}j&&(Fe=` However, 'props' will change when *any* prop changes, so the preferred fix is to destructure the 'props' object outside of the ${m} call and refer to those specific props inside ${r(x)}.`)}if(!Fe&&Se.size>0){let w=null;Se.forEach(v=>{if(w)return;let j=R.set.get(v),_=z.get(v);if(_.references[0].resolved!==j)return;let J=j.defs[0];if(J==null||J.name==null||J.type!=="Parameter")return;let U=!1,Y;for(let q=0;q<_.references.length;q++)if(Y=_.references[q].identifier,Y!=null&&Y.parent!=null&&(Y.parent.type==="CallExpression"||Y.parent.type==="OptionalCallExpression")&&Y.parent.callee===Y){U=!0;break}U&&(w=v)}),w!==null&&(Fe=` If '${w}' changes too often, find the parent component that defines it and wrap that definition in useCallback.`)}if(!Fe&&Se.size>0){let w=null;if(Se.forEach(v=>{if(w!==null)return;let _=z.get(v).references,J,U;for(let Y=0;Y<_.length;Y++){for(J=_[Y].identifier,U=J.parent;U!=null&&U!==R.block;){if(U.type==="CallExpression"){let q=c.get(U.callee);if(q!=null){if(q.name===v)w={missingDep:v,setter:U.callee.name,form:"updater"};else if(d.has(J))w={missingDep:v,setter:U.callee.name,form:"reducer"};else{let Pe=_[Y].resolved;if(Pe!=null){let $e=Pe.defs[0];$e!=null&&$e.type==="Parameter"&&(w={missingDep:v,setter:U.callee.name,form:"inlineReducer"})}}break}}U=U.parent}if(w!==null)break}}),w!==null)switch(w.form){case"reducer":Fe=` You can also replace multiple useState variables with useReducer if '${w.setter}' needs the current value of '${w.missingDep}'.`;break;case"inlineReducer":Fe=` If '${w.setter}' needs the current value of '${w.missingDep}', you can also switch to useReducer instead of useState and read '${w.missingDep}' in the reducer.`;break;case"updater":Fe=` You can also do a functional update '${w.setter}(${w.missingDep.slice(0,1)} => ...)' if you only need '${w.missingDep}' in the '${w.setter}' call.`;break;default:throw new Error("Unknown case.")}}p({node:E,message:`React Hook ${r(x)} has `+(Ft(Se,"a","missing","include")||Ft(Ae,"an","unnecessary","exclude")||Ft(ut,"a","duplicate","omit"))+Fe,suggest:[{desc:`Update the dependencies array to be: [${rt.map(vt).join(", ")}]`,fix(w){return w.replaceText(E,`[${rt.map(vt).join(", ")}]`)}}]})}function g(f){let E=Ci(f.callee,i);if(E===-1)return;let x=f.arguments[E],m=f.callee,b=Gn(m).name,T=f.arguments[E+1],A=/Effect($|[^a-z])/g.test(b);if(!x){p({node:m,message:`React Hook ${b} requires an effect callback. Did you forget to pass a callback to the hook?`});return}if(!(t&&!A)){if(!T&&!A){(b==="useMemo"||b==="useCallback")&&p({node:m,message:`React Hook ${b} does nothing when called with only one argument. Did you forget to pass an array of dependencies?`});return}switch(x.type){case"FunctionExpression":case"ArrowFunctionExpression":S(x,T,m,b,A);return;case"Identifier":if(!T||T.elements&&T.elements.some(L=>L&&L.type==="Identifier"&&L.name===x.name))return;let R=n(f).set.get(x.name);if(R==null||R.defs==null)return;let P=R.defs[0];if(!P||!P.node||P.type!=="Variable"&&P.type!=="FunctionName")break;switch(P.node.type){case"FunctionDeclaration":S(P.node,T,m,b,A);return;case"VariableDeclarator":let L=P.node.init;if(!L)break;switch(L.type){case"ArrowFunctionExpression":case"FunctionExpression":S(L,T,m,b,A);return}break}break;default:p({node:m,message:`React Hook ${b} received a function whose dependencies are unknown. Pass an inline function instead.`});return}p({node:m,message:`React Hook ${b} has a missing dependency: '${x.name}'. Either include it or remove the dependency array.`,suggest:[{desc:`Update the dependencies array to be: [${x.name}]`,fix(R){return R.replaceText(T,`[${x.name}]`)}}]})}}if(e.options[0]?.ignoreIfReactCompilerIsEnabled){for(let f of e.sourceCode.getAllComments())if(bi.test(f.value))return t=!0,{CallExpression:E=>g(E,!0)}}return{CallExpression:f=>g(f)}}};function Dt({dependencies:e,declaredDependencies:t,stableDependencies:r,externalDependencies:n,isEffect:o}){let s=i();function i(){return{isUsed:!1,isSatisfiedRecursively:!1,isSubtreeUsed:!1,children:new Map}}e.forEach((S,g)=>{let f=p(s,g);f.isUsed=!0,a(s,g,E=>{E.isSubtreeUsed=!0})}),t.forEach(({key:S})=>{let g=p(s,S);g.isSatisfiedRecursively=!0}),r.forEach(S=>{let g=p(s,S);g.isSatisfiedRecursively=!0});function p(S,g){let f=g.split("."),E=S;for(let x of f){let m=E.children.get(x);m||(m=i(),E.children.set(x,m)),E=m}return E}function a(S,g,f){let E=g.split("."),x=S;for(let m of E){let b=x.children.get(m);if(!b)return;f(b),x=b}}let c=new Set,d=new Set;y(s,c,d,S=>S);function y(S,g,f,E){S.children.forEach((x,m)=>{let b=E(m);if(x.isSatisfiedRecursively){x.isSubtreeUsed&&f.add(b);return}if(x.isUsed){g.add(b);return}y(x,g,f,T=>b+"."+T)})}let l=[],h=new Set,u=new Set;return t.forEach(({key:S})=>{d.has(S)?l.indexOf(S)===-1?l.push(S):u.add(S):h.add(S)}),c.forEach(S=>{l.push(S)}),{suggestedDependencies:l,unnecessaryDependencies:h,duplicateDependencies:u,missingDependencies:c}}function Ve(e){switch(e.type){case"ObjectExpression":return"object";case"ArrayExpression":return"array";case"ArrowFunctionExpression":case"FunctionExpression":return"function";case"ClassExpression":return"class";case"ConditionalExpression":return Ve(e.consequent)!=null||Ve(e.alternate)!=null?"conditional":null;case"LogicalExpression":return Ve(e.left)!=null||Ve(e.right)!=null?"logical expression":null;case"JSXFragment":return"JSX fragment";case"JSXElement":return"JSX element";case"AssignmentExpression":return Ve(e.right)!=null?"assignment expression":null;case"NewExpression":return"object construction";case"Literal":return e.value instanceof RegExp?"regular expression":null;case"TypeCastExpression":return Ve(e.expression);case"TSAsExpression":return Ve(e.expression)}return null}function xi({declaredDependencies:e,declaredDependenciesNode:t,componentScope:r,scope:n}){let o=e.map(({key:i})=>{let p=r.variables.find(c=>c.name===i);if(p==null)return null;let a=p.defs[0];if(a==null)return null;if(a.type==="Variable"&&a.node.type==="VariableDeclarator"&&a.node.id.type==="Identifier"&&a.node.init!=null){let c=Ve(a.node.init);if(c!=null)return[p,c]}return a.type==="FunctionName"&&a.node.type==="FunctionDeclaration"?[p,"function"]:a.type==="ClassName"&&a.node.type==="ClassDeclaration"?[p,"class"]:null}).filter(Boolean);function s(i){let p=!1;for(let a=0;a<i.references.length;a++){let c=i.references[a];if(c.writeExpr){if(p)return!0;p=!0;continue}let d=c.from;for(;d!==n&&d!=null;)d=d.upper;if(d!==n&&!Kn(t,c.identifier))return!0}return!1}return o.map(([i,p])=>({construction:i.defs[0],depType:p,isUsedOutsideOfHook:s(i)}))}function Zn(e){return(e.parent.type==="MemberExpression"||e.parent.type==="OptionalMemberExpression")&&e.parent.object===e&&e.parent.property.name!=="current"&&!e.parent.computed&&!(e.parent.parent!=null&&(e.parent.parent.type==="CallExpression"||e.parent.parent.type==="OptionalCallExpression")&&e.parent.parent.callee===e.parent)?Zn(e.parent):e.type==="MemberExpression"&&e.parent&&e.parent.type==="AssignmentExpression"&&e.parent.left===e?e.object:e}function jt(e,t,r){t&&(e.optional?t.has(r)||t.set(r,!0):t.has(r)||t.set(r,!1))}function _e(e,t){if(e.type==="Identifier"||e.type==="JSXIdentifier"){let r=e.name;return t&&t.set(r,!1),r}else if(e.type==="MemberExpression"&&!e.computed){let r=_e(e.object,t),n=_e(e.property,null),o=`${r}.${n}`;return jt(e,t,o),o}else if(e.type==="OptionalMemberExpression"&&!e.computed){let r=_e(e.object,t),n=_e(e.property,null),o=`${r}.${n}`;return jt(e,t,o),o}else if(e.type==="ChainExpression"&&!e.computed){let r=e.expression;if(r.type==="CallExpression")throw new Error(`Unsupported node type: ${r.type}`);let n=_e(r.object,t),o=_e(r.property,null),s=`${n}.${o}`;return jt(r,t,s),s}else throw new Error(`Unsupported node type: ${e.type}`)}function Gn(e,t){return e.type==="MemberExpression"&&e.object.type==="Identifier"&&e.object.name==="React"&&e.property.type==="Identifier"&&!e.computed?e.property:e}function Ci(e,t){let r=Gn(e);if(r.type!=="Identifier")return-1;switch(r.name){case"useEffect":case"useLayoutEffect":case"useCallback":case"useMemo":return 0;case"useImperativeHandle":return 1;default:if(r===e&&t&&t.additionalHooks){let n;try{n=_e(r,null)}catch(o){if(/Unsupported node type/.test(o.message))return 0;throw o}return t.additionalHooks.test(n)?0:-1}else return-1}}function Lt(e,t){let r=[e],n=null;for(;r.length;){if(n=r.shift(),Ai(n,t))return n;if(Kn(n,t))for(let[o,s]of Object.entries(n))o!=="parent"&&(Yn(s)?(s.parent=n,r.push(s)):Array.isArray(s)&&s.forEach(i=>{Yn(i)&&(i.parent=n,r.push(i))}))}return null}function Ii(e){let t="";for(let r=0;r<e.length;r++)t+=e[r],r===0&&e.length===2?t+=" and ":r===e.length-2&&e.length>2?t+=", and ":r<e.length-1&&(t+=", ");return t}function Yn(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&typeof e.type=="string"}function Ai(e,t){return(e.type==="Identifier"||e.type==="JSXIdentifier")&&e.type===t.type&&e.name===t.name&&e.range[0]===t.range[0]&&e.range[1]===t.range[1]}function Kn(e,t){return e.range[0]<=t.range[0]&&e.range[1]>=t.range[1]}function wi(e){return!1}var pe=require("@typescript-eslint/utils"),me=ke(require("typescript")),nr=require("zod/v4");var Mt=require("@typescript-eslint/utils");function Ge(e,t,r=1/0){if(r!==0&&e.parent)return e.type===t?e:Ge(e.parent,t,r===1/0?r:r-1)}function*$t(e){yield e,e.parent&&(yield*$t(e.parent))}function _t(e,t){for(let r of e){let n=t(r);if(n!=null&&n!==!1)return n}}function er(e,t,r){let o=r.getDeclaredVariables(e).find(s=>s.name===t||s.identifiers[0]?.parent.type===Mt.AST_NODE_TYPES.Property&&s.identifiers[0].parent.key.type===Mt.AST_NODE_TYPES.Identifier&&s.identifiers[0].parent.key.name===t);return o?o.references.filter(s=>!s.init):[]}function Qn(e){return e===null||typeof e!="object"||!("type"in e)?!1:typeof e.type=="string"}function Ri(e,t){return e[t]}function Oe(e,t,r){let n=r.visitorKeys,o=new Set;function s(i){if(o.has(i))return!1;if(o.add(i),t(i)===!0)return!0;let a=n[i.type];if(a)for(let c of a){let d=Ri(i,c);if(d){if(Array.isArray(d)){for(let y of d)if(Qn(y)&&s(y))return!0}else if(Qn(d)&&s(d))return!0}}return!1}s(e)}var Pi=pe.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),tr="improved-no-unnecessary-condition",vi=nr.z.object({}),Fi=["string","number","bigint","boolean","symbol","undefined","object","function","never"],ki=new Set(Fi),Ut={name:tr,rule:Pi({name:tr,meta:{type:"suggestion",docs:{description:"Extends checks of `no-unnecessary-condition` rule"},messages:{unnecessaryTypeofCondition:'This condition is unnecessary. The type of "{{name}}" is always "{{type}}".',alwaysFalseTypeofCondition:'This condition will always be false. The type of "{{name}}" is "{{actualType}}" so the condition has no overlap with "{{conditionType}}".',unnecessaryStartsWithCondition:"This startsWith check is unnecessary as it always evaluates to true.",alwaysFalseStartsWithCondition:"This startsWith check will always be false.",unnecessaryEndsWithCondition:"This endsWith check is unnecessary as it always evaluates to true.",alwaysFalseEndsWithCondition:"This endsWith check will always be false.",unnecessaryIncludesCondition:"This includes check is unnecessary as it always evaluates to true.",alwaysFalseIncludesCondition:"This includes check will always be false.",unnecessaryLengthCondition:"This length comparison is unnecessary as it always evaluates to true.",alwaysFalseLengthCondition:"This length comparison will always be false."},schema:[V(vi)]},defaultOptions:[{}],create(e){let t=pe.ESLintUtils.getParserServices(e,!0),r=t.program?.getTypeChecker();if(!r||!t.program)throw new Error("TypeScript services or program not available");function n(l){return l.type===pe.AST_NODE_TYPES.UnaryExpression&&l.operator==="typeof"}function o(l){return l.flags&me.default.TypeFlags.Any||l.flags&me.default.TypeFlags.Unknown?null:l.flags&me.default.TypeFlags.StringLike?["string"]:l.flags&me.default.TypeFlags.NumberLike?["number"]:l.flags&me.default.TypeFlags.BigIntLike?["bigint"]:l.flags&me.default.TypeFlags.BooleanLike?["boolean"]:l.flags&me.default.TypeFlags.ESSymbolLike?["symbol"]:l.flags&me.default.TypeFlags.Undefined||l.flags&me.default.TypeFlags.Void?["undefined"]:l.flags&me.default.TypeFlags.Null?["object"]:l.getCallSignatures().length>0?["function"]:l.flags&me.default.TypeFlags.Object?l.getProperties().length===0?["string","number","bigint","boolean","symbol","object","function"]:["object"]:l.flags&me.default.TypeFlags.NonPrimitive?["object"]:l.flags&me.default.TypeFlags.Never?["never"]:null}function s(l){if(!r)return null;let h=t.esTreeNodeToTSNodeMap.get(l),u=r.getTypeAtLocation(h.expression);if(u.flags&me.default.TypeFlags.Any||u.flags&me.default.TypeFlags.Unknown)return null;let S=[];if(u.isUnion()){for(let f of u.types){let E=o(f);if(E)S.push(...E);else return null}return S}let g=o(u);return g?(S.push(...g),S):null}function i(l){if(!(l.operator==="==="||l.operator==="!=="))return;let u=null,S=null;if(n(l.left)?(u=l.left,S=l.right.type===pe.AST_NODE_TYPES.Literal&&typeof l.right.value=="string"?l.right.value:null):n(l.right)&&(u=l.right,S=l.left.type===pe.AST_NODE_TYPES.Literal&&typeof l.left.value=="string"?l.left.value:null),!u||!S||!Oi(S,ki))return;let g=s(u);if(!g)return;let f=l.operator==="!==",E=g.includes(S);g.length===1?E&&!f?e.report({node:l,messageId:"unnecessaryTypeofCondition",data:{name:Ke(u,e),type:S}}):!E&&f?e.report({node:l,messageId:"unnecessaryTypeofCondition",data:{name:Ke(u,e),type:Array.from(g)[0]}}):!E&&!f?e.report({node:l,messageId:"alwaysFalseTypeofCondition",data:{name:Ke(u,e),actualType:mt(g),conditionType:S}}):E&&f&&e.report({node:l,messageId:"alwaysFalseTypeofCondition",data:{name:Ke(u,e),actualType:mt(g),conditionType:S}}):!E&&!f?e.report({node:l,messageId:"alwaysFalseTypeofCondition",data:{name:Ke(u,e),actualType:mt(g),conditionType:S}}):!E&&f&&e.report({node:l,messageId:"unnecessaryTypeofCondition",data:{name:Ke(u,e),type:mt(g)}})}function p(l){if(l.flags&me.default.TypeFlags.Any||l.flags&me.default.TypeFlags.Unknown)return null;if(l.isUnion()){let h=[];for(let u of l.types)if(u.flags&me.default.TypeFlags.StringLiteral){let S=u.value;h.push(S)}else return null;return h}return l.flags&me.default.TypeFlags.StringLiteral?[l.value]:null}function a(l){if(!r)return null;let h=t.esTreeNodeToTSNodeMap.get(l),u=r.getTypeAtLocation(h),S=p(u);if(S)return S;let g=r.getSymbolAtLocation(h);if(g){let f=r.getTypeOfSymbolAtLocation(g,h),E=p(f);if(E)return E}return null}function c(l){let h=e.sourceCode.ast,u=null;return Oe(h,S=>{if(S.type===pe.AST_NODE_TYPES.VariableDeclarator&&S.id.type===pe.AST_NODE_TYPES.Identifier&&S.id.name===l.name&&S.id.typeAnnotation){let g=S.id.typeAnnotation.typeAnnotation;if(g.type===pe.AST_NODE_TYPES.TSUnionType){let f=[];for(let E of g.types)if(E.type===pe.AST_NODE_TYPES.TSLiteralType&&E.literal.type===pe.AST_NODE_TYPES.Literal&&typeof E.literal.value=="string")f.push(E.literal.value);else return!0;return u=f,!0}if(g.type===pe.AST_NODE_TYPES.TSLiteralType&&g.literal.type===pe.AST_NODE_TYPES.Literal&&typeof g.literal.value=="string")return u=[g.literal.value],!0}return!1},e.sourceCode),u}function d(l){if(l.callee.type!==pe.AST_NODE_TYPES.MemberExpression||l.callee.property.type!==pe.AST_NODE_TYPES.Identifier||l.callee.computed)return;let h=l.callee.property.name;if(h!=="startsWith"&&h!=="endsWith"&&h!=="includes"||l.arguments.length!==1)return;let[u]=l.arguments;if(!u||u.type!==pe.AST_NODE_TYPES.Literal||typeof u.value!="string")return;let S=l.callee.object,g=a(S);if(!g&&S.type===pe.AST_NODE_TYPES.Identifier&&(g=c(S)),!g||g.length===0)return;let f=u.value;if(h==="includes"&&g.length>1)return;let E=0,x=0;for(let m of g)if((h==="startsWith"?m.startsWith(f):h==="endsWith"?m.endsWith(f):m.includes(f))?E++:x++,E>0&&x>0)return;if(E>0&&x===0){let m=h==="startsWith"?"unnecessaryStartsWithCondition":h==="endsWith"?"unnecessaryEndsWithCondition":"unnecessaryIncludesCondition";e.report({node:l,messageId:m})}else if(x>0&&E===0){let m=h==="startsWith"?"alwaysFalseStartsWithCondition":h==="endsWith"?"alwaysFalseEndsWithCondition":"alwaysFalseIncludesCondition";e.report({node:l,messageId:m})}}function y(l){if(!new Set(["===","!==",">",">=","<","<="]).has(l.operator))return;function u(b){if(b.type!==pe.AST_NODE_TYPES.MemberExpression||b.computed||b.property.type!==pe.AST_NODE_TYPES.Identifier||b.property.name!=="length")return null;let T=b.object,A=a(T);if(!A||A.length===0)return null;let R=[];for(let P of A)R.push(P.length);return{values:R}}let S=u(l.left),g=u(l.right),f=null,E=null;if(S?l.right.type===pe.AST_NODE_TYPES.Literal&&typeof l.right.value=="number"&&(f=S.values,E=l.right.value):g&&l.left.type===pe.AST_NODE_TYPES.Literal&&typeof l.left.value=="number"&&(f=g.values,E=l.left.value),!f||E===null)return;let x=0,m=0;for(let b of f){let T=!1;if(l.operator==="==="?T=b===E:l.operator==="!=="?T=b!==E:l.operator===">"?T=b>E:l.operator===">="?T=b>=E:l.operator==="<"?T=b<E:l.operator==="<="&&(T=b<=E),T?x++:m++,x>0&&m>0)return}x>0&&m===0?e.report({node:l,messageId:"unnecessaryLengthCondition"}):m>0&&x===0&&e.report({node:l,messageId:"alwaysFalseLengthCondition"})}return{BinaryExpression(l){i(l),y(l)},CallExpression:d}}})};function mt(e){return Array.from(new Set(e)).join(" | ")||"never"}function Ke(e,t){let r=e.argument;return r.type===pe.AST_NODE_TYPES.Identifier?r.name:t.sourceCode.getText(r)}function Oi(e,t){return t.has(e)}var yt=require("@typescript-eslint/utils"),dt=require("zod/v4");var Ni=yt.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),rr="no-call-with-explicit-generics",Di=dt.z.object({functions:dt.z.array(dt.z.string())}),ji=Ni({name:rr,meta:{type:"problem",docs:{description:"Enforce calling configured functions with inferred generics only"},messages:{noExplicitGenerics:"Function '{{ functionName }}' should be called with inferred generics (remove the explicit type parameters)"},schema:[V(Di)]},defaultOptions:[{functions:[]}],create(e,[t]){let r=new Set(t.functions);return{CallExpression(n){let{callee:o}=n;o.type===yt.AST_NODE_TYPES.Identifier&&r.has(o.name)&&n.typeArguments&&e.report({node:n,messageId:"noExplicitGenerics",data:{functionName:o.name}})}}}}),zt={name:rr,rule:ji};var Be=require("@typescript-eslint/utils"),Li=Be.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),ir="no-call-with-inferred-generics",Mi=Li({name:ir,meta:{type:"problem",docs:{description:"Disable calling configured functions with infered generics"},messages:{missingGenericDeclaration:"Function '{{ functionName }}' should be called with at least {{ minGenerics }} generic(s) (ex: `fn<Generic>()`) defined",anyUsedInGenerics:"Function '{{ functionName }}' should not be called with 'any' in generics"},schema:[{type:"object",properties:{functions:{type:"array",items:{type:"object",properties:{name:{type:"string"},minGenerics:{type:"number"},allowAny:{type:"boolean"},disallowTypes:{type:"array",items:{type:"string"}}},required:["name"]}},anyAliases:{type:"array",items:{type:"string"}}},required:["functions"]}]},defaultOptions:[{functions:[]}],create(e,[t]){let r=new Map(t.functions.map(n=>[n.name,n]));return{CallExpression(n){let{callee:o}=n;if(o.type!==Be.AST_NODE_TYPES.Identifier)return;let s=r.get(o.name);if(!s)return;let{minGenerics:i=1,allowAny:p,disallowTypes:a=t.disallowTypes}=s;(n.typeArguments?.params.length||0)<(i||0)&&e.report({node:n,messageId:"missingGenericDeclaration",data:{functionName:o.name,minGenerics:i||0}}),!(p&&!a)&&n.typeArguments?.params.some(d=>!p&&d.type===Be.AST_NODE_TYPES.TSAnyKeyword||a&&d.type===Be.AST_NODE_TYPES.TSTypeReference&&d.typeName.type===Be.AST_NODE_TYPES.Identifier&&a.includes(d.typeName.name))&&e.report({node:n,messageId:"anyUsedInGenerics",data:{functionName:o.name}})}}}}),Wt={name:ir,rule:Mi};var ar=require("@typescript-eslint/utils"),$i=ar.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),lr="no-commented-out-code",_i=["function ","class ","interface ","type ","enum ","namespace ","import ","export ","const ","let ","var ","return ","throw ","break","continue","try {","catch (","finally {","async ","await ","case ","switch (","while (","for (","default:"],Ui=/^\s*return\s+/,zi=/\w=("|'|`)/,Wi=/\w+:\s*('|"|`)/,Ji=/\[['"][^'"]*['"]\]:\s*('|"|`|[^'"`\s])/,Vi=/\w+-\w+:/,Xi=/\w+_\w+:/,Hi=/\?\s+\w/,Bi=/:\s+\w/,Yi=/^\s*('|"|`)[^'"]*('|"|`),?\s*$/,qi=/^\s*\d+[,}]/,Zi=/^\s*\[[^\]]*\][,}]/,Gi=/^\s*\{[^}]*\}[,}]/,Ki=/\.\w+\(/,Qi=/\[\w+\]/,eo=/^\s*(['"`]).+?\1\s*:/,to=/^<[A-Z]\w*(\s|>|\/)/,no=/^<[a-z]+(\s|>|\/)/,ro=/<[A-Z]\w*(\s.*)?>/,io=/<\/[A-Z]\w*>/,oo=/<[a-z]+(\s.*)?>/,so=/<\/[a-z]+>/,ao=/^\s*[*\s]*$/,lo=/^[a-zA-Z]/,po=/^[A-Z][A-Za-z]*(?:\s+\d+)?(?:\s+[a-z]+)*:\s+[A-Za-z]/,co=/```[\s\S]*?```/g,uo=/`[^`]*`/g,or=/[a-zA-Z0-9]/,fo=/\.[A-Za-z_][A-Za-z0-9_]*\(/,mo=/[{}[\]()`=<>]/,yo=/:\s*(['"`[{(]|\w+\s*=>)/,go=/\bif\s*\(|\belse\b|=>/,ce={returnStatement:Ui,stringAssignment:zi,objectPropertyWithQuotes:Wi,computedPropertyAssignment:Ji,kebabCaseProperty:Vi,snakeCaseProperty:Xi,ternaryOperator:Hi,colonWithWord:Bi,quotedString:Yi,numberWithComma:qi,arrayWithComma:Zi,objectWithComma:Gi,methodCall:Ki,arrayAccess:Qi,quotedPropertyKey:eo,jsxSelfClosing:to,jsxElement:no,jsxOpeningTag:ro,jsxClosingTag:io,htmlOpeningTag:oo,htmlClosingTag:so,jsdocComment:ao};function So(e){if(e.includes(":")){let r=e.split(":")[0]?.trim();if(r&&lo.test(r)&&r.includes(" "))return!0}let t=e.trim();return t.length===0||fo.test(t)||mo.test(t)||yo.test(t)||go.test(t)?!1:!!(t.includes(":")&&po.test(t))}var To=[") {","return;",ce.returnStatement,"if (","else {","else if (","/>","</","< ","},",": {"," } = ","={",ce.stringAssignment,");",ce.objectPropertyWithQuotes,ce.computedPropertyAssignment,ce.kebabCaseProperty,ce.snakeCaseProperty,"&&","||","()",ce.ternaryOperator,ce.colonWithWord,ce.quotedString,ce.numberWithComma,ce.arrayWithComma,ce.objectWithComma,ce.methodCall,ce.arrayAccess,"?.(","??","=>",ce.quotedPropertyKey],ho=["/>","</",ce.jsxSelfClosing,ce.jsxElement,ce.jsxOpeningTag,ce.jsxClosingTag,ce.htmlOpeningTag,ce.htmlClosingTag],sr=["INFO:","TODO:","DOCS:","FIX:","FIXME:","HACK:","NOTE:","WARNING:","WARN:","BUG:","ISSUE:","TEMP:","TEMPORARY:","XXX:","REVIEW:","eslint"],Eo=$i({name:lr,meta:{type:"problem",docs:{description:"Disallow commented code"},messages:{commentedOutCode:"Commented code is not allowed. Detected pattern: `{{ wrongPattern }}` Use a comment starting with one of these prefixes if you want to keep this code commented out: {{ allowedPrefixes }}"},schema:[]},defaultOptions:[],create(e){function t(n,o){if(n.startsWith("/"))return!1;let s=n.trimStart();if(n.startsWith("*")||s.startsWith("eslint-disable")||n.includes("@deprecated")||n.includes("@example")||n.includes("@param")||n.includes("@returns")||n.includes("@throws")||n.includes("typescript-eslint")||n.includes("@ts-")||n.includes("prettier-ignore")||ce.jsdocComment.test(n))return!1;for(let i of sr)if(s.startsWith(i))return!1;if(n.includes("https://")||So(s))return!1;if(o==="Block"){for(let i of ho)if(typeof i=="string"){if(n.includes(i))return{wrongPattern:i}}else if(i.test(n))return{wrongPattern:`regex(${i.toString()})`};return!1}for(let i of _i)if(s.startsWith(i))return{wrongPattern:i};for(let i of To)if(typeof i=="string"){if(n.includes(i))return{wrongPattern:i}}else if(i.test(n))return{wrongPattern:`regex(${i.toString()})`};return!1}function r(n,o){let s=n,i=s.trim();if(i.startsWith("`")&&(i.endsWith("`,")||i.endsWith("`;")||i.endsWith("`")))return s;if(o==="Block"&&s.includes("```")){let c=s.split(co);c.some(y=>or.test(y))&&(s=c.join(""))}if(!s.includes("`"))return s;let p=s.split(uo);return p.some(c=>or.test(c))?p.join(""):s}return{Program(){let o=e.sourceCode.getAllComments();for(let s of o){let i=r(s.value,s.type),p=t(i,s.type);p&&e.report({node:s,messageId:"commentedOutCode",data:{wrongPattern:p.wrongPattern,allowedPrefixes:sr.join(", ")}})}}}}}),Jt={name:lr,rule:Eo};var gt=require("@typescript-eslint/utils"),bo=gt.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),pr="no-default-export",xo=bo({name:pr,meta:{type:"problem",docs:{description:"Disallow default exports"},schema:[],messages:{noDefaultExport:"Default exports are not allowed, use named exports instead."}},defaultOptions:[],create(e){return{ExportDefaultDeclaration(t){e.report({node:t,messageId:"noDefaultExport"})},ExportNamedDeclaration(t){for(let r of t.specifiers)r.exported.type===gt.TSESTree.AST_NODE_TYPES.Identifier&&r.exported.name==="default"&&e.report({node:t,messageId:"noDefaultExport"})}}}}),Vt={name:pr,rule:xo};var cr=require("@typescript-eslint/utils"),Co=cr.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),ur="no-leaked-text-in-jsx",Io=[",",";","[","]","(",")"],Ao=Co({name:ur,meta:{type:"problem",docs:{description:"Prevents leaking of text in JSX that should be wrapped in an expression container"},messages:{leakedTextInJSX:'Text "{{ text }}" should be wrapped in a JSX expression container.'},schema:[],fixable:"code"},defaultOptions:[],create(e){return{JSXText(t){let r=t.value.trim();if(!r)return;let n="";Io.includes(r)?n=r:r.includes("&&")?n="&&":r.includes("||")?n="||":r.endsWith("? (")&&(n="? ("),n&&e.report({node:t,messageId:"leakedTextInJSX",data:{text:n}})}}}}),Xt={name:ur,rule:Ao};var Xe=require("@typescript-eslint/utils"),wo=Xe.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),mr="no-non-camel-case-functions",Ro=/^(\$?[a-z][a-zA-Z0-9]*)$/;function fr(e){if(e.typeName.type!==Xe.AST_NODE_TYPES.TSQualifiedName)return!1;let{left:t,right:r}=e.typeName;return t.type===Xe.AST_NODE_TYPES.Identifier&&t.name==="JSX"&&r.name==="Element"}var Po=wo({name:mr,meta:{type:"suggestion",docs:{description:"Enforce camelCase naming convention for function declarations"},schema:[],messages:{nonCamelCaseFunction:'Function name "{{functionName}}" should be in camelCase format. If this fn is a React component and can\'t use the `FC` type, add a explicit "JSX.Element" return type to it'}},defaultOptions:[],create(e){return{FunctionDeclaration(t){if(t.id&&!Ro.test(t.id.name)){let r=t.returnType?.typeAnnotation;if(r&&(r.type===Xe.AST_NODE_TYPES.TSTypeReference?fr(r):r.type===Xe.AST_NODE_TYPES.TSUnionType&&r.types.some(o=>o.type===Xe.AST_NODE_TYPES.TSTypeReference&&fr(o))))return;e.report({node:t.id,messageId:"nonCamelCaseFunction",data:{functionName:t.id.name}})}}}}}),Ht={name:mr,rule:Po};var re=require("@typescript-eslint/utils");var vo=re.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),dr="no-optional-root-props",Fo=vo({name:dr,meta:{type:"problem",docs:{description:"Prevents usage of optional properties at the root of a type if that type is a local type alias or interface referenced only once"},messages:{optionalNotAllowed:'Optional property "{{ propertyName }}" is not allowed on a local type used only once. Use `prop: undefined | ...` instead.',suggestion:"Use `prop: undefined | ...` instead."},hasSuggestions:!0,schema:[]},defaultOptions:[],create(e){function t(n){let s=e.sourceCode.getDeclaredVariables(n)[0];if(!s||s.references.length!==1)return!1;let i=s.references[0];if(!i)return!1;for(let p of $t(i.identifier)){if("returnType"in p||p.type===re.TSESTree.AST_NODE_TYPES.ExportNamedDeclaration)return!1;let a=p.parent;if(!a)return!1;if(a.type===re.TSESTree.AST_NODE_TYPES.TSTypeParameterInstantiation&&a.parent.type===re.TSESTree.AST_NODE_TYPES.TSTypeReference&&a.parent.typeName.type===re.TSESTree.AST_NODE_TYPES.Identifier&&a.parent.typeName.name==="FC"){let d=Ge(a.parent.parent,re.TSESTree.AST_NODE_TYPES.VariableDeclaration,4);if(!d)return!1;let y=St(d,e.sourceCode);return y?!(y.parent.type===re.TSESTree.AST_NODE_TYPES.CallExpression&&y.parent.callee.type===re.TSESTree.AST_NODE_TYPES.Identifier&&y.parent.callee.name==="memo"):!1}if(p.type===re.TSESTree.AST_NODE_TYPES.AssignmentPattern)return!1;if(a.type===re.TSESTree.AST_NODE_TYPES.ArrowFunctionExpression){let c=Ge(a,re.TSESTree.AST_NODE_TYPES.VariableDeclaration);return c?!!St(c,e.sourceCode):!1}if(a.type===re.TSESTree.AST_NODE_TYPES.FunctionDeclaration)return!!St(a,e.sourceCode)}return!1}function r(n){n.key.type!==re.TSESTree.AST_NODE_TYPES.Identifier||!n.optional||e.report({node:n.key,messageId:"optionalNotAllowed",data:{propertyName:n.key.name},suggest:[{messageId:"suggestion",fix:o=>{let s=Ge(n,re.TSESTree.AST_NODE_TYPES.TSPropertySignature);if(!s)return null;let i=e.sourceCode.getText(s);return o.replaceText(s,i.replace("?:",": undefined |"))}}]})}return{TSTypeAliasDeclaration(n){if(n.typeAnnotation.type===re.TSESTree.AST_NODE_TYPES.TSTypeLiteral&&!(Tt(n)||!t(n)))for(let o of n.typeAnnotation.members)o.type===re.TSESTree.AST_NODE_TYPES.TSPropertySignature&&r(o)},TSInterfaceDeclaration(n){if(!(Tt(n)||!t(n)))for(let o of n.body.body)o.type===re.TSESTree.AST_NODE_TYPES.TSPropertySignature&&r(o)},TSTypeReference(n){if(n.typeName.type!==re.TSESTree.AST_NODE_TYPES.Identifier||n.typeName.name!=="FC"||!n.typeArguments?.params[0])return;let o=n.typeArguments.params[0];if(o.type!==re.TSESTree.AST_NODE_TYPES.TSTypeLiteral)return;let s=Ge(n.parent,re.TSESTree.AST_NODE_TYPES.VariableDeclaration,4);if(!s)return;let i=St(s,e.sourceCode);if(!(!i||i.parent.type===re.TSESTree.AST_NODE_TYPES.CallExpression&&i.parent.callee.type===re.TSESTree.AST_NODE_TYPES.Identifier&&i.parent.callee.name==="memo"))for(let a of o.members)a.type===re.TSESTree.AST_NODE_TYPES.TSPropertySignature&&r(a)}}}});function Tt(e){return e?e.parent?.type===re.TSESTree.AST_NODE_TYPES.ExportNamedDeclaration||e.parent?.type===re.TSESTree.AST_NODE_TYPES.ExportDefaultDeclaration:!1}function St(e,t){if(Tt(e))return;let r;if(e.type===re.TSESTree.AST_NODE_TYPES.VariableDeclaration){if(e.declarations.length!==1)return;e.declarations[0].id.type===re.TSESTree.AST_NODE_TYPES.Identifier&&(r=e.declarations[0].id)}else{if(!e.id)return;r=e.id}if(!r)return;let n=t.getScope(e);e.type===re.TSESTree.AST_NODE_TYPES.FunctionDeclaration&&n.upper&&(n=n.upper);let o=n.variables.find(i=>i.identifiers.includes(r));if(!o)return;let s=o.references.filter(i=>i.identifier!==r);if(!(s.length!==1||!s[0])&&!Tt(s[0].identifier.parent.parent))return s[0].identifier}var Bt={name:dr,rule:Fo};var it=require("@typescript-eslint/utils");var ot=H({name:"no-reexport",meta:{type:"problem",docs:{description:"Disallow re-exports to prevent indirection"},schema:[],messages:{noReexport:"Re-exports are not allowed. Use direct exports only."}},defaultOptions:[],create(e){let t=new Set;function r(n){return n?n.type===it.AST_NODE_TYPES.Identifier?t.has(n.name):n.type===it.AST_NODE_TYPES.MemberExpression?r(n.object):!1:!1}return{ImportDeclaration(n){for(let o of n.specifiers)t.add(o.local.name)},ExportNamedDeclaration(n){if(n.source){e.report({node:n,messageId:"noReexport"});return}if(n.declaration?.type===it.AST_NODE_TYPES.VariableDeclaration)for(let o of n.declaration.declarations)r(o.init)&&e.report({node:n,messageId:"noReexport"});n.specifiers.length>0&&e.report({node:n,messageId:"noReexport"})},ExportDefaultDeclaration(n){n.declaration.type===it.AST_NODE_TYPES.Identifier&&t.has(n.declaration.name)&&e.report({node:n,messageId:"noReexport"})},ExportAllDeclaration(n){e.report({node:n,messageId:"noReexport"})}}}});var yr=require("@typescript-eslint/utils"),ht=ke(require("path")),Ue=require("zod/v4");var ko=yr.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),gr="no-relative-imports",Oo=Ue.z.object({find:Ue.z.string(),replacement:Ue.z.string()}),No=Ue.z.object({aliases:Ue.z.array(Oo),rootDir:Ue.z.string().optional(),allowNotFoundAliases:Ue.z.boolean().optional(),_dev_simulateFileName:Ue.z.string().optional()}),Do=ko({name:gr,meta:{type:"problem",fixable:"code",docs:{description:"Prevent relative imports and auto-fix them using configured aliases"},messages:{noRelativeImports:"Relative imports are not allowed. Use one of the valid aliases in tsconfig.json instead.",noRelativeImportsWithAlias:'Relative imports are not allowed. Use the "{{ alias }}" alias instead.'},schema:[V(No)]},defaultOptions:[{aliases:[],rootDir:void 0}],create(e,[t]){let r=t._dev_simulateFileName??e.filename;function n(i){return i.startsWith(".")||i.startsWith("..")}function o(i,p){let a=ht.default.dirname(p);return ht.default.resolve(a,i)}function s(i){let p=t.rootDir??process.cwd(),a=ht.default.relative(p,i);if(a.startsWith("."))return null;a.startsWith("/")||(a=`/${a}`);for(let{find:c,replacement:d}of t.aliases)if(a.startsWith(d)){let y=a.replace(d,c);return{alias:c,newPath:y}}return null}return{ImportDeclaration(i){let p=i.source.value;if(!n(p))return;let a=o(p,r),c=s(a);!c&&t.allowNotFoundAliases||e.report({node:i,messageId:c?"noRelativeImportsWithAlias":"noRelativeImports",data:{alias:c?.alias},fix:c?d=>d.replaceText(i.source,`'${c.newPath}'`):void 0})}}}}),Yt={name:gr,rule:Do};var ue=require("@typescript-eslint/utils"),qt=require("zod/v4");var jo=qt.z.object({customMessage:qt.z.string().optional()}),Zt=H({name:"no-static-style-prop",meta:{type:"problem",docs:{description:"Prevent using static style props in JSX, only dynamic values should be allowed"},schema:[V(jo)],messages:{noStaticStyleProp:"Static style props are not allowed use css instead.{{customMessage}}"}},defaultOptions:[{}],create(e,[t]){function r(n){switch(n.type){case ue.AST_NODE_TYPES.Literal:return!0;case ue.AST_NODE_TYPES.ObjectExpression:return n.properties.every(o=>o.type===ue.AST_NODE_TYPES.Property?o.computed||o.value.type===ue.AST_NODE_TYPES.Identifier&&o.key.type===ue.AST_NODE_TYPES.Identifier&&o.key.name===o.value.name?!1:r(o.value):!1);case ue.AST_NODE_TYPES.ArrayExpression:return n.elements.every(o=>o?o.type===ue.AST_NODE_TYPES.SpreadElement?!1:r(o):!0);case ue.AST_NODE_TYPES.TemplateLiteral:return n.expressions.length===0;case ue.AST_NODE_TYPES.ConditionalExpression:case ue.AST_NODE_TYPES.LogicalExpression:case ue.AST_NODE_TYPES.BinaryExpression:case ue.AST_NODE_TYPES.UnaryExpression:case ue.AST_NODE_TYPES.CallExpression:case ue.AST_NODE_TYPES.MemberExpression:case ue.AST_NODE_TYPES.Identifier:case ue.AST_NODE_TYPES.ArrowFunctionExpression:case ue.AST_NODE_TYPES.FunctionExpression:return!1;default:return!1}}return{JSXAttribute(n){if(n.name.type===ue.AST_NODE_TYPES.JSXIdentifier&&n.name.name==="style"&&n.value){let o=null;n.value.type===ue.AST_NODE_TYPES.JSXExpressionContainer?n.value.expression.type!==ue.AST_NODE_TYPES.JSXEmptyExpression&&(o=n.value.expression):n.value.type===ue.AST_NODE_TYPES.Literal&&(o=n.value),o&&r(o)&&e.report({node:n,messageId:"noStaticStyleProp",data:{customMessage:t.customMessage?` ${t.customMessage}`:""}})}}}}});var st=require("@typescript-eslint/utils"),Ye=ke(require("zod/v4"));var Lo=Ye.object({alternativeMsgs:Ye.object({inArrayFind:Ye.string().optional(),inArrayFilter:Ye.string().optional()}).optional(),__dev_simulateFileName:Ye.string().optional()});function Mo(e){return e.typeAnnotation.type!==st.AST_NODE_TYPES.TSTypePredicate?!1:e.typeAnnotation.asserts===!1}var $o=/(typeGuards|type-guards)\.(ts|tsx)$/;function _o(e){return $o.test(e)}function Uo(e){let t=e.parent;for(;t;){if(t.type===st.AST_NODE_TYPES.CallExpression&&t.callee.type===st.AST_NODE_TYPES.MemberExpression&&t.callee.property.type===st.AST_NODE_TYPES.Identifier){let r=t.callee.property.name;if(r==="filter"||r==="find")return{method:r}}t=t.parent}return null}var Gt=H({name:"no-type-guards",meta:{type:"problem",docs:{description:"Disallow type guards unless in *.typeGuards.(ts|tsx) or *.type-guards.(ts|tsx) files"},messages:{typeGuardNotAllowed:"Check if the type guard can be inferred by typescript, in most cases it can, e.g. `.filter((nullable) => nullable !== null)`. If not, type guards are only allowed in *.typeGuards.(ts|tsx) or *.type-guards.(ts|tsx) files",useFilterWithTypeCheck:"{{message}}",useFindWithTypeCheck:"{{message}}"},schema:[V(Lo)],hasSuggestions:!0},defaultOptions:[{}],create(e,[t]){let r=t.__dev_simulateFileName??e.filename;if(_o(r))return{};function n(o){if(!Mo(o))return;let s=Uo(o);if(t.alternativeMsgs&&s){let i=s.method==="filter"?t.alternativeMsgs.inArrayFilter:t.alternativeMsgs.inArrayFind;if(i){let p=s.method==="filter"?"useFilterWithTypeCheck":"useFindWithTypeCheck";e.report({node:o,messageId:p,data:{message:i}});return}}e.report({node:o,messageId:"typeGuardNotAllowed"})}return{"FunctionDeclaration > :matches(TSTypeAnnotation)":n,"ArrowFunctionExpression > :matches(TSTypeAnnotation)":n,"MethodDefinition > FunctionExpression > :matches(TSTypeAnnotation)":n}}});var qe=require("@typescript-eslint/utils");var zo="no-unnecessary-async-on-jsx-props";function Wo(e){if(e.body.type!==qe.AST_NODE_TYPES.BlockStatement)return!1;let t=e.body.body;if(t.length!==1)return!1;let r=t[0];return!r||r.type!==qe.AST_NODE_TYPES.ExpressionStatement?!1:r.expression.type===qe.AST_NODE_TYPES.AwaitExpression}var Kt=H({name:zo,meta:{type:"suggestion",fixable:"code",docs:{description:"Disallow unnecessary async/await in JSX props where a single await provides no benefit"},messages:{unnecessaryAsyncInJsxProp:"Unnecessary async/await in JSX prop. The single await expression provides no benefit here."},schema:[]},defaultOptions:[],create(e){function t(r){Wo(r)&&e.report({node:r,messageId:"unnecessaryAsyncInJsxProp",fix(n){let o=e.sourceCode,s=[],i=o.getFirstToken(r,a=>a.value==="async");if(i){let a=o.getTokenAfter(i);a?s.push(n.replaceTextRange([i.range[0],a.range[0]],"")):s.push(n.remove(i))}function p(a){if(a.type===qe.AST_NODE_TYPES.AwaitExpression){let c=o.getFirstToken(a);if(c&&c.value==="await"){let d=o.getTokenAfter(c);d?s.push(n.replaceTextRange([c.range[0],d.range[0]],"")):s.push(n.remove(c))}}if(a.type===qe.AST_NODE_TYPES.BlockStatement)for(let c of a.body)p(c);else a.type===qe.AST_NODE_TYPES.ExpressionStatement&&p(a.expression)}return p(r.body),s}})}return{"JSXAttribute ArrowFunctionExpression[async=true]":t,"JSXAttribute FunctionExpression[async=true]":t}}});var ze=require("@typescript-eslint/utils"),Qt=ke(require("typescript")),Qe=ke(require("zod/v4"));var Jo=ze.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),Sr="no-unnecessary-casting",Vo=Qe.default.object({additionalCastFunctions:Qe.default.array(Qe.default.object({name:Qe.default.string(),expectedType:Qe.default.enum(["string","number"])})).optional()}),en={name:Sr,rule:Jo({name:Sr,meta:{type:"suggestion",docs:{description:"Prevents unnecessary Number and String castings"},messages:{unnecessaryNumberCasting:"Unnecessary Number() casting on a value already of number type",unnecessaryStringCasting:"Unnecessary String() casting on a value already of string type",unnecessaryCustomCasting:"Unnecessary {{name}}() casting on a value already of {{type}} type"},schema:[V(Vo)],fixable:"code"},defaultOptions:[{}],create(e){let r=e.options[0].additionalCastFunctions||[],n=[{name:"Number",expectedType:"number"},{name:"String",expectedType:"string"},...r],o=ze.ESLintUtils.getParserServices(e,!0),s=o.program?.getTypeChecker();if(!s||!o.program)throw new Error("TypeScript services or program not available");function i(d,y){switch(d.type){case ze.AST_NODE_TYPES.Literal:return y==="number"?typeof d.value=="number":typeof d.value=="string";case ze.AST_NODE_TYPES.TemplateLiteral:return y==="string";case ze.AST_NODE_TYPES.UnaryExpression:return y==="number"?d.operator==="+"||d.operator==="-"||d.operator==="~":!1;default:return!1}}function p(d,y){return y==="number"?!!(d.flags&Qt.TypeFlags.NumberLike):!!(d.flags&Qt.TypeFlags.StringLike)}function a(d,y){return l=>l.replaceText(d,e.sourceCode.getText(y))}function c(d){if(!s||d.arguments.length!==1)return;let y=d.arguments[0];if(!y||y.type===ze.AST_NODE_TYPES.SpreadElement)return;let{callee:l}=d;if(l.type!==ze.AST_NODE_TYPES.Identifier)return;let h=l.name,u=n.find(g=>g.name===h);if(!u)return;if(i(y,u.expectedType)||p(s.getTypeAtLocation(o.esTreeNodeToTSNodeMap.get(y)),u.expectedType)){let g,f;h==="Number"?g="unnecessaryNumberCasting":h==="String"?g="unnecessaryStringCasting":(g="unnecessaryCustomCasting",f={name:u.name,type:u.expectedType}),e.report({node:d,messageId:g,...f?{data:f}:{},fix:a(d,y)})}}return{CallExpression:c}}})};var be=require("@typescript-eslint/utils"),Et=ke(require("zod/v4"));var Xo=Et.object({ignoreWithDescription:Et.string().optional()}),tn=H({name:"no-unnecessary-describe",meta:{type:"suggestion",docs:{description:"Disallow unnecessary describe blocks that wrap all tests in a file"},messages:{unnecessaryDescribe:"Describe blocks that solely wrap all tests in the file are unnecessary, they just add unnecessary nesting to the code. The file itself should be enough to group tests. Remove it.",removeDescribe:"Remove the describe block"},hasSuggestions:!0,schema:[V(Xo)]},defaultOptions:[{}],create(e,[t]){let r=e.getSourceCode(),n=r.ast;function o(a){let c=a.arguments[0];return c&&c.type===be.AST_NODE_TYPES.Literal&&typeof c.value=="string"?c.value:null}function s(a){return!a||!t.ignoreWithDescription?!1:new RegExp(t.ignoreWithDescription).test(a)}function i(a){return a.length!==1?!1:n.body.filter(d=>{if(d.type===be.AST_NODE_TYPES.ExpressionStatement){let y=d.expression;if(y.type===be.AST_NODE_TYPES.CallExpression&&y.callee.type===be.AST_NODE_TYPES.Identifier){let l=y.callee.name;return["test","it","beforeEach","afterEach","beforeAll","afterAll"].includes(l)}}return!1}).length===0}function p(a){let c=a.arguments[1];if(c&&(c.type===be.AST_NODE_TYPES.FunctionExpression||c.type===be.AST_NODE_TYPES.ArrowFunctionExpression)&&c.body.type===be.AST_NODE_TYPES.BlockStatement){let d=c.body.body;return d.length===0?"":d.map(l=>r.text.slice(l.range[0],l.range[1])).join(`
16
16
 
17
- `)}return""}return{Program(){let a=[];for(let l of n.body)l.type===ge.AST_NODE_TYPES.ExpressionStatement&&l.expression.type===ge.AST_NODE_TYPES.CallExpression&&l.expression.callee.type===ge.AST_NODE_TYPES.Identifier&&l.expression.callee.name==="describe"&&l.expression.arguments.length===2&&a.push(l.expression);if(!i(a))return;let[c]=a;if(!c)return;let g=s(c);if(o(g))return;let S=n.body.find(l=>l.type===ge.AST_NODE_TYPES.ExpressionStatement&&l.expression===c);!S||S.type!==ge.AST_NODE_TYPES.ExpressionStatement||e.report({node:c,messageId:"unnecessaryDescribe",suggest:[{messageId:"removeDescribe",fix(l){let E=p(c);return E?l.replaceText(S,E):null}}]})}}}});var nt=require("@typescript-eslint/utils"),Re=xe(require("zod/v4"));var Vs=Re.object({methods:Re.union([Re.array(Re.string()),Re.literal("array")])}),Gt=_({name:"no-unnecessary-typing",meta:{type:"suggestion",docs:{description:"Prevents unnecessary explicit type annotations in callback parameters where TypeScript can infer the type"},messages:{unnecessaryTypeAnnotation:"Unnecessary type annotation. TypeScript can infer this type from context."},fixable:"code",schema:[$(Vs)]},defaultOptions:[{methods:"array"}],create(e,[t]){let r=t.methods,n=new Set(["find","filter","map","forEach","some","every","reduce","findIndex","sort"]);function s(p){return Array.isArray(r)?r.includes(p):n.has(p)}function o(p){let{callee:a}=p;if(a.type===nt.AST_NODE_TYPES.MemberExpression){let c=a.property;if(c.type===nt.AST_NODE_TYPES.Identifier)return c.name}return null}function i(p,a){if(p.type!==nt.AST_NODE_TYPES.Identifier||!p.typeAnnotation)return;let c=a.parent;if(c.type===nt.AST_NODE_TYPES.CallExpression){let g=o(c);g&&s(g)&&c.arguments.indexOf(a)===0&&e.report({node:p.typeAnnotation,messageId:"unnecessaryTypeAnnotation",fix(l){return p.typeAnnotation?l.remove(p.typeAnnotation):null}})}}return{ArrowFunctionExpression(p){for(let a of p.params)i(a,p)},FunctionExpression(p){for(let a of p.params)i(a,p)}}}});var ye=require("@typescript-eslint/utils");var Kt=_({name:"no-unused-obj-props",meta:{type:"suggestion",docs:{description:"Disallow unused properties when it is safe to remove them"},messages:{unusedObjectProperty:'The object property "{{name}}" is not being used',unusedReturnObjectProperty:'The object property "{{name}}" returned by this function is not being used'},schema:[]},defaultOptions:[],create(e){return{VariableDeclarator(t){if(t.id.type===ye.AST_NODE_TYPES.ObjectPattern||!t.init||t.init.type!==ye.AST_NODE_TYPES.ObjectExpression||t.id.type===ye.AST_NODE_TYPES.Identifier&&t.id.typeAnnotation||t.parent.parent.type===ye.AST_NODE_TYPES.ExportNamedDeclaration)return;let r=new Map;for(let i of t.init.properties)i.type===ye.AST_NODE_TYPES.Property&&i.key.type===ye.AST_NODE_TYPES.Identifier&&r.set(i.key.name,i);if(r.size===0||t.id.type!==ye.AST_NODE_TYPES.Identifier)return;let n=Xs(t,e.sourceCode);if(n.length===0)return;let s=t.init.properties.some(i=>i.type!==ye.AST_NODE_TYPES.Property?!1:i.value.type===ye.AST_NODE_TYPES.FunctionExpression),o=new Set;for(let i of n){if(i.identifier.parent.type!==ye.AST_NODE_TYPES.MemberExpression)return;let p=i.identifier.parent;if(p.object!==i.identifier)return;if(p.computed)if(p.property.type===ye.AST_NODE_TYPES.Literal&&typeof p.property.value=="string")o.add(p.property.value);else return;else{if(p.property.type!==ye.AST_NODE_TYPES.Identifier)return;o.add(p.property.name)}if(p.parent.type===ye.AST_NODE_TYPES.CallExpression&&s)return}for(let[i,p]of r)o.has(i)||e.report({node:p,messageId:"unusedObjectProperty",data:{name:i}})}}}});function Xs(e,t){let r=t.getDeclaredVariables(e);if(r.length!==1)return[];let n=r[0];return n?n.references.filter(s=>s.identifier!==e.id):[]}var J=require("@typescript-eslint/utils"),Qt=require("zod/v4");var Hs=Qt.z.object({ignoreArgsMatching:Qt.z.string().optional()}),en=_({name:"no-unused-optional-args",meta:{type:"problem",docs:{description:"Detect unused optional function arguments in non-exported functions"},messages:{unusedOptionalArg:"Optional parameter '{{name}}' is never used",unusedOptionalProp:"Optional prop '{{name}}' is never provided"},schema:[$(Hs)]},defaultOptions:[{}],create(e,[t]){let r=[];function n(i){return t.ignoreArgsMatching?new RegExp(t.ignoreArgsMatching).test(i):!1}function s(i){return i.type===J.AST_NODE_TYPES.ExportNamedDeclaration||i.type===J.AST_NODE_TYPES.ExportDefaultDeclaration||i.parent?.type===J.AST_NODE_TYPES.ExportNamedDeclaration||i.parent?.type===J.AST_NODE_TYPES.ExportDefaultDeclaration}function o(i){let p=[];for(let a=0;a<i.length;a++){let c=i[a];if(!c||c.type!==J.AST_NODE_TYPES.Identifier)continue;let g=c.name;if(!n(g)){if(c.optional&&c.typeAnnotation&&c.typeAnnotation.typeAnnotation.type===J.AST_NODE_TYPES.TSTypeLiteral){let S=c.typeAnnotation.typeAnnotation,l=[];for(let E of S.members)E.type===J.AST_NODE_TYPES.TSPropertySignature&&E.key.type===J.AST_NODE_TYPES.Identifier&&l.push({name:E.key.name,optional:E.optional===!0});l.some(E=>E.optional)?p.push({param:c,index:a,name:g,isObjectParam:!0,objectProps:l}):p.push({param:c,index:a,name:g,isObjectParam:!1})}else if(c.optional)p.push({param:c,index:a,name:g,isObjectParam:!1});else if(c.typeAnnotation&&c.typeAnnotation.typeAnnotation.type===J.AST_NODE_TYPES.TSTypeLiteral){let S=c.typeAnnotation.typeAnnotation,l=[];for(let E of S.members)E.type===J.AST_NODE_TYPES.TSPropertySignature&&E.key.type===J.AST_NODE_TYPES.Identifier&&l.push({name:E.key.name,optional:E.optional===!0});l.some(E=>E.optional)&&p.push({param:c,index:a,name:g,isObjectParam:!0,objectProps:l})}}}return p}return{FunctionDeclaration(i){if(s(i))return;let p=o(i.params);p.length!==0&&r.push({node:i,declarationNode:i,optionalParams:p})},VariableDeclarator(i){if(i.id.type!==J.AST_NODE_TYPES.Identifier||!i.init||i.init.type!==J.AST_NODE_TYPES.ArrowFunctionExpression&&i.init.type!==J.AST_NODE_TYPES.FunctionExpression||s(i.parent.parent))return;let a=[...o(i.init.params)];if(i.id.typeAnnotation&&i.id.typeAnnotation.typeAnnotation.type===J.AST_NODE_TYPES.TSTypeReference){let c=i.id.typeAnnotation.typeAnnotation;if(c.typeName.type===J.AST_NODE_TYPES.Identifier&&c.typeName.name==="FC"){let g=c.typeArguments;if(g&&g.params.length===1){let S=g.params[0];if(S&&S.type===J.AST_NODE_TYPES.TSTypeLiteral){let l=[];for(let E of S.members)E.type===J.AST_NODE_TYPES.TSPropertySignature&&E.key.type===J.AST_NODE_TYPES.Identifier&&l.push({name:E.key.name,optional:E.optional===!0});l.some(E=>E.optional)&&a.push({param:i.id,index:0,name:"props",isObjectParam:!0,objectProps:l})}}}}a.length!==0&&r.push({node:i.init,declarationNode:i,optionalParams:a})},"Program:exit"(){for(let i of r){let a=e.sourceCode.getDeclaredVariables(i.declarationNode)[0];if(!a)continue;let c=a.references.filter(l=>l.identifier!==a.identifiers[0]);if(c.length===0)continue;let g=!1;for(let l of c){let E=l.identifier.parent;if(E.type===J.AST_NODE_TYPES.CallExpression&&l.identifier.type===J.AST_NODE_TYPES.Identifier&&E.arguments.includes(l.identifier)){g=!0;break}if(E.type===J.AST_NODE_TYPES.ReturnStatement){g=!0;break}if(E.type===J.AST_NODE_TYPES.Property&&E.parent.type===J.AST_NODE_TYPES.ObjectExpression&&E.parent.parent.type===J.AST_NODE_TYPES.ReturnStatement){g=!0;break}if(E.type===J.AST_NODE_TYPES.JSXExpressionContainer){g=!0;break}}if(g)continue;let S=[];for(let l of c){let E=l.identifier.parent;if(E.type===J.AST_NODE_TYPES.CallExpression&&E.callee===l.identifier){let f=E.arguments.length,h=E.arguments.some(m=>m.type===J.AST_NODE_TYPES.SpreadElement);if(h){g=!0;break}let T={argCount:f,hasSpread:h};for(let m of i.optionalParams)if(m.isObjectParam&&m.index<f){let b=E.arguments[m.index];if(b?.type===J.AST_NODE_TYPES.ObjectExpression){let C={};for(let y of b.properties)y.type===J.AST_NODE_TYPES.Property&&y.key.type===J.AST_NODE_TYPES.Identifier&&(C[y.key.name]=!0);T.objectArgs||(T.objectArgs=[]),T.objectArgs[m.index]=C}else if(b){g=!0;break}}S.push(T)}else if(E.type===J.AST_NODE_TYPES.JSXOpeningElement&&E.name===l.identifier){let f=E.attributes.some(T=>T.type===J.AST_NODE_TYPES.JSXSpreadAttribute);if(f){g=!0;break}let h={argCount:1,hasSpread:f};for(let T of i.optionalParams)if(T.isObjectParam&&T.index===0){let m={};for(let b of E.attributes)b.type===J.AST_NODE_TYPES.JSXAttribute&&b.name.type===J.AST_NODE_TYPES.JSXIdentifier&&(m[b.name.name]=!0);h.objectArgs||(h.objectArgs=[]),h.objectArgs[0]=m}S.push(h)}}if(!(g||S.length===0))for(let l of i.optionalParams)if(l.isObjectParam&&l.objectProps)for(let E of l.objectProps){if(!E.optional)continue;let f=!1;for(let h of S)if(h.objectArgs&&h.objectArgs[l.index]){let T=h.objectArgs[l.index];if(T&&T[E.name]){f=!0;break}}f||e.report({node:l.param,messageId:"unusedOptionalProp",data:{name:E.name}})}else{let E=!1;for(let f of S)if(f.argCount>l.index){E=!0;break}E||e.report({node:l.param,messageId:"unusedOptionalArg",data:{name:l.name}})}}}}}});var G=require("@typescript-eslint/utils"),Ue=require("zod/v4");var Bs=Ue.z.object({selectors:Ue.z.array(Ue.z.object({name:Ue.z.string(),selectorProp:Ue.z.string().optional(),selectorArgPos:Ue.z.number().optional(),returnProp:Ue.z.string().optional()}))}),Ys=G.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),dr="no-unused-selected-values",tn={name:dr,rule:Ys({name:dr,meta:{type:"suggestion",docs:{description:"Disallow unused values in selector objects"},messages:{unusedSelectedValue:'The selected value "{{name}}" is not being used'},schema:[$(Bs)]},defaultOptions:[{selectors:[]}],create(e,[t]){let{selectors:r=[]}=t,n=new Map(r.map(s=>[s.name,s]));return{VariableDeclarator(s){let o=null;if(s.init?.type===G.AST_NODE_TYPES.CallExpression&&(o=s.init),!o)return;let i=Zs(o);if(!i)return;let p=n.get(i);if(!p)return;let a=qs(o,p.selectorArgPos??0,p.selectorProp);if(!a)return;let c=Gs(a);if(!c)return;let g=gr(c.properties,void 0);if(!g)return;if(s.id.type===G.AST_NODE_TYPES.ObjectPattern){let E=gr(s.id.properties,p.returnProp);if(!E)return;for(let[f,h]of g)E.has(f)||e.report({node:h,messageId:"unusedSelectedValue",data:{name:f}});return}if(s.id.type!==G.AST_NODE_TYPES.Identifier||p.returnProp)return;let S=Ks(s,e.sourceCode);if(S.length===0)return;let l=new Set;for(let E of S){if(E.identifier.parent.type!==G.AST_NODE_TYPES.MemberExpression)return;let f=E.identifier.parent.property;if(f.type!==G.AST_NODE_TYPES.Identifier)return;l.add(f.name)}for(let[E,f]of g)l.has(E)||e.report({node:f,messageId:"unusedSelectedValue",data:{name:E}})}}}})};function qs(e,t,r){let n=e.arguments[t];if(!n)return null;if(n.type===G.AST_NODE_TYPES.ArrowFunctionExpression||n.type===G.AST_NODE_TYPES.FunctionExpression)return n;if(r&&n.type===G.AST_NODE_TYPES.ObjectExpression){let s=n.properties.find(i=>i.type===G.AST_NODE_TYPES.Property&&i.key.type===G.AST_NODE_TYPES.Identifier&&i.key.name===r);if(s?.type!==G.AST_NODE_TYPES.Property)return null;let o=s.value;if(o.type===G.AST_NODE_TYPES.ArrowFunctionExpression||o.type===G.AST_NODE_TYPES.FunctionExpression)return o}return null}function Zs(e){return e.callee.type===G.AST_NODE_TYPES.Identifier?e.callee.name:e.callee.type===G.AST_NODE_TYPES.MemberExpression&&e.callee.property.type===G.AST_NODE_TYPES.Identifier?e.callee.property.name:null}function Gs(e){if(e.body.type===G.AST_NODE_TYPES.ObjectExpression)return e.body;if(e.body.type===G.AST_NODE_TYPES.BlockStatement){let t=e.body.body.filter(r=>r.type===G.AST_NODE_TYPES.ReturnStatement);return t.length!==1||!t[0]||t[0].argument?.type!==G.AST_NODE_TYPES.ObjectExpression?null:t[0].argument}return null}function gr(e,t){let r=e;if(t){let s=e.find(o=>o.type===G.AST_NODE_TYPES.Property&&o.key.type===G.AST_NODE_TYPES.Identifier&&o.key.name===t);if(s?.type!==G.AST_NODE_TYPES.Property||s.value.type!==G.AST_NODE_TYPES.ObjectPattern)return null;r=s.value.properties}let n=new Map;for(let s of r){if(s.type!==G.AST_NODE_TYPES.Property||s.key.type!==G.AST_NODE_TYPES.Identifier)return null;n.set(s.key.name,s)}return n.size>0?n:null}function Ks(e,t){let r=t.getDeclaredVariables(e);if(r.length!==1)return[];let n=r[0];return n?n.references.filter(s=>s.identifier!==e.id):[]}var Q=require("@typescript-eslint/utils");var nn=_({name:"no-unused-t-state-field",meta:{type:"suggestion",docs:{description:"Prevent declaring unused t-state fields"},messages:{unusedField:'Field "{{name}}" is not being used, you can safely remove it'},schema:[]},defaultOptions:[],create(e){if(!(e.filename.endsWith(".jsx")||e.filename.endsWith(".tsx")))return{};if(!e.sourceCode.ast.body.some(o=>o.type===Q.AST_NODE_TYPES.ImportDeclaration&&o.source.value==="t-state-form"))return{};let n=null,s=!1;return{CallExpression(o){if(s)return;if(!n){let p=Qs(o);p&&(n=p);return}let i=eo(o,e.sourceCode);if(i){s=!0;for(let p of i)n.delete(p);if(n.size!==0)for(let[p,a]of n)e.report({node:a,messageId:"unusedField",data:{name:p}})}}}}});function Qs(e){if(!(e.callee.type===Q.AST_NODE_TYPES.Identifier&&e.callee.name==="useForm"))return null;let r=e.arguments[0];if(!r||r.type!==Q.AST_NODE_TYPES.ObjectExpression)return null;let n=Dt(r.properties,o=>o.type!==Q.AST_NODE_TYPES.Property||o.key.type!==Q.AST_NODE_TYPES.Identifier||o.key.name!=="initialConfig"?null:o.value.type===Q.AST_NODE_TYPES.ObjectExpression?o.value:o.value.type===Q.AST_NODE_TYPES.ArrowFunctionExpression||o.value.type===Q.AST_NODE_TYPES.FunctionExpression?to(o.value):null);if(!n)return null;let s=new Map;for(let o of n.properties)o.type===Q.AST_NODE_TYPES.Property&&o.key.type===Q.AST_NODE_TYPES.Identifier&&s.set(o.key.name,o);return s}function eo(e,t){if(!(e.callee.type===Q.AST_NODE_TYPES.Identifier&&e.callee.name==="useFormState")||e.parent.type!==Q.AST_NODE_TYPES.VariableDeclarator||e.parent.id.type!==Q.AST_NODE_TYPES.ObjectPattern||!Dt(e.parent.id.properties,i=>i.type===Q.AST_NODE_TYPES.Property&&i.key.type===Q.AST_NODE_TYPES.Identifier&&i.key.name==="formFields"&&i))return null;let s=Gn(e.parent,"formFields",t),o=new Set;for(let{identifier:i}of s){if(i.type!==Q.AST_NODE_TYPES.Identifier||i.parent.type===Q.AST_NODE_TYPES.Property&&i.parent.parent.type===Q.AST_NODE_TYPES.ObjectExpression&&i.parent.parent.parent.type===Q.AST_NODE_TYPES.ReturnStatement||i.parent.type===Q.AST_NODE_TYPES.ReturnStatement)return null;if(i.parent.type===Q.AST_NODE_TYPES.MemberExpression){if(i.parent.object.type!==Q.AST_NODE_TYPES.Identifier||i.parent.property.type!==Q.AST_NODE_TYPES.Identifier)return null;o.add(i.parent.property.name)}}return o}function to(e){if(e.body.type===Q.AST_NODE_TYPES.ObjectExpression)return e.body;if(e.body.type===Q.AST_NODE_TYPES.BlockStatement){let t=e.body.body.filter(r=>r.type===Q.AST_NODE_TYPES.ReturnStatement);return t.length!==1||!t[0]||t[0].argument?.type!==Q.AST_NODE_TYPES.ObjectExpression?null:t[0].argument}return null}var Y=require("@typescript-eslint/utils"),rt=require("zod/v4");var no=Y.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`);function Sr(e){let t=[];for(let r of e.members)r.type===Y.AST_NODE_TYPES.TSPropertySignature&&r.key.type===Y.AST_NODE_TYPES.Identifier&&t.push([r.key.name,r]);return t}function Tr(e,...t){for(let r of t)e.set(...r);return e}var ro=rt.z.object({forceCheckOnFCPropTypesWithName:rt.z.array(rt.z.string()).optional(),alwaysCheckFunctionOptionTypes:rt.z.boolean().optional()}),hr="no-unused-type-props-in-args",rn=null,io=no({name:hr,meta:{type:"problem",docs:{description:"Disallow unused undestructured object type properties"},messages:{unusedObjectTypeProperty:"Object type property '{{ propertyName }}' is defined but never used",missingComponentParam:"Component has declared props but no props are used"},schema:[$(ro)],fixable:"code"},defaultOptions:[{alwaysCheckFunctionOptionTypes:!0}],create(e,[t]){let{forceCheckOnFCPropTypesWithName:r,alwaysCheckFunctionOptionTypes:n=!0}=t;r&&!rn&&(rn=r.map(a=>new RegExp(a)));function s(a,c,g,S,l=!0,E=!1){let f=g.name,h=e.sourceCode.getScope(c).references.find(y=>y.identifier.name===f)?.resolved,T=a&&rn?.some(y=>y.test(f)),m=E&&n;if(!h||!T&&h.references.filter(y=>y.isTypeReference).length>1||!h.defs[0])return;let b=h.defs[0].node,C=b.parent?.type===Y.AST_NODE_TYPES.ExportNamedDeclaration;if(!(l&&C&&!m)){if(b.type===Y.AST_NODE_TYPES.TSTypeAliasDeclaration){o(a,c,S,b.typeAnnotation,!0,E);return}if(b.type===Y.AST_NODE_TYPES.TSInterfaceDeclaration){o(a,c,S,b.body,!0,E);return}}}function o(a,c,g,S,l,E=!1){if(S.type===Y.AST_NODE_TYPES.TSInterfaceBody){for(let f of S.body)f.type===Y.AST_NODE_TYPES.TSPropertySignature&&f.key.type===Y.AST_NODE_TYPES.Identifier&&g.set(f.key.name,f);return}if(S.type===Y.AST_NODE_TYPES.TSTypeLiteral){Tr(g,...Sr(S));return}if(S.type===Y.AST_NODE_TYPES.TSIntersectionType){for(let f of S.types)o(a,c,g,f,!0,E);return}l||S.type===Y.AST_NODE_TYPES.TSTypeReference&&S.typeName.type===Y.AST_NODE_TYPES.Identifier&&s(a,c,S.typeName,g,!0,E)}function i(a,c,g,S=!1){for(let l of g)if(l.type===Y.AST_NODE_TYPES.ObjectPattern&&l.typeAnnotation){let E=new Map;if(o(a,c,E,l.typeAnnotation.typeAnnotation,!1,S),E.size===0)continue;p(l,E)}else l.type===Y.AST_NODE_TYPES.AssignmentPattern&&l.left.type===Y.AST_NODE_TYPES.ObjectPattern&&i(a,c,[l.left],S)}function p(a,c){let g=[];if(a.properties.at(-1)?.type===Y.AST_NODE_TYPES.RestElement)return;for(let f of a.properties)f.type===Y.AST_NODE_TYPES.Property&&f.key.type===Y.AST_NODE_TYPES.Identifier&&g.push(f.key.name);let l=[],E=[];for(let[f,h]of c)g.includes(f)||(E.push(f),l.push({node:h,messageId:"unusedObjectTypeProperty",data:{propertyName:f}}));for(let[f,h]of l.entries())e.report({...h,fix:f===l.length-1?T=>{let m=a.properties.at(-1),b=E.join(", ");return m?m.type===Y.AST_NODE_TYPES.RestElement?null:T.insertTextAfter(m,`, ${b}`):T.insertTextBeforeRange([a.range[0]+1,a.range[1]],b)}:void 0})}return{VariableDeclaration(a){let c=a.declarations[0],g=new Map,S=c.id.type===Y.AST_NODE_TYPES.Identifier&&c.id.typeAnnotation?.typeAnnotation.type===Y.AST_NODE_TYPES.TSTypeReference&&c.id.typeAnnotation.typeAnnotation.typeName.type===Y.AST_NODE_TYPES.Identifier&&c.id.typeAnnotation.typeAnnotation.typeName.name==="FC"&&c.id.typeAnnotation.typeAnnotation.typeArguments?.params[0];if(S){if(S.type===Y.AST_NODE_TYPES.TSTypeReference&&S.typeName.type===Y.AST_NODE_TYPES.Identifier)s(!0,a,S.typeName,g,!1);else if(S.type===Y.AST_NODE_TYPES.TSTypeLiteral)Tr(g,...Sr(S));else if(S.type===Y.AST_NODE_TYPES.TSIntersectionType)for(let l of S.types)l.type===Y.AST_NODE_TYPES.TSTypeReference&&l.typeName.type===Y.AST_NODE_TYPES.Identifier?s(!0,a,l.typeName,g,!1):o(!0,a,g,l,!0);if(g.size!==0&&c.init?.type===Y.AST_NODE_TYPES.ArrowFunctionExpression){let l=c.init.params[0];if(!l){e.report({node:c.init,messageId:"missingComponentParam"});return}l.type===Y.AST_NODE_TYPES.ObjectPattern&&p(l,g)}}},FunctionDeclaration(a){i(!1,a,a.params,n)},ArrowFunctionExpression(a){i(!1,a,a.params,n)}}}}),sn={name:hr,rule:io};var Ee=require("@typescript-eslint/utils");var on=_({name:"no-write-only-ref",meta:{type:"problem",docs:{description:"Disallow creating refs that are never read"},messages:{refNotRead:'Ref "{{name}}" is never read. Consider removing it if not needed.'},schema:[]},defaultOptions:[],create(e){let t=new Set;function r(n){return n.callee.type===Ee.AST_NODE_TYPES.Identifier?t.has(n.callee.name):n.callee.type===Ee.AST_NODE_TYPES.MemberExpression&&n.callee.object.type===Ee.AST_NODE_TYPES.Identifier&&n.callee.property.type===Ee.AST_NODE_TYPES.Identifier?n.callee.property.name==="useRef":!1}return{ImportDeclaration(n){if(n.source.value==="react")for(let s of n.specifiers)s.type===Ee.AST_NODE_TYPES.ImportSpecifier&&s.imported.type===Ee.AST_NODE_TYPES.Identifier&&s.imported.name==="useRef"&&t.add(s.local.name)},VariableDeclarator(n){if(n.init&&n.init.type===Ee.AST_NODE_TYPES.CallExpression&&r(n.init)&&n.id.type===Ee.AST_NODE_TYPES.Identifier){let o=e.sourceCode.getScope(n).set.get(n.id.name);if(o){let i=!1;for(let p of o.references){let c=p.identifier.parent;if(c!==n&&!(c.type===Ee.AST_NODE_TYPES.JSXExpressionContainer&&c.parent.type===Ee.AST_NODE_TYPES.JSXAttribute&&c.parent.name.type===Ee.AST_NODE_TYPES.JSXIdentifier&&c.parent.name.name==="ref")){i=!0;break}}i||e.report({node:n.id,messageId:"refNotRead",data:{name:n.id.name}})}}}}}});var qe=require("@typescript-eslint/utils"),so=qe.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),br="prefer-named-functions",Er=new Map,oo=so({name:br,meta:{hasSuggestions:!0,type:"suggestion",docs:{description:"Prevent using arrow functions when a named function can be used instead"},schema:[{type:"object",properties:{ignoreRegex:{type:"string"},disallowArrowFnWithImplicitReturns:{type:"boolean"}}}],messages:{suggestion:"Convert to named function",default:'Function {{functionName}} should be defined as a named function "function {{functionName}} () {}" instead of an arrow function',withIgnoreRegex:'Function {{functionName}} should be defined as a named function "function {{functionName}} () {}", if not possible to use `function` you can also use a name that matches the rule ignore regex'}},defaultOptions:[{}],create(e,[t]){let r=null;if(t.ignoreRegex){let n=Er.get(t.ignoreRegex);n?r=n:(r=new RegExp(t.ignoreRegex),Er.set(t.ignoreRegex,r))}return{VariableDeclarator(n){if(n.init&&n.init.type===qe.AST_NODE_TYPES.ArrowFunctionExpression&&n.id.type===qe.AST_NODE_TYPES.Identifier){let s=n.id.name;if(n.id.typeAnnotation||r&&r.test(s)||!t.disallowArrowFnWithImplicitReturns&&n.init.body.type!==qe.AST_NODE_TYPES.BlockStatement)return;let o=n.parent,i=n.init.params,p=n.init.body,a=n.init;e.report({node:n.id,messageId:r?"withIgnoreRegex":"default",data:{functionName:s,ignoreRegex:t.ignoreRegex},suggest:[{messageId:"suggestion",fix:c=>c.replaceText(o,`${a.async?"async ":""}function ${s}(${i.map(g=>e.sourceCode.getText(g)).join(", ")||""}) ${e.sourceCode.getText(p)}`)}]})}}}}}),an={name:br,rule:oo};var U=require("@typescript-eslint/utils"),Pe=require("zod/v4");var ao=Pe.z.object({disallowedFunctions:Pe.z.array(Pe.z.object({name:Pe.z.string(),allowUsingWithArgs:Pe.z.boolean().optional(),hookAlternative:Pe.z.string().optional(),message:Pe.z.string().optional(),allowUseInside:Pe.z.array(Pe.z.string()).optional()}))}),lo=/^use[A-Z]/,po=/^[A-Z]/;function St(e){return lo.test(e)}function xr(e){return po.test(e)}function co(e){return e.type===U.AST_NODE_TYPES.Identifier?St(e.name):e.type===U.AST_NODE_TYPES.MemberExpression&&e.property.type===U.AST_NODE_TYPES.Identifier?St(e.property.name):!1}function Cr(e,t){return e.type===U.AST_NODE_TYPES.Identifier?e.name===t:e.type===U.AST_NODE_TYPES.MemberExpression&&e.object.type===U.AST_NODE_TYPES.Identifier&&e.property.type===U.AST_NODE_TYPES.Identifier?e.object.name==="React"&&e.property.name===t:!1}function Ar(e){return!!(e.parent&&e.parent.type===U.AST_NODE_TYPES.CallExpression&&Cr(e.parent.callee,"forwardRef"))}function Ir(e){return!!(e.parent&&e.parent.type===U.AST_NODE_TYPES.CallExpression&&Cr(e.parent.callee,"memo"))}function ln(e){if(e.type===U.AST_NODE_TYPES.FunctionDeclaration||e.type===U.AST_NODE_TYPES.FunctionExpression&&e.id)return e.id||void 0;if(e.type===U.AST_NODE_TYPES.FunctionExpression||e.type===U.AST_NODE_TYPES.ArrowFunctionExpression){if(e.parent.type===U.AST_NODE_TYPES.VariableDeclarator&&e.parent.init===e)return e.parent.id;if(e.parent.type===U.AST_NODE_TYPES.AssignmentExpression&&e.parent.right===e&&e.parent.operator==="=")return e.parent.left;if(e.parent.type===U.AST_NODE_TYPES.Property&&e.parent.value===e&&!e.parent.computed)return e.parent.key;if(e.parent.type===U.AST_NODE_TYPES.AssignmentPattern&&e.parent.right===e)return e.parent.left}}function uo(e){let t=e.parent,r=!1;for(;t;){if(t.type===U.AST_NODE_TYPES.FunctionDeclaration||t.type===U.AST_NODE_TYPES.FunctionExpression||t.type===U.AST_NODE_TYPES.ArrowFunctionExpression){let n=ln(t);if(n&&n.type===U.AST_NODE_TYPES.Identifier){if(xr(n.name)||St(n.name))return!r;r=!0}else{if(Ar(t)||Ir(t))return!r;if(t.parent.type===U.AST_NODE_TYPES.CallExpression){let s=t.parent;co(s.callee)||(r=!0)}else t.parent.type===U.AST_NODE_TYPES.JSXExpressionContainer||(r=!0)}}t=t.parent}return!1}function wr(e){return e.callee.type===U.AST_NODE_TYPES.Identifier?e.callee.name:e.callee.type===U.AST_NODE_TYPES.MemberExpression&&e.callee.property.type===U.AST_NODE_TYPES.Identifier?e.callee.property.name:null}function fo(e,t){if(!t.length)return!1;let r=e.parent;for(;r;){if(r.type===U.AST_NODE_TYPES.FunctionDeclaration||r.type===U.AST_NODE_TYPES.FunctionExpression||r.type===U.AST_NODE_TYPES.ArrowFunctionExpression){let n=ln(r);if(n&&n.type===U.AST_NODE_TYPES.Identifier&&t.includes(n.name))return!0}else if(r.type===U.AST_NODE_TYPES.CallExpression){let n=wr(r);if(n&&t.includes(n))return!0}r=r.parent}return!1}function mo(e){return e.arguments.length>0&&!e.arguments.every(t=>t.type===U.AST_NODE_TYPES.Identifier&&t.name==="undefined")}function yo(e,t){let r=!1,n=e.parent;for(;n;){if(n.type===U.AST_NODE_TYPES.FunctionDeclaration||n.type===U.AST_NODE_TYPES.FunctionExpression||n.type===U.AST_NODE_TYPES.ArrowFunctionExpression){let s=ln(n);if(s&&s.type===U.AST_NODE_TYPES.Identifier){if(xr(s.name)||St(s.name)){r=!0;break}}else if(Ar(n)||Ir(n)){r=!0;break}}n=n.parent}return r?t.length===0?uo(e):!fo(e,t):!1}var pn=_({name:"prefer-react-hook-alternative",meta:{type:"suggestion",docs:{description:"Prefer hook alternatives for certain functions in React components and hooks"},messages:{preferHookAlternative:"This function should not be used in react{{message}}."},schema:[$(ao)],hasSuggestions:!0},defaultOptions:[{disallowedFunctions:[]}],create(e,[t]){let{disallowedFunctions:r}=t,n=new Map(r.map(s=>[s.name,s]));return{CallExpression(s){let o=wr(s);if(!o)return;let i=n.get(o);if(!i||i.allowUsingWithArgs&&mo(s))return;let p=i.allowUseInside||[];yo(s,p)&&e.report({node:s,messageId:"preferHookAlternative",data:{message:i.message?` ${i.message}`:` use ${i.hookAlternative} instead`},suggest:i.hookAlternative?[{messageId:"preferHookAlternative",data:{message:`Replace with ${i.hookAlternative}`,hookAlternative:i.hookAlternative},fix:a=>{let c=i.hookAlternative;return c?s.callee.type===U.AST_NODE_TYPES.Identifier?a.replaceText(s.callee,c):s.callee.type===U.AST_NODE_TYPES.MemberExpression&&s.callee.property.type===U.AST_NODE_TYPES.Identifier?a.replaceText(s.callee.property,c):null:null}}]:[]})}}}});var ee=require("@typescript-eslint/utils"),Tt=xe(require("zod/v4"));var go=ee.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),Pr="prefer-single-line-if",So=Tt.default.object({maxLineLength:Tt.default.number().optional(),maxNonSimpleConditionLength:Tt.default.number().optional()}),To=go({name:Pr,meta:{type:"suggestion",fixable:"code",docs:{description:"Enforce single-line if in simple if statements"},messages:{noSingleLineCurly:"If return statement with single statement body should be written in a single line"},schema:[$(So)]},defaultOptions:[{}],create(e,[t]){let r=e.sourceCode;return{IfStatement(n){if(n.consequent.type!==ee.AST_NODE_TYPES.BlockStatement||n.loc.start.line===n.loc.end.line||r.getCommentsInside(n.consequent).length>0||n.alternate||n.consequent.body.length!==1)return;let o=n.consequent.body[0];if(!o)return;if(o.type===ee.AST_NODE_TYPES.ReturnStatement){if(!kr(o))return}else if(!(o.type===ee.AST_NODE_TYPES.ContinueStatement||o.type===ee.AST_NODE_TYPES.BreakStatement))return;if(n.test.type===ee.AST_NODE_TYPES.LogicalExpression||n.test.type===ee.AST_NODE_TYPES.ConditionalExpression)return;let i;if(t.maxNonSimpleConditionLength){let S=Rr(n.test);if(!S&&n.test.type===ee.AST_NODE_TYPES.UnaryExpression&&n.test.operator==="!"){let l=n.test.argument;Rr(l)&&(S=!0)}if(S&&(i=r.getText(n.test),i.length>t.maxNonSimpleConditionLength))return}i||(i=r.getText(n.test));let p=r.getText(o);if(i.includes(`
18
- `))return;let a=r.getTokenAfter(n);if(a&&a.type===ee.AST_TOKEN_TYPES.Punctuator&&a.value==="}"){let S=r.getTokenAfter(a);if(S&&S.type===ee.AST_TOKEN_TYPES.Keyword&&(S.value==="else"||S.value==="catch"))return}let c=ho(r,n),g=`if (${i}) ${p}`;t.maxLineLength&&g.length+c.length>t.maxLineLength||e.report({node:n,messageId:"noSingleLineCurly",fix:S=>S.replaceText(n,g)})}}}});function Rr(e){return e.type===ee.AST_NODE_TYPES.CallExpression||e.type===ee.AST_NODE_TYPES.BinaryExpression||e.type===ee.AST_NODE_TYPES.MemberExpression&&vr(e)}function vr(e){return e.object.type===ee.AST_NODE_TYPES.MemberExpression?vr(e.object):e.object.type!==ee.AST_NODE_TYPES.Identifier}function ho(e,t){return e.text.slice(t.range[0]-t.loc.start.column,t.range[0])}function kr(e){if(!e.argument)return!0;let t=e.argument;return t.type===ee.AST_NODE_TYPES.ArrayExpression&&t.elements.length===0||t.type===ee.AST_NODE_TYPES.ObjectExpression&&t.properties.length===0||t.type===ee.AST_NODE_TYPES.Literal||t.type===ee.AST_NODE_TYPES.Identifier||t.type===ee.AST_NODE_TYPES.TemplateLiteral||t.type===ee.AST_NODE_TYPES.TaggedTemplateExpression?!0:t.type===ee.AST_NODE_TYPES.CallExpression?t.arguments.length===0:t.type===ee.AST_NODE_TYPES.UnaryExpression?kr(t):!1}var cn={name:Pr,rule:To};var N=require("@typescript-eslint/utils"),fn=require("zod/v4");var Eo=N.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),Dr="react-compiler-extra",bo=fn.z.object({runOnlyWithEnableCompilerDirective:fn.z.boolean().optional()}),xo=/eslint +react-compiler\/react-compiler: +\["error/;function jr(e){return e.type===N.AST_NODE_TYPES.Identifier?e.name.startsWith("use"):!1}function Co(e){return e.type===N.AST_NODE_TYPES.Identifier?e.name.startsWith("use"):e.type===N.AST_NODE_TYPES.MemberExpression&&e.property.type===N.AST_NODE_TYPES.Identifier?e.property.name.startsWith("use"):!1}function ve(e){if(!e)return!1;switch(e.type){case N.AST_NODE_TYPES.JSXElement:case N.AST_NODE_TYPES.JSXFragment:return!0;case N.AST_NODE_TYPES.ConditionalExpression:return ve(e.consequent)||ve(e.alternate);case N.AST_NODE_TYPES.LogicalExpression:return e.operator==="&&"?ve(e.right):e.operator==="||"?ve(e.left)||ve(e.right):!1;case N.AST_NODE_TYPES.CallExpression:if(e.callee.type===N.AST_NODE_TYPES.MemberExpression&&e.callee.object.type===N.AST_NODE_TYPES.Identifier&&e.callee.object.name==="React"&&e.callee.property.type===N.AST_NODE_TYPES.Identifier&&e.callee.property.name==="createElement")return!0;for(let t of e.arguments)if(t.type!==N.AST_NODE_TYPES.SpreadElement&&ve(t))return!0;return!1;default:return!1}}function Ao(e){let t=e.typeAnnotation;if(t.type===N.AST_NODE_TYPES.TSTypeReference){if(t.typeName.type===N.AST_NODE_TYPES.Identifier)return t.typeName.name==="FC";if(t.typeName.type===N.AST_NODE_TYPES.TSQualifiedName&&t.typeName.left.type===N.AST_NODE_TYPES.Identifier&&t.typeName.right.type===N.AST_NODE_TYPES.Identifier)return t.typeName.left.name==="React"&&t.typeName.right.name==="FC"}return!1}var Io=/^[A-Z][a-zA-Z0-9]*$/;function st(e){return Io.test(e)}function mn(e){return e.startsWith("use")&&e.length>3}function yn(e,t,r,n){if(r&&Ao(r))return t?st(t.name):e.type===N.AST_NODE_TYPES.FunctionDeclaration&&e.id?st(e.id.name):!0;if(t&&mn(t.name)||e.type===N.AST_NODE_TYPES.FunctionDeclaration&&e.id&&mn(e.id.name))return!0;if(n){let s=t?.name||e.type===N.AST_NODE_TYPES.FunctionDeclaration&&e.id?.name;if(s&&st(s)&&Lr(e.body,n).containsJSX)return!0}return!1}function it(e){if(e.body.type===N.AST_NODE_TYPES.BlockStatement){for(let t of e.body.body)if(t.type===N.AST_NODE_TYPES.ExpressionStatement&&t.expression.type===N.AST_NODE_TYPES.Literal&&typeof t.expression.value=="string"&&t.expression.value==="use memo")return!0}return!1}function Lr(e,t){let r={containsJSX:!1,containsHookCalls:!1};return we(e,n=>{if(r.containsJSX&&r.containsHookCalls)return!0;switch(n.type){case N.AST_NODE_TYPES.JSXElement:case N.AST_NODE_TYPES.JSXFragment:r.containsJSX=!0;break;case N.AST_NODE_TYPES.CallExpression:jr(n.callee)&&(r.containsHookCalls=!0),ve(n)&&(r.containsJSX=!0);break;case N.AST_NODE_TYPES.ReturnStatement:n.argument&&ve(n.argument)&&(r.containsJSX=!0);break;case N.AST_NODE_TYPES.VariableDeclarator:n.init&&ve(n.init)&&(r.containsJSX=!0);break;case N.AST_NODE_TYPES.AssignmentExpression:ve(n.right)&&(r.containsJSX=!0);break}},t),r}function Fr(e,t){let r=e.body,n=Lr(r,t);return n.containsJSX||n.containsHookCalls}var wo=/\bthis[.[]/;function Or(e){return wo.test(e)}function Ro(e,t){let r={containsJSX:!1,containsHookCalls:!1};return we(e,n=>{if(r.containsHookCalls||(n.type===N.AST_NODE_TYPES.FunctionDeclaration||n.type===N.AST_NODE_TYPES.FunctionExpression||n.type===N.AST_NODE_TYPES.ArrowFunctionExpression)&&n!==e)return!0;n.type===N.AST_NODE_TYPES.CallExpression&&Co(n.callee)&&(r.containsHookCalls=!0)},t),r}function Nr(e){return st(e)||mn(e)}function un(e,t,r,n){if(!Ro(e.body,t).containsHookCalls)return!1;let o=yn(e,r,n,t);if(!o&&n){let i=r?.name||e.type===N.AST_NODE_TYPES.FunctionDeclaration&&e.id?.name;i&&st(i)&&(o=!0)}return!o}var Po=Eo({name:Dr,meta:{type:"suggestion",fixable:"code",docs:{description:"Extra rules to enforce best practices when using the React compiler"},messages:{objectMethodIsNotSupported:"Object methods such as `{ method() {} }` have limited support to optimizations in the React compiler, use a function expression `{ method: () => {} }` instead.",replaceWithFunctionExpression:"Replace with function expression",thisKeywordInMethod:"Object method uses `this` keyword which would have different behavior if converted to an arrow function. Fix this manually.",fcComponentShouldReturnJsx:'React components and hooks should create JSX elements, call other hooks or use the "use memo" directive for optimal React compiler detection.',addUseMemoDirective:'Add "use memo" directive to opt into React compiler memoization',functionCallingHooksMustBeComponent:'Functions calling hooks must be React components (PascalCase with FC type) or hooks (start with "use").',useMemoDirectiveNaming:'Functions using "use memo" directive must follow React naming conventions (PascalCase for components or start with "use" for hooks).'},hasSuggestions:!0,schema:[$(bo)]},defaultOptions:[{}],create(e,[t]){let r=!1;if(t.runOnlyWithEnableCompilerDirective){for(let o of e.sourceCode.getAllComments())if(xo.test(o.value)){r=!0;break}if(!r)return{}}function n(o){for(let i of o.properties)if(i.type===N.AST_NODE_TYPES.Property&&i.method&&i.value.type===N.AST_NODE_TYPES.FunctionExpression){let p=e.sourceCode,a=p.getText(i.key),c=i.value,g=p.getText(c.body);if(Or(g))e.report({node:i,messageId:"thisKeywordInMethod"});else{let S=c.params.map(E=>p.getText(E)).join(", "),l="";c.generator?l=`${a}: function* (${S}) ${g}`:l=`${a}: (${S}) => ${g}`,e.report({node:i,messageId:"objectMethodIsNotSupported",fix:E=>E.replaceText(i,l)})}}}function s(o){for(let i of o.properties)if(i.type===N.AST_NODE_TYPES.Property&&i.value.type===N.AST_NODE_TYPES.ObjectExpression){for(let p of i.value.properties)if(p.type===N.AST_NODE_TYPES.Property&&p.method&&p.value.type===N.AST_NODE_TYPES.FunctionExpression){let c=e.sourceCode.getText(p.value.body);Or(c)&&e.report({node:p,messageId:"thisKeywordInMethod"})}}}return{CallExpression(o){if(jr(o.callee))for(let i of o.arguments){if(i.type===N.AST_NODE_TYPES.ObjectExpression&&(n(i),s(i)),i.type===N.AST_NODE_TYPES.ArrowFunctionExpression&&(i.body.type===N.AST_NODE_TYPES.ObjectExpression&&(n(i.body),s(i.body)),i.body.type===N.AST_NODE_TYPES.BlockStatement))for(let p of i.body.body)p.type===N.AST_NODE_TYPES.ReturnStatement&&p.argument?.type===N.AST_NODE_TYPES.ObjectExpression&&(n(p.argument),s(p.argument));if(i.type===N.AST_NODE_TYPES.FunctionExpression)for(let p of i.body.body)p.type===N.AST_NODE_TYPES.ReturnStatement&&p.argument?.type===N.AST_NODE_TYPES.ObjectExpression&&(n(p.argument),s(p.argument))}},VariableDeclarator(o){if(o.id.type===N.AST_NODE_TYPES.Identifier&&o.init&&(o.init.type===N.AST_NODE_TYPES.ArrowFunctionExpression||o.init.type===N.AST_NODE_TYPES.FunctionExpression)){let i=o.init,p=o.id,a=o.id.typeAnnotation;if(it(i)&&!Nr(p.name)){e.report({node:i,messageId:"useMemoDirectiveNaming"});return}if(un(i,e.sourceCode,p,a)){e.report({node:i,messageId:"functionCallingHooksMustBeComponent"});return}if(yn(i,p,a,e.sourceCode)){let c=Fr(i,e.sourceCode),g=it(i);!c&&!g&&e.report({node:i,messageId:"fcComponentShouldReturnJsx",suggest:[{messageId:"addUseMemoDirective",fix(S){if(i.body.type===N.AST_NODE_TYPES.BlockStatement){let l=i.body.range[0]+1;return S.insertTextAfterRange([l,l],`
17
+ `)}return""}return{Program(){let a=[];for(let l of n.body)l.type===be.AST_NODE_TYPES.ExpressionStatement&&l.expression.type===be.AST_NODE_TYPES.CallExpression&&l.expression.callee.type===be.AST_NODE_TYPES.Identifier&&l.expression.callee.name==="describe"&&l.expression.arguments.length===2&&a.push(l.expression);if(!i(a))return;let[c]=a;if(!c)return;let d=o(c);if(s(d))return;let y=n.body.find(l=>l.type===be.AST_NODE_TYPES.ExpressionStatement&&l.expression===c);!y||y.type!==be.AST_NODE_TYPES.ExpressionStatement||e.report({node:c,messageId:"unnecessaryDescribe",suggest:[{messageId:"removeDescribe",fix(l){let h=p(c);return h?l.replaceText(y,h):null}}]})}}}});var at=require("@typescript-eslint/utils"),De=ke(require("zod/v4"));var Ho=De.object({methods:De.union([De.array(De.string()),De.literal("array")])}),nn=H({name:"no-unnecessary-typing",meta:{type:"suggestion",docs:{description:"Prevents unnecessary explicit type annotations in callback parameters where TypeScript can infer the type"},messages:{unnecessaryTypeAnnotation:"Unnecessary type annotation. TypeScript can infer this type from context."},fixable:"code",schema:[V(Ho)]},defaultOptions:[{methods:"array"}],create(e,[t]){let r=t.methods,n=new Set(["find","filter","map","forEach","some","every","reduce","findIndex","sort"]);function o(p){return Array.isArray(r)?r.includes(p):n.has(p)}function s(p){let{callee:a}=p;if(a.type===at.AST_NODE_TYPES.MemberExpression){let c=a.property;if(c.type===at.AST_NODE_TYPES.Identifier)return c.name}return null}function i(p,a){if(p.type!==at.AST_NODE_TYPES.Identifier||!p.typeAnnotation)return;let c=a.parent;if(c.type===at.AST_NODE_TYPES.CallExpression){let d=s(c);d&&o(d)&&c.arguments.indexOf(a)===0&&e.report({node:p.typeAnnotation,messageId:"unnecessaryTypeAnnotation",fix(l){return p.typeAnnotation?l.remove(p.typeAnnotation):null}})}}return{ArrowFunctionExpression(p){for(let a of p.params)i(a,p)},FunctionExpression(p){for(let a of p.params)i(a,p)}}}});var Ee=require("@typescript-eslint/utils");var rn=H({name:"no-unused-obj-props",meta:{type:"suggestion",docs:{description:"Disallow unused properties when it is safe to remove them"},messages:{unusedObjectProperty:'The object property "{{name}}" is not being used',unusedReturnObjectProperty:'The object property "{{name}}" returned by this function is not being used'},schema:[]},defaultOptions:[],create(e){return{VariableDeclarator(t){if(t.id.type===Ee.AST_NODE_TYPES.ObjectPattern||!t.init||t.init.type!==Ee.AST_NODE_TYPES.ObjectExpression||t.id.type===Ee.AST_NODE_TYPES.Identifier&&t.id.typeAnnotation||t.parent.parent.type===Ee.AST_NODE_TYPES.ExportNamedDeclaration)return;let r=new Map;for(let i of t.init.properties)i.type===Ee.AST_NODE_TYPES.Property&&i.key.type===Ee.AST_NODE_TYPES.Identifier&&r.set(i.key.name,i);if(r.size===0||t.id.type!==Ee.AST_NODE_TYPES.Identifier)return;let n=Bo(t,e.sourceCode);if(n.length===0)return;let o=t.init.properties.some(i=>i.type!==Ee.AST_NODE_TYPES.Property?!1:i.value.type===Ee.AST_NODE_TYPES.FunctionExpression),s=new Set;for(let i of n){if(i.identifier.parent.type!==Ee.AST_NODE_TYPES.MemberExpression)return;let p=i.identifier.parent;if(p.object!==i.identifier)return;if(p.computed)if(p.property.type===Ee.AST_NODE_TYPES.Literal&&typeof p.property.value=="string")s.add(p.property.value);else return;else{if(p.property.type!==Ee.AST_NODE_TYPES.Identifier)return;s.add(p.property.name)}if(p.parent.type===Ee.AST_NODE_TYPES.CallExpression&&o)return}for(let[i,p]of r)s.has(i)||e.report({node:p,messageId:"unusedObjectProperty",data:{name:i}})}}}});function Bo(e,t){let r=t.getDeclaredVariables(e);if(r.length!==1)return[];let n=r[0];return n?n.references.filter(o=>o.identifier!==e.id):[]}var Z=require("@typescript-eslint/utils"),on=require("zod/v4");var Yo=on.z.object({ignoreArgsMatching:on.z.string().optional()}),sn=H({name:"no-unused-optional-args",meta:{type:"problem",docs:{description:"Detect unused optional function arguments in non-exported functions"},messages:{unusedOptionalArg:"Optional parameter '{{name}}' is never used",unusedOptionalProp:"Optional prop '{{name}}' is never provided"},schema:[V(Yo)]},defaultOptions:[{}],create(e,[t]){let r=[];function n(i){return t.ignoreArgsMatching?new RegExp(t.ignoreArgsMatching).test(i):!1}function o(i){return i.type===Z.AST_NODE_TYPES.ExportNamedDeclaration||i.type===Z.AST_NODE_TYPES.ExportDefaultDeclaration||i.parent?.type===Z.AST_NODE_TYPES.ExportNamedDeclaration||i.parent?.type===Z.AST_NODE_TYPES.ExportDefaultDeclaration}function s(i){let p=[];for(let a=0;a<i.length;a++){let c=i[a];if(!c||c.type!==Z.AST_NODE_TYPES.Identifier)continue;let d=c.name;if(!n(d)){if(c.optional&&c.typeAnnotation&&c.typeAnnotation.typeAnnotation.type===Z.AST_NODE_TYPES.TSTypeLiteral){let y=c.typeAnnotation.typeAnnotation,l=[];for(let h of y.members)h.type===Z.AST_NODE_TYPES.TSPropertySignature&&h.key.type===Z.AST_NODE_TYPES.Identifier&&l.push({name:h.key.name,optional:h.optional===!0});l.some(h=>h.optional)?p.push({param:c,index:a,name:d,isObjectParam:!0,objectProps:l}):p.push({param:c,index:a,name:d,isObjectParam:!1})}else if(c.optional)p.push({param:c,index:a,name:d,isObjectParam:!1});else if(c.typeAnnotation&&c.typeAnnotation.typeAnnotation.type===Z.AST_NODE_TYPES.TSTypeLiteral){let y=c.typeAnnotation.typeAnnotation,l=[];for(let h of y.members)h.type===Z.AST_NODE_TYPES.TSPropertySignature&&h.key.type===Z.AST_NODE_TYPES.Identifier&&l.push({name:h.key.name,optional:h.optional===!0});l.some(h=>h.optional)&&p.push({param:c,index:a,name:d,isObjectParam:!0,objectProps:l})}}}return p}return{FunctionDeclaration(i){if(o(i))return;let p=s(i.params);p.length!==0&&r.push({node:i,declarationNode:i,optionalParams:p})},VariableDeclarator(i){if(i.id.type!==Z.AST_NODE_TYPES.Identifier||!i.init||i.init.type!==Z.AST_NODE_TYPES.ArrowFunctionExpression&&i.init.type!==Z.AST_NODE_TYPES.FunctionExpression||o(i.parent.parent))return;let a=[...s(i.init.params)];if(i.id.typeAnnotation&&i.id.typeAnnotation.typeAnnotation.type===Z.AST_NODE_TYPES.TSTypeReference){let c=i.id.typeAnnotation.typeAnnotation;if(c.typeName.type===Z.AST_NODE_TYPES.Identifier&&c.typeName.name==="FC"){let d=c.typeArguments;if(d&&d.params.length===1){let y=d.params[0];if(y&&y.type===Z.AST_NODE_TYPES.TSTypeLiteral){let l=[];for(let h of y.members)h.type===Z.AST_NODE_TYPES.TSPropertySignature&&h.key.type===Z.AST_NODE_TYPES.Identifier&&l.push({name:h.key.name,optional:h.optional===!0});l.some(h=>h.optional)&&a.push({param:i.id,index:0,name:"props",isObjectParam:!0,objectProps:l})}}}}a.length!==0&&r.push({node:i.init,declarationNode:i,optionalParams:a})},"Program:exit"(){for(let i of r){let a=e.sourceCode.getDeclaredVariables(i.declarationNode)[0];if(!a)continue;let c=a.references.filter(l=>l.identifier!==a.identifiers[0]);if(c.length===0)continue;let d=!1;for(let l of c){let h=l.identifier.parent;if(h.type===Z.AST_NODE_TYPES.CallExpression&&l.identifier.type===Z.AST_NODE_TYPES.Identifier&&h.arguments.includes(l.identifier)){d=!0;break}if(h.type===Z.AST_NODE_TYPES.ReturnStatement){d=!0;break}if(h.type===Z.AST_NODE_TYPES.Property&&h.parent.type===Z.AST_NODE_TYPES.ObjectExpression&&h.parent.parent.type===Z.AST_NODE_TYPES.ReturnStatement){d=!0;break}if(h.type===Z.AST_NODE_TYPES.JSXExpressionContainer){d=!0;break}}if(d)continue;let y=[];for(let l of c){let h=l.identifier.parent;if(h.type===Z.AST_NODE_TYPES.CallExpression&&h.callee===l.identifier){let u=h.arguments.length,S=h.arguments.some(f=>f.type===Z.AST_NODE_TYPES.SpreadElement);if(S){d=!0;break}let g={argCount:u,hasSpread:S};for(let f of i.optionalParams)if(f.isObjectParam&&f.index<u){let E=h.arguments[f.index];if(E?.type===Z.AST_NODE_TYPES.ObjectExpression){let x={};for(let m of E.properties)m.type===Z.AST_NODE_TYPES.Property&&m.key.type===Z.AST_NODE_TYPES.Identifier&&(x[m.key.name]=!0);g.objectArgs||(g.objectArgs=[]),g.objectArgs[f.index]=x}else if(E){d=!0;break}}y.push(g)}else if(h.type===Z.AST_NODE_TYPES.JSXOpeningElement&&h.name===l.identifier){let u=h.attributes.some(g=>g.type===Z.AST_NODE_TYPES.JSXSpreadAttribute);if(u){d=!0;break}let S={argCount:1,hasSpread:u};for(let g of i.optionalParams)if(g.isObjectParam&&g.index===0){let f={};for(let E of h.attributes)E.type===Z.AST_NODE_TYPES.JSXAttribute&&E.name.type===Z.AST_NODE_TYPES.JSXIdentifier&&(f[E.name.name]=!0);S.objectArgs||(S.objectArgs=[]),S.objectArgs[0]=f}y.push(S)}}if(!(d||y.length===0))for(let l of i.optionalParams)if(l.isObjectParam&&l.objectProps)for(let h of l.objectProps){if(!h.optional)continue;let u=!1;for(let S of y)if(S.objectArgs&&S.objectArgs[l.index]){let g=S.objectArgs[l.index];if(g&&g[h.name]){u=!0;break}}u||e.report({node:l.param,messageId:"unusedOptionalProp",data:{name:h.name}})}else{let h=!1;for(let u of y)if(u.argCount>l.index){h=!0;break}h||e.report({node:l.param,messageId:"unusedOptionalArg",data:{name:l.name}})}}}}}});var oe=require("@typescript-eslint/utils"),He=require("zod/v4");var qo=He.z.object({selectors:He.z.array(He.z.object({name:He.z.string(),selectorProp:He.z.string().optional(),selectorArgPos:He.z.number().optional(),returnProp:He.z.string().optional()}))}),Zo=oe.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),Tr="no-unused-selected-values",an={name:Tr,rule:Zo({name:Tr,meta:{type:"suggestion",docs:{description:"Disallow unused values in selector objects"},messages:{unusedSelectedValue:'The selected value "{{name}}" is not being used'},schema:[V(qo)]},defaultOptions:[{selectors:[]}],create(e,[t]){let{selectors:r=[]}=t,n=new Map(r.map(o=>[o.name,o]));return{VariableDeclarator(o){let s=null;if(o.init?.type===oe.AST_NODE_TYPES.CallExpression&&(s=o.init),!s)return;let i=Ko(s);if(!i)return;let p=n.get(i);if(!p)return;let a=Go(s,p.selectorArgPos??0,p.selectorProp);if(!a)return;let c=Qo(a);if(!c)return;let d=hr(c.properties,void 0);if(!d)return;if(o.id.type===oe.AST_NODE_TYPES.ObjectPattern){let h=hr(o.id.properties,p.returnProp);if(!h)return;for(let[u,S]of d)h.has(u)||e.report({node:S,messageId:"unusedSelectedValue",data:{name:u}});return}if(o.id.type!==oe.AST_NODE_TYPES.Identifier||p.returnProp)return;let y=es(o,e.sourceCode);if(y.length===0)return;let l=new Set;for(let h of y){if(h.identifier.parent.type!==oe.AST_NODE_TYPES.MemberExpression)return;let u=h.identifier.parent.property;if(u.type!==oe.AST_NODE_TYPES.Identifier)return;l.add(u.name)}for(let[h,u]of d)l.has(h)||e.report({node:u,messageId:"unusedSelectedValue",data:{name:h}})}}}})};function Go(e,t,r){let n=e.arguments[t];if(!n)return null;if(n.type===oe.AST_NODE_TYPES.ArrowFunctionExpression||n.type===oe.AST_NODE_TYPES.FunctionExpression)return n;if(r&&n.type===oe.AST_NODE_TYPES.ObjectExpression){let o=n.properties.find(i=>i.type===oe.AST_NODE_TYPES.Property&&i.key.type===oe.AST_NODE_TYPES.Identifier&&i.key.name===r);if(o?.type!==oe.AST_NODE_TYPES.Property)return null;let s=o.value;if(s.type===oe.AST_NODE_TYPES.ArrowFunctionExpression||s.type===oe.AST_NODE_TYPES.FunctionExpression)return s}return null}function Ko(e){return e.callee.type===oe.AST_NODE_TYPES.Identifier?e.callee.name:e.callee.type===oe.AST_NODE_TYPES.MemberExpression&&e.callee.property.type===oe.AST_NODE_TYPES.Identifier?e.callee.property.name:null}function Qo(e){if(e.body.type===oe.AST_NODE_TYPES.ObjectExpression)return e.body;if(e.body.type===oe.AST_NODE_TYPES.BlockStatement){let t=e.body.body.filter(r=>r.type===oe.AST_NODE_TYPES.ReturnStatement);return t.length!==1||!t[0]||t[0].argument?.type!==oe.AST_NODE_TYPES.ObjectExpression?null:t[0].argument}return null}function hr(e,t){let r=e;if(t){let o=e.find(s=>s.type===oe.AST_NODE_TYPES.Property&&s.key.type===oe.AST_NODE_TYPES.Identifier&&s.key.name===t);if(o?.type!==oe.AST_NODE_TYPES.Property||o.value.type!==oe.AST_NODE_TYPES.ObjectPattern)return null;r=o.value.properties}let n=new Map;for(let o of r){if(o.type!==oe.AST_NODE_TYPES.Property||o.key.type!==oe.AST_NODE_TYPES.Identifier)return null;n.set(o.key.name,o)}return n.size>0?n:null}function es(e,t){let r=t.getDeclaredVariables(e);if(r.length!==1)return[];let n=r[0];return n?n.references.filter(o=>o.identifier!==e.id):[]}var se=require("@typescript-eslint/utils");var ln=H({name:"no-unused-t-state-field",meta:{type:"suggestion",docs:{description:"Prevent declaring unused t-state fields"},messages:{unusedField:'Field "{{name}}" is not being used, you can safely remove it'},schema:[]},defaultOptions:[],create(e){if(!(e.filename.endsWith(".jsx")||e.filename.endsWith(".tsx")))return{};if(!e.sourceCode.ast.body.some(s=>s.type===se.AST_NODE_TYPES.ImportDeclaration&&s.source.value==="t-state-form"))return{};let n=null,o=!1;return{CallExpression(s){if(o)return;if(!n){let p=ts(s);p&&(n=p);return}let i=ns(s,e.sourceCode);if(i){o=!0;for(let p of i)n.delete(p);if(n.size!==0)for(let[p,a]of n)e.report({node:a,messageId:"unusedField",data:{name:p}})}}}}});function ts(e){if(!(e.callee.type===se.AST_NODE_TYPES.Identifier&&e.callee.name==="useForm"))return null;let r=e.arguments[0];if(!r||r.type!==se.AST_NODE_TYPES.ObjectExpression)return null;let n=_t(r.properties,s=>s.type!==se.AST_NODE_TYPES.Property||s.key.type!==se.AST_NODE_TYPES.Identifier||s.key.name!=="initialConfig"?null:s.value.type===se.AST_NODE_TYPES.ObjectExpression?s.value:s.value.type===se.AST_NODE_TYPES.ArrowFunctionExpression||s.value.type===se.AST_NODE_TYPES.FunctionExpression?rs(s.value):null);if(!n)return null;let o=new Map;for(let s of n.properties)s.type===se.AST_NODE_TYPES.Property&&s.key.type===se.AST_NODE_TYPES.Identifier&&o.set(s.key.name,s);return o}function ns(e,t){if(!(e.callee.type===se.AST_NODE_TYPES.Identifier&&e.callee.name==="useFormState")||e.parent.type!==se.AST_NODE_TYPES.VariableDeclarator||e.parent.id.type!==se.AST_NODE_TYPES.ObjectPattern||!_t(e.parent.id.properties,i=>i.type===se.AST_NODE_TYPES.Property&&i.key.type===se.AST_NODE_TYPES.Identifier&&i.key.name==="formFields"&&i))return null;let o=er(e.parent,"formFields",t),s=new Set;for(let{identifier:i}of o){if(i.type!==se.AST_NODE_TYPES.Identifier||i.parent.type===se.AST_NODE_TYPES.Property&&i.parent.parent.type===se.AST_NODE_TYPES.ObjectExpression&&i.parent.parent.parent.type===se.AST_NODE_TYPES.ReturnStatement||i.parent.type===se.AST_NODE_TYPES.ReturnStatement)return null;if(i.parent.type===se.AST_NODE_TYPES.MemberExpression){if(i.parent.object.type!==se.AST_NODE_TYPES.Identifier||i.parent.property.type!==se.AST_NODE_TYPES.Identifier)return null;s.add(i.parent.property.name)}}return s}function rs(e){if(e.body.type===se.AST_NODE_TYPES.ObjectExpression)return e.body;if(e.body.type===se.AST_NODE_TYPES.BlockStatement){let t=e.body.body.filter(r=>r.type===se.AST_NODE_TYPES.ReturnStatement);return t.length!==1||!t[0]||t[0].argument?.type!==se.AST_NODE_TYPES.ObjectExpression?null:t[0].argument}return null}var ee=require("@typescript-eslint/utils"),lt=require("zod/v4");var is=ee.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`);function Er(e){let t=[];for(let r of e.members)r.type===ee.AST_NODE_TYPES.TSPropertySignature&&r.key.type===ee.AST_NODE_TYPES.Identifier&&t.push([r.key.name,r]);return t}function br(e,...t){for(let r of t)e.set(...r);return e}var os=lt.z.object({forceCheckOnFCPropTypesWithName:lt.z.array(lt.z.string()).optional(),alwaysCheckFunctionOptionTypes:lt.z.boolean().optional()}),xr="no-unused-type-props-in-args",pn=null,ss=is({name:xr,meta:{type:"problem",docs:{description:"Disallow unused undestructured object type properties"},messages:{unusedObjectTypeProperty:"Object type property '{{ propertyName }}' is defined but never used",missingComponentParam:"Component has declared props but no props are used"},schema:[V(os)],fixable:"code"},defaultOptions:[{alwaysCheckFunctionOptionTypes:!0}],create(e,[t]){let{forceCheckOnFCPropTypesWithName:r,alwaysCheckFunctionOptionTypes:n=!0}=t;r&&!pn&&(pn=r.map(a=>new RegExp(a)));function o(a,c,d,y,l=!0,h=!1){let u=d.name,S=e.sourceCode.getScope(c).references.find(m=>m.identifier.name===u)?.resolved,g=a&&pn?.some(m=>m.test(u)),f=h&&n;if(!S||!g&&S.references.filter(m=>m.isTypeReference).length>1||!S.defs[0])return;let E=S.defs[0].node,x=E.parent?.type===ee.AST_NODE_TYPES.ExportNamedDeclaration;if(!(l&&x&&!f)){if(E.type===ee.AST_NODE_TYPES.TSTypeAliasDeclaration){s(a,c,y,E.typeAnnotation,!0,h);return}if(E.type===ee.AST_NODE_TYPES.TSInterfaceDeclaration){s(a,c,y,E.body,!0,h);return}}}function s(a,c,d,y,l,h=!1){if(y.type===ee.AST_NODE_TYPES.TSInterfaceBody){for(let u of y.body)u.type===ee.AST_NODE_TYPES.TSPropertySignature&&u.key.type===ee.AST_NODE_TYPES.Identifier&&d.set(u.key.name,u);return}if(y.type===ee.AST_NODE_TYPES.TSTypeLiteral){br(d,...Er(y));return}if(y.type===ee.AST_NODE_TYPES.TSIntersectionType){for(let u of y.types)s(a,c,d,u,!0,h);return}l||y.type===ee.AST_NODE_TYPES.TSTypeReference&&y.typeName.type===ee.AST_NODE_TYPES.Identifier&&o(a,c,y.typeName,d,!0,h)}function i(a,c,d,y=!1){for(let l of d)if(l.type===ee.AST_NODE_TYPES.ObjectPattern&&l.typeAnnotation){let h=new Map;if(s(a,c,h,l.typeAnnotation.typeAnnotation,!1,y),h.size===0)continue;p(l,h)}else l.type===ee.AST_NODE_TYPES.AssignmentPattern&&l.left.type===ee.AST_NODE_TYPES.ObjectPattern&&i(a,c,[l.left],y)}function p(a,c){let d=[];if(a.properties.at(-1)?.type===ee.AST_NODE_TYPES.RestElement)return;for(let u of a.properties)u.type===ee.AST_NODE_TYPES.Property&&u.key.type===ee.AST_NODE_TYPES.Identifier&&d.push(u.key.name);let l=[],h=[];for(let[u,S]of c)d.includes(u)||(h.push(u),l.push({node:S,messageId:"unusedObjectTypeProperty",data:{propertyName:u}}));for(let[u,S]of l.entries())e.report({...S,fix:u===l.length-1?g=>{let f=a.properties.at(-1),E=h.join(", ");return f?f.type===ee.AST_NODE_TYPES.RestElement?null:g.insertTextAfter(f,`, ${E}`):g.insertTextBeforeRange([a.range[0]+1,a.range[1]],E)}:void 0})}return{VariableDeclaration(a){let c=a.declarations[0],d=new Map,y=c.id.type===ee.AST_NODE_TYPES.Identifier&&c.id.typeAnnotation?.typeAnnotation.type===ee.AST_NODE_TYPES.TSTypeReference&&c.id.typeAnnotation.typeAnnotation.typeName.type===ee.AST_NODE_TYPES.Identifier&&c.id.typeAnnotation.typeAnnotation.typeName.name==="FC"&&c.id.typeAnnotation.typeAnnotation.typeArguments?.params[0];if(y){if(y.type===ee.AST_NODE_TYPES.TSTypeReference&&y.typeName.type===ee.AST_NODE_TYPES.Identifier)o(!0,a,y.typeName,d,!1);else if(y.type===ee.AST_NODE_TYPES.TSTypeLiteral)br(d,...Er(y));else if(y.type===ee.AST_NODE_TYPES.TSIntersectionType)for(let l of y.types)l.type===ee.AST_NODE_TYPES.TSTypeReference&&l.typeName.type===ee.AST_NODE_TYPES.Identifier?o(!0,a,l.typeName,d,!1):s(!0,a,d,l,!0);if(d.size!==0&&c.init?.type===ee.AST_NODE_TYPES.ArrowFunctionExpression){let l=c.init.params[0];if(!l){e.report({node:c.init,messageId:"missingComponentParam"});return}l.type===ee.AST_NODE_TYPES.ObjectPattern&&p(l,d)}}},FunctionDeclaration(a){i(!1,a,a.params,n)},ArrowFunctionExpression(a){i(!1,a,a.params,n)}}}}),cn={name:xr,rule:ss};var ve=require("@typescript-eslint/utils");var un=H({name:"no-write-only-ref",meta:{type:"problem",docs:{description:"Disallow creating refs that are never read"},messages:{refNotRead:'Ref "{{name}}" is never read. Consider removing it if not needed.'},schema:[]},defaultOptions:[],create(e){let t=new Set;function r(n){return n.callee.type===ve.AST_NODE_TYPES.Identifier?t.has(n.callee.name):n.callee.type===ve.AST_NODE_TYPES.MemberExpression&&n.callee.object.type===ve.AST_NODE_TYPES.Identifier&&n.callee.property.type===ve.AST_NODE_TYPES.Identifier?n.callee.property.name==="useRef":!1}return{ImportDeclaration(n){if(n.source.value==="react")for(let o of n.specifiers)o.type===ve.AST_NODE_TYPES.ImportSpecifier&&o.imported.type===ve.AST_NODE_TYPES.Identifier&&o.imported.name==="useRef"&&t.add(o.local.name)},VariableDeclarator(n){if(n.init&&n.init.type===ve.AST_NODE_TYPES.CallExpression&&r(n.init)&&n.id.type===ve.AST_NODE_TYPES.Identifier){let s=e.sourceCode.getScope(n).set.get(n.id.name);if(s){let i=!1;for(let p of s.references){let c=p.identifier.parent;if(c!==n&&!(c.type===ve.AST_NODE_TYPES.JSXExpressionContainer&&c.parent.type===ve.AST_NODE_TYPES.JSXAttribute&&c.parent.name.type===ve.AST_NODE_TYPES.JSXIdentifier&&c.parent.name.name==="ref")){i=!0;break}}i||e.report({node:n.id,messageId:"refNotRead",data:{name:n.id.name}})}}}}}});var et=require("@typescript-eslint/utils"),as=et.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),Ir="prefer-named-functions",Cr=new Map,ls=as({name:Ir,meta:{hasSuggestions:!0,type:"suggestion",docs:{description:"Prevent using arrow functions when a named function can be used instead"},schema:[{type:"object",properties:{ignoreRegex:{type:"string"},disallowArrowFnWithImplicitReturns:{type:"boolean"}}}],messages:{suggestion:"Convert to named function",default:'Function {{functionName}} should be defined as a named function "function {{functionName}} () {}" instead of an arrow function',withIgnoreRegex:'Function {{functionName}} should be defined as a named function "function {{functionName}} () {}", if not possible to use `function` you can also use a name that matches the rule ignore regex'}},defaultOptions:[{}],create(e,[t]){let r=null;if(t.ignoreRegex){let n=Cr.get(t.ignoreRegex);n?r=n:(r=new RegExp(t.ignoreRegex),Cr.set(t.ignoreRegex,r))}return{VariableDeclarator(n){if(n.init&&n.init.type===et.AST_NODE_TYPES.ArrowFunctionExpression&&n.id.type===et.AST_NODE_TYPES.Identifier){let o=n.id.name;if(n.id.typeAnnotation||r&&r.test(o)||!t.disallowArrowFnWithImplicitReturns&&n.init.body.type!==et.AST_NODE_TYPES.BlockStatement)return;let s=n.parent,i=n.init.params,p=n.init.body,a=n.init;e.report({node:n.id,messageId:r?"withIgnoreRegex":"default",data:{functionName:o,ignoreRegex:t.ignoreRegex},suggest:[{messageId:"suggestion",fix:c=>c.replaceText(s,`${a.async?"async ":""}function ${o}(${i.map(d=>e.sourceCode.getText(d)).join(", ")||""}) ${e.sourceCode.getText(p)}`)}]})}}}}}),fn={name:Ir,rule:ls};var B=require("@typescript-eslint/utils"),je=require("zod/v4");var ps=je.z.object({disallowedFunctions:je.z.array(je.z.object({name:je.z.string(),allowUsingWithArgs:je.z.boolean().optional(),hookAlternative:je.z.string().optional(),message:je.z.string().optional(),allowUseInside:je.z.array(je.z.string()).optional()}))}),cs=/^use[A-Z]/,us=/^[A-Z]/;function bt(e){return cs.test(e)}function Ar(e){return us.test(e)}function fs(e){return e.type===B.AST_NODE_TYPES.Identifier?bt(e.name):e.type===B.AST_NODE_TYPES.MemberExpression&&e.property.type===B.AST_NODE_TYPES.Identifier?bt(e.property.name):!1}function wr(e,t){return e.type===B.AST_NODE_TYPES.Identifier?e.name===t:e.type===B.AST_NODE_TYPES.MemberExpression&&e.object.type===B.AST_NODE_TYPES.Identifier&&e.property.type===B.AST_NODE_TYPES.Identifier?e.object.name==="React"&&e.property.name===t:!1}function Rr(e){return!!(e.parent&&e.parent.type===B.AST_NODE_TYPES.CallExpression&&wr(e.parent.callee,"forwardRef"))}function Pr(e){return!!(e.parent&&e.parent.type===B.AST_NODE_TYPES.CallExpression&&wr(e.parent.callee,"memo"))}function mn(e){if(e.type===B.AST_NODE_TYPES.FunctionDeclaration||e.type===B.AST_NODE_TYPES.FunctionExpression&&e.id)return e.id||void 0;if(e.type===B.AST_NODE_TYPES.FunctionExpression||e.type===B.AST_NODE_TYPES.ArrowFunctionExpression){if(e.parent.type===B.AST_NODE_TYPES.VariableDeclarator&&e.parent.init===e)return e.parent.id;if(e.parent.type===B.AST_NODE_TYPES.AssignmentExpression&&e.parent.right===e&&e.parent.operator==="=")return e.parent.left;if(e.parent.type===B.AST_NODE_TYPES.Property&&e.parent.value===e&&!e.parent.computed)return e.parent.key;if(e.parent.type===B.AST_NODE_TYPES.AssignmentPattern&&e.parent.right===e)return e.parent.left}}function ms(e){let t=e.parent,r=!1;for(;t;){if(t.type===B.AST_NODE_TYPES.FunctionDeclaration||t.type===B.AST_NODE_TYPES.FunctionExpression||t.type===B.AST_NODE_TYPES.ArrowFunctionExpression){let n=mn(t);if(n&&n.type===B.AST_NODE_TYPES.Identifier){if(Ar(n.name)||bt(n.name))return!r;r=!0}else{if(Rr(t)||Pr(t))return!r;if(t.parent.type===B.AST_NODE_TYPES.CallExpression){let o=t.parent;fs(o.callee)||(r=!0)}else t.parent.type===B.AST_NODE_TYPES.JSXExpressionContainer||(r=!0)}}t=t.parent}return!1}function vr(e){return e.callee.type===B.AST_NODE_TYPES.Identifier?e.callee.name:e.callee.type===B.AST_NODE_TYPES.MemberExpression&&e.callee.property.type===B.AST_NODE_TYPES.Identifier?e.callee.property.name:null}function ds(e,t){if(!t.length)return!1;let r=e.parent;for(;r;){if(r.type===B.AST_NODE_TYPES.FunctionDeclaration||r.type===B.AST_NODE_TYPES.FunctionExpression||r.type===B.AST_NODE_TYPES.ArrowFunctionExpression){let n=mn(r);if(n&&n.type===B.AST_NODE_TYPES.Identifier&&t.includes(n.name))return!0}else if(r.type===B.AST_NODE_TYPES.CallExpression){let n=vr(r);if(n&&t.includes(n))return!0}r=r.parent}return!1}function ys(e){return e.arguments.length>0&&!e.arguments.every(t=>t.type===B.AST_NODE_TYPES.Identifier&&t.name==="undefined")}function gs(e,t){let r=!1,n=e.parent;for(;n;){if(n.type===B.AST_NODE_TYPES.FunctionDeclaration||n.type===B.AST_NODE_TYPES.FunctionExpression||n.type===B.AST_NODE_TYPES.ArrowFunctionExpression){let o=mn(n);if(o&&o.type===B.AST_NODE_TYPES.Identifier){if(Ar(o.name)||bt(o.name)){r=!0;break}}else if(Rr(n)||Pr(n)){r=!0;break}}n=n.parent}return r?t.length===0?ms(e):!ds(e,t):!1}var dn=H({name:"prefer-react-hook-alternative",meta:{type:"suggestion",docs:{description:"Prefer hook alternatives for certain functions in React components and hooks"},messages:{preferHookAlternative:"This function should not be used in react{{message}}."},schema:[V(ps)],hasSuggestions:!0},defaultOptions:[{disallowedFunctions:[]}],create(e,[t]){let{disallowedFunctions:r}=t,n=new Map(r.map(o=>[o.name,o]));return{CallExpression(o){let s=vr(o);if(!s)return;let i=n.get(s);if(!i||i.allowUsingWithArgs&&ys(o))return;let p=i.allowUseInside||[];gs(o,p)&&e.report({node:o,messageId:"preferHookAlternative",data:{message:i.message?` ${i.message}`:` use ${i.hookAlternative} instead`},suggest:i.hookAlternative?[{messageId:"preferHookAlternative",data:{message:`Replace with ${i.hookAlternative}`,hookAlternative:i.hookAlternative},fix:a=>{let c=i.hookAlternative;return c?o.callee.type===B.AST_NODE_TYPES.Identifier?a.replaceText(o.callee,c):o.callee.type===B.AST_NODE_TYPES.MemberExpression&&o.callee.property.type===B.AST_NODE_TYPES.Identifier?a.replaceText(o.callee.property,c):null:null}}]:[]})}}}});var ae=require("@typescript-eslint/utils"),xt=ke(require("zod/v4"));var Ss=ae.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),kr="prefer-single-line-if",Ts=xt.default.object({maxLineLength:xt.default.number().optional(),maxNonSimpleConditionLength:xt.default.number().optional()}),hs=Ss({name:kr,meta:{type:"suggestion",fixable:"code",docs:{description:"Enforce single-line if in simple if statements"},messages:{noSingleLineCurly:"If return statement with single statement body should be written in a single line"},schema:[V(Ts)]},defaultOptions:[{}],create(e,[t]){let r=e.sourceCode;return{IfStatement(n){if(n.consequent.type!==ae.AST_NODE_TYPES.BlockStatement||n.loc.start.line===n.loc.end.line||r.getCommentsInside(n.consequent).length>0||n.alternate||n.consequent.body.length!==1)return;let s=n.consequent.body[0];if(!s)return;if(s.type===ae.AST_NODE_TYPES.ReturnStatement){if(!Nr(s))return}else if(!(s.type===ae.AST_NODE_TYPES.ContinueStatement||s.type===ae.AST_NODE_TYPES.BreakStatement))return;if(n.test.type===ae.AST_NODE_TYPES.LogicalExpression||n.test.type===ae.AST_NODE_TYPES.ConditionalExpression)return;let i;if(t.maxNonSimpleConditionLength){let y=Fr(n.test);if(!y&&n.test.type===ae.AST_NODE_TYPES.UnaryExpression&&n.test.operator==="!"){let l=n.test.argument;Fr(l)&&(y=!0)}if(y&&(i=r.getText(n.test),i.length>t.maxNonSimpleConditionLength))return}i||(i=r.getText(n.test));let p=r.getText(s);if(i.includes(`
18
+ `))return;let a=r.getTokenAfter(n);if(a&&a.type===ae.AST_TOKEN_TYPES.Punctuator&&a.value==="}"){let y=r.getTokenAfter(a);if(y&&y.type===ae.AST_TOKEN_TYPES.Keyword&&(y.value==="else"||y.value==="catch"))return}let c=Es(r,n),d=`if (${i}) ${p}`;t.maxLineLength&&d.length+c.length>t.maxLineLength||e.report({node:n,messageId:"noSingleLineCurly",fix:y=>y.replaceText(n,d)})}}}});function Fr(e){return e.type===ae.AST_NODE_TYPES.CallExpression||e.type===ae.AST_NODE_TYPES.BinaryExpression||e.type===ae.AST_NODE_TYPES.MemberExpression&&Or(e)}function Or(e){return e.object.type===ae.AST_NODE_TYPES.MemberExpression?Or(e.object):e.object.type!==ae.AST_NODE_TYPES.Identifier}function Es(e,t){return e.text.slice(t.range[0]-t.loc.start.column,t.range[0])}function Nr(e){if(!e.argument)return!0;let t=e.argument;return t.type===ae.AST_NODE_TYPES.ArrayExpression&&t.elements.length===0||t.type===ae.AST_NODE_TYPES.ObjectExpression&&t.properties.length===0||t.type===ae.AST_NODE_TYPES.Literal||t.type===ae.AST_NODE_TYPES.Identifier||t.type===ae.AST_NODE_TYPES.TemplateLiteral||t.type===ae.AST_NODE_TYPES.TaggedTemplateExpression?!0:t.type===ae.AST_NODE_TYPES.CallExpression?t.arguments.length===0:t.type===ae.AST_NODE_TYPES.UnaryExpression?Nr(t):!1}var yn={name:kr,rule:hs};var $=require("@typescript-eslint/utils"),Sn=require("zod/v4");var bs=$.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),Mr="react-compiler-extra",xs=Sn.z.object({runOnlyWithEnableCompilerDirective:Sn.z.boolean().optional()}),Cs=/eslint +react-compiler\/react-compiler: +\["error/;function $r(e){return e.type===$.AST_NODE_TYPES.Identifier?e.name.startsWith("use"):!1}function Is(e){return e.type===$.AST_NODE_TYPES.Identifier?e.name.startsWith("use"):e.type===$.AST_NODE_TYPES.MemberExpression&&e.property.type===$.AST_NODE_TYPES.Identifier?e.property.name.startsWith("use"):!1}function Le(e){if(!e)return!1;switch(e.type){case $.AST_NODE_TYPES.JSXElement:case $.AST_NODE_TYPES.JSXFragment:return!0;case $.AST_NODE_TYPES.ConditionalExpression:return Le(e.consequent)||Le(e.alternate);case $.AST_NODE_TYPES.LogicalExpression:return e.operator==="&&"?Le(e.right):e.operator==="||"?Le(e.left)||Le(e.right):!1;case $.AST_NODE_TYPES.CallExpression:if(e.callee.type===$.AST_NODE_TYPES.MemberExpression&&e.callee.object.type===$.AST_NODE_TYPES.Identifier&&e.callee.object.name==="React"&&e.callee.property.type===$.AST_NODE_TYPES.Identifier&&e.callee.property.name==="createElement")return!0;for(let t of e.arguments)if(t.type!==$.AST_NODE_TYPES.SpreadElement&&Le(t))return!0;return!1;default:return!1}}function As(e){let t=e.typeAnnotation;if(t.type===$.AST_NODE_TYPES.TSTypeReference){if(t.typeName.type===$.AST_NODE_TYPES.Identifier)return t.typeName.name==="FC";if(t.typeName.type===$.AST_NODE_TYPES.TSQualifiedName&&t.typeName.left.type===$.AST_NODE_TYPES.Identifier&&t.typeName.right.type===$.AST_NODE_TYPES.Identifier)return t.typeName.left.name==="React"&&t.typeName.right.name==="FC"}return!1}var ws=/^[A-Z][a-zA-Z0-9]*$/;function ct(e){return ws.test(e)}function Tn(e){return e.startsWith("use")&&e.length>3}function hn(e,t,r,n){if(r&&As(r))return t?ct(t.name):e.type===$.AST_NODE_TYPES.FunctionDeclaration&&e.id?ct(e.id.name):!0;if(t&&Tn(t.name)||e.type===$.AST_NODE_TYPES.FunctionDeclaration&&e.id&&Tn(e.id.name))return!0;if(n){let o=t?.name||e.type===$.AST_NODE_TYPES.FunctionDeclaration&&e.id?.name;if(o&&ct(o)&&_r(e.body,n).containsJSX)return!0}return!1}function pt(e){if(e.body.type===$.AST_NODE_TYPES.BlockStatement){for(let t of e.body.body)if(t.type===$.AST_NODE_TYPES.ExpressionStatement&&t.expression.type===$.AST_NODE_TYPES.Literal&&typeof t.expression.value=="string"&&t.expression.value==="use memo")return!0}return!1}function _r(e,t){let r={containsJSX:!1,containsHookCalls:!1};return Oe(e,n=>{if(r.containsJSX&&r.containsHookCalls)return!0;switch(n.type){case $.AST_NODE_TYPES.JSXElement:case $.AST_NODE_TYPES.JSXFragment:r.containsJSX=!0;break;case $.AST_NODE_TYPES.CallExpression:$r(n.callee)&&(r.containsHookCalls=!0),Le(n)&&(r.containsJSX=!0);break;case $.AST_NODE_TYPES.ReturnStatement:n.argument&&Le(n.argument)&&(r.containsJSX=!0);break;case $.AST_NODE_TYPES.VariableDeclarator:n.init&&Le(n.init)&&(r.containsJSX=!0);break;case $.AST_NODE_TYPES.AssignmentExpression:Le(n.right)&&(r.containsJSX=!0);break}},t),r}function Dr(e,t){let r=e.body,n=_r(r,t);return n.containsJSX||n.containsHookCalls}var Rs=/\bthis[.[]/;function jr(e){return Rs.test(e)}function Ps(e,t){let r={containsJSX:!1,containsHookCalls:!1};return Oe(e,n=>{if(r.containsHookCalls||(n.type===$.AST_NODE_TYPES.FunctionDeclaration||n.type===$.AST_NODE_TYPES.FunctionExpression||n.type===$.AST_NODE_TYPES.ArrowFunctionExpression)&&n!==e)return!0;n.type===$.AST_NODE_TYPES.CallExpression&&Is(n.callee)&&(r.containsHookCalls=!0)},t),r}function Lr(e){return ct(e)||Tn(e)}function gn(e,t,r,n){if(!Ps(e.body,t).containsHookCalls)return!1;let s=hn(e,r,n,t);if(!s&&n){let i=r?.name||e.type===$.AST_NODE_TYPES.FunctionDeclaration&&e.id?.name;i&&ct(i)&&(s=!0)}return!s}var vs=bs({name:Mr,meta:{type:"suggestion",fixable:"code",docs:{description:"Extra rules to enforce best practices when using the React compiler"},messages:{objectMethodIsNotSupported:"Object methods such as `{ method() {} }` have limited support to optimizations in the React compiler, use a function expression `{ method: () => {} }` instead.",replaceWithFunctionExpression:"Replace with function expression",thisKeywordInMethod:"Object method uses `this` keyword which would have different behavior if converted to an arrow function. Fix this manually.",fcComponentShouldReturnJsx:'React components and hooks should create JSX elements, call other hooks or use the "use memo" directive for optimal React compiler detection.',addUseMemoDirective:'Add "use memo" directive to opt into React compiler memoization',functionCallingHooksMustBeComponent:'Functions calling hooks must be React components (PascalCase with FC type) or hooks (start with "use").',useMemoDirectiveNaming:'Functions using "use memo" directive must follow React naming conventions (PascalCase for components or start with "use" for hooks).'},hasSuggestions:!0,schema:[V(xs)]},defaultOptions:[{}],create(e,[t]){let r=!1;if(t.runOnlyWithEnableCompilerDirective){for(let s of e.sourceCode.getAllComments())if(Cs.test(s.value)){r=!0;break}if(!r)return{}}function n(s){for(let i of s.properties)if(i.type===$.AST_NODE_TYPES.Property&&i.method&&i.value.type===$.AST_NODE_TYPES.FunctionExpression){let p=e.sourceCode,a=p.getText(i.key),c=i.value,d=p.getText(c.body);if(jr(d))e.report({node:i,messageId:"thisKeywordInMethod"});else{let y=c.params.map(h=>p.getText(h)).join(", "),l="";c.generator?l=`${a}: function* (${y}) ${d}`:l=`${a}: (${y}) => ${d}`,e.report({node:i,messageId:"objectMethodIsNotSupported",fix:h=>h.replaceText(i,l)})}}}function o(s){for(let i of s.properties)if(i.type===$.AST_NODE_TYPES.Property&&i.value.type===$.AST_NODE_TYPES.ObjectExpression){for(let p of i.value.properties)if(p.type===$.AST_NODE_TYPES.Property&&p.method&&p.value.type===$.AST_NODE_TYPES.FunctionExpression){let c=e.sourceCode.getText(p.value.body);jr(c)&&e.report({node:p,messageId:"thisKeywordInMethod"})}}}return{CallExpression(s){if($r(s.callee))for(let i of s.arguments){if(i.type===$.AST_NODE_TYPES.ObjectExpression&&(n(i),o(i)),i.type===$.AST_NODE_TYPES.ArrowFunctionExpression&&(i.body.type===$.AST_NODE_TYPES.ObjectExpression&&(n(i.body),o(i.body)),i.body.type===$.AST_NODE_TYPES.BlockStatement))for(let p of i.body.body)p.type===$.AST_NODE_TYPES.ReturnStatement&&p.argument?.type===$.AST_NODE_TYPES.ObjectExpression&&(n(p.argument),o(p.argument));if(i.type===$.AST_NODE_TYPES.FunctionExpression)for(let p of i.body.body)p.type===$.AST_NODE_TYPES.ReturnStatement&&p.argument?.type===$.AST_NODE_TYPES.ObjectExpression&&(n(p.argument),o(p.argument))}},VariableDeclarator(s){if(s.id.type===$.AST_NODE_TYPES.Identifier&&s.init&&(s.init.type===$.AST_NODE_TYPES.ArrowFunctionExpression||s.init.type===$.AST_NODE_TYPES.FunctionExpression)){let i=s.init,p=s.id,a=s.id.typeAnnotation;if(pt(i)&&!Lr(p.name)){e.report({node:i,messageId:"useMemoDirectiveNaming"});return}if(gn(i,e.sourceCode,p,a)){e.report({node:i,messageId:"functionCallingHooksMustBeComponent"});return}if(hn(i,p,a,e.sourceCode)){let c=Dr(i,e.sourceCode),d=pt(i);!c&&!d&&e.report({node:i,messageId:"fcComponentShouldReturnJsx",suggest:[{messageId:"addUseMemoDirective",fix(y){if(i.body.type===$.AST_NODE_TYPES.BlockStatement){let l=i.body.range[0]+1;return y.insertTextAfterRange([l,l],`
19
19
  "use memo"
20
- `)}return null}}]})}}},FunctionDeclaration(o){if(o.id&&it(o)&&!Nr(o.id.name)){e.report({node:o,messageId:"useMemoDirectiveNaming"});return}if(un(o,e.sourceCode)){e.report({node:o,messageId:"functionCallingHooksMustBeComponent"});return}if(yn(o,void 0,void 0,e.sourceCode)){let i=Fr(o,e.sourceCode),p=it(o);!i&&!p&&e.report({node:o,messageId:"fcComponentShouldReturnJsx",suggest:[{messageId:"addUseMemoDirective",fix(a){let c=o.body.range[0]+1;return a.insertTextAfterRange([c,c],`
20
+ `)}return null}}]})}}},FunctionDeclaration(s){if(s.id&&pt(s)&&!Lr(s.id.name)){e.report({node:s,messageId:"useMemoDirectiveNaming"});return}if(gn(s,e.sourceCode)){e.report({node:s,messageId:"functionCallingHooksMustBeComponent"});return}if(hn(s,void 0,void 0,e.sourceCode)){let i=Dr(s,e.sourceCode),p=pt(s);!i&&!p&&e.report({node:s,messageId:"fcComponentShouldReturnJsx",suggest:[{messageId:"addUseMemoDirective",fix(a){let c=s.body.range[0]+1;return a.insertTextAfterRange([c,c],`
21
21
  "use memo"
22
- `)}}]})}},FunctionExpression(o){if(it(o)){e.report({node:o,messageId:"useMemoDirectiveNaming"});return}un(o,e.sourceCode)&&e.report({node:o,messageId:"functionCallingHooksMustBeComponent"})}}}}),dn={name:Dr,rule:Po};var fe=require("@typescript-eslint/utils"),Ce=require("zod/v4");var vo=fe.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),Mr="react-compiler-migration",ko=Ce.z.object({disallowHooks:Ce.z.array(Ce.z.object({name:Ce.z.string(),replacement:Ce.z.string()})).optional(),disallowMethods:Ce.z.array(Ce.z.object({name:Ce.z.string(),replacement:Ce.z.string().optional(),requireTrueProp:Ce.z.string().optional()})).optional()}),Fo=/eslint +react-compiler\/react-compiler: +\["error/;function Oo(e){return e.type===fe.AST_NODE_TYPES.Identifier?e.name.startsWith("use"):e.type===fe.AST_NODE_TYPES.MemberExpression&&e.property.type===fe.AST_NODE_TYPES.Identifier?e.property.name.startsWith("use"):!1}var No=vo({name:Mr,meta:{type:"suggestion",fixable:"code",docs:{description:"Rules to help migrate to the new React compiler"},messages:{disallowedFunctionOrMethod:"{{functionOrMethod}} is not supported in react compiler. Use {{replacement}} instead.",replace:"Replace with safe alternative {{replacement}}",disallowedMethodWithMissingRequireTrueProp:"{{method}} is should have a prop named {{requireTrueProp}} set to true when used in react compiler."},hasSuggestions:!0,schema:[$(ko)]},defaultOptions:[{disallowHooks:[],disallowMethods:[]}],create(e,[t]){let r=!1;for(let n of e.sourceCode.getAllComments())if(Fo.test(n.value)){r=!0;break}return r?{CallExpression(n){if(t.disallowHooks?.length){let s=null,o=null;if(n.callee.type===fe.AST_NODE_TYPES.Identifier?(s=n.callee.name,o=n.callee):n.callee.type===fe.AST_NODE_TYPES.MemberExpression&&n.callee.property.type===fe.AST_NODE_TYPES.Identifier&&(s=n.callee.property.name,o=n.callee.property),s){let i=t.disallowHooks.find(p=>p.name===s);i&&o&&e.report({node:n,messageId:"disallowedFunctionOrMethod",data:{functionOrMethod:i.name,replacement:i.replacement},suggest:[{messageId:"replace",data:{replacement:i.replacement},fix:p=>p.replaceText(o,i.replacement)}]})}}if(t.disallowMethods?.length&&Oo(n.callee)){for(let s of n.arguments)if(s.type===fe.AST_NODE_TYPES.ObjectExpression){for(let o of s.properties)if(o.type===fe.AST_NODE_TYPES.Property&&o.key.type===fe.AST_NODE_TYPES.Identifier){let i=o.key.name,p=t.disallowMethods.find(a=>a.name===i);if(p){if(p.requireTrueProp){let a=p.requireTrueProp,c=!1;for(let g of s.properties)if(g.type===fe.AST_NODE_TYPES.Property&&g.key.type===fe.AST_NODE_TYPES.Identifier&&g.key.name===a&&g.value.type===fe.AST_NODE_TYPES.Literal&&g.value.value===!0){c=!0;break}if(!c){e.report({node:o,messageId:"disallowedMethodWithMissingRequireTrueProp",data:{method:p.name,requireTrueProp:a}});continue}}p.replacement&&e.report({node:o,messageId:"disallowedFunctionOrMethod",data:{functionOrMethod:p.name,replacement:p.replacement},suggest:[{messageId:"replace",data:{replacement:p.replacement},fix:a=>p.replacement?a.replaceText(o.key,p.replacement):null}]})}}}}}}:{}}}),gn={name:Mr,rule:No};var F=require("@typescript-eslint/utils"),Tn=require("zod");var Do=Tn.z.object({runOnlyWithEnableCompilerDirective:Tn.z.boolean().optional()}),jo=/eslint +react-compiler\/react-compiler: +\["error/,Lo=/^\d+$/,Mo=/[\s_-]+/,$o=/[a-z][A-Z]/,_o=/^(.+?)([A-Z][a-z]+s?)$/,Uo=/^[a-z][a-zA-Z]*$/;function $r(e,t){let r=[];if(e.type===F.AST_NODE_TYPES.JSXElement){for(let n of e.openingElement.attributes)if(n.type===F.AST_NODE_TYPES.JSXAttribute&&n.name.type===F.AST_NODE_TYPES.JSXIdentifier&&n.value?.type===F.AST_NODE_TYPES.JSXExpressionContainer&&n.value.expression.type!==F.AST_NODE_TYPES.JSXEmptyExpression){let s=n.name.name,o=n.value.expression,i=!1;we(o,p=>{switch(p.type){case F.AST_NODE_TYPES.ObjectExpression:case F.AST_NODE_TYPES.ArrowFunctionExpression:case F.AST_NODE_TYPES.FunctionExpression:case F.AST_NODE_TYPES.ArrayExpression:return i=!0,!0}return!1},t),i&&r.push(s)}}return{hasUnstable:r.length>0,problematicProps:r}}function zo(e){if(e.body.type===F.AST_NODE_TYPES.JSXElement||e.body.type===F.AST_NODE_TYPES.JSXFragment)return!0;if(e.body.type===F.AST_NODE_TYPES.BlockStatement){for(let t of e.body.body)if(t.type===F.AST_NODE_TYPES.ReturnStatement&&t.argument&&(t.argument.type===F.AST_NODE_TYPES.JSXElement||t.argument.type===F.AST_NODE_TYPES.JSXFragment))return!0}return!1}function Wo(e,t){let r=e.callee;if(r.type===F.AST_NODE_TYPES.MemberExpression){let n=r.object;if(n.type===F.AST_NODE_TYPES.Identifier){let s=n.name,o=Jo(s);if(o!==s)return hn(o)}}if(t.length>0){let n=t[0];if(n&&n.type===F.AST_NODE_TYPES.Identifier)return hn(n.name)}return"ListItem"}function Jo(e){let r={people:"person",children:"child",feet:"foot",teeth:"tooth",mice:"mouse",men:"man",women:"woman"}[e.toLowerCase()];if(r)return r;if(e.match($o)){let n=e.match(_o);if(n){let s=n[1],o=n[2];if(!s||!o)return Sn(e);let i=Sn(o);if(i!==o)return s+i}}return Sn(e)}function Sn(e){return e.endsWith("ies")?`${e.slice(0,-3)}y`:e.endsWith("es")&&e.length>3?e.slice(0,-2):e.endsWith("s")&&e.length>1?e.slice(0,-1):e}function hn(e){return e.match(Uo)?e.charAt(0).toUpperCase()+e.slice(1):e.split(Mo).map(t=>t.charAt(0).toUpperCase()+t.slice(1).toLowerCase()).join("")}function _r(e,t,r){let n=[],s=new Set,o=new Set(["console","document","window","Math","Object","Array","String","Number","Boolean","undefined","null"]);we(e,i=>{if(i.type===F.AST_NODE_TYPES.Identifier&&!t.includes(i.name)&&!o.has(i.name)&&!Lo.test(i.name)){let p=i.parent;if(p.type===F.AST_NODE_TYPES.Property&&p.key===i||p.type===F.AST_NODE_TYPES.MemberExpression&&p.property===i&&!p.computed||p.type===F.AST_NODE_TYPES.JSXOpeningElement||p.type===F.AST_NODE_TYPES.JSXClosingElement||p.type===F.AST_NODE_TYPES.JSXAttribute&&p.name.type===F.AST_NODE_TYPES.JSXIdentifier&&p.name.name===i.name)return!1;s.add(i.name)}return!1},r);for(let i of s)t.includes(i)||n.push({name:i,type:"unknown"});return n}function Ur(e,t,r,n,s){let i=[...r.map(S=>S.type===F.AST_NODE_TYPES.Identifier?S.name:"item").map((S,l)=>({name:S,type:l===0?`${e}Type`:l===1?"number":"unknown"})),...n],p=i.map(S=>{let l=S.type;return S.name.includes("on")&&l==="any"&&(l="unknown"),` ${S.name}: ${l};`}).join(`
23
- `),a=i.map(S=>S.name).join(", "),c=s.getText(t),g=`${e}Props`;return`type ${g} = {
22
+ `)}}]})}},FunctionExpression(s){if(pt(s)){e.report({node:s,messageId:"useMemoDirectiveNaming"});return}gn(s,e.sourceCode)&&e.report({node:s,messageId:"functionCallingHooksMustBeComponent"})}}}}),En={name:Mr,rule:vs};var Te=require("@typescript-eslint/utils"),Ne=require("zod/v4");var Fs=Te.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),Ur="react-compiler-migration",ks=Ne.z.object({disallowHooks:Ne.z.array(Ne.z.object({name:Ne.z.string(),replacement:Ne.z.string()})).optional(),disallowMethods:Ne.z.array(Ne.z.object({name:Ne.z.string(),replacement:Ne.z.string().optional(),requireTrueProp:Ne.z.string().optional()})).optional()}),Os=/eslint +react-compiler\/react-compiler: +\["error/;function Ns(e){return e.type===Te.AST_NODE_TYPES.Identifier?e.name.startsWith("use"):e.type===Te.AST_NODE_TYPES.MemberExpression&&e.property.type===Te.AST_NODE_TYPES.Identifier?e.property.name.startsWith("use"):!1}var Ds=Fs({name:Ur,meta:{type:"suggestion",fixable:"code",docs:{description:"Rules to help migrate to the new React compiler"},messages:{disallowedFunctionOrMethod:"{{functionOrMethod}} is not supported in react compiler. Use {{replacement}} instead.",replace:"Replace with safe alternative {{replacement}}",disallowedMethodWithMissingRequireTrueProp:"{{method}} is should have a prop named {{requireTrueProp}} set to true when used in react compiler."},hasSuggestions:!0,schema:[V(ks)]},defaultOptions:[{disallowHooks:[],disallowMethods:[]}],create(e,[t]){let r=!1;for(let n of e.sourceCode.getAllComments())if(Os.test(n.value)){r=!0;break}return r?{CallExpression(n){if(t.disallowHooks?.length){let o=null,s=null;if(n.callee.type===Te.AST_NODE_TYPES.Identifier?(o=n.callee.name,s=n.callee):n.callee.type===Te.AST_NODE_TYPES.MemberExpression&&n.callee.property.type===Te.AST_NODE_TYPES.Identifier&&(o=n.callee.property.name,s=n.callee.property),o){let i=t.disallowHooks.find(p=>p.name===o);i&&s&&e.report({node:n,messageId:"disallowedFunctionOrMethod",data:{functionOrMethod:i.name,replacement:i.replacement},suggest:[{messageId:"replace",data:{replacement:i.replacement},fix:p=>p.replaceText(s,i.replacement)}]})}}if(t.disallowMethods?.length&&Ns(n.callee)){for(let o of n.arguments)if(o.type===Te.AST_NODE_TYPES.ObjectExpression){for(let s of o.properties)if(s.type===Te.AST_NODE_TYPES.Property&&s.key.type===Te.AST_NODE_TYPES.Identifier){let i=s.key.name,p=t.disallowMethods.find(a=>a.name===i);if(p){if(p.requireTrueProp){let a=p.requireTrueProp,c=!1;for(let d of o.properties)if(d.type===Te.AST_NODE_TYPES.Property&&d.key.type===Te.AST_NODE_TYPES.Identifier&&d.key.name===a&&d.value.type===Te.AST_NODE_TYPES.Literal&&d.value.value===!0){c=!0;break}if(!c){e.report({node:s,messageId:"disallowedMethodWithMissingRequireTrueProp",data:{method:p.name,requireTrueProp:a}});continue}}p.replacement&&e.report({node:s,messageId:"disallowedFunctionOrMethod",data:{functionOrMethod:p.name,replacement:p.replacement},suggest:[{messageId:"replace",data:{replacement:p.replacement},fix:a=>p.replacement?a.replaceText(s.key,p.replacement):null}]})}}}}}}:{}}}),bn={name:Ur,rule:Ds};var D=require("@typescript-eslint/utils"),Cn=require("zod");var js=Cn.z.object({runOnlyWithEnableCompilerDirective:Cn.z.boolean().optional()}),Ls=/eslint +react-compiler\/react-compiler: +\["error/,Ms=/^\d+$/,$s=/[\s_-]+/,_s=/[a-z][A-Z]/,Us=/^(.+?)([A-Z][a-z]+s?)$/,zs=/^[a-z][a-zA-Z]*$/;function zr(e,t){let r=[];if(e.type===D.AST_NODE_TYPES.JSXElement){for(let n of e.openingElement.attributes)if(n.type===D.AST_NODE_TYPES.JSXAttribute&&n.name.type===D.AST_NODE_TYPES.JSXIdentifier&&n.value?.type===D.AST_NODE_TYPES.JSXExpressionContainer&&n.value.expression.type!==D.AST_NODE_TYPES.JSXEmptyExpression){let o=n.name.name,s=n.value.expression,i=!1;Oe(s,p=>{switch(p.type){case D.AST_NODE_TYPES.ObjectExpression:case D.AST_NODE_TYPES.ArrowFunctionExpression:case D.AST_NODE_TYPES.FunctionExpression:case D.AST_NODE_TYPES.ArrayExpression:return i=!0,!0}return!1},t),i&&r.push(o)}}return{hasUnstable:r.length>0,problematicProps:r}}function Ws(e){if(e.body.type===D.AST_NODE_TYPES.JSXElement||e.body.type===D.AST_NODE_TYPES.JSXFragment)return!0;if(e.body.type===D.AST_NODE_TYPES.BlockStatement){for(let t of e.body.body)if(t.type===D.AST_NODE_TYPES.ReturnStatement&&t.argument&&(t.argument.type===D.AST_NODE_TYPES.JSXElement||t.argument.type===D.AST_NODE_TYPES.JSXFragment))return!0}return!1}function Js(e,t){let r=e.callee;if(r.type===D.AST_NODE_TYPES.MemberExpression){let n=r.object;if(n.type===D.AST_NODE_TYPES.Identifier){let o=n.name,s=Vs(o);if(s!==o)return In(s)}}if(t.length>0){let n=t[0];if(n&&n.type===D.AST_NODE_TYPES.Identifier)return In(n.name)}return"ListItem"}function Vs(e){let r={people:"person",children:"child",feet:"foot",teeth:"tooth",mice:"mouse",men:"man",women:"woman"}[e.toLowerCase()];if(r)return r;if(e.match(_s)){let n=e.match(Us);if(n){let o=n[1],s=n[2];if(!o||!s)return xn(e);let i=xn(s);if(i!==s)return o+i}}return xn(e)}function xn(e){return e.endsWith("ies")?`${e.slice(0,-3)}y`:e.endsWith("es")&&e.length>3?e.slice(0,-2):e.endsWith("s")&&e.length>1?e.slice(0,-1):e}function In(e){return e.match(zs)?e.charAt(0).toUpperCase()+e.slice(1):e.split($s).map(t=>t.charAt(0).toUpperCase()+t.slice(1).toLowerCase()).join("")}function Wr(e,t,r){let n=[],o=new Set,s=new Set(["console","document","window","Math","Object","Array","String","Number","Boolean","undefined","null"]);Oe(e,i=>{if(i.type===D.AST_NODE_TYPES.Identifier&&!t.includes(i.name)&&!s.has(i.name)&&!Ms.test(i.name)){let p=i.parent;if(p.type===D.AST_NODE_TYPES.Property&&p.key===i||p.type===D.AST_NODE_TYPES.MemberExpression&&p.property===i&&!p.computed||p.type===D.AST_NODE_TYPES.JSXOpeningElement||p.type===D.AST_NODE_TYPES.JSXClosingElement||p.type===D.AST_NODE_TYPES.JSXAttribute&&p.name.type===D.AST_NODE_TYPES.JSXIdentifier&&p.name.name===i.name)return!1;o.add(i.name)}return!1},r);for(let i of o)t.includes(i)||n.push({name:i,type:"unknown"});return n}function Jr(e,t,r,n,o){let i=[...r.map(y=>y.type===D.AST_NODE_TYPES.Identifier?y.name:"item").map((y,l)=>({name:y,type:l===0?`${e}Type`:l===1?"number":"unknown"})),...n],p=i.map(y=>{let l=y.type;return y.name.includes("on")&&l==="any"&&(l="unknown"),` ${y.name}: ${l};`}).join(`
23
+ `),a=i.map(y=>y.name).join(", "),c=o.getText(t),d=`${e}Props`;return`type ${d} = {
24
24
  ${p}
25
25
  };
26
26
 
27
- const ${e}: FC<${g}> = ({ ${a} }) => {
27
+ const ${e}: FC<${d}> = ({ ${a} }) => {
28
28
  return (
29
29
  ${c}
30
30
  );
31
- };`}function Vo(e,t,r,n){let s=t.map(i=>i.type===F.AST_NODE_TYPES.Identifier?i.name:"item"),o=[n?`key={${n}}`:`key={${s[0]}.id}`,...s.map(i=>`${i}={${i}}`),...r.map(i=>`${i.name}={${i.name}}`)].filter(Boolean);return`<${e} ${o.join(" ")} />`}function Xo(e){if(e.type===F.AST_NODE_TYPES.JSXElement&&e.openingElement.name.type===F.AST_NODE_TYPES.JSXIdentifier){let t=e.openingElement.name.name;if(t!=="div"&&t!=="span")return hn(t)}return"ListItem"}function Ho(e,t,r){let n=[r?`key={${r}}`:"",...t.map(s=>`${s.name}={${s.name}}`)].filter(Boolean);return`<${e}${n.length>0?` ${n.join(" ")}`:""} />`}function zr(e,t){for(let r of e.openingElement.attributes)if(r.type===F.AST_NODE_TYPES.JSXAttribute&&r.name.type===F.AST_NODE_TYPES.JSXIdentifier&&r.name.name==="key"&&r.value&&r.value.type===F.AST_NODE_TYPES.JSXExpressionContainer&&r.value.expression.type!==F.AST_NODE_TYPES.JSXEmptyExpression)return t.getText(r.value.expression);return null}var En=_({name:"react-optimized-collections",meta:{type:"suggestion",docs:{description:"Detect unstable values in map renders that prevent React Compiler optimization"},messages:{unstableValueInMap:"Unstable values in {{problematicProps}} prevent React Compiler from optimizing individual list items. Extract the problematic props to outside the loop or extract the item to a separate component.",extractComponent:"Extract to {{componentName}} component"},schema:[$(Do)],hasSuggestions:!0},defaultOptions:[{runOnlyWithEnableCompilerDirective:!1}],create(e,[t]){let{sourceCode:r}=e;if(t.runOnlyWithEnableCompilerDirective){let n=!1;for(let s of r.getAllComments())if(jo.test(s.value)){n=!0;break}if(!n)return{}}return{CallExpression(n){n.callee.type===F.AST_NODE_TYPES.MemberExpression&&n.callee.property.type===F.AST_NODE_TYPES.Identifier&&(n.callee.property.name==="map"||n.callee.property.name==="push")&&(n.callee.property.name==="map"?Bo(n,r,e):Yo(n,r,e))}}}});function Bo(e,t,r){let n=e.arguments[0];if(!n||n.type!==F.AST_NODE_TYPES.ArrowFunctionExpression&&n.type!==F.AST_NODE_TYPES.FunctionExpression||!zo(n))return;let s=null;if(n.body.type===F.AST_NODE_TYPES.JSXElement||n.body.type===F.AST_NODE_TYPES.JSXFragment?s=n.body:n.body.type===F.AST_NODE_TYPES.BlockStatement&&n.body.body[0]?.type===F.AST_NODE_TYPES.ReturnStatement&&n.body.body[0].argument&&(n.body.body[0].argument.type===F.AST_NODE_TYPES.JSXElement||n.body.body[0].argument.type===F.AST_NODE_TYPES.JSXFragment)&&(s=n.body.body[0].argument),!s)return;let o=$r(s,t);if(!o.hasUnstable)return;let i=Wo(e,n.params),p=n.params.map(S=>S.type===F.AST_NODE_TYPES.Identifier?S.name:"item"),a=_r(s,p,t),c=s.type===F.AST_NODE_TYPES.JSXElement?zr(s,t):null,g=o.problematicProps.length===1?`prop "${o.problematicProps[0]}"`:`props "${o.problematicProps.join('", "')}"`;r.report({node:s,messageId:"unstableValueInMap",data:{problematicProps:g},suggest:[{messageId:"extractComponent",data:{componentName:i},fix:S=>{let l=Ur(i,s,n.params,a,t),E=Vo(i,n.params,a,c),f=e;for(;f.parent.type!==F.AST_NODE_TYPES.Program&&!(f.type===F.AST_NODE_TYPES.FunctionDeclaration||f.type===F.AST_NODE_TYPES.VariableDeclarator&&f.init&&(f.init.type===F.AST_NODE_TYPES.ArrowFunctionExpression||f.init.type===F.AST_NODE_TYPES.FunctionExpression));)f=f.parent;let h=[];return h.push(S.insertTextAfter(f,`
31
+ };`}function Xs(e,t,r,n){let o=t.map(i=>i.type===D.AST_NODE_TYPES.Identifier?i.name:"item"),s=[n?`key={${n}}`:`key={${o[0]}.id}`,...o.map(i=>`${i}={${i}}`),...r.map(i=>`${i.name}={${i.name}}`)].filter(Boolean);return`<${e} ${s.join(" ")} />`}function Hs(e){if(e.type===D.AST_NODE_TYPES.JSXElement&&e.openingElement.name.type===D.AST_NODE_TYPES.JSXIdentifier){let t=e.openingElement.name.name;if(t!=="div"&&t!=="span")return In(t)}return"ListItem"}function Bs(e,t,r){let n=[r?`key={${r}}`:"",...t.map(o=>`${o.name}={${o.name}}`)].filter(Boolean);return`<${e}${n.length>0?` ${n.join(" ")}`:""} />`}function Vr(e,t){for(let r of e.openingElement.attributes)if(r.type===D.AST_NODE_TYPES.JSXAttribute&&r.name.type===D.AST_NODE_TYPES.JSXIdentifier&&r.name.name==="key"&&r.value&&r.value.type===D.AST_NODE_TYPES.JSXExpressionContainer&&r.value.expression.type!==D.AST_NODE_TYPES.JSXEmptyExpression)return t.getText(r.value.expression);return null}var An=H({name:"react-optimized-collections",meta:{type:"suggestion",docs:{description:"Detect unstable values in map renders that prevent React Compiler optimization"},messages:{unstableValueInMap:"Unstable values in {{problematicProps}} prevent React Compiler from optimizing individual list items. Extract the problematic props to outside the loop or extract the item to a separate component.",extractComponent:"Extract to {{componentName}} component"},schema:[V(js)],hasSuggestions:!0},defaultOptions:[{runOnlyWithEnableCompilerDirective:!1}],create(e,[t]){let{sourceCode:r}=e;if(t.runOnlyWithEnableCompilerDirective){let n=!1;for(let o of r.getAllComments())if(Ls.test(o.value)){n=!0;break}if(!n)return{}}return{CallExpression(n){n.callee.type===D.AST_NODE_TYPES.MemberExpression&&n.callee.property.type===D.AST_NODE_TYPES.Identifier&&(n.callee.property.name==="map"||n.callee.property.name==="push")&&(n.callee.property.name==="map"?Ys(n,r,e):qs(n,r,e))}}}});function Ys(e,t,r){let n=e.arguments[0];if(!n||n.type!==D.AST_NODE_TYPES.ArrowFunctionExpression&&n.type!==D.AST_NODE_TYPES.FunctionExpression||!Ws(n))return;let o=null;if(n.body.type===D.AST_NODE_TYPES.JSXElement||n.body.type===D.AST_NODE_TYPES.JSXFragment?o=n.body:n.body.type===D.AST_NODE_TYPES.BlockStatement&&n.body.body[0]?.type===D.AST_NODE_TYPES.ReturnStatement&&n.body.body[0].argument&&(n.body.body[0].argument.type===D.AST_NODE_TYPES.JSXElement||n.body.body[0].argument.type===D.AST_NODE_TYPES.JSXFragment)&&(o=n.body.body[0].argument),!o)return;let s=zr(o,t);if(!s.hasUnstable)return;let i=Js(e,n.params),p=n.params.map(y=>y.type===D.AST_NODE_TYPES.Identifier?y.name:"item"),a=Wr(o,p,t),c=o.type===D.AST_NODE_TYPES.JSXElement?Vr(o,t):null,d=s.problematicProps.length===1?`prop "${s.problematicProps[0]}"`:`props "${s.problematicProps.join('", "')}"`;r.report({node:o,messageId:"unstableValueInMap",data:{problematicProps:d},suggest:[{messageId:"extractComponent",data:{componentName:i},fix:y=>{let l=Jr(i,o,n.params,a,t),h=Xs(i,n.params,a,c),u=e;for(;u.parent.type!==D.AST_NODE_TYPES.Program&&!(u.type===D.AST_NODE_TYPES.FunctionDeclaration||u.type===D.AST_NODE_TYPES.VariableDeclarator&&u.init&&(u.init.type===D.AST_NODE_TYPES.ArrowFunctionExpression||u.init.type===D.AST_NODE_TYPES.FunctionExpression));)u=u.parent;let S=[];return S.push(y.insertTextAfter(u,`
32
32
 
33
- ${l}`)),h.push(S.replaceText(s,E)),h}}]})}function Yo(e,t,r){let n=e.arguments[0];if(!n||n.type!==F.AST_NODE_TYPES.JSXElement&&n.type!==F.AST_NODE_TYPES.JSXFragment)return;let s=n,o=$r(s,t);if(!o.hasUnstable)return;let i=Xo(s),p=_r(s,[],t),a=s.type===F.AST_NODE_TYPES.JSXElement?zr(s,t):null,c=o.problematicProps.length===1?`prop "${o.problematicProps[0]}"`:`props "${o.problematicProps.join('", "')}"`;r.report({node:s,messageId:"unstableValueInMap",data:{problematicProps:c},suggest:[{messageId:"extractComponent",data:{componentName:i},fix:g=>{let S=Ur(i,s,[],p,t),l=Ho(i,p,a),E=e;for(;E.parent.type!==F.AST_NODE_TYPES.Program&&!(E.type===F.AST_NODE_TYPES.FunctionDeclaration||E.type===F.AST_NODE_TYPES.VariableDeclarator&&E.init&&(E.init.type===F.AST_NODE_TYPES.ArrowFunctionExpression||E.init.type===F.AST_NODE_TYPES.FunctionExpression));)E=E.parent;let f=[];return f.push(g.insertTextAfter(E,`
33
+ ${l}`)),S.push(y.replaceText(o,h)),S}}]})}function qs(e,t,r){let n=e.arguments[0];if(!n||n.type!==D.AST_NODE_TYPES.JSXElement&&n.type!==D.AST_NODE_TYPES.JSXFragment)return;let o=n,s=zr(o,t);if(!s.hasUnstable)return;let i=Hs(o),p=Wr(o,[],t),a=o.type===D.AST_NODE_TYPES.JSXElement?Vr(o,t):null,c=s.problematicProps.length===1?`prop "${s.problematicProps[0]}"`:`props "${s.problematicProps.join('", "')}"`;r.report({node:o,messageId:"unstableValueInMap",data:{problematicProps:c},suggest:[{messageId:"extractComponent",data:{componentName:i},fix:d=>{let y=Jr(i,o,[],p,t),l=Bs(i,p,a),h=e;for(;h.parent.type!==D.AST_NODE_TYPES.Program&&!(h.type===D.AST_NODE_TYPES.FunctionDeclaration||h.type===D.AST_NODE_TYPES.VariableDeclarator&&h.init&&(h.init.type===D.AST_NODE_TYPES.ArrowFunctionExpression||h.init.type===D.AST_NODE_TYPES.FunctionExpression));)h=h.parent;let u=[];return u.push(d.insertTextAfter(h,`
34
34
 
35
- ${S}`)),f.push(g.replaceText(s,l)),f}}]})}var ht=require("@typescript-eslint/utils"),qo=ht.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),Wr="require-description",Zo=/^(eslint(?:-env|-enable|-disable(?:(?:-next)?-line)?)?|exported|globals?)(?:\s|$)/u,Go=/^eslint-disable-(next-)?line$/u,Ko=qo({name:Wr,meta:{type:"problem",docs:{description:"Require descriptions for eslint directives."},messages:{missingDescription:"Unexpected undescribed directive comment. Include descriptions to explain why the comment is necessary."},schema:[{type:"object",properties:{ignore:{type:"array",items:{type:"string",enum:["eslint","eslint-disable","eslint-disable-line","eslint-disable-next-line","eslint-enable","eslint-env","exported","global","globals"]},additionalItems:!1,uniqueItems:!0}},additionalProperties:!1}]},defaultOptions:[{ignore:[]}],create(e,[t]){let r=e.sourceCode,n=new Set(t.ignore||[]);return{Program(){for(let s of r.getAllComments()){let o=Qo(s);o!=null&&(n.has(o.kind)||o.description||e.report({loc:na(s.loc),messageId:"missingDescription"}))}}}}}),Jr={name:Wr,rule:Ko};function Qo(e){let{text:t,description:r}=ta(e.value);if(!t)return null;let n=Zo.exec(t);if(!n)return null;let s=n[1];if(!s)return null;let o=Go.test(s);if(e.type===ht.TSESTree.AST_TOKEN_TYPES.Line&&!o||o&&e.loc.start.line!==e.loc.end.line)return null;let i=t.slice(n.index+s.length);return{kind:s,value:i.trim(),description:r}}var ea=/\s-{2,}\s/u;function ta(e){let t=e.split(ea);return{text:t[0]?.trim(),description:t.length>1?t[1]?.trim()??null:null}}function na(e){return{start:{line:e.start.line,column:-1},end:e.end}}var V=require("@typescript-eslint/utils"),ke=require("zod/v4");var ra=ke.z.object({varsToCheck:ke.z.array(ke.z.object({selector:ke.z.string().optional(),fromFnCall:ke.z.string().optional(),prop:ke.z.string().or(ke.z.array(ke.z.string())),errorMsg:ke.z.string().optional()}))}),bn=_({name:"require-reads-to-var-prop",meta:{type:"suggestion",docs:{description:"Require specific properties from variables to be read or ensure the variable is passed to functions/components"},messages:{propNotRead:'"{{fnName}}" requires reads to the prop "{{prop}}". {{customMsg}}',propsNotRead:'"{{fnName}}" requires reads to the props {{props}}. {{customMsg}}'},schema:[$(ra)]},defaultOptions:[{varsToCheck:[]}],create(e,[t]){let r=new Map;function n(i,p,a,c){let g=new Set;for(let l of i.properties)l.type===V.AST_NODE_TYPES.Property&&l.key.type===V.AST_NODE_TYPES.Identifier&&g.add(l.key.name);let S=p.filter(l=>!g.has(l));if(S.length>0)if(S.length===1)e.report({node:i,messageId:"propNotRead",data:{prop:S[0],fnName:c,customMsg:a||""}});else{let l=S.map(E=>`"${E}"`).join(", ");e.report({node:i,messageId:"propsNotRead",data:{props:l,fnName:c,customMsg:a||""}})}}function s(i){if(i.init?.type===V.AST_NODE_TYPES.CallExpression){if(i.init.callee.type===V.AST_NODE_TYPES.Identifier)return i.init.callee.name;if(i.init.callee.type===V.AST_NODE_TYPES.MemberExpression&&i.init.callee.property.type===V.AST_NODE_TYPES.Identifier)return i.init.callee.object.type===V.AST_NODE_TYPES.Identifier?`${i.init.callee.object.name}.${i.init.callee.property.name}`:i.init.callee.property.name}return"unknown function"}let o={};for(let i of t.varsToCheck)i.selector&&(o[i.selector]=p=>{if(p.type===V.AST_NODE_TYPES.VariableDeclarator&&p.id.type===V.AST_NODE_TYPES.Identifier&&r.set(p.id.name,{props:Array.isArray(i.prop)?i.prop:[i.prop],errorMsg:i.errorMsg,node:p.id,fnName:s(p)}),p.type===V.AST_NODE_TYPES.VariableDeclarator&&p.id.type===V.AST_NODE_TYPES.ObjectPattern){let a=Array.isArray(i.prop)?i.prop:[i.prop];n(p.id,a,i.errorMsg,s(p))}});for(let i of t.varsToCheck)if(i.fromFnCall){let p=i.fromFnCall;if(p.startsWith("*.")){let c=`VariableDeclarator > CallExpression > MemberExpression[property.name="${p.slice(2)}"]`;o[c]=g=>{if(g.type!==V.AST_NODE_TYPES.MemberExpression||g.parent.type!==V.AST_NODE_TYPES.CallExpression)return;let S=g.parent;if(S.parent.type!==V.AST_NODE_TYPES.VariableDeclarator)return;let l=S.parent;if(l.id.type===V.AST_NODE_TYPES.Identifier)r.set(l.id.name,{props:Array.isArray(i.prop)?i.prop:[i.prop],errorMsg:i.errorMsg,node:l.id,fnName:i.fromFnCall||"unknown function"});else if(l.id.type===V.AST_NODE_TYPES.ObjectPattern){let E=Array.isArray(i.prop)?i.prop:[i.prop];n(l.id,E,i.errorMsg,i.fromFnCall||"unknown function")}}}else if(p.includes(".")){let[a,c]=p.split("."),g=`VariableDeclarator > CallExpression > MemberExpression[object.name="${a}"][property.name="${c}"]`;o[g]=S=>{if(S.type!==V.AST_NODE_TYPES.MemberExpression||S.parent.type!==V.AST_NODE_TYPES.CallExpression)return;let l=S.parent;if(l.parent.type!==V.AST_NODE_TYPES.VariableDeclarator)return;let E=l.parent;if(E.id.type===V.AST_NODE_TYPES.Identifier)r.set(E.id.name,{props:Array.isArray(i.prop)?i.prop:[i.prop],errorMsg:i.errorMsg,node:E.id,fnName:i.fromFnCall||"unknown function"});else if(E.id.type===V.AST_NODE_TYPES.ObjectPattern){let f=Array.isArray(i.prop)?i.prop:[i.prop];n(E.id,f,i.errorMsg,i.fromFnCall||"unknown function")}}}else{let a=`VariableDeclarator > CallExpression > Identifier[name="${p}"]`;o[a]=c=>{if(c.type!==V.AST_NODE_TYPES.Identifier||c.parent.type!==V.AST_NODE_TYPES.CallExpression)return;let g=c.parent;if(g.parent.type!==V.AST_NODE_TYPES.VariableDeclarator)return;let S=g.parent;if(S.id.type===V.AST_NODE_TYPES.Identifier)r.set(S.id.name,{props:Array.isArray(i.prop)?i.prop:[i.prop],errorMsg:i.errorMsg,node:S.id,fnName:i.fromFnCall||"unknown function"});else if(S.id.type===V.AST_NODE_TYPES.ObjectPattern){let l=Array.isArray(i.prop)?i.prop:[i.prop];n(S.id,l,i.errorMsg,i.fromFnCall||"unknown function")}}}}return{...o,"Program:exit"(){for(let[i,{props:p,errorMsg:a,node:c,fnName:g}]of r){let l=e.sourceCode.getScope(c).set.get(i);if(l){let E=new Set(p);for(let f of l.references){let h=f.identifier,T=h.parent;if(!(T.type===V.AST_NODE_TYPES.VariableDeclarator&&T.id===h)){if(T.type===V.AST_NODE_TYPES.MemberExpression&&T.object===h&&T.property.type===V.AST_NODE_TYPES.Identifier&&E.has(T.property.name)){if(E.delete(T.property.name),E.size===0)break;continue}if(T.type===V.AST_NODE_TYPES.VariableDeclarator&&T.init===h&&T.id.type===V.AST_NODE_TYPES.ObjectPattern){for(let m of T.id.properties)m.type===V.AST_NODE_TYPES.Property&&m.key.type===V.AST_NODE_TYPES.Identifier&&E.has(m.key.name)&&E.delete(m.key.name);if(E.size===0)break;continue}if(!(T.type===V.AST_NODE_TYPES.MemberExpression&&T.object===h&&T.property.type===V.AST_NODE_TYPES.Identifier&&!p.includes(T.property.name))){E.clear();break}}}if(E.size>0){let f=Array.from(E);if(f.length===1)e.report({node:c,messageId:"propNotRead",data:{prop:f[0],fnName:g,customMsg:a||""}});else{let h=f.map(T=>`"${T}"`).join(", ");e.report({node:c,messageId:"propsNotRead",data:{props:h,fnName:g,customMsg:a||""}})}}}}}}}});function Hr(e){return/^use[A-Z0-9]/.test(e)}function Et(e){return e.type==="Identifier"?Hr(e.name):e.type==="MemberExpression"&&!e.computed&&Et(e.property)?e.object.type==="Identifier":!1}function Br(e){return e.type==="Identifier"&&/^[A-Z]/.test(e.name)}function Yr(e,t){return e.name===t||e.type==="MemberExpression"&&e.object.name==="React"&&e.property.name===t}function qr(e){return!!(e.parent&&e.parent.callee&&Yr(e.parent.callee,"forwardRef"))}function Zr(e){return!!(e.parent&&e.parent.callee&&Yr(e.parent.callee,"memo"))}function xn(e){for(;e;){let t=Kr(e);if(t&&(Br(t)||Et(t))||qr(e)||Zr(e))return!0;e=e.parent}return!1}function Vr(e){return!1}function Cn(e){return!1}var ia=/eslint +react-compiler\/react-compiler: +\["error/,Gr={meta:{type:"problem",docs:{description:"enforces the Rules of Hooks",recommended:!0,url:"https://reactjs.org/docs/hooks-rules.html"},schema:[{type:"object",ignoreIfReactCompilerIsEnabled:!1,properties:{ignoreIfReactCompilerIsEnabled:{type:"boolean"}}}]},create(e){if(e.options[0]?.ignoreIfReactCompilerIsEnabled){for(let a of e.sourceCode.getAllComments())if(ia.test(a.value))return{CallExpression(c){let g=null;c.callee.name==="useMemo"?g="useMemo":c.callee.name==="useCallback"&&(g="useCallback"),g&&e.report({node:c,message:`"${g}" is not necessary when using React Compiler.`})}}}let t=typeof e.getSource=="function"?a=>t(a):a=>e.sourceCode.getText(a),r=typeof e.getScope=="function"?()=>r():a=>e.sourceCode.getScope(a),n=null,s=[],o=[],i=new WeakSet;function p(a){for(let c of a.references){let g=c.identifier.parent;if(g.type==="VariableDeclarator"&&g.init&&g.init.type==="CallExpression"&&g.init.callee&&Vr(g.init.callee))for(let S of c.resolved.references)S!==c&&i.add(S.identifier)}}return{onCodePathSegmentStart:a=>o.push(a),onCodePathSegmentEnd:()=>o.pop(),onCodePathStart:()=>s.push(new Map),onCodePathEnd(a,c){let g=s.pop();if(g.size===0)return;let S=new Set;function l(y,x){let{cache:u}=l,d=u.get(y.id),A=new Set(x);if(A.has(y.id)){let I=[...A],P=I.slice(I.indexOf(y.id)+1);for(let k of P)S.add(k);return BigInt("0")}if(A.add(y.id),d!==void 0)return d;if(a.thrownSegments.includes(y))d=BigInt("0");else if(y.prevSegments.length===0)d=BigInt("1");else{d=BigInt("0");for(let I of y.prevSegments)d+=l(I,A)}return y.reachable&&d===BigInt("0")?u.delete(y.id):u.set(y.id,d),d}function E(y,x){let{cache:u}=E,d=u.get(y.id),A=new Set(x);if(A.has(y.id)){let I=Array.from(A),P=I.slice(I.indexOf(y.id)+1);for(let k of P)S.add(k);return BigInt("0")}if(A.add(y.id),d!==void 0)return d;if(a.thrownSegments.includes(y))d=BigInt("0");else if(y.nextSegments.length===0)d=BigInt("1");else{d=BigInt("0");for(let I of y.nextSegments)d+=E(I,A)}return u.set(y.id,d),d}function f(y){let{cache:x}=f,u=x.get(y.id);if(u===null)return 1/0;if(u!==void 0)return u;if(x.set(y.id,null),y.prevSegments.length===0)u=1;else{u=1/0;for(let d of y.prevSegments){let A=f(d);A<u&&(u=A)}u+=1}return x.set(y.id,u),u}l.cache=new Map,E.cache=new Map,f.cache=new Map;let h=E(a.initialSegment),T=Kr(c),m=xn(c),b=T?Br(T)||Et(T):qr(c)||Zr(c),C=1/0;for(let y of a.finalSegments){if(!y.reachable)continue;let x=f(y);x<C&&(C=x)}for(let[y,x]of g){if(!y.reachable)continue;let u=y.nextSegments.length===0?C<=f(y):C<f(y),d=l(y)*E(y),A=S.has(y.id);for(let I of x)if(A&&!Cn(I)&&e.report({node:I,message:`React Hook "${t(I)}" may be executed more than once. Possibly because it is called in a loop. React Hooks must be called in the exact same order in every component render.`}),b){if(c.async&&e.report({node:I,message:`React Hook "${t(I)}" cannot be called in an async function.`}),!A&&d!==h&&!Cn(I)){let k=`React Hook "${t(I)}" is called conditionally. React Hooks must be called in the exact same order in every component render.`+(u?" Did you accidentally call a React Hook after an early return?":"");e.report({node:I,message:k})}}else if(c.parent&&(c.parent.type==="MethodDefinition"||c.parent.type==="ClassProperty")&&c.parent.value===c){let P=`React Hook "${t(I)}" cannot be called in a class component. React Hooks must be called in a React function component or a custom React Hook function.`;e.report({node:I,message:P})}else if(T){let P=`React Hook "${t(I)}" is called in function "${t(T)}" that is neither a React function component nor a custom React Hook function. React component names must start with an uppercase letter. React Hook names must start with the word "use".`;e.report({node:I,message:P})}else if(c.type==="Program"){let P=`React Hook "${t(I)}" cannot be called at the top level. React Hooks must be called in a React function component or a custom React Hook function.`;e.report({node:I,message:P})}else if(m&&!Cn(I)){if(c.parent.type==="CallExpression"&&c.parent.callee.type==="Identifier"&&c.parent.callee.name==="useCallback"){let k=c.parent;if(k.parent.type==="VariableDeclarator"&&Hr(k.parent.id.name))return}let P=`React Hook "${t(I)}" cannot be called inside a callback. React Hooks must be called in a React function component or a custom React Hook function.`;e.report({node:I,message:P})}}},CallExpression(a){if(Et(a.callee)){let c=Xr(s),g=Xr(o),S=c.get(g);S||(S=[],c.set(g,S)),S.push(a.callee)}a.callee.type==="Identifier"&&(a.callee.name==="useEffect"||Vr(a.callee))&&a.arguments.length>0&&(n=a)},Identifier(a){n==null&&i.has(a)&&a.parent.type!=="CallExpression"&&e.report({node:a,message:`\`${t(a)}\` is a function created with React Hook "useEffectEvent", and can only be called from the same component. They cannot be assigned to variables or passed down.`})},"CallExpression:exit"(a){a===n&&(n=null)},FunctionDeclaration(a){xn(a)&&p(r(a))},ArrowFunctionExpression(a){xn(a)&&p(r(a))}}}};function Kr(e){return e.type==="FunctionDeclaration"||e.type==="FunctionExpression"&&e.id?e.id:e.type==="FunctionExpression"||e.type==="ArrowFunctionExpression"?e.parent.type==="VariableDeclarator"&&e.parent.init===e?e.parent.id:e.parent.type==="AssignmentExpression"&&e.parent.right===e&&e.parent.operator==="="?e.parent.left:e.parent.type==="Property"&&e.parent.value===e&&!e.parent.computed?e.parent.key:e.parent.type==="AssignmentPattern"&&e.parent.right===e&&!e.parent.computed?e.parent.left:void 0:void 0}function Xr(e){return e[e.length-1]}var le=require("@typescript-eslint/utils"),me=xe(require("zod/v4"));var sa=/^\s+$/,An=/\r?\n/,oa=/^(\s*)/,aa=/^(\s*)\S/,la=/\r?\n/,pa=me.object({indent:me.union([me.string().regex(sa),me.number().int().min(1)]).optional(),tags:me.array(me.string()).optional(),functions:me.array(me.string()).optional(),comments:me.array(me.string()).optional()}),In=_({name:"template-indent",meta:{type:"suggestion",docs:{description:"Fix whitespace-insensitive template indentation"},fixable:"code",schema:[$(pa)],messages:{improperlyIndented:"Templates should be properly indented."}},defaultOptions:[{}],create(e){let t=e.sourceCode,{comments:r=["HTML","indent"],functions:n=["dedent","stripIndent"],tags:s=["outdent","dedent","gql","sql","html","styled"],indent:o}=e.options[0],i=r.map(m=>m.toLowerCase());function p(m){let b=m.split(An),C=b.filter(x=>x.trim()!=="");if(C.length===0)return m;let y=Number.POSITIVE_INFINITY;for(let x of C){let u=x.match(oa);u&&(y=Math.min(y,u[1]?.length??0))}return!isFinite(y)||y===0?m:b.map(x=>x.slice(y)).join(`
36
- `)}function a(m,b,C){return m.split(An).map(x=>x.trim()===""?x:C.repeat(b)+x).join(`
37
- `)}function c(m){if(m.type===le.AST_NODE_TYPES.Identifier)return m.name;if(m.type===le.AST_NODE_TYPES.MemberExpression){let b=m.object.type===le.AST_NODE_TYPES.Identifier?m.object.name:null,C=m.property.type===le.AST_NODE_TYPES.Identifier?m.property.name:null;return b&&C?`${b}.${C}`:C}return null}function g(m,b){if(!m)return!1;for(let C of b)if(C.includes(".")){let y=C.split(".");if(m.type===le.AST_NODE_TYPES.MemberExpression&&m.object.type===le.AST_NODE_TYPES.Identifier&&m.property.type===le.AST_NODE_TYPES.Identifier&&m.object.name===y[0]&&m.property.name===y[1])return!0}else if(m.type===le.AST_NODE_TYPES.Identifier&&m.name===C)return!0;return!1}function S(m,b){let C=m.parent;if(C.type!==le.AST_NODE_TYPES.TaggedTemplateExpression)return!1;let y=c(C.tag);return y?b.includes(y):!1}function l(m,b){if(!m||m.type!==le.AST_NODE_TYPES.CallExpression)return!1;let{method:C,argumentsLength:y,optionalCall:x=!0,optionalMember:u=!0}=b;return y!==void 0&&m.arguments.length!==y||!x&&m.optional||m.callee.type!==le.AST_NODE_TYPES.MemberExpression||!u&&m.callee.optional||m.callee.property.type!==le.AST_NODE_TYPES.Identifier?!1:m.callee.property.name===C}function E(m,b){if(!m||m.type!==le.AST_NODE_TYPES.CallExpression)return!1;let{name:C,argumentsLength:y,optionalCall:x=!0}=b;return y!==void 0&&m.arguments.length!==y||!x&&m.optional||m.callee.type!==le.AST_NODE_TYPES.Identifier?!1:m.callee.name===C}function f(m){return l(m.parent,{method:"toMatchInlineSnapshot",argumentsLength:1,optionalCall:!1,optionalMember:!1})&&m.parent.type===le.AST_NODE_TYPES.CallExpression&&m.parent.arguments[0]===m&&E(m.parent.callee.type===le.AST_NODE_TYPES.MemberExpression?m.parent.callee.object:null,{name:"expect",argumentsLength:1,optionalCall:!1,optionalMember:!1})}function h(m){if(i.length>0){let b=t.getTokenBefore(m,{includeComments:!0});if(b?.type===le.AST_TOKEN_TYPES.Block&&i.includes(b.value.trim().toLowerCase()))return!0}return!!(f(m)||s.length>0&&S(m,s)||n.length>0&&m.parent.type===le.AST_NODE_TYPES.CallExpression&&m.parent.arguments.includes(m)&&g(m.parent.callee,n))}function T(m){let b=`__PLACEHOLDER__${Math.random()}`,C=m.quasis.map(Z=>t.getText(Z).slice(1,Z.tail?-1:-2)).join(b),y=C.match(la);if(!y)return;let x=y[0],u=t.lines[t.getLocFromIndex(m.range[0]).line-1];if(!u)return;let A=u.match(aa)?.[1]??"",I;typeof o=="string"?I=o:typeof o=="number"?I=" ".repeat(o):I=A.startsWith(" ")?" ":" ";let k=p(C).replace(new RegExp(`^${x}|${x}[ ]*$`,"g"),""),H=x+a(k,1,A+I)+x+A,K=C.includes(`\r
35
+ ${y}`)),u.push(d.replaceText(o,l)),u}}]})}var Ct=require("@typescript-eslint/utils"),Zs=Ct.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),Xr="require-description",Gs=/^(eslint(?:-env|-enable|-disable(?:(?:-next)?-line)?)?|exported|globals?)(?:\s|$)/u,Ks=/^eslint-disable-(next-)?line$/u,Qs=Zs({name:Xr,meta:{type:"problem",docs:{description:"Require descriptions for eslint directives."},messages:{missingDescription:"Unexpected undescribed directive comment. Include descriptions to explain why the comment is necessary."},schema:[{type:"object",properties:{ignore:{type:"array",items:{type:"string",enum:["eslint","eslint-disable","eslint-disable-line","eslint-disable-next-line","eslint-enable","eslint-env","exported","global","globals"]},additionalItems:!1,uniqueItems:!0}},additionalProperties:!1}]},defaultOptions:[{ignore:[]}],create(e,[t]){let r=e.sourceCode,n=new Set(t.ignore||[]);return{Program(){for(let o of r.getAllComments()){let s=ea(o);s!=null&&(n.has(s.kind)||s.description||e.report({loc:ra(o.loc),messageId:"missingDescription"}))}}}}}),Hr={name:Xr,rule:Qs};function ea(e){let{text:t,description:r}=na(e.value);if(!t)return null;let n=Gs.exec(t);if(!n)return null;let o=n[1];if(!o)return null;let s=Ks.test(o);if(e.type===Ct.TSESTree.AST_TOKEN_TYPES.Line&&!s||s&&e.loc.start.line!==e.loc.end.line)return null;let i=t.slice(n.index+o.length);return{kind:o,value:i.trim(),description:r}}var ta=/\s-{2,}\s/u;function na(e){let t=e.split(ta);return{text:t[0]?.trim(),description:t.length>1?t[1]?.trim()??null:null}}function ra(e){return{start:{line:e.start.line,column:-1},end:e.end}}var G=require("@typescript-eslint/utils"),Me=require("zod/v4");var ia=Me.z.object({varsToCheck:Me.z.array(Me.z.object({selector:Me.z.string().optional(),fromFnCall:Me.z.string().optional(),prop:Me.z.string().or(Me.z.array(Me.z.string())),errorMsg:Me.z.string().optional()}))}),wn=H({name:"require-reads-to-var-prop",meta:{type:"suggestion",docs:{description:"Require specific properties from variables to be read or ensure the variable is passed to functions/components"},messages:{propNotRead:'"{{fnName}}" requires reads to the prop "{{prop}}". {{customMsg}}',propsNotRead:'"{{fnName}}" requires reads to the props {{props}}. {{customMsg}}'},schema:[V(ia)]},defaultOptions:[{varsToCheck:[]}],create(e,[t]){let r=new Map;function n(i,p,a,c){let d=new Set;for(let l of i.properties)l.type===G.AST_NODE_TYPES.Property&&l.key.type===G.AST_NODE_TYPES.Identifier&&d.add(l.key.name);let y=p.filter(l=>!d.has(l));if(y.length>0)if(y.length===1)e.report({node:i,messageId:"propNotRead",data:{prop:y[0],fnName:c,customMsg:a||""}});else{let l=y.map(h=>`"${h}"`).join(", ");e.report({node:i,messageId:"propsNotRead",data:{props:l,fnName:c,customMsg:a||""}})}}function o(i){if(i.init?.type===G.AST_NODE_TYPES.CallExpression){if(i.init.callee.type===G.AST_NODE_TYPES.Identifier)return i.init.callee.name;if(i.init.callee.type===G.AST_NODE_TYPES.MemberExpression&&i.init.callee.property.type===G.AST_NODE_TYPES.Identifier)return i.init.callee.object.type===G.AST_NODE_TYPES.Identifier?`${i.init.callee.object.name}.${i.init.callee.property.name}`:i.init.callee.property.name}return"unknown function"}let s={};for(let i of t.varsToCheck)i.selector&&(s[i.selector]=p=>{if(p.type===G.AST_NODE_TYPES.VariableDeclarator&&p.id.type===G.AST_NODE_TYPES.Identifier&&r.set(p.id.name,{props:Array.isArray(i.prop)?i.prop:[i.prop],errorMsg:i.errorMsg,node:p.id,fnName:o(p)}),p.type===G.AST_NODE_TYPES.VariableDeclarator&&p.id.type===G.AST_NODE_TYPES.ObjectPattern){let a=Array.isArray(i.prop)?i.prop:[i.prop];n(p.id,a,i.errorMsg,o(p))}});for(let i of t.varsToCheck)if(i.fromFnCall){let p=i.fromFnCall;if(p.startsWith("*.")){let c=`VariableDeclarator > CallExpression > MemberExpression[property.name="${p.slice(2)}"]`;s[c]=d=>{if(d.type!==G.AST_NODE_TYPES.MemberExpression||d.parent.type!==G.AST_NODE_TYPES.CallExpression)return;let y=d.parent;if(y.parent.type!==G.AST_NODE_TYPES.VariableDeclarator)return;let l=y.parent;if(l.id.type===G.AST_NODE_TYPES.Identifier)r.set(l.id.name,{props:Array.isArray(i.prop)?i.prop:[i.prop],errorMsg:i.errorMsg,node:l.id,fnName:i.fromFnCall||"unknown function"});else if(l.id.type===G.AST_NODE_TYPES.ObjectPattern){let h=Array.isArray(i.prop)?i.prop:[i.prop];n(l.id,h,i.errorMsg,i.fromFnCall||"unknown function")}}}else if(p.includes(".")){let[a,c]=p.split("."),d=`VariableDeclarator > CallExpression > MemberExpression[object.name="${a}"][property.name="${c}"]`;s[d]=y=>{if(y.type!==G.AST_NODE_TYPES.MemberExpression||y.parent.type!==G.AST_NODE_TYPES.CallExpression)return;let l=y.parent;if(l.parent.type!==G.AST_NODE_TYPES.VariableDeclarator)return;let h=l.parent;if(h.id.type===G.AST_NODE_TYPES.Identifier)r.set(h.id.name,{props:Array.isArray(i.prop)?i.prop:[i.prop],errorMsg:i.errorMsg,node:h.id,fnName:i.fromFnCall||"unknown function"});else if(h.id.type===G.AST_NODE_TYPES.ObjectPattern){let u=Array.isArray(i.prop)?i.prop:[i.prop];n(h.id,u,i.errorMsg,i.fromFnCall||"unknown function")}}}else{let a=`VariableDeclarator > CallExpression > Identifier[name="${p}"]`;s[a]=c=>{if(c.type!==G.AST_NODE_TYPES.Identifier||c.parent.type!==G.AST_NODE_TYPES.CallExpression)return;let d=c.parent;if(d.parent.type!==G.AST_NODE_TYPES.VariableDeclarator)return;let y=d.parent;if(y.id.type===G.AST_NODE_TYPES.Identifier)r.set(y.id.name,{props:Array.isArray(i.prop)?i.prop:[i.prop],errorMsg:i.errorMsg,node:y.id,fnName:i.fromFnCall||"unknown function"});else if(y.id.type===G.AST_NODE_TYPES.ObjectPattern){let l=Array.isArray(i.prop)?i.prop:[i.prop];n(y.id,l,i.errorMsg,i.fromFnCall||"unknown function")}}}}return{...s,"Program:exit"(){for(let[i,{props:p,errorMsg:a,node:c,fnName:d}]of r){let l=e.sourceCode.getScope(c).set.get(i);if(l){let h=new Set(p);for(let u of l.references){let S=u.identifier,g=S.parent;if(!(g.type===G.AST_NODE_TYPES.VariableDeclarator&&g.id===S)){if(g.type===G.AST_NODE_TYPES.MemberExpression&&g.object===S&&g.property.type===G.AST_NODE_TYPES.Identifier&&h.has(g.property.name)){if(h.delete(g.property.name),h.size===0)break;continue}if(g.type===G.AST_NODE_TYPES.VariableDeclarator&&g.init===S&&g.id.type===G.AST_NODE_TYPES.ObjectPattern){for(let f of g.id.properties)f.type===G.AST_NODE_TYPES.Property&&f.key.type===G.AST_NODE_TYPES.Identifier&&h.has(f.key.name)&&h.delete(f.key.name);if(h.size===0)break;continue}if(!(g.type===G.AST_NODE_TYPES.MemberExpression&&g.object===S&&g.property.type===G.AST_NODE_TYPES.Identifier&&!p.includes(g.property.name))){h.clear();break}}}if(h.size>0){let u=Array.from(h);if(u.length===1)e.report({node:c,messageId:"propNotRead",data:{prop:u[0],fnName:d,customMsg:a||""}});else{let S=u.map(g=>`"${g}"`).join(", ");e.report({node:c,messageId:"propsNotRead",data:{props:S,fnName:d,customMsg:a||""}})}}}}}}}});function qr(e){return/^use[A-Z0-9]/.test(e)}function It(e){return e.type==="Identifier"?qr(e.name):e.type==="MemberExpression"&&!e.computed&&It(e.property)?e.object.type==="Identifier":!1}function Zr(e){return e.type==="Identifier"&&/^[A-Z]/.test(e.name)}function Gr(e,t){return e.name===t||e.type==="MemberExpression"&&e.object.name==="React"&&e.property.name===t}function Kr(e){return!!(e.parent&&e.parent.callee&&Gr(e.parent.callee,"forwardRef"))}function Qr(e){return!!(e.parent&&e.parent.callee&&Gr(e.parent.callee,"memo"))}function Rn(e){for(;e;){let t=ti(e);if(t&&(Zr(t)||It(t))||Kr(e)||Qr(e))return!0;e=e.parent}return!1}function Br(e){return!1}function Pn(e){return!1}var oa=/eslint +react-compiler\/react-compiler: +\["error/,ei={meta:{type:"problem",docs:{description:"enforces the Rules of Hooks",recommended:!0,url:"https://reactjs.org/docs/hooks-rules.html"},schema:[{type:"object",ignoreIfReactCompilerIsEnabled:!1,properties:{ignoreIfReactCompilerIsEnabled:{type:"boolean"}}}]},create(e){if(e.options[0]?.ignoreIfReactCompilerIsEnabled){for(let a of e.sourceCode.getAllComments())if(oa.test(a.value))return{CallExpression(c){let d=null;c.callee.name==="useMemo"?d="useMemo":c.callee.name==="useCallback"&&(d="useCallback"),d&&e.report({node:c,message:`"${d}" is not necessary when using React Compiler.`})}}}let t=typeof e.getSource=="function"?a=>t(a):a=>e.sourceCode.getText(a),r=typeof e.getScope=="function"?()=>r():a=>e.sourceCode.getScope(a),n=null,o=[],s=[],i=new WeakSet;function p(a){for(let c of a.references){let d=c.identifier.parent;if(d.type==="VariableDeclarator"&&d.init&&d.init.type==="CallExpression"&&d.init.callee&&Br(d.init.callee))for(let y of c.resolved.references)y!==c&&i.add(y.identifier)}}return{onCodePathSegmentStart:a=>s.push(a),onCodePathSegmentEnd:()=>s.pop(),onCodePathStart:()=>o.push(new Map),onCodePathEnd(a,c){let d=o.pop();if(d.size===0)return;let y=new Set;function l(m,b){let{cache:T}=l,A=T.get(m.id),R=new Set(b);if(R.has(m.id)){let P=[...R],L=P.slice(P.indexOf(m.id)+1);for(let C of L)y.add(C);return BigInt("0")}if(R.add(m.id),A!==void 0)return A;if(a.thrownSegments.includes(m))A=BigInt("0");else if(m.prevSegments.length===0)A=BigInt("1");else{A=BigInt("0");for(let P of m.prevSegments)A+=l(P,R)}return m.reachable&&A===BigInt("0")?T.delete(m.id):T.set(m.id,A),A}function h(m,b){let{cache:T}=h,A=T.get(m.id),R=new Set(b);if(R.has(m.id)){let P=Array.from(R),L=P.slice(P.indexOf(m.id)+1);for(let C of L)y.add(C);return BigInt("0")}if(R.add(m.id),A!==void 0)return A;if(a.thrownSegments.includes(m))A=BigInt("0");else if(m.nextSegments.length===0)A=BigInt("1");else{A=BigInt("0");for(let P of m.nextSegments)A+=h(P,R)}return T.set(m.id,A),A}function u(m){let{cache:b}=u,T=b.get(m.id);if(T===null)return 1/0;if(T!==void 0)return T;if(b.set(m.id,null),m.prevSegments.length===0)T=1;else{T=1/0;for(let A of m.prevSegments){let R=u(A);R<T&&(T=R)}T+=1}return b.set(m.id,T),T}l.cache=new Map,h.cache=new Map,u.cache=new Map;let S=h(a.initialSegment),g=ti(c),f=Rn(c),E=g?Zr(g)||It(g):Kr(c)||Qr(c),x=1/0;for(let m of a.finalSegments){if(!m.reachable)continue;let b=u(m);b<x&&(x=b)}for(let[m,b]of d){if(!m.reachable)continue;let T=m.nextSegments.length===0?x<=u(m):x<u(m),A=l(m)*h(m),R=y.has(m.id);for(let P of b)if(R&&!Pn(P)&&e.report({node:P,message:`React Hook "${t(P)}" may be executed more than once. Possibly because it is called in a loop. React Hooks must be called in the exact same order in every component render.`}),E){if(c.async&&e.report({node:P,message:`React Hook "${t(P)}" cannot be called in an async function.`}),!R&&A!==S&&!Pn(P)){let C=`React Hook "${t(P)}" is called conditionally. React Hooks must be called in the exact same order in every component render.`+(T?" Did you accidentally call a React Hook after an early return?":"");e.report({node:P,message:C})}}else if(c.parent&&(c.parent.type==="MethodDefinition"||c.parent.type==="ClassProperty")&&c.parent.value===c){let L=`React Hook "${t(P)}" cannot be called in a class component. React Hooks must be called in a React function component or a custom React Hook function.`;e.report({node:P,message:L})}else if(g){let L=`React Hook "${t(P)}" is called in function "${t(g)}" that is neither a React function component nor a custom React Hook function. React component names must start with an uppercase letter. React Hook names must start with the word "use".`;e.report({node:P,message:L})}else if(c.type==="Program"){let L=`React Hook "${t(P)}" cannot be called at the top level. React Hooks must be called in a React function component or a custom React Hook function.`;e.report({node:P,message:L})}else if(f&&!Pn(P)){if(c.parent.type==="CallExpression"&&c.parent.callee.type==="Identifier"&&c.parent.callee.name==="useCallback"){let C=c.parent;if(C.parent.type==="VariableDeclarator"&&qr(C.parent.id.name))return}let L=`React Hook "${t(P)}" cannot be called inside a callback. React Hooks must be called in a React function component or a custom React Hook function.`;e.report({node:P,message:L})}}},CallExpression(a){if(It(a.callee)){let c=Yr(o),d=Yr(s),y=c.get(d);y||(y=[],c.set(d,y)),y.push(a.callee)}a.callee.type==="Identifier"&&(a.callee.name==="useEffect"||Br(a.callee))&&a.arguments.length>0&&(n=a)},Identifier(a){n==null&&i.has(a)&&a.parent.type!=="CallExpression"&&e.report({node:a,message:`\`${t(a)}\` is a function created with React Hook "useEffectEvent", and can only be called from the same component. They cannot be assigned to variables or passed down.`})},"CallExpression:exit"(a){a===n&&(n=null)},FunctionDeclaration(a){Rn(a)&&p(r(a))},ArrowFunctionExpression(a){Rn(a)&&p(r(a))}}}};function ti(e){return e.type==="FunctionDeclaration"||e.type==="FunctionExpression"&&e.id?e.id:e.type==="FunctionExpression"||e.type==="ArrowFunctionExpression"?e.parent.type==="VariableDeclarator"&&e.parent.init===e?e.parent.id:e.parent.type==="AssignmentExpression"&&e.parent.right===e&&e.parent.operator==="="?e.parent.left:e.parent.type==="Property"&&e.parent.value===e&&!e.parent.computed?e.parent.key:e.parent.type==="AssignmentPattern"&&e.parent.right===e&&!e.parent.computed?e.parent.left:void 0:void 0}function Yr(e){return e[e.length-1]}var de=require("@typescript-eslint/utils"),he=ke(require("zod/v4"));var sa=/^\s+$/,vn=/\r?\n/,aa=/^(\s*)/,la=/^(\s*)\S/,pa=/\r?\n/,ca=he.object({indent:he.union([he.string().regex(sa),he.number().int().min(1)]).optional(),tags:he.array(he.string()).optional(),functions:he.array(he.string()).optional(),comments:he.array(he.string()).optional()}),Fn=H({name:"template-indent",meta:{type:"suggestion",docs:{description:"Fix whitespace-insensitive template indentation"},fixable:"code",schema:[V(ca)],messages:{improperlyIndented:"Templates should be properly indented."}},defaultOptions:[{}],create(e){let t=e.sourceCode,{comments:r=["HTML","indent"],functions:n=["dedent","stripIndent"],tags:o=["outdent","dedent","gql","sql","html","styled"],indent:s}=e.options[0],i=r.map(f=>f.toLowerCase());function p(f){let E=f.split(vn),x=E.filter(b=>b.trim()!=="");if(x.length===0)return f;let m=Number.POSITIVE_INFINITY;for(let b of x){let T=b.match(aa);T&&(m=Math.min(m,T[1]?.length??0))}return!isFinite(m)||m===0?f:E.map(b=>b.slice(m)).join(`
36
+ `)}function a(f,E,x){return f.split(vn).map(b=>b.trim()===""?b:x.repeat(E)+b).join(`
37
+ `)}function c(f){if(f.type===de.AST_NODE_TYPES.Identifier)return f.name;if(f.type===de.AST_NODE_TYPES.MemberExpression){let E=f.object.type===de.AST_NODE_TYPES.Identifier?f.object.name:null,x=f.property.type===de.AST_NODE_TYPES.Identifier?f.property.name:null;return E&&x?`${E}.${x}`:x}return null}function d(f,E){if(!f)return!1;for(let x of E)if(x.includes(".")){let m=x.split(".");if(f.type===de.AST_NODE_TYPES.MemberExpression&&f.object.type===de.AST_NODE_TYPES.Identifier&&f.property.type===de.AST_NODE_TYPES.Identifier&&f.object.name===m[0]&&f.property.name===m[1])return!0}else if(f.type===de.AST_NODE_TYPES.Identifier&&f.name===x)return!0;return!1}function y(f,E){let x=f.parent;if(x.type!==de.AST_NODE_TYPES.TaggedTemplateExpression)return!1;let m=c(x.tag);return m?E.includes(m):!1}function l(f,E){if(!f||f.type!==de.AST_NODE_TYPES.CallExpression)return!1;let{method:x,argumentsLength:m,optionalCall:b=!0,optionalMember:T=!0}=E;return m!==void 0&&f.arguments.length!==m||!b&&f.optional||f.callee.type!==de.AST_NODE_TYPES.MemberExpression||!T&&f.callee.optional||f.callee.property.type!==de.AST_NODE_TYPES.Identifier?!1:f.callee.property.name===x}function h(f,E){if(!f||f.type!==de.AST_NODE_TYPES.CallExpression)return!1;let{name:x,argumentsLength:m,optionalCall:b=!0}=E;return m!==void 0&&f.arguments.length!==m||!b&&f.optional||f.callee.type!==de.AST_NODE_TYPES.Identifier?!1:f.callee.name===x}function u(f){return l(f.parent,{method:"toMatchInlineSnapshot",argumentsLength:1,optionalCall:!1,optionalMember:!1})&&f.parent.type===de.AST_NODE_TYPES.CallExpression&&f.parent.arguments[0]===f&&h(f.parent.callee.type===de.AST_NODE_TYPES.MemberExpression?f.parent.callee.object:null,{name:"expect",argumentsLength:1,optionalCall:!1,optionalMember:!1})}function S(f){if(i.length>0){let E=t.getTokenBefore(f,{includeComments:!0});if(E?.type===de.AST_TOKEN_TYPES.Block&&i.includes(E.value.trim().toLowerCase()))return!0}return!!(u(f)||o.length>0&&y(f,o)||n.length>0&&f.parent.type===de.AST_NODE_TYPES.CallExpression&&f.parent.arguments.includes(f)&&d(f.parent.callee,n))}function g(f){let E=`__PLACEHOLDER__${Math.random()}`,x=f.quasis.map(z=>t.getText(z).slice(1,z.tail?-1:-2)).join(E),m=x.match(pa);if(!m)return;let b=m[0],T=t.lines[t.getLocFromIndex(f.range[0]).line-1];if(!T)return;let R=T.match(la)?.[1]??"",P;typeof s=="string"?P=s:typeof s=="number"?P=" ".repeat(s):P=R.startsWith(" ")?" ":" ";let C=p(x).replace(new RegExp(`^${b}|${b}[ ]*$`,"g"),""),I=b+a(C,1,R+P)+b+R,F=x.includes(`\r
38
38
  `)?`\r
39
39
  `:`
40
- `,ne=C.split(An),oe=ne.map((Z,de)=>de!==ne.length-1&&Z===I+A?"":Z).join(K);if(H!==oe)return{node:m,messageId:"improperlyIndented",fix:Z=>H.split(b).map((de,Ae)=>{let ue=m.quasis[Ae];return ue?Z.replaceTextRange([ue.range[0]+1,ue.range[1]-(ue.tail?1:2)],de):[]}).flat()}}return{TemplateLiteral(m){if(!h(m))return;let b=T(m);if(b)return e.report(b)}}}});var wn=require("@typescript-eslint/utils");function ca(e){if(!("regex"in e))return!1;let t=e.regex.flags;return t.includes("g")||t.includes("y")}function ua(e){let t=e.parent;return t?.type===wn.AST_NODE_TYPES.NewExpression&&t.callee.type===wn.AST_NODE_TYPES.Identifier&&t.callee.name==="RegExp"}var Rn=_({name:"use-top-level-regex",meta:{type:"suggestion",docs:{description:"Require regex literals to be declared at the top level to avoid performance issues"},messages:{regexShouldBeTopLevel:"Move this regex literal to the top level to avoid creating new RegExp objects on each function call."},schema:[],hasSuggestions:!1},defaultOptions:[],create(e){function t(r){ca(r)||ua(r)||e.report({node:r,messageId:"regexShouldBeTopLevel"})}return{"FunctionDeclaration Literal[regex], FunctionExpression Literal[regex], ArrowFunctionExpression Literal[regex], MethodDefinition Literal[regex]":t}}});var pe=require("@typescript-eslint/utils"),Ze=require("zod/v4");var fa=Ze.z.object({checkOnly:Ze.z.array(Ze.z.enum(["function-args","FC","generic-args-at-fn-calls"])).optional(),checkTypesFromSelectors:Ze.z.array(Ze.z.string()).optional()}),Pn=_({name:"use-types-directly-above-usage",meta:{type:"suggestion",docs:{description:"Require type definitions to be placed directly above their first usage for better readability"},fixable:"code",schema:[$(fa)],messages:{moveTypeAboveUsage:"Type definition should be placed directly above its first usage."}},defaultOptions:[{}],create(e,[t]){let r=e.sourceCode,n=new Map,s=[];function o(f){for(let h of s)if(f.range[0]>=h.range[0]&&f.range[1]<=h.range[1])return h;return null}function i(f){let h=f.parent;for(;h;){if(h.type===pe.AST_NODE_TYPES.FunctionDeclaration||h.type===pe.AST_NODE_TYPES.FunctionExpression||h.type===pe.AST_NODE_TYPES.ArrowFunctionExpression){let T=h.params;for(let m of T)if(f.range[0]>=m.range[0]&&f.range[1]<=m.range[1])return!0;break}h=h.parent}return!1}function p(f){let h=f.parent;for(;h;){if(h.type===pe.AST_NODE_TYPES.TSTypeParameterInstantiation){let T=h.parent;if(T.type===pe.AST_NODE_TYPES.TSTypeReference&&T.typeName.type===pe.AST_NODE_TYPES.Identifier&&(T.typeName.name==="FC"||T.typeName.name==="React.FC")||T.type===pe.AST_NODE_TYPES.TSTypeReference&&T.typeName.type===pe.AST_NODE_TYPES.TSQualifiedName&&T.typeName.right.name==="FC")return!0}h=h.parent}return!1}function a(f){let h=f.parent;for(;h;){if(h.type===pe.AST_NODE_TYPES.TSTypeParameterInstantiation){let T=h.parent;if(T.type===pe.AST_NODE_TYPES.CallExpression||T.type===pe.AST_NODE_TYPES.NewExpression)return!0}h=h.parent}return!1}function c(f){let h=f.parent;for(;h;){if(h.type===pe.AST_NODE_TYPES.TSTypeAliasDeclaration||h.type===pe.AST_NODE_TYPES.TSInterfaceDeclaration)return!0;h=h.parent}return!1}function g(f){return f.parent.type===pe.AST_NODE_TYPES.TSIndexedAccessType&&f.parent.objectType===f}let S=[];function l(f){let h=[],T=new Map;for(let{typeName:b,firstUsage:C}of f){let y=T.get(C)||[];y.push(b),T.set(C,y)}for(let{typeName:b,firstUsage:C,firstUsagePosition:y,firstUsageInFunctionArgs:x}of f){let u=n.get(b);if(!u||u.statement===C)continue;let d=s.indexOf(u.statement),A=s.indexOf(C);if(d===-1||A===-1)continue;let I=!!(t.checkOnly&&t.checkOnly.includes("function-args")&&x),k=(T.get(C)||[]).length>1;(I||k?d>A:d>A||d!==A-1)&&h.push({typeName:b,typeDef:u,targetStatement:C,firstUsagePosition:y})}if(h.length===0)return;h.sort((b,C)=>{let y=b.firstUsagePosition-C.firstUsagePosition;if(y!==0)return y;let x=s.indexOf(b.typeDef.statement),u=s.indexOf(C.typeDef.statement);return x-u});let m=h[0];m&&e.report({node:m.typeDef.node,messageId:"moveTypeAboveUsage",fix:E(h)})}function E(f){return function*(h){let T=new Map;for(let m of f){let b=T.get(m.targetStatement)||[];b.push(m),T.set(m.targetStatement,b)}for(let[,m]of T)m.sort((b,C)=>{let y=b.firstUsagePosition-C.firstUsagePosition;if(y!==0)return y;let x=s.indexOf(b.typeDef.statement),u=s.indexOf(C.typeDef.statement);return x-u});for(let m of f){let{typeDef:b}=m,C=b.statement,y=r.getCommentsBefore(C),x=C.range[0],u=C.range[1];y.length>0&&y[0]&&(x=y[0].range[0]),yield h.removeRange([x,u])}for(let[m,b]of T){let C=r.getCommentsBefore(m),y=C.length>0&&C[0]?C[0].range[0]:m.range[0],x=[];for(let u of b){let d=u.typeDef.statement,A=r.getText(d),I=r.getCommentsBefore(d),P=A;I.length>0&&(P=`${I.map(H=>r.getText(H)).join(`
40
+ `,N=x.split(vn),te=N.map((z,ie)=>ie!==N.length-1&&z===P+R?"":z).join(F);if(I!==te)return{node:f,messageId:"improperlyIndented",fix:z=>I.split(E).map((ie,M)=>{let W=f.quasis[M];return W?z.replaceTextRange([W.range[0]+1,W.range[1]-(W.tail?1:2)],ie):[]}).flat()}}return{TemplateLiteral(f){if(!S(f))return;let E=g(f);if(E)return e.report(E)}}}});var kn=require("@typescript-eslint/utils");function ua(e){if(!("regex"in e))return!1;let t=e.regex.flags;return t.includes("g")||t.includes("y")}function fa(e){let t=e.parent;return t?.type===kn.AST_NODE_TYPES.NewExpression&&t.callee.type===kn.AST_NODE_TYPES.Identifier&&t.callee.name==="RegExp"}var On=H({name:"use-top-level-regex",meta:{type:"suggestion",docs:{description:"Require regex literals to be declared at the top level to avoid performance issues"},messages:{regexShouldBeTopLevel:"Move this regex literal to the top level to avoid creating new RegExp objects on each function call."},schema:[],hasSuggestions:!1},defaultOptions:[],create(e){function t(r){ua(r)||fa(r)||e.report({node:r,messageId:"regexShouldBeTopLevel"})}return{"FunctionDeclaration Literal[regex], FunctionExpression Literal[regex], ArrowFunctionExpression Literal[regex], MethodDefinition Literal[regex]":t}}});var ye=require("@typescript-eslint/utils"),tt=require("zod/v4");var ma=tt.z.object({checkOnly:tt.z.array(tt.z.enum(["function-args","FC","generic-args-at-fn-calls"])).optional(),checkTypesFromSelectors:tt.z.array(tt.z.string()).optional()}),Nn=H({name:"use-types-directly-above-usage",meta:{type:"suggestion",docs:{description:"Require type definitions to be placed directly above their first usage for better readability"},fixable:"code",schema:[V(ma)],messages:{moveTypeAboveUsage:"Type definition should be placed directly above its first usage."}},defaultOptions:[{}],create(e,[t]){let r=e.sourceCode,n=new Map,o=[];function s(u){for(let S of o)if(u.range[0]>=S.range[0]&&u.range[1]<=S.range[1])return S;return null}function i(u){let S=u.parent;for(;S;){if(S.type===ye.AST_NODE_TYPES.FunctionDeclaration||S.type===ye.AST_NODE_TYPES.FunctionExpression||S.type===ye.AST_NODE_TYPES.ArrowFunctionExpression){let g=S.params;for(let f of g)if(u.range[0]>=f.range[0]&&u.range[1]<=f.range[1])return!0;break}S=S.parent}return!1}function p(u){let S=u.parent;for(;S;){if(S.type===ye.AST_NODE_TYPES.TSTypeParameterInstantiation){let g=S.parent;if(g.type===ye.AST_NODE_TYPES.TSTypeReference&&g.typeName.type===ye.AST_NODE_TYPES.Identifier&&(g.typeName.name==="FC"||g.typeName.name==="React.FC")||g.type===ye.AST_NODE_TYPES.TSTypeReference&&g.typeName.type===ye.AST_NODE_TYPES.TSQualifiedName&&g.typeName.right.name==="FC")return!0}S=S.parent}return!1}function a(u){let S=u.parent;for(;S;){if(S.type===ye.AST_NODE_TYPES.TSTypeParameterInstantiation){let g=S.parent;if(g.type===ye.AST_NODE_TYPES.CallExpression||g.type===ye.AST_NODE_TYPES.NewExpression)return!0}S=S.parent}return!1}function c(u){let S=u.parent;for(;S;){if(S.type===ye.AST_NODE_TYPES.TSTypeAliasDeclaration||S.type===ye.AST_NODE_TYPES.TSInterfaceDeclaration)return!0;S=S.parent}return!1}function d(u){return u.parent.type===ye.AST_NODE_TYPES.TSIndexedAccessType&&u.parent.objectType===u}let y=[];function l(u){let S=[],g=new Map;for(let{typeName:E,firstUsage:x}of u){let m=g.get(x)||[];m.push(E),g.set(x,m)}for(let{typeName:E,firstUsage:x,firstUsagePosition:m,firstUsageInFunctionArgs:b}of u){let T=n.get(E);if(!T||T.statement===x)continue;let A=o.indexOf(T.statement),R=o.indexOf(x);if(A===-1||R===-1)continue;let P=!!(t.checkOnly&&t.checkOnly.includes("function-args")&&b),C=(g.get(x)||[]).length>1;(P||C?A>R:A>R||A!==R-1)&&S.push({typeName:E,typeDef:T,targetStatement:x,firstUsagePosition:m})}if(S.length===0)return;S.sort((E,x)=>{let m=E.firstUsagePosition-x.firstUsagePosition;if(m!==0)return m;let b=o.indexOf(E.typeDef.statement),T=o.indexOf(x.typeDef.statement);return b-T});let f=S[0];f&&e.report({node:f.typeDef.node,messageId:"moveTypeAboveUsage",fix:h(S)})}function h(u){return function*(S){let g=new Map;for(let f of u){let E=g.get(f.targetStatement)||[];E.push(f),g.set(f.targetStatement,E)}for(let[,f]of g)f.sort((E,x)=>{let m=E.firstUsagePosition-x.firstUsagePosition;if(m!==0)return m;let b=o.indexOf(E.typeDef.statement),T=o.indexOf(x.typeDef.statement);return b-T});for(let f of u){let{typeDef:E}=f,x=E.statement,m=r.getCommentsBefore(x),b=x.range[0],T=x.range[1];m.length>0&&m[0]&&(b=m[0].range[0]),yield S.removeRange([b,T])}for(let[f,E]of g){let x=r.getCommentsBefore(f),m=x.length>0&&x[0]?x[0].range[0]:f.range[0],b=[];for(let T of E){let A=T.typeDef.statement,R=r.getText(A),P=r.getCommentsBefore(A),L=R;P.length>0&&(L=`${P.map(I=>r.getText(I)).join(`
41
41
  `)}
42
- ${A}`),x.push(P)}yield h.insertTextBeforeRange([y,y],`${x.join(`
42
+ ${R}`),b.push(L)}yield S.insertTextBeforeRange([m,m],`${b.join(`
43
43
 
44
44
  `)}
45
45
 
46
- `)}}}return{Program(f){s.push(...f.body)},TSTypeAliasDeclaration(f){if(s.some(T=>T.type===pe.AST_NODE_TYPES.ExportNamedDeclaration&&T.declaration===f?!0:T===f)){let T=o(f);T&&n.set(f.id.name,{node:f,name:f.id.name,statement:T})}},TSInterfaceDeclaration(f){if(s.some(T=>T.type===pe.AST_NODE_TYPES.ExportNamedDeclaration&&T.declaration===f?!0:T===f)){let T=o(f);T&&n.set(f.id.name,{node:f,name:f.id.name,statement:T})}},TSTypeReference(f){if(f.typeName.type===pe.AST_NODE_TYPES.Identifier){if(g(f))return;let h=i(f),T=p(f),m=a(f);S.push({typeName:f.typeName.name,node:f,inFunctionArgs:h,inFCProps:T,inGenericArgAtFunctionCall:m,usagePosition:f.range[0]})}},"Program:exit"(){let f=new Map;function h(m){if(!t.checkOnly||t.checkOnly.length===0)return!0;for(let b of t.checkOnly)if(b==="function-args"&&m.inFunctionArgs||b==="FC"&&m.inFCProps||b==="generic-args-at-fn-calls"&&m.inGenericArgAtFunctionCall)return!0;return!1}for(let m of S){let{typeName:b,node:C}=m;if(!n.has(b)||!h(m))continue;let y=o(C),x=n.get(b);if(!y||!x||y===x.statement)continue;f.has(b)||f.set(b,[]);let u=f.get(b);if(!u)return;u.includes(y)||u.push(y)}let T=[];for(let[m,b]of f)if(b.length>0){if(b.length===0)continue;let C=b[0];if(!C)continue;let y=Number.MAX_SAFE_INTEGER,x=!1;for(let d of b)d.range[0]<C.range[0]&&(C=d);for(let d of S)h(d)&&d.typeName===m&&o(d.node)===C&&d.usagePosition<y&&(y=d.usagePosition,x=d.inFunctionArgs);if(!!(t.checkOnly&&t.checkOnly.length>0)){let d=Number.MAX_SAFE_INTEGER;for(let I of S){if(I.typeName!==m)continue;let P=o(I.node);if(!P)continue;let k=s.indexOf(P);k!==-1&&k<d&&(d=k)}let A=s.indexOf(C);if(d!==Number.MAX_SAFE_INTEGER&&A!==-1&&d<A)continue}else{let d=Number.MAX_SAFE_INTEGER;for(let I of S){if(I.typeName!==m||c(I.node))continue;let P=o(I.node);if(!P)continue;let k=s.indexOf(P);k!==-1&&k<d&&(d=k)}let A=s.indexOf(C);if(d!==Number.MAX_SAFE_INTEGER&&A!==-1&&d<A)continue}T.push({typeName:m,firstUsage:C,firstUsagePosition:y,firstUsageInFunctionArgs:x})}T.length>0&&l(T)}}}});var B=require("@typescript-eslint/utils"),Ge=xe(require("zod/v4"));var ma=["tsx"],ya=/^[A-Z][A-Za-z0-9]*$/,da=Ge.object({extensions:Ge.array(Ge.string()).optional()}),vn=_({name:"react-single-export",meta:{type:"problem",docs:{description:"Enforces only one export per React component file to support fast refresh"},messages:{multipleExports:"React component files should have only one export to support fast refresh, if you want to export multiple components, use a separate file for each component. Type-only exports are allowed."},schema:[$(da)]},defaultOptions:[{}],create(e,[t]){let r=e.getFilename(),n=t.extensions??ma,s=!1;for(let y of n)if(r.endsWith(y)){s=!0;break}if(!s)return{};let o=e.sourceCode,i=new Set,p=new Map;function a(y){return ya.test(y)}function c(y){if(y.type!==B.AST_NODE_TYPES.CallExpression)return!1;let x=y.callee;return x.type===B.AST_NODE_TYPES.Identifier?x.name==="memo"||x.name==="forwardRef":x.type===B.AST_NODE_TYPES.MemberExpression&&x.property.type===B.AST_NODE_TYPES.Identifier?x.property.name==="memo"||x.property.name==="forwardRef":!1}function g(y){if(y.type===B.AST_NODE_TYPES.JSXElement||y.type===B.AST_NODE_TYPES.JSXFragment)return!0;if(y.type===B.AST_NODE_TYPES.ArrayExpression){for(let x of y.elements)if(x&&(x.type===B.AST_NODE_TYPES.JSXElement||x.type===B.AST_NODE_TYPES.JSXFragment))return!0}return!1}function S(y){if(y.type!==B.AST_NODE_TYPES.ArrowFunctionExpression)return!1;let x=y.body;if(x.type===B.AST_NODE_TYPES.ArrowFunctionExpression){let u=x.body;if(g(u))return!0}return!1}function l(y){if(y.id.type!==B.AST_NODE_TYPES.Identifier)return;let x=y.id.name,u=y.init;if(u){if(a(x)&&(u.type===B.AST_NODE_TYPES.ArrowFunctionExpression||u.type===B.AST_NODE_TYPES.FunctionExpression||c(u))){i.add(x);return}u.type===B.AST_NODE_TYPES.Identifier&&p.set(x,u.name),a(x)||S(u)&&i.add(x)}}function E(y){if(y.type===B.AST_NODE_TYPES.VariableDeclaration){for(let x of y.declarations)l(x);return}if(y.type===B.AST_NODE_TYPES.FunctionDeclaration&&y.id){a(y.id.name)&&i.add(y.id.name);return}if(y.type===B.AST_NODE_TYPES.ExportNamedDeclaration&&y.declaration){let x=y.declaration;if(x.type===B.AST_NODE_TYPES.VariableDeclaration){for(let u of x.declarations)l(u);return}if(x.type===B.AST_NODE_TYPES.FunctionDeclaration&&x.id){a(x.id.name)&&i.add(x.id.name);return}}}for(let y of o.ast.body)E(y);function f(y,x=new Set){if(i.has(y))return!0;if(x.has(y))return!1;x.add(y);let u=p.get(y);return u?f(u,x):!1}let h=[];function T(y,x,u){h.push({node:y,isType:x,isComponent:u})}for(let y of o.ast.body){if(y.type===B.AST_NODE_TYPES.ExportNamedDeclaration){let x=y.exportKind==="type";if(y.declaration){let u=y.declaration;if(u.type===B.AST_NODE_TYPES.TSTypeAliasDeclaration||u.type===B.AST_NODE_TYPES.TSInterfaceDeclaration){T(u,!0,!1);continue}if(u.type===B.AST_NODE_TYPES.VariableDeclaration){for(let d of u.declarations){if(d.id.type!==B.AST_NODE_TYPES.Identifier)continue;let A=d.id.name,I=f(A);T(d,x,I)}continue}if(u.type===B.AST_NODE_TYPES.FunctionDeclaration){let d=u.id?.name,A=d?f(d)||a(d):!1;T(u,x,A);continue}T(u,x,!1);continue}if(y.specifiers.length>0)for(let u of y.specifiers){if(u.local.type!==B.AST_NODE_TYPES.Identifier)continue;let d=u.local.name,A=f(d);T(u,x,A)}continue}if(y.type===B.AST_NODE_TYPES.ExportDefaultDeclaration){let x=y.declaration;if(x.type===B.AST_NODE_TYPES.Identifier){let u=f(x.name)||a(x.name);T(y,!1,u);continue}if(x.type===B.AST_NODE_TYPES.FunctionDeclaration||x.type===B.AST_NODE_TYPES.ArrowFunctionExpression||x.type===B.AST_NODE_TYPES.FunctionExpression||x.type===B.AST_NODE_TYPES.CallExpression){T(y,!1,!0);continue}T(y,!1,!1);continue}}let m=!1;for(let y of h)if(!y.isType&&y.isComponent){m=!0;break}if(!m)return{};let b=[];for(let y of h)y.isType||b.push(y);let C=-1;for(let[y,x]of b.entries())if(x.isComponent){C=y;break}if(C===-1)return{};for(let[y,x]of b.entries())if(y!==C){e.report({node:x.node,messageId:"multipleExports"});break}return{}}});var je=require("@typescript-eslint/utils"),bt=require("zod/v4");function xt(e){return e.charAt(0).toUpperCase()+e.slice(1)}function ga(e){return e.callee.type===je.AST_NODE_TYPES.Identifier?e.callee.name==="useState":e.callee.type===je.AST_NODE_TYPES.MemberExpression&&e.callee.object.type===je.AST_NODE_TYPES.Identifier&&e.callee.property.type===je.AST_NODE_TYPES.Identifier?e.callee.object.name==="React"&&e.callee.property.name==="useState":!1}var Sa=bt.z.object({ignorePrefixes:bt.z.array(bt.z.string()).optional()});function Qr(e,t){for(let r of t)if(e.startsWith(r))return e.slice(r.length);return e}function Ta(e){return`set${xt(e)}`}var kn=_({name:"use-state-setter-naming",meta:{type:"problem",docs:{description:"Enforce consistent naming convention for useState destructuring where setter should be set{Value}"},messages:{incorrectSetterName:'useState setter should follow the pattern "set{{expectedName}}" with a "set" prefix but got "{{actualName}}"',useSuggestedName:'Use "{{expectedSetterName}}" instead'},hasSuggestions:!0,schema:[$(Sa)]},defaultOptions:[{ignorePrefixes:[]}],create(e,[t]){return{VariableDeclarator(r){if(!r.init||r.init.type!==je.AST_NODE_TYPES.CallExpression||!ga(r.init)||r.id.type!==je.AST_NODE_TYPES.ArrayPattern||r.id.elements.length!==2)return;let[n,s]=r.id.elements;if(!n||!s||n.type!==je.AST_NODE_TYPES.Identifier||s.type!==je.AST_NODE_TYPES.Identifier)return;let o=n.name,i=s.name,p=t.ignorePrefixes||[],a=Qr(o,p),c=Qr(i,p);if(a===""){if(!c.startsWith("set")){let S=`set${xt(o)}`;e.report({node:s,messageId:"incorrectSetterName",data:{expectedName:xt(o),actualName:i},suggest:[{messageId:"useSuggestedName",data:{expectedSetterName:S},fix:l=>l.replaceText(s,S)}]})}return}let g=Ta(a);c!==g&&e.report({node:s,messageId:"incorrectSetterName",data:{expectedName:xt(a),actualName:i},suggest:[{messageId:"useSuggestedName",data:{expectedSetterName:g},fix:S=>S.replaceText(s,g)}]})}}}});var se=require("@typescript-eslint/utils"),Xe=require("zod/v4");var ha=Xe.z.object({name:Xe.z.string(),defaults:Xe.z.array(Xe.z.unknown())}),Ea=Xe.z.object({functions:Xe.z.array(ha)});function Ct(e,t){if(e===t)return!0;if(e===null||t===null||e===void 0||t===void 0)return e===t;if(typeof e!=typeof t||typeof e!="object"||Array.isArray(e)!==Array.isArray(t))return!1;if(Array.isArray(e)&&Array.isArray(t))return e.length!==t.length?!1:e.every((s,o)=>Ct(s,t[o]));let r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(let s of r){if(!n.includes(s))return!1;let o=Object.getOwnPropertyDescriptor(e,s),i=Object.getOwnPropertyDescriptor(t,s);if(!o||!i)return!1;let p=o.value,a=i.value;if(!Ct(p,a))return!1}return!0}function ba(e,t){let r=new Set;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return r;for(let n in e){if(!(n in t))continue;let s=Object.getOwnPropertyDescriptor(e,n),o=Object.getOwnPropertyDescriptor(t,n);s&&o&&Ct(s.value,o.value)&&r.add(n)}return r}function ei(e){if(e.type===se.AST_NODE_TYPES.SpreadElement)return Symbol("COMPLEX_EXPRESSION");switch(e.type){case se.AST_NODE_TYPES.Literal:return e.value;case se.AST_NODE_TYPES.ObjectExpression:{let t={};for(let r of e.properties)r.type===se.AST_NODE_TYPES.Property&&r.key.type===se.AST_NODE_TYPES.Identifier&&!r.computed&&(r.value.type===se.AST_NODE_TYPES.Literal?t[r.key.name]=r.value.value:r.value.type===se.AST_NODE_TYPES.ObjectExpression?t[r.key.name]=ei(r.value):t[r.key.name]=Symbol("COMPLEX_EXPRESSION"));return t}case se.AST_NODE_TYPES.ArrayExpression:return e.elements.map(t=>{if(!(!t||t.type===se.AST_NODE_TYPES.SpreadElement))return t.type===se.AST_NODE_TYPES.Literal?t.value:Symbol("COMPLEX_EXPRESSION")});default:return Symbol("COMPLEX_EXPRESSION")}}function xa(e){return e.type===se.AST_NODE_TYPES.Identifier?e.name:e.type===se.AST_NODE_TYPES.MemberExpression&&e.property.type===se.AST_NODE_TYPES.Identifier&&!e.computed?e.property.name:null}var Fn=_({name:"no-redundant-function-params",meta:{type:"suggestion",docs:{description:"Disallow calling functions with redundant default parameters"},messages:{redundantParams:"Function call has redundant parameters matching its default values and can be removed: {{details}}"},fixable:"code",schema:[$(Ea)]},defaultOptions:[{functions:[]}],create(e,[t]){let r=new Map;for(let n of t.functions)r.set(n.name,n.defaults);return{CallExpression(n){let s=xa(n.callee);if(!s)return;let o=r.get(s);if(!o)return;let i=n.arguments;if(i.length===0)return;let p=-1,a=!1,c=new Map,g=new Set,S=new Map,l=[];for(let f=0;f<i.length;f++){if(f>=o.length){p=f;continue}let h=o[f],T=i[f];if(!T||T.type===se.AST_NODE_TYPES.SpreadElement){p=f;continue}let m=ei(T);if(h===void 0){p=f;continue}if(Ct(m,h)){T.type===se.AST_NODE_TYPES.ObjectExpression?(g.add(f),l.push({type:"object",position:f+1})):(S.set(f,m),l.push({type:"simple",position:f+1,value:m}));continue}if(T.type===se.AST_NODE_TYPES.ObjectExpression&&T.properties.length===0&&typeof h=="object"&&h!==null&&Object.keys(h).length>0){g.add(f),l.push({type:"object",position:f+1});continue}let b=ba(m,h);if(b.size>0){let C=typeof h=="object"&&h!==null?Object.keys(h).length:0;if(T.type===se.AST_NODE_TYPES.ObjectExpression&&T.properties.length===b.size&&T.properties.length===C){g.add(f),l.push({type:"object",position:f+1});continue}else a=!0,c.set(f,b),l.push({type:"partialObject",position:f+1,redundantProperties:Array.from(b)}),p=f}else p=f}if(p<i.length-1||a||g.size>0){let f=function(){let T=[];for(let m of l)if(m.type==="simple")T.push(`Param ${m.position} with value ${JSON.stringify(m.value)}`);else if(m.type==="object")T.push(`Param ${m.position} (object)`);else{let b=m.redundantProperties||[],C=o?o[m.position-1]:void 0;if(typeof C=="object"&&C!==null){let y=C;for(let x of b)if(x in y){let u=Object.getOwnPropertyDescriptor(y,x);u&&T.push(`Param ${m.position} property "${x}" with value ${JSON.stringify(u.value)}`)}}}return{messageId:"redundantParams",data:{details:T.join(", ")}}};var E=f;let h=f();e.report({node:n,messageId:h.messageId,data:h.data,fix(T){let m=[];if(a)for(let[C,y]of c){let x=i[C];if(x&&x.type===se.AST_NODE_TYPES.ObjectExpression){let u=[];for(let A of x.properties)A.type===se.AST_NODE_TYPES.Property&&A.key.type===se.AST_NODE_TYPES.Identifier&&!A.computed&&y.has(A.key.name)||u.push(A);let d=u.map(A=>e.sourceCode.getText(A));m.push(T.replaceText(x,`{ ${d.join(", ")} }`))}}let b=-1;for(let C=i.length-1;C>=0;C--)if(!g.has(C)&&C<=p){b=C;break}if(b<i.length-1)if(b===-1){let C=e.sourceCode.getTokenAfter(n.callee),y=e.sourceCode.getLastToken(n);C&&y&&m.push(T.replaceTextRange([C.range[1],y.range[0]],""))}else{let C=i[b],y=e.sourceCode.getLastToken(n);y&&C&&m.push(T.replaceTextRange([C.range[1],y.range[0]],""))}return m.length>0?m:null}})}}}}});var Se=require("@typescript-eslint/utils");function Ca(e){let t=e.parent;for(;t;){if(t.type===Se.AST_NODE_TYPES.AwaitExpression||t.type===Se.AST_NODE_TYPES.MemberExpression&&t.object===e&&t.property.type===Se.AST_NODE_TYPES.Identifier&&t.property.name==="then"||t.type===Se.AST_NODE_TYPES.ArrowFunctionExpression&&t.body===e)return!0;if(t.type===Se.AST_NODE_TYPES.ArrayExpression&&t.parent.type===Se.AST_NODE_TYPES.CallExpression){let r=t.parent;if(r.callee.type===Se.AST_NODE_TYPES.MemberExpression&&r.callee.object.type===Se.AST_NODE_TYPES.Identifier&&r.callee.object.name==="Promise"&&r.callee.property.type===Se.AST_NODE_TYPES.Identifier&&["all","allSettled","race"].includes(r.callee.property.name))return!0}if(t.parent)t=t.parent;else break}return!1}function Aa(e){let{callee:t}=e;return t.type===Se.AST_NODE_TYPES.Identifier&&t.name==="require"||t.type===Se.AST_NODE_TYPES.MemberExpression&&t.object.type===Se.AST_NODE_TYPES.Identifier&&t.object.name==="require"}var On=_({name:"no-sync-dynamic-import",meta:{type:"problem",docs:{description:"Disallow synchronous dynamic imports and require statements, only allow async dynamic imports with await"},messages:{syncDynamicImport:"Synchronous dynamic import() is not allowed. Use regular import statement or await import() for dynamic imports.",requireNotAllowed:"require() statements are not allowed. Use ES6 import statements instead."},schema:[]},defaultOptions:[],create(e){return{ImportExpression(t){Ca(t)||e.report({node:t,messageId:"syncDynamicImport"})},TSImportType(t){e.report({node:t,messageId:"syncDynamicImport"})},CallExpression(t){Aa(t)&&e.report({node:t,messageId:"requireNotAllowed"})}}}});var j=require("@typescript-eslint/utils"),Nn=require("zod/v4");var Ia=Nn.z.object({mainComponentRegex:Nn.z.string().optional()}),wa=/^[A-Z][A-Za-z0-9]*$/,Dn=_({name:"sort-react-components-and-styles",meta:{type:"suggestion",docs:{description:"Sort React components and styles with styles placed above their first usage"},fixable:"code",schema:[$(Ia)],messages:{stylesShouldBeAboveUsage:"Style definitions should be placed above the first component that uses them"}},defaultOptions:[{}],create(e,[t]){let r=e.sourceCode,n=t.mainComponentRegex?new RegExp(t.mainComponentRegex):void 0,s=new Set,o=new Map,i=[],p=[];function a(u){return wa.test(u)}function c(u){if(u.type!==j.AST_NODE_TYPES.CallExpression)return!1;let d=u.callee;return d.type===j.AST_NODE_TYPES.Identifier?d.name==="memo"||d.name==="forwardRef":d.type===j.AST_NODE_TYPES.MemberExpression&&d.property.type===j.AST_NODE_TYPES.Identifier?d.property.name==="memo"||d.property.name==="forwardRef":!1}function g(u){if(u.type===j.AST_NODE_TYPES.JSXElement||u.type===j.AST_NODE_TYPES.JSXFragment)return!0;if(u.type===j.AST_NODE_TYPES.BlockStatement){for(let d of u.body)if(d.type===j.AST_NODE_TYPES.ReturnStatement&&d.argument)return g(d.argument)}if(u.type===j.AST_NODE_TYPES.ArrayExpression){for(let d of u.elements)if(d&&(d.type===j.AST_NODE_TYPES.JSXElement||d.type===j.AST_NODE_TYPES.JSXFragment))return!0}return!1}function S(u){if(u.type!==j.AST_NODE_TYPES.ArrowFunctionExpression)return!1;let d=u.body;if(d.type===j.AST_NODE_TYPES.ArrowFunctionExpression){let A=d.body;if(g(A))return!0}return!1}function l(u){if(u.type===j.AST_NODE_TYPES.TaggedTemplateExpression){let d=u.tag;if(d.type===j.AST_NODE_TYPES.MemberExpression&&d.object.type===j.AST_NODE_TYPES.Identifier&&d.object.name==="styled")return!0;if(d.type===j.AST_NODE_TYPES.CallExpression){let A=d.callee;if(A.type===j.AST_NODE_TYPES.Identifier&&A.name==="styled")return!0}}return!1}function E(u){if(u.type===j.AST_NODE_TYPES.TaggedTemplateExpression){let d=u.tag;if(d.type===j.AST_NODE_TYPES.Identifier&&d.name==="css")return!0}return!1}function f(u,d){if(u.id.type!==j.AST_NODE_TYPES.Identifier)return;let A=u.id.name,I=u.init;if(I){if(l(I)||E(I)){p.push({node:d,name:A});return}if((a(A)||I.type===j.AST_NODE_TYPES.ArrowFunctionExpression)&&(I.type===j.AST_NODE_TYPES.ArrowFunctionExpression||I.type===j.AST_NODE_TYPES.FunctionExpression||c(I))){if(I.type===j.AST_NODE_TYPES.ArrowFunctionExpression||I.type===j.AST_NODE_TYPES.FunctionExpression){if(g(I.body)){s.add(A);return}}else if(c(I)){s.add(A);return}}I.type===j.AST_NODE_TYPES.Identifier&&o.set(A,I.name),a(A)||S(I)&&s.add(A)}}function h(u){return u.type===j.AST_NODE_TYPES.ExportDefaultDeclaration||u.type===j.AST_NODE_TYPES.ExportNamedDeclaration}function T(u){if(u.type===j.AST_NODE_TYPES.FunctionDeclaration)return u.id?u.id.name:null;if(u.type===j.AST_NODE_TYPES.VariableDeclaration){let d=u.declarations[0];if(d&&d.id.type===j.AST_NODE_TYPES.Identifier)return d.id.name}if(u.type===j.AST_NODE_TYPES.ExportDefaultDeclaration){let d=u.declaration;if(d.type===j.AST_NODE_TYPES.FunctionDeclaration)return d.id?d.id.name:"default";if(d.type===j.AST_NODE_TYPES.Identifier)return d.name}if(u.type===j.AST_NODE_TYPES.ExportNamedDeclaration){let d=u.declaration;if(d&&d.type===j.AST_NODE_TYPES.FunctionDeclaration)return d.id?d.id.name:null;if(d&&d.type===j.AST_NODE_TYPES.VariableDeclaration){let A=d.declarations[0];if(A&&A.id.type===j.AST_NODE_TYPES.Identifier)return A.id.name}}return null}function m(u,d){return n?n.test(d):h(u)}function b(u){let d=new Set;we(u.node,A=>{if(A.type===j.AST_NODE_TYPES.Identifier)for(let I of p)I.name===A.name&&(d.add(I.name),(I.firstUsagePosition===void 0||A.range[0]<I.firstUsagePosition)&&(I.firstUsagePosition=A.range[0]));if(A.type===j.AST_NODE_TYPES.JSXElement){let I=A.openingElement;if(I.name.type===j.AST_NODE_TYPES.JSXIdentifier)for(let P of p)P.name===I.name.name&&(d.add(P.name),(P.firstUsagePosition===void 0||I.name.range[0]<P.firstUsagePosition)&&(P.firstUsagePosition=I.name.range[0]))}return!1},r),u.usedStyles=d}function C(u){if(u.type===j.AST_NODE_TYPES.VariableDeclaration){for(let d of u.declarations)f(d,u);return}if(u.type===j.AST_NODE_TYPES.FunctionDeclaration){u.id&&a(u.id.name)&&g(u.body)&&s.add(u.id.name);return}if(u.type===j.AST_NODE_TYPES.ExportNamedDeclaration&&u.declaration){let d=u.declaration;if(d.type===j.AST_NODE_TYPES.VariableDeclaration){for(let A of d.declarations)f(A,u);return}if(d.type===j.AST_NODE_TYPES.FunctionDeclaration&&d.id){a(d.id.name)&&g(d.body)&&s.add(d.id.name);return}}if(u.type===j.AST_NODE_TYPES.ExportDefaultDeclaration){let d=u.declaration;d.type===j.AST_NODE_TYPES.Identifier&&s.add(d.name),(d.type===j.AST_NODE_TYPES.FunctionDeclaration||d.type===j.AST_NODE_TYPES.ArrowFunctionExpression||d.type===j.AST_NODE_TYPES.FunctionExpression)&&(d.type===j.AST_NODE_TYPES.FunctionDeclaration?d.id?s.add(d.id.name):s.add("default"):g(d.body)&&s.add("default"))}}function y(u,d=new Set){if(s.has(u))return!0;if(d.has(u))return!1;d.add(u);let A=o.get(u);return A?y(A,d):!1}return{Program(u){for(let A of u.body)C(A);for(let A of u.body){let I=T(A);if(I&&y(I)){let P=m(A,I);i.push({node:A,name:I,isMainComponent:P,usedStyles:new Set})}}for(let A of i)b(A);let d=[];for(let A of p){if(A.firstUsagePosition===void 0)continue;let I=u.body.indexOf(A.node),P=-1;for(let k of i)if(k.usedStyles.has(A.name)){let H=u.body.indexOf(k.node);(P===-1||H<P)&&(P=H)}P!==-1&&I>P&&d.push({style:A,targetPosition:P})}if(d.length>0){let A=d[0];A&&e.report({node:A.style.node,messageId:"stylesShouldBeAboveUsage",fix:x(d,u.body)})}}};function x(u,d){return function*(A){u.sort((P,k)=>P.targetPosition-k.targetPosition);for(let{style:P}of u){let k=r.getCommentsBefore(P.node),H=P.node.range[0],K=P.node.range[1];k.length>0&&k[0]&&(H=k[0].range[0]),yield A.removeRange([H,K])}let I=new Map;for(let P of u){let k=I.get(P.targetPosition)||[];k.push(P),I.set(P.targetPosition,k)}for(let[P,k]of I){let H=d[P];if(!H)continue;let K=r.getCommentsBefore(H),ne=K.length>0&&K[0]?K[0].range[0]:H.range[0],oe=[];for(let{style:Z}of k){let de=r.getCommentsBefore(Z.node),Ae=r.getText(Z.node);de.length>0&&(Ae=`${de.map(Ie=>r.getText(Ie)).join(`
46
+ `)}}}return{Program(u){o.push(...u.body)},TSTypeAliasDeclaration(u){if(o.some(g=>g.type===ye.AST_NODE_TYPES.ExportNamedDeclaration&&g.declaration===u?!0:g===u)){let g=s(u);g&&n.set(u.id.name,{node:u,name:u.id.name,statement:g})}},TSInterfaceDeclaration(u){if(o.some(g=>g.type===ye.AST_NODE_TYPES.ExportNamedDeclaration&&g.declaration===u?!0:g===u)){let g=s(u);g&&n.set(u.id.name,{node:u,name:u.id.name,statement:g})}},TSTypeReference(u){if(u.typeName.type===ye.AST_NODE_TYPES.Identifier){if(d(u))return;let S=i(u),g=p(u),f=a(u);y.push({typeName:u.typeName.name,node:u,inFunctionArgs:S,inFCProps:g,inGenericArgAtFunctionCall:f,usagePosition:u.range[0]})}},"Program:exit"(){let u=new Map;function S(f){if(!t.checkOnly||t.checkOnly.length===0)return!0;for(let E of t.checkOnly)if(E==="function-args"&&f.inFunctionArgs||E==="FC"&&f.inFCProps||E==="generic-args-at-fn-calls"&&f.inGenericArgAtFunctionCall)return!0;return!1}for(let f of y){let{typeName:E,node:x}=f;if(!n.has(E)||!S(f))continue;let m=s(x),b=n.get(E);if(!m||!b||m===b.statement)continue;u.has(E)||u.set(E,[]);let T=u.get(E);if(!T)return;T.includes(m)||T.push(m)}let g=[];for(let[f,E]of u)if(E.length>0){if(E.length===0)continue;let x=E[0];if(!x)continue;let m=Number.MAX_SAFE_INTEGER,b=!1;for(let A of E)A.range[0]<x.range[0]&&(x=A);for(let A of y)S(A)&&A.typeName===f&&s(A.node)===x&&A.usagePosition<m&&(m=A.usagePosition,b=A.inFunctionArgs);if(!!(t.checkOnly&&t.checkOnly.length>0)){let A=Number.MAX_SAFE_INTEGER;for(let P of y){if(P.typeName!==f)continue;let L=s(P.node);if(!L)continue;let C=o.indexOf(L);C!==-1&&C<A&&(A=C)}let R=o.indexOf(x);if(A!==Number.MAX_SAFE_INTEGER&&R!==-1&&A<R)continue}else{let A=Number.MAX_SAFE_INTEGER;for(let P of y){if(P.typeName!==f||c(P.node))continue;let L=s(P.node);if(!L)continue;let C=o.indexOf(L);C!==-1&&C<A&&(A=C)}let R=o.indexOf(x);if(A!==Number.MAX_SAFE_INTEGER&&R!==-1&&A<R)continue}g.push({typeName:f,firstUsage:x,firstUsagePosition:m,firstUsageInFunctionArgs:b})}g.length>0&&l(g)}}}});var Q=require("@typescript-eslint/utils"),nt=ke(require("zod/v4"));var da=["tsx"],ya=/^[A-Z][A-Za-z0-9]*$/,ga=nt.object({extensions:nt.array(nt.string()).optional()}),Dn=H({name:"react-single-export",meta:{type:"problem",docs:{description:"Enforces only one export per React component file to support fast refresh"},messages:{multipleExports:"React component files should have only one export to support fast refresh, if you want to export multiple components, use a separate file for each component. Type-only exports are allowed."},schema:[V(ga)]},defaultOptions:[{}],create(e,[t]){let r=e.getFilename(),n=t.extensions??da,o=!1;for(let m of n)if(r.endsWith(m)){o=!0;break}if(!o)return{};let s=e.sourceCode,i=new Set,p=new Map;function a(m){return ya.test(m)}function c(m){if(m.type!==Q.AST_NODE_TYPES.CallExpression)return!1;let b=m.callee;return b.type===Q.AST_NODE_TYPES.Identifier?b.name==="memo"||b.name==="forwardRef":b.type===Q.AST_NODE_TYPES.MemberExpression&&b.property.type===Q.AST_NODE_TYPES.Identifier?b.property.name==="memo"||b.property.name==="forwardRef":!1}function d(m){if(m.type===Q.AST_NODE_TYPES.JSXElement||m.type===Q.AST_NODE_TYPES.JSXFragment)return!0;if(m.type===Q.AST_NODE_TYPES.ArrayExpression){for(let b of m.elements)if(b&&(b.type===Q.AST_NODE_TYPES.JSXElement||b.type===Q.AST_NODE_TYPES.JSXFragment))return!0}return!1}function y(m){if(m.type!==Q.AST_NODE_TYPES.ArrowFunctionExpression)return!1;let b=m.body;if(b.type===Q.AST_NODE_TYPES.ArrowFunctionExpression){let T=b.body;if(d(T))return!0}return!1}function l(m){if(m.id.type!==Q.AST_NODE_TYPES.Identifier)return;let b=m.id.name,T=m.init;if(T){if(a(b)&&(T.type===Q.AST_NODE_TYPES.ArrowFunctionExpression||T.type===Q.AST_NODE_TYPES.FunctionExpression||c(T))){i.add(b);return}T.type===Q.AST_NODE_TYPES.Identifier&&p.set(b,T.name),a(b)||y(T)&&i.add(b)}}function h(m){if(m.type===Q.AST_NODE_TYPES.VariableDeclaration){for(let b of m.declarations)l(b);return}if(m.type===Q.AST_NODE_TYPES.FunctionDeclaration&&m.id){a(m.id.name)&&i.add(m.id.name);return}if(m.type===Q.AST_NODE_TYPES.ExportNamedDeclaration&&m.declaration){let b=m.declaration;if(b.type===Q.AST_NODE_TYPES.VariableDeclaration){for(let T of b.declarations)l(T);return}if(b.type===Q.AST_NODE_TYPES.FunctionDeclaration&&b.id){a(b.id.name)&&i.add(b.id.name);return}}}for(let m of s.ast.body)h(m);function u(m,b=new Set){if(i.has(m))return!0;if(b.has(m))return!1;b.add(m);let T=p.get(m);return T?u(T,b):!1}let S=[];function g(m,b,T){S.push({node:m,isType:b,isComponent:T})}for(let m of s.ast.body){if(m.type===Q.AST_NODE_TYPES.ExportNamedDeclaration){let b=m.exportKind==="type";if(m.declaration){let T=m.declaration;if(T.type===Q.AST_NODE_TYPES.TSTypeAliasDeclaration||T.type===Q.AST_NODE_TYPES.TSInterfaceDeclaration){g(T,!0,!1);continue}if(T.type===Q.AST_NODE_TYPES.VariableDeclaration){for(let A of T.declarations){if(A.id.type!==Q.AST_NODE_TYPES.Identifier)continue;let R=A.id.name,P=u(R);g(A,b,P)}continue}if(T.type===Q.AST_NODE_TYPES.FunctionDeclaration){let A=T.id?.name,R=A?u(A)||a(A):!1;g(T,b,R);continue}g(T,b,!1);continue}if(m.specifiers.length>0)for(let T of m.specifiers){if(T.local.type!==Q.AST_NODE_TYPES.Identifier)continue;let A=T.local.name,R=u(A);g(T,b,R)}continue}if(m.type===Q.AST_NODE_TYPES.ExportDefaultDeclaration){let b=m.declaration;if(b.type===Q.AST_NODE_TYPES.Identifier){let T=u(b.name)||a(b.name);g(m,!1,T);continue}if(b.type===Q.AST_NODE_TYPES.FunctionDeclaration||b.type===Q.AST_NODE_TYPES.ArrowFunctionExpression||b.type===Q.AST_NODE_TYPES.FunctionExpression||b.type===Q.AST_NODE_TYPES.CallExpression){g(m,!1,!0);continue}g(m,!1,!1);continue}}let f=!1;for(let m of S)if(!m.isType&&m.isComponent){f=!0;break}if(!f)return{};let E=[];for(let m of S)m.isType||E.push(m);let x=-1;for(let[m,b]of E.entries())if(b.isComponent){x=m;break}if(x===-1)return{};for(let[m,b]of E.entries())if(m!==x){e.report({node:b.node,messageId:"multipleExports"});break}return{}}});var We=require("@typescript-eslint/utils"),At=require("zod/v4");function wt(e){return e.charAt(0).toUpperCase()+e.slice(1)}function Sa(e){return e.callee.type===We.AST_NODE_TYPES.Identifier?e.callee.name==="useState":e.callee.type===We.AST_NODE_TYPES.MemberExpression&&e.callee.object.type===We.AST_NODE_TYPES.Identifier&&e.callee.property.type===We.AST_NODE_TYPES.Identifier?e.callee.object.name==="React"&&e.callee.property.name==="useState":!1}var Ta=At.z.object({ignorePrefixes:At.z.array(At.z.string()).optional()});function ni(e,t){for(let r of t)if(e.startsWith(r))return e.slice(r.length);return e}function ha(e){return`set${wt(e)}`}var jn=H({name:"use-state-setter-naming",meta:{type:"problem",docs:{description:"Enforce consistent naming convention for useState destructuring where setter should be set{Value}"},messages:{incorrectSetterName:'useState setter should follow the pattern "set{{expectedName}}" with a "set" prefix but got "{{actualName}}"',useSuggestedName:'Use "{{expectedSetterName}}" instead'},hasSuggestions:!0,schema:[V(Ta)]},defaultOptions:[{ignorePrefixes:[]}],create(e,[t]){return{VariableDeclarator(r){if(!r.init||r.init.type!==We.AST_NODE_TYPES.CallExpression||!Sa(r.init)||r.id.type!==We.AST_NODE_TYPES.ArrayPattern||r.id.elements.length!==2)return;let[n,o]=r.id.elements;if(!n||!o||n.type!==We.AST_NODE_TYPES.Identifier||o.type!==We.AST_NODE_TYPES.Identifier)return;let s=n.name,i=o.name,p=t.ignorePrefixes||[],a=ni(s,p),c=ni(i,p);if(a===""){if(!c.startsWith("set")){let y=`set${wt(s)}`;e.report({node:o,messageId:"incorrectSetterName",data:{expectedName:wt(s),actualName:i},suggest:[{messageId:"useSuggestedName",data:{expectedSetterName:y},fix:l=>l.replaceText(o,y)}]})}return}let d=ha(a);c!==d&&e.report({node:o,messageId:"incorrectSetterName",data:{expectedName:wt(a),actualName:i},suggest:[{messageId:"useSuggestedName",data:{expectedSetterName:d},fix:y=>y.replaceText(o,d)}]})}}}});var fe=require("@typescript-eslint/utils"),Ze=require("zod/v4");var Ea=Ze.z.object({name:Ze.z.string(),defaults:Ze.z.array(Ze.z.unknown())}),ba=Ze.z.object({functions:Ze.z.array(Ea)});function Rt(e,t){if(e===t)return!0;if(e===null||t===null||e===void 0||t===void 0)return e===t;if(typeof e!=typeof t||typeof e!="object"||Array.isArray(e)!==Array.isArray(t))return!1;if(Array.isArray(e)&&Array.isArray(t))return e.length!==t.length?!1:e.every((o,s)=>Rt(o,t[s]));let r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(let o of r){if(!n.includes(o))return!1;let s=Object.getOwnPropertyDescriptor(e,o),i=Object.getOwnPropertyDescriptor(t,o);if(!s||!i)return!1;let p=s.value,a=i.value;if(!Rt(p,a))return!1}return!0}function xa(e,t){let r=new Set;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return r;for(let n in e){if(!(n in t))continue;let o=Object.getOwnPropertyDescriptor(e,n),s=Object.getOwnPropertyDescriptor(t,n);o&&s&&Rt(o.value,s.value)&&r.add(n)}return r}function ri(e){if(e.type===fe.AST_NODE_TYPES.SpreadElement)return Symbol("COMPLEX_EXPRESSION");switch(e.type){case fe.AST_NODE_TYPES.Literal:return e.value;case fe.AST_NODE_TYPES.ObjectExpression:{let t={};for(let r of e.properties)r.type===fe.AST_NODE_TYPES.Property&&r.key.type===fe.AST_NODE_TYPES.Identifier&&!r.computed&&(r.value.type===fe.AST_NODE_TYPES.Literal?t[r.key.name]=r.value.value:r.value.type===fe.AST_NODE_TYPES.ObjectExpression?t[r.key.name]=ri(r.value):t[r.key.name]=Symbol("COMPLEX_EXPRESSION"));return t}case fe.AST_NODE_TYPES.ArrayExpression:return e.elements.map(t=>{if(!(!t||t.type===fe.AST_NODE_TYPES.SpreadElement))return t.type===fe.AST_NODE_TYPES.Literal?t.value:Symbol("COMPLEX_EXPRESSION")});default:return Symbol("COMPLEX_EXPRESSION")}}function Ca(e){return e.type===fe.AST_NODE_TYPES.Identifier?e.name:e.type===fe.AST_NODE_TYPES.MemberExpression&&e.property.type===fe.AST_NODE_TYPES.Identifier&&!e.computed?e.property.name:null}var Ln=H({name:"no-redundant-function-params",meta:{type:"suggestion",docs:{description:"Disallow calling functions with redundant default parameters"},messages:{redundantParams:"Function call has redundant parameters matching its default values and can be removed: {{details}}"},fixable:"code",schema:[V(ba)]},defaultOptions:[{functions:[]}],create(e,[t]){let r=new Map;for(let n of t.functions)r.set(n.name,n.defaults);return{CallExpression(n){let o=Ca(n.callee);if(!o)return;let s=r.get(o);if(!s)return;let i=n.arguments;if(i.length===0)return;let p=-1,a=!1,c=new Map,d=new Set,y=new Map,l=[];for(let u=0;u<i.length;u++){if(u>=s.length){p=u;continue}let S=s[u],g=i[u];if(!g||g.type===fe.AST_NODE_TYPES.SpreadElement){p=u;continue}let f=ri(g);if(S===void 0){p=u;continue}if(Rt(f,S)){g.type===fe.AST_NODE_TYPES.ObjectExpression?(d.add(u),l.push({type:"object",position:u+1})):(y.set(u,f),l.push({type:"simple",position:u+1,value:f}));continue}if(g.type===fe.AST_NODE_TYPES.ObjectExpression&&g.properties.length===0&&typeof S=="object"&&S!==null&&Object.keys(S).length>0){d.add(u),l.push({type:"object",position:u+1});continue}let E=xa(f,S);if(E.size>0){let x=typeof S=="object"&&S!==null?Object.keys(S).length:0;if(g.type===fe.AST_NODE_TYPES.ObjectExpression&&g.properties.length===E.size&&g.properties.length===x){d.add(u),l.push({type:"object",position:u+1});continue}else a=!0,c.set(u,E),l.push({type:"partialObject",position:u+1,redundantProperties:Array.from(E)}),p=u}else p=u}if(p<i.length-1||a||d.size>0){let u=function(){let g=[];for(let f of l)if(f.type==="simple")g.push(`Param ${f.position} with value ${JSON.stringify(f.value)}`);else if(f.type==="object")g.push(`Param ${f.position} (object)`);else{let E=f.redundantProperties||[],x=s?s[f.position-1]:void 0;if(typeof x=="object"&&x!==null){let m=x;for(let b of E)if(b in m){let T=Object.getOwnPropertyDescriptor(m,b);T&&g.push(`Param ${f.position} property "${b}" with value ${JSON.stringify(T.value)}`)}}}return{messageId:"redundantParams",data:{details:g.join(", ")}}};var h=u;let S=u();e.report({node:n,messageId:S.messageId,data:S.data,fix(g){let f=[];if(a)for(let[x,m]of c){let b=i[x];if(b&&b.type===fe.AST_NODE_TYPES.ObjectExpression){let T=[];for(let R of b.properties)R.type===fe.AST_NODE_TYPES.Property&&R.key.type===fe.AST_NODE_TYPES.Identifier&&!R.computed&&m.has(R.key.name)||T.push(R);let A=T.map(R=>e.sourceCode.getText(R));f.push(g.replaceText(b,`{ ${A.join(", ")} }`))}}let E=-1;for(let x=i.length-1;x>=0;x--)if(!d.has(x)&&x<=p){E=x;break}if(E<i.length-1)if(E===-1){let x=e.sourceCode.getTokenAfter(n.callee),m=e.sourceCode.getLastToken(n);x&&m&&f.push(g.replaceTextRange([x.range[1],m.range[0]],""))}else{let x=i[E],m=e.sourceCode.getLastToken(n);m&&x&&f.push(g.replaceTextRange([x.range[1],m.range[0]],""))}return f.length>0?f:null}})}}}}});var xe=require("@typescript-eslint/utils");function Ia(e){let t=e.parent;for(;t;){if(t.type===xe.AST_NODE_TYPES.AwaitExpression||t.type===xe.AST_NODE_TYPES.MemberExpression&&t.object===e&&t.property.type===xe.AST_NODE_TYPES.Identifier&&t.property.name==="then"||t.type===xe.AST_NODE_TYPES.ArrowFunctionExpression&&t.body===e)return!0;if(t.type===xe.AST_NODE_TYPES.ArrayExpression&&t.parent.type===xe.AST_NODE_TYPES.CallExpression){let r=t.parent;if(r.callee.type===xe.AST_NODE_TYPES.MemberExpression&&r.callee.object.type===xe.AST_NODE_TYPES.Identifier&&r.callee.object.name==="Promise"&&r.callee.property.type===xe.AST_NODE_TYPES.Identifier&&["all","allSettled","race"].includes(r.callee.property.name))return!0}if(t.parent)t=t.parent;else break}return!1}function Aa(e){let{callee:t}=e;return t.type===xe.AST_NODE_TYPES.Identifier&&t.name==="require"||t.type===xe.AST_NODE_TYPES.MemberExpression&&t.object.type===xe.AST_NODE_TYPES.Identifier&&t.object.name==="require"}var Mn=H({name:"no-sync-dynamic-import",meta:{type:"problem",docs:{description:"Disallow synchronous dynamic imports and require statements, only allow async dynamic imports with await"},messages:{syncDynamicImport:"Synchronous dynamic import() is not allowed. Use regular import statement or await import() for dynamic imports.",requireNotAllowed:"require() statements are not allowed. Use ES6 import statements instead."},schema:[]},defaultOptions:[],create(e){return{ImportExpression(t){Ia(t)||e.report({node:t,messageId:"syncDynamicImport"})},TSImportType(t){e.report({node:t,messageId:"syncDynamicImport"})},CallExpression(t){Aa(t)&&e.report({node:t,messageId:"requireNotAllowed"})}}}});var k=require("@typescript-eslint/utils"),Pt=require("zod/v4");var wa=Pt.z.object({mainComponentRegex:Pt.z.string().optional(),mainComponentSelector:Pt.z.string().optional()}),Ra=/^[A-Z][A-Za-z0-9]*$/,$n=H({name:"sort-react-components-and-styles",meta:{type:"suggestion",docs:{description:"Sort React components and styles with styles placed above their first usage"},fixable:"code",schema:[V(wa)],messages:{stylesShouldBeAboveUsage:"Style definitions should be placed above the first component that uses them",mainComponentShouldBeFirst:"Main component should be placed before other components"}},defaultOptions:[{}],create(e,[t]){let r=e.sourceCode,n=t.mainComponentRegex?new RegExp(t.mainComponentRegex):void 0,o=t.mainComponentSelector,s=new Set,i=new Map,p=[],a=[],c=new Set;function d(C){let I=C.node;if(I.type===k.AST_NODE_TYPES.VariableDeclaration){for(let F of I.declarations)if(F.id.type===k.AST_NODE_TYPES.Identifier&&F.id.name===C.name&&F.init)return F.init}if(I.type===k.AST_NODE_TYPES.ExportNamedDeclaration){let F=I.declaration;if(F&&F.type===k.AST_NODE_TYPES.VariableDeclaration){for(let N of F.declarations)if(N.id.type===k.AST_NODE_TYPES.Identifier&&N.id.name===C.name&&N.init)return N.init}}return null}function y(C){let I=new Set;return Oe(C,F=>(F.type===k.AST_NODE_TYPES.Identifier&&F.name!=="styled"&&F.name!=="css"&&I.add(F.name),!1),r),I}function l(C){return Ra.test(C)}function h(C){if(C.type!==k.AST_NODE_TYPES.CallExpression)return!1;let I=C.callee;return I.type===k.AST_NODE_TYPES.Identifier?I.name==="memo"||I.name==="forwardRef":I.type===k.AST_NODE_TYPES.MemberExpression&&I.property.type===k.AST_NODE_TYPES.Identifier?I.property.name==="memo"||I.property.name==="forwardRef":!1}function u(C){if(C.type===k.AST_NODE_TYPES.JSXElement||C.type===k.AST_NODE_TYPES.JSXFragment)return!0;if(C.type===k.AST_NODE_TYPES.BlockStatement){for(let I of C.body)if(I.type===k.AST_NODE_TYPES.ReturnStatement&&I.argument)return u(I.argument)}if(C.type===k.AST_NODE_TYPES.ArrayExpression){for(let I of C.elements)if(I&&(I.type===k.AST_NODE_TYPES.JSXElement||I.type===k.AST_NODE_TYPES.JSXFragment))return!0}return!1}function S(C){if(C.type!==k.AST_NODE_TYPES.ArrowFunctionExpression)return!1;let I=C.body;if(I.type===k.AST_NODE_TYPES.ArrowFunctionExpression){let F=I.body;if(u(F))return!0}return!1}function g(C){if(C.type===k.AST_NODE_TYPES.TaggedTemplateExpression){let I=C.tag;if(I.type===k.AST_NODE_TYPES.MemberExpression&&I.object.type===k.AST_NODE_TYPES.Identifier&&I.object.name==="styled")return!0;if(I.type===k.AST_NODE_TYPES.CallExpression){let F=I.callee;if(F.type===k.AST_NODE_TYPES.Identifier&&F.name==="styled")return!0}}return!1}function f(C){if(C.type===k.AST_NODE_TYPES.TaggedTemplateExpression){let I=C.tag;if(I.type===k.AST_NODE_TYPES.Identifier&&I.name==="css")return!0}return!1}function E(C,I){if(C.id.type!==k.AST_NODE_TYPES.Identifier)return;let F=C.id.name,N=C.init;if(N){if(g(N)||f(N)){a.push({node:I,name:F});return}if((l(F)||N.type===k.AST_NODE_TYPES.ArrowFunctionExpression)&&(N.type===k.AST_NODE_TYPES.ArrowFunctionExpression||N.type===k.AST_NODE_TYPES.FunctionExpression||h(N))){if(N.type===k.AST_NODE_TYPES.ArrowFunctionExpression||N.type===k.AST_NODE_TYPES.FunctionExpression){if(u(N.body)){s.add(F);return}}else if(h(N)){s.add(F);return}}N.type===k.AST_NODE_TYPES.Identifier&&i.set(F,N.name),l(F)||S(N)&&s.add(F)}}function x(C){return C.type===k.AST_NODE_TYPES.ExportDefaultDeclaration||C.type===k.AST_NODE_TYPES.ExportNamedDeclaration}function m(C){if(C.type===k.AST_NODE_TYPES.FunctionDeclaration)return C.id?C.id.name:null;if(C.type===k.AST_NODE_TYPES.VariableDeclaration){let I=C.declarations[0];if(I&&I.id.type===k.AST_NODE_TYPES.Identifier)return I.id.name}if(C.type===k.AST_NODE_TYPES.ExportDefaultDeclaration){let I=C.declaration;if(I.type===k.AST_NODE_TYPES.FunctionDeclaration)return I.id?I.id.name:"default";if(I.type===k.AST_NODE_TYPES.Identifier)return I.name}if(C.type===k.AST_NODE_TYPES.ExportNamedDeclaration){let I=C.declaration;if(I&&I.type===k.AST_NODE_TYPES.FunctionDeclaration)return I.id?I.id.name:null;if(I&&I.type===k.AST_NODE_TYPES.VariableDeclaration){let F=I.declarations[0];if(F&&F.id.type===k.AST_NODE_TYPES.Identifier)return F.id.name}}return null}function b(C,I){return o?c.has(C):n?n.test(I):x(C)}function T(C){let I=new Set;Oe(C.node,F=>{if(F.type===k.AST_NODE_TYPES.Identifier)for(let N of a)N.name===F.name&&(I.add(N.name),(N.firstUsagePosition===void 0||F.range[0]<N.firstUsagePosition)&&(N.firstUsagePosition=F.range[0]));if(F.type===k.AST_NODE_TYPES.JSXElement){let N=F.openingElement;if(N.name.type===k.AST_NODE_TYPES.JSXIdentifier)for(let te of a)te.name===N.name.name&&(I.add(te.name),(te.firstUsagePosition===void 0||N.name.range[0]<te.firstUsagePosition)&&(te.firstUsagePosition=N.name.range[0]))}return!1},r),C.usedStyles=I}function A(C){if(C.type===k.AST_NODE_TYPES.VariableDeclaration){for(let I of C.declarations)E(I,C);return}if(C.type===k.AST_NODE_TYPES.FunctionDeclaration){l(C.id.name)&&u(C.body)&&s.add(C.id.name);return}if(C.type===k.AST_NODE_TYPES.ExportNamedDeclaration&&C.declaration){let I=C.declaration;if(I.type===k.AST_NODE_TYPES.VariableDeclaration){for(let F of I.declarations)E(F,C);return}if(I.type===k.AST_NODE_TYPES.FunctionDeclaration&&I.id){l(I.id.name)&&u(I.body)&&s.add(I.id.name);return}}if(C.type===k.AST_NODE_TYPES.ExportDefaultDeclaration){let I=C.declaration;I.type===k.AST_NODE_TYPES.Identifier&&s.add(I.name),(I.type===k.AST_NODE_TYPES.FunctionDeclaration||I.type===k.AST_NODE_TYPES.ArrowFunctionExpression||I.type===k.AST_NODE_TYPES.FunctionExpression)&&(I.type===k.AST_NODE_TYPES.FunctionDeclaration?I.id?s.add(I.id.name):s.add("default"):u(I.body)&&s.add("default"))}}function R(C,I=new Set){if(s.has(C))return!0;if(I.has(C))return!1;I.add(C);let F=i.get(C);return F?R(F,I):!1}let P={};return o&&(P[o]=C=>{let I=C;for(;I.parent&&I.parent.type!==k.AST_NODE_TYPES.Program;)I=I.parent;I.parent&&(I.type===k.AST_NODE_TYPES.VariableDeclaration||I.type===k.AST_NODE_TYPES.FunctionDeclaration||I.type===k.AST_NODE_TYPES.ExportNamedDeclaration||I.type===k.AST_NODE_TYPES.ExportDefaultDeclaration)&&c.add(I)}),P["Program:exit"]=C=>{for(let M of C.body)A(M);for(let M of C.body){let W=m(M);if(W&&R(W)){let X=b(M,W);p.push({node:M,name:W,isMainComponent:X,usedStyles:new Set})}}for(let M of p)T(M);let I=new Set;for(let M of a)I.add(M.name);let F=new Map;for(let M=0;M<C.body.length;M+=1){let W=C.body[M];for(let X of a)X.node===W&&F.set(X.name,M)}let N=new Map;for(let M of a){let W=d(M),X=new Set;if(W){let ne=y(W);for(let le of ne)I.has(le)&&le!==M.name&&X.add(le)}N.set(M.name,X)}let te=new Map;for(let M of a){let W=N.get(M.name);if(!W)continue;let X=F.get(M.name);if(X!==void 0)for(let ne of W){let le=te.get(ne);(le===void 0||X<le)&&te.set(ne,X)}}let z=[];for(let M of a){if(M.firstUsagePosition===void 0)continue;let W=C.body.indexOf(M.node),X=-1;for(let we of p){if(!we.usedStyles.has(M.name))continue;let Re=C.body.indexOf(we.node);(X===-1||Re<X)&&(X=Re)}let ne=te.get(M.name);if(ne!==void 0&&(X===-1||ne<X)&&(X=ne),X===-1)continue;let le=-1;for(let we of p){let Re=C.body.indexOf(we.node);Re<X&&Re>le&&(le=Re)}let Ce=W<X,Ie=W>le,Ae=-1,Se=N.get(M.name);if(Se)for(let we of Se){let Re=F.get(we);Re!==void 0&&Re>Ae&&(Ae=Re)}let ut=W>Ae;if(!(Ce&&Ie&&ut)){let we=le+1;if(Ae+1>we&&(we=Ae+1),we>X)continue;z.push({style:M,targetPosition:we})}}let ie=null;if(p.length>1){let M=p.map(X=>({c:X,idx:C.body.indexOf(X.node)})).sort((X,ne)=>X.idx-ne.idx)[0]?.c,W=p.find(X=>X.isMainComponent)||null;M&&W&&M.node!==W.node&&(ie={component:W,targetBefore:M.node})}if(z.length>0||ie){let M=z[0]?.style.node||ie?.component.node||C,W=z.length>0?"stylesShouldBeAboveUsage":"mainComponentShouldBeFirst";e.report({node:M,messageId:W,fix:L(z,ie,C.body)})}},P;function L(C,I,F){return function*(N){C.sort((z,ie)=>z.targetPosition-ie.targetPosition);for(let{style:z}of C){let ie=r.getCommentsBefore(z.node),M=z.node.range[0],W=z.node.range[1];ie.length>0&&ie[0]&&(M=ie[0].range[0]),M===z.node.range[0]&&r.text.slice(0,M).trim().length===0&&(M=0),yield N.removeRange([M,W])}let te=new Map;for(let z of C){let ie=te.get(z.targetPosition)||[];ie.push(z),te.set(z.targetPosition,ie)}for(let[z,ie]of te){let M=F[z];if(!M)continue;let W=r.getCommentsBefore(M),X=W.length>0&&W[0]?W[0].range[0]:M.range[0],ne=[];for(let{style:le}of ie){let Ce=r.getCommentsBefore(le.node),Ie=r.getText(le.node);Ce.length>0&&(Ie=`${Ce.map(Se=>r.getText(Se)).join(`
47
47
  `)}
48
- ${Ae}`),oe.push(Ae)}yield A.insertTextBeforeRange([ne,ne],`${oe.join(`
48
+ ${Ie}`),ne.push(Ie)}yield N.insertTextBeforeRange([X,X],`${ne.join(`
49
49
 
50
50
  `)}
51
51
 
52
- `)}}}}});var ti={[sn.name]:sn.rule,[$t.name]:$t.rule,[Mt.name]:Mt.rule,"rules-of-hooks":Gr,"exhaustive-deps":Hn,"require-description":Jr.rule,[_t.name]:_t.rule,[zt.name]:zt.rule,[an.name]:an.rule,[wt.name]:wt.rule,[Lt.name]:Lt.rule,[Jt.name]:Jt.rule,[et.name]:et.rule,[cn.name]:cn.rule,[Wt.name]:Wt.rule,[Ut.name]:Ut.rule,[Xt.name]:Xt.rule,[Pt.name]:Pt.rule,[gn.name]:gn.rule,[dn.name]:dn.rule,[En.name]:En.rule,[jt.name]:jt.rule,[qt.name]:qt.rule,[Zt.name]:Zt.rule,[Gt.name]:Gt.rule,[tn.name]:tn.rule,[nn.name]:nn.rule,[Kt.name]:Kt.rule,[en.name]:en.rule,[pn.name]:pn.rule,[Bt.name]:Bt.rule,[Ht.name]:Ht.rule,[Rn.name]:Rn.rule,[on.name]:on.rule,[bn.name]:bn.rule,[In.name]:In.rule,[Pn.name]:Pn.rule,[vn.name]:vn.rule,[kn.name]:kn.rule,[Fn.name]:Fn.rule,[On.name]:On.rule,[Dn.name]:Dn.rule,[et.name]:et.rule};var Ra={rules:ti};0&&(module.exports={extendedLintPlugin});
52
+ `)}if(I){let{component:z,targetBefore:ie}=I,M=r.getCommentsBefore(z.node),W=z.node.range[0],X=z.node.range[1];M.length>0&&M[0]&&(W=M[0].range[0]),W===z.node.range[0]&&r.text.slice(0,W).trim().length===0&&(W=0);let ne=r.getCommentsBefore(ie),le=ne.length>0&&ne[0]?ne[0].range[0]:ie.range[0],Ce=(()=>{let Ie=r.getText(z.node);return M.length>0&&(Ie=`${M.map(Se=>r.getText(Se)).join(`
53
+ `)}
54
+ ${Ie}`),Ie})();yield N.removeRange([W,X]),yield N.insertTextBeforeRange([le,le],`${Ce}
55
+ `)}}}}});var ii={[cn.name]:cn.rule,[Jt.name]:Jt.rule,[Wt.name]:Wt.rule,"rules-of-hooks":ei,"exhaustive-deps":qn,"require-description":Hr.rule,[Vt.name]:Vt.rule,[Ht.name]:Ht.rule,[fn.name]:fn.rule,[kt.name]:kt.rule,[zt.name]:zt.rule,[Yt.name]:Yt.rule,[ot.name]:ot.rule,[yn.name]:yn.rule,[Bt.name]:Bt.rule,[Xt.name]:Xt.rule,[Zt.name]:Zt.rule,[Nt.name]:Nt.rule,[bn.name]:bn.rule,[En.name]:En.rule,[An.name]:An.rule,[Ut.name]:Ut.rule,[en.name]:en.rule,[tn.name]:tn.rule,[nn.name]:nn.rule,[an.name]:an.rule,[ln.name]:ln.rule,[rn.name]:rn.rule,[sn.name]:sn.rule,[dn.name]:dn.rule,[Kt.name]:Kt.rule,[Gt.name]:Gt.rule,[On.name]:On.rule,[un.name]:un.rule,[wn.name]:wn.rule,[Fn.name]:Fn.rule,[Nn.name]:Nn.rule,[Dn.name]:Dn.rule,[jn.name]:jn.rule,[Ln.name]:Ln.rule,[Mn.name]:Mn.rule,[$n.name]:$n.rule,[ot.name]:ot.rule};var Pa={rules:ii};0&&(module.exports={extendedLintPlugin});