@ls-stack/extended-lint 0.90.0 → 0.90.2

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,4 +1,4 @@
1
- "use strict";var Hi=Object.create;var Ft=Object.defineProperty;var Yi=Object.getOwnPropertyDescriptor;var qi=Object.getOwnPropertyNames;var Zi=Object.getPrototypeOf,Gi=Object.prototype.hasOwnProperty;var Ki=(e,t)=>{for(var n in t)Ft(e,n,{get:t[n],enumerable:!0})},mr=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of qi(t))!Gi.call(e,s)&&s!==n&&Ft(e,s,{get:()=>t[s],enumerable:!(r=Yi(t,s))||r.enumerable});return e};var Re=(e,t,n)=>(n=e!=null?Hi(Zi(e)):{},mr(t||!e||!e.__esModule?Ft(n,"default",{value:e,enumerable:!0}):n,e)),Qi=e=>mr(Ft({},"__esModule",{value:!0}),e);var Xl={};Ki(Xl,{default:()=>Jl,extendedLintPlugin:()=>zi});module.exports=Qi(Xl);var xe=require("@typescript-eslint/utils"),_=require("zod/v4");var yr=require("@typescript-eslint/utils"),dr=Re(require("zod/v4"));function z(e){let n=yr.ESLintUtils.RuleCreator(r=>`https://github.com/lucasols/extended-lint#${r}`)(e);return{name:e.name,rule:n}}function U(e){return dr.toJSONSchema(e)}var es=_.z.object({disallow:_.z.array(_.z.object({selector:_.z.string(),message:_.z.string(),replace:_.z.optional(_.z.union([_.z.string(),_.z.object({regex:_.z.string(),with:_.z.string()})])),replaceType:_.z.optional(_.z.enum(["suggestion","autofix"]))})).optional(),disallowFnCalls:_.z.optional(_.z.array(_.z.object({fn:_.z.string(),withArgs:_.z.optional(_.z.array(_.z.object({atIndex:_.z.number(),value:_.z.union([_.z.string(),_.z.number(),_.z.boolean()])}))),message:_.z.string(),replaceWith:_.z.optional(_.z.string()),ignoreRegex:_.z.optional(_.z.string())}))),__dev_simulateFileName:_.z.optional(_.z.string()),mustMatchSyntax:_.z.optional(_.z.array(_.z.object({includeRegex:_.z.string(),excludeRegex:_.z.optional(_.z.string()),mustCallFn:_.z.optional(_.z.array(_.z.object({anyCall:_.z.array(_.z.object({fn:_.z.string(),withArgs:_.z.array(_.z.object({atIndex:_.z.number(),literal:_.z.union([_.z.string(),_.z.number(),_.z.boolean()])}))})),message:_.z.optional(_.z.string())}))),mustMatchSelector:_.z.optional(_.z.array(_.z.object({selector:_.z.string(),message:_.z.string()}))),mustHaveExport:_.z.optional(_.z.array(_.z.object({name:_.z.string(),type:_.z.enum(["function","variable","any"]).default("any"),message:_.z.string()})))})))}),Bt=z({name:"advanced-no-restricted-syntax",meta:{type:"suggestion",docs:{description:"Disallow specific syntax patterns"},schema:[U(es)],messages:{default:"{{message}}"},fixable:"code",hasSuggestions:!0},defaultOptions:[{disallow:[]}],create(e,[t]){let n={},{mustMatchSyntax:r,__dev_simulateFileName:s,disallow:o,disallowFnCalls:i}=t,a=s??e.filename,l=[],p=new Map,m=new Set,y=new Map,u=new Set,d=new Map;function c(C){for(let w of C.specifiers)w.type===xe.AST_NODE_TYPES.ImportSpecifier&&w.imported.type===xe.AST_NODE_TYPES.Identifier&&w.imported.name!==w.local.name&&d.set(w.local.name,w.imported.name)}function g(C){if(C.declaration){if(C.declaration.type===xe.AST_NODE_TYPES.FunctionDeclaration&&C.declaration.id){let w=C.declaration.id.name;for(let N of Array.from(u)){let[k,O]=N.split(":");k===w&&(O==="function"||O==="any")&&u.delete(N)}}else if(C.declaration.type===xe.AST_NODE_TYPES.VariableDeclaration){for(let w of C.declaration.declarations)if(w.id.type===xe.AST_NODE_TYPES.Identifier){let N=w.id.name;for(let k of Array.from(u)){let[O,f]=k.split(":");O===N&&(f==="variable"||f==="any")&&u.delete(k)}}}}for(let w of C.specifiers)if(w.exported.type===xe.AST_NODE_TYPES.Identifier){let N=w.exported.name;for(let k of Array.from(u)){let[O,f]=k.split(":");O===N&&f==="any"&&u.delete(k)}}}function h(C){C.id.type===xe.AST_NODE_TYPES.Identifier&&C.init?.type===xe.AST_NODE_TYPES.Identifier&&d.set(C.id.name,C.init.name)}function S(C){return d.get(C)??C}function I(C,w){return S(C)===w||C===w}for(let{includeRegex:C,excludeRegex:w,mustCallFn:N,mustMatchSelector:k,mustHaveExport:O}of r??[]){let x=function(E){let F=E;for(let{name:R,value:M}of f??[])F=F.replaceAll(R,M);return F};var b=x;let f=ts(a,new RegExp(C));if(f&&!(w&&new RegExp(w).test(a))){for(let{anyCall:E,message:F}of N??[]){let R=`Expected file to call the function: ${E.map(({fn:M})=>M).join(" or ")}`;m.add(R),l.push(M=>{let{callee:P}=M;if(P.type===xe.AST_NODE_TYPES.Identifier){for(let{fn:ee,withArgs:Z}of E)if(P.name===ee){m.delete(R);for(let D of Z){let q=M.arguments[D.atIndex],B=typeof D.literal=="string"?x(D.literal):D.literal;if(!q){e.report({node:M,messageId:"default",data:{message:`Missing argument with value "${B}" at index ${D.atIndex}${F?`: ${x(F)}`:""}`}});continue}if(q.type!==xe.AST_NODE_TYPES.Literal){e.report({node:q,messageId:"default",data:{message:`Argument at position ${D.atIndex} should the literal "${B}"${F?`: ${x(F)}`:""}`}});continue}q.value!==B&&e.report({node:q,messageId:"default",data:{message:`Argument should have the value "${B}"${F?`: ${x(F)}`:""}`},fix:ue=>ue.replaceText(q,typeof B=="string"?`'${B}'`:String(B))})}break}}})}for(let{selector:E,message:F}of k??[])y.set(E,x(F)),p.set(x(E),()=>{y.delete(E)});for(let{name:E,type:F,message:R}of O??[]){let M=x(E),P=x(R);u.add(`${M}:${F}:${P}`)}}}for(let{fn:C,withArgs:w,message:N,replaceWith:k,ignoreRegex:O}of i??[])O&&new RegExp(O).test(a)||l.push(f=>{let{callee:x}=f;if(x.type!==xe.AST_NODE_TYPES.Identifier||!I(x.name,C))return;if(w)for(let F of w){let R=f.arguments[F.atIndex];if(!R){e.report({node:f,messageId:"default",data:{message:`Missing argument with value "${F.value}" at index ${F.atIndex}: ${N}`}});return}if(R.type!==xe.AST_NODE_TYPES.Literal||R.value!==F.value)return}let E=F=>k?F.replaceText(f,k):null;e.report({node:f,messageId:"default",data:{message:N},suggest:k?[{messageId:"default",data:{message:`Replace with "${k}"`},fix:E}]:void 0})});function A(C,w){let N=n[C];N?n[C]=k=>{N(k),w(k)}:n[C]=w}for(let{selector:C,message:w,replace:N,replaceType:k="suggestion"}of o??[]){if(C==="CallExpression"){l.push(O=>{T(N,O,w,k)});continue}n[C]=O=>{T(N,O,w,k)}}if(p.size>0)for(let[C,w]of p)A(C,w);return l.length>0&&(n.CallExpression=C=>{if(C.type===xe.AST_NODE_TYPES.CallExpression)for(let w of l)w(C)}),n.ImportDeclaration=C=>{C.type===xe.AST_NODE_TYPES.ImportDeclaration&&c(C)},n.ExportNamedDeclaration=C=>{C.type===xe.AST_NODE_TYPES.ExportNamedDeclaration&&g(C)},n.VariableDeclarator=C=>{C.type===xe.AST_NODE_TYPES.VariableDeclarator&&h(C)},n["Program:exit"]=C=>{for(let w of m)e.report({node:C,messageId:"default",data:{message:w}});for(let[,w]of y)e.report({node:C,messageId:"default",data:{message:w}});for(let w of u){let[N,k,O]=w.split(":");e.report({node:C,messageId:"default",data:{message:`Missing required export "${N}" of type ${k}: ${O}`}})}},n;function T(C,w,N,k){let O=f=>{if(!C)return null;if(typeof C=="string")return f.replaceText(w,C);{let x=new RegExp(C.regex),E=e.sourceCode.getText(w);return f.replaceText(w,E.replace(x,C.with))}};e.report({node:w,messageId:"default",data:{message:N},fix:C&&k==="autofix"?O:void 0,suggest:C&&k==="suggestion"?[{messageId:"default",data:{message:`Replace with "${typeof C=="string"?C:C.with}"`},fix:O}]:void 0})}}});function ts(e,t){let n=[],r=t.exec(e);if(!r)return null;let[s,...o]=r;n.push({name:"$0_lowercase",value:s.toLowerCase()}),n.push({name:"$0_capitalize",value:gr(s)}),n.push({name:"$0_uncapitalize",value:Sr(s)}),n.push({name:"$0",value:s});for(let i=0;i<o.length;i++){let a=`$${i+1}`,l=o[i];l!==void 0&&(n.push({name:`${a}_lowercase`,value:l.toLowerCase()}),n.push({name:`${a}_capitalize`,value:gr(l)}),n.push({name:`${a}_uncapitalize`,value:Sr(l)}),n.push({name:a,value:l}))}return n}function gr(e){return e.charAt(0).toUpperCase()+e.slice(1)}function Sr(e){return e.charAt(0).toLowerCase()+e.slice(1)}var re=require("@typescript-eslint/utils"),Ge=require("zod/v4");var ns=re.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),Er="collapse-simple-objs-in-one-line",rs=Ge.z.object({maxLineLength:Ge.z.number().optional(),maxProperties:Ge.z.number().optional(),nestedObjMaxLineLength:Ge.z.number().optional(),nestedObjMaxProperties:Ge.z.number().optional(),ignoreTypesWithSuffix:Ge.z.array(Ge.z.string()).optional()}),is=ns({name:Er,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:[U(rs)]},defaultOptions:[{}],create(e,[t]){let n=e.sourceCode,r=t.ignoreTypesWithSuffix??[],s=t.maxProperties??2,o=t.nestedObjMaxLineLength??t.maxLineLength,i=t.nestedObjMaxProperties??3;function a(p){if(p.type===re.AST_NODE_TYPES.ObjectExpression){let m=p.parent.type===re.AST_NODE_TYPES.Property,y=m?i:s,u=p.properties.length;if(u>y)return!1;if(u===1){let c=p.properties[0];return!c||c.type===re.AST_NODE_TYPES.Property&&c.value.type===re.AST_NODE_TYPES.ObjectExpression||c.type===re.AST_NODE_TYPES.Property&&c.value.type===re.AST_NODE_TYPES.ArrayExpression&&!c.value.elements.every(h=>h&&Ht(h))?!1:{text:n.getText(c),isNested:m,propsSize:u}}let d=[];for(let c of p.properties){if(c.type===re.AST_NODE_TYPES.Property&&!Ht(c.value))return!1;d.push(n.getText(c))}return{text:d.join(", "),isNested:m,propsSize:u}}else{let m=p.parent.parent?.type===re.AST_NODE_TYPES.TSPropertySignature,y=m?i:s,u=p.members.length;if(u>y)return!1;if(r.length>0&&p.parent.type===re.AST_NODE_TYPES.TSTypeAliasDeclaration){let c=p.parent.id.name;if(r.some(g=>c.endsWith(g)))return!1}if(u===1){let c=p.members[0];return!c||c.type===re.AST_NODE_TYPES.TSPropertySignature&&c.typeAnnotation?.typeAnnotation.type===re.AST_NODE_TYPES.TSTypeLiteral?!1:{text:n.getText(c),isNested:m,propsSize:1}}if(p.parent.type===re.AST_NODE_TYPES.TSIntersectionType||p.parent.type===re.AST_NODE_TYPES.TSUnionType&&p.parent.types[0]!==p)return!1;let d=[];for(let c of p.members){if(c.type!==re.AST_NODE_TYPES.TSPropertySignature)return!1;let g=c.typeAnnotation?.typeAnnotation;if(!g||g.type===re.AST_NODE_TYPES.TSTypeLiteral||!Tr(g))return!1;if(g.type===re.AST_NODE_TYPES.TSTypeReference&&g.typeArguments){if(g.typeArguments.params.length>1)return!1;let S=g.typeArguments.params[0];if(!S||!Tr(S))return!1}let h=n.getText(c).trim();(h.endsWith(";")||h.endsWith(","))&&(h=h.slice(0,-1)),d.push(h)}return{text:d.join("; "),isNested:m,propsSize:u}}}function l(p){if(p.loc.start.line===p.loc.end.line)return;if(p.parent.type!==re.AST_NODE_TYPES.JSXExpressionContainer){let g=0,h=!1,S=n.getTokenAfter(p,{filter:A=>A.type!==re.AST_TOKEN_TYPES.Punctuator||h?!0:A.value===","?(g++,!1):A.value===";"?(g++,h=!0,!1):A.value===")"||A.value==="}"?(g++,!1):!0});if(g>4)return;let I=S?.type===re.AST_TOKEN_TYPES.Template&&S.value.startsWith(`}
1
+ "use strict";var Hi=Object.create;var Ft=Object.defineProperty;var Yi=Object.getOwnPropertyDescriptor;var qi=Object.getOwnPropertyNames;var Zi=Object.getPrototypeOf,Gi=Object.prototype.hasOwnProperty;var Ki=(e,t)=>{for(var n in t)Ft(e,n,{get:t[n],enumerable:!0})},mr=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of qi(t))!Gi.call(e,s)&&s!==n&&Ft(e,s,{get:()=>t[s],enumerable:!(r=Yi(t,s))||r.enumerable});return e};var Re=(e,t,n)=>(n=e!=null?Hi(Zi(e)):{},mr(t||!e||!e.__esModule?Ft(n,"default",{value:e,enumerable:!0}):n,e)),Qi=e=>mr(Ft({},"__esModule",{value:!0}),e);var Yl={};Ki(Yl,{default:()=>Hl,extendedLintPlugin:()=>zi});module.exports=Qi(Yl);var xe=require("@typescript-eslint/utils"),_=require("zod/v4");var yr=require("@typescript-eslint/utils"),dr=Re(require("zod/v4"));function z(e){let n=yr.ESLintUtils.RuleCreator(r=>`https://github.com/lucasols/extended-lint#${r}`)(e);return{name:e.name,rule:n}}function U(e){return dr.toJSONSchema(e)}var es=_.z.object({disallow:_.z.array(_.z.object({selector:_.z.string(),message:_.z.string(),replace:_.z.optional(_.z.union([_.z.string(),_.z.object({regex:_.z.string(),with:_.z.string()})])),replaceType:_.z.optional(_.z.enum(["suggestion","autofix"]))})).optional(),disallowFnCalls:_.z.optional(_.z.array(_.z.object({fn:_.z.string(),withArgs:_.z.optional(_.z.array(_.z.object({atIndex:_.z.number(),value:_.z.union([_.z.string(),_.z.number(),_.z.boolean()])}))),message:_.z.string(),replaceWith:_.z.optional(_.z.string()),ignoreRegex:_.z.optional(_.z.string())}))),__dev_simulateFileName:_.z.optional(_.z.string()),mustMatchSyntax:_.z.optional(_.z.array(_.z.object({includeRegex:_.z.string(),excludeRegex:_.z.optional(_.z.string()),mustCallFn:_.z.optional(_.z.array(_.z.object({anyCall:_.z.array(_.z.object({fn:_.z.string(),withArgs:_.z.array(_.z.object({atIndex:_.z.number(),literal:_.z.union([_.z.string(),_.z.number(),_.z.boolean()])}))})),message:_.z.optional(_.z.string())}))),mustMatchSelector:_.z.optional(_.z.array(_.z.object({selector:_.z.string(),message:_.z.string()}))),mustHaveExport:_.z.optional(_.z.array(_.z.object({name:_.z.string(),type:_.z.enum(["function","variable","any"]).default("any"),message:_.z.string()})))})))}),Bt=z({name:"advanced-no-restricted-syntax",meta:{type:"suggestion",docs:{description:"Disallow specific syntax patterns"},schema:[U(es)],messages:{default:"{{message}}"},fixable:"code",hasSuggestions:!0},defaultOptions:[{disallow:[]}],create(e,[t]){let n={},{mustMatchSyntax:r,__dev_simulateFileName:s,disallow:o,disallowFnCalls:i}=t,a=s??e.filename,l=[],p=new Map,m=new Set,y=new Map,u=new Set,d=new Map;function c(C){for(let w of C.specifiers)w.type===xe.AST_NODE_TYPES.ImportSpecifier&&w.imported.type===xe.AST_NODE_TYPES.Identifier&&w.imported.name!==w.local.name&&d.set(w.local.name,w.imported.name)}function g(C){if(C.declaration){if(C.declaration.type===xe.AST_NODE_TYPES.FunctionDeclaration&&C.declaration.id){let w=C.declaration.id.name;for(let N of Array.from(u)){let[k,O]=N.split(":");k===w&&(O==="function"||O==="any")&&u.delete(N)}}else if(C.declaration.type===xe.AST_NODE_TYPES.VariableDeclaration){for(let w of C.declaration.declarations)if(w.id.type===xe.AST_NODE_TYPES.Identifier){let N=w.id.name;for(let k of Array.from(u)){let[O,f]=k.split(":");O===N&&(f==="variable"||f==="any")&&u.delete(k)}}}}for(let w of C.specifiers)if(w.exported.type===xe.AST_NODE_TYPES.Identifier){let N=w.exported.name;for(let k of Array.from(u)){let[O,f]=k.split(":");O===N&&f==="any"&&u.delete(k)}}}function h(C){C.id.type===xe.AST_NODE_TYPES.Identifier&&C.init?.type===xe.AST_NODE_TYPES.Identifier&&d.set(C.id.name,C.init.name)}function S(C){return d.get(C)??C}function I(C,w){return S(C)===w||C===w}for(let{includeRegex:C,excludeRegex:w,mustCallFn:N,mustMatchSelector:k,mustHaveExport:O}of r??[]){let x=function(E){let F=E;for(let{name:R,value:M}of f??[])F=F.replaceAll(R,M);return F};var b=x;let f=ts(a,new RegExp(C));if(f&&!(w&&new RegExp(w).test(a))){for(let{anyCall:E,message:F}of N??[]){let R=`Expected file to call the function: ${E.map(({fn:M})=>M).join(" or ")}`;m.add(R),l.push(M=>{let{callee:P}=M;if(P.type===xe.AST_NODE_TYPES.Identifier){for(let{fn:ee,withArgs:Z}of E)if(P.name===ee){m.delete(R);for(let D of Z){let q=M.arguments[D.atIndex],B=typeof D.literal=="string"?x(D.literal):D.literal;if(!q){e.report({node:M,messageId:"default",data:{message:`Missing argument with value "${B}" at index ${D.atIndex}${F?`: ${x(F)}`:""}`}});continue}if(q.type!==xe.AST_NODE_TYPES.Literal){e.report({node:q,messageId:"default",data:{message:`Argument at position ${D.atIndex} should the literal "${B}"${F?`: ${x(F)}`:""}`}});continue}q.value!==B&&e.report({node:q,messageId:"default",data:{message:`Argument should have the value "${B}"${F?`: ${x(F)}`:""}`},fix:ue=>ue.replaceText(q,typeof B=="string"?`'${B}'`:String(B))})}break}}})}for(let{selector:E,message:F}of k??[])y.set(E,x(F)),p.set(x(E),()=>{y.delete(E)});for(let{name:E,type:F,message:R}of O??[]){let M=x(E),P=x(R);u.add(`${M}:${F}:${P}`)}}}for(let{fn:C,withArgs:w,message:N,replaceWith:k,ignoreRegex:O}of i??[])O&&new RegExp(O).test(a)||l.push(f=>{let{callee:x}=f;if(x.type!==xe.AST_NODE_TYPES.Identifier||!I(x.name,C))return;if(w)for(let F of w){let R=f.arguments[F.atIndex];if(!R){e.report({node:f,messageId:"default",data:{message:`Missing argument with value "${F.value}" at index ${F.atIndex}: ${N}`}});return}if(R.type!==xe.AST_NODE_TYPES.Literal||R.value!==F.value)return}let E=F=>k?F.replaceText(f,k):null;e.report({node:f,messageId:"default",data:{message:N},suggest:k?[{messageId:"default",data:{message:`Replace with "${k}"`},fix:E}]:void 0})});function A(C,w){let N=n[C];N?n[C]=k=>{N(k),w(k)}:n[C]=w}for(let{selector:C,message:w,replace:N,replaceType:k="suggestion"}of o??[]){if(C==="CallExpression"){l.push(O=>{T(N,O,w,k)});continue}n[C]=O=>{T(N,O,w,k)}}if(p.size>0)for(let[C,w]of p)A(C,w);return l.length>0&&(n.CallExpression=C=>{if(C.type===xe.AST_NODE_TYPES.CallExpression)for(let w of l)w(C)}),n.ImportDeclaration=C=>{C.type===xe.AST_NODE_TYPES.ImportDeclaration&&c(C)},n.ExportNamedDeclaration=C=>{C.type===xe.AST_NODE_TYPES.ExportNamedDeclaration&&g(C)},n.VariableDeclarator=C=>{C.type===xe.AST_NODE_TYPES.VariableDeclarator&&h(C)},n["Program:exit"]=C=>{for(let w of m)e.report({node:C,messageId:"default",data:{message:w}});for(let[,w]of y)e.report({node:C,messageId:"default",data:{message:w}});for(let w of u){let[N,k,O]=w.split(":");e.report({node:C,messageId:"default",data:{message:`Missing required export "${N}" of type ${k}: ${O}`}})}},n;function T(C,w,N,k){let O=f=>{if(!C)return null;if(typeof C=="string")return f.replaceText(w,C);{let x=new RegExp(C.regex),E=e.sourceCode.getText(w);return f.replaceText(w,E.replace(x,C.with))}};e.report({node:w,messageId:"default",data:{message:N},fix:C&&k==="autofix"?O:void 0,suggest:C&&k==="suggestion"?[{messageId:"default",data:{message:`Replace with "${typeof C=="string"?C:C.with}"`},fix:O}]:void 0})}}});function ts(e,t){let n=[],r=t.exec(e);if(!r)return null;let[s,...o]=r;n.push({name:"$0_lowercase",value:s.toLowerCase()}),n.push({name:"$0_capitalize",value:gr(s)}),n.push({name:"$0_uncapitalize",value:Sr(s)}),n.push({name:"$0",value:s});for(let i=0;i<o.length;i++){let a=`$${i+1}`,l=o[i];l!==void 0&&(n.push({name:`${a}_lowercase`,value:l.toLowerCase()}),n.push({name:`${a}_capitalize`,value:gr(l)}),n.push({name:`${a}_uncapitalize`,value:Sr(l)}),n.push({name:a,value:l}))}return n}function gr(e){return e.charAt(0).toUpperCase()+e.slice(1)}function Sr(e){return e.charAt(0).toLowerCase()+e.slice(1)}var re=require("@typescript-eslint/utils"),Ge=require("zod/v4");var ns=re.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),Er="collapse-simple-objs-in-one-line",rs=Ge.z.object({maxLineLength:Ge.z.number().optional(),maxProperties:Ge.z.number().optional(),nestedObjMaxLineLength:Ge.z.number().optional(),nestedObjMaxProperties:Ge.z.number().optional(),ignoreTypesWithSuffix:Ge.z.array(Ge.z.string()).optional()}),is=ns({name:Er,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:[U(rs)]},defaultOptions:[{}],create(e,[t]){let n=e.sourceCode,r=t.ignoreTypesWithSuffix??[],s=t.maxProperties??2,o=t.nestedObjMaxLineLength??t.maxLineLength,i=t.nestedObjMaxProperties??3;function a(p){if(p.type===re.AST_NODE_TYPES.ObjectExpression){let m=p.parent.type===re.AST_NODE_TYPES.Property,y=m?i:s,u=p.properties.length;if(u>y)return!1;if(u===1){let c=p.properties[0];return!c||c.type===re.AST_NODE_TYPES.Property&&c.value.type===re.AST_NODE_TYPES.ObjectExpression||c.type===re.AST_NODE_TYPES.Property&&c.value.type===re.AST_NODE_TYPES.ArrayExpression&&!c.value.elements.every(h=>h&&Ht(h))?!1:{text:n.getText(c),isNested:m,propsSize:u}}let d=[];for(let c of p.properties){if(c.type===re.AST_NODE_TYPES.Property&&!Ht(c.value))return!1;d.push(n.getText(c))}return{text:d.join(", "),isNested:m,propsSize:u}}else{let m=p.parent.parent?.type===re.AST_NODE_TYPES.TSPropertySignature,y=m?i:s,u=p.members.length;if(u>y)return!1;if(r.length>0&&p.parent.type===re.AST_NODE_TYPES.TSTypeAliasDeclaration){let c=p.parent.id.name;if(r.some(g=>c.endsWith(g)))return!1}if(u===1){let c=p.members[0];return!c||c.type===re.AST_NODE_TYPES.TSPropertySignature&&c.typeAnnotation?.typeAnnotation.type===re.AST_NODE_TYPES.TSTypeLiteral?!1:{text:n.getText(c),isNested:m,propsSize:1}}if(p.parent.type===re.AST_NODE_TYPES.TSIntersectionType||p.parent.type===re.AST_NODE_TYPES.TSUnionType&&p.parent.types[0]!==p)return!1;let d=[];for(let c of p.members){if(c.type!==re.AST_NODE_TYPES.TSPropertySignature)return!1;let g=c.typeAnnotation?.typeAnnotation;if(!g||g.type===re.AST_NODE_TYPES.TSTypeLiteral||!Tr(g))return!1;if(g.type===re.AST_NODE_TYPES.TSTypeReference&&g.typeArguments){if(g.typeArguments.params.length>1)return!1;let S=g.typeArguments.params[0];if(!S||!Tr(S))return!1}let h=n.getText(c).trim();(h.endsWith(";")||h.endsWith(","))&&(h=h.slice(0,-1)),d.push(h)}return{text:d.join("; "),isNested:m,propsSize:u}}}function l(p){if(p.loc.start.line===p.loc.end.line)return;if(p.parent.type!==re.AST_NODE_TYPES.JSXExpressionContainer){let g=0,h=!1,S=n.getTokenAfter(p,{filter:A=>A.type!==re.AST_TOKEN_TYPES.Punctuator||h?!0:A.value===","?(g++,!1):A.value===";"?(g++,h=!0,!1):A.value===")"||A.value==="}"?(g++,!1):!0});if(g>4)return;let I=S?.type===re.AST_TOKEN_TYPES.Template&&S.value.startsWith(`}
2
2
  `);if(S?.loc.start.line===p.loc.end.line&&!I)return}let m=a(p);if(!m)return;let y=m.text;if(y.includes(`
3
3
  `)||n.getCommentsInside(p).length>0)return;y.endsWith(";")&&(y=y.slice(0,-1));let u=`{ ${y} }`,d=os(n,p),c=m.isNested&&m.propsSize>2?o:t.maxLineLength;c&&u.length+d.length+ss(p,n)>c||e.report({node:p,messageId:"singleLineProp",fix:g=>g.replaceText(p,u)})}return{TSTypeLiteral:l,ObjectExpression:l}}});function Tr(e){return e.type===re.AST_NODE_TYPES.TSLiteralType||e.type===re.AST_NODE_TYPES.TSTypeReference||e.type===re.AST_NODE_TYPES.TSNumberKeyword||e.type===re.AST_NODE_TYPES.TSStringKeyword||e.type===re.AST_NODE_TYPES.TSBooleanKeyword||e.type===re.AST_NODE_TYPES.TSNullKeyword||e.type===re.AST_NODE_TYPES.TSUndefinedKeyword}function Ht(e,t){return!!(e.type===re.AST_NODE_TYPES.Literal||e.type===re.AST_NODE_TYPES.Identifier||e.type===re.AST_NODE_TYPES.TemplateLiteral||e.type===re.AST_NODE_TYPES.TaggedTemplateExpression||!t&&e.type===re.AST_NODE_TYPES.ArrayExpression&&e.elements.every(n=>n&&Ht(n,!0)))}function ss(e,t){let n=t.getLastToken(e);if(!n)return 0;let r=t.text.indexOf(`
4
4
  `,n.range[1]);return(r!==-1?r:t.text.length)-n.range[1]}function os(e,t){return e.text.slice(t.range[0]-t.loc.start.column,t.range[0])}var Yt={name:Er,rule:is};var as=/eslint +react-compiler\/react-compiler: +\["error/;function hr(e){let t=null;if((e.type==="FunctionDeclaration"||e.type==="FunctionExpression"||e.type==="ArrowFunctionExpression"&&e.body.type==="BlockStatement")&&(t=e.body),!t||t.body.length===0)return!1;let n=t.body[0];return n.type==="ExpressionStatement"&&n.expression.type==="Literal"&&n.expression.value==="use no memo"}function br(e){let t=e.parent;for(;t;){if(t.type==="FunctionDeclaration"||t.type==="FunctionExpression"||t.type==="ArrowFunctionExpression")return t;t=t.parent}return null}var Cr={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"},reactCompilerIsEnabled:{type:"boolean"}}}]},create(e){let t=!1,n=typeof e.getSource=="function"?I=>n(I):I=>e.sourceCode.getText(I),r=typeof e.getScope=="function"?()=>r():I=>e.sourceCode.getScope(I),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 a(I){o&&Array.isArray(I.suggest)&&I.suggest.length>0&&(I.fix=I.suggest[0].fix),e.report(I)}let l=e.getSourceCode().scopeManager,p=new WeakMap,m=new WeakSet,y=new WeakMap,u=new WeakMap,d=new WeakSet;function c(I,A){return function(T){if(A.has(T))return A.get(T);let b=I(T);return A.set(T,b),b}}function g(I,A,T,b,C){C&&I.async&&a({node:I,message:`Effect callbacks are synchronous to prevent race conditions. Put the async function inside:
@@ -12,14 +12,14 @@ 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 w=l.acquire(I),N=new Set,k=null;{let v=w.upper;for(;v&&(N.add(v),v.type!=="function");)v=v.upper;if(!v)return;k=v}let O=Array.isArray;function f(v){if(!O(v.defs))return!1;let L=v.defs[0];if(L==null||L.node.type!=="VariableDeclarator")return!1;let J=L.node.init;if(J==null)return!1;for(;J.type==="TSAsExpression";)J=J.expression;let X=L.node.parent;if(X==null&&(Gt(k.block,L.node.id),X=L.node.parent,X==null))return!1;if(X.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 Y=J.callee;if(Y.type==="MemberExpression"&&Y.object.name==="React"&&Y.property!=null&&!Y.computed&&(Y=Y.property),Y.type!=="Identifier")return!1;let W=L.node.id,{name:G}=Y;if(G==="useRef"&&W.type==="Identifier")return!0;if(fs(Y)&&W.type==="Identifier"){for(let Q of v.references)Q!==W&&d.add(Q.identifier);return!0}else if(G==="useState"||G==="useReducer"){if(W.type==="ArrayPattern"&&W.elements.length===2&&O(v.identifiers)){if(W.elements[1]===v.identifiers[0]){if(G==="useState"){let Q=v.references,ve=0;for(let Xe=0;Xe<Q.length;Xe++){if(Q[Xe].isWrite()&&ve++,ve>1)return!1;p.set(Q[Xe].identifier,W.elements[0])}}return!0}else if(W.elements[0]===v.identifiers[0]){if(G==="useState"){let Q=v.references;for(let ve=0;ve<Q.length;ve++)m.add(Q[ve].identifier)}return!1}}}else if(G==="useTransition"&&W.type==="ArrayPattern"&&W.elements.length===2&&Array.isArray(v.identifiers)&&W.elements[1]===v.identifiers[0])return!0;return!1}function x(v){if(!O(v.defs))return!1;let L=v.defs[0];if(L==null||L.node==null||L.node.id==null)return!1;let J=L.node,X=k.childScopes,Y=null,W;for(W=0;W<X.length;W++){let G=X[W],Q=G.block;if(J.type==="FunctionDeclaration"&&Q===J||J.type==="VariableDeclarator"&&Q.parent===J){Y=G;break}}if(Y==null)return!1;for(W=0;W<Y.through.length;W++){let G=Y.through[W];if(G.resolved!=null&&N.has(G.resolved.scope)&&!E(G.resolved))return!1}return!0}let E=c(f,y),F=c(x,u),R=new Map;function M(v){let L=v.from,J=!1;for(;L.block!==I;)L.type==="function"&&(J=L.block.parent!=null&&L.block.parent.type==="ReturnStatement"),L=L.upper;return J}let P=new Map,ee=new Map;Z(w);function Z(v){for(let L of v.references){if(!L.resolved||!N.has(L.resolved.scope))continue;let J=Gt(I,L.identifier),X=Ir(J),Y=Be(X,ee);if(C&&X.type==="Identifier"&&(X.parent.type==="MemberExpression"||X.parent.type==="OptionalMemberExpression")&&!X.parent.computed&&X.parent.property.type==="Identifier"&&X.parent.property.name==="current"&&M(L)&&R.set(Y,{reference:L,dependencyNode:X}),X.parent.type==="TSTypeQuery"||X.parent.type==="TSTypeReference")continue;let W=L.resolved.defs[0];if(W!=null&&!(W.node!=null&&W.node.init===I.parent)&&W.type!=="TypeParameter")if(P.has(Y))P.get(Y).references.push(L);else{let G=L.resolved,Q=E(G)||F(G);P.set(Y,{isStable:Q,references:[L]})}}for(let L of v.childScopes)Z(L)}R.forEach(({reference:v,dependencyNode:L},J)=>{let X=v.resolved.references,Y=!1;for(let W=0;W<X.length;W++){let{identifier:G}=X[W],{parent:Q}=G;if(Q!=null&&Q.type==="MemberExpression"&&!Q.computed&&Q.property.type==="Identifier"&&Q.property.name==="current"&&Q.parent.type==="AssignmentExpression"&&Q.parent.left===Q){Y=!0;break}}Y||a({node:L.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 D=new Set;function q(v,L){D.has(L)||(D.add(L),a({node:v,message:`Assignments to the '${L}' variable from inside React Hook ${n(T)} 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 ${n(T)}.`}))}let B=new Set;if(P.forEach(({isStable:v,references:L},J)=>{v&&B.add(J),L.forEach(X=>{X.writeExpr&&q(X.writeExpr,J)})}),D.size>0)return;if(!A){let v=null;if(P.forEach(({isStable:L,references:J},X)=>{v||J.forEach(Y=>{if(v)return;let W=Y.identifier;if(!p.has(W))return;let Q=Y.from;for(;Q.type!=="function";)Q=Q.upper;Q.block===I&&(v=X)})}),v){let{suggestedDependencies:L}=qt({dependencies:P,declaredDependencies:[],stableDependencies:B,externalDependencies:new Set,isEffect:!0});a({node:T,message:`React Hook ${b} contains a call to '${v}'. Without a list of dependencies, this can lead to an infinite chain of updates. To fix this, pass [`+L.join(", ")+`] as a second argument to the ${b} Hook.`,suggest:[{desc:`Add dependencies array: [${L.join(", ")}]`,fix(J){return J.insertTextAfter(I,`, [${L.join(", ")}]`)}}]})}return}let ue=[],me=new Set;A.type!=="ArrayExpression"?a({node:A,message:`React Hook ${n(T)} 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.`}):A.elements.forEach(v=>{if(v===null)return;if(v.type==="SpreadElement"){a({node:v,message:`React Hook ${n(T)} has a spread element in its dependency array. This means we can't statically verify whether you've passed the correct dependencies.`});return}d.has(v)&&a({node:v,message:`Functions returned from \`useEffectEvent\` must not be included in the dependency array. Remove \`${n(v)}\` from the list.`,suggest:[{desc:`Remove the dependency \`${n(v)}\``,fix(Y){return Y.removeRange(v.range)}}]});let L;try{L=Be(v,ee)}catch(Y){if(/Unsupported node type/.test(Y.message)){v.type==="Literal"?P.has(v.value)?a({node:v,message:`The ${v.raw} literal is not a valid dependency because it never changes. Did you mean to include ${v.value} in the array instead?`}):a({node:v,message:`The ${v.raw} literal is not a valid dependency because it never changes. You can safely remove it.`}):a({node:v,message:`React Hook ${n(T)} has a complex expression in the dependency array. Extract it to a separate variable so it can be statically checked.`});return}else throw Y}let J=v;for(;J.type==="MemberExpression"||J.type==="OptionalMemberExpression"||J.type==="ChainExpression";)J=J.object||J.expression.object;let X=!k.through.some(Y=>Y.identifier===J);ue.push({key:L,node:v}),X||me.add(L)});let{suggestedDependencies:Oe,unnecessaryDependencies:Ze,missingDependencies:he,duplicateDependencies:Et}=qt({dependencies:P,declaredDependencies:ue,stableDependencies:B,externalDependencies:me,isEffect:C}),pt=Oe;if(Et.size+he.size+Ze.size===0){let v=br(T),L=v&&hr(v);if(t&&!L)return;ls({declaredDependencies:ue,declaredDependenciesNode:A,componentScope:k,scope:w}).forEach(({construction:X,isUsedOutsideOfHook:Y,depType:W})=>{let G=W==="function"?"useCallback":"useMemo",Q=W==="function"?"definition":"initialization",ve=`wrap the ${Q} of '${X.name.name}' in its own ${G}() Hook.`,Xe=Y?`To fix this, ${ve}`:`Move it inside the ${b} callback. Alternatively, ${ve}`,Wi=W==="conditional"||W==="logical expression"?"could make":"makes",Ji=`The '${X.name.name}' ${W} ${Wi} the dependencies of ${b} Hook (at line ${A.loc.start.line}) change on every render. ${Xe}`,ur;Y&&X.type==="Variable"&&W==="function"&&(ur=[{desc:`Wrap the ${Q} of '${X.name.name}' in its own ${G}() Hook.`,fix(fr){let[Xi,Bi]=G==="useMemo"?["useMemo(() => { return ","; })"]:["useCallback(",")"];return[fr.insertTextBefore(X.node.init,Xi),fr.insertTextAfter(X.node.init,Bi)]}}]),a({node:X.node,message:Ji,suggest:ur})});return}!C&&he.size>0&&(pt=qt({dependencies:P,declaredDependencies:[],stableDependencies:B,externalDependencies:me,isEffect:C}).suggestedDependencies);function Ce(){if(ue.length===0)return!0;let v=ue.map(J=>J.key),L=v.slice().sort();return v.join(",")===L.join(",")}Ce()&&pt.sort();function we(v){let L=v.split("."),J="";for(let X=0;X<L.length;X++){if(X!==0){let Y=L.slice(0,X+1).join("."),W=ee.get(Y)===!0;J+=W?"?.":"."}J+=L[X]}return J}function Xt(v,L,J,X){return v.size===0?null:(v.size>1?"":L+" ")+J+" "+(v.size>1?"dependencies":"dependency")+": "+cs(Array.from(v).sort().map(Y=>"'"+we(Y)+"'"))+`. Either ${X} ${v.size>1?"them":"it"} or remove the dependency array.`}let $e="";if(Ze.size>0){let v=null;if(Array.from(Ze.keys()).forEach(L=>{v===null&&L.endsWith(".current")&&(v=L)}),v!==null)$e=` Mutable values like '${v}' aren't valid dependencies because mutating them doesn't re-render the component.`;else if(me.size>0){let L=Array.from(me)[0];w.set.has(L)||($e=` Outer scope values like '${L}' aren't valid dependencies because mutating them doesn't re-render the component.`)}}if(!$e&&he.has("props")){let v=P.get("props");if(v==null)return;let L=v.references;if(!Array.isArray(L))return;let J=!0;for(let X=0;X<L.length;X++){let Y=L[X],W=Gt(k.block,Y.identifier);if(!W){J=!1;break}let G=W.parent;if(G==null){J=!1;break}if(G.type!=="MemberExpression"&&G.type!=="OptionalMemberExpression"){J=!1;break}}J&&($e=` However, 'props' will change when *any* prop changes, so the preferred fix is to destructure the 'props' object outside of the ${b} call and refer to those specific props inside ${n(T)}.`)}if(!$e&&he.size>0){let v=null;he.forEach(L=>{if(v)return;let J=k.set.get(L),X=P.get(L);if(X.references[0].resolved!==J)return;let Y=J.defs[0];if(Y==null||Y.name==null||Y.type!=="Parameter")return;let W=!1,G;for(let Q=0;Q<X.references.length;Q++)if(G=X.references[Q].identifier,G!=null&&G.parent!=null&&(G.parent.type==="CallExpression"||G.parent.type==="OptionalCallExpression")&&G.parent.callee===G){W=!0;break}W&&(v=L)}),v!==null&&($e=` If '${v}' changes too often, find the parent component that defines it and wrap that definition in useCallback.`)}if(!$e&&he.size>0){let v=null;if(he.forEach(L=>{if(v!==null)return;let X=P.get(L).references,Y,W;for(let G=0;G<X.length;G++){for(Y=X[G].identifier,W=Y.parent;W!=null&&W!==k.block;){if(W.type==="CallExpression"){let Q=p.get(W.callee);if(Q!=null){if(Q.name===L)v={missingDep:L,setter:W.callee.name,form:"updater"};else if(m.has(Y))v={missingDep:L,setter:W.callee.name,form:"reducer"};else{let ve=X[G].resolved;if(ve!=null){let Xe=ve.defs[0];Xe!=null&&Xe.type==="Parameter"&&(v={missingDep:L,setter:W.callee.name,form:"inlineReducer"})}}break}}W=W.parent}if(v!==null)break}}),v!==null)switch(v.form){case"reducer":$e=` You can also replace multiple useState variables with useReducer if '${v.setter}' needs the current value of '${v.missingDep}'.`;break;case"inlineReducer":$e=` If '${v.setter}' needs the current value of '${v.missingDep}', you can also switch to useReducer instead of useState and read '${v.missingDep}' in the reducer.`;break;case"updater":$e=` You can also do a functional update '${v.setter}(${v.missingDep.slice(0,1)} => ...)' if you only need '${v.missingDep}' in the '${v.setter}' call.`;break;default:throw new Error("Unknown case.")}}a({node:A,message:`React Hook ${n(T)} has `+(Xt(he,"a","missing","include")||Xt(Ze,"an","unnecessary","exclude")||Xt(Et,"a","duplicate","omit"))+$e,suggest:[{desc:`Update the dependencies array to be: [${pt.map(we).join(", ")}]`,fix(v){return v.replaceText(A,`[${pt.map(we).join(", ")}]`)}}]})}function h(I){let A=ps(I.callee,i);if(A===-1)return;let T=I.arguments[A],b=I.callee,C=Ar(b).name,w=I.arguments[A+1],N=/Effect($|[^a-z])/g.test(C);if(!T){a({node:b,message:`React Hook ${C} requires an effect callback. Did you forget to pass a callback to the hook?`});return}if(t&&!N){let k=br(b);if(!(k&&hr(k)))return}if(!w&&!N){(C==="useMemo"||C==="useCallback")&&a({node:b,message:`React Hook ${C} does nothing when called with only one argument. Did you forget to pass an array of dependencies?`});return}switch(T.type){case"FunctionExpression":case"ArrowFunctionExpression":g(T,w,b,C,N);return;case"Identifier":if(!w||w.elements&&w.elements.some(f=>f&&f.type==="Identifier"&&f.name===T.name))return;let k=r(I).set.get(T.name);if(k==null||k.defs==null)return;let O=k.defs[0];if(!O||!O.node||O.type!=="Variable"&&O.type!=="FunctionName")break;switch(O.node.type){case"FunctionDeclaration":g(O.node,w,b,C,N);return;case"VariableDeclarator":let f=O.node.init;if(!f)break;switch(f.type){case"ArrowFunctionExpression":case"FunctionExpression":g(f,w,b,C,N);return}break}break;default:a({node:b,message:`React Hook ${C} received a function whose dependencies are unknown. Pass an inline function instead.`});return}a({node:b,message:`React Hook ${C} has a missing dependency: '${T.name}'. Either include it or remove the dependency array.`,suggest:[{desc:`Update the dependencies array to be: [${T.name}]`,fix(k){return k.replaceText(w,`[${T.name}]`)}}]})}if(!!e.options[0]?.reactCompilerIsEnabled)return t=!0,{CallExpression:I=>h(I)};if(e.options[0]?.ignoreIfReactCompilerIsEnabled){for(let I of e.sourceCode.getAllComments())if(as.test(I.value))return t=!0,{CallExpression:A=>h(A)}}return{CallExpression:I=>h(I)}}};function qt({dependencies:e,declaredDependencies:t,stableDependencies:n,externalDependencies:r,isEffect:s}){let o=i();function i(){return{isUsed:!1,isSatisfiedRecursively:!1,isSubtreeUsed:!1,children:new Map}}e.forEach((g,h)=>{let S=a(o,h);S.isUsed=!0,l(o,h,I=>{I.isSubtreeUsed=!0})}),t.forEach(({key:g})=>{let h=a(o,g);h.isSatisfiedRecursively=!0}),n.forEach(g=>{let h=a(o,g);h.isSatisfiedRecursively=!0});function a(g,h){let S=h.split("."),I=g;for(let A of S){let T=I.children.get(A);T||(T=i(),I.children.set(A,T)),I=T}return I}function l(g,h,S){let I=h.split("."),A=g;for(let T of I){let b=A.children.get(T);if(!b)return;S(b),A=b}}let p=new Set,m=new Set;y(o,p,m,g=>g);function y(g,h,S,I){g.children.forEach((A,T)=>{let b=I(T);if(A.isSatisfiedRecursively){A.isSubtreeUsed&&S.add(b);return}if(A.isUsed){h.add(b);return}y(A,h,S,C=>b+"."+C)})}let u=[],d=new Set,c=new Set;return t.forEach(({key:g})=>{m.has(g)?u.indexOf(g)===-1?u.push(g):c.add(g):d.add(g)}),p.forEach(g=>{u.push(g)}),{suggestedDependencies:u,unnecessaryDependencies:d,duplicateDependencies:c,missingDependencies:p}}function Ke(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 Ke(e.consequent)!=null||Ke(e.alternate)!=null?"conditional":null;case"LogicalExpression":return Ke(e.left)!=null||Ke(e.right)!=null?"logical expression":null;case"JSXFragment":return"JSX fragment";case"JSXElement":return"JSX element";case"AssignmentExpression":return Ke(e.right)!=null?"assignment expression":null;case"NewExpression":return"object construction";case"Literal":return e.value instanceof RegExp?"regular expression":null;case"TypeCastExpression":return Ke(e.expression);case"TSAsExpression":return Ke(e.expression)}return null}function ls({declaredDependencies:e,declaredDependenciesNode:t,componentScope:n,scope:r}){let s=e.map(({key:i})=>{let a=n.variables.find(p=>p.name===i);if(a==null)return null;let l=a.defs[0];if(l==null)return null;if(l.type==="Variable"&&l.node.type==="VariableDeclarator"&&l.node.id.type==="Identifier"&&l.node.init!=null){let p=Ke(l.node.init);if(p!=null)return[a,p]}return l.type==="FunctionName"&&l.node.type==="FunctionDeclaration"?[a,"function"]:l.type==="ClassName"&&l.node.type==="ClassDeclaration"?[a,"class"]:null}).filter(Boolean);function o(i){let a=!1;for(let l=0;l<i.references.length;l++){let p=i.references[l];if(p.writeExpr){if(a)return!0;a=!0;continue}let m=p.from;for(;m!==r&&m!=null;)m=m.upper;if(m!==r&&!wr(t,p.identifier))return!0}return!1}return s.map(([i,a])=>({construction:i.defs[0],depType:a,isUsedOutsideOfHook:o(i)}))}function Ir(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)?Ir(e.parent):e.type==="MemberExpression"&&e.parent&&e.parent.type==="AssignmentExpression"&&e.parent.left===e?e.object:e}function Zt(e,t,n){t&&(e.optional?t.has(n)||t.set(n,!0):t.has(n)||t.set(n,!1))}function Be(e,t){if(e.type==="Identifier"||e.type==="JSXIdentifier"){let n=e.name;return t&&t.set(n,!1),n}else if(e.type==="MemberExpression"&&!e.computed){let n=Be(e.object,t),r=Be(e.property,null),s=`${n}.${r}`;return Zt(e,t,s),s}else if(e.type==="OptionalMemberExpression"&&!e.computed){let n=Be(e.object,t),r=Be(e.property,null),s=`${n}.${r}`;return Zt(e,t,s),s}else if(e.type==="ChainExpression"&&!e.computed){let n=e.expression;if(n.type==="CallExpression")throw new Error(`Unsupported node type: ${n.type}`);let r=Be(n.object,t),s=Be(n.property,null),o=`${r}.${s}`;return Zt(n,t,o),o}else throw new Error(`Unsupported node type: ${e.type}`)}function Ar(e,t){return e.type==="MemberExpression"&&e.object.type==="Identifier"&&e.object.name==="React"&&e.property.type==="Identifier"&&!e.computed?e.property:e}function ps(e,t){let n=Ar(e);if(n.type!=="Identifier")return-1;switch(n.name){case"useEffect":case"useLayoutEffect":case"useCallback":case"useMemo":return 0;case"useImperativeHandle":return 1;default:if(n===e&&t&&t.additionalHooks){let r;try{r=Be(n,null)}catch(s){if(/Unsupported node type/.test(s.message))return 0;throw s}return t.additionalHooks.test(r)?0:-1}else return-1}}function Gt(e,t){let n=[e],r=null;for(;n.length;){if(r=n.shift(),us(r,t))return r;if(wr(r,t))for(let[s,o]of Object.entries(r))s!=="parent"&&(xr(o)?(o.parent=r,n.push(o)):Array.isArray(o)&&o.forEach(i=>{xr(i)&&(i.parent=r,n.push(i))}))}return null}function cs(e){let t="";for(let n=0;n<e.length;n++)t+=e[n],n===0&&e.length===2?t+=" and ":n===e.length-2&&e.length>2?t+=", and ":n<e.length-1&&(t+=", ");return t}function xr(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&typeof e.type=="string"}function us(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 wr(e,t){return e.range[0]<=t.range[0]&&e.range[1]>=t.range[1]}function fs(e){return!1}var le=require("@typescript-eslint/utils"),H=Re(require("typescript")),tn=require("zod/v4");var Kt=require("@typescript-eslint/utils");function ct(e,t,n=1/0){if(n!==0&&e.parent)return e.type===t?e:ct(e.parent,t,n===1/0?n:n-1)}function*Qt(e){yield e,e.parent&&(yield*Qt(e.parent))}function en(e,t){for(let n of e){let r=t(n);if(r!=null&&r!==!1)return r}}function vr(e,t,n){let s=n.getDeclaredVariables(e).find(o=>o.name===t||o.identifiers[0]?.parent.type===Kt.AST_NODE_TYPES.Property&&o.identifiers[0].parent.key.type===Kt.AST_NODE_TYPES.Identifier&&o.identifiers[0].parent.key.name===t);return s?s.references.filter(o=>!o.init):[]}function Fr(e){return e===null||typeof e!="object"||!("type"in e)?!1:typeof e.type=="string"}function ms(e,t){return e[t]}function _e(e,t,n){let r=n.visitorKeys,s=new Set;function o(i){if(s.has(i))return!1;if(s.add(i),t(i)===!0)return!0;let l=r[i.type];if(l)for(let p of l){let m=ms(i,p);if(m){if(Array.isArray(m)){for(let y of m)if(Fr(y)&&o(y))return!0}else if(Fr(m)&&o(m))return!0}}return!1}o(e)}var ys=le.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),Rr="improved-no-unnecessary-condition",ds=tn.z.object({alternativeForInCondition:tn.z.string().optional().describe("Alternative to appear in the error for `in` condition")}),Nr={object:"Array",property:"isArray"},gs=["string","number","bigint","boolean","symbol","undefined","object","function","never"],Ss=new Set(gs),nn={name:Rr,rule:ys({name:Rr,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.",unnecessaryArrayIsArrayCondition:"This Array.isArray check is unnecessary as it always evaluates to true.",alwaysFalseArrayIsArrayCondition:"This Array.isArray 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.",unnecessaryInCondition:'This in check is unnecessary. Property "{{property}}" always exists on type "{{type}}".{{alternative}}',alwaysFalseInCondition:'This in check will always be false. Property "{{property}}" does not exist on type "{{type}}".{{alternative}}'},schema:[U(ds)]},defaultOptions:[{}],create(e,[t]){let n=le.ESLintUtils.getParserServices(e,!0),r=n.program?.getTypeChecker();if(!r||!n.program)throw new Error("TypeScript services or program not available");function s(f){return f.type===le.AST_NODE_TYPES.UnaryExpression&&f.operator==="typeof"}function o(f){return f.flags&H.default.TypeFlags.Any||f.flags&H.default.TypeFlags.Unknown?null:f.flags&H.default.TypeFlags.StringLike?["string"]:f.flags&H.default.TypeFlags.NumberLike?["number"]:f.flags&H.default.TypeFlags.BigIntLike?["bigint"]:f.flags&H.default.TypeFlags.BooleanLike?["boolean"]:f.flags&H.default.TypeFlags.ESSymbolLike?["symbol"]:f.flags&H.default.TypeFlags.Undefined||f.flags&H.default.TypeFlags.Void?["undefined"]:f.flags&H.default.TypeFlags.Null?["object"]:f.getCallSignatures().length>0?["function"]:f.flags&H.default.TypeFlags.Object?f.getProperties().length===0?["string","number","bigint","boolean","symbol","object","function"]:["object"]:f.flags&H.default.TypeFlags.NonPrimitive?["object"]:f.flags&H.default.TypeFlags.Never?["never"]:null}function i(f){if(!r)return null;let x=n.esTreeNodeToTSNodeMap.get(f),E=r.getTypeAtLocation(x.expression);if(E.flags&H.default.TypeFlags.Any||E.flags&H.default.TypeFlags.Unknown)return null;let F=[];if(E.isUnion()){for(let M of E.types){let P=o(M);if(P)F.push(...P);else return null}return F}let R=o(E);return R?(F.push(...R),F):null}function a(f){if(!(f.operator==="==="||f.operator==="!=="))return;let E=null,F=null;if(s(f.left)?(E=f.left,F=f.right.type===le.AST_NODE_TYPES.Literal&&typeof f.right.value=="string"?f.right.value:null):s(f.right)&&(E=f.right,F=f.left.type===le.AST_NODE_TYPES.Literal&&typeof f.left.value=="string"?f.left.value:null),!E||!F||!Ts(F,Ss))return;let R=i(E);if(!R)return;let M=f.operator==="!==",P=R.includes(F);R.length===1?P&&!M?e.report({node:f,messageId:"unnecessaryTypeofCondition",data:{name:ut(E,e),type:F}}):!P&&M?e.report({node:f,messageId:"unnecessaryTypeofCondition",data:{name:ut(E,e),type:Array.from(R)[0]}}):!P&&!M?e.report({node:f,messageId:"alwaysFalseTypeofCondition",data:{name:ut(E,e),actualType:vt(R),conditionType:F}}):P&&M&&e.report({node:f,messageId:"alwaysFalseTypeofCondition",data:{name:ut(E,e),actualType:vt(R),conditionType:F}}):!P&&!M?e.report({node:f,messageId:"alwaysFalseTypeofCondition",data:{name:ut(E,e),actualType:vt(R),conditionType:F}}):!P&&M&&e.report({node:f,messageId:"unnecessaryTypeofCondition",data:{name:ut(E,e),type:vt(R)}})}function l(f){if(f.flags&H.default.TypeFlags.Any||f.flags&H.default.TypeFlags.Unknown)return null;if(f.isUnion()){let x=[];for(let E of f.types)if(E.flags&H.default.TypeFlags.StringLiteral){let F=E.value;x.push(F)}else return null;return x}return f.flags&H.default.TypeFlags.StringLiteral?[f.value]:null}function p(f){if(!r)return null;let x=n.esTreeNodeToTSNodeMap.get(f),E=r.getTypeAtLocation(x),F=l(E);if(F)return F;let R=r.getSymbolAtLocation(x);if(R){let M=r.getTypeOfSymbolAtLocation(R,x),P=l(M);if(P)return P}return null}function m(f){let x=e.sourceCode.ast,E=null;return _e(x,F=>{if(F.type===le.AST_NODE_TYPES.VariableDeclarator&&F.id.type===le.AST_NODE_TYPES.Identifier&&F.id.name===f.name&&F.id.typeAnnotation){let R=F.id.typeAnnotation.typeAnnotation;if(R.type===le.AST_NODE_TYPES.TSUnionType){let M=[];for(let P of R.types)if(P.type===le.AST_NODE_TYPES.TSLiteralType&&P.literal.type===le.AST_NODE_TYPES.Literal&&typeof P.literal.value=="string")M.push(P.literal.value);else return!0;return E=M,!0}if(R.type===le.AST_NODE_TYPES.TSLiteralType&&R.literal.type===le.AST_NODE_TYPES.Literal&&typeof R.literal.value=="string")return E=[R.literal.value],!0}return!1},e.sourceCode),E}function y(f){return f==="Array"||f==="ReadonlyArray"?!0:f.endsWith(".Array")||f.endsWith(".ReadonlyArray")}function u(f){if(!r)return!1;if(r.isArrayType(f)||r.isTupleType(f))return!0;let x=r.getApparentType(f);if(x!==f&&(r.isArrayType(x)||r.isTupleType(x)))return!0;if(f.aliasSymbol){let F=r.getFullyQualifiedName(f.aliasSymbol);if(y(F))return!0}let E=f.getSymbol();if(E){let F=r.getFullyQualifiedName(E);if(y(F))return!0}return!1}function d(f){return r?f.getProperties().length===0&&r.getIndexInfosOfType(f).length===0&&f.getCallSignatures().length===0&&f.getConstructSignatures().length===0:!1}function c(f){return r?!!(f.flags&H.default.TypeFlags.StringLike||f.flags&H.default.TypeFlags.NumberLike||f.flags&H.default.TypeFlags.BigIntLike||f.flags&H.default.TypeFlags.BooleanLike||f.flags&H.default.TypeFlags.ESSymbolLike||f.flags&H.default.TypeFlags.EnumLike||f.flags&H.default.TypeFlags.Null||f.flags&H.default.TypeFlags.Undefined||f.flags&H.default.TypeFlags.Void||f.flags&H.default.TypeFlags.Never||f.flags&H.default.TypeFlags.Object&&!f.isClassOrInterface()&&!u(f)&&!d(f)):!1}function g(f){if(f.flags&H.default.TypeFlags.Any||f.flags&H.default.TypeFlags.Unknown)return"unknown";if(f.isUnion()){let x=!0,E=!0;for(let F of f.types){let R=g(F);if(R==="unknown")return"unknown";R!=="alwaysTrue"&&(x=!1),R!=="alwaysFalse"&&(E=!1)}return x?"alwaysTrue":E?"alwaysFalse":"unknown"}return u(f)?"alwaysTrue":c(f)?"alwaysFalse":"unknown"}function h(f){return!f.computed&&f.object.type===le.AST_NODE_TYPES.Identifier&&f.object.name===Nr.object&&f.property.type===le.AST_NODE_TYPES.Identifier&&f.property.name===Nr.property}function S(f){if(!r||f.callee.type!==le.AST_NODE_TYPES.MemberExpression||!h(f.callee)||f.arguments.length===0)return;let[x]=f.arguments;if(!x||x.type===le.AST_NODE_TYPES.SpreadElement)return;let E=n.esTreeNodeToTSNodeMap.get(x),F=r.getTypeAtLocation(E),R=g(F);R==="alwaysTrue"?e.report({node:f,messageId:"unnecessaryArrayIsArrayCondition"}):R==="alwaysFalse"&&e.report({node:f,messageId:"alwaysFalseArrayIsArrayCondition"})}function I(f){if(f.callee.type!==le.AST_NODE_TYPES.MemberExpression||f.callee.property.type!==le.AST_NODE_TYPES.Identifier||f.callee.computed)return;let x=f.callee.property.name;if(x!=="startsWith"&&x!=="endsWith"&&x!=="includes"||f.arguments.length!==1)return;let[E]=f.arguments;if(!E||E.type!==le.AST_NODE_TYPES.Literal||typeof E.value!="string")return;let F=f.callee.object,R=p(F);if(!R&&F.type===le.AST_NODE_TYPES.Identifier&&(R=m(F)),!R||R.length===0)return;let M=E.value;if(x==="includes"&&R.length>1)return;let P=0,ee=0;for(let Z of R)if((x==="startsWith"?Z.startsWith(M):x==="endsWith"?Z.endsWith(M):Z.includes(M))?P++:ee++,P>0&&ee>0)return;if(P>0&&ee===0){let Z=x==="startsWith"?"unnecessaryStartsWithCondition":x==="endsWith"?"unnecessaryEndsWithCondition":"unnecessaryIncludesCondition";e.report({node:f,messageId:Z})}else if(ee>0&&P===0){let Z=x==="startsWith"?"alwaysFalseStartsWithCondition":x==="endsWith"?"alwaysFalseEndsWithCondition":"alwaysFalseIncludesCondition";e.report({node:f,messageId:Z})}}function A(f){if(!new Set(["===","!==",">",">=","<","<="]).has(f.operator))return;function E(D){if(D.type!==le.AST_NODE_TYPES.MemberExpression||D.computed||D.property.type!==le.AST_NODE_TYPES.Identifier||D.property.name!=="length")return null;let q=D.object,B=p(q);if(!B||B.length===0)return null;let ue=[];for(let me of B)ue.push(me.length);return{values:ue}}let F=E(f.left),R=E(f.right),M=null,P=null;if(F?f.right.type===le.AST_NODE_TYPES.Literal&&typeof f.right.value=="number"&&(M=F.values,P=f.right.value):R&&f.left.type===le.AST_NODE_TYPES.Literal&&typeof f.left.value=="number"&&(M=R.values,P=f.left.value),!M||P===null)return;let ee=0,Z=0;for(let D of M){let q=!1;if(f.operator==="==="?q=D===P:f.operator==="!=="?q=D!==P:f.operator===">"?q=D>P:f.operator===">="?q=D>=P:f.operator==="<"?q=D<P:f.operator==="<="&&(q=D<=P),q?ee++:Z++,ee>0&&Z>0)return}ee>0&&Z===0?e.report({node:f,messageId:"unnecessaryLengthCondition"}):Z>0&&ee===0&&e.report({node:f,messageId:"alwaysFalseLengthCondition"})}function T(f){if(f.type===le.AST_NODE_TYPES.Literal&&typeof f.value=="string")return f.value;let x=p(f);if(!x||x.length!==1)return null;let[E]=x;return E??null}function b(f){return(f.flags&H.default.TypeFlags.Intersection)!==0}function C(f){return(f.flags&H.default.TypeFlags.Object)!==0}function w(f){return!r||r.getIndexTypeOfType(f,H.default.IndexKind.String)?!0:!!r.getIndexTypeOfType(f,H.default.IndexKind.Number)}function N(f,x){if(!r||w(f)||f.getProperties().length===0)return"unknown";let E=r.getPropertyOfType(f,x);return E?E.flags&H.default.SymbolFlags.Optional?"optional":"required":"absent"}function k(f,x){if(f.flags&H.default.TypeFlags.Any||f.flags&H.default.TypeFlags.Unknown||f.flags&H.default.TypeFlags.Never||f.flags&H.default.TypeFlags.TypeParameter||f.flags&H.default.TypeFlags.IndexedAccess||f.flags&H.default.TypeFlags.StringLike||f.flags&H.default.TypeFlags.NumberLike||f.flags&H.default.TypeFlags.BigIntLike||f.flags&H.default.TypeFlags.BooleanLike||f.flags&H.default.TypeFlags.EnumLike||f.flags&H.default.TypeFlags.ESSymbolLike||f.flags&H.default.TypeFlags.NonPrimitive||f.flags&H.default.TypeFlags.Null||f.flags&H.default.TypeFlags.Undefined||f.flags&H.default.TypeFlags.Void)return"unknown";if(f.isUnion()){let E=!0,F=!0;for(let R of f.types){let M=k(R,x);if(M==="unknown"||(M!=="required"&&(E=!1),M!=="absent"&&(F=!1),M==="optional"))return"unknown"}return E?"required":F?"absent":"unknown"}if(b(f)){let E=f,F=!1,R=!1;for(let M of E.types){let P=k(M,x);if(P==="unknown")return"unknown";P==="required"?F=!0:P==="optional"&&(R=!0)}return F?"required":R?"optional":"absent"}return C(f)?N(f,x):"unknown"}function O(f){if(f.operator!=="in"||f.left.type===le.AST_NODE_TYPES.PrivateIdentifier)return;let x=T(f.left);if(!x)return;let E=f.right,F=n.esTreeNodeToTSNodeMap.get(E);if(!r)return;let R=r.getTypeAtLocation(F),M=k(R,x);M==="required"?e.report({node:f,messageId:"unnecessaryInCondition",data:{property:x,type:r.typeToString(R),alternative:t.alternativeForInCondition?`If this a valid condition, you can use as alternative: ${t.alternativeForInCondition}`:""}}):M==="absent"&&e.report({node:f,messageId:"alwaysFalseInCondition",data:{property:x,type:r.typeToString(R),alternative:t.alternativeForInCondition?`If this a valid condition, you can use as alternative: ${t.alternativeForInCondition}`:""}})}return{BinaryExpression(f){a(f),A(f),O(f)},CallExpression(f){I(f),S(f)}}}})};function vt(e){return Array.from(new Set(e)).join(" | ")||"never"}function ut(e,t){let n=e.argument;return n.type===le.AST_NODE_TYPES.Identifier?n.name:t.sourceCode.getText(n)}function Ts(e,t){return t.has(e)}var ht=require("@typescript-eslint/utils"),st=require("zod/v4");var Es=st.z.object({functions:st.z.array(st.z.string().or(st.z.object({name:st.z.string(),message:st.z.string()})))});function hs(e){if(e.type===ht.AST_NODE_TYPES.Identifier)return e.name;if(e.type===ht.AST_NODE_TYPES.MemberExpression&&e.property.type===ht.AST_NODE_TYPES.Identifier&&e.object.type===ht.AST_NODE_TYPES.Identifier)return`${e.object.name}.${e.property.name}`}var rn=z({name:"no-call-with-explicit-generics",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)",noExplicitGenericsCustom:"{{ message }}"},schema:[U(Es)]},defaultOptions:[{functions:[]}],create(e,[t]){let n=new Map,r=new Map;for(let o of t.functions){let i=typeof o=="string"?o:o.name,a=typeof o=="string"?void 0:o.message;i.startsWith("*.")?r.set(i.slice(2),a):n.set(i,a)}function s(o){if(n.has(o))return{message:n.get(o)};let i=o.indexOf(".");if(i!==-1){let a=o.slice(i+1);if(r.has(a))return{message:r.get(a)}}}return{CallExpression(o){let i=hs(o.callee);if(!i||!o.typeArguments)return;let a=s(i);a&&(a.message?e.report({node:o,messageId:"noExplicitGenericsCustom",data:{message:a.message}}):e.report({node:o,messageId:"noExplicitGenerics",data:{functionName:i}}))}}}});var De=require("@typescript-eslint/utils"),bs=De.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),kr="no-call-with-inferred-generics",xs=bs({name:kr,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",typeOfUsedInGenerics:"Function '{{ functionName }}' should not be called with 'typeof' in generics",unknownUsedInGenerics:"Function '{{ functionName }}' should not be called with 'unknown' 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"}},disallowTypeOf:{type:"boolean"},disallowUnknown:{type:"boolean"}},required:["name"]}},anyAliases:{type:"array",items:{type:"string"}}},required:["functions"]}]},defaultOptions:[{functions:[]}],create(e,[t]){let n=new Map(t.functions.map(o=>[o.name,o])),r=t.functions.some(o=>o.disallowTypeOf),s=new Set;return{...r&&{TSTypeAliasDeclaration(o){o.typeAnnotation.type===De.AST_NODE_TYPES.TSTypeQuery&&s.add(o.id.name)}},CallExpression(o){let{callee:i}=o;if(i.type!==De.AST_NODE_TYPES.Identifier)return;let a=n.get(i.name);if(!a)return;let{minGenerics:l=1,allowAny:p,disallowTypes:m=t.disallowTypes,disallowTypeOf:y,disallowUnknown:u}=a;(o.typeArguments?.params.length||0)<(l||0)&&e.report({node:o,messageId:"missingGenericDeclaration",data:{functionName:i.name,minGenerics:l||0}}),!(p&&!m)&&(o.typeArguments?.params.some(c=>!p&&c.type===De.AST_NODE_TYPES.TSAnyKeyword||m&&c.type===De.AST_NODE_TYPES.TSTypeReference&&c.typeName.type===De.AST_NODE_TYPES.Identifier&&m.includes(c.typeName.name))&&e.report({node:o,messageId:"anyUsedInGenerics",data:{functionName:i.name}}),u&&o.typeArguments?.params.some(c=>c.type===De.AST_NODE_TYPES.TSUnknownKeyword)&&e.report({node:o,messageId:"unknownUsedInGenerics",data:{functionName:i.name}}),y&&o.typeArguments?.params.some(c=>c.type===De.AST_NODE_TYPES.TSTypeQuery||c.type===De.AST_NODE_TYPES.TSTypeReference&&c.typeName.type===De.AST_NODE_TYPES.Identifier&&s.has(c.typeName.name))&&e.report({node:o,messageId:"typeOfUsedInGenerics",data:{functionName:i.name}}))}}}}),sn={name:kr,rule:xs};var Dr=require("@typescript-eslint/utils"),Cs=Dr.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),Lr="no-commented-out-code",Is=["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:"],As=/^\s*return\s+/,ws=/\w=("|'|`)/,Fs=/\w+:\s*('|"|`)/,vs=/\[['"][^'"]*['"]\]:\s*('|"|`|[^'"`\s])/,Rs=/\w+-\w+:/,Ns=/\w+_\w+:/,ks=/\?\s+\w/,Ps=/:\s+\w/,Os=/^\s*('|"|`)[^'"]*('|"|`),?\s*$/,Ds=/^\s*\d+[,}]/,Ls=/^\s*\[[^\]]*\][,}]/,js=/^\s*\{[^}]*\}[,}]/,Ms=/\.\w+\(/,$s=/\[\w+\]/,_s=/^\s*(['"`]).+?\1\s*:/,Us=/^<[A-Z]\w*(\s|>|\/)/,zs=/^<[a-z]+(\s|>|\/)/,Vs=/<[A-Z]\w*(\s.*)?>/,Ws=/<\/[A-Z]\w*>/,Js=/<[a-z]+(\s.*)?>/,Xs=/<\/[a-z]+>/,Bs=/^\s*[*\s]*$/,Hs=/^[a-zA-Z]/,Ys=/^[A-Z][A-Za-z]*(?:\s+\d+)?(?:\s+[a-z]+)*:\s+[A-Za-z]/,qs=/```[\s\S]*?```/g,Zs=/`[^`]*`/g,Pr=/[a-zA-Z0-9]/,Gs=/\.[A-Za-z_][A-Za-z0-9_]*\(/,Ks=/[{}[\]()`=<>]/,Qs=/:\s*(['"`[{(]|\w+\s*=>)/,eo=/\bif\s*\(|\belse\b|=>/,ge={returnStatement:As,stringAssignment:ws,objectPropertyWithQuotes:Fs,computedPropertyAssignment:vs,kebabCaseProperty:Rs,snakeCaseProperty:Ns,ternaryOperator:ks,colonWithWord:Ps,quotedString:Os,numberWithComma:Ds,arrayWithComma:Ls,objectWithComma:js,methodCall:Ms,arrayAccess:$s,quotedPropertyKey:_s,jsxSelfClosing:Us,jsxElement:zs,jsxOpeningTag:Vs,jsxClosingTag:Ws,htmlOpeningTag:Js,htmlClosingTag:Xs,jsdocComment:Bs};function to(e){if(e.includes(":")){let n=e.split(":")[0]?.trim();if(n&&Hs.test(n)&&n.includes(" "))return!0}let t=e.trim();return t.length===0||Gs.test(t)||Ks.test(t)||Qs.test(t)||eo.test(t)?!1:!!(t.includes(":")&&Ys.test(t))}var no=[") {","return;",ge.returnStatement,"if (","else {","else if (","/>","</","< ","},",": {"," } = ","={",ge.stringAssignment,");",ge.objectPropertyWithQuotes,ge.computedPropertyAssignment,ge.kebabCaseProperty,ge.snakeCaseProperty,"&&","||","()",ge.ternaryOperator,ge.colonWithWord,ge.quotedString,ge.numberWithComma,ge.arrayWithComma,ge.objectWithComma,ge.methodCall,ge.arrayAccess,"?.(","??","=>",ge.quotedPropertyKey],ro=["/>","</",ge.jsxSelfClosing,ge.jsxElement,ge.jsxOpeningTag,ge.jsxClosingTag,ge.htmlOpeningTag,ge.htmlClosingTag],Or=["INFO:","TODO:","DOCS:","FIX:","FIXME:","HACK:","NOTE:","WARNING:","WARN:","BUG:","ISSUE:","TEMP:","TEMPORARY:","XXX:","REVIEW:","eslint","cspell:","spell-checker:"],io=Cs({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(r,s){if(r.startsWith("/"))return!1;let o=r.trimStart();if(r.startsWith("*")||o.startsWith("eslint-disable")||r.includes("@deprecated")||r.includes("@example")||r.includes("@param")||r.includes("@returns")||r.includes("@throws")||r.includes("typescript-eslint")||r.includes("@ts-")||r.includes("prettier-ignore")||ge.jsdocComment.test(r))return!1;for(let i of Or)if(o.startsWith(i))return!1;if(r.includes("https://")||to(o))return!1;if(s==="Block"){for(let i of ro)if(typeof i=="string"){if(r.includes(i))return{wrongPattern:i}}else if(i.test(r))return{wrongPattern:`regex(${i.toString()})`};return!1}for(let i of Is)if(o.startsWith(i))return{wrongPattern:i};for(let i of no)if(typeof i=="string"){if(r.includes(i))return{wrongPattern:i}}else if(i.test(r))return{wrongPattern:`regex(${i.toString()})`};return!1}function n(r,s){let o=r,i=o.trim();if(i.startsWith("`")&&(i.endsWith("`,")||i.endsWith("`;")||i.endsWith("`")))return o;if(s==="Block"&&o.includes("```")){let p=o.split(qs);p.some(y=>Pr.test(y))&&(o=p.join(""))}if(!o.includes("`"))return o;let a=o.split(Zs);return a.some(p=>Pr.test(p))?a.join(""):o}return{Program(){let s=e.sourceCode.getAllComments();for(let o of s){let i=n(o.value,o.type),a=t(i,o.type);a&&e.report({node:o,messageId:"commentedOutCode",data:{wrongPattern:a.wrongPattern,allowedPrefixes:Or.join(", ")}})}}}}}),on={name:Lr,rule:io};var Rt=require("@typescript-eslint/utils"),so=Rt.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),jr="no-default-export",oo=so({name:jr,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 n of t.specifiers)n.exported.type===Rt.TSESTree.AST_NODE_TYPES.Identifier&&n.exported.name==="default"&&e.report({node:t,messageId:"noDefaultExport"})}}}}),an={name:jr,rule:oo};var Mr=require("@typescript-eslint/utils"),ao=Mr.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),$r="no-leaked-text-in-jsx",lo=[",",";","[","]","(",")"],po=ao({name:$r,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 n=t.value.trim();if(!n)return;let r="";lo.includes(n)?r=n:n.includes("&&")?r="&&":n.includes("||")?r="||":n.endsWith("? (")&&(r="? ("),r&&e.report({node:t,messageId:"leakedTextInJSX",data:{text:r}})}}}}),ln={name:$r,rule:po};var Qe=require("@typescript-eslint/utils"),co=Qe.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),Ur="no-non-camel-case-functions",uo=/^(\$?[a-z][a-zA-Z0-9]*)$/;function _r(e){if(e.typeName.type!==Qe.AST_NODE_TYPES.TSQualifiedName)return!1;let{left:t,right:n}=e.typeName;return t.type===Qe.AST_NODE_TYPES.Identifier&&t.name==="JSX"&&n.name==="Element"}var fo=co({name:Ur,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&&!uo.test(t.id.name)){let n=t.returnType?.typeAnnotation;if(n&&(n.type===Qe.AST_NODE_TYPES.TSTypeReference?_r(n):n.type===Qe.AST_NODE_TYPES.TSUnionType&&n.types.some(s=>s.type===Qe.AST_NODE_TYPES.TSTypeReference&&_r(s))))return;e.report({node:t.id,messageId:"nonCamelCaseFunction",data:{functionName:t.id.name}})}}}}}),pn={name:Ur,rule:fo};var ae=require("@typescript-eslint/utils");var mo=ae.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),zr="no-optional-root-props",yo=mo({name:zr,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(r){let o=e.sourceCode.getDeclaredVariables(r)[0];if(!o||o.references.length!==1)return!1;let i=o.references[0];if(!i)return!1;for(let a of Qt(i.identifier)){if("returnType"in a||a.type===ae.TSESTree.AST_NODE_TYPES.ExportNamedDeclaration)return!1;let l=a.parent;if(!l)return!1;if(l.type===ae.TSESTree.AST_NODE_TYPES.TSTypeParameterInstantiation&&l.parent.type===ae.TSESTree.AST_NODE_TYPES.TSTypeReference&&l.parent.typeName.type===ae.TSESTree.AST_NODE_TYPES.Identifier&&l.parent.typeName.name==="FC"){let m=ct(l.parent.parent,ae.TSESTree.AST_NODE_TYPES.VariableDeclaration,4);if(!m)return!1;let y=Nt(m,e.sourceCode);return y?!(y.parent.type===ae.TSESTree.AST_NODE_TYPES.CallExpression&&y.parent.callee.type===ae.TSESTree.AST_NODE_TYPES.Identifier&&y.parent.callee.name==="memo"):!1}if(a.type===ae.TSESTree.AST_NODE_TYPES.AssignmentPattern)return!1;if(l.type===ae.TSESTree.AST_NODE_TYPES.ArrowFunctionExpression){let p=ct(l,ae.TSESTree.AST_NODE_TYPES.VariableDeclaration);return p?!!Nt(p,e.sourceCode):!1}if(l.type===ae.TSESTree.AST_NODE_TYPES.FunctionDeclaration)return!!Nt(l,e.sourceCode)}return!1}function n(r){r.key.type!==ae.TSESTree.AST_NODE_TYPES.Identifier||!r.optional||e.report({node:r.key,messageId:"optionalNotAllowed",data:{propertyName:r.key.name},suggest:[{messageId:"suggestion",fix:s=>{let o=ct(r,ae.TSESTree.AST_NODE_TYPES.TSPropertySignature);if(!o)return null;let i=e.sourceCode.getText(o);return s.replaceText(o,i.replace("?:",": undefined |"))}}]})}return{TSTypeAliasDeclaration(r){if(r.typeAnnotation.type===ae.TSESTree.AST_NODE_TYPES.TSTypeLiteral&&!(kt(r)||!t(r)))for(let s of r.typeAnnotation.members)s.type===ae.TSESTree.AST_NODE_TYPES.TSPropertySignature&&n(s)},TSInterfaceDeclaration(r){if(!(kt(r)||!t(r)))for(let s of r.body.body)s.type===ae.TSESTree.AST_NODE_TYPES.TSPropertySignature&&n(s)},TSTypeReference(r){if(r.typeName.type!==ae.TSESTree.AST_NODE_TYPES.Identifier||r.typeName.name!=="FC"||!r.typeArguments?.params[0])return;let s=r.typeArguments.params[0];if(s.type!==ae.TSESTree.AST_NODE_TYPES.TSTypeLiteral)return;let o=ct(r.parent,ae.TSESTree.AST_NODE_TYPES.VariableDeclaration,4);if(!o)return;let i=Nt(o,e.sourceCode);if(!(!i||i.parent.type===ae.TSESTree.AST_NODE_TYPES.CallExpression&&i.parent.callee.type===ae.TSESTree.AST_NODE_TYPES.Identifier&&i.parent.callee.name==="memo"))for(let l of s.members)l.type===ae.TSESTree.AST_NODE_TYPES.TSPropertySignature&&n(l)}}}});function kt(e){return e?e.parent?.type===ae.TSESTree.AST_NODE_TYPES.ExportNamedDeclaration||e.parent?.type===ae.TSESTree.AST_NODE_TYPES.ExportDefaultDeclaration:!1}function Nt(e,t){if(kt(e))return;let n;if(e.type===ae.TSESTree.AST_NODE_TYPES.VariableDeclaration){if(e.declarations.length!==1)return;e.declarations[0].id.type===ae.TSESTree.AST_NODE_TYPES.Identifier&&(n=e.declarations[0].id)}else{if(!e.id)return;n=e.id}if(!n)return;let r=t.getScope(e);e.type===ae.TSESTree.AST_NODE_TYPES.FunctionDeclaration&&r.upper&&(r=r.upper);let s=r.variables.find(i=>i.identifiers.includes(n));if(!s)return;let o=s.references.filter(i=>i.identifier!==n);if(!(o.length!==1||!o[0])&&!kt(o[0].identifier.parent.parent))return o[0].identifier}var cn={name:zr,rule:yo};var et=require("@typescript-eslint/utils");var bt=z({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 n(s){return s?s.type===et.AST_NODE_TYPES.Identifier?t.has(s.name):s.type===et.AST_NODE_TYPES.MemberExpression?n(s.object):!1:!1}function r(s){return s.type!==et.AST_NODE_TYPES.TSTypeReference||s.typeArguments?!1:s.typeName.type===et.AST_NODE_TYPES.Identifier&&t.has(s.typeName.name)}return{ImportDeclaration(s){for(let o of s.specifiers)t.add(o.local.name)},ExportNamedDeclaration(s){if(s.source){e.report({node:s,messageId:"noReexport"});return}if(s.declaration?.type===et.AST_NODE_TYPES.VariableDeclaration)for(let o of s.declaration.declarations)n(o.init)&&e.report({node:s,messageId:"noReexport"});s.declaration?.type===et.AST_NODE_TYPES.TSTypeAliasDeclaration&&r(s.declaration.typeAnnotation)&&e.report({node:s,messageId:"noReexport"}),s.specifiers.length>0&&e.report({node:s,messageId:"noReexport"})},ExportDefaultDeclaration(s){s.declaration.type===et.AST_NODE_TYPES.Identifier&&t.has(s.declaration.name)&&e.report({node:s,messageId:"noReexport"})},ExportAllDeclaration(s){e.report({node:s,messageId:"noReexport"})}}}});var Vr=require("@typescript-eslint/utils"),Pt=Re(require("path")),He=require("zod/v4");var go=Vr.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),Wr="no-relative-imports",So=He.z.object({find:He.z.string(),replacement:He.z.string()}),To=He.z.object({aliases:He.z.array(So),rootDir:He.z.string().optional(),allowNotFoundAliases:He.z.boolean().optional(),_dev_simulateFileName:He.z.string().optional()}),Eo=go({name:Wr,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:[U(To)]},defaultOptions:[{aliases:[],rootDir:void 0}],create(e,[t]){let n=t._dev_simulateFileName??e.filename;function r(i){return i.startsWith(".")||i.startsWith("..")}function s(i,a){let l=Pt.default.dirname(a);return Pt.default.resolve(l,i)}function o(i){let a=t.rootDir??process.cwd(),l=Pt.default.relative(a,i);if(l.startsWith("."))return null;l.startsWith("/")||(l=`/${l}`);for(let{find:p,replacement:m}of t.aliases)if(l.startsWith(m)){let y=l.replace(m,p);return{alias:p,newPath:y}}return null}return{ImportDeclaration(i){let a=i.source.value;if(!r(a))return;let l=s(a,n),p=o(l);!p&&t.allowNotFoundAliases||e.report({node:i,messageId:p?"noRelativeImportsWithAlias":"noRelativeImports",data:{alias:p?.alias},fix:p?m=>m.replaceText(i.source,`'${p.newPath}'`):void 0})}}}}),un={name:Wr,rule:Eo};var Se=require("@typescript-eslint/utils"),fn=require("zod/v4");var ho=fn.z.object({customMessage:fn.z.string().optional()}),mn=z({name:"no-static-style-prop",meta:{type:"problem",docs:{description:"Prevent using static style props in JSX, only dynamic values should be allowed"},schema:[U(ho)],messages:{noStaticStyleProp:"Static style props are not allowed use css instead.{{customMessage}}"}},defaultOptions:[{}],create(e,[t]){function n(r){switch(r.type){case Se.AST_NODE_TYPES.Literal:return!0;case Se.AST_NODE_TYPES.ObjectExpression:return r.properties.every(s=>s.type===Se.AST_NODE_TYPES.Property?s.computed||s.value.type===Se.AST_NODE_TYPES.Identifier&&s.key.type===Se.AST_NODE_TYPES.Identifier&&s.key.name===s.value.name?!1:n(s.value):!1);case Se.AST_NODE_TYPES.ArrayExpression:return r.elements.every(s=>s?s.type===Se.AST_NODE_TYPES.SpreadElement?!1:n(s):!0);case Se.AST_NODE_TYPES.TemplateLiteral:return r.expressions.length===0;case Se.AST_NODE_TYPES.ConditionalExpression:case Se.AST_NODE_TYPES.LogicalExpression:case Se.AST_NODE_TYPES.BinaryExpression:case Se.AST_NODE_TYPES.UnaryExpression:case Se.AST_NODE_TYPES.CallExpression:case Se.AST_NODE_TYPES.MemberExpression:case Se.AST_NODE_TYPES.Identifier:case Se.AST_NODE_TYPES.ArrowFunctionExpression:case Se.AST_NODE_TYPES.FunctionExpression:return!1;default:return!1}}return{JSXAttribute(r){if(r.name.type===Se.AST_NODE_TYPES.JSXIdentifier&&r.name.name==="style"&&r.value){let s=null;r.value.type===Se.AST_NODE_TYPES.JSXExpressionContainer?r.value.expression.type!==Se.AST_NODE_TYPES.JSXEmptyExpression&&(s=r.value.expression):r.value.type===Se.AST_NODE_TYPES.Literal&&(s=r.value),s&&n(s)&&e.report({node:r,messageId:"noStaticStyleProp",data:{customMessage:t.customMessage?` ${t.customMessage}`:""}})}}}}});var xt=require("@typescript-eslint/utils"),ot=Re(require("zod/v4"));var bo=ot.object({alternativeMsgs:ot.object({inArrayFind:ot.string().optional(),inArrayFilter:ot.string().optional()}).optional(),__dev_simulateFileName:ot.string().optional()});function xo(e){return e.typeAnnotation.type!==xt.AST_NODE_TYPES.TSTypePredicate?!1:e.typeAnnotation.asserts===!1}var Co=/(typeGuards|type-guards)\.(ts|tsx)$/;function Io(e){return Co.test(e)}function Ao(e){let t=e.parent;for(;t;){if(t.type===xt.AST_NODE_TYPES.CallExpression&&t.callee.type===xt.AST_NODE_TYPES.MemberExpression&&t.callee.property.type===xt.AST_NODE_TYPES.Identifier){let n=t.callee.property.name;if(n==="filter"||n==="find")return{method:n}}t=t.parent}return null}var yn=z({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:[U(bo)],hasSuggestions:!0},defaultOptions:[{}],create(e,[t]){let n=t.__dev_simulateFileName??e.filename;if(Io(n))return{};function r(s){if(!xo(s))return;let o=Ao(s);if(t.alternativeMsgs&&o){let i=o.method==="filter"?t.alternativeMsgs.inArrayFilter:t.alternativeMsgs.inArrayFind;if(i){let a=o.method==="filter"?"useFilterWithTypeCheck":"useFindWithTypeCheck";e.report({node:s,messageId:a,data:{message:i}});return}}e.report({node:s,messageId:"typeGuardNotAllowed"})}return{"FunctionDeclaration > :matches(TSTypeAnnotation)":r,"ArrowFunctionExpression > :matches(TSTypeAnnotation)":r,"MethodDefinition > FunctionExpression > :matches(TSTypeAnnotation)":r}}});var at=require("@typescript-eslint/utils");var wo="no-unnecessary-async-on-jsx-props";function Fo(e){if(e.body.type!==at.AST_NODE_TYPES.BlockStatement)return!1;let t=e.body.body;if(t.length!==1)return!1;let n=t[0];return!n||n.type!==at.AST_NODE_TYPES.ExpressionStatement?!1:n.expression.type===at.AST_NODE_TYPES.AwaitExpression}var dn=z({name:wo,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(n){Fo(n)&&e.report({node:n,messageId:"unnecessaryAsyncInJsxProp",fix(r){let s=e.sourceCode,o=[],i=s.getFirstToken(n,l=>l.value==="async");if(i){let l=s.getTokenAfter(i);l?o.push(r.replaceTextRange([i.range[0],l.range[0]],"")):o.push(r.remove(i))}function a(l){if(l.type===at.AST_NODE_TYPES.AwaitExpression){let p=s.getFirstToken(l);if(p&&p.value==="await"){let m=s.getTokenAfter(p);m?o.push(r.replaceTextRange([p.range[0],m.range[0]],"")):o.push(r.remove(p))}}if(l.type===at.AST_NODE_TYPES.BlockStatement)for(let p of l.body)a(p);else l.type===at.AST_NODE_TYPES.ExpressionStatement&&a(l.expression)}return a(n.body),o}})}return{"JSXAttribute ArrowFunctionExpression[async=true]":t,"JSXAttribute FunctionExpression[async=true]":t}}});var Ye=require("@typescript-eslint/utils"),gn=Re(require("typescript")),ft=Re(require("zod/v4"));var vo=Ye.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),Jr="no-unnecessary-casting",Ro=ft.default.object({additionalCastFunctions:ft.default.array(ft.default.object({name:ft.default.string(),expectedType:ft.default.enum(["string","number"])})).optional()}),Sn={name:Jr,rule:vo({name:Jr,meta:{type:"suggestion",docs:{description:"Prevents unnecessary Number and String castings"},deprecated:{message:"Use the strict-casting rule instead"},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:[U(Ro)],fixable:"code"},defaultOptions:[{}],create(e){let n=e.options[0].additionalCastFunctions||[],r=[{name:"Number",expectedType:"number"},{name:"String",expectedType:"string"},...n],s=Ye.ESLintUtils.getParserServices(e,!0),o=s.program?.getTypeChecker();if(!o||!s.program)throw new Error("TypeScript services or program not available");function i(m,y){switch(m.type){case Ye.AST_NODE_TYPES.Literal:return y==="number"?typeof m.value=="number":typeof m.value=="string";case Ye.AST_NODE_TYPES.TemplateLiteral:return y==="string";case Ye.AST_NODE_TYPES.UnaryExpression:return y==="number"?m.operator==="+"||m.operator==="-"||m.operator==="~":!1;default:return!1}}function a(m,y){return y==="number"?!!(m.flags&gn.TypeFlags.NumberLike):!!(m.flags&gn.TypeFlags.StringLike)}function l(m,y){return u=>u.replaceText(m,e.sourceCode.getText(y))}function p(m){if(!o||m.arguments.length!==1)return;let y=m.arguments[0];if(!y||y.type===Ye.AST_NODE_TYPES.SpreadElement)return;let{callee:u}=m;if(u.type!==Ye.AST_NODE_TYPES.Identifier)return;let d=u.name,c=r.find(h=>h.name===d);if(!c)return;if(i(y,c.expectedType)||a(o.getTypeAtLocation(s.esTreeNodeToTSNodeMap.get(y)),c.expectedType)){let h,S;d==="Number"?h="unnecessaryNumberCasting":d==="String"?h="unnecessaryStringCasting":(h="unnecessaryCustomCasting",S={name:c.name,type:c.expectedType}),e.report({node:m,messageId:h,...S?{data:S}:{},fix:l(m,y)})}}return{CallExpression:p}}})};var Ne=require("@typescript-eslint/utils"),Ot=Re(require("zod/v4"));var No=Ot.object({ignoreWithDescription:Ot.string().optional()}),Tn=z({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:[U(No)]},defaultOptions:[{}],create(e,[t]){let n=e.getSourceCode(),r=n.ast;function s(l){let p=l.arguments[0];return p&&p.type===Ne.AST_NODE_TYPES.Literal&&typeof p.value=="string"?p.value:null}function o(l){return!l||!t.ignoreWithDescription?!1:new RegExp(t.ignoreWithDescription).test(l)}function i(l){return l.length!==1?!1:r.body.filter(m=>{if(m.type===Ne.AST_NODE_TYPES.ExpressionStatement){let y=m.expression;if(y.type===Ne.AST_NODE_TYPES.CallExpression&&y.callee.type===Ne.AST_NODE_TYPES.Identifier){let u=y.callee.name;return["test","it","beforeEach","afterEach","beforeAll","afterAll"].includes(u)}}return!1}).length===0}function a(l){let p=l.arguments[1];if(p&&(p.type===Ne.AST_NODE_TYPES.FunctionExpression||p.type===Ne.AST_NODE_TYPES.ArrowFunctionExpression)&&p.body.type===Ne.AST_NODE_TYPES.BlockStatement){let m=p.body.body;return m.length===0?"":m.map(u=>n.text.slice(u.range[0],u.range[1])).join(`
15
+ Learn more about data fetching with Hooks: https://reactjs.org/link/hooks-data-fetching`});let w=l.acquire(I),N=new Set,k=null;{let v=w.upper;for(;v&&(N.add(v),v.type!=="function");)v=v.upper;if(!v)return;k=v}let O=Array.isArray;function f(v){if(!O(v.defs))return!1;let L=v.defs[0];if(L==null||L.node.type!=="VariableDeclarator")return!1;let J=L.node.init;if(J==null)return!1;for(;J.type==="TSAsExpression";)J=J.expression;let X=L.node.parent;if(X==null&&(Gt(k.block,L.node.id),X=L.node.parent,X==null))return!1;if(X.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 Y=J.callee;if(Y.type==="MemberExpression"&&Y.object.name==="React"&&Y.property!=null&&!Y.computed&&(Y=Y.property),Y.type!=="Identifier")return!1;let W=L.node.id,{name:G}=Y;if(G==="useRef"&&W.type==="Identifier")return!0;if(fs(Y)&&W.type==="Identifier"){for(let Q of v.references)Q!==W&&d.add(Q.identifier);return!0}else if(G==="useState"||G==="useReducer"){if(W.type==="ArrayPattern"&&W.elements.length===2&&O(v.identifiers)){if(W.elements[1]===v.identifiers[0]){if(G==="useState"){let Q=v.references,ve=0;for(let Xe=0;Xe<Q.length;Xe++){if(Q[Xe].isWrite()&&ve++,ve>1)return!1;p.set(Q[Xe].identifier,W.elements[0])}}return!0}else if(W.elements[0]===v.identifiers[0]){if(G==="useState"){let Q=v.references;for(let ve=0;ve<Q.length;ve++)m.add(Q[ve].identifier)}return!1}}}else if(G==="useTransition"&&W.type==="ArrayPattern"&&W.elements.length===2&&Array.isArray(v.identifiers)&&W.elements[1]===v.identifiers[0])return!0;return!1}function x(v){if(!O(v.defs))return!1;let L=v.defs[0];if(L==null||L.node==null||L.node.id==null)return!1;let J=L.node,X=k.childScopes,Y=null,W;for(W=0;W<X.length;W++){let G=X[W],Q=G.block;if(J.type==="FunctionDeclaration"&&Q===J||J.type==="VariableDeclarator"&&Q.parent===J){Y=G;break}}if(Y==null)return!1;for(W=0;W<Y.through.length;W++){let G=Y.through[W];if(G.resolved!=null&&N.has(G.resolved.scope)&&!E(G.resolved))return!1}return!0}let E=c(f,y),F=c(x,u),R=new Map;function M(v){let L=v.from,J=!1;for(;L.block!==I;)L.type==="function"&&(J=L.block.parent!=null&&L.block.parent.type==="ReturnStatement"),L=L.upper;return J}let P=new Map,ee=new Map;Z(w);function Z(v){for(let L of v.references){if(!L.resolved||!N.has(L.resolved.scope))continue;let J=Gt(I,L.identifier),X=Ir(J),Y=Be(X,ee);if(C&&X.type==="Identifier"&&(X.parent.type==="MemberExpression"||X.parent.type==="OptionalMemberExpression")&&!X.parent.computed&&X.parent.property.type==="Identifier"&&X.parent.property.name==="current"&&M(L)&&R.set(Y,{reference:L,dependencyNode:X}),X.parent.type==="TSTypeQuery"||X.parent.type==="TSTypeReference")continue;let W=L.resolved.defs[0];if(W!=null&&!(W.node!=null&&W.node.init===I.parent)&&W.type!=="TypeParameter")if(P.has(Y))P.get(Y).references.push(L);else{let G=L.resolved,Q=E(G)||F(G);P.set(Y,{isStable:Q,references:[L]})}}for(let L of v.childScopes)Z(L)}R.forEach(({reference:v,dependencyNode:L},J)=>{let X=v.resolved.references,Y=!1;for(let W=0;W<X.length;W++){let{identifier:G}=X[W],{parent:Q}=G;if(Q!=null&&Q.type==="MemberExpression"&&!Q.computed&&Q.property.type==="Identifier"&&Q.property.name==="current"&&Q.parent.type==="AssignmentExpression"&&Q.parent.left===Q){Y=!0;break}}Y||a({node:L.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 D=new Set;function q(v,L){D.has(L)||(D.add(L),a({node:v,message:`Assignments to the '${L}' variable from inside React Hook ${n(T)} 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 ${n(T)}.`}))}let B=new Set;if(P.forEach(({isStable:v,references:L},J)=>{v&&B.add(J),L.forEach(X=>{X.writeExpr&&q(X.writeExpr,J)})}),D.size>0)return;if(!A){let v=null;if(P.forEach(({isStable:L,references:J},X)=>{v||J.forEach(Y=>{if(v)return;let W=Y.identifier;if(!p.has(W))return;let Q=Y.from;for(;Q.type!=="function";)Q=Q.upper;Q.block===I&&(v=X)})}),v){let{suggestedDependencies:L}=qt({dependencies:P,declaredDependencies:[],stableDependencies:B,externalDependencies:new Set,isEffect:!0});a({node:T,message:`React Hook ${b} contains a call to '${v}'. Without a list of dependencies, this can lead to an infinite chain of updates. To fix this, pass [`+L.join(", ")+`] as a second argument to the ${b} Hook.`,suggest:[{desc:`Add dependencies array: [${L.join(", ")}]`,fix(J){return J.insertTextAfter(I,`, [${L.join(", ")}]`)}}]})}return}let ue=[],me=new Set;A.type!=="ArrayExpression"?a({node:A,message:`React Hook ${n(T)} 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.`}):A.elements.forEach(v=>{if(v===null)return;if(v.type==="SpreadElement"){a({node:v,message:`React Hook ${n(T)} has a spread element in its dependency array. This means we can't statically verify whether you've passed the correct dependencies.`});return}d.has(v)&&a({node:v,message:`Functions returned from \`useEffectEvent\` must not be included in the dependency array. Remove \`${n(v)}\` from the list.`,suggest:[{desc:`Remove the dependency \`${n(v)}\``,fix(Y){return Y.removeRange(v.range)}}]});let L;try{L=Be(v,ee)}catch(Y){if(/Unsupported node type/.test(Y.message)){v.type==="Literal"?P.has(v.value)?a({node:v,message:`The ${v.raw} literal is not a valid dependency because it never changes. Did you mean to include ${v.value} in the array instead?`}):a({node:v,message:`The ${v.raw} literal is not a valid dependency because it never changes. You can safely remove it.`}):a({node:v,message:`React Hook ${n(T)} has a complex expression in the dependency array. Extract it to a separate variable so it can be statically checked.`});return}else throw Y}let J=v;for(;J.type==="MemberExpression"||J.type==="OptionalMemberExpression"||J.type==="ChainExpression";)J=J.object||J.expression.object;let X=!k.through.some(Y=>Y.identifier===J);ue.push({key:L,node:v}),X||me.add(L)});let{suggestedDependencies:Oe,unnecessaryDependencies:Ze,missingDependencies:he,duplicateDependencies:Et}=qt({dependencies:P,declaredDependencies:ue,stableDependencies:B,externalDependencies:me,isEffect:C}),pt=Oe;if(Et.size+he.size+Ze.size===0){let v=br(T),L=v&&hr(v);if(t&&!L)return;ls({declaredDependencies:ue,declaredDependenciesNode:A,componentScope:k,scope:w}).forEach(({construction:X,isUsedOutsideOfHook:Y,depType:W})=>{let G=W==="function"?"useCallback":"useMemo",Q=W==="function"?"definition":"initialization",ve=`wrap the ${Q} of '${X.name.name}' in its own ${G}() Hook.`,Xe=Y?`To fix this, ${ve}`:`Move it inside the ${b} callback. Alternatively, ${ve}`,Wi=W==="conditional"||W==="logical expression"?"could make":"makes",Ji=`The '${X.name.name}' ${W} ${Wi} the dependencies of ${b} Hook (at line ${A.loc.start.line}) change on every render. ${Xe}`,ur;Y&&X.type==="Variable"&&W==="function"&&(ur=[{desc:`Wrap the ${Q} of '${X.name.name}' in its own ${G}() Hook.`,fix(fr){let[Xi,Bi]=G==="useMemo"?["useMemo(() => { return ","; })"]:["useCallback(",")"];return[fr.insertTextBefore(X.node.init,Xi),fr.insertTextAfter(X.node.init,Bi)]}}]),a({node:X.node,message:Ji,suggest:ur})});return}!C&&he.size>0&&(pt=qt({dependencies:P,declaredDependencies:[],stableDependencies:B,externalDependencies:me,isEffect:C}).suggestedDependencies);function Ce(){if(ue.length===0)return!0;let v=ue.map(J=>J.key),L=v.slice().sort();return v.join(",")===L.join(",")}Ce()&&pt.sort();function we(v){let L=v.split("."),J="";for(let X=0;X<L.length;X++){if(X!==0){let Y=L.slice(0,X+1).join("."),W=ee.get(Y)===!0;J+=W?"?.":"."}J+=L[X]}return J}function Xt(v,L,J,X){return v.size===0?null:(v.size>1?"":L+" ")+J+" "+(v.size>1?"dependencies":"dependency")+": "+cs(Array.from(v).sort().map(Y=>"'"+we(Y)+"'"))+`. Either ${X} ${v.size>1?"them":"it"} or remove the dependency array.`}let $e="";if(Ze.size>0){let v=null;if(Array.from(Ze.keys()).forEach(L=>{v===null&&L.endsWith(".current")&&(v=L)}),v!==null)$e=` Mutable values like '${v}' aren't valid dependencies because mutating them doesn't re-render the component.`;else if(me.size>0){let L=Array.from(me)[0];w.set.has(L)||($e=` Outer scope values like '${L}' aren't valid dependencies because mutating them doesn't re-render the component.`)}}if(!$e&&he.has("props")){let v=P.get("props");if(v==null)return;let L=v.references;if(!Array.isArray(L))return;let J=!0;for(let X=0;X<L.length;X++){let Y=L[X],W=Gt(k.block,Y.identifier);if(!W){J=!1;break}let G=W.parent;if(G==null){J=!1;break}if(G.type!=="MemberExpression"&&G.type!=="OptionalMemberExpression"){J=!1;break}}J&&($e=` However, 'props' will change when *any* prop changes, so the preferred fix is to destructure the 'props' object outside of the ${b} call and refer to those specific props inside ${n(T)}.`)}if(!$e&&he.size>0){let v=null;he.forEach(L=>{if(v)return;let J=k.set.get(L),X=P.get(L);if(X.references[0].resolved!==J)return;let Y=J.defs[0];if(Y==null||Y.name==null||Y.type!=="Parameter")return;let W=!1,G;for(let Q=0;Q<X.references.length;Q++)if(G=X.references[Q].identifier,G!=null&&G.parent!=null&&(G.parent.type==="CallExpression"||G.parent.type==="OptionalCallExpression")&&G.parent.callee===G){W=!0;break}W&&(v=L)}),v!==null&&($e=` If '${v}' changes too often, find the parent component that defines it and wrap that definition in useCallback.`)}if(!$e&&he.size>0){let v=null;if(he.forEach(L=>{if(v!==null)return;let X=P.get(L).references,Y,W;for(let G=0;G<X.length;G++){for(Y=X[G].identifier,W=Y.parent;W!=null&&W!==k.block;){if(W.type==="CallExpression"){let Q=p.get(W.callee);if(Q!=null){if(Q.name===L)v={missingDep:L,setter:W.callee.name,form:"updater"};else if(m.has(Y))v={missingDep:L,setter:W.callee.name,form:"reducer"};else{let ve=X[G].resolved;if(ve!=null){let Xe=ve.defs[0];Xe!=null&&Xe.type==="Parameter"&&(v={missingDep:L,setter:W.callee.name,form:"inlineReducer"})}}break}}W=W.parent}if(v!==null)break}}),v!==null)switch(v.form){case"reducer":$e=` You can also replace multiple useState variables with useReducer if '${v.setter}' needs the current value of '${v.missingDep}'.`;break;case"inlineReducer":$e=` If '${v.setter}' needs the current value of '${v.missingDep}', you can also switch to useReducer instead of useState and read '${v.missingDep}' in the reducer.`;break;case"updater":$e=` You can also do a functional update '${v.setter}(${v.missingDep.slice(0,1)} => ...)' if you only need '${v.missingDep}' in the '${v.setter}' call.`;break;default:throw new Error("Unknown case.")}}a({node:A,message:`React Hook ${n(T)} has `+(Xt(he,"a","missing","include")||Xt(Ze,"an","unnecessary","exclude")||Xt(Et,"a","duplicate","omit"))+$e,suggest:[{desc:`Update the dependencies array to be: [${pt.map(we).join(", ")}]`,fix(v){return v.replaceText(A,`[${pt.map(we).join(", ")}]`)}}]})}function h(I){let A=ps(I.callee,i);if(A===-1)return;let T=I.arguments[A],b=I.callee,C=Ar(b).name,w=I.arguments[A+1],N=/Effect($|[^a-z])/g.test(C);if(!T){a({node:b,message:`React Hook ${C} requires an effect callback. Did you forget to pass a callback to the hook?`});return}if(t&&!N){let k=br(b);if(!(k&&hr(k)))return}if(!w&&!N){(C==="useMemo"||C==="useCallback")&&a({node:b,message:`React Hook ${C} does nothing when called with only one argument. Did you forget to pass an array of dependencies?`});return}switch(T.type){case"FunctionExpression":case"ArrowFunctionExpression":g(T,w,b,C,N);return;case"Identifier":if(!w||w.elements&&w.elements.some(f=>f&&f.type==="Identifier"&&f.name===T.name))return;let k=r(I).set.get(T.name);if(k==null||k.defs==null)return;let O=k.defs[0];if(!O||!O.node||O.type!=="Variable"&&O.type!=="FunctionName")break;switch(O.node.type){case"FunctionDeclaration":g(O.node,w,b,C,N);return;case"VariableDeclarator":let f=O.node.init;if(!f)break;switch(f.type){case"ArrowFunctionExpression":case"FunctionExpression":g(f,w,b,C,N);return}break}break;default:a({node:b,message:`React Hook ${C} received a function whose dependencies are unknown. Pass an inline function instead.`});return}a({node:b,message:`React Hook ${C} has a missing dependency: '${T.name}'. Either include it or remove the dependency array.`,suggest:[{desc:`Update the dependencies array to be: [${T.name}]`,fix(k){return k.replaceText(w,`[${T.name}]`)}}]})}if(!!e.options[0]?.reactCompilerIsEnabled)return t=!0,{CallExpression:I=>h(I)};if(e.options[0]?.ignoreIfReactCompilerIsEnabled){for(let I of e.sourceCode.getAllComments())if(as.test(I.value))return t=!0,{CallExpression:A=>h(A)}}return{CallExpression:I=>h(I)}}};function qt({dependencies:e,declaredDependencies:t,stableDependencies:n,externalDependencies:r,isEffect:s}){let o=i();function i(){return{isUsed:!1,isSatisfiedRecursively:!1,isSubtreeUsed:!1,children:new Map}}e.forEach((g,h)=>{let S=a(o,h);S.isUsed=!0,l(o,h,I=>{I.isSubtreeUsed=!0})}),t.forEach(({key:g})=>{let h=a(o,g);h.isSatisfiedRecursively=!0}),n.forEach(g=>{let h=a(o,g);h.isSatisfiedRecursively=!0});function a(g,h){let S=h.split("."),I=g;for(let A of S){let T=I.children.get(A);T||(T=i(),I.children.set(A,T)),I=T}return I}function l(g,h,S){let I=h.split("."),A=g;for(let T of I){let b=A.children.get(T);if(!b)return;S(b),A=b}}let p=new Set,m=new Set;y(o,p,m,g=>g);function y(g,h,S,I){g.children.forEach((A,T)=>{let b=I(T);if(A.isSatisfiedRecursively){A.isSubtreeUsed&&S.add(b);return}if(A.isUsed){h.add(b);return}y(A,h,S,C=>b+"."+C)})}let u=[],d=new Set,c=new Set;return t.forEach(({key:g})=>{m.has(g)?u.indexOf(g)===-1?u.push(g):c.add(g):d.add(g)}),p.forEach(g=>{u.push(g)}),{suggestedDependencies:u,unnecessaryDependencies:d,duplicateDependencies:c,missingDependencies:p}}function Ke(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 Ke(e.consequent)!=null||Ke(e.alternate)!=null?"conditional":null;case"LogicalExpression":return Ke(e.left)!=null||Ke(e.right)!=null?"logical expression":null;case"JSXFragment":return"JSX fragment";case"JSXElement":return"JSX element";case"AssignmentExpression":return Ke(e.right)!=null?"assignment expression":null;case"NewExpression":return"object construction";case"Literal":return e.value instanceof RegExp?"regular expression":null;case"TypeCastExpression":return Ke(e.expression);case"TSAsExpression":return Ke(e.expression)}return null}function ls({declaredDependencies:e,declaredDependenciesNode:t,componentScope:n,scope:r}){let s=e.map(({key:i})=>{let a=n.variables.find(p=>p.name===i);if(a==null)return null;let l=a.defs[0];if(l==null)return null;if(l.type==="Variable"&&l.node.type==="VariableDeclarator"&&l.node.id.type==="Identifier"&&l.node.init!=null){let p=Ke(l.node.init);if(p!=null)return[a,p]}return l.type==="FunctionName"&&l.node.type==="FunctionDeclaration"?[a,"function"]:l.type==="ClassName"&&l.node.type==="ClassDeclaration"?[a,"class"]:null}).filter(Boolean);function o(i){let a=!1;for(let l=0;l<i.references.length;l++){let p=i.references[l];if(p.writeExpr){if(a)return!0;a=!0;continue}let m=p.from;for(;m!==r&&m!=null;)m=m.upper;if(m!==r&&!wr(t,p.identifier))return!0}return!1}return s.map(([i,a])=>({construction:i.defs[0],depType:a,isUsedOutsideOfHook:o(i)}))}function Ir(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)?Ir(e.parent):e.type==="MemberExpression"&&e.parent&&e.parent.type==="AssignmentExpression"&&e.parent.left===e?e.object:e}function Zt(e,t,n){t&&(e.optional?t.has(n)||t.set(n,!0):t.has(n)||t.set(n,!1))}function Be(e,t){if(e.type==="Identifier"||e.type==="JSXIdentifier"){let n=e.name;return t&&t.set(n,!1),n}else if(e.type==="MemberExpression"&&!e.computed){let n=Be(e.object,t),r=Be(e.property,null),s=`${n}.${r}`;return Zt(e,t,s),s}else if(e.type==="OptionalMemberExpression"&&!e.computed){let n=Be(e.object,t),r=Be(e.property,null),s=`${n}.${r}`;return Zt(e,t,s),s}else if(e.type==="ChainExpression"&&!e.computed){let n=e.expression;if(n.type==="CallExpression")throw new Error(`Unsupported node type: ${n.type}`);let r=Be(n.object,t),s=Be(n.property,null),o=`${r}.${s}`;return Zt(n,t,o),o}else throw new Error(`Unsupported node type: ${e.type}`)}function Ar(e,t){return e.type==="MemberExpression"&&e.object.type==="Identifier"&&e.object.name==="React"&&e.property.type==="Identifier"&&!e.computed?e.property:e}function ps(e,t){let n=Ar(e);if(n.type!=="Identifier")return-1;switch(n.name){case"useEffect":case"useLayoutEffect":case"useCallback":case"useMemo":return 0;case"useImperativeHandle":return 1;default:if(n===e&&t&&t.additionalHooks){let r;try{r=Be(n,null)}catch(s){if(/Unsupported node type/.test(s.message))return 0;throw s}return t.additionalHooks.test(r)?0:-1}else return-1}}function Gt(e,t){let n=[e],r=null;for(;n.length;){if(r=n.shift(),us(r,t))return r;if(wr(r,t))for(let[s,o]of Object.entries(r))s!=="parent"&&(xr(o)?(o.parent=r,n.push(o)):Array.isArray(o)&&o.forEach(i=>{xr(i)&&(i.parent=r,n.push(i))}))}return null}function cs(e){let t="";for(let n=0;n<e.length;n++)t+=e[n],n===0&&e.length===2?t+=" and ":n===e.length-2&&e.length>2?t+=", and ":n<e.length-1&&(t+=", ");return t}function xr(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&typeof e.type=="string"}function us(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 wr(e,t){return e.range[0]<=t.range[0]&&e.range[1]>=t.range[1]}function fs(e){return!1}var le=require("@typescript-eslint/utils"),H=Re(require("typescript")),tn=require("zod/v4");var Kt=require("@typescript-eslint/utils");function ct(e,t,n=1/0){if(n!==0&&e.parent)return e.type===t?e:ct(e.parent,t,n===1/0?n:n-1)}function*Qt(e){yield e,e.parent&&(yield*Qt(e.parent))}function en(e,t){for(let n of e){let r=t(n);if(r!=null&&r!==!1)return r}}function vr(e,t,n){let s=n.getDeclaredVariables(e).find(o=>o.name===t||o.identifiers[0]?.parent.type===Kt.AST_NODE_TYPES.Property&&o.identifiers[0].parent.key.type===Kt.AST_NODE_TYPES.Identifier&&o.identifiers[0].parent.key.name===t);return s?s.references.filter(o=>!o.init):[]}function Fr(e){return e===null||typeof e!="object"||!("type"in e)?!1:typeof e.type=="string"}function ms(e,t){return e[t]}function _e(e,t,n){let r=n.visitorKeys,s=new Set;function o(i){if(s.has(i))return!1;if(s.add(i),t(i)===!0)return!0;let l=r[i.type];if(l)for(let p of l){let m=ms(i,p);if(m){if(Array.isArray(m)){for(let y of m)if(Fr(y)&&o(y))return!0}else if(Fr(m)&&o(m))return!0}}return!1}o(e)}var ys=le.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),Rr="improved-no-unnecessary-condition",ds=tn.z.object({alternativeForInCondition:tn.z.string().optional().describe("Alternative to appear in the error for `in` condition")}),Nr={object:"Array",property:"isArray"},gs=["string","number","bigint","boolean","symbol","undefined","object","function","never"],Ss=new Set(gs),nn={name:Rr,rule:ys({name:Rr,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.",unnecessaryArrayIsArrayCondition:"This Array.isArray check is unnecessary as it always evaluates to true.",alwaysFalseArrayIsArrayCondition:"This Array.isArray 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.",unnecessaryInCondition:'This in check is unnecessary. Property "{{property}}" always exists on type "{{type}}".{{alternative}}',alwaysFalseInCondition:'This in check will always be false. Property "{{property}}" does not exist on type "{{type}}".{{alternative}}'},schema:[U(ds)]},defaultOptions:[{}],create(e,[t]){let n=le.ESLintUtils.getParserServices(e,!0),r=n.program?.getTypeChecker();if(!r||!n.program)throw new Error("TypeScript services or program not available");function s(f){return f.type===le.AST_NODE_TYPES.UnaryExpression&&f.operator==="typeof"}function o(f){return f.flags&H.default.TypeFlags.Any||f.flags&H.default.TypeFlags.Unknown?null:f.flags&H.default.TypeFlags.StringLike?["string"]:f.flags&H.default.TypeFlags.NumberLike?["number"]:f.flags&H.default.TypeFlags.BigIntLike?["bigint"]:f.flags&H.default.TypeFlags.BooleanLike?["boolean"]:f.flags&H.default.TypeFlags.ESSymbolLike?["symbol"]:f.flags&H.default.TypeFlags.Undefined||f.flags&H.default.TypeFlags.Void?["undefined"]:f.flags&H.default.TypeFlags.Null?["object"]:f.getCallSignatures().length>0?["function"]:f.flags&H.default.TypeFlags.Object?f.getProperties().length===0?["string","number","bigint","boolean","symbol","object","function"]:["object"]:f.flags&H.default.TypeFlags.NonPrimitive?["object"]:f.flags&H.default.TypeFlags.Never?["never"]:null}function i(f){if(!r)return null;let x=n.esTreeNodeToTSNodeMap.get(f),E=r.getTypeAtLocation(x.expression);if(E.flags&H.default.TypeFlags.Any||E.flags&H.default.TypeFlags.Unknown)return null;let F=[];if(E.isUnion()){for(let M of E.types){let P=o(M);if(P)F.push(...P);else return null}return F}let R=o(E);return R?(F.push(...R),F):null}function a(f){if(!(f.operator==="==="||f.operator==="!=="))return;let E=null,F=null;if(s(f.left)?(E=f.left,F=f.right.type===le.AST_NODE_TYPES.Literal&&typeof f.right.value=="string"?f.right.value:null):s(f.right)&&(E=f.right,F=f.left.type===le.AST_NODE_TYPES.Literal&&typeof f.left.value=="string"?f.left.value:null),!E||!F||!Ts(F,Ss))return;let R=i(E);if(!R)return;let M=f.operator==="!==",P=R.includes(F);R.length===1?P&&!M?e.report({node:f,messageId:"unnecessaryTypeofCondition",data:{name:ut(E,e),type:F}}):!P&&M?e.report({node:f,messageId:"unnecessaryTypeofCondition",data:{name:ut(E,e),type:Array.from(R)[0]}}):!P&&!M?e.report({node:f,messageId:"alwaysFalseTypeofCondition",data:{name:ut(E,e),actualType:vt(R),conditionType:F}}):P&&M&&e.report({node:f,messageId:"alwaysFalseTypeofCondition",data:{name:ut(E,e),actualType:vt(R),conditionType:F}}):!P&&!M?e.report({node:f,messageId:"alwaysFalseTypeofCondition",data:{name:ut(E,e),actualType:vt(R),conditionType:F}}):!P&&M&&e.report({node:f,messageId:"unnecessaryTypeofCondition",data:{name:ut(E,e),type:vt(R)}})}function l(f){if(f.flags&H.default.TypeFlags.Any||f.flags&H.default.TypeFlags.Unknown)return null;if(f.isUnion()){let x=[];for(let E of f.types)if(E.flags&H.default.TypeFlags.StringLiteral){let F=E.value;x.push(F)}else return null;return x}return f.flags&H.default.TypeFlags.StringLiteral?[f.value]:null}function p(f){if(!r)return null;let x=n.esTreeNodeToTSNodeMap.get(f),E=r.getTypeAtLocation(x),F=l(E);if(F)return F;let R=r.getSymbolAtLocation(x);if(R){let M=r.getTypeOfSymbolAtLocation(R,x),P=l(M);if(P)return P}return null}function m(f){let x=e.sourceCode.ast,E=null;return _e(x,F=>{if(F.type===le.AST_NODE_TYPES.VariableDeclarator&&F.id.type===le.AST_NODE_TYPES.Identifier&&F.id.name===f.name&&F.id.typeAnnotation){let R=F.id.typeAnnotation.typeAnnotation;if(R.type===le.AST_NODE_TYPES.TSUnionType){let M=[];for(let P of R.types)if(P.type===le.AST_NODE_TYPES.TSLiteralType&&P.literal.type===le.AST_NODE_TYPES.Literal&&typeof P.literal.value=="string")M.push(P.literal.value);else return!0;return E=M,!0}if(R.type===le.AST_NODE_TYPES.TSLiteralType&&R.literal.type===le.AST_NODE_TYPES.Literal&&typeof R.literal.value=="string")return E=[R.literal.value],!0}return!1},e.sourceCode),E}function y(f){return f==="Array"||f==="ReadonlyArray"?!0:f.endsWith(".Array")||f.endsWith(".ReadonlyArray")}function u(f){if(!r)return!1;if(r.isArrayType(f)||r.isTupleType(f))return!0;let x=r.getApparentType(f);if(x!==f&&(r.isArrayType(x)||r.isTupleType(x)))return!0;if(f.aliasSymbol){let F=r.getFullyQualifiedName(f.aliasSymbol);if(y(F))return!0}let E=f.getSymbol();if(E){let F=r.getFullyQualifiedName(E);if(y(F))return!0}return!1}function d(f){return r?f.getProperties().length===0&&r.getIndexInfosOfType(f).length===0&&f.getCallSignatures().length===0&&f.getConstructSignatures().length===0:!1}function c(f){return r?!!(f.flags&H.default.TypeFlags.StringLike||f.flags&H.default.TypeFlags.NumberLike||f.flags&H.default.TypeFlags.BigIntLike||f.flags&H.default.TypeFlags.BooleanLike||f.flags&H.default.TypeFlags.ESSymbolLike||f.flags&H.default.TypeFlags.EnumLike||f.flags&H.default.TypeFlags.Null||f.flags&H.default.TypeFlags.Undefined||f.flags&H.default.TypeFlags.Void||f.flags&H.default.TypeFlags.Never||f.flags&H.default.TypeFlags.Object&&!f.isClassOrInterface()&&!u(f)&&!d(f)):!1}function g(f){if(f.flags&H.default.TypeFlags.Any||f.flags&H.default.TypeFlags.Unknown)return"unknown";if(f.isUnion()){let x=!0,E=!0;for(let F of f.types){let R=g(F);if(R==="unknown")return"unknown";R!=="alwaysTrue"&&(x=!1),R!=="alwaysFalse"&&(E=!1)}return x?"alwaysTrue":E?"alwaysFalse":"unknown"}return u(f)?"alwaysTrue":c(f)?"alwaysFalse":"unknown"}function h(f){return!f.computed&&f.object.type===le.AST_NODE_TYPES.Identifier&&f.object.name===Nr.object&&f.property.type===le.AST_NODE_TYPES.Identifier&&f.property.name===Nr.property}function S(f){if(!r||f.callee.type!==le.AST_NODE_TYPES.MemberExpression||!h(f.callee)||f.arguments.length===0)return;let[x]=f.arguments;if(!x||x.type===le.AST_NODE_TYPES.SpreadElement)return;let E=n.esTreeNodeToTSNodeMap.get(x),F=r.getTypeAtLocation(E),R=g(F);R==="alwaysTrue"?e.report({node:f,messageId:"unnecessaryArrayIsArrayCondition"}):R==="alwaysFalse"&&e.report({node:f,messageId:"alwaysFalseArrayIsArrayCondition"})}function I(f){if(f.callee.type!==le.AST_NODE_TYPES.MemberExpression||f.callee.property.type!==le.AST_NODE_TYPES.Identifier||f.callee.computed)return;let x=f.callee.property.name;if(x!=="startsWith"&&x!=="endsWith"&&x!=="includes"||f.arguments.length!==1)return;let[E]=f.arguments;if(!E||E.type!==le.AST_NODE_TYPES.Literal||typeof E.value!="string")return;let F=f.callee.object,R=p(F);if(!R&&F.type===le.AST_NODE_TYPES.Identifier&&(R=m(F)),!R||R.length===0)return;let M=E.value;if(x==="includes"&&R.length>1)return;let P=0,ee=0;for(let Z of R)if((x==="startsWith"?Z.startsWith(M):x==="endsWith"?Z.endsWith(M):Z.includes(M))?P++:ee++,P>0&&ee>0)return;if(P>0&&ee===0){let Z=x==="startsWith"?"unnecessaryStartsWithCondition":x==="endsWith"?"unnecessaryEndsWithCondition":"unnecessaryIncludesCondition";e.report({node:f,messageId:Z})}else if(ee>0&&P===0){let Z=x==="startsWith"?"alwaysFalseStartsWithCondition":x==="endsWith"?"alwaysFalseEndsWithCondition":"alwaysFalseIncludesCondition";e.report({node:f,messageId:Z})}}function A(f){if(!new Set(["===","!==",">",">=","<","<="]).has(f.operator))return;function E(D){if(D.type!==le.AST_NODE_TYPES.MemberExpression||D.computed||D.property.type!==le.AST_NODE_TYPES.Identifier||D.property.name!=="length")return null;let q=D.object,B=p(q);if(!B||B.length===0)return null;let ue=[];for(let me of B)ue.push(me.length);return{values:ue}}let F=E(f.left),R=E(f.right),M=null,P=null;if(F?f.right.type===le.AST_NODE_TYPES.Literal&&typeof f.right.value=="number"&&(M=F.values,P=f.right.value):R&&f.left.type===le.AST_NODE_TYPES.Literal&&typeof f.left.value=="number"&&(M=R.values,P=f.left.value),!M||P===null)return;let ee=0,Z=0;for(let D of M){let q=!1;if(f.operator==="==="?q=D===P:f.operator==="!=="?q=D!==P:f.operator===">"?q=D>P:f.operator===">="?q=D>=P:f.operator==="<"?q=D<P:f.operator==="<="&&(q=D<=P),q?ee++:Z++,ee>0&&Z>0)return}ee>0&&Z===0?e.report({node:f,messageId:"unnecessaryLengthCondition"}):Z>0&&ee===0&&e.report({node:f,messageId:"alwaysFalseLengthCondition"})}function T(f){if(f.type===le.AST_NODE_TYPES.Literal&&typeof f.value=="string")return f.value;let x=p(f);if(!x||x.length!==1)return null;let[E]=x;return E??null}function b(f){return(f.flags&H.default.TypeFlags.Intersection)!==0}function C(f){return(f.flags&H.default.TypeFlags.Object)!==0}function w(f){return!r||r.getIndexTypeOfType(f,H.default.IndexKind.String)?!0:!!r.getIndexTypeOfType(f,H.default.IndexKind.Number)}function N(f,x){if(!r||w(f)||f.getProperties().length===0)return"unknown";let E=r.getPropertyOfType(f,x);return E?E.flags&H.default.SymbolFlags.Optional?"optional":"required":"absent"}function k(f,x){if(f.flags&H.default.TypeFlags.Any||f.flags&H.default.TypeFlags.Unknown||f.flags&H.default.TypeFlags.Never||f.flags&H.default.TypeFlags.TypeParameter||f.flags&H.default.TypeFlags.IndexedAccess||f.flags&H.default.TypeFlags.StringLike||f.flags&H.default.TypeFlags.NumberLike||f.flags&H.default.TypeFlags.BigIntLike||f.flags&H.default.TypeFlags.BooleanLike||f.flags&H.default.TypeFlags.EnumLike||f.flags&H.default.TypeFlags.ESSymbolLike||f.flags&H.default.TypeFlags.NonPrimitive||f.flags&H.default.TypeFlags.Null||f.flags&H.default.TypeFlags.Undefined||f.flags&H.default.TypeFlags.Void)return"unknown";if(f.isUnion()){let E=!0,F=!0;for(let R of f.types){let M=k(R,x);if(M==="unknown"||(M!=="required"&&(E=!1),M!=="absent"&&(F=!1),M==="optional"))return"unknown"}return E?"required":F?"absent":"unknown"}if(b(f)){let E=f,F=!1,R=!1;for(let M of E.types){let P=k(M,x);if(P==="unknown")return"unknown";P==="required"?F=!0:P==="optional"&&(R=!0)}return F?"required":R?"optional":"absent"}return C(f)?N(f,x):"unknown"}function O(f){if(f.operator!=="in"||f.left.type===le.AST_NODE_TYPES.PrivateIdentifier)return;let x=T(f.left);if(!x)return;let E=f.right,F=n.esTreeNodeToTSNodeMap.get(E);if(!r)return;let R=r.getTypeAtLocation(F),M=k(R,x);M==="required"?e.report({node:f,messageId:"unnecessaryInCondition",data:{property:x,type:r.typeToString(R),alternative:t.alternativeForInCondition?`If this a valid condition, you can use as alternative: ${t.alternativeForInCondition}`:""}}):M==="absent"&&e.report({node:f,messageId:"alwaysFalseInCondition",data:{property:x,type:r.typeToString(R),alternative:t.alternativeForInCondition?`If this a valid condition, you can use as alternative: ${t.alternativeForInCondition}`:""}})}return{BinaryExpression(f){a(f),A(f),O(f)},CallExpression(f){I(f),S(f)}}}})};function vt(e){return Array.from(new Set(e)).join(" | ")||"never"}function ut(e,t){let n=e.argument;return n.type===le.AST_NODE_TYPES.Identifier?n.name:t.sourceCode.getText(n)}function Ts(e,t){return t.has(e)}var ht=require("@typescript-eslint/utils"),st=require("zod/v4");var Es=st.z.object({functions:st.z.array(st.z.string().or(st.z.object({name:st.z.string(),message:st.z.string()})))});function hs(e){if(e.type===ht.AST_NODE_TYPES.Identifier)return e.name;if(e.type===ht.AST_NODE_TYPES.MemberExpression&&e.property.type===ht.AST_NODE_TYPES.Identifier&&e.object.type===ht.AST_NODE_TYPES.Identifier)return`${e.object.name}.${e.property.name}`}var rn=z({name:"no-call-with-explicit-generics",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)",noExplicitGenericsCustom:"{{ message }}"},schema:[U(Es)]},defaultOptions:[{functions:[]}],create(e,[t]){let n=new Map,r=new Map;for(let o of t.functions){let i=typeof o=="string"?o:o.name,a=typeof o=="string"?void 0:o.message;i.startsWith("*.")?r.set(i.slice(2),a):n.set(i,a)}function s(o){if(n.has(o))return{message:n.get(o)};let i=o.indexOf(".");if(i!==-1){let a=o.slice(i+1);if(r.has(a))return{message:r.get(a)}}}return{CallExpression(o){let i=hs(o.callee);if(!i||!o.typeArguments)return;let a=s(i);a&&(a.message?e.report({node:o,messageId:"noExplicitGenericsCustom",data:{message:a.message}}):e.report({node:o,messageId:"noExplicitGenerics",data:{functionName:i}}))}}}});var De=require("@typescript-eslint/utils"),bs=De.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),kr="no-call-with-inferred-generics",xs=bs({name:kr,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",typeOfUsedInGenerics:"Function '{{ functionName }}' should not be called with 'typeof' in generics",unknownUsedInGenerics:"Function '{{ functionName }}' should not be called with 'unknown' 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"}},disallowTypeOf:{type:"boolean"},disallowUnknown:{type:"boolean"}},required:["name"]}},anyAliases:{type:"array",items:{type:"string"}}},required:["functions"]}]},defaultOptions:[{functions:[]}],create(e,[t]){let n=new Map(t.functions.map(o=>[o.name,o])),r=t.functions.some(o=>o.disallowTypeOf),s=new Set;return{...r&&{TSTypeAliasDeclaration(o){o.typeAnnotation.type===De.AST_NODE_TYPES.TSTypeQuery&&s.add(o.id.name)}},CallExpression(o){let{callee:i}=o;if(i.type!==De.AST_NODE_TYPES.Identifier)return;let a=n.get(i.name);if(!a)return;let{minGenerics:l=1,allowAny:p,disallowTypes:m=t.disallowTypes,disallowTypeOf:y,disallowUnknown:u}=a;(o.typeArguments?.params.length||0)<(l||0)&&e.report({node:o,messageId:"missingGenericDeclaration",data:{functionName:i.name,minGenerics:l||0}}),!(p&&!m)&&(o.typeArguments?.params.some(c=>!p&&c.type===De.AST_NODE_TYPES.TSAnyKeyword||m&&c.type===De.AST_NODE_TYPES.TSTypeReference&&c.typeName.type===De.AST_NODE_TYPES.Identifier&&m.includes(c.typeName.name))&&e.report({node:o,messageId:"anyUsedInGenerics",data:{functionName:i.name}}),u&&o.typeArguments?.params.some(c=>c.type===De.AST_NODE_TYPES.TSUnknownKeyword)&&e.report({node:o,messageId:"unknownUsedInGenerics",data:{functionName:i.name}}),y&&o.typeArguments?.params.some(c=>c.type===De.AST_NODE_TYPES.TSTypeQuery||c.type===De.AST_NODE_TYPES.TSTypeReference&&c.typeName.type===De.AST_NODE_TYPES.Identifier&&s.has(c.typeName.name))&&e.report({node:o,messageId:"typeOfUsedInGenerics",data:{functionName:i.name}}))}}}}),sn={name:kr,rule:xs};var Dr=require("@typescript-eslint/utils"),Cs=Dr.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),Lr="no-commented-out-code",Is=["function ","class ","interface ","enum ","namespace ","import ","export ","const ","let ","var ","return ","throw ","try {","catch (","finally {","async ","await ","case ","switch (","while (","for (","default:"],As=/^\s*return\s+/,ws=/^\s*type\s+[\p{ID_Start}$_][\p{ID_Continue}$\u200C\u200D]*\s*(?:=|<)/u,Fs=/^\s*(?:break|continue)(?:;|\s+[A-Za-z_$][\w$]*;?)?\s*$/,vs=/\w=("|'|`)/,Rs=/\w+:\s*('|"|`)/,Ns=/\[['"][^'"]*['"]\]:\s*('|"|`|[^'"`\s])/,ks=/\w+-\w+:/,Ps=/\w+_\w+:/,Os=/\?\s+\w/,Ds=/:\s+\w/,Ls=/^\s*('|"|`)[^'"]*('|"|`),?\s*$/,js=/^\s*\d+[,}]/,Ms=/^\s*\[[^\]]*\][,}]/,$s=/^\s*\{[^}]*\}[,}]/,_s=/\.\w+\(/,Us=/\[\w+\]/,zs=/^\s*(['"`]).+?\1\s*:/,Vs=/^<[A-Z]\w*(\s|>|\/)/,Ws=/^<[a-z]+(\s|>|\/)/,Js=/<[A-Z]\w*(\s.*)?>/,Xs=/<\/[A-Z]\w*>/,Bs=/<[a-z]+(\s.*)?>/,Hs=/<\/[a-z]+>/,Ys=/^\s*[*\s]*$/,qs=/^[a-zA-Z]/,Zs=/^[A-Z][A-Za-z]*(?:\s+\d+)?(?:\s+[a-z]+)*:\s+[A-Za-z]/,Gs=/^[a-z][A-Za-z0-9_-]*:\s+[A-Za-z][\w'-]*(?:\s+[A-Za-z][\w'-]*){2,}/,Ks=/```[\s\S]*?```/g,Qs=/`[^`]*`/g,Pr=/[a-zA-Z0-9]/,eo=/\.[A-Za-z_][A-Za-z0-9_]*\(/,to=/[{}[\]()`=<>]/,no=/:\s*(['"`[{(]|\w+\s*=>)/,ro=/\bif\s*\(|\belse\b|=>/,de={returnStatement:As,typeAliasDeclaration:ws,stringAssignment:vs,objectPropertyWithQuotes:Rs,computedPropertyAssignment:Ns,kebabCaseProperty:ks,snakeCaseProperty:Ps,ternaryOperator:Os,colonWithWord:Ds,quotedString:Ls,numberWithComma:js,arrayWithComma:Ms,objectWithComma:$s,methodCall:_s,arrayAccess:Us,quotedPropertyKey:zs,jsxSelfClosing:Vs,jsxElement:Ws,jsxOpeningTag:Js,jsxClosingTag:Xs,htmlOpeningTag:Bs,htmlClosingTag:Hs,jsdocComment:Ys};function io(e){if(e.includes(":")){let n=e.split(":")[0]?.trim();if(n&&qs.test(n)&&n.includes(" "))return!0}let t=e.trim();return t.length===0||eo.test(t)||to.test(t)||no.test(t)||ro.test(t)?!1:!!(t.includes(":")&&(Zs.test(t)||Gs.test(t)))}var so=[") {","return;",de.returnStatement,de.typeAliasDeclaration,Fs,"if (","else {","else if (","/>","</","< ","},",": {"," } = ","={",de.stringAssignment,");",de.objectPropertyWithQuotes,de.computedPropertyAssignment,de.kebabCaseProperty,de.snakeCaseProperty,"&&","||","()",de.ternaryOperator,de.colonWithWord,de.quotedString,de.numberWithComma,de.arrayWithComma,de.objectWithComma,de.methodCall,de.arrayAccess,"?.(","??","=>",de.quotedPropertyKey],oo=["/>","</",de.jsxSelfClosing,de.jsxElement,de.jsxOpeningTag,de.jsxClosingTag,de.htmlOpeningTag,de.htmlClosingTag],Or=["INFO:","TODO:","DOCS:","FIX:","FIXME:","HACK:","NOTE:","WARNING:","WARN:","BUG:","ISSUE:","TEMP:","TEMPORARY:","XXX:","REVIEW:","eslint","cspell:","spell-checker:"],ao=Cs({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(r,s){if(r.startsWith("/"))return!1;let o=r.trimStart();if(r.startsWith("*")||o.startsWith("eslint-disable")||r.includes("@deprecated")||r.includes("@example")||r.includes("@param")||r.includes("@returns")||r.includes("@throws")||r.includes("typescript-eslint")||r.includes("@ts-")||r.includes("prettier-ignore")||de.jsdocComment.test(r))return!1;for(let i of Or)if(o.startsWith(i))return!1;if(r.includes("https://")||io(o))return!1;if(s==="Block"){for(let i of oo)if(typeof i=="string"){if(r.includes(i))return{wrongPattern:i}}else if(i.test(r))return{wrongPattern:`regex(${i.toString()})`};return!1}for(let i of Is)if(o.startsWith(i))return{wrongPattern:i};for(let i of so)if(typeof i=="string"){if(r.includes(i))return{wrongPattern:i}}else if(i.test(r))return{wrongPattern:`regex(${i.toString()})`};return!1}function n(r,s){let o=r,i=o.trim();if(i.startsWith("`")&&(i.endsWith("`,")||i.endsWith("`;")||i.endsWith("`")))return o;if(s==="Block"&&o.includes("```")){let p=o.split(Ks);p.some(y=>Pr.test(y))&&(o=p.join(""))}if(!o.includes("`"))return o;let a=o.split(Qs);return a.some(p=>Pr.test(p))?a.join(""):o}return{Program(){let s=e.sourceCode.getAllComments();for(let o of s){let i=n(o.value,o.type),a=t(i,o.type);a&&e.report({node:o,messageId:"commentedOutCode",data:{wrongPattern:a.wrongPattern,allowedPrefixes:Or.join(", ")}})}}}}}),on={name:Lr,rule:ao};var Rt=require("@typescript-eslint/utils"),lo=Rt.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),jr="no-default-export",po=lo({name:jr,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 n of t.specifiers)n.exported.type===Rt.TSESTree.AST_NODE_TYPES.Identifier&&n.exported.name==="default"&&e.report({node:t,messageId:"noDefaultExport"})}}}}),an={name:jr,rule:po};var Mr=require("@typescript-eslint/utils"),co=Mr.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),$r="no-leaked-text-in-jsx",uo=[",",";","[","]","(",")"],fo=co({name:$r,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 n=t.value.trim();if(!n)return;let r="";uo.includes(n)?r=n:n.includes("&&")?r="&&":n.includes("||")?r="||":n.endsWith("? (")&&(r="? ("),r&&e.report({node:t,messageId:"leakedTextInJSX",data:{text:r}})}}}}),ln={name:$r,rule:fo};var Qe=require("@typescript-eslint/utils"),mo=Qe.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),Ur="no-non-camel-case-functions",yo=/^(\$?[a-z][a-zA-Z0-9]*)$/;function _r(e){if(e.typeName.type!==Qe.AST_NODE_TYPES.TSQualifiedName)return!1;let{left:t,right:n}=e.typeName;return t.type===Qe.AST_NODE_TYPES.Identifier&&t.name==="JSX"&&n.name==="Element"}var go=mo({name:Ur,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&&!yo.test(t.id.name)){let n=t.returnType?.typeAnnotation;if(n&&(n.type===Qe.AST_NODE_TYPES.TSTypeReference?_r(n):n.type===Qe.AST_NODE_TYPES.TSUnionType&&n.types.some(s=>s.type===Qe.AST_NODE_TYPES.TSTypeReference&&_r(s))))return;e.report({node:t.id,messageId:"nonCamelCaseFunction",data:{functionName:t.id.name}})}}}}}),pn={name:Ur,rule:go};var ae=require("@typescript-eslint/utils");var So=ae.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),zr="no-optional-root-props",To=So({name:zr,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(r){let o=e.sourceCode.getDeclaredVariables(r)[0];if(!o||o.references.length!==1)return!1;let i=o.references[0];if(!i)return!1;for(let a of Qt(i.identifier)){if("returnType"in a||a.type===ae.TSESTree.AST_NODE_TYPES.ExportNamedDeclaration)return!1;let l=a.parent;if(!l)return!1;if(l.type===ae.TSESTree.AST_NODE_TYPES.TSTypeParameterInstantiation&&l.parent.type===ae.TSESTree.AST_NODE_TYPES.TSTypeReference&&l.parent.typeName.type===ae.TSESTree.AST_NODE_TYPES.Identifier&&l.parent.typeName.name==="FC"){let m=ct(l.parent.parent,ae.TSESTree.AST_NODE_TYPES.VariableDeclaration,4);if(!m)return!1;let y=Nt(m,e.sourceCode);return y?!(y.parent.type===ae.TSESTree.AST_NODE_TYPES.CallExpression&&y.parent.callee.type===ae.TSESTree.AST_NODE_TYPES.Identifier&&y.parent.callee.name==="memo"):!1}if(a.type===ae.TSESTree.AST_NODE_TYPES.AssignmentPattern)return!1;if(l.type===ae.TSESTree.AST_NODE_TYPES.ArrowFunctionExpression){let p=ct(l,ae.TSESTree.AST_NODE_TYPES.VariableDeclaration);return p?!!Nt(p,e.sourceCode):!1}if(l.type===ae.TSESTree.AST_NODE_TYPES.FunctionDeclaration)return!!Nt(l,e.sourceCode)}return!1}function n(r){r.key.type!==ae.TSESTree.AST_NODE_TYPES.Identifier||!r.optional||e.report({node:r.key,messageId:"optionalNotAllowed",data:{propertyName:r.key.name},suggest:[{messageId:"suggestion",fix:s=>{let o=ct(r,ae.TSESTree.AST_NODE_TYPES.TSPropertySignature);if(!o)return null;let i=e.sourceCode.getText(o);return s.replaceText(o,i.replace("?:",": undefined |"))}}]})}return{TSTypeAliasDeclaration(r){if(r.typeAnnotation.type===ae.TSESTree.AST_NODE_TYPES.TSTypeLiteral&&!(kt(r)||!t(r)))for(let s of r.typeAnnotation.members)s.type===ae.TSESTree.AST_NODE_TYPES.TSPropertySignature&&n(s)},TSInterfaceDeclaration(r){if(!(kt(r)||!t(r)))for(let s of r.body.body)s.type===ae.TSESTree.AST_NODE_TYPES.TSPropertySignature&&n(s)},TSTypeReference(r){if(r.typeName.type!==ae.TSESTree.AST_NODE_TYPES.Identifier||r.typeName.name!=="FC"||!r.typeArguments?.params[0])return;let s=r.typeArguments.params[0];if(s.type!==ae.TSESTree.AST_NODE_TYPES.TSTypeLiteral)return;let o=ct(r.parent,ae.TSESTree.AST_NODE_TYPES.VariableDeclaration,4);if(!o)return;let i=Nt(o,e.sourceCode);if(!(!i||i.parent.type===ae.TSESTree.AST_NODE_TYPES.CallExpression&&i.parent.callee.type===ae.TSESTree.AST_NODE_TYPES.Identifier&&i.parent.callee.name==="memo"))for(let l of s.members)l.type===ae.TSESTree.AST_NODE_TYPES.TSPropertySignature&&n(l)}}}});function kt(e){return e?e.parent?.type===ae.TSESTree.AST_NODE_TYPES.ExportNamedDeclaration||e.parent?.type===ae.TSESTree.AST_NODE_TYPES.ExportDefaultDeclaration:!1}function Nt(e,t){if(kt(e))return;let n;if(e.type===ae.TSESTree.AST_NODE_TYPES.VariableDeclaration){if(e.declarations.length!==1)return;e.declarations[0].id.type===ae.TSESTree.AST_NODE_TYPES.Identifier&&(n=e.declarations[0].id)}else{if(!e.id)return;n=e.id}if(!n)return;let r=t.getScope(e);e.type===ae.TSESTree.AST_NODE_TYPES.FunctionDeclaration&&r.upper&&(r=r.upper);let s=r.variables.find(i=>i.identifiers.includes(n));if(!s)return;let o=s.references.filter(i=>i.identifier!==n);if(!(o.length!==1||!o[0])&&!kt(o[0].identifier.parent.parent))return o[0].identifier}var cn={name:zr,rule:To};var et=require("@typescript-eslint/utils");var bt=z({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 n(s){return s?s.type===et.AST_NODE_TYPES.Identifier?t.has(s.name):s.type===et.AST_NODE_TYPES.MemberExpression?n(s.object):!1:!1}function r(s){return s.type!==et.AST_NODE_TYPES.TSTypeReference||s.typeArguments?!1:s.typeName.type===et.AST_NODE_TYPES.Identifier&&t.has(s.typeName.name)}return{ImportDeclaration(s){for(let o of s.specifiers)t.add(o.local.name)},ExportNamedDeclaration(s){if(s.source){e.report({node:s,messageId:"noReexport"});return}if(s.declaration?.type===et.AST_NODE_TYPES.VariableDeclaration)for(let o of s.declaration.declarations)n(o.init)&&e.report({node:s,messageId:"noReexport"});s.declaration?.type===et.AST_NODE_TYPES.TSTypeAliasDeclaration&&r(s.declaration.typeAnnotation)&&e.report({node:s,messageId:"noReexport"}),s.specifiers.length>0&&e.report({node:s,messageId:"noReexport"})},ExportDefaultDeclaration(s){s.declaration.type===et.AST_NODE_TYPES.Identifier&&t.has(s.declaration.name)&&e.report({node:s,messageId:"noReexport"})},ExportAllDeclaration(s){e.report({node:s,messageId:"noReexport"})}}}});var Vr=require("@typescript-eslint/utils"),Pt=Re(require("path")),He=require("zod/v4");var Eo=Vr.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),Wr="no-relative-imports",ho=He.z.object({find:He.z.string(),replacement:He.z.string()}),bo=He.z.object({aliases:He.z.array(ho),rootDir:He.z.string().optional(),allowNotFoundAliases:He.z.boolean().optional(),_dev_simulateFileName:He.z.string().optional()}),xo=Eo({name:Wr,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:[U(bo)]},defaultOptions:[{aliases:[],rootDir:void 0}],create(e,[t]){let n=t._dev_simulateFileName??e.filename;function r(i){return i.startsWith(".")||i.startsWith("..")}function s(i,a){let l=Pt.default.dirname(a);return Pt.default.resolve(l,i)}function o(i){let a=t.rootDir??process.cwd(),l=Pt.default.relative(a,i);if(l.startsWith("."))return null;l.startsWith("/")||(l=`/${l}`);for(let{find:p,replacement:m}of t.aliases)if(l.startsWith(m)){let y=l.replace(m,p);return{alias:p,newPath:y}}return null}return{ImportDeclaration(i){let a=i.source.value;if(!r(a))return;let l=s(a,n),p=o(l);!p&&t.allowNotFoundAliases||e.report({node:i,messageId:p?"noRelativeImportsWithAlias":"noRelativeImports",data:{alias:p?.alias},fix:p?m=>m.replaceText(i.source,`'${p.newPath}'`):void 0})}}}}),un={name:Wr,rule:xo};var Se=require("@typescript-eslint/utils"),fn=require("zod/v4");var Co=fn.z.object({customMessage:fn.z.string().optional()}),mn=z({name:"no-static-style-prop",meta:{type:"problem",docs:{description:"Prevent using static style props in JSX, only dynamic values should be allowed"},schema:[U(Co)],messages:{noStaticStyleProp:"Static style props are not allowed use css instead.{{customMessage}}"}},defaultOptions:[{}],create(e,[t]){function n(r){switch(r.type){case Se.AST_NODE_TYPES.Literal:return!0;case Se.AST_NODE_TYPES.ObjectExpression:return r.properties.every(s=>s.type===Se.AST_NODE_TYPES.Property?s.computed||s.value.type===Se.AST_NODE_TYPES.Identifier&&s.key.type===Se.AST_NODE_TYPES.Identifier&&s.key.name===s.value.name?!1:n(s.value):!1);case Se.AST_NODE_TYPES.ArrayExpression:return r.elements.every(s=>s?s.type===Se.AST_NODE_TYPES.SpreadElement?!1:n(s):!0);case Se.AST_NODE_TYPES.TemplateLiteral:return r.expressions.length===0;case Se.AST_NODE_TYPES.ConditionalExpression:case Se.AST_NODE_TYPES.LogicalExpression:case Se.AST_NODE_TYPES.BinaryExpression:case Se.AST_NODE_TYPES.UnaryExpression:case Se.AST_NODE_TYPES.CallExpression:case Se.AST_NODE_TYPES.MemberExpression:case Se.AST_NODE_TYPES.Identifier:case Se.AST_NODE_TYPES.ArrowFunctionExpression:case Se.AST_NODE_TYPES.FunctionExpression:return!1;default:return!1}}return{JSXAttribute(r){if(r.name.type===Se.AST_NODE_TYPES.JSXIdentifier&&r.name.name==="style"&&r.value){let s=null;r.value.type===Se.AST_NODE_TYPES.JSXExpressionContainer?r.value.expression.type!==Se.AST_NODE_TYPES.JSXEmptyExpression&&(s=r.value.expression):r.value.type===Se.AST_NODE_TYPES.Literal&&(s=r.value),s&&n(s)&&e.report({node:r,messageId:"noStaticStyleProp",data:{customMessage:t.customMessage?` ${t.customMessage}`:""}})}}}}});var xt=require("@typescript-eslint/utils"),ot=Re(require("zod/v4"));var Io=ot.object({alternativeMsgs:ot.object({inArrayFind:ot.string().optional(),inArrayFilter:ot.string().optional()}).optional(),__dev_simulateFileName:ot.string().optional()});function Ao(e){return e.typeAnnotation.type!==xt.AST_NODE_TYPES.TSTypePredicate?!1:e.typeAnnotation.asserts===!1}var wo=/(typeGuards|type-guards)\.(ts|tsx)$/;function Fo(e){return wo.test(e)}function vo(e){let t=e.parent;for(;t;){if(t.type===xt.AST_NODE_TYPES.CallExpression&&t.callee.type===xt.AST_NODE_TYPES.MemberExpression&&t.callee.property.type===xt.AST_NODE_TYPES.Identifier){let n=t.callee.property.name;if(n==="filter"||n==="find")return{method:n}}t=t.parent}return null}var yn=z({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:[U(Io)],hasSuggestions:!0},defaultOptions:[{}],create(e,[t]){let n=t.__dev_simulateFileName??e.filename;if(Fo(n))return{};function r(s){if(!Ao(s))return;let o=vo(s);if(t.alternativeMsgs&&o){let i=o.method==="filter"?t.alternativeMsgs.inArrayFilter:t.alternativeMsgs.inArrayFind;if(i){let a=o.method==="filter"?"useFilterWithTypeCheck":"useFindWithTypeCheck";e.report({node:s,messageId:a,data:{message:i}});return}}e.report({node:s,messageId:"typeGuardNotAllowed"})}return{"FunctionDeclaration > :matches(TSTypeAnnotation)":r,"ArrowFunctionExpression > :matches(TSTypeAnnotation)":r,"MethodDefinition > FunctionExpression > :matches(TSTypeAnnotation)":r}}});var at=require("@typescript-eslint/utils");var Ro="no-unnecessary-async-on-jsx-props";function No(e){if(e.body.type!==at.AST_NODE_TYPES.BlockStatement)return!1;let t=e.body.body;if(t.length!==1)return!1;let n=t[0];return!n||n.type!==at.AST_NODE_TYPES.ExpressionStatement?!1:n.expression.type===at.AST_NODE_TYPES.AwaitExpression}var dn=z({name:Ro,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(n){No(n)&&e.report({node:n,messageId:"unnecessaryAsyncInJsxProp",fix(r){let s=e.sourceCode,o=[],i=s.getFirstToken(n,l=>l.value==="async");if(i){let l=s.getTokenAfter(i);l?o.push(r.replaceTextRange([i.range[0],l.range[0]],"")):o.push(r.remove(i))}function a(l){if(l.type===at.AST_NODE_TYPES.AwaitExpression){let p=s.getFirstToken(l);if(p&&p.value==="await"){let m=s.getTokenAfter(p);m?o.push(r.replaceTextRange([p.range[0],m.range[0]],"")):o.push(r.remove(p))}}if(l.type===at.AST_NODE_TYPES.BlockStatement)for(let p of l.body)a(p);else l.type===at.AST_NODE_TYPES.ExpressionStatement&&a(l.expression)}return a(n.body),o}})}return{"JSXAttribute ArrowFunctionExpression[async=true]":t,"JSXAttribute FunctionExpression[async=true]":t}}});var Ye=require("@typescript-eslint/utils"),gn=Re(require("typescript")),ft=Re(require("zod/v4"));var ko=Ye.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),Jr="no-unnecessary-casting",Po=ft.default.object({additionalCastFunctions:ft.default.array(ft.default.object({name:ft.default.string(),expectedType:ft.default.enum(["string","number"])})).optional()}),Sn={name:Jr,rule:ko({name:Jr,meta:{type:"suggestion",docs:{description:"Prevents unnecessary Number and String castings"},deprecated:{message:"Use the strict-casting rule instead"},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:[U(Po)],fixable:"code"},defaultOptions:[{}],create(e){let n=e.options[0].additionalCastFunctions||[],r=[{name:"Number",expectedType:"number"},{name:"String",expectedType:"string"},...n],s=Ye.ESLintUtils.getParserServices(e,!0),o=s.program?.getTypeChecker();if(!o||!s.program)throw new Error("TypeScript services or program not available");function i(m,y){switch(m.type){case Ye.AST_NODE_TYPES.Literal:return y==="number"?typeof m.value=="number":typeof m.value=="string";case Ye.AST_NODE_TYPES.TemplateLiteral:return y==="string";case Ye.AST_NODE_TYPES.UnaryExpression:return y==="number"?m.operator==="+"||m.operator==="-"||m.operator==="~":!1;default:return!1}}function a(m,y){return y==="number"?!!(m.flags&gn.TypeFlags.NumberLike):!!(m.flags&gn.TypeFlags.StringLike)}function l(m,y){return u=>u.replaceText(m,e.sourceCode.getText(y))}function p(m){if(!o||m.arguments.length!==1)return;let y=m.arguments[0];if(!y||y.type===Ye.AST_NODE_TYPES.SpreadElement)return;let{callee:u}=m;if(u.type!==Ye.AST_NODE_TYPES.Identifier)return;let d=u.name,c=r.find(h=>h.name===d);if(!c)return;if(i(y,c.expectedType)||a(o.getTypeAtLocation(s.esTreeNodeToTSNodeMap.get(y)),c.expectedType)){let h,S;d==="Number"?h="unnecessaryNumberCasting":d==="String"?h="unnecessaryStringCasting":(h="unnecessaryCustomCasting",S={name:c.name,type:c.expectedType}),e.report({node:m,messageId:h,...S?{data:S}:{},fix:l(m,y)})}}return{CallExpression:p}}})};var Ne=require("@typescript-eslint/utils"),Ot=Re(require("zod/v4"));var Oo=Ot.object({ignoreWithDescription:Ot.string().optional()}),Tn=z({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:[U(Oo)]},defaultOptions:[{}],create(e,[t]){let n=e.getSourceCode(),r=n.ast;function s(l){let p=l.arguments[0];return p&&p.type===Ne.AST_NODE_TYPES.Literal&&typeof p.value=="string"?p.value:null}function o(l){return!l||!t.ignoreWithDescription?!1:new RegExp(t.ignoreWithDescription).test(l)}function i(l){return l.length!==1?!1:r.body.filter(m=>{if(m.type===Ne.AST_NODE_TYPES.ExpressionStatement){let y=m.expression;if(y.type===Ne.AST_NODE_TYPES.CallExpression&&y.callee.type===Ne.AST_NODE_TYPES.Identifier){let u=y.callee.name;return["test","it","beforeEach","afterEach","beforeAll","afterAll"].includes(u)}}return!1}).length===0}function a(l){let p=l.arguments[1];if(p&&(p.type===Ne.AST_NODE_TYPES.FunctionExpression||p.type===Ne.AST_NODE_TYPES.ArrowFunctionExpression)&&p.body.type===Ne.AST_NODE_TYPES.BlockStatement){let m=p.body.body;return m.length===0?"":m.map(u=>n.text.slice(u.range[0],u.range[1])).join(`
16
16
 
17
- `)}return""}return{Program(){let l=[];for(let u of r.body)u.type===Ne.AST_NODE_TYPES.ExpressionStatement&&u.expression.type===Ne.AST_NODE_TYPES.CallExpression&&u.expression.callee.type===Ne.AST_NODE_TYPES.Identifier&&u.expression.callee.name==="describe"&&u.expression.arguments.length===2&&l.push(u.expression);if(!i(l))return;let[p]=l;if(!p)return;let m=s(p);if(o(m))return;let y=r.body.find(u=>u.type===Ne.AST_NODE_TYPES.ExpressionStatement&&u.expression===p);!y||y.type!==Ne.AST_NODE_TYPES.ExpressionStatement||e.report({node:p,messageId:"unnecessaryDescribe",suggest:[{messageId:"removeDescribe",fix(u){let d=a(p);return d?u.replaceText(y,d):null}}]})}}}});var Ct=require("@typescript-eslint/utils"),Ue=Re(require("zod/v4"));var ko=Ue.object({methods:Ue.union([Ue.array(Ue.string()),Ue.literal("array")])}),En=z({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:[U(ko)]},defaultOptions:[{methods:"array"}],create(e,[t]){let n=t.methods,r=new Set(["find","filter","map","forEach","some","every","reduce","findIndex","sort"]);function s(a){return Array.isArray(n)?n.includes(a):r.has(a)}function o(a){let{callee:l}=a;if(l.type===Ct.AST_NODE_TYPES.MemberExpression){let p=l.property;if(p.type===Ct.AST_NODE_TYPES.Identifier)return p.name}return null}function i(a,l){if(a.type!==Ct.AST_NODE_TYPES.Identifier||!a.typeAnnotation)return;let p=l.parent;if(p.type===Ct.AST_NODE_TYPES.CallExpression){let m=o(p);m&&s(m)&&p.arguments.indexOf(l)===0&&e.report({node:a.typeAnnotation,messageId:"unnecessaryTypeAnnotation",fix(u){return a.typeAnnotation?u.remove(a.typeAnnotation):null}})}}return{ArrowFunctionExpression(a){for(let l of a.params)i(l,a)},FunctionExpression(a){for(let l of a.params)i(l,a)}}}});var Fe=require("@typescript-eslint/utils");var hn=z({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===Fe.AST_NODE_TYPES.ObjectPattern||!t.init||t.init.type!==Fe.AST_NODE_TYPES.ObjectExpression||t.id.type===Fe.AST_NODE_TYPES.Identifier&&t.id.typeAnnotation||t.parent.parent.type===Fe.AST_NODE_TYPES.ExportNamedDeclaration)return;let n=new Map;for(let i of t.init.properties)i.type===Fe.AST_NODE_TYPES.Property&&i.key.type===Fe.AST_NODE_TYPES.Identifier&&n.set(i.key.name,i);if(n.size===0||t.id.type!==Fe.AST_NODE_TYPES.Identifier)return;let r=Po(t,e.sourceCode);if(r.length===0)return;let s=t.init.properties.some(i=>i.type!==Fe.AST_NODE_TYPES.Property?!1:i.value.type===Fe.AST_NODE_TYPES.FunctionExpression),o=new Set;for(let i of r){if(i.identifier.parent.type!==Fe.AST_NODE_TYPES.MemberExpression)return;let a=i.identifier.parent;if(a.object!==i.identifier)return;if(a.computed)if(a.property.type===Fe.AST_NODE_TYPES.Literal&&typeof a.property.value=="string")o.add(a.property.value);else return;else{if(a.property.type!==Fe.AST_NODE_TYPES.Identifier)return;o.add(a.property.name)}if(a.parent.type===Fe.AST_NODE_TYPES.CallExpression&&s)return}for(let[i,a]of n)o.has(i)||e.report({node:a,messageId:"unusedObjectProperty",data:{name:i}})}}}});function Po(e,t){let n=t.getDeclaredVariables(e);if(n.length!==1)return[];let r=n[0];return r?r.references.filter(s=>s.identifier!==e.id):[]}var te=require("@typescript-eslint/utils"),bn=require("zod/v4");var Oo=bn.z.object({ignoreArgsMatching:bn.z.string().optional()}),xn=z({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:[U(Oo)]},defaultOptions:[{}],create(e,[t]){let n=[];function r(i){return t.ignoreArgsMatching?new RegExp(t.ignoreArgsMatching).test(i):!1}function s(i){return i.type===te.AST_NODE_TYPES.ExportNamedDeclaration||i.type===te.AST_NODE_TYPES.ExportDefaultDeclaration||i.parent?.type===te.AST_NODE_TYPES.ExportNamedDeclaration||i.parent?.type===te.AST_NODE_TYPES.ExportDefaultDeclaration}function o(i){let a=[];for(let l=0;l<i.length;l++){let p=i[l];if(!p||p.type!==te.AST_NODE_TYPES.Identifier)continue;let m=p.name;if(!r(m)){if(p.optional&&p.typeAnnotation&&p.typeAnnotation.typeAnnotation.type===te.AST_NODE_TYPES.TSTypeLiteral){let y=p.typeAnnotation.typeAnnotation,u=[];for(let d of y.members)d.type===te.AST_NODE_TYPES.TSPropertySignature&&d.key.type===te.AST_NODE_TYPES.Identifier&&u.push({name:d.key.name,optional:d.optional===!0});u.some(d=>d.optional)?a.push({param:p,index:l,name:m,isObjectParam:!0,objectProps:u}):a.push({param:p,index:l,name:m,isObjectParam:!1})}else if(p.optional)a.push({param:p,index:l,name:m,isObjectParam:!1});else if(p.typeAnnotation&&p.typeAnnotation.typeAnnotation.type===te.AST_NODE_TYPES.TSTypeLiteral){let y=p.typeAnnotation.typeAnnotation,u=[];for(let d of y.members)d.type===te.AST_NODE_TYPES.TSPropertySignature&&d.key.type===te.AST_NODE_TYPES.Identifier&&u.push({name:d.key.name,optional:d.optional===!0});u.some(d=>d.optional)&&a.push({param:p,index:l,name:m,isObjectParam:!0,objectProps:u})}}}return a}return{FunctionDeclaration(i){if(s(i))return;let a=o(i.params);a.length!==0&&n.push({node:i,declarationNode:i,optionalParams:a})},VariableDeclarator(i){if(i.id.type!==te.AST_NODE_TYPES.Identifier||!i.init||i.init.type!==te.AST_NODE_TYPES.ArrowFunctionExpression&&i.init.type!==te.AST_NODE_TYPES.FunctionExpression||s(i.parent.parent))return;let l=[...o(i.init.params)];if(i.id.typeAnnotation&&i.id.typeAnnotation.typeAnnotation.type===te.AST_NODE_TYPES.TSTypeReference){let p=i.id.typeAnnotation.typeAnnotation;if(p.typeName.type===te.AST_NODE_TYPES.Identifier&&p.typeName.name==="FC"){let m=p.typeArguments;if(m&&m.params.length===1){let y=m.params[0];if(y&&y.type===te.AST_NODE_TYPES.TSTypeLiteral){let u=[];for(let d of y.members)d.type===te.AST_NODE_TYPES.TSPropertySignature&&d.key.type===te.AST_NODE_TYPES.Identifier&&u.push({name:d.key.name,optional:d.optional===!0});u.some(d=>d.optional)&&l.push({param:i.id,index:0,name:"props",isObjectParam:!0,objectProps:u})}}}}l.length!==0&&n.push({node:i.init,declarationNode:i,optionalParams:l})},"Program:exit"(){for(let i of n){let l=e.sourceCode.getDeclaredVariables(i.declarationNode)[0];if(!l)continue;let p=l.references.filter(u=>u.identifier!==l.identifiers[0]);if(p.length===0)continue;let m=!1;for(let u of p){let d=u.identifier.parent;if(d.type===te.AST_NODE_TYPES.CallExpression&&u.identifier.type===te.AST_NODE_TYPES.Identifier&&d.arguments.includes(u.identifier)){m=!0;break}if(d.type===te.AST_NODE_TYPES.ReturnStatement){m=!0;break}if(d.type===te.AST_NODE_TYPES.Property&&d.parent.type===te.AST_NODE_TYPES.ObjectExpression&&d.parent.parent.type===te.AST_NODE_TYPES.ReturnStatement){m=!0;break}if(d.type===te.AST_NODE_TYPES.JSXExpressionContainer){m=!0;break}}if(m)continue;let y=[];for(let u of p){let d=u.identifier.parent;if(d.type===te.AST_NODE_TYPES.CallExpression&&d.callee===u.identifier){let c=d.arguments.length,g=d.arguments.some(S=>S.type===te.AST_NODE_TYPES.SpreadElement);if(g){m=!0;break}let h={argCount:c,hasSpread:g};for(let S of i.optionalParams)if(S.isObjectParam&&S.index<c){let I=d.arguments[S.index];if(I?.type===te.AST_NODE_TYPES.ObjectExpression){let A={};for(let T of I.properties)T.type===te.AST_NODE_TYPES.Property&&T.key.type===te.AST_NODE_TYPES.Identifier&&(A[T.key.name]=!0);h.objectArgs||(h.objectArgs=[]),h.objectArgs[S.index]=A}else if(I){m=!0;break}}y.push(h)}else if(d.type===te.AST_NODE_TYPES.JSXOpeningElement&&d.name===u.identifier){let c=d.attributes.some(h=>h.type===te.AST_NODE_TYPES.JSXSpreadAttribute);if(c){m=!0;break}let g={argCount:1,hasSpread:c};for(let h of i.optionalParams)if(h.isObjectParam&&h.index===0){let S={};for(let I of d.attributes)I.type===te.AST_NODE_TYPES.JSXAttribute&&I.name.type===te.AST_NODE_TYPES.JSXIdentifier&&(S[I.name.name]=!0);g.objectArgs||(g.objectArgs=[]),g.objectArgs[0]=S}y.push(g)}}if(!(m||y.length===0))for(let u of i.optionalParams)if(u.isObjectParam&&u.objectProps)for(let d of u.objectProps){if(!d.optional)continue;let c=!1;for(let g of y)if(g.objectArgs&&g.objectArgs[u.index]){let h=g.objectArgs[u.index];if(h&&h[d.name]){c=!0;break}}c||e.report({node:u.param,messageId:"unusedOptionalProp",data:{name:d.name}})}else{let d=!1;for(let c of y)if(c.argCount>u.index){d=!0;break}d||e.report({node:u.param,messageId:"unusedOptionalArg",data:{name:u.name}})}}}}}});var pe=require("@typescript-eslint/utils"),tt=require("zod/v4");var Do=tt.z.object({selectors:tt.z.array(tt.z.object({name:tt.z.string(),selectorProp:tt.z.string().optional(),selectorArgPos:tt.z.number().optional(),returnProp:tt.z.string().optional()}))}),Lo=pe.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),Xr="no-unused-selected-values",Cn={name:Xr,rule:Lo({name:Xr,meta:{type:"suggestion",docs:{description:"Disallow unused values in selector objects"},messages:{unusedSelectedValue:'The selected value "{{name}}" is not being used'},schema:[U(Do)]},defaultOptions:[{selectors:[]}],create(e,[t]){let{selectors:n=[]}=t,r=new Map(n.map(s=>[s.name,s]));return{VariableDeclarator(s){let o=null;if(s.init?.type===pe.AST_NODE_TYPES.CallExpression&&(o=s.init),!o)return;let i=Mo(o);if(!i)return;let a=r.get(i);if(!a)return;let l=jo(o,a.selectorArgPos??0,a.selectorProp);if(!l)return;let p=$o(l);if(!p)return;let m=Br(p.properties,void 0);if(!m)return;if(s.id.type===pe.AST_NODE_TYPES.ObjectPattern){let d=Br(s.id.properties,a.returnProp);if(!d)return;for(let[c,g]of m)d.has(c)||e.report({node:g,messageId:"unusedSelectedValue",data:{name:c}});return}if(s.id.type!==pe.AST_NODE_TYPES.Identifier||a.returnProp)return;let y=_o(s,e.sourceCode);if(y.length===0)return;let u=new Set;for(let d of y){if(d.identifier.parent.type!==pe.AST_NODE_TYPES.MemberExpression)return;let c=d.identifier.parent.property;if(c.type!==pe.AST_NODE_TYPES.Identifier)return;u.add(c.name)}for(let[d,c]of m)u.has(d)||e.report({node:c,messageId:"unusedSelectedValue",data:{name:d}})}}}})};function jo(e,t,n){let r=e.arguments[t];if(!r)return null;if(r.type===pe.AST_NODE_TYPES.ArrowFunctionExpression||r.type===pe.AST_NODE_TYPES.FunctionExpression)return r;if(n&&r.type===pe.AST_NODE_TYPES.ObjectExpression){let s=r.properties.find(i=>i.type===pe.AST_NODE_TYPES.Property&&i.key.type===pe.AST_NODE_TYPES.Identifier&&i.key.name===n);if(s?.type!==pe.AST_NODE_TYPES.Property)return null;let o=s.value;if(o.type===pe.AST_NODE_TYPES.ArrowFunctionExpression||o.type===pe.AST_NODE_TYPES.FunctionExpression)return o}return null}function Mo(e){return e.callee.type===pe.AST_NODE_TYPES.Identifier?e.callee.name:e.callee.type===pe.AST_NODE_TYPES.MemberExpression&&e.callee.property.type===pe.AST_NODE_TYPES.Identifier?e.callee.property.name:null}function $o(e){if(e.body.type===pe.AST_NODE_TYPES.ObjectExpression)return e.body;if(e.body.type===pe.AST_NODE_TYPES.BlockStatement){let t=e.body.body.filter(n=>n.type===pe.AST_NODE_TYPES.ReturnStatement);return t.length!==1||!t[0]||t[0].argument?.type!==pe.AST_NODE_TYPES.ObjectExpression?null:t[0].argument}return null}function Br(e,t){let n=e;if(t){let s=e.find(o=>o.type===pe.AST_NODE_TYPES.Property&&o.key.type===pe.AST_NODE_TYPES.Identifier&&o.key.name===t);if(s?.type!==pe.AST_NODE_TYPES.Property||s.value.type!==pe.AST_NODE_TYPES.ObjectPattern)return null;n=s.value.properties}let r=new Map;for(let s of n){if(s.type!==pe.AST_NODE_TYPES.Property||s.key.type!==pe.AST_NODE_TYPES.Identifier)return null;r.set(s.key.name,s)}return r.size>0?r:null}function _o(e,t){let n=t.getDeclaredVariables(e);if(n.length!==1)return[];let r=n[0];return r?r.references.filter(s=>s.identifier!==e.id):[]}var ce=require("@typescript-eslint/utils");var In=z({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===ce.AST_NODE_TYPES.ImportDeclaration&&o.source.value==="t-state-form"))return{};let r=null,s=!1;return{CallExpression(o){if(s)return;if(!r){let a=Uo(o);a&&(r=a);return}let i=zo(o,e.sourceCode);if(i){s=!0;for(let a of i)r.delete(a);if(r.size!==0)for(let[a,l]of r)e.report({node:l,messageId:"unusedField",data:{name:a}})}}}}});function Uo(e){if(!(e.callee.type===ce.AST_NODE_TYPES.Identifier&&e.callee.name==="useForm"))return null;let n=e.arguments[0];if(!n||n.type!==ce.AST_NODE_TYPES.ObjectExpression)return null;let r=en(n.properties,o=>o.type!==ce.AST_NODE_TYPES.Property||o.key.type!==ce.AST_NODE_TYPES.Identifier||o.key.name!=="initialConfig"?null:o.value.type===ce.AST_NODE_TYPES.ObjectExpression?o.value:o.value.type===ce.AST_NODE_TYPES.ArrowFunctionExpression||o.value.type===ce.AST_NODE_TYPES.FunctionExpression?Vo(o.value):null);if(!r)return null;let s=new Map;for(let o of r.properties)o.type===ce.AST_NODE_TYPES.Property&&o.key.type===ce.AST_NODE_TYPES.Identifier&&s.set(o.key.name,o);return s}function zo(e,t){if(!(e.callee.type===ce.AST_NODE_TYPES.Identifier&&e.callee.name==="useFormState")||e.parent.type!==ce.AST_NODE_TYPES.VariableDeclarator||e.parent.id.type!==ce.AST_NODE_TYPES.ObjectPattern||!en(e.parent.id.properties,i=>i.type===ce.AST_NODE_TYPES.Property&&i.key.type===ce.AST_NODE_TYPES.Identifier&&i.key.name==="formFields"&&i))return null;let s=vr(e.parent,"formFields",t),o=new Set;for(let{identifier:i}of s){if(i.type!==ce.AST_NODE_TYPES.Identifier||i.parent.type===ce.AST_NODE_TYPES.Property&&i.parent.parent.type===ce.AST_NODE_TYPES.ObjectExpression&&i.parent.parent.parent.type===ce.AST_NODE_TYPES.ReturnStatement||i.parent.type===ce.AST_NODE_TYPES.ReturnStatement)return null;if(i.parent.type===ce.AST_NODE_TYPES.MemberExpression){if(i.parent.object.type!==ce.AST_NODE_TYPES.Identifier||i.parent.property.type!==ce.AST_NODE_TYPES.Identifier)return null;o.add(i.parent.property.name)}}return o}function Vo(e){if(e.body.type===ce.AST_NODE_TYPES.ObjectExpression)return e.body;if(e.body.type===ce.AST_NODE_TYPES.BlockStatement){let t=e.body.body.filter(n=>n.type===ce.AST_NODE_TYPES.ReturnStatement);return t.length!==1||!t[0]||t[0].argument?.type!==ce.AST_NODE_TYPES.ObjectExpression?null:t[0].argument}return null}var se=require("@typescript-eslint/utils"),It=require("zod/v4");var Wo=se.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`);function Hr(e){let t=[];for(let n of e.members)n.type===se.AST_NODE_TYPES.TSPropertySignature&&n.key.type===se.AST_NODE_TYPES.Identifier&&t.push([n.key.name,n]);return t}function Yr(e,...t){for(let n of t)e.set(...n);return e}var Jo=It.z.object({forceCheckOnFCPropTypesWithName:It.z.array(It.z.string()).optional(),alwaysCheckFunctionOptionTypes:It.z.boolean().optional()}),qr="no-unused-type-props-in-args",An=null,Xo=Wo({name:qr,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:[U(Jo)],fixable:"code"},defaultOptions:[{alwaysCheckFunctionOptionTypes:!0}],create(e,[t]){let{forceCheckOnFCPropTypesWithName:n,alwaysCheckFunctionOptionTypes:r=!0}=t;n&&!An&&(An=n.map(l=>new RegExp(l)));function s(l,p,m,y,u=!0,d=!1){let c=m.name,g=e.sourceCode.getScope(p).references.find(T=>T.identifier.name===c)?.resolved,h=l&&An?.some(T=>T.test(c)),S=d&&r;if(!g||!h&&g.references.filter(T=>T.isTypeReference).length>1||!g.defs[0])return;let I=g.defs[0].node,A=I.parent?.type===se.AST_NODE_TYPES.ExportNamedDeclaration;if(!(u&&A&&!S)){if(I.type===se.AST_NODE_TYPES.TSTypeAliasDeclaration){o(l,p,y,I.typeAnnotation,!0,d);return}if(I.type===se.AST_NODE_TYPES.TSInterfaceDeclaration){o(l,p,y,I.body,!0,d);return}}}function o(l,p,m,y,u,d=!1){if(y.type===se.AST_NODE_TYPES.TSInterfaceBody){for(let c of y.body)c.type===se.AST_NODE_TYPES.TSPropertySignature&&c.key.type===se.AST_NODE_TYPES.Identifier&&m.set(c.key.name,c);return}if(y.type===se.AST_NODE_TYPES.TSTypeLiteral){Yr(m,...Hr(y));return}if(y.type===se.AST_NODE_TYPES.TSIntersectionType){for(let c of y.types)o(l,p,m,c,!0,d);return}u||y.type===se.AST_NODE_TYPES.TSTypeReference&&y.typeName.type===se.AST_NODE_TYPES.Identifier&&s(l,p,y.typeName,m,!0,d)}function i(l,p,m,y=!1){for(let u of m)if(u.type===se.AST_NODE_TYPES.ObjectPattern&&u.typeAnnotation){let d=new Map;if(o(l,p,d,u.typeAnnotation.typeAnnotation,!1,y),d.size===0)continue;a(u,d)}else u.type===se.AST_NODE_TYPES.AssignmentPattern&&u.left.type===se.AST_NODE_TYPES.ObjectPattern&&i(l,p,[u.left],y)}function a(l,p){let m=[];if(l.properties.at(-1)?.type===se.AST_NODE_TYPES.RestElement)return;for(let c of l.properties)c.type===se.AST_NODE_TYPES.Property&&c.key.type===se.AST_NODE_TYPES.Identifier&&m.push(c.key.name);let u=[],d=[];for(let[c,g]of p)m.includes(c)||(d.push(c),u.push({node:g,messageId:"unusedObjectTypeProperty",data:{propertyName:c}}));for(let[c,g]of u.entries())e.report({...g,fix:c===u.length-1?h=>{let S=l.properties.at(-1),I=d.join(", ");return S?S.type===se.AST_NODE_TYPES.RestElement?null:h.insertTextAfter(S,`, ${I}`):h.insertTextBeforeRange([l.range[0]+1,l.range[1]],I)}:void 0})}return{VariableDeclaration(l){let p=l.declarations[0],m=new Map,y=p.id.type===se.AST_NODE_TYPES.Identifier&&p.id.typeAnnotation?.typeAnnotation.type===se.AST_NODE_TYPES.TSTypeReference&&p.id.typeAnnotation.typeAnnotation.typeName.type===se.AST_NODE_TYPES.Identifier&&p.id.typeAnnotation.typeAnnotation.typeName.name==="FC"&&p.id.typeAnnotation.typeAnnotation.typeArguments?.params[0];if(y){if(y.type===se.AST_NODE_TYPES.TSTypeReference&&y.typeName.type===se.AST_NODE_TYPES.Identifier)s(!0,l,y.typeName,m,!1);else if(y.type===se.AST_NODE_TYPES.TSTypeLiteral)Yr(m,...Hr(y));else if(y.type===se.AST_NODE_TYPES.TSIntersectionType)for(let u of y.types)u.type===se.AST_NODE_TYPES.TSTypeReference&&u.typeName.type===se.AST_NODE_TYPES.Identifier?s(!0,l,u.typeName,m,!1):o(!0,l,m,u,!0);if(m.size!==0&&p.init?.type===se.AST_NODE_TYPES.ArrowFunctionExpression){let u=p.init.params[0];if(!u){e.report({node:p.init,messageId:"missingComponentParam"});return}u.type===se.AST_NODE_TYPES.ObjectPattern&&a(u,m)}}},FunctionDeclaration(l){i(!1,l,l.params,r)},ArrowFunctionExpression(l){i(!1,l,l.params,r)}}}}),wn={name:qr,rule:Xo};var Le=require("@typescript-eslint/utils");var Fn=z({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 n(r){return r.callee.type===Le.AST_NODE_TYPES.Identifier?t.has(r.callee.name):r.callee.type===Le.AST_NODE_TYPES.MemberExpression&&r.callee.object.type===Le.AST_NODE_TYPES.Identifier&&r.callee.property.type===Le.AST_NODE_TYPES.Identifier?r.callee.property.name==="useRef":!1}return{ImportDeclaration(r){if(r.source.value==="react")for(let s of r.specifiers)s.type===Le.AST_NODE_TYPES.ImportSpecifier&&s.imported.type===Le.AST_NODE_TYPES.Identifier&&s.imported.name==="useRef"&&t.add(s.local.name)},VariableDeclarator(r){if(r.init&&r.init.type===Le.AST_NODE_TYPES.CallExpression&&n(r.init)&&r.id.type===Le.AST_NODE_TYPES.Identifier){let o=e.sourceCode.getScope(r).set.get(r.id.name);if(o){let i=!1;for(let a of o.references){let p=a.identifier.parent;if(p!==r&&!(p.type===Le.AST_NODE_TYPES.JSXExpressionContainer&&p.parent.type===Le.AST_NODE_TYPES.JSXAttribute&&p.parent.name.type===Le.AST_NODE_TYPES.JSXIdentifier&&p.parent.name.name==="ref")){i=!0;break}}i||e.report({node:r.id,messageId:"refNotRead",data:{name:r.id.name}})}}}}}});var mt=require("@typescript-eslint/utils"),Bo=mt.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),Gr="prefer-named-functions",Zr=new Map,Ho=Bo({name:Gr,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 n=null;if(t.ignoreRegex){let r=Zr.get(t.ignoreRegex);r?n=r:(n=new RegExp(t.ignoreRegex),Zr.set(t.ignoreRegex,n))}return{VariableDeclarator(r){if(r.init&&r.init.type===mt.AST_NODE_TYPES.ArrowFunctionExpression&&r.id.type===mt.AST_NODE_TYPES.Identifier){let s=r.id.name;if(r.id.typeAnnotation||n&&n.test(s)||!t.disallowArrowFnWithImplicitReturns&&r.init.body.type!==mt.AST_NODE_TYPES.BlockStatement)return;let o=r.parent,i=r.init.params,a=r.init.body,l=r.init;e.report({node:r.id,messageId:n?"withIgnoreRegex":"default",data:{functionName:s,ignoreRegex:t.ignoreRegex},suggest:[{messageId:"suggestion",fix:p=>p.replaceText(o,`${l.async?"async ":""}function ${s}(${i.map(m=>e.sourceCode.getText(m)).join(", ")||""}) ${e.sourceCode.getText(a)}`)}]})}}}}}),vn={name:Gr,rule:Ho};var K=require("@typescript-eslint/utils"),ze=require("zod/v4");var Yo=ze.z.object({disallowedFunctions:ze.z.array(ze.z.object({name:ze.z.string(),allowUsingWithArgs:ze.z.boolean().optional(),hookAlternative:ze.z.string().optional(),message:ze.z.string().optional(),allowUseInside:ze.z.array(ze.z.string()).optional()}))}),qo=/^use[A-Z]/,Zo=/^[A-Z]/;function Dt(e){return qo.test(e)}function Kr(e){return Zo.test(e)}function Go(e){return e.type===K.AST_NODE_TYPES.Identifier?Dt(e.name):e.type===K.AST_NODE_TYPES.MemberExpression&&e.property.type===K.AST_NODE_TYPES.Identifier?Dt(e.property.name):!1}function Qr(e,t){return e.type===K.AST_NODE_TYPES.Identifier?e.name===t:e.type===K.AST_NODE_TYPES.MemberExpression&&e.object.type===K.AST_NODE_TYPES.Identifier&&e.property.type===K.AST_NODE_TYPES.Identifier?e.object.name==="React"&&e.property.name===t:!1}function ei(e){return!!(e.parent&&e.parent.type===K.AST_NODE_TYPES.CallExpression&&Qr(e.parent.callee,"forwardRef"))}function ti(e){return!!(e.parent&&e.parent.type===K.AST_NODE_TYPES.CallExpression&&Qr(e.parent.callee,"memo"))}function Rn(e){if(e.type===K.AST_NODE_TYPES.FunctionDeclaration||e.type===K.AST_NODE_TYPES.FunctionExpression&&e.id)return e.id||void 0;if(e.type===K.AST_NODE_TYPES.FunctionExpression||e.type===K.AST_NODE_TYPES.ArrowFunctionExpression){if(e.parent.type===K.AST_NODE_TYPES.VariableDeclarator&&e.parent.init===e)return e.parent.id;if(e.parent.type===K.AST_NODE_TYPES.AssignmentExpression&&e.parent.right===e&&e.parent.operator==="=")return e.parent.left;if(e.parent.type===K.AST_NODE_TYPES.Property&&e.parent.value===e&&!e.parent.computed)return e.parent.key;if(e.parent.type===K.AST_NODE_TYPES.AssignmentPattern&&e.parent.right===e)return e.parent.left}}function Ko(e){let t=e.parent,n=!1;for(;t;){if(t.type===K.AST_NODE_TYPES.FunctionDeclaration||t.type===K.AST_NODE_TYPES.FunctionExpression||t.type===K.AST_NODE_TYPES.ArrowFunctionExpression){let r=Rn(t);if(r&&r.type===K.AST_NODE_TYPES.Identifier){if(Kr(r.name)||Dt(r.name))return!n;n=!0}else{if(ei(t)||ti(t))return!n;if(t.parent.type===K.AST_NODE_TYPES.CallExpression){let s=t.parent;Go(s.callee)||(n=!0)}else t.parent.type===K.AST_NODE_TYPES.JSXExpressionContainer||(n=!0)}}t=t.parent}return!1}function ni(e){return e.callee.type===K.AST_NODE_TYPES.Identifier?e.callee.name:e.callee.type===K.AST_NODE_TYPES.MemberExpression&&e.callee.property.type===K.AST_NODE_TYPES.Identifier?e.callee.property.name:null}function Qo(e,t){if(!t.length)return!1;let n=e.parent;for(;n;){if(n.type===K.AST_NODE_TYPES.FunctionDeclaration||n.type===K.AST_NODE_TYPES.FunctionExpression||n.type===K.AST_NODE_TYPES.ArrowFunctionExpression){let r=Rn(n);if(r&&r.type===K.AST_NODE_TYPES.Identifier&&t.includes(r.name))return!0}else if(n.type===K.AST_NODE_TYPES.CallExpression){let r=ni(n);if(r&&t.includes(r))return!0}n=n.parent}return!1}function ea(e){return e.arguments.length>0&&!e.arguments.every(t=>t.type===K.AST_NODE_TYPES.Identifier&&t.name==="undefined")}function ta(e,t){let n=!1,r=e.parent;for(;r;){if(r.type===K.AST_NODE_TYPES.FunctionDeclaration||r.type===K.AST_NODE_TYPES.FunctionExpression||r.type===K.AST_NODE_TYPES.ArrowFunctionExpression){let s=Rn(r);if(s&&s.type===K.AST_NODE_TYPES.Identifier){if(Kr(s.name)||Dt(s.name)){n=!0;break}}else if(ei(r)||ti(r)){n=!0;break}}r=r.parent}return n?t.length===0?Ko(e):!Qo(e,t):!1}var Nn=z({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:[U(Yo)],hasSuggestions:!0},defaultOptions:[{disallowedFunctions:[]}],create(e,[t]){let{disallowedFunctions:n}=t,r=new Map(n.map(s=>[s.name,s]));return{CallExpression(s){let o=ni(s);if(!o)return;let i=r.get(o);if(!i||i.allowUsingWithArgs&&ea(s))return;let a=i.allowUseInside||[];ta(s,a)&&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:l=>{let p=i.hookAlternative;return p?s.callee.type===K.AST_NODE_TYPES.Identifier?l.replaceText(s.callee,p):s.callee.type===K.AST_NODE_TYPES.MemberExpression&&s.callee.property.type===K.AST_NODE_TYPES.Identifier?l.replaceText(s.callee.property,p):null:null}}]:[]})}}}});var fe=require("@typescript-eslint/utils"),Lt=Re(require("zod/v4"));var na=fe.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),ii="prefer-single-line-if",ra=Lt.default.object({maxLineLength:Lt.default.number().optional(),maxNonSimpleConditionLength:Lt.default.number().optional()}),ia=na({name:ii,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:[U(ra)]},defaultOptions:[{}],create(e,[t]){let n=e.sourceCode;return{IfStatement(r){if(r.consequent.type!==fe.AST_NODE_TYPES.BlockStatement||r.loc.start.line===r.loc.end.line||n.getCommentsInside(r.consequent).length>0||r.alternate||r.consequent.body.length!==1)return;let o=r.consequent.body[0];if(!o)return;if(o.type===fe.AST_NODE_TYPES.ReturnStatement){if(!oi(o))return}else if(!(o.type===fe.AST_NODE_TYPES.ContinueStatement||o.type===fe.AST_NODE_TYPES.BreakStatement))return;if(r.test.type===fe.AST_NODE_TYPES.LogicalExpression||r.test.type===fe.AST_NODE_TYPES.ConditionalExpression)return;let i;if(t.maxNonSimpleConditionLength){let y=ri(r.test);if(!y&&r.test.type===fe.AST_NODE_TYPES.UnaryExpression&&r.test.operator==="!"){let u=r.test.argument;ri(u)&&(y=!0)}if(y&&(i=n.getText(r.test),i.length>t.maxNonSimpleConditionLength))return}i||(i=n.getText(r.test));let a=n.getText(o);if(i.includes(`
18
- `))return;let l=n.getTokenAfter(r);if(l&&l.type===fe.AST_TOKEN_TYPES.Punctuator&&l.value==="}"){let y=n.getTokenAfter(l);if(y&&y.type===fe.AST_TOKEN_TYPES.Keyword&&(y.value==="else"||y.value==="catch"))return}let p=sa(n,r),m=`if (${i}) ${a}`;t.maxLineLength&&m.length+p.length>t.maxLineLength||e.report({node:r,messageId:"noSingleLineCurly",fix:y=>y.replaceText(r,m)})}}}});function ri(e){return e.type===fe.AST_NODE_TYPES.CallExpression||e.type===fe.AST_NODE_TYPES.BinaryExpression||e.type===fe.AST_NODE_TYPES.MemberExpression&&si(e)}function si(e){return e.object.type===fe.AST_NODE_TYPES.MemberExpression?si(e.object):e.object.type!==fe.AST_NODE_TYPES.Identifier}function sa(e,t){return e.text.slice(t.range[0]-t.loc.start.column,t.range[0])}function oi(e){if(!e.argument)return!0;let t=e.argument;return t.type===fe.AST_NODE_TYPES.ArrayExpression&&t.elements.length===0||t.type===fe.AST_NODE_TYPES.ObjectExpression&&t.properties.length===0||t.type===fe.AST_NODE_TYPES.Literal||t.type===fe.AST_NODE_TYPES.Identifier||t.type===fe.AST_NODE_TYPES.TemplateLiteral||t.type===fe.AST_NODE_TYPES.TaggedTemplateExpression?!0:t.type===fe.AST_NODE_TYPES.CallExpression?t.arguments.length===0:t.type===fe.AST_NODE_TYPES.UnaryExpression?oi(t):!1}var kn={name:ii,rule:ia};var j=require("@typescript-eslint/utils"),On=require("zod/v4");var oa=j.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),ui="react-compiler-extra",aa=On.z.object({runOnlyWithEnableCompilerDirective:On.z.boolean().optional()}),la=/eslint +react-compiler\/react-compiler: +\["error/;function yt(e){let t=null;if((e.type===j.AST_NODE_TYPES.FunctionDeclaration||e.type===j.AST_NODE_TYPES.FunctionExpression||e.type===j.AST_NODE_TYPES.ArrowFunctionExpression&&e.body.type===j.AST_NODE_TYPES.BlockStatement)&&(t=e.body),!t||t.body.length===0)return!1;let n=t.body[0];return n?n.type===j.AST_NODE_TYPES.ExpressionStatement&&n.expression.type===j.AST_NODE_TYPES.Literal&&n.expression.value==="use no memo":!1}function ai(e){let t=e.parent;for(;t;){if(t.type===j.AST_NODE_TYPES.FunctionDeclaration||t.type===j.AST_NODE_TYPES.FunctionExpression||t.type===j.AST_NODE_TYPES.ArrowFunctionExpression)return t;t=t.parent}return null}function pa(e){return e.type===j.AST_NODE_TYPES.Identifier?e.name.startsWith("use"):!1}function fi(e){return e.type===j.AST_NODE_TYPES.Identifier?e.name.startsWith("use"):e.type===j.AST_NODE_TYPES.MemberExpression&&e.property.type===j.AST_NODE_TYPES.Identifier?e.property.name.startsWith("use"):!1}function Ve(e){if(!e)return!1;switch(e.type){case j.AST_NODE_TYPES.JSXElement:case j.AST_NODE_TYPES.JSXFragment:return!0;case j.AST_NODE_TYPES.ConditionalExpression:return Ve(e.consequent)||Ve(e.alternate);case j.AST_NODE_TYPES.LogicalExpression:return e.operator==="&&"?Ve(e.right):e.operator==="||"?Ve(e.left)||Ve(e.right):!1;case j.AST_NODE_TYPES.CallExpression:if(e.callee.type===j.AST_NODE_TYPES.MemberExpression&&e.callee.object.type===j.AST_NODE_TYPES.Identifier&&e.callee.object.name==="React"&&e.callee.property.type===j.AST_NODE_TYPES.Identifier&&e.callee.property.name==="createElement")return!0;for(let t of e.arguments)if(t.type!==j.AST_NODE_TYPES.SpreadElement&&Ve(t))return!0;return!1;default:return!1}}function ca(e){let t=e.typeAnnotation;if(t.type===j.AST_NODE_TYPES.TSTypeReference){if(t.typeName.type===j.AST_NODE_TYPES.Identifier)return t.typeName.name==="FC";if(t.typeName.type===j.AST_NODE_TYPES.TSQualifiedName&&t.typeName.left.type===j.AST_NODE_TYPES.Identifier&&t.typeName.right.type===j.AST_NODE_TYPES.Identifier)return t.typeName.left.name==="React"&&t.typeName.right.name==="FC"}return!1}var ua=/^[A-Z][a-zA-Z0-9]*$/;function wt(e){return ua.test(e)}function jt(e){return e.startsWith("use")&&e.length>3}function Dn(e,t,n,r){if(n&&ca(n))return t?wt(t.name):e.type===j.AST_NODE_TYPES.FunctionDeclaration&&e.id?wt(e.id.name):!0;if(t&&jt(t.name)||e.type===j.AST_NODE_TYPES.FunctionDeclaration&&e.id&&jt(e.id.name))return!0;if(r){let s=t?.name||e.type===j.AST_NODE_TYPES.FunctionDeclaration&&e.id?.name;if(s&&wt(s)&&mi(e.body,r).containsJSX)return!0}return!1}function At(e){if(e.body.type===j.AST_NODE_TYPES.BlockStatement){for(let t of e.body.body)if(t.type===j.AST_NODE_TYPES.ExpressionStatement&&t.expression.type===j.AST_NODE_TYPES.Literal&&typeof t.expression.value=="string"&&t.expression.value==="use memo")return!0}return!1}function mi(e,t){let n={containsJSX:!1,containsHookCalls:!1};return _e(e,r=>{if(n.containsJSX&&n.containsHookCalls)return!0;switch(r.type){case j.AST_NODE_TYPES.JSXElement:case j.AST_NODE_TYPES.JSXFragment:n.containsJSX=!0;break;case j.AST_NODE_TYPES.CallExpression:pa(r.callee)&&(n.containsHookCalls=!0),Ve(r)&&(n.containsJSX=!0);break;case j.AST_NODE_TYPES.ReturnStatement:r.argument&&Ve(r.argument)&&(n.containsJSX=!0);break;case j.AST_NODE_TYPES.VariableDeclarator:r.init&&Ve(r.init)&&(n.containsJSX=!0);break;case j.AST_NODE_TYPES.AssignmentExpression:Ve(r.right)&&(n.containsJSX=!0);break}},t),n}function li(e,t){let n=e.body,r=mi(n,t);return r.containsJSX||r.containsHookCalls}var fa=/\bthis[.[]/;function pi(e){return fa.test(e)}function ma(e,t){let n={containsJSX:!1,containsHookCalls:!1};return _e(e,r=>{if(n.containsHookCalls||(r.type===j.AST_NODE_TYPES.FunctionDeclaration||r.type===j.AST_NODE_TYPES.FunctionExpression||r.type===j.AST_NODE_TYPES.ArrowFunctionExpression)&&r!==e)return!0;r.type===j.AST_NODE_TYPES.CallExpression&&fi(r.callee)&&(n.containsHookCalls=!0)},t),n}function ci(e){return wt(e)||jt(e)}function Pn(e,t,n,r){if(!ma(e.body,t).containsHookCalls)return!1;let o=Dn(e,n,r,t);if(!o&&r){let i=n?.name||e.type===j.AST_NODE_TYPES.FunctionDeclaration&&e.id?.name;i&&wt(i)&&(o=!0)}return!o}var ya=oa({name:ui,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:[U(aa)]},defaultOptions:[{}],create(e,[t]){let n=!1;if(t.runOnlyWithEnableCompilerDirective){for(let i of e.sourceCode.getAllComments())if(la.test(i.value)){n=!0;break}if(!n)return{}}function r(i){for(let a of i.properties)if(a.type===j.AST_NODE_TYPES.Property&&a.method&&a.value.type===j.AST_NODE_TYPES.FunctionExpression){let l=e.sourceCode,p=l.getText(a.key),m=a.value,y=l.getText(m.body);if(pi(y))e.report({node:a,messageId:"thisKeywordInMethod"});else{let u=m.params.map(c=>l.getText(c)).join(", "),d="";m.generator?d=`${p}: function* (${u}) ${y}`:m.async?d=`${p}: async (${u}) => ${y}`:d=`${p}: (${u}) => ${y}`,e.report({node:a,messageId:"objectMethodIsNotSupported",fix:c=>c.replaceText(a,d)})}}}function s(i){for(let a of i.properties)if(a.type===j.AST_NODE_TYPES.Property&&a.value.type===j.AST_NODE_TYPES.ObjectExpression){for(let l of a.value.properties)if(l.type===j.AST_NODE_TYPES.Property&&l.method&&l.value.type===j.AST_NODE_TYPES.FunctionExpression){let m=e.sourceCode.getText(l.value.body);pi(m)&&e.report({node:l,messageId:"thisKeywordInMethod"})}}}function o(i){let a=ai(i);return a!==null&&yt(a)}return{CallExpression(i){if(fi(i.callee))for(let a of i.arguments){if(a.type===j.AST_NODE_TYPES.ObjectExpression){if(o(i))return;r(a),s(a)}if(a.type===j.AST_NODE_TYPES.ArrowFunctionExpression){if(a.body.type===j.AST_NODE_TYPES.ObjectExpression){if(o(i))return;r(a.body),s(a.body)}if(a.body.type===j.AST_NODE_TYPES.BlockStatement){for(let l of a.body.body)if(l.type===j.AST_NODE_TYPES.ReturnStatement&&l.argument?.type===j.AST_NODE_TYPES.ObjectExpression){if(o(i))return;r(l.argument),s(l.argument)}}}if(a.type===j.AST_NODE_TYPES.FunctionExpression){for(let l of a.body.body)if(l.type===j.AST_NODE_TYPES.ReturnStatement&&l.argument?.type===j.AST_NODE_TYPES.ObjectExpression){if(o(i))return;r(l.argument),s(l.argument)}}}},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)){let a=i.init,l=i.id,p=i.id.typeAnnotation;if(At(a)&&!ci(l.name)){e.report({node:a,messageId:"useMemoDirectiveNaming"});return}if(Pn(a,e.sourceCode,l,p)){if(yt(a))return;e.report({node:a,messageId:"functionCallingHooksMustBeComponent"});return}if(Dn(a,l,p,e.sourceCode)){let m=li(a,e.sourceCode),y=At(a);if(!m&&!y){if(yt(a))return;e.report({node:a,messageId:"fcComponentShouldReturnJsx",suggest:[{messageId:"addUseMemoDirective",fix(u){if(a.body.type===j.AST_NODE_TYPES.BlockStatement){let d=a.body.range[0]+1;return u.insertTextAfterRange([d,d],`
17
+ `)}return""}return{Program(){let l=[];for(let u of r.body)u.type===Ne.AST_NODE_TYPES.ExpressionStatement&&u.expression.type===Ne.AST_NODE_TYPES.CallExpression&&u.expression.callee.type===Ne.AST_NODE_TYPES.Identifier&&u.expression.callee.name==="describe"&&u.expression.arguments.length===2&&l.push(u.expression);if(!i(l))return;let[p]=l;if(!p)return;let m=s(p);if(o(m))return;let y=r.body.find(u=>u.type===Ne.AST_NODE_TYPES.ExpressionStatement&&u.expression===p);!y||y.type!==Ne.AST_NODE_TYPES.ExpressionStatement||e.report({node:p,messageId:"unnecessaryDescribe",suggest:[{messageId:"removeDescribe",fix(u){let d=a(p);return d?u.replaceText(y,d):null}}]})}}}});var Ct=require("@typescript-eslint/utils"),Ue=Re(require("zod/v4"));var Do=Ue.object({methods:Ue.union([Ue.array(Ue.string()),Ue.literal("array")])}),En=z({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:[U(Do)]},defaultOptions:[{methods:"array"}],create(e,[t]){let n=t.methods,r=new Set(["find","filter","map","forEach","some","every","reduce","findIndex","sort"]);function s(a){return Array.isArray(n)?n.includes(a):r.has(a)}function o(a){let{callee:l}=a;if(l.type===Ct.AST_NODE_TYPES.MemberExpression){let p=l.property;if(p.type===Ct.AST_NODE_TYPES.Identifier)return p.name}return null}function i(a,l){if(a.type!==Ct.AST_NODE_TYPES.Identifier||!a.typeAnnotation)return;let p=l.parent;if(p.type===Ct.AST_NODE_TYPES.CallExpression){let m=o(p);m&&s(m)&&p.arguments.indexOf(l)===0&&e.report({node:a.typeAnnotation,messageId:"unnecessaryTypeAnnotation",fix(u){return a.typeAnnotation?u.remove(a.typeAnnotation):null}})}}return{ArrowFunctionExpression(a){for(let l of a.params)i(l,a)},FunctionExpression(a){for(let l of a.params)i(l,a)}}}});var Fe=require("@typescript-eslint/utils");var hn=z({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===Fe.AST_NODE_TYPES.ObjectPattern||!t.init||t.init.type!==Fe.AST_NODE_TYPES.ObjectExpression||t.id.type===Fe.AST_NODE_TYPES.Identifier&&t.id.typeAnnotation||t.parent.parent.type===Fe.AST_NODE_TYPES.ExportNamedDeclaration)return;let n=new Map;for(let i of t.init.properties)i.type===Fe.AST_NODE_TYPES.Property&&i.key.type===Fe.AST_NODE_TYPES.Identifier&&n.set(i.key.name,i);if(n.size===0||t.id.type!==Fe.AST_NODE_TYPES.Identifier)return;let r=Lo(t,e.sourceCode);if(r.length===0)return;let s=t.init.properties.some(i=>i.type!==Fe.AST_NODE_TYPES.Property?!1:i.value.type===Fe.AST_NODE_TYPES.FunctionExpression),o=new Set;for(let i of r){if(i.identifier.parent.type!==Fe.AST_NODE_TYPES.MemberExpression)return;let a=i.identifier.parent;if(a.object!==i.identifier)return;if(a.computed)if(a.property.type===Fe.AST_NODE_TYPES.Literal&&typeof a.property.value=="string")o.add(a.property.value);else return;else{if(a.property.type!==Fe.AST_NODE_TYPES.Identifier)return;o.add(a.property.name)}if(a.parent.type===Fe.AST_NODE_TYPES.CallExpression&&s)return}for(let[i,a]of n)o.has(i)||e.report({node:a,messageId:"unusedObjectProperty",data:{name:i}})}}}});function Lo(e,t){let n=t.getDeclaredVariables(e);if(n.length!==1)return[];let r=n[0];return r?r.references.filter(s=>s.identifier!==e.id):[]}var te=require("@typescript-eslint/utils"),bn=require("zod/v4");var jo=bn.z.object({ignoreArgsMatching:bn.z.string().optional()}),xn=z({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:[U(jo)]},defaultOptions:[{}],create(e,[t]){let n=[];function r(i){return t.ignoreArgsMatching?new RegExp(t.ignoreArgsMatching).test(i):!1}function s(i){return i.type===te.AST_NODE_TYPES.ExportNamedDeclaration||i.type===te.AST_NODE_TYPES.ExportDefaultDeclaration||i.parent?.type===te.AST_NODE_TYPES.ExportNamedDeclaration||i.parent?.type===te.AST_NODE_TYPES.ExportDefaultDeclaration}function o(i){let a=[];for(let l=0;l<i.length;l++){let p=i[l];if(!p||p.type!==te.AST_NODE_TYPES.Identifier)continue;let m=p.name;if(!r(m)){if(p.optional&&p.typeAnnotation&&p.typeAnnotation.typeAnnotation.type===te.AST_NODE_TYPES.TSTypeLiteral){let y=p.typeAnnotation.typeAnnotation,u=[];for(let d of y.members)d.type===te.AST_NODE_TYPES.TSPropertySignature&&d.key.type===te.AST_NODE_TYPES.Identifier&&u.push({name:d.key.name,optional:d.optional===!0});u.some(d=>d.optional)?a.push({param:p,index:l,name:m,isObjectParam:!0,objectProps:u}):a.push({param:p,index:l,name:m,isObjectParam:!1})}else if(p.optional)a.push({param:p,index:l,name:m,isObjectParam:!1});else if(p.typeAnnotation&&p.typeAnnotation.typeAnnotation.type===te.AST_NODE_TYPES.TSTypeLiteral){let y=p.typeAnnotation.typeAnnotation,u=[];for(let d of y.members)d.type===te.AST_NODE_TYPES.TSPropertySignature&&d.key.type===te.AST_NODE_TYPES.Identifier&&u.push({name:d.key.name,optional:d.optional===!0});u.some(d=>d.optional)&&a.push({param:p,index:l,name:m,isObjectParam:!0,objectProps:u})}}}return a}return{FunctionDeclaration(i){if(s(i))return;let a=o(i.params);a.length!==0&&n.push({node:i,declarationNode:i,optionalParams:a})},VariableDeclarator(i){if(i.id.type!==te.AST_NODE_TYPES.Identifier||!i.init||i.init.type!==te.AST_NODE_TYPES.ArrowFunctionExpression&&i.init.type!==te.AST_NODE_TYPES.FunctionExpression||s(i.parent.parent))return;let l=[...o(i.init.params)];if(i.id.typeAnnotation&&i.id.typeAnnotation.typeAnnotation.type===te.AST_NODE_TYPES.TSTypeReference){let p=i.id.typeAnnotation.typeAnnotation;if(p.typeName.type===te.AST_NODE_TYPES.Identifier&&p.typeName.name==="FC"){let m=p.typeArguments;if(m&&m.params.length===1){let y=m.params[0];if(y&&y.type===te.AST_NODE_TYPES.TSTypeLiteral){let u=[];for(let d of y.members)d.type===te.AST_NODE_TYPES.TSPropertySignature&&d.key.type===te.AST_NODE_TYPES.Identifier&&u.push({name:d.key.name,optional:d.optional===!0});u.some(d=>d.optional)&&l.push({param:i.id,index:0,name:"props",isObjectParam:!0,objectProps:u})}}}}l.length!==0&&n.push({node:i.init,declarationNode:i,optionalParams:l})},"Program:exit"(){for(let i of n){let l=e.sourceCode.getDeclaredVariables(i.declarationNode)[0];if(!l)continue;let p=l.references.filter(u=>u.identifier!==l.identifiers[0]);if(p.length===0)continue;let m=!1;for(let u of p){let d=u.identifier.parent;if(d.type===te.AST_NODE_TYPES.CallExpression&&u.identifier.type===te.AST_NODE_TYPES.Identifier&&d.arguments.includes(u.identifier)){m=!0;break}if(d.type===te.AST_NODE_TYPES.ReturnStatement){m=!0;break}if(d.type===te.AST_NODE_TYPES.Property&&d.parent.type===te.AST_NODE_TYPES.ObjectExpression&&d.parent.parent.type===te.AST_NODE_TYPES.ReturnStatement){m=!0;break}if(d.type===te.AST_NODE_TYPES.JSXExpressionContainer){m=!0;break}}if(m)continue;let y=[];for(let u of p){let d=u.identifier.parent;if(d.type===te.AST_NODE_TYPES.CallExpression&&d.callee===u.identifier){let c=d.arguments.length,g=d.arguments.some(S=>S.type===te.AST_NODE_TYPES.SpreadElement);if(g){m=!0;break}let h={argCount:c,hasSpread:g};for(let S of i.optionalParams)if(S.isObjectParam&&S.index<c){let I=d.arguments[S.index];if(I?.type===te.AST_NODE_TYPES.ObjectExpression){let A={};for(let T of I.properties)T.type===te.AST_NODE_TYPES.Property&&T.key.type===te.AST_NODE_TYPES.Identifier&&(A[T.key.name]=!0);h.objectArgs||(h.objectArgs=[]),h.objectArgs[S.index]=A}else if(I){m=!0;break}}y.push(h)}else if(d.type===te.AST_NODE_TYPES.JSXOpeningElement&&d.name===u.identifier){let c=d.attributes.some(h=>h.type===te.AST_NODE_TYPES.JSXSpreadAttribute);if(c){m=!0;break}let g={argCount:1,hasSpread:c};for(let h of i.optionalParams)if(h.isObjectParam&&h.index===0){let S={};for(let I of d.attributes)I.type===te.AST_NODE_TYPES.JSXAttribute&&I.name.type===te.AST_NODE_TYPES.JSXIdentifier&&(S[I.name.name]=!0);g.objectArgs||(g.objectArgs=[]),g.objectArgs[0]=S}y.push(g)}}if(!(m||y.length===0))for(let u of i.optionalParams)if(u.isObjectParam&&u.objectProps)for(let d of u.objectProps){if(!d.optional)continue;let c=!1;for(let g of y)if(g.objectArgs&&g.objectArgs[u.index]){let h=g.objectArgs[u.index];if(h&&h[d.name]){c=!0;break}}c||e.report({node:u.param,messageId:"unusedOptionalProp",data:{name:d.name}})}else{let d=!1;for(let c of y)if(c.argCount>u.index){d=!0;break}d||e.report({node:u.param,messageId:"unusedOptionalArg",data:{name:u.name}})}}}}}});var pe=require("@typescript-eslint/utils"),tt=require("zod/v4");var Mo=tt.z.object({selectors:tt.z.array(tt.z.object({name:tt.z.string(),selectorProp:tt.z.string().optional(),selectorArgPos:tt.z.number().optional(),returnProp:tt.z.string().optional()}))}),$o=pe.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),Xr="no-unused-selected-values",Cn={name:Xr,rule:$o({name:Xr,meta:{type:"suggestion",docs:{description:"Disallow unused values in selector objects"},messages:{unusedSelectedValue:'The selected value "{{name}}" is not being used'},schema:[U(Mo)]},defaultOptions:[{selectors:[]}],create(e,[t]){let{selectors:n=[]}=t,r=new Map(n.map(s=>[s.name,s]));return{VariableDeclarator(s){let o=null;if(s.init?.type===pe.AST_NODE_TYPES.CallExpression&&(o=s.init),!o)return;let i=Uo(o);if(!i)return;let a=r.get(i);if(!a)return;let l=_o(o,a.selectorArgPos??0,a.selectorProp);if(!l)return;let p=zo(l);if(!p)return;let m=Br(p.properties,void 0);if(!m)return;if(s.id.type===pe.AST_NODE_TYPES.ObjectPattern){let d=Br(s.id.properties,a.returnProp);if(!d)return;for(let[c,g]of m)d.has(c)||e.report({node:g,messageId:"unusedSelectedValue",data:{name:c}});return}if(s.id.type!==pe.AST_NODE_TYPES.Identifier||a.returnProp)return;let y=Vo(s,e.sourceCode);if(y.length===0)return;let u=new Set;for(let d of y){if(d.identifier.parent.type!==pe.AST_NODE_TYPES.MemberExpression)return;let c=d.identifier.parent.property;if(c.type!==pe.AST_NODE_TYPES.Identifier)return;u.add(c.name)}for(let[d,c]of m)u.has(d)||e.report({node:c,messageId:"unusedSelectedValue",data:{name:d}})}}}})};function _o(e,t,n){let r=e.arguments[t];if(!r)return null;if(r.type===pe.AST_NODE_TYPES.ArrowFunctionExpression||r.type===pe.AST_NODE_TYPES.FunctionExpression)return r;if(n&&r.type===pe.AST_NODE_TYPES.ObjectExpression){let s=r.properties.find(i=>i.type===pe.AST_NODE_TYPES.Property&&i.key.type===pe.AST_NODE_TYPES.Identifier&&i.key.name===n);if(s?.type!==pe.AST_NODE_TYPES.Property)return null;let o=s.value;if(o.type===pe.AST_NODE_TYPES.ArrowFunctionExpression||o.type===pe.AST_NODE_TYPES.FunctionExpression)return o}return null}function Uo(e){return e.callee.type===pe.AST_NODE_TYPES.Identifier?e.callee.name:e.callee.type===pe.AST_NODE_TYPES.MemberExpression&&e.callee.property.type===pe.AST_NODE_TYPES.Identifier?e.callee.property.name:null}function zo(e){if(e.body.type===pe.AST_NODE_TYPES.ObjectExpression)return e.body;if(e.body.type===pe.AST_NODE_TYPES.BlockStatement){let t=e.body.body.filter(n=>n.type===pe.AST_NODE_TYPES.ReturnStatement);return t.length!==1||!t[0]||t[0].argument?.type!==pe.AST_NODE_TYPES.ObjectExpression?null:t[0].argument}return null}function Br(e,t){let n=e;if(t){let s=e.find(o=>o.type===pe.AST_NODE_TYPES.Property&&o.key.type===pe.AST_NODE_TYPES.Identifier&&o.key.name===t);if(s?.type!==pe.AST_NODE_TYPES.Property||s.value.type!==pe.AST_NODE_TYPES.ObjectPattern)return null;n=s.value.properties}let r=new Map;for(let s of n){if(s.type!==pe.AST_NODE_TYPES.Property||s.key.type!==pe.AST_NODE_TYPES.Identifier)return null;r.set(s.key.name,s)}return r.size>0?r:null}function Vo(e,t){let n=t.getDeclaredVariables(e);if(n.length!==1)return[];let r=n[0];return r?r.references.filter(s=>s.identifier!==e.id):[]}var ce=require("@typescript-eslint/utils");var In=z({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===ce.AST_NODE_TYPES.ImportDeclaration&&o.source.value==="t-state-form"))return{};let r=null,s=!1;return{CallExpression(o){if(s)return;if(!r){let a=Wo(o);a&&(r=a);return}let i=Jo(o,e.sourceCode);if(i){s=!0;for(let a of i)r.delete(a);if(r.size!==0)for(let[a,l]of r)e.report({node:l,messageId:"unusedField",data:{name:a}})}}}}});function Wo(e){if(!(e.callee.type===ce.AST_NODE_TYPES.Identifier&&e.callee.name==="useForm"))return null;let n=e.arguments[0];if(!n||n.type!==ce.AST_NODE_TYPES.ObjectExpression)return null;let r=en(n.properties,o=>o.type!==ce.AST_NODE_TYPES.Property||o.key.type!==ce.AST_NODE_TYPES.Identifier||o.key.name!=="initialConfig"?null:o.value.type===ce.AST_NODE_TYPES.ObjectExpression?o.value:o.value.type===ce.AST_NODE_TYPES.ArrowFunctionExpression||o.value.type===ce.AST_NODE_TYPES.FunctionExpression?Xo(o.value):null);if(!r)return null;let s=new Map;for(let o of r.properties)o.type===ce.AST_NODE_TYPES.Property&&o.key.type===ce.AST_NODE_TYPES.Identifier&&s.set(o.key.name,o);return s}function Jo(e,t){if(!(e.callee.type===ce.AST_NODE_TYPES.Identifier&&e.callee.name==="useFormState")||e.parent.type!==ce.AST_NODE_TYPES.VariableDeclarator||e.parent.id.type!==ce.AST_NODE_TYPES.ObjectPattern||!en(e.parent.id.properties,i=>i.type===ce.AST_NODE_TYPES.Property&&i.key.type===ce.AST_NODE_TYPES.Identifier&&i.key.name==="formFields"&&i))return null;let s=vr(e.parent,"formFields",t),o=new Set;for(let{identifier:i}of s){if(i.type!==ce.AST_NODE_TYPES.Identifier||i.parent.type===ce.AST_NODE_TYPES.Property&&i.parent.parent.type===ce.AST_NODE_TYPES.ObjectExpression&&i.parent.parent.parent.type===ce.AST_NODE_TYPES.ReturnStatement||i.parent.type===ce.AST_NODE_TYPES.ReturnStatement)return null;if(i.parent.type===ce.AST_NODE_TYPES.MemberExpression){if(i.parent.object.type!==ce.AST_NODE_TYPES.Identifier||i.parent.property.type!==ce.AST_NODE_TYPES.Identifier)return null;o.add(i.parent.property.name)}}return o}function Xo(e){if(e.body.type===ce.AST_NODE_TYPES.ObjectExpression)return e.body;if(e.body.type===ce.AST_NODE_TYPES.BlockStatement){let t=e.body.body.filter(n=>n.type===ce.AST_NODE_TYPES.ReturnStatement);return t.length!==1||!t[0]||t[0].argument?.type!==ce.AST_NODE_TYPES.ObjectExpression?null:t[0].argument}return null}var se=require("@typescript-eslint/utils"),It=require("zod/v4");var Bo=se.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`);function Hr(e){let t=[];for(let n of e.members)n.type===se.AST_NODE_TYPES.TSPropertySignature&&n.key.type===se.AST_NODE_TYPES.Identifier&&t.push([n.key.name,n]);return t}function Yr(e,...t){for(let n of t)e.set(...n);return e}var Ho=It.z.object({forceCheckOnFCPropTypesWithName:It.z.array(It.z.string()).optional(),alwaysCheckFunctionOptionTypes:It.z.boolean().optional()}),qr="no-unused-type-props-in-args",An=null,Yo=Bo({name:qr,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:[U(Ho)],fixable:"code"},defaultOptions:[{alwaysCheckFunctionOptionTypes:!0}],create(e,[t]){let{forceCheckOnFCPropTypesWithName:n,alwaysCheckFunctionOptionTypes:r=!0}=t;n&&!An&&(An=n.map(l=>new RegExp(l)));function s(l,p,m,y,u=!0,d=!1){let c=m.name,g=e.sourceCode.getScope(p).references.find(T=>T.identifier.name===c)?.resolved,h=l&&An?.some(T=>T.test(c)),S=d&&r;if(!g||!h&&g.references.filter(T=>T.isTypeReference).length>1||!g.defs[0])return;let I=g.defs[0].node,A=I.parent?.type===se.AST_NODE_TYPES.ExportNamedDeclaration;if(!(u&&A&&!S)){if(I.type===se.AST_NODE_TYPES.TSTypeAliasDeclaration){o(l,p,y,I.typeAnnotation,!0,d);return}if(I.type===se.AST_NODE_TYPES.TSInterfaceDeclaration){o(l,p,y,I.body,!0,d);return}}}function o(l,p,m,y,u,d=!1){if(y.type===se.AST_NODE_TYPES.TSInterfaceBody){for(let c of y.body)c.type===se.AST_NODE_TYPES.TSPropertySignature&&c.key.type===se.AST_NODE_TYPES.Identifier&&m.set(c.key.name,c);return}if(y.type===se.AST_NODE_TYPES.TSTypeLiteral){Yr(m,...Hr(y));return}if(y.type===se.AST_NODE_TYPES.TSIntersectionType){for(let c of y.types)o(l,p,m,c,!0,d);return}u||y.type===se.AST_NODE_TYPES.TSTypeReference&&y.typeName.type===se.AST_NODE_TYPES.Identifier&&s(l,p,y.typeName,m,!0,d)}function i(l,p,m,y=!1){for(let u of m)if(u.type===se.AST_NODE_TYPES.ObjectPattern&&u.typeAnnotation){let d=new Map;if(o(l,p,d,u.typeAnnotation.typeAnnotation,!1,y),d.size===0)continue;a(u,d)}else u.type===se.AST_NODE_TYPES.AssignmentPattern&&u.left.type===se.AST_NODE_TYPES.ObjectPattern&&i(l,p,[u.left],y)}function a(l,p){let m=[];if(l.properties.at(-1)?.type===se.AST_NODE_TYPES.RestElement)return;for(let c of l.properties)c.type===se.AST_NODE_TYPES.Property&&c.key.type===se.AST_NODE_TYPES.Identifier&&m.push(c.key.name);let u=[],d=[];for(let[c,g]of p)m.includes(c)||(d.push(c),u.push({node:g,messageId:"unusedObjectTypeProperty",data:{propertyName:c}}));for(let[c,g]of u.entries())e.report({...g,fix:c===u.length-1?h=>{let S=l.properties.at(-1),I=d.join(", ");return S?S.type===se.AST_NODE_TYPES.RestElement?null:h.insertTextAfter(S,`, ${I}`):h.insertTextBeforeRange([l.range[0]+1,l.range[1]],I)}:void 0})}return{VariableDeclaration(l){let p=l.declarations[0],m=new Map,y=p.id.type===se.AST_NODE_TYPES.Identifier&&p.id.typeAnnotation?.typeAnnotation.type===se.AST_NODE_TYPES.TSTypeReference&&p.id.typeAnnotation.typeAnnotation.typeName.type===se.AST_NODE_TYPES.Identifier&&p.id.typeAnnotation.typeAnnotation.typeName.name==="FC"&&p.id.typeAnnotation.typeAnnotation.typeArguments?.params[0];if(y){if(y.type===se.AST_NODE_TYPES.TSTypeReference&&y.typeName.type===se.AST_NODE_TYPES.Identifier)s(!0,l,y.typeName,m,!1);else if(y.type===se.AST_NODE_TYPES.TSTypeLiteral)Yr(m,...Hr(y));else if(y.type===se.AST_NODE_TYPES.TSIntersectionType)for(let u of y.types)u.type===se.AST_NODE_TYPES.TSTypeReference&&u.typeName.type===se.AST_NODE_TYPES.Identifier?s(!0,l,u.typeName,m,!1):o(!0,l,m,u,!0);if(m.size!==0&&p.init?.type===se.AST_NODE_TYPES.ArrowFunctionExpression){let u=p.init.params[0];if(!u){e.report({node:p.init,messageId:"missingComponentParam"});return}u.type===se.AST_NODE_TYPES.ObjectPattern&&a(u,m)}}},FunctionDeclaration(l){i(!1,l,l.params,r)},ArrowFunctionExpression(l){i(!1,l,l.params,r)}}}}),wn={name:qr,rule:Yo};var Le=require("@typescript-eslint/utils");var Fn=z({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 n(r){return r.callee.type===Le.AST_NODE_TYPES.Identifier?t.has(r.callee.name):r.callee.type===Le.AST_NODE_TYPES.MemberExpression&&r.callee.object.type===Le.AST_NODE_TYPES.Identifier&&r.callee.property.type===Le.AST_NODE_TYPES.Identifier?r.callee.property.name==="useRef":!1}return{ImportDeclaration(r){if(r.source.value==="react")for(let s of r.specifiers)s.type===Le.AST_NODE_TYPES.ImportSpecifier&&s.imported.type===Le.AST_NODE_TYPES.Identifier&&s.imported.name==="useRef"&&t.add(s.local.name)},VariableDeclarator(r){if(r.init&&r.init.type===Le.AST_NODE_TYPES.CallExpression&&n(r.init)&&r.id.type===Le.AST_NODE_TYPES.Identifier){let o=e.sourceCode.getScope(r).set.get(r.id.name);if(o){let i=!1;for(let a of o.references){let p=a.identifier.parent;if(p!==r&&!(p.type===Le.AST_NODE_TYPES.JSXExpressionContainer&&p.parent.type===Le.AST_NODE_TYPES.JSXAttribute&&p.parent.name.type===Le.AST_NODE_TYPES.JSXIdentifier&&p.parent.name.name==="ref")){i=!0;break}}i||e.report({node:r.id,messageId:"refNotRead",data:{name:r.id.name}})}}}}}});var mt=require("@typescript-eslint/utils"),qo=mt.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),Gr="prefer-named-functions",Zr=new Map,Zo=qo({name:Gr,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 n=null;if(t.ignoreRegex){let r=Zr.get(t.ignoreRegex);r?n=r:(n=new RegExp(t.ignoreRegex),Zr.set(t.ignoreRegex,n))}return{VariableDeclarator(r){if(r.init&&r.init.type===mt.AST_NODE_TYPES.ArrowFunctionExpression&&r.id.type===mt.AST_NODE_TYPES.Identifier){let s=r.id.name;if(r.id.typeAnnotation||n&&n.test(s)||!t.disallowArrowFnWithImplicitReturns&&r.init.body.type!==mt.AST_NODE_TYPES.BlockStatement)return;let o=r.parent,i=r.init.params,a=r.init.body,l=r.init;e.report({node:r.id,messageId:n?"withIgnoreRegex":"default",data:{functionName:s,ignoreRegex:t.ignoreRegex},suggest:[{messageId:"suggestion",fix:p=>p.replaceText(o,`${l.async?"async ":""}function ${s}(${i.map(m=>e.sourceCode.getText(m)).join(", ")||""}) ${e.sourceCode.getText(a)}`)}]})}}}}}),vn={name:Gr,rule:Zo};var K=require("@typescript-eslint/utils"),ze=require("zod/v4");var Go=ze.z.object({disallowedFunctions:ze.z.array(ze.z.object({name:ze.z.string(),allowUsingWithArgs:ze.z.boolean().optional(),hookAlternative:ze.z.string().optional(),message:ze.z.string().optional(),allowUseInside:ze.z.array(ze.z.string()).optional()}))}),Ko=/^use[A-Z]/,Qo=/^[A-Z]/;function Dt(e){return Ko.test(e)}function Kr(e){return Qo.test(e)}function ea(e){return e.type===K.AST_NODE_TYPES.Identifier?Dt(e.name):e.type===K.AST_NODE_TYPES.MemberExpression&&e.property.type===K.AST_NODE_TYPES.Identifier?Dt(e.property.name):!1}function Qr(e,t){return e.type===K.AST_NODE_TYPES.Identifier?e.name===t:e.type===K.AST_NODE_TYPES.MemberExpression&&e.object.type===K.AST_NODE_TYPES.Identifier&&e.property.type===K.AST_NODE_TYPES.Identifier?e.object.name==="React"&&e.property.name===t:!1}function ei(e){return!!(e.parent&&e.parent.type===K.AST_NODE_TYPES.CallExpression&&Qr(e.parent.callee,"forwardRef"))}function ti(e){return!!(e.parent&&e.parent.type===K.AST_NODE_TYPES.CallExpression&&Qr(e.parent.callee,"memo"))}function Rn(e){if(e.type===K.AST_NODE_TYPES.FunctionDeclaration||e.type===K.AST_NODE_TYPES.FunctionExpression&&e.id)return e.id||void 0;if(e.type===K.AST_NODE_TYPES.FunctionExpression||e.type===K.AST_NODE_TYPES.ArrowFunctionExpression){if(e.parent.type===K.AST_NODE_TYPES.VariableDeclarator&&e.parent.init===e)return e.parent.id;if(e.parent.type===K.AST_NODE_TYPES.AssignmentExpression&&e.parent.right===e&&e.parent.operator==="=")return e.parent.left;if(e.parent.type===K.AST_NODE_TYPES.Property&&e.parent.value===e&&!e.parent.computed)return e.parent.key;if(e.parent.type===K.AST_NODE_TYPES.AssignmentPattern&&e.parent.right===e)return e.parent.left}}function ta(e){let t=e.parent,n=!1;for(;t;){if(t.type===K.AST_NODE_TYPES.FunctionDeclaration||t.type===K.AST_NODE_TYPES.FunctionExpression||t.type===K.AST_NODE_TYPES.ArrowFunctionExpression){let r=Rn(t);if(r&&r.type===K.AST_NODE_TYPES.Identifier){if(Kr(r.name)||Dt(r.name))return!n;n=!0}else{if(ei(t)||ti(t))return!n;if(t.parent.type===K.AST_NODE_TYPES.CallExpression){let s=t.parent;ea(s.callee)||(n=!0)}else t.parent.type===K.AST_NODE_TYPES.JSXExpressionContainer||(n=!0)}}t=t.parent}return!1}function ni(e){return e.callee.type===K.AST_NODE_TYPES.Identifier?e.callee.name:e.callee.type===K.AST_NODE_TYPES.MemberExpression&&e.callee.property.type===K.AST_NODE_TYPES.Identifier?e.callee.property.name:null}function na(e,t){if(!t.length)return!1;let n=e.parent;for(;n;){if(n.type===K.AST_NODE_TYPES.FunctionDeclaration||n.type===K.AST_NODE_TYPES.FunctionExpression||n.type===K.AST_NODE_TYPES.ArrowFunctionExpression){let r=Rn(n);if(r&&r.type===K.AST_NODE_TYPES.Identifier&&t.includes(r.name))return!0}else if(n.type===K.AST_NODE_TYPES.CallExpression){let r=ni(n);if(r&&t.includes(r))return!0}n=n.parent}return!1}function ra(e){return e.arguments.length>0&&!e.arguments.every(t=>t.type===K.AST_NODE_TYPES.Identifier&&t.name==="undefined")}function ia(e,t){let n=!1,r=e.parent;for(;r;){if(r.type===K.AST_NODE_TYPES.FunctionDeclaration||r.type===K.AST_NODE_TYPES.FunctionExpression||r.type===K.AST_NODE_TYPES.ArrowFunctionExpression){let s=Rn(r);if(s&&s.type===K.AST_NODE_TYPES.Identifier){if(Kr(s.name)||Dt(s.name)){n=!0;break}}else if(ei(r)||ti(r)){n=!0;break}}r=r.parent}return n?t.length===0?ta(e):!na(e,t):!1}var Nn=z({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:[U(Go)],hasSuggestions:!0},defaultOptions:[{disallowedFunctions:[]}],create(e,[t]){let{disallowedFunctions:n}=t,r=new Map(n.map(s=>[s.name,s]));return{CallExpression(s){let o=ni(s);if(!o)return;let i=r.get(o);if(!i||i.allowUsingWithArgs&&ra(s))return;let a=i.allowUseInside||[];ia(s,a)&&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:l=>{let p=i.hookAlternative;return p?s.callee.type===K.AST_NODE_TYPES.Identifier?l.replaceText(s.callee,p):s.callee.type===K.AST_NODE_TYPES.MemberExpression&&s.callee.property.type===K.AST_NODE_TYPES.Identifier?l.replaceText(s.callee.property,p):null:null}}]:[]})}}}});var fe=require("@typescript-eslint/utils"),Lt=Re(require("zod/v4"));var sa=fe.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),ii="prefer-single-line-if",oa=Lt.default.object({maxLineLength:Lt.default.number().optional(),maxNonSimpleConditionLength:Lt.default.number().optional()}),aa=sa({name:ii,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:[U(oa)]},defaultOptions:[{}],create(e,[t]){let n=e.sourceCode;return{IfStatement(r){if(r.consequent.type!==fe.AST_NODE_TYPES.BlockStatement||r.loc.start.line===r.loc.end.line||n.getCommentsInside(r.consequent).length>0||r.alternate||r.consequent.body.length!==1)return;let o=r.consequent.body[0];if(!o)return;if(o.type===fe.AST_NODE_TYPES.ReturnStatement){if(!oi(o))return}else if(!(o.type===fe.AST_NODE_TYPES.ContinueStatement||o.type===fe.AST_NODE_TYPES.BreakStatement))return;if(r.test.type===fe.AST_NODE_TYPES.LogicalExpression||r.test.type===fe.AST_NODE_TYPES.ConditionalExpression)return;let i;if(t.maxNonSimpleConditionLength){let y=ri(r.test);if(!y&&r.test.type===fe.AST_NODE_TYPES.UnaryExpression&&r.test.operator==="!"){let u=r.test.argument;ri(u)&&(y=!0)}if(y&&(i=n.getText(r.test),i.length>t.maxNonSimpleConditionLength))return}i||(i=n.getText(r.test));let a=n.getText(o);if(i.includes(`
18
+ `))return;let l=n.getTokenAfter(r);if(l&&l.type===fe.AST_TOKEN_TYPES.Punctuator&&l.value==="}"){let y=n.getTokenAfter(l);if(y&&y.type===fe.AST_TOKEN_TYPES.Keyword&&(y.value==="else"||y.value==="catch"))return}let p=la(n,r),m=`if (${i}) ${a}`;t.maxLineLength&&m.length+p.length>t.maxLineLength||e.report({node:r,messageId:"noSingleLineCurly",fix:y=>y.replaceText(r,m)})}}}});function ri(e){return e.type===fe.AST_NODE_TYPES.CallExpression||e.type===fe.AST_NODE_TYPES.BinaryExpression||e.type===fe.AST_NODE_TYPES.MemberExpression&&si(e)}function si(e){return e.object.type===fe.AST_NODE_TYPES.MemberExpression?si(e.object):e.object.type!==fe.AST_NODE_TYPES.Identifier}function la(e,t){return e.text.slice(t.range[0]-t.loc.start.column,t.range[0])}function oi(e){if(!e.argument)return!0;let t=e.argument;return t.type===fe.AST_NODE_TYPES.ArrayExpression&&t.elements.length===0||t.type===fe.AST_NODE_TYPES.ObjectExpression&&t.properties.length===0||t.type===fe.AST_NODE_TYPES.Literal||t.type===fe.AST_NODE_TYPES.Identifier||t.type===fe.AST_NODE_TYPES.TemplateLiteral||t.type===fe.AST_NODE_TYPES.TaggedTemplateExpression?!0:t.type===fe.AST_NODE_TYPES.CallExpression?t.arguments.length===0:t.type===fe.AST_NODE_TYPES.UnaryExpression?oi(t):!1}var kn={name:ii,rule:aa};var j=require("@typescript-eslint/utils"),On=require("zod/v4");var pa=j.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),ui="react-compiler-extra",ca=On.z.object({runOnlyWithEnableCompilerDirective:On.z.boolean().optional()}),ua=/eslint +react-compiler\/react-compiler: +\["error/;function yt(e){let t=null;if((e.type===j.AST_NODE_TYPES.FunctionDeclaration||e.type===j.AST_NODE_TYPES.FunctionExpression||e.type===j.AST_NODE_TYPES.ArrowFunctionExpression&&e.body.type===j.AST_NODE_TYPES.BlockStatement)&&(t=e.body),!t||t.body.length===0)return!1;let n=t.body[0];return n?n.type===j.AST_NODE_TYPES.ExpressionStatement&&n.expression.type===j.AST_NODE_TYPES.Literal&&n.expression.value==="use no memo":!1}function ai(e){let t=e.parent;for(;t;){if(t.type===j.AST_NODE_TYPES.FunctionDeclaration||t.type===j.AST_NODE_TYPES.FunctionExpression||t.type===j.AST_NODE_TYPES.ArrowFunctionExpression)return t;t=t.parent}return null}function fa(e){return e.type===j.AST_NODE_TYPES.Identifier?e.name.startsWith("use"):!1}function fi(e){return e.type===j.AST_NODE_TYPES.Identifier?e.name.startsWith("use"):e.type===j.AST_NODE_TYPES.MemberExpression&&e.property.type===j.AST_NODE_TYPES.Identifier?e.property.name.startsWith("use"):!1}function Ve(e){if(!e)return!1;switch(e.type){case j.AST_NODE_TYPES.JSXElement:case j.AST_NODE_TYPES.JSXFragment:return!0;case j.AST_NODE_TYPES.ConditionalExpression:return Ve(e.consequent)||Ve(e.alternate);case j.AST_NODE_TYPES.LogicalExpression:return e.operator==="&&"?Ve(e.right):e.operator==="||"?Ve(e.left)||Ve(e.right):!1;case j.AST_NODE_TYPES.CallExpression:if(e.callee.type===j.AST_NODE_TYPES.MemberExpression&&e.callee.object.type===j.AST_NODE_TYPES.Identifier&&e.callee.object.name==="React"&&e.callee.property.type===j.AST_NODE_TYPES.Identifier&&e.callee.property.name==="createElement")return!0;for(let t of e.arguments)if(t.type!==j.AST_NODE_TYPES.SpreadElement&&Ve(t))return!0;return!1;default:return!1}}function ma(e){let t=e.typeAnnotation;if(t.type===j.AST_NODE_TYPES.TSTypeReference){if(t.typeName.type===j.AST_NODE_TYPES.Identifier)return t.typeName.name==="FC";if(t.typeName.type===j.AST_NODE_TYPES.TSQualifiedName&&t.typeName.left.type===j.AST_NODE_TYPES.Identifier&&t.typeName.right.type===j.AST_NODE_TYPES.Identifier)return t.typeName.left.name==="React"&&t.typeName.right.name==="FC"}return!1}var ya=/^[A-Z][a-zA-Z0-9]*$/;function wt(e){return ya.test(e)}function jt(e){return e.startsWith("use")&&e.length>3}function Dn(e,t,n,r){if(n&&ma(n))return t?wt(t.name):e.type===j.AST_NODE_TYPES.FunctionDeclaration&&e.id?wt(e.id.name):!0;if(t&&jt(t.name)||e.type===j.AST_NODE_TYPES.FunctionDeclaration&&e.id&&jt(e.id.name))return!0;if(r){let s=t?.name||e.type===j.AST_NODE_TYPES.FunctionDeclaration&&e.id?.name;if(s&&wt(s)&&mi(e.body,r).containsJSX)return!0}return!1}function At(e){if(e.body.type===j.AST_NODE_TYPES.BlockStatement){for(let t of e.body.body)if(t.type===j.AST_NODE_TYPES.ExpressionStatement&&t.expression.type===j.AST_NODE_TYPES.Literal&&typeof t.expression.value=="string"&&t.expression.value==="use memo")return!0}return!1}function mi(e,t){let n={containsJSX:!1,containsHookCalls:!1};return _e(e,r=>{if(n.containsJSX&&n.containsHookCalls)return!0;switch(r.type){case j.AST_NODE_TYPES.JSXElement:case j.AST_NODE_TYPES.JSXFragment:n.containsJSX=!0;break;case j.AST_NODE_TYPES.CallExpression:fa(r.callee)&&(n.containsHookCalls=!0),Ve(r)&&(n.containsJSX=!0);break;case j.AST_NODE_TYPES.ReturnStatement:r.argument&&Ve(r.argument)&&(n.containsJSX=!0);break;case j.AST_NODE_TYPES.VariableDeclarator:r.init&&Ve(r.init)&&(n.containsJSX=!0);break;case j.AST_NODE_TYPES.AssignmentExpression:Ve(r.right)&&(n.containsJSX=!0);break}},t),n}function li(e,t){let n=e.body,r=mi(n,t);return r.containsJSX||r.containsHookCalls}var da=/\bthis[.[]/;function pi(e){return da.test(e)}function ga(e,t){let n={containsJSX:!1,containsHookCalls:!1};return _e(e,r=>{if(n.containsHookCalls||(r.type===j.AST_NODE_TYPES.FunctionDeclaration||r.type===j.AST_NODE_TYPES.FunctionExpression||r.type===j.AST_NODE_TYPES.ArrowFunctionExpression)&&r!==e)return!0;r.type===j.AST_NODE_TYPES.CallExpression&&fi(r.callee)&&(n.containsHookCalls=!0)},t),n}function ci(e){return wt(e)||jt(e)}function Pn(e,t,n,r){if(!ga(e.body,t).containsHookCalls)return!1;let o=Dn(e,n,r,t);if(!o&&r){let i=n?.name||e.type===j.AST_NODE_TYPES.FunctionDeclaration&&e.id?.name;i&&wt(i)&&(o=!0)}return!o}var Sa=pa({name:ui,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:[U(ca)]},defaultOptions:[{}],create(e,[t]){let n=!1;if(t.runOnlyWithEnableCompilerDirective){for(let i of e.sourceCode.getAllComments())if(ua.test(i.value)){n=!0;break}if(!n)return{}}function r(i){for(let a of i.properties)if(a.type===j.AST_NODE_TYPES.Property&&a.method&&a.value.type===j.AST_NODE_TYPES.FunctionExpression){let l=e.sourceCode,p=l.getText(a.key),m=a.value,y=l.getText(m.body);if(pi(y))e.report({node:a,messageId:"thisKeywordInMethod"});else{let u=m.params.map(c=>l.getText(c)).join(", "),d="";m.generator?d=`${p}: function* (${u}) ${y}`:m.async?d=`${p}: async (${u}) => ${y}`:d=`${p}: (${u}) => ${y}`,e.report({node:a,messageId:"objectMethodIsNotSupported",fix:c=>c.replaceText(a,d)})}}}function s(i){for(let a of i.properties)if(a.type===j.AST_NODE_TYPES.Property&&a.value.type===j.AST_NODE_TYPES.ObjectExpression){for(let l of a.value.properties)if(l.type===j.AST_NODE_TYPES.Property&&l.method&&l.value.type===j.AST_NODE_TYPES.FunctionExpression){let m=e.sourceCode.getText(l.value.body);pi(m)&&e.report({node:l,messageId:"thisKeywordInMethod"})}}}function o(i){let a=ai(i);return a!==null&&yt(a)}return{CallExpression(i){if(fi(i.callee))for(let a of i.arguments){if(a.type===j.AST_NODE_TYPES.ObjectExpression){if(o(i))return;r(a),s(a)}if(a.type===j.AST_NODE_TYPES.ArrowFunctionExpression){if(a.body.type===j.AST_NODE_TYPES.ObjectExpression){if(o(i))return;r(a.body),s(a.body)}if(a.body.type===j.AST_NODE_TYPES.BlockStatement){for(let l of a.body.body)if(l.type===j.AST_NODE_TYPES.ReturnStatement&&l.argument?.type===j.AST_NODE_TYPES.ObjectExpression){if(o(i))return;r(l.argument),s(l.argument)}}}if(a.type===j.AST_NODE_TYPES.FunctionExpression){for(let l of a.body.body)if(l.type===j.AST_NODE_TYPES.ReturnStatement&&l.argument?.type===j.AST_NODE_TYPES.ObjectExpression){if(o(i))return;r(l.argument),s(l.argument)}}}},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)){let a=i.init,l=i.id,p=i.id.typeAnnotation;if(At(a)&&!ci(l.name)){e.report({node:a,messageId:"useMemoDirectiveNaming"});return}if(Pn(a,e.sourceCode,l,p)){if(yt(a))return;e.report({node:a,messageId:"functionCallingHooksMustBeComponent"});return}if(Dn(a,l,p,e.sourceCode)){let m=li(a,e.sourceCode),y=At(a);if(!m&&!y){if(yt(a))return;e.report({node:a,messageId:"fcComponentShouldReturnJsx",suggest:[{messageId:"addUseMemoDirective",fix(u){if(a.body.type===j.AST_NODE_TYPES.BlockStatement){let d=a.body.range[0]+1;return u.insertTextAfterRange([d,d],`
19
19
  "use memo"
20
20
  `)}return null}}]})}}}},FunctionDeclaration(i){if(i.id&&At(i)&&!ci(i.id.name)){e.report({node:i,messageId:"useMemoDirectiveNaming"});return}if(Pn(i,e.sourceCode)){if(yt(i))return;e.report({node:i,messageId:"functionCallingHooksMustBeComponent"});return}if(Dn(i,void 0,void 0,e.sourceCode)){let a=li(i,e.sourceCode),l=At(i);if(!a&&!l){if(yt(i))return;e.report({node:i,messageId:"fcComponentShouldReturnJsx",suggest:[{messageId:"addUseMemoDirective",fix(p){let m=i.body.range[0]+1;return p.insertTextAfterRange([m,m],`
21
21
  "use memo"
22
- `)}}]})}}},FunctionExpression(i){if(At(i)){e.report({node:i,messageId:"useMemoDirectiveNaming"});return}if(Pn(i,e.sourceCode)){if(yt(i))return;e.report({node:i,messageId:"functionCallingHooksMustBeComponent"})}},ReturnStatement(i){if(i.argument?.type!==j.AST_NODE_TYPES.ObjectExpression)return;let a=ai(i);if(!a)return;let l;a.type===j.AST_NODE_TYPES.FunctionDeclaration&&a.id?l=a.id.name:(a.type===j.AST_NODE_TYPES.ArrowFunctionExpression||a.type===j.AST_NODE_TYPES.FunctionExpression)&&a.parent.type===j.AST_NODE_TYPES.VariableDeclarator&&a.parent.id.type===j.AST_NODE_TYPES.Identifier&&(l=a.parent.id.name),l&&jt(l)&&(o(i)||(r(i.argument),s(i.argument)))}}}}),Ln={name:ui,rule:ya};var ye=require("@typescript-eslint/utils"),je=require("zod/v4");var da=ye.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),yi="react-compiler-migration",ga=je.z.object({disallowHooks:je.z.array(je.z.object({name:je.z.string(),replacement:je.z.string()})).optional(),disallowMethods:je.z.array(je.z.object({name:je.z.string(),replacement:je.z.string().optional(),requireTrueProp:je.z.string().optional()})).optional(),runOnlyWithEnableCompilerDirective:je.z.boolean().optional()}),Sa=/eslint +react-compiler\/react-compiler: +\["error/;function Ta(e){let t=null;if((e.type===ye.AST_NODE_TYPES.FunctionDeclaration||e.type===ye.AST_NODE_TYPES.FunctionExpression||e.type===ye.AST_NODE_TYPES.ArrowFunctionExpression&&e.body.type===ye.AST_NODE_TYPES.BlockStatement)&&(t=e.body),!t||t.body.length===0)return!1;let n=t.body[0];return n?n.type===ye.AST_NODE_TYPES.ExpressionStatement&&n.expression.type===ye.AST_NODE_TYPES.Literal&&n.expression.value==="use no memo":!1}function Ea(e){let t=e.parent;for(;t;){if(t.type===ye.AST_NODE_TYPES.FunctionDeclaration||t.type===ye.AST_NODE_TYPES.FunctionExpression||t.type===ye.AST_NODE_TYPES.ArrowFunctionExpression)return t;t=t.parent}return null}function ha(e){return e.type===ye.AST_NODE_TYPES.Identifier?e.name.startsWith("use"):e.type===ye.AST_NODE_TYPES.MemberExpression&&e.property.type===ye.AST_NODE_TYPES.Identifier?e.property.name.startsWith("use"):!1}var ba=da({name:yi,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:[U(ga)]},defaultOptions:[{disallowHooks:[],disallowMethods:[],runOnlyWithEnableCompilerDirective:!1}],create(e,[t]){let n=!0;if(t.runOnlyWithEnableCompilerDirective){n=!1;for(let s of e.sourceCode.getAllComments())if(Sa.test(s.value)){n=!0;break}}if(!n)return{};function r(s){let o=Ea(s);return o!==null&&Ta(o)}return{CallExpression(s){if(t.disallowHooks?.length){let o=null,i=null;if(s.callee.type===ye.AST_NODE_TYPES.Identifier?(o=s.callee.name,i=s.callee):s.callee.type===ye.AST_NODE_TYPES.MemberExpression&&s.callee.property.type===ye.AST_NODE_TYPES.Identifier&&(o=s.callee.property.name,i=s.callee.property),o){let a=t.disallowHooks.find(l=>l.name===o);if(a&&i){if(r(s))return;e.report({node:s,messageId:"disallowedFunctionOrMethod",data:{functionOrMethod:a.name,replacement:a.replacement},suggest:[{messageId:"replace",data:{replacement:a.replacement},fix:l=>l.replaceText(i,a.replacement)}]})}}}if(t.disallowMethods?.length&&ha(s.callee)){for(let o of s.arguments)if(o.type===ye.AST_NODE_TYPES.ObjectExpression){for(let i of o.properties)if(i.type===ye.AST_NODE_TYPES.Property&&i.key.type===ye.AST_NODE_TYPES.Identifier){let a=i.key.name,l=t.disallowMethods.find(p=>p.name===a);if(l){if(r(s))return;if(l.requireTrueProp){let p=l.requireTrueProp,m=!1;for(let y of o.properties)if(y.type===ye.AST_NODE_TYPES.Property&&y.key.type===ye.AST_NODE_TYPES.Identifier&&y.key.name===p&&y.value.type===ye.AST_NODE_TYPES.Literal&&y.value.value===!0){m=!0;break}if(!m){e.report({node:i,messageId:"disallowedMethodWithMissingRequireTrueProp",data:{method:l.name,requireTrueProp:p}});continue}}l.replacement&&e.report({node:i,messageId:"disallowedFunctionOrMethod",data:{functionOrMethod:l.name,replacement:l.replacement},suggest:[{messageId:"replace",data:{replacement:l.replacement},fix:p=>l.replacement?p.replaceText(i.key,l.replacement):null}]})}}}}}}}}),jn={name:yi,rule:ba};var oe=require("@typescript-eslint/utils"),Mn=require("zod/v4");var xa=/\.(tsx|jsx)$/,Ca=/^[A-Z][A-Za-z0-9]*$/,Ia=/^[A-Z][A-Z0-9_]*$/,di=80,Aa=Mn.z.object({ignoreConstCaseVarRegex:Mn.z.string().optional()}),_n=z({name:"react-no-module-level-single-use-values",meta:{type:"problem",docs:{description:"Disallow module-level allocated data values and long strings that are only used in one React component, excluding functions, inferable aliases, regex values, and class instantiations except Set/Map"},schema:[U(Aa)],messages:{moveValueInsideComponent:"Module-level `{{valueName}}` is only used in React component `{{componentName}}`. Move it inside the component to improve memory usage."}},defaultOptions:[{}],create(e,[t]){if(!xa.test(e.filename))return{};let n=e.sourceCode,r=Ma(t.ignoreConstCaseVarRegex),s=wa(n.ast.body);return s.length===0?{}:{VariableDeclarator(o){if(o.id.type!==oe.AST_NODE_TYPES.Identifier||!Fa(o)||!Na(o.init))return;let i=o.id.name;if(r&&ja(i)&&r.test(i))return;let l=n.getDeclaredVariables(o).find(d=>d.name===i);if(!l)return;let p=new Set,m=!1,y=!1;for(let d of l.references){if(d.init)continue;y=!0;let c=va(d.identifier,s);if(!c){m=!0;break}if(p.add(c),p.size>1)break}if(!y||m||p.size!==1)return;let[u]=Array.from(p);u&&e.report({node:o.id,messageId:"moveValueInsideComponent",data:{valueName:i,componentName:u}})}}}});function wa(e){let t=[],n=new Set;function r(o,i){Ca.test(o)&&(n.has(o)||(n.add(o),t.push({name:o,range:i.range})))}function s(o){for(let i of o.declarations){if(i.id.type!==oe.AST_NODE_TYPES.Identifier)continue;let a=gi(i.init);a&&r(i.id.name,a)}}for(let o of e){if(o.type===oe.AST_NODE_TYPES.VariableDeclaration){s(o);continue}if(o.type===oe.AST_NODE_TYPES.FunctionDeclaration){r(o.id.name,o);continue}o.type===oe.AST_NODE_TYPES.ExportNamedDeclaration&&o.declaration&&(o.declaration.type===oe.AST_NODE_TYPES.VariableDeclaration?s(o.declaration):o.declaration.type===oe.AST_NODE_TYPES.FunctionDeclaration&&o.declaration.id&&r(o.declaration.id.name,o.declaration))}return t}function Fa(e){return e.parent.parent.type===oe.AST_NODE_TYPES.Program}function va(e,t){let n=null;for(let r of t){if(!(e.range[0]>=r.range[0]&&e.range[1]<=r.range[1]))continue;if(!n){n=r;continue}let o=n.range[1]-n.range[0];r.range[1]-r.range[0]<o&&(n=r)}return n?.name??null}function gi(e){if(!e)return null;let t=$n(e);if(t.type===oe.AST_NODE_TYPES.ArrowFunctionExpression||t.type===oe.AST_NODE_TYPES.FunctionExpression)return t;if(t.type!==oe.AST_NODE_TYPES.CallExpression||!Ra(t.callee))return null;let n=t.arguments[0];if(!n||n.type===oe.AST_NODE_TYPES.SpreadElement)return null;if(n.type===oe.AST_NODE_TYPES.CallExpression)return gi(n);let r=$n(n);return r.type===oe.AST_NODE_TYPES.ArrowFunctionExpression||r.type===oe.AST_NODE_TYPES.FunctionExpression?r:null}function Ra(e){return e.type===oe.AST_NODE_TYPES.Identifier?e.name==="memo"||e.name==="forwardRef":e.type===oe.AST_NODE_TYPES.MemberExpression?e.property.type===oe.AST_NODE_TYPES.Identifier&&(e.property.name==="memo"||e.property.name==="forwardRef"):!1}function $n(e){let t=e;for(;;){if(t.type===oe.AST_NODE_TYPES.TSAsExpression){t=t.expression;continue}if(t.type===oe.AST_NODE_TYPES.TSSatisfiesExpression){t=t.expression;continue}if(t.type===oe.AST_NODE_TYPES.TSNonNullExpression){t=t.expression;continue}return t}}function Na(e){if(!e)return!1;let t=$n(e);return ka(t)?!1:Pa(t)?!0:Oa(t)}function ka(e){return e.type===oe.AST_NODE_TYPES.Identifier||e.type===oe.AST_NODE_TYPES.MemberExpression}function Pa(e){if(e.type===oe.AST_NODE_TYPES.Literal)return typeof e.value=="string"&&e.value.length>=di;if(e.type===oe.AST_NODE_TYPES.TemplateLiteral){if(e.expressions.length>0)return!1;let t=e.quasis[0];return t?t.value.cooked.length>=di:!1}return!1}function Oa(e){return e.type===oe.AST_NODE_TYPES.ArrayExpression||e.type===oe.AST_NODE_TYPES.ObjectExpression||e.type===oe.AST_NODE_TYPES.ClassExpression?!0:e.type===oe.AST_NODE_TYPES.NewExpression?Da(e):!1}function Da(e){let t=La(e.callee);return t==="Set"||t==="Map"}function La(e){return e.type===oe.AST_NODE_TYPES.Identifier?e.name:e.type===oe.AST_NODE_TYPES.MemberExpression?e.computed||e.property.type!==oe.AST_NODE_TYPES.Identifier?null:e.property.name:null}function ja(e){return Ia.test(e)}function Ma(e){if(!e)return null;try{return new RegExp(e)}catch{return null}}var V=require("@typescript-eslint/utils"),zn=require("zod");var $a=zn.z.object({runOnlyWithEnableCompilerDirective:zn.z.boolean().optional()}),_a=/eslint +react-compiler\/react-compiler: +\["error/,Ua=/^\d+$/,za=/[\s_-]+/,Va=/[a-z][A-Z]/,Wa=/^(.+?)([A-Z][a-z]+s?)$/,Ja=/^[a-z][a-zA-Z]*$/;function Si(e,t){let n=[];if(e.type===V.AST_NODE_TYPES.JSXElement){for(let r of e.openingElement.attributes)if(r.type===V.AST_NODE_TYPES.JSXAttribute&&r.name.type===V.AST_NODE_TYPES.JSXIdentifier&&r.value?.type===V.AST_NODE_TYPES.JSXExpressionContainer&&r.value.expression.type!==V.AST_NODE_TYPES.JSXEmptyExpression){let s=r.name.name,o=r.value.expression,i=!1;_e(o,a=>{switch(a.type){case V.AST_NODE_TYPES.ObjectExpression:case V.AST_NODE_TYPES.ArrowFunctionExpression:case V.AST_NODE_TYPES.FunctionExpression:case V.AST_NODE_TYPES.ArrayExpression:return i=!0,!0}return!1},t),i&&n.push(s)}}return{hasUnstable:n.length>0,problematicProps:n}}function Xa(e){if(e.body.type===V.AST_NODE_TYPES.JSXElement||e.body.type===V.AST_NODE_TYPES.JSXFragment)return!0;if(e.body.type===V.AST_NODE_TYPES.BlockStatement){for(let t of e.body.body)if(t.type===V.AST_NODE_TYPES.ReturnStatement&&t.argument&&(t.argument.type===V.AST_NODE_TYPES.JSXElement||t.argument.type===V.AST_NODE_TYPES.JSXFragment))return!0}return!1}function Ba(e,t){let n=e.callee;if(n.type===V.AST_NODE_TYPES.MemberExpression){let r=n.object;if(r.type===V.AST_NODE_TYPES.Identifier){let s=r.name,o=Ha(s);if(o!==s)return Vn(o)}}if(t.length>0){let r=t[0];if(r&&r.type===V.AST_NODE_TYPES.Identifier)return Vn(r.name)}return"ListItem"}function Ha(e){let n={people:"person",children:"child",feet:"foot",teeth:"tooth",mice:"mouse",men:"man",women:"woman"}[e.toLowerCase()];if(n)return n;if(e.match(Va)){let r=e.match(Wa);if(r){let s=r[1],o=r[2];if(!s||!o)return Un(e);let i=Un(o);if(i!==o)return s+i}}return Un(e)}function Un(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 Vn(e){return e.match(Ja)?e.charAt(0).toUpperCase()+e.slice(1):e.split(za).map(t=>t.charAt(0).toUpperCase()+t.slice(1).toLowerCase()).join("")}function Ti(e,t,n){let r=[],s=new Set,o=new Set(["console","document","window","Math","Object","Array","String","Number","Boolean","undefined","null"]);_e(e,i=>{if(i.type===V.AST_NODE_TYPES.Identifier&&!t.includes(i.name)&&!o.has(i.name)&&!Ua.test(i.name)){let a=i.parent;if(a.type===V.AST_NODE_TYPES.Property&&a.key===i||a.type===V.AST_NODE_TYPES.MemberExpression&&a.property===i&&!a.computed||a.type===V.AST_NODE_TYPES.JSXOpeningElement||a.type===V.AST_NODE_TYPES.JSXClosingElement||a.type===V.AST_NODE_TYPES.JSXAttribute&&a.name.type===V.AST_NODE_TYPES.JSXIdentifier&&a.name.name===i.name)return!1;s.add(i.name)}return!1},n);for(let i of s)t.includes(i)||r.push({name:i,type:"unknown"});return r}function Ei(e,t,n,r,s){let i=[...n.map(y=>y.type===V.AST_NODE_TYPES.Identifier?y.name:"item").map((y,u)=>({name:y,type:u===0?`${e}Type`:u===1?"number":"unknown"})),...r],a=i.map(y=>{let u=y.type;return y.name.includes("on")&&u==="any"&&(u="unknown"),` ${y.name}: ${u};`}).join(`
22
+ `)}}]})}}},FunctionExpression(i){if(At(i)){e.report({node:i,messageId:"useMemoDirectiveNaming"});return}if(Pn(i,e.sourceCode)){if(yt(i))return;e.report({node:i,messageId:"functionCallingHooksMustBeComponent"})}},ReturnStatement(i){if(i.argument?.type!==j.AST_NODE_TYPES.ObjectExpression)return;let a=ai(i);if(!a)return;let l;a.type===j.AST_NODE_TYPES.FunctionDeclaration&&a.id?l=a.id.name:(a.type===j.AST_NODE_TYPES.ArrowFunctionExpression||a.type===j.AST_NODE_TYPES.FunctionExpression)&&a.parent.type===j.AST_NODE_TYPES.VariableDeclarator&&a.parent.id.type===j.AST_NODE_TYPES.Identifier&&(l=a.parent.id.name),l&&jt(l)&&(o(i)||(r(i.argument),s(i.argument)))}}}}),Ln={name:ui,rule:Sa};var ye=require("@typescript-eslint/utils"),je=require("zod/v4");var Ta=ye.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),yi="react-compiler-migration",Ea=je.z.object({disallowHooks:je.z.array(je.z.object({name:je.z.string(),replacement:je.z.string()})).optional(),disallowMethods:je.z.array(je.z.object({name:je.z.string(),replacement:je.z.string().optional(),requireTrueProp:je.z.string().optional()})).optional(),runOnlyWithEnableCompilerDirective:je.z.boolean().optional()}),ha=/eslint +react-compiler\/react-compiler: +\["error/;function ba(e){let t=null;if((e.type===ye.AST_NODE_TYPES.FunctionDeclaration||e.type===ye.AST_NODE_TYPES.FunctionExpression||e.type===ye.AST_NODE_TYPES.ArrowFunctionExpression&&e.body.type===ye.AST_NODE_TYPES.BlockStatement)&&(t=e.body),!t||t.body.length===0)return!1;let n=t.body[0];return n?n.type===ye.AST_NODE_TYPES.ExpressionStatement&&n.expression.type===ye.AST_NODE_TYPES.Literal&&n.expression.value==="use no memo":!1}function xa(e){let t=e.parent;for(;t;){if(t.type===ye.AST_NODE_TYPES.FunctionDeclaration||t.type===ye.AST_NODE_TYPES.FunctionExpression||t.type===ye.AST_NODE_TYPES.ArrowFunctionExpression)return t;t=t.parent}return null}function Ca(e){return e.type===ye.AST_NODE_TYPES.Identifier?e.name.startsWith("use"):e.type===ye.AST_NODE_TYPES.MemberExpression&&e.property.type===ye.AST_NODE_TYPES.Identifier?e.property.name.startsWith("use"):!1}var Ia=Ta({name:yi,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:[U(Ea)]},defaultOptions:[{disallowHooks:[],disallowMethods:[],runOnlyWithEnableCompilerDirective:!1}],create(e,[t]){let n=!0;if(t.runOnlyWithEnableCompilerDirective){n=!1;for(let s of e.sourceCode.getAllComments())if(ha.test(s.value)){n=!0;break}}if(!n)return{};function r(s){let o=xa(s);return o!==null&&ba(o)}return{CallExpression(s){if(t.disallowHooks?.length){let o=null,i=null;if(s.callee.type===ye.AST_NODE_TYPES.Identifier?(o=s.callee.name,i=s.callee):s.callee.type===ye.AST_NODE_TYPES.MemberExpression&&s.callee.property.type===ye.AST_NODE_TYPES.Identifier&&(o=s.callee.property.name,i=s.callee.property),o){let a=t.disallowHooks.find(l=>l.name===o);if(a&&i){if(r(s))return;e.report({node:s,messageId:"disallowedFunctionOrMethod",data:{functionOrMethod:a.name,replacement:a.replacement},suggest:[{messageId:"replace",data:{replacement:a.replacement},fix:l=>l.replaceText(i,a.replacement)}]})}}}if(t.disallowMethods?.length&&Ca(s.callee)){for(let o of s.arguments)if(o.type===ye.AST_NODE_TYPES.ObjectExpression){for(let i of o.properties)if(i.type===ye.AST_NODE_TYPES.Property&&i.key.type===ye.AST_NODE_TYPES.Identifier){let a=i.key.name,l=t.disallowMethods.find(p=>p.name===a);if(l){if(r(s))return;if(l.requireTrueProp){let p=l.requireTrueProp,m=!1;for(let y of o.properties)if(y.type===ye.AST_NODE_TYPES.Property&&y.key.type===ye.AST_NODE_TYPES.Identifier&&y.key.name===p&&y.value.type===ye.AST_NODE_TYPES.Literal&&y.value.value===!0){m=!0;break}if(!m){e.report({node:i,messageId:"disallowedMethodWithMissingRequireTrueProp",data:{method:l.name,requireTrueProp:p}});continue}}l.replacement&&e.report({node:i,messageId:"disallowedFunctionOrMethod",data:{functionOrMethod:l.name,replacement:l.replacement},suggest:[{messageId:"replace",data:{replacement:l.replacement},fix:p=>l.replacement?p.replaceText(i.key,l.replacement):null}]})}}}}}}}}),jn={name:yi,rule:Ia};var oe=require("@typescript-eslint/utils"),Mn=require("zod/v4");var Aa=/\.(tsx|jsx)$/,wa=/^[A-Z][A-Za-z0-9]*$/,Fa=/^[A-Z][A-Z0-9_]*$/,di=80,va=Mn.z.object({ignoreConstCaseVarRegex:Mn.z.string().optional()}),_n=z({name:"react-no-module-level-single-use-values",meta:{type:"problem",docs:{description:"Disallow module-level allocated data values and long strings that are only used in one React component, excluding functions, inferable aliases, regex values, and class instantiations except Set/Map"},schema:[U(va)],messages:{moveValueInsideComponent:"Module-level `{{valueName}}` is only used in React component `{{componentName}}`. Move it inside the component to improve memory usage."}},defaultOptions:[{}],create(e,[t]){if(!Aa.test(e.filename))return{};let n=e.sourceCode,r=Ua(t.ignoreConstCaseVarRegex),s=Ra(n.ast.body);return s.length===0?{}:{VariableDeclarator(o){if(o.id.type!==oe.AST_NODE_TYPES.Identifier||!Na(o)||!Oa(o.init))return;let i=o.id.name;if(r&&_a(i)&&r.test(i))return;let l=n.getDeclaredVariables(o).find(d=>d.name===i);if(!l)return;let p=new Set,m=!1,y=!1;for(let d of l.references){if(d.init)continue;y=!0;let c=ka(d.identifier,s);if(!c){m=!0;break}if(p.add(c),p.size>1)break}if(!y||m||p.size!==1)return;let[u]=Array.from(p);u&&e.report({node:o.id,messageId:"moveValueInsideComponent",data:{valueName:i,componentName:u}})}}}});function Ra(e){let t=[],n=new Set;function r(o,i){wa.test(o)&&(n.has(o)||(n.add(o),t.push({name:o,range:i.range})))}function s(o){for(let i of o.declarations){if(i.id.type!==oe.AST_NODE_TYPES.Identifier)continue;let a=gi(i.init);a&&r(i.id.name,a)}}for(let o of e){if(o.type===oe.AST_NODE_TYPES.VariableDeclaration){s(o);continue}if(o.type===oe.AST_NODE_TYPES.FunctionDeclaration){r(o.id.name,o);continue}o.type===oe.AST_NODE_TYPES.ExportNamedDeclaration&&o.declaration&&(o.declaration.type===oe.AST_NODE_TYPES.VariableDeclaration?s(o.declaration):o.declaration.type===oe.AST_NODE_TYPES.FunctionDeclaration&&o.declaration.id&&r(o.declaration.id.name,o.declaration))}return t}function Na(e){return e.parent.parent.type===oe.AST_NODE_TYPES.Program}function ka(e,t){let n=null;for(let r of t){if(!(e.range[0]>=r.range[0]&&e.range[1]<=r.range[1]))continue;if(!n){n=r;continue}let o=n.range[1]-n.range[0];r.range[1]-r.range[0]<o&&(n=r)}return n?.name??null}function gi(e){if(!e)return null;let t=$n(e);if(t.type===oe.AST_NODE_TYPES.ArrowFunctionExpression||t.type===oe.AST_NODE_TYPES.FunctionExpression)return t;if(t.type!==oe.AST_NODE_TYPES.CallExpression||!Pa(t.callee))return null;let n=t.arguments[0];if(!n||n.type===oe.AST_NODE_TYPES.SpreadElement)return null;if(n.type===oe.AST_NODE_TYPES.CallExpression)return gi(n);let r=$n(n);return r.type===oe.AST_NODE_TYPES.ArrowFunctionExpression||r.type===oe.AST_NODE_TYPES.FunctionExpression?r:null}function Pa(e){return e.type===oe.AST_NODE_TYPES.Identifier?e.name==="memo"||e.name==="forwardRef":e.type===oe.AST_NODE_TYPES.MemberExpression?e.property.type===oe.AST_NODE_TYPES.Identifier&&(e.property.name==="memo"||e.property.name==="forwardRef"):!1}function $n(e){let t=e;for(;;){if(t.type===oe.AST_NODE_TYPES.TSAsExpression){t=t.expression;continue}if(t.type===oe.AST_NODE_TYPES.TSSatisfiesExpression){t=t.expression;continue}if(t.type===oe.AST_NODE_TYPES.TSNonNullExpression){t=t.expression;continue}return t}}function Oa(e){if(!e)return!1;let t=$n(e);return Da(t)?!1:La(t)?!0:ja(t)}function Da(e){return e.type===oe.AST_NODE_TYPES.Identifier||e.type===oe.AST_NODE_TYPES.MemberExpression}function La(e){if(e.type===oe.AST_NODE_TYPES.Literal)return typeof e.value=="string"&&e.value.length>=di;if(e.type===oe.AST_NODE_TYPES.TemplateLiteral){if(e.expressions.length>0)return!1;let t=e.quasis[0];return t?t.value.cooked.length>=di:!1}return!1}function ja(e){return e.type===oe.AST_NODE_TYPES.ArrayExpression||e.type===oe.AST_NODE_TYPES.ObjectExpression||e.type===oe.AST_NODE_TYPES.ClassExpression?!0:e.type===oe.AST_NODE_TYPES.NewExpression?Ma(e):!1}function Ma(e){let t=$a(e.callee);return t==="Set"||t==="Map"}function $a(e){return e.type===oe.AST_NODE_TYPES.Identifier?e.name:e.type===oe.AST_NODE_TYPES.MemberExpression?e.computed||e.property.type!==oe.AST_NODE_TYPES.Identifier?null:e.property.name:null}function _a(e){return Fa.test(e)}function Ua(e){if(!e)return null;try{return new RegExp(e)}catch{return null}}var V=require("@typescript-eslint/utils"),zn=require("zod");var za=zn.z.object({runOnlyWithEnableCompilerDirective:zn.z.boolean().optional()}),Va=/eslint +react-compiler\/react-compiler: +\["error/,Wa=/^\d+$/,Ja=/[\s_-]+/,Xa=/[a-z][A-Z]/,Ba=/^(.+?)([A-Z][a-z]+s?)$/,Ha=/^[a-z][a-zA-Z]*$/;function Si(e,t){let n=[];if(e.type===V.AST_NODE_TYPES.JSXElement){for(let r of e.openingElement.attributes)if(r.type===V.AST_NODE_TYPES.JSXAttribute&&r.name.type===V.AST_NODE_TYPES.JSXIdentifier&&r.value?.type===V.AST_NODE_TYPES.JSXExpressionContainer&&r.value.expression.type!==V.AST_NODE_TYPES.JSXEmptyExpression){let s=r.name.name,o=r.value.expression,i=!1;_e(o,a=>{switch(a.type){case V.AST_NODE_TYPES.ObjectExpression:case V.AST_NODE_TYPES.ArrowFunctionExpression:case V.AST_NODE_TYPES.FunctionExpression:case V.AST_NODE_TYPES.ArrayExpression:return i=!0,!0}return!1},t),i&&n.push(s)}}return{hasUnstable:n.length>0,problematicProps:n}}function Ya(e){if(e.body.type===V.AST_NODE_TYPES.JSXElement||e.body.type===V.AST_NODE_TYPES.JSXFragment)return!0;if(e.body.type===V.AST_NODE_TYPES.BlockStatement){for(let t of e.body.body)if(t.type===V.AST_NODE_TYPES.ReturnStatement&&t.argument&&(t.argument.type===V.AST_NODE_TYPES.JSXElement||t.argument.type===V.AST_NODE_TYPES.JSXFragment))return!0}return!1}function qa(e,t){let n=e.callee;if(n.type===V.AST_NODE_TYPES.MemberExpression){let r=n.object;if(r.type===V.AST_NODE_TYPES.Identifier){let s=r.name,o=Za(s);if(o!==s)return Vn(o)}}if(t.length>0){let r=t[0];if(r&&r.type===V.AST_NODE_TYPES.Identifier)return Vn(r.name)}return"ListItem"}function Za(e){let n={people:"person",children:"child",feet:"foot",teeth:"tooth",mice:"mouse",men:"man",women:"woman"}[e.toLowerCase()];if(n)return n;if(e.match(Xa)){let r=e.match(Ba);if(r){let s=r[1],o=r[2];if(!s||!o)return Un(e);let i=Un(o);if(i!==o)return s+i}}return Un(e)}function Un(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 Vn(e){return e.match(Ha)?e.charAt(0).toUpperCase()+e.slice(1):e.split(Ja).map(t=>t.charAt(0).toUpperCase()+t.slice(1).toLowerCase()).join("")}function Ti(e,t,n){let r=[],s=new Set,o=new Set(["console","document","window","Math","Object","Array","String","Number","Boolean","undefined","null"]);_e(e,i=>{if(i.type===V.AST_NODE_TYPES.Identifier&&!t.includes(i.name)&&!o.has(i.name)&&!Wa.test(i.name)){let a=i.parent;if(a.type===V.AST_NODE_TYPES.Property&&a.key===i||a.type===V.AST_NODE_TYPES.MemberExpression&&a.property===i&&!a.computed||a.type===V.AST_NODE_TYPES.JSXOpeningElement||a.type===V.AST_NODE_TYPES.JSXClosingElement||a.type===V.AST_NODE_TYPES.JSXAttribute&&a.name.type===V.AST_NODE_TYPES.JSXIdentifier&&a.name.name===i.name)return!1;s.add(i.name)}return!1},n);for(let i of s)t.includes(i)||r.push({name:i,type:"unknown"});return r}function Ei(e,t,n,r,s){let i=[...n.map(y=>y.type===V.AST_NODE_TYPES.Identifier?y.name:"item").map((y,u)=>({name:y,type:u===0?`${e}Type`:u===1?"number":"unknown"})),...r],a=i.map(y=>{let u=y.type;return y.name.includes("on")&&u==="any"&&(u="unknown"),` ${y.name}: ${u};`}).join(`
23
23
  `),l=i.map(y=>y.name).join(", "),p=s.getText(t),m=`${e}Props`;return`type ${m} = {
24
24
  ${a}
25
25
  };
@@ -28,22 +28,22 @@ const ${e}: FC<${m}> = ({ ${l} }) => {
28
28
  return (
29
29
  ${p}
30
30
  );
31
- };`}function Ya(e,t,n,r){let s=t.map(i=>i.type===V.AST_NODE_TYPES.Identifier?i.name:"item"),o=[r?`key={${r}}`:`key={${s[0]}.id}`,...s.map(i=>`${i}={${i}}`),...n.map(i=>`${i.name}={${i.name}}`)].filter(Boolean);return`<${e} ${o.join(" ")} />`}function qa(e){if(e.type===V.AST_NODE_TYPES.JSXElement&&e.openingElement.name.type===V.AST_NODE_TYPES.JSXIdentifier){let t=e.openingElement.name.name;if(t!=="div"&&t!=="span")return Vn(t)}return"ListItem"}function Za(e,t,n){let r=[n?`key={${n}}`:"",...t.map(s=>`${s.name}={${s.name}}`)].filter(Boolean);return`<${e}${r.length>0?` ${r.join(" ")}`:""} />`}function hi(e,t){for(let n of e.openingElement.attributes)if(n.type===V.AST_NODE_TYPES.JSXAttribute&&n.name.type===V.AST_NODE_TYPES.JSXIdentifier&&n.name.name==="key"&&n.value&&n.value.type===V.AST_NODE_TYPES.JSXExpressionContainer&&n.value.expression.type!==V.AST_NODE_TYPES.JSXEmptyExpression)return t.getText(n.value.expression);return null}var Wn=z({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:[U($a)],hasSuggestions:!0},defaultOptions:[{runOnlyWithEnableCompilerDirective:!1}],create(e,[t]){let{sourceCode:n}=e;if(t.runOnlyWithEnableCompilerDirective){let r=!1;for(let s of n.getAllComments())if(_a.test(s.value)){r=!0;break}if(!r)return{}}return{CallExpression(r){r.callee.type===V.AST_NODE_TYPES.MemberExpression&&r.callee.property.type===V.AST_NODE_TYPES.Identifier&&(r.callee.property.name==="map"||r.callee.property.name==="push")&&(r.callee.property.name==="map"?Ga(r,n,e):Ka(r,n,e))}}}});function Ga(e,t,n){let r=e.arguments[0];if(!r||r.type!==V.AST_NODE_TYPES.ArrowFunctionExpression&&r.type!==V.AST_NODE_TYPES.FunctionExpression||!Xa(r))return;let s=null;if(r.body.type===V.AST_NODE_TYPES.JSXElement||r.body.type===V.AST_NODE_TYPES.JSXFragment?s=r.body:r.body.type===V.AST_NODE_TYPES.BlockStatement&&r.body.body[0]?.type===V.AST_NODE_TYPES.ReturnStatement&&r.body.body[0].argument&&(r.body.body[0].argument.type===V.AST_NODE_TYPES.JSXElement||r.body.body[0].argument.type===V.AST_NODE_TYPES.JSXFragment)&&(s=r.body.body[0].argument),!s)return;let o=Si(s,t);if(!o.hasUnstable)return;let i=Ba(e,r.params),a=r.params.map(y=>y.type===V.AST_NODE_TYPES.Identifier?y.name:"item"),l=Ti(s,a,t),p=s.type===V.AST_NODE_TYPES.JSXElement?hi(s,t):null,m=o.problematicProps.length===1?`prop "${o.problematicProps[0]}"`:`props "${o.problematicProps.join('", "')}"`;n.report({node:s,messageId:"unstableValueInMap",data:{problematicProps:m},suggest:[{messageId:"extractComponent",data:{componentName:i},fix:y=>{let u=Ei(i,s,r.params,l,t),d=Ya(i,r.params,l,p),c=e;for(;c.parent.type!==V.AST_NODE_TYPES.Program&&!(c.type===V.AST_NODE_TYPES.FunctionDeclaration||c.type===V.AST_NODE_TYPES.VariableDeclarator&&c.init&&(c.init.type===V.AST_NODE_TYPES.ArrowFunctionExpression||c.init.type===V.AST_NODE_TYPES.FunctionExpression));)c=c.parent;let g=[];return g.push(y.insertTextAfter(c,`
31
+ };`}function Ga(e,t,n,r){let s=t.map(i=>i.type===V.AST_NODE_TYPES.Identifier?i.name:"item"),o=[r?`key={${r}}`:`key={${s[0]}.id}`,...s.map(i=>`${i}={${i}}`),...n.map(i=>`${i.name}={${i.name}}`)].filter(Boolean);return`<${e} ${o.join(" ")} />`}function Ka(e){if(e.type===V.AST_NODE_TYPES.JSXElement&&e.openingElement.name.type===V.AST_NODE_TYPES.JSXIdentifier){let t=e.openingElement.name.name;if(t!=="div"&&t!=="span")return Vn(t)}return"ListItem"}function Qa(e,t,n){let r=[n?`key={${n}}`:"",...t.map(s=>`${s.name}={${s.name}}`)].filter(Boolean);return`<${e}${r.length>0?` ${r.join(" ")}`:""} />`}function hi(e,t){for(let n of e.openingElement.attributes)if(n.type===V.AST_NODE_TYPES.JSXAttribute&&n.name.type===V.AST_NODE_TYPES.JSXIdentifier&&n.name.name==="key"&&n.value&&n.value.type===V.AST_NODE_TYPES.JSXExpressionContainer&&n.value.expression.type!==V.AST_NODE_TYPES.JSXEmptyExpression)return t.getText(n.value.expression);return null}var Wn=z({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:[U(za)],hasSuggestions:!0},defaultOptions:[{runOnlyWithEnableCompilerDirective:!1}],create(e,[t]){let{sourceCode:n}=e;if(t.runOnlyWithEnableCompilerDirective){let r=!1;for(let s of n.getAllComments())if(Va.test(s.value)){r=!0;break}if(!r)return{}}return{CallExpression(r){r.callee.type===V.AST_NODE_TYPES.MemberExpression&&r.callee.property.type===V.AST_NODE_TYPES.Identifier&&(r.callee.property.name==="map"||r.callee.property.name==="push")&&(r.callee.property.name==="map"?el(r,n,e):tl(r,n,e))}}}});function el(e,t,n){let r=e.arguments[0];if(!r||r.type!==V.AST_NODE_TYPES.ArrowFunctionExpression&&r.type!==V.AST_NODE_TYPES.FunctionExpression||!Ya(r))return;let s=null;if(r.body.type===V.AST_NODE_TYPES.JSXElement||r.body.type===V.AST_NODE_TYPES.JSXFragment?s=r.body:r.body.type===V.AST_NODE_TYPES.BlockStatement&&r.body.body[0]?.type===V.AST_NODE_TYPES.ReturnStatement&&r.body.body[0].argument&&(r.body.body[0].argument.type===V.AST_NODE_TYPES.JSXElement||r.body.body[0].argument.type===V.AST_NODE_TYPES.JSXFragment)&&(s=r.body.body[0].argument),!s)return;let o=Si(s,t);if(!o.hasUnstable)return;let i=qa(e,r.params),a=r.params.map(y=>y.type===V.AST_NODE_TYPES.Identifier?y.name:"item"),l=Ti(s,a,t),p=s.type===V.AST_NODE_TYPES.JSXElement?hi(s,t):null,m=o.problematicProps.length===1?`prop "${o.problematicProps[0]}"`:`props "${o.problematicProps.join('", "')}"`;n.report({node:s,messageId:"unstableValueInMap",data:{problematicProps:m},suggest:[{messageId:"extractComponent",data:{componentName:i},fix:y=>{let u=Ei(i,s,r.params,l,t),d=Ga(i,r.params,l,p),c=e;for(;c.parent.type!==V.AST_NODE_TYPES.Program&&!(c.type===V.AST_NODE_TYPES.FunctionDeclaration||c.type===V.AST_NODE_TYPES.VariableDeclarator&&c.init&&(c.init.type===V.AST_NODE_TYPES.ArrowFunctionExpression||c.init.type===V.AST_NODE_TYPES.FunctionExpression));)c=c.parent;let g=[];return g.push(y.insertTextAfter(c,`
32
32
 
33
- ${u}`)),g.push(y.replaceText(s,d)),g}}]})}function Ka(e,t,n){let r=e.arguments[0];if(!r||r.type!==V.AST_NODE_TYPES.JSXElement&&r.type!==V.AST_NODE_TYPES.JSXFragment)return;let s=r,o=Si(s,t);if(!o.hasUnstable)return;let i=qa(s),a=Ti(s,[],t),l=s.type===V.AST_NODE_TYPES.JSXElement?hi(s,t):null,p=o.problematicProps.length===1?`prop "${o.problematicProps[0]}"`:`props "${o.problematicProps.join('", "')}"`;n.report({node:s,messageId:"unstableValueInMap",data:{problematicProps:p},suggest:[{messageId:"extractComponent",data:{componentName:i},fix:m=>{let y=Ei(i,s,[],a,t),u=Za(i,a,l),d=e;for(;d.parent.type!==V.AST_NODE_TYPES.Program&&!(d.type===V.AST_NODE_TYPES.FunctionDeclaration||d.type===V.AST_NODE_TYPES.VariableDeclarator&&d.init&&(d.init.type===V.AST_NODE_TYPES.ArrowFunctionExpression||d.init.type===V.AST_NODE_TYPES.FunctionExpression));)d=d.parent;let c=[];return c.push(m.insertTextAfter(d,`
33
+ ${u}`)),g.push(y.replaceText(s,d)),g}}]})}function tl(e,t,n){let r=e.arguments[0];if(!r||r.type!==V.AST_NODE_TYPES.JSXElement&&r.type!==V.AST_NODE_TYPES.JSXFragment)return;let s=r,o=Si(s,t);if(!o.hasUnstable)return;let i=Ka(s),a=Ti(s,[],t),l=s.type===V.AST_NODE_TYPES.JSXElement?hi(s,t):null,p=o.problematicProps.length===1?`prop "${o.problematicProps[0]}"`:`props "${o.problematicProps.join('", "')}"`;n.report({node:s,messageId:"unstableValueInMap",data:{problematicProps:p},suggest:[{messageId:"extractComponent",data:{componentName:i},fix:m=>{let y=Ei(i,s,[],a,t),u=Qa(i,a,l),d=e;for(;d.parent.type!==V.AST_NODE_TYPES.Program&&!(d.type===V.AST_NODE_TYPES.FunctionDeclaration||d.type===V.AST_NODE_TYPES.VariableDeclarator&&d.init&&(d.init.type===V.AST_NODE_TYPES.ArrowFunctionExpression||d.init.type===V.AST_NODE_TYPES.FunctionExpression));)d=d.parent;let c=[];return c.push(m.insertTextAfter(d,`
34
34
 
35
- ${y}`)),c.push(m.replaceText(s,u)),c}}]})}var Mt=require("@typescript-eslint/utils"),Qa=Mt.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),bi="require-description",el=/^(eslint(?:-env|-enable|-disable(?:(?:-next)?-line)?)?|exported|globals?)(?:\s|$)/u,tl=/^eslint-disable-(next-)?line$/u,nl=Qa({name:bi,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 n=e.sourceCode,r=new Set(t.ignore||[]);return{Program(){for(let s of n.getAllComments()){let o=rl(s);o!=null&&(r.has(o.kind)||o.description||e.report({loc:ol(s.loc),messageId:"missingDescription"}))}}}}}),xi={name:bi,rule:nl};function rl(e){let{text:t,description:n}=sl(e.value);if(!t)return null;let r=el.exec(t);if(!r)return null;let s=r[1];if(!s)return null;let o=tl.test(s);if(e.type===Mt.TSESTree.AST_TOKEN_TYPES.Line&&!o||o&&e.loc.start.line!==e.loc.end.line)return null;let i=t.slice(r.index+s.length);return{kind:s,value:i.trim(),description:n}}var il=/\s-{2,}\s/u;function sl(e){let t=e.split(il);return{text:t[0]?.trim(),description:t.length>1?t[1]?.trim()??null:null}}function ol(e){return{start:{line:e.start.line,column:-1},end:e.end}}var ne=require("@typescript-eslint/utils"),We=require("zod/v4");var al=We.z.object({varsToCheck:We.z.array(We.z.object({selector:We.z.string().optional(),fromFnCall:We.z.string().optional(),prop:We.z.string().or(We.z.array(We.z.string())),errorMsg:We.z.string().optional()}))}),Jn=z({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:[U(al)]},defaultOptions:[{varsToCheck:[]}],create(e,[t]){let n=new Map;function r(i,a,l,p){let m=new Set;for(let u of i.properties)u.type===ne.AST_NODE_TYPES.Property&&u.key.type===ne.AST_NODE_TYPES.Identifier&&m.add(u.key.name);let y=a.filter(u=>!m.has(u));if(y.length>0)if(y.length===1)e.report({node:i,messageId:"propNotRead",data:{prop:y[0],fnName:p,customMsg:l||""}});else{let u=y.map(d=>`"${d}"`).join(", ");e.report({node:i,messageId:"propsNotRead",data:{props:u,fnName:p,customMsg:l||""}})}}function s(i){if(i.init?.type===ne.AST_NODE_TYPES.CallExpression){if(i.init.callee.type===ne.AST_NODE_TYPES.Identifier)return i.init.callee.name;if(i.init.callee.type===ne.AST_NODE_TYPES.MemberExpression&&i.init.callee.property.type===ne.AST_NODE_TYPES.Identifier)return i.init.callee.object.type===ne.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]=a=>{if(a.type===ne.AST_NODE_TYPES.VariableDeclarator&&a.id.type===ne.AST_NODE_TYPES.Identifier&&n.set(a.id.name,{props:Array.isArray(i.prop)?i.prop:[i.prop],errorMsg:i.errorMsg,node:a.id,fnName:s(a)}),a.type===ne.AST_NODE_TYPES.VariableDeclarator&&a.id.type===ne.AST_NODE_TYPES.ObjectPattern){let l=Array.isArray(i.prop)?i.prop:[i.prop];r(a.id,l,i.errorMsg,s(a))}});for(let i of t.varsToCheck)if(i.fromFnCall){let a=i.fromFnCall;if(a.startsWith("*.")){let p=`VariableDeclarator > CallExpression > MemberExpression[property.name="${a.slice(2)}"]`;o[p]=m=>{if(m.type!==ne.AST_NODE_TYPES.MemberExpression||m.parent.type!==ne.AST_NODE_TYPES.CallExpression)return;let y=m.parent;if(y.parent.type!==ne.AST_NODE_TYPES.VariableDeclarator)return;let u=y.parent;if(u.id.type===ne.AST_NODE_TYPES.Identifier)n.set(u.id.name,{props:Array.isArray(i.prop)?i.prop:[i.prop],errorMsg:i.errorMsg,node:u.id,fnName:i.fromFnCall||"unknown function"});else if(u.id.type===ne.AST_NODE_TYPES.ObjectPattern){let d=Array.isArray(i.prop)?i.prop:[i.prop];r(u.id,d,i.errorMsg,i.fromFnCall||"unknown function")}}}else if(a.includes(".")){let[l,p]=a.split("."),m=`VariableDeclarator > CallExpression > MemberExpression[object.name="${l}"][property.name="${p}"]`;o[m]=y=>{if(y.type!==ne.AST_NODE_TYPES.MemberExpression||y.parent.type!==ne.AST_NODE_TYPES.CallExpression)return;let u=y.parent;if(u.parent.type!==ne.AST_NODE_TYPES.VariableDeclarator)return;let d=u.parent;if(d.id.type===ne.AST_NODE_TYPES.Identifier)n.set(d.id.name,{props:Array.isArray(i.prop)?i.prop:[i.prop],errorMsg:i.errorMsg,node:d.id,fnName:i.fromFnCall||"unknown function"});else if(d.id.type===ne.AST_NODE_TYPES.ObjectPattern){let c=Array.isArray(i.prop)?i.prop:[i.prop];r(d.id,c,i.errorMsg,i.fromFnCall||"unknown function")}}}else{let l=`VariableDeclarator > CallExpression > Identifier[name="${a}"]`;o[l]=p=>{if(p.type!==ne.AST_NODE_TYPES.Identifier||p.parent.type!==ne.AST_NODE_TYPES.CallExpression)return;let m=p.parent;if(m.parent.type!==ne.AST_NODE_TYPES.VariableDeclarator)return;let y=m.parent;if(y.id.type===ne.AST_NODE_TYPES.Identifier)n.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===ne.AST_NODE_TYPES.ObjectPattern){let u=Array.isArray(i.prop)?i.prop:[i.prop];r(y.id,u,i.errorMsg,i.fromFnCall||"unknown function")}}}}return{...o,"Program:exit"(){for(let[i,{props:a,errorMsg:l,node:p,fnName:m}]of n){let u=e.sourceCode.getScope(p).set.get(i);if(u){let d=new Set(a);for(let c of u.references){let g=c.identifier,h=g.parent;if(!(h.type===ne.AST_NODE_TYPES.VariableDeclarator&&h.id===g)){if(h.type===ne.AST_NODE_TYPES.MemberExpression&&h.object===g&&h.property.type===ne.AST_NODE_TYPES.Identifier&&d.has(h.property.name)){if(d.delete(h.property.name),d.size===0)break;continue}if(h.type===ne.AST_NODE_TYPES.VariableDeclarator&&h.init===g&&h.id.type===ne.AST_NODE_TYPES.ObjectPattern){for(let S of h.id.properties)S.type===ne.AST_NODE_TYPES.Property&&S.key.type===ne.AST_NODE_TYPES.Identifier&&d.has(S.key.name)&&d.delete(S.key.name);if(d.size===0)break;continue}if(!(h.type===ne.AST_NODE_TYPES.MemberExpression&&h.object===g&&h.property.type===ne.AST_NODE_TYPES.Identifier&&!a.includes(h.property.name))){d.clear();break}}}if(d.size>0){let c=Array.from(d);if(c.length===1)e.report({node:p,messageId:"propNotRead",data:{prop:c[0],fnName:m,customMsg:l||""}});else{let g=c.map(h=>`"${h}"`).join(", ");e.report({node:p,messageId:"propsNotRead",data:{props:g,fnName:m,customMsg:l||""}})}}}}}}}});function Fi(e){return/^use[A-Z0-9]/.test(e)}function $t(e){return e.type==="Identifier"?Fi(e.name):e.type==="MemberExpression"&&!e.computed&&$t(e.property)?e.object.type==="Identifier":!1}function vi(e){return e.type==="Identifier"&&/^[A-Z]/.test(e.name)}function Ri(e,t){return e.name===t||e.type==="MemberExpression"&&e.object.name==="React"&&e.property.name===t}function Ni(e){return!!(e.parent&&e.parent.callee&&Ri(e.parent.callee,"forwardRef"))}function ki(e){return!!(e.parent&&e.parent.callee&&Ri(e.parent.callee,"memo"))}function Xn(e){for(;e;){let t=Oi(e);if(t&&(vi(t)||$t(t))||Ni(e)||ki(e))return!0;e=e.parent}return!1}function Ci(e){return!1}function Bn(e){return!1}var ll=/eslint +react-compiler\/react-compiler: +\["error/;function Ii(e){let t=null;if((e.type==="FunctionDeclaration"||e.type==="FunctionExpression"||e.type==="ArrowFunctionExpression"&&e.body.type==="BlockStatement")&&(t=e.body),!t||t.body.length===0)return!1;let n=t.body[0];return n.type==="ExpressionStatement"&&n.expression.type==="Literal"&&n.expression.value==="use no memo"}function Ai(e){let t=e.parent;for(;t;){if(t.type==="FunctionDeclaration"||t.type==="FunctionExpression"||t.type==="ArrowFunctionExpression")return t;t=t.parent}return null}var Pi={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"},reactCompilerIsEnabled:{type:"boolean"}}}]},create(e){let t=!!e.options[0]?.reactCompilerIsEnabled;if(t)return{CallExpression(p){let m=null;if(p.callee.name==="useMemo"?m="useMemo":p.callee.name==="useCallback"&&(m="useCallback"),m){let y=Ai(p);if(y&&Ii(y))return;e.report({node:p,message:`"${m}" is not necessary when using React Compiler.`})}}};if(e.options[0]?.ignoreIfReactCompilerIsEnabled||t){for(let p of e.sourceCode.getAllComments())if(ll.test(p.value))return{CallExpression(m){let y=null;if(m.callee.name==="useMemo"?y="useMemo":m.callee.name==="useCallback"&&(y="useCallback"),y){let u=Ai(m);if(u&&Ii(u))return;e.report({node:m,message:`"${y}" is not necessary when using React Compiler.`})}}}}let n=typeof e.getSource=="function"?p=>n(p):p=>e.sourceCode.getText(p),r=typeof e.getScope=="function"?()=>r():p=>e.sourceCode.getScope(p),s=null,o=[],i=[],a=new WeakSet;function l(p){for(let m of p.references){let y=m.identifier.parent;if(y.type==="VariableDeclarator"&&y.init&&y.init.type==="CallExpression"&&y.init.callee&&Ci(y.init.callee))for(let u of m.resolved.references)u!==m&&a.add(u.identifier)}}return{onCodePathSegmentStart:p=>i.push(p),onCodePathSegmentEnd:()=>i.pop(),onCodePathStart:()=>o.push(new Map),onCodePathEnd(p,m){let y=o.pop();if(y.size===0)return;let u=new Set;function d(b,C){let{cache:w}=d,N=w.get(b.id),k=new Set(C);if(k.has(b.id)){let O=[...k],f=O.slice(O.indexOf(b.id)+1);for(let x of f)u.add(x);return BigInt("0")}if(k.add(b.id),N!==void 0)return N;if(p.thrownSegments.includes(b))N=BigInt("0");else if(b.prevSegments.length===0)N=BigInt("1");else{N=BigInt("0");for(let O of b.prevSegments)N+=d(O,k)}return b.reachable&&N===BigInt("0")?w.delete(b.id):w.set(b.id,N),N}function c(b,C){let{cache:w}=c,N=w.get(b.id),k=new Set(C);if(k.has(b.id)){let O=Array.from(k),f=O.slice(O.indexOf(b.id)+1);for(let x of f)u.add(x);return BigInt("0")}if(k.add(b.id),N!==void 0)return N;if(p.thrownSegments.includes(b))N=BigInt("0");else if(b.nextSegments.length===0)N=BigInt("1");else{N=BigInt("0");for(let O of b.nextSegments)N+=c(O,k)}return w.set(b.id,N),N}function g(b){let{cache:C}=g,w=C.get(b.id);if(w===null)return 1/0;if(w!==void 0)return w;if(C.set(b.id,null),b.prevSegments.length===0)w=1;else{w=1/0;for(let N of b.prevSegments){let k=g(N);k<w&&(w=k)}w+=1}return C.set(b.id,w),w}d.cache=new Map,c.cache=new Map,g.cache=new Map;let h=c(p.initialSegment),S=Oi(m),I=Xn(m),A=S?vi(S)||$t(S):Ni(m)||ki(m),T=1/0;for(let b of p.finalSegments){if(!b.reachable)continue;let C=g(b);C<T&&(T=C)}for(let[b,C]of y){if(!b.reachable)continue;let w=b.nextSegments.length===0?T<=g(b):T<g(b),N=d(b)*c(b),k=u.has(b.id);for(let O of C)if(k&&!Bn(O)&&e.report({node:O,message:`React Hook "${n(O)}" 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.`}),A){if(m.async&&e.report({node:O,message:`React Hook "${n(O)}" cannot be called in an async function.`}),!k&&N!==h&&!Bn(O)){let x=`React Hook "${n(O)}" is called conditionally. React Hooks must be called in the exact same order in every component render.`+(w?" Did you accidentally call a React Hook after an early return?":"");e.report({node:O,message:x})}}else if(m.parent&&(m.parent.type==="MethodDefinition"||m.parent.type==="ClassProperty")&&m.parent.value===m){let f=`React Hook "${n(O)}" 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:O,message:f})}else if(S){let f=`React Hook "${n(O)}" is called in function "${n(S)}" 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:O,message:f})}else if(m.type==="Program"){let f=`React Hook "${n(O)}" 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:O,message:f})}else if(I&&!Bn(O)){if(m.parent.type==="CallExpression"&&m.parent.callee.type==="Identifier"&&m.parent.callee.name==="useCallback"){let x=m.parent;if(x.parent.type==="VariableDeclarator"&&Fi(x.parent.id.name))return}let f=`React Hook "${n(O)}" 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:O,message:f})}}},CallExpression(p){if($t(p.callee)){let m=wi(o),y=wi(i),u=m.get(y);u||(u=[],m.set(y,u)),u.push(p.callee)}p.callee.type==="Identifier"&&(p.callee.name==="useEffect"||Ci(p.callee))&&p.arguments.length>0&&(s=p)},Identifier(p){s==null&&a.has(p)&&p.parent.type!=="CallExpression"&&e.report({node:p,message:`\`${n(p)}\` 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"(p){p===s&&(s=null)},FunctionDeclaration(p){Xn(p)&&l(r(p))},ArrowFunctionExpression(p){Xn(p)&&l(r(p))}}}};function Oi(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 wi(e){return e[e.length-1]}var Ee=require("@typescript-eslint/utils"),Ie=Re(require("zod/v4"));var pl=/^\s+$/,Hn=/\r?\n/,cl=/^(\s*)/,ul=/^(\s*)\S/,fl=/\r?\n/,ml=Ie.object({indent:Ie.union([Ie.string().regex(pl),Ie.number().int().min(1)]).optional(),tags:Ie.array(Ie.string()).optional(),functions:Ie.array(Ie.string()).optional(),comments:Ie.array(Ie.string()).optional()}),Yn=z({name:"template-indent",meta:{type:"suggestion",docs:{description:"Fix whitespace-insensitive template indentation"},fixable:"code",schema:[U(ml)],messages:{improperlyIndented:"Templates should be properly indented."}},defaultOptions:[{}],create(e){let t=e.sourceCode,{comments:n=["HTML","indent"],functions:r=["dedent","stripIndent"],tags:s=["outdent","dedent","gql","sql","html","styled"],indent:o}=e.options[0],i=n.map(S=>S.toLowerCase());function a(S){let I=S.split(Hn),A=I.filter(b=>b.trim()!=="");if(A.length===0)return S;let T=Number.POSITIVE_INFINITY;for(let b of A){let C=b.match(cl);C&&(T=Math.min(T,C[1]?.length??0))}return!isFinite(T)||T===0?S:I.map(b=>b.slice(T)).join(`
35
+ ${y}`)),c.push(m.replaceText(s,u)),c}}]})}var Mt=require("@typescript-eslint/utils"),nl=Mt.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),bi="require-description",rl=/^(eslint(?:-env|-enable|-disable(?:(?:-next)?-line)?)?|exported|globals?)(?:\s|$)/u,il=/^eslint-disable-(next-)?line$/u,sl=nl({name:bi,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 n=e.sourceCode,r=new Set(t.ignore||[]);return{Program(){for(let s of n.getAllComments()){let o=ol(s);o!=null&&(r.has(o.kind)||o.description||e.report({loc:pl(s.loc),messageId:"missingDescription"}))}}}}}),xi={name:bi,rule:sl};function ol(e){let{text:t,description:n}=ll(e.value);if(!t)return null;let r=rl.exec(t);if(!r)return null;let s=r[1];if(!s)return null;let o=il.test(s);if(e.type===Mt.TSESTree.AST_TOKEN_TYPES.Line&&!o||o&&e.loc.start.line!==e.loc.end.line)return null;let i=t.slice(r.index+s.length);return{kind:s,value:i.trim(),description:n}}var al=/\s-{2,}\s/u;function ll(e){let t=e.split(al);return{text:t[0]?.trim(),description:t.length>1?t[1]?.trim()??null:null}}function pl(e){return{start:{line:e.start.line,column:-1},end:e.end}}var ne=require("@typescript-eslint/utils"),We=require("zod/v4");var cl=We.z.object({varsToCheck:We.z.array(We.z.object({selector:We.z.string().optional(),fromFnCall:We.z.string().optional(),prop:We.z.string().or(We.z.array(We.z.string())),errorMsg:We.z.string().optional()}))}),Jn=z({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:[U(cl)]},defaultOptions:[{varsToCheck:[]}],create(e,[t]){let n=new Map;function r(i,a,l,p){let m=new Set;for(let u of i.properties)u.type===ne.AST_NODE_TYPES.Property&&u.key.type===ne.AST_NODE_TYPES.Identifier&&m.add(u.key.name);let y=a.filter(u=>!m.has(u));if(y.length>0)if(y.length===1)e.report({node:i,messageId:"propNotRead",data:{prop:y[0],fnName:p,customMsg:l||""}});else{let u=y.map(d=>`"${d}"`).join(", ");e.report({node:i,messageId:"propsNotRead",data:{props:u,fnName:p,customMsg:l||""}})}}function s(i){if(i.init?.type===ne.AST_NODE_TYPES.CallExpression){if(i.init.callee.type===ne.AST_NODE_TYPES.Identifier)return i.init.callee.name;if(i.init.callee.type===ne.AST_NODE_TYPES.MemberExpression&&i.init.callee.property.type===ne.AST_NODE_TYPES.Identifier)return i.init.callee.object.type===ne.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]=a=>{if(a.type===ne.AST_NODE_TYPES.VariableDeclarator&&a.id.type===ne.AST_NODE_TYPES.Identifier&&n.set(a.id.name,{props:Array.isArray(i.prop)?i.prop:[i.prop],errorMsg:i.errorMsg,node:a.id,fnName:s(a)}),a.type===ne.AST_NODE_TYPES.VariableDeclarator&&a.id.type===ne.AST_NODE_TYPES.ObjectPattern){let l=Array.isArray(i.prop)?i.prop:[i.prop];r(a.id,l,i.errorMsg,s(a))}});for(let i of t.varsToCheck)if(i.fromFnCall){let a=i.fromFnCall;if(a.startsWith("*.")){let p=`VariableDeclarator > CallExpression > MemberExpression[property.name="${a.slice(2)}"]`;o[p]=m=>{if(m.type!==ne.AST_NODE_TYPES.MemberExpression||m.parent.type!==ne.AST_NODE_TYPES.CallExpression)return;let y=m.parent;if(y.parent.type!==ne.AST_NODE_TYPES.VariableDeclarator)return;let u=y.parent;if(u.id.type===ne.AST_NODE_TYPES.Identifier)n.set(u.id.name,{props:Array.isArray(i.prop)?i.prop:[i.prop],errorMsg:i.errorMsg,node:u.id,fnName:i.fromFnCall||"unknown function"});else if(u.id.type===ne.AST_NODE_TYPES.ObjectPattern){let d=Array.isArray(i.prop)?i.prop:[i.prop];r(u.id,d,i.errorMsg,i.fromFnCall||"unknown function")}}}else if(a.includes(".")){let[l,p]=a.split("."),m=`VariableDeclarator > CallExpression > MemberExpression[object.name="${l}"][property.name="${p}"]`;o[m]=y=>{if(y.type!==ne.AST_NODE_TYPES.MemberExpression||y.parent.type!==ne.AST_NODE_TYPES.CallExpression)return;let u=y.parent;if(u.parent.type!==ne.AST_NODE_TYPES.VariableDeclarator)return;let d=u.parent;if(d.id.type===ne.AST_NODE_TYPES.Identifier)n.set(d.id.name,{props:Array.isArray(i.prop)?i.prop:[i.prop],errorMsg:i.errorMsg,node:d.id,fnName:i.fromFnCall||"unknown function"});else if(d.id.type===ne.AST_NODE_TYPES.ObjectPattern){let c=Array.isArray(i.prop)?i.prop:[i.prop];r(d.id,c,i.errorMsg,i.fromFnCall||"unknown function")}}}else{let l=`VariableDeclarator > CallExpression > Identifier[name="${a}"]`;o[l]=p=>{if(p.type!==ne.AST_NODE_TYPES.Identifier||p.parent.type!==ne.AST_NODE_TYPES.CallExpression)return;let m=p.parent;if(m.parent.type!==ne.AST_NODE_TYPES.VariableDeclarator)return;let y=m.parent;if(y.id.type===ne.AST_NODE_TYPES.Identifier)n.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===ne.AST_NODE_TYPES.ObjectPattern){let u=Array.isArray(i.prop)?i.prop:[i.prop];r(y.id,u,i.errorMsg,i.fromFnCall||"unknown function")}}}}return{...o,"Program:exit"(){for(let[i,{props:a,errorMsg:l,node:p,fnName:m}]of n){let u=e.sourceCode.getScope(p).set.get(i);if(u){let d=new Set(a);for(let c of u.references){let g=c.identifier,h=g.parent;if(!(h.type===ne.AST_NODE_TYPES.VariableDeclarator&&h.id===g)){if(h.type===ne.AST_NODE_TYPES.MemberExpression&&h.object===g&&h.property.type===ne.AST_NODE_TYPES.Identifier&&d.has(h.property.name)){if(d.delete(h.property.name),d.size===0)break;continue}if(h.type===ne.AST_NODE_TYPES.VariableDeclarator&&h.init===g&&h.id.type===ne.AST_NODE_TYPES.ObjectPattern){for(let S of h.id.properties)S.type===ne.AST_NODE_TYPES.Property&&S.key.type===ne.AST_NODE_TYPES.Identifier&&d.has(S.key.name)&&d.delete(S.key.name);if(d.size===0)break;continue}if(!(h.type===ne.AST_NODE_TYPES.MemberExpression&&h.object===g&&h.property.type===ne.AST_NODE_TYPES.Identifier&&!a.includes(h.property.name))){d.clear();break}}}if(d.size>0){let c=Array.from(d);if(c.length===1)e.report({node:p,messageId:"propNotRead",data:{prop:c[0],fnName:m,customMsg:l||""}});else{let g=c.map(h=>`"${h}"`).join(", ");e.report({node:p,messageId:"propsNotRead",data:{props:g,fnName:m,customMsg:l||""}})}}}}}}}});function Fi(e){return/^use[A-Z0-9]/.test(e)}function $t(e){return e.type==="Identifier"?Fi(e.name):e.type==="MemberExpression"&&!e.computed&&$t(e.property)?e.object.type==="Identifier":!1}function vi(e){return e.type==="Identifier"&&/^[A-Z]/.test(e.name)}function Ri(e,t){return e.name===t||e.type==="MemberExpression"&&e.object.name==="React"&&e.property.name===t}function Ni(e){return!!(e.parent&&e.parent.callee&&Ri(e.parent.callee,"forwardRef"))}function ki(e){return!!(e.parent&&e.parent.callee&&Ri(e.parent.callee,"memo"))}function Xn(e){for(;e;){let t=Oi(e);if(t&&(vi(t)||$t(t))||Ni(e)||ki(e))return!0;e=e.parent}return!1}function Ci(e){return!1}function Bn(e){return!1}var ul=/eslint +react-compiler\/react-compiler: +\["error/;function Ii(e){let t=null;if((e.type==="FunctionDeclaration"||e.type==="FunctionExpression"||e.type==="ArrowFunctionExpression"&&e.body.type==="BlockStatement")&&(t=e.body),!t||t.body.length===0)return!1;let n=t.body[0];return n.type==="ExpressionStatement"&&n.expression.type==="Literal"&&n.expression.value==="use no memo"}function Ai(e){let t=e.parent;for(;t;){if(t.type==="FunctionDeclaration"||t.type==="FunctionExpression"||t.type==="ArrowFunctionExpression")return t;t=t.parent}return null}var Pi={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"},reactCompilerIsEnabled:{type:"boolean"}}}]},create(e){let t=!!e.options[0]?.reactCompilerIsEnabled;if(t)return{CallExpression(p){let m=null;if(p.callee.name==="useMemo"?m="useMemo":p.callee.name==="useCallback"&&(m="useCallback"),m){let y=Ai(p);if(y&&Ii(y))return;e.report({node:p,message:`"${m}" is not necessary when using React Compiler.`})}}};if(e.options[0]?.ignoreIfReactCompilerIsEnabled||t){for(let p of e.sourceCode.getAllComments())if(ul.test(p.value))return{CallExpression(m){let y=null;if(m.callee.name==="useMemo"?y="useMemo":m.callee.name==="useCallback"&&(y="useCallback"),y){let u=Ai(m);if(u&&Ii(u))return;e.report({node:m,message:`"${y}" is not necessary when using React Compiler.`})}}}}let n=typeof e.getSource=="function"?p=>n(p):p=>e.sourceCode.getText(p),r=typeof e.getScope=="function"?()=>r():p=>e.sourceCode.getScope(p),s=null,o=[],i=[],a=new WeakSet;function l(p){for(let m of p.references){let y=m.identifier.parent;if(y.type==="VariableDeclarator"&&y.init&&y.init.type==="CallExpression"&&y.init.callee&&Ci(y.init.callee))for(let u of m.resolved.references)u!==m&&a.add(u.identifier)}}return{onCodePathSegmentStart:p=>i.push(p),onCodePathSegmentEnd:()=>i.pop(),onCodePathStart:()=>o.push(new Map),onCodePathEnd(p,m){let y=o.pop();if(y.size===0)return;let u=new Set;function d(b,C){let{cache:w}=d,N=w.get(b.id),k=new Set(C);if(k.has(b.id)){let O=[...k],f=O.slice(O.indexOf(b.id)+1);for(let x of f)u.add(x);return BigInt("0")}if(k.add(b.id),N!==void 0)return N;if(p.thrownSegments.includes(b))N=BigInt("0");else if(b.prevSegments.length===0)N=BigInt("1");else{N=BigInt("0");for(let O of b.prevSegments)N+=d(O,k)}return b.reachable&&N===BigInt("0")?w.delete(b.id):w.set(b.id,N),N}function c(b,C){let{cache:w}=c,N=w.get(b.id),k=new Set(C);if(k.has(b.id)){let O=Array.from(k),f=O.slice(O.indexOf(b.id)+1);for(let x of f)u.add(x);return BigInt("0")}if(k.add(b.id),N!==void 0)return N;if(p.thrownSegments.includes(b))N=BigInt("0");else if(b.nextSegments.length===0)N=BigInt("1");else{N=BigInt("0");for(let O of b.nextSegments)N+=c(O,k)}return w.set(b.id,N),N}function g(b){let{cache:C}=g,w=C.get(b.id);if(w===null)return 1/0;if(w!==void 0)return w;if(C.set(b.id,null),b.prevSegments.length===0)w=1;else{w=1/0;for(let N of b.prevSegments){let k=g(N);k<w&&(w=k)}w+=1}return C.set(b.id,w),w}d.cache=new Map,c.cache=new Map,g.cache=new Map;let h=c(p.initialSegment),S=Oi(m),I=Xn(m),A=S?vi(S)||$t(S):Ni(m)||ki(m),T=1/0;for(let b of p.finalSegments){if(!b.reachable)continue;let C=g(b);C<T&&(T=C)}for(let[b,C]of y){if(!b.reachable)continue;let w=b.nextSegments.length===0?T<=g(b):T<g(b),N=d(b)*c(b),k=u.has(b.id);for(let O of C)if(k&&!Bn(O)&&e.report({node:O,message:`React Hook "${n(O)}" 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.`}),A){if(m.async&&e.report({node:O,message:`React Hook "${n(O)}" cannot be called in an async function.`}),!k&&N!==h&&!Bn(O)){let x=`React Hook "${n(O)}" is called conditionally. React Hooks must be called in the exact same order in every component render.`+(w?" Did you accidentally call a React Hook after an early return?":"");e.report({node:O,message:x})}}else if(m.parent&&(m.parent.type==="MethodDefinition"||m.parent.type==="ClassProperty")&&m.parent.value===m){let f=`React Hook "${n(O)}" 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:O,message:f})}else if(S){let f=`React Hook "${n(O)}" is called in function "${n(S)}" 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:O,message:f})}else if(m.type==="Program"){let f=`React Hook "${n(O)}" 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:O,message:f})}else if(I&&!Bn(O)){if(m.parent.type==="CallExpression"&&m.parent.callee.type==="Identifier"&&m.parent.callee.name==="useCallback"){let x=m.parent;if(x.parent.type==="VariableDeclarator"&&Fi(x.parent.id.name))return}let f=`React Hook "${n(O)}" 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:O,message:f})}}},CallExpression(p){if($t(p.callee)){let m=wi(o),y=wi(i),u=m.get(y);u||(u=[],m.set(y,u)),u.push(p.callee)}p.callee.type==="Identifier"&&(p.callee.name==="useEffect"||Ci(p.callee))&&p.arguments.length>0&&(s=p)},Identifier(p){s==null&&a.has(p)&&p.parent.type!=="CallExpression"&&e.report({node:p,message:`\`${n(p)}\` 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"(p){p===s&&(s=null)},FunctionDeclaration(p){Xn(p)&&l(r(p))},ArrowFunctionExpression(p){Xn(p)&&l(r(p))}}}};function Oi(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 wi(e){return e[e.length-1]}var Ee=require("@typescript-eslint/utils"),Ie=Re(require("zod/v4"));var fl=/^\s+$/,Hn=/\r?\n/,ml=/^(\s*)/,yl=/^(\s*)\S/,dl=/\r?\n/,gl=Ie.object({indent:Ie.union([Ie.string().regex(fl),Ie.number().int().min(1)]).optional(),tags:Ie.array(Ie.string()).optional(),functions:Ie.array(Ie.string()).optional(),comments:Ie.array(Ie.string()).optional()}),Yn=z({name:"template-indent",meta:{type:"suggestion",docs:{description:"Fix whitespace-insensitive template indentation"},fixable:"code",schema:[U(gl)],messages:{improperlyIndented:"Templates should be properly indented."}},defaultOptions:[{}],create(e){let t=e.sourceCode,{comments:n=["HTML","indent"],functions:r=["dedent","stripIndent"],tags:s=["outdent","dedent","gql","sql","html","styled"],indent:o}=e.options[0],i=n.map(S=>S.toLowerCase());function a(S){let I=S.split(Hn),A=I.filter(b=>b.trim()!=="");if(A.length===0)return S;let T=Number.POSITIVE_INFINITY;for(let b of A){let C=b.match(ml);C&&(T=Math.min(T,C[1]?.length??0))}return!isFinite(T)||T===0?S:I.map(b=>b.slice(T)).join(`
36
36
  `)}function l(S,I,A){return S.split(Hn).map(b=>b.trim()===""?b:A.repeat(I)+b).join(`
37
- `)}function p(S){if(S.type===Ee.AST_NODE_TYPES.Identifier)return S.name;if(S.type===Ee.AST_NODE_TYPES.MemberExpression){let I=S.object.type===Ee.AST_NODE_TYPES.Identifier?S.object.name:null,A=S.property.type===Ee.AST_NODE_TYPES.Identifier?S.property.name:null;return I&&A?`${I}.${A}`:A}return null}function m(S,I){if(!S)return!1;for(let A of I)if(A.includes(".")){let T=A.split(".");if(S.type===Ee.AST_NODE_TYPES.MemberExpression&&S.object.type===Ee.AST_NODE_TYPES.Identifier&&S.property.type===Ee.AST_NODE_TYPES.Identifier&&S.object.name===T[0]&&S.property.name===T[1])return!0}else if(S.type===Ee.AST_NODE_TYPES.Identifier&&S.name===A)return!0;return!1}function y(S,I){let A=S.parent;if(A.type!==Ee.AST_NODE_TYPES.TaggedTemplateExpression)return!1;let T=p(A.tag);return T?I.includes(T):!1}function u(S,I){if(!S||S.type!==Ee.AST_NODE_TYPES.CallExpression)return!1;let{method:A,argumentsLength:T,optionalCall:b=!0,optionalMember:C=!0}=I;return T!==void 0&&S.arguments.length!==T||!b&&S.optional||S.callee.type!==Ee.AST_NODE_TYPES.MemberExpression||!C&&S.callee.optional||S.callee.property.type!==Ee.AST_NODE_TYPES.Identifier?!1:S.callee.property.name===A}function d(S,I){if(!S||S.type!==Ee.AST_NODE_TYPES.CallExpression)return!1;let{name:A,argumentsLength:T,optionalCall:b=!0}=I;return T!==void 0&&S.arguments.length!==T||!b&&S.optional||S.callee.type!==Ee.AST_NODE_TYPES.Identifier?!1:S.callee.name===A}function c(S){return u(S.parent,{method:"toMatchInlineSnapshot",argumentsLength:1,optionalCall:!1,optionalMember:!1})&&S.parent.type===Ee.AST_NODE_TYPES.CallExpression&&S.parent.arguments[0]===S&&d(S.parent.callee.type===Ee.AST_NODE_TYPES.MemberExpression?S.parent.callee.object:null,{name:"expect",argumentsLength:1,optionalCall:!1,optionalMember:!1})}function g(S){if(i.length>0){let I=t.getTokenBefore(S,{includeComments:!0});if(I?.type===Ee.AST_TOKEN_TYPES.Block&&i.includes(I.value.trim().toLowerCase()))return!0}return!!(c(S)||s.length>0&&y(S,s)||r.length>0&&S.parent.type===Ee.AST_NODE_TYPES.CallExpression&&S.parent.arguments.includes(S)&&m(S.parent.callee,r))}function h(S){let I=`__PLACEHOLDER__${Math.random()}`,A=S.quasis.map(M=>t.getText(M).slice(1,M.tail?-1:-2)).join(I),T=A.match(fl);if(!T)return;let b=T[0],C=t.lines[t.getLocFromIndex(S.range[0]).line-1];if(!C)return;let N=C.match(ul)?.[1]??"",k;typeof o=="string"?k=o:typeof o=="number"?k=" ".repeat(o):k=N.startsWith(" ")?" ":" ";let f=a(A).replace(new RegExp(`^${b}|${b}[ ]*$`,"g"),""),x=b+l(f,1,N+k)+b+N,E=A.includes(`\r
37
+ `)}function p(S){if(S.type===Ee.AST_NODE_TYPES.Identifier)return S.name;if(S.type===Ee.AST_NODE_TYPES.MemberExpression){let I=S.object.type===Ee.AST_NODE_TYPES.Identifier?S.object.name:null,A=S.property.type===Ee.AST_NODE_TYPES.Identifier?S.property.name:null;return I&&A?`${I}.${A}`:A}return null}function m(S,I){if(!S)return!1;for(let A of I)if(A.includes(".")){let T=A.split(".");if(S.type===Ee.AST_NODE_TYPES.MemberExpression&&S.object.type===Ee.AST_NODE_TYPES.Identifier&&S.property.type===Ee.AST_NODE_TYPES.Identifier&&S.object.name===T[0]&&S.property.name===T[1])return!0}else if(S.type===Ee.AST_NODE_TYPES.Identifier&&S.name===A)return!0;return!1}function y(S,I){let A=S.parent;if(A.type!==Ee.AST_NODE_TYPES.TaggedTemplateExpression)return!1;let T=p(A.tag);return T?I.includes(T):!1}function u(S,I){if(!S||S.type!==Ee.AST_NODE_TYPES.CallExpression)return!1;let{method:A,argumentsLength:T,optionalCall:b=!0,optionalMember:C=!0}=I;return T!==void 0&&S.arguments.length!==T||!b&&S.optional||S.callee.type!==Ee.AST_NODE_TYPES.MemberExpression||!C&&S.callee.optional||S.callee.property.type!==Ee.AST_NODE_TYPES.Identifier?!1:S.callee.property.name===A}function d(S,I){if(!S||S.type!==Ee.AST_NODE_TYPES.CallExpression)return!1;let{name:A,argumentsLength:T,optionalCall:b=!0}=I;return T!==void 0&&S.arguments.length!==T||!b&&S.optional||S.callee.type!==Ee.AST_NODE_TYPES.Identifier?!1:S.callee.name===A}function c(S){return u(S.parent,{method:"toMatchInlineSnapshot",argumentsLength:1,optionalCall:!1,optionalMember:!1})&&S.parent.type===Ee.AST_NODE_TYPES.CallExpression&&S.parent.arguments[0]===S&&d(S.parent.callee.type===Ee.AST_NODE_TYPES.MemberExpression?S.parent.callee.object:null,{name:"expect",argumentsLength:1,optionalCall:!1,optionalMember:!1})}function g(S){if(i.length>0){let I=t.getTokenBefore(S,{includeComments:!0});if(I?.type===Ee.AST_TOKEN_TYPES.Block&&i.includes(I.value.trim().toLowerCase()))return!0}return!!(c(S)||s.length>0&&y(S,s)||r.length>0&&S.parent.type===Ee.AST_NODE_TYPES.CallExpression&&S.parent.arguments.includes(S)&&m(S.parent.callee,r))}function h(S){let I=`__PLACEHOLDER__${Math.random()}`,A=S.quasis.map(M=>t.getText(M).slice(1,M.tail?-1:-2)).join(I),T=A.match(dl);if(!T)return;let b=T[0],C=t.lines[t.getLocFromIndex(S.range[0]).line-1];if(!C)return;let N=C.match(yl)?.[1]??"",k;typeof o=="string"?k=o:typeof o=="number"?k=" ".repeat(o):k=N.startsWith(" ")?" ":" ";let f=a(A).replace(new RegExp(`^${b}|${b}[ ]*$`,"g"),""),x=b+l(f,1,N+k)+b+N,E=A.includes(`\r
38
38
  `)?`\r
39
39
  `:`
40
- `,F=A.split(Hn),R=F.map((M,P)=>P!==F.length-1&&M===k+N?"":M).join(E);if(x!==R)return{node:S,messageId:"improperlyIndented",fix:M=>x.split(I).map((P,ee)=>{let Z=S.quasis[ee];return Z?M.replaceTextRange([Z.range[0]+1,Z.range[1]-(Z.tail?1:2)],P):[]}).flat()}}return{TemplateLiteral(S){if(!g(S))return;let I=h(S);if(I)return e.report(I)}}}});var qn=require("@typescript-eslint/utils");function yl(e){if(!("regex"in e))return!1;let t=e.regex.flags;return t.includes("g")||t.includes("y")}function dl(e){let t=e.parent;return t?.type===qn.AST_NODE_TYPES.NewExpression&&t.callee.type===qn.AST_NODE_TYPES.Identifier&&t.callee.name==="RegExp"}var Zn=z({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(n){yl(n)||dl(n)||e.report({node:n,messageId:"regexShouldBeTopLevel"})}return{"FunctionDeclaration Literal[regex], FunctionExpression Literal[regex], ArrowFunctionExpression Literal[regex], MethodDefinition Literal[regex]":t}}});var be=require("@typescript-eslint/utils"),dt=require("zod/v4");var gl=dt.z.object({checkOnly:dt.z.array(dt.z.enum(["function-args","FC","generic-args-at-fn-calls"])).optional(),checkTypesFromSelectors:dt.z.array(dt.z.string()).optional()}),Gn=z({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:[U(gl)],messages:{moveTypeAboveUsage:"Type definition should be placed directly above its first usage."}},defaultOptions:[{}],create(e,[t]){let n=e.sourceCode,r=new Map,s=[];function o(c){for(let g of s)if(c.range[0]>=g.range[0]&&c.range[1]<=g.range[1])return g;return null}function i(c){let g=c.parent;for(;g;){if(g.type===be.AST_NODE_TYPES.FunctionDeclaration||g.type===be.AST_NODE_TYPES.FunctionExpression||g.type===be.AST_NODE_TYPES.ArrowFunctionExpression){let h=g.params;for(let S of h)if(c.range[0]>=S.range[0]&&c.range[1]<=S.range[1])return!0;break}g=g.parent}return!1}function a(c){let g=c.parent;for(;g;){if(g.type===be.AST_NODE_TYPES.TSTypeParameterInstantiation){let h=g.parent;if(h.type===be.AST_NODE_TYPES.TSTypeReference&&h.typeName.type===be.AST_NODE_TYPES.Identifier&&(h.typeName.name==="FC"||h.typeName.name==="React.FC")||h.type===be.AST_NODE_TYPES.TSTypeReference&&h.typeName.type===be.AST_NODE_TYPES.TSQualifiedName&&h.typeName.right.name==="FC")return!0}g=g.parent}return!1}function l(c){let g=c.parent;for(;g;){if(g.type===be.AST_NODE_TYPES.TSTypeParameterInstantiation){let h=g.parent;if(h.type===be.AST_NODE_TYPES.CallExpression||h.type===be.AST_NODE_TYPES.NewExpression)return!0}g=g.parent}return!1}function p(c){let g=c.parent;for(;g;){if(g.type===be.AST_NODE_TYPES.TSTypeAliasDeclaration||g.type===be.AST_NODE_TYPES.TSInterfaceDeclaration)return!0;g=g.parent}return!1}function m(c){return c.parent.type===be.AST_NODE_TYPES.TSIndexedAccessType&&c.parent.objectType===c}let y=[];function u(c){let g=[],h=new Map;for(let{typeName:I,firstUsage:A}of c){let T=h.get(A)||[];T.push(I),h.set(A,T)}for(let{typeName:I,firstUsage:A,firstUsagePosition:T,firstUsageInFunctionArgs:b}of c){let C=r.get(I);if(!C||C.statement===A)continue;let w=s.indexOf(C.statement),N=s.indexOf(A);if(w===-1||N===-1)continue;let k=!!(t.checkOnly&&t.checkOnly.includes("function-args")&&b),f=(h.get(A)||[]).length>1;(k||f?w>N:w>N||w!==N-1)&&g.push({typeName:I,typeDef:C,targetStatement:A,firstUsagePosition:T})}if(g.length===0)return;g.sort((I,A)=>{let T=I.firstUsagePosition-A.firstUsagePosition;if(T!==0)return T;let b=s.indexOf(I.typeDef.statement),C=s.indexOf(A.typeDef.statement);return b-C});let S=g[0];S&&e.report({node:S.typeDef.node,messageId:"moveTypeAboveUsage",fix:d(g)})}function d(c){return function*(g){let h=new Map;for(let S of c){let I=h.get(S.targetStatement)||[];I.push(S),h.set(S.targetStatement,I)}for(let[,S]of h)S.sort((I,A)=>{let T=I.firstUsagePosition-A.firstUsagePosition;if(T!==0)return T;let b=s.indexOf(I.typeDef.statement),C=s.indexOf(A.typeDef.statement);return b-C});for(let S of c){let{typeDef:I}=S,A=I.statement,T=n.getCommentsBefore(A),b=A.range[0],C=A.range[1];T.length>0&&T[0]&&(b=T[0].range[0]),yield g.removeRange([b,C])}for(let[S,I]of h){let A=n.getCommentsBefore(S),T=A.length>0&&A[0]?A[0].range[0]:S.range[0],b=[];for(let C of I){let w=C.typeDef.statement,N=n.getText(w),k=n.getCommentsBefore(w),O=N;k.length>0&&(O=`${k.map(x=>n.getText(x)).join(`
40
+ `,F=A.split(Hn),R=F.map((M,P)=>P!==F.length-1&&M===k+N?"":M).join(E);if(x!==R)return{node:S,messageId:"improperlyIndented",fix:M=>x.split(I).map((P,ee)=>{let Z=S.quasis[ee];return Z?M.replaceTextRange([Z.range[0]+1,Z.range[1]-(Z.tail?1:2)],P):[]}).flat()}}return{TemplateLiteral(S){if(!g(S))return;let I=h(S);if(I)return e.report(I)}}}});var qn=require("@typescript-eslint/utils");function Sl(e){if(!("regex"in e))return!1;let t=e.regex.flags;return t.includes("g")||t.includes("y")}function Tl(e){let t=e.parent;return t?.type===qn.AST_NODE_TYPES.NewExpression&&t.callee.type===qn.AST_NODE_TYPES.Identifier&&t.callee.name==="RegExp"}var Zn=z({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(n){Sl(n)||Tl(n)||e.report({node:n,messageId:"regexShouldBeTopLevel"})}return{"FunctionDeclaration Literal[regex], FunctionExpression Literal[regex], ArrowFunctionExpression Literal[regex], MethodDefinition Literal[regex]":t}}});var be=require("@typescript-eslint/utils"),dt=require("zod/v4");var El=dt.z.object({checkOnly:dt.z.array(dt.z.enum(["function-args","FC","generic-args-at-fn-calls"])).optional(),checkTypesFromSelectors:dt.z.array(dt.z.string()).optional()}),Gn=z({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:[U(El)],messages:{moveTypeAboveUsage:"Type definition should be placed directly above its first usage."}},defaultOptions:[{}],create(e,[t]){let n=e.sourceCode,r=new Map,s=[];function o(c){for(let g of s)if(c.range[0]>=g.range[0]&&c.range[1]<=g.range[1])return g;return null}function i(c){let g=c.parent;for(;g;){if(g.type===be.AST_NODE_TYPES.FunctionDeclaration||g.type===be.AST_NODE_TYPES.FunctionExpression||g.type===be.AST_NODE_TYPES.ArrowFunctionExpression){let h=g.params;for(let S of h)if(c.range[0]>=S.range[0]&&c.range[1]<=S.range[1])return!0;break}g=g.parent}return!1}function a(c){let g=c.parent;for(;g;){if(g.type===be.AST_NODE_TYPES.TSTypeParameterInstantiation){let h=g.parent;if(h.type===be.AST_NODE_TYPES.TSTypeReference&&h.typeName.type===be.AST_NODE_TYPES.Identifier&&(h.typeName.name==="FC"||h.typeName.name==="React.FC")||h.type===be.AST_NODE_TYPES.TSTypeReference&&h.typeName.type===be.AST_NODE_TYPES.TSQualifiedName&&h.typeName.right.name==="FC")return!0}g=g.parent}return!1}function l(c){let g=c.parent;for(;g;){if(g.type===be.AST_NODE_TYPES.TSTypeParameterInstantiation){let h=g.parent;if(h.type===be.AST_NODE_TYPES.CallExpression||h.type===be.AST_NODE_TYPES.NewExpression)return!0}g=g.parent}return!1}function p(c){let g=c.parent;for(;g;){if(g.type===be.AST_NODE_TYPES.TSTypeAliasDeclaration||g.type===be.AST_NODE_TYPES.TSInterfaceDeclaration)return!0;g=g.parent}return!1}function m(c){return c.parent.type===be.AST_NODE_TYPES.TSIndexedAccessType&&c.parent.objectType===c}let y=[];function u(c){let g=[],h=new Map;for(let{typeName:I,firstUsage:A}of c){let T=h.get(A)||[];T.push(I),h.set(A,T)}for(let{typeName:I,firstUsage:A,firstUsagePosition:T,firstUsageInFunctionArgs:b}of c){let C=r.get(I);if(!C||C.statement===A)continue;let w=s.indexOf(C.statement),N=s.indexOf(A);if(w===-1||N===-1)continue;let k=!!(t.checkOnly&&t.checkOnly.includes("function-args")&&b),f=(h.get(A)||[]).length>1;(k||f?w>N:w>N||w!==N-1)&&g.push({typeName:I,typeDef:C,targetStatement:A,firstUsagePosition:T})}if(g.length===0)return;g.sort((I,A)=>{let T=I.firstUsagePosition-A.firstUsagePosition;if(T!==0)return T;let b=s.indexOf(I.typeDef.statement),C=s.indexOf(A.typeDef.statement);return b-C});let S=g[0];S&&e.report({node:S.typeDef.node,messageId:"moveTypeAboveUsage",fix:d(g)})}function d(c){return function*(g){let h=new Map;for(let S of c){let I=h.get(S.targetStatement)||[];I.push(S),h.set(S.targetStatement,I)}for(let[,S]of h)S.sort((I,A)=>{let T=I.firstUsagePosition-A.firstUsagePosition;if(T!==0)return T;let b=s.indexOf(I.typeDef.statement),C=s.indexOf(A.typeDef.statement);return b-C});for(let S of c){let{typeDef:I}=S,A=I.statement,T=n.getCommentsBefore(A),b=A.range[0],C=A.range[1];T.length>0&&T[0]&&(b=T[0].range[0]),yield g.removeRange([b,C])}for(let[S,I]of h){let A=n.getCommentsBefore(S),T=A.length>0&&A[0]?A[0].range[0]:S.range[0],b=[];for(let C of I){let w=C.typeDef.statement,N=n.getText(w),k=n.getCommentsBefore(w),O=N;k.length>0&&(O=`${k.map(x=>n.getText(x)).join(`
41
41
  `)}
42
42
  ${N}`),b.push(O)}yield g.insertTextBeforeRange([T,T],`${b.join(`
43
43
 
44
44
  `)}
45
45
 
46
- `)}}}return{Program(c){s.push(...c.body)},TSTypeAliasDeclaration(c){if(s.some(h=>h.type===be.AST_NODE_TYPES.ExportNamedDeclaration&&h.declaration===c?!0:h===c)){let h=o(c);h&&r.set(c.id.name,{node:c,name:c.id.name,statement:h})}},TSInterfaceDeclaration(c){if(s.some(h=>h.type===be.AST_NODE_TYPES.ExportNamedDeclaration&&h.declaration===c?!0:h===c)){let h=o(c);h&&r.set(c.id.name,{node:c,name:c.id.name,statement:h})}},TSTypeReference(c){if(c.typeName.type===be.AST_NODE_TYPES.Identifier){if(m(c))return;let g=i(c),h=a(c),S=l(c);y.push({typeName:c.typeName.name,node:c,inFunctionArgs:g,inFCProps:h,inGenericArgAtFunctionCall:S,usagePosition:c.range[0]})}},"Program:exit"(){let c=new Map;function g(S){if(!t.checkOnly||t.checkOnly.length===0)return!0;for(let I of t.checkOnly)if(I==="function-args"&&S.inFunctionArgs||I==="FC"&&S.inFCProps||I==="generic-args-at-fn-calls"&&S.inGenericArgAtFunctionCall)return!0;return!1}for(let S of y){let{typeName:I,node:A}=S;if(!r.has(I)||!g(S))continue;let T=o(A),b=r.get(I);if(!T||!b||T===b.statement)continue;c.has(I)||c.set(I,[]);let C=c.get(I);if(!C)return;C.includes(T)||C.push(T)}let h=[];for(let[S,I]of c)if(I.length>0){if(I.length===0)continue;let A=I[0];if(!A)continue;let T=Number.MAX_SAFE_INTEGER,b=!1;for(let w of I)w.range[0]<A.range[0]&&(A=w);for(let w of y)g(w)&&w.typeName===S&&o(w.node)===A&&w.usagePosition<T&&(T=w.usagePosition,b=w.inFunctionArgs);if(!!(t.checkOnly&&t.checkOnly.length>0)){let w=Number.MAX_SAFE_INTEGER;for(let k of y){if(k.typeName!==S)continue;let O=o(k.node);if(!O)continue;let f=s.indexOf(O);f!==-1&&f<w&&(w=f)}let N=s.indexOf(A);if(w!==Number.MAX_SAFE_INTEGER&&N!==-1&&w<N)continue}else{let w=Number.MAX_SAFE_INTEGER;for(let k of y){if(k.typeName!==S||p(k.node))continue;let O=o(k.node);if(!O)continue;let f=s.indexOf(O);f!==-1&&f<w&&(w=f)}let N=s.indexOf(A);if(w!==Number.MAX_SAFE_INTEGER&&N!==-1&&w<N)continue}h.push({typeName:S,firstUsage:A,firstUsagePosition:T,firstUsageInFunctionArgs:b})}h.length>0&&u(h)}}}});var ie=require("@typescript-eslint/utils"),gt=Re(require("zod/v4"));var Sl=["tsx"],Tl=/^[A-Z][A-Za-z0-9]*$/,El=gt.object({extensions:gt.array(gt.string()).optional()}),Kn=z({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:[U(El)]},defaultOptions:[{}],create(e,[t]){let n=e.getFilename(),r=t.extensions??Sl,s=!1;for(let T of r)if(n.endsWith(T)){s=!0;break}if(!s)return{};let o=e.sourceCode,i=new Set,a=new Map;function l(T){return Tl.test(T)}function p(T){if(T.type!==ie.AST_NODE_TYPES.CallExpression)return!1;let b=T.callee;return b.type===ie.AST_NODE_TYPES.Identifier?b.name==="memo"||b.name==="forwardRef":b.type===ie.AST_NODE_TYPES.MemberExpression&&b.property.type===ie.AST_NODE_TYPES.Identifier?b.property.name==="memo"||b.property.name==="forwardRef":!1}function m(T){if(T.type===ie.AST_NODE_TYPES.JSXElement||T.type===ie.AST_NODE_TYPES.JSXFragment)return!0;if(T.type===ie.AST_NODE_TYPES.ArrayExpression){for(let b of T.elements)if(b&&(b.type===ie.AST_NODE_TYPES.JSXElement||b.type===ie.AST_NODE_TYPES.JSXFragment))return!0}return!1}function y(T){if(T.type!==ie.AST_NODE_TYPES.ArrowFunctionExpression)return!1;let b=T.body;if(b.type===ie.AST_NODE_TYPES.ArrowFunctionExpression){let C=b.body;if(m(C))return!0}return!1}function u(T){if(T.id.type!==ie.AST_NODE_TYPES.Identifier)return;let b=T.id.name,C=T.init;if(C){if(l(b)&&(C.type===ie.AST_NODE_TYPES.ArrowFunctionExpression||C.type===ie.AST_NODE_TYPES.FunctionExpression||p(C))){i.add(b);return}C.type===ie.AST_NODE_TYPES.Identifier&&a.set(b,C.name),l(b)||y(C)&&i.add(b)}}function d(T){if(T.type===ie.AST_NODE_TYPES.VariableDeclaration){for(let b of T.declarations)u(b);return}if(T.type===ie.AST_NODE_TYPES.FunctionDeclaration&&T.id){l(T.id.name)&&i.add(T.id.name);return}if(T.type===ie.AST_NODE_TYPES.ExportNamedDeclaration&&T.declaration){let b=T.declaration;if(b.type===ie.AST_NODE_TYPES.VariableDeclaration){for(let C of b.declarations)u(C);return}if(b.type===ie.AST_NODE_TYPES.FunctionDeclaration&&b.id){l(b.id.name)&&i.add(b.id.name);return}}}for(let T of o.ast.body)d(T);function c(T,b=new Set){if(i.has(T))return!0;if(b.has(T))return!1;b.add(T);let C=a.get(T);return C?c(C,b):!1}let g=[];function h(T,b,C){g.push({node:T,isType:b,isComponent:C})}for(let T of o.ast.body){if(T.type===ie.AST_NODE_TYPES.ExportNamedDeclaration){let b=T.exportKind==="type";if(T.declaration){let C=T.declaration;if(C.type===ie.AST_NODE_TYPES.TSTypeAliasDeclaration||C.type===ie.AST_NODE_TYPES.TSInterfaceDeclaration){h(C,!0,!1);continue}if(C.type===ie.AST_NODE_TYPES.VariableDeclaration){for(let w of C.declarations){if(w.id.type!==ie.AST_NODE_TYPES.Identifier)continue;let N=w.id.name,k=c(N);h(w,b,k)}continue}if(C.type===ie.AST_NODE_TYPES.FunctionDeclaration){let w=C.id?.name,N=w?c(w)||l(w):!1;h(C,b,N);continue}h(C,b,!1);continue}if(T.specifiers.length>0)for(let C of T.specifiers){if(C.local.type!==ie.AST_NODE_TYPES.Identifier)continue;let w=C.local.name,N=c(w);h(C,b,N)}continue}if(T.type===ie.AST_NODE_TYPES.ExportDefaultDeclaration){let b=T.declaration;if(b.type===ie.AST_NODE_TYPES.Identifier){let C=c(b.name)||l(b.name);h(T,!1,C);continue}if(b.type===ie.AST_NODE_TYPES.FunctionDeclaration||b.type===ie.AST_NODE_TYPES.ArrowFunctionExpression||b.type===ie.AST_NODE_TYPES.FunctionExpression||b.type===ie.AST_NODE_TYPES.CallExpression){h(T,!1,!0);continue}h(T,!1,!1);continue}}let S=!1;for(let T of g)if(!T.isType&&T.isComponent){S=!0;break}if(!S)return{};let I=[];for(let T of g)T.isType||I.push(T);let A=-1;for(let[T,b]of I.entries())if(b.isComponent){A=T;break}if(A===-1)return{};for(let[T,b]of I.entries())if(T!==A){e.report({node:b.node,messageId:"multipleExports"});break}return{}}});var qe=require("@typescript-eslint/utils"),_t=require("zod/v4");function Ut(e){return e.charAt(0).toUpperCase()+e.slice(1)}function hl(e){return e.callee.type===qe.AST_NODE_TYPES.Identifier?e.callee.name==="useState":e.callee.type===qe.AST_NODE_TYPES.MemberExpression&&e.callee.object.type===qe.AST_NODE_TYPES.Identifier&&e.callee.property.type===qe.AST_NODE_TYPES.Identifier?e.callee.object.name==="React"&&e.callee.property.name==="useState":!1}var bl=_t.z.object({ignorePrefixes:_t.z.array(_t.z.string()).optional()});function Di(e,t){for(let n of t)if(e.startsWith(n))return e.slice(n.length);return e}function xl(e){return`set${Ut(e)}`}var Qn=z({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:[U(bl)]},defaultOptions:[{ignorePrefixes:[]}],create(e,[t]){return{VariableDeclarator(n){if(!n.init||n.init.type!==qe.AST_NODE_TYPES.CallExpression||!hl(n.init)||n.id.type!==qe.AST_NODE_TYPES.ArrayPattern||n.id.elements.length!==2)return;let[r,s]=n.id.elements;if(!r||!s||r.type!==qe.AST_NODE_TYPES.Identifier||s.type!==qe.AST_NODE_TYPES.Identifier)return;let o=r.name,i=s.name,a=t.ignorePrefixes||[],l=Di(o,a),p=Di(i,a);if(l===""){if(!p.startsWith("set")){let y=`set${Ut(o)}`;e.report({node:s,messageId:"incorrectSetterName",data:{expectedName:Ut(o),actualName:i},suggest:[{messageId:"useSuggestedName",data:{expectedSetterName:y},fix:u=>u.replaceText(s,y)}]})}return}let m=xl(l);p!==m&&e.report({node:s,messageId:"incorrectSetterName",data:{expectedName:Ut(l),actualName:i},suggest:[{messageId:"useSuggestedName",data:{expectedSetterName:m},fix:y=>y.replaceText(s,m)}]})}}}});var Te=require("@typescript-eslint/utils"),lt=require("zod/v4");var Cl=lt.z.object({name:lt.z.string(),defaults:lt.z.array(lt.z.unknown())}),Il=lt.z.object({functions:lt.z.array(Cl)});function zt(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)=>zt(s,t[o]));let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let s of n){if(!r.includes(s))return!1;let o=Object.getOwnPropertyDescriptor(e,s),i=Object.getOwnPropertyDescriptor(t,s);if(!o||!i)return!1;let a=o.value,l=i.value;if(!zt(a,l))return!1}return!0}function Al(e,t){let n=new Set;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return n;for(let r in e){if(!(r in t))continue;let s=Object.getOwnPropertyDescriptor(e,r),o=Object.getOwnPropertyDescriptor(t,r);s&&o&&zt(s.value,o.value)&&n.add(r)}return n}function Li(e){if(e.type===Te.AST_NODE_TYPES.SpreadElement)return Symbol("COMPLEX_EXPRESSION");switch(e.type){case Te.AST_NODE_TYPES.Literal:return e.value;case Te.AST_NODE_TYPES.ObjectExpression:{let t={};for(let n of e.properties)n.type===Te.AST_NODE_TYPES.Property&&n.key.type===Te.AST_NODE_TYPES.Identifier&&!n.computed&&(n.value.type===Te.AST_NODE_TYPES.Literal?t[n.key.name]=n.value.value:n.value.type===Te.AST_NODE_TYPES.ObjectExpression?t[n.key.name]=Li(n.value):t[n.key.name]=Symbol("COMPLEX_EXPRESSION"));return t}case Te.AST_NODE_TYPES.ArrayExpression:return e.elements.map(t=>{if(!(!t||t.type===Te.AST_NODE_TYPES.SpreadElement))return t.type===Te.AST_NODE_TYPES.Literal?t.value:Symbol("COMPLEX_EXPRESSION")});default:return Symbol("COMPLEX_EXPRESSION")}}function wl(e){return e.type===Te.AST_NODE_TYPES.Identifier?e.name:e.type===Te.AST_NODE_TYPES.MemberExpression&&e.property.type===Te.AST_NODE_TYPES.Identifier&&!e.computed?e.property.name:null}var er=z({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:[U(Il)]},defaultOptions:[{functions:[]}],create(e,[t]){let n=new Map;for(let r of t.functions)n.set(r.name,r.defaults);return{CallExpression(r){let s=wl(r.callee);if(!s)return;let o=n.get(s);if(!o)return;let i=r.arguments;if(i.length===0)return;let a=-1,l=!1,p=new Map,m=new Set,y=new Map,u=[];for(let c=0;c<i.length;c++){if(c>=o.length){a=c;continue}let g=o[c],h=i[c];if(!h||h.type===Te.AST_NODE_TYPES.SpreadElement){a=c;continue}let S=Li(h);if(g===void 0){a=c;continue}if(zt(S,g)){h.type===Te.AST_NODE_TYPES.ObjectExpression?(m.add(c),u.push({type:"object",position:c+1})):(y.set(c,S),u.push({type:"simple",position:c+1,value:S}));continue}if(h.type===Te.AST_NODE_TYPES.ObjectExpression&&h.properties.length===0&&typeof g=="object"&&g!==null&&Object.keys(g).length>0){m.add(c),u.push({type:"object",position:c+1});continue}let I=Al(S,g);if(I.size>0){let A=typeof g=="object"&&g!==null?Object.keys(g).length:0;if(h.type===Te.AST_NODE_TYPES.ObjectExpression&&h.properties.length===I.size&&h.properties.length===A){m.add(c),u.push({type:"object",position:c+1});continue}else l=!0,p.set(c,I),u.push({type:"partialObject",position:c+1,redundantProperties:Array.from(I)}),a=c}else a=c}if(a<i.length-1||l||m.size>0){let c=function(){let h=[];for(let S of u)if(S.type==="simple")h.push(`Param ${S.position} with value ${JSON.stringify(S.value)}`);else if(S.type==="object")h.push(`Param ${S.position} (object)`);else{let I=S.redundantProperties||[],A=o?o[S.position-1]:void 0;if(typeof A=="object"&&A!==null){let T=A;for(let b of I)if(b in T){let C=Object.getOwnPropertyDescriptor(T,b);C&&h.push(`Param ${S.position} property "${b}" with value ${JSON.stringify(C.value)}`)}}}return{messageId:"redundantParams",data:{details:h.join(", ")}}};var d=c;let g=c();e.report({node:r,messageId:g.messageId,data:g.data,fix(h){let S=[];if(l)for(let[A,T]of p){let b=i[A];if(b&&b.type===Te.AST_NODE_TYPES.ObjectExpression){let C=[];for(let N of b.properties)N.type===Te.AST_NODE_TYPES.Property&&N.key.type===Te.AST_NODE_TYPES.Identifier&&!N.computed&&T.has(N.key.name)||C.push(N);let w=C.map(N=>e.sourceCode.getText(N));S.push(h.replaceText(b,`{ ${w.join(", ")} }`))}}let I=-1;for(let A=i.length-1;A>=0;A--)if(!m.has(A)&&A<=a){I=A;break}if(I<i.length-1)if(I===-1){let A=e.sourceCode.getTokenAfter(r.callee),T=e.sourceCode.getLastToken(r);A&&T&&S.push(h.replaceTextRange([A.range[1],T.range[0]],""))}else{let A=i[I],T=e.sourceCode.getLastToken(r);T&&A&&S.push(h.replaceTextRange([A.range[1],T.range[0]],""))}return S.length>0?S:null}})}}}}});var ke=require("@typescript-eslint/utils");function Fl(e){let t=e.parent;for(;t;){if(t.type===ke.AST_NODE_TYPES.AwaitExpression||t.type===ke.AST_NODE_TYPES.MemberExpression&&t.object===e&&t.property.type===ke.AST_NODE_TYPES.Identifier&&t.property.name==="then"||t.type===ke.AST_NODE_TYPES.ArrowFunctionExpression&&t.body===e)return!0;if(t.type===ke.AST_NODE_TYPES.ArrayExpression&&t.parent.type===ke.AST_NODE_TYPES.CallExpression){let n=t.parent;if(n.callee.type===ke.AST_NODE_TYPES.MemberExpression&&n.callee.object.type===ke.AST_NODE_TYPES.Identifier&&n.callee.object.name==="Promise"&&n.callee.property.type===ke.AST_NODE_TYPES.Identifier&&["all","allSettled","race"].includes(n.callee.property.name))return!0}if(t.parent)t=t.parent;else break}return!1}function vl(e){let{callee:t}=e;return t.type===ke.AST_NODE_TYPES.Identifier&&t.name==="require"||t.type===ke.AST_NODE_TYPES.MemberExpression&&t.object.type===ke.AST_NODE_TYPES.Identifier&&t.object.name==="require"}var tr=z({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){Fl(t)||e.report({node:t,messageId:"syncDynamicImport"})},TSImportType(t){e.report({node:t,messageId:"syncDynamicImport"})},CallExpression(t){vl(t)&&e.report({node:t,messageId:"requireNotAllowed"})}}}});var $=require("@typescript-eslint/utils"),Vt=require("zod/v4");var Rl=Vt.z.object({mainComponentRegex:Vt.z.string().optional(),mainComponentSelector:Vt.z.string().optional()}),Nl=/^[A-Z][A-Za-z0-9]*$/,nr=z({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:[U(Rl)],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 n=e.sourceCode,r=t.mainComponentRegex?new RegExp(t.mainComponentRegex):void 0,s=t.mainComponentSelector;if(!e.filename.endsWith(".tsx"))return{};let i=new Set,a=new Map,l=[],p=[],m=new Set;function y(x){let E=x.node;if(E.type===$.AST_NODE_TYPES.VariableDeclaration){for(let F of E.declarations)if(F.id.type===$.AST_NODE_TYPES.Identifier&&F.id.name===x.name&&F.init)return F.init}if(E.type===$.AST_NODE_TYPES.ExportNamedDeclaration){let F=E.declaration;if(F&&F.type===$.AST_NODE_TYPES.VariableDeclaration){for(let R of F.declarations)if(R.id.type===$.AST_NODE_TYPES.Identifier&&R.id.name===x.name&&R.init)return R.init}}return null}function u(x){let E=new Set;return _e(x,F=>(F.type===$.AST_NODE_TYPES.Identifier&&F.name!=="styled"&&F.name!=="css"&&E.add(F.name),!1),n),E}function d(x){return Nl.test(x)}function c(x){if(x.type!==$.AST_NODE_TYPES.CallExpression)return!1;let E=x.callee;return E.type===$.AST_NODE_TYPES.Identifier?E.name==="memo"||E.name==="forwardRef":E.type===$.AST_NODE_TYPES.MemberExpression&&E.property.type===$.AST_NODE_TYPES.Identifier?E.property.name==="memo"||E.property.name==="forwardRef":!1}function g(x){if(x.type===$.AST_NODE_TYPES.JSXElement||x.type===$.AST_NODE_TYPES.JSXFragment)return!0;if(x.type===$.AST_NODE_TYPES.BlockStatement){for(let E of x.body)if(E.type===$.AST_NODE_TYPES.ReturnStatement&&E.argument)return g(E.argument)}if(x.type===$.AST_NODE_TYPES.ArrayExpression){for(let E of x.elements)if(E&&(E.type===$.AST_NODE_TYPES.JSXElement||E.type===$.AST_NODE_TYPES.JSXFragment))return!0}return!1}function h(x){if(x.type!==$.AST_NODE_TYPES.ArrowFunctionExpression)return!1;let E=x.body;if(E.type===$.AST_NODE_TYPES.ArrowFunctionExpression){let F=E.body;if(g(F))return!0}return!1}function S(x){if(x.type===$.AST_NODE_TYPES.TaggedTemplateExpression){let E=x.tag;if(E.type===$.AST_NODE_TYPES.MemberExpression&&E.object.type===$.AST_NODE_TYPES.Identifier&&E.object.name==="styled")return!0;if(E.type===$.AST_NODE_TYPES.CallExpression){let F=E.callee;if(F.type===$.AST_NODE_TYPES.Identifier&&F.name==="styled")return!0}}return!1}function I(x){if(x.type===$.AST_NODE_TYPES.TaggedTemplateExpression){let E=x.tag;if(E.type===$.AST_NODE_TYPES.Identifier&&E.name==="css")return!0}return!1}function A(x,E){if(x.id.type!==$.AST_NODE_TYPES.Identifier)return;let F=x.id.name,R=x.init;if(R){if(S(R)||I(R)){p.push({node:E,name:F});return}if((d(F)||R.type===$.AST_NODE_TYPES.ArrowFunctionExpression)&&(R.type===$.AST_NODE_TYPES.ArrowFunctionExpression||R.type===$.AST_NODE_TYPES.FunctionExpression||c(R))){if(R.type===$.AST_NODE_TYPES.ArrowFunctionExpression||R.type===$.AST_NODE_TYPES.FunctionExpression){if(g(R.body)){i.add(F);return}}else if(c(R)){i.add(F);return}}R.type===$.AST_NODE_TYPES.Identifier&&a.set(F,R.name),d(F)||h(R)&&i.add(F)}}function T(x){return x.type===$.AST_NODE_TYPES.ExportDefaultDeclaration||x.type===$.AST_NODE_TYPES.ExportNamedDeclaration}function b(x){if(x.type===$.AST_NODE_TYPES.FunctionDeclaration)return x.id?x.id.name:null;if(x.type===$.AST_NODE_TYPES.VariableDeclaration){let E=x.declarations[0];if(E&&E.id.type===$.AST_NODE_TYPES.Identifier)return E.id.name}if(x.type===$.AST_NODE_TYPES.ExportDefaultDeclaration){let E=x.declaration;if(E.type===$.AST_NODE_TYPES.FunctionDeclaration)return E.id?E.id.name:"default";if(E.type===$.AST_NODE_TYPES.Identifier)return E.name}if(x.type===$.AST_NODE_TYPES.ExportNamedDeclaration){let E=x.declaration;if(E&&E.type===$.AST_NODE_TYPES.FunctionDeclaration)return E.id?E.id.name:null;if(E&&E.type===$.AST_NODE_TYPES.VariableDeclaration){let F=E.declarations[0];if(F&&F.id.type===$.AST_NODE_TYPES.Identifier)return F.id.name}}return null}function C(x,E){return s?m.has(x):r?r.test(E):T(x)}function w(x){let E=new Set;_e(x.node,F=>{if(F.type===$.AST_NODE_TYPES.Identifier)for(let R of p)R.name===F.name&&(E.add(R.name),(R.firstUsagePosition===void 0||F.range[0]<R.firstUsagePosition)&&(R.firstUsagePosition=F.range[0]));if(F.type===$.AST_NODE_TYPES.JSXElement){let R=F.openingElement;if(R.name.type===$.AST_NODE_TYPES.JSXIdentifier)for(let M of p)M.name===R.name.name&&(E.add(M.name),(M.firstUsagePosition===void 0||R.name.range[0]<M.firstUsagePosition)&&(M.firstUsagePosition=R.name.range[0]))}return!1},n),x.usedStyles=E}function N(x){if(x.type===$.AST_NODE_TYPES.VariableDeclaration){for(let E of x.declarations)A(E,x);return}if(x.type===$.AST_NODE_TYPES.FunctionDeclaration){d(x.id.name)&&g(x.body)&&i.add(x.id.name);return}if(x.type===$.AST_NODE_TYPES.ExportNamedDeclaration&&x.declaration){let E=x.declaration;if(E.type===$.AST_NODE_TYPES.VariableDeclaration){for(let F of E.declarations)A(F,x);return}if(E.type===$.AST_NODE_TYPES.FunctionDeclaration&&E.id){d(E.id.name)&&g(E.body)&&i.add(E.id.name);return}}if(x.type===$.AST_NODE_TYPES.ExportDefaultDeclaration){let E=x.declaration;E.type===$.AST_NODE_TYPES.Identifier&&i.add(E.name),(E.type===$.AST_NODE_TYPES.FunctionDeclaration||E.type===$.AST_NODE_TYPES.ArrowFunctionExpression||E.type===$.AST_NODE_TYPES.FunctionExpression)&&(E.type===$.AST_NODE_TYPES.FunctionDeclaration?E.id?i.add(E.id.name):i.add("default"):g(E.body)&&i.add("default"))}}function k(x,E=new Set){if(i.has(x))return!0;if(E.has(x))return!1;E.add(x);let F=a.get(x);return F?k(F,E):!1}let O={};return s&&(O[s]=x=>{let E=x;for(;E.parent&&E.parent.type!==$.AST_NODE_TYPES.Program;)E=E.parent;E.parent&&(E.type===$.AST_NODE_TYPES.VariableDeclaration||E.type===$.AST_NODE_TYPES.FunctionDeclaration||E.type===$.AST_NODE_TYPES.ExportNamedDeclaration||E.type===$.AST_NODE_TYPES.ExportDefaultDeclaration)&&m.add(E)}),O["Program:exit"]=x=>{let E=0;for(let D of x.body){if(D.type===$.AST_NODE_TYPES.ImportDeclaration){E+=1;continue}break}for(let D of x.body)N(D);for(let D of x.body){let q=b(D);if(q&&k(q)){let B=C(D,q);l.push({node:D,name:q,isMainComponent:B,usedStyles:new Set,isExported:T(D)})}}if(!s&&r&&!l.some(D=>D.isMainComponent))for(let D of l)D.isExported&&(D.isMainComponent=!0);for(let D of l)w(D);let F=new Set;for(let D of p)F.add(D.name);let R=new Map;for(let D=0;D<x.body.length;D+=1){let q=x.body[D];for(let B of p)B.node===q&&R.set(B.name,D)}let M=new Map;for(let D of p){let q=y(D),B=new Set;if(q){let ue=u(q);for(let me of ue)F.has(me)&&me!==D.name&&B.add(me)}M.set(D.name,B)}let P=new Map;for(let D of p){let q=M.get(D.name);if(!q)continue;let B=R.get(D.name);if(B!==void 0)for(let ue of q){let me=P.get(ue);(me===void 0||B<me)&&P.set(ue,B)}}let ee=[];for(let D of p){if(D.firstUsagePosition===void 0)continue;let q=x.body.indexOf(D.node),B=-1;for(let Ce of l){if(!Ce.usedStyles.has(D.name))continue;let we=x.body.indexOf(Ce.node);(B===-1||we<B)&&(B=we)}let ue=P.get(D.name);if(ue!==void 0&&(B===-1||ue<B)&&(B=ue),B===-1)continue;let me=-1;for(let Ce of l){let we=x.body.indexOf(Ce.node);we<B&&we>me&&(me=we)}let Oe=q<B,Ze=q>me,he=-1,Et=M.get(D.name);if(Et)for(let Ce of Et){let we=R.get(Ce);we!==void 0&&we>he&&(he=we)}let pt=q>he;if(!(Oe&&Ze&&pt)){let Ce=me+1;if(he+1>Ce&&(Ce=he+1),Ce<E&&(Ce=E),Ce>B)continue;ee.push({style:D,targetPosition:Ce})}}let Z=null;if(l.length>1){let D=l.map(B=>({c:B,idx:x.body.indexOf(B.node)})).sort((B,ue)=>B.idx-ue.idx)[0]?.c,q=l.find(B=>B.isMainComponent)||null;D&&q&&D.node!==q.node&&(Z={component:q,targetBefore:D.node})}if(ee.length>0||Z){let D=ee[0]?.style.node||Z?.component.node||x,q=ee.length>0?"stylesShouldBeAboveUsage":"mainComponentShouldBeFirst";e.report({node:D,messageId:q,fix:f(ee,Z,x.body)})}},O;function f(x,E,F){return function*(R){x.sort((P,ee)=>P.targetPosition-ee.targetPosition);for(let{style:P}of x){let ee=n.getCommentsBefore(P.node),Z=P.node.range[0],D=P.node.range[1];ee.length>0&&ee[0]&&(Z=ee[0].range[0]),Z===P.node.range[0]&&n.text.slice(0,Z).trim().length===0&&(Z=0),yield R.removeRange([Z,D])}let M=new Map;for(let P of x){let ee=M.get(P.targetPosition)||[];ee.push(P),M.set(P.targetPosition,ee)}for(let[P,ee]of M){let Z=F[P];if(!Z)continue;let D=n.getCommentsBefore(Z),q=D.length>0&&D[0]?D[0].range[0]:Z.range[0],B=[];for(let{style:ue}of ee){let me=n.getCommentsBefore(ue.node),Oe=n.getText(ue.node);me.length>0&&(Oe=`${me.map(he=>n.getText(he)).join(`
46
+ `)}}}return{Program(c){s.push(...c.body)},TSTypeAliasDeclaration(c){if(s.some(h=>h.type===be.AST_NODE_TYPES.ExportNamedDeclaration&&h.declaration===c?!0:h===c)){let h=o(c);h&&r.set(c.id.name,{node:c,name:c.id.name,statement:h})}},TSInterfaceDeclaration(c){if(s.some(h=>h.type===be.AST_NODE_TYPES.ExportNamedDeclaration&&h.declaration===c?!0:h===c)){let h=o(c);h&&r.set(c.id.name,{node:c,name:c.id.name,statement:h})}},TSTypeReference(c){if(c.typeName.type===be.AST_NODE_TYPES.Identifier){if(m(c))return;let g=i(c),h=a(c),S=l(c);y.push({typeName:c.typeName.name,node:c,inFunctionArgs:g,inFCProps:h,inGenericArgAtFunctionCall:S,usagePosition:c.range[0]})}},"Program:exit"(){let c=new Map;function g(S){if(!t.checkOnly||t.checkOnly.length===0)return!0;for(let I of t.checkOnly)if(I==="function-args"&&S.inFunctionArgs||I==="FC"&&S.inFCProps||I==="generic-args-at-fn-calls"&&S.inGenericArgAtFunctionCall)return!0;return!1}for(let S of y){let{typeName:I,node:A}=S;if(!r.has(I)||!g(S))continue;let T=o(A),b=r.get(I);if(!T||!b||T===b.statement)continue;c.has(I)||c.set(I,[]);let C=c.get(I);if(!C)return;C.includes(T)||C.push(T)}let h=[];for(let[S,I]of c)if(I.length>0){if(I.length===0)continue;let A=I[0];if(!A)continue;let T=Number.MAX_SAFE_INTEGER,b=!1;for(let w of I)w.range[0]<A.range[0]&&(A=w);for(let w of y)g(w)&&w.typeName===S&&o(w.node)===A&&w.usagePosition<T&&(T=w.usagePosition,b=w.inFunctionArgs);if(!!(t.checkOnly&&t.checkOnly.length>0)){let w=Number.MAX_SAFE_INTEGER;for(let k of y){if(k.typeName!==S)continue;let O=o(k.node);if(!O)continue;let f=s.indexOf(O);f!==-1&&f<w&&(w=f)}let N=s.indexOf(A);if(w!==Number.MAX_SAFE_INTEGER&&N!==-1&&w<N)continue}else{let w=Number.MAX_SAFE_INTEGER;for(let k of y){if(k.typeName!==S||p(k.node))continue;let O=o(k.node);if(!O)continue;let f=s.indexOf(O);f!==-1&&f<w&&(w=f)}let N=s.indexOf(A);if(w!==Number.MAX_SAFE_INTEGER&&N!==-1&&w<N)continue}h.push({typeName:S,firstUsage:A,firstUsagePosition:T,firstUsageInFunctionArgs:b})}h.length>0&&u(h)}}}});var ie=require("@typescript-eslint/utils"),gt=Re(require("zod/v4"));var hl=["tsx"],bl=/^[A-Z][A-Za-z0-9]*$/,xl=gt.object({extensions:gt.array(gt.string()).optional()}),Kn=z({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:[U(xl)]},defaultOptions:[{}],create(e,[t]){let n=e.getFilename(),r=t.extensions??hl,s=!1;for(let T of r)if(n.endsWith(T)){s=!0;break}if(!s)return{};let o=e.sourceCode,i=new Set,a=new Map;function l(T){return bl.test(T)}function p(T){if(T.type!==ie.AST_NODE_TYPES.CallExpression)return!1;let b=T.callee;return b.type===ie.AST_NODE_TYPES.Identifier?b.name==="memo"||b.name==="forwardRef":b.type===ie.AST_NODE_TYPES.MemberExpression&&b.property.type===ie.AST_NODE_TYPES.Identifier?b.property.name==="memo"||b.property.name==="forwardRef":!1}function m(T){if(T.type===ie.AST_NODE_TYPES.JSXElement||T.type===ie.AST_NODE_TYPES.JSXFragment)return!0;if(T.type===ie.AST_NODE_TYPES.ArrayExpression){for(let b of T.elements)if(b&&(b.type===ie.AST_NODE_TYPES.JSXElement||b.type===ie.AST_NODE_TYPES.JSXFragment))return!0}return!1}function y(T){if(T.type!==ie.AST_NODE_TYPES.ArrowFunctionExpression)return!1;let b=T.body;if(b.type===ie.AST_NODE_TYPES.ArrowFunctionExpression){let C=b.body;if(m(C))return!0}return!1}function u(T){if(T.id.type!==ie.AST_NODE_TYPES.Identifier)return;let b=T.id.name,C=T.init;if(C){if(l(b)&&(C.type===ie.AST_NODE_TYPES.ArrowFunctionExpression||C.type===ie.AST_NODE_TYPES.FunctionExpression||p(C))){i.add(b);return}C.type===ie.AST_NODE_TYPES.Identifier&&a.set(b,C.name),l(b)||y(C)&&i.add(b)}}function d(T){if(T.type===ie.AST_NODE_TYPES.VariableDeclaration){for(let b of T.declarations)u(b);return}if(T.type===ie.AST_NODE_TYPES.FunctionDeclaration&&T.id){l(T.id.name)&&i.add(T.id.name);return}if(T.type===ie.AST_NODE_TYPES.ExportNamedDeclaration&&T.declaration){let b=T.declaration;if(b.type===ie.AST_NODE_TYPES.VariableDeclaration){for(let C of b.declarations)u(C);return}if(b.type===ie.AST_NODE_TYPES.FunctionDeclaration&&b.id){l(b.id.name)&&i.add(b.id.name);return}}}for(let T of o.ast.body)d(T);function c(T,b=new Set){if(i.has(T))return!0;if(b.has(T))return!1;b.add(T);let C=a.get(T);return C?c(C,b):!1}let g=[];function h(T,b,C){g.push({node:T,isType:b,isComponent:C})}for(let T of o.ast.body){if(T.type===ie.AST_NODE_TYPES.ExportNamedDeclaration){let b=T.exportKind==="type";if(T.declaration){let C=T.declaration;if(C.type===ie.AST_NODE_TYPES.TSTypeAliasDeclaration||C.type===ie.AST_NODE_TYPES.TSInterfaceDeclaration){h(C,!0,!1);continue}if(C.type===ie.AST_NODE_TYPES.VariableDeclaration){for(let w of C.declarations){if(w.id.type!==ie.AST_NODE_TYPES.Identifier)continue;let N=w.id.name,k=c(N);h(w,b,k)}continue}if(C.type===ie.AST_NODE_TYPES.FunctionDeclaration){let w=C.id?.name,N=w?c(w)||l(w):!1;h(C,b,N);continue}h(C,b,!1);continue}if(T.specifiers.length>0)for(let C of T.specifiers){if(C.local.type!==ie.AST_NODE_TYPES.Identifier)continue;let w=C.local.name,N=c(w);h(C,b,N)}continue}if(T.type===ie.AST_NODE_TYPES.ExportDefaultDeclaration){let b=T.declaration;if(b.type===ie.AST_NODE_TYPES.Identifier){let C=c(b.name)||l(b.name);h(T,!1,C);continue}if(b.type===ie.AST_NODE_TYPES.FunctionDeclaration||b.type===ie.AST_NODE_TYPES.ArrowFunctionExpression||b.type===ie.AST_NODE_TYPES.FunctionExpression||b.type===ie.AST_NODE_TYPES.CallExpression){h(T,!1,!0);continue}h(T,!1,!1);continue}}let S=!1;for(let T of g)if(!T.isType&&T.isComponent){S=!0;break}if(!S)return{};let I=[];for(let T of g)T.isType||I.push(T);let A=-1;for(let[T,b]of I.entries())if(b.isComponent){A=T;break}if(A===-1)return{};for(let[T,b]of I.entries())if(T!==A){e.report({node:b.node,messageId:"multipleExports"});break}return{}}});var qe=require("@typescript-eslint/utils"),_t=require("zod/v4");function Ut(e){return e.charAt(0).toUpperCase()+e.slice(1)}function Cl(e){return e.callee.type===qe.AST_NODE_TYPES.Identifier?e.callee.name==="useState":e.callee.type===qe.AST_NODE_TYPES.MemberExpression&&e.callee.object.type===qe.AST_NODE_TYPES.Identifier&&e.callee.property.type===qe.AST_NODE_TYPES.Identifier?e.callee.object.name==="React"&&e.callee.property.name==="useState":!1}var Il=_t.z.object({ignorePrefixes:_t.z.array(_t.z.string()).optional()});function Di(e,t){for(let n of t)if(e.startsWith(n))return e.slice(n.length);return e}function Al(e){return`set${Ut(e)}`}var Qn=z({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:[U(Il)]},defaultOptions:[{ignorePrefixes:[]}],create(e,[t]){return{VariableDeclarator(n){if(!n.init||n.init.type!==qe.AST_NODE_TYPES.CallExpression||!Cl(n.init)||n.id.type!==qe.AST_NODE_TYPES.ArrayPattern||n.id.elements.length!==2)return;let[r,s]=n.id.elements;if(!r||!s||r.type!==qe.AST_NODE_TYPES.Identifier||s.type!==qe.AST_NODE_TYPES.Identifier)return;let o=r.name,i=s.name,a=t.ignorePrefixes||[],l=Di(o,a),p=Di(i,a);if(l===""){if(!p.startsWith("set")){let y=`set${Ut(o)}`;e.report({node:s,messageId:"incorrectSetterName",data:{expectedName:Ut(o),actualName:i},suggest:[{messageId:"useSuggestedName",data:{expectedSetterName:y},fix:u=>u.replaceText(s,y)}]})}return}let m=Al(l);p!==m&&e.report({node:s,messageId:"incorrectSetterName",data:{expectedName:Ut(l),actualName:i},suggest:[{messageId:"useSuggestedName",data:{expectedSetterName:m},fix:y=>y.replaceText(s,m)}]})}}}});var Te=require("@typescript-eslint/utils"),lt=require("zod/v4");var wl=lt.z.object({name:lt.z.string(),defaults:lt.z.array(lt.z.unknown())}),Fl=lt.z.object({functions:lt.z.array(wl)});function zt(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)=>zt(s,t[o]));let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let s of n){if(!r.includes(s))return!1;let o=Object.getOwnPropertyDescriptor(e,s),i=Object.getOwnPropertyDescriptor(t,s);if(!o||!i)return!1;let a=o.value,l=i.value;if(!zt(a,l))return!1}return!0}function vl(e,t){let n=new Set;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return n;for(let r in e){if(!(r in t))continue;let s=Object.getOwnPropertyDescriptor(e,r),o=Object.getOwnPropertyDescriptor(t,r);s&&o&&zt(s.value,o.value)&&n.add(r)}return n}function Li(e){if(e.type===Te.AST_NODE_TYPES.SpreadElement)return Symbol("COMPLEX_EXPRESSION");switch(e.type){case Te.AST_NODE_TYPES.Literal:return e.value;case Te.AST_NODE_TYPES.ObjectExpression:{let t={};for(let n of e.properties)n.type===Te.AST_NODE_TYPES.Property&&n.key.type===Te.AST_NODE_TYPES.Identifier&&!n.computed&&(n.value.type===Te.AST_NODE_TYPES.Literal?t[n.key.name]=n.value.value:n.value.type===Te.AST_NODE_TYPES.ObjectExpression?t[n.key.name]=Li(n.value):t[n.key.name]=Symbol("COMPLEX_EXPRESSION"));return t}case Te.AST_NODE_TYPES.ArrayExpression:return e.elements.map(t=>{if(!(!t||t.type===Te.AST_NODE_TYPES.SpreadElement))return t.type===Te.AST_NODE_TYPES.Literal?t.value:Symbol("COMPLEX_EXPRESSION")});default:return Symbol("COMPLEX_EXPRESSION")}}function Rl(e){return e.type===Te.AST_NODE_TYPES.Identifier?e.name:e.type===Te.AST_NODE_TYPES.MemberExpression&&e.property.type===Te.AST_NODE_TYPES.Identifier&&!e.computed?e.property.name:null}var er=z({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:[U(Fl)]},defaultOptions:[{functions:[]}],create(e,[t]){let n=new Map;for(let r of t.functions)n.set(r.name,r.defaults);return{CallExpression(r){let s=Rl(r.callee);if(!s)return;let o=n.get(s);if(!o)return;let i=r.arguments;if(i.length===0)return;let a=-1,l=!1,p=new Map,m=new Set,y=new Map,u=[];for(let c=0;c<i.length;c++){if(c>=o.length){a=c;continue}let g=o[c],h=i[c];if(!h||h.type===Te.AST_NODE_TYPES.SpreadElement){a=c;continue}let S=Li(h);if(g===void 0){a=c;continue}if(zt(S,g)){h.type===Te.AST_NODE_TYPES.ObjectExpression?(m.add(c),u.push({type:"object",position:c+1})):(y.set(c,S),u.push({type:"simple",position:c+1,value:S}));continue}if(h.type===Te.AST_NODE_TYPES.ObjectExpression&&h.properties.length===0&&typeof g=="object"&&g!==null&&Object.keys(g).length>0){m.add(c),u.push({type:"object",position:c+1});continue}let I=vl(S,g);if(I.size>0){let A=typeof g=="object"&&g!==null?Object.keys(g).length:0;if(h.type===Te.AST_NODE_TYPES.ObjectExpression&&h.properties.length===I.size&&h.properties.length===A){m.add(c),u.push({type:"object",position:c+1});continue}else l=!0,p.set(c,I),u.push({type:"partialObject",position:c+1,redundantProperties:Array.from(I)}),a=c}else a=c}if(a<i.length-1||l||m.size>0){let c=function(){let h=[];for(let S of u)if(S.type==="simple")h.push(`Param ${S.position} with value ${JSON.stringify(S.value)}`);else if(S.type==="object")h.push(`Param ${S.position} (object)`);else{let I=S.redundantProperties||[],A=o?o[S.position-1]:void 0;if(typeof A=="object"&&A!==null){let T=A;for(let b of I)if(b in T){let C=Object.getOwnPropertyDescriptor(T,b);C&&h.push(`Param ${S.position} property "${b}" with value ${JSON.stringify(C.value)}`)}}}return{messageId:"redundantParams",data:{details:h.join(", ")}}};var d=c;let g=c();e.report({node:r,messageId:g.messageId,data:g.data,fix(h){let S=[];if(l)for(let[A,T]of p){let b=i[A];if(b&&b.type===Te.AST_NODE_TYPES.ObjectExpression){let C=[];for(let N of b.properties)N.type===Te.AST_NODE_TYPES.Property&&N.key.type===Te.AST_NODE_TYPES.Identifier&&!N.computed&&T.has(N.key.name)||C.push(N);let w=C.map(N=>e.sourceCode.getText(N));S.push(h.replaceText(b,`{ ${w.join(", ")} }`))}}let I=-1;for(let A=i.length-1;A>=0;A--)if(!m.has(A)&&A<=a){I=A;break}if(I<i.length-1)if(I===-1){let A=e.sourceCode.getTokenAfter(r.callee),T=e.sourceCode.getLastToken(r);A&&T&&S.push(h.replaceTextRange([A.range[1],T.range[0]],""))}else{let A=i[I],T=e.sourceCode.getLastToken(r);T&&A&&S.push(h.replaceTextRange([A.range[1],T.range[0]],""))}return S.length>0?S:null}})}}}}});var ke=require("@typescript-eslint/utils");function Nl(e){let t=e.parent;for(;t;){if(t.type===ke.AST_NODE_TYPES.AwaitExpression||t.type===ke.AST_NODE_TYPES.MemberExpression&&t.object===e&&t.property.type===ke.AST_NODE_TYPES.Identifier&&t.property.name==="then"||t.type===ke.AST_NODE_TYPES.ArrowFunctionExpression&&t.body===e)return!0;if(t.type===ke.AST_NODE_TYPES.ArrayExpression&&t.parent.type===ke.AST_NODE_TYPES.CallExpression){let n=t.parent;if(n.callee.type===ke.AST_NODE_TYPES.MemberExpression&&n.callee.object.type===ke.AST_NODE_TYPES.Identifier&&n.callee.object.name==="Promise"&&n.callee.property.type===ke.AST_NODE_TYPES.Identifier&&["all","allSettled","race"].includes(n.callee.property.name))return!0}if(t.parent)t=t.parent;else break}return!1}function kl(e){let{callee:t}=e;return t.type===ke.AST_NODE_TYPES.Identifier&&t.name==="require"||t.type===ke.AST_NODE_TYPES.MemberExpression&&t.object.type===ke.AST_NODE_TYPES.Identifier&&t.object.name==="require"}var tr=z({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){Nl(t)||e.report({node:t,messageId:"syncDynamicImport"})},TSImportType(t){e.report({node:t,messageId:"syncDynamicImport"})},CallExpression(t){kl(t)&&e.report({node:t,messageId:"requireNotAllowed"})}}}});var $=require("@typescript-eslint/utils"),Vt=require("zod/v4");var Pl=Vt.z.object({mainComponentRegex:Vt.z.string().optional(),mainComponentSelector:Vt.z.string().optional()}),Ol=/^[A-Z][A-Za-z0-9]*$/,nr=z({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:[U(Pl)],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 n=e.sourceCode,r=t.mainComponentRegex?new RegExp(t.mainComponentRegex):void 0,s=t.mainComponentSelector;if(!e.filename.endsWith(".tsx"))return{};let i=new Set,a=new Map,l=[],p=[],m=new Set;function y(x){let E=x.node;if(E.type===$.AST_NODE_TYPES.VariableDeclaration){for(let F of E.declarations)if(F.id.type===$.AST_NODE_TYPES.Identifier&&F.id.name===x.name&&F.init)return F.init}if(E.type===$.AST_NODE_TYPES.ExportNamedDeclaration){let F=E.declaration;if(F&&F.type===$.AST_NODE_TYPES.VariableDeclaration){for(let R of F.declarations)if(R.id.type===$.AST_NODE_TYPES.Identifier&&R.id.name===x.name&&R.init)return R.init}}return null}function u(x){let E=new Set;return _e(x,F=>(F.type===$.AST_NODE_TYPES.Identifier&&F.name!=="styled"&&F.name!=="css"&&E.add(F.name),!1),n),E}function d(x){return Ol.test(x)}function c(x){if(x.type!==$.AST_NODE_TYPES.CallExpression)return!1;let E=x.callee;return E.type===$.AST_NODE_TYPES.Identifier?E.name==="memo"||E.name==="forwardRef":E.type===$.AST_NODE_TYPES.MemberExpression&&E.property.type===$.AST_NODE_TYPES.Identifier?E.property.name==="memo"||E.property.name==="forwardRef":!1}function g(x){if(x.type===$.AST_NODE_TYPES.JSXElement||x.type===$.AST_NODE_TYPES.JSXFragment)return!0;if(x.type===$.AST_NODE_TYPES.BlockStatement){for(let E of x.body)if(E.type===$.AST_NODE_TYPES.ReturnStatement&&E.argument)return g(E.argument)}if(x.type===$.AST_NODE_TYPES.ArrayExpression){for(let E of x.elements)if(E&&(E.type===$.AST_NODE_TYPES.JSXElement||E.type===$.AST_NODE_TYPES.JSXFragment))return!0}return!1}function h(x){if(x.type!==$.AST_NODE_TYPES.ArrowFunctionExpression)return!1;let E=x.body;if(E.type===$.AST_NODE_TYPES.ArrowFunctionExpression){let F=E.body;if(g(F))return!0}return!1}function S(x){if(x.type===$.AST_NODE_TYPES.TaggedTemplateExpression){let E=x.tag;if(E.type===$.AST_NODE_TYPES.MemberExpression&&E.object.type===$.AST_NODE_TYPES.Identifier&&E.object.name==="styled")return!0;if(E.type===$.AST_NODE_TYPES.CallExpression){let F=E.callee;if(F.type===$.AST_NODE_TYPES.Identifier&&F.name==="styled")return!0}}return!1}function I(x){if(x.type===$.AST_NODE_TYPES.TaggedTemplateExpression){let E=x.tag;if(E.type===$.AST_NODE_TYPES.Identifier&&E.name==="css")return!0}return!1}function A(x,E){if(x.id.type!==$.AST_NODE_TYPES.Identifier)return;let F=x.id.name,R=x.init;if(R){if(S(R)||I(R)){p.push({node:E,name:F});return}if((d(F)||R.type===$.AST_NODE_TYPES.ArrowFunctionExpression)&&(R.type===$.AST_NODE_TYPES.ArrowFunctionExpression||R.type===$.AST_NODE_TYPES.FunctionExpression||c(R))){if(R.type===$.AST_NODE_TYPES.ArrowFunctionExpression||R.type===$.AST_NODE_TYPES.FunctionExpression){if(g(R.body)){i.add(F);return}}else if(c(R)){i.add(F);return}}R.type===$.AST_NODE_TYPES.Identifier&&a.set(F,R.name),d(F)||h(R)&&i.add(F)}}function T(x){return x.type===$.AST_NODE_TYPES.ExportDefaultDeclaration||x.type===$.AST_NODE_TYPES.ExportNamedDeclaration}function b(x){if(x.type===$.AST_NODE_TYPES.FunctionDeclaration)return x.id?x.id.name:null;if(x.type===$.AST_NODE_TYPES.VariableDeclaration){let E=x.declarations[0];if(E&&E.id.type===$.AST_NODE_TYPES.Identifier)return E.id.name}if(x.type===$.AST_NODE_TYPES.ExportDefaultDeclaration){let E=x.declaration;if(E.type===$.AST_NODE_TYPES.FunctionDeclaration)return E.id?E.id.name:"default";if(E.type===$.AST_NODE_TYPES.Identifier)return E.name}if(x.type===$.AST_NODE_TYPES.ExportNamedDeclaration){let E=x.declaration;if(E&&E.type===$.AST_NODE_TYPES.FunctionDeclaration)return E.id?E.id.name:null;if(E&&E.type===$.AST_NODE_TYPES.VariableDeclaration){let F=E.declarations[0];if(F&&F.id.type===$.AST_NODE_TYPES.Identifier)return F.id.name}}return null}function C(x,E){return s?m.has(x):r?r.test(E):T(x)}function w(x){let E=new Set;_e(x.node,F=>{if(F.type===$.AST_NODE_TYPES.Identifier)for(let R of p)R.name===F.name&&(E.add(R.name),(R.firstUsagePosition===void 0||F.range[0]<R.firstUsagePosition)&&(R.firstUsagePosition=F.range[0]));if(F.type===$.AST_NODE_TYPES.JSXElement){let R=F.openingElement;if(R.name.type===$.AST_NODE_TYPES.JSXIdentifier)for(let M of p)M.name===R.name.name&&(E.add(M.name),(M.firstUsagePosition===void 0||R.name.range[0]<M.firstUsagePosition)&&(M.firstUsagePosition=R.name.range[0]))}return!1},n),x.usedStyles=E}function N(x){if(x.type===$.AST_NODE_TYPES.VariableDeclaration){for(let E of x.declarations)A(E,x);return}if(x.type===$.AST_NODE_TYPES.FunctionDeclaration){d(x.id.name)&&g(x.body)&&i.add(x.id.name);return}if(x.type===$.AST_NODE_TYPES.ExportNamedDeclaration&&x.declaration){let E=x.declaration;if(E.type===$.AST_NODE_TYPES.VariableDeclaration){for(let F of E.declarations)A(F,x);return}if(E.type===$.AST_NODE_TYPES.FunctionDeclaration&&E.id){d(E.id.name)&&g(E.body)&&i.add(E.id.name);return}}if(x.type===$.AST_NODE_TYPES.ExportDefaultDeclaration){let E=x.declaration;E.type===$.AST_NODE_TYPES.Identifier&&i.add(E.name),(E.type===$.AST_NODE_TYPES.FunctionDeclaration||E.type===$.AST_NODE_TYPES.ArrowFunctionExpression||E.type===$.AST_NODE_TYPES.FunctionExpression)&&(E.type===$.AST_NODE_TYPES.FunctionDeclaration?E.id?i.add(E.id.name):i.add("default"):g(E.body)&&i.add("default"))}}function k(x,E=new Set){if(i.has(x))return!0;if(E.has(x))return!1;E.add(x);let F=a.get(x);return F?k(F,E):!1}let O={};return s&&(O[s]=x=>{let E=x;for(;E.parent&&E.parent.type!==$.AST_NODE_TYPES.Program;)E=E.parent;E.parent&&(E.type===$.AST_NODE_TYPES.VariableDeclaration||E.type===$.AST_NODE_TYPES.FunctionDeclaration||E.type===$.AST_NODE_TYPES.ExportNamedDeclaration||E.type===$.AST_NODE_TYPES.ExportDefaultDeclaration)&&m.add(E)}),O["Program:exit"]=x=>{let E=0;for(let D of x.body){if(D.type===$.AST_NODE_TYPES.ImportDeclaration){E+=1;continue}break}for(let D of x.body)N(D);for(let D of x.body){let q=b(D);if(q&&k(q)){let B=C(D,q);l.push({node:D,name:q,isMainComponent:B,usedStyles:new Set,isExported:T(D)})}}if(!s&&r&&!l.some(D=>D.isMainComponent))for(let D of l)D.isExported&&(D.isMainComponent=!0);for(let D of l)w(D);let F=new Set;for(let D of p)F.add(D.name);let R=new Map;for(let D=0;D<x.body.length;D+=1){let q=x.body[D];for(let B of p)B.node===q&&R.set(B.name,D)}let M=new Map;for(let D of p){let q=y(D),B=new Set;if(q){let ue=u(q);for(let me of ue)F.has(me)&&me!==D.name&&B.add(me)}M.set(D.name,B)}let P=new Map;for(let D of p){let q=M.get(D.name);if(!q)continue;let B=R.get(D.name);if(B!==void 0)for(let ue of q){let me=P.get(ue);(me===void 0||B<me)&&P.set(ue,B)}}let ee=[];for(let D of p){if(D.firstUsagePosition===void 0)continue;let q=x.body.indexOf(D.node),B=-1;for(let Ce of l){if(!Ce.usedStyles.has(D.name))continue;let we=x.body.indexOf(Ce.node);(B===-1||we<B)&&(B=we)}let ue=P.get(D.name);if(ue!==void 0&&(B===-1||ue<B)&&(B=ue),B===-1)continue;let me=-1;for(let Ce of l){let we=x.body.indexOf(Ce.node);we<B&&we>me&&(me=we)}let Oe=q<B,Ze=q>me,he=-1,Et=M.get(D.name);if(Et)for(let Ce of Et){let we=R.get(Ce);we!==void 0&&we>he&&(he=we)}let pt=q>he;if(!(Oe&&Ze&&pt)){let Ce=me+1;if(he+1>Ce&&(Ce=he+1),Ce<E&&(Ce=E),Ce>B)continue;ee.push({style:D,targetPosition:Ce})}}let Z=null;if(l.length>1){let D=l.map(B=>({c:B,idx:x.body.indexOf(B.node)})).sort((B,ue)=>B.idx-ue.idx)[0]?.c,q=l.find(B=>B.isMainComponent)||null;D&&q&&D.node!==q.node&&(Z={component:q,targetBefore:D.node})}if(ee.length>0||Z){let D=ee[0]?.style.node||Z?.component.node||x,q=ee.length>0?"stylesShouldBeAboveUsage":"mainComponentShouldBeFirst";e.report({node:D,messageId:q,fix:f(ee,Z,x.body)})}},O;function f(x,E,F){return function*(R){x.sort((P,ee)=>P.targetPosition-ee.targetPosition);for(let{style:P}of x){let ee=n.getCommentsBefore(P.node),Z=P.node.range[0],D=P.node.range[1];ee.length>0&&ee[0]&&(Z=ee[0].range[0]),Z===P.node.range[0]&&n.text.slice(0,Z).trim().length===0&&(Z=0),yield R.removeRange([Z,D])}let M=new Map;for(let P of x){let ee=M.get(P.targetPosition)||[];ee.push(P),M.set(P.targetPosition,ee)}for(let[P,ee]of M){let Z=F[P];if(!Z)continue;let D=n.getCommentsBefore(Z),q=D.length>0&&D[0]?D[0].range[0]:Z.range[0],B=[];for(let{style:ue}of ee){let me=n.getCommentsBefore(ue.node),Oe=n.getText(ue.node);me.length>0&&(Oe=`${me.map(he=>n.getText(he)).join(`
47
47
  `)}
48
48
  ${Oe}`),B.push(Oe)}yield R.insertTextBeforeRange([q,q],`${B.join(`
49
49
 
@@ -52,4 +52,4 @@ ${Oe}`),B.push(Oe)}yield R.insertTextBeforeRange([q,q],`${B.join(`
52
52
  `)}if(E){let{component:P,targetBefore:ee}=E,Z=n.getCommentsBefore(P.node),D=P.node.range[0],q=P.node.range[1];Z.length>0&&Z[0]&&(D=Z[0].range[0]),D===P.node.range[0]&&n.text.slice(0,D).trim().length===0&&(D=0);let B=n.getCommentsBefore(ee),ue=B.length>0&&B[0]?B[0].range[0]:ee.range[0],me=(()=>{let Oe=n.getText(P.node);return Z.length>0&&(Oe=`${Z.map(he=>n.getText(he)).join(`
53
53
  `)}
54
54
  ${Oe}`),Oe})();yield R.removeRange([D,q]),yield R.insertTextBeforeRange([ue,ue],`${me}
55
- `)}}}}});var Wt=require("@typescript-eslint/utils"),rr=Re(require("typescript")),ji=require("zod/v4");var kl=ji.z.object({}),ir=z({name:"no-unnecessary-void-on-promise",meta:{type:"suggestion",docs:{description:"Disallow void operator on non-Promise function calls to avoid unnecessary void keywords added by no-floating-promises"},messages:{unnecessaryVoid:"Unnecessary void operator on non-Promise function call",removeVoid:"Remove void operator"},hasSuggestions:!0,schema:[U(kl)]},defaultOptions:[{}],create(e){let t=Wt.ESLintUtils.getParserServices(e,!0),n=t.program?.getTypeChecker();if(!n||!t.program)throw new Error("TypeScript services or program not available");function r(s,o){if(s.flags&rr.default.TypeFlags.Any||s.flags&rr.default.TypeFlags.Unknown)return!1;let i=s.getProperty("then");return i?o.getTypeOfSymbol(i).getCallSignatures().length>0:!1}return{UnaryExpression(s){if(s.operator!=="void"||s.argument.type!==Wt.AST_NODE_TYPES.CallExpression)return;let o=t.esTreeNodeToTSNodeMap.get(s.argument),i=n.getTypeAtLocation(o);if(!r(i,n)){let l=e.sourceCode.getText(s.argument);e.report({node:s,messageId:"unnecessaryVoid",suggest:[{messageId:"removeVoid",fix(p){return p.replaceText(s,l)}}]})}}}}});var Ae=require("@typescript-eslint/utils"),St=require("zod/v4");var Pl=St.z.object({functions:St.z.array(St.z.string()).optional(),selectors:St.z.array(St.z.string()).optional()});function Mi(e){let t=e.parent;for(;t;){if(t.type===Ae.AST_NODE_TYPES.FunctionDeclaration||t.type===Ae.AST_NODE_TYPES.FunctionExpression||t.type===Ae.AST_NODE_TYPES.ArrowFunctionExpression)return!0;t=t.parent}return!1}function $i(e){if(e.type===Ae.AST_NODE_TYPES.TaggedTemplateExpression){let{tag:n}=e;return n.type===Ae.AST_NODE_TYPES.Identifier?n.name:n.type===Ae.AST_NODE_TYPES.MemberExpression&&n.property.type===Ae.AST_NODE_TYPES.Identifier?n.property.name:null}let{callee:t}=e;return t.type===Ae.AST_NODE_TYPES.Identifier?t.name:t.type===Ae.AST_NODE_TYPES.MemberExpression&&t.property.type===Ae.AST_NODE_TYPES.Identifier?t.property.name:null}var sr=z({name:"require-lazy-execution",meta:{type:"problem",docs:{description:"Require certain function calls to be executed lazily (inside functions, not at module level)"},messages:{moduleLevel:'Function "{{ functionName }}" must only be called inside functions or getters, not at module level'},schema:[U(Pl)]},defaultOptions:[{functions:[],selectors:[]}],create(e){let[t]=e.options,n=new Set(t.functions??[]),r=t.selectors??[];function s(i){if(Mi(i))return;let a=$i(i);a&&n.has(a)&&e.report({node:i,messageId:"moduleLevel",data:{functionName:a}})}let o={CallExpression(i){i.type===Ae.AST_NODE_TYPES.CallExpression&&s(i)},TaggedTemplateExpression(i){i.type===Ae.AST_NODE_TYPES.TaggedTemplateExpression&&s(i)}};for(let i of r)o[i]=a=>{if(a.type!==Ae.AST_NODE_TYPES.CallExpression&&a.type!==Ae.AST_NODE_TYPES.TaggedTemplateExpression||Mi(a))return;let l=$i(a);l&&e.report({node:a,messageId:"moduleLevel",data:{functionName:l}})};return o}});var Pe=require("@typescript-eslint/utils");function Ol(e,t){let{body:n}=e;if(n.type!==Pe.AST_NODE_TYPES.BlockStatement)return t.getText(n);let r=n.body[0];return!r||r.type!==Pe.AST_NODE_TYPES.ReturnStatement?"":r.argument?t.getText(r.argument):"undefined"}function Dl(e){let t=e.parent;if(t.type!==Pe.AST_NODE_TYPES.ReturnStatement)return null;let n=t.parent;if(n.type!==Pe.AST_NODE_TYPES.BlockStatement||n.body.length!==1)return null;let r=n.parent;return r.type!==Pe.AST_NODE_TYPES.FunctionDeclaration&&r.type!==Pe.AST_NODE_TYPES.ArrowFunctionExpression&&r.type!==Pe.AST_NODE_TYPES.FunctionExpression?null:{parentFunction:r,returnStatement:t}}var or=z({name:"no-unnecessary-iife",meta:{type:"suggestion",fixable:"code",docs:{description:"Disallow unnecessary immediately invoked function expressions"},messages:{unnecessaryIife:"Unnecessary IIFE. Can be simplified to the returned expression."},schema:[]},defaultOptions:[],create(e){let t=e.sourceCode;return{CallExpression(n){let{callee:r,arguments:s}=n;if(s.length>0||r.type!==Pe.AST_NODE_TYPES.FunctionExpression&&r.type!==Pe.AST_NODE_TYPES.ArrowFunctionExpression||r.async||r.params.length>0)return;let{body:o}=r;if(o.type===Pe.AST_NODE_TYPES.BlockStatement){if(o.body.length!==1){let p=Dl(n);if(p){if(t.getCommentsInside(r).length>0)return;let y=t.getText(o);e.report({node:n,messageId:"unnecessaryIife",fix:u=>{let{parentFunction:d}=p;return d.body.type!==Pe.AST_NODE_TYPES.BlockStatement?null:u.replaceText(d.body,y)}})}return}let l=o.body[0];if(!l||l.type!==Pe.AST_NODE_TYPES.ReturnStatement)return}if(t.getCommentsInside(r).length>0)return;let a=Ol(r,t);e.report({node:n,messageId:"unnecessaryIife",fix:l=>l.replaceText(n,a)})}}}});var nt=require("zod/v4");var Ll="no-restricted-comments",jl=nt.z.object({regex:nt.z.string().optional(),includes:nt.z.string().optional(),message:nt.z.string().optional(),autoFix:nt.z.boolean().optional()}),Ml=nt.z.object({patterns:nt.z.array(jl)}),ar=z({name:Ll,meta:{type:"problem",docs:{description:"Disallow comments matching specific patterns"},fixable:"code",hasSuggestions:!0,schema:[U(Ml)],messages:{restrictedComment:"Comment matches restricted pattern '{{pattern}}'",restrictedCommentWithMessage:"{{message}}",removeComment:"Remove this comment"}},defaultOptions:[{patterns:[]}],create(e,[t]){let n=e.sourceCode,r=new Map;function s(i){let a=r.get(i);return a||(a=new RegExp(i),r.set(i,a)),a}function o(i,a){return a.regex?s(a.regex).test(i):a.includes?i.includes(a.includes):!1}return{Program(){let i=n.getAllComments();for(let l of i)for(let p of t.patterns)if(o(l.value,p)){let y=function(u){return u.remove(l)};var a=y;let m=p.regex??p.includes??"";p.message?e.report({loc:l.loc,messageId:"restrictedCommentWithMessage",data:{message:p.message},fix:p.autoFix?y:void 0,suggest:p.autoFix?void 0:[{messageId:"removeComment",fix:y}]}):e.report({loc:l.loc,messageId:"restrictedComment",data:{pattern:m},fix:p.autoFix?y:void 0,suggest:p.autoFix?void 0:[{messageId:"removeComment",fix:y}]});break}}}}});var Jt=require("@typescript-eslint/utils"),Tt=require("zod/v4");var $l=Tt.z.object({allow:Tt.z.record(Tt.z.string(),Tt.z.array(Tt.z.string())).optional()}),lr=z({name:"no-data-attributes-on-components",meta:{type:"problem",docs:{description:"Disallow data-* attributes on custom React components. Use regular props instead."},schema:[U($l)],messages:{noDataAttributesOnComponents:"Avoid using data-* attributes on custom components. Use regular props instead or apply data attributes to the underlying DOM element."}},defaultOptions:[{}],create(e,[t]){let n=t.allow??{};function r(i){let a=i.charAt(0);return a===a.toUpperCase()&&a!==a.toLowerCase()}function s(i){return i.type===Jt.AST_NODE_TYPES.JSXIdentifier?{name:i.name,isCustom:r(i.name)}:i.type===Jt.AST_NODE_TYPES.JSXMemberExpression?{name:"",isCustom:!0}:{name:`${i.namespace.name}:${i.name.name}`,isCustom:!1}}function o(i,a){let l=n[i];return l?l.includes(a):!1}return{JSXAttribute(i){if(i.name.type!==Jt.AST_NODE_TYPES.JSXIdentifier)return;let a=i.name.name;if(!a.startsWith("data-"))return;let l=s(i.parent.name);!l||!l.isCustom||l.name&&o(l.name,a)||e.report({node:i,messageId:"noDataAttributesOnComponents"})}}}});var rt=require("@typescript-eslint/utils"),it=require("zod/v4");var _l=it.z.object({fn:it.z.string().optional(),selector:it.z.string().optional(),commentPrefix:it.z.string(),message:it.z.string().optional()}),Ul=it.z.object({matches:it.z.array(_l)}),pr=z({name:"require-usage-explanation",meta:{type:"problem",docs:{description:"Require explanatory comments with a specific prefix above matched code patterns"},schema:[U(Ul)],messages:{default:"{{message}}"}},defaultOptions:[{matches:[]}],create(e,[t]){let n=e.sourceCode,r={},s=[];function o(u){let d=u;for(;d.parent;){let c=d.parent.type;if(c===rt.AST_NODE_TYPES.Program||c===rt.AST_NODE_TYPES.BlockStatement||c===rt.AST_NODE_TYPES.SwitchCase)return d;d=d.parent}}function i(u,d){for(let c of u){let g=c.value.trim();if(g.startsWith(d)&&g.slice(d.length).trim().length>0)return!0}return!1}function a(u){let{callee:d}=u;if(d.type===rt.AST_NODE_TYPES.Identifier)return d.name;if(d.type===rt.AST_NODE_TYPES.MemberExpression&&d.property.type===rt.AST_NODE_TYPES.Identifier)return d.property.name}function l(u,d,c){let g=`Add a comment with prefix "${u}" to explain why "${d}" is being used.`;return c?`${g} ${c}`:g}function p(u,d){let c=o(u);if(!c)return!1;let g=u;for(;g!==c&&g.parent;){let S=n.getCommentsBefore(g);if(i(S,d))return!0;g=g.parent}let h=n.getCommentsBefore(c);return!!i(h,d)}function m(u,d){p(u,d.commentPrefix)||e.report({node:u,messageId:"default",data:{message:l(d.commentPrefix,d.label,d.message)}})}function y(u,d){let c=r[u];c?r[u]=g=>{c(g),d(g)}:r[u]=d}for(let u of t.matches){if(u.fn){let d=u.fn,c={commentPrefix:u.commentPrefix,label:d,message:u.message};s.push(g=>{a(g)===d&&m(g,c)})}if(u.selector){let d={commentPrefix:u.commentPrefix,label:u.selector,message:u.message};y(u.selector,c=>{m(c,d)})}}return s.length>0&&y("CallExpression",u=>{if(u.type===rt.AST_NODE_TYPES.CallExpression)for(let d of s)d(u)}),r}});var de=require("@typescript-eslint/utils"),Me=Re(require("typescript")),Je=require("zod/v4");var zl=Je.z.object({additionalCastFunctions:Je.z.array(Je.z.object({name:Je.z.string(),expectedType:Je.z.enum(["string","number"])})).optional(),allowNullishCasting:Je.z.boolean().optional(),allowInvalidCasting:Je.z.boolean().optional(),allowAnyCasting:Je.z.boolean().optional(),allowUnknownCasting:Je.z.boolean().optional()}),_i=new Set([de.AST_NODE_TYPES.Identifier,de.AST_NODE_TYPES.Literal,de.AST_NODE_TYPES.TemplateLiteral,de.AST_NODE_TYPES.MemberExpression,de.AST_NODE_TYPES.CallExpression]),Vl=Me.TypeFlags.Null|Me.TypeFlags.Undefined|Me.TypeFlags.Void;function Wl(e,t){if(_i.has(e.type))return!1;if(e.type===de.AST_NODE_TYPES.SequenceExpression)return!0;let n=t.parent;switch(n.type){case de.AST_NODE_TYPES.VariableDeclarator:case de.AST_NODE_TYPES.ExpressionStatement:case de.AST_NODE_TYPES.ReturnStatement:case de.AST_NODE_TYPES.ArrowFunctionExpression:case de.AST_NODE_TYPES.Property:case de.AST_NODE_TYPES.ArrayExpression:case de.AST_NODE_TYPES.AssignmentExpression:case de.AST_NODE_TYPES.JSXExpressionContainer:return!1;case de.AST_NODE_TYPES.CallExpression:case de.AST_NODE_TYPES.NewExpression:return n.callee===t;default:return!0}}var cr=z({name:"strict-casting",meta:{type:"problem",docs:{description:"Disallow unnecessary, nullish and invalid String()/Number() casts"},schema:[U(zl)],fixable:"code",hasSuggestions:!0,messages:{unnecessaryCasting:"Unnecessary {{name}}() cast of a value that is already of type {{type}}",nullishStringCasting:"String() cast of a possibly nullish value results in the strings 'null' or 'undefined', handle the nullish case explicitly",nullishNumberCasting:"Number() cast of a possibly nullish value results in 0 for null and NaN for undefined, handle the nullish case explicitly",symbolNumberCasting:"Number() cast of a symbol throws at runtime",nanNumberCasting:'Number() cast of a value of type "{{type}}" will result in NaN',anyCasting:"{{name}}() cast of an `any` value is unsafe, type the value before casting",unknownCasting:"{{name}}() cast of an `unknown` value is unsafe, narrow the value before casting",addNullishFallback:"Add a `?? {{fallback}}` fallback to handle the nullish case"}},defaultOptions:[{}],create(e,[t]){let n=t.allowNullishCasting??!1,r=t.allowInvalidCasting??!1,s=t.allowAnyCasting??!1,o=t.allowUnknownCasting??!1,i=new Map([["String",{expectedType:"string",builtin:!0}],["Number",{expectedType:"number",builtin:!0}]]);for(let u of t.additionalCastFunctions??[])i.set(u.name,{expectedType:u.expectedType,builtin:!1});let a=de.ESLintUtils.getParserServices(e),l=a.program.getTypeChecker();function p(u){let d=u.isUnion()?u.types:[u],c=[];for(let g of d)if(g.isTypeParameter()){let h=l.getBaseConstraintOfType(g);if(!h)return;h.isUnion()?c.push(...h.types):c.push(h)}else c.push(g);return c}function m(u,d){let g=l.getApparentType(u).getProperty("valueOf");if(!g)return!1;let h=l.getTypeOfSymbolAtLocation(g,d);for(let S of h.getCallSignatures())if(S.getReturnType().flags&Me.TypeFlags.NumberLike)return!0;return!1}function y(u,d,c,g){e.report({node:u,messageId:"unnecessaryCasting",data:{name:c,type:g},fix(h){let S=e.sourceCode.getText(d);return h.replaceText(u,Wl(d,u)?`(${S})`:S)}})}return{CallExpression(u){if(u.callee.type!==de.AST_NODE_TYPES.Identifier)return;let d=i.get(u.callee.name);if(!d||u.arguments.length!==1)return;let c=u.arguments[0];if(!c||c.type===de.AST_NODE_TYPES.SpreadElement)return;let g=u.callee.name,{expectedType:h,builtin:S}=d;if(c.type===de.AST_NODE_TYPES.Literal){if(typeof c.value===h){y(u,c,g,h);return}}else if(c.type===de.AST_NODE_TYPES.TemplateLiteral&&h==="string"){y(u,c,g,h);return}let I=l.getTypeAtLocation(a.esTreeNodeToTSNodeMap.get(c)),A=p(I);if(!A)return;let T=!1,b=!1;for(let w of A)w.flags&Me.TypeFlags.Any?T=!0:w.flags&Me.TypeFlags.Unknown&&(b=!0);if(T||b){S&&(T&&!s?e.report({node:u,messageId:"anyCasting",data:{name:g}}):b&&!o&&e.report({node:u,messageId:"unknownCasting",data:{name:g}}));return}if(S&&!n&&A.some(N=>N.flags&Vl)){let N=h==="string"?"''":"0";e.report({node:u,messageId:h==="string"?"nullishStringCasting":"nullishNumberCasting",suggest:[{messageId:"addNullishFallback",data:{fallback:N},fix(k){let O=e.sourceCode.getText(c),f=_i.has(c.type)?O:`(${O})`;return k.replaceText(c,`${f} ?? ${N}`)}}]});return}if(S&&h==="number"&&!r){if(A.some(k=>k.flags&Me.TypeFlags.ESSymbolLike)){e.report({node:u,messageId:"symbolNumberCasting"});return}let w=a.esTreeNodeToTSNodeMap.get(c);if(A.some(k=>k.flags&(Me.TypeFlags.Object|Me.TypeFlags.Intersection)&&!m(k,w))){e.report({node:u,messageId:"nanNumberCasting",data:{type:l.typeToString(I)}});return}}let C=h==="string"?Me.TypeFlags.StringLike:Me.TypeFlags.NumberLike;A.every(w=>w.flags&C)&&y(u,c,g,h)}}}});var Ui={[wn.name]:wn.rule,[on.name]:on.rule,[sn.name]:sn.rule,"rules-of-hooks":Pi,"exhaustive-deps":Cr,"require-description":xi.rule,[an.name]:an.rule,[pn.name]:pn.rule,[vn.name]:vn.rule,[Bt.name]:Bt.rule,[rn.name]:rn.rule,[un.name]:un.rule,[bt.name]:bt.rule,[kn.name]:kn.rule,[cn.name]:cn.rule,[ln.name]:ln.rule,[mn.name]:mn.rule,[Yt.name]:Yt.rule,[jn.name]:jn.rule,[Ln.name]:Ln.rule,[_n.name]:_n.rule,[Wn.name]:Wn.rule,[nn.name]:nn.rule,[Sn.name]:Sn.rule,[Tn.name]:Tn.rule,[En.name]:En.rule,[Cn.name]:Cn.rule,[In.name]:In.rule,[hn.name]:hn.rule,[xn.name]:xn.rule,[Nn.name]:Nn.rule,[dn.name]:dn.rule,[yn.name]:yn.rule,[Zn.name]:Zn.rule,[Fn.name]:Fn.rule,[Jn.name]:Jn.rule,[Yn.name]:Yn.rule,[Gn.name]:Gn.rule,[Kn.name]:Kn.rule,[Qn.name]:Qn.rule,[er.name]:er.rule,[tr.name]:tr.rule,[nr.name]:nr.rule,[ir.name]:ir.rule,[sr.name]:sr.rule,[bt.name]:bt.rule,[or.name]:or.rule,[ar.name]:ar.rule,[lr.name]:lr.rule,[pr.name]:pr.rule,[cr.name]:cr.rule};var zi={rules:Ui},Jl=zi;0&&(module.exports={extendedLintPlugin});
55
+ `)}}}}});var Wt=require("@typescript-eslint/utils"),rr=Re(require("typescript")),ji=require("zod/v4");var Dl=ji.z.object({}),ir=z({name:"no-unnecessary-void-on-promise",meta:{type:"suggestion",docs:{description:"Disallow void operator on non-Promise function calls to avoid unnecessary void keywords added by no-floating-promises"},messages:{unnecessaryVoid:"Unnecessary void operator on non-Promise function call",removeVoid:"Remove void operator"},hasSuggestions:!0,schema:[U(Dl)]},defaultOptions:[{}],create(e){let t=Wt.ESLintUtils.getParserServices(e,!0),n=t.program?.getTypeChecker();if(!n||!t.program)throw new Error("TypeScript services or program not available");function r(s,o){if(s.flags&rr.default.TypeFlags.Any||s.flags&rr.default.TypeFlags.Unknown)return!1;let i=s.getProperty("then");return i?o.getTypeOfSymbol(i).getCallSignatures().length>0:!1}return{UnaryExpression(s){if(s.operator!=="void"||s.argument.type!==Wt.AST_NODE_TYPES.CallExpression)return;let o=t.esTreeNodeToTSNodeMap.get(s.argument),i=n.getTypeAtLocation(o);if(!r(i,n)){let l=e.sourceCode.getText(s.argument);e.report({node:s,messageId:"unnecessaryVoid",suggest:[{messageId:"removeVoid",fix(p){return p.replaceText(s,l)}}]})}}}}});var Ae=require("@typescript-eslint/utils"),St=require("zod/v4");var Ll=St.z.object({functions:St.z.array(St.z.string()).optional(),selectors:St.z.array(St.z.string()).optional()});function Mi(e){let t=e.parent;for(;t;){if(t.type===Ae.AST_NODE_TYPES.FunctionDeclaration||t.type===Ae.AST_NODE_TYPES.FunctionExpression||t.type===Ae.AST_NODE_TYPES.ArrowFunctionExpression)return!0;t=t.parent}return!1}function $i(e){if(e.type===Ae.AST_NODE_TYPES.TaggedTemplateExpression){let{tag:n}=e;return n.type===Ae.AST_NODE_TYPES.Identifier?n.name:n.type===Ae.AST_NODE_TYPES.MemberExpression&&n.property.type===Ae.AST_NODE_TYPES.Identifier?n.property.name:null}let{callee:t}=e;return t.type===Ae.AST_NODE_TYPES.Identifier?t.name:t.type===Ae.AST_NODE_TYPES.MemberExpression&&t.property.type===Ae.AST_NODE_TYPES.Identifier?t.property.name:null}var sr=z({name:"require-lazy-execution",meta:{type:"problem",docs:{description:"Require certain function calls to be executed lazily (inside functions, not at module level)"},messages:{moduleLevel:'Function "{{ functionName }}" must only be called inside functions or getters, not at module level'},schema:[U(Ll)]},defaultOptions:[{functions:[],selectors:[]}],create(e){let[t]=e.options,n=new Set(t.functions??[]),r=t.selectors??[];function s(i){if(Mi(i))return;let a=$i(i);a&&n.has(a)&&e.report({node:i,messageId:"moduleLevel",data:{functionName:a}})}let o={CallExpression(i){i.type===Ae.AST_NODE_TYPES.CallExpression&&s(i)},TaggedTemplateExpression(i){i.type===Ae.AST_NODE_TYPES.TaggedTemplateExpression&&s(i)}};for(let i of r)o[i]=a=>{if(a.type!==Ae.AST_NODE_TYPES.CallExpression&&a.type!==Ae.AST_NODE_TYPES.TaggedTemplateExpression||Mi(a))return;let l=$i(a);l&&e.report({node:a,messageId:"moduleLevel",data:{functionName:l}})};return o}});var Pe=require("@typescript-eslint/utils");function jl(e,t){let{body:n}=e;if(n.type!==Pe.AST_NODE_TYPES.BlockStatement)return t.getText(n);let r=n.body[0];return!r||r.type!==Pe.AST_NODE_TYPES.ReturnStatement?"":r.argument?t.getText(r.argument):"undefined"}function Ml(e){let t=e.parent;if(t.type!==Pe.AST_NODE_TYPES.ReturnStatement)return null;let n=t.parent;if(n.type!==Pe.AST_NODE_TYPES.BlockStatement||n.body.length!==1)return null;let r=n.parent;return r.type!==Pe.AST_NODE_TYPES.FunctionDeclaration&&r.type!==Pe.AST_NODE_TYPES.ArrowFunctionExpression&&r.type!==Pe.AST_NODE_TYPES.FunctionExpression?null:{parentFunction:r,returnStatement:t}}var or=z({name:"no-unnecessary-iife",meta:{type:"suggestion",fixable:"code",docs:{description:"Disallow unnecessary immediately invoked function expressions"},messages:{unnecessaryIife:"Unnecessary IIFE. Can be simplified to the returned expression."},schema:[]},defaultOptions:[],create(e){let t=e.sourceCode;return{CallExpression(n){let{callee:r,arguments:s}=n;if(s.length>0||r.type!==Pe.AST_NODE_TYPES.FunctionExpression&&r.type!==Pe.AST_NODE_TYPES.ArrowFunctionExpression||r.async||r.params.length>0)return;let{body:o}=r;if(o.type===Pe.AST_NODE_TYPES.BlockStatement){if(o.body.length!==1){let p=Ml(n);if(p){if(t.getCommentsInside(r).length>0)return;let y=t.getText(o);e.report({node:n,messageId:"unnecessaryIife",fix:u=>{let{parentFunction:d}=p;return d.body.type!==Pe.AST_NODE_TYPES.BlockStatement?null:u.replaceText(d.body,y)}})}return}let l=o.body[0];if(!l||l.type!==Pe.AST_NODE_TYPES.ReturnStatement)return}if(t.getCommentsInside(r).length>0)return;let a=jl(r,t);e.report({node:n,messageId:"unnecessaryIife",fix:l=>l.replaceText(n,a)})}}}});var nt=require("zod/v4");var $l="no-restricted-comments",_l=nt.z.object({regex:nt.z.string().optional(),includes:nt.z.string().optional(),message:nt.z.string().optional(),autoFix:nt.z.boolean().optional()}),Ul=nt.z.object({patterns:nt.z.array(_l)}),ar=z({name:$l,meta:{type:"problem",docs:{description:"Disallow comments matching specific patterns"},fixable:"code",hasSuggestions:!0,schema:[U(Ul)],messages:{restrictedComment:"Comment matches restricted pattern '{{pattern}}'",restrictedCommentWithMessage:"{{message}}",removeComment:"Remove this comment"}},defaultOptions:[{patterns:[]}],create(e,[t]){let n=e.sourceCode,r=new Map;function s(i){let a=r.get(i);return a||(a=new RegExp(i),r.set(i,a)),a}function o(i,a){return a.regex?s(a.regex).test(i):a.includes?i.includes(a.includes):!1}return{Program(){let i=n.getAllComments();for(let l of i)for(let p of t.patterns)if(o(l.value,p)){let y=function(u){return u.remove(l)};var a=y;let m=p.regex??p.includes??"";p.message?e.report({loc:l.loc,messageId:"restrictedCommentWithMessage",data:{message:p.message},fix:p.autoFix?y:void 0,suggest:p.autoFix?void 0:[{messageId:"removeComment",fix:y}]}):e.report({loc:l.loc,messageId:"restrictedComment",data:{pattern:m},fix:p.autoFix?y:void 0,suggest:p.autoFix?void 0:[{messageId:"removeComment",fix:y}]});break}}}}});var Jt=require("@typescript-eslint/utils"),Tt=require("zod/v4");var zl=Tt.z.object({allow:Tt.z.record(Tt.z.string(),Tt.z.array(Tt.z.string())).optional()}),lr=z({name:"no-data-attributes-on-components",meta:{type:"problem",docs:{description:"Disallow data-* attributes on custom React components. Use regular props instead."},schema:[U(zl)],messages:{noDataAttributesOnComponents:"Avoid using data-* attributes on custom components. Use regular props instead or apply data attributes to the underlying DOM element."}},defaultOptions:[{}],create(e,[t]){let n=t.allow??{};function r(i){let a=i.charAt(0);return a===a.toUpperCase()&&a!==a.toLowerCase()}function s(i){return i.type===Jt.AST_NODE_TYPES.JSXIdentifier?{name:i.name,isCustom:r(i.name)}:i.type===Jt.AST_NODE_TYPES.JSXMemberExpression?{name:"",isCustom:!0}:{name:`${i.namespace.name}:${i.name.name}`,isCustom:!1}}function o(i,a){let l=n[i];return l?l.includes(a):!1}return{JSXAttribute(i){if(i.name.type!==Jt.AST_NODE_TYPES.JSXIdentifier)return;let a=i.name.name;if(!a.startsWith("data-"))return;let l=s(i.parent.name);!l||!l.isCustom||l.name&&o(l.name,a)||e.report({node:i,messageId:"noDataAttributesOnComponents"})}}}});var rt=require("@typescript-eslint/utils"),it=require("zod/v4");var Vl=it.z.object({fn:it.z.string().optional(),selector:it.z.string().optional(),commentPrefix:it.z.string(),message:it.z.string().optional()}),Wl=it.z.object({matches:it.z.array(Vl)}),pr=z({name:"require-usage-explanation",meta:{type:"problem",docs:{description:"Require explanatory comments with a specific prefix above matched code patterns"},schema:[U(Wl)],messages:{default:"{{message}}"}},defaultOptions:[{matches:[]}],create(e,[t]){let n=e.sourceCode,r={},s=[];function o(u){let d=u;for(;d.parent;){let c=d.parent.type;if(c===rt.AST_NODE_TYPES.Program||c===rt.AST_NODE_TYPES.BlockStatement||c===rt.AST_NODE_TYPES.SwitchCase)return d;d=d.parent}}function i(u,d){for(let c of u){let g=c.value.trim();if(g.startsWith(d)&&g.slice(d.length).trim().length>0)return!0}return!1}function a(u){let{callee:d}=u;if(d.type===rt.AST_NODE_TYPES.Identifier)return d.name;if(d.type===rt.AST_NODE_TYPES.MemberExpression&&d.property.type===rt.AST_NODE_TYPES.Identifier)return d.property.name}function l(u,d,c){let g=`Add a comment with prefix "${u}" to explain why "${d}" is being used.`;return c?`${g} ${c}`:g}function p(u,d){let c=o(u);if(!c)return!1;let g=u;for(;g!==c&&g.parent;){let S=n.getCommentsBefore(g);if(i(S,d))return!0;g=g.parent}let h=n.getCommentsBefore(c);return!!i(h,d)}function m(u,d){p(u,d.commentPrefix)||e.report({node:u,messageId:"default",data:{message:l(d.commentPrefix,d.label,d.message)}})}function y(u,d){let c=r[u];c?r[u]=g=>{c(g),d(g)}:r[u]=d}for(let u of t.matches){if(u.fn){let d=u.fn,c={commentPrefix:u.commentPrefix,label:d,message:u.message};s.push(g=>{a(g)===d&&m(g,c)})}if(u.selector){let d={commentPrefix:u.commentPrefix,label:u.selector,message:u.message};y(u.selector,c=>{m(c,d)})}}return s.length>0&&y("CallExpression",u=>{if(u.type===rt.AST_NODE_TYPES.CallExpression)for(let d of s)d(u)}),r}});var ge=require("@typescript-eslint/utils"),Me=Re(require("typescript")),Je=require("zod/v4");var Jl=Je.z.object({additionalCastFunctions:Je.z.array(Je.z.object({name:Je.z.string(),expectedType:Je.z.enum(["string","number"])})).optional(),allowNullishCasting:Je.z.boolean().optional(),allowInvalidCasting:Je.z.boolean().optional(),allowAnyCasting:Je.z.boolean().optional(),allowUnknownCasting:Je.z.boolean().optional()}),_i=new Set([ge.AST_NODE_TYPES.Identifier,ge.AST_NODE_TYPES.Literal,ge.AST_NODE_TYPES.TemplateLiteral,ge.AST_NODE_TYPES.MemberExpression,ge.AST_NODE_TYPES.CallExpression]),Xl=Me.TypeFlags.Null|Me.TypeFlags.Undefined|Me.TypeFlags.Void;function Bl(e,t){if(_i.has(e.type))return!1;if(e.type===ge.AST_NODE_TYPES.SequenceExpression)return!0;let n=t.parent;switch(n.type){case ge.AST_NODE_TYPES.VariableDeclarator:case ge.AST_NODE_TYPES.ExpressionStatement:case ge.AST_NODE_TYPES.ReturnStatement:case ge.AST_NODE_TYPES.ArrowFunctionExpression:case ge.AST_NODE_TYPES.Property:case ge.AST_NODE_TYPES.ArrayExpression:case ge.AST_NODE_TYPES.AssignmentExpression:case ge.AST_NODE_TYPES.JSXExpressionContainer:return!1;case ge.AST_NODE_TYPES.CallExpression:case ge.AST_NODE_TYPES.NewExpression:return n.callee===t;default:return!0}}var cr=z({name:"strict-casting",meta:{type:"problem",docs:{description:"Disallow unnecessary, nullish and invalid String()/Number() casts"},schema:[U(Jl)],fixable:"code",hasSuggestions:!0,messages:{unnecessaryCasting:"Unnecessary {{name}}() cast of a value that is already of type {{type}}",nullishStringCasting:"String() cast of a possibly nullish value results in the strings 'null' or 'undefined', handle the nullish case explicitly",nullishNumberCasting:"Number() cast of a possibly nullish value results in 0 for null and NaN for undefined, handle the nullish case explicitly",symbolNumberCasting:"Number() cast of a symbol throws at runtime",nanNumberCasting:'Number() cast of a value of type "{{type}}" will result in NaN',anyCasting:"{{name}}() cast of an `any` value is unsafe, type the value before casting",unknownCasting:"{{name}}() cast of an `unknown` value is unsafe, narrow the value before casting",addNullishFallback:"Add a `?? {{fallback}}` fallback to handle the nullish case"}},defaultOptions:[{}],create(e,[t]){let n=t.allowNullishCasting??!1,r=t.allowInvalidCasting??!1,s=t.allowAnyCasting??!1,o=t.allowUnknownCasting??!1,i=new Map([["String",{expectedType:"string",builtin:!0}],["Number",{expectedType:"number",builtin:!0}]]);for(let u of t.additionalCastFunctions??[])i.set(u.name,{expectedType:u.expectedType,builtin:!1});let a=ge.ESLintUtils.getParserServices(e),l=a.program.getTypeChecker();function p(u){let d=u.isUnion()?u.types:[u],c=[];for(let g of d)if(g.isTypeParameter()){let h=l.getBaseConstraintOfType(g);if(!h)return;h.isUnion()?c.push(...h.types):c.push(h)}else c.push(g);return c}function m(u,d){let g=l.getApparentType(u).getProperty("valueOf");if(!g)return!1;let h=l.getTypeOfSymbolAtLocation(g,d);for(let S of h.getCallSignatures())if(S.getReturnType().flags&Me.TypeFlags.NumberLike)return!0;return!1}function y(u,d,c,g){e.report({node:u,messageId:"unnecessaryCasting",data:{name:c,type:g},fix(h){let S=e.sourceCode.getText(d);return h.replaceText(u,Bl(d,u)?`(${S})`:S)}})}return{CallExpression(u){if(u.callee.type!==ge.AST_NODE_TYPES.Identifier)return;let d=i.get(u.callee.name);if(!d||u.arguments.length!==1)return;let c=u.arguments[0];if(!c||c.type===ge.AST_NODE_TYPES.SpreadElement)return;let g=u.callee.name,{expectedType:h,builtin:S}=d;if(c.type===ge.AST_NODE_TYPES.Literal){if(typeof c.value===h){y(u,c,g,h);return}}else if(c.type===ge.AST_NODE_TYPES.TemplateLiteral&&h==="string"){y(u,c,g,h);return}let I=l.getTypeAtLocation(a.esTreeNodeToTSNodeMap.get(c)),A=p(I);if(!A)return;let T=!1,b=!1;for(let w of A)w.flags&Me.TypeFlags.Any?T=!0:w.flags&Me.TypeFlags.Unknown&&(b=!0);if(T||b){S&&(T&&!s?e.report({node:u,messageId:"anyCasting",data:{name:g}}):b&&!o&&e.report({node:u,messageId:"unknownCasting",data:{name:g}}));return}if(S&&!n&&A.some(N=>N.flags&Xl)){let N=h==="string"?"''":"0";e.report({node:u,messageId:h==="string"?"nullishStringCasting":"nullishNumberCasting",suggest:[{messageId:"addNullishFallback",data:{fallback:N},fix(k){let O=e.sourceCode.getText(c),f=_i.has(c.type)?O:`(${O})`;return k.replaceText(c,`${f} ?? ${N}`)}}]});return}if(S&&h==="number"&&!r){if(A.some(k=>k.flags&Me.TypeFlags.ESSymbolLike)){e.report({node:u,messageId:"symbolNumberCasting"});return}let w=a.esTreeNodeToTSNodeMap.get(c);if(A.some(k=>k.flags&(Me.TypeFlags.Object|Me.TypeFlags.Intersection)&&!m(k,w))){e.report({node:u,messageId:"nanNumberCasting",data:{type:l.typeToString(I)}});return}}let C=h==="string"?Me.TypeFlags.StringLike:Me.TypeFlags.NumberLike;A.every(w=>w.flags&C)&&y(u,c,g,h)}}}});var Ui={[wn.name]:wn.rule,[on.name]:on.rule,[sn.name]:sn.rule,"rules-of-hooks":Pi,"exhaustive-deps":Cr,"require-description":xi.rule,[an.name]:an.rule,[pn.name]:pn.rule,[vn.name]:vn.rule,[Bt.name]:Bt.rule,[rn.name]:rn.rule,[un.name]:un.rule,[bt.name]:bt.rule,[kn.name]:kn.rule,[cn.name]:cn.rule,[ln.name]:ln.rule,[mn.name]:mn.rule,[Yt.name]:Yt.rule,[jn.name]:jn.rule,[Ln.name]:Ln.rule,[_n.name]:_n.rule,[Wn.name]:Wn.rule,[nn.name]:nn.rule,[Sn.name]:Sn.rule,[Tn.name]:Tn.rule,[En.name]:En.rule,[Cn.name]:Cn.rule,[In.name]:In.rule,[hn.name]:hn.rule,[xn.name]:xn.rule,[Nn.name]:Nn.rule,[dn.name]:dn.rule,[yn.name]:yn.rule,[Zn.name]:Zn.rule,[Fn.name]:Fn.rule,[Jn.name]:Jn.rule,[Yn.name]:Yn.rule,[Gn.name]:Gn.rule,[Kn.name]:Kn.rule,[Qn.name]:Qn.rule,[er.name]:er.rule,[tr.name]:tr.rule,[nr.name]:nr.rule,[ir.name]:ir.rule,[sr.name]:sr.rule,[bt.name]:bt.rule,[or.name]:or.rule,[ar.name]:ar.rule,[lr.name]:lr.rule,[pr.name]:pr.rule,[cr.name]:cr.rule};var zi={rules:Ui},Hl=zi;0&&(module.exports={extendedLintPlugin});