@ls-stack/extended-lint 0.71.0 → 0.72.0

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,6 +1,6 @@
1
- "use strict";var oi=Object.create;var lt=Object.defineProperty;var ai=Object.getOwnPropertyDescriptor;var li=Object.getOwnPropertyNames;var pi=Object.getPrototypeOf,ci=Object.prototype.hasOwnProperty;var ui=(e,t)=>{for(var r in t)lt(e,r,{get:t[r],enumerable:!0})},$n=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of li(t))!ci.call(e,s)&&s!==r&&lt(e,s,{get:()=>t[s],enumerable:!(n=ai(t,s))||n.enumerable});return e};var xe=(e,t,r)=>(r=e!=null?oi(pi(e)):{},$n(t||!e||!e.__esModule?lt(r,"default",{value:e,enumerable:!0}):r,e)),fi=e=>$n(lt({},"__esModule",{value:!0}),e);var Pa={};ui(Pa,{extendedLintPlugin:()=>Ra});module.exports=fi(Pa);var ce=require("@typescript-eslint/utils"),v=require("zod/v4");var _n=require("@typescript-eslint/utils"),Un=xe(require("zod/v4"));function _(e){let r=_n.ESLintUtils.RuleCreator(n=>`https://github.com/lucasols/extended-lint#${n}`)(e);return{name:e.name,rule:r}}function $(e){return Un.toJSONSchema(e)}var mi=v.z.object({disallow:v.z.array(v.z.object({selector:v.z.string(),message:v.z.string(),replace:v.z.optional(v.z.union([v.z.string(),v.z.object({regex:v.z.string(),with:v.z.string()})])),replaceType:v.z.optional(v.z.enum(["suggestion","autofix"]))})).optional(),disallowFnCalls:v.z.optional(v.z.array(v.z.object({fn:v.z.string(),withArgs:v.z.optional(v.z.array(v.z.object({atIndex:v.z.number(),value:v.z.union([v.z.string(),v.z.number(),v.z.boolean()])}))),message:v.z.string(),replaceWith:v.z.optional(v.z.string()),ignoreRegex:v.z.optional(v.z.string())}))),__dev_simulateFileName:v.z.optional(v.z.string()),mustMatchSyntax:v.z.optional(v.z.array(v.z.object({includeRegex:v.z.string(),mustCallFn:v.z.optional(v.z.array(v.z.object({anyCall:v.z.array(v.z.object({fn:v.z.string(),withArgs:v.z.array(v.z.object({atIndex:v.z.number(),literal:v.z.union([v.z.string(),v.z.number(),v.z.boolean()])}))})),message:v.z.optional(v.z.string())}))),mustMatchSelector:v.z.optional(v.z.array(v.z.object({selector:v.z.string(),message:v.z.string()}))),mustHaveExport:v.z.optional(v.z.array(v.z.object({name:v.z.string(),type:v.z.enum(["function","variable","any"]).default("any"),message:v.z.string()})))})))}),wt=_({name:"advanced-no-restricted-syntax",meta:{type:"suggestion",docs:{description:"Disallow specific syntax patterns"},schema:[$(mi)],messages:{default:"{{message}}"},fixable:"code",hasSuggestions:!0},defaultOptions:[{disallow:[]}],create(e,[t]){let r={},{mustMatchSyntax:n,__dev_simulateFileName:s,disallow:o,disallowFnCalls:i}=t,p=s??e.filename,a=[],c=new Map,g=new Set,S=new Map,l=new Set,E=new Map;function f(u){for(let d of u.specifiers)d.type===ce.AST_NODE_TYPES.ImportSpecifier&&d.imported.type===ce.AST_NODE_TYPES.Identifier&&d.imported.name!==d.local.name&&E.set(d.local.name,d.imported.name)}function h(u){if(u.declaration){if(u.declaration.type===ce.AST_NODE_TYPES.FunctionDeclaration&&u.declaration.id){let d=u.declaration.id.name;for(let A of Array.from(l)){let[I,P]=A.split(":");I===d&&(P==="function"||P==="any")&&l.delete(A)}}else if(u.declaration.type===ce.AST_NODE_TYPES.VariableDeclaration){for(let d of u.declaration.declarations)if(d.id.type===ce.AST_NODE_TYPES.Identifier){let A=d.id.name;for(let I of Array.from(l)){let[P,k]=I.split(":");P===A&&(k==="variable"||k==="any")&&l.delete(I)}}}}for(let d of u.specifiers)if(d.exported.type===ce.AST_NODE_TYPES.Identifier){let A=d.exported.name;for(let I of Array.from(l)){let[P,k]=I.split(":");P===A&&k==="any"&&l.delete(I)}}}function T(u){u.id.type===ce.AST_NODE_TYPES.Identifier&&u.init?.type===ce.AST_NODE_TYPES.Identifier&&E.set(u.id.name,u.init.name)}function m(u){return E.get(u)??u}function b(u,d){return m(u)===d||u===d}for(let{includeRegex:u,mustCallFn:d,mustMatchSelector:A,mustHaveExport:I}of n??[]){let k=function(H){let K=H;for(let{name:ne,value:oe}of P??[])K=K.replaceAll(ne,oe);return K};var x=k;let P=yi(p,new RegExp(u));if(P){for(let{anyCall:H,message:K}of d??[]){let ne=`Expected file to call the function: ${H.map(({fn:oe})=>oe).join(" or ")}`;g.add(ne),a.push(oe=>{let{callee:Z}=oe;if(Z.type===ce.AST_NODE_TYPES.Identifier){for(let{fn:de,withArgs:Ae}of H)if(Z.name===de){g.delete(ne);for(let ue of Ae){let Ie=oe.arguments[ue.atIndex],Te=typeof ue.literal=="string"?k(ue.literal):ue.literal;if(!Ie){e.report({node:oe,messageId:"default",data:{message:`Missing argument with value "${Te}" at index ${ue.atIndex}${K?`: ${k(K)}`:""}`}});continue}if(Ie.type!==ce.AST_NODE_TYPES.Literal){e.report({node:Ie,messageId:"default",data:{message:`Argument at position ${ue.atIndex} should the literal "${Te}"${K?`: ${k(K)}`:""}`}});continue}Ie.value!==Te&&e.report({node:Ie,messageId:"default",data:{message:`Argument should have the value "${Te}"${K?`: ${k(K)}`:""}`},fix:ze=>ze.replaceText(Ie,typeof Te=="string"?`'${Te}'`:String(Te))})}break}}})}for(let{selector:H,message:K}of A??[])S.set(H,k(K)),c.set(k(H),()=>{S.delete(H)});for(let{name:H,type:K,message:ne}of I??[]){let oe=k(H),Z=k(ne);l.add(`${oe}:${K}:${Z}`)}}}for(let{fn:u,withArgs:d,message:A,replaceWith:I,ignoreRegex:P}of i??[])P&&new RegExp(P).test(p)||a.push(k=>{let{callee:H}=k;if(H.type!==ce.AST_NODE_TYPES.Identifier||!b(H.name,u))return;if(d)for(let ne of d){let oe=k.arguments[ne.atIndex];if(!oe){e.report({node:k,messageId:"default",data:{message:`Missing argument with value "${ne.value}" at index ${ne.atIndex}: ${A}`}});return}if(oe.type!==ce.AST_NODE_TYPES.Literal||oe.value!==ne.value)return}let K=ne=>I?ne.replaceText(k,I):null;e.report({node:k,messageId:"default",data:{message:A},suggest:I?[{messageId:"default",data:{message:`Replace with "${I}"`},fix:K}]:void 0})});function C(u,d){let A=r[u];A?r[u]=I=>{A(I),d(I)}:r[u]=d}for(let{selector:u,message:d,replace:A,replaceType:I="suggestion"}of o??[]){if(u==="CallExpression"){a.push(P=>{y(A,P,d,I)});continue}r[u]=P=>{y(A,P,d,I)}}if(c.size>0)for(let[u,d]of c)C(u,d);return a.length>0&&(r.CallExpression=u=>{if(u.type===ce.AST_NODE_TYPES.CallExpression)for(let d of a)d(u)}),r.ImportDeclaration=u=>{u.type===ce.AST_NODE_TYPES.ImportDeclaration&&f(u)},r.ExportNamedDeclaration=u=>{u.type===ce.AST_NODE_TYPES.ExportNamedDeclaration&&h(u)},r.VariableDeclarator=u=>{u.type===ce.AST_NODE_TYPES.VariableDeclarator&&T(u)},r["Program:exit"]=u=>{for(let d of g)e.report({node:u,messageId:"default",data:{message:d}});for(let[,d]of S)e.report({node:u,messageId:"default",data:{message:d}});for(let d of l){let[A,I,P]=d.split(":");e.report({node:u,messageId:"default",data:{message:`Missing required export "${A}" of type ${I}: ${P}`}})}},r;function y(u,d,A,I){let P=k=>{if(!u)return null;if(typeof u=="string")return k.replaceText(d,u);{let H=new RegExp(u.regex),K=e.sourceCode.getText(d);return k.replaceText(d,K.replace(H,u.with))}};e.report({node:d,messageId:"default",data:{message:A},fix:u&&I==="autofix"?P:void 0,suggest:u&&I==="suggestion"?[{messageId:"default",data:{message:`Replace with "${typeof u=="string"?u:u.with}"`},fix:P}]:void 0})}}});function yi(e,t){let r=[],n=t.exec(e);if(!n)return null;let[s,...o]=n;r.push({name:"$0_lowercase",value:s.toLowerCase()}),r.push({name:"$0_capitalize",value:zn(s)}),r.push({name:"$0_uncapitalize",value:Wn(s)}),r.push({name:"$0",value:s});for(let i=0;i<o.length;i++){let p=`$${i+1}`,a=o[i];a!==void 0&&(r.push({name:`${p}_lowercase`,value:a.toLowerCase()}),r.push({name:`${p}_capitalize`,value:zn(a)}),r.push({name:`${p}_uncapitalize`,value:Wn(a)}),r.push({name:p,value:a}))}return r}function zn(e){return e.charAt(0).toUpperCase()+e.slice(1)}function Wn(e){return e.charAt(0).toLowerCase()+e.slice(1)}var X=require("@typescript-eslint/utils"),Me=require("zod/v4");var di=X.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),Vn="collapse-simple-objs-in-one-line",gi=Me.z.object({maxLineLength:Me.z.number().optional(),maxProperties:Me.z.number().optional(),nestedObjMaxLineLength:Me.z.number().optional(),nestedObjMaxProperties:Me.z.number().optional(),ignoreTypesWithSuffix:Me.z.array(Me.z.string()).optional()}),Si=di({name:Vn,meta:{type:"suggestion",fixable:"code",docs:{description:"Format simple objects and types in one line"},messages:{singleLineProp:"Object/type should be written in a single line"},schema:[$(gi)]},defaultOptions:[{}],create(e,[t]){let r=e.sourceCode,n=t.ignoreTypesWithSuffix??[],s=t.maxProperties??2,o=t.nestedObjMaxLineLength??t.maxLineLength,i=t.nestedObjMaxProperties??3;function p(c){if(c.type===X.AST_NODE_TYPES.ObjectExpression){let g=c.parent.type===X.AST_NODE_TYPES.Property,S=g?i:s,l=c.properties.length;if(l>S)return!1;if(l===1){let f=c.properties[0];return!f||f.type===X.AST_NODE_TYPES.Property&&f.value.type===X.AST_NODE_TYPES.ObjectExpression||f.type===X.AST_NODE_TYPES.Property&&f.value.type===X.AST_NODE_TYPES.ArrayExpression&&!f.value.elements.every(T=>T&&Rt(T))?!1:{text:r.getText(f),isNested:g,propsSize:l}}let E=[];for(let f of c.properties){if(f.type===X.AST_NODE_TYPES.Property&&!Rt(f.value))return!1;E.push(r.getText(f))}return{text:E.join(", "),isNested:g,propsSize:l}}else{let g=c.parent.parent?.type===X.AST_NODE_TYPES.TSPropertySignature,S=g?i:s,l=c.members.length;if(l>S)return!1;if(n.length>0&&c.parent.type===X.AST_NODE_TYPES.TSTypeAliasDeclaration){let f=c.parent.id.name;if(n.some(h=>f.endsWith(h)))return!1}if(l===1){let f=c.members[0];return!f||f.type===X.AST_NODE_TYPES.TSPropertySignature&&f.typeAnnotation?.typeAnnotation.type===X.AST_NODE_TYPES.TSTypeLiteral?!1:{text:r.getText(f),isNested:g,propsSize:1}}if(c.parent.type===X.AST_NODE_TYPES.TSIntersectionType||c.parent.type===X.AST_NODE_TYPES.TSUnionType&&c.parent.types[0]!==c)return!1;let E=[];for(let f of c.members){if(f.type!==X.AST_NODE_TYPES.TSPropertySignature)return!1;let h=f.typeAnnotation?.typeAnnotation;if(!h||h.type===X.AST_NODE_TYPES.TSTypeLiteral||!Jn(h))return!1;if(h.type===X.AST_NODE_TYPES.TSTypeReference&&h.typeArguments){if(h.typeArguments.params.length>1)return!1;let m=h.typeArguments.params[0];if(!m||!Jn(m))return!1}let T=r.getText(f).trim();(T.endsWith(";")||T.endsWith(","))&&(T=T.slice(0,-1)),E.push(T)}return{text:E.join("; "),isNested:g,propsSize:l}}}function a(c){if(c.loc.start.line===c.loc.end.line)return;if(c.parent.type!==X.AST_NODE_TYPES.JSXExpressionContainer){let h=0,T=!1,m=r.getTokenAfter(c,{filter:C=>C.type!==X.AST_TOKEN_TYPES.Punctuator||T?!0:C.value===","?(h++,!1):C.value===";"?(h++,T=!0,!1):C.value===")"||C.value==="}"?(h++,!1):!0});if(h>4)return;let b=m?.type===X.AST_TOKEN_TYPES.Template&&m.value.startsWith(`}
1
+ "use strict";var oi=Object.create;var lt=Object.defineProperty;var ai=Object.getOwnPropertyDescriptor;var li=Object.getOwnPropertyNames;var pi=Object.getPrototypeOf,ci=Object.prototype.hasOwnProperty;var ui=(e,t)=>{for(var r in t)lt(e,r,{get:t[r],enumerable:!0})},$n=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of li(t))!ci.call(e,s)&&s!==r&&lt(e,s,{get:()=>t[s],enumerable:!(n=ai(t,s))||n.enumerable});return e};var xe=(e,t,r)=>(r=e!=null?oi(pi(e)):{},$n(t||!e||!e.__esModule?lt(r,"default",{value:e,enumerable:!0}):r,e)),fi=e=>$n(lt({},"__esModule",{value:!0}),e);var Pa={};ui(Pa,{extendedLintPlugin:()=>Ra});module.exports=fi(Pa);var ce=require("@typescript-eslint/utils"),v=require("zod/v4");var _n=require("@typescript-eslint/utils"),Un=xe(require("zod/v4"));function _(e){let r=_n.ESLintUtils.RuleCreator(n=>`https://github.com/lucasols/extended-lint#${n}`)(e);return{name:e.name,rule:r}}function $(e){return Un.toJSONSchema(e)}var mi=v.z.object({disallow:v.z.array(v.z.object({selector:v.z.string(),message:v.z.string(),replace:v.z.optional(v.z.union([v.z.string(),v.z.object({regex:v.z.string(),with:v.z.string()})])),replaceType:v.z.optional(v.z.enum(["suggestion","autofix"]))})).optional(),disallowFnCalls:v.z.optional(v.z.array(v.z.object({fn:v.z.string(),withArgs:v.z.optional(v.z.array(v.z.object({atIndex:v.z.number(),value:v.z.union([v.z.string(),v.z.number(),v.z.boolean()])}))),message:v.z.string(),replaceWith:v.z.optional(v.z.string()),ignoreRegex:v.z.optional(v.z.string())}))),__dev_simulateFileName:v.z.optional(v.z.string()),mustMatchSyntax:v.z.optional(v.z.array(v.z.object({includeRegex:v.z.string(),mustCallFn:v.z.optional(v.z.array(v.z.object({anyCall:v.z.array(v.z.object({fn:v.z.string(),withArgs:v.z.array(v.z.object({atIndex:v.z.number(),literal:v.z.union([v.z.string(),v.z.number(),v.z.boolean()])}))})),message:v.z.optional(v.z.string())}))),mustMatchSelector:v.z.optional(v.z.array(v.z.object({selector:v.z.string(),message:v.z.string()}))),mustHaveExport:v.z.optional(v.z.array(v.z.object({name:v.z.string(),type:v.z.enum(["function","variable","any"]).default("any"),message:v.z.string()})))})))}),wt=_({name:"advanced-no-restricted-syntax",meta:{type:"suggestion",docs:{description:"Disallow specific syntax patterns"},schema:[$(mi)],messages:{default:"{{message}}"},fixable:"code",hasSuggestions:!0},defaultOptions:[{disallow:[]}],create(e,[t]){let r={},{mustMatchSyntax:n,__dev_simulateFileName:s,disallow:o,disallowFnCalls:i}=t,p=s??e.filename,a=[],c=new Map,g=new Set,S=new Map,l=new Set,E=new Map;function f(u){for(let d of u.specifiers)d.type===ce.AST_NODE_TYPES.ImportSpecifier&&d.imported.type===ce.AST_NODE_TYPES.Identifier&&d.imported.name!==d.local.name&&E.set(d.local.name,d.imported.name)}function h(u){if(u.declaration){if(u.declaration.type===ce.AST_NODE_TYPES.FunctionDeclaration&&u.declaration.id){let d=u.declaration.id.name;for(let A of Array.from(l)){let[I,R]=A.split(":");I===d&&(R==="function"||R==="any")&&l.delete(A)}}else if(u.declaration.type===ce.AST_NODE_TYPES.VariableDeclaration){for(let d of u.declaration.declarations)if(d.id.type===ce.AST_NODE_TYPES.Identifier){let A=d.id.name;for(let I of Array.from(l)){let[R,F]=I.split(":");R===A&&(F==="variable"||F==="any")&&l.delete(I)}}}}for(let d of u.specifiers)if(d.exported.type===ce.AST_NODE_TYPES.Identifier){let A=d.exported.name;for(let I of Array.from(l)){let[R,F]=I.split(":");R===A&&F==="any"&&l.delete(I)}}}function T(u){u.id.type===ce.AST_NODE_TYPES.Identifier&&u.init?.type===ce.AST_NODE_TYPES.Identifier&&E.set(u.id.name,u.init.name)}function m(u){return E.get(u)??u}function b(u,d){return m(u)===d||u===d}for(let{includeRegex:u,mustCallFn:d,mustMatchSelector:A,mustHaveExport:I}of n??[]){let F=function(J){let Z=J;for(let{name:ne,value:te}of R??[])Z=Z.replaceAll(ne,te);return Z};var x=F;let R=yi(p,new RegExp(u));if(R){for(let{anyCall:J,message:Z}of d??[]){let ne=`Expected file to call the function: ${J.map(({fn:te})=>te).join(" or ")}`;g.add(ne),a.push(te=>{let{callee:V}=te;if(V.type===ce.AST_NODE_TYPES.Identifier){for(let{fn:de,withArgs:Ae}of J)if(V.name===de){g.delete(ne);for(let ue of Ae){let Ie=te.arguments[ue.atIndex],Te=typeof ue.literal=="string"?F(ue.literal):ue.literal;if(!Ie){e.report({node:te,messageId:"default",data:{message:`Missing argument with value "${Te}" at index ${ue.atIndex}${Z?`: ${F(Z)}`:""}`}});continue}if(Ie.type!==ce.AST_NODE_TYPES.Literal){e.report({node:Ie,messageId:"default",data:{message:`Argument at position ${ue.atIndex} should the literal "${Te}"${Z?`: ${F(Z)}`:""}`}});continue}Ie.value!==Te&&e.report({node:Ie,messageId:"default",data:{message:`Argument should have the value "${Te}"${Z?`: ${F(Z)}`:""}`},fix:ze=>ze.replaceText(Ie,typeof Te=="string"?`'${Te}'`:String(Te))})}break}}})}for(let{selector:J,message:Z}of A??[])S.set(J,F(Z)),c.set(F(J),()=>{S.delete(J)});for(let{name:J,type:Z,message:ne}of I??[]){let te=F(J),V=F(ne);l.add(`${te}:${Z}:${V}`)}}}for(let{fn:u,withArgs:d,message:A,replaceWith:I,ignoreRegex:R}of i??[])R&&new RegExp(R).test(p)||a.push(F=>{let{callee:J}=F;if(J.type!==ce.AST_NODE_TYPES.Identifier||!b(J.name,u))return;if(d)for(let ne of d){let te=F.arguments[ne.atIndex];if(!te){e.report({node:F,messageId:"default",data:{message:`Missing argument with value "${ne.value}" at index ${ne.atIndex}: ${A}`}});return}if(te.type!==ce.AST_NODE_TYPES.Literal||te.value!==ne.value)return}let Z=ne=>I?ne.replaceText(F,I):null;e.report({node:F,messageId:"default",data:{message:A},suggest:I?[{messageId:"default",data:{message:`Replace with "${I}"`},fix:Z}]:void 0})});function C(u,d){let A=r[u];A?r[u]=I=>{A(I),d(I)}:r[u]=d}for(let{selector:u,message:d,replace:A,replaceType:I="suggestion"}of o??[]){if(u==="CallExpression"){a.push(R=>{y(A,R,d,I)});continue}r[u]=R=>{y(A,R,d,I)}}if(c.size>0)for(let[u,d]of c)C(u,d);return a.length>0&&(r.CallExpression=u=>{if(u.type===ce.AST_NODE_TYPES.CallExpression)for(let d of a)d(u)}),r.ImportDeclaration=u=>{u.type===ce.AST_NODE_TYPES.ImportDeclaration&&f(u)},r.ExportNamedDeclaration=u=>{u.type===ce.AST_NODE_TYPES.ExportNamedDeclaration&&h(u)},r.VariableDeclarator=u=>{u.type===ce.AST_NODE_TYPES.VariableDeclarator&&T(u)},r["Program:exit"]=u=>{for(let d of g)e.report({node:u,messageId:"default",data:{message:d}});for(let[,d]of S)e.report({node:u,messageId:"default",data:{message:d}});for(let d of l){let[A,I,R]=d.split(":");e.report({node:u,messageId:"default",data:{message:`Missing required export "${A}" of type ${I}: ${R}`}})}},r;function y(u,d,A,I){let R=F=>{if(!u)return null;if(typeof u=="string")return F.replaceText(d,u);{let J=new RegExp(u.regex),Z=e.sourceCode.getText(d);return F.replaceText(d,Z.replace(J,u.with))}};e.report({node:d,messageId:"default",data:{message:A},fix:u&&I==="autofix"?R:void 0,suggest:u&&I==="suggestion"?[{messageId:"default",data:{message:`Replace with "${typeof u=="string"?u:u.with}"`},fix:R}]:void 0})}}});function yi(e,t){let r=[],n=t.exec(e);if(!n)return null;let[s,...o]=n;r.push({name:"$0_lowercase",value:s.toLowerCase()}),r.push({name:"$0_capitalize",value:zn(s)}),r.push({name:"$0_uncapitalize",value:Wn(s)}),r.push({name:"$0",value:s});for(let i=0;i<o.length;i++){let p=`$${i+1}`,a=o[i];a!==void 0&&(r.push({name:`${p}_lowercase`,value:a.toLowerCase()}),r.push({name:`${p}_capitalize`,value:zn(a)}),r.push({name:`${p}_uncapitalize`,value:Wn(a)}),r.push({name:p,value:a}))}return r}function zn(e){return e.charAt(0).toUpperCase()+e.slice(1)}function Wn(e){return e.charAt(0).toLowerCase()+e.slice(1)}var B=require("@typescript-eslint/utils"),Me=require("zod/v4");var di=B.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),Vn="collapse-simple-objs-in-one-line",gi=Me.z.object({maxLineLength:Me.z.number().optional(),maxProperties:Me.z.number().optional(),nestedObjMaxLineLength:Me.z.number().optional(),nestedObjMaxProperties:Me.z.number().optional(),ignoreTypesWithSuffix:Me.z.array(Me.z.string()).optional()}),Si=di({name:Vn,meta:{type:"suggestion",fixable:"code",docs:{description:"Format simple objects and types in one line"},messages:{singleLineProp:"Object/type should be written in a single line"},schema:[$(gi)]},defaultOptions:[{}],create(e,[t]){let r=e.sourceCode,n=t.ignoreTypesWithSuffix??[],s=t.maxProperties??2,o=t.nestedObjMaxLineLength??t.maxLineLength,i=t.nestedObjMaxProperties??3;function p(c){if(c.type===B.AST_NODE_TYPES.ObjectExpression){let g=c.parent.type===B.AST_NODE_TYPES.Property,S=g?i:s,l=c.properties.length;if(l>S)return!1;if(l===1){let f=c.properties[0];return!f||f.type===B.AST_NODE_TYPES.Property&&f.value.type===B.AST_NODE_TYPES.ObjectExpression||f.type===B.AST_NODE_TYPES.Property&&f.value.type===B.AST_NODE_TYPES.ArrayExpression&&!f.value.elements.every(T=>T&&Rt(T))?!1:{text:r.getText(f),isNested:g,propsSize:l}}let E=[];for(let f of c.properties){if(f.type===B.AST_NODE_TYPES.Property&&!Rt(f.value))return!1;E.push(r.getText(f))}return{text:E.join(", "),isNested:g,propsSize:l}}else{let g=c.parent.parent?.type===B.AST_NODE_TYPES.TSPropertySignature,S=g?i:s,l=c.members.length;if(l>S)return!1;if(n.length>0&&c.parent.type===B.AST_NODE_TYPES.TSTypeAliasDeclaration){let f=c.parent.id.name;if(n.some(h=>f.endsWith(h)))return!1}if(l===1){let f=c.members[0];return!f||f.type===B.AST_NODE_TYPES.TSPropertySignature&&f.typeAnnotation?.typeAnnotation.type===B.AST_NODE_TYPES.TSTypeLiteral?!1:{text:r.getText(f),isNested:g,propsSize:1}}if(c.parent.type===B.AST_NODE_TYPES.TSIntersectionType||c.parent.type===B.AST_NODE_TYPES.TSUnionType&&c.parent.types[0]!==c)return!1;let E=[];for(let f of c.members){if(f.type!==B.AST_NODE_TYPES.TSPropertySignature)return!1;let h=f.typeAnnotation?.typeAnnotation;if(!h||h.type===B.AST_NODE_TYPES.TSTypeLiteral||!Jn(h))return!1;if(h.type===B.AST_NODE_TYPES.TSTypeReference&&h.typeArguments){if(h.typeArguments.params.length>1)return!1;let m=h.typeArguments.params[0];if(!m||!Jn(m))return!1}let T=r.getText(f).trim();(T.endsWith(";")||T.endsWith(","))&&(T=T.slice(0,-1)),E.push(T)}return{text:E.join("; "),isNested:g,propsSize:l}}}function a(c){if(c.loc.start.line===c.loc.end.line)return;if(c.parent.type!==B.AST_NODE_TYPES.JSXExpressionContainer){let h=0,T=!1,m=r.getTokenAfter(c,{filter:C=>C.type!==B.AST_TOKEN_TYPES.Punctuator||T?!0:C.value===","?(h++,!1):C.value===";"?(h++,T=!0,!1):C.value===")"||C.value==="}"?(h++,!1):!0});if(h>4)return;let b=m?.type===B.AST_TOKEN_TYPES.Template&&m.value.startsWith(`}
2
2
  `);if(m?.loc.start.line===c.loc.end.line&&!b)return}let g=p(c);if(!g)return;let S=g.text;if(S.includes(`
3
- `)||r.getCommentsInside(c).length>0)return;S.endsWith(";")&&(S=S.slice(0,-1));let l=`{ ${S} }`,E=hi(r,c),f=g.isNested&&g.propsSize>2?o:t.maxLineLength;f&&l.length+E.length+Ti(c,r)>f||e.report({node:c,messageId:"singleLineProp",fix:h=>h.replaceText(c,l)})}return{TSTypeLiteral:a,ObjectExpression:a}}});function Jn(e){return e.type===X.AST_NODE_TYPES.TSLiteralType||e.type===X.AST_NODE_TYPES.TSTypeReference||e.type===X.AST_NODE_TYPES.TSNumberKeyword||e.type===X.AST_NODE_TYPES.TSStringKeyword||e.type===X.AST_NODE_TYPES.TSBooleanKeyword||e.type===X.AST_NODE_TYPES.TSNullKeyword||e.type===X.AST_NODE_TYPES.TSUndefinedKeyword}function Rt(e,t){return!!(e.type===X.AST_NODE_TYPES.Literal||e.type===X.AST_NODE_TYPES.Identifier||e.type===X.AST_NODE_TYPES.TemplateLiteral||e.type===X.AST_NODE_TYPES.TaggedTemplateExpression||!t&&e.type===X.AST_NODE_TYPES.ArrayExpression&&e.elements.every(r=>r&&Rt(r,!0)))}function Ti(e,t){let r=t.getLastToken(e);if(!r)return 0;let n=t.text.indexOf(`
3
+ `)||r.getCommentsInside(c).length>0)return;S.endsWith(";")&&(S=S.slice(0,-1));let l=`{ ${S} }`,E=hi(r,c),f=g.isNested&&g.propsSize>2?o:t.maxLineLength;f&&l.length+E.length+Ti(c,r)>f||e.report({node:c,messageId:"singleLineProp",fix:h=>h.replaceText(c,l)})}return{TSTypeLiteral:a,ObjectExpression:a}}});function Jn(e){return e.type===B.AST_NODE_TYPES.TSLiteralType||e.type===B.AST_NODE_TYPES.TSTypeReference||e.type===B.AST_NODE_TYPES.TSNumberKeyword||e.type===B.AST_NODE_TYPES.TSStringKeyword||e.type===B.AST_NODE_TYPES.TSBooleanKeyword||e.type===B.AST_NODE_TYPES.TSNullKeyword||e.type===B.AST_NODE_TYPES.TSUndefinedKeyword}function Rt(e,t){return!!(e.type===B.AST_NODE_TYPES.Literal||e.type===B.AST_NODE_TYPES.Identifier||e.type===B.AST_NODE_TYPES.TemplateLiteral||e.type===B.AST_NODE_TYPES.TaggedTemplateExpression||!t&&e.type===B.AST_NODE_TYPES.ArrayExpression&&e.elements.every(r=>r&&Rt(r,!0)))}function Ti(e,t){let r=t.getLastToken(e);if(!r)return 0;let n=t.text.indexOf(`
4
4
  `,r.range[1]);return(n!==-1?n:t.text.length)-r.range[1]}function hi(e,t){return e.text.slice(t.range[0]-t.loc.start.column,t.range[0])}var Pt={name:Vn,rule:Si};var Ei=/eslint +react-compiler\/react-compiler: +\["error/,Hn={meta:{type:"suggestion",docs:{description:"verifies the list of dependencies for Hooks like useEffect and similar",recommended:!0,url:"https://github.com/facebook/react/issues/14920"},fixable:"code",hasSuggestions:!0,schema:[{type:"object",additionalProperties:!1,ignoreIfReactCompilerIsEnabled:!1,enableDangerousAutofixThisMayCauseInfiniteLoops:!1,properties:{additionalHooks:{type:"string"},ignoreIfReactCompilerIsEnabled:{type:"boolean"},enableDangerousAutofixThisMayCauseInfiniteLoops:{type:"boolean"}}}]},create(e){let t=!1,r=typeof e.getSource=="function"?m=>r(m):m=>e.sourceCode.getText(m),n=typeof e.getScope=="function"?()=>n():m=>e.sourceCode.getScope(m),s=e.options&&e.options[0]&&e.options[0].additionalHooks?new RegExp(e.options[0].additionalHooks):void 0,o=e.options&&e.options[0]&&e.options[0].enableDangerousAutofixThisMayCauseInfiniteLoops||!1,i={additionalHooks:s,enableDangerousAutofixThisMayCauseInfiniteLoops:o};function p(m){o&&Array.isArray(m.suggest)&&m.suggest.length>0&&(m.fix=m.suggest[0].fix),e.report(m)}let a=e.getSourceCode().scopeManager,c=new WeakMap,g=new WeakSet,S=new WeakMap,l=new WeakMap,E=new WeakSet;function f(m,b){return function(C){if(b.has(C))return b.get(C);let y=m(C);return b.set(C,y),y}}function h(m,b,C,y,x){x&&m.async&&p({node:m,message:`Effect callbacks are synchronous to prevent race conditions. Put the async function inside:
5
5
 
6
6
  useEffect(() => {
@@ -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 u=a.acquire(m),d=new Set,A=null;{let w=u.upper;for(;w&&(d.add(w),w.type!=="function");)w=w.upper;if(!w)return;A=w}let I=Array.isArray;function P(w){if(!I(w.defs))return!1;let R=w.defs[0];if(R==null||R.node.type!=="VariableDeclarator")return!1;let O=R.node.init;if(O==null)return!1;for(;O.type==="TSAsExpression";)O=O.expression;let D=R.node.parent;if(D==null&&(Ft(A.block,R.node.id),D=R.node.parent,D==null))return!1;if(D.kind==="const"&&O.type==="Literal"&&(typeof O.value=="string"||typeof O.value=="number"||O.value===null))return!0;if(O.type!=="CallExpression")return!1;let M=O.callee;if(M.type==="MemberExpression"&&M.object.name==="React"&&M.property!=null&&!M.computed&&(M=M.property),M.type!=="Identifier")return!1;let L=R.node.id,{name:z}=M;if(z==="useRef"&&L.type==="Identifier")return!0;if(Ii(M)&&L.type==="Identifier"){for(let W of w.references)W!==L&&E.add(W.identifier);return!0}else if(z==="useState"||z==="useReducer"){if(L.type==="ArrayPattern"&&L.elements.length===2&&I(w.identifiers)){if(L.elements[1]===w.identifiers[0]){if(z==="useState"){let W=w.references,he=0;for(let Fe=0;Fe<W.length;Fe++){if(W[Fe].isWrite()&&he++,he>1)return!1;c.set(W[Fe].identifier,L.elements[0])}}return!0}else if(L.elements[0]===w.identifiers[0]){if(z==="useState"){let W=w.references;for(let he=0;he<W.length;he++)g.add(W[he].identifier)}return!1}}}else if(z==="useTransition"&&L.type==="ArrayPattern"&&L.elements.length===2&&Array.isArray(w.identifiers)&&L.elements[1]===w.identifiers[0])return!0;return!1}function k(w){if(!I(w.defs))return!1;let R=w.defs[0];if(R==null||R.node==null||R.node.id==null)return!1;let O=R.node,D=A.childScopes,M=null,L;for(L=0;L<D.length;L++){let z=D[L],W=z.block;if(O.type==="FunctionDeclaration"&&W===O||O.type==="VariableDeclarator"&&W.parent===O){M=z;break}}if(M==null)return!1;for(L=0;L<M.through.length;L++){let z=M.through[L];if(z.resolved!=null&&d.has(z.resolved.scope)&&!H(z.resolved))return!1}return!0}let H=f(P,S),K=f(k,l),ne=new Map;function oe(w){let R=w.from,O=!1;for(;R.block!==m;)R.type==="function"&&(O=R.block.parent!=null&&R.block.parent.type==="ReturnStatement"),R=R.upper;return O}let Z=new Map,de=new Map;Ae(u);function Ae(w){for(let R of w.references){if(!R.resolved||!d.has(R.resolved.scope))continue;let O=Ft(m,R.identifier),D=Bn(O),M=Oe(D,de);if(x&&D.type==="Identifier"&&(D.parent.type==="MemberExpression"||D.parent.type==="OptionalMemberExpression")&&!D.parent.computed&&D.parent.property.type==="Identifier"&&D.parent.property.name==="current"&&oe(R)&&ne.set(M,{reference:R,dependencyNode:D}),D.parent.type==="TSTypeQuery"||D.parent.type==="TSTypeReference")continue;let L=R.resolved.defs[0];if(L!=null&&!(L.node!=null&&L.node.init===m.parent)&&L.type!=="TypeParameter")if(Z.has(M))Z.get(M).references.push(R);else{let z=R.resolved,W=H(z)||K(z);Z.set(M,{isStable:W,references:[R]})}}for(let R of w.childScopes)Ae(R)}ne.forEach(({reference:w,dependencyNode:R},O)=>{let D=w.resolved.references,M=!1;for(let L=0;L<D.length;L++){let{identifier:z}=D[L],{parent:W}=z;if(W!=null&&W.type==="MemberExpression"&&!W.computed&&W.property.type==="Identifier"&&W.property.name==="current"&&W.parent.type==="AssignmentExpression"&&W.parent.left===W){M=!0;break}}M||p({node:R.parent.property,message:`The ref value '${O}.current' will likely have changed by the time this effect cleanup function runs. If this ref points to a node rendered by React, copy '${O}.current' to a variable inside the effect, and use that variable in the cleanup function.`})});let ue=new Set;function Ie(w,R){ue.has(R)||(ue.add(R),p({node:w,message:`Assignments to the '${R}' variable from inside React Hook ${r(C)} will be lost after each render. To preserve the value over time, store it in a useRef Hook and keep the mutable value in the '.current' property. Otherwise, you can move this variable directly inside ${r(C)}.`}))}let Te=new Set;if(Z.forEach(({isStable:w,references:R},O)=>{w&&Te.add(O),R.forEach(D=>{D.writeExpr&&Ie(D.writeExpr,O)})}),ue.size>0)return;if(!b){let w=null;if(Z.forEach(({isStable:R,references:O},D)=>{w||O.forEach(M=>{if(w)return;let L=M.identifier;if(!c.has(L))return;let W=M.from;for(;W.type!=="function";)W=W.upper;W.block===m&&(w=D)})}),w){let{suggestedDependencies:R}=vt({dependencies:Z,declaredDependencies:[],stableDependencies:Te,externalDependencies:new Set,isEffect:!0});p({node:C,message:`React Hook ${y} contains a call to '${w}'. Without a list of dependencies, this can lead to an infinite chain of updates. To fix this, pass [`+R.join(", ")+`] as a second argument to the ${y} Hook.`,suggest:[{desc:`Add dependencies array: [${R.join(", ")}]`,fix(O){return O.insertTextAfter(m,`, [${R.join(", ")}]`)}}]})}return}let ze=[],Ke=new Set;b.type!=="ArrayExpression"?p({node:b,message:`React Hook ${r(C)} was passed a dependency list that is not an array literal. This means we can't statically verify whether you've passed the correct dependencies.`}):b.elements.forEach(w=>{if(w===null)return;if(w.type==="SpreadElement"){p({node:w,message:`React Hook ${r(C)} has a spread element in its dependency array. This means we can't statically verify whether you've passed the correct dependencies.`});return}E.has(w)&&p({node:w,message:`Functions returned from \`useEffectEvent\` must not be included in the dependency array. Remove \`${r(w)}\` from the list.`,suggest:[{desc:`Remove the dependency \`${r(w)}\``,fix(M){return M.removeRange(w.range)}}]});let R;try{R=Oe(w,de)}catch(M){if(/Unsupported node type/.test(M.message)){w.type==="Literal"?Z.has(w.value)?p({node:w,message:`The ${w.raw} literal is not a valid dependency because it never changes. Did you mean to include ${w.value} in the array instead?`}):p({node:w,message:`The ${w.raw} literal is not a valid dependency because it never changes. You can safely remove it.`}):p({node:w,message:`React Hook ${r(C)} has a complex expression in the dependency array. Extract it to a separate variable so it can be statically checked.`});return}else throw M}let O=w;for(;O.type==="MemberExpression"||O.type==="OptionalMemberExpression"||O.type==="ChainExpression";)O=O.object||O.expression.object;let D=!A.through.some(M=>M.identifier===O);ze.push({key:R,node:w}),D||Ke.add(R)});let{suggestedDependencies:ni,unnecessaryDependencies:ot,missingDependencies:Le,duplicateDependencies:jn}=vt({dependencies:Z,declaredDependencies:ze,stableDependencies:Te,externalDependencies:Ke,isEffect:x}),at=ni;if(jn.size+Le.size+ot.size===0){if(t)return;bi({declaredDependencies:ze,declaredDependenciesNode:b,componentScope:A,scope:u}).forEach(({construction:R,isUsedOutsideOfHook:O,depType:D})=>{let M=D==="function"?"useCallback":"useMemo",L=D==="function"?"definition":"initialization",z=`wrap the ${L} of '${R.name.name}' in its own ${M}() Hook.`,W=O?`To fix this, ${z}`:`Move it inside the ${y} callback. Alternatively, ${z}`,he=D==="conditional"||D==="logical expression"?"could make":"makes",Fe=`The '${R.name.name}' ${D} ${he} the dependencies of ${y} Hook (at line ${b.loc.start.line}) change on every render. ${W}`,Ln;O&&R.type==="Variable"&&D==="function"&&(Ln=[{desc:`Wrap the ${L} of '${R.name.name}' in its own ${M}() Hook.`,fix(Mn){let[ii,si]=M==="useMemo"?["useMemo(() => { return ","; })"]:["useCallback(",")"];return[Mn.insertTextBefore(R.node.init,ii),Mn.insertTextAfter(R.node.init,si)]}}]),p({node:R.node,message:Fe,suggest:Ln})});return}!x&&Le.size>0&&(at=vt({dependencies:Z,declaredDependencies:[],stableDependencies:Te,externalDependencies:Ke,isEffect:x}).suggestedDependencies);function ri(){if(ze.length===0)return!0;let w=ze.map(O=>O.key),R=w.slice().sort();return w.join(",")===R.join(",")}ri()&&at.sort();function At(w){let R=w.split("."),O="";for(let D=0;D<R.length;D++){if(D!==0){let M=R.slice(0,D+1).join("."),L=de.get(M)===!0;O+=L?"?.":"."}O+=R[D]}return O}function It(w,R,O,D){return w.size===0?null:(w.size>1?"":R+" ")+O+" "+(w.size>1?"dependencies":"dependency")+": "+Ci(Array.from(w).sort().map(M=>"'"+At(M)+"'"))+`. Either ${D} ${w.size>1?"them":"it"} or remove the dependency array.`}let be="";if(ot.size>0){let w=null;if(Array.from(ot.keys()).forEach(R=>{w===null&&R.endsWith(".current")&&(w=R)}),w!==null)be=` Mutable values like '${w}' aren't valid dependencies because mutating them doesn't re-render the component.`;else if(Ke.size>0){let R=Array.from(Ke)[0];u.set.has(R)||(be=` Outer scope values like '${R}' aren't valid dependencies because mutating them doesn't re-render the component.`)}}if(!be&&Le.has("props")){let w=Z.get("props");if(w==null)return;let R=w.references;if(!Array.isArray(R))return;let O=!0;for(let D=0;D<R.length;D++){let M=R[D],L=Ft(A.block,M.identifier);if(!L){O=!1;break}let z=L.parent;if(z==null){O=!1;break}if(z.type!=="MemberExpression"&&z.type!=="OptionalMemberExpression"){O=!1;break}}O&&(be=` However, 'props' will change when *any* prop changes, so the preferred fix is to destructure the 'props' object outside of the ${y} call and refer to those specific props inside ${r(C)}.`)}if(!be&&Le.size>0){let w=null;Le.forEach(R=>{if(w)return;let O=A.set.get(R),D=Z.get(R);if(D.references[0].resolved!==O)return;let M=O.defs[0];if(M==null||M.name==null||M.type!=="Parameter")return;let L=!1,z;for(let W=0;W<D.references.length;W++)if(z=D.references[W].identifier,z!=null&&z.parent!=null&&(z.parent.type==="CallExpression"||z.parent.type==="OptionalCallExpression")&&z.parent.callee===z){L=!0;break}L&&(w=R)}),w!==null&&(be=` If '${w}' changes too often, find the parent component that defines it and wrap that definition in useCallback.`)}if(!be&&Le.size>0){let w=null;if(Le.forEach(R=>{if(w!==null)return;let D=Z.get(R).references,M,L;for(let z=0;z<D.length;z++){for(M=D[z].identifier,L=M.parent;L!=null&&L!==A.block;){if(L.type==="CallExpression"){let W=c.get(L.callee);if(W!=null){if(W.name===R)w={missingDep:R,setter:L.callee.name,form:"updater"};else if(g.has(M))w={missingDep:R,setter:L.callee.name,form:"reducer"};else{let he=D[z].resolved;if(he!=null){let Fe=he.defs[0];Fe!=null&&Fe.type==="Parameter"&&(w={missingDep:R,setter:L.callee.name,form:"inlineReducer"})}}break}}L=L.parent}if(w!==null)break}}),w!==null)switch(w.form){case"reducer":be=` You can also replace multiple useState variables with useReducer if '${w.setter}' needs the current value of '${w.missingDep}'.`;break;case"inlineReducer":be=` If '${w.setter}' needs the current value of '${w.missingDep}', you can also switch to useReducer instead of useState and read '${w.missingDep}' in the reducer.`;break;case"updater":be=` You can also do a functional update '${w.setter}(${w.missingDep.slice(0,1)} => ...)' if you only need '${w.missingDep}' in the '${w.setter}' call.`;break;default:throw new Error("Unknown case.")}}p({node:b,message:`React Hook ${r(C)} has `+(It(Le,"a","missing","include")||It(ot,"an","unnecessary","exclude")||It(jn,"a","duplicate","omit"))+be,suggest:[{desc:`Update the dependencies array to be: [${at.map(At).join(", ")}]`,fix(w){return w.replaceText(b,`[${at.map(At).join(", ")}]`)}}]})}function T(m){let b=xi(m.callee,i);if(b===-1)return;let C=m.arguments[b],y=m.callee,x=Yn(y).name,u=m.arguments[b+1],d=/Effect($|[^a-z])/g.test(x);if(!C){p({node:y,message:`React Hook ${x} requires an effect callback. Did you forget to pass a callback to the hook?`});return}if(!(t&&!d)){if(!u&&!d){(x==="useMemo"||x==="useCallback")&&p({node:y,message:`React Hook ${x} does nothing when called with only one argument. Did you forget to pass an array of dependencies?`});return}switch(C.type){case"FunctionExpression":case"ArrowFunctionExpression":h(C,u,y,x,d);return;case"Identifier":if(!u||u.elements&&u.elements.some(P=>P&&P.type==="Identifier"&&P.name===C.name))return;let A=n(m).set.get(C.name);if(A==null||A.defs==null)return;let I=A.defs[0];if(!I||!I.node||I.type!=="Variable"&&I.type!=="FunctionName")break;switch(I.node.type){case"FunctionDeclaration":h(I.node,u,y,x,d);return;case"VariableDeclarator":let P=I.node.init;if(!P)break;switch(P.type){case"ArrowFunctionExpression":case"FunctionExpression":h(P,u,y,x,d);return}break}break;default:p({node:y,message:`React Hook ${x} received a function whose dependencies are unknown. Pass an inline function instead.`});return}p({node:y,message:`React Hook ${x} has a missing dependency: '${C.name}'. Either include it or remove the dependency array.`,suggest:[{desc:`Update the dependencies array to be: [${C.name}]`,fix(A){return A.replaceText(u,`[${C.name}]`)}}]})}}if(e.options[0]?.ignoreIfReactCompilerIsEnabled){for(let m of e.sourceCode.getAllComments())if(Ei.test(m.value))return t=!0,{CallExpression:b=>T(b,!0)}}return{CallExpression:m=>T(m)}}};function vt({dependencies:e,declaredDependencies:t,stableDependencies:r,externalDependencies:n,isEffect:s}){let o=i();function i(){return{isUsed:!1,isSatisfiedRecursively:!1,isSubtreeUsed:!1,children:new Map}}e.forEach((h,T)=>{let m=p(o,T);m.isUsed=!0,a(o,T,b=>{b.isSubtreeUsed=!0})}),t.forEach(({key:h})=>{let T=p(o,h);T.isSatisfiedRecursively=!0}),r.forEach(h=>{let T=p(o,h);T.isSatisfiedRecursively=!0});function p(h,T){let m=T.split("."),b=h;for(let C of m){let y=b.children.get(C);y||(y=i(),b.children.set(C,y)),b=y}return b}function a(h,T,m){let b=T.split("."),C=h;for(let y of b){let x=C.children.get(y);if(!x)return;m(x),C=x}}let c=new Set,g=new Set;S(o,c,g,h=>h);function S(h,T,m,b){h.children.forEach((C,y)=>{let x=b(y);if(C.isSatisfiedRecursively){C.isSubtreeUsed&&m.add(x);return}if(C.isUsed){T.add(x);return}S(C,T,m,u=>x+"."+u)})}let l=[],E=new Set,f=new Set;return t.forEach(({key:h})=>{g.has(h)?l.indexOf(h)===-1?l.push(h):f.add(h):E.add(h)}),c.forEach(h=>{l.push(h)}),{suggestedDependencies:l,unnecessaryDependencies:E,duplicateDependencies:f,missingDependencies:c}}function $e(e){switch(e.type){case"ObjectExpression":return"object";case"ArrayExpression":return"array";case"ArrowFunctionExpression":case"FunctionExpression":return"function";case"ClassExpression":return"class";case"ConditionalExpression":return $e(e.consequent)!=null||$e(e.alternate)!=null?"conditional":null;case"LogicalExpression":return $e(e.left)!=null||$e(e.right)!=null?"logical expression":null;case"JSXFragment":return"JSX fragment";case"JSXElement":return"JSX element";case"AssignmentExpression":return $e(e.right)!=null?"assignment expression":null;case"NewExpression":return"object construction";case"Literal":return e.value instanceof RegExp?"regular expression":null;case"TypeCastExpression":return $e(e.expression);case"TSAsExpression":return $e(e.expression)}return null}function bi({declaredDependencies:e,declaredDependenciesNode:t,componentScope:r,scope:n}){let s=e.map(({key:i})=>{let p=r.variables.find(c=>c.name===i);if(p==null)return null;let a=p.defs[0];if(a==null)return null;if(a.type==="Variable"&&a.node.type==="VariableDeclarator"&&a.node.id.type==="Identifier"&&a.node.init!=null){let c=$e(a.node.init);if(c!=null)return[p,c]}return a.type==="FunctionName"&&a.node.type==="FunctionDeclaration"?[p,"function"]:a.type==="ClassName"&&a.node.type==="ClassDeclaration"?[p,"class"]:null}).filter(Boolean);function o(i){let p=!1;for(let a=0;a<i.references.length;a++){let c=i.references[a];if(c.writeExpr){if(p)return!0;p=!0;continue}let g=c.from;for(;g!==n&&g!=null;)g=g.upper;if(g!==n&&!qn(t,c.identifier))return!0}return!1}return s.map(([i,p])=>({construction:i.defs[0],depType:p,isUsedOutsideOfHook:o(i)}))}function Bn(e){return(e.parent.type==="MemberExpression"||e.parent.type==="OptionalMemberExpression")&&e.parent.object===e&&e.parent.property.name!=="current"&&!e.parent.computed&&!(e.parent.parent!=null&&(e.parent.parent.type==="CallExpression"||e.parent.parent.type==="OptionalCallExpression")&&e.parent.parent.callee===e.parent)?Bn(e.parent):e.type==="MemberExpression"&&e.parent&&e.parent.type==="AssignmentExpression"&&e.parent.left===e?e.object:e}function kt(e,t,r){t&&(e.optional?t.has(r)||t.set(r,!0):t.has(r)||t.set(r,!1))}function Oe(e,t){if(e.type==="Identifier"||e.type==="JSXIdentifier"){let r=e.name;return t&&t.set(r,!1),r}else if(e.type==="MemberExpression"&&!e.computed){let r=Oe(e.object,t),n=Oe(e.property,null),s=`${r}.${n}`;return kt(e,t,s),s}else if(e.type==="OptionalMemberExpression"&&!e.computed){let r=Oe(e.object,t),n=Oe(e.property,null),s=`${r}.${n}`;return kt(e,t,s),s}else if(e.type==="ChainExpression"&&!e.computed){let r=e.expression;if(r.type==="CallExpression")throw new Error(`Unsupported node type: ${r.type}`);let n=Oe(r.object,t),s=Oe(r.property,null),o=`${n}.${s}`;return kt(r,t,o),o}else throw new Error(`Unsupported node type: ${e.type}`)}function Yn(e,t){return e.type==="MemberExpression"&&e.object.type==="Identifier"&&e.object.name==="React"&&e.property.type==="Identifier"&&!e.computed?e.property:e}function xi(e,t){let r=Yn(e);if(r.type!=="Identifier")return-1;switch(r.name){case"useEffect":case"useLayoutEffect":case"useCallback":case"useMemo":return 0;case"useImperativeHandle":return 1;default:if(r===e&&t&&t.additionalHooks){let n;try{n=Oe(r,null)}catch(s){if(/Unsupported node type/.test(s.message))return 0;throw s}return t.additionalHooks.test(n)?0:-1}else return-1}}function Ft(e,t){let r=[e],n=null;for(;r.length;){if(n=r.shift(),Ai(n,t))return n;if(qn(n,t))for(let[s,o]of Object.entries(n))s!=="parent"&&(Xn(o)?(o.parent=n,r.push(o)):Array.isArray(o)&&o.forEach(i=>{Xn(i)&&(i.parent=n,r.push(i))}))}return null}function Ci(e){let t="";for(let r=0;r<e.length;r++)t+=e[r],r===0&&e.length===2?t+=" and ":r===e.length-2&&e.length>2?t+=", and ":r<e.length-1&&(t+=", ");return t}function Xn(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&typeof e.type=="string"}function Ai(e,t){return(e.type==="Identifier"||e.type==="JSXIdentifier")&&e.type===t.type&&e.name===t.name&&e.range[0]===t.range[0]&&e.range[1]===t.range[1]}function qn(e,t){return e.range[0]<=t.range[0]&&e.range[1]>=t.range[1]}function Ii(e){return!1}var te=require("@typescript-eslint/utils"),ae=xe(require("typescript")),Qn=require("zod/v4");var Ot=require("@typescript-eslint/utils");function He(e,t,r=1/0){if(r!==0&&e.parent)return e.type===t?e:He(e.parent,t,r===1/0?r:r-1)}function*Nt(e){yield e,e.parent&&(yield*Nt(e.parent))}function Dt(e,t){for(let r of e){let n=t(r);if(n!=null&&n!==!1)return n}}function Gn(e,t,r){let s=r.getDeclaredVariables(e).find(o=>o.name===t||o.identifiers[0]?.parent.type===Ot.AST_NODE_TYPES.Property&&o.identifiers[0].parent.key.type===Ot.AST_NODE_TYPES.Identifier&&o.identifiers[0].parent.key.name===t);return s?s.references.filter(o=>!o.init):[]}function Zn(e){return e===null||typeof e!="object"||!("type"in e)?!1:typeof e.type=="string"}function wi(e,t){return e[t]}function we(e,t,r){let n=r.visitorKeys,s=new Set;function o(i){if(s.has(i))return!1;if(s.add(i),t(i)===!0)return!0;let a=n[i.type];if(a)for(let c of a){let g=wi(i,c);if(g){if(Array.isArray(g)){for(let S of g)if(Zn(S)&&o(S))return!0}else if(Zn(g)&&o(g))return!0}}return!1}o(e)}var Ri=te.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),Kn="improved-no-unnecessary-condition",Pi=Qn.z.object({}),vi=["string","number","bigint","boolean","symbol","undefined","object","function","never"],ki=new Set(vi),jt={name:Kn,rule:Ri({name:Kn,meta:{type:"suggestion",docs:{description:"Extends checks of `no-unnecessary-condition` rule"},messages:{unnecessaryTypeofCondition:'This condition is unnecessary. The type of "{{name}}" is always "{{type}}".',alwaysFalseTypeofCondition:'This condition will always be false. The type of "{{name}}" is "{{actualType}}" so the condition has no overlap with "{{conditionType}}".',unnecessaryStartsWithCondition:"This startsWith check is unnecessary as it always evaluates to true.",alwaysFalseStartsWithCondition:"This startsWith check will always be false.",unnecessaryEndsWithCondition:"This endsWith check is unnecessary as it always evaluates to true.",alwaysFalseEndsWithCondition:"This endsWith check will always be false.",unnecessaryIncludesCondition:"This includes check is unnecessary as it always evaluates to true.",alwaysFalseIncludesCondition:"This includes check will always be false.",unnecessaryLengthCondition:"This length comparison is unnecessary as it always evaluates to true.",alwaysFalseLengthCondition:"This length comparison will always be false."},schema:[$(Pi)]},defaultOptions:[{}],create(e){let t=te.ESLintUtils.getParserServices(e,!0),r=t.program?.getTypeChecker();if(!r||!t.program)throw new Error("TypeScript services or program not available");function n(l){return l.type===te.AST_NODE_TYPES.UnaryExpression&&l.operator==="typeof"}function s(l){return l.flags&ae.default.TypeFlags.Any||l.flags&ae.default.TypeFlags.Unknown?null:l.flags&ae.default.TypeFlags.StringLike?["string"]:l.flags&ae.default.TypeFlags.NumberLike?["number"]:l.flags&ae.default.TypeFlags.BigIntLike?["bigint"]:l.flags&ae.default.TypeFlags.BooleanLike?["boolean"]:l.flags&ae.default.TypeFlags.ESSymbolLike?["symbol"]:l.flags&ae.default.TypeFlags.Undefined||l.flags&ae.default.TypeFlags.Void?["undefined"]:l.flags&ae.default.TypeFlags.Null?["object"]:l.getCallSignatures().length>0?["function"]:l.flags&ae.default.TypeFlags.Object?l.getProperties().length===0?["string","number","bigint","boolean","symbol","object","function"]:["object"]:l.flags&ae.default.TypeFlags.NonPrimitive?["object"]:l.flags&ae.default.TypeFlags.Never?["never"]:null}function o(l){if(!r)return null;let E=t.esTreeNodeToTSNodeMap.get(l),f=r.getTypeAtLocation(E.expression);if(f.flags&ae.default.TypeFlags.Any||f.flags&ae.default.TypeFlags.Unknown)return null;let h=[];if(f.isUnion()){for(let m of f.types){let b=s(m);if(b)h.push(...b);else return null}return h}let T=s(f);return T?(h.push(...T),h):null}function i(l){if(!(l.operator==="==="||l.operator==="!=="))return;let f=null,h=null;if(n(l.left)?(f=l.left,h=l.right.type===te.AST_NODE_TYPES.Literal&&typeof l.right.value=="string"?l.right.value:null):n(l.right)&&(f=l.right,h=l.left.type===te.AST_NODE_TYPES.Literal&&typeof l.left.value=="string"?l.left.value:null),!f||!h||!Fi(h,ki))return;let T=o(f);if(!T)return;let m=l.operator==="!==",b=T.includes(h);T.length===1?b&&!m?e.report({node:l,messageId:"unnecessaryTypeofCondition",data:{name:Be(f,e),type:h}}):!b&&m?e.report({node:l,messageId:"unnecessaryTypeofCondition",data:{name:Be(f,e),type:Array.from(T)[0]}}):!b&&!m?e.report({node:l,messageId:"alwaysFalseTypeofCondition",data:{name:Be(f,e),actualType:pt(T),conditionType:h}}):b&&m&&e.report({node:l,messageId:"alwaysFalseTypeofCondition",data:{name:Be(f,e),actualType:pt(T),conditionType:h}}):!b&&!m?e.report({node:l,messageId:"alwaysFalseTypeofCondition",data:{name:Be(f,e),actualType:pt(T),conditionType:h}}):!b&&m&&e.report({node:l,messageId:"unnecessaryTypeofCondition",data:{name:Be(f,e),type:pt(T)}})}function p(l){if(l.flags&ae.default.TypeFlags.Any||l.flags&ae.default.TypeFlags.Unknown)return null;if(l.isUnion()){let E=[];for(let f of l.types)if(f.flags&ae.default.TypeFlags.StringLiteral){let h=f.value;E.push(h)}else return null;return E}return l.flags&ae.default.TypeFlags.StringLiteral?[l.value]:null}function a(l){if(!r)return null;let E=t.esTreeNodeToTSNodeMap.get(l),f=r.getTypeAtLocation(E),h=p(f);if(h)return h;let T=r.getSymbolAtLocation(E);if(T){let m=r.getTypeOfSymbolAtLocation(T,E),b=p(m);if(b)return b}return null}function c(l){let E=e.sourceCode.ast,f=null;return we(E,h=>{if(h.type===te.AST_NODE_TYPES.VariableDeclarator&&h.id.type===te.AST_NODE_TYPES.Identifier&&h.id.name===l.name&&h.id.typeAnnotation){let T=h.id.typeAnnotation.typeAnnotation;if(T.type===te.AST_NODE_TYPES.TSUnionType){let m=[];for(let b of T.types)if(b.type===te.AST_NODE_TYPES.TSLiteralType&&b.literal.type===te.AST_NODE_TYPES.Literal&&typeof b.literal.value=="string")m.push(b.literal.value);else return!0;return f=m,!0}if(T.type===te.AST_NODE_TYPES.TSLiteralType&&T.literal.type===te.AST_NODE_TYPES.Literal&&typeof T.literal.value=="string")return f=[T.literal.value],!0}return!1},e.sourceCode),f}function g(l){if(l.callee.type!==te.AST_NODE_TYPES.MemberExpression||l.callee.property.type!==te.AST_NODE_TYPES.Identifier||l.callee.computed)return;let E=l.callee.property.name;if(E!=="startsWith"&&E!=="endsWith"&&E!=="includes"||l.arguments.length!==1)return;let[f]=l.arguments;if(!f||f.type!==te.AST_NODE_TYPES.Literal||typeof f.value!="string")return;let h=l.callee.object,T=a(h);if(!T&&h.type===te.AST_NODE_TYPES.Identifier&&(T=c(h)),!T||T.length===0)return;let m=f.value;if(E==="includes"&&T.length>1)return;let b=0,C=0;for(let y of T)if((E==="startsWith"?y.startsWith(m):E==="endsWith"?y.endsWith(m):y.includes(m))?b++:C++,b>0&&C>0)return;if(b>0&&C===0){let y=E==="startsWith"?"unnecessaryStartsWithCondition":E==="endsWith"?"unnecessaryEndsWithCondition":"unnecessaryIncludesCondition";e.report({node:l,messageId:y})}else if(C>0&&b===0){let y=E==="startsWith"?"alwaysFalseStartsWithCondition":E==="endsWith"?"alwaysFalseEndsWithCondition":"alwaysFalseIncludesCondition";e.report({node:l,messageId:y})}}function S(l){if(!new Set(["===","!==",">",">=","<","<="]).has(l.operator))return;function f(x){if(x.type!==te.AST_NODE_TYPES.MemberExpression||x.computed||x.property.type!==te.AST_NODE_TYPES.Identifier||x.property.name!=="length")return null;let u=x.object,d=a(u);if(!d||d.length===0)return null;let A=[];for(let I of d)A.push(I.length);return{values:A}}let h=f(l.left),T=f(l.right),m=null,b=null;if(h?l.right.type===te.AST_NODE_TYPES.Literal&&typeof l.right.value=="number"&&(m=h.values,b=l.right.value):T&&l.left.type===te.AST_NODE_TYPES.Literal&&typeof l.left.value=="number"&&(m=T.values,b=l.left.value),!m||b===null)return;let C=0,y=0;for(let x of m){let u=!1;if(l.operator==="==="?u=x===b:l.operator==="!=="?u=x!==b:l.operator===">"?u=x>b:l.operator===">="?u=x>=b:l.operator==="<"?u=x<b:l.operator==="<="&&(u=x<=b),u?C++:y++,C>0&&y>0)return}C>0&&y===0?e.report({node:l,messageId:"unnecessaryLengthCondition"}):y>0&&C===0&&e.report({node:l,messageId:"alwaysFalseLengthCondition"})}return{BinaryExpression(l){i(l),S(l)},CallExpression:g}}})};function pt(e){return Array.from(new Set(e)).join(" | ")||"never"}function Be(e,t){let r=e.argument;return r.type===te.AST_NODE_TYPES.Identifier?r.name:t.sourceCode.getText(r)}function Fi(e,t){return t.has(e)}var ut=require("@typescript-eslint/utils"),ct=require("zod/v4");var Oi=ut.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),er="no-call-with-explicit-generics",Ni=ct.z.object({functions:ct.z.array(ct.z.string())}),Di=Oi({name:er,meta:{type:"problem",docs:{description:"Enforce calling configured functions with inferred generics only"},messages:{noExplicitGenerics:"Function '{{ functionName }}' should be called with inferred generics (remove the explicit type parameters)"},schema:[$(Ni)]},defaultOptions:[{functions:[]}],create(e,[t]){let r=new Set(t.functions);return{CallExpression(n){let{callee:s}=n;s.type===ut.AST_NODE_TYPES.Identifier&&r.has(s.name)&&n.typeArguments&&e.report({node:n,messageId:"noExplicitGenerics",data:{functionName:s.name}})}}}}),Lt={name:er,rule:Di};var We=require("@typescript-eslint/utils"),ji=We.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),tr="no-call-with-inferred-generics",Li=ji({name:tr,meta:{type:"problem",docs:{description:"Disable calling configured functions with infered generics"},messages:{missingGenericDeclaration:"Function '{{ functionName }}' should be called with at least {{ minGenerics }} generic(s) (ex: `fn<Generic>()`) defined",anyUsedInGenerics:"Function '{{ functionName }}' should not be called with 'any' in generics"},schema:[{type:"object",properties:{functions:{type:"array",items:{type:"object",properties:{name:{type:"string"},minGenerics:{type:"number"},allowAny:{type:"boolean"},disallowTypes:{type:"array",items:{type:"string"}}},required:["name"]}},anyAliases:{type:"array",items:{type:"string"}}},required:["functions"]}]},defaultOptions:[{functions:[]}],create(e,[t]){let r=new Map(t.functions.map(n=>[n.name,n]));return{CallExpression(n){let{callee:s}=n;if(s.type!==We.AST_NODE_TYPES.Identifier)return;let o=r.get(s.name);if(!o)return;let{minGenerics:i=1,allowAny:p,disallowTypes:a=t.disallowTypes}=o;(n.typeArguments?.params.length||0)<(i||0)&&e.report({node:n,messageId:"missingGenericDeclaration",data:{functionName:s.name,minGenerics:i||0}}),!(p&&!a)&&n.typeArguments?.params.some(g=>!p&&g.type===We.AST_NODE_TYPES.TSAnyKeyword||a&&g.type===We.AST_NODE_TYPES.TSTypeReference&&g.typeName.type===We.AST_NODE_TYPES.Identifier&&a.includes(g.typeName.name))&&e.report({node:n,messageId:"anyUsedInGenerics",data:{functionName:s.name}})}}}}),Mt={name:tr,rule:Li};var ir=require("@typescript-eslint/utils"),Mi=ir.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),sr="no-commented-out-code",$i=["function ","class ","interface ","type ","enum ","namespace ","import ","export ","const ","let ","var ","return ","throw ","break","continue","try {","catch (","finally {","async ","await ","case ","switch (","while (","for (","default:"],_i=/^\s*return\s+/,Ui=/\w=("|'|`)/,zi=/\w+:\s*('|"|`)/,Wi=/\[['"][^'"]*['"]\]:\s*('|"|`|[^'"`\s])/,Ji=/\w+-\w+:/,Vi=/\w+_\w+:/,Xi=/\?\s+\w/,Hi=/:\s+\w/,Bi=/^\s*('|"|`)[^'"]*('|"|`),?\s*$/,Yi=/^\s*\d+[,}]/,qi=/^\s*\[[^\]]*\][,}]/,Zi=/^\s*\{[^}]*\}[,}]/,Gi=/\.\w+\(/,Ki=/\[\w+\]/,Qi=/^\s*(['"`]).+?\1\s*:/,es=/^<[A-Z]\w*(\s|>|\/)/,ts=/^<[a-z]+(\s|>|\/)/,ns=/<[A-Z]\w*(\s.*)?>/,rs=/<\/[A-Z]\w*>/,is=/<[a-z]+(\s.*)?>/,ss=/<\/[a-z]+>/,os=/^\s*[*\s]*$/,as=/^[a-zA-Z]/,ls=/^[A-Z][A-Za-z]*(?:\s+\d+)?(?:\s+[a-z]+)*:\s+[A-Za-z]/,ps=/```[\s\S]*?```/g,cs=/`[^`]*`/g,nr=/[a-zA-Z0-9]/,us=/\.[A-Za-z_][A-Za-z0-9_]*\(/,fs=/[{}[\]()`=<>]/,ms=/:\s*(['"`[{(]|\w+\s*=>)/,ys=/\bif\s*\(|\belse\b|=>/,re={returnStatement:_i,stringAssignment:Ui,objectPropertyWithQuotes:zi,computedPropertyAssignment:Wi,kebabCaseProperty:Ji,snakeCaseProperty:Vi,ternaryOperator:Xi,colonWithWord:Hi,quotedString:Bi,numberWithComma:Yi,arrayWithComma:qi,objectWithComma:Zi,methodCall:Gi,arrayAccess:Ki,quotedPropertyKey:Qi,jsxSelfClosing:es,jsxElement:ts,jsxOpeningTag:ns,jsxClosingTag:rs,htmlOpeningTag:is,htmlClosingTag:ss,jsdocComment:os};function ds(e){if(e.includes(":")){let r=e.split(":")[0]?.trim();if(r&&as.test(r)&&r.includes(" "))return!0}let t=e.trim();return t.length===0||us.test(t)||fs.test(t)||ms.test(t)||ys.test(t)?!1:!!(t.includes(":")&&ls.test(t))}var gs=[") {","return;",re.returnStatement,"if (","else {","else if (","/>","</","< ","},",": {"," } = ","={",re.stringAssignment,");",re.objectPropertyWithQuotes,re.computedPropertyAssignment,re.kebabCaseProperty,re.snakeCaseProperty,"&&","||","()",re.ternaryOperator,re.colonWithWord,re.quotedString,re.numberWithComma,re.arrayWithComma,re.objectWithComma,re.methodCall,re.arrayAccess,"?.(","??","=>",re.quotedPropertyKey],Ss=["/>","</",re.jsxSelfClosing,re.jsxElement,re.jsxOpeningTag,re.jsxClosingTag,re.htmlOpeningTag,re.htmlClosingTag],rr=["INFO:","TODO:","DOCS:","FIX:","FIXME:","HACK:","NOTE:","WARNING:","WARN:","BUG:","ISSUE:","TEMP:","TEMPORARY:","XXX:","REVIEW:","eslint"],Ts=Mi({name:sr,meta:{type:"problem",docs:{description:"Disallow commented code"},messages:{commentedOutCode:"Commented code is not allowed. Detected pattern: `{{ wrongPattern }}` Use a comment starting with one of these prefixes if you want to keep this code commented out: {{ allowedPrefixes }}"},schema:[]},defaultOptions:[],create(e){function t(n,s){if(n.startsWith("/"))return!1;let o=n.trimStart();if(n.startsWith("*")||o.startsWith("eslint-disable")||n.includes("@deprecated")||n.includes("@example")||n.includes("@param")||n.includes("@returns")||n.includes("@throws")||n.includes("typescript-eslint")||n.includes("@ts-")||n.includes("prettier-ignore")||re.jsdocComment.test(n))return!1;for(let i of rr)if(o.startsWith(i))return!1;if(n.includes("https://")||ds(o))return!1;if(s==="Block"){for(let i of Ss)if(typeof i=="string"){if(n.includes(i))return{wrongPattern:i}}else if(i.test(n))return{wrongPattern:`regex(${i.toString()})`};return!1}for(let i of $i)if(o.startsWith(i))return{wrongPattern:i};for(let i of gs)if(typeof i=="string"){if(n.includes(i))return{wrongPattern:i}}else if(i.test(n))return{wrongPattern:`regex(${i.toString()})`};return!1}function r(n,s){let o=n,i=o.trim();if(i.startsWith("`")&&(i.endsWith("`,")||i.endsWith("`;")||i.endsWith("`")))return o;if(s==="Block"&&o.includes("```")){let c=o.split(ps);c.some(S=>nr.test(S))&&(o=c.join(""))}if(!o.includes("`"))return o;let p=o.split(cs);return p.some(c=>nr.test(c))?p.join(""):o}return{Program(){let s=e.sourceCode.getAllComments();for(let o of s){let i=r(o.value,o.type),p=t(i,o.type);p&&e.report({node:o,messageId:"commentedOutCode",data:{wrongPattern:p.wrongPattern,allowedPrefixes:rr.join(", ")}})}}}}}),$t={name:sr,rule:Ts};var ft=require("@typescript-eslint/utils"),hs=ft.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),or="no-default-export",Es=hs({name:or,meta:{type:"problem",docs:{description:"Disallow default exports"},schema:[],messages:{noDefaultExport:"Default exports are not allowed, use named exports instead."}},defaultOptions:[],create(e){return{ExportDefaultDeclaration(t){e.report({node:t,messageId:"noDefaultExport"})},ExportNamedDeclaration(t){for(let r of t.specifiers)r.exported.type===ft.TSESTree.AST_NODE_TYPES.Identifier&&r.exported.name==="default"&&e.report({node:t,messageId:"noDefaultExport"})}}}}),_t={name:or,rule:Es};var ar=require("@typescript-eslint/utils"),bs=ar.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),lr="no-leaked-text-in-jsx",xs=[",",";","[","]","(",")"],Cs=bs({name:lr,meta:{type:"problem",docs:{description:"Prevents leaking of text in JSX that should be wrapped in an expression container"},messages:{leakedTextInJSX:'Text "{{ text }}" should be wrapped in a JSX expression container.'},schema:[],fixable:"code"},defaultOptions:[],create(e){return{JSXText(t){let r=t.value.trim();if(!r)return;let n="";xs.includes(r)?n=r:r.includes("&&")?n="&&":r.includes("||")?n="||":r.endsWith("? (")&&(n="? ("),n&&e.report({node:t,messageId:"leakedTextInJSX",data:{text:n}})}}}}),Ut={name:lr,rule:Cs};var _e=require("@typescript-eslint/utils"),As=_e.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),cr="no-non-camel-case-functions",Is=/^(\$?[a-z][a-zA-Z0-9]*)$/;function pr(e){if(e.typeName.type!==_e.AST_NODE_TYPES.TSQualifiedName)return!1;let{left:t,right:r}=e.typeName;return t.type===_e.AST_NODE_TYPES.Identifier&&t.name==="JSX"&&r.name==="Element"}var ws=As({name:cr,meta:{type:"suggestion",docs:{description:"Enforce camelCase naming convention for function declarations"},schema:[],messages:{nonCamelCaseFunction:'Function name "{{functionName}}" should be in camelCase format. If this fn is a React component and can\'t use the `FC` type, add a explicit "JSX.Element" return type to it'}},defaultOptions:[],create(e){return{FunctionDeclaration(t){if(t.id&&!Is.test(t.id.name)){let r=t.returnType?.typeAnnotation;if(r&&(r.type===_e.AST_NODE_TYPES.TSTypeReference?pr(r):r.type===_e.AST_NODE_TYPES.TSUnionType&&r.types.some(s=>s.type===_e.AST_NODE_TYPES.TSTypeReference&&pr(s))))return;e.report({node:t.id,messageId:"nonCamelCaseFunction",data:{functionName:t.id.name}})}}}}}),zt={name:cr,rule:ws};var q=require("@typescript-eslint/utils");var Rs=q.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),ur="no-optional-root-props",Ps=Rs({name:ur,meta:{type:"problem",docs:{description:"Prevents usage of optional properties at the root of a type if that type is a local type alias or interface referenced only once"},messages:{optionalNotAllowed:'Optional property "{{ propertyName }}" is not allowed on a local type used only once. Use `prop: undefined | ...` instead.',suggestion:"Use `prop: undefined | ...` instead."},hasSuggestions:!0,schema:[]},defaultOptions:[],create(e){function t(n){let o=e.sourceCode.getDeclaredVariables(n)[0];if(!o||o.references.length!==1)return!1;let i=o.references[0];if(!i)return!1;for(let p of Nt(i.identifier)){if("returnType"in p||p.type===q.TSESTree.AST_NODE_TYPES.ExportNamedDeclaration)return!1;let a=p.parent;if(!a)return!1;if(a.type===q.TSESTree.AST_NODE_TYPES.TSTypeParameterInstantiation&&a.parent.type===q.TSESTree.AST_NODE_TYPES.TSTypeReference&&a.parent.typeName.type===q.TSESTree.AST_NODE_TYPES.Identifier&&a.parent.typeName.name==="FC"){let g=He(a.parent.parent,q.TSESTree.AST_NODE_TYPES.VariableDeclaration,4);if(!g)return!1;let S=mt(g,e.sourceCode);return S?!(S.parent.type===q.TSESTree.AST_NODE_TYPES.CallExpression&&S.parent.callee.type===q.TSESTree.AST_NODE_TYPES.Identifier&&S.parent.callee.name==="memo"):!1}if(p.type===q.TSESTree.AST_NODE_TYPES.AssignmentPattern)return!1;if(a.type===q.TSESTree.AST_NODE_TYPES.ArrowFunctionExpression){let c=He(a,q.TSESTree.AST_NODE_TYPES.VariableDeclaration);return c?!!mt(c,e.sourceCode):!1}if(a.type===q.TSESTree.AST_NODE_TYPES.FunctionDeclaration)return!!mt(a,e.sourceCode)}return!1}function r(n){n.key.type!==q.TSESTree.AST_NODE_TYPES.Identifier||!n.optional||e.report({node:n.key,messageId:"optionalNotAllowed",data:{propertyName:n.key.name},suggest:[{messageId:"suggestion",fix:s=>{let o=He(n,q.TSESTree.AST_NODE_TYPES.TSPropertySignature);if(!o)return null;let i=e.sourceCode.getText(o);return s.replaceText(o,i.replace("?:",": undefined |"))}}]})}return{TSTypeAliasDeclaration(n){if(n.typeAnnotation.type===q.TSESTree.AST_NODE_TYPES.TSTypeLiteral&&!(yt(n)||!t(n)))for(let s of n.typeAnnotation.members)s.type===q.TSESTree.AST_NODE_TYPES.TSPropertySignature&&r(s)},TSInterfaceDeclaration(n){if(!(yt(n)||!t(n)))for(let s of n.body.body)s.type===q.TSESTree.AST_NODE_TYPES.TSPropertySignature&&r(s)},TSTypeReference(n){if(n.typeName.type!==q.TSESTree.AST_NODE_TYPES.Identifier||n.typeName.name!=="FC"||!n.typeArguments?.params[0])return;let s=n.typeArguments.params[0];if(s.type!==q.TSESTree.AST_NODE_TYPES.TSTypeLiteral)return;let o=He(n.parent,q.TSESTree.AST_NODE_TYPES.VariableDeclaration,4);if(!o)return;let i=mt(o,e.sourceCode);if(!(!i||i.parent.type===q.TSESTree.AST_NODE_TYPES.CallExpression&&i.parent.callee.type===q.TSESTree.AST_NODE_TYPES.Identifier&&i.parent.callee.name==="memo"))for(let a of s.members)a.type===q.TSESTree.AST_NODE_TYPES.TSPropertySignature&&r(a)}}}});function yt(e){return e?e.parent?.type===q.TSESTree.AST_NODE_TYPES.ExportNamedDeclaration||e.parent?.type===q.TSESTree.AST_NODE_TYPES.ExportDefaultDeclaration:!1}function mt(e,t){if(yt(e))return;let r;if(e.type===q.TSESTree.AST_NODE_TYPES.VariableDeclaration){if(e.declarations.length!==1)return;e.declarations[0].id.type===q.TSESTree.AST_NODE_TYPES.Identifier&&(r=e.declarations[0].id)}else{if(!e.id)return;r=e.id}if(!r)return;let n=t.getScope(e);e.type===q.TSESTree.AST_NODE_TYPES.FunctionDeclaration&&n.upper&&(n=n.upper);let s=n.variables.find(i=>i.identifiers.includes(r));if(!s)return;let o=s.references.filter(i=>i.identifier!==r);if(!(o.length!==1||!o[0])&&!yt(o[0].identifier.parent.parent))return o[0].identifier}var Wt={name:ur,rule:Ps};var Qe=require("@typescript-eslint/utils");var et=_({name:"no-reexport",meta:{type:"problem",docs:{description:"Disallow re-exports to prevent indirection"},schema:[],messages:{noReexport:"Re-exports are not allowed. Use direct exports only."}},defaultOptions:[],create(e){let t=new Set;function r(n){return n?n.type===Qe.AST_NODE_TYPES.Identifier?t.has(n.name):n.type===Qe.AST_NODE_TYPES.MemberExpression?r(n.object):!1:!1}return{ImportDeclaration(n){for(let s of n.specifiers)t.add(s.local.name)},ExportNamedDeclaration(n){if(n.source){e.report({node:n,messageId:"noReexport"});return}if(n.declaration?.type===Qe.AST_NODE_TYPES.VariableDeclaration)for(let s of n.declaration.declarations)r(s.init)&&e.report({node:n,messageId:"noReexport"});n.specifiers.length>0&&e.report({node:n,messageId:"noReexport"})},ExportDefaultDeclaration(n){n.declaration.type===Qe.AST_NODE_TYPES.Identifier&&t.has(n.declaration.name)&&e.report({node:n,messageId:"noReexport"})},ExportAllDeclaration(n){e.report({node:n,messageId:"noReexport"})}}}});var fr=require("@typescript-eslint/utils"),dt=xe(require("path")),Ne=require("zod/v4");var vs=fr.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),mr="no-relative-imports",ks=Ne.z.object({find:Ne.z.string(),replacement:Ne.z.string()}),Fs=Ne.z.object({aliases:Ne.z.array(ks),rootDir:Ne.z.string().optional(),allowNotFoundAliases:Ne.z.boolean().optional(),_dev_simulateFileName:Ne.z.string().optional()}),Os=vs({name:mr,meta:{type:"problem",fixable:"code",docs:{description:"Prevent relative imports and auto-fix them using configured aliases"},messages:{noRelativeImports:"Relative imports are not allowed. Use one of the valid aliases in tsconfig.json instead.",noRelativeImportsWithAlias:'Relative imports are not allowed. Use the "{{ alias }}" alias instead.'},schema:[$(Fs)]},defaultOptions:[{aliases:[],rootDir:void 0}],create(e,[t]){let r=t._dev_simulateFileName??e.filename;function n(i){return i.startsWith(".")||i.startsWith("..")}function s(i,p){let a=dt.default.dirname(p);return dt.default.resolve(a,i)}function o(i){let p=t.rootDir??process.cwd(),a=dt.default.relative(p,i);if(a.startsWith("."))return null;a.startsWith("/")||(a=`/${a}`);for(let{find:c,replacement:g}of t.aliases)if(a.startsWith(g)){let S=a.replace(g,c);return{alias:c,newPath:S}}return null}return{ImportDeclaration(i){let p=i.source.value;if(!n(p))return;let a=s(p,r),c=o(a);!c&&t.allowNotFoundAliases||e.report({node:i,messageId:c?"noRelativeImportsWithAlias":"noRelativeImports",data:{alias:c?.alias},fix:c?g=>g.replaceText(i.source,`'${c.newPath}'`):void 0})}}}}),Jt={name:mr,rule:Os};var ie=require("@typescript-eslint/utils"),Vt=require("zod/v4");var Ns=Vt.z.object({customMessage:Vt.z.string().optional()}),Xt=_({name:"no-static-style-prop",meta:{type:"problem",docs:{description:"Prevent using static style props in JSX, only dynamic values should be allowed"},schema:[$(Ns)],messages:{noStaticStyleProp:"Static style props are not allowed use css instead.{{customMessage}}"}},defaultOptions:[{}],create(e,[t]){function r(n){switch(n.type){case ie.AST_NODE_TYPES.Literal:return!0;case ie.AST_NODE_TYPES.ObjectExpression:return n.properties.every(s=>s.type===ie.AST_NODE_TYPES.Property?s.computed||s.value.type===ie.AST_NODE_TYPES.Identifier&&s.key.type===ie.AST_NODE_TYPES.Identifier&&s.key.name===s.value.name?!1:r(s.value):!1);case ie.AST_NODE_TYPES.ArrayExpression:return n.elements.every(s=>s?s.type===ie.AST_NODE_TYPES.SpreadElement?!1:r(s):!0);case ie.AST_NODE_TYPES.TemplateLiteral:return n.expressions.length===0;case ie.AST_NODE_TYPES.ConditionalExpression:case ie.AST_NODE_TYPES.LogicalExpression:case ie.AST_NODE_TYPES.BinaryExpression:case ie.AST_NODE_TYPES.UnaryExpression:case ie.AST_NODE_TYPES.CallExpression:case ie.AST_NODE_TYPES.MemberExpression:case ie.AST_NODE_TYPES.Identifier:case ie.AST_NODE_TYPES.ArrowFunctionExpression:case ie.AST_NODE_TYPES.FunctionExpression:return!1;default:return!1}}return{JSXAttribute(n){if(n.name.type===ie.AST_NODE_TYPES.JSXIdentifier&&n.name.name==="style"&&n.value){let s=null;n.value.type===ie.AST_NODE_TYPES.JSXExpressionContainer?n.value.expression.type!==ie.AST_NODE_TYPES.JSXEmptyExpression&&(s=n.value.expression):n.value.type===ie.AST_NODE_TYPES.Literal&&(s=n.value),s&&r(s)&&e.report({node:n,messageId:"noStaticStyleProp",data:{customMessage:t.customMessage?` ${t.customMessage}`:""}})}}}}});var tt=require("@typescript-eslint/utils"),Je=xe(require("zod/v4"));var Ds=Je.object({alternativeMsgs:Je.object({inArrayFind:Je.string().optional(),inArrayFilter:Je.string().optional()}).optional(),__dev_simulateFileName:Je.string().optional()});function js(e){return e.typeAnnotation.type!==tt.AST_NODE_TYPES.TSTypePredicate?!1:e.typeAnnotation.asserts===!1}var Ls=/(typeGuards|type-guards)\.(ts|tsx)$/;function Ms(e){return Ls.test(e)}function $s(e){let t=e.parent;for(;t;){if(t.type===tt.AST_NODE_TYPES.CallExpression&&t.callee.type===tt.AST_NODE_TYPES.MemberExpression&&t.callee.property.type===tt.AST_NODE_TYPES.Identifier){let r=t.callee.property.name;if(r==="filter"||r==="find")return{method:r}}t=t.parent}return null}var Ht=_({name:"no-type-guards",meta:{type:"problem",docs:{description:"Disallow type guards unless in *.typeGuards.(ts|tsx) or *.type-guards.(ts|tsx) files"},messages:{typeGuardNotAllowed:"Check if the type guard can be inferred by typescript, in most cases it can, e.g. `.filter((nullable) => nullable !== null)`. If not, type guards are only allowed in *.typeGuards.(ts|tsx) or *.type-guards.(ts|tsx) files",useFilterWithTypeCheck:"{{message}}",useFindWithTypeCheck:"{{message}}"},schema:[$(Ds)],hasSuggestions:!0},defaultOptions:[{}],create(e,[t]){let r=t.__dev_simulateFileName??e.filename;if(Ms(r))return{};function n(s){if(!js(s))return;let o=$s(s);if(t.alternativeMsgs&&o){let i=o.method==="filter"?t.alternativeMsgs.inArrayFilter:t.alternativeMsgs.inArrayFind;if(i){let p=o.method==="filter"?"useFilterWithTypeCheck":"useFindWithTypeCheck";e.report({node:s,messageId:p,data:{message:i}});return}}e.report({node:s,messageId:"typeGuardNotAllowed"})}return{"FunctionDeclaration > :matches(TSTypeAnnotation)":n,"ArrowFunctionExpression > :matches(TSTypeAnnotation)":n,"MethodDefinition > FunctionExpression > :matches(TSTypeAnnotation)":n}}});var Ve=require("@typescript-eslint/utils");var _s="no-unnecessary-async-on-jsx-props";function Us(e){if(e.body.type!==Ve.AST_NODE_TYPES.BlockStatement)return!1;let t=e.body.body;if(t.length!==1)return!1;let r=t[0];return!r||r.type!==Ve.AST_NODE_TYPES.ExpressionStatement?!1:r.expression.type===Ve.AST_NODE_TYPES.AwaitExpression}var Bt=_({name:_s,meta:{type:"suggestion",fixable:"code",docs:{description:"Disallow unnecessary async/await in JSX props where a single await provides no benefit"},messages:{unnecessaryAsyncInJsxProp:"Unnecessary async/await in JSX prop. The single await expression provides no benefit here."},schema:[]},defaultOptions:[],create(e){function t(r){Us(r)&&e.report({node:r,messageId:"unnecessaryAsyncInJsxProp",fix(n){let s=e.sourceCode,o=[],i=s.getFirstToken(r,a=>a.value==="async");if(i){let a=s.getTokenAfter(i);a?o.push(n.replaceTextRange([i.range[0],a.range[0]],"")):o.push(n.remove(i))}function p(a){if(a.type===Ve.AST_NODE_TYPES.AwaitExpression){let c=s.getFirstToken(a);if(c&&c.value==="await"){let g=s.getTokenAfter(c);g?o.push(n.replaceTextRange([c.range[0],g.range[0]],"")):o.push(n.remove(c))}}if(a.type===Ve.AST_NODE_TYPES.BlockStatement)for(let c of a.body)p(c);else a.type===Ve.AST_NODE_TYPES.ExpressionStatement&&p(a.expression)}return p(r.body),o}})}return{"JSXAttribute ArrowFunctionExpression[async=true]":t,"JSXAttribute FunctionExpression[async=true]":t}}});var De=require("@typescript-eslint/utils"),Yt=xe(require("typescript")),Ye=xe(require("zod/v4"));var zs=De.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),yr="no-unnecessary-casting",Ws=Ye.default.object({additionalCastFunctions:Ye.default.array(Ye.default.object({name:Ye.default.string(),expectedType:Ye.default.enum(["string","number"])})).optional()}),qt={name:yr,rule:zs({name:yr,meta:{type:"suggestion",docs:{description:"Prevents unnecessary Number and String castings"},messages:{unnecessaryNumberCasting:"Unnecessary Number() casting on a value already of number type",unnecessaryStringCasting:"Unnecessary String() casting on a value already of string type",unnecessaryCustomCasting:"Unnecessary {{name}}() casting on a value already of {{type}} type"},schema:[$(Ws)],fixable:"code"},defaultOptions:[{}],create(e){let r=e.options[0].additionalCastFunctions||[],n=[{name:"Number",expectedType:"number"},{name:"String",expectedType:"string"},...r],s=De.ESLintUtils.getParserServices(e,!0),o=s.program?.getTypeChecker();if(!o||!s.program)throw new Error("TypeScript services or program not available");function i(g,S){switch(g.type){case De.AST_NODE_TYPES.Literal:return S==="number"?typeof g.value=="number":typeof g.value=="string";case De.AST_NODE_TYPES.TemplateLiteral:return S==="string";case De.AST_NODE_TYPES.UnaryExpression:return S==="number"?g.operator==="+"||g.operator==="-"||g.operator==="~":!1;default:return!1}}function p(g,S){return S==="number"?!!(g.flags&Yt.TypeFlags.NumberLike):!!(g.flags&Yt.TypeFlags.StringLike)}function a(g,S){return l=>l.replaceText(g,e.sourceCode.getText(S))}function c(g){if(!o||g.arguments.length!==1)return;let S=g.arguments[0];if(!S||S.type===De.AST_NODE_TYPES.SpreadElement)return;let{callee:l}=g;if(l.type!==De.AST_NODE_TYPES.Identifier)return;let E=l.name,f=n.find(T=>T.name===E);if(!f)return;if(i(S,f.expectedType)||p(o.getTypeAtLocation(s.esTreeNodeToTSNodeMap.get(S)),f.expectedType)){let T,m;E==="Number"?T="unnecessaryNumberCasting":E==="String"?T="unnecessaryStringCasting":(T="unnecessaryCustomCasting",m={name:f.name,type:f.expectedType}),e.report({node:g,messageId:T,...m?{data:m}:{},fix:a(g,S)})}}return{CallExpression:c}}})};var ge=require("@typescript-eslint/utils"),gt=xe(require("zod/v4"));var Js=gt.object({ignoreWithDescription:gt.string().optional()}),Zt=_({name:"no-unnecessary-describe",meta:{type:"suggestion",docs:{description:"Disallow unnecessary describe blocks that wrap all tests in a file"},messages:{unnecessaryDescribe:"Describe blocks that solely wrap all tests in the file are unnecessary, they just add unnecessary nesting to the code. The file itself should be enough to group tests. Remove it.",removeDescribe:"Remove the describe block"},hasSuggestions:!0,schema:[$(Js)]},defaultOptions:[{}],create(e,[t]){let r=e.getSourceCode(),n=r.ast;function s(a){let c=a.arguments[0];return c&&c.type===ge.AST_NODE_TYPES.Literal&&typeof c.value=="string"?c.value:null}function o(a){return!a||!t.ignoreWithDescription?!1:new RegExp(t.ignoreWithDescription).test(a)}function i(a){return a.length!==1?!1:n.body.filter(g=>{if(g.type===ge.AST_NODE_TYPES.ExpressionStatement){let S=g.expression;if(S.type===ge.AST_NODE_TYPES.CallExpression&&S.callee.type===ge.AST_NODE_TYPES.Identifier){let l=S.callee.name;return["test","it","beforeEach","afterEach","beforeAll","afterAll"].includes(l)}}return!1}).length===0}function p(a){let c=a.arguments[1];if(c&&(c.type===ge.AST_NODE_TYPES.FunctionExpression||c.type===ge.AST_NODE_TYPES.ArrowFunctionExpression)&&c.body.type===ge.AST_NODE_TYPES.BlockStatement){let g=c.body.body;return g.length===0?"":g.map(l=>r.text.slice(l.range[0],l.range[1])).join(`
15
+ Learn more about data fetching with Hooks: https://reactjs.org/link/hooks-data-fetching`});let u=a.acquire(m),d=new Set,A=null;{let w=u.upper;for(;w&&(d.add(w),w.type!=="function");)w=w.upper;if(!w)return;A=w}let I=Array.isArray;function R(w){if(!I(w.defs))return!1;let P=w.defs[0];if(P==null||P.node.type!=="VariableDeclarator")return!1;let O=P.node.init;if(O==null)return!1;for(;O.type==="TSAsExpression";)O=O.expression;let D=P.node.parent;if(D==null&&(kt(A.block,P.node.id),D=P.node.parent,D==null))return!1;if(D.kind==="const"&&O.type==="Literal"&&(typeof O.value=="string"||typeof O.value=="number"||O.value===null))return!0;if(O.type!=="CallExpression")return!1;let M=O.callee;if(M.type==="MemberExpression"&&M.object.name==="React"&&M.property!=null&&!M.computed&&(M=M.property),M.type!=="Identifier")return!1;let L=P.node.id,{name:z}=M;if(z==="useRef"&&L.type==="Identifier")return!0;if(Ii(M)&&L.type==="Identifier"){for(let W of w.references)W!==L&&E.add(W.identifier);return!0}else if(z==="useState"||z==="useReducer"){if(L.type==="ArrayPattern"&&L.elements.length===2&&I(w.identifiers)){if(L.elements[1]===w.identifiers[0]){if(z==="useState"){let W=w.references,he=0;for(let ke=0;ke<W.length;ke++){if(W[ke].isWrite()&&he++,he>1)return!1;c.set(W[ke].identifier,L.elements[0])}}return!0}else if(L.elements[0]===w.identifiers[0]){if(z==="useState"){let W=w.references;for(let he=0;he<W.length;he++)g.add(W[he].identifier)}return!1}}}else if(z==="useTransition"&&L.type==="ArrayPattern"&&L.elements.length===2&&Array.isArray(w.identifiers)&&L.elements[1]===w.identifiers[0])return!0;return!1}function F(w){if(!I(w.defs))return!1;let P=w.defs[0];if(P==null||P.node==null||P.node.id==null)return!1;let O=P.node,D=A.childScopes,M=null,L;for(L=0;L<D.length;L++){let z=D[L],W=z.block;if(O.type==="FunctionDeclaration"&&W===O||O.type==="VariableDeclarator"&&W.parent===O){M=z;break}}if(M==null)return!1;for(L=0;L<M.through.length;L++){let z=M.through[L];if(z.resolved!=null&&d.has(z.resolved.scope)&&!J(z.resolved))return!1}return!0}let J=f(R,S),Z=f(F,l),ne=new Map;function te(w){let P=w.from,O=!1;for(;P.block!==m;)P.type==="function"&&(O=P.block.parent!=null&&P.block.parent.type==="ReturnStatement"),P=P.upper;return O}let V=new Map,de=new Map;Ae(u);function Ae(w){for(let P of w.references){if(!P.resolved||!d.has(P.resolved.scope))continue;let O=kt(m,P.identifier),D=Bn(O),M=Oe(D,de);if(x&&D.type==="Identifier"&&(D.parent.type==="MemberExpression"||D.parent.type==="OptionalMemberExpression")&&!D.parent.computed&&D.parent.property.type==="Identifier"&&D.parent.property.name==="current"&&te(P)&&ne.set(M,{reference:P,dependencyNode:D}),D.parent.type==="TSTypeQuery"||D.parent.type==="TSTypeReference")continue;let L=P.resolved.defs[0];if(L!=null&&!(L.node!=null&&L.node.init===m.parent)&&L.type!=="TypeParameter")if(V.has(M))V.get(M).references.push(P);else{let z=P.resolved,W=J(z)||Z(z);V.set(M,{isStable:W,references:[P]})}}for(let P of w.childScopes)Ae(P)}ne.forEach(({reference:w,dependencyNode:P},O)=>{let D=w.resolved.references,M=!1;for(let L=0;L<D.length;L++){let{identifier:z}=D[L],{parent:W}=z;if(W!=null&&W.type==="MemberExpression"&&!W.computed&&W.property.type==="Identifier"&&W.property.name==="current"&&W.parent.type==="AssignmentExpression"&&W.parent.left===W){M=!0;break}}M||p({node:P.parent.property,message:`The ref value '${O}.current' will likely have changed by the time this effect cleanup function runs. If this ref points to a node rendered by React, copy '${O}.current' to a variable inside the effect, and use that variable in the cleanup function.`})});let ue=new Set;function Ie(w,P){ue.has(P)||(ue.add(P),p({node:w,message:`Assignments to the '${P}' variable from inside React Hook ${r(C)} will be lost after each render. To preserve the value over time, store it in a useRef Hook and keep the mutable value in the '.current' property. Otherwise, you can move this variable directly inside ${r(C)}.`}))}let Te=new Set;if(V.forEach(({isStable:w,references:P},O)=>{w&&Te.add(O),P.forEach(D=>{D.writeExpr&&Ie(D.writeExpr,O)})}),ue.size>0)return;if(!b){let w=null;if(V.forEach(({isStable:P,references:O},D)=>{w||O.forEach(M=>{if(w)return;let L=M.identifier;if(!c.has(L))return;let W=M.from;for(;W.type!=="function";)W=W.upper;W.block===m&&(w=D)})}),w){let{suggestedDependencies:P}=vt({dependencies:V,declaredDependencies:[],stableDependencies:Te,externalDependencies:new Set,isEffect:!0});p({node:C,message:`React Hook ${y} contains a call to '${w}'. Without a list of dependencies, this can lead to an infinite chain of updates. To fix this, pass [`+P.join(", ")+`] as a second argument to the ${y} Hook.`,suggest:[{desc:`Add dependencies array: [${P.join(", ")}]`,fix(O){return O.insertTextAfter(m,`, [${P.join(", ")}]`)}}]})}return}let ze=[],Ke=new Set;b.type!=="ArrayExpression"?p({node:b,message:`React Hook ${r(C)} was passed a dependency list that is not an array literal. This means we can't statically verify whether you've passed the correct dependencies.`}):b.elements.forEach(w=>{if(w===null)return;if(w.type==="SpreadElement"){p({node:w,message:`React Hook ${r(C)} has a spread element in its dependency array. This means we can't statically verify whether you've passed the correct dependencies.`});return}E.has(w)&&p({node:w,message:`Functions returned from \`useEffectEvent\` must not be included in the dependency array. Remove \`${r(w)}\` from the list.`,suggest:[{desc:`Remove the dependency \`${r(w)}\``,fix(M){return M.removeRange(w.range)}}]});let P;try{P=Oe(w,de)}catch(M){if(/Unsupported node type/.test(M.message)){w.type==="Literal"?V.has(w.value)?p({node:w,message:`The ${w.raw} literal is not a valid dependency because it never changes. Did you mean to include ${w.value} in the array instead?`}):p({node:w,message:`The ${w.raw} literal is not a valid dependency because it never changes. You can safely remove it.`}):p({node:w,message:`React Hook ${r(C)} has a complex expression in the dependency array. Extract it to a separate variable so it can be statically checked.`});return}else throw M}let O=w;for(;O.type==="MemberExpression"||O.type==="OptionalMemberExpression"||O.type==="ChainExpression";)O=O.object||O.expression.object;let D=!A.through.some(M=>M.identifier===O);ze.push({key:P,node:w}),D||Ke.add(P)});let{suggestedDependencies:ni,unnecessaryDependencies:ot,missingDependencies:Le,duplicateDependencies:jn}=vt({dependencies:V,declaredDependencies:ze,stableDependencies:Te,externalDependencies:Ke,isEffect:x}),at=ni;if(jn.size+Le.size+ot.size===0){if(t)return;bi({declaredDependencies:ze,declaredDependenciesNode:b,componentScope:A,scope:u}).forEach(({construction:P,isUsedOutsideOfHook:O,depType:D})=>{let M=D==="function"?"useCallback":"useMemo",L=D==="function"?"definition":"initialization",z=`wrap the ${L} of '${P.name.name}' in its own ${M}() Hook.`,W=O?`To fix this, ${z}`:`Move it inside the ${y} callback. Alternatively, ${z}`,he=D==="conditional"||D==="logical expression"?"could make":"makes",ke=`The '${P.name.name}' ${D} ${he} the dependencies of ${y} Hook (at line ${b.loc.start.line}) change on every render. ${W}`,Ln;O&&P.type==="Variable"&&D==="function"&&(Ln=[{desc:`Wrap the ${L} of '${P.name.name}' in its own ${M}() Hook.`,fix(Mn){let[ii,si]=M==="useMemo"?["useMemo(() => { return ","; })"]:["useCallback(",")"];return[Mn.insertTextBefore(P.node.init,ii),Mn.insertTextAfter(P.node.init,si)]}}]),p({node:P.node,message:ke,suggest:Ln})});return}!x&&Le.size>0&&(at=vt({dependencies:V,declaredDependencies:[],stableDependencies:Te,externalDependencies:Ke,isEffect:x}).suggestedDependencies);function ri(){if(ze.length===0)return!0;let w=ze.map(O=>O.key),P=w.slice().sort();return w.join(",")===P.join(",")}ri()&&at.sort();function At(w){let P=w.split("."),O="";for(let D=0;D<P.length;D++){if(D!==0){let M=P.slice(0,D+1).join("."),L=de.get(M)===!0;O+=L?"?.":"."}O+=P[D]}return O}function It(w,P,O,D){return w.size===0?null:(w.size>1?"":P+" ")+O+" "+(w.size>1?"dependencies":"dependency")+": "+Ci(Array.from(w).sort().map(M=>"'"+At(M)+"'"))+`. Either ${D} ${w.size>1?"them":"it"} or remove the dependency array.`}let be="";if(ot.size>0){let w=null;if(Array.from(ot.keys()).forEach(P=>{w===null&&P.endsWith(".current")&&(w=P)}),w!==null)be=` Mutable values like '${w}' aren't valid dependencies because mutating them doesn't re-render the component.`;else if(Ke.size>0){let P=Array.from(Ke)[0];u.set.has(P)||(be=` Outer scope values like '${P}' aren't valid dependencies because mutating them doesn't re-render the component.`)}}if(!be&&Le.has("props")){let w=V.get("props");if(w==null)return;let P=w.references;if(!Array.isArray(P))return;let O=!0;for(let D=0;D<P.length;D++){let M=P[D],L=kt(A.block,M.identifier);if(!L){O=!1;break}let z=L.parent;if(z==null){O=!1;break}if(z.type!=="MemberExpression"&&z.type!=="OptionalMemberExpression"){O=!1;break}}O&&(be=` However, 'props' will change when *any* prop changes, so the preferred fix is to destructure the 'props' object outside of the ${y} call and refer to those specific props inside ${r(C)}.`)}if(!be&&Le.size>0){let w=null;Le.forEach(P=>{if(w)return;let O=A.set.get(P),D=V.get(P);if(D.references[0].resolved!==O)return;let M=O.defs[0];if(M==null||M.name==null||M.type!=="Parameter")return;let L=!1,z;for(let W=0;W<D.references.length;W++)if(z=D.references[W].identifier,z!=null&&z.parent!=null&&(z.parent.type==="CallExpression"||z.parent.type==="OptionalCallExpression")&&z.parent.callee===z){L=!0;break}L&&(w=P)}),w!==null&&(be=` If '${w}' changes too often, find the parent component that defines it and wrap that definition in useCallback.`)}if(!be&&Le.size>0){let w=null;if(Le.forEach(P=>{if(w!==null)return;let D=V.get(P).references,M,L;for(let z=0;z<D.length;z++){for(M=D[z].identifier,L=M.parent;L!=null&&L!==A.block;){if(L.type==="CallExpression"){let W=c.get(L.callee);if(W!=null){if(W.name===P)w={missingDep:P,setter:L.callee.name,form:"updater"};else if(g.has(M))w={missingDep:P,setter:L.callee.name,form:"reducer"};else{let he=D[z].resolved;if(he!=null){let ke=he.defs[0];ke!=null&&ke.type==="Parameter"&&(w={missingDep:P,setter:L.callee.name,form:"inlineReducer"})}}break}}L=L.parent}if(w!==null)break}}),w!==null)switch(w.form){case"reducer":be=` You can also replace multiple useState variables with useReducer if '${w.setter}' needs the current value of '${w.missingDep}'.`;break;case"inlineReducer":be=` If '${w.setter}' needs the current value of '${w.missingDep}', you can also switch to useReducer instead of useState and read '${w.missingDep}' in the reducer.`;break;case"updater":be=` You can also do a functional update '${w.setter}(${w.missingDep.slice(0,1)} => ...)' if you only need '${w.missingDep}' in the '${w.setter}' call.`;break;default:throw new Error("Unknown case.")}}p({node:b,message:`React Hook ${r(C)} has `+(It(Le,"a","missing","include")||It(ot,"an","unnecessary","exclude")||It(jn,"a","duplicate","omit"))+be,suggest:[{desc:`Update the dependencies array to be: [${at.map(At).join(", ")}]`,fix(w){return w.replaceText(b,`[${at.map(At).join(", ")}]`)}}]})}function T(m){let b=xi(m.callee,i);if(b===-1)return;let C=m.arguments[b],y=m.callee,x=Yn(y).name,u=m.arguments[b+1],d=/Effect($|[^a-z])/g.test(x);if(!C){p({node:y,message:`React Hook ${x} requires an effect callback. Did you forget to pass a callback to the hook?`});return}if(!(t&&!d)){if(!u&&!d){(x==="useMemo"||x==="useCallback")&&p({node:y,message:`React Hook ${x} does nothing when called with only one argument. Did you forget to pass an array of dependencies?`});return}switch(C.type){case"FunctionExpression":case"ArrowFunctionExpression":h(C,u,y,x,d);return;case"Identifier":if(!u||u.elements&&u.elements.some(R=>R&&R.type==="Identifier"&&R.name===C.name))return;let A=n(m).set.get(C.name);if(A==null||A.defs==null)return;let I=A.defs[0];if(!I||!I.node||I.type!=="Variable"&&I.type!=="FunctionName")break;switch(I.node.type){case"FunctionDeclaration":h(I.node,u,y,x,d);return;case"VariableDeclarator":let R=I.node.init;if(!R)break;switch(R.type){case"ArrowFunctionExpression":case"FunctionExpression":h(R,u,y,x,d);return}break}break;default:p({node:y,message:`React Hook ${x} received a function whose dependencies are unknown. Pass an inline function instead.`});return}p({node:y,message:`React Hook ${x} has a missing dependency: '${C.name}'. Either include it or remove the dependency array.`,suggest:[{desc:`Update the dependencies array to be: [${C.name}]`,fix(A){return A.replaceText(u,`[${C.name}]`)}}]})}}if(e.options[0]?.ignoreIfReactCompilerIsEnabled){for(let m of e.sourceCode.getAllComments())if(Ei.test(m.value))return t=!0,{CallExpression:b=>T(b,!0)}}return{CallExpression:m=>T(m)}}};function vt({dependencies:e,declaredDependencies:t,stableDependencies:r,externalDependencies:n,isEffect:s}){let o=i();function i(){return{isUsed:!1,isSatisfiedRecursively:!1,isSubtreeUsed:!1,children:new Map}}e.forEach((h,T)=>{let m=p(o,T);m.isUsed=!0,a(o,T,b=>{b.isSubtreeUsed=!0})}),t.forEach(({key:h})=>{let T=p(o,h);T.isSatisfiedRecursively=!0}),r.forEach(h=>{let T=p(o,h);T.isSatisfiedRecursively=!0});function p(h,T){let m=T.split("."),b=h;for(let C of m){let y=b.children.get(C);y||(y=i(),b.children.set(C,y)),b=y}return b}function a(h,T,m){let b=T.split("."),C=h;for(let y of b){let x=C.children.get(y);if(!x)return;m(x),C=x}}let c=new Set,g=new Set;S(o,c,g,h=>h);function S(h,T,m,b){h.children.forEach((C,y)=>{let x=b(y);if(C.isSatisfiedRecursively){C.isSubtreeUsed&&m.add(x);return}if(C.isUsed){T.add(x);return}S(C,T,m,u=>x+"."+u)})}let l=[],E=new Set,f=new Set;return t.forEach(({key:h})=>{g.has(h)?l.indexOf(h)===-1?l.push(h):f.add(h):E.add(h)}),c.forEach(h=>{l.push(h)}),{suggestedDependencies:l,unnecessaryDependencies:E,duplicateDependencies:f,missingDependencies:c}}function $e(e){switch(e.type){case"ObjectExpression":return"object";case"ArrayExpression":return"array";case"ArrowFunctionExpression":case"FunctionExpression":return"function";case"ClassExpression":return"class";case"ConditionalExpression":return $e(e.consequent)!=null||$e(e.alternate)!=null?"conditional":null;case"LogicalExpression":return $e(e.left)!=null||$e(e.right)!=null?"logical expression":null;case"JSXFragment":return"JSX fragment";case"JSXElement":return"JSX element";case"AssignmentExpression":return $e(e.right)!=null?"assignment expression":null;case"NewExpression":return"object construction";case"Literal":return e.value instanceof RegExp?"regular expression":null;case"TypeCastExpression":return $e(e.expression);case"TSAsExpression":return $e(e.expression)}return null}function bi({declaredDependencies:e,declaredDependenciesNode:t,componentScope:r,scope:n}){let s=e.map(({key:i})=>{let p=r.variables.find(c=>c.name===i);if(p==null)return null;let a=p.defs[0];if(a==null)return null;if(a.type==="Variable"&&a.node.type==="VariableDeclarator"&&a.node.id.type==="Identifier"&&a.node.init!=null){let c=$e(a.node.init);if(c!=null)return[p,c]}return a.type==="FunctionName"&&a.node.type==="FunctionDeclaration"?[p,"function"]:a.type==="ClassName"&&a.node.type==="ClassDeclaration"?[p,"class"]:null}).filter(Boolean);function o(i){let p=!1;for(let a=0;a<i.references.length;a++){let c=i.references[a];if(c.writeExpr){if(p)return!0;p=!0;continue}let g=c.from;for(;g!==n&&g!=null;)g=g.upper;if(g!==n&&!qn(t,c.identifier))return!0}return!1}return s.map(([i,p])=>({construction:i.defs[0],depType:p,isUsedOutsideOfHook:o(i)}))}function Bn(e){return(e.parent.type==="MemberExpression"||e.parent.type==="OptionalMemberExpression")&&e.parent.object===e&&e.parent.property.name!=="current"&&!e.parent.computed&&!(e.parent.parent!=null&&(e.parent.parent.type==="CallExpression"||e.parent.parent.type==="OptionalCallExpression")&&e.parent.parent.callee===e.parent)?Bn(e.parent):e.type==="MemberExpression"&&e.parent&&e.parent.type==="AssignmentExpression"&&e.parent.left===e?e.object:e}function Ft(e,t,r){t&&(e.optional?t.has(r)||t.set(r,!0):t.has(r)||t.set(r,!1))}function Oe(e,t){if(e.type==="Identifier"||e.type==="JSXIdentifier"){let r=e.name;return t&&t.set(r,!1),r}else if(e.type==="MemberExpression"&&!e.computed){let r=Oe(e.object,t),n=Oe(e.property,null),s=`${r}.${n}`;return Ft(e,t,s),s}else if(e.type==="OptionalMemberExpression"&&!e.computed){let r=Oe(e.object,t),n=Oe(e.property,null),s=`${r}.${n}`;return Ft(e,t,s),s}else if(e.type==="ChainExpression"&&!e.computed){let r=e.expression;if(r.type==="CallExpression")throw new Error(`Unsupported node type: ${r.type}`);let n=Oe(r.object,t),s=Oe(r.property,null),o=`${n}.${s}`;return Ft(r,t,o),o}else throw new Error(`Unsupported node type: ${e.type}`)}function Yn(e,t){return e.type==="MemberExpression"&&e.object.type==="Identifier"&&e.object.name==="React"&&e.property.type==="Identifier"&&!e.computed?e.property:e}function xi(e,t){let r=Yn(e);if(r.type!=="Identifier")return-1;switch(r.name){case"useEffect":case"useLayoutEffect":case"useCallback":case"useMemo":return 0;case"useImperativeHandle":return 1;default:if(r===e&&t&&t.additionalHooks){let n;try{n=Oe(r,null)}catch(s){if(/Unsupported node type/.test(s.message))return 0;throw s}return t.additionalHooks.test(n)?0:-1}else return-1}}function kt(e,t){let r=[e],n=null;for(;r.length;){if(n=r.shift(),Ai(n,t))return n;if(qn(n,t))for(let[s,o]of Object.entries(n))s!=="parent"&&(Xn(o)?(o.parent=n,r.push(o)):Array.isArray(o)&&o.forEach(i=>{Xn(i)&&(i.parent=n,r.push(i))}))}return null}function Ci(e){let t="";for(let r=0;r<e.length;r++)t+=e[r],r===0&&e.length===2?t+=" and ":r===e.length-2&&e.length>2?t+=", and ":r<e.length-1&&(t+=", ");return t}function Xn(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&typeof e.type=="string"}function Ai(e,t){return(e.type==="Identifier"||e.type==="JSXIdentifier")&&e.type===t.type&&e.name===t.name&&e.range[0]===t.range[0]&&e.range[1]===t.range[1]}function qn(e,t){return e.range[0]<=t.range[0]&&e.range[1]>=t.range[1]}function Ii(e){return!1}var re=require("@typescript-eslint/utils"),ae=xe(require("typescript")),Qn=require("zod/v4");var Ot=require("@typescript-eslint/utils");function He(e,t,r=1/0){if(r!==0&&e.parent)return e.type===t?e:He(e.parent,t,r===1/0?r:r-1)}function*Nt(e){yield e,e.parent&&(yield*Nt(e.parent))}function Dt(e,t){for(let r of e){let n=t(r);if(n!=null&&n!==!1)return n}}function Gn(e,t,r){let s=r.getDeclaredVariables(e).find(o=>o.name===t||o.identifiers[0]?.parent.type===Ot.AST_NODE_TYPES.Property&&o.identifiers[0].parent.key.type===Ot.AST_NODE_TYPES.Identifier&&o.identifiers[0].parent.key.name===t);return s?s.references.filter(o=>!o.init):[]}function Zn(e){return e===null||typeof e!="object"||!("type"in e)?!1:typeof e.type=="string"}function wi(e,t){return e[t]}function we(e,t,r){let n=r.visitorKeys,s=new Set;function o(i){if(s.has(i))return!1;if(s.add(i),t(i)===!0)return!0;let a=n[i.type];if(a)for(let c of a){let g=wi(i,c);if(g){if(Array.isArray(g)){for(let S of g)if(Zn(S)&&o(S))return!0}else if(Zn(g)&&o(g))return!0}}return!1}o(e)}var Ri=re.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),Kn="improved-no-unnecessary-condition",Pi=Qn.z.object({}),vi=["string","number","bigint","boolean","symbol","undefined","object","function","never"],Fi=new Set(vi),jt={name:Kn,rule:Ri({name:Kn,meta:{type:"suggestion",docs:{description:"Extends checks of `no-unnecessary-condition` rule"},messages:{unnecessaryTypeofCondition:'This condition is unnecessary. The type of "{{name}}" is always "{{type}}".',alwaysFalseTypeofCondition:'This condition will always be false. The type of "{{name}}" is "{{actualType}}" so the condition has no overlap with "{{conditionType}}".',unnecessaryStartsWithCondition:"This startsWith check is unnecessary as it always evaluates to true.",alwaysFalseStartsWithCondition:"This startsWith check will always be false.",unnecessaryEndsWithCondition:"This endsWith check is unnecessary as it always evaluates to true.",alwaysFalseEndsWithCondition:"This endsWith check will always be false.",unnecessaryIncludesCondition:"This includes check is unnecessary as it always evaluates to true.",alwaysFalseIncludesCondition:"This includes check will always be false.",unnecessaryLengthCondition:"This length comparison is unnecessary as it always evaluates to true.",alwaysFalseLengthCondition:"This length comparison will always be false."},schema:[$(Pi)]},defaultOptions:[{}],create(e){let t=re.ESLintUtils.getParserServices(e,!0),r=t.program?.getTypeChecker();if(!r||!t.program)throw new Error("TypeScript services or program not available");function n(l){return l.type===re.AST_NODE_TYPES.UnaryExpression&&l.operator==="typeof"}function s(l){return l.flags&ae.default.TypeFlags.Any||l.flags&ae.default.TypeFlags.Unknown?null:l.flags&ae.default.TypeFlags.StringLike?["string"]:l.flags&ae.default.TypeFlags.NumberLike?["number"]:l.flags&ae.default.TypeFlags.BigIntLike?["bigint"]:l.flags&ae.default.TypeFlags.BooleanLike?["boolean"]:l.flags&ae.default.TypeFlags.ESSymbolLike?["symbol"]:l.flags&ae.default.TypeFlags.Undefined||l.flags&ae.default.TypeFlags.Void?["undefined"]:l.flags&ae.default.TypeFlags.Null?["object"]:l.getCallSignatures().length>0?["function"]:l.flags&ae.default.TypeFlags.Object?l.getProperties().length===0?["string","number","bigint","boolean","symbol","object","function"]:["object"]:l.flags&ae.default.TypeFlags.NonPrimitive?["object"]:l.flags&ae.default.TypeFlags.Never?["never"]:null}function o(l){if(!r)return null;let E=t.esTreeNodeToTSNodeMap.get(l),f=r.getTypeAtLocation(E.expression);if(f.flags&ae.default.TypeFlags.Any||f.flags&ae.default.TypeFlags.Unknown)return null;let h=[];if(f.isUnion()){for(let m of f.types){let b=s(m);if(b)h.push(...b);else return null}return h}let T=s(f);return T?(h.push(...T),h):null}function i(l){if(!(l.operator==="==="||l.operator==="!=="))return;let f=null,h=null;if(n(l.left)?(f=l.left,h=l.right.type===re.AST_NODE_TYPES.Literal&&typeof l.right.value=="string"?l.right.value:null):n(l.right)&&(f=l.right,h=l.left.type===re.AST_NODE_TYPES.Literal&&typeof l.left.value=="string"?l.left.value:null),!f||!h||!ki(h,Fi))return;let T=o(f);if(!T)return;let m=l.operator==="!==",b=T.includes(h);T.length===1?b&&!m?e.report({node:l,messageId:"unnecessaryTypeofCondition",data:{name:Be(f,e),type:h}}):!b&&m?e.report({node:l,messageId:"unnecessaryTypeofCondition",data:{name:Be(f,e),type:Array.from(T)[0]}}):!b&&!m?e.report({node:l,messageId:"alwaysFalseTypeofCondition",data:{name:Be(f,e),actualType:pt(T),conditionType:h}}):b&&m&&e.report({node:l,messageId:"alwaysFalseTypeofCondition",data:{name:Be(f,e),actualType:pt(T),conditionType:h}}):!b&&!m?e.report({node:l,messageId:"alwaysFalseTypeofCondition",data:{name:Be(f,e),actualType:pt(T),conditionType:h}}):!b&&m&&e.report({node:l,messageId:"unnecessaryTypeofCondition",data:{name:Be(f,e),type:pt(T)}})}function p(l){if(l.flags&ae.default.TypeFlags.Any||l.flags&ae.default.TypeFlags.Unknown)return null;if(l.isUnion()){let E=[];for(let f of l.types)if(f.flags&ae.default.TypeFlags.StringLiteral){let h=f.value;E.push(h)}else return null;return E}return l.flags&ae.default.TypeFlags.StringLiteral?[l.value]:null}function a(l){if(!r)return null;let E=t.esTreeNodeToTSNodeMap.get(l),f=r.getTypeAtLocation(E),h=p(f);if(h)return h;let T=r.getSymbolAtLocation(E);if(T){let m=r.getTypeOfSymbolAtLocation(T,E),b=p(m);if(b)return b}return null}function c(l){let E=e.sourceCode.ast,f=null;return we(E,h=>{if(h.type===re.AST_NODE_TYPES.VariableDeclarator&&h.id.type===re.AST_NODE_TYPES.Identifier&&h.id.name===l.name&&h.id.typeAnnotation){let T=h.id.typeAnnotation.typeAnnotation;if(T.type===re.AST_NODE_TYPES.TSUnionType){let m=[];for(let b of T.types)if(b.type===re.AST_NODE_TYPES.TSLiteralType&&b.literal.type===re.AST_NODE_TYPES.Literal&&typeof b.literal.value=="string")m.push(b.literal.value);else return!0;return f=m,!0}if(T.type===re.AST_NODE_TYPES.TSLiteralType&&T.literal.type===re.AST_NODE_TYPES.Literal&&typeof T.literal.value=="string")return f=[T.literal.value],!0}return!1},e.sourceCode),f}function g(l){if(l.callee.type!==re.AST_NODE_TYPES.MemberExpression||l.callee.property.type!==re.AST_NODE_TYPES.Identifier||l.callee.computed)return;let E=l.callee.property.name;if(E!=="startsWith"&&E!=="endsWith"&&E!=="includes"||l.arguments.length!==1)return;let[f]=l.arguments;if(!f||f.type!==re.AST_NODE_TYPES.Literal||typeof f.value!="string")return;let h=l.callee.object,T=a(h);if(!T&&h.type===re.AST_NODE_TYPES.Identifier&&(T=c(h)),!T||T.length===0)return;let m=f.value;if(E==="includes"&&T.length>1)return;let b=0,C=0;for(let y of T)if((E==="startsWith"?y.startsWith(m):E==="endsWith"?y.endsWith(m):y.includes(m))?b++:C++,b>0&&C>0)return;if(b>0&&C===0){let y=E==="startsWith"?"unnecessaryStartsWithCondition":E==="endsWith"?"unnecessaryEndsWithCondition":"unnecessaryIncludesCondition";e.report({node:l,messageId:y})}else if(C>0&&b===0){let y=E==="startsWith"?"alwaysFalseStartsWithCondition":E==="endsWith"?"alwaysFalseEndsWithCondition":"alwaysFalseIncludesCondition";e.report({node:l,messageId:y})}}function S(l){if(!new Set(["===","!==",">",">=","<","<="]).has(l.operator))return;function f(x){if(x.type!==re.AST_NODE_TYPES.MemberExpression||x.computed||x.property.type!==re.AST_NODE_TYPES.Identifier||x.property.name!=="length")return null;let u=x.object,d=a(u);if(!d||d.length===0)return null;let A=[];for(let I of d)A.push(I.length);return{values:A}}let h=f(l.left),T=f(l.right),m=null,b=null;if(h?l.right.type===re.AST_NODE_TYPES.Literal&&typeof l.right.value=="number"&&(m=h.values,b=l.right.value):T&&l.left.type===re.AST_NODE_TYPES.Literal&&typeof l.left.value=="number"&&(m=T.values,b=l.left.value),!m||b===null)return;let C=0,y=0;for(let x of m){let u=!1;if(l.operator==="==="?u=x===b:l.operator==="!=="?u=x!==b:l.operator===">"?u=x>b:l.operator===">="?u=x>=b:l.operator==="<"?u=x<b:l.operator==="<="&&(u=x<=b),u?C++:y++,C>0&&y>0)return}C>0&&y===0?e.report({node:l,messageId:"unnecessaryLengthCondition"}):y>0&&C===0&&e.report({node:l,messageId:"alwaysFalseLengthCondition"})}return{BinaryExpression(l){i(l),S(l)},CallExpression:g}}})};function pt(e){return Array.from(new Set(e)).join(" | ")||"never"}function Be(e,t){let r=e.argument;return r.type===re.AST_NODE_TYPES.Identifier?r.name:t.sourceCode.getText(r)}function ki(e,t){return t.has(e)}var ut=require("@typescript-eslint/utils"),ct=require("zod/v4");var Oi=ut.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),er="no-call-with-explicit-generics",Ni=ct.z.object({functions:ct.z.array(ct.z.string())}),Di=Oi({name:er,meta:{type:"problem",docs:{description:"Enforce calling configured functions with inferred generics only"},messages:{noExplicitGenerics:"Function '{{ functionName }}' should be called with inferred generics (remove the explicit type parameters)"},schema:[$(Ni)]},defaultOptions:[{functions:[]}],create(e,[t]){let r=new Set(t.functions);return{CallExpression(n){let{callee:s}=n;s.type===ut.AST_NODE_TYPES.Identifier&&r.has(s.name)&&n.typeArguments&&e.report({node:n,messageId:"noExplicitGenerics",data:{functionName:s.name}})}}}}),Lt={name:er,rule:Di};var We=require("@typescript-eslint/utils"),ji=We.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),tr="no-call-with-inferred-generics",Li=ji({name:tr,meta:{type:"problem",docs:{description:"Disable calling configured functions with infered generics"},messages:{missingGenericDeclaration:"Function '{{ functionName }}' should be called with at least {{ minGenerics }} generic(s) (ex: `fn<Generic>()`) defined",anyUsedInGenerics:"Function '{{ functionName }}' should not be called with 'any' in generics"},schema:[{type:"object",properties:{functions:{type:"array",items:{type:"object",properties:{name:{type:"string"},minGenerics:{type:"number"},allowAny:{type:"boolean"},disallowTypes:{type:"array",items:{type:"string"}}},required:["name"]}},anyAliases:{type:"array",items:{type:"string"}}},required:["functions"]}]},defaultOptions:[{functions:[]}],create(e,[t]){let r=new Map(t.functions.map(n=>[n.name,n]));return{CallExpression(n){let{callee:s}=n;if(s.type!==We.AST_NODE_TYPES.Identifier)return;let o=r.get(s.name);if(!o)return;let{minGenerics:i=1,allowAny:p,disallowTypes:a=t.disallowTypes}=o;(n.typeArguments?.params.length||0)<(i||0)&&e.report({node:n,messageId:"missingGenericDeclaration",data:{functionName:s.name,minGenerics:i||0}}),!(p&&!a)&&n.typeArguments?.params.some(g=>!p&&g.type===We.AST_NODE_TYPES.TSAnyKeyword||a&&g.type===We.AST_NODE_TYPES.TSTypeReference&&g.typeName.type===We.AST_NODE_TYPES.Identifier&&a.includes(g.typeName.name))&&e.report({node:n,messageId:"anyUsedInGenerics",data:{functionName:s.name}})}}}}),Mt={name:tr,rule:Li};var ir=require("@typescript-eslint/utils"),Mi=ir.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),sr="no-commented-out-code",$i=["function ","class ","interface ","type ","enum ","namespace ","import ","export ","const ","let ","var ","return ","throw ","break","continue","try {","catch (","finally {","async ","await ","case ","switch (","while (","for (","default:"],_i=/^\s*return\s+/,Ui=/\w=("|'|`)/,zi=/\w+:\s*('|"|`)/,Wi=/\[['"][^'"]*['"]\]:\s*('|"|`|[^'"`\s])/,Ji=/\w+-\w+:/,Vi=/\w+_\w+:/,Xi=/\?\s+\w/,Hi=/:\s+\w/,Bi=/^\s*('|"|`)[^'"]*('|"|`),?\s*$/,Yi=/^\s*\d+[,}]/,qi=/^\s*\[[^\]]*\][,}]/,Zi=/^\s*\{[^}]*\}[,}]/,Gi=/\.\w+\(/,Ki=/\[\w+\]/,Qi=/^\s*(['"`]).+?\1\s*:/,es=/^<[A-Z]\w*(\s|>|\/)/,ts=/^<[a-z]+(\s|>|\/)/,ns=/<[A-Z]\w*(\s.*)?>/,rs=/<\/[A-Z]\w*>/,is=/<[a-z]+(\s.*)?>/,ss=/<\/[a-z]+>/,os=/^\s*[*\s]*$/,as=/^[a-zA-Z]/,ls=/^[A-Z][A-Za-z]*(?:\s+\d+)?(?:\s+[a-z]+)*:\s+[A-Za-z]/,ps=/```[\s\S]*?```/g,cs=/`[^`]*`/g,nr=/[a-zA-Z0-9]/,us=/\.[A-Za-z_][A-Za-z0-9_]*\(/,fs=/[{}[\]()`=<>]/,ms=/:\s*(['"`[{(]|\w+\s*=>)/,ys=/\bif\s*\(|\belse\b|=>/,ie={returnStatement:_i,stringAssignment:Ui,objectPropertyWithQuotes:zi,computedPropertyAssignment:Wi,kebabCaseProperty:Ji,snakeCaseProperty:Vi,ternaryOperator:Xi,colonWithWord:Hi,quotedString:Bi,numberWithComma:Yi,arrayWithComma:qi,objectWithComma:Zi,methodCall:Gi,arrayAccess:Ki,quotedPropertyKey:Qi,jsxSelfClosing:es,jsxElement:ts,jsxOpeningTag:ns,jsxClosingTag:rs,htmlOpeningTag:is,htmlClosingTag:ss,jsdocComment:os};function ds(e){if(e.includes(":")){let r=e.split(":")[0]?.trim();if(r&&as.test(r)&&r.includes(" "))return!0}let t=e.trim();return t.length===0||us.test(t)||fs.test(t)||ms.test(t)||ys.test(t)?!1:!!(t.includes(":")&&ls.test(t))}var gs=[") {","return;",ie.returnStatement,"if (","else {","else if (","/>","</","< ","},",": {"," } = ","={",ie.stringAssignment,");",ie.objectPropertyWithQuotes,ie.computedPropertyAssignment,ie.kebabCaseProperty,ie.snakeCaseProperty,"&&","||","()",ie.ternaryOperator,ie.colonWithWord,ie.quotedString,ie.numberWithComma,ie.arrayWithComma,ie.objectWithComma,ie.methodCall,ie.arrayAccess,"?.(","??","=>",ie.quotedPropertyKey],Ss=["/>","</",ie.jsxSelfClosing,ie.jsxElement,ie.jsxOpeningTag,ie.jsxClosingTag,ie.htmlOpeningTag,ie.htmlClosingTag],rr=["INFO:","TODO:","DOCS:","FIX:","FIXME:","HACK:","NOTE:","WARNING:","WARN:","BUG:","ISSUE:","TEMP:","TEMPORARY:","XXX:","REVIEW:","eslint"],Ts=Mi({name:sr,meta:{type:"problem",docs:{description:"Disallow commented code"},messages:{commentedOutCode:"Commented code is not allowed. Detected pattern: `{{ wrongPattern }}` Use a comment starting with one of these prefixes if you want to keep this code commented out: {{ allowedPrefixes }}"},schema:[]},defaultOptions:[],create(e){function t(n,s){if(n.startsWith("/"))return!1;let o=n.trimStart();if(n.startsWith("*")||o.startsWith("eslint-disable")||n.includes("@deprecated")||n.includes("@example")||n.includes("@param")||n.includes("@returns")||n.includes("@throws")||n.includes("typescript-eslint")||n.includes("@ts-")||n.includes("prettier-ignore")||ie.jsdocComment.test(n))return!1;for(let i of rr)if(o.startsWith(i))return!1;if(n.includes("https://")||ds(o))return!1;if(s==="Block"){for(let i of Ss)if(typeof i=="string"){if(n.includes(i))return{wrongPattern:i}}else if(i.test(n))return{wrongPattern:`regex(${i.toString()})`};return!1}for(let i of $i)if(o.startsWith(i))return{wrongPattern:i};for(let i of gs)if(typeof i=="string"){if(n.includes(i))return{wrongPattern:i}}else if(i.test(n))return{wrongPattern:`regex(${i.toString()})`};return!1}function r(n,s){let o=n,i=o.trim();if(i.startsWith("`")&&(i.endsWith("`,")||i.endsWith("`;")||i.endsWith("`")))return o;if(s==="Block"&&o.includes("```")){let c=o.split(ps);c.some(S=>nr.test(S))&&(o=c.join(""))}if(!o.includes("`"))return o;let p=o.split(cs);return p.some(c=>nr.test(c))?p.join(""):o}return{Program(){let s=e.sourceCode.getAllComments();for(let o of s){let i=r(o.value,o.type),p=t(i,o.type);p&&e.report({node:o,messageId:"commentedOutCode",data:{wrongPattern:p.wrongPattern,allowedPrefixes:rr.join(", ")}})}}}}}),$t={name:sr,rule:Ts};var ft=require("@typescript-eslint/utils"),hs=ft.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),or="no-default-export",Es=hs({name:or,meta:{type:"problem",docs:{description:"Disallow default exports"},schema:[],messages:{noDefaultExport:"Default exports are not allowed, use named exports instead."}},defaultOptions:[],create(e){return{ExportDefaultDeclaration(t){e.report({node:t,messageId:"noDefaultExport"})},ExportNamedDeclaration(t){for(let r of t.specifiers)r.exported.type===ft.TSESTree.AST_NODE_TYPES.Identifier&&r.exported.name==="default"&&e.report({node:t,messageId:"noDefaultExport"})}}}}),_t={name:or,rule:Es};var ar=require("@typescript-eslint/utils"),bs=ar.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),lr="no-leaked-text-in-jsx",xs=[",",";","[","]","(",")"],Cs=bs({name:lr,meta:{type:"problem",docs:{description:"Prevents leaking of text in JSX that should be wrapped in an expression container"},messages:{leakedTextInJSX:'Text "{{ text }}" should be wrapped in a JSX expression container.'},schema:[],fixable:"code"},defaultOptions:[],create(e){return{JSXText(t){let r=t.value.trim();if(!r)return;let n="";xs.includes(r)?n=r:r.includes("&&")?n="&&":r.includes("||")?n="||":r.endsWith("? (")&&(n="? ("),n&&e.report({node:t,messageId:"leakedTextInJSX",data:{text:n}})}}}}),Ut={name:lr,rule:Cs};var _e=require("@typescript-eslint/utils"),As=_e.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),cr="no-non-camel-case-functions",Is=/^(\$?[a-z][a-zA-Z0-9]*)$/;function pr(e){if(e.typeName.type!==_e.AST_NODE_TYPES.TSQualifiedName)return!1;let{left:t,right:r}=e.typeName;return t.type===_e.AST_NODE_TYPES.Identifier&&t.name==="JSX"&&r.name==="Element"}var ws=As({name:cr,meta:{type:"suggestion",docs:{description:"Enforce camelCase naming convention for function declarations"},schema:[],messages:{nonCamelCaseFunction:'Function name "{{functionName}}" should be in camelCase format. If this fn is a React component and can\'t use the `FC` type, add a explicit "JSX.Element" return type to it'}},defaultOptions:[],create(e){return{FunctionDeclaration(t){if(t.id&&!Is.test(t.id.name)){let r=t.returnType?.typeAnnotation;if(r&&(r.type===_e.AST_NODE_TYPES.TSTypeReference?pr(r):r.type===_e.AST_NODE_TYPES.TSUnionType&&r.types.some(s=>s.type===_e.AST_NODE_TYPES.TSTypeReference&&pr(s))))return;e.report({node:t.id,messageId:"nonCamelCaseFunction",data:{functionName:t.id.name}})}}}}}),zt={name:cr,rule:ws};var G=require("@typescript-eslint/utils");var Rs=G.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),ur="no-optional-root-props",Ps=Rs({name:ur,meta:{type:"problem",docs:{description:"Prevents usage of optional properties at the root of a type if that type is a local type alias or interface referenced only once"},messages:{optionalNotAllowed:'Optional property "{{ propertyName }}" is not allowed on a local type used only once. Use `prop: undefined | ...` instead.',suggestion:"Use `prop: undefined | ...` instead."},hasSuggestions:!0,schema:[]},defaultOptions:[],create(e){function t(n){let o=e.sourceCode.getDeclaredVariables(n)[0];if(!o||o.references.length!==1)return!1;let i=o.references[0];if(!i)return!1;for(let p of Nt(i.identifier)){if("returnType"in p||p.type===G.TSESTree.AST_NODE_TYPES.ExportNamedDeclaration)return!1;let a=p.parent;if(!a)return!1;if(a.type===G.TSESTree.AST_NODE_TYPES.TSTypeParameterInstantiation&&a.parent.type===G.TSESTree.AST_NODE_TYPES.TSTypeReference&&a.parent.typeName.type===G.TSESTree.AST_NODE_TYPES.Identifier&&a.parent.typeName.name==="FC"){let g=He(a.parent.parent,G.TSESTree.AST_NODE_TYPES.VariableDeclaration,4);if(!g)return!1;let S=mt(g,e.sourceCode);return S?!(S.parent.type===G.TSESTree.AST_NODE_TYPES.CallExpression&&S.parent.callee.type===G.TSESTree.AST_NODE_TYPES.Identifier&&S.parent.callee.name==="memo"):!1}if(p.type===G.TSESTree.AST_NODE_TYPES.AssignmentPattern)return!1;if(a.type===G.TSESTree.AST_NODE_TYPES.ArrowFunctionExpression){let c=He(a,G.TSESTree.AST_NODE_TYPES.VariableDeclaration);return c?!!mt(c,e.sourceCode):!1}if(a.type===G.TSESTree.AST_NODE_TYPES.FunctionDeclaration)return!!mt(a,e.sourceCode)}return!1}function r(n){n.key.type!==G.TSESTree.AST_NODE_TYPES.Identifier||!n.optional||e.report({node:n.key,messageId:"optionalNotAllowed",data:{propertyName:n.key.name},suggest:[{messageId:"suggestion",fix:s=>{let o=He(n,G.TSESTree.AST_NODE_TYPES.TSPropertySignature);if(!o)return null;let i=e.sourceCode.getText(o);return s.replaceText(o,i.replace("?:",": undefined |"))}}]})}return{TSTypeAliasDeclaration(n){if(n.typeAnnotation.type===G.TSESTree.AST_NODE_TYPES.TSTypeLiteral&&!(yt(n)||!t(n)))for(let s of n.typeAnnotation.members)s.type===G.TSESTree.AST_NODE_TYPES.TSPropertySignature&&r(s)},TSInterfaceDeclaration(n){if(!(yt(n)||!t(n)))for(let s of n.body.body)s.type===G.TSESTree.AST_NODE_TYPES.TSPropertySignature&&r(s)},TSTypeReference(n){if(n.typeName.type!==G.TSESTree.AST_NODE_TYPES.Identifier||n.typeName.name!=="FC"||!n.typeArguments?.params[0])return;let s=n.typeArguments.params[0];if(s.type!==G.TSESTree.AST_NODE_TYPES.TSTypeLiteral)return;let o=He(n.parent,G.TSESTree.AST_NODE_TYPES.VariableDeclaration,4);if(!o)return;let i=mt(o,e.sourceCode);if(!(!i||i.parent.type===G.TSESTree.AST_NODE_TYPES.CallExpression&&i.parent.callee.type===G.TSESTree.AST_NODE_TYPES.Identifier&&i.parent.callee.name==="memo"))for(let a of s.members)a.type===G.TSESTree.AST_NODE_TYPES.TSPropertySignature&&r(a)}}}});function yt(e){return e?e.parent?.type===G.TSESTree.AST_NODE_TYPES.ExportNamedDeclaration||e.parent?.type===G.TSESTree.AST_NODE_TYPES.ExportDefaultDeclaration:!1}function mt(e,t){if(yt(e))return;let r;if(e.type===G.TSESTree.AST_NODE_TYPES.VariableDeclaration){if(e.declarations.length!==1)return;e.declarations[0].id.type===G.TSESTree.AST_NODE_TYPES.Identifier&&(r=e.declarations[0].id)}else{if(!e.id)return;r=e.id}if(!r)return;let n=t.getScope(e);e.type===G.TSESTree.AST_NODE_TYPES.FunctionDeclaration&&n.upper&&(n=n.upper);let s=n.variables.find(i=>i.identifiers.includes(r));if(!s)return;let o=s.references.filter(i=>i.identifier!==r);if(!(o.length!==1||!o[0])&&!yt(o[0].identifier.parent.parent))return o[0].identifier}var Wt={name:ur,rule:Ps};var Qe=require("@typescript-eslint/utils");var et=_({name:"no-reexport",meta:{type:"problem",docs:{description:"Disallow re-exports to prevent indirection"},schema:[],messages:{noReexport:"Re-exports are not allowed. Use direct exports only."}},defaultOptions:[],create(e){let t=new Set;function r(n){return n?n.type===Qe.AST_NODE_TYPES.Identifier?t.has(n.name):n.type===Qe.AST_NODE_TYPES.MemberExpression?r(n.object):!1:!1}return{ImportDeclaration(n){for(let s of n.specifiers)t.add(s.local.name)},ExportNamedDeclaration(n){if(n.source){e.report({node:n,messageId:"noReexport"});return}if(n.declaration?.type===Qe.AST_NODE_TYPES.VariableDeclaration)for(let s of n.declaration.declarations)r(s.init)&&e.report({node:n,messageId:"noReexport"});n.specifiers.length>0&&e.report({node:n,messageId:"noReexport"})},ExportDefaultDeclaration(n){n.declaration.type===Qe.AST_NODE_TYPES.Identifier&&t.has(n.declaration.name)&&e.report({node:n,messageId:"noReexport"})},ExportAllDeclaration(n){e.report({node:n,messageId:"noReexport"})}}}});var fr=require("@typescript-eslint/utils"),dt=xe(require("path")),Ne=require("zod/v4");var vs=fr.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),mr="no-relative-imports",Fs=Ne.z.object({find:Ne.z.string(),replacement:Ne.z.string()}),ks=Ne.z.object({aliases:Ne.z.array(Fs),rootDir:Ne.z.string().optional(),allowNotFoundAliases:Ne.z.boolean().optional(),_dev_simulateFileName:Ne.z.string().optional()}),Os=vs({name:mr,meta:{type:"problem",fixable:"code",docs:{description:"Prevent relative imports and auto-fix them using configured aliases"},messages:{noRelativeImports:"Relative imports are not allowed. Use one of the valid aliases in tsconfig.json instead.",noRelativeImportsWithAlias:'Relative imports are not allowed. Use the "{{ alias }}" alias instead.'},schema:[$(ks)]},defaultOptions:[{aliases:[],rootDir:void 0}],create(e,[t]){let r=t._dev_simulateFileName??e.filename;function n(i){return i.startsWith(".")||i.startsWith("..")}function s(i,p){let a=dt.default.dirname(p);return dt.default.resolve(a,i)}function o(i){let p=t.rootDir??process.cwd(),a=dt.default.relative(p,i);if(a.startsWith("."))return null;a.startsWith("/")||(a=`/${a}`);for(let{find:c,replacement:g}of t.aliases)if(a.startsWith(g)){let S=a.replace(g,c);return{alias:c,newPath:S}}return null}return{ImportDeclaration(i){let p=i.source.value;if(!n(p))return;let a=s(p,r),c=o(a);!c&&t.allowNotFoundAliases||e.report({node:i,messageId:c?"noRelativeImportsWithAlias":"noRelativeImports",data:{alias:c?.alias},fix:c?g=>g.replaceText(i.source,`'${c.newPath}'`):void 0})}}}}),Jt={name:mr,rule:Os};var se=require("@typescript-eslint/utils"),Vt=require("zod/v4");var Ns=Vt.z.object({customMessage:Vt.z.string().optional()}),Xt=_({name:"no-static-style-prop",meta:{type:"problem",docs:{description:"Prevent using static style props in JSX, only dynamic values should be allowed"},schema:[$(Ns)],messages:{noStaticStyleProp:"Static style props are not allowed use css instead.{{customMessage}}"}},defaultOptions:[{}],create(e,[t]){function r(n){switch(n.type){case se.AST_NODE_TYPES.Literal:return!0;case se.AST_NODE_TYPES.ObjectExpression:return n.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:r(s.value):!1);case se.AST_NODE_TYPES.ArrayExpression:return n.elements.every(s=>s?s.type===se.AST_NODE_TYPES.SpreadElement?!1:r(s):!0);case se.AST_NODE_TYPES.TemplateLiteral:return n.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(n){if(n.name.type===se.AST_NODE_TYPES.JSXIdentifier&&n.name.name==="style"&&n.value){let s=null;n.value.type===se.AST_NODE_TYPES.JSXExpressionContainer?n.value.expression.type!==se.AST_NODE_TYPES.JSXEmptyExpression&&(s=n.value.expression):n.value.type===se.AST_NODE_TYPES.Literal&&(s=n.value),s&&r(s)&&e.report({node:n,messageId:"noStaticStyleProp",data:{customMessage:t.customMessage?` ${t.customMessage}`:""}})}}}}});var tt=require("@typescript-eslint/utils"),Je=xe(require("zod/v4"));var Ds=Je.object({alternativeMsgs:Je.object({inArrayFind:Je.string().optional(),inArrayFilter:Je.string().optional()}).optional(),__dev_simulateFileName:Je.string().optional()});function js(e){return e.typeAnnotation.type!==tt.AST_NODE_TYPES.TSTypePredicate?!1:e.typeAnnotation.asserts===!1}var Ls=/(typeGuards|type-guards)\.(ts|tsx)$/;function Ms(e){return Ls.test(e)}function $s(e){let t=e.parent;for(;t;){if(t.type===tt.AST_NODE_TYPES.CallExpression&&t.callee.type===tt.AST_NODE_TYPES.MemberExpression&&t.callee.property.type===tt.AST_NODE_TYPES.Identifier){let r=t.callee.property.name;if(r==="filter"||r==="find")return{method:r}}t=t.parent}return null}var Ht=_({name:"no-type-guards",meta:{type:"problem",docs:{description:"Disallow type guards unless in *.typeGuards.(ts|tsx) or *.type-guards.(ts|tsx) files"},messages:{typeGuardNotAllowed:"Check if the type guard can be inferred by typescript, in most cases it can, e.g. `.filter((nullable) => nullable !== null)`. If not, type guards are only allowed in *.typeGuards.(ts|tsx) or *.type-guards.(ts|tsx) files",useFilterWithTypeCheck:"{{message}}",useFindWithTypeCheck:"{{message}}"},schema:[$(Ds)],hasSuggestions:!0},defaultOptions:[{}],create(e,[t]){let r=t.__dev_simulateFileName??e.filename;if(Ms(r))return{};function n(s){if(!js(s))return;let o=$s(s);if(t.alternativeMsgs&&o){let i=o.method==="filter"?t.alternativeMsgs.inArrayFilter:t.alternativeMsgs.inArrayFind;if(i){let p=o.method==="filter"?"useFilterWithTypeCheck":"useFindWithTypeCheck";e.report({node:s,messageId:p,data:{message:i}});return}}e.report({node:s,messageId:"typeGuardNotAllowed"})}return{"FunctionDeclaration > :matches(TSTypeAnnotation)":n,"ArrowFunctionExpression > :matches(TSTypeAnnotation)":n,"MethodDefinition > FunctionExpression > :matches(TSTypeAnnotation)":n}}});var Ve=require("@typescript-eslint/utils");var _s="no-unnecessary-async-on-jsx-props";function Us(e){if(e.body.type!==Ve.AST_NODE_TYPES.BlockStatement)return!1;let t=e.body.body;if(t.length!==1)return!1;let r=t[0];return!r||r.type!==Ve.AST_NODE_TYPES.ExpressionStatement?!1:r.expression.type===Ve.AST_NODE_TYPES.AwaitExpression}var Bt=_({name:_s,meta:{type:"suggestion",fixable:"code",docs:{description:"Disallow unnecessary async/await in JSX props where a single await provides no benefit"},messages:{unnecessaryAsyncInJsxProp:"Unnecessary async/await in JSX prop. The single await expression provides no benefit here."},schema:[]},defaultOptions:[],create(e){function t(r){Us(r)&&e.report({node:r,messageId:"unnecessaryAsyncInJsxProp",fix(n){let s=e.sourceCode,o=[],i=s.getFirstToken(r,a=>a.value==="async");if(i){let a=s.getTokenAfter(i);a?o.push(n.replaceTextRange([i.range[0],a.range[0]],"")):o.push(n.remove(i))}function p(a){if(a.type===Ve.AST_NODE_TYPES.AwaitExpression){let c=s.getFirstToken(a);if(c&&c.value==="await"){let g=s.getTokenAfter(c);g?o.push(n.replaceTextRange([c.range[0],g.range[0]],"")):o.push(n.remove(c))}}if(a.type===Ve.AST_NODE_TYPES.BlockStatement)for(let c of a.body)p(c);else a.type===Ve.AST_NODE_TYPES.ExpressionStatement&&p(a.expression)}return p(r.body),o}})}return{"JSXAttribute ArrowFunctionExpression[async=true]":t,"JSXAttribute FunctionExpression[async=true]":t}}});var De=require("@typescript-eslint/utils"),Yt=xe(require("typescript")),Ye=xe(require("zod/v4"));var zs=De.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),yr="no-unnecessary-casting",Ws=Ye.default.object({additionalCastFunctions:Ye.default.array(Ye.default.object({name:Ye.default.string(),expectedType:Ye.default.enum(["string","number"])})).optional()}),qt={name:yr,rule:zs({name:yr,meta:{type:"suggestion",docs:{description:"Prevents unnecessary Number and String castings"},messages:{unnecessaryNumberCasting:"Unnecessary Number() casting on a value already of number type",unnecessaryStringCasting:"Unnecessary String() casting on a value already of string type",unnecessaryCustomCasting:"Unnecessary {{name}}() casting on a value already of {{type}} type"},schema:[$(Ws)],fixable:"code"},defaultOptions:[{}],create(e){let r=e.options[0].additionalCastFunctions||[],n=[{name:"Number",expectedType:"number"},{name:"String",expectedType:"string"},...r],s=De.ESLintUtils.getParserServices(e,!0),o=s.program?.getTypeChecker();if(!o||!s.program)throw new Error("TypeScript services or program not available");function i(g,S){switch(g.type){case De.AST_NODE_TYPES.Literal:return S==="number"?typeof g.value=="number":typeof g.value=="string";case De.AST_NODE_TYPES.TemplateLiteral:return S==="string";case De.AST_NODE_TYPES.UnaryExpression:return S==="number"?g.operator==="+"||g.operator==="-"||g.operator==="~":!1;default:return!1}}function p(g,S){return S==="number"?!!(g.flags&Yt.TypeFlags.NumberLike):!!(g.flags&Yt.TypeFlags.StringLike)}function a(g,S){return l=>l.replaceText(g,e.sourceCode.getText(S))}function c(g){if(!o||g.arguments.length!==1)return;let S=g.arguments[0];if(!S||S.type===De.AST_NODE_TYPES.SpreadElement)return;let{callee:l}=g;if(l.type!==De.AST_NODE_TYPES.Identifier)return;let E=l.name,f=n.find(T=>T.name===E);if(!f)return;if(i(S,f.expectedType)||p(o.getTypeAtLocation(s.esTreeNodeToTSNodeMap.get(S)),f.expectedType)){let T,m;E==="Number"?T="unnecessaryNumberCasting":E==="String"?T="unnecessaryStringCasting":(T="unnecessaryCustomCasting",m={name:f.name,type:f.expectedType}),e.report({node:g,messageId:T,...m?{data:m}:{},fix:a(g,S)})}}return{CallExpression:c}}})};var ge=require("@typescript-eslint/utils"),gt=xe(require("zod/v4"));var Js=gt.object({ignoreWithDescription:gt.string().optional()}),Zt=_({name:"no-unnecessary-describe",meta:{type:"suggestion",docs:{description:"Disallow unnecessary describe blocks that wrap all tests in a file"},messages:{unnecessaryDescribe:"Describe blocks that solely wrap all tests in the file are unnecessary, they just add unnecessary nesting to the code. The file itself should be enough to group tests. Remove it.",removeDescribe:"Remove the describe block"},hasSuggestions:!0,schema:[$(Js)]},defaultOptions:[{}],create(e,[t]){let r=e.getSourceCode(),n=r.ast;function s(a){let c=a.arguments[0];return c&&c.type===ge.AST_NODE_TYPES.Literal&&typeof c.value=="string"?c.value:null}function o(a){return!a||!t.ignoreWithDescription?!1:new RegExp(t.ignoreWithDescription).test(a)}function i(a){return a.length!==1?!1:n.body.filter(g=>{if(g.type===ge.AST_NODE_TYPES.ExpressionStatement){let S=g.expression;if(S.type===ge.AST_NODE_TYPES.CallExpression&&S.callee.type===ge.AST_NODE_TYPES.Identifier){let l=S.callee.name;return["test","it","beforeEach","afterEach","beforeAll","afterAll"].includes(l)}}return!1}).length===0}function p(a){let c=a.arguments[1];if(c&&(c.type===ge.AST_NODE_TYPES.FunctionExpression||c.type===ge.AST_NODE_TYPES.ArrowFunctionExpression)&&c.body.type===ge.AST_NODE_TYPES.BlockStatement){let g=c.body.body;return g.length===0?"":g.map(l=>r.text.slice(l.range[0],l.range[1])).join(`
16
16
 
17
- `)}return""}return{Program(){let a=[];for(let l of n.body)l.type===ge.AST_NODE_TYPES.ExpressionStatement&&l.expression.type===ge.AST_NODE_TYPES.CallExpression&&l.expression.callee.type===ge.AST_NODE_TYPES.Identifier&&l.expression.callee.name==="describe"&&l.expression.arguments.length===2&&a.push(l.expression);if(!i(a))return;let[c]=a;if(!c)return;let g=s(c);if(o(g))return;let S=n.body.find(l=>l.type===ge.AST_NODE_TYPES.ExpressionStatement&&l.expression===c);!S||S.type!==ge.AST_NODE_TYPES.ExpressionStatement||e.report({node:c,messageId:"unnecessaryDescribe",suggest:[{messageId:"removeDescribe",fix(l){let E=p(c);return E?l.replaceText(S,E):null}}]})}}}});var nt=require("@typescript-eslint/utils"),Re=xe(require("zod/v4"));var Vs=Re.object({methods:Re.union([Re.array(Re.string()),Re.literal("array")])}),Gt=_({name:"no-unnecessary-typing",meta:{type:"suggestion",docs:{description:"Prevents unnecessary explicit type annotations in callback parameters where TypeScript can infer the type"},messages:{unnecessaryTypeAnnotation:"Unnecessary type annotation. TypeScript can infer this type from context."},fixable:"code",schema:[$(Vs)]},defaultOptions:[{methods:"array"}],create(e,[t]){let r=t.methods,n=new Set(["find","filter","map","forEach","some","every","reduce","findIndex","sort"]);function s(p){return Array.isArray(r)?r.includes(p):n.has(p)}function o(p){let{callee:a}=p;if(a.type===nt.AST_NODE_TYPES.MemberExpression){let c=a.property;if(c.type===nt.AST_NODE_TYPES.Identifier)return c.name}return null}function i(p,a){if(p.type!==nt.AST_NODE_TYPES.Identifier||!p.typeAnnotation)return;let c=a.parent;if(c.type===nt.AST_NODE_TYPES.CallExpression){let g=o(c);g&&s(g)&&c.arguments.indexOf(a)===0&&e.report({node:p.typeAnnotation,messageId:"unnecessaryTypeAnnotation",fix(l){return p.typeAnnotation?l.remove(p.typeAnnotation):null}})}}return{ArrowFunctionExpression(p){for(let a of p.params)i(a,p)},FunctionExpression(p){for(let a of p.params)i(a,p)}}}});var ye=require("@typescript-eslint/utils");var Kt=_({name:"no-unused-obj-props",meta:{type:"suggestion",docs:{description:"Disallow unused properties when it is safe to remove them"},messages:{unusedObjectProperty:'The object property "{{name}}" is not being used',unusedReturnObjectProperty:'The object property "{{name}}" returned by this function is not being used'},schema:[]},defaultOptions:[],create(e){return{VariableDeclarator(t){if(t.id.type===ye.AST_NODE_TYPES.ObjectPattern||!t.init||t.init.type!==ye.AST_NODE_TYPES.ObjectExpression||t.id.type===ye.AST_NODE_TYPES.Identifier&&t.id.typeAnnotation||t.parent.parent.type===ye.AST_NODE_TYPES.ExportNamedDeclaration)return;let r=new Map;for(let i of t.init.properties)i.type===ye.AST_NODE_TYPES.Property&&i.key.type===ye.AST_NODE_TYPES.Identifier&&r.set(i.key.name,i);if(r.size===0||t.id.type!==ye.AST_NODE_TYPES.Identifier)return;let n=Xs(t,e.sourceCode);if(n.length===0)return;let s=t.init.properties.some(i=>i.type!==ye.AST_NODE_TYPES.Property?!1:i.value.type===ye.AST_NODE_TYPES.FunctionExpression),o=new Set;for(let i of n){if(i.identifier.parent.type!==ye.AST_NODE_TYPES.MemberExpression)return;let p=i.identifier.parent;if(p.object!==i.identifier)return;if(p.computed)if(p.property.type===ye.AST_NODE_TYPES.Literal&&typeof p.property.value=="string")o.add(p.property.value);else return;else{if(p.property.type!==ye.AST_NODE_TYPES.Identifier)return;o.add(p.property.name)}if(p.parent.type===ye.AST_NODE_TYPES.CallExpression&&s)return}for(let[i,p]of r)o.has(i)||e.report({node:p,messageId:"unusedObjectProperty",data:{name:i}})}}}});function Xs(e,t){let r=t.getDeclaredVariables(e);if(r.length!==1)return[];let n=r[0];return n?n.references.filter(s=>s.identifier!==e.id):[]}var J=require("@typescript-eslint/utils"),Qt=require("zod/v4");var Hs=Qt.z.object({ignoreArgsMatching:Qt.z.string().optional()}),en=_({name:"no-unused-optional-args",meta:{type:"problem",docs:{description:"Detect unused optional function arguments in non-exported functions"},messages:{unusedOptionalArg:"Optional parameter '{{name}}' is never used",unusedOptionalProp:"Optional prop '{{name}}' is never provided"},schema:[$(Hs)]},defaultOptions:[{}],create(e,[t]){let r=[];function n(i){return t.ignoreArgsMatching?new RegExp(t.ignoreArgsMatching).test(i):!1}function s(i){return i.type===J.AST_NODE_TYPES.ExportNamedDeclaration||i.type===J.AST_NODE_TYPES.ExportDefaultDeclaration||i.parent?.type===J.AST_NODE_TYPES.ExportNamedDeclaration||i.parent?.type===J.AST_NODE_TYPES.ExportDefaultDeclaration}function o(i){let p=[];for(let a=0;a<i.length;a++){let c=i[a];if(!c||c.type!==J.AST_NODE_TYPES.Identifier)continue;let g=c.name;if(!n(g)){if(c.optional&&c.typeAnnotation&&c.typeAnnotation.typeAnnotation.type===J.AST_NODE_TYPES.TSTypeLiteral){let S=c.typeAnnotation.typeAnnotation,l=[];for(let E of S.members)E.type===J.AST_NODE_TYPES.TSPropertySignature&&E.key.type===J.AST_NODE_TYPES.Identifier&&l.push({name:E.key.name,optional:E.optional===!0});l.some(E=>E.optional)?p.push({param:c,index:a,name:g,isObjectParam:!0,objectProps:l}):p.push({param:c,index:a,name:g,isObjectParam:!1})}else if(c.optional)p.push({param:c,index:a,name:g,isObjectParam:!1});else if(c.typeAnnotation&&c.typeAnnotation.typeAnnotation.type===J.AST_NODE_TYPES.TSTypeLiteral){let S=c.typeAnnotation.typeAnnotation,l=[];for(let E of S.members)E.type===J.AST_NODE_TYPES.TSPropertySignature&&E.key.type===J.AST_NODE_TYPES.Identifier&&l.push({name:E.key.name,optional:E.optional===!0});l.some(E=>E.optional)&&p.push({param:c,index:a,name:g,isObjectParam:!0,objectProps:l})}}}return p}return{FunctionDeclaration(i){if(s(i))return;let p=o(i.params);p.length!==0&&r.push({node:i,declarationNode:i,optionalParams:p})},VariableDeclarator(i){if(i.id.type!==J.AST_NODE_TYPES.Identifier||!i.init||i.init.type!==J.AST_NODE_TYPES.ArrowFunctionExpression&&i.init.type!==J.AST_NODE_TYPES.FunctionExpression||s(i.parent.parent))return;let a=[...o(i.init.params)];if(i.id.typeAnnotation&&i.id.typeAnnotation.typeAnnotation.type===J.AST_NODE_TYPES.TSTypeReference){let c=i.id.typeAnnotation.typeAnnotation;if(c.typeName.type===J.AST_NODE_TYPES.Identifier&&c.typeName.name==="FC"){let g=c.typeArguments;if(g&&g.params.length===1){let S=g.params[0];if(S&&S.type===J.AST_NODE_TYPES.TSTypeLiteral){let l=[];for(let E of S.members)E.type===J.AST_NODE_TYPES.TSPropertySignature&&E.key.type===J.AST_NODE_TYPES.Identifier&&l.push({name:E.key.name,optional:E.optional===!0});l.some(E=>E.optional)&&a.push({param:i.id,index:0,name:"props",isObjectParam:!0,objectProps:l})}}}}a.length!==0&&r.push({node:i.init,declarationNode:i,optionalParams:a})},"Program:exit"(){for(let i of r){let a=e.sourceCode.getDeclaredVariables(i.declarationNode)[0];if(!a)continue;let c=a.references.filter(l=>l.identifier!==a.identifiers[0]);if(c.length===0)continue;let g=!1;for(let l of c){let E=l.identifier.parent;if(E.type===J.AST_NODE_TYPES.CallExpression&&l.identifier.type===J.AST_NODE_TYPES.Identifier&&E.arguments.includes(l.identifier)){g=!0;break}if(E.type===J.AST_NODE_TYPES.ReturnStatement){g=!0;break}if(E.type===J.AST_NODE_TYPES.Property&&E.parent.type===J.AST_NODE_TYPES.ObjectExpression&&E.parent.parent.type===J.AST_NODE_TYPES.ReturnStatement){g=!0;break}if(E.type===J.AST_NODE_TYPES.JSXExpressionContainer){g=!0;break}}if(g)continue;let S=[];for(let l of c){let E=l.identifier.parent;if(E.type===J.AST_NODE_TYPES.CallExpression&&E.callee===l.identifier){let f=E.arguments.length,h=E.arguments.some(m=>m.type===J.AST_NODE_TYPES.SpreadElement);if(h){g=!0;break}let T={argCount:f,hasSpread:h};for(let m of i.optionalParams)if(m.isObjectParam&&m.index<f){let b=E.arguments[m.index];if(b?.type===J.AST_NODE_TYPES.ObjectExpression){let C={};for(let y of b.properties)y.type===J.AST_NODE_TYPES.Property&&y.key.type===J.AST_NODE_TYPES.Identifier&&(C[y.key.name]=!0);T.objectArgs||(T.objectArgs=[]),T.objectArgs[m.index]=C}else if(b){g=!0;break}}S.push(T)}else if(E.type===J.AST_NODE_TYPES.JSXOpeningElement&&E.name===l.identifier){let f=E.attributes.some(T=>T.type===J.AST_NODE_TYPES.JSXSpreadAttribute);if(f){g=!0;break}let h={argCount:1,hasSpread:f};for(let T of i.optionalParams)if(T.isObjectParam&&T.index===0){let m={};for(let b of E.attributes)b.type===J.AST_NODE_TYPES.JSXAttribute&&b.name.type===J.AST_NODE_TYPES.JSXIdentifier&&(m[b.name.name]=!0);h.objectArgs||(h.objectArgs=[]),h.objectArgs[0]=m}S.push(h)}}if(!(g||S.length===0))for(let l of i.optionalParams)if(l.isObjectParam&&l.objectProps)for(let E of l.objectProps){if(!E.optional)continue;let f=!1;for(let h of S)if(h.objectArgs&&h.objectArgs[l.index]){let T=h.objectArgs[l.index];if(T&&T[E.name]){f=!0;break}}f||e.report({node:l.param,messageId:"unusedOptionalProp",data:{name:E.name}})}else{let E=!1;for(let f of S)if(f.argCount>l.index){E=!0;break}E||e.report({node:l.param,messageId:"unusedOptionalArg",data:{name:l.name}})}}}}}});var G=require("@typescript-eslint/utils"),Ue=require("zod/v4");var Bs=Ue.z.object({selectors:Ue.z.array(Ue.z.object({name:Ue.z.string(),selectorProp:Ue.z.string().optional(),selectorArgPos:Ue.z.number().optional(),returnProp:Ue.z.string().optional()}))}),Ys=G.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),dr="no-unused-selected-values",tn={name:dr,rule:Ys({name:dr,meta:{type:"suggestion",docs:{description:"Disallow unused values in selector objects"},messages:{unusedSelectedValue:'The selected value "{{name}}" is not being used'},schema:[$(Bs)]},defaultOptions:[{selectors:[]}],create(e,[t]){let{selectors:r=[]}=t,n=new Map(r.map(s=>[s.name,s]));return{VariableDeclarator(s){let o=null;if(s.init?.type===G.AST_NODE_TYPES.CallExpression&&(o=s.init),!o)return;let i=Zs(o);if(!i)return;let p=n.get(i);if(!p)return;let a=qs(o,p.selectorArgPos??0,p.selectorProp);if(!a)return;let c=Gs(a);if(!c)return;let g=gr(c.properties,void 0);if(!g)return;if(s.id.type===G.AST_NODE_TYPES.ObjectPattern){let E=gr(s.id.properties,p.returnProp);if(!E)return;for(let[f,h]of g)E.has(f)||e.report({node:h,messageId:"unusedSelectedValue",data:{name:f}});return}if(s.id.type!==G.AST_NODE_TYPES.Identifier||p.returnProp)return;let S=Ks(s,e.sourceCode);if(S.length===0)return;let l=new Set;for(let E of S){if(E.identifier.parent.type!==G.AST_NODE_TYPES.MemberExpression)return;let f=E.identifier.parent.property;if(f.type!==G.AST_NODE_TYPES.Identifier)return;l.add(f.name)}for(let[E,f]of g)l.has(E)||e.report({node:f,messageId:"unusedSelectedValue",data:{name:E}})}}}})};function qs(e,t,r){let n=e.arguments[t];if(!n)return null;if(n.type===G.AST_NODE_TYPES.ArrowFunctionExpression||n.type===G.AST_NODE_TYPES.FunctionExpression)return n;if(r&&n.type===G.AST_NODE_TYPES.ObjectExpression){let s=n.properties.find(i=>i.type===G.AST_NODE_TYPES.Property&&i.key.type===G.AST_NODE_TYPES.Identifier&&i.key.name===r);if(s?.type!==G.AST_NODE_TYPES.Property)return null;let o=s.value;if(o.type===G.AST_NODE_TYPES.ArrowFunctionExpression||o.type===G.AST_NODE_TYPES.FunctionExpression)return o}return null}function Zs(e){return e.callee.type===G.AST_NODE_TYPES.Identifier?e.callee.name:e.callee.type===G.AST_NODE_TYPES.MemberExpression&&e.callee.property.type===G.AST_NODE_TYPES.Identifier?e.callee.property.name:null}function Gs(e){if(e.body.type===G.AST_NODE_TYPES.ObjectExpression)return e.body;if(e.body.type===G.AST_NODE_TYPES.BlockStatement){let t=e.body.body.filter(r=>r.type===G.AST_NODE_TYPES.ReturnStatement);return t.length!==1||!t[0]||t[0].argument?.type!==G.AST_NODE_TYPES.ObjectExpression?null:t[0].argument}return null}function gr(e,t){let r=e;if(t){let s=e.find(o=>o.type===G.AST_NODE_TYPES.Property&&o.key.type===G.AST_NODE_TYPES.Identifier&&o.key.name===t);if(s?.type!==G.AST_NODE_TYPES.Property||s.value.type!==G.AST_NODE_TYPES.ObjectPattern)return null;r=s.value.properties}let n=new Map;for(let s of r){if(s.type!==G.AST_NODE_TYPES.Property||s.key.type!==G.AST_NODE_TYPES.Identifier)return null;n.set(s.key.name,s)}return n.size>0?n:null}function Ks(e,t){let r=t.getDeclaredVariables(e);if(r.length!==1)return[];let n=r[0];return n?n.references.filter(s=>s.identifier!==e.id):[]}var Q=require("@typescript-eslint/utils");var nn=_({name:"no-unused-t-state-field",meta:{type:"suggestion",docs:{description:"Prevent declaring unused t-state fields"},messages:{unusedField:'Field "{{name}}" is not being used, you can safely remove it'},schema:[]},defaultOptions:[],create(e){if(!(e.filename.endsWith(".jsx")||e.filename.endsWith(".tsx")))return{};if(!e.sourceCode.ast.body.some(o=>o.type===Q.AST_NODE_TYPES.ImportDeclaration&&o.source.value==="t-state-form"))return{};let n=null,s=!1;return{CallExpression(o){if(s)return;if(!n){let p=Qs(o);p&&(n=p);return}let i=eo(o,e.sourceCode);if(i){s=!0;for(let p of i)n.delete(p);if(n.size!==0)for(let[p,a]of n)e.report({node:a,messageId:"unusedField",data:{name:p}})}}}}});function Qs(e){if(!(e.callee.type===Q.AST_NODE_TYPES.Identifier&&e.callee.name==="useForm"))return null;let r=e.arguments[0];if(!r||r.type!==Q.AST_NODE_TYPES.ObjectExpression)return null;let n=Dt(r.properties,o=>o.type!==Q.AST_NODE_TYPES.Property||o.key.type!==Q.AST_NODE_TYPES.Identifier||o.key.name!=="initialConfig"?null:o.value.type===Q.AST_NODE_TYPES.ObjectExpression?o.value:o.value.type===Q.AST_NODE_TYPES.ArrowFunctionExpression||o.value.type===Q.AST_NODE_TYPES.FunctionExpression?to(o.value):null);if(!n)return null;let s=new Map;for(let o of n.properties)o.type===Q.AST_NODE_TYPES.Property&&o.key.type===Q.AST_NODE_TYPES.Identifier&&s.set(o.key.name,o);return s}function eo(e,t){if(!(e.callee.type===Q.AST_NODE_TYPES.Identifier&&e.callee.name==="useFormState")||e.parent.type!==Q.AST_NODE_TYPES.VariableDeclarator||e.parent.id.type!==Q.AST_NODE_TYPES.ObjectPattern||!Dt(e.parent.id.properties,i=>i.type===Q.AST_NODE_TYPES.Property&&i.key.type===Q.AST_NODE_TYPES.Identifier&&i.key.name==="formFields"&&i))return null;let s=Gn(e.parent,"formFields",t),o=new Set;for(let{identifier:i}of s){if(i.type!==Q.AST_NODE_TYPES.Identifier||i.parent.type===Q.AST_NODE_TYPES.Property&&i.parent.parent.type===Q.AST_NODE_TYPES.ObjectExpression&&i.parent.parent.parent.type===Q.AST_NODE_TYPES.ReturnStatement||i.parent.type===Q.AST_NODE_TYPES.ReturnStatement)return null;if(i.parent.type===Q.AST_NODE_TYPES.MemberExpression){if(i.parent.object.type!==Q.AST_NODE_TYPES.Identifier||i.parent.property.type!==Q.AST_NODE_TYPES.Identifier)return null;o.add(i.parent.property.name)}}return o}function to(e){if(e.body.type===Q.AST_NODE_TYPES.ObjectExpression)return e.body;if(e.body.type===Q.AST_NODE_TYPES.BlockStatement){let t=e.body.body.filter(r=>r.type===Q.AST_NODE_TYPES.ReturnStatement);return t.length!==1||!t[0]||t[0].argument?.type!==Q.AST_NODE_TYPES.ObjectExpression?null:t[0].argument}return null}var Y=require("@typescript-eslint/utils"),rt=require("zod/v4");var no=Y.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`);function Sr(e){let t=[];for(let r of e.members)r.type===Y.AST_NODE_TYPES.TSPropertySignature&&r.key.type===Y.AST_NODE_TYPES.Identifier&&t.push([r.key.name,r]);return t}function Tr(e,...t){for(let r of t)e.set(...r);return e}var ro=rt.z.object({forceCheckOnFCPropTypesWithName:rt.z.array(rt.z.string()).optional(),alwaysCheckFunctionOptionTypes:rt.z.boolean().optional()}),hr="no-unused-type-props-in-args",rn=null,io=no({name:hr,meta:{type:"problem",docs:{description:"Disallow unused undestructured object type properties"},messages:{unusedObjectTypeProperty:"Object type property '{{ propertyName }}' is defined but never used",missingComponentParam:"Component has declared props but no props are used"},schema:[$(ro)],fixable:"code"},defaultOptions:[{alwaysCheckFunctionOptionTypes:!0}],create(e,[t]){let{forceCheckOnFCPropTypesWithName:r,alwaysCheckFunctionOptionTypes:n=!0}=t;r&&!rn&&(rn=r.map(a=>new RegExp(a)));function s(a,c,g,S,l=!0,E=!1){let f=g.name,h=e.sourceCode.getScope(c).references.find(y=>y.identifier.name===f)?.resolved,T=a&&rn?.some(y=>y.test(f)),m=E&&n;if(!h||!T&&h.references.filter(y=>y.isTypeReference).length>1||!h.defs[0])return;let b=h.defs[0].node,C=b.parent?.type===Y.AST_NODE_TYPES.ExportNamedDeclaration;if(!(l&&C&&!m)){if(b.type===Y.AST_NODE_TYPES.TSTypeAliasDeclaration){o(a,c,S,b.typeAnnotation,!0,E);return}if(b.type===Y.AST_NODE_TYPES.TSInterfaceDeclaration){o(a,c,S,b.body,!0,E);return}}}function o(a,c,g,S,l,E=!1){if(S.type===Y.AST_NODE_TYPES.TSInterfaceBody){for(let f of S.body)f.type===Y.AST_NODE_TYPES.TSPropertySignature&&f.key.type===Y.AST_NODE_TYPES.Identifier&&g.set(f.key.name,f);return}if(S.type===Y.AST_NODE_TYPES.TSTypeLiteral){Tr(g,...Sr(S));return}if(S.type===Y.AST_NODE_TYPES.TSIntersectionType){for(let f of S.types)o(a,c,g,f,!0,E);return}l||S.type===Y.AST_NODE_TYPES.TSTypeReference&&S.typeName.type===Y.AST_NODE_TYPES.Identifier&&s(a,c,S.typeName,g,!0,E)}function i(a,c,g,S=!1){for(let l of g)if(l.type===Y.AST_NODE_TYPES.ObjectPattern&&l.typeAnnotation){let E=new Map;if(o(a,c,E,l.typeAnnotation.typeAnnotation,!1,S),E.size===0)continue;p(l,E)}else l.type===Y.AST_NODE_TYPES.AssignmentPattern&&l.left.type===Y.AST_NODE_TYPES.ObjectPattern&&i(a,c,[l.left],S)}function p(a,c){let g=[];if(a.properties.at(-1)?.type===Y.AST_NODE_TYPES.RestElement)return;for(let f of a.properties)f.type===Y.AST_NODE_TYPES.Property&&f.key.type===Y.AST_NODE_TYPES.Identifier&&g.push(f.key.name);let l=[],E=[];for(let[f,h]of c)g.includes(f)||(E.push(f),l.push({node:h,messageId:"unusedObjectTypeProperty",data:{propertyName:f}}));for(let[f,h]of l.entries())e.report({...h,fix:f===l.length-1?T=>{let m=a.properties.at(-1),b=E.join(", ");return m?m.type===Y.AST_NODE_TYPES.RestElement?null:T.insertTextAfter(m,`, ${b}`):T.insertTextBeforeRange([a.range[0]+1,a.range[1]],b)}:void 0})}return{VariableDeclaration(a){let c=a.declarations[0],g=new Map,S=c.id.type===Y.AST_NODE_TYPES.Identifier&&c.id.typeAnnotation?.typeAnnotation.type===Y.AST_NODE_TYPES.TSTypeReference&&c.id.typeAnnotation.typeAnnotation.typeName.type===Y.AST_NODE_TYPES.Identifier&&c.id.typeAnnotation.typeAnnotation.typeName.name==="FC"&&c.id.typeAnnotation.typeAnnotation.typeArguments?.params[0];if(S){if(S.type===Y.AST_NODE_TYPES.TSTypeReference&&S.typeName.type===Y.AST_NODE_TYPES.Identifier)s(!0,a,S.typeName,g,!1);else if(S.type===Y.AST_NODE_TYPES.TSTypeLiteral)Tr(g,...Sr(S));else if(S.type===Y.AST_NODE_TYPES.TSIntersectionType)for(let l of S.types)l.type===Y.AST_NODE_TYPES.TSTypeReference&&l.typeName.type===Y.AST_NODE_TYPES.Identifier?s(!0,a,l.typeName,g,!1):o(!0,a,g,l,!0);if(g.size!==0&&c.init?.type===Y.AST_NODE_TYPES.ArrowFunctionExpression){let l=c.init.params[0];if(!l){e.report({node:c.init,messageId:"missingComponentParam"});return}l.type===Y.AST_NODE_TYPES.ObjectPattern&&p(l,g)}}},FunctionDeclaration(a){i(!1,a,a.params,n)},ArrowFunctionExpression(a){i(!1,a,a.params,n)}}}}),sn={name:hr,rule:io};var Ee=require("@typescript-eslint/utils");var on=_({name:"no-write-only-ref",meta:{type:"problem",docs:{description:"Disallow creating refs that are never read"},messages:{refNotRead:'Ref "{{name}}" is never read. Consider removing it if not needed.'},schema:[]},defaultOptions:[],create(e){let t=new Set;function r(n){return n.callee.type===Ee.AST_NODE_TYPES.Identifier?t.has(n.callee.name):n.callee.type===Ee.AST_NODE_TYPES.MemberExpression&&n.callee.object.type===Ee.AST_NODE_TYPES.Identifier&&n.callee.property.type===Ee.AST_NODE_TYPES.Identifier?n.callee.property.name==="useRef":!1}return{ImportDeclaration(n){if(n.source.value==="react")for(let s of n.specifiers)s.type===Ee.AST_NODE_TYPES.ImportSpecifier&&s.imported.type===Ee.AST_NODE_TYPES.Identifier&&s.imported.name==="useRef"&&t.add(s.local.name)},VariableDeclarator(n){if(n.init&&n.init.type===Ee.AST_NODE_TYPES.CallExpression&&r(n.init)&&n.id.type===Ee.AST_NODE_TYPES.Identifier){let o=e.sourceCode.getScope(n).set.get(n.id.name);if(o){let i=!1;for(let p of o.references){let c=p.identifier.parent;if(c!==n&&!(c.type===Ee.AST_NODE_TYPES.JSXExpressionContainer&&c.parent.type===Ee.AST_NODE_TYPES.JSXAttribute&&c.parent.name.type===Ee.AST_NODE_TYPES.JSXIdentifier&&c.parent.name.name==="ref")){i=!0;break}}i||e.report({node:n.id,messageId:"refNotRead",data:{name:n.id.name}})}}}}}});var qe=require("@typescript-eslint/utils"),so=qe.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),br="prefer-named-functions",Er=new Map,oo=so({name:br,meta:{hasSuggestions:!0,type:"suggestion",docs:{description:"Prevent using arrow functions when a named function can be used instead"},schema:[{type:"object",properties:{ignoreRegex:{type:"string"},disallowArrowFnWithImplicitReturns:{type:"boolean"}}}],messages:{suggestion:"Convert to named function",default:'Function {{functionName}} should be defined as a named function "function {{functionName}} () {}" instead of an arrow function',withIgnoreRegex:'Function {{functionName}} should be defined as a named function "function {{functionName}} () {}", if not possible to use `function` you can also use a name that matches the rule ignore regex'}},defaultOptions:[{}],create(e,[t]){let r=null;if(t.ignoreRegex){let n=Er.get(t.ignoreRegex);n?r=n:(r=new RegExp(t.ignoreRegex),Er.set(t.ignoreRegex,r))}return{VariableDeclarator(n){if(n.init&&n.init.type===qe.AST_NODE_TYPES.ArrowFunctionExpression&&n.id.type===qe.AST_NODE_TYPES.Identifier){let s=n.id.name;if(n.id.typeAnnotation||r&&r.test(s)||!t.disallowArrowFnWithImplicitReturns&&n.init.body.type!==qe.AST_NODE_TYPES.BlockStatement)return;let o=n.parent,i=n.init.params,p=n.init.body,a=n.init;e.report({node:n.id,messageId:r?"withIgnoreRegex":"default",data:{functionName:s,ignoreRegex:t.ignoreRegex},suggest:[{messageId:"suggestion",fix:c=>c.replaceText(o,`${a.async?"async ":""}function ${s}(${i.map(g=>e.sourceCode.getText(g)).join(", ")||""}) ${e.sourceCode.getText(p)}`)}]})}}}}}),an={name:br,rule:oo};var U=require("@typescript-eslint/utils"),Pe=require("zod/v4");var ao=Pe.z.object({disallowedFunctions:Pe.z.array(Pe.z.object({name:Pe.z.string(),allowUsingWithArgs:Pe.z.boolean().optional(),hookAlternative:Pe.z.string().optional(),message:Pe.z.string().optional(),allowUseInside:Pe.z.array(Pe.z.string()).optional()}))}),lo=/^use[A-Z]/,po=/^[A-Z]/;function St(e){return lo.test(e)}function xr(e){return po.test(e)}function co(e){return e.type===U.AST_NODE_TYPES.Identifier?St(e.name):e.type===U.AST_NODE_TYPES.MemberExpression&&e.property.type===U.AST_NODE_TYPES.Identifier?St(e.property.name):!1}function Cr(e,t){return e.type===U.AST_NODE_TYPES.Identifier?e.name===t:e.type===U.AST_NODE_TYPES.MemberExpression&&e.object.type===U.AST_NODE_TYPES.Identifier&&e.property.type===U.AST_NODE_TYPES.Identifier?e.object.name==="React"&&e.property.name===t:!1}function Ar(e){return!!(e.parent&&e.parent.type===U.AST_NODE_TYPES.CallExpression&&Cr(e.parent.callee,"forwardRef"))}function Ir(e){return!!(e.parent&&e.parent.type===U.AST_NODE_TYPES.CallExpression&&Cr(e.parent.callee,"memo"))}function ln(e){if(e.type===U.AST_NODE_TYPES.FunctionDeclaration||e.type===U.AST_NODE_TYPES.FunctionExpression&&e.id)return e.id||void 0;if(e.type===U.AST_NODE_TYPES.FunctionExpression||e.type===U.AST_NODE_TYPES.ArrowFunctionExpression){if(e.parent.type===U.AST_NODE_TYPES.VariableDeclarator&&e.parent.init===e)return e.parent.id;if(e.parent.type===U.AST_NODE_TYPES.AssignmentExpression&&e.parent.right===e&&e.parent.operator==="=")return e.parent.left;if(e.parent.type===U.AST_NODE_TYPES.Property&&e.parent.value===e&&!e.parent.computed)return e.parent.key;if(e.parent.type===U.AST_NODE_TYPES.AssignmentPattern&&e.parent.right===e)return e.parent.left}}function uo(e){let t=e.parent,r=!1;for(;t;){if(t.type===U.AST_NODE_TYPES.FunctionDeclaration||t.type===U.AST_NODE_TYPES.FunctionExpression||t.type===U.AST_NODE_TYPES.ArrowFunctionExpression){let n=ln(t);if(n&&n.type===U.AST_NODE_TYPES.Identifier){if(xr(n.name)||St(n.name))return!r;r=!0}else{if(Ar(t)||Ir(t))return!r;if(t.parent.type===U.AST_NODE_TYPES.CallExpression){let s=t.parent;co(s.callee)||(r=!0)}else t.parent.type===U.AST_NODE_TYPES.JSXExpressionContainer||(r=!0)}}t=t.parent}return!1}function wr(e){return e.callee.type===U.AST_NODE_TYPES.Identifier?e.callee.name:e.callee.type===U.AST_NODE_TYPES.MemberExpression&&e.callee.property.type===U.AST_NODE_TYPES.Identifier?e.callee.property.name:null}function fo(e,t){if(!t.length)return!1;let r=e.parent;for(;r;){if(r.type===U.AST_NODE_TYPES.FunctionDeclaration||r.type===U.AST_NODE_TYPES.FunctionExpression||r.type===U.AST_NODE_TYPES.ArrowFunctionExpression){let n=ln(r);if(n&&n.type===U.AST_NODE_TYPES.Identifier&&t.includes(n.name))return!0}else if(r.type===U.AST_NODE_TYPES.CallExpression){let n=wr(r);if(n&&t.includes(n))return!0}r=r.parent}return!1}function mo(e){return e.arguments.length>0&&!e.arguments.every(t=>t.type===U.AST_NODE_TYPES.Identifier&&t.name==="undefined")}function yo(e,t){let r=!1,n=e.parent;for(;n;){if(n.type===U.AST_NODE_TYPES.FunctionDeclaration||n.type===U.AST_NODE_TYPES.FunctionExpression||n.type===U.AST_NODE_TYPES.ArrowFunctionExpression){let s=ln(n);if(s&&s.type===U.AST_NODE_TYPES.Identifier){if(xr(s.name)||St(s.name)){r=!0;break}}else if(Ar(n)||Ir(n)){r=!0;break}}n=n.parent}return r?t.length===0?uo(e):!fo(e,t):!1}var pn=_({name:"prefer-react-hook-alternative",meta:{type:"suggestion",docs:{description:"Prefer hook alternatives for certain functions in React components and hooks"},messages:{preferHookAlternative:"This function should not be used in react{{message}}."},schema:[$(ao)],hasSuggestions:!0},defaultOptions:[{disallowedFunctions:[]}],create(e,[t]){let{disallowedFunctions:r}=t,n=new Map(r.map(s=>[s.name,s]));return{CallExpression(s){let o=wr(s);if(!o)return;let i=n.get(o);if(!i||i.allowUsingWithArgs&&mo(s))return;let p=i.allowUseInside||[];yo(s,p)&&e.report({node:s,messageId:"preferHookAlternative",data:{message:i.message?` ${i.message}`:` use ${i.hookAlternative} instead`},suggest:i.hookAlternative?[{messageId:"preferHookAlternative",data:{message:`Replace with ${i.hookAlternative}`,hookAlternative:i.hookAlternative},fix:a=>{let c=i.hookAlternative;return c?s.callee.type===U.AST_NODE_TYPES.Identifier?a.replaceText(s.callee,c):s.callee.type===U.AST_NODE_TYPES.MemberExpression&&s.callee.property.type===U.AST_NODE_TYPES.Identifier?a.replaceText(s.callee.property,c):null:null}}]:[]})}}}});var ee=require("@typescript-eslint/utils"),Tt=xe(require("zod/v4"));var go=ee.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),Pr="prefer-single-line-if",So=Tt.default.object({maxLineLength:Tt.default.number().optional(),maxNonSimpleConditionLength:Tt.default.number().optional()}),To=go({name:Pr,meta:{type:"suggestion",fixable:"code",docs:{description:"Enforce single-line if in simple if statements"},messages:{noSingleLineCurly:"If return statement with single statement body should be written in a single line"},schema:[$(So)]},defaultOptions:[{}],create(e,[t]){let r=e.sourceCode;return{IfStatement(n){if(n.consequent.type!==ee.AST_NODE_TYPES.BlockStatement||n.loc.start.line===n.loc.end.line||r.getCommentsInside(n.consequent).length>0||n.alternate||n.consequent.body.length!==1)return;let o=n.consequent.body[0];if(!o)return;if(o.type===ee.AST_NODE_TYPES.ReturnStatement){if(!kr(o))return}else if(!(o.type===ee.AST_NODE_TYPES.ContinueStatement||o.type===ee.AST_NODE_TYPES.BreakStatement))return;if(n.test.type===ee.AST_NODE_TYPES.LogicalExpression||n.test.type===ee.AST_NODE_TYPES.ConditionalExpression)return;let i;if(t.maxNonSimpleConditionLength){let S=Rr(n.test);if(!S&&n.test.type===ee.AST_NODE_TYPES.UnaryExpression&&n.test.operator==="!"){let l=n.test.argument;Rr(l)&&(S=!0)}if(S&&(i=r.getText(n.test),i.length>t.maxNonSimpleConditionLength))return}i||(i=r.getText(n.test));let p=r.getText(o);if(i.includes(`
18
- `))return;let a=r.getTokenAfter(n);if(a&&a.type===ee.AST_TOKEN_TYPES.Punctuator&&a.value==="}"){let S=r.getTokenAfter(a);if(S&&S.type===ee.AST_TOKEN_TYPES.Keyword&&(S.value==="else"||S.value==="catch"))return}let c=ho(r,n),g=`if (${i}) ${p}`;t.maxLineLength&&g.length+c.length>t.maxLineLength||e.report({node:n,messageId:"noSingleLineCurly",fix:S=>S.replaceText(n,g)})}}}});function Rr(e){return e.type===ee.AST_NODE_TYPES.CallExpression||e.type===ee.AST_NODE_TYPES.BinaryExpression||e.type===ee.AST_NODE_TYPES.MemberExpression&&vr(e)}function vr(e){return e.object.type===ee.AST_NODE_TYPES.MemberExpression?vr(e.object):e.object.type!==ee.AST_NODE_TYPES.Identifier}function ho(e,t){return e.text.slice(t.range[0]-t.loc.start.column,t.range[0])}function kr(e){if(!e.argument)return!0;let t=e.argument;return t.type===ee.AST_NODE_TYPES.ArrayExpression&&t.elements.length===0||t.type===ee.AST_NODE_TYPES.ObjectExpression&&t.properties.length===0||t.type===ee.AST_NODE_TYPES.Literal||t.type===ee.AST_NODE_TYPES.Identifier||t.type===ee.AST_NODE_TYPES.TemplateLiteral||t.type===ee.AST_NODE_TYPES.TaggedTemplateExpression?!0:t.type===ee.AST_NODE_TYPES.CallExpression?t.arguments.length===0:t.type===ee.AST_NODE_TYPES.UnaryExpression?kr(t):!1}var cn={name:Pr,rule:To};var N=require("@typescript-eslint/utils"),fn=require("zod/v4");var Eo=N.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),Dr="react-compiler-extra",bo=fn.z.object({runOnlyWithEnableCompilerDirective:fn.z.boolean().optional()}),xo=/eslint +react-compiler\/react-compiler: +\["error/;function jr(e){return e.type===N.AST_NODE_TYPES.Identifier?e.name.startsWith("use"):!1}function Co(e){return e.type===N.AST_NODE_TYPES.Identifier?e.name.startsWith("use"):e.type===N.AST_NODE_TYPES.MemberExpression&&e.property.type===N.AST_NODE_TYPES.Identifier?e.property.name.startsWith("use"):!1}function ve(e){if(!e)return!1;switch(e.type){case N.AST_NODE_TYPES.JSXElement:case N.AST_NODE_TYPES.JSXFragment:return!0;case N.AST_NODE_TYPES.ConditionalExpression:return ve(e.consequent)||ve(e.alternate);case N.AST_NODE_TYPES.LogicalExpression:return e.operator==="&&"?ve(e.right):e.operator==="||"?ve(e.left)||ve(e.right):!1;case N.AST_NODE_TYPES.CallExpression:if(e.callee.type===N.AST_NODE_TYPES.MemberExpression&&e.callee.object.type===N.AST_NODE_TYPES.Identifier&&e.callee.object.name==="React"&&e.callee.property.type===N.AST_NODE_TYPES.Identifier&&e.callee.property.name==="createElement")return!0;for(let t of e.arguments)if(t.type!==N.AST_NODE_TYPES.SpreadElement&&ve(t))return!0;return!1;default:return!1}}function Ao(e){let t=e.typeAnnotation;if(t.type===N.AST_NODE_TYPES.TSTypeReference){if(t.typeName.type===N.AST_NODE_TYPES.Identifier)return t.typeName.name==="FC";if(t.typeName.type===N.AST_NODE_TYPES.TSQualifiedName&&t.typeName.left.type===N.AST_NODE_TYPES.Identifier&&t.typeName.right.type===N.AST_NODE_TYPES.Identifier)return t.typeName.left.name==="React"&&t.typeName.right.name==="FC"}return!1}var Io=/^[A-Z][a-zA-Z0-9]*$/;function st(e){return Io.test(e)}function mn(e){return e.startsWith("use")&&e.length>3}function yn(e,t,r,n){if(r&&Ao(r))return t?st(t.name):e.type===N.AST_NODE_TYPES.FunctionDeclaration&&e.id?st(e.id.name):!0;if(t&&mn(t.name)||e.type===N.AST_NODE_TYPES.FunctionDeclaration&&e.id&&mn(e.id.name))return!0;if(n){let s=t?.name||e.type===N.AST_NODE_TYPES.FunctionDeclaration&&e.id?.name;if(s&&st(s)&&Lr(e.body,n).containsJSX)return!0}return!1}function it(e){if(e.body.type===N.AST_NODE_TYPES.BlockStatement){for(let t of e.body.body)if(t.type===N.AST_NODE_TYPES.ExpressionStatement&&t.expression.type===N.AST_NODE_TYPES.Literal&&typeof t.expression.value=="string"&&t.expression.value==="use memo")return!0}return!1}function Lr(e,t){let r={containsJSX:!1,containsHookCalls:!1};return we(e,n=>{if(r.containsJSX&&r.containsHookCalls)return!0;switch(n.type){case N.AST_NODE_TYPES.JSXElement:case N.AST_NODE_TYPES.JSXFragment:r.containsJSX=!0;break;case N.AST_NODE_TYPES.CallExpression:jr(n.callee)&&(r.containsHookCalls=!0),ve(n)&&(r.containsJSX=!0);break;case N.AST_NODE_TYPES.ReturnStatement:n.argument&&ve(n.argument)&&(r.containsJSX=!0);break;case N.AST_NODE_TYPES.VariableDeclarator:n.init&&ve(n.init)&&(r.containsJSX=!0);break;case N.AST_NODE_TYPES.AssignmentExpression:ve(n.right)&&(r.containsJSX=!0);break}},t),r}function Fr(e,t){let r=e.body,n=Lr(r,t);return n.containsJSX||n.containsHookCalls}var wo=/\bthis[.[]/;function Or(e){return wo.test(e)}function Ro(e,t){let r={containsJSX:!1,containsHookCalls:!1};return we(e,n=>{if(r.containsHookCalls||(n.type===N.AST_NODE_TYPES.FunctionDeclaration||n.type===N.AST_NODE_TYPES.FunctionExpression||n.type===N.AST_NODE_TYPES.ArrowFunctionExpression)&&n!==e)return!0;n.type===N.AST_NODE_TYPES.CallExpression&&Co(n.callee)&&(r.containsHookCalls=!0)},t),r}function Nr(e){return st(e)||mn(e)}function un(e,t,r,n){if(!Ro(e.body,t).containsHookCalls)return!1;let o=yn(e,r,n,t);if(!o&&n){let i=r?.name||e.type===N.AST_NODE_TYPES.FunctionDeclaration&&e.id?.name;i&&st(i)&&(o=!0)}return!o}var Po=Eo({name:Dr,meta:{type:"suggestion",fixable:"code",docs:{description:"Extra rules to enforce best practices when using the React compiler"},messages:{objectMethodIsNotSupported:"Object methods such as `{ method() {} }` have limited support to optimizations in the React compiler, use a function expression `{ method: () => {} }` instead.",replaceWithFunctionExpression:"Replace with function expression",thisKeywordInMethod:"Object method uses `this` keyword which would have different behavior if converted to an arrow function. Fix this manually.",fcComponentShouldReturnJsx:'React components and hooks should create JSX elements, call other hooks or use the "use memo" directive for optimal React compiler detection.',addUseMemoDirective:'Add "use memo" directive to opt into React compiler memoization',functionCallingHooksMustBeComponent:'Functions calling hooks must be React components (PascalCase with FC type) or hooks (start with "use").',useMemoDirectiveNaming:'Functions using "use memo" directive must follow React naming conventions (PascalCase for components or start with "use" for hooks).'},hasSuggestions:!0,schema:[$(bo)]},defaultOptions:[{}],create(e,[t]){let r=!1;if(t.runOnlyWithEnableCompilerDirective){for(let o of e.sourceCode.getAllComments())if(xo.test(o.value)){r=!0;break}if(!r)return{}}function n(o){for(let i of o.properties)if(i.type===N.AST_NODE_TYPES.Property&&i.method&&i.value.type===N.AST_NODE_TYPES.FunctionExpression){let p=e.sourceCode,a=p.getText(i.key),c=i.value,g=p.getText(c.body);if(Or(g))e.report({node:i,messageId:"thisKeywordInMethod"});else{let S=c.params.map(E=>p.getText(E)).join(", "),l="";c.generator?l=`${a}: function* (${S}) ${g}`:l=`${a}: (${S}) => ${g}`,e.report({node:i,messageId:"objectMethodIsNotSupported",fix:E=>E.replaceText(i,l)})}}}function s(o){for(let i of o.properties)if(i.type===N.AST_NODE_TYPES.Property&&i.value.type===N.AST_NODE_TYPES.ObjectExpression){for(let p of i.value.properties)if(p.type===N.AST_NODE_TYPES.Property&&p.method&&p.value.type===N.AST_NODE_TYPES.FunctionExpression){let c=e.sourceCode.getText(p.value.body);Or(c)&&e.report({node:p,messageId:"thisKeywordInMethod"})}}}return{CallExpression(o){if(jr(o.callee))for(let i of o.arguments){if(i.type===N.AST_NODE_TYPES.ObjectExpression&&(n(i),s(i)),i.type===N.AST_NODE_TYPES.ArrowFunctionExpression&&(i.body.type===N.AST_NODE_TYPES.ObjectExpression&&(n(i.body),s(i.body)),i.body.type===N.AST_NODE_TYPES.BlockStatement))for(let p of i.body.body)p.type===N.AST_NODE_TYPES.ReturnStatement&&p.argument?.type===N.AST_NODE_TYPES.ObjectExpression&&(n(p.argument),s(p.argument));if(i.type===N.AST_NODE_TYPES.FunctionExpression)for(let p of i.body.body)p.type===N.AST_NODE_TYPES.ReturnStatement&&p.argument?.type===N.AST_NODE_TYPES.ObjectExpression&&(n(p.argument),s(p.argument))}},VariableDeclarator(o){if(o.id.type===N.AST_NODE_TYPES.Identifier&&o.init&&(o.init.type===N.AST_NODE_TYPES.ArrowFunctionExpression||o.init.type===N.AST_NODE_TYPES.FunctionExpression)){let i=o.init,p=o.id,a=o.id.typeAnnotation;if(it(i)&&!Nr(p.name)){e.report({node:i,messageId:"useMemoDirectiveNaming"});return}if(un(i,e.sourceCode,p,a)){e.report({node:i,messageId:"functionCallingHooksMustBeComponent"});return}if(yn(i,p,a,e.sourceCode)){let c=Fr(i,e.sourceCode),g=it(i);!c&&!g&&e.report({node:i,messageId:"fcComponentShouldReturnJsx",suggest:[{messageId:"addUseMemoDirective",fix(S){if(i.body.type===N.AST_NODE_TYPES.BlockStatement){let l=i.body.range[0]+1;return S.insertTextAfterRange([l,l],`
17
+ `)}return""}return{Program(){let a=[];for(let l of n.body)l.type===ge.AST_NODE_TYPES.ExpressionStatement&&l.expression.type===ge.AST_NODE_TYPES.CallExpression&&l.expression.callee.type===ge.AST_NODE_TYPES.Identifier&&l.expression.callee.name==="describe"&&l.expression.arguments.length===2&&a.push(l.expression);if(!i(a))return;let[c]=a;if(!c)return;let g=s(c);if(o(g))return;let S=n.body.find(l=>l.type===ge.AST_NODE_TYPES.ExpressionStatement&&l.expression===c);!S||S.type!==ge.AST_NODE_TYPES.ExpressionStatement||e.report({node:c,messageId:"unnecessaryDescribe",suggest:[{messageId:"removeDescribe",fix(l){let E=p(c);return E?l.replaceText(S,E):null}}]})}}}});var nt=require("@typescript-eslint/utils"),Re=xe(require("zod/v4"));var Vs=Re.object({methods:Re.union([Re.array(Re.string()),Re.literal("array")])}),Gt=_({name:"no-unnecessary-typing",meta:{type:"suggestion",docs:{description:"Prevents unnecessary explicit type annotations in callback parameters where TypeScript can infer the type"},messages:{unnecessaryTypeAnnotation:"Unnecessary type annotation. TypeScript can infer this type from context."},fixable:"code",schema:[$(Vs)]},defaultOptions:[{methods:"array"}],create(e,[t]){let r=t.methods,n=new Set(["find","filter","map","forEach","some","every","reduce","findIndex","sort"]);function s(p){return Array.isArray(r)?r.includes(p):n.has(p)}function o(p){let{callee:a}=p;if(a.type===nt.AST_NODE_TYPES.MemberExpression){let c=a.property;if(c.type===nt.AST_NODE_TYPES.Identifier)return c.name}return null}function i(p,a){if(p.type!==nt.AST_NODE_TYPES.Identifier||!p.typeAnnotation)return;let c=a.parent;if(c.type===nt.AST_NODE_TYPES.CallExpression){let g=o(c);g&&s(g)&&c.arguments.indexOf(a)===0&&e.report({node:p.typeAnnotation,messageId:"unnecessaryTypeAnnotation",fix(l){return p.typeAnnotation?l.remove(p.typeAnnotation):null}})}}return{ArrowFunctionExpression(p){for(let a of p.params)i(a,p)},FunctionExpression(p){for(let a of p.params)i(a,p)}}}});var ye=require("@typescript-eslint/utils");var Kt=_({name:"no-unused-obj-props",meta:{type:"suggestion",docs:{description:"Disallow unused properties when it is safe to remove them"},messages:{unusedObjectProperty:'The object property "{{name}}" is not being used',unusedReturnObjectProperty:'The object property "{{name}}" returned by this function is not being used'},schema:[]},defaultOptions:[],create(e){return{VariableDeclarator(t){if(t.id.type===ye.AST_NODE_TYPES.ObjectPattern||!t.init||t.init.type!==ye.AST_NODE_TYPES.ObjectExpression||t.id.type===ye.AST_NODE_TYPES.Identifier&&t.id.typeAnnotation||t.parent.parent.type===ye.AST_NODE_TYPES.ExportNamedDeclaration)return;let r=new Map;for(let i of t.init.properties)i.type===ye.AST_NODE_TYPES.Property&&i.key.type===ye.AST_NODE_TYPES.Identifier&&r.set(i.key.name,i);if(r.size===0||t.id.type!==ye.AST_NODE_TYPES.Identifier)return;let n=Xs(t,e.sourceCode);if(n.length===0)return;let s=t.init.properties.some(i=>i.type!==ye.AST_NODE_TYPES.Property?!1:i.value.type===ye.AST_NODE_TYPES.FunctionExpression),o=new Set;for(let i of n){if(i.identifier.parent.type!==ye.AST_NODE_TYPES.MemberExpression)return;let p=i.identifier.parent;if(p.object!==i.identifier)return;if(p.computed)if(p.property.type===ye.AST_NODE_TYPES.Literal&&typeof p.property.value=="string")o.add(p.property.value);else return;else{if(p.property.type!==ye.AST_NODE_TYPES.Identifier)return;o.add(p.property.name)}if(p.parent.type===ye.AST_NODE_TYPES.CallExpression&&s)return}for(let[i,p]of r)o.has(i)||e.report({node:p,messageId:"unusedObjectProperty",data:{name:i}})}}}});function Xs(e,t){let r=t.getDeclaredVariables(e);if(r.length!==1)return[];let n=r[0];return n?n.references.filter(s=>s.identifier!==e.id):[]}var X=require("@typescript-eslint/utils"),Qt=require("zod/v4");var Hs=Qt.z.object({ignoreArgsMatching:Qt.z.string().optional()}),en=_({name:"no-unused-optional-args",meta:{type:"problem",docs:{description:"Detect unused optional function arguments in non-exported functions"},messages:{unusedOptionalArg:"Optional parameter '{{name}}' is never used",unusedOptionalProp:"Optional prop '{{name}}' is never provided"},schema:[$(Hs)]},defaultOptions:[{}],create(e,[t]){let r=[];function n(i){return t.ignoreArgsMatching?new RegExp(t.ignoreArgsMatching).test(i):!1}function s(i){return i.type===X.AST_NODE_TYPES.ExportNamedDeclaration||i.type===X.AST_NODE_TYPES.ExportDefaultDeclaration||i.parent?.type===X.AST_NODE_TYPES.ExportNamedDeclaration||i.parent?.type===X.AST_NODE_TYPES.ExportDefaultDeclaration}function o(i){let p=[];for(let a=0;a<i.length;a++){let c=i[a];if(!c||c.type!==X.AST_NODE_TYPES.Identifier)continue;let g=c.name;if(!n(g)){if(c.optional&&c.typeAnnotation&&c.typeAnnotation.typeAnnotation.type===X.AST_NODE_TYPES.TSTypeLiteral){let S=c.typeAnnotation.typeAnnotation,l=[];for(let E of S.members)E.type===X.AST_NODE_TYPES.TSPropertySignature&&E.key.type===X.AST_NODE_TYPES.Identifier&&l.push({name:E.key.name,optional:E.optional===!0});l.some(E=>E.optional)?p.push({param:c,index:a,name:g,isObjectParam:!0,objectProps:l}):p.push({param:c,index:a,name:g,isObjectParam:!1})}else if(c.optional)p.push({param:c,index:a,name:g,isObjectParam:!1});else if(c.typeAnnotation&&c.typeAnnotation.typeAnnotation.type===X.AST_NODE_TYPES.TSTypeLiteral){let S=c.typeAnnotation.typeAnnotation,l=[];for(let E of S.members)E.type===X.AST_NODE_TYPES.TSPropertySignature&&E.key.type===X.AST_NODE_TYPES.Identifier&&l.push({name:E.key.name,optional:E.optional===!0});l.some(E=>E.optional)&&p.push({param:c,index:a,name:g,isObjectParam:!0,objectProps:l})}}}return p}return{FunctionDeclaration(i){if(s(i))return;let p=o(i.params);p.length!==0&&r.push({node:i,declarationNode:i,optionalParams:p})},VariableDeclarator(i){if(i.id.type!==X.AST_NODE_TYPES.Identifier||!i.init||i.init.type!==X.AST_NODE_TYPES.ArrowFunctionExpression&&i.init.type!==X.AST_NODE_TYPES.FunctionExpression||s(i.parent.parent))return;let a=[...o(i.init.params)];if(i.id.typeAnnotation&&i.id.typeAnnotation.typeAnnotation.type===X.AST_NODE_TYPES.TSTypeReference){let c=i.id.typeAnnotation.typeAnnotation;if(c.typeName.type===X.AST_NODE_TYPES.Identifier&&c.typeName.name==="FC"){let g=c.typeArguments;if(g&&g.params.length===1){let S=g.params[0];if(S&&S.type===X.AST_NODE_TYPES.TSTypeLiteral){let l=[];for(let E of S.members)E.type===X.AST_NODE_TYPES.TSPropertySignature&&E.key.type===X.AST_NODE_TYPES.Identifier&&l.push({name:E.key.name,optional:E.optional===!0});l.some(E=>E.optional)&&a.push({param:i.id,index:0,name:"props",isObjectParam:!0,objectProps:l})}}}}a.length!==0&&r.push({node:i.init,declarationNode:i,optionalParams:a})},"Program:exit"(){for(let i of r){let a=e.sourceCode.getDeclaredVariables(i.declarationNode)[0];if(!a)continue;let c=a.references.filter(l=>l.identifier!==a.identifiers[0]);if(c.length===0)continue;let g=!1;for(let l of c){let E=l.identifier.parent;if(E.type===X.AST_NODE_TYPES.CallExpression&&l.identifier.type===X.AST_NODE_TYPES.Identifier&&E.arguments.includes(l.identifier)){g=!0;break}if(E.type===X.AST_NODE_TYPES.ReturnStatement){g=!0;break}if(E.type===X.AST_NODE_TYPES.Property&&E.parent.type===X.AST_NODE_TYPES.ObjectExpression&&E.parent.parent.type===X.AST_NODE_TYPES.ReturnStatement){g=!0;break}if(E.type===X.AST_NODE_TYPES.JSXExpressionContainer){g=!0;break}}if(g)continue;let S=[];for(let l of c){let E=l.identifier.parent;if(E.type===X.AST_NODE_TYPES.CallExpression&&E.callee===l.identifier){let f=E.arguments.length,h=E.arguments.some(m=>m.type===X.AST_NODE_TYPES.SpreadElement);if(h){g=!0;break}let T={argCount:f,hasSpread:h};for(let m of i.optionalParams)if(m.isObjectParam&&m.index<f){let b=E.arguments[m.index];if(b?.type===X.AST_NODE_TYPES.ObjectExpression){let C={};for(let y of b.properties)y.type===X.AST_NODE_TYPES.Property&&y.key.type===X.AST_NODE_TYPES.Identifier&&(C[y.key.name]=!0);T.objectArgs||(T.objectArgs=[]),T.objectArgs[m.index]=C}else if(b){g=!0;break}}S.push(T)}else if(E.type===X.AST_NODE_TYPES.JSXOpeningElement&&E.name===l.identifier){let f=E.attributes.some(T=>T.type===X.AST_NODE_TYPES.JSXSpreadAttribute);if(f){g=!0;break}let h={argCount:1,hasSpread:f};for(let T of i.optionalParams)if(T.isObjectParam&&T.index===0){let m={};for(let b of E.attributes)b.type===X.AST_NODE_TYPES.JSXAttribute&&b.name.type===X.AST_NODE_TYPES.JSXIdentifier&&(m[b.name.name]=!0);h.objectArgs||(h.objectArgs=[]),h.objectArgs[0]=m}S.push(h)}}if(!(g||S.length===0))for(let l of i.optionalParams)if(l.isObjectParam&&l.objectProps)for(let E of l.objectProps){if(!E.optional)continue;let f=!1;for(let h of S)if(h.objectArgs&&h.objectArgs[l.index]){let T=h.objectArgs[l.index];if(T&&T[E.name]){f=!0;break}}f||e.report({node:l.param,messageId:"unusedOptionalProp",data:{name:E.name}})}else{let E=!1;for(let f of S)if(f.argCount>l.index){E=!0;break}E||e.report({node:l.param,messageId:"unusedOptionalArg",data:{name:l.name}})}}}}}});var K=require("@typescript-eslint/utils"),Ue=require("zod/v4");var Bs=Ue.z.object({selectors:Ue.z.array(Ue.z.object({name:Ue.z.string(),selectorProp:Ue.z.string().optional(),selectorArgPos:Ue.z.number().optional(),returnProp:Ue.z.string().optional()}))}),Ys=K.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),dr="no-unused-selected-values",tn={name:dr,rule:Ys({name:dr,meta:{type:"suggestion",docs:{description:"Disallow unused values in selector objects"},messages:{unusedSelectedValue:'The selected value "{{name}}" is not being used'},schema:[$(Bs)]},defaultOptions:[{selectors:[]}],create(e,[t]){let{selectors:r=[]}=t,n=new Map(r.map(s=>[s.name,s]));return{VariableDeclarator(s){let o=null;if(s.init?.type===K.AST_NODE_TYPES.CallExpression&&(o=s.init),!o)return;let i=Zs(o);if(!i)return;let p=n.get(i);if(!p)return;let a=qs(o,p.selectorArgPos??0,p.selectorProp);if(!a)return;let c=Gs(a);if(!c)return;let g=gr(c.properties,void 0);if(!g)return;if(s.id.type===K.AST_NODE_TYPES.ObjectPattern){let E=gr(s.id.properties,p.returnProp);if(!E)return;for(let[f,h]of g)E.has(f)||e.report({node:h,messageId:"unusedSelectedValue",data:{name:f}});return}if(s.id.type!==K.AST_NODE_TYPES.Identifier||p.returnProp)return;let S=Ks(s,e.sourceCode);if(S.length===0)return;let l=new Set;for(let E of S){if(E.identifier.parent.type!==K.AST_NODE_TYPES.MemberExpression)return;let f=E.identifier.parent.property;if(f.type!==K.AST_NODE_TYPES.Identifier)return;l.add(f.name)}for(let[E,f]of g)l.has(E)||e.report({node:f,messageId:"unusedSelectedValue",data:{name:E}})}}}})};function qs(e,t,r){let n=e.arguments[t];if(!n)return null;if(n.type===K.AST_NODE_TYPES.ArrowFunctionExpression||n.type===K.AST_NODE_TYPES.FunctionExpression)return n;if(r&&n.type===K.AST_NODE_TYPES.ObjectExpression){let s=n.properties.find(i=>i.type===K.AST_NODE_TYPES.Property&&i.key.type===K.AST_NODE_TYPES.Identifier&&i.key.name===r);if(s?.type!==K.AST_NODE_TYPES.Property)return null;let o=s.value;if(o.type===K.AST_NODE_TYPES.ArrowFunctionExpression||o.type===K.AST_NODE_TYPES.FunctionExpression)return o}return null}function Zs(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 Gs(e){if(e.body.type===K.AST_NODE_TYPES.ObjectExpression)return e.body;if(e.body.type===K.AST_NODE_TYPES.BlockStatement){let t=e.body.body.filter(r=>r.type===K.AST_NODE_TYPES.ReturnStatement);return t.length!==1||!t[0]||t[0].argument?.type!==K.AST_NODE_TYPES.ObjectExpression?null:t[0].argument}return null}function gr(e,t){let r=e;if(t){let s=e.find(o=>o.type===K.AST_NODE_TYPES.Property&&o.key.type===K.AST_NODE_TYPES.Identifier&&o.key.name===t);if(s?.type!==K.AST_NODE_TYPES.Property||s.value.type!==K.AST_NODE_TYPES.ObjectPattern)return null;r=s.value.properties}let n=new Map;for(let s of r){if(s.type!==K.AST_NODE_TYPES.Property||s.key.type!==K.AST_NODE_TYPES.Identifier)return null;n.set(s.key.name,s)}return n.size>0?n:null}function Ks(e,t){let r=t.getDeclaredVariables(e);if(r.length!==1)return[];let n=r[0];return n?n.references.filter(s=>s.identifier!==e.id):[]}var Q=require("@typescript-eslint/utils");var nn=_({name:"no-unused-t-state-field",meta:{type:"suggestion",docs:{description:"Prevent declaring unused t-state fields"},messages:{unusedField:'Field "{{name}}" is not being used, you can safely remove it'},schema:[]},defaultOptions:[],create(e){if(!(e.filename.endsWith(".jsx")||e.filename.endsWith(".tsx")))return{};if(!e.sourceCode.ast.body.some(o=>o.type===Q.AST_NODE_TYPES.ImportDeclaration&&o.source.value==="t-state-form"))return{};let n=null,s=!1;return{CallExpression(o){if(s)return;if(!n){let p=Qs(o);p&&(n=p);return}let i=eo(o,e.sourceCode);if(i){s=!0;for(let p of i)n.delete(p);if(n.size!==0)for(let[p,a]of n)e.report({node:a,messageId:"unusedField",data:{name:p}})}}}}});function Qs(e){if(!(e.callee.type===Q.AST_NODE_TYPES.Identifier&&e.callee.name==="useForm"))return null;let r=e.arguments[0];if(!r||r.type!==Q.AST_NODE_TYPES.ObjectExpression)return null;let n=Dt(r.properties,o=>o.type!==Q.AST_NODE_TYPES.Property||o.key.type!==Q.AST_NODE_TYPES.Identifier||o.key.name!=="initialConfig"?null:o.value.type===Q.AST_NODE_TYPES.ObjectExpression?o.value:o.value.type===Q.AST_NODE_TYPES.ArrowFunctionExpression||o.value.type===Q.AST_NODE_TYPES.FunctionExpression?to(o.value):null);if(!n)return null;let s=new Map;for(let o of n.properties)o.type===Q.AST_NODE_TYPES.Property&&o.key.type===Q.AST_NODE_TYPES.Identifier&&s.set(o.key.name,o);return s}function eo(e,t){if(!(e.callee.type===Q.AST_NODE_TYPES.Identifier&&e.callee.name==="useFormState")||e.parent.type!==Q.AST_NODE_TYPES.VariableDeclarator||e.parent.id.type!==Q.AST_NODE_TYPES.ObjectPattern||!Dt(e.parent.id.properties,i=>i.type===Q.AST_NODE_TYPES.Property&&i.key.type===Q.AST_NODE_TYPES.Identifier&&i.key.name==="formFields"&&i))return null;let s=Gn(e.parent,"formFields",t),o=new Set;for(let{identifier:i}of s){if(i.type!==Q.AST_NODE_TYPES.Identifier||i.parent.type===Q.AST_NODE_TYPES.Property&&i.parent.parent.type===Q.AST_NODE_TYPES.ObjectExpression&&i.parent.parent.parent.type===Q.AST_NODE_TYPES.ReturnStatement||i.parent.type===Q.AST_NODE_TYPES.ReturnStatement)return null;if(i.parent.type===Q.AST_NODE_TYPES.MemberExpression){if(i.parent.object.type!==Q.AST_NODE_TYPES.Identifier||i.parent.property.type!==Q.AST_NODE_TYPES.Identifier)return null;o.add(i.parent.property.name)}}return o}function to(e){if(e.body.type===Q.AST_NODE_TYPES.ObjectExpression)return e.body;if(e.body.type===Q.AST_NODE_TYPES.BlockStatement){let t=e.body.body.filter(r=>r.type===Q.AST_NODE_TYPES.ReturnStatement);return t.length!==1||!t[0]||t[0].argument?.type!==Q.AST_NODE_TYPES.ObjectExpression?null:t[0].argument}return null}var q=require("@typescript-eslint/utils"),rt=require("zod/v4");var no=q.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`);function Sr(e){let t=[];for(let r of e.members)r.type===q.AST_NODE_TYPES.TSPropertySignature&&r.key.type===q.AST_NODE_TYPES.Identifier&&t.push([r.key.name,r]);return t}function Tr(e,...t){for(let r of t)e.set(...r);return e}var ro=rt.z.object({forceCheckOnFCPropTypesWithName:rt.z.array(rt.z.string()).optional(),alwaysCheckFunctionOptionTypes:rt.z.boolean().optional()}),hr="no-unused-type-props-in-args",rn=null,io=no({name:hr,meta:{type:"problem",docs:{description:"Disallow unused undestructured object type properties"},messages:{unusedObjectTypeProperty:"Object type property '{{ propertyName }}' is defined but never used",missingComponentParam:"Component has declared props but no props are used"},schema:[$(ro)],fixable:"code"},defaultOptions:[{alwaysCheckFunctionOptionTypes:!0}],create(e,[t]){let{forceCheckOnFCPropTypesWithName:r,alwaysCheckFunctionOptionTypes:n=!0}=t;r&&!rn&&(rn=r.map(a=>new RegExp(a)));function s(a,c,g,S,l=!0,E=!1){let f=g.name,h=e.sourceCode.getScope(c).references.find(y=>y.identifier.name===f)?.resolved,T=a&&rn?.some(y=>y.test(f)),m=E&&n;if(!h||!T&&h.references.filter(y=>y.isTypeReference).length>1||!h.defs[0])return;let b=h.defs[0].node,C=b.parent?.type===q.AST_NODE_TYPES.ExportNamedDeclaration;if(!(l&&C&&!m)){if(b.type===q.AST_NODE_TYPES.TSTypeAliasDeclaration){o(a,c,S,b.typeAnnotation,!0,E);return}if(b.type===q.AST_NODE_TYPES.TSInterfaceDeclaration){o(a,c,S,b.body,!0,E);return}}}function o(a,c,g,S,l,E=!1){if(S.type===q.AST_NODE_TYPES.TSInterfaceBody){for(let f of S.body)f.type===q.AST_NODE_TYPES.TSPropertySignature&&f.key.type===q.AST_NODE_TYPES.Identifier&&g.set(f.key.name,f);return}if(S.type===q.AST_NODE_TYPES.TSTypeLiteral){Tr(g,...Sr(S));return}if(S.type===q.AST_NODE_TYPES.TSIntersectionType){for(let f of S.types)o(a,c,g,f,!0,E);return}l||S.type===q.AST_NODE_TYPES.TSTypeReference&&S.typeName.type===q.AST_NODE_TYPES.Identifier&&s(a,c,S.typeName,g,!0,E)}function i(a,c,g,S=!1){for(let l of g)if(l.type===q.AST_NODE_TYPES.ObjectPattern&&l.typeAnnotation){let E=new Map;if(o(a,c,E,l.typeAnnotation.typeAnnotation,!1,S),E.size===0)continue;p(l,E)}else l.type===q.AST_NODE_TYPES.AssignmentPattern&&l.left.type===q.AST_NODE_TYPES.ObjectPattern&&i(a,c,[l.left],S)}function p(a,c){let g=[];if(a.properties.at(-1)?.type===q.AST_NODE_TYPES.RestElement)return;for(let f of a.properties)f.type===q.AST_NODE_TYPES.Property&&f.key.type===q.AST_NODE_TYPES.Identifier&&g.push(f.key.name);let l=[],E=[];for(let[f,h]of c)g.includes(f)||(E.push(f),l.push({node:h,messageId:"unusedObjectTypeProperty",data:{propertyName:f}}));for(let[f,h]of l.entries())e.report({...h,fix:f===l.length-1?T=>{let m=a.properties.at(-1),b=E.join(", ");return m?m.type===q.AST_NODE_TYPES.RestElement?null:T.insertTextAfter(m,`, ${b}`):T.insertTextBeforeRange([a.range[0]+1,a.range[1]],b)}:void 0})}return{VariableDeclaration(a){let c=a.declarations[0],g=new Map,S=c.id.type===q.AST_NODE_TYPES.Identifier&&c.id.typeAnnotation?.typeAnnotation.type===q.AST_NODE_TYPES.TSTypeReference&&c.id.typeAnnotation.typeAnnotation.typeName.type===q.AST_NODE_TYPES.Identifier&&c.id.typeAnnotation.typeAnnotation.typeName.name==="FC"&&c.id.typeAnnotation.typeAnnotation.typeArguments?.params[0];if(S){if(S.type===q.AST_NODE_TYPES.TSTypeReference&&S.typeName.type===q.AST_NODE_TYPES.Identifier)s(!0,a,S.typeName,g,!1);else if(S.type===q.AST_NODE_TYPES.TSTypeLiteral)Tr(g,...Sr(S));else if(S.type===q.AST_NODE_TYPES.TSIntersectionType)for(let l of S.types)l.type===q.AST_NODE_TYPES.TSTypeReference&&l.typeName.type===q.AST_NODE_TYPES.Identifier?s(!0,a,l.typeName,g,!1):o(!0,a,g,l,!0);if(g.size!==0&&c.init?.type===q.AST_NODE_TYPES.ArrowFunctionExpression){let l=c.init.params[0];if(!l){e.report({node:c.init,messageId:"missingComponentParam"});return}l.type===q.AST_NODE_TYPES.ObjectPattern&&p(l,g)}}},FunctionDeclaration(a){i(!1,a,a.params,n)},ArrowFunctionExpression(a){i(!1,a,a.params,n)}}}}),sn={name:hr,rule:io};var Ee=require("@typescript-eslint/utils");var on=_({name:"no-write-only-ref",meta:{type:"problem",docs:{description:"Disallow creating refs that are never read"},messages:{refNotRead:'Ref "{{name}}" is never read. Consider removing it if not needed.'},schema:[]},defaultOptions:[],create(e){let t=new Set;function r(n){return n.callee.type===Ee.AST_NODE_TYPES.Identifier?t.has(n.callee.name):n.callee.type===Ee.AST_NODE_TYPES.MemberExpression&&n.callee.object.type===Ee.AST_NODE_TYPES.Identifier&&n.callee.property.type===Ee.AST_NODE_TYPES.Identifier?n.callee.property.name==="useRef":!1}return{ImportDeclaration(n){if(n.source.value==="react")for(let s of n.specifiers)s.type===Ee.AST_NODE_TYPES.ImportSpecifier&&s.imported.type===Ee.AST_NODE_TYPES.Identifier&&s.imported.name==="useRef"&&t.add(s.local.name)},VariableDeclarator(n){if(n.init&&n.init.type===Ee.AST_NODE_TYPES.CallExpression&&r(n.init)&&n.id.type===Ee.AST_NODE_TYPES.Identifier){let o=e.sourceCode.getScope(n).set.get(n.id.name);if(o){let i=!1;for(let p of o.references){let c=p.identifier.parent;if(c!==n&&!(c.type===Ee.AST_NODE_TYPES.JSXExpressionContainer&&c.parent.type===Ee.AST_NODE_TYPES.JSXAttribute&&c.parent.name.type===Ee.AST_NODE_TYPES.JSXIdentifier&&c.parent.name.name==="ref")){i=!0;break}}i||e.report({node:n.id,messageId:"refNotRead",data:{name:n.id.name}})}}}}}});var qe=require("@typescript-eslint/utils"),so=qe.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),br="prefer-named-functions",Er=new Map,oo=so({name:br,meta:{hasSuggestions:!0,type:"suggestion",docs:{description:"Prevent using arrow functions when a named function can be used instead"},schema:[{type:"object",properties:{ignoreRegex:{type:"string"},disallowArrowFnWithImplicitReturns:{type:"boolean"}}}],messages:{suggestion:"Convert to named function",default:'Function {{functionName}} should be defined as a named function "function {{functionName}} () {}" instead of an arrow function',withIgnoreRegex:'Function {{functionName}} should be defined as a named function "function {{functionName}} () {}", if not possible to use `function` you can also use a name that matches the rule ignore regex'}},defaultOptions:[{}],create(e,[t]){let r=null;if(t.ignoreRegex){let n=Er.get(t.ignoreRegex);n?r=n:(r=new RegExp(t.ignoreRegex),Er.set(t.ignoreRegex,r))}return{VariableDeclarator(n){if(n.init&&n.init.type===qe.AST_NODE_TYPES.ArrowFunctionExpression&&n.id.type===qe.AST_NODE_TYPES.Identifier){let s=n.id.name;if(n.id.typeAnnotation||r&&r.test(s)||!t.disallowArrowFnWithImplicitReturns&&n.init.body.type!==qe.AST_NODE_TYPES.BlockStatement)return;let o=n.parent,i=n.init.params,p=n.init.body,a=n.init;e.report({node:n.id,messageId:r?"withIgnoreRegex":"default",data:{functionName:s,ignoreRegex:t.ignoreRegex},suggest:[{messageId:"suggestion",fix:c=>c.replaceText(o,`${a.async?"async ":""}function ${s}(${i.map(g=>e.sourceCode.getText(g)).join(", ")||""}) ${e.sourceCode.getText(p)}`)}]})}}}}}),an={name:br,rule:oo};var U=require("@typescript-eslint/utils"),Pe=require("zod/v4");var ao=Pe.z.object({disallowedFunctions:Pe.z.array(Pe.z.object({name:Pe.z.string(),allowUsingWithArgs:Pe.z.boolean().optional(),hookAlternative:Pe.z.string().optional(),message:Pe.z.string().optional(),allowUseInside:Pe.z.array(Pe.z.string()).optional()}))}),lo=/^use[A-Z]/,po=/^[A-Z]/;function St(e){return lo.test(e)}function xr(e){return po.test(e)}function co(e){return e.type===U.AST_NODE_TYPES.Identifier?St(e.name):e.type===U.AST_NODE_TYPES.MemberExpression&&e.property.type===U.AST_NODE_TYPES.Identifier?St(e.property.name):!1}function Cr(e,t){return e.type===U.AST_NODE_TYPES.Identifier?e.name===t:e.type===U.AST_NODE_TYPES.MemberExpression&&e.object.type===U.AST_NODE_TYPES.Identifier&&e.property.type===U.AST_NODE_TYPES.Identifier?e.object.name==="React"&&e.property.name===t:!1}function Ar(e){return!!(e.parent&&e.parent.type===U.AST_NODE_TYPES.CallExpression&&Cr(e.parent.callee,"forwardRef"))}function Ir(e){return!!(e.parent&&e.parent.type===U.AST_NODE_TYPES.CallExpression&&Cr(e.parent.callee,"memo"))}function ln(e){if(e.type===U.AST_NODE_TYPES.FunctionDeclaration||e.type===U.AST_NODE_TYPES.FunctionExpression&&e.id)return e.id||void 0;if(e.type===U.AST_NODE_TYPES.FunctionExpression||e.type===U.AST_NODE_TYPES.ArrowFunctionExpression){if(e.parent.type===U.AST_NODE_TYPES.VariableDeclarator&&e.parent.init===e)return e.parent.id;if(e.parent.type===U.AST_NODE_TYPES.AssignmentExpression&&e.parent.right===e&&e.parent.operator==="=")return e.parent.left;if(e.parent.type===U.AST_NODE_TYPES.Property&&e.parent.value===e&&!e.parent.computed)return e.parent.key;if(e.parent.type===U.AST_NODE_TYPES.AssignmentPattern&&e.parent.right===e)return e.parent.left}}function uo(e){let t=e.parent,r=!1;for(;t;){if(t.type===U.AST_NODE_TYPES.FunctionDeclaration||t.type===U.AST_NODE_TYPES.FunctionExpression||t.type===U.AST_NODE_TYPES.ArrowFunctionExpression){let n=ln(t);if(n&&n.type===U.AST_NODE_TYPES.Identifier){if(xr(n.name)||St(n.name))return!r;r=!0}else{if(Ar(t)||Ir(t))return!r;if(t.parent.type===U.AST_NODE_TYPES.CallExpression){let s=t.parent;co(s.callee)||(r=!0)}else t.parent.type===U.AST_NODE_TYPES.JSXExpressionContainer||(r=!0)}}t=t.parent}return!1}function wr(e){return e.callee.type===U.AST_NODE_TYPES.Identifier?e.callee.name:e.callee.type===U.AST_NODE_TYPES.MemberExpression&&e.callee.property.type===U.AST_NODE_TYPES.Identifier?e.callee.property.name:null}function fo(e,t){if(!t.length)return!1;let r=e.parent;for(;r;){if(r.type===U.AST_NODE_TYPES.FunctionDeclaration||r.type===U.AST_NODE_TYPES.FunctionExpression||r.type===U.AST_NODE_TYPES.ArrowFunctionExpression){let n=ln(r);if(n&&n.type===U.AST_NODE_TYPES.Identifier&&t.includes(n.name))return!0}else if(r.type===U.AST_NODE_TYPES.CallExpression){let n=wr(r);if(n&&t.includes(n))return!0}r=r.parent}return!1}function mo(e){return e.arguments.length>0&&!e.arguments.every(t=>t.type===U.AST_NODE_TYPES.Identifier&&t.name==="undefined")}function yo(e,t){let r=!1,n=e.parent;for(;n;){if(n.type===U.AST_NODE_TYPES.FunctionDeclaration||n.type===U.AST_NODE_TYPES.FunctionExpression||n.type===U.AST_NODE_TYPES.ArrowFunctionExpression){let s=ln(n);if(s&&s.type===U.AST_NODE_TYPES.Identifier){if(xr(s.name)||St(s.name)){r=!0;break}}else if(Ar(n)||Ir(n)){r=!0;break}}n=n.parent}return r?t.length===0?uo(e):!fo(e,t):!1}var pn=_({name:"prefer-react-hook-alternative",meta:{type:"suggestion",docs:{description:"Prefer hook alternatives for certain functions in React components and hooks"},messages:{preferHookAlternative:"This function should not be used in react{{message}}."},schema:[$(ao)],hasSuggestions:!0},defaultOptions:[{disallowedFunctions:[]}],create(e,[t]){let{disallowedFunctions:r}=t,n=new Map(r.map(s=>[s.name,s]));return{CallExpression(s){let o=wr(s);if(!o)return;let i=n.get(o);if(!i||i.allowUsingWithArgs&&mo(s))return;let p=i.allowUseInside||[];yo(s,p)&&e.report({node:s,messageId:"preferHookAlternative",data:{message:i.message?` ${i.message}`:` use ${i.hookAlternative} instead`},suggest:i.hookAlternative?[{messageId:"preferHookAlternative",data:{message:`Replace with ${i.hookAlternative}`,hookAlternative:i.hookAlternative},fix:a=>{let c=i.hookAlternative;return c?s.callee.type===U.AST_NODE_TYPES.Identifier?a.replaceText(s.callee,c):s.callee.type===U.AST_NODE_TYPES.MemberExpression&&s.callee.property.type===U.AST_NODE_TYPES.Identifier?a.replaceText(s.callee.property,c):null:null}}]:[]})}}}});var ee=require("@typescript-eslint/utils"),Tt=xe(require("zod/v4"));var go=ee.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),Pr="prefer-single-line-if",So=Tt.default.object({maxLineLength:Tt.default.number().optional(),maxNonSimpleConditionLength:Tt.default.number().optional()}),To=go({name:Pr,meta:{type:"suggestion",fixable:"code",docs:{description:"Enforce single-line if in simple if statements"},messages:{noSingleLineCurly:"If return statement with single statement body should be written in a single line"},schema:[$(So)]},defaultOptions:[{}],create(e,[t]){let r=e.sourceCode;return{IfStatement(n){if(n.consequent.type!==ee.AST_NODE_TYPES.BlockStatement||n.loc.start.line===n.loc.end.line||r.getCommentsInside(n.consequent).length>0||n.alternate||n.consequent.body.length!==1)return;let o=n.consequent.body[0];if(!o)return;if(o.type===ee.AST_NODE_TYPES.ReturnStatement){if(!Fr(o))return}else if(!(o.type===ee.AST_NODE_TYPES.ContinueStatement||o.type===ee.AST_NODE_TYPES.BreakStatement))return;if(n.test.type===ee.AST_NODE_TYPES.LogicalExpression||n.test.type===ee.AST_NODE_TYPES.ConditionalExpression)return;let i;if(t.maxNonSimpleConditionLength){let S=Rr(n.test);if(!S&&n.test.type===ee.AST_NODE_TYPES.UnaryExpression&&n.test.operator==="!"){let l=n.test.argument;Rr(l)&&(S=!0)}if(S&&(i=r.getText(n.test),i.length>t.maxNonSimpleConditionLength))return}i||(i=r.getText(n.test));let p=r.getText(o);if(i.includes(`
18
+ `))return;let a=r.getTokenAfter(n);if(a&&a.type===ee.AST_TOKEN_TYPES.Punctuator&&a.value==="}"){let S=r.getTokenAfter(a);if(S&&S.type===ee.AST_TOKEN_TYPES.Keyword&&(S.value==="else"||S.value==="catch"))return}let c=ho(r,n),g=`if (${i}) ${p}`;t.maxLineLength&&g.length+c.length>t.maxLineLength||e.report({node:n,messageId:"noSingleLineCurly",fix:S=>S.replaceText(n,g)})}}}});function Rr(e){return e.type===ee.AST_NODE_TYPES.CallExpression||e.type===ee.AST_NODE_TYPES.BinaryExpression||e.type===ee.AST_NODE_TYPES.MemberExpression&&vr(e)}function vr(e){return e.object.type===ee.AST_NODE_TYPES.MemberExpression?vr(e.object):e.object.type!==ee.AST_NODE_TYPES.Identifier}function ho(e,t){return e.text.slice(t.range[0]-t.loc.start.column,t.range[0])}function Fr(e){if(!e.argument)return!0;let t=e.argument;return t.type===ee.AST_NODE_TYPES.ArrayExpression&&t.elements.length===0||t.type===ee.AST_NODE_TYPES.ObjectExpression&&t.properties.length===0||t.type===ee.AST_NODE_TYPES.Literal||t.type===ee.AST_NODE_TYPES.Identifier||t.type===ee.AST_NODE_TYPES.TemplateLiteral||t.type===ee.AST_NODE_TYPES.TaggedTemplateExpression?!0:t.type===ee.AST_NODE_TYPES.CallExpression?t.arguments.length===0:t.type===ee.AST_NODE_TYPES.UnaryExpression?Fr(t):!1}var cn={name:Pr,rule:To};var N=require("@typescript-eslint/utils"),fn=require("zod/v4");var Eo=N.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),Dr="react-compiler-extra",bo=fn.z.object({runOnlyWithEnableCompilerDirective:fn.z.boolean().optional()}),xo=/eslint +react-compiler\/react-compiler: +\["error/;function jr(e){return e.type===N.AST_NODE_TYPES.Identifier?e.name.startsWith("use"):!1}function Co(e){return e.type===N.AST_NODE_TYPES.Identifier?e.name.startsWith("use"):e.type===N.AST_NODE_TYPES.MemberExpression&&e.property.type===N.AST_NODE_TYPES.Identifier?e.property.name.startsWith("use"):!1}function ve(e){if(!e)return!1;switch(e.type){case N.AST_NODE_TYPES.JSXElement:case N.AST_NODE_TYPES.JSXFragment:return!0;case N.AST_NODE_TYPES.ConditionalExpression:return ve(e.consequent)||ve(e.alternate);case N.AST_NODE_TYPES.LogicalExpression:return e.operator==="&&"?ve(e.right):e.operator==="||"?ve(e.left)||ve(e.right):!1;case N.AST_NODE_TYPES.CallExpression:if(e.callee.type===N.AST_NODE_TYPES.MemberExpression&&e.callee.object.type===N.AST_NODE_TYPES.Identifier&&e.callee.object.name==="React"&&e.callee.property.type===N.AST_NODE_TYPES.Identifier&&e.callee.property.name==="createElement")return!0;for(let t of e.arguments)if(t.type!==N.AST_NODE_TYPES.SpreadElement&&ve(t))return!0;return!1;default:return!1}}function Ao(e){let t=e.typeAnnotation;if(t.type===N.AST_NODE_TYPES.TSTypeReference){if(t.typeName.type===N.AST_NODE_TYPES.Identifier)return t.typeName.name==="FC";if(t.typeName.type===N.AST_NODE_TYPES.TSQualifiedName&&t.typeName.left.type===N.AST_NODE_TYPES.Identifier&&t.typeName.right.type===N.AST_NODE_TYPES.Identifier)return t.typeName.left.name==="React"&&t.typeName.right.name==="FC"}return!1}var Io=/^[A-Z][a-zA-Z0-9]*$/;function st(e){return Io.test(e)}function mn(e){return e.startsWith("use")&&e.length>3}function yn(e,t,r,n){if(r&&Ao(r))return t?st(t.name):e.type===N.AST_NODE_TYPES.FunctionDeclaration&&e.id?st(e.id.name):!0;if(t&&mn(t.name)||e.type===N.AST_NODE_TYPES.FunctionDeclaration&&e.id&&mn(e.id.name))return!0;if(n){let s=t?.name||e.type===N.AST_NODE_TYPES.FunctionDeclaration&&e.id?.name;if(s&&st(s)&&Lr(e.body,n).containsJSX)return!0}return!1}function it(e){if(e.body.type===N.AST_NODE_TYPES.BlockStatement){for(let t of e.body.body)if(t.type===N.AST_NODE_TYPES.ExpressionStatement&&t.expression.type===N.AST_NODE_TYPES.Literal&&typeof t.expression.value=="string"&&t.expression.value==="use memo")return!0}return!1}function Lr(e,t){let r={containsJSX:!1,containsHookCalls:!1};return we(e,n=>{if(r.containsJSX&&r.containsHookCalls)return!0;switch(n.type){case N.AST_NODE_TYPES.JSXElement:case N.AST_NODE_TYPES.JSXFragment:r.containsJSX=!0;break;case N.AST_NODE_TYPES.CallExpression:jr(n.callee)&&(r.containsHookCalls=!0),ve(n)&&(r.containsJSX=!0);break;case N.AST_NODE_TYPES.ReturnStatement:n.argument&&ve(n.argument)&&(r.containsJSX=!0);break;case N.AST_NODE_TYPES.VariableDeclarator:n.init&&ve(n.init)&&(r.containsJSX=!0);break;case N.AST_NODE_TYPES.AssignmentExpression:ve(n.right)&&(r.containsJSX=!0);break}},t),r}function kr(e,t){let r=e.body,n=Lr(r,t);return n.containsJSX||n.containsHookCalls}var wo=/\bthis[.[]/;function Or(e){return wo.test(e)}function Ro(e,t){let r={containsJSX:!1,containsHookCalls:!1};return we(e,n=>{if(r.containsHookCalls||(n.type===N.AST_NODE_TYPES.FunctionDeclaration||n.type===N.AST_NODE_TYPES.FunctionExpression||n.type===N.AST_NODE_TYPES.ArrowFunctionExpression)&&n!==e)return!0;n.type===N.AST_NODE_TYPES.CallExpression&&Co(n.callee)&&(r.containsHookCalls=!0)},t),r}function Nr(e){return st(e)||mn(e)}function un(e,t,r,n){if(!Ro(e.body,t).containsHookCalls)return!1;let o=yn(e,r,n,t);if(!o&&n){let i=r?.name||e.type===N.AST_NODE_TYPES.FunctionDeclaration&&e.id?.name;i&&st(i)&&(o=!0)}return!o}var Po=Eo({name:Dr,meta:{type:"suggestion",fixable:"code",docs:{description:"Extra rules to enforce best practices when using the React compiler"},messages:{objectMethodIsNotSupported:"Object methods such as `{ method() {} }` have limited support to optimizations in the React compiler, use a function expression `{ method: () => {} }` instead.",replaceWithFunctionExpression:"Replace with function expression",thisKeywordInMethod:"Object method uses `this` keyword which would have different behavior if converted to an arrow function. Fix this manually.",fcComponentShouldReturnJsx:'React components and hooks should create JSX elements, call other hooks or use the "use memo" directive for optimal React compiler detection.',addUseMemoDirective:'Add "use memo" directive to opt into React compiler memoization',functionCallingHooksMustBeComponent:'Functions calling hooks must be React components (PascalCase with FC type) or hooks (start with "use").',useMemoDirectiveNaming:'Functions using "use memo" directive must follow React naming conventions (PascalCase for components or start with "use" for hooks).'},hasSuggestions:!0,schema:[$(bo)]},defaultOptions:[{}],create(e,[t]){let r=!1;if(t.runOnlyWithEnableCompilerDirective){for(let o of e.sourceCode.getAllComments())if(xo.test(o.value)){r=!0;break}if(!r)return{}}function n(o){for(let i of o.properties)if(i.type===N.AST_NODE_TYPES.Property&&i.method&&i.value.type===N.AST_NODE_TYPES.FunctionExpression){let p=e.sourceCode,a=p.getText(i.key),c=i.value,g=p.getText(c.body);if(Or(g))e.report({node:i,messageId:"thisKeywordInMethod"});else{let S=c.params.map(E=>p.getText(E)).join(", "),l="";c.generator?l=`${a}: function* (${S}) ${g}`:l=`${a}: (${S}) => ${g}`,e.report({node:i,messageId:"objectMethodIsNotSupported",fix:E=>E.replaceText(i,l)})}}}function s(o){for(let i of o.properties)if(i.type===N.AST_NODE_TYPES.Property&&i.value.type===N.AST_NODE_TYPES.ObjectExpression){for(let p of i.value.properties)if(p.type===N.AST_NODE_TYPES.Property&&p.method&&p.value.type===N.AST_NODE_TYPES.FunctionExpression){let c=e.sourceCode.getText(p.value.body);Or(c)&&e.report({node:p,messageId:"thisKeywordInMethod"})}}}return{CallExpression(o){if(jr(o.callee))for(let i of o.arguments){if(i.type===N.AST_NODE_TYPES.ObjectExpression&&(n(i),s(i)),i.type===N.AST_NODE_TYPES.ArrowFunctionExpression&&(i.body.type===N.AST_NODE_TYPES.ObjectExpression&&(n(i.body),s(i.body)),i.body.type===N.AST_NODE_TYPES.BlockStatement))for(let p of i.body.body)p.type===N.AST_NODE_TYPES.ReturnStatement&&p.argument?.type===N.AST_NODE_TYPES.ObjectExpression&&(n(p.argument),s(p.argument));if(i.type===N.AST_NODE_TYPES.FunctionExpression)for(let p of i.body.body)p.type===N.AST_NODE_TYPES.ReturnStatement&&p.argument?.type===N.AST_NODE_TYPES.ObjectExpression&&(n(p.argument),s(p.argument))}},VariableDeclarator(o){if(o.id.type===N.AST_NODE_TYPES.Identifier&&o.init&&(o.init.type===N.AST_NODE_TYPES.ArrowFunctionExpression||o.init.type===N.AST_NODE_TYPES.FunctionExpression)){let i=o.init,p=o.id,a=o.id.typeAnnotation;if(it(i)&&!Nr(p.name)){e.report({node:i,messageId:"useMemoDirectiveNaming"});return}if(un(i,e.sourceCode,p,a)){e.report({node:i,messageId:"functionCallingHooksMustBeComponent"});return}if(yn(i,p,a,e.sourceCode)){let c=kr(i,e.sourceCode),g=it(i);!c&&!g&&e.report({node:i,messageId:"fcComponentShouldReturnJsx",suggest:[{messageId:"addUseMemoDirective",fix(S){if(i.body.type===N.AST_NODE_TYPES.BlockStatement){let l=i.body.range[0]+1;return S.insertTextAfterRange([l,l],`
19
19
  "use memo"
20
- `)}return null}}]})}}},FunctionDeclaration(o){if(o.id&&it(o)&&!Nr(o.id.name)){e.report({node:o,messageId:"useMemoDirectiveNaming"});return}if(un(o,e.sourceCode)){e.report({node:o,messageId:"functionCallingHooksMustBeComponent"});return}if(yn(o,void 0,void 0,e.sourceCode)){let i=Fr(o,e.sourceCode),p=it(o);!i&&!p&&e.report({node:o,messageId:"fcComponentShouldReturnJsx",suggest:[{messageId:"addUseMemoDirective",fix(a){let c=o.body.range[0]+1;return a.insertTextAfterRange([c,c],`
20
+ `)}return null}}]})}}},FunctionDeclaration(o){if(o.id&&it(o)&&!Nr(o.id.name)){e.report({node:o,messageId:"useMemoDirectiveNaming"});return}if(un(o,e.sourceCode)){e.report({node:o,messageId:"functionCallingHooksMustBeComponent"});return}if(yn(o,void 0,void 0,e.sourceCode)){let i=kr(o,e.sourceCode),p=it(o);!i&&!p&&e.report({node:o,messageId:"fcComponentShouldReturnJsx",suggest:[{messageId:"addUseMemoDirective",fix(a){let c=o.body.range[0]+1;return a.insertTextAfterRange([c,c],`
21
21
  "use memo"
22
- `)}}]})}},FunctionExpression(o){if(it(o)){e.report({node:o,messageId:"useMemoDirectiveNaming"});return}un(o,e.sourceCode)&&e.report({node:o,messageId:"functionCallingHooksMustBeComponent"})}}}}),dn={name:Dr,rule:Po};var fe=require("@typescript-eslint/utils"),Ce=require("zod/v4");var vo=fe.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),Mr="react-compiler-migration",ko=Ce.z.object({disallowHooks:Ce.z.array(Ce.z.object({name:Ce.z.string(),replacement:Ce.z.string()})).optional(),disallowMethods:Ce.z.array(Ce.z.object({name:Ce.z.string(),replacement:Ce.z.string().optional(),requireTrueProp:Ce.z.string().optional()})).optional()}),Fo=/eslint +react-compiler\/react-compiler: +\["error/;function Oo(e){return e.type===fe.AST_NODE_TYPES.Identifier?e.name.startsWith("use"):e.type===fe.AST_NODE_TYPES.MemberExpression&&e.property.type===fe.AST_NODE_TYPES.Identifier?e.property.name.startsWith("use"):!1}var No=vo({name:Mr,meta:{type:"suggestion",fixable:"code",docs:{description:"Rules to help migrate to the new React compiler"},messages:{disallowedFunctionOrMethod:"{{functionOrMethod}} is not supported in react compiler. Use {{replacement}} instead.",replace:"Replace with safe alternative {{replacement}}",disallowedMethodWithMissingRequireTrueProp:"{{method}} is should have a prop named {{requireTrueProp}} set to true when used in react compiler."},hasSuggestions:!0,schema:[$(ko)]},defaultOptions:[{disallowHooks:[],disallowMethods:[]}],create(e,[t]){let r=!1;for(let n of e.sourceCode.getAllComments())if(Fo.test(n.value)){r=!0;break}return r?{CallExpression(n){if(t.disallowHooks?.length){let s=null,o=null;if(n.callee.type===fe.AST_NODE_TYPES.Identifier?(s=n.callee.name,o=n.callee):n.callee.type===fe.AST_NODE_TYPES.MemberExpression&&n.callee.property.type===fe.AST_NODE_TYPES.Identifier&&(s=n.callee.property.name,o=n.callee.property),s){let i=t.disallowHooks.find(p=>p.name===s);i&&o&&e.report({node:n,messageId:"disallowedFunctionOrMethod",data:{functionOrMethod:i.name,replacement:i.replacement},suggest:[{messageId:"replace",data:{replacement:i.replacement},fix:p=>p.replaceText(o,i.replacement)}]})}}if(t.disallowMethods?.length&&Oo(n.callee)){for(let s of n.arguments)if(s.type===fe.AST_NODE_TYPES.ObjectExpression){for(let o of s.properties)if(o.type===fe.AST_NODE_TYPES.Property&&o.key.type===fe.AST_NODE_TYPES.Identifier){let i=o.key.name,p=t.disallowMethods.find(a=>a.name===i);if(p){if(p.requireTrueProp){let a=p.requireTrueProp,c=!1;for(let g of s.properties)if(g.type===fe.AST_NODE_TYPES.Property&&g.key.type===fe.AST_NODE_TYPES.Identifier&&g.key.name===a&&g.value.type===fe.AST_NODE_TYPES.Literal&&g.value.value===!0){c=!0;break}if(!c){e.report({node:o,messageId:"disallowedMethodWithMissingRequireTrueProp",data:{method:p.name,requireTrueProp:a}});continue}}p.replacement&&e.report({node:o,messageId:"disallowedFunctionOrMethod",data:{functionOrMethod:p.name,replacement:p.replacement},suggest:[{messageId:"replace",data:{replacement:p.replacement},fix:a=>p.replacement?a.replaceText(o.key,p.replacement):null}]})}}}}}}:{}}}),gn={name:Mr,rule:No};var F=require("@typescript-eslint/utils"),Tn=require("zod");var Do=Tn.z.object({runOnlyWithEnableCompilerDirective:Tn.z.boolean().optional()}),jo=/eslint +react-compiler\/react-compiler: +\["error/,Lo=/^\d+$/,Mo=/[\s_-]+/,$o=/[a-z][A-Z]/,_o=/^(.+?)([A-Z][a-z]+s?)$/,Uo=/^[a-z][a-zA-Z]*$/;function $r(e,t){let r=[];if(e.type===F.AST_NODE_TYPES.JSXElement){for(let n of e.openingElement.attributes)if(n.type===F.AST_NODE_TYPES.JSXAttribute&&n.name.type===F.AST_NODE_TYPES.JSXIdentifier&&n.value?.type===F.AST_NODE_TYPES.JSXExpressionContainer&&n.value.expression.type!==F.AST_NODE_TYPES.JSXEmptyExpression){let s=n.name.name,o=n.value.expression,i=!1;we(o,p=>{switch(p.type){case F.AST_NODE_TYPES.ObjectExpression:case F.AST_NODE_TYPES.ArrowFunctionExpression:case F.AST_NODE_TYPES.FunctionExpression:case F.AST_NODE_TYPES.ArrayExpression:return i=!0,!0}return!1},t),i&&r.push(s)}}return{hasUnstable:r.length>0,problematicProps:r}}function zo(e){if(e.body.type===F.AST_NODE_TYPES.JSXElement||e.body.type===F.AST_NODE_TYPES.JSXFragment)return!0;if(e.body.type===F.AST_NODE_TYPES.BlockStatement){for(let t of e.body.body)if(t.type===F.AST_NODE_TYPES.ReturnStatement&&t.argument&&(t.argument.type===F.AST_NODE_TYPES.JSXElement||t.argument.type===F.AST_NODE_TYPES.JSXFragment))return!0}return!1}function Wo(e,t){let r=e.callee;if(r.type===F.AST_NODE_TYPES.MemberExpression){let n=r.object;if(n.type===F.AST_NODE_TYPES.Identifier){let s=n.name,o=Jo(s);if(o!==s)return hn(o)}}if(t.length>0){let n=t[0];if(n&&n.type===F.AST_NODE_TYPES.Identifier)return hn(n.name)}return"ListItem"}function Jo(e){let r={people:"person",children:"child",feet:"foot",teeth:"tooth",mice:"mouse",men:"man",women:"woman"}[e.toLowerCase()];if(r)return r;if(e.match($o)){let n=e.match(_o);if(n){let s=n[1],o=n[2];if(!s||!o)return Sn(e);let i=Sn(o);if(i!==o)return s+i}}return Sn(e)}function Sn(e){return e.endsWith("ies")?`${e.slice(0,-3)}y`:e.endsWith("es")&&e.length>3?e.slice(0,-2):e.endsWith("s")&&e.length>1?e.slice(0,-1):e}function hn(e){return e.match(Uo)?e.charAt(0).toUpperCase()+e.slice(1):e.split(Mo).map(t=>t.charAt(0).toUpperCase()+t.slice(1).toLowerCase()).join("")}function _r(e,t,r){let n=[],s=new Set,o=new Set(["console","document","window","Math","Object","Array","String","Number","Boolean","undefined","null"]);we(e,i=>{if(i.type===F.AST_NODE_TYPES.Identifier&&!t.includes(i.name)&&!o.has(i.name)&&!Lo.test(i.name)){let p=i.parent;if(p.type===F.AST_NODE_TYPES.Property&&p.key===i||p.type===F.AST_NODE_TYPES.MemberExpression&&p.property===i&&!p.computed||p.type===F.AST_NODE_TYPES.JSXOpeningElement||p.type===F.AST_NODE_TYPES.JSXClosingElement||p.type===F.AST_NODE_TYPES.JSXAttribute&&p.name.type===F.AST_NODE_TYPES.JSXIdentifier&&p.name.name===i.name)return!1;s.add(i.name)}return!1},r);for(let i of s)t.includes(i)||n.push({name:i,type:"unknown"});return n}function Ur(e,t,r,n,s){let i=[...r.map(S=>S.type===F.AST_NODE_TYPES.Identifier?S.name:"item").map((S,l)=>({name:S,type:l===0?`${e}Type`:l===1?"number":"unknown"})),...n],p=i.map(S=>{let l=S.type;return S.name.includes("on")&&l==="any"&&(l="unknown"),` ${S.name}: ${l};`}).join(`
22
+ `)}}]})}},FunctionExpression(o){if(it(o)){e.report({node:o,messageId:"useMemoDirectiveNaming"});return}un(o,e.sourceCode)&&e.report({node:o,messageId:"functionCallingHooksMustBeComponent"})}}}}),dn={name:Dr,rule:Po};var fe=require("@typescript-eslint/utils"),Ce=require("zod/v4");var vo=fe.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),Mr="react-compiler-migration",Fo=Ce.z.object({disallowHooks:Ce.z.array(Ce.z.object({name:Ce.z.string(),replacement:Ce.z.string()})).optional(),disallowMethods:Ce.z.array(Ce.z.object({name:Ce.z.string(),replacement:Ce.z.string().optional(),requireTrueProp:Ce.z.string().optional()})).optional()}),ko=/eslint +react-compiler\/react-compiler: +\["error/;function Oo(e){return e.type===fe.AST_NODE_TYPES.Identifier?e.name.startsWith("use"):e.type===fe.AST_NODE_TYPES.MemberExpression&&e.property.type===fe.AST_NODE_TYPES.Identifier?e.property.name.startsWith("use"):!1}var No=vo({name:Mr,meta:{type:"suggestion",fixable:"code",docs:{description:"Rules to help migrate to the new React compiler"},messages:{disallowedFunctionOrMethod:"{{functionOrMethod}} is not supported in react compiler. Use {{replacement}} instead.",replace:"Replace with safe alternative {{replacement}}",disallowedMethodWithMissingRequireTrueProp:"{{method}} is should have a prop named {{requireTrueProp}} set to true when used in react compiler."},hasSuggestions:!0,schema:[$(Fo)]},defaultOptions:[{disallowHooks:[],disallowMethods:[]}],create(e,[t]){let r=!1;for(let n of e.sourceCode.getAllComments())if(ko.test(n.value)){r=!0;break}return r?{CallExpression(n){if(t.disallowHooks?.length){let s=null,o=null;if(n.callee.type===fe.AST_NODE_TYPES.Identifier?(s=n.callee.name,o=n.callee):n.callee.type===fe.AST_NODE_TYPES.MemberExpression&&n.callee.property.type===fe.AST_NODE_TYPES.Identifier&&(s=n.callee.property.name,o=n.callee.property),s){let i=t.disallowHooks.find(p=>p.name===s);i&&o&&e.report({node:n,messageId:"disallowedFunctionOrMethod",data:{functionOrMethod:i.name,replacement:i.replacement},suggest:[{messageId:"replace",data:{replacement:i.replacement},fix:p=>p.replaceText(o,i.replacement)}]})}}if(t.disallowMethods?.length&&Oo(n.callee)){for(let s of n.arguments)if(s.type===fe.AST_NODE_TYPES.ObjectExpression){for(let o of s.properties)if(o.type===fe.AST_NODE_TYPES.Property&&o.key.type===fe.AST_NODE_TYPES.Identifier){let i=o.key.name,p=t.disallowMethods.find(a=>a.name===i);if(p){if(p.requireTrueProp){let a=p.requireTrueProp,c=!1;for(let g of s.properties)if(g.type===fe.AST_NODE_TYPES.Property&&g.key.type===fe.AST_NODE_TYPES.Identifier&&g.key.name===a&&g.value.type===fe.AST_NODE_TYPES.Literal&&g.value.value===!0){c=!0;break}if(!c){e.report({node:o,messageId:"disallowedMethodWithMissingRequireTrueProp",data:{method:p.name,requireTrueProp:a}});continue}}p.replacement&&e.report({node:o,messageId:"disallowedFunctionOrMethod",data:{functionOrMethod:p.name,replacement:p.replacement},suggest:[{messageId:"replace",data:{replacement:p.replacement},fix:a=>p.replacement?a.replaceText(o.key,p.replacement):null}]})}}}}}}:{}}}),gn={name:Mr,rule:No};var k=require("@typescript-eslint/utils"),Tn=require("zod");var Do=Tn.z.object({runOnlyWithEnableCompilerDirective:Tn.z.boolean().optional()}),jo=/eslint +react-compiler\/react-compiler: +\["error/,Lo=/^\d+$/,Mo=/[\s_-]+/,$o=/[a-z][A-Z]/,_o=/^(.+?)([A-Z][a-z]+s?)$/,Uo=/^[a-z][a-zA-Z]*$/;function $r(e,t){let r=[];if(e.type===k.AST_NODE_TYPES.JSXElement){for(let n of e.openingElement.attributes)if(n.type===k.AST_NODE_TYPES.JSXAttribute&&n.name.type===k.AST_NODE_TYPES.JSXIdentifier&&n.value?.type===k.AST_NODE_TYPES.JSXExpressionContainer&&n.value.expression.type!==k.AST_NODE_TYPES.JSXEmptyExpression){let s=n.name.name,o=n.value.expression,i=!1;we(o,p=>{switch(p.type){case k.AST_NODE_TYPES.ObjectExpression:case k.AST_NODE_TYPES.ArrowFunctionExpression:case k.AST_NODE_TYPES.FunctionExpression:case k.AST_NODE_TYPES.ArrayExpression:return i=!0,!0}return!1},t),i&&r.push(s)}}return{hasUnstable:r.length>0,problematicProps:r}}function zo(e){if(e.body.type===k.AST_NODE_TYPES.JSXElement||e.body.type===k.AST_NODE_TYPES.JSXFragment)return!0;if(e.body.type===k.AST_NODE_TYPES.BlockStatement){for(let t of e.body.body)if(t.type===k.AST_NODE_TYPES.ReturnStatement&&t.argument&&(t.argument.type===k.AST_NODE_TYPES.JSXElement||t.argument.type===k.AST_NODE_TYPES.JSXFragment))return!0}return!1}function Wo(e,t){let r=e.callee;if(r.type===k.AST_NODE_TYPES.MemberExpression){let n=r.object;if(n.type===k.AST_NODE_TYPES.Identifier){let s=n.name,o=Jo(s);if(o!==s)return hn(o)}}if(t.length>0){let n=t[0];if(n&&n.type===k.AST_NODE_TYPES.Identifier)return hn(n.name)}return"ListItem"}function Jo(e){let r={people:"person",children:"child",feet:"foot",teeth:"tooth",mice:"mouse",men:"man",women:"woman"}[e.toLowerCase()];if(r)return r;if(e.match($o)){let n=e.match(_o);if(n){let s=n[1],o=n[2];if(!s||!o)return Sn(e);let i=Sn(o);if(i!==o)return s+i}}return Sn(e)}function Sn(e){return e.endsWith("ies")?`${e.slice(0,-3)}y`:e.endsWith("es")&&e.length>3?e.slice(0,-2):e.endsWith("s")&&e.length>1?e.slice(0,-1):e}function hn(e){return e.match(Uo)?e.charAt(0).toUpperCase()+e.slice(1):e.split(Mo).map(t=>t.charAt(0).toUpperCase()+t.slice(1).toLowerCase()).join("")}function _r(e,t,r){let n=[],s=new Set,o=new Set(["console","document","window","Math","Object","Array","String","Number","Boolean","undefined","null"]);we(e,i=>{if(i.type===k.AST_NODE_TYPES.Identifier&&!t.includes(i.name)&&!o.has(i.name)&&!Lo.test(i.name)){let p=i.parent;if(p.type===k.AST_NODE_TYPES.Property&&p.key===i||p.type===k.AST_NODE_TYPES.MemberExpression&&p.property===i&&!p.computed||p.type===k.AST_NODE_TYPES.JSXOpeningElement||p.type===k.AST_NODE_TYPES.JSXClosingElement||p.type===k.AST_NODE_TYPES.JSXAttribute&&p.name.type===k.AST_NODE_TYPES.JSXIdentifier&&p.name.name===i.name)return!1;s.add(i.name)}return!1},r);for(let i of s)t.includes(i)||n.push({name:i,type:"unknown"});return n}function Ur(e,t,r,n,s){let i=[...r.map(S=>S.type===k.AST_NODE_TYPES.Identifier?S.name:"item").map((S,l)=>({name:S,type:l===0?`${e}Type`:l===1?"number":"unknown"})),...n],p=i.map(S=>{let l=S.type;return S.name.includes("on")&&l==="any"&&(l="unknown"),` ${S.name}: ${l};`}).join(`
23
23
  `),a=i.map(S=>S.name).join(", "),c=s.getText(t),g=`${e}Props`;return`type ${g} = {
24
24
  ${p}
25
25
  };
@@ -28,25 +28,25 @@ const ${e}: FC<${g}> = ({ ${a} }) => {
28
28
  return (
29
29
  ${c}
30
30
  );
31
- };`}function Vo(e,t,r,n){let s=t.map(i=>i.type===F.AST_NODE_TYPES.Identifier?i.name:"item"),o=[n?`key={${n}}`:`key={${s[0]}.id}`,...s.map(i=>`${i}={${i}}`),...r.map(i=>`${i.name}={${i.name}}`)].filter(Boolean);return`<${e} ${o.join(" ")} />`}function Xo(e){if(e.type===F.AST_NODE_TYPES.JSXElement&&e.openingElement.name.type===F.AST_NODE_TYPES.JSXIdentifier){let t=e.openingElement.name.name;if(t!=="div"&&t!=="span")return hn(t)}return"ListItem"}function Ho(e,t,r){let n=[r?`key={${r}}`:"",...t.map(s=>`${s.name}={${s.name}}`)].filter(Boolean);return`<${e}${n.length>0?` ${n.join(" ")}`:""} />`}function zr(e,t){for(let r of e.openingElement.attributes)if(r.type===F.AST_NODE_TYPES.JSXAttribute&&r.name.type===F.AST_NODE_TYPES.JSXIdentifier&&r.name.name==="key"&&r.value&&r.value.type===F.AST_NODE_TYPES.JSXExpressionContainer&&r.value.expression.type!==F.AST_NODE_TYPES.JSXEmptyExpression)return t.getText(r.value.expression);return null}var En=_({name:"react-optimized-collections",meta:{type:"suggestion",docs:{description:"Detect unstable values in map renders that prevent React Compiler optimization"},messages:{unstableValueInMap:"Unstable values in {{problematicProps}} prevent React Compiler from optimizing individual list items. Extract the problematic props to outside the loop or extract the item to a separate component.",extractComponent:"Extract to {{componentName}} component"},schema:[$(Do)],hasSuggestions:!0},defaultOptions:[{runOnlyWithEnableCompilerDirective:!1}],create(e,[t]){let{sourceCode:r}=e;if(t.runOnlyWithEnableCompilerDirective){let n=!1;for(let s of r.getAllComments())if(jo.test(s.value)){n=!0;break}if(!n)return{}}return{CallExpression(n){n.callee.type===F.AST_NODE_TYPES.MemberExpression&&n.callee.property.type===F.AST_NODE_TYPES.Identifier&&(n.callee.property.name==="map"||n.callee.property.name==="push")&&(n.callee.property.name==="map"?Bo(n,r,e):Yo(n,r,e))}}}});function Bo(e,t,r){let n=e.arguments[0];if(!n||n.type!==F.AST_NODE_TYPES.ArrowFunctionExpression&&n.type!==F.AST_NODE_TYPES.FunctionExpression||!zo(n))return;let s=null;if(n.body.type===F.AST_NODE_TYPES.JSXElement||n.body.type===F.AST_NODE_TYPES.JSXFragment?s=n.body:n.body.type===F.AST_NODE_TYPES.BlockStatement&&n.body.body[0]?.type===F.AST_NODE_TYPES.ReturnStatement&&n.body.body[0].argument&&(n.body.body[0].argument.type===F.AST_NODE_TYPES.JSXElement||n.body.body[0].argument.type===F.AST_NODE_TYPES.JSXFragment)&&(s=n.body.body[0].argument),!s)return;let o=$r(s,t);if(!o.hasUnstable)return;let i=Wo(e,n.params),p=n.params.map(S=>S.type===F.AST_NODE_TYPES.Identifier?S.name:"item"),a=_r(s,p,t),c=s.type===F.AST_NODE_TYPES.JSXElement?zr(s,t):null,g=o.problematicProps.length===1?`prop "${o.problematicProps[0]}"`:`props "${o.problematicProps.join('", "')}"`;r.report({node:s,messageId:"unstableValueInMap",data:{problematicProps:g},suggest:[{messageId:"extractComponent",data:{componentName:i},fix:S=>{let l=Ur(i,s,n.params,a,t),E=Vo(i,n.params,a,c),f=e;for(;f.parent.type!==F.AST_NODE_TYPES.Program&&!(f.type===F.AST_NODE_TYPES.FunctionDeclaration||f.type===F.AST_NODE_TYPES.VariableDeclarator&&f.init&&(f.init.type===F.AST_NODE_TYPES.ArrowFunctionExpression||f.init.type===F.AST_NODE_TYPES.FunctionExpression));)f=f.parent;let h=[];return h.push(S.insertTextAfter(f,`
31
+ };`}function Vo(e,t,r,n){let s=t.map(i=>i.type===k.AST_NODE_TYPES.Identifier?i.name:"item"),o=[n?`key={${n}}`:`key={${s[0]}.id}`,...s.map(i=>`${i}={${i}}`),...r.map(i=>`${i.name}={${i.name}}`)].filter(Boolean);return`<${e} ${o.join(" ")} />`}function Xo(e){if(e.type===k.AST_NODE_TYPES.JSXElement&&e.openingElement.name.type===k.AST_NODE_TYPES.JSXIdentifier){let t=e.openingElement.name.name;if(t!=="div"&&t!=="span")return hn(t)}return"ListItem"}function Ho(e,t,r){let n=[r?`key={${r}}`:"",...t.map(s=>`${s.name}={${s.name}}`)].filter(Boolean);return`<${e}${n.length>0?` ${n.join(" ")}`:""} />`}function zr(e,t){for(let r of e.openingElement.attributes)if(r.type===k.AST_NODE_TYPES.JSXAttribute&&r.name.type===k.AST_NODE_TYPES.JSXIdentifier&&r.name.name==="key"&&r.value&&r.value.type===k.AST_NODE_TYPES.JSXExpressionContainer&&r.value.expression.type!==k.AST_NODE_TYPES.JSXEmptyExpression)return t.getText(r.value.expression);return null}var En=_({name:"react-optimized-collections",meta:{type:"suggestion",docs:{description:"Detect unstable values in map renders that prevent React Compiler optimization"},messages:{unstableValueInMap:"Unstable values in {{problematicProps}} prevent React Compiler from optimizing individual list items. Extract the problematic props to outside the loop or extract the item to a separate component.",extractComponent:"Extract to {{componentName}} component"},schema:[$(Do)],hasSuggestions:!0},defaultOptions:[{runOnlyWithEnableCompilerDirective:!1}],create(e,[t]){let{sourceCode:r}=e;if(t.runOnlyWithEnableCompilerDirective){let n=!1;for(let s of r.getAllComments())if(jo.test(s.value)){n=!0;break}if(!n)return{}}return{CallExpression(n){n.callee.type===k.AST_NODE_TYPES.MemberExpression&&n.callee.property.type===k.AST_NODE_TYPES.Identifier&&(n.callee.property.name==="map"||n.callee.property.name==="push")&&(n.callee.property.name==="map"?Bo(n,r,e):Yo(n,r,e))}}}});function Bo(e,t,r){let n=e.arguments[0];if(!n||n.type!==k.AST_NODE_TYPES.ArrowFunctionExpression&&n.type!==k.AST_NODE_TYPES.FunctionExpression||!zo(n))return;let s=null;if(n.body.type===k.AST_NODE_TYPES.JSXElement||n.body.type===k.AST_NODE_TYPES.JSXFragment?s=n.body:n.body.type===k.AST_NODE_TYPES.BlockStatement&&n.body.body[0]?.type===k.AST_NODE_TYPES.ReturnStatement&&n.body.body[0].argument&&(n.body.body[0].argument.type===k.AST_NODE_TYPES.JSXElement||n.body.body[0].argument.type===k.AST_NODE_TYPES.JSXFragment)&&(s=n.body.body[0].argument),!s)return;let o=$r(s,t);if(!o.hasUnstable)return;let i=Wo(e,n.params),p=n.params.map(S=>S.type===k.AST_NODE_TYPES.Identifier?S.name:"item"),a=_r(s,p,t),c=s.type===k.AST_NODE_TYPES.JSXElement?zr(s,t):null,g=o.problematicProps.length===1?`prop "${o.problematicProps[0]}"`:`props "${o.problematicProps.join('", "')}"`;r.report({node:s,messageId:"unstableValueInMap",data:{problematicProps:g},suggest:[{messageId:"extractComponent",data:{componentName:i},fix:S=>{let l=Ur(i,s,n.params,a,t),E=Vo(i,n.params,a,c),f=e;for(;f.parent.type!==k.AST_NODE_TYPES.Program&&!(f.type===k.AST_NODE_TYPES.FunctionDeclaration||f.type===k.AST_NODE_TYPES.VariableDeclarator&&f.init&&(f.init.type===k.AST_NODE_TYPES.ArrowFunctionExpression||f.init.type===k.AST_NODE_TYPES.FunctionExpression));)f=f.parent;let h=[];return h.push(S.insertTextAfter(f,`
32
32
 
33
- ${l}`)),h.push(S.replaceText(s,E)),h}}]})}function Yo(e,t,r){let n=e.arguments[0];if(!n||n.type!==F.AST_NODE_TYPES.JSXElement&&n.type!==F.AST_NODE_TYPES.JSXFragment)return;let s=n,o=$r(s,t);if(!o.hasUnstable)return;let i=Xo(s),p=_r(s,[],t),a=s.type===F.AST_NODE_TYPES.JSXElement?zr(s,t):null,c=o.problematicProps.length===1?`prop "${o.problematicProps[0]}"`:`props "${o.problematicProps.join('", "')}"`;r.report({node:s,messageId:"unstableValueInMap",data:{problematicProps:c},suggest:[{messageId:"extractComponent",data:{componentName:i},fix:g=>{let S=Ur(i,s,[],p,t),l=Ho(i,p,a),E=e;for(;E.parent.type!==F.AST_NODE_TYPES.Program&&!(E.type===F.AST_NODE_TYPES.FunctionDeclaration||E.type===F.AST_NODE_TYPES.VariableDeclarator&&E.init&&(E.init.type===F.AST_NODE_TYPES.ArrowFunctionExpression||E.init.type===F.AST_NODE_TYPES.FunctionExpression));)E=E.parent;let f=[];return f.push(g.insertTextAfter(E,`
33
+ ${l}`)),h.push(S.replaceText(s,E)),h}}]})}function Yo(e,t,r){let n=e.arguments[0];if(!n||n.type!==k.AST_NODE_TYPES.JSXElement&&n.type!==k.AST_NODE_TYPES.JSXFragment)return;let s=n,o=$r(s,t);if(!o.hasUnstable)return;let i=Xo(s),p=_r(s,[],t),a=s.type===k.AST_NODE_TYPES.JSXElement?zr(s,t):null,c=o.problematicProps.length===1?`prop "${o.problematicProps[0]}"`:`props "${o.problematicProps.join('", "')}"`;r.report({node:s,messageId:"unstableValueInMap",data:{problematicProps:c},suggest:[{messageId:"extractComponent",data:{componentName:i},fix:g=>{let S=Ur(i,s,[],p,t),l=Ho(i,p,a),E=e;for(;E.parent.type!==k.AST_NODE_TYPES.Program&&!(E.type===k.AST_NODE_TYPES.FunctionDeclaration||E.type===k.AST_NODE_TYPES.VariableDeclarator&&E.init&&(E.init.type===k.AST_NODE_TYPES.ArrowFunctionExpression||E.init.type===k.AST_NODE_TYPES.FunctionExpression));)E=E.parent;let f=[];return f.push(g.insertTextAfter(E,`
34
34
 
35
- ${S}`)),f.push(g.replaceText(s,l)),f}}]})}var ht=require("@typescript-eslint/utils"),qo=ht.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),Wr="require-description",Zo=/^(eslint(?:-env|-enable|-disable(?:(?:-next)?-line)?)?|exported|globals?)(?:\s|$)/u,Go=/^eslint-disable-(next-)?line$/u,Ko=qo({name:Wr,meta:{type:"problem",docs:{description:"Require descriptions for eslint directives."},messages:{missingDescription:"Unexpected undescribed directive comment. Include descriptions to explain why the comment is necessary."},schema:[{type:"object",properties:{ignore:{type:"array",items:{type:"string",enum:["eslint","eslint-disable","eslint-disable-line","eslint-disable-next-line","eslint-enable","eslint-env","exported","global","globals"]},additionalItems:!1,uniqueItems:!0}},additionalProperties:!1}]},defaultOptions:[{ignore:[]}],create(e,[t]){let r=e.sourceCode,n=new Set(t.ignore||[]);return{Program(){for(let s of r.getAllComments()){let o=Qo(s);o!=null&&(n.has(o.kind)||o.description||e.report({loc:na(s.loc),messageId:"missingDescription"}))}}}}}),Jr={name:Wr,rule:Ko};function Qo(e){let{text:t,description:r}=ta(e.value);if(!t)return null;let n=Zo.exec(t);if(!n)return null;let s=n[1];if(!s)return null;let o=Go.test(s);if(e.type===ht.TSESTree.AST_TOKEN_TYPES.Line&&!o||o&&e.loc.start.line!==e.loc.end.line)return null;let i=t.slice(n.index+s.length);return{kind:s,value:i.trim(),description:r}}var ea=/\s-{2,}\s/u;function ta(e){let t=e.split(ea);return{text:t[0]?.trim(),description:t.length>1?t[1]?.trim()??null:null}}function na(e){return{start:{line:e.start.line,column:-1},end:e.end}}var V=require("@typescript-eslint/utils"),ke=require("zod/v4");var ra=ke.z.object({varsToCheck:ke.z.array(ke.z.object({selector:ke.z.string().optional(),fromFnCall:ke.z.string().optional(),prop:ke.z.string().or(ke.z.array(ke.z.string())),errorMsg:ke.z.string().optional()}))}),bn=_({name:"require-reads-to-var-prop",meta:{type:"suggestion",docs:{description:"Require specific properties from variables to be read or ensure the variable is passed to functions/components"},messages:{propNotRead:'"{{fnName}}" requires reads to the prop "{{prop}}". {{customMsg}}',propsNotRead:'"{{fnName}}" requires reads to the props {{props}}. {{customMsg}}'},schema:[$(ra)]},defaultOptions:[{varsToCheck:[]}],create(e,[t]){let r=new Map;function n(i,p,a,c){let g=new Set;for(let l of i.properties)l.type===V.AST_NODE_TYPES.Property&&l.key.type===V.AST_NODE_TYPES.Identifier&&g.add(l.key.name);let S=p.filter(l=>!g.has(l));if(S.length>0)if(S.length===1)e.report({node:i,messageId:"propNotRead",data:{prop:S[0],fnName:c,customMsg:a||""}});else{let l=S.map(E=>`"${E}"`).join(", ");e.report({node:i,messageId:"propsNotRead",data:{props:l,fnName:c,customMsg:a||""}})}}function s(i){if(i.init?.type===V.AST_NODE_TYPES.CallExpression){if(i.init.callee.type===V.AST_NODE_TYPES.Identifier)return i.init.callee.name;if(i.init.callee.type===V.AST_NODE_TYPES.MemberExpression&&i.init.callee.property.type===V.AST_NODE_TYPES.Identifier)return i.init.callee.object.type===V.AST_NODE_TYPES.Identifier?`${i.init.callee.object.name}.${i.init.callee.property.name}`:i.init.callee.property.name}return"unknown function"}let o={};for(let i of t.varsToCheck)i.selector&&(o[i.selector]=p=>{if(p.type===V.AST_NODE_TYPES.VariableDeclarator&&p.id.type===V.AST_NODE_TYPES.Identifier&&r.set(p.id.name,{props:Array.isArray(i.prop)?i.prop:[i.prop],errorMsg:i.errorMsg,node:p.id,fnName:s(p)}),p.type===V.AST_NODE_TYPES.VariableDeclarator&&p.id.type===V.AST_NODE_TYPES.ObjectPattern){let a=Array.isArray(i.prop)?i.prop:[i.prop];n(p.id,a,i.errorMsg,s(p))}});for(let i of t.varsToCheck)if(i.fromFnCall){let p=i.fromFnCall;if(p.startsWith("*.")){let c=`VariableDeclarator > CallExpression > MemberExpression[property.name="${p.slice(2)}"]`;o[c]=g=>{if(g.type!==V.AST_NODE_TYPES.MemberExpression||g.parent.type!==V.AST_NODE_TYPES.CallExpression)return;let S=g.parent;if(S.parent.type!==V.AST_NODE_TYPES.VariableDeclarator)return;let l=S.parent;if(l.id.type===V.AST_NODE_TYPES.Identifier)r.set(l.id.name,{props:Array.isArray(i.prop)?i.prop:[i.prop],errorMsg:i.errorMsg,node:l.id,fnName:i.fromFnCall||"unknown function"});else if(l.id.type===V.AST_NODE_TYPES.ObjectPattern){let E=Array.isArray(i.prop)?i.prop:[i.prop];n(l.id,E,i.errorMsg,i.fromFnCall||"unknown function")}}}else if(p.includes(".")){let[a,c]=p.split("."),g=`VariableDeclarator > CallExpression > MemberExpression[object.name="${a}"][property.name="${c}"]`;o[g]=S=>{if(S.type!==V.AST_NODE_TYPES.MemberExpression||S.parent.type!==V.AST_NODE_TYPES.CallExpression)return;let l=S.parent;if(l.parent.type!==V.AST_NODE_TYPES.VariableDeclarator)return;let E=l.parent;if(E.id.type===V.AST_NODE_TYPES.Identifier)r.set(E.id.name,{props:Array.isArray(i.prop)?i.prop:[i.prop],errorMsg:i.errorMsg,node:E.id,fnName:i.fromFnCall||"unknown function"});else if(E.id.type===V.AST_NODE_TYPES.ObjectPattern){let f=Array.isArray(i.prop)?i.prop:[i.prop];n(E.id,f,i.errorMsg,i.fromFnCall||"unknown function")}}}else{let a=`VariableDeclarator > CallExpression > Identifier[name="${p}"]`;o[a]=c=>{if(c.type!==V.AST_NODE_TYPES.Identifier||c.parent.type!==V.AST_NODE_TYPES.CallExpression)return;let g=c.parent;if(g.parent.type!==V.AST_NODE_TYPES.VariableDeclarator)return;let S=g.parent;if(S.id.type===V.AST_NODE_TYPES.Identifier)r.set(S.id.name,{props:Array.isArray(i.prop)?i.prop:[i.prop],errorMsg:i.errorMsg,node:S.id,fnName:i.fromFnCall||"unknown function"});else if(S.id.type===V.AST_NODE_TYPES.ObjectPattern){let l=Array.isArray(i.prop)?i.prop:[i.prop];n(S.id,l,i.errorMsg,i.fromFnCall||"unknown function")}}}}return{...o,"Program:exit"(){for(let[i,{props:p,errorMsg:a,node:c,fnName:g}]of r){let l=e.sourceCode.getScope(c).set.get(i);if(l){let E=new Set(p);for(let f of l.references){let h=f.identifier,T=h.parent;if(!(T.type===V.AST_NODE_TYPES.VariableDeclarator&&T.id===h)){if(T.type===V.AST_NODE_TYPES.MemberExpression&&T.object===h&&T.property.type===V.AST_NODE_TYPES.Identifier&&E.has(T.property.name)){if(E.delete(T.property.name),E.size===0)break;continue}if(T.type===V.AST_NODE_TYPES.VariableDeclarator&&T.init===h&&T.id.type===V.AST_NODE_TYPES.ObjectPattern){for(let m of T.id.properties)m.type===V.AST_NODE_TYPES.Property&&m.key.type===V.AST_NODE_TYPES.Identifier&&E.has(m.key.name)&&E.delete(m.key.name);if(E.size===0)break;continue}if(!(T.type===V.AST_NODE_TYPES.MemberExpression&&T.object===h&&T.property.type===V.AST_NODE_TYPES.Identifier&&!p.includes(T.property.name))){E.clear();break}}}if(E.size>0){let f=Array.from(E);if(f.length===1)e.report({node:c,messageId:"propNotRead",data:{prop:f[0],fnName:g,customMsg:a||""}});else{let h=f.map(T=>`"${T}"`).join(", ");e.report({node:c,messageId:"propsNotRead",data:{props:h,fnName:g,customMsg:a||""}})}}}}}}}});function Hr(e){return/^use[A-Z0-9]/.test(e)}function Et(e){return e.type==="Identifier"?Hr(e.name):e.type==="MemberExpression"&&!e.computed&&Et(e.property)?e.object.type==="Identifier":!1}function Br(e){return e.type==="Identifier"&&/^[A-Z]/.test(e.name)}function Yr(e,t){return e.name===t||e.type==="MemberExpression"&&e.object.name==="React"&&e.property.name===t}function qr(e){return!!(e.parent&&e.parent.callee&&Yr(e.parent.callee,"forwardRef"))}function Zr(e){return!!(e.parent&&e.parent.callee&&Yr(e.parent.callee,"memo"))}function xn(e){for(;e;){let t=Kr(e);if(t&&(Br(t)||Et(t))||qr(e)||Zr(e))return!0;e=e.parent}return!1}function Vr(e){return!1}function Cn(e){return!1}var ia=/eslint +react-compiler\/react-compiler: +\["error/,Gr={meta:{type:"problem",docs:{description:"enforces the Rules of Hooks",recommended:!0,url:"https://reactjs.org/docs/hooks-rules.html"},schema:[{type:"object",ignoreIfReactCompilerIsEnabled:!1,properties:{ignoreIfReactCompilerIsEnabled:{type:"boolean"}}}]},create(e){if(e.options[0]?.ignoreIfReactCompilerIsEnabled){for(let a of e.sourceCode.getAllComments())if(ia.test(a.value))return{CallExpression(c){let g=null;c.callee.name==="useMemo"?g="useMemo":c.callee.name==="useCallback"&&(g="useCallback"),g&&e.report({node:c,message:`"${g}" is not necessary when using React Compiler.`})}}}let t=typeof e.getSource=="function"?a=>t(a):a=>e.sourceCode.getText(a),r=typeof e.getScope=="function"?()=>r():a=>e.sourceCode.getScope(a),n=null,s=[],o=[],i=new WeakSet;function p(a){for(let c of a.references){let g=c.identifier.parent;if(g.type==="VariableDeclarator"&&g.init&&g.init.type==="CallExpression"&&g.init.callee&&Vr(g.init.callee))for(let S of c.resolved.references)S!==c&&i.add(S.identifier)}}return{onCodePathSegmentStart:a=>o.push(a),onCodePathSegmentEnd:()=>o.pop(),onCodePathStart:()=>s.push(new Map),onCodePathEnd(a,c){let g=s.pop();if(g.size===0)return;let S=new Set;function l(y,x){let{cache:u}=l,d=u.get(y.id),A=new Set(x);if(A.has(y.id)){let I=[...A],P=I.slice(I.indexOf(y.id)+1);for(let k of P)S.add(k);return BigInt("0")}if(A.add(y.id),d!==void 0)return d;if(a.thrownSegments.includes(y))d=BigInt("0");else if(y.prevSegments.length===0)d=BigInt("1");else{d=BigInt("0");for(let I of y.prevSegments)d+=l(I,A)}return y.reachable&&d===BigInt("0")?u.delete(y.id):u.set(y.id,d),d}function E(y,x){let{cache:u}=E,d=u.get(y.id),A=new Set(x);if(A.has(y.id)){let I=Array.from(A),P=I.slice(I.indexOf(y.id)+1);for(let k of P)S.add(k);return BigInt("0")}if(A.add(y.id),d!==void 0)return d;if(a.thrownSegments.includes(y))d=BigInt("0");else if(y.nextSegments.length===0)d=BigInt("1");else{d=BigInt("0");for(let I of y.nextSegments)d+=E(I,A)}return u.set(y.id,d),d}function f(y){let{cache:x}=f,u=x.get(y.id);if(u===null)return 1/0;if(u!==void 0)return u;if(x.set(y.id,null),y.prevSegments.length===0)u=1;else{u=1/0;for(let d of y.prevSegments){let A=f(d);A<u&&(u=A)}u+=1}return x.set(y.id,u),u}l.cache=new Map,E.cache=new Map,f.cache=new Map;let h=E(a.initialSegment),T=Kr(c),m=xn(c),b=T?Br(T)||Et(T):qr(c)||Zr(c),C=1/0;for(let y of a.finalSegments){if(!y.reachable)continue;let x=f(y);x<C&&(C=x)}for(let[y,x]of g){if(!y.reachable)continue;let u=y.nextSegments.length===0?C<=f(y):C<f(y),d=l(y)*E(y),A=S.has(y.id);for(let I of x)if(A&&!Cn(I)&&e.report({node:I,message:`React Hook "${t(I)}" may be executed more than once. Possibly because it is called in a loop. React Hooks must be called in the exact same order in every component render.`}),b){if(c.async&&e.report({node:I,message:`React Hook "${t(I)}" cannot be called in an async function.`}),!A&&d!==h&&!Cn(I)){let k=`React Hook "${t(I)}" is called conditionally. React Hooks must be called in the exact same order in every component render.`+(u?" Did you accidentally call a React Hook after an early return?":"");e.report({node:I,message:k})}}else if(c.parent&&(c.parent.type==="MethodDefinition"||c.parent.type==="ClassProperty")&&c.parent.value===c){let P=`React Hook "${t(I)}" cannot be called in a class component. React Hooks must be called in a React function component or a custom React Hook function.`;e.report({node:I,message:P})}else if(T){let P=`React Hook "${t(I)}" is called in function "${t(T)}" that is neither a React function component nor a custom React Hook function. React component names must start with an uppercase letter. React Hook names must start with the word "use".`;e.report({node:I,message:P})}else if(c.type==="Program"){let P=`React Hook "${t(I)}" cannot be called at the top level. React Hooks must be called in a React function component or a custom React Hook function.`;e.report({node:I,message:P})}else if(m&&!Cn(I)){if(c.parent.type==="CallExpression"&&c.parent.callee.type==="Identifier"&&c.parent.callee.name==="useCallback"){let k=c.parent;if(k.parent.type==="VariableDeclarator"&&Hr(k.parent.id.name))return}let P=`React Hook "${t(I)}" cannot be called inside a callback. React Hooks must be called in a React function component or a custom React Hook function.`;e.report({node:I,message:P})}}},CallExpression(a){if(Et(a.callee)){let c=Xr(s),g=Xr(o),S=c.get(g);S||(S=[],c.set(g,S)),S.push(a.callee)}a.callee.type==="Identifier"&&(a.callee.name==="useEffect"||Vr(a.callee))&&a.arguments.length>0&&(n=a)},Identifier(a){n==null&&i.has(a)&&a.parent.type!=="CallExpression"&&e.report({node:a,message:`\`${t(a)}\` is a function created with React Hook "useEffectEvent", and can only be called from the same component. They cannot be assigned to variables or passed down.`})},"CallExpression:exit"(a){a===n&&(n=null)},FunctionDeclaration(a){xn(a)&&p(r(a))},ArrowFunctionExpression(a){xn(a)&&p(r(a))}}}};function Kr(e){return e.type==="FunctionDeclaration"||e.type==="FunctionExpression"&&e.id?e.id:e.type==="FunctionExpression"||e.type==="ArrowFunctionExpression"?e.parent.type==="VariableDeclarator"&&e.parent.init===e?e.parent.id:e.parent.type==="AssignmentExpression"&&e.parent.right===e&&e.parent.operator==="="?e.parent.left:e.parent.type==="Property"&&e.parent.value===e&&!e.parent.computed?e.parent.key:e.parent.type==="AssignmentPattern"&&e.parent.right===e&&!e.parent.computed?e.parent.left:void 0:void 0}function Xr(e){return e[e.length-1]}var le=require("@typescript-eslint/utils"),me=xe(require("zod/v4"));var sa=/^\s+$/,An=/\r?\n/,oa=/^(\s*)/,aa=/^(\s*)\S/,la=/\r?\n/,pa=me.object({indent:me.union([me.string().regex(sa),me.number().int().min(1)]).optional(),tags:me.array(me.string()).optional(),functions:me.array(me.string()).optional(),comments:me.array(me.string()).optional()}),In=_({name:"template-indent",meta:{type:"suggestion",docs:{description:"Fix whitespace-insensitive template indentation"},fixable:"code",schema:[$(pa)],messages:{improperlyIndented:"Templates should be properly indented."}},defaultOptions:[{}],create(e){let t=e.sourceCode,{comments:r=["HTML","indent"],functions:n=["dedent","stripIndent"],tags:s=["outdent","dedent","gql","sql","html","styled"],indent:o}=e.options[0],i=r.map(m=>m.toLowerCase());function p(m){let b=m.split(An),C=b.filter(x=>x.trim()!=="");if(C.length===0)return m;let y=Number.POSITIVE_INFINITY;for(let x of C){let u=x.match(oa);u&&(y=Math.min(y,u[1]?.length??0))}return!isFinite(y)||y===0?m:b.map(x=>x.slice(y)).join(`
35
+ ${S}`)),f.push(g.replaceText(s,l)),f}}]})}var ht=require("@typescript-eslint/utils"),qo=ht.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),Wr="require-description",Zo=/^(eslint(?:-env|-enable|-disable(?:(?:-next)?-line)?)?|exported|globals?)(?:\s|$)/u,Go=/^eslint-disable-(next-)?line$/u,Ko=qo({name:Wr,meta:{type:"problem",docs:{description:"Require descriptions for eslint directives."},messages:{missingDescription:"Unexpected undescribed directive comment. Include descriptions to explain why the comment is necessary."},schema:[{type:"object",properties:{ignore:{type:"array",items:{type:"string",enum:["eslint","eslint-disable","eslint-disable-line","eslint-disable-next-line","eslint-enable","eslint-env","exported","global","globals"]},additionalItems:!1,uniqueItems:!0}},additionalProperties:!1}]},defaultOptions:[{ignore:[]}],create(e,[t]){let r=e.sourceCode,n=new Set(t.ignore||[]);return{Program(){for(let s of r.getAllComments()){let o=Qo(s);o!=null&&(n.has(o.kind)||o.description||e.report({loc:na(s.loc),messageId:"missingDescription"}))}}}}}),Jr={name:Wr,rule:Ko};function Qo(e){let{text:t,description:r}=ta(e.value);if(!t)return null;let n=Zo.exec(t);if(!n)return null;let s=n[1];if(!s)return null;let o=Go.test(s);if(e.type===ht.TSESTree.AST_TOKEN_TYPES.Line&&!o||o&&e.loc.start.line!==e.loc.end.line)return null;let i=t.slice(n.index+s.length);return{kind:s,value:i.trim(),description:r}}var ea=/\s-{2,}\s/u;function ta(e){let t=e.split(ea);return{text:t[0]?.trim(),description:t.length>1?t[1]?.trim()??null:null}}function na(e){return{start:{line:e.start.line,column:-1},end:e.end}}var H=require("@typescript-eslint/utils"),Fe=require("zod/v4");var ra=Fe.z.object({varsToCheck:Fe.z.array(Fe.z.object({selector:Fe.z.string().optional(),fromFnCall:Fe.z.string().optional(),prop:Fe.z.string().or(Fe.z.array(Fe.z.string())),errorMsg:Fe.z.string().optional()}))}),bn=_({name:"require-reads-to-var-prop",meta:{type:"suggestion",docs:{description:"Require specific properties from variables to be read or ensure the variable is passed to functions/components"},messages:{propNotRead:'"{{fnName}}" requires reads to the prop "{{prop}}". {{customMsg}}',propsNotRead:'"{{fnName}}" requires reads to the props {{props}}. {{customMsg}}'},schema:[$(ra)]},defaultOptions:[{varsToCheck:[]}],create(e,[t]){let r=new Map;function n(i,p,a,c){let g=new Set;for(let l of i.properties)l.type===H.AST_NODE_TYPES.Property&&l.key.type===H.AST_NODE_TYPES.Identifier&&g.add(l.key.name);let S=p.filter(l=>!g.has(l));if(S.length>0)if(S.length===1)e.report({node:i,messageId:"propNotRead",data:{prop:S[0],fnName:c,customMsg:a||""}});else{let l=S.map(E=>`"${E}"`).join(", ");e.report({node:i,messageId:"propsNotRead",data:{props:l,fnName:c,customMsg:a||""}})}}function s(i){if(i.init?.type===H.AST_NODE_TYPES.CallExpression){if(i.init.callee.type===H.AST_NODE_TYPES.Identifier)return i.init.callee.name;if(i.init.callee.type===H.AST_NODE_TYPES.MemberExpression&&i.init.callee.property.type===H.AST_NODE_TYPES.Identifier)return i.init.callee.object.type===H.AST_NODE_TYPES.Identifier?`${i.init.callee.object.name}.${i.init.callee.property.name}`:i.init.callee.property.name}return"unknown function"}let o={};for(let i of t.varsToCheck)i.selector&&(o[i.selector]=p=>{if(p.type===H.AST_NODE_TYPES.VariableDeclarator&&p.id.type===H.AST_NODE_TYPES.Identifier&&r.set(p.id.name,{props:Array.isArray(i.prop)?i.prop:[i.prop],errorMsg:i.errorMsg,node:p.id,fnName:s(p)}),p.type===H.AST_NODE_TYPES.VariableDeclarator&&p.id.type===H.AST_NODE_TYPES.ObjectPattern){let a=Array.isArray(i.prop)?i.prop:[i.prop];n(p.id,a,i.errorMsg,s(p))}});for(let i of t.varsToCheck)if(i.fromFnCall){let p=i.fromFnCall;if(p.startsWith("*.")){let c=`VariableDeclarator > CallExpression > MemberExpression[property.name="${p.slice(2)}"]`;o[c]=g=>{if(g.type!==H.AST_NODE_TYPES.MemberExpression||g.parent.type!==H.AST_NODE_TYPES.CallExpression)return;let S=g.parent;if(S.parent.type!==H.AST_NODE_TYPES.VariableDeclarator)return;let l=S.parent;if(l.id.type===H.AST_NODE_TYPES.Identifier)r.set(l.id.name,{props:Array.isArray(i.prop)?i.prop:[i.prop],errorMsg:i.errorMsg,node:l.id,fnName:i.fromFnCall||"unknown function"});else if(l.id.type===H.AST_NODE_TYPES.ObjectPattern){let E=Array.isArray(i.prop)?i.prop:[i.prop];n(l.id,E,i.errorMsg,i.fromFnCall||"unknown function")}}}else if(p.includes(".")){let[a,c]=p.split("."),g=`VariableDeclarator > CallExpression > MemberExpression[object.name="${a}"][property.name="${c}"]`;o[g]=S=>{if(S.type!==H.AST_NODE_TYPES.MemberExpression||S.parent.type!==H.AST_NODE_TYPES.CallExpression)return;let l=S.parent;if(l.parent.type!==H.AST_NODE_TYPES.VariableDeclarator)return;let E=l.parent;if(E.id.type===H.AST_NODE_TYPES.Identifier)r.set(E.id.name,{props:Array.isArray(i.prop)?i.prop:[i.prop],errorMsg:i.errorMsg,node:E.id,fnName:i.fromFnCall||"unknown function"});else if(E.id.type===H.AST_NODE_TYPES.ObjectPattern){let f=Array.isArray(i.prop)?i.prop:[i.prop];n(E.id,f,i.errorMsg,i.fromFnCall||"unknown function")}}}else{let a=`VariableDeclarator > CallExpression > Identifier[name="${p}"]`;o[a]=c=>{if(c.type!==H.AST_NODE_TYPES.Identifier||c.parent.type!==H.AST_NODE_TYPES.CallExpression)return;let g=c.parent;if(g.parent.type!==H.AST_NODE_TYPES.VariableDeclarator)return;let S=g.parent;if(S.id.type===H.AST_NODE_TYPES.Identifier)r.set(S.id.name,{props:Array.isArray(i.prop)?i.prop:[i.prop],errorMsg:i.errorMsg,node:S.id,fnName:i.fromFnCall||"unknown function"});else if(S.id.type===H.AST_NODE_TYPES.ObjectPattern){let l=Array.isArray(i.prop)?i.prop:[i.prop];n(S.id,l,i.errorMsg,i.fromFnCall||"unknown function")}}}}return{...o,"Program:exit"(){for(let[i,{props:p,errorMsg:a,node:c,fnName:g}]of r){let l=e.sourceCode.getScope(c).set.get(i);if(l){let E=new Set(p);for(let f of l.references){let h=f.identifier,T=h.parent;if(!(T.type===H.AST_NODE_TYPES.VariableDeclarator&&T.id===h)){if(T.type===H.AST_NODE_TYPES.MemberExpression&&T.object===h&&T.property.type===H.AST_NODE_TYPES.Identifier&&E.has(T.property.name)){if(E.delete(T.property.name),E.size===0)break;continue}if(T.type===H.AST_NODE_TYPES.VariableDeclarator&&T.init===h&&T.id.type===H.AST_NODE_TYPES.ObjectPattern){for(let m of T.id.properties)m.type===H.AST_NODE_TYPES.Property&&m.key.type===H.AST_NODE_TYPES.Identifier&&E.has(m.key.name)&&E.delete(m.key.name);if(E.size===0)break;continue}if(!(T.type===H.AST_NODE_TYPES.MemberExpression&&T.object===h&&T.property.type===H.AST_NODE_TYPES.Identifier&&!p.includes(T.property.name))){E.clear();break}}}if(E.size>0){let f=Array.from(E);if(f.length===1)e.report({node:c,messageId:"propNotRead",data:{prop:f[0],fnName:g,customMsg:a||""}});else{let h=f.map(T=>`"${T}"`).join(", ");e.report({node:c,messageId:"propsNotRead",data:{props:h,fnName:g,customMsg:a||""}})}}}}}}}});function Hr(e){return/^use[A-Z0-9]/.test(e)}function Et(e){return e.type==="Identifier"?Hr(e.name):e.type==="MemberExpression"&&!e.computed&&Et(e.property)?e.object.type==="Identifier":!1}function Br(e){return e.type==="Identifier"&&/^[A-Z]/.test(e.name)}function Yr(e,t){return e.name===t||e.type==="MemberExpression"&&e.object.name==="React"&&e.property.name===t}function qr(e){return!!(e.parent&&e.parent.callee&&Yr(e.parent.callee,"forwardRef"))}function Zr(e){return!!(e.parent&&e.parent.callee&&Yr(e.parent.callee,"memo"))}function xn(e){for(;e;){let t=Kr(e);if(t&&(Br(t)||Et(t))||qr(e)||Zr(e))return!0;e=e.parent}return!1}function Vr(e){return!1}function Cn(e){return!1}var ia=/eslint +react-compiler\/react-compiler: +\["error/,Gr={meta:{type:"problem",docs:{description:"enforces the Rules of Hooks",recommended:!0,url:"https://reactjs.org/docs/hooks-rules.html"},schema:[{type:"object",ignoreIfReactCompilerIsEnabled:!1,properties:{ignoreIfReactCompilerIsEnabled:{type:"boolean"}}}]},create(e){if(e.options[0]?.ignoreIfReactCompilerIsEnabled){for(let a of e.sourceCode.getAllComments())if(ia.test(a.value))return{CallExpression(c){let g=null;c.callee.name==="useMemo"?g="useMemo":c.callee.name==="useCallback"&&(g="useCallback"),g&&e.report({node:c,message:`"${g}" is not necessary when using React Compiler.`})}}}let t=typeof e.getSource=="function"?a=>t(a):a=>e.sourceCode.getText(a),r=typeof e.getScope=="function"?()=>r():a=>e.sourceCode.getScope(a),n=null,s=[],o=[],i=new WeakSet;function p(a){for(let c of a.references){let g=c.identifier.parent;if(g.type==="VariableDeclarator"&&g.init&&g.init.type==="CallExpression"&&g.init.callee&&Vr(g.init.callee))for(let S of c.resolved.references)S!==c&&i.add(S.identifier)}}return{onCodePathSegmentStart:a=>o.push(a),onCodePathSegmentEnd:()=>o.pop(),onCodePathStart:()=>s.push(new Map),onCodePathEnd(a,c){let g=s.pop();if(g.size===0)return;let S=new Set;function l(y,x){let{cache:u}=l,d=u.get(y.id),A=new Set(x);if(A.has(y.id)){let I=[...A],R=I.slice(I.indexOf(y.id)+1);for(let F of R)S.add(F);return BigInt("0")}if(A.add(y.id),d!==void 0)return d;if(a.thrownSegments.includes(y))d=BigInt("0");else if(y.prevSegments.length===0)d=BigInt("1");else{d=BigInt("0");for(let I of y.prevSegments)d+=l(I,A)}return y.reachable&&d===BigInt("0")?u.delete(y.id):u.set(y.id,d),d}function E(y,x){let{cache:u}=E,d=u.get(y.id),A=new Set(x);if(A.has(y.id)){let I=Array.from(A),R=I.slice(I.indexOf(y.id)+1);for(let F of R)S.add(F);return BigInt("0")}if(A.add(y.id),d!==void 0)return d;if(a.thrownSegments.includes(y))d=BigInt("0");else if(y.nextSegments.length===0)d=BigInt("1");else{d=BigInt("0");for(let I of y.nextSegments)d+=E(I,A)}return u.set(y.id,d),d}function f(y){let{cache:x}=f,u=x.get(y.id);if(u===null)return 1/0;if(u!==void 0)return u;if(x.set(y.id,null),y.prevSegments.length===0)u=1;else{u=1/0;for(let d of y.prevSegments){let A=f(d);A<u&&(u=A)}u+=1}return x.set(y.id,u),u}l.cache=new Map,E.cache=new Map,f.cache=new Map;let h=E(a.initialSegment),T=Kr(c),m=xn(c),b=T?Br(T)||Et(T):qr(c)||Zr(c),C=1/0;for(let y of a.finalSegments){if(!y.reachable)continue;let x=f(y);x<C&&(C=x)}for(let[y,x]of g){if(!y.reachable)continue;let u=y.nextSegments.length===0?C<=f(y):C<f(y),d=l(y)*E(y),A=S.has(y.id);for(let I of x)if(A&&!Cn(I)&&e.report({node:I,message:`React Hook "${t(I)}" may be executed more than once. Possibly because it is called in a loop. React Hooks must be called in the exact same order in every component render.`}),b){if(c.async&&e.report({node:I,message:`React Hook "${t(I)}" cannot be called in an async function.`}),!A&&d!==h&&!Cn(I)){let F=`React Hook "${t(I)}" is called conditionally. React Hooks must be called in the exact same order in every component render.`+(u?" Did you accidentally call a React Hook after an early return?":"");e.report({node:I,message:F})}}else if(c.parent&&(c.parent.type==="MethodDefinition"||c.parent.type==="ClassProperty")&&c.parent.value===c){let R=`React Hook "${t(I)}" cannot be called in a class component. React Hooks must be called in a React function component or a custom React Hook function.`;e.report({node:I,message:R})}else if(T){let R=`React Hook "${t(I)}" is called in function "${t(T)}" that is neither a React function component nor a custom React Hook function. React component names must start with an uppercase letter. React Hook names must start with the word "use".`;e.report({node:I,message:R})}else if(c.type==="Program"){let R=`React Hook "${t(I)}" cannot be called at the top level. React Hooks must be called in a React function component or a custom React Hook function.`;e.report({node:I,message:R})}else if(m&&!Cn(I)){if(c.parent.type==="CallExpression"&&c.parent.callee.type==="Identifier"&&c.parent.callee.name==="useCallback"){let F=c.parent;if(F.parent.type==="VariableDeclarator"&&Hr(F.parent.id.name))return}let R=`React Hook "${t(I)}" cannot be called inside a callback. React Hooks must be called in a React function component or a custom React Hook function.`;e.report({node:I,message:R})}}},CallExpression(a){if(Et(a.callee)){let c=Xr(s),g=Xr(o),S=c.get(g);S||(S=[],c.set(g,S)),S.push(a.callee)}a.callee.type==="Identifier"&&(a.callee.name==="useEffect"||Vr(a.callee))&&a.arguments.length>0&&(n=a)},Identifier(a){n==null&&i.has(a)&&a.parent.type!=="CallExpression"&&e.report({node:a,message:`\`${t(a)}\` is a function created with React Hook "useEffectEvent", and can only be called from the same component. They cannot be assigned to variables or passed down.`})},"CallExpression:exit"(a){a===n&&(n=null)},FunctionDeclaration(a){xn(a)&&p(r(a))},ArrowFunctionExpression(a){xn(a)&&p(r(a))}}}};function Kr(e){return e.type==="FunctionDeclaration"||e.type==="FunctionExpression"&&e.id?e.id:e.type==="FunctionExpression"||e.type==="ArrowFunctionExpression"?e.parent.type==="VariableDeclarator"&&e.parent.init===e?e.parent.id:e.parent.type==="AssignmentExpression"&&e.parent.right===e&&e.parent.operator==="="?e.parent.left:e.parent.type==="Property"&&e.parent.value===e&&!e.parent.computed?e.parent.key:e.parent.type==="AssignmentPattern"&&e.parent.right===e&&!e.parent.computed?e.parent.left:void 0:void 0}function Xr(e){return e[e.length-1]}var le=require("@typescript-eslint/utils"),me=xe(require("zod/v4"));var sa=/^\s+$/,An=/\r?\n/,oa=/^(\s*)/,aa=/^(\s*)\S/,la=/\r?\n/,pa=me.object({indent:me.union([me.string().regex(sa),me.number().int().min(1)]).optional(),tags:me.array(me.string()).optional(),functions:me.array(me.string()).optional(),comments:me.array(me.string()).optional()}),In=_({name:"template-indent",meta:{type:"suggestion",docs:{description:"Fix whitespace-insensitive template indentation"},fixable:"code",schema:[$(pa)],messages:{improperlyIndented:"Templates should be properly indented."}},defaultOptions:[{}],create(e){let t=e.sourceCode,{comments:r=["HTML","indent"],functions:n=["dedent","stripIndent"],tags:s=["outdent","dedent","gql","sql","html","styled"],indent:o}=e.options[0],i=r.map(m=>m.toLowerCase());function p(m){let b=m.split(An),C=b.filter(x=>x.trim()!=="");if(C.length===0)return m;let y=Number.POSITIVE_INFINITY;for(let x of C){let u=x.match(oa);u&&(y=Math.min(y,u[1]?.length??0))}return!isFinite(y)||y===0?m:b.map(x=>x.slice(y)).join(`
36
36
  `)}function a(m,b,C){return m.split(An).map(x=>x.trim()===""?x:C.repeat(b)+x).join(`
37
- `)}function c(m){if(m.type===le.AST_NODE_TYPES.Identifier)return m.name;if(m.type===le.AST_NODE_TYPES.MemberExpression){let b=m.object.type===le.AST_NODE_TYPES.Identifier?m.object.name:null,C=m.property.type===le.AST_NODE_TYPES.Identifier?m.property.name:null;return b&&C?`${b}.${C}`:C}return null}function g(m,b){if(!m)return!1;for(let C of b)if(C.includes(".")){let y=C.split(".");if(m.type===le.AST_NODE_TYPES.MemberExpression&&m.object.type===le.AST_NODE_TYPES.Identifier&&m.property.type===le.AST_NODE_TYPES.Identifier&&m.object.name===y[0]&&m.property.name===y[1])return!0}else if(m.type===le.AST_NODE_TYPES.Identifier&&m.name===C)return!0;return!1}function S(m,b){let C=m.parent;if(C.type!==le.AST_NODE_TYPES.TaggedTemplateExpression)return!1;let y=c(C.tag);return y?b.includes(y):!1}function l(m,b){if(!m||m.type!==le.AST_NODE_TYPES.CallExpression)return!1;let{method:C,argumentsLength:y,optionalCall:x=!0,optionalMember:u=!0}=b;return y!==void 0&&m.arguments.length!==y||!x&&m.optional||m.callee.type!==le.AST_NODE_TYPES.MemberExpression||!u&&m.callee.optional||m.callee.property.type!==le.AST_NODE_TYPES.Identifier?!1:m.callee.property.name===C}function E(m,b){if(!m||m.type!==le.AST_NODE_TYPES.CallExpression)return!1;let{name:C,argumentsLength:y,optionalCall:x=!0}=b;return y!==void 0&&m.arguments.length!==y||!x&&m.optional||m.callee.type!==le.AST_NODE_TYPES.Identifier?!1:m.callee.name===C}function f(m){return l(m.parent,{method:"toMatchInlineSnapshot",argumentsLength:1,optionalCall:!1,optionalMember:!1})&&m.parent.type===le.AST_NODE_TYPES.CallExpression&&m.parent.arguments[0]===m&&E(m.parent.callee.type===le.AST_NODE_TYPES.MemberExpression?m.parent.callee.object:null,{name:"expect",argumentsLength:1,optionalCall:!1,optionalMember:!1})}function h(m){if(i.length>0){let b=t.getTokenBefore(m,{includeComments:!0});if(b?.type===le.AST_TOKEN_TYPES.Block&&i.includes(b.value.trim().toLowerCase()))return!0}return!!(f(m)||s.length>0&&S(m,s)||n.length>0&&m.parent.type===le.AST_NODE_TYPES.CallExpression&&m.parent.arguments.includes(m)&&g(m.parent.callee,n))}function T(m){let b=`__PLACEHOLDER__${Math.random()}`,C=m.quasis.map(Z=>t.getText(Z).slice(1,Z.tail?-1:-2)).join(b),y=C.match(la);if(!y)return;let x=y[0],u=t.lines[t.getLocFromIndex(m.range[0]).line-1];if(!u)return;let A=u.match(aa)?.[1]??"",I;typeof o=="string"?I=o:typeof o=="number"?I=" ".repeat(o):I=A.startsWith(" ")?" ":" ";let k=p(C).replace(new RegExp(`^${x}|${x}[ ]*$`,"g"),""),H=x+a(k,1,A+I)+x+A,K=C.includes(`\r
37
+ `)}function c(m){if(m.type===le.AST_NODE_TYPES.Identifier)return m.name;if(m.type===le.AST_NODE_TYPES.MemberExpression){let b=m.object.type===le.AST_NODE_TYPES.Identifier?m.object.name:null,C=m.property.type===le.AST_NODE_TYPES.Identifier?m.property.name:null;return b&&C?`${b}.${C}`:C}return null}function g(m,b){if(!m)return!1;for(let C of b)if(C.includes(".")){let y=C.split(".");if(m.type===le.AST_NODE_TYPES.MemberExpression&&m.object.type===le.AST_NODE_TYPES.Identifier&&m.property.type===le.AST_NODE_TYPES.Identifier&&m.object.name===y[0]&&m.property.name===y[1])return!0}else if(m.type===le.AST_NODE_TYPES.Identifier&&m.name===C)return!0;return!1}function S(m,b){let C=m.parent;if(C.type!==le.AST_NODE_TYPES.TaggedTemplateExpression)return!1;let y=c(C.tag);return y?b.includes(y):!1}function l(m,b){if(!m||m.type!==le.AST_NODE_TYPES.CallExpression)return!1;let{method:C,argumentsLength:y,optionalCall:x=!0,optionalMember:u=!0}=b;return y!==void 0&&m.arguments.length!==y||!x&&m.optional||m.callee.type!==le.AST_NODE_TYPES.MemberExpression||!u&&m.callee.optional||m.callee.property.type!==le.AST_NODE_TYPES.Identifier?!1:m.callee.property.name===C}function E(m,b){if(!m||m.type!==le.AST_NODE_TYPES.CallExpression)return!1;let{name:C,argumentsLength:y,optionalCall:x=!0}=b;return y!==void 0&&m.arguments.length!==y||!x&&m.optional||m.callee.type!==le.AST_NODE_TYPES.Identifier?!1:m.callee.name===C}function f(m){return l(m.parent,{method:"toMatchInlineSnapshot",argumentsLength:1,optionalCall:!1,optionalMember:!1})&&m.parent.type===le.AST_NODE_TYPES.CallExpression&&m.parent.arguments[0]===m&&E(m.parent.callee.type===le.AST_NODE_TYPES.MemberExpression?m.parent.callee.object:null,{name:"expect",argumentsLength:1,optionalCall:!1,optionalMember:!1})}function h(m){if(i.length>0){let b=t.getTokenBefore(m,{includeComments:!0});if(b?.type===le.AST_TOKEN_TYPES.Block&&i.includes(b.value.trim().toLowerCase()))return!0}return!!(f(m)||s.length>0&&S(m,s)||n.length>0&&m.parent.type===le.AST_NODE_TYPES.CallExpression&&m.parent.arguments.includes(m)&&g(m.parent.callee,n))}function T(m){let b=`__PLACEHOLDER__${Math.random()}`,C=m.quasis.map(V=>t.getText(V).slice(1,V.tail?-1:-2)).join(b),y=C.match(la);if(!y)return;let x=y[0],u=t.lines[t.getLocFromIndex(m.range[0]).line-1];if(!u)return;let A=u.match(aa)?.[1]??"",I;typeof o=="string"?I=o:typeof o=="number"?I=" ".repeat(o):I=A.startsWith(" ")?" ":" ";let F=p(C).replace(new RegExp(`^${x}|${x}[ ]*$`,"g"),""),J=x+a(F,1,A+I)+x+A,Z=C.includes(`\r
38
38
  `)?`\r
39
39
  `:`
40
- `,ne=C.split(An),oe=ne.map((Z,de)=>de!==ne.length-1&&Z===I+A?"":Z).join(K);if(H!==oe)return{node:m,messageId:"improperlyIndented",fix:Z=>H.split(b).map((de,Ae)=>{let ue=m.quasis[Ae];return ue?Z.replaceTextRange([ue.range[0]+1,ue.range[1]-(ue.tail?1:2)],de):[]}).flat()}}return{TemplateLiteral(m){if(!h(m))return;let b=T(m);if(b)return e.report(b)}}}});var wn=require("@typescript-eslint/utils");function ca(e){if(!("regex"in e))return!1;let t=e.regex.flags;return t.includes("g")||t.includes("y")}function ua(e){let t=e.parent;return t?.type===wn.AST_NODE_TYPES.NewExpression&&t.callee.type===wn.AST_NODE_TYPES.Identifier&&t.callee.name==="RegExp"}var Rn=_({name:"use-top-level-regex",meta:{type:"suggestion",docs:{description:"Require regex literals to be declared at the top level to avoid performance issues"},messages:{regexShouldBeTopLevel:"Move this regex literal to the top level to avoid creating new RegExp objects on each function call."},schema:[],hasSuggestions:!1},defaultOptions:[],create(e){function t(r){ca(r)||ua(r)||e.report({node:r,messageId:"regexShouldBeTopLevel"})}return{"FunctionDeclaration Literal[regex], FunctionExpression Literal[regex], ArrowFunctionExpression Literal[regex], MethodDefinition Literal[regex]":t}}});var pe=require("@typescript-eslint/utils"),Ze=require("zod/v4");var fa=Ze.z.object({checkOnly:Ze.z.array(Ze.z.enum(["function-args","FC","generic-args-at-fn-calls"])).optional(),checkTypesFromSelectors:Ze.z.array(Ze.z.string()).optional()}),Pn=_({name:"use-types-directly-above-usage",meta:{type:"suggestion",docs:{description:"Require type definitions to be placed directly above their first usage for better readability"},fixable:"code",schema:[$(fa)],messages:{moveTypeAboveUsage:"Type definition should be placed directly above its first usage."}},defaultOptions:[{}],create(e,[t]){let r=e.sourceCode,n=new Map,s=[];function o(f){for(let h of s)if(f.range[0]>=h.range[0]&&f.range[1]<=h.range[1])return h;return null}function i(f){let h=f.parent;for(;h;){if(h.type===pe.AST_NODE_TYPES.FunctionDeclaration||h.type===pe.AST_NODE_TYPES.FunctionExpression||h.type===pe.AST_NODE_TYPES.ArrowFunctionExpression){let T=h.params;for(let m of T)if(f.range[0]>=m.range[0]&&f.range[1]<=m.range[1])return!0;break}h=h.parent}return!1}function p(f){let h=f.parent;for(;h;){if(h.type===pe.AST_NODE_TYPES.TSTypeParameterInstantiation){let T=h.parent;if(T.type===pe.AST_NODE_TYPES.TSTypeReference&&T.typeName.type===pe.AST_NODE_TYPES.Identifier&&(T.typeName.name==="FC"||T.typeName.name==="React.FC")||T.type===pe.AST_NODE_TYPES.TSTypeReference&&T.typeName.type===pe.AST_NODE_TYPES.TSQualifiedName&&T.typeName.right.name==="FC")return!0}h=h.parent}return!1}function a(f){let h=f.parent;for(;h;){if(h.type===pe.AST_NODE_TYPES.TSTypeParameterInstantiation){let T=h.parent;if(T.type===pe.AST_NODE_TYPES.CallExpression||T.type===pe.AST_NODE_TYPES.NewExpression)return!0}h=h.parent}return!1}function c(f){let h=f.parent;for(;h;){if(h.type===pe.AST_NODE_TYPES.TSTypeAliasDeclaration||h.type===pe.AST_NODE_TYPES.TSInterfaceDeclaration)return!0;h=h.parent}return!1}function g(f){return f.parent.type===pe.AST_NODE_TYPES.TSIndexedAccessType&&f.parent.objectType===f}let S=[];function l(f){let h=[],T=new Map;for(let{typeName:b,firstUsage:C}of f){let y=T.get(C)||[];y.push(b),T.set(C,y)}for(let{typeName:b,firstUsage:C,firstUsagePosition:y,firstUsageInFunctionArgs:x}of f){let u=n.get(b);if(!u||u.statement===C)continue;let d=s.indexOf(u.statement),A=s.indexOf(C);if(d===-1||A===-1)continue;let I=!!(t.checkOnly&&t.checkOnly.includes("function-args")&&x),k=(T.get(C)||[]).length>1;(I||k?d>A:d>A||d!==A-1)&&h.push({typeName:b,typeDef:u,targetStatement:C,firstUsagePosition:y})}if(h.length===0)return;h.sort((b,C)=>{let y=b.firstUsagePosition-C.firstUsagePosition;if(y!==0)return y;let x=s.indexOf(b.typeDef.statement),u=s.indexOf(C.typeDef.statement);return x-u});let m=h[0];m&&e.report({node:m.typeDef.node,messageId:"moveTypeAboveUsage",fix:E(h)})}function E(f){return function*(h){let T=new Map;for(let m of f){let b=T.get(m.targetStatement)||[];b.push(m),T.set(m.targetStatement,b)}for(let[,m]of T)m.sort((b,C)=>{let y=b.firstUsagePosition-C.firstUsagePosition;if(y!==0)return y;let x=s.indexOf(b.typeDef.statement),u=s.indexOf(C.typeDef.statement);return x-u});for(let m of f){let{typeDef:b}=m,C=b.statement,y=r.getCommentsBefore(C),x=C.range[0],u=C.range[1];y.length>0&&y[0]&&(x=y[0].range[0]),yield h.removeRange([x,u])}for(let[m,b]of T){let C=r.getCommentsBefore(m),y=C.length>0&&C[0]?C[0].range[0]:m.range[0],x=[];for(let u of b){let d=u.typeDef.statement,A=r.getText(d),I=r.getCommentsBefore(d),P=A;I.length>0&&(P=`${I.map(H=>r.getText(H)).join(`
40
+ `,ne=C.split(An),te=ne.map((V,de)=>de!==ne.length-1&&V===I+A?"":V).join(Z);if(J!==te)return{node:m,messageId:"improperlyIndented",fix:V=>J.split(b).map((de,Ae)=>{let ue=m.quasis[Ae];return ue?V.replaceTextRange([ue.range[0]+1,ue.range[1]-(ue.tail?1:2)],de):[]}).flat()}}return{TemplateLiteral(m){if(!h(m))return;let b=T(m);if(b)return e.report(b)}}}});var wn=require("@typescript-eslint/utils");function ca(e){if(!("regex"in e))return!1;let t=e.regex.flags;return t.includes("g")||t.includes("y")}function ua(e){let t=e.parent;return t?.type===wn.AST_NODE_TYPES.NewExpression&&t.callee.type===wn.AST_NODE_TYPES.Identifier&&t.callee.name==="RegExp"}var Rn=_({name:"use-top-level-regex",meta:{type:"suggestion",docs:{description:"Require regex literals to be declared at the top level to avoid performance issues"},messages:{regexShouldBeTopLevel:"Move this regex literal to the top level to avoid creating new RegExp objects on each function call."},schema:[],hasSuggestions:!1},defaultOptions:[],create(e){function t(r){ca(r)||ua(r)||e.report({node:r,messageId:"regexShouldBeTopLevel"})}return{"FunctionDeclaration Literal[regex], FunctionExpression Literal[regex], ArrowFunctionExpression Literal[regex], MethodDefinition Literal[regex]":t}}});var pe=require("@typescript-eslint/utils"),Ze=require("zod/v4");var fa=Ze.z.object({checkOnly:Ze.z.array(Ze.z.enum(["function-args","FC","generic-args-at-fn-calls"])).optional(),checkTypesFromSelectors:Ze.z.array(Ze.z.string()).optional()}),Pn=_({name:"use-types-directly-above-usage",meta:{type:"suggestion",docs:{description:"Require type definitions to be placed directly above their first usage for better readability"},fixable:"code",schema:[$(fa)],messages:{moveTypeAboveUsage:"Type definition should be placed directly above its first usage."}},defaultOptions:[{}],create(e,[t]){let r=e.sourceCode,n=new Map,s=[];function o(f){for(let h of s)if(f.range[0]>=h.range[0]&&f.range[1]<=h.range[1])return h;return null}function i(f){let h=f.parent;for(;h;){if(h.type===pe.AST_NODE_TYPES.FunctionDeclaration||h.type===pe.AST_NODE_TYPES.FunctionExpression||h.type===pe.AST_NODE_TYPES.ArrowFunctionExpression){let T=h.params;for(let m of T)if(f.range[0]>=m.range[0]&&f.range[1]<=m.range[1])return!0;break}h=h.parent}return!1}function p(f){let h=f.parent;for(;h;){if(h.type===pe.AST_NODE_TYPES.TSTypeParameterInstantiation){let T=h.parent;if(T.type===pe.AST_NODE_TYPES.TSTypeReference&&T.typeName.type===pe.AST_NODE_TYPES.Identifier&&(T.typeName.name==="FC"||T.typeName.name==="React.FC")||T.type===pe.AST_NODE_TYPES.TSTypeReference&&T.typeName.type===pe.AST_NODE_TYPES.TSQualifiedName&&T.typeName.right.name==="FC")return!0}h=h.parent}return!1}function a(f){let h=f.parent;for(;h;){if(h.type===pe.AST_NODE_TYPES.TSTypeParameterInstantiation){let T=h.parent;if(T.type===pe.AST_NODE_TYPES.CallExpression||T.type===pe.AST_NODE_TYPES.NewExpression)return!0}h=h.parent}return!1}function c(f){let h=f.parent;for(;h;){if(h.type===pe.AST_NODE_TYPES.TSTypeAliasDeclaration||h.type===pe.AST_NODE_TYPES.TSInterfaceDeclaration)return!0;h=h.parent}return!1}function g(f){return f.parent.type===pe.AST_NODE_TYPES.TSIndexedAccessType&&f.parent.objectType===f}let S=[];function l(f){let h=[],T=new Map;for(let{typeName:b,firstUsage:C}of f){let y=T.get(C)||[];y.push(b),T.set(C,y)}for(let{typeName:b,firstUsage:C,firstUsagePosition:y,firstUsageInFunctionArgs:x}of f){let u=n.get(b);if(!u||u.statement===C)continue;let d=s.indexOf(u.statement),A=s.indexOf(C);if(d===-1||A===-1)continue;let I=!!(t.checkOnly&&t.checkOnly.includes("function-args")&&x),F=(T.get(C)||[]).length>1;(I||F?d>A:d>A||d!==A-1)&&h.push({typeName:b,typeDef:u,targetStatement:C,firstUsagePosition:y})}if(h.length===0)return;h.sort((b,C)=>{let y=b.firstUsagePosition-C.firstUsagePosition;if(y!==0)return y;let x=s.indexOf(b.typeDef.statement),u=s.indexOf(C.typeDef.statement);return x-u});let m=h[0];m&&e.report({node:m.typeDef.node,messageId:"moveTypeAboveUsage",fix:E(h)})}function E(f){return function*(h){let T=new Map;for(let m of f){let b=T.get(m.targetStatement)||[];b.push(m),T.set(m.targetStatement,b)}for(let[,m]of T)m.sort((b,C)=>{let y=b.firstUsagePosition-C.firstUsagePosition;if(y!==0)return y;let x=s.indexOf(b.typeDef.statement),u=s.indexOf(C.typeDef.statement);return x-u});for(let m of f){let{typeDef:b}=m,C=b.statement,y=r.getCommentsBefore(C),x=C.range[0],u=C.range[1];y.length>0&&y[0]&&(x=y[0].range[0]),yield h.removeRange([x,u])}for(let[m,b]of T){let C=r.getCommentsBefore(m),y=C.length>0&&C[0]?C[0].range[0]:m.range[0],x=[];for(let u of b){let d=u.typeDef.statement,A=r.getText(d),I=r.getCommentsBefore(d),R=A;I.length>0&&(R=`${I.map(J=>r.getText(J)).join(`
41
41
  `)}
42
- ${A}`),x.push(P)}yield h.insertTextBeforeRange([y,y],`${x.join(`
42
+ ${A}`),x.push(R)}yield h.insertTextBeforeRange([y,y],`${x.join(`
43
43
 
44
44
  `)}
45
45
 
46
- `)}}}return{Program(f){s.push(...f.body)},TSTypeAliasDeclaration(f){if(s.some(T=>T.type===pe.AST_NODE_TYPES.ExportNamedDeclaration&&T.declaration===f?!0:T===f)){let T=o(f);T&&n.set(f.id.name,{node:f,name:f.id.name,statement:T})}},TSInterfaceDeclaration(f){if(s.some(T=>T.type===pe.AST_NODE_TYPES.ExportNamedDeclaration&&T.declaration===f?!0:T===f)){let T=o(f);T&&n.set(f.id.name,{node:f,name:f.id.name,statement:T})}},TSTypeReference(f){if(f.typeName.type===pe.AST_NODE_TYPES.Identifier){if(g(f))return;let h=i(f),T=p(f),m=a(f);S.push({typeName:f.typeName.name,node:f,inFunctionArgs:h,inFCProps:T,inGenericArgAtFunctionCall:m,usagePosition:f.range[0]})}},"Program:exit"(){let f=new Map;function h(m){if(!t.checkOnly||t.checkOnly.length===0)return!0;for(let b of t.checkOnly)if(b==="function-args"&&m.inFunctionArgs||b==="FC"&&m.inFCProps||b==="generic-args-at-fn-calls"&&m.inGenericArgAtFunctionCall)return!0;return!1}for(let m of S){let{typeName:b,node:C}=m;if(!n.has(b)||!h(m))continue;let y=o(C),x=n.get(b);if(!y||!x||y===x.statement)continue;f.has(b)||f.set(b,[]);let u=f.get(b);if(!u)return;u.includes(y)||u.push(y)}let T=[];for(let[m,b]of f)if(b.length>0){if(b.length===0)continue;let C=b[0];if(!C)continue;let y=Number.MAX_SAFE_INTEGER,x=!1;for(let d of b)d.range[0]<C.range[0]&&(C=d);for(let d of S)h(d)&&d.typeName===m&&o(d.node)===C&&d.usagePosition<y&&(y=d.usagePosition,x=d.inFunctionArgs);if(!!(t.checkOnly&&t.checkOnly.length>0)){let d=Number.MAX_SAFE_INTEGER;for(let I of S){if(I.typeName!==m)continue;let P=o(I.node);if(!P)continue;let k=s.indexOf(P);k!==-1&&k<d&&(d=k)}let A=s.indexOf(C);if(d!==Number.MAX_SAFE_INTEGER&&A!==-1&&d<A)continue}else{let d=Number.MAX_SAFE_INTEGER;for(let I of S){if(I.typeName!==m||c(I.node))continue;let P=o(I.node);if(!P)continue;let k=s.indexOf(P);k!==-1&&k<d&&(d=k)}let A=s.indexOf(C);if(d!==Number.MAX_SAFE_INTEGER&&A!==-1&&d<A)continue}T.push({typeName:m,firstUsage:C,firstUsagePosition:y,firstUsageInFunctionArgs:x})}T.length>0&&l(T)}}}});var B=require("@typescript-eslint/utils"),Ge=xe(require("zod/v4"));var ma=["tsx"],ya=/^[A-Z][A-Za-z0-9]*$/,da=Ge.object({extensions:Ge.array(Ge.string()).optional()}),vn=_({name:"react-single-export",meta:{type:"problem",docs:{description:"Enforces only one export per React component file to support fast refresh"},messages:{multipleExports:"React component files should have only one export to support fast refresh, if you want to export multiple components, use a separate file for each component. Type-only exports are allowed."},schema:[$(da)]},defaultOptions:[{}],create(e,[t]){let r=e.getFilename(),n=t.extensions??ma,s=!1;for(let y of n)if(r.endsWith(y)){s=!0;break}if(!s)return{};let o=e.sourceCode,i=new Set,p=new Map;function a(y){return ya.test(y)}function c(y){if(y.type!==B.AST_NODE_TYPES.CallExpression)return!1;let x=y.callee;return x.type===B.AST_NODE_TYPES.Identifier?x.name==="memo"||x.name==="forwardRef":x.type===B.AST_NODE_TYPES.MemberExpression&&x.property.type===B.AST_NODE_TYPES.Identifier?x.property.name==="memo"||x.property.name==="forwardRef":!1}function g(y){if(y.type===B.AST_NODE_TYPES.JSXElement||y.type===B.AST_NODE_TYPES.JSXFragment)return!0;if(y.type===B.AST_NODE_TYPES.ArrayExpression){for(let x of y.elements)if(x&&(x.type===B.AST_NODE_TYPES.JSXElement||x.type===B.AST_NODE_TYPES.JSXFragment))return!0}return!1}function S(y){if(y.type!==B.AST_NODE_TYPES.ArrowFunctionExpression)return!1;let x=y.body;if(x.type===B.AST_NODE_TYPES.ArrowFunctionExpression){let u=x.body;if(g(u))return!0}return!1}function l(y){if(y.id.type!==B.AST_NODE_TYPES.Identifier)return;let x=y.id.name,u=y.init;if(u){if(a(x)&&(u.type===B.AST_NODE_TYPES.ArrowFunctionExpression||u.type===B.AST_NODE_TYPES.FunctionExpression||c(u))){i.add(x);return}u.type===B.AST_NODE_TYPES.Identifier&&p.set(x,u.name),a(x)||S(u)&&i.add(x)}}function E(y){if(y.type===B.AST_NODE_TYPES.VariableDeclaration){for(let x of y.declarations)l(x);return}if(y.type===B.AST_NODE_TYPES.FunctionDeclaration&&y.id){a(y.id.name)&&i.add(y.id.name);return}if(y.type===B.AST_NODE_TYPES.ExportNamedDeclaration&&y.declaration){let x=y.declaration;if(x.type===B.AST_NODE_TYPES.VariableDeclaration){for(let u of x.declarations)l(u);return}if(x.type===B.AST_NODE_TYPES.FunctionDeclaration&&x.id){a(x.id.name)&&i.add(x.id.name);return}}}for(let y of o.ast.body)E(y);function f(y,x=new Set){if(i.has(y))return!0;if(x.has(y))return!1;x.add(y);let u=p.get(y);return u?f(u,x):!1}let h=[];function T(y,x,u){h.push({node:y,isType:x,isComponent:u})}for(let y of o.ast.body){if(y.type===B.AST_NODE_TYPES.ExportNamedDeclaration){let x=y.exportKind==="type";if(y.declaration){let u=y.declaration;if(u.type===B.AST_NODE_TYPES.TSTypeAliasDeclaration||u.type===B.AST_NODE_TYPES.TSInterfaceDeclaration){T(u,!0,!1);continue}if(u.type===B.AST_NODE_TYPES.VariableDeclaration){for(let d of u.declarations){if(d.id.type!==B.AST_NODE_TYPES.Identifier)continue;let A=d.id.name,I=f(A);T(d,x,I)}continue}if(u.type===B.AST_NODE_TYPES.FunctionDeclaration){let d=u.id?.name,A=d?f(d)||a(d):!1;T(u,x,A);continue}T(u,x,!1);continue}if(y.specifiers.length>0)for(let u of y.specifiers){if(u.local.type!==B.AST_NODE_TYPES.Identifier)continue;let d=u.local.name,A=f(d);T(u,x,A)}continue}if(y.type===B.AST_NODE_TYPES.ExportDefaultDeclaration){let x=y.declaration;if(x.type===B.AST_NODE_TYPES.Identifier){let u=f(x.name)||a(x.name);T(y,!1,u);continue}if(x.type===B.AST_NODE_TYPES.FunctionDeclaration||x.type===B.AST_NODE_TYPES.ArrowFunctionExpression||x.type===B.AST_NODE_TYPES.FunctionExpression||x.type===B.AST_NODE_TYPES.CallExpression){T(y,!1,!0);continue}T(y,!1,!1);continue}}let m=!1;for(let y of h)if(!y.isType&&y.isComponent){m=!0;break}if(!m)return{};let b=[];for(let y of h)y.isType||b.push(y);let C=-1;for(let[y,x]of b.entries())if(x.isComponent){C=y;break}if(C===-1)return{};for(let[y,x]of b.entries())if(y!==C){e.report({node:x.node,messageId:"multipleExports"});break}return{}}});var je=require("@typescript-eslint/utils"),bt=require("zod/v4");function xt(e){return e.charAt(0).toUpperCase()+e.slice(1)}function ga(e){return e.callee.type===je.AST_NODE_TYPES.Identifier?e.callee.name==="useState":e.callee.type===je.AST_NODE_TYPES.MemberExpression&&e.callee.object.type===je.AST_NODE_TYPES.Identifier&&e.callee.property.type===je.AST_NODE_TYPES.Identifier?e.callee.object.name==="React"&&e.callee.property.name==="useState":!1}var Sa=bt.z.object({ignorePrefixes:bt.z.array(bt.z.string()).optional()});function Qr(e,t){for(let r of t)if(e.startsWith(r))return e.slice(r.length);return e}function Ta(e){return`set${xt(e)}`}var kn=_({name:"use-state-setter-naming",meta:{type:"problem",docs:{description:"Enforce consistent naming convention for useState destructuring where setter should be set{Value}"},messages:{incorrectSetterName:'useState setter should follow the pattern "set{{expectedName}}" with a "set" prefix but got "{{actualName}}"',useSuggestedName:'Use "{{expectedSetterName}}" instead'},hasSuggestions:!0,schema:[$(Sa)]},defaultOptions:[{ignorePrefixes:[]}],create(e,[t]){return{VariableDeclarator(r){if(!r.init||r.init.type!==je.AST_NODE_TYPES.CallExpression||!ga(r.init)||r.id.type!==je.AST_NODE_TYPES.ArrayPattern||r.id.elements.length!==2)return;let[n,s]=r.id.elements;if(!n||!s||n.type!==je.AST_NODE_TYPES.Identifier||s.type!==je.AST_NODE_TYPES.Identifier)return;let o=n.name,i=s.name,p=t.ignorePrefixes||[],a=Qr(o,p),c=Qr(i,p);if(a===""){if(!c.startsWith("set")){let S=`set${xt(o)}`;e.report({node:s,messageId:"incorrectSetterName",data:{expectedName:xt(o),actualName:i},suggest:[{messageId:"useSuggestedName",data:{expectedSetterName:S},fix:l=>l.replaceText(s,S)}]})}return}let g=Ta(a);c!==g&&e.report({node:s,messageId:"incorrectSetterName",data:{expectedName:xt(a),actualName:i},suggest:[{messageId:"useSuggestedName",data:{expectedSetterName:g},fix:S=>S.replaceText(s,g)}]})}}}});var se=require("@typescript-eslint/utils"),Xe=require("zod/v4");var ha=Xe.z.object({name:Xe.z.string(),defaults:Xe.z.array(Xe.z.unknown())}),Ea=Xe.z.object({functions:Xe.z.array(ha)});function Ct(e,t){if(e===t)return!0;if(e===null||t===null||e===void 0||t===void 0)return e===t;if(typeof e!=typeof t||typeof e!="object"||Array.isArray(e)!==Array.isArray(t))return!1;if(Array.isArray(e)&&Array.isArray(t))return e.length!==t.length?!1:e.every((s,o)=>Ct(s,t[o]));let r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(let s of r){if(!n.includes(s))return!1;let o=Object.getOwnPropertyDescriptor(e,s),i=Object.getOwnPropertyDescriptor(t,s);if(!o||!i)return!1;let p=o.value,a=i.value;if(!Ct(p,a))return!1}return!0}function ba(e,t){let r=new Set;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return r;for(let n in e){if(!(n in t))continue;let s=Object.getOwnPropertyDescriptor(e,n),o=Object.getOwnPropertyDescriptor(t,n);s&&o&&Ct(s.value,o.value)&&r.add(n)}return r}function ei(e){if(e.type===se.AST_NODE_TYPES.SpreadElement)return Symbol("COMPLEX_EXPRESSION");switch(e.type){case se.AST_NODE_TYPES.Literal:return e.value;case se.AST_NODE_TYPES.ObjectExpression:{let t={};for(let r of e.properties)r.type===se.AST_NODE_TYPES.Property&&r.key.type===se.AST_NODE_TYPES.Identifier&&!r.computed&&(r.value.type===se.AST_NODE_TYPES.Literal?t[r.key.name]=r.value.value:r.value.type===se.AST_NODE_TYPES.ObjectExpression?t[r.key.name]=ei(r.value):t[r.key.name]=Symbol("COMPLEX_EXPRESSION"));return t}case se.AST_NODE_TYPES.ArrayExpression:return e.elements.map(t=>{if(!(!t||t.type===se.AST_NODE_TYPES.SpreadElement))return t.type===se.AST_NODE_TYPES.Literal?t.value:Symbol("COMPLEX_EXPRESSION")});default:return Symbol("COMPLEX_EXPRESSION")}}function xa(e){return e.type===se.AST_NODE_TYPES.Identifier?e.name:e.type===se.AST_NODE_TYPES.MemberExpression&&e.property.type===se.AST_NODE_TYPES.Identifier&&!e.computed?e.property.name:null}var Fn=_({name:"no-redundant-function-params",meta:{type:"suggestion",docs:{description:"Disallow calling functions with redundant default parameters"},messages:{redundantParams:"Function call has redundant parameters matching its default values and can be removed: {{details}}"},fixable:"code",schema:[$(Ea)]},defaultOptions:[{functions:[]}],create(e,[t]){let r=new Map;for(let n of t.functions)r.set(n.name,n.defaults);return{CallExpression(n){let s=xa(n.callee);if(!s)return;let o=r.get(s);if(!o)return;let i=n.arguments;if(i.length===0)return;let p=-1,a=!1,c=new Map,g=new Set,S=new Map,l=[];for(let f=0;f<i.length;f++){if(f>=o.length){p=f;continue}let h=o[f],T=i[f];if(!T||T.type===se.AST_NODE_TYPES.SpreadElement){p=f;continue}let m=ei(T);if(h===void 0){p=f;continue}if(Ct(m,h)){T.type===se.AST_NODE_TYPES.ObjectExpression?(g.add(f),l.push({type:"object",position:f+1})):(S.set(f,m),l.push({type:"simple",position:f+1,value:m}));continue}if(T.type===se.AST_NODE_TYPES.ObjectExpression&&T.properties.length===0&&typeof h=="object"&&h!==null&&Object.keys(h).length>0){g.add(f),l.push({type:"object",position:f+1});continue}let b=ba(m,h);if(b.size>0){let C=typeof h=="object"&&h!==null?Object.keys(h).length:0;if(T.type===se.AST_NODE_TYPES.ObjectExpression&&T.properties.length===b.size&&T.properties.length===C){g.add(f),l.push({type:"object",position:f+1});continue}else a=!0,c.set(f,b),l.push({type:"partialObject",position:f+1,redundantProperties:Array.from(b)}),p=f}else p=f}if(p<i.length-1||a||g.size>0){let f=function(){let T=[];for(let m of l)if(m.type==="simple")T.push(`Param ${m.position} with value ${JSON.stringify(m.value)}`);else if(m.type==="object")T.push(`Param ${m.position} (object)`);else{let b=m.redundantProperties||[],C=o?o[m.position-1]:void 0;if(typeof C=="object"&&C!==null){let y=C;for(let x of b)if(x in y){let u=Object.getOwnPropertyDescriptor(y,x);u&&T.push(`Param ${m.position} property "${x}" with value ${JSON.stringify(u.value)}`)}}}return{messageId:"redundantParams",data:{details:T.join(", ")}}};var E=f;let h=f();e.report({node:n,messageId:h.messageId,data:h.data,fix(T){let m=[];if(a)for(let[C,y]of c){let x=i[C];if(x&&x.type===se.AST_NODE_TYPES.ObjectExpression){let u=[];for(let A of x.properties)A.type===se.AST_NODE_TYPES.Property&&A.key.type===se.AST_NODE_TYPES.Identifier&&!A.computed&&y.has(A.key.name)||u.push(A);let d=u.map(A=>e.sourceCode.getText(A));m.push(T.replaceText(x,`{ ${d.join(", ")} }`))}}let b=-1;for(let C=i.length-1;C>=0;C--)if(!g.has(C)&&C<=p){b=C;break}if(b<i.length-1)if(b===-1){let C=e.sourceCode.getTokenAfter(n.callee),y=e.sourceCode.getLastToken(n);C&&y&&m.push(T.replaceTextRange([C.range[1],y.range[0]],""))}else{let C=i[b],y=e.sourceCode.getLastToken(n);y&&C&&m.push(T.replaceTextRange([C.range[1],y.range[0]],""))}return m.length>0?m:null}})}}}}});var Se=require("@typescript-eslint/utils");function Ca(e){let t=e.parent;for(;t;){if(t.type===Se.AST_NODE_TYPES.AwaitExpression||t.type===Se.AST_NODE_TYPES.MemberExpression&&t.object===e&&t.property.type===Se.AST_NODE_TYPES.Identifier&&t.property.name==="then"||t.type===Se.AST_NODE_TYPES.ArrowFunctionExpression&&t.body===e)return!0;if(t.type===Se.AST_NODE_TYPES.ArrayExpression&&t.parent.type===Se.AST_NODE_TYPES.CallExpression){let r=t.parent;if(r.callee.type===Se.AST_NODE_TYPES.MemberExpression&&r.callee.object.type===Se.AST_NODE_TYPES.Identifier&&r.callee.object.name==="Promise"&&r.callee.property.type===Se.AST_NODE_TYPES.Identifier&&["all","allSettled","race"].includes(r.callee.property.name))return!0}if(t.parent)t=t.parent;else break}return!1}function Aa(e){let{callee:t}=e;return t.type===Se.AST_NODE_TYPES.Identifier&&t.name==="require"||t.type===Se.AST_NODE_TYPES.MemberExpression&&t.object.type===Se.AST_NODE_TYPES.Identifier&&t.object.name==="require"}var On=_({name:"no-sync-dynamic-import",meta:{type:"problem",docs:{description:"Disallow synchronous dynamic imports and require statements, only allow async dynamic imports with await"},messages:{syncDynamicImport:"Synchronous dynamic import() is not allowed. Use regular import statement or await import() for dynamic imports.",requireNotAllowed:"require() statements are not allowed. Use ES6 import statements instead."},schema:[]},defaultOptions:[],create(e){return{ImportExpression(t){Ca(t)||e.report({node:t,messageId:"syncDynamicImport"})},TSImportType(t){e.report({node:t,messageId:"syncDynamicImport"})},CallExpression(t){Aa(t)&&e.report({node:t,messageId:"requireNotAllowed"})}}}});var j=require("@typescript-eslint/utils"),Nn=require("zod/v4");var Ia=Nn.z.object({mainComponentRegex:Nn.z.string().optional()}),wa=/^[A-Z][A-Za-z0-9]*$/,Dn=_({name:"sort-react-components-and-styles",meta:{type:"suggestion",docs:{description:"Sort React components and styles with styles placed above their first usage"},fixable:"code",schema:[$(Ia)],messages:{stylesShouldBeAboveUsage:"Style definitions should be placed above the first component that uses them"}},defaultOptions:[{}],create(e,[t]){let r=e.sourceCode,n=t.mainComponentRegex?new RegExp(t.mainComponentRegex):void 0,s=new Set,o=new Map,i=[],p=[];function a(u){return wa.test(u)}function c(u){if(u.type!==j.AST_NODE_TYPES.CallExpression)return!1;let d=u.callee;return d.type===j.AST_NODE_TYPES.Identifier?d.name==="memo"||d.name==="forwardRef":d.type===j.AST_NODE_TYPES.MemberExpression&&d.property.type===j.AST_NODE_TYPES.Identifier?d.property.name==="memo"||d.property.name==="forwardRef":!1}function g(u){if(u.type===j.AST_NODE_TYPES.JSXElement||u.type===j.AST_NODE_TYPES.JSXFragment)return!0;if(u.type===j.AST_NODE_TYPES.BlockStatement){for(let d of u.body)if(d.type===j.AST_NODE_TYPES.ReturnStatement&&d.argument)return g(d.argument)}if(u.type===j.AST_NODE_TYPES.ArrayExpression){for(let d of u.elements)if(d&&(d.type===j.AST_NODE_TYPES.JSXElement||d.type===j.AST_NODE_TYPES.JSXFragment))return!0}return!1}function S(u){if(u.type!==j.AST_NODE_TYPES.ArrowFunctionExpression)return!1;let d=u.body;if(d.type===j.AST_NODE_TYPES.ArrowFunctionExpression){let A=d.body;if(g(A))return!0}return!1}function l(u){if(u.type===j.AST_NODE_TYPES.TaggedTemplateExpression){let d=u.tag;if(d.type===j.AST_NODE_TYPES.MemberExpression&&d.object.type===j.AST_NODE_TYPES.Identifier&&d.object.name==="styled")return!0;if(d.type===j.AST_NODE_TYPES.CallExpression){let A=d.callee;if(A.type===j.AST_NODE_TYPES.Identifier&&A.name==="styled")return!0}}return!1}function E(u){if(u.type===j.AST_NODE_TYPES.TaggedTemplateExpression){let d=u.tag;if(d.type===j.AST_NODE_TYPES.Identifier&&d.name==="css")return!0}return!1}function f(u,d){if(u.id.type!==j.AST_NODE_TYPES.Identifier)return;let A=u.id.name,I=u.init;if(I){if(l(I)||E(I)){p.push({node:d,name:A});return}if((a(A)||I.type===j.AST_NODE_TYPES.ArrowFunctionExpression)&&(I.type===j.AST_NODE_TYPES.ArrowFunctionExpression||I.type===j.AST_NODE_TYPES.FunctionExpression||c(I))){if(I.type===j.AST_NODE_TYPES.ArrowFunctionExpression||I.type===j.AST_NODE_TYPES.FunctionExpression){if(g(I.body)){s.add(A);return}}else if(c(I)){s.add(A);return}}I.type===j.AST_NODE_TYPES.Identifier&&o.set(A,I.name),a(A)||S(I)&&s.add(A)}}function h(u){return u.type===j.AST_NODE_TYPES.ExportDefaultDeclaration||u.type===j.AST_NODE_TYPES.ExportNamedDeclaration}function T(u){if(u.type===j.AST_NODE_TYPES.FunctionDeclaration)return u.id?u.id.name:null;if(u.type===j.AST_NODE_TYPES.VariableDeclaration){let d=u.declarations[0];if(d&&d.id.type===j.AST_NODE_TYPES.Identifier)return d.id.name}if(u.type===j.AST_NODE_TYPES.ExportDefaultDeclaration){let d=u.declaration;if(d.type===j.AST_NODE_TYPES.FunctionDeclaration)return d.id?d.id.name:"default";if(d.type===j.AST_NODE_TYPES.Identifier)return d.name}if(u.type===j.AST_NODE_TYPES.ExportNamedDeclaration){let d=u.declaration;if(d&&d.type===j.AST_NODE_TYPES.FunctionDeclaration)return d.id?d.id.name:null;if(d&&d.type===j.AST_NODE_TYPES.VariableDeclaration){let A=d.declarations[0];if(A&&A.id.type===j.AST_NODE_TYPES.Identifier)return A.id.name}}return null}function m(u,d){return n?n.test(d):h(u)}function b(u){let d=new Set;we(u.node,A=>{if(A.type===j.AST_NODE_TYPES.Identifier)for(let I of p)I.name===A.name&&(d.add(I.name),(I.firstUsagePosition===void 0||A.range[0]<I.firstUsagePosition)&&(I.firstUsagePosition=A.range[0]));if(A.type===j.AST_NODE_TYPES.JSXElement){let I=A.openingElement;if(I.name.type===j.AST_NODE_TYPES.JSXIdentifier)for(let P of p)P.name===I.name.name&&(d.add(P.name),(P.firstUsagePosition===void 0||I.name.range[0]<P.firstUsagePosition)&&(P.firstUsagePosition=I.name.range[0]))}return!1},r),u.usedStyles=d}function C(u){if(u.type===j.AST_NODE_TYPES.VariableDeclaration){for(let d of u.declarations)f(d,u);return}if(u.type===j.AST_NODE_TYPES.FunctionDeclaration){u.id&&a(u.id.name)&&g(u.body)&&s.add(u.id.name);return}if(u.type===j.AST_NODE_TYPES.ExportNamedDeclaration&&u.declaration){let d=u.declaration;if(d.type===j.AST_NODE_TYPES.VariableDeclaration){for(let A of d.declarations)f(A,u);return}if(d.type===j.AST_NODE_TYPES.FunctionDeclaration&&d.id){a(d.id.name)&&g(d.body)&&s.add(d.id.name);return}}if(u.type===j.AST_NODE_TYPES.ExportDefaultDeclaration){let d=u.declaration;d.type===j.AST_NODE_TYPES.Identifier&&s.add(d.name),(d.type===j.AST_NODE_TYPES.FunctionDeclaration||d.type===j.AST_NODE_TYPES.ArrowFunctionExpression||d.type===j.AST_NODE_TYPES.FunctionExpression)&&(d.type===j.AST_NODE_TYPES.FunctionDeclaration?d.id?s.add(d.id.name):s.add("default"):g(d.body)&&s.add("default"))}}function y(u,d=new Set){if(s.has(u))return!0;if(d.has(u))return!1;d.add(u);let A=o.get(u);return A?y(A,d):!1}return{Program(u){for(let A of u.body)C(A);for(let A of u.body){let I=T(A);if(I&&y(I)){let P=m(A,I);i.push({node:A,name:I,isMainComponent:P,usedStyles:new Set})}}for(let A of i)b(A);let d=[];for(let A of p){if(A.firstUsagePosition===void 0)continue;let I=u.body.indexOf(A.node),P=-1;for(let k of i)if(k.usedStyles.has(A.name)){let H=u.body.indexOf(k.node);(P===-1||H<P)&&(P=H)}P!==-1&&I>P&&d.push({style:A,targetPosition:P})}if(d.length>0){let A=d[0];A&&e.report({node:A.style.node,messageId:"stylesShouldBeAboveUsage",fix:x(d,u.body)})}}};function x(u,d){return function*(A){u.sort((P,k)=>P.targetPosition-k.targetPosition);for(let{style:P}of u){let k=r.getCommentsBefore(P.node),H=P.node.range[0],K=P.node.range[1];k.length>0&&k[0]&&(H=k[0].range[0]),yield A.removeRange([H,K])}let I=new Map;for(let P of u){let k=I.get(P.targetPosition)||[];k.push(P),I.set(P.targetPosition,k)}for(let[P,k]of I){let H=d[P];if(!H)continue;let K=r.getCommentsBefore(H),ne=K.length>0&&K[0]?K[0].range[0]:H.range[0],oe=[];for(let{style:Z}of k){let de=r.getCommentsBefore(Z.node),Ae=r.getText(Z.node);de.length>0&&(Ae=`${de.map(Ie=>r.getText(Ie)).join(`
46
+ `)}}}return{Program(f){s.push(...f.body)},TSTypeAliasDeclaration(f){if(s.some(T=>T.type===pe.AST_NODE_TYPES.ExportNamedDeclaration&&T.declaration===f?!0:T===f)){let T=o(f);T&&n.set(f.id.name,{node:f,name:f.id.name,statement:T})}},TSInterfaceDeclaration(f){if(s.some(T=>T.type===pe.AST_NODE_TYPES.ExportNamedDeclaration&&T.declaration===f?!0:T===f)){let T=o(f);T&&n.set(f.id.name,{node:f,name:f.id.name,statement:T})}},TSTypeReference(f){if(f.typeName.type===pe.AST_NODE_TYPES.Identifier){if(g(f))return;let h=i(f),T=p(f),m=a(f);S.push({typeName:f.typeName.name,node:f,inFunctionArgs:h,inFCProps:T,inGenericArgAtFunctionCall:m,usagePosition:f.range[0]})}},"Program:exit"(){let f=new Map;function h(m){if(!t.checkOnly||t.checkOnly.length===0)return!0;for(let b of t.checkOnly)if(b==="function-args"&&m.inFunctionArgs||b==="FC"&&m.inFCProps||b==="generic-args-at-fn-calls"&&m.inGenericArgAtFunctionCall)return!0;return!1}for(let m of S){let{typeName:b,node:C}=m;if(!n.has(b)||!h(m))continue;let y=o(C),x=n.get(b);if(!y||!x||y===x.statement)continue;f.has(b)||f.set(b,[]);let u=f.get(b);if(!u)return;u.includes(y)||u.push(y)}let T=[];for(let[m,b]of f)if(b.length>0){if(b.length===0)continue;let C=b[0];if(!C)continue;let y=Number.MAX_SAFE_INTEGER,x=!1;for(let d of b)d.range[0]<C.range[0]&&(C=d);for(let d of S)h(d)&&d.typeName===m&&o(d.node)===C&&d.usagePosition<y&&(y=d.usagePosition,x=d.inFunctionArgs);if(!!(t.checkOnly&&t.checkOnly.length>0)){let d=Number.MAX_SAFE_INTEGER;for(let I of S){if(I.typeName!==m)continue;let R=o(I.node);if(!R)continue;let F=s.indexOf(R);F!==-1&&F<d&&(d=F)}let A=s.indexOf(C);if(d!==Number.MAX_SAFE_INTEGER&&A!==-1&&d<A)continue}else{let d=Number.MAX_SAFE_INTEGER;for(let I of S){if(I.typeName!==m||c(I.node))continue;let R=o(I.node);if(!R)continue;let F=s.indexOf(R);F!==-1&&F<d&&(d=F)}let A=s.indexOf(C);if(d!==Number.MAX_SAFE_INTEGER&&A!==-1&&d<A)continue}T.push({typeName:m,firstUsage:C,firstUsagePosition:y,firstUsageInFunctionArgs:x})}T.length>0&&l(T)}}}});var Y=require("@typescript-eslint/utils"),Ge=xe(require("zod/v4"));var ma=["tsx"],ya=/^[A-Z][A-Za-z0-9]*$/,da=Ge.object({extensions:Ge.array(Ge.string()).optional()}),vn=_({name:"react-single-export",meta:{type:"problem",docs:{description:"Enforces only one export per React component file to support fast refresh"},messages:{multipleExports:"React component files should have only one export to support fast refresh, if you want to export multiple components, use a separate file for each component. Type-only exports are allowed."},schema:[$(da)]},defaultOptions:[{}],create(e,[t]){let r=e.getFilename(),n=t.extensions??ma,s=!1;for(let y of n)if(r.endsWith(y)){s=!0;break}if(!s)return{};let o=e.sourceCode,i=new Set,p=new Map;function a(y){return ya.test(y)}function c(y){if(y.type!==Y.AST_NODE_TYPES.CallExpression)return!1;let x=y.callee;return x.type===Y.AST_NODE_TYPES.Identifier?x.name==="memo"||x.name==="forwardRef":x.type===Y.AST_NODE_TYPES.MemberExpression&&x.property.type===Y.AST_NODE_TYPES.Identifier?x.property.name==="memo"||x.property.name==="forwardRef":!1}function g(y){if(y.type===Y.AST_NODE_TYPES.JSXElement||y.type===Y.AST_NODE_TYPES.JSXFragment)return!0;if(y.type===Y.AST_NODE_TYPES.ArrayExpression){for(let x of y.elements)if(x&&(x.type===Y.AST_NODE_TYPES.JSXElement||x.type===Y.AST_NODE_TYPES.JSXFragment))return!0}return!1}function S(y){if(y.type!==Y.AST_NODE_TYPES.ArrowFunctionExpression)return!1;let x=y.body;if(x.type===Y.AST_NODE_TYPES.ArrowFunctionExpression){let u=x.body;if(g(u))return!0}return!1}function l(y){if(y.id.type!==Y.AST_NODE_TYPES.Identifier)return;let x=y.id.name,u=y.init;if(u){if(a(x)&&(u.type===Y.AST_NODE_TYPES.ArrowFunctionExpression||u.type===Y.AST_NODE_TYPES.FunctionExpression||c(u))){i.add(x);return}u.type===Y.AST_NODE_TYPES.Identifier&&p.set(x,u.name),a(x)||S(u)&&i.add(x)}}function E(y){if(y.type===Y.AST_NODE_TYPES.VariableDeclaration){for(let x of y.declarations)l(x);return}if(y.type===Y.AST_NODE_TYPES.FunctionDeclaration&&y.id){a(y.id.name)&&i.add(y.id.name);return}if(y.type===Y.AST_NODE_TYPES.ExportNamedDeclaration&&y.declaration){let x=y.declaration;if(x.type===Y.AST_NODE_TYPES.VariableDeclaration){for(let u of x.declarations)l(u);return}if(x.type===Y.AST_NODE_TYPES.FunctionDeclaration&&x.id){a(x.id.name)&&i.add(x.id.name);return}}}for(let y of o.ast.body)E(y);function f(y,x=new Set){if(i.has(y))return!0;if(x.has(y))return!1;x.add(y);let u=p.get(y);return u?f(u,x):!1}let h=[];function T(y,x,u){h.push({node:y,isType:x,isComponent:u})}for(let y of o.ast.body){if(y.type===Y.AST_NODE_TYPES.ExportNamedDeclaration){let x=y.exportKind==="type";if(y.declaration){let u=y.declaration;if(u.type===Y.AST_NODE_TYPES.TSTypeAliasDeclaration||u.type===Y.AST_NODE_TYPES.TSInterfaceDeclaration){T(u,!0,!1);continue}if(u.type===Y.AST_NODE_TYPES.VariableDeclaration){for(let d of u.declarations){if(d.id.type!==Y.AST_NODE_TYPES.Identifier)continue;let A=d.id.name,I=f(A);T(d,x,I)}continue}if(u.type===Y.AST_NODE_TYPES.FunctionDeclaration){let d=u.id?.name,A=d?f(d)||a(d):!1;T(u,x,A);continue}T(u,x,!1);continue}if(y.specifiers.length>0)for(let u of y.specifiers){if(u.local.type!==Y.AST_NODE_TYPES.Identifier)continue;let d=u.local.name,A=f(d);T(u,x,A)}continue}if(y.type===Y.AST_NODE_TYPES.ExportDefaultDeclaration){let x=y.declaration;if(x.type===Y.AST_NODE_TYPES.Identifier){let u=f(x.name)||a(x.name);T(y,!1,u);continue}if(x.type===Y.AST_NODE_TYPES.FunctionDeclaration||x.type===Y.AST_NODE_TYPES.ArrowFunctionExpression||x.type===Y.AST_NODE_TYPES.FunctionExpression||x.type===Y.AST_NODE_TYPES.CallExpression){T(y,!1,!0);continue}T(y,!1,!1);continue}}let m=!1;for(let y of h)if(!y.isType&&y.isComponent){m=!0;break}if(!m)return{};let b=[];for(let y of h)y.isType||b.push(y);let C=-1;for(let[y,x]of b.entries())if(x.isComponent){C=y;break}if(C===-1)return{};for(let[y,x]of b.entries())if(y!==C){e.report({node:x.node,messageId:"multipleExports"});break}return{}}});var je=require("@typescript-eslint/utils"),bt=require("zod/v4");function xt(e){return e.charAt(0).toUpperCase()+e.slice(1)}function ga(e){return e.callee.type===je.AST_NODE_TYPES.Identifier?e.callee.name==="useState":e.callee.type===je.AST_NODE_TYPES.MemberExpression&&e.callee.object.type===je.AST_NODE_TYPES.Identifier&&e.callee.property.type===je.AST_NODE_TYPES.Identifier?e.callee.object.name==="React"&&e.callee.property.name==="useState":!1}var Sa=bt.z.object({ignorePrefixes:bt.z.array(bt.z.string()).optional()});function Qr(e,t){for(let r of t)if(e.startsWith(r))return e.slice(r.length);return e}function Ta(e){return`set${xt(e)}`}var Fn=_({name:"use-state-setter-naming",meta:{type:"problem",docs:{description:"Enforce consistent naming convention for useState destructuring where setter should be set{Value}"},messages:{incorrectSetterName:'useState setter should follow the pattern "set{{expectedName}}" with a "set" prefix but got "{{actualName}}"',useSuggestedName:'Use "{{expectedSetterName}}" instead'},hasSuggestions:!0,schema:[$(Sa)]},defaultOptions:[{ignorePrefixes:[]}],create(e,[t]){return{VariableDeclarator(r){if(!r.init||r.init.type!==je.AST_NODE_TYPES.CallExpression||!ga(r.init)||r.id.type!==je.AST_NODE_TYPES.ArrayPattern||r.id.elements.length!==2)return;let[n,s]=r.id.elements;if(!n||!s||n.type!==je.AST_NODE_TYPES.Identifier||s.type!==je.AST_NODE_TYPES.Identifier)return;let o=n.name,i=s.name,p=t.ignorePrefixes||[],a=Qr(o,p),c=Qr(i,p);if(a===""){if(!c.startsWith("set")){let S=`set${xt(o)}`;e.report({node:s,messageId:"incorrectSetterName",data:{expectedName:xt(o),actualName:i},suggest:[{messageId:"useSuggestedName",data:{expectedSetterName:S},fix:l=>l.replaceText(s,S)}]})}return}let g=Ta(a);c!==g&&e.report({node:s,messageId:"incorrectSetterName",data:{expectedName:xt(a),actualName:i},suggest:[{messageId:"useSuggestedName",data:{expectedSetterName:g},fix:S=>S.replaceText(s,g)}]})}}}});var oe=require("@typescript-eslint/utils"),Xe=require("zod/v4");var ha=Xe.z.object({name:Xe.z.string(),defaults:Xe.z.array(Xe.z.unknown())}),Ea=Xe.z.object({functions:Xe.z.array(ha)});function Ct(e,t){if(e===t)return!0;if(e===null||t===null||e===void 0||t===void 0)return e===t;if(typeof e!=typeof t||typeof e!="object"||Array.isArray(e)!==Array.isArray(t))return!1;if(Array.isArray(e)&&Array.isArray(t))return e.length!==t.length?!1:e.every((s,o)=>Ct(s,t[o]));let r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(let s of r){if(!n.includes(s))return!1;let o=Object.getOwnPropertyDescriptor(e,s),i=Object.getOwnPropertyDescriptor(t,s);if(!o||!i)return!1;let p=o.value,a=i.value;if(!Ct(p,a))return!1}return!0}function ba(e,t){let r=new Set;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return r;for(let n in e){if(!(n in t))continue;let s=Object.getOwnPropertyDescriptor(e,n),o=Object.getOwnPropertyDescriptor(t,n);s&&o&&Ct(s.value,o.value)&&r.add(n)}return r}function ei(e){if(e.type===oe.AST_NODE_TYPES.SpreadElement)return Symbol("COMPLEX_EXPRESSION");switch(e.type){case oe.AST_NODE_TYPES.Literal:return e.value;case oe.AST_NODE_TYPES.ObjectExpression:{let t={};for(let r of e.properties)r.type===oe.AST_NODE_TYPES.Property&&r.key.type===oe.AST_NODE_TYPES.Identifier&&!r.computed&&(r.value.type===oe.AST_NODE_TYPES.Literal?t[r.key.name]=r.value.value:r.value.type===oe.AST_NODE_TYPES.ObjectExpression?t[r.key.name]=ei(r.value):t[r.key.name]=Symbol("COMPLEX_EXPRESSION"));return t}case oe.AST_NODE_TYPES.ArrayExpression:return e.elements.map(t=>{if(!(!t||t.type===oe.AST_NODE_TYPES.SpreadElement))return t.type===oe.AST_NODE_TYPES.Literal?t.value:Symbol("COMPLEX_EXPRESSION")});default:return Symbol("COMPLEX_EXPRESSION")}}function xa(e){return e.type===oe.AST_NODE_TYPES.Identifier?e.name:e.type===oe.AST_NODE_TYPES.MemberExpression&&e.property.type===oe.AST_NODE_TYPES.Identifier&&!e.computed?e.property.name:null}var kn=_({name:"no-redundant-function-params",meta:{type:"suggestion",docs:{description:"Disallow calling functions with redundant default parameters"},messages:{redundantParams:"Function call has redundant parameters matching its default values and can be removed: {{details}}"},fixable:"code",schema:[$(Ea)]},defaultOptions:[{functions:[]}],create(e,[t]){let r=new Map;for(let n of t.functions)r.set(n.name,n.defaults);return{CallExpression(n){let s=xa(n.callee);if(!s)return;let o=r.get(s);if(!o)return;let i=n.arguments;if(i.length===0)return;let p=-1,a=!1,c=new Map,g=new Set,S=new Map,l=[];for(let f=0;f<i.length;f++){if(f>=o.length){p=f;continue}let h=o[f],T=i[f];if(!T||T.type===oe.AST_NODE_TYPES.SpreadElement){p=f;continue}let m=ei(T);if(h===void 0){p=f;continue}if(Ct(m,h)){T.type===oe.AST_NODE_TYPES.ObjectExpression?(g.add(f),l.push({type:"object",position:f+1})):(S.set(f,m),l.push({type:"simple",position:f+1,value:m}));continue}if(T.type===oe.AST_NODE_TYPES.ObjectExpression&&T.properties.length===0&&typeof h=="object"&&h!==null&&Object.keys(h).length>0){g.add(f),l.push({type:"object",position:f+1});continue}let b=ba(m,h);if(b.size>0){let C=typeof h=="object"&&h!==null?Object.keys(h).length:0;if(T.type===oe.AST_NODE_TYPES.ObjectExpression&&T.properties.length===b.size&&T.properties.length===C){g.add(f),l.push({type:"object",position:f+1});continue}else a=!0,c.set(f,b),l.push({type:"partialObject",position:f+1,redundantProperties:Array.from(b)}),p=f}else p=f}if(p<i.length-1||a||g.size>0){let f=function(){let T=[];for(let m of l)if(m.type==="simple")T.push(`Param ${m.position} with value ${JSON.stringify(m.value)}`);else if(m.type==="object")T.push(`Param ${m.position} (object)`);else{let b=m.redundantProperties||[],C=o?o[m.position-1]:void 0;if(typeof C=="object"&&C!==null){let y=C;for(let x of b)if(x in y){let u=Object.getOwnPropertyDescriptor(y,x);u&&T.push(`Param ${m.position} property "${x}" with value ${JSON.stringify(u.value)}`)}}}return{messageId:"redundantParams",data:{details:T.join(", ")}}};var E=f;let h=f();e.report({node:n,messageId:h.messageId,data:h.data,fix(T){let m=[];if(a)for(let[C,y]of c){let x=i[C];if(x&&x.type===oe.AST_NODE_TYPES.ObjectExpression){let u=[];for(let A of x.properties)A.type===oe.AST_NODE_TYPES.Property&&A.key.type===oe.AST_NODE_TYPES.Identifier&&!A.computed&&y.has(A.key.name)||u.push(A);let d=u.map(A=>e.sourceCode.getText(A));m.push(T.replaceText(x,`{ ${d.join(", ")} }`))}}let b=-1;for(let C=i.length-1;C>=0;C--)if(!g.has(C)&&C<=p){b=C;break}if(b<i.length-1)if(b===-1){let C=e.sourceCode.getTokenAfter(n.callee),y=e.sourceCode.getLastToken(n);C&&y&&m.push(T.replaceTextRange([C.range[1],y.range[0]],""))}else{let C=i[b],y=e.sourceCode.getLastToken(n);y&&C&&m.push(T.replaceTextRange([C.range[1],y.range[0]],""))}return m.length>0?m:null}})}}}}});var Se=require("@typescript-eslint/utils");function Ca(e){let t=e.parent;for(;t;){if(t.type===Se.AST_NODE_TYPES.AwaitExpression||t.type===Se.AST_NODE_TYPES.MemberExpression&&t.object===e&&t.property.type===Se.AST_NODE_TYPES.Identifier&&t.property.name==="then"||t.type===Se.AST_NODE_TYPES.ArrowFunctionExpression&&t.body===e)return!0;if(t.type===Se.AST_NODE_TYPES.ArrayExpression&&t.parent.type===Se.AST_NODE_TYPES.CallExpression){let r=t.parent;if(r.callee.type===Se.AST_NODE_TYPES.MemberExpression&&r.callee.object.type===Se.AST_NODE_TYPES.Identifier&&r.callee.object.name==="Promise"&&r.callee.property.type===Se.AST_NODE_TYPES.Identifier&&["all","allSettled","race"].includes(r.callee.property.name))return!0}if(t.parent)t=t.parent;else break}return!1}function Aa(e){let{callee:t}=e;return t.type===Se.AST_NODE_TYPES.Identifier&&t.name==="require"||t.type===Se.AST_NODE_TYPES.MemberExpression&&t.object.type===Se.AST_NODE_TYPES.Identifier&&t.object.name==="require"}var On=_({name:"no-sync-dynamic-import",meta:{type:"problem",docs:{description:"Disallow synchronous dynamic imports and require statements, only allow async dynamic imports with await"},messages:{syncDynamicImport:"Synchronous dynamic import() is not allowed. Use regular import statement or await import() for dynamic imports.",requireNotAllowed:"require() statements are not allowed. Use ES6 import statements instead."},schema:[]},defaultOptions:[],create(e){return{ImportExpression(t){Ca(t)||e.report({node:t,messageId:"syncDynamicImport"})},TSImportType(t){e.report({node:t,messageId:"syncDynamicImport"})},CallExpression(t){Aa(t)&&e.report({node:t,messageId:"requireNotAllowed"})}}}});var j=require("@typescript-eslint/utils"),Nn=require("zod/v4");var Ia=Nn.z.object({mainComponentRegex:Nn.z.string().optional()}),wa=/^[A-Z][A-Za-z0-9]*$/,Dn=_({name:"sort-react-components-and-styles",meta:{type:"suggestion",docs:{description:"Sort React components and styles with styles placed above their first usage"},fixable:"code",schema:[$(Ia)],messages:{stylesShouldBeAboveUsage:"Style definitions should be placed above the first component that uses them"}},defaultOptions:[{}],create(e,[t]){let r=e.sourceCode,n=t.mainComponentRegex?new RegExp(t.mainComponentRegex):void 0,s=new Set,o=new Map,i=[],p=[];function a(u){return wa.test(u)}function c(u){if(u.type!==j.AST_NODE_TYPES.CallExpression)return!1;let d=u.callee;return d.type===j.AST_NODE_TYPES.Identifier?d.name==="memo"||d.name==="forwardRef":d.type===j.AST_NODE_TYPES.MemberExpression&&d.property.type===j.AST_NODE_TYPES.Identifier?d.property.name==="memo"||d.property.name==="forwardRef":!1}function g(u){if(u.type===j.AST_NODE_TYPES.JSXElement||u.type===j.AST_NODE_TYPES.JSXFragment)return!0;if(u.type===j.AST_NODE_TYPES.BlockStatement){for(let d of u.body)if(d.type===j.AST_NODE_TYPES.ReturnStatement&&d.argument)return g(d.argument)}if(u.type===j.AST_NODE_TYPES.ArrayExpression){for(let d of u.elements)if(d&&(d.type===j.AST_NODE_TYPES.JSXElement||d.type===j.AST_NODE_TYPES.JSXFragment))return!0}return!1}function S(u){if(u.type!==j.AST_NODE_TYPES.ArrowFunctionExpression)return!1;let d=u.body;if(d.type===j.AST_NODE_TYPES.ArrowFunctionExpression){let A=d.body;if(g(A))return!0}return!1}function l(u){if(u.type===j.AST_NODE_TYPES.TaggedTemplateExpression){let d=u.tag;if(d.type===j.AST_NODE_TYPES.MemberExpression&&d.object.type===j.AST_NODE_TYPES.Identifier&&d.object.name==="styled")return!0;if(d.type===j.AST_NODE_TYPES.CallExpression){let A=d.callee;if(A.type===j.AST_NODE_TYPES.Identifier&&A.name==="styled")return!0}}return!1}function E(u){if(u.type===j.AST_NODE_TYPES.TaggedTemplateExpression){let d=u.tag;if(d.type===j.AST_NODE_TYPES.Identifier&&d.name==="css")return!0}return!1}function f(u,d){if(u.id.type!==j.AST_NODE_TYPES.Identifier)return;let A=u.id.name,I=u.init;if(I){if(l(I)||E(I)){p.push({node:d,name:A});return}if((a(A)||I.type===j.AST_NODE_TYPES.ArrowFunctionExpression)&&(I.type===j.AST_NODE_TYPES.ArrowFunctionExpression||I.type===j.AST_NODE_TYPES.FunctionExpression||c(I))){if(I.type===j.AST_NODE_TYPES.ArrowFunctionExpression||I.type===j.AST_NODE_TYPES.FunctionExpression){if(g(I.body)){s.add(A);return}}else if(c(I)){s.add(A);return}}I.type===j.AST_NODE_TYPES.Identifier&&o.set(A,I.name),a(A)||S(I)&&s.add(A)}}function h(u){return u.type===j.AST_NODE_TYPES.ExportDefaultDeclaration||u.type===j.AST_NODE_TYPES.ExportNamedDeclaration}function T(u){if(u.type===j.AST_NODE_TYPES.FunctionDeclaration)return u.id?u.id.name:null;if(u.type===j.AST_NODE_TYPES.VariableDeclaration){let d=u.declarations[0];if(d&&d.id.type===j.AST_NODE_TYPES.Identifier)return d.id.name}if(u.type===j.AST_NODE_TYPES.ExportDefaultDeclaration){let d=u.declaration;if(d.type===j.AST_NODE_TYPES.FunctionDeclaration)return d.id?d.id.name:"default";if(d.type===j.AST_NODE_TYPES.Identifier)return d.name}if(u.type===j.AST_NODE_TYPES.ExportNamedDeclaration){let d=u.declaration;if(d&&d.type===j.AST_NODE_TYPES.FunctionDeclaration)return d.id?d.id.name:null;if(d&&d.type===j.AST_NODE_TYPES.VariableDeclaration){let A=d.declarations[0];if(A&&A.id.type===j.AST_NODE_TYPES.Identifier)return A.id.name}}return null}function m(u,d){return n?n.test(d):h(u)}function b(u){let d=new Set;we(u.node,A=>{if(A.type===j.AST_NODE_TYPES.Identifier)for(let I of p)I.name===A.name&&(d.add(I.name),(I.firstUsagePosition===void 0||A.range[0]<I.firstUsagePosition)&&(I.firstUsagePosition=A.range[0]));if(A.type===j.AST_NODE_TYPES.JSXElement){let I=A.openingElement;if(I.name.type===j.AST_NODE_TYPES.JSXIdentifier)for(let R of p)R.name===I.name.name&&(d.add(R.name),(R.firstUsagePosition===void 0||I.name.range[0]<R.firstUsagePosition)&&(R.firstUsagePosition=I.name.range[0]))}return!1},r),u.usedStyles=d}function C(u){if(u.type===j.AST_NODE_TYPES.VariableDeclaration){for(let d of u.declarations)f(d,u);return}if(u.type===j.AST_NODE_TYPES.FunctionDeclaration){u.id&&a(u.id.name)&&g(u.body)&&s.add(u.id.name);return}if(u.type===j.AST_NODE_TYPES.ExportNamedDeclaration&&u.declaration){let d=u.declaration;if(d.type===j.AST_NODE_TYPES.VariableDeclaration){for(let A of d.declarations)f(A,u);return}if(d.type===j.AST_NODE_TYPES.FunctionDeclaration&&d.id){a(d.id.name)&&g(d.body)&&s.add(d.id.name);return}}if(u.type===j.AST_NODE_TYPES.ExportDefaultDeclaration){let d=u.declaration;d.type===j.AST_NODE_TYPES.Identifier&&s.add(d.name),(d.type===j.AST_NODE_TYPES.FunctionDeclaration||d.type===j.AST_NODE_TYPES.ArrowFunctionExpression||d.type===j.AST_NODE_TYPES.FunctionExpression)&&(d.type===j.AST_NODE_TYPES.FunctionDeclaration?d.id?s.add(d.id.name):s.add("default"):g(d.body)&&s.add("default"))}}function y(u,d=new Set){if(s.has(u))return!0;if(d.has(u))return!1;d.add(u);let A=o.get(u);return A?y(A,d):!1}return{Program(u){for(let A of u.body)C(A);for(let A of u.body){let I=T(A);if(I&&y(I)){let R=m(A,I);i.push({node:A,name:I,isMainComponent:R,usedStyles:new Set})}}for(let A of i)b(A);let d=[];for(let A of p){if(A.firstUsagePosition===void 0)continue;let I=u.body.indexOf(A.node),R=-1;for(let te of i){if(!te.usedStyles.has(A.name))continue;let V=u.body.indexOf(te.node);(R===-1||V<R)&&(R=V)}if(R===-1)continue;let F=-1;for(let te of i){let V=u.body.indexOf(te.node);V<R&&V>F&&(F=V)}let J=I<R,Z=I>F;J&&Z||d.push({style:A,targetPosition:R})}if(d.length>0){let A=d[0];A&&e.report({node:A.style.node,messageId:"stylesShouldBeAboveUsage",fix:x(d,u.body)})}}};function x(u,d){return function*(A){u.sort((R,F)=>R.targetPosition-F.targetPosition);for(let{style:R}of u){let F=r.getCommentsBefore(R.node),J=R.node.range[0],Z=R.node.range[1];F.length>0&&F[0]&&(J=F[0].range[0]),J===R.node.range[0]&&r.text.slice(0,J).trim().length===0&&(J=0),yield A.removeRange([J,Z])}let I=new Map;for(let R of u){let F=I.get(R.targetPosition)||[];F.push(R),I.set(R.targetPosition,F)}for(let[R,F]of I){let J=d[R];if(!J)continue;let Z=r.getCommentsBefore(J),ne=Z.length>0&&Z[0]?Z[0].range[0]:J.range[0],te=[];for(let{style:V}of F){let de=r.getCommentsBefore(V.node),Ae=r.getText(V.node);de.length>0&&(Ae=`${de.map(Ie=>r.getText(Ie)).join(`
47
47
  `)}
48
- ${Ae}`),oe.push(Ae)}yield A.insertTextBeforeRange([ne,ne],`${oe.join(`
48
+ ${Ae}`),te.push(Ae)}yield A.insertTextBeforeRange([ne,ne],`${te.join(`
49
49
 
50
50
  `)}
51
51
 
52
- `)}}}}});var ti={[sn.name]:sn.rule,[$t.name]:$t.rule,[Mt.name]:Mt.rule,"rules-of-hooks":Gr,"exhaustive-deps":Hn,"require-description":Jr.rule,[_t.name]:_t.rule,[zt.name]:zt.rule,[an.name]:an.rule,[wt.name]:wt.rule,[Lt.name]:Lt.rule,[Jt.name]:Jt.rule,[et.name]:et.rule,[cn.name]:cn.rule,[Wt.name]:Wt.rule,[Ut.name]:Ut.rule,[Xt.name]:Xt.rule,[Pt.name]:Pt.rule,[gn.name]:gn.rule,[dn.name]:dn.rule,[En.name]:En.rule,[jt.name]:jt.rule,[qt.name]:qt.rule,[Zt.name]:Zt.rule,[Gt.name]:Gt.rule,[tn.name]:tn.rule,[nn.name]:nn.rule,[Kt.name]:Kt.rule,[en.name]:en.rule,[pn.name]:pn.rule,[Bt.name]:Bt.rule,[Ht.name]:Ht.rule,[Rn.name]:Rn.rule,[on.name]:on.rule,[bn.name]:bn.rule,[In.name]:In.rule,[Pn.name]:Pn.rule,[vn.name]:vn.rule,[kn.name]:kn.rule,[Fn.name]:Fn.rule,[On.name]:On.rule,[Dn.name]:Dn.rule,[et.name]:et.rule};var Ra={rules:ti};0&&(module.exports={extendedLintPlugin});
52
+ `)}}}}});var ti={[sn.name]:sn.rule,[$t.name]:$t.rule,[Mt.name]:Mt.rule,"rules-of-hooks":Gr,"exhaustive-deps":Hn,"require-description":Jr.rule,[_t.name]:_t.rule,[zt.name]:zt.rule,[an.name]:an.rule,[wt.name]:wt.rule,[Lt.name]:Lt.rule,[Jt.name]:Jt.rule,[et.name]:et.rule,[cn.name]:cn.rule,[Wt.name]:Wt.rule,[Ut.name]:Ut.rule,[Xt.name]:Xt.rule,[Pt.name]:Pt.rule,[gn.name]:gn.rule,[dn.name]:dn.rule,[En.name]:En.rule,[jt.name]:jt.rule,[qt.name]:qt.rule,[Zt.name]:Zt.rule,[Gt.name]:Gt.rule,[tn.name]:tn.rule,[nn.name]:nn.rule,[Kt.name]:Kt.rule,[en.name]:en.rule,[pn.name]:pn.rule,[Bt.name]:Bt.rule,[Ht.name]:Ht.rule,[Rn.name]:Rn.rule,[on.name]:on.rule,[bn.name]:bn.rule,[In.name]:In.rule,[Pn.name]:Pn.rule,[vn.name]:vn.rule,[Fn.name]:Fn.rule,[kn.name]:kn.rule,[On.name]:On.rule,[Dn.name]:Dn.rule,[et.name]:et.rule};var Ra={rules:ti};0&&(module.exports={extendedLintPlugin});