@ls-stack/extended-lint 0.68.4 → 0.69.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,7 +1,7 @@
1
- "use strict";var Zr=Object.create;var it=Object.defineProperty;var Gr=Object.getOwnPropertyDescriptor;var Kr=Object.getOwnPropertyNames;var Qr=Object.getPrototypeOf,ei=Object.prototype.hasOwnProperty;var ti=(e,n)=>{for(var r in n)it(e,r,{get:n[r],enumerable:!0})},Fn=(e,n,r,t)=>{if(n&&typeof n=="object"||typeof n=="function")for(let s of Kr(n))!ei.call(e,s)&&s!==r&&it(e,s,{get:()=>n[s],enumerable:!(t=Gr(n,s))||t.enumerable});return e};var Te=(e,n,r)=>(r=e!=null?Zr(Qr(e)):{},Fn(n||!e||!e.__esModule?it(r,"default",{value:e,enumerable:!0}):r,e)),ni=e=>Fn(it({},"__esModule",{value:!0}),e);var ca={};ti(ca,{extendedLintPlugin:()=>pa});module.exports=ni(ca);var ae=require("@typescript-eslint/utils"),v=require("zod/v4");var kn=require("@typescript-eslint/utils"),Pn=Te(require("zod/v4"));function U(e){let r=kn.ESLintUtils.RuleCreator(t=>`https://github.com/lucasols/extended-lint#${t}`)(e);return{name:e.name,rule:r}}function j(e){return Pn.toJSONSchema(e)}var ri=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()})))})))}),bt=U({name:"advanced-no-restricted-syntax",meta:{type:"suggestion",docs:{description:"Disallow specific syntax patterns"},schema:[j(ri)],messages:{default:"{{message}}"},fixable:"code",hasSuggestions:!0},defaultOptions:[{disallow:[]}],create(e,[n]){let r={},{mustMatchSyntax:t,__dev_simulateFileName:s,disallow:o,disallowFnCalls:i}=n,c=s??e.filename,a=[],p=new Map,m=new Set,g=new Map,l=new Set,u=new Map;function y(S){for(let C of S.specifiers)C.type===ae.AST_NODE_TYPES.ImportSpecifier&&C.imported.type===ae.AST_NODE_TYPES.Identifier&&C.imported.name!==C.local.name&&u.set(C.local.name,C.imported.name)}function T(S){if(S.declaration){if(S.declaration.type===ae.AST_NODE_TYPES.FunctionDeclaration&&S.declaration.id){let C=S.declaration.id.name;for(let w of Array.from(l)){let[I,O]=w.split(":");I===C&&(O==="function"||O==="any")&&l.delete(w)}}else if(S.declaration.type===ae.AST_NODE_TYPES.VariableDeclaration){for(let C of S.declaration.declarations)if(C.id.type===ae.AST_NODE_TYPES.Identifier){let w=C.id.name;for(let I of Array.from(l)){let[O,$]=I.split(":");O===w&&($==="variable"||$==="any")&&l.delete(I)}}}}for(let C of S.specifiers)if(C.exported.type===ae.AST_NODE_TYPES.Identifier){let w=C.exported.name;for(let I of Array.from(l)){let[O,$]=I.split(":");O===w&&$==="any"&&l.delete(I)}}}function h(S){S.id.type===ae.AST_NODE_TYPES.Identifier&&S.init?.type===ae.AST_NODE_TYPES.Identifier&&u.set(S.id.name,S.init.name)}function f(S){return u.get(S)??S}function E(S,C){return f(S)===C||S===C}for(let{includeRegex:S,mustCallFn:C,mustMatchSelector:w,mustHaveExport:I}of t??[]){let $=function(ne){let Q=ne;for(let{name:se,value:oe}of O??[])Q=Q.replaceAll(se,oe);return Q};var b=$;let O=ii(c,new RegExp(S));if(O){for(let{anyCall:ne,message:Q}of C??[]){let se=`Expected file to call the function: ${ne.map(({fn:oe})=>oe).join(" or ")}`;m.add(se),a.push(oe=>{let{callee:Z}=oe;if(Z.type===ae.AST_NODE_TYPES.Identifier){for(let{fn:Ee,withArgs:We}of ne)if(Z.name===Ee){m.delete(se);for(let pe of We){let ke=oe.arguments[pe.atIndex],ye=typeof pe.literal=="string"?$(pe.literal):pe.literal;if(!ke){e.report({node:oe,messageId:"default",data:{message:`Missing argument with value "${ye}" at index ${pe.atIndex}${Q?`: ${$(Q)}`:""}`}});continue}if(ke.type!==ae.AST_NODE_TYPES.Literal){e.report({node:ke,messageId:"default",data:{message:`Argument at position ${pe.atIndex} should the literal "${ye}"${Q?`: ${$(Q)}`:""}`}});continue}ke.value!==ye&&e.report({node:ke,messageId:"default",data:{message:`Argument should have the value "${ye}"${Q?`: ${$(Q)}`:""}`},fix:Me=>Me.replaceText(ke,typeof ye=="string"?`'${ye}'`:String(ye))})}break}}})}for(let{selector:ne,message:Q}of w??[])g.set(ne,$(Q)),p.set($(ne),()=>{g.delete(ne)});for(let{name:ne,type:Q,message:se}of I??[]){let oe=$(ne),Z=$(se);l.add(`${oe}:${Q}:${Z}`)}}}for(let{fn:S,withArgs:C,message:w,replaceWith:I,ignoreRegex:O}of i??[])O&&new RegExp(O).test(c)||a.push($=>{let{callee:ne}=$;if(ne.type!==ae.AST_NODE_TYPES.Identifier||!E(ne.name,S))return;if(C)for(let se of C){let oe=$.arguments[se.atIndex];if(!oe){e.report({node:$,messageId:"default",data:{message:`Missing argument with value "${se.value}" at index ${se.atIndex}: ${w}`}});return}if(oe.type!==ae.AST_NODE_TYPES.Literal||oe.value!==se.value)return}let Q=se=>I?se.replaceText($,I):null;e.report({node:$,messageId:"default",data:{message:w},suggest:I?[{messageId:"default",data:{message:`Replace with "${I}"`},fix:Q}]:void 0})});function x(S,C){let w=r[S];w?r[S]=I=>{w(I),C(I)}:r[S]=C}for(let{selector:S,message:C,replace:w,replaceType:I="suggestion"}of o??[]){if(S==="CallExpression"){a.push(O=>{d(w,O,C,I)});continue}r[S]=O=>{d(w,O,C,I)}}if(p.size>0)for(let[S,C]of p)x(S,C);return a.length>0&&(r.CallExpression=S=>{if(S.type===ae.AST_NODE_TYPES.CallExpression)for(let C of a)C(S)}),r.ImportDeclaration=S=>{S.type===ae.AST_NODE_TYPES.ImportDeclaration&&y(S)},r.ExportNamedDeclaration=S=>{S.type===ae.AST_NODE_TYPES.ExportNamedDeclaration&&T(S)},r.VariableDeclarator=S=>{S.type===ae.AST_NODE_TYPES.VariableDeclarator&&h(S)},r["Program:exit"]=S=>{for(let C of m)e.report({node:S,messageId:"default",data:{message:C}});for(let[,C]of g)e.report({node:S,messageId:"default",data:{message:C}});for(let C of l){let[w,I,O]=C.split(":");e.report({node:S,messageId:"default",data:{message:`Missing required export "${w}" of type ${I}: ${O}`}})}},r;function d(S,C,w,I){let O=$=>{if(!S)return null;if(typeof S=="string")return $.replaceText(C,S);{let ne=new RegExp(S.regex),Q=e.sourceCode.getText(C);return $.replaceText(C,Q.replace(ne,S.with))}};e.report({node:C,messageId:"default",data:{message:w},fix:S&&I==="autofix"?O:void 0,suggest:S&&I==="suggestion"?[{messageId:"default",data:{message:`Replace with "${typeof S=="string"?S:S.with}"`},fix:O}]:void 0})}}});function ii(e,n){let r=[],t=n.exec(e);if(!t)return null;let[s,...o]=t;r.push({name:"$0_lowercase",value:s.toLowerCase()}),r.push({name:"$0_capitalize",value:On(s)}),r.push({name:"$0_uncapitalize",value:Nn(s)}),r.push({name:"$0",value:s});for(let i=0;i<o.length;i++){let c=`$${i+1}`,a=o[i];a!==void 0&&(r.push({name:`${c}_lowercase`,value:a.toLowerCase()}),r.push({name:`${c}_capitalize`,value:On(a)}),r.push({name:`${c}_uncapitalize`,value:Nn(a)}),r.push({name:c,value:a}))}return r}function On(e){return e.charAt(0).toUpperCase()+e.slice(1)}function Nn(e){return e.charAt(0).toLowerCase()+e.slice(1)}var V=require("@typescript-eslint/utils"),Oe=require("zod/v4");var si=V.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),Ln="collapse-simple-objs-in-one-line",oi=Oe.z.object({maxLineLength:Oe.z.number().optional(),maxProperties:Oe.z.number().optional(),nestedObjMaxLineLength:Oe.z.number().optional(),nestedObjMaxProperties:Oe.z.number().optional(),ignoreTypesWithSuffix:Oe.z.array(Oe.z.string()).optional()}),ai=si({name:Ln,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:[j(oi)]},defaultOptions:[{}],create(e,[n]){let r=e.sourceCode,t=n.ignoreTypesWithSuffix??[],s=n.maxProperties??2,o=n.nestedObjMaxLineLength??n.maxLineLength,i=n.nestedObjMaxProperties??3;function c(p){if(p.type===V.AST_NODE_TYPES.ObjectExpression){let m=p.parent.type===V.AST_NODE_TYPES.Property,g=m?i:s,l=p.properties.length;if(l>g)return!1;if(l===1){let y=p.properties[0];return!y||y.type===V.AST_NODE_TYPES.Property&&y.value.type===V.AST_NODE_TYPES.ObjectExpression||y.type===V.AST_NODE_TYPES.Property&&y.value.type===V.AST_NODE_TYPES.ArrayExpression&&!y.value.elements.every(h=>h&&xt(h))?!1:{text:r.getText(y),isNested:m,propsSize:l}}let u=[];for(let y of p.properties){if(y.type===V.AST_NODE_TYPES.Property&&!xt(y.value))return!1;u.push(r.getText(y))}return{text:u.join(", "),isNested:m,propsSize:l}}else{let m=p.parent.parent?.type===V.AST_NODE_TYPES.TSPropertySignature,g=m?i:s,l=p.members.length;if(l>g)return!1;if(t.length>0&&p.parent.type===V.AST_NODE_TYPES.TSTypeAliasDeclaration){let y=p.parent.id.name;if(t.some(T=>y.endsWith(T)))return!1}if(l===1){let y=p.members[0];return!y||y.type===V.AST_NODE_TYPES.TSPropertySignature&&y.typeAnnotation?.typeAnnotation.type===V.AST_NODE_TYPES.TSTypeLiteral?!1:{text:r.getText(y),isNested:m,propsSize:1}}if(p.parent.type===V.AST_NODE_TYPES.TSIntersectionType||p.parent.type===V.AST_NODE_TYPES.TSUnionType&&p.parent.types[0]!==p)return!1;let u=[];for(let y of p.members){if(y.type!==V.AST_NODE_TYPES.TSPropertySignature)return!1;let T=y.typeAnnotation?.typeAnnotation;if(!T||T.type===V.AST_NODE_TYPES.TSTypeLiteral||!Dn(T))return!1;if(T.type===V.AST_NODE_TYPES.TSTypeReference&&T.typeArguments){if(T.typeArguments.params.length>1)return!1;let f=T.typeArguments.params[0];if(!f||!Dn(f))return!1}let h=r.getText(y).trim();(h.endsWith(";")||h.endsWith(","))&&(h=h.slice(0,-1)),u.push(h)}return{text:u.join("; "),isNested:m,propsSize:l}}}function a(p){if(p.loc.start.line===p.loc.end.line)return;if(p.parent.type!==V.AST_NODE_TYPES.JSXExpressionContainer){let T=0,h=!1,f=r.getTokenAfter(p,{filter:x=>x.type!==V.AST_TOKEN_TYPES.Punctuator||h?!0:x.value===","?(T++,!1):x.value===";"?(T++,h=!0,!1):x.value===")"||x.value==="}"?(T++,!1):!0});if(T>4)return;let E=f?.type===V.AST_TOKEN_TYPES.Template&&f.value.startsWith(`}
2
- `);if(f?.loc.start.line===p.loc.end.line&&!E)return}let m=c(p);if(!m)return;let g=m.text;if(g.includes(`
3
- `)||r.getCommentsInside(p).length>0)return;g.endsWith(";")&&(g=g.slice(0,-1));let l=`{ ${g} }`,u=pi(r,p),y=m.isNested&&m.propsSize>2?o:n.maxLineLength;y&&l.length+u.length+li(p,r)>y||e.report({node:p,messageId:"singleLineProp",fix:T=>T.replaceText(p,l)})}return{TSTypeLiteral:a,ObjectExpression:a}}});function Dn(e){return e.type===V.AST_NODE_TYPES.TSLiteralType||e.type===V.AST_NODE_TYPES.TSTypeReference||e.type===V.AST_NODE_TYPES.TSNumberKeyword||e.type===V.AST_NODE_TYPES.TSStringKeyword||e.type===V.AST_NODE_TYPES.TSBooleanKeyword||e.type===V.AST_NODE_TYPES.TSNullKeyword||e.type===V.AST_NODE_TYPES.TSUndefinedKeyword}function xt(e,n){return!!(e.type===V.AST_NODE_TYPES.Literal||e.type===V.AST_NODE_TYPES.Identifier||e.type===V.AST_NODE_TYPES.TemplateLiteral||e.type===V.AST_NODE_TYPES.TaggedTemplateExpression||!n&&e.type===V.AST_NODE_TYPES.ArrayExpression&&e.elements.every(r=>r&&xt(r,!0)))}function li(e,n){let r=n.getLastToken(e);if(!r)return 0;let t=n.text.indexOf(`
4
- `,r.range[1]);return(t!==-1?t:n.text.length)-r.range[1]}function pi(e,n){return e.text.slice(n.range[0]-n.loc.start.column,n.range[0])}var Ct={name:Ln,rule:ai};var ci=/eslint +react-compiler\/react-compiler: +\["error/,Mn={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 n=!1,r=typeof e.getSource=="function"?f=>r(f):f=>e.sourceCode.getText(f),t=typeof e.getScope=="function"?()=>t():f=>e.sourceCode.getScope(f),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 c(f){o&&Array.isArray(f.suggest)&&f.suggest.length>0&&(f.fix=f.suggest[0].fix),e.report(f)}let a=e.getSourceCode().scopeManager,p=new WeakMap,m=new WeakSet,g=new WeakMap,l=new WeakMap,u=new WeakSet;function y(f,E){return function(x){if(E.has(x))return E.get(x);let d=f(x);return E.set(x,d),d}}function T(f,E,x,d,b){b&&f.async&&c({node:f,message:`Effect callbacks are synchronous to prevent race conditions. Put the async function inside:
1
+ "use strict";var ti=Object.create;var ot=Object.defineProperty;var ni=Object.getOwnPropertyDescriptor;var ri=Object.getOwnPropertyNames;var ii=Object.getPrototypeOf,si=Object.prototype.hasOwnProperty;var oi=(e,t)=>{for(var r in t)ot(e,r,{get:t[r],enumerable:!0})},Nn=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of ri(t))!si.call(e,s)&&s!==r&&ot(e,s,{get:()=>t[s],enumerable:!(n=ni(t,s))||n.enumerable});return e};var he=(e,t,r)=>(r=e!=null?ti(ii(e)):{},Nn(t||!e||!e.__esModule?ot(r,"default",{value:e,enumerable:!0}):r,e)),ai=e=>Nn(ot({},"__esModule",{value:!0}),e);var Ta={};oi(Ta,{extendedLintPlugin:()=>Sa});module.exports=ai(Ta);var ae=require("@typescript-eslint/utils"),v=require("zod/v4");var Dn=require("@typescript-eslint/utils"),Ln=he(require("zod/v4"));function M(e){let r=Dn.ESLintUtils.RuleCreator(n=>`https://github.com/lucasols/extended-lint#${n}`)(e);return{name:e.name,rule:r}}function j(e){return Ln.toJSONSchema(e)}var li=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()})))})))}),Ct=M({name:"advanced-no-restricted-syntax",meta:{type:"suggestion",docs:{description:"Disallow specific syntax patterns"},schema:[j(li)],messages:{default:"{{message}}"},fixable:"code",hasSuggestions:!0},defaultOptions:[{disallow:[]}],create(e,[t]){let r={},{mustMatchSyntax:n,__dev_simulateFileName:s,disallow:o,disallowFnCalls:i}=t,c=s??e.filename,a=[],p=new Map,f=new Set,g=new Map,l=new Set,u=new Map;function y(S){for(let C of S.specifiers)C.type===ae.AST_NODE_TYPES.ImportSpecifier&&C.imported.type===ae.AST_NODE_TYPES.Identifier&&C.imported.name!==C.local.name&&u.set(C.local.name,C.imported.name)}function T(S){if(S.declaration){if(S.declaration.type===ae.AST_NODE_TYPES.FunctionDeclaration&&S.declaration.id){let C=S.declaration.id.name;for(let w of Array.from(l)){let[I,O]=w.split(":");I===C&&(O==="function"||O==="any")&&l.delete(w)}}else if(S.declaration.type===ae.AST_NODE_TYPES.VariableDeclaration){for(let C of S.declaration.declarations)if(C.id.type===ae.AST_NODE_TYPES.Identifier){let w=C.id.name;for(let I of Array.from(l)){let[O,$]=I.split(":");O===w&&($==="variable"||$==="any")&&l.delete(I)}}}}for(let C of S.specifiers)if(C.exported.type===ae.AST_NODE_TYPES.Identifier){let w=C.exported.name;for(let I of Array.from(l)){let[O,$]=I.split(":");O===w&&$==="any"&&l.delete(I)}}}function h(S){S.id.type===ae.AST_NODE_TYPES.Identifier&&S.init?.type===ae.AST_NODE_TYPES.Identifier&&u.set(S.id.name,S.init.name)}function m(S){return u.get(S)??S}function E(S,C){return m(S)===C||S===C}for(let{includeRegex:S,mustCallFn:C,mustMatchSelector:w,mustHaveExport:I}of n??[]){let $=function(ne){let Q=ne;for(let{name:se,value:oe}of O??[])Q=Q.replaceAll(se,oe);return Q};var b=$;let O=pi(c,new RegExp(S));if(O){for(let{anyCall:ne,message:Q}of C??[]){let se=`Expected file to call the function: ${ne.map(({fn:oe})=>oe).join(" or ")}`;f.add(se),a.push(oe=>{let{callee:Z}=oe;if(Z.type===ae.AST_NODE_TYPES.Identifier){for(let{fn:be,withArgs:Je}of ne)if(Z.name===be){f.delete(se);for(let pe of Je){let Pe=oe.arguments[pe.atIndex],de=typeof pe.literal=="string"?$(pe.literal):pe.literal;if(!Pe){e.report({node:oe,messageId:"default",data:{message:`Missing argument with value "${de}" at index ${pe.atIndex}${Q?`: ${$(Q)}`:""}`}});continue}if(Pe.type!==ae.AST_NODE_TYPES.Literal){e.report({node:Pe,messageId:"default",data:{message:`Argument at position ${pe.atIndex} should the literal "${de}"${Q?`: ${$(Q)}`:""}`}});continue}Pe.value!==de&&e.report({node:Pe,messageId:"default",data:{message:`Argument should have the value "${de}"${Q?`: ${$(Q)}`:""}`},fix:_e=>_e.replaceText(Pe,typeof de=="string"?`'${de}'`:String(de))})}break}}})}for(let{selector:ne,message:Q}of w??[])g.set(ne,$(Q)),p.set($(ne),()=>{g.delete(ne)});for(let{name:ne,type:Q,message:se}of I??[]){let oe=$(ne),Z=$(se);l.add(`${oe}:${Q}:${Z}`)}}}for(let{fn:S,withArgs:C,message:w,replaceWith:I,ignoreRegex:O}of i??[])O&&new RegExp(O).test(c)||a.push($=>{let{callee:ne}=$;if(ne.type!==ae.AST_NODE_TYPES.Identifier||!E(ne.name,S))return;if(C)for(let se of C){let oe=$.arguments[se.atIndex];if(!oe){e.report({node:$,messageId:"default",data:{message:`Missing argument with value "${se.value}" at index ${se.atIndex}: ${w}`}});return}if(oe.type!==ae.AST_NODE_TYPES.Literal||oe.value!==se.value)return}let Q=se=>I?se.replaceText($,I):null;e.report({node:$,messageId:"default",data:{message:w},suggest:I?[{messageId:"default",data:{message:`Replace with "${I}"`},fix:Q}]:void 0})});function x(S,C){let w=r[S];w?r[S]=I=>{w(I),C(I)}:r[S]=C}for(let{selector:S,message:C,replace:w,replaceType:I="suggestion"}of o??[]){if(S==="CallExpression"){a.push(O=>{d(w,O,C,I)});continue}r[S]=O=>{d(w,O,C,I)}}if(p.size>0)for(let[S,C]of p)x(S,C);return a.length>0&&(r.CallExpression=S=>{if(S.type===ae.AST_NODE_TYPES.CallExpression)for(let C of a)C(S)}),r.ImportDeclaration=S=>{S.type===ae.AST_NODE_TYPES.ImportDeclaration&&y(S)},r.ExportNamedDeclaration=S=>{S.type===ae.AST_NODE_TYPES.ExportNamedDeclaration&&T(S)},r.VariableDeclarator=S=>{S.type===ae.AST_NODE_TYPES.VariableDeclarator&&h(S)},r["Program:exit"]=S=>{for(let C of f)e.report({node:S,messageId:"default",data:{message:C}});for(let[,C]of g)e.report({node:S,messageId:"default",data:{message:C}});for(let C of l){let[w,I,O]=C.split(":");e.report({node:S,messageId:"default",data:{message:`Missing required export "${w}" of type ${I}: ${O}`}})}},r;function d(S,C,w,I){let O=$=>{if(!S)return null;if(typeof S=="string")return $.replaceText(C,S);{let ne=new RegExp(S.regex),Q=e.sourceCode.getText(C);return $.replaceText(C,Q.replace(ne,S.with))}};e.report({node:C,messageId:"default",data:{message:w},fix:S&&I==="autofix"?O:void 0,suggest:S&&I==="suggestion"?[{messageId:"default",data:{message:`Replace with "${typeof S=="string"?S:S.with}"`},fix:O}]:void 0})}}});function pi(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:jn(s)}),r.push({name:"$0_uncapitalize",value:Mn(s)}),r.push({name:"$0",value:s});for(let i=0;i<o.length;i++){let c=`$${i+1}`,a=o[i];a!==void 0&&(r.push({name:`${c}_lowercase`,value:a.toLowerCase()}),r.push({name:`${c}_capitalize`,value:jn(a)}),r.push({name:`${c}_uncapitalize`,value:Mn(a)}),r.push({name:c,value:a}))}return r}function jn(e){return e.charAt(0).toUpperCase()+e.slice(1)}function Mn(e){return e.charAt(0).toLowerCase()+e.slice(1)}var V=require("@typescript-eslint/utils"),Ne=require("zod/v4");var ci=V.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),$n="collapse-simple-objs-in-one-line",ui=Ne.z.object({maxLineLength:Ne.z.number().optional(),maxProperties:Ne.z.number().optional(),nestedObjMaxLineLength:Ne.z.number().optional(),nestedObjMaxProperties:Ne.z.number().optional(),ignoreTypesWithSuffix:Ne.z.array(Ne.z.string()).optional()}),fi=ci({name:$n,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:[j(ui)]},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 c(p){if(p.type===V.AST_NODE_TYPES.ObjectExpression){let f=p.parent.type===V.AST_NODE_TYPES.Property,g=f?i:s,l=p.properties.length;if(l>g)return!1;if(l===1){let y=p.properties[0];return!y||y.type===V.AST_NODE_TYPES.Property&&y.value.type===V.AST_NODE_TYPES.ObjectExpression||y.type===V.AST_NODE_TYPES.Property&&y.value.type===V.AST_NODE_TYPES.ArrayExpression&&!y.value.elements.every(h=>h&&At(h))?!1:{text:r.getText(y),isNested:f,propsSize:l}}let u=[];for(let y of p.properties){if(y.type===V.AST_NODE_TYPES.Property&&!At(y.value))return!1;u.push(r.getText(y))}return{text:u.join(", "),isNested:f,propsSize:l}}else{let f=p.parent.parent?.type===V.AST_NODE_TYPES.TSPropertySignature,g=f?i:s,l=p.members.length;if(l>g)return!1;if(n.length>0&&p.parent.type===V.AST_NODE_TYPES.TSTypeAliasDeclaration){let y=p.parent.id.name;if(n.some(T=>y.endsWith(T)))return!1}if(l===1){let y=p.members[0];return!y||y.type===V.AST_NODE_TYPES.TSPropertySignature&&y.typeAnnotation?.typeAnnotation.type===V.AST_NODE_TYPES.TSTypeLiteral?!1:{text:r.getText(y),isNested:f,propsSize:1}}if(p.parent.type===V.AST_NODE_TYPES.TSIntersectionType||p.parent.type===V.AST_NODE_TYPES.TSUnionType&&p.parent.types[0]!==p)return!1;let u=[];for(let y of p.members){if(y.type!==V.AST_NODE_TYPES.TSPropertySignature)return!1;let T=y.typeAnnotation?.typeAnnotation;if(!T||T.type===V.AST_NODE_TYPES.TSTypeLiteral||!_n(T))return!1;if(T.type===V.AST_NODE_TYPES.TSTypeReference&&T.typeArguments){if(T.typeArguments.params.length>1)return!1;let m=T.typeArguments.params[0];if(!m||!_n(m))return!1}let h=r.getText(y).trim();(h.endsWith(";")||h.endsWith(","))&&(h=h.slice(0,-1)),u.push(h)}return{text:u.join("; "),isNested:f,propsSize:l}}}function a(p){if(p.loc.start.line===p.loc.end.line)return;if(p.parent.type!==V.AST_NODE_TYPES.JSXExpressionContainer){let T=0,h=!1,m=r.getTokenAfter(p,{filter:x=>x.type!==V.AST_TOKEN_TYPES.Punctuator||h?!0:x.value===","?(T++,!1):x.value===";"?(T++,h=!0,!1):x.value===")"||x.value==="}"?(T++,!1):!0});if(T>4)return;let E=m?.type===V.AST_TOKEN_TYPES.Template&&m.value.startsWith(`}
2
+ `);if(m?.loc.start.line===p.loc.end.line&&!E)return}let f=c(p);if(!f)return;let g=f.text;if(g.includes(`
3
+ `)||r.getCommentsInside(p).length>0)return;g.endsWith(";")&&(g=g.slice(0,-1));let l=`{ ${g} }`,u=yi(r,p),y=f.isNested&&f.propsSize>2?o:t.maxLineLength;y&&l.length+u.length+mi(p,r)>y||e.report({node:p,messageId:"singleLineProp",fix:T=>T.replaceText(p,l)})}return{TSTypeLiteral:a,ObjectExpression:a}}});function _n(e){return e.type===V.AST_NODE_TYPES.TSLiteralType||e.type===V.AST_NODE_TYPES.TSTypeReference||e.type===V.AST_NODE_TYPES.TSNumberKeyword||e.type===V.AST_NODE_TYPES.TSStringKeyword||e.type===V.AST_NODE_TYPES.TSBooleanKeyword||e.type===V.AST_NODE_TYPES.TSNullKeyword||e.type===V.AST_NODE_TYPES.TSUndefinedKeyword}function At(e,t){return!!(e.type===V.AST_NODE_TYPES.Literal||e.type===V.AST_NODE_TYPES.Identifier||e.type===V.AST_NODE_TYPES.TemplateLiteral||e.type===V.AST_NODE_TYPES.TaggedTemplateExpression||!t&&e.type===V.AST_NODE_TYPES.ArrayExpression&&e.elements.every(r=>r&&At(r,!0)))}function mi(e,t){let r=t.getLastToken(e);if(!r)return 0;let n=t.text.indexOf(`
4
+ `,r.range[1]);return(n!==-1?n:t.text.length)-r.range[1]}function yi(e,t){return e.text.slice(t.range[0]-t.loc.start.column,t.range[0])}var It={name:$n,rule:fi};var di=/eslint +react-compiler\/react-compiler: +\["error/,Wn={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 c(m){o&&Array.isArray(m.suggest)&&m.suggest.length>0&&(m.fix=m.suggest[0].fix),e.report(m)}let a=e.getSourceCode().scopeManager,p=new WeakMap,f=new WeakSet,g=new WeakMap,l=new WeakMap,u=new WeakSet;function y(m,E){return function(x){if(E.has(x))return E.get(x);let d=m(x);return E.set(x,d),d}}function T(m,E,x,d,b){b&&m.async&&c({node:m,message:`Effect callbacks are synchronous to prevent race conditions. Put the async function inside:
5
5
 
6
6
  useEffect(() => {
7
7
  async function fetchData() {
@@ -12,35 +12,35 @@ 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 S=a.acquire(f),C=new Set,w=null;{let A=S.upper;for(;A&&(C.add(A),A.type!=="function");)A=A.upper;if(!A)return;w=A}let I=Array.isArray;function O(A){if(!I(A.defs))return!1;let R=A.defs[0];if(R==null||R.node.type!=="VariableDeclarator")return!1;let k=R.node.init;if(k==null)return!1;for(;k.type==="TSAsExpression";)k=k.expression;let N=R.node.parent;if(N==null&&(Rt(w.block,R.node.id),N=R.node.parent,N==null))return!1;if(N.kind==="const"&&k.type==="Literal"&&(typeof k.value=="string"||typeof k.value=="number"||k.value===null))return!0;if(k.type!=="CallExpression")return!1;let L=k.callee;if(L.type==="MemberExpression"&&L.object.name==="React"&&L.property!=null&&!L.computed&&(L=L.property),L.type!=="Identifier")return!1;let D=R.node.id,{name:_}=L;if(_==="useRef"&&D.type==="Identifier")return!0;if(di(L)&&D.type==="Identifier"){for(let W of A.references)W!==D&&u.add(W.identifier);return!0}else if(_==="useState"||_==="useReducer"){if(D.type==="ArrayPattern"&&D.elements.length===2&&I(A.identifiers)){if(D.elements[1]===A.identifiers[0]){if(_==="useState"){let W=A.references,de=0;for(let Ie=0;Ie<W.length;Ie++){if(W[Ie].isWrite()&&de++,de>1)return!1;p.set(W[Ie].identifier,D.elements[0])}}return!0}else if(D.elements[0]===A.identifiers[0]){if(_==="useState"){let W=A.references;for(let de=0;de<W.length;de++)m.add(W[de].identifier)}return!1}}}else if(_==="useTransition"&&D.type==="ArrayPattern"&&D.elements.length===2&&Array.isArray(A.identifiers)&&D.elements[1]===A.identifiers[0])return!0;return!1}function $(A){if(!I(A.defs))return!1;let R=A.defs[0];if(R==null||R.node==null||R.node.id==null)return!1;let k=R.node,N=w.childScopes,L=null,D;for(D=0;D<N.length;D++){let _=N[D],W=_.block;if(k.type==="FunctionDeclaration"&&W===k||k.type==="VariableDeclarator"&&W.parent===k){L=_;break}}if(L==null)return!1;for(D=0;D<L.through.length;D++){let _=L.through[D];if(_.resolved!=null&&C.has(_.resolved.scope)&&!ne(_.resolved))return!1}return!0}let ne=y(O,g),Q=y($,l),se=new Map;function oe(A){let R=A.from,k=!1;for(;R.block!==f;)R.type==="function"&&(k=R.block.parent!=null&&R.block.parent.type==="ReturnStatement"),R=R.upper;return k}let Z=new Map,Ee=new Map;We(S);function We(A){for(let R of A.references){if(!R.resolved||!C.has(R.resolved.scope))continue;let k=Rt(f,R.identifier),N=$n(k),L=Re(N,Ee);if(b&&N.type==="Identifier"&&(N.parent.type==="MemberExpression"||N.parent.type==="OptionalMemberExpression")&&!N.parent.computed&&N.parent.property.type==="Identifier"&&N.parent.property.name==="current"&&oe(R)&&se.set(L,{reference:R,dependencyNode:N}),N.parent.type==="TSTypeQuery"||N.parent.type==="TSTypeReference")continue;let D=R.resolved.defs[0];if(D!=null&&!(D.node!=null&&D.node.init===f.parent)&&D.type!=="TypeParameter")if(Z.has(L))Z.get(L).references.push(R);else{let _=R.resolved,W=ne(_)||Q(_);Z.set(L,{isStable:W,references:[R]})}}for(let R of A.childScopes)We(R)}se.forEach(({reference:A,dependencyNode:R},k)=>{let N=A.resolved.references,L=!1;for(let D=0;D<N.length;D++){let{identifier:_}=N[D],{parent:W}=_;if(W!=null&&W.type==="MemberExpression"&&!W.computed&&W.property.type==="Identifier"&&W.property.name==="current"&&W.parent.type==="AssignmentExpression"&&W.parent.left===W){L=!0;break}}L||c({node:R.parent.property,message:`The ref value '${k}.current' will likely have changed by the time this effect cleanup function runs. If this ref points to a node rendered by React, copy '${k}.current' to a variable inside the effect, and use that variable in the cleanup function.`})});let pe=new Set;function ke(A,R){pe.has(R)||(pe.add(R),c({node:A,message:`Assignments to the '${R}' variable from inside React Hook ${r(x)} will be lost after each render. To preserve the value over time, store it in a useRef Hook and keep the mutable value in the '.current' property. Otherwise, you can move this variable directly inside ${r(x)}.`}))}let ye=new Set;if(Z.forEach(({isStable:A,references:R},k)=>{A&&ye.add(k),R.forEach(N=>{N.writeExpr&&ke(N.writeExpr,k)})}),pe.size>0)return;if(!E){let A=null;if(Z.forEach(({isStable:R,references:k},N)=>{A||k.forEach(L=>{if(A)return;let D=L.identifier;if(!p.has(D))return;let W=L.from;for(;W.type!=="function";)W=W.upper;W.block===f&&(A=N)})}),A){let{suggestedDependencies:R}=At({dependencies:Z,declaredDependencies:[],stableDependencies:ye,externalDependencies:new Set,isEffect:!0});c({node:x,message:`React Hook ${d} contains a call to '${A}'. 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 ${d} Hook.`,suggest:[{desc:`Add dependencies array: [${R.join(", ")}]`,fix(k){return k.insertTextAfter(f,`, [${R.join(", ")}]`)}}]})}return}let Me=[],Ye=new Set;E.type!=="ArrayExpression"?c({node:E,message:`React Hook ${r(x)} was passed a dependency list that is not an array literal. This means we can't statically verify whether you've passed the correct dependencies.`}):E.elements.forEach(A=>{if(A===null)return;if(A.type==="SpreadElement"){c({node:A,message:`React Hook ${r(x)} has a spread element in its dependency array. This means we can't statically verify whether you've passed the correct dependencies.`});return}u.has(A)&&c({node:A,message:`Functions returned from \`useEffectEvent\` must not be included in the dependency array. Remove \`${r(A)}\` from the list.`,suggest:[{desc:`Remove the dependency \`${r(A)}\``,fix(L){return L.removeRange(A.range)}}]});let R;try{R=Re(A,Ee)}catch(L){if(/Unsupported node type/.test(L.message)){A.type==="Literal"?Z.has(A.value)?c({node:A,message:`The ${A.raw} literal is not a valid dependency because it never changes. Did you mean to include ${A.value} in the array instead?`}):c({node:A,message:`The ${A.raw} literal is not a valid dependency because it never changes. You can safely remove it.`}):c({node:A,message:`React Hook ${r(x)} has a complex expression in the dependency array. Extract it to a separate variable so it can be statically checked.`});return}else throw L}let k=A;for(;k.type==="MemberExpression"||k.type==="OptionalMemberExpression"||k.type==="ChainExpression";)k=k.object||k.expression.object;let N=!w.through.some(L=>L.identifier===k);Me.push({key:R,node:A}),N||Ye.add(R)});let{suggestedDependencies:Hr,unnecessaryDependencies:nt,missingDependencies:Pe,duplicateDependencies:Rn}=At({dependencies:Z,declaredDependencies:Me,stableDependencies:ye,externalDependencies:Ye,isEffect:b}),rt=Hr;if(Rn.size+Pe.size+nt.size===0){if(n)return;ui({declaredDependencies:Me,declaredDependenciesNode:E,componentScope:w,scope:S}).forEach(({construction:R,isUsedOutsideOfHook:k,depType:N})=>{let L=N==="function"?"useCallback":"useMemo",D=N==="function"?"definition":"initialization",_=`wrap the ${D} of '${R.name.name}' in its own ${L}() Hook.`,W=k?`To fix this, ${_}`:`Move it inside the ${d} callback. Alternatively, ${_}`,de=N==="conditional"||N==="logical expression"?"could make":"makes",Ie=`The '${R.name.name}' ${N} ${de} the dependencies of ${d} Hook (at line ${E.loc.start.line}) change on every render. ${W}`,wn;k&&R.type==="Variable"&&N==="function"&&(wn=[{desc:`Wrap the ${D} of '${R.name.name}' in its own ${L}() Hook.`,fix(vn){let[Yr,qr]=L==="useMemo"?["useMemo(() => { return ","; })"]:["useCallback(",")"];return[vn.insertTextBefore(R.node.init,Yr),vn.insertTextAfter(R.node.init,qr)]}}]),c({node:R.node,message:Ie,suggest:wn})});return}!b&&Pe.size>0&&(rt=At({dependencies:Z,declaredDependencies:[],stableDependencies:ye,externalDependencies:Ye,isEffect:b}).suggestedDependencies);function Br(){if(Me.length===0)return!0;let A=Me.map(k=>k.key),R=A.slice().sort();return A.join(",")===R.join(",")}Br()&&rt.sort();function ht(A){let R=A.split("."),k="";for(let N=0;N<R.length;N++){if(N!==0){let L=R.slice(0,N+1).join("."),D=Ee.get(L)===!0;k+=D?"?.":"."}k+=R[N]}return k}function Et(A,R,k,N){return A.size===0?null:(A.size>1?"":R+" ")+k+" "+(A.size>1?"dependencies":"dependency")+": "+mi(Array.from(A).sort().map(L=>"'"+ht(L)+"'"))+`. Either ${N} ${A.size>1?"them":"it"} or remove the dependency array.`}let Se="";if(nt.size>0){let A=null;if(Array.from(nt.keys()).forEach(R=>{A===null&&R.endsWith(".current")&&(A=R)}),A!==null)Se=` Mutable values like '${A}' aren't valid dependencies because mutating them doesn't re-render the component.`;else if(Ye.size>0){let R=Array.from(Ye)[0];S.set.has(R)||(Se=` Outer scope values like '${R}' aren't valid dependencies because mutating them doesn't re-render the component.`)}}if(!Se&&Pe.has("props")){let A=Z.get("props");if(A==null)return;let R=A.references;if(!Array.isArray(R))return;let k=!0;for(let N=0;N<R.length;N++){let L=R[N],D=Rt(w.block,L.identifier);if(!D){k=!1;break}let _=D.parent;if(_==null){k=!1;break}if(_.type!=="MemberExpression"&&_.type!=="OptionalMemberExpression"){k=!1;break}}k&&(Se=` However, 'props' will change when *any* prop changes, so the preferred fix is to destructure the 'props' object outside of the ${d} call and refer to those specific props inside ${r(x)}.`)}if(!Se&&Pe.size>0){let A=null;Pe.forEach(R=>{if(A)return;let k=w.set.get(R),N=Z.get(R);if(N.references[0].resolved!==k)return;let L=k.defs[0];if(L==null||L.name==null||L.type!=="Parameter")return;let D=!1,_;for(let W=0;W<N.references.length;W++)if(_=N.references[W].identifier,_!=null&&_.parent!=null&&(_.parent.type==="CallExpression"||_.parent.type==="OptionalCallExpression")&&_.parent.callee===_){D=!0;break}D&&(A=R)}),A!==null&&(Se=` If '${A}' changes too often, find the parent component that defines it and wrap that definition in useCallback.`)}if(!Se&&Pe.size>0){let A=null;if(Pe.forEach(R=>{if(A!==null)return;let N=Z.get(R).references,L,D;for(let _=0;_<N.length;_++){for(L=N[_].identifier,D=L.parent;D!=null&&D!==w.block;){if(D.type==="CallExpression"){let W=p.get(D.callee);if(W!=null){if(W.name===R)A={missingDep:R,setter:D.callee.name,form:"updater"};else if(m.has(L))A={missingDep:R,setter:D.callee.name,form:"reducer"};else{let de=N[_].resolved;if(de!=null){let Ie=de.defs[0];Ie!=null&&Ie.type==="Parameter"&&(A={missingDep:R,setter:D.callee.name,form:"inlineReducer"})}}break}}D=D.parent}if(A!==null)break}}),A!==null)switch(A.form){case"reducer":Se=` You can also replace multiple useState variables with useReducer if '${A.setter}' needs the current value of '${A.missingDep}'.`;break;case"inlineReducer":Se=` If '${A.setter}' needs the current value of '${A.missingDep}', you can also switch to useReducer instead of useState and read '${A.missingDep}' in the reducer.`;break;case"updater":Se=` You can also do a functional update '${A.setter}(${A.missingDep.slice(0,1)} => ...)' if you only need '${A.missingDep}' in the '${A.setter}' call.`;break;default:throw new Error("Unknown case.")}}c({node:E,message:`React Hook ${r(x)} has `+(Et(Pe,"a","missing","include")||Et(nt,"an","unnecessary","exclude")||Et(Rn,"a","duplicate","omit"))+Se,suggest:[{desc:`Update the dependencies array to be: [${rt.map(ht).join(", ")}]`,fix(A){return A.replaceText(E,`[${rt.map(ht).join(", ")}]`)}}]})}function h(f){let E=fi(f.callee,i);if(E===-1)return;let x=f.arguments[E],d=f.callee,b=_n(d).name,S=f.arguments[E+1],C=/Effect($|[^a-z])/g.test(b);if(!x){c({node:d,message:`React Hook ${b} requires an effect callback. Did you forget to pass a callback to the hook?`});return}if(!(n&&!C)){if(!S&&!C){(b==="useMemo"||b==="useCallback")&&c({node:d,message:`React Hook ${b} does nothing when called with only one argument. Did you forget to pass an array of dependencies?`});return}switch(x.type){case"FunctionExpression":case"ArrowFunctionExpression":T(x,S,d,b,C);return;case"Identifier":if(!S||S.elements&&S.elements.some(O=>O&&O.type==="Identifier"&&O.name===x.name))return;let w=t(f).set.get(x.name);if(w==null||w.defs==null)return;let I=w.defs[0];if(!I||!I.node||I.type!=="Variable"&&I.type!=="FunctionName")break;switch(I.node.type){case"FunctionDeclaration":T(I.node,S,d,b,C);return;case"VariableDeclarator":let O=I.node.init;if(!O)break;switch(O.type){case"ArrowFunctionExpression":case"FunctionExpression":T(O,S,d,b,C);return}break}break;default:c({node:d,message:`React Hook ${b} received a function whose dependencies are unknown. Pass an inline function instead.`});return}c({node:d,message:`React Hook ${b} has a missing dependency: '${x.name}'. Either include it or remove the dependency array.`,suggest:[{desc:`Update the dependencies array to be: [${x.name}]`,fix(w){return w.replaceText(S,`[${x.name}]`)}}]})}}if(e.options[0]?.ignoreIfReactCompilerIsEnabled){for(let f of e.sourceCode.getAllComments())if(ci.test(f.value))return n=!0,{CallExpression:E=>h(E,!0)}}return{CallExpression:f=>h(f)}}};function At({dependencies:e,declaredDependencies:n,stableDependencies:r,externalDependencies:t,isEffect:s}){let o=i();function i(){return{isUsed:!1,isSatisfiedRecursively:!1,isSubtreeUsed:!1,children:new Map}}e.forEach((T,h)=>{let f=c(o,h);f.isUsed=!0,a(o,h,E=>{E.isSubtreeUsed=!0})}),n.forEach(({key:T})=>{let h=c(o,T);h.isSatisfiedRecursively=!0}),r.forEach(T=>{let h=c(o,T);h.isSatisfiedRecursively=!0});function c(T,h){let f=h.split("."),E=T;for(let x of f){let d=E.children.get(x);d||(d=i(),E.children.set(x,d)),E=d}return E}function a(T,h,f){let E=h.split("."),x=T;for(let d of E){let b=x.children.get(d);if(!b)return;f(b),x=b}}let p=new Set,m=new Set;g(o,p,m,T=>T);function g(T,h,f,E){T.children.forEach((x,d)=>{let b=E(d);if(x.isSatisfiedRecursively){x.isSubtreeUsed&&f.add(b);return}if(x.isUsed){h.add(b);return}g(x,h,f,S=>b+"."+S)})}let l=[],u=new Set,y=new Set;return n.forEach(({key:T})=>{m.has(T)?l.indexOf(T)===-1?l.push(T):y.add(T):u.add(T)}),p.forEach(T=>{l.push(T)}),{suggestedDependencies:l,unnecessaryDependencies:u,duplicateDependencies:y,missingDependencies:p}}function Ne(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 Ne(e.consequent)!=null||Ne(e.alternate)!=null?"conditional":null;case"LogicalExpression":return Ne(e.left)!=null||Ne(e.right)!=null?"logical expression":null;case"JSXFragment":return"JSX fragment";case"JSXElement":return"JSX element";case"AssignmentExpression":return Ne(e.right)!=null?"assignment expression":null;case"NewExpression":return"object construction";case"Literal":return e.value instanceof RegExp?"regular expression":null;case"TypeCastExpression":return Ne(e.expression);case"TSAsExpression":return Ne(e.expression)}return null}function ui({declaredDependencies:e,declaredDependenciesNode:n,componentScope:r,scope:t}){let s=e.map(({key:i})=>{let c=r.variables.find(p=>p.name===i);if(c==null)return null;let a=c.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 p=Ne(a.node.init);if(p!=null)return[c,p]}return a.type==="FunctionName"&&a.node.type==="FunctionDeclaration"?[c,"function"]:a.type==="ClassName"&&a.node.type==="ClassDeclaration"?[c,"class"]:null}).filter(Boolean);function o(i){let c=!1;for(let a=0;a<i.references.length;a++){let p=i.references[a];if(p.writeExpr){if(c)return!0;c=!0;continue}let m=p.from;for(;m!==t&&m!=null;)m=m.upper;if(m!==t&&!Un(n,p.identifier))return!0}return!1}return s.map(([i,c])=>({construction:i.defs[0],depType:c,isUsedOutsideOfHook:o(i)}))}function $n(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)?$n(e.parent):e.type==="MemberExpression"&&e.parent&&e.parent.type==="AssignmentExpression"&&e.parent.left===e?e.object:e}function It(e,n,r){n&&(e.optional?n.has(r)||n.set(r,!0):n.has(r)||n.set(r,!1))}function Re(e,n){if(e.type==="Identifier"||e.type==="JSXIdentifier"){let r=e.name;return n&&n.set(r,!1),r}else if(e.type==="MemberExpression"&&!e.computed){let r=Re(e.object,n),t=Re(e.property,null),s=`${r}.${t}`;return It(e,n,s),s}else if(e.type==="OptionalMemberExpression"&&!e.computed){let r=Re(e.object,n),t=Re(e.property,null),s=`${r}.${t}`;return It(e,n,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 t=Re(r.object,n),s=Re(r.property,null),o=`${t}.${s}`;return It(r,n,o),o}else throw new Error(`Unsupported node type: ${e.type}`)}function _n(e,n){return e.type==="MemberExpression"&&e.object.type==="Identifier"&&e.object.name==="React"&&e.property.type==="Identifier"&&!e.computed?e.property:e}function fi(e,n){let r=_n(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&&n&&n.additionalHooks){let t;try{t=Re(r,null)}catch(s){if(/Unsupported node type/.test(s.message))return 0;throw s}return n.additionalHooks.test(t)?0:-1}else return-1}}function Rt(e,n){let r=[e],t=null;for(;r.length;){if(t=r.shift(),yi(t,n))return t;if(Un(t,n))for(let[s,o]of Object.entries(t))s!=="parent"&&(jn(o)?(o.parent=t,r.push(o)):Array.isArray(o)&&o.forEach(i=>{jn(i)&&(i.parent=t,r.push(i))}))}return null}function mi(e){let n="";for(let r=0;r<e.length;r++)n+=e[r],r===0&&e.length===2?n+=" and ":r===e.length-2&&e.length>2?n+=", and ":r<e.length-1&&(n+=", ");return n}function jn(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&typeof e.type=="string"}function yi(e,n){return(e.type==="Identifier"||e.type==="JSXIdentifier")&&e.type===n.type&&e.name===n.name&&e.range[0]===n.range[0]&&e.range[1]===n.range[1]}function Un(e,n){return e.range[0]<=n.range[0]&&e.range[1]>=n.range[1]}function di(e){return!1}var K=require("@typescript-eslint/utils"),re=Te(require("typescript")),Vn=require("zod/v4");var wt=require("@typescript-eslint/utils");function ze(e,n,r=1/0){if(r!==0&&e.parent)return e.type===n?e:ze(e.parent,n,r===1/0?r:r-1)}function*vt(e){yield e,e.parent&&(yield*vt(e.parent))}function Ft(e,n){for(let r of e){let t=n(r);if(t!=null&&t!==!1)return t}}function zn(e,n,r){let s=r.getDeclaredVariables(e).find(o=>o.name===n||o.identifiers[0]?.parent.type===wt.AST_NODE_TYPES.Property&&o.identifiers[0].parent.key.type===wt.AST_NODE_TYPES.Identifier&&o.identifiers[0].parent.key.name===n);return s?s.references.filter(o=>!o.init):[]}function Wn(e){return e===null||typeof e!="object"||!("type"in e)?!1:typeof e.type=="string"}function gi(e,n){return e[n]}function De(e,n,r){let t=r.visitorKeys,s=new Set;function o(i){if(s.has(i))return!1;if(s.add(i),n(i)===!0)return!0;let a=t[i.type];if(a)for(let p of a){let m=gi(i,p);if(m){if(Array.isArray(m)){for(let g of m)if(Wn(g)&&o(g))return!0}else if(Wn(m)&&o(m))return!0}}return!1}o(e)}var Si=K.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),Jn="improved-no-unnecessary-condition",Ti=Vn.z.object({}),hi=["string","number","bigint","boolean","symbol","undefined","object","function","never"],Ei=new Set(hi),kt={name:Jn,rule:Si({name:Jn,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:[j(Ti)]},defaultOptions:[{}],create(e){let n=K.ESLintUtils.getParserServices(e,!0),r=n.program?.getTypeChecker();if(!r||!n.program)throw new Error("TypeScript services or program not available");function t(l){return l.type===K.AST_NODE_TYPES.UnaryExpression&&l.operator==="typeof"}function s(l){return l.flags&re.default.TypeFlags.Any||l.flags&re.default.TypeFlags.Unknown?null:l.flags&re.default.TypeFlags.StringLike?["string"]:l.flags&re.default.TypeFlags.NumberLike?["number"]:l.flags&re.default.TypeFlags.BigIntLike?["bigint"]:l.flags&re.default.TypeFlags.BooleanLike?["boolean"]:l.flags&re.default.TypeFlags.ESSymbolLike?["symbol"]:l.flags&re.default.TypeFlags.Undefined||l.flags&re.default.TypeFlags.Void?["undefined"]:l.flags&re.default.TypeFlags.Null?["object"]:l.getCallSignatures().length>0?["function"]:l.flags&re.default.TypeFlags.Object?l.getProperties().length===0?["string","number","bigint","boolean","symbol","object","function"]:["object"]:l.flags&re.default.TypeFlags.NonPrimitive?["object"]:l.flags&re.default.TypeFlags.Never?["never"]:null}function o(l){if(!r)return null;let u=n.esTreeNodeToTSNodeMap.get(l),y=r.getTypeAtLocation(u.expression);if(y.flags&re.default.TypeFlags.Any||y.flags&re.default.TypeFlags.Unknown)return null;let T=[];if(y.isUnion()){for(let f of y.types){let E=s(f);if(E)T.push(...E);else return null}return T}let h=s(y);return h?(T.push(...h),T):null}function i(l){if(!(l.operator==="==="||l.operator==="!=="))return;let y=null,T=null;if(t(l.left)?(y=l.left,T=l.right.type===K.AST_NODE_TYPES.Literal&&typeof l.right.value=="string"?l.right.value:null):t(l.right)&&(y=l.right,T=l.left.type===K.AST_NODE_TYPES.Literal&&typeof l.left.value=="string"?l.left.value:null),!y||!T||!bi(T,Ei))return;let h=o(y);if(!h)return;let f=l.operator==="!==",E=h.includes(T);h.length===1?E&&!f?e.report({node:l,messageId:"unnecessaryTypeofCondition",data:{name:Je(y,e),type:T}}):!E&&f?e.report({node:l,messageId:"unnecessaryTypeofCondition",data:{name:Je(y,e),type:Array.from(h)[0]}}):!E&&!f?e.report({node:l,messageId:"alwaysFalseTypeofCondition",data:{name:Je(y,e),actualType:st(h),conditionType:T}}):E&&f&&e.report({node:l,messageId:"alwaysFalseTypeofCondition",data:{name:Je(y,e),actualType:st(h),conditionType:T}}):!E&&!f?e.report({node:l,messageId:"alwaysFalseTypeofCondition",data:{name:Je(y,e),actualType:st(h),conditionType:T}}):!E&&f&&e.report({node:l,messageId:"unnecessaryTypeofCondition",data:{name:Je(y,e),type:st(h)}})}function c(l){if(l.flags&re.default.TypeFlags.Any||l.flags&re.default.TypeFlags.Unknown)return null;if(l.isUnion()){let u=[];for(let y of l.types)if(y.flags&re.default.TypeFlags.StringLiteral){let T=y.value;u.push(T)}else return null;return u}return l.flags&re.default.TypeFlags.StringLiteral?[l.value]:null}function a(l){if(!r)return null;let u=n.esTreeNodeToTSNodeMap.get(l),y=r.getTypeAtLocation(u),T=c(y);if(T)return T;let h=r.getSymbolAtLocation(u);if(h){let f=r.getTypeOfSymbolAtLocation(h,u),E=c(f);if(E)return E}return null}function p(l){let u=e.sourceCode.ast,y=null;return De(u,T=>{if(T.type===K.AST_NODE_TYPES.VariableDeclarator&&T.id.type===K.AST_NODE_TYPES.Identifier&&T.id.name===l.name&&T.id.typeAnnotation){let h=T.id.typeAnnotation.typeAnnotation;if(h.type===K.AST_NODE_TYPES.TSUnionType){let f=[];for(let E of h.types)if(E.type===K.AST_NODE_TYPES.TSLiteralType&&E.literal.type===K.AST_NODE_TYPES.Literal&&typeof E.literal.value=="string")f.push(E.literal.value);else return!0;return y=f,!0}if(h.type===K.AST_NODE_TYPES.TSLiteralType&&h.literal.type===K.AST_NODE_TYPES.Literal&&typeof h.literal.value=="string")return y=[h.literal.value],!0}return!1},e.sourceCode),y}function m(l){if(l.callee.type!==K.AST_NODE_TYPES.MemberExpression||l.callee.property.type!==K.AST_NODE_TYPES.Identifier||l.callee.computed)return;let u=l.callee.property.name;if(u!=="startsWith"&&u!=="endsWith"&&u!=="includes"||l.arguments.length!==1)return;let[y]=l.arguments;if(!y||y.type!==K.AST_NODE_TYPES.Literal||typeof y.value!="string")return;let T=l.callee.object,h=a(T);if(!h&&T.type===K.AST_NODE_TYPES.Identifier&&(h=p(T)),!h||h.length===0)return;let f=y.value;if(u==="includes"&&h.length>1)return;let E=0,x=0;for(let d of h)if((u==="startsWith"?d.startsWith(f):u==="endsWith"?d.endsWith(f):d.includes(f))?E++:x++,E>0&&x>0)return;if(E>0&&x===0){let d=u==="startsWith"?"unnecessaryStartsWithCondition":u==="endsWith"?"unnecessaryEndsWithCondition":"unnecessaryIncludesCondition";e.report({node:l,messageId:d})}else if(x>0&&E===0){let d=u==="startsWith"?"alwaysFalseStartsWithCondition":u==="endsWith"?"alwaysFalseEndsWithCondition":"alwaysFalseIncludesCondition";e.report({node:l,messageId:d})}}function g(l){if(!new Set(["===","!==",">",">=","<","<="]).has(l.operator))return;function y(b){if(b.type!==K.AST_NODE_TYPES.MemberExpression||b.computed||b.property.type!==K.AST_NODE_TYPES.Identifier||b.property.name!=="length")return null;let S=b.object,C=a(S);if(!C||C.length===0)return null;let w=[];for(let I of C)w.push(I.length);return{values:w}}let T=y(l.left),h=y(l.right),f=null,E=null;if(T?l.right.type===K.AST_NODE_TYPES.Literal&&typeof l.right.value=="number"&&(f=T.values,E=l.right.value):h&&l.left.type===K.AST_NODE_TYPES.Literal&&typeof l.left.value=="number"&&(f=h.values,E=l.left.value),!f||E===null)return;let x=0,d=0;for(let b of f){let S=!1;if(l.operator==="==="?S=b===E:l.operator==="!=="?S=b!==E:l.operator===">"?S=b>E:l.operator===">="?S=b>=E:l.operator==="<"?S=b<E:l.operator==="<="&&(S=b<=E),S?x++:d++,x>0&&d>0)return}x>0&&d===0?e.report({node:l,messageId:"unnecessaryLengthCondition"}):d>0&&x===0&&e.report({node:l,messageId:"alwaysFalseLengthCondition"})}return{BinaryExpression(l){i(l),g(l)},CallExpression:m}}})};function st(e){return Array.from(new Set(e)).join(" | ")||"never"}function Je(e,n){let r=e.argument;return r.type===K.AST_NODE_TYPES.Identifier?r.name:n.sourceCode.getText(r)}function bi(e,n){return n.has(e)}var at=require("@typescript-eslint/utils"),ot=require("zod/v4");var xi=at.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),Xn="no-call-with-explicit-generics",Ci=ot.z.object({functions:ot.z.array(ot.z.string())}),Ai=xi({name:Xn,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:[j(Ci)]},defaultOptions:[{functions:[]}],create(e,[n]){let r=new Set(n.functions);return{CallExpression(t){let{callee:s}=t;s.type===at.AST_NODE_TYPES.Identifier&&r.has(s.name)&&t.typeArguments&&e.report({node:t,messageId:"noExplicitGenerics",data:{functionName:s.name}})}}}}),Pt={name:Xn,rule:Ai};var $e=require("@typescript-eslint/utils"),Ii=$e.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),Hn="no-call-with-inferred-generics",Ri=Ii({name:Hn,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,[n]){let r=new Map(n.functions.map(t=>[t.name,t]));return{CallExpression(t){let{callee:s}=t;if(s.type!==$e.AST_NODE_TYPES.Identifier)return;let o=r.get(s.name);if(!o)return;let{minGenerics:i=1,allowAny:c,disallowTypes:a=n.disallowTypes}=o;(t.typeArguments?.params.length||0)<(i||0)&&e.report({node:t,messageId:"missingGenericDeclaration",data:{functionName:s.name,minGenerics:i||0}}),!(c&&!a)&&t.typeArguments?.params.some(m=>!c&&m.type===$e.AST_NODE_TYPES.TSAnyKeyword||a&&m.type===$e.AST_NODE_TYPES.TSTypeReference&&m.typeName.type===$e.AST_NODE_TYPES.Identifier&&a.includes(m.typeName.name))&&e.report({node:t,messageId:"anyUsedInGenerics",data:{functionName:s.name}})}}}}),Ot={name:Hn,rule:Ri};var qn=require("@typescript-eslint/utils"),wi=qn.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),Zn="no-commented-out-code",vi=["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:"],Fi=/^\s*return\s+/,ki=/\w=("|'|`)/,Pi=/\w+:\s*('|"|`)/,Oi=/\[['"][^'"]*['"]\]:\s*('|"|`|[^'"`\s])/,Ni=/\w+-\w+:/,Di=/\w+_\w+:/,Li=/\?\s+\w/,ji=/:\s+\w/,Mi=/^\s*('|"|`)[^'"]*('|"|`),?\s*$/,$i=/^\s*\d+[,}]/,_i=/^\s*\[[^\]]*\][,}]/,Ui=/^\s*\{[^}]*\}[,}]/,Wi=/\.\w+\(/,zi=/\[\w+\]/,Ji=/^\s*(['"`]).+?\1\s*:/,Vi=/^<[A-Z]\w*(\s|>|\/)/,Xi=/^<[a-z]+(\s|>|\/)/,Hi=/<[A-Z]\w*(\s.*)?>/,Bi=/<\/[A-Z]\w*>/,Yi=/<[a-z]+(\s.*)?>/,qi=/<\/[a-z]+>/,Zi=/^\s*[*\s]*$/,Gi=/^[a-zA-Z]/,Ki=/^[A-Z][A-Za-z]*(?:\s+\d+)?(?:\s+[a-z]+)*:\s+[A-Za-z]/,Qi=/```[\s\S]*?```/g,es=/`[^`]*`/g,Bn=/[a-zA-Z0-9]/,ts=/\.[A-Za-z_][A-Za-z0-9_]*\(/,ns=/[{}[\]()`=<>]/,rs=/:\s*(['"`[{(]|\w+\s*=>)/,is=/\bif\s*\(|\belse\b|=>/,ee={returnStatement:Fi,stringAssignment:ki,objectPropertyWithQuotes:Pi,computedPropertyAssignment:Oi,kebabCaseProperty:Ni,snakeCaseProperty:Di,ternaryOperator:Li,colonWithWord:ji,quotedString:Mi,numberWithComma:$i,arrayWithComma:_i,objectWithComma:Ui,methodCall:Wi,arrayAccess:zi,quotedPropertyKey:Ji,jsxSelfClosing:Vi,jsxElement:Xi,jsxOpeningTag:Hi,jsxClosingTag:Bi,htmlOpeningTag:Yi,htmlClosingTag:qi,jsdocComment:Zi};function ss(e){if(e.includes(":")){let r=e.split(":")[0]?.trim();if(r&&Gi.test(r)&&r.includes(" "))return!0}let n=e.trim();return n.length===0||ts.test(n)||ns.test(n)||rs.test(n)||is.test(n)?!1:!!(n.includes(":")&&Ki.test(n))}var os=[") {","return;",ee.returnStatement,"if (","else {","else if (","/>","</","< ","},",": {"," } = ","={",ee.stringAssignment,");",ee.objectPropertyWithQuotes,ee.computedPropertyAssignment,ee.kebabCaseProperty,ee.snakeCaseProperty,"&&","||","()",ee.ternaryOperator,ee.colonWithWord,ee.quotedString,ee.numberWithComma,ee.arrayWithComma,ee.objectWithComma,ee.methodCall,ee.arrayAccess,"?.(","??","=>",ee.quotedPropertyKey],as=["/>","</",ee.jsxSelfClosing,ee.jsxElement,ee.jsxOpeningTag,ee.jsxClosingTag,ee.htmlOpeningTag,ee.htmlClosingTag],Yn=["INFO:","TODO:","DOCS:","FIX:","FIXME:","HACK:","NOTE:","WARNING:","WARN:","BUG:","ISSUE:","TEMP:","TEMPORARY:","XXX:","REVIEW:","eslint"],ls=wi({name:Zn,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 n(t,s){if(t.startsWith("/"))return!1;let o=t.trimStart();if(t.startsWith("*")||o.startsWith("eslint-disable")||t.includes("@deprecated")||t.includes("@example")||t.includes("@param")||t.includes("@returns")||t.includes("@throws")||t.includes("typescript-eslint")||t.includes("@ts-")||t.includes("prettier-ignore")||ee.jsdocComment.test(t))return!1;for(let i of Yn)if(o.startsWith(i))return!1;if(t.includes("https://")||ss(o))return!1;if(s==="Block"){for(let i of as)if(typeof i=="string"){if(t.includes(i))return{wrongPattern:i}}else if(i.test(t))return{wrongPattern:`regex(${i.toString()})`};return!1}for(let i of vi)if(o.startsWith(i))return{wrongPattern:i};for(let i of os)if(typeof i=="string"){if(t.includes(i))return{wrongPattern:i}}else if(i.test(t))return{wrongPattern:`regex(${i.toString()})`};return!1}function r(t,s){let o=t,i=o.trim();if(i.startsWith("`")&&(i.endsWith("`,")||i.endsWith("`;")||i.endsWith("`")))return o;if(s==="Block"&&o.includes("```")){let p=o.split(Qi);p.some(g=>Bn.test(g))&&(o=p.join(""))}if(!o.includes("`"))return o;let c=o.split(es);return c.some(p=>Bn.test(p))?c.join(""):o}return{Program(){let s=e.sourceCode.getAllComments();for(let o of s){let i=r(o.value,o.type),c=n(i,o.type);c&&e.report({node:o,messageId:"commentedOutCode",data:{wrongPattern:c.wrongPattern,allowedPrefixes:Yn.join(", ")}})}}}}}),Nt={name:Zn,rule:ls};var lt=require("@typescript-eslint/utils"),ps=lt.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),Gn="no-default-export",cs=ps({name:Gn,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(n){e.report({node:n,messageId:"noDefaultExport"})},ExportNamedDeclaration(n){for(let r of n.specifiers)r.exported.type===lt.TSESTree.AST_NODE_TYPES.Identifier&&r.exported.name==="default"&&e.report({node:n,messageId:"noDefaultExport"})}}}}),Dt={name:Gn,rule:cs};var Kn=require("@typescript-eslint/utils"),us=Kn.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),Qn="no-leaked-text-in-jsx",fs=[",",";","[","]","(",")"],ms=us({name:Qn,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(n){let r=n.value.trim();if(!r)return;let t="";fs.includes(r)?t=r:r.includes("&&")?t="&&":r.includes("||")?t="||":r.endsWith("? (")&&(t="? ("),t&&e.report({node:n,messageId:"leakedTextInJSX",data:{text:t}})}}}}),Lt={name:Qn,rule:ms};var Le=require("@typescript-eslint/utils"),ys=Le.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),tr="no-non-camel-case-functions",ds=/^(\$?[a-z][a-zA-Z0-9]*)$/;function er(e){if(e.typeName.type!==Le.AST_NODE_TYPES.TSQualifiedName)return!1;let{left:n,right:r}=e.typeName;return n.type===Le.AST_NODE_TYPES.Identifier&&n.name==="JSX"&&r.name==="Element"}var gs=ys({name:tr,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(n){if(n.id&&!ds.test(n.id.name)){let r=n.returnType?.typeAnnotation;if(r&&(r.type===Le.AST_NODE_TYPES.TSTypeReference?er(r):r.type===Le.AST_NODE_TYPES.TSUnionType&&r.types.some(s=>s.type===Le.AST_NODE_TYPES.TSTypeReference&&er(s))))return;e.report({node:n.id,messageId:"nonCamelCaseFunction",data:{functionName:n.id.name}})}}}}}),jt={name:tr,rule:gs};var B=require("@typescript-eslint/utils");var Ss=B.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),nr="no-optional-root-props",Ts=Ss({name:nr,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 n(t){let o=e.sourceCode.getDeclaredVariables(t)[0];if(!o||o.references.length!==1)return!1;let i=o.references[0];if(!i)return!1;for(let c of vt(i.identifier)){if("returnType"in c||c.type===B.TSESTree.AST_NODE_TYPES.ExportNamedDeclaration)return!1;let a=c.parent;if(!a)return!1;if(a.type===B.TSESTree.AST_NODE_TYPES.TSTypeParameterInstantiation&&a.parent.type===B.TSESTree.AST_NODE_TYPES.TSTypeReference&&a.parent.typeName.type===B.TSESTree.AST_NODE_TYPES.Identifier&&a.parent.typeName.name==="FC"){let m=ze(a.parent.parent,B.TSESTree.AST_NODE_TYPES.VariableDeclaration,4);if(!m)return!1;let g=pt(m,e.sourceCode);return g?!(g.parent.type===B.TSESTree.AST_NODE_TYPES.CallExpression&&g.parent.callee.type===B.TSESTree.AST_NODE_TYPES.Identifier&&g.parent.callee.name==="memo"):!1}if(c.type===B.TSESTree.AST_NODE_TYPES.AssignmentPattern)return!1;if(a.type===B.TSESTree.AST_NODE_TYPES.ArrowFunctionExpression){let p=ze(a,B.TSESTree.AST_NODE_TYPES.VariableDeclaration);return p?!!pt(p,e.sourceCode):!1}if(a.type===B.TSESTree.AST_NODE_TYPES.FunctionDeclaration)return!!pt(a,e.sourceCode)}return!1}function r(t){t.key.type!==B.TSESTree.AST_NODE_TYPES.Identifier||!t.optional||e.report({node:t.key,messageId:"optionalNotAllowed",data:{propertyName:t.key.name},suggest:[{messageId:"suggestion",fix:s=>{let o=ze(t,B.TSESTree.AST_NODE_TYPES.TSPropertySignature);if(!o)return null;let i=e.sourceCode.getText(o);return s.replaceText(o,i.replace("?:",": undefined |"))}}]})}return{TSTypeAliasDeclaration(t){if(t.typeAnnotation.type===B.TSESTree.AST_NODE_TYPES.TSTypeLiteral&&!(ct(t)||!n(t)))for(let s of t.typeAnnotation.members)s.type===B.TSESTree.AST_NODE_TYPES.TSPropertySignature&&r(s)},TSInterfaceDeclaration(t){if(!(ct(t)||!n(t)))for(let s of t.body.body)s.type===B.TSESTree.AST_NODE_TYPES.TSPropertySignature&&r(s)},TSTypeReference(t){if(t.typeName.type!==B.TSESTree.AST_NODE_TYPES.Identifier||t.typeName.name!=="FC"||!t.typeArguments?.params[0])return;let s=t.typeArguments.params[0];if(s.type!==B.TSESTree.AST_NODE_TYPES.TSTypeLiteral)return;let o=ze(t.parent,B.TSESTree.AST_NODE_TYPES.VariableDeclaration,4);if(!o)return;let i=pt(o,e.sourceCode);if(!(!i||i.parent.type===B.TSESTree.AST_NODE_TYPES.CallExpression&&i.parent.callee.type===B.TSESTree.AST_NODE_TYPES.Identifier&&i.parent.callee.name==="memo"))for(let a of s.members)a.type===B.TSESTree.AST_NODE_TYPES.TSPropertySignature&&r(a)}}}});function ct(e){return e?e.parent?.type===B.TSESTree.AST_NODE_TYPES.ExportNamedDeclaration||e.parent?.type===B.TSESTree.AST_NODE_TYPES.ExportDefaultDeclaration:!1}function pt(e,n){if(ct(e))return;let r;if(e.type===B.TSESTree.AST_NODE_TYPES.VariableDeclaration){if(e.declarations.length!==1)return;e.declarations[0].id.type===B.TSESTree.AST_NODE_TYPES.Identifier&&(r=e.declarations[0].id)}else{if(!e.id)return;r=e.id}if(!r)return;let t=n.getScope(e);e.type===B.TSESTree.AST_NODE_TYPES.FunctionDeclaration&&t.upper&&(t=t.upper);let s=t.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])&&!ct(o[0].identifier.parent.parent))return o[0].identifier}var Mt={name:nr,rule:Ts};var qe=require("@typescript-eslint/utils");var Ze=U({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 n=new Set;function r(t){return t?t.type===qe.AST_NODE_TYPES.Identifier?n.has(t.name):t.type===qe.AST_NODE_TYPES.MemberExpression?r(t.object):!1:!1}return{ImportDeclaration(t){for(let s of t.specifiers)n.add(s.local.name)},ExportNamedDeclaration(t){if(t.source){e.report({node:t,messageId:"noReexport"});return}if(t.declaration?.type===qe.AST_NODE_TYPES.VariableDeclaration)for(let s of t.declaration.declarations)r(s.init)&&e.report({node:t,messageId:"noReexport"});t.specifiers.length>0&&e.report({node:t,messageId:"noReexport"})},ExportDefaultDeclaration(t){t.declaration.type===qe.AST_NODE_TYPES.Identifier&&n.has(t.declaration.name)&&e.report({node:t,messageId:"noReexport"})},ExportAllDeclaration(t){e.report({node:t,messageId:"noReexport"})}}}});var rr=require("@typescript-eslint/utils"),ut=Te(require("path")),we=require("zod/v4");var hs=rr.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),ir="no-relative-imports",Es=we.z.object({find:we.z.string(),replacement:we.z.string()}),bs=we.z.object({aliases:we.z.array(Es),rootDir:we.z.string().optional(),allowNotFoundAliases:we.z.boolean().optional(),_dev_simulateFileName:we.z.string().optional()}),xs=hs({name:ir,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:[j(bs)]},defaultOptions:[{aliases:[],rootDir:void 0}],create(e,[n]){let r=n._dev_simulateFileName??e.filename;function t(i){return i.startsWith(".")||i.startsWith("..")}function s(i,c){let a=ut.default.dirname(c);return ut.default.resolve(a,i)}function o(i){let c=n.rootDir??process.cwd(),a=ut.default.relative(c,i);if(a.startsWith("."))return null;a.startsWith("/")||(a=`/${a}`);for(let{find:p,replacement:m}of n.aliases)if(a.startsWith(m)){let g=a.replace(m,p);return{alias:p,newPath:g}}return null}return{ImportDeclaration(i){let c=i.source.value;if(!t(c))return;let a=s(c,r),p=o(a);!p&&n.allowNotFoundAliases||e.report({node:i,messageId:p?"noRelativeImportsWithAlias":"noRelativeImports",data:{alias:p?.alias},fix:p?m=>m.replaceText(i.source,`'${p.newPath}'`):void 0})}}}}),$t={name:ir,rule:xs};var te=require("@typescript-eslint/utils"),_t=require("zod/v4");var Cs=_t.z.object({customMessage:_t.z.string().optional()}),Ut=U({name:"no-static-style-prop",meta:{type:"problem",docs:{description:"Prevent using static style props in JSX, only dynamic values should be allowed"},schema:[j(Cs)],messages:{noStaticStyleProp:"Static style props are not allowed use css instead.{{customMessage}}"}},defaultOptions:[{}],create(e,[n]){function r(t){switch(t.type){case te.AST_NODE_TYPES.Literal:return!0;case te.AST_NODE_TYPES.ObjectExpression:return t.properties.every(s=>s.type===te.AST_NODE_TYPES.Property?s.computed||s.value.type===te.AST_NODE_TYPES.Identifier&&s.key.type===te.AST_NODE_TYPES.Identifier&&s.key.name===s.value.name?!1:r(s.value):!1);case te.AST_NODE_TYPES.ArrayExpression:return t.elements.every(s=>s?s.type===te.AST_NODE_TYPES.SpreadElement?!1:r(s):!0);case te.AST_NODE_TYPES.TemplateLiteral:return t.expressions.length===0;case te.AST_NODE_TYPES.ConditionalExpression:case te.AST_NODE_TYPES.LogicalExpression:case te.AST_NODE_TYPES.BinaryExpression:case te.AST_NODE_TYPES.UnaryExpression:case te.AST_NODE_TYPES.CallExpression:case te.AST_NODE_TYPES.MemberExpression:case te.AST_NODE_TYPES.Identifier:case te.AST_NODE_TYPES.ArrowFunctionExpression:case te.AST_NODE_TYPES.FunctionExpression:return!1;default:return!1}}return{JSXAttribute(t){if(t.name.type===te.AST_NODE_TYPES.JSXIdentifier&&t.name.name==="style"&&t.value){let s=null;t.value.type===te.AST_NODE_TYPES.JSXExpressionContainer?t.value.expression.type!==te.AST_NODE_TYPES.JSXEmptyExpression&&(s=t.value.expression):t.value.type===te.AST_NODE_TYPES.Literal&&(s=t.value),s&&r(s)&&e.report({node:t,messageId:"noStaticStyleProp",data:{customMessage:n.customMessage?` ${n.customMessage}`:""}})}}}}});var Ge=require("@typescript-eslint/utils"),_e=Te(require("zod/v4"));var As=_e.object({alternativeMsgs:_e.object({inArrayFind:_e.string().optional(),inArrayFilter:_e.string().optional()}).optional(),__dev_simulateFileName:_e.string().optional()});function Is(e){return e.typeAnnotation.type!==Ge.AST_NODE_TYPES.TSTypePredicate?!1:e.typeAnnotation.asserts===!1}var Rs=/(typeGuards|type-guards)\.(ts|tsx)$/;function ws(e){return Rs.test(e)}function vs(e){let n=e.parent;for(;n;){if(n.type===Ge.AST_NODE_TYPES.CallExpression&&n.callee.type===Ge.AST_NODE_TYPES.MemberExpression&&n.callee.property.type===Ge.AST_NODE_TYPES.Identifier){let r=n.callee.property.name;if(r==="filter"||r==="find")return{method:r}}n=n.parent}return null}var Wt=U({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:[j(As)],hasSuggestions:!0},defaultOptions:[{}],create(e,[n]){let r=n.__dev_simulateFileName??e.filename;if(ws(r))return{};function t(s){if(!Is(s))return;let o=vs(s);if(n.alternativeMsgs&&o){let i=o.method==="filter"?n.alternativeMsgs.inArrayFilter:n.alternativeMsgs.inArrayFind;if(i){let c=o.method==="filter"?"useFilterWithTypeCheck":"useFindWithTypeCheck";e.report({node:s,messageId:c,data:{message:i}});return}}e.report({node:s,messageId:"typeGuardNotAllowed"})}return{"FunctionDeclaration > :matches(TSTypeAnnotation)":t,"ArrowFunctionExpression > :matches(TSTypeAnnotation)":t,"MethodDefinition > FunctionExpression > :matches(TSTypeAnnotation)":t}}});var Ue=require("@typescript-eslint/utils");var Fs="no-unnecessary-async-on-jsx-props";function ks(e){if(e.body.type!==Ue.AST_NODE_TYPES.BlockStatement)return!1;let n=e.body.body;if(n.length!==1)return!1;let r=n[0];return!r||r.type!==Ue.AST_NODE_TYPES.ExpressionStatement?!1:r.expression.type===Ue.AST_NODE_TYPES.AwaitExpression}var zt=U({name:Fs,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 n(r){ks(r)&&e.report({node:r,messageId:"unnecessaryAsyncInJsxProp",fix(t){let s=e.sourceCode,o=[],i=s.getFirstToken(r,a=>a.value==="async");if(i){let a=s.getTokenAfter(i);a?o.push(t.replaceTextRange([i.range[0],a.range[0]],"")):o.push(t.remove(i))}function c(a){if(a.type===Ue.AST_NODE_TYPES.AwaitExpression){let p=s.getFirstToken(a);if(p&&p.value==="await"){let m=s.getTokenAfter(p);m?o.push(t.replaceTextRange([p.range[0],m.range[0]],"")):o.push(t.remove(p))}}if(a.type===Ue.AST_NODE_TYPES.BlockStatement)for(let p of a.body)c(p);else a.type===Ue.AST_NODE_TYPES.ExpressionStatement&&c(a.expression)}return c(r.body),o}})}return{"JSXAttribute ArrowFunctionExpression[async=true]":n,"JSXAttribute FunctionExpression[async=true]":n}}});var ve=require("@typescript-eslint/utils"),Jt=Te(require("typescript")),Ve=Te(require("zod/v4"));var Ps=ve.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),sr="no-unnecessary-casting",Os=Ve.default.object({additionalCastFunctions:Ve.default.array(Ve.default.object({name:Ve.default.string(),expectedType:Ve.default.enum(["string","number"])})).optional()}),Vt={name:sr,rule:Ps({name:sr,meta:{type:"suggestion",docs:{description:"Prevents unnecessary Number and String castings"},messages:{unnecessaryNumberCasting:"Unnecessary Number() casting on a value already of number type",unnecessaryStringCasting:"Unnecessary String() casting on a value already of string type",unnecessaryCustomCasting:"Unnecessary {{name}}() casting on a value already of {{type}} type"},schema:[j(Os)],fixable:"code"},defaultOptions:[{}],create(e){let r=e.options[0].additionalCastFunctions||[],t=[{name:"Number",expectedType:"number"},{name:"String",expectedType:"string"},...r],s=ve.ESLintUtils.getParserServices(e,!0),o=s.program?.getTypeChecker();if(!o||!s.program)throw new Error("TypeScript services or program not available");function i(m,g){switch(m.type){case ve.AST_NODE_TYPES.Literal:return g==="number"?typeof m.value=="number":typeof m.value=="string";case ve.AST_NODE_TYPES.TemplateLiteral:return g==="string";case ve.AST_NODE_TYPES.UnaryExpression:return g==="number"?m.operator==="+"||m.operator==="-"||m.operator==="~":!1;default:return!1}}function c(m,g){return g==="number"?!!(m.flags&Jt.TypeFlags.NumberLike):!!(m.flags&Jt.TypeFlags.StringLike)}function a(m,g){return l=>l.replaceText(m,e.sourceCode.getText(g))}function p(m){if(!o||m.arguments.length!==1)return;let g=m.arguments[0];if(!g||g.type===ve.AST_NODE_TYPES.SpreadElement)return;let{callee:l}=m;if(l.type!==ve.AST_NODE_TYPES.Identifier)return;let u=l.name,y=t.find(h=>h.name===u);if(!y)return;if(i(g,y.expectedType)||c(o.getTypeAtLocation(s.esTreeNodeToTSNodeMap.get(g)),y.expectedType)){let h,f;u==="Number"?h="unnecessaryNumberCasting":u==="String"?h="unnecessaryStringCasting":(h="unnecessaryCustomCasting",f={name:y.name,type:y.expectedType}),e.report({node:m,messageId:h,...f?{data:f}:{},fix:a(m,g)})}}return{CallExpression:p}}})};var me=require("@typescript-eslint/utils"),ft=Te(require("zod/v4"));var Ns=ft.object({ignoreWithDescription:ft.string().optional()}),Xt=U({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:[j(Ns)]},defaultOptions:[{}],create(e,[n]){let r=e.getSourceCode(),t=r.ast;function s(a){let p=a.arguments[0];return p&&p.type===me.AST_NODE_TYPES.Literal&&typeof p.value=="string"?p.value:null}function o(a){return!a||!n.ignoreWithDescription?!1:new RegExp(n.ignoreWithDescription).test(a)}function i(a){return a.length!==1?!1:t.body.filter(m=>{if(m.type===me.AST_NODE_TYPES.ExpressionStatement){let g=m.expression;if(g.type===me.AST_NODE_TYPES.CallExpression&&g.callee.type===me.AST_NODE_TYPES.Identifier){let l=g.callee.name;return["test","it","beforeEach","afterEach","beforeAll","afterAll"].includes(l)}}return!1}).length===0}function c(a){let p=a.arguments[1];if(p&&(p.type===me.AST_NODE_TYPES.FunctionExpression||p.type===me.AST_NODE_TYPES.ArrowFunctionExpression)&&p.body.type===me.AST_NODE_TYPES.BlockStatement){let m=p.body.body;return m.length===0?"":m.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 S=a.acquire(m),C=new Set,w=null;{let A=S.upper;for(;A&&(C.add(A),A.type!=="function");)A=A.upper;if(!A)return;w=A}let I=Array.isArray;function O(A){if(!I(A.defs))return!1;let R=A.defs[0];if(R==null||R.node.type!=="VariableDeclarator")return!1;let F=R.node.init;if(F==null)return!1;for(;F.type==="TSAsExpression";)F=F.expression;let N=R.node.parent;if(N==null&&(vt(w.block,R.node.id),N=R.node.parent,N==null))return!1;if(N.kind==="const"&&F.type==="Literal"&&(typeof F.value=="string"||typeof F.value=="number"||F.value===null))return!0;if(F.type!=="CallExpression")return!1;let L=F.callee;if(L.type==="MemberExpression"&&L.object.name==="React"&&L.property!=null&&!L.computed&&(L=L.property),L.type!=="Identifier")return!1;let D=R.node.id,{name:U}=L;if(U==="useRef"&&D.type==="Identifier")return!0;if(Ei(L)&&D.type==="Identifier"){for(let W of A.references)W!==D&&u.add(W.identifier);return!0}else if(U==="useState"||U==="useReducer"){if(D.type==="ArrayPattern"&&D.elements.length===2&&I(A.identifiers)){if(D.elements[1]===A.identifiers[0]){if(U==="useState"){let W=A.references,ge=0;for(let Re=0;Re<W.length;Re++){if(W[Re].isWrite()&&ge++,ge>1)return!1;p.set(W[Re].identifier,D.elements[0])}}return!0}else if(D.elements[0]===A.identifiers[0]){if(U==="useState"){let W=A.references;for(let ge=0;ge<W.length;ge++)f.add(W[ge].identifier)}return!1}}}else if(U==="useTransition"&&D.type==="ArrayPattern"&&D.elements.length===2&&Array.isArray(A.identifiers)&&D.elements[1]===A.identifiers[0])return!0;return!1}function $(A){if(!I(A.defs))return!1;let R=A.defs[0];if(R==null||R.node==null||R.node.id==null)return!1;let F=R.node,N=w.childScopes,L=null,D;for(D=0;D<N.length;D++){let U=N[D],W=U.block;if(F.type==="FunctionDeclaration"&&W===F||F.type==="VariableDeclarator"&&W.parent===F){L=U;break}}if(L==null)return!1;for(D=0;D<L.through.length;D++){let U=L.through[D];if(U.resolved!=null&&C.has(U.resolved.scope)&&!ne(U.resolved))return!1}return!0}let ne=y(O,g),Q=y($,l),se=new Map;function oe(A){let R=A.from,F=!1;for(;R.block!==m;)R.type==="function"&&(F=R.block.parent!=null&&R.block.parent.type==="ReturnStatement"),R=R.upper;return F}let Z=new Map,be=new Map;Je(S);function Je(A){for(let R of A.references){if(!R.resolved||!C.has(R.resolved.scope))continue;let F=vt(m,R.identifier),N=zn(F),L=we(N,be);if(b&&N.type==="Identifier"&&(N.parent.type==="MemberExpression"||N.parent.type==="OptionalMemberExpression")&&!N.parent.computed&&N.parent.property.type==="Identifier"&&N.parent.property.name==="current"&&oe(R)&&se.set(L,{reference:R,dependencyNode:N}),N.parent.type==="TSTypeQuery"||N.parent.type==="TSTypeReference")continue;let D=R.resolved.defs[0];if(D!=null&&!(D.node!=null&&D.node.init===m.parent)&&D.type!=="TypeParameter")if(Z.has(L))Z.get(L).references.push(R);else{let U=R.resolved,W=ne(U)||Q(U);Z.set(L,{isStable:W,references:[R]})}}for(let R of A.childScopes)Je(R)}se.forEach(({reference:A,dependencyNode:R},F)=>{let N=A.resolved.references,L=!1;for(let D=0;D<N.length;D++){let{identifier:U}=N[D],{parent:W}=U;if(W!=null&&W.type==="MemberExpression"&&!W.computed&&W.property.type==="Identifier"&&W.property.name==="current"&&W.parent.type==="AssignmentExpression"&&W.parent.left===W){L=!0;break}}L||c({node:R.parent.property,message:`The ref value '${F}.current' will likely have changed by the time this effect cleanup function runs. If this ref points to a node rendered by React, copy '${F}.current' to a variable inside the effect, and use that variable in the cleanup function.`})});let pe=new Set;function Pe(A,R){pe.has(R)||(pe.add(R),c({node:A,message:`Assignments to the '${R}' variable from inside React Hook ${r(x)} will be lost after each render. To preserve the value over time, store it in a useRef Hook and keep the mutable value in the '.current' property. Otherwise, you can move this variable directly inside ${r(x)}.`}))}let de=new Set;if(Z.forEach(({isStable:A,references:R},F)=>{A&&de.add(F),R.forEach(N=>{N.writeExpr&&Pe(N.writeExpr,F)})}),pe.size>0)return;if(!E){let A=null;if(Z.forEach(({isStable:R,references:F},N)=>{A||F.forEach(L=>{if(A)return;let D=L.identifier;if(!p.has(D))return;let W=L.from;for(;W.type!=="function";)W=W.upper;W.block===m&&(A=N)})}),A){let{suggestedDependencies:R}=Rt({dependencies:Z,declaredDependencies:[],stableDependencies:de,externalDependencies:new Set,isEffect:!0});c({node:x,message:`React Hook ${d} contains a call to '${A}'. 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 ${d} Hook.`,suggest:[{desc:`Add dependencies array: [${R.join(", ")}]`,fix(F){return F.insertTextAfter(m,`, [${R.join(", ")}]`)}}]})}return}let _e=[],Ze=new Set;E.type!=="ArrayExpression"?c({node:E,message:`React Hook ${r(x)} was passed a dependency list that is not an array literal. This means we can't statically verify whether you've passed the correct dependencies.`}):E.elements.forEach(A=>{if(A===null)return;if(A.type==="SpreadElement"){c({node:A,message:`React Hook ${r(x)} has a spread element in its dependency array. This means we can't statically verify whether you've passed the correct dependencies.`});return}u.has(A)&&c({node:A,message:`Functions returned from \`useEffectEvent\` must not be included in the dependency array. Remove \`${r(A)}\` from the list.`,suggest:[{desc:`Remove the dependency \`${r(A)}\``,fix(L){return L.removeRange(A.range)}}]});let R;try{R=we(A,be)}catch(L){if(/Unsupported node type/.test(L.message)){A.type==="Literal"?Z.has(A.value)?c({node:A,message:`The ${A.raw} literal is not a valid dependency because it never changes. Did you mean to include ${A.value} in the array instead?`}):c({node:A,message:`The ${A.raw} literal is not a valid dependency because it never changes. You can safely remove it.`}):c({node:A,message:`React Hook ${r(x)} has a complex expression in the dependency array. Extract it to a separate variable so it can be statically checked.`});return}else throw L}let F=A;for(;F.type==="MemberExpression"||F.type==="OptionalMemberExpression"||F.type==="ChainExpression";)F=F.object||F.expression.object;let N=!w.through.some(L=>L.identifier===F);_e.push({key:R,node:A}),N||Ze.add(R)});let{suggestedDependencies:Gr,unnecessaryDependencies:it,missingDependencies:Oe,duplicateDependencies:Fn}=Rt({dependencies:Z,declaredDependencies:_e,stableDependencies:de,externalDependencies:Ze,isEffect:b}),st=Gr;if(Fn.size+Oe.size+it.size===0){if(t)return;gi({declaredDependencies:_e,declaredDependenciesNode:E,componentScope:w,scope:S}).forEach(({construction:R,isUsedOutsideOfHook:F,depType:N})=>{let L=N==="function"?"useCallback":"useMemo",D=N==="function"?"definition":"initialization",U=`wrap the ${D} of '${R.name.name}' in its own ${L}() Hook.`,W=F?`To fix this, ${U}`:`Move it inside the ${d} callback. Alternatively, ${U}`,ge=N==="conditional"||N==="logical expression"?"could make":"makes",Re=`The '${R.name.name}' ${N} ${ge} the dependencies of ${d} Hook (at line ${E.loc.start.line}) change on every render. ${W}`,Pn;F&&R.type==="Variable"&&N==="function"&&(Pn=[{desc:`Wrap the ${D} of '${R.name.name}' in its own ${L}() Hook.`,fix(On){let[Qr,ei]=L==="useMemo"?["useMemo(() => { return ","; })"]:["useCallback(",")"];return[On.insertTextBefore(R.node.init,Qr),On.insertTextAfter(R.node.init,ei)]}}]),c({node:R.node,message:Re,suggest:Pn})});return}!b&&Oe.size>0&&(st=Rt({dependencies:Z,declaredDependencies:[],stableDependencies:de,externalDependencies:Ze,isEffect:b}).suggestedDependencies);function Kr(){if(_e.length===0)return!0;let A=_e.map(F=>F.key),R=A.slice().sort();return A.join(",")===R.join(",")}Kr()&&st.sort();function bt(A){let R=A.split("."),F="";for(let N=0;N<R.length;N++){if(N!==0){let L=R.slice(0,N+1).join("."),D=be.get(L)===!0;F+=D?"?.":"."}F+=R[N]}return F}function xt(A,R,F,N){return A.size===0?null:(A.size>1?"":R+" ")+F+" "+(A.size>1?"dependencies":"dependency")+": "+Ti(Array.from(A).sort().map(L=>"'"+bt(L)+"'"))+`. Either ${N} ${A.size>1?"them":"it"} or remove the dependency array.`}let Te="";if(it.size>0){let A=null;if(Array.from(it.keys()).forEach(R=>{A===null&&R.endsWith(".current")&&(A=R)}),A!==null)Te=` Mutable values like '${A}' aren't valid dependencies because mutating them doesn't re-render the component.`;else if(Ze.size>0){let R=Array.from(Ze)[0];S.set.has(R)||(Te=` Outer scope values like '${R}' aren't valid dependencies because mutating them doesn't re-render the component.`)}}if(!Te&&Oe.has("props")){let A=Z.get("props");if(A==null)return;let R=A.references;if(!Array.isArray(R))return;let F=!0;for(let N=0;N<R.length;N++){let L=R[N],D=vt(w.block,L.identifier);if(!D){F=!1;break}let U=D.parent;if(U==null){F=!1;break}if(U.type!=="MemberExpression"&&U.type!=="OptionalMemberExpression"){F=!1;break}}F&&(Te=` However, 'props' will change when *any* prop changes, so the preferred fix is to destructure the 'props' object outside of the ${d} call and refer to those specific props inside ${r(x)}.`)}if(!Te&&Oe.size>0){let A=null;Oe.forEach(R=>{if(A)return;let F=w.set.get(R),N=Z.get(R);if(N.references[0].resolved!==F)return;let L=F.defs[0];if(L==null||L.name==null||L.type!=="Parameter")return;let D=!1,U;for(let W=0;W<N.references.length;W++)if(U=N.references[W].identifier,U!=null&&U.parent!=null&&(U.parent.type==="CallExpression"||U.parent.type==="OptionalCallExpression")&&U.parent.callee===U){D=!0;break}D&&(A=R)}),A!==null&&(Te=` If '${A}' changes too often, find the parent component that defines it and wrap that definition in useCallback.`)}if(!Te&&Oe.size>0){let A=null;if(Oe.forEach(R=>{if(A!==null)return;let N=Z.get(R).references,L,D;for(let U=0;U<N.length;U++){for(L=N[U].identifier,D=L.parent;D!=null&&D!==w.block;){if(D.type==="CallExpression"){let W=p.get(D.callee);if(W!=null){if(W.name===R)A={missingDep:R,setter:D.callee.name,form:"updater"};else if(f.has(L))A={missingDep:R,setter:D.callee.name,form:"reducer"};else{let ge=N[U].resolved;if(ge!=null){let Re=ge.defs[0];Re!=null&&Re.type==="Parameter"&&(A={missingDep:R,setter:D.callee.name,form:"inlineReducer"})}}break}}D=D.parent}if(A!==null)break}}),A!==null)switch(A.form){case"reducer":Te=` You can also replace multiple useState variables with useReducer if '${A.setter}' needs the current value of '${A.missingDep}'.`;break;case"inlineReducer":Te=` If '${A.setter}' needs the current value of '${A.missingDep}', you can also switch to useReducer instead of useState and read '${A.missingDep}' in the reducer.`;break;case"updater":Te=` You can also do a functional update '${A.setter}(${A.missingDep.slice(0,1)} => ...)' if you only need '${A.missingDep}' in the '${A.setter}' call.`;break;default:throw new Error("Unknown case.")}}c({node:E,message:`React Hook ${r(x)} has `+(xt(Oe,"a","missing","include")||xt(it,"an","unnecessary","exclude")||xt(Fn,"a","duplicate","omit"))+Te,suggest:[{desc:`Update the dependencies array to be: [${st.map(bt).join(", ")}]`,fix(A){return A.replaceText(E,`[${st.map(bt).join(", ")}]`)}}]})}function h(m){let E=Si(m.callee,i);if(E===-1)return;let x=m.arguments[E],d=m.callee,b=Jn(d).name,S=m.arguments[E+1],C=/Effect($|[^a-z])/g.test(b);if(!x){c({node:d,message:`React Hook ${b} requires an effect callback. Did you forget to pass a callback to the hook?`});return}if(!(t&&!C)){if(!S&&!C){(b==="useMemo"||b==="useCallback")&&c({node:d,message:`React Hook ${b} does nothing when called with only one argument. Did you forget to pass an array of dependencies?`});return}switch(x.type){case"FunctionExpression":case"ArrowFunctionExpression":T(x,S,d,b,C);return;case"Identifier":if(!S||S.elements&&S.elements.some(O=>O&&O.type==="Identifier"&&O.name===x.name))return;let w=n(m).set.get(x.name);if(w==null||w.defs==null)return;let I=w.defs[0];if(!I||!I.node||I.type!=="Variable"&&I.type!=="FunctionName")break;switch(I.node.type){case"FunctionDeclaration":T(I.node,S,d,b,C);return;case"VariableDeclarator":let O=I.node.init;if(!O)break;switch(O.type){case"ArrowFunctionExpression":case"FunctionExpression":T(O,S,d,b,C);return}break}break;default:c({node:d,message:`React Hook ${b} received a function whose dependencies are unknown. Pass an inline function instead.`});return}c({node:d,message:`React Hook ${b} has a missing dependency: '${x.name}'. Either include it or remove the dependency array.`,suggest:[{desc:`Update the dependencies array to be: [${x.name}]`,fix(w){return w.replaceText(S,`[${x.name}]`)}}]})}}if(e.options[0]?.ignoreIfReactCompilerIsEnabled){for(let m of e.sourceCode.getAllComments())if(di.test(m.value))return t=!0,{CallExpression:E=>h(E,!0)}}return{CallExpression:m=>h(m)}}};function Rt({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((T,h)=>{let m=c(o,h);m.isUsed=!0,a(o,h,E=>{E.isSubtreeUsed=!0})}),t.forEach(({key:T})=>{let h=c(o,T);h.isSatisfiedRecursively=!0}),r.forEach(T=>{let h=c(o,T);h.isSatisfiedRecursively=!0});function c(T,h){let m=h.split("."),E=T;for(let x of m){let d=E.children.get(x);d||(d=i(),E.children.set(x,d)),E=d}return E}function a(T,h,m){let E=h.split("."),x=T;for(let d of E){let b=x.children.get(d);if(!b)return;m(b),x=b}}let p=new Set,f=new Set;g(o,p,f,T=>T);function g(T,h,m,E){T.children.forEach((x,d)=>{let b=E(d);if(x.isSatisfiedRecursively){x.isSubtreeUsed&&m.add(b);return}if(x.isUsed){h.add(b);return}g(x,h,m,S=>b+"."+S)})}let l=[],u=new Set,y=new Set;return t.forEach(({key:T})=>{f.has(T)?l.indexOf(T)===-1?l.push(T):y.add(T):u.add(T)}),p.forEach(T=>{l.push(T)}),{suggestedDependencies:l,unnecessaryDependencies:u,duplicateDependencies:y,missingDependencies:p}}function De(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 De(e.consequent)!=null||De(e.alternate)!=null?"conditional":null;case"LogicalExpression":return De(e.left)!=null||De(e.right)!=null?"logical expression":null;case"JSXFragment":return"JSX fragment";case"JSXElement":return"JSX element";case"AssignmentExpression":return De(e.right)!=null?"assignment expression":null;case"NewExpression":return"object construction";case"Literal":return e.value instanceof RegExp?"regular expression":null;case"TypeCastExpression":return De(e.expression);case"TSAsExpression":return De(e.expression)}return null}function gi({declaredDependencies:e,declaredDependenciesNode:t,componentScope:r,scope:n}){let s=e.map(({key:i})=>{let c=r.variables.find(p=>p.name===i);if(c==null)return null;let a=c.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 p=De(a.node.init);if(p!=null)return[c,p]}return a.type==="FunctionName"&&a.node.type==="FunctionDeclaration"?[c,"function"]:a.type==="ClassName"&&a.node.type==="ClassDeclaration"?[c,"class"]:null}).filter(Boolean);function o(i){let c=!1;for(let a=0;a<i.references.length;a++){let p=i.references[a];if(p.writeExpr){if(c)return!0;c=!0;continue}let f=p.from;for(;f!==n&&f!=null;)f=f.upper;if(f!==n&&!Vn(t,p.identifier))return!0}return!1}return s.map(([i,c])=>({construction:i.defs[0],depType:c,isUsedOutsideOfHook:o(i)}))}function zn(e){return(e.parent.type==="MemberExpression"||e.parent.type==="OptionalMemberExpression")&&e.parent.object===e&&e.parent.property.name!=="current"&&!e.parent.computed&&!(e.parent.parent!=null&&(e.parent.parent.type==="CallExpression"||e.parent.parent.type==="OptionalCallExpression")&&e.parent.parent.callee===e.parent)?zn(e.parent):e.type==="MemberExpression"&&e.parent&&e.parent.type==="AssignmentExpression"&&e.parent.left===e?e.object:e}function wt(e,t,r){t&&(e.optional?t.has(r)||t.set(r,!0):t.has(r)||t.set(r,!1))}function we(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=we(e.object,t),n=we(e.property,null),s=`${r}.${n}`;return wt(e,t,s),s}else if(e.type==="OptionalMemberExpression"&&!e.computed){let r=we(e.object,t),n=we(e.property,null),s=`${r}.${n}`;return wt(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=we(r.object,t),s=we(r.property,null),o=`${n}.${s}`;return wt(r,t,o),o}else throw new Error(`Unsupported node type: ${e.type}`)}function Jn(e,t){return e.type==="MemberExpression"&&e.object.type==="Identifier"&&e.object.name==="React"&&e.property.type==="Identifier"&&!e.computed?e.property:e}function Si(e,t){let r=Jn(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=we(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 vt(e,t){let r=[e],n=null;for(;r.length;){if(n=r.shift(),hi(n,t))return n;if(Vn(n,t))for(let[s,o]of Object.entries(n))s!=="parent"&&(Un(o)?(o.parent=n,r.push(o)):Array.isArray(o)&&o.forEach(i=>{Un(i)&&(i.parent=n,r.push(i))}))}return null}function Ti(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 Un(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&typeof e.type=="string"}function hi(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 Vn(e,t){return e.range[0]<=t.range[0]&&e.range[1]>=t.range[1]}function Ei(e){return!1}var K=require("@typescript-eslint/utils"),re=he(require("typescript")),Yn=require("zod/v4");var kt=require("@typescript-eslint/utils");function Ve(e,t,r=1/0){if(r!==0&&e.parent)return e.type===t?e:Ve(e.parent,t,r===1/0?r:r-1)}function*Ft(e){yield e,e.parent&&(yield*Ft(e.parent))}function Pt(e,t){for(let r of e){let n=t(r);if(n!=null&&n!==!1)return n}}function Hn(e,t,r){let s=r.getDeclaredVariables(e).find(o=>o.name===t||o.identifiers[0]?.parent.type===kt.AST_NODE_TYPES.Property&&o.identifiers[0].parent.key.type===kt.AST_NODE_TYPES.Identifier&&o.identifiers[0].parent.key.name===t);return s?s.references.filter(o=>!o.init):[]}function Xn(e){return e===null||typeof e!="object"||!("type"in e)?!1:typeof e.type=="string"}function bi(e,t){return e[t]}function Le(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 p of a){let f=bi(i,p);if(f){if(Array.isArray(f)){for(let g of f)if(Xn(g)&&o(g))return!0}else if(Xn(f)&&o(f))return!0}}return!1}o(e)}var xi=K.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),Bn="improved-no-unnecessary-condition",Ci=Yn.z.object({}),Ai=["string","number","bigint","boolean","symbol","undefined","object","function","never"],Ii=new Set(Ai),Ot={name:Bn,rule:xi({name:Bn,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:[j(Ci)]},defaultOptions:[{}],create(e){let t=K.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===K.AST_NODE_TYPES.UnaryExpression&&l.operator==="typeof"}function s(l){return l.flags&re.default.TypeFlags.Any||l.flags&re.default.TypeFlags.Unknown?null:l.flags&re.default.TypeFlags.StringLike?["string"]:l.flags&re.default.TypeFlags.NumberLike?["number"]:l.flags&re.default.TypeFlags.BigIntLike?["bigint"]:l.flags&re.default.TypeFlags.BooleanLike?["boolean"]:l.flags&re.default.TypeFlags.ESSymbolLike?["symbol"]:l.flags&re.default.TypeFlags.Undefined||l.flags&re.default.TypeFlags.Void?["undefined"]:l.flags&re.default.TypeFlags.Null?["object"]:l.getCallSignatures().length>0?["function"]:l.flags&re.default.TypeFlags.Object?l.getProperties().length===0?["string","number","bigint","boolean","symbol","object","function"]:["object"]:l.flags&re.default.TypeFlags.NonPrimitive?["object"]:l.flags&re.default.TypeFlags.Never?["never"]:null}function o(l){if(!r)return null;let u=t.esTreeNodeToTSNodeMap.get(l),y=r.getTypeAtLocation(u.expression);if(y.flags&re.default.TypeFlags.Any||y.flags&re.default.TypeFlags.Unknown)return null;let T=[];if(y.isUnion()){for(let m of y.types){let E=s(m);if(E)T.push(...E);else return null}return T}let h=s(y);return h?(T.push(...h),T):null}function i(l){if(!(l.operator==="==="||l.operator==="!=="))return;let y=null,T=null;if(n(l.left)?(y=l.left,T=l.right.type===K.AST_NODE_TYPES.Literal&&typeof l.right.value=="string"?l.right.value:null):n(l.right)&&(y=l.right,T=l.left.type===K.AST_NODE_TYPES.Literal&&typeof l.left.value=="string"?l.left.value:null),!y||!T||!Ri(T,Ii))return;let h=o(y);if(!h)return;let m=l.operator==="!==",E=h.includes(T);h.length===1?E&&!m?e.report({node:l,messageId:"unnecessaryTypeofCondition",data:{name:Xe(y,e),type:T}}):!E&&m?e.report({node:l,messageId:"unnecessaryTypeofCondition",data:{name:Xe(y,e),type:Array.from(h)[0]}}):!E&&!m?e.report({node:l,messageId:"alwaysFalseTypeofCondition",data:{name:Xe(y,e),actualType:at(h),conditionType:T}}):E&&m&&e.report({node:l,messageId:"alwaysFalseTypeofCondition",data:{name:Xe(y,e),actualType:at(h),conditionType:T}}):!E&&!m?e.report({node:l,messageId:"alwaysFalseTypeofCondition",data:{name:Xe(y,e),actualType:at(h),conditionType:T}}):!E&&m&&e.report({node:l,messageId:"unnecessaryTypeofCondition",data:{name:Xe(y,e),type:at(h)}})}function c(l){if(l.flags&re.default.TypeFlags.Any||l.flags&re.default.TypeFlags.Unknown)return null;if(l.isUnion()){let u=[];for(let y of l.types)if(y.flags&re.default.TypeFlags.StringLiteral){let T=y.value;u.push(T)}else return null;return u}return l.flags&re.default.TypeFlags.StringLiteral?[l.value]:null}function a(l){if(!r)return null;let u=t.esTreeNodeToTSNodeMap.get(l),y=r.getTypeAtLocation(u),T=c(y);if(T)return T;let h=r.getSymbolAtLocation(u);if(h){let m=r.getTypeOfSymbolAtLocation(h,u),E=c(m);if(E)return E}return null}function p(l){let u=e.sourceCode.ast,y=null;return Le(u,T=>{if(T.type===K.AST_NODE_TYPES.VariableDeclarator&&T.id.type===K.AST_NODE_TYPES.Identifier&&T.id.name===l.name&&T.id.typeAnnotation){let h=T.id.typeAnnotation.typeAnnotation;if(h.type===K.AST_NODE_TYPES.TSUnionType){let m=[];for(let E of h.types)if(E.type===K.AST_NODE_TYPES.TSLiteralType&&E.literal.type===K.AST_NODE_TYPES.Literal&&typeof E.literal.value=="string")m.push(E.literal.value);else return!0;return y=m,!0}if(h.type===K.AST_NODE_TYPES.TSLiteralType&&h.literal.type===K.AST_NODE_TYPES.Literal&&typeof h.literal.value=="string")return y=[h.literal.value],!0}return!1},e.sourceCode),y}function f(l){if(l.callee.type!==K.AST_NODE_TYPES.MemberExpression||l.callee.property.type!==K.AST_NODE_TYPES.Identifier||l.callee.computed)return;let u=l.callee.property.name;if(u!=="startsWith"&&u!=="endsWith"&&u!=="includes"||l.arguments.length!==1)return;let[y]=l.arguments;if(!y||y.type!==K.AST_NODE_TYPES.Literal||typeof y.value!="string")return;let T=l.callee.object,h=a(T);if(!h&&T.type===K.AST_NODE_TYPES.Identifier&&(h=p(T)),!h||h.length===0)return;let m=y.value;if(u==="includes"&&h.length>1)return;let E=0,x=0;for(let d of h)if((u==="startsWith"?d.startsWith(m):u==="endsWith"?d.endsWith(m):d.includes(m))?E++:x++,E>0&&x>0)return;if(E>0&&x===0){let d=u==="startsWith"?"unnecessaryStartsWithCondition":u==="endsWith"?"unnecessaryEndsWithCondition":"unnecessaryIncludesCondition";e.report({node:l,messageId:d})}else if(x>0&&E===0){let d=u==="startsWith"?"alwaysFalseStartsWithCondition":u==="endsWith"?"alwaysFalseEndsWithCondition":"alwaysFalseIncludesCondition";e.report({node:l,messageId:d})}}function g(l){if(!new Set(["===","!==",">",">=","<","<="]).has(l.operator))return;function y(b){if(b.type!==K.AST_NODE_TYPES.MemberExpression||b.computed||b.property.type!==K.AST_NODE_TYPES.Identifier||b.property.name!=="length")return null;let S=b.object,C=a(S);if(!C||C.length===0)return null;let w=[];for(let I of C)w.push(I.length);return{values:w}}let T=y(l.left),h=y(l.right),m=null,E=null;if(T?l.right.type===K.AST_NODE_TYPES.Literal&&typeof l.right.value=="number"&&(m=T.values,E=l.right.value):h&&l.left.type===K.AST_NODE_TYPES.Literal&&typeof l.left.value=="number"&&(m=h.values,E=l.left.value),!m||E===null)return;let x=0,d=0;for(let b of m){let S=!1;if(l.operator==="==="?S=b===E:l.operator==="!=="?S=b!==E:l.operator===">"?S=b>E:l.operator===">="?S=b>=E:l.operator==="<"?S=b<E:l.operator==="<="&&(S=b<=E),S?x++:d++,x>0&&d>0)return}x>0&&d===0?e.report({node:l,messageId:"unnecessaryLengthCondition"}):d>0&&x===0&&e.report({node:l,messageId:"alwaysFalseLengthCondition"})}return{BinaryExpression(l){i(l),g(l)},CallExpression:f}}})};function at(e){return Array.from(new Set(e)).join(" | ")||"never"}function Xe(e,t){let r=e.argument;return r.type===K.AST_NODE_TYPES.Identifier?r.name:t.sourceCode.getText(r)}function Ri(e,t){return t.has(e)}var pt=require("@typescript-eslint/utils"),lt=require("zod/v4");var wi=pt.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),qn="no-call-with-explicit-generics",vi=lt.z.object({functions:lt.z.array(lt.z.string())}),ki=wi({name:qn,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:[j(vi)]},defaultOptions:[{functions:[]}],create(e,[t]){let r=new Set(t.functions);return{CallExpression(n){let{callee:s}=n;s.type===pt.AST_NODE_TYPES.Identifier&&r.has(s.name)&&n.typeArguments&&e.report({node:n,messageId:"noExplicitGenerics",data:{functionName:s.name}})}}}}),Nt={name:qn,rule:ki};var $e=require("@typescript-eslint/utils"),Fi=$e.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),Zn="no-call-with-inferred-generics",Pi=Fi({name:Zn,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!==$e.AST_NODE_TYPES.Identifier)return;let o=r.get(s.name);if(!o)return;let{minGenerics:i=1,allowAny:c,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}}),!(c&&!a)&&n.typeArguments?.params.some(f=>!c&&f.type===$e.AST_NODE_TYPES.TSAnyKeyword||a&&f.type===$e.AST_NODE_TYPES.TSTypeReference&&f.typeName.type===$e.AST_NODE_TYPES.Identifier&&a.includes(f.typeName.name))&&e.report({node:n,messageId:"anyUsedInGenerics",data:{functionName:s.name}})}}}}),Dt={name:Zn,rule:Pi};var Qn=require("@typescript-eslint/utils"),Oi=Qn.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),er="no-commented-out-code",Ni=["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:"],Di=/^\s*return\s+/,Li=/\w=("|'|`)/,ji=/\w+:\s*('|"|`)/,Mi=/\[['"][^'"]*['"]\]:\s*('|"|`|[^'"`\s])/,_i=/\w+-\w+:/,$i=/\w+_\w+:/,Ui=/\?\s+\w/,Wi=/:\s+\w/,zi=/^\s*('|"|`)[^'"]*('|"|`),?\s*$/,Ji=/^\s*\d+[,}]/,Vi=/^\s*\[[^\]]*\][,}]/,Xi=/^\s*\{[^}]*\}[,}]/,Hi=/\.\w+\(/,Bi=/\[\w+\]/,Yi=/^\s*(['"`]).+?\1\s*:/,qi=/^<[A-Z]\w*(\s|>|\/)/,Zi=/^<[a-z]+(\s|>|\/)/,Gi=/<[A-Z]\w*(\s.*)?>/,Ki=/<\/[A-Z]\w*>/,Qi=/<[a-z]+(\s.*)?>/,es=/<\/[a-z]+>/,ts=/^\s*[*\s]*$/,ns=/^[a-zA-Z]/,rs=/^[A-Z][A-Za-z]*(?:\s+\d+)?(?:\s+[a-z]+)*:\s+[A-Za-z]/,is=/```[\s\S]*?```/g,ss=/`[^`]*`/g,Gn=/[a-zA-Z0-9]/,os=/\.[A-Za-z_][A-Za-z0-9_]*\(/,as=/[{}[\]()`=<>]/,ls=/:\s*(['"`[{(]|\w+\s*=>)/,ps=/\bif\s*\(|\belse\b|=>/,ee={returnStatement:Di,stringAssignment:Li,objectPropertyWithQuotes:ji,computedPropertyAssignment:Mi,kebabCaseProperty:_i,snakeCaseProperty:$i,ternaryOperator:Ui,colonWithWord:Wi,quotedString:zi,numberWithComma:Ji,arrayWithComma:Vi,objectWithComma:Xi,methodCall:Hi,arrayAccess:Bi,quotedPropertyKey:Yi,jsxSelfClosing:qi,jsxElement:Zi,jsxOpeningTag:Gi,jsxClosingTag:Ki,htmlOpeningTag:Qi,htmlClosingTag:es,jsdocComment:ts};function cs(e){if(e.includes(":")){let r=e.split(":")[0]?.trim();if(r&&ns.test(r)&&r.includes(" "))return!0}let t=e.trim();return t.length===0||os.test(t)||as.test(t)||ls.test(t)||ps.test(t)?!1:!!(t.includes(":")&&rs.test(t))}var us=[") {","return;",ee.returnStatement,"if (","else {","else if (","/>","</","< ","},",": {"," } = ","={",ee.stringAssignment,");",ee.objectPropertyWithQuotes,ee.computedPropertyAssignment,ee.kebabCaseProperty,ee.snakeCaseProperty,"&&","||","()",ee.ternaryOperator,ee.colonWithWord,ee.quotedString,ee.numberWithComma,ee.arrayWithComma,ee.objectWithComma,ee.methodCall,ee.arrayAccess,"?.(","??","=>",ee.quotedPropertyKey],fs=["/>","</",ee.jsxSelfClosing,ee.jsxElement,ee.jsxOpeningTag,ee.jsxClosingTag,ee.htmlOpeningTag,ee.htmlClosingTag],Kn=["INFO:","TODO:","DOCS:","FIX:","FIXME:","HACK:","NOTE:","WARNING:","WARN:","BUG:","ISSUE:","TEMP:","TEMPORARY:","XXX:","REVIEW:","eslint"],ms=Oi({name:er,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")||ee.jsdocComment.test(n))return!1;for(let i of Kn)if(o.startsWith(i))return!1;if(n.includes("https://")||cs(o))return!1;if(s==="Block"){for(let i of fs)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 Ni)if(o.startsWith(i))return{wrongPattern:i};for(let i of us)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 p=o.split(is);p.some(g=>Gn.test(g))&&(o=p.join(""))}if(!o.includes("`"))return o;let c=o.split(ss);return c.some(p=>Gn.test(p))?c.join(""):o}return{Program(){let s=e.sourceCode.getAllComments();for(let o of s){let i=r(o.value,o.type),c=t(i,o.type);c&&e.report({node:o,messageId:"commentedOutCode",data:{wrongPattern:c.wrongPattern,allowedPrefixes:Kn.join(", ")}})}}}}}),Lt={name:er,rule:ms};var ct=require("@typescript-eslint/utils"),ys=ct.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),tr="no-default-export",ds=ys({name:tr,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===ct.TSESTree.AST_NODE_TYPES.Identifier&&r.exported.name==="default"&&e.report({node:t,messageId:"noDefaultExport"})}}}}),jt={name:tr,rule:ds};var nr=require("@typescript-eslint/utils"),gs=nr.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),rr="no-leaked-text-in-jsx",Ss=[",",";","[","]","(",")"],Ts=gs({name:rr,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="";Ss.includes(r)?n=r:r.includes("&&")?n="&&":r.includes("||")?n="||":r.endsWith("? (")&&(n="? ("),n&&e.report({node:t,messageId:"leakedTextInJSX",data:{text:n}})}}}}),Mt={name:rr,rule:Ts};var je=require("@typescript-eslint/utils"),hs=je.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),sr="no-non-camel-case-functions",Es=/^(\$?[a-z][a-zA-Z0-9]*)$/;function ir(e){if(e.typeName.type!==je.AST_NODE_TYPES.TSQualifiedName)return!1;let{left:t,right:r}=e.typeName;return t.type===je.AST_NODE_TYPES.Identifier&&t.name==="JSX"&&r.name==="Element"}var bs=hs({name:sr,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&&!Es.test(t.id.name)){let r=t.returnType?.typeAnnotation;if(r&&(r.type===je.AST_NODE_TYPES.TSTypeReference?ir(r):r.type===je.AST_NODE_TYPES.TSUnionType&&r.types.some(s=>s.type===je.AST_NODE_TYPES.TSTypeReference&&ir(s))))return;e.report({node:t.id,messageId:"nonCamelCaseFunction",data:{functionName:t.id.name}})}}}}}),_t={name:sr,rule:bs};var B=require("@typescript-eslint/utils");var xs=B.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),or="no-optional-root-props",Cs=xs({name:or,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 c of Ft(i.identifier)){if("returnType"in c||c.type===B.TSESTree.AST_NODE_TYPES.ExportNamedDeclaration)return!1;let a=c.parent;if(!a)return!1;if(a.type===B.TSESTree.AST_NODE_TYPES.TSTypeParameterInstantiation&&a.parent.type===B.TSESTree.AST_NODE_TYPES.TSTypeReference&&a.parent.typeName.type===B.TSESTree.AST_NODE_TYPES.Identifier&&a.parent.typeName.name==="FC"){let f=Ve(a.parent.parent,B.TSESTree.AST_NODE_TYPES.VariableDeclaration,4);if(!f)return!1;let g=ut(f,e.sourceCode);return g?!(g.parent.type===B.TSESTree.AST_NODE_TYPES.CallExpression&&g.parent.callee.type===B.TSESTree.AST_NODE_TYPES.Identifier&&g.parent.callee.name==="memo"):!1}if(c.type===B.TSESTree.AST_NODE_TYPES.AssignmentPattern)return!1;if(a.type===B.TSESTree.AST_NODE_TYPES.ArrowFunctionExpression){let p=Ve(a,B.TSESTree.AST_NODE_TYPES.VariableDeclaration);return p?!!ut(p,e.sourceCode):!1}if(a.type===B.TSESTree.AST_NODE_TYPES.FunctionDeclaration)return!!ut(a,e.sourceCode)}return!1}function r(n){n.key.type!==B.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=Ve(n,B.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===B.TSESTree.AST_NODE_TYPES.TSTypeLiteral&&!(ft(n)||!t(n)))for(let s of n.typeAnnotation.members)s.type===B.TSESTree.AST_NODE_TYPES.TSPropertySignature&&r(s)},TSInterfaceDeclaration(n){if(!(ft(n)||!t(n)))for(let s of n.body.body)s.type===B.TSESTree.AST_NODE_TYPES.TSPropertySignature&&r(s)},TSTypeReference(n){if(n.typeName.type!==B.TSESTree.AST_NODE_TYPES.Identifier||n.typeName.name!=="FC"||!n.typeArguments?.params[0])return;let s=n.typeArguments.params[0];if(s.type!==B.TSESTree.AST_NODE_TYPES.TSTypeLiteral)return;let o=Ve(n.parent,B.TSESTree.AST_NODE_TYPES.VariableDeclaration,4);if(!o)return;let i=ut(o,e.sourceCode);if(!(!i||i.parent.type===B.TSESTree.AST_NODE_TYPES.CallExpression&&i.parent.callee.type===B.TSESTree.AST_NODE_TYPES.Identifier&&i.parent.callee.name==="memo"))for(let a of s.members)a.type===B.TSESTree.AST_NODE_TYPES.TSPropertySignature&&r(a)}}}});function ft(e){return e?e.parent?.type===B.TSESTree.AST_NODE_TYPES.ExportNamedDeclaration||e.parent?.type===B.TSESTree.AST_NODE_TYPES.ExportDefaultDeclaration:!1}function ut(e,t){if(ft(e))return;let r;if(e.type===B.TSESTree.AST_NODE_TYPES.VariableDeclaration){if(e.declarations.length!==1)return;e.declarations[0].id.type===B.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===B.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])&&!ft(o[0].identifier.parent.parent))return o[0].identifier}var $t={name:or,rule:Cs};var Ge=require("@typescript-eslint/utils");var Ke=M({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===Ge.AST_NODE_TYPES.Identifier?t.has(n.name):n.type===Ge.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===Ge.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===Ge.AST_NODE_TYPES.Identifier&&t.has(n.declaration.name)&&e.report({node:n,messageId:"noReexport"})},ExportAllDeclaration(n){e.report({node:n,messageId:"noReexport"})}}}});var ar=require("@typescript-eslint/utils"),mt=he(require("path")),ve=require("zod/v4");var As=ar.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),lr="no-relative-imports",Is=ve.z.object({find:ve.z.string(),replacement:ve.z.string()}),Rs=ve.z.object({aliases:ve.z.array(Is),rootDir:ve.z.string().optional(),allowNotFoundAliases:ve.z.boolean().optional(),_dev_simulateFileName:ve.z.string().optional()}),ws=As({name:lr,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:[j(Rs)]},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,c){let a=mt.default.dirname(c);return mt.default.resolve(a,i)}function o(i){let c=t.rootDir??process.cwd(),a=mt.default.relative(c,i);if(a.startsWith("."))return null;a.startsWith("/")||(a=`/${a}`);for(let{find:p,replacement:f}of t.aliases)if(a.startsWith(f)){let g=a.replace(f,p);return{alias:p,newPath:g}}return null}return{ImportDeclaration(i){let c=i.source.value;if(!n(c))return;let a=s(c,r),p=o(a);!p&&t.allowNotFoundAliases||e.report({node:i,messageId:p?"noRelativeImportsWithAlias":"noRelativeImports",data:{alias:p?.alias},fix:p?f=>f.replaceText(i.source,`'${p.newPath}'`):void 0})}}}}),Ut={name:lr,rule:ws};var te=require("@typescript-eslint/utils"),Wt=require("zod/v4");var vs=Wt.z.object({customMessage:Wt.z.string().optional()}),zt=M({name:"no-static-style-prop",meta:{type:"problem",docs:{description:"Prevent using static style props in JSX, only dynamic values should be allowed"},schema:[j(vs)],messages:{noStaticStyleProp:"Static style props are not allowed use css instead.{{customMessage}}"}},defaultOptions:[{}],create(e,[t]){function r(n){switch(n.type){case te.AST_NODE_TYPES.Literal:return!0;case te.AST_NODE_TYPES.ObjectExpression:return n.properties.every(s=>s.type===te.AST_NODE_TYPES.Property?s.computed||s.value.type===te.AST_NODE_TYPES.Identifier&&s.key.type===te.AST_NODE_TYPES.Identifier&&s.key.name===s.value.name?!1:r(s.value):!1);case te.AST_NODE_TYPES.ArrayExpression:return n.elements.every(s=>s?s.type===te.AST_NODE_TYPES.SpreadElement?!1:r(s):!0);case te.AST_NODE_TYPES.TemplateLiteral:return n.expressions.length===0;case te.AST_NODE_TYPES.ConditionalExpression:case te.AST_NODE_TYPES.LogicalExpression:case te.AST_NODE_TYPES.BinaryExpression:case te.AST_NODE_TYPES.UnaryExpression:case te.AST_NODE_TYPES.CallExpression:case te.AST_NODE_TYPES.MemberExpression:case te.AST_NODE_TYPES.Identifier:case te.AST_NODE_TYPES.ArrowFunctionExpression:case te.AST_NODE_TYPES.FunctionExpression:return!1;default:return!1}}return{JSXAttribute(n){if(n.name.type===te.AST_NODE_TYPES.JSXIdentifier&&n.name.name==="style"&&n.value){let s=null;n.value.type===te.AST_NODE_TYPES.JSXExpressionContainer?n.value.expression.type!==te.AST_NODE_TYPES.JSXEmptyExpression&&(s=n.value.expression):n.value.type===te.AST_NODE_TYPES.Literal&&(s=n.value),s&&r(s)&&e.report({node:n,messageId:"noStaticStyleProp",data:{customMessage:t.customMessage?` ${t.customMessage}`:""}})}}}}});var Qe=require("@typescript-eslint/utils"),Ue=he(require("zod/v4"));var ks=Ue.object({alternativeMsgs:Ue.object({inArrayFind:Ue.string().optional(),inArrayFilter:Ue.string().optional()}).optional(),__dev_simulateFileName:Ue.string().optional()});function Fs(e){return e.typeAnnotation.type!==Qe.AST_NODE_TYPES.TSTypePredicate?!1:e.typeAnnotation.asserts===!1}var Ps=/(typeGuards|type-guards)\.(ts|tsx)$/;function Os(e){return Ps.test(e)}function Ns(e){let t=e.parent;for(;t;){if(t.type===Qe.AST_NODE_TYPES.CallExpression&&t.callee.type===Qe.AST_NODE_TYPES.MemberExpression&&t.callee.property.type===Qe.AST_NODE_TYPES.Identifier){let r=t.callee.property.name;if(r==="filter"||r==="find")return{method:r}}t=t.parent}return null}var Jt=M({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:[j(ks)],hasSuggestions:!0},defaultOptions:[{}],create(e,[t]){let r=t.__dev_simulateFileName??e.filename;if(Os(r))return{};function n(s){if(!Fs(s))return;let o=Ns(s);if(t.alternativeMsgs&&o){let i=o.method==="filter"?t.alternativeMsgs.inArrayFilter:t.alternativeMsgs.inArrayFind;if(i){let c=o.method==="filter"?"useFilterWithTypeCheck":"useFindWithTypeCheck";e.report({node:s,messageId:c,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 We=require("@typescript-eslint/utils");var Ds="no-unnecessary-async-on-jsx-props";function Ls(e){if(e.body.type!==We.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!==We.AST_NODE_TYPES.ExpressionStatement?!1:r.expression.type===We.AST_NODE_TYPES.AwaitExpression}var Vt=M({name:Ds,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){Ls(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 c(a){if(a.type===We.AST_NODE_TYPES.AwaitExpression){let p=s.getFirstToken(a);if(p&&p.value==="await"){let f=s.getTokenAfter(p);f?o.push(n.replaceTextRange([p.range[0],f.range[0]],"")):o.push(n.remove(p))}}if(a.type===We.AST_NODE_TYPES.BlockStatement)for(let p of a.body)c(p);else a.type===We.AST_NODE_TYPES.ExpressionStatement&&c(a.expression)}return c(r.body),o}})}return{"JSXAttribute ArrowFunctionExpression[async=true]":t,"JSXAttribute FunctionExpression[async=true]":t}}});var ke=require("@typescript-eslint/utils"),Xt=he(require("typescript")),He=he(require("zod/v4"));var js=ke.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),pr="no-unnecessary-casting",Ms=He.default.object({additionalCastFunctions:He.default.array(He.default.object({name:He.default.string(),expectedType:He.default.enum(["string","number"])})).optional()}),Ht={name:pr,rule:js({name:pr,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:[j(Ms)],fixable:"code"},defaultOptions:[{}],create(e){let r=e.options[0].additionalCastFunctions||[],n=[{name:"Number",expectedType:"number"},{name:"String",expectedType:"string"},...r],s=ke.ESLintUtils.getParserServices(e,!0),o=s.program?.getTypeChecker();if(!o||!s.program)throw new Error("TypeScript services or program not available");function i(f,g){switch(f.type){case ke.AST_NODE_TYPES.Literal:return g==="number"?typeof f.value=="number":typeof f.value=="string";case ke.AST_NODE_TYPES.TemplateLiteral:return g==="string";case ke.AST_NODE_TYPES.UnaryExpression:return g==="number"?f.operator==="+"||f.operator==="-"||f.operator==="~":!1;default:return!1}}function c(f,g){return g==="number"?!!(f.flags&Xt.TypeFlags.NumberLike):!!(f.flags&Xt.TypeFlags.StringLike)}function a(f,g){return l=>l.replaceText(f,e.sourceCode.getText(g))}function p(f){if(!o||f.arguments.length!==1)return;let g=f.arguments[0];if(!g||g.type===ke.AST_NODE_TYPES.SpreadElement)return;let{callee:l}=f;if(l.type!==ke.AST_NODE_TYPES.Identifier)return;let u=l.name,y=n.find(h=>h.name===u);if(!y)return;if(i(g,y.expectedType)||c(o.getTypeAtLocation(s.esTreeNodeToTSNodeMap.get(g)),y.expectedType)){let h,m;u==="Number"?h="unnecessaryNumberCasting":u==="String"?h="unnecessaryStringCasting":(h="unnecessaryCustomCasting",m={name:y.name,type:y.expectedType}),e.report({node:f,messageId:h,...m?{data:m}:{},fix:a(f,g)})}}return{CallExpression:p}}})};var ye=require("@typescript-eslint/utils"),yt=he(require("zod/v4"));var _s=yt.object({ignoreWithDescription:yt.string().optional()}),Bt=M({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:[j(_s)]},defaultOptions:[{}],create(e,[t]){let r=e.getSourceCode(),n=r.ast;function s(a){let p=a.arguments[0];return p&&p.type===ye.AST_NODE_TYPES.Literal&&typeof p.value=="string"?p.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(f=>{if(f.type===ye.AST_NODE_TYPES.ExpressionStatement){let g=f.expression;if(g.type===ye.AST_NODE_TYPES.CallExpression&&g.callee.type===ye.AST_NODE_TYPES.Identifier){let l=g.callee.name;return["test","it","beforeEach","afterEach","beforeAll","afterAll"].includes(l)}}return!1}).length===0}function c(a){let p=a.arguments[1];if(p&&(p.type===ye.AST_NODE_TYPES.FunctionExpression||p.type===ye.AST_NODE_TYPES.ArrowFunctionExpression)&&p.body.type===ye.AST_NODE_TYPES.BlockStatement){let f=p.body.body;return f.length===0?"":f.map(l=>r.text.slice(l.range[0],l.range[1])).join(`
16
16
 
17
- `)}return""}return{Program(){let a=[];for(let l of t.body)l.type===me.AST_NODE_TYPES.ExpressionStatement&&l.expression.type===me.AST_NODE_TYPES.CallExpression&&l.expression.callee.type===me.AST_NODE_TYPES.Identifier&&l.expression.callee.name==="describe"&&l.expression.arguments.length===2&&a.push(l.expression);if(!i(a))return;let[p]=a;if(!p)return;let m=s(p);if(o(m))return;let g=t.body.find(l=>l.type===me.AST_NODE_TYPES.ExpressionStatement&&l.expression===p);!g||g.type!==me.AST_NODE_TYPES.ExpressionStatement||e.report({node:p,messageId:"unnecessaryDescribe",suggest:[{messageId:"removeDescribe",fix(l){let u=c(p);return u?l.replaceText(g,u):null}}]})}}}});var Ke=require("@typescript-eslint/utils"),be=Te(require("zod/v4"));var Ds=be.object({methods:be.union([be.array(be.string()),be.literal("array")])}),Ht=U({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:[j(Ds)]},defaultOptions:[{methods:"array"}],create(e,[n]){let r=n.methods,t=new Set(["find","filter","map","forEach","some","every","reduce","findIndex","sort"]);function s(c){return Array.isArray(r)?r.includes(c):t.has(c)}function o(c){let{callee:a}=c;if(a.type===Ke.AST_NODE_TYPES.MemberExpression){let p=a.property;if(p.type===Ke.AST_NODE_TYPES.Identifier)return p.name}return null}function i(c,a){if(c.type!==Ke.AST_NODE_TYPES.Identifier||!c.typeAnnotation)return;let p=a.parent;if(p.type===Ke.AST_NODE_TYPES.CallExpression){let m=o(p);m&&s(m)&&p.arguments.indexOf(a)===0&&e.report({node:c.typeAnnotation,messageId:"unnecessaryTypeAnnotation",fix(l){return c.typeAnnotation?l.remove(c.typeAnnotation):null}})}}return{ArrowFunctionExpression(c){for(let a of c.params)i(a,c)},FunctionExpression(c){for(let a of c.params)i(a,c)}}}});var fe=require("@typescript-eslint/utils");var Bt=U({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(n){if(n.id.type===fe.AST_NODE_TYPES.ObjectPattern||!n.init||n.init.type!==fe.AST_NODE_TYPES.ObjectExpression||n.id.type===fe.AST_NODE_TYPES.Identifier&&n.id.typeAnnotation||n.parent.parent.type===fe.AST_NODE_TYPES.ExportNamedDeclaration)return;let r=new Map;for(let i of n.init.properties)i.type===fe.AST_NODE_TYPES.Property&&i.key.type===fe.AST_NODE_TYPES.Identifier&&r.set(i.key.name,i);if(r.size===0||n.id.type!==fe.AST_NODE_TYPES.Identifier)return;let t=Ls(n,e.sourceCode);if(t.length===0)return;let s=n.init.properties.some(i=>i.type!==fe.AST_NODE_TYPES.Property?!1:i.value.type===fe.AST_NODE_TYPES.FunctionExpression),o=new Set;for(let i of t){if(i.identifier.parent.type!==fe.AST_NODE_TYPES.MemberExpression)return;let c=i.identifier.parent;if(c.object!==i.identifier)return;if(c.computed)if(c.property.type===fe.AST_NODE_TYPES.Literal&&typeof c.property.value=="string")o.add(c.property.value);else return;else{if(c.property.type!==fe.AST_NODE_TYPES.Identifier)return;o.add(c.property.name)}if(c.parent.type===fe.AST_NODE_TYPES.CallExpression&&s)return}for(let[i,c]of r)o.has(i)||e.report({node:c,messageId:"unusedObjectProperty",data:{name:i}})}}}});function Ls(e,n){let r=n.getDeclaredVariables(e);if(r.length!==1)return[];let t=r[0];return t?t.references.filter(s=>s.identifier!==e.id):[]}var z=require("@typescript-eslint/utils"),Yt=require("zod/v4");var js=Yt.z.object({ignoreArgsMatching:Yt.z.string().optional()}),qt=U({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:[j(js)]},defaultOptions:[{}],create(e,[n]){let r=[];function t(i){return n.ignoreArgsMatching?new RegExp(n.ignoreArgsMatching).test(i):!1}function s(i){return i.type===z.AST_NODE_TYPES.ExportNamedDeclaration||i.type===z.AST_NODE_TYPES.ExportDefaultDeclaration||i.parent?.type===z.AST_NODE_TYPES.ExportNamedDeclaration||i.parent?.type===z.AST_NODE_TYPES.ExportDefaultDeclaration}function o(i){let c=[];for(let a=0;a<i.length;a++){let p=i[a];if(!p||p.type!==z.AST_NODE_TYPES.Identifier)continue;let m=p.name;if(!t(m)){if(p.optional&&p.typeAnnotation&&p.typeAnnotation.typeAnnotation.type===z.AST_NODE_TYPES.TSTypeLiteral){let g=p.typeAnnotation.typeAnnotation,l=[];for(let u of g.members)u.type===z.AST_NODE_TYPES.TSPropertySignature&&u.key.type===z.AST_NODE_TYPES.Identifier&&l.push({name:u.key.name,optional:u.optional===!0});l.some(u=>u.optional)?c.push({param:p,index:a,name:m,isObjectParam:!0,objectProps:l}):c.push({param:p,index:a,name:m,isObjectParam:!1})}else if(p.optional)c.push({param:p,index:a,name:m,isObjectParam:!1});else if(p.typeAnnotation&&p.typeAnnotation.typeAnnotation.type===z.AST_NODE_TYPES.TSTypeLiteral){let g=p.typeAnnotation.typeAnnotation,l=[];for(let u of g.members)u.type===z.AST_NODE_TYPES.TSPropertySignature&&u.key.type===z.AST_NODE_TYPES.Identifier&&l.push({name:u.key.name,optional:u.optional===!0});l.some(u=>u.optional)&&c.push({param:p,index:a,name:m,isObjectParam:!0,objectProps:l})}}}return c}return{FunctionDeclaration(i){if(s(i))return;let c=o(i.params);c.length!==0&&r.push({node:i,declarationNode:i,optionalParams:c})},VariableDeclarator(i){if(i.id.type!==z.AST_NODE_TYPES.Identifier||!i.init||i.init.type!==z.AST_NODE_TYPES.ArrowFunctionExpression&&i.init.type!==z.AST_NODE_TYPES.FunctionExpression||s(i.parent.parent))return;let a=[...o(i.init.params)];if(i.id.typeAnnotation&&i.id.typeAnnotation.typeAnnotation.type===z.AST_NODE_TYPES.TSTypeReference){let p=i.id.typeAnnotation.typeAnnotation;if(p.typeName.type===z.AST_NODE_TYPES.Identifier&&p.typeName.name==="FC"){let m=p.typeArguments;if(m&&m.params.length===1){let g=m.params[0];if(g&&g.type===z.AST_NODE_TYPES.TSTypeLiteral){let l=[];for(let u of g.members)u.type===z.AST_NODE_TYPES.TSPropertySignature&&u.key.type===z.AST_NODE_TYPES.Identifier&&l.push({name:u.key.name,optional:u.optional===!0});l.some(u=>u.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 p=a.references.filter(l=>l.identifier!==a.identifiers[0]);if(p.length===0)continue;let m=!1;for(let l of p){let u=l.identifier.parent;if(u.type===z.AST_NODE_TYPES.CallExpression&&l.identifier.type===z.AST_NODE_TYPES.Identifier&&u.arguments.includes(l.identifier)){m=!0;break}if(u.type===z.AST_NODE_TYPES.ReturnStatement){m=!0;break}if(u.type===z.AST_NODE_TYPES.Property&&u.parent.type===z.AST_NODE_TYPES.ObjectExpression&&u.parent.parent.type===z.AST_NODE_TYPES.ReturnStatement){m=!0;break}if(u.type===z.AST_NODE_TYPES.JSXExpressionContainer){m=!0;break}}if(m)continue;let g=[];for(let l of p){let u=l.identifier.parent;if(u.type===z.AST_NODE_TYPES.CallExpression&&u.callee===l.identifier){let y=u.arguments.length,T=u.arguments.some(f=>f.type===z.AST_NODE_TYPES.SpreadElement);if(T){m=!0;break}let h={argCount:y,hasSpread:T};for(let f of i.optionalParams)if(f.isObjectParam&&f.index<y){let E=u.arguments[f.index];if(E?.type===z.AST_NODE_TYPES.ObjectExpression){let x={};for(let d of E.properties)d.type===z.AST_NODE_TYPES.Property&&d.key.type===z.AST_NODE_TYPES.Identifier&&(x[d.key.name]=!0);h.objectArgs||(h.objectArgs=[]),h.objectArgs[f.index]=x}else if(E){m=!0;break}}g.push(h)}else if(u.type===z.AST_NODE_TYPES.JSXOpeningElement&&u.name===l.identifier){let y=u.attributes.some(h=>h.type===z.AST_NODE_TYPES.JSXSpreadAttribute);if(y){m=!0;break}let T={argCount:1,hasSpread:y};for(let h of i.optionalParams)if(h.isObjectParam&&h.index===0){let f={};for(let E of u.attributes)E.type===z.AST_NODE_TYPES.JSXAttribute&&E.name.type===z.AST_NODE_TYPES.JSXIdentifier&&(f[E.name.name]=!0);T.objectArgs||(T.objectArgs=[]),T.objectArgs[0]=f}g.push(T)}}if(!(m||g.length===0))for(let l of i.optionalParams)if(l.isObjectParam&&l.objectProps)for(let u of l.objectProps){if(!u.optional)continue;let y=!1;for(let T of g)if(T.objectArgs&&T.objectArgs[l.index]){let h=T.objectArgs[l.index];if(h&&h[u.name]){y=!0;break}}y||e.report({node:l.param,messageId:"unusedOptionalProp",data:{name:u.name}})}else{let u=!1;for(let y of g)if(y.argCount>l.index){u=!0;break}u||e.report({node:l.param,messageId:"unusedOptionalArg",data:{name:l.name}})}}}}}});var Y=require("@typescript-eslint/utils"),je=require("zod/v4");var Ms=je.z.object({selectors:je.z.array(je.z.object({name:je.z.string(),selectorProp:je.z.string().optional(),selectorArgPos:je.z.number().optional(),returnProp:je.z.string().optional()}))}),$s=Y.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),or="no-unused-selected-values",Zt={name:or,rule:$s({name:or,meta:{type:"suggestion",docs:{description:"Disallow unused values in selector objects"},messages:{unusedSelectedValue:'The selected value "{{name}}" is not being used'},schema:[j(Ms)]},defaultOptions:[{selectors:[]}],create(e,[n]){let{selectors:r=[]}=n,t=new Map(r.map(s=>[s.name,s]));return{VariableDeclarator(s){let o=null;if(s.init?.type===Y.AST_NODE_TYPES.CallExpression&&(o=s.init),!o)return;let i=Us(o);if(!i)return;let c=t.get(i);if(!c)return;let a=_s(o,c.selectorArgPos??0,c.selectorProp);if(!a)return;let p=Ws(a);if(!p)return;let m=ar(p.properties,void 0);if(!m)return;if(s.id.type===Y.AST_NODE_TYPES.ObjectPattern){let u=ar(s.id.properties,c.returnProp);if(!u)return;for(let[y,T]of m)u.has(y)||e.report({node:T,messageId:"unusedSelectedValue",data:{name:y}});return}if(s.id.type!==Y.AST_NODE_TYPES.Identifier||c.returnProp)return;let g=zs(s,e.sourceCode);if(g.length===0)return;let l=new Set;for(let u of g){if(u.identifier.parent.type!==Y.AST_NODE_TYPES.MemberExpression)return;let y=u.identifier.parent.property;if(y.type!==Y.AST_NODE_TYPES.Identifier)return;l.add(y.name)}for(let[u,y]of m)l.has(u)||e.report({node:y,messageId:"unusedSelectedValue",data:{name:u}})}}}})};function _s(e,n,r){let t=e.arguments[n];if(!t)return null;if(t.type===Y.AST_NODE_TYPES.ArrowFunctionExpression||t.type===Y.AST_NODE_TYPES.FunctionExpression)return t;if(r&&t.type===Y.AST_NODE_TYPES.ObjectExpression){let s=t.properties.find(i=>i.type===Y.AST_NODE_TYPES.Property&&i.key.type===Y.AST_NODE_TYPES.Identifier&&i.key.name===r);if(s?.type!==Y.AST_NODE_TYPES.Property)return null;let o=s.value;if(o.type===Y.AST_NODE_TYPES.ArrowFunctionExpression||o.type===Y.AST_NODE_TYPES.FunctionExpression)return o}return null}function Us(e){return e.callee.type===Y.AST_NODE_TYPES.Identifier?e.callee.name:e.callee.type===Y.AST_NODE_TYPES.MemberExpression&&e.callee.property.type===Y.AST_NODE_TYPES.Identifier?e.callee.property.name:null}function Ws(e){if(e.body.type===Y.AST_NODE_TYPES.ObjectExpression)return e.body;if(e.body.type===Y.AST_NODE_TYPES.BlockStatement){let n=e.body.body.filter(r=>r.type===Y.AST_NODE_TYPES.ReturnStatement);return n.length!==1||!n[0]||n[0].argument?.type!==Y.AST_NODE_TYPES.ObjectExpression?null:n[0].argument}return null}function ar(e,n){let r=e;if(n){let s=e.find(o=>o.type===Y.AST_NODE_TYPES.Property&&o.key.type===Y.AST_NODE_TYPES.Identifier&&o.key.name===n);if(s?.type!==Y.AST_NODE_TYPES.Property||s.value.type!==Y.AST_NODE_TYPES.ObjectPattern)return null;r=s.value.properties}let t=new Map;for(let s of r){if(s.type!==Y.AST_NODE_TYPES.Property||s.key.type!==Y.AST_NODE_TYPES.Identifier)return null;t.set(s.key.name,s)}return t.size>0?t:null}function zs(e,n){let r=n.getDeclaredVariables(e);if(r.length!==1)return[];let t=r[0];return t?t.references.filter(s=>s.identifier!==e.id):[]}var q=require("@typescript-eslint/utils");var Gt=U({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 t=null,s=!1;return{CallExpression(o){if(s)return;if(!t){let c=Js(o);c&&(t=c);return}let i=Vs(o,e.sourceCode);if(i){s=!0;for(let c of i)t.delete(c);if(t.size!==0)for(let[c,a]of t)e.report({node:a,messageId:"unusedField",data:{name:c}})}}}}});function Js(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 t=Ft(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?Xs(o.value):null);if(!t)return null;let s=new Map;for(let o of t.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 Vs(e,n){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||!Ft(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=zn(e.parent,"formFields",n),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 Xs(e){if(e.body.type===q.AST_NODE_TYPES.ObjectExpression)return e.body;if(e.body.type===q.AST_NODE_TYPES.BlockStatement){let n=e.body.body.filter(r=>r.type===q.AST_NODE_TYPES.ReturnStatement);return n.length!==1||!n[0]||n[0].argument?.type!==q.AST_NODE_TYPES.ObjectExpression?null:n[0].argument}return null}var H=require("@typescript-eslint/utils"),Qe=require("zod/v4");var Hs=H.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`);function lr(e){let n=[];for(let r of e.members)r.type===H.AST_NODE_TYPES.TSPropertySignature&&r.key.type===H.AST_NODE_TYPES.Identifier&&n.push([r.key.name,r]);return n}function pr(e,...n){for(let r of n)e.set(...r);return e}var Bs=Qe.z.object({forceCheckOnFCPropTypesWithName:Qe.z.array(Qe.z.string()).optional(),alwaysCheckFunctionOptionTypes:Qe.z.boolean().optional()}),cr="no-unused-type-props-in-args",Kt=null,Ys=Hs({name:cr,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:[j(Bs)],fixable:"code"},defaultOptions:[{alwaysCheckFunctionOptionTypes:!0}],create(e,[n]){let{forceCheckOnFCPropTypesWithName:r,alwaysCheckFunctionOptionTypes:t=!0}=n;r&&!Kt&&(Kt=r.map(a=>new RegExp(a)));function s(a,p,m,g,l=!0,u=!1){let y=m.name,T=e.sourceCode.getScope(p).references.find(d=>d.identifier.name===y)?.resolved,h=a&&Kt?.some(d=>d.test(y)),f=u&&t;if(!T||!h&&T.references.filter(d=>d.isTypeReference).length>1||!T.defs[0])return;let E=T.defs[0].node,x=E.parent?.type===H.AST_NODE_TYPES.ExportNamedDeclaration;if(!(l&&x&&!f)){if(E.type===H.AST_NODE_TYPES.TSTypeAliasDeclaration){o(a,p,g,E.typeAnnotation,!0,u);return}if(E.type===H.AST_NODE_TYPES.TSInterfaceDeclaration){o(a,p,g,E.body,!0,u);return}}}function o(a,p,m,g,l,u=!1){if(g.type===H.AST_NODE_TYPES.TSInterfaceBody){for(let y of g.body)y.type===H.AST_NODE_TYPES.TSPropertySignature&&y.key.type===H.AST_NODE_TYPES.Identifier&&m.set(y.key.name,y);return}if(g.type===H.AST_NODE_TYPES.TSTypeLiteral){pr(m,...lr(g));return}if(g.type===H.AST_NODE_TYPES.TSIntersectionType){for(let y of g.types)o(a,p,m,y,!0,u);return}l||g.type===H.AST_NODE_TYPES.TSTypeReference&&g.typeName.type===H.AST_NODE_TYPES.Identifier&&s(a,p,g.typeName,m,!0,u)}function i(a,p,m,g=!1){for(let l of m)if(l.type===H.AST_NODE_TYPES.ObjectPattern&&l.typeAnnotation){let u=new Map;if(o(a,p,u,l.typeAnnotation.typeAnnotation,!1,g),u.size===0)continue;c(l,u)}else l.type===H.AST_NODE_TYPES.AssignmentPattern&&l.left.type===H.AST_NODE_TYPES.ObjectPattern&&i(a,p,[l.left],g)}function c(a,p){let m=[];if(a.properties.at(-1)?.type===H.AST_NODE_TYPES.RestElement)return;for(let y of a.properties)y.type===H.AST_NODE_TYPES.Property&&y.key.type===H.AST_NODE_TYPES.Identifier&&m.push(y.key.name);let l=[],u=[];for(let[y,T]of p)m.includes(y)||(u.push(y),l.push({node:T,messageId:"unusedObjectTypeProperty",data:{propertyName:y}}));for(let[y,T]of l.entries())e.report({...T,fix:y===l.length-1?h=>{let f=a.properties.at(-1),E=u.join(", ");return f?f.type===H.AST_NODE_TYPES.RestElement?null:h.insertTextAfter(f,`, ${E}`):h.insertTextBeforeRange([a.range[0]+1,a.range[1]],E)}:void 0})}return{VariableDeclaration(a){let p=a.declarations[0],m=new Map,g=p.id.type===H.AST_NODE_TYPES.Identifier&&p.id.typeAnnotation?.typeAnnotation.type===H.AST_NODE_TYPES.TSTypeReference&&p.id.typeAnnotation.typeAnnotation.typeName.type===H.AST_NODE_TYPES.Identifier&&p.id.typeAnnotation.typeAnnotation.typeName.name==="FC"&&p.id.typeAnnotation.typeAnnotation.typeArguments?.params[0];if(g){if(g.type===H.AST_NODE_TYPES.TSTypeReference&&g.typeName.type===H.AST_NODE_TYPES.Identifier)s(!0,a,g.typeName,m,!1);else if(g.type===H.AST_NODE_TYPES.TSTypeLiteral)pr(m,...lr(g));else if(g.type===H.AST_NODE_TYPES.TSIntersectionType)for(let l of g.types)l.type===H.AST_NODE_TYPES.TSTypeReference&&l.typeName.type===H.AST_NODE_TYPES.Identifier?s(!0,a,l.typeName,m,!1):o(!0,a,m,l,!0);if(m.size!==0&&p.init?.type===H.AST_NODE_TYPES.ArrowFunctionExpression){let l=p.init.params[0];if(!l){e.report({node:p.init,messageId:"missingComponentParam"});return}l.type===H.AST_NODE_TYPES.ObjectPattern&&c(l,m)}}},FunctionDeclaration(a){i(!1,a,a.params,t)},ArrowFunctionExpression(a){i(!1,a,a.params,t)}}}}),Qt={name:cr,rule:Ys};var ge=require("@typescript-eslint/utils");var en=U({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 n=new Set;function r(t){return t.callee.type===ge.AST_NODE_TYPES.Identifier?n.has(t.callee.name):t.callee.type===ge.AST_NODE_TYPES.MemberExpression&&t.callee.object.type===ge.AST_NODE_TYPES.Identifier&&t.callee.property.type===ge.AST_NODE_TYPES.Identifier?t.callee.property.name==="useRef":!1}return{ImportDeclaration(t){if(t.source.value==="react")for(let s of t.specifiers)s.type===ge.AST_NODE_TYPES.ImportSpecifier&&s.imported.type===ge.AST_NODE_TYPES.Identifier&&s.imported.name==="useRef"&&n.add(s.local.name)},VariableDeclarator(t){if(t.init&&t.init.type===ge.AST_NODE_TYPES.CallExpression&&r(t.init)&&t.id.type===ge.AST_NODE_TYPES.Identifier){let o=e.sourceCode.getScope(t).set.get(t.id.name);if(o){let i=!1;for(let c of o.references){let p=c.identifier.parent;if(p!==t&&!(p.type===ge.AST_NODE_TYPES.JSXExpressionContainer&&p.parent.type===ge.AST_NODE_TYPES.JSXAttribute&&p.parent.name.type===ge.AST_NODE_TYPES.JSXIdentifier&&p.parent.name.name==="ref")){i=!0;break}}i||e.report({node:t.id,messageId:"refNotRead",data:{name:t.id.name}})}}}}}});var Xe=require("@typescript-eslint/utils"),qs=Xe.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),fr="prefer-named-functions",ur=new Map,Zs=qs({name:fr,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,[n]){let r=null;if(n.ignoreRegex){let t=ur.get(n.ignoreRegex);t?r=t:(r=new RegExp(n.ignoreRegex),ur.set(n.ignoreRegex,r))}return{VariableDeclarator(t){if(t.init&&t.init.type===Xe.AST_NODE_TYPES.ArrowFunctionExpression&&t.id.type===Xe.AST_NODE_TYPES.Identifier){let s=t.id.name;if(t.id.typeAnnotation||r&&r.test(s)||!n.disallowArrowFnWithImplicitReturns&&t.init.body.type!==Xe.AST_NODE_TYPES.BlockStatement)return;let o=t.parent,i=t.init.params,c=t.init.body,a=t.init;e.report({node:t.id,messageId:r?"withIgnoreRegex":"default",data:{functionName:s,ignoreRegex:n.ignoreRegex},suggest:[{messageId:"suggestion",fix:p=>p.replaceText(o,`${a.async?"async ":""}function ${s}(${i.map(m=>e.sourceCode.getText(m)).join(", ")||""}) ${e.sourceCode.getText(c)}`)}]})}}}}}),tn={name:fr,rule:Zs};var M=require("@typescript-eslint/utils"),xe=require("zod/v4");var Gs=xe.z.object({disallowedFunctions:xe.z.array(xe.z.object({name:xe.z.string(),allowUsingWithArgs:xe.z.boolean().optional(),hookAlternative:xe.z.string().optional(),message:xe.z.string().optional(),allowUseInside:xe.z.array(xe.z.string()).optional()}))}),Ks=/^use[A-Z]/,Qs=/^[A-Z]/;function mt(e){return Ks.test(e)}function mr(e){return Qs.test(e)}function eo(e){return e.type===M.AST_NODE_TYPES.Identifier?mt(e.name):e.type===M.AST_NODE_TYPES.MemberExpression&&e.property.type===M.AST_NODE_TYPES.Identifier?mt(e.property.name):!1}function yr(e,n){return e.type===M.AST_NODE_TYPES.Identifier?e.name===n:e.type===M.AST_NODE_TYPES.MemberExpression&&e.object.type===M.AST_NODE_TYPES.Identifier&&e.property.type===M.AST_NODE_TYPES.Identifier?e.object.name==="React"&&e.property.name===n:!1}function dr(e){return!!(e.parent&&e.parent.type===M.AST_NODE_TYPES.CallExpression&&yr(e.parent.callee,"forwardRef"))}function gr(e){return!!(e.parent&&e.parent.type===M.AST_NODE_TYPES.CallExpression&&yr(e.parent.callee,"memo"))}function nn(e){if(e.type===M.AST_NODE_TYPES.FunctionDeclaration||e.type===M.AST_NODE_TYPES.FunctionExpression&&e.id)return e.id||void 0;if(e.type===M.AST_NODE_TYPES.FunctionExpression||e.type===M.AST_NODE_TYPES.ArrowFunctionExpression){if(e.parent.type===M.AST_NODE_TYPES.VariableDeclarator&&e.parent.init===e)return e.parent.id;if(e.parent.type===M.AST_NODE_TYPES.AssignmentExpression&&e.parent.right===e&&e.parent.operator==="=")return e.parent.left;if(e.parent.type===M.AST_NODE_TYPES.Property&&e.parent.value===e&&!e.parent.computed)return e.parent.key;if(e.parent.type===M.AST_NODE_TYPES.AssignmentPattern&&e.parent.right===e)return e.parent.left}}function to(e){let n=e.parent,r=!1;for(;n;){if(n.type===M.AST_NODE_TYPES.FunctionDeclaration||n.type===M.AST_NODE_TYPES.FunctionExpression||n.type===M.AST_NODE_TYPES.ArrowFunctionExpression){let t=nn(n);if(t&&t.type===M.AST_NODE_TYPES.Identifier){if(mr(t.name)||mt(t.name))return!r;r=!0}else{if(dr(n)||gr(n))return!r;if(n.parent.type===M.AST_NODE_TYPES.CallExpression){let s=n.parent;eo(s.callee)||(r=!0)}else n.parent.type===M.AST_NODE_TYPES.JSXExpressionContainer||(r=!0)}}n=n.parent}return!1}function Sr(e){return e.callee.type===M.AST_NODE_TYPES.Identifier?e.callee.name:e.callee.type===M.AST_NODE_TYPES.MemberExpression&&e.callee.property.type===M.AST_NODE_TYPES.Identifier?e.callee.property.name:null}function no(e,n){if(!n.length)return!1;let r=e.parent;for(;r;){if(r.type===M.AST_NODE_TYPES.FunctionDeclaration||r.type===M.AST_NODE_TYPES.FunctionExpression||r.type===M.AST_NODE_TYPES.ArrowFunctionExpression){let t=nn(r);if(t&&t.type===M.AST_NODE_TYPES.Identifier&&n.includes(t.name))return!0}else if(r.type===M.AST_NODE_TYPES.CallExpression){let t=Sr(r);if(t&&n.includes(t))return!0}r=r.parent}return!1}function ro(e){return e.arguments.length>0&&!e.arguments.every(n=>n.type===M.AST_NODE_TYPES.Identifier&&n.name==="undefined")}function io(e,n){let r=!1,t=e.parent;for(;t;){if(t.type===M.AST_NODE_TYPES.FunctionDeclaration||t.type===M.AST_NODE_TYPES.FunctionExpression||t.type===M.AST_NODE_TYPES.ArrowFunctionExpression){let s=nn(t);if(s&&s.type===M.AST_NODE_TYPES.Identifier){if(mr(s.name)||mt(s.name)){r=!0;break}}else if(dr(t)||gr(t)){r=!0;break}}t=t.parent}return r?n.length===0?to(e):!no(e,n):!1}var rn=U({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:[j(Gs)],hasSuggestions:!0},defaultOptions:[{disallowedFunctions:[]}],create(e,[n]){let{disallowedFunctions:r}=n,t=new Map(r.map(s=>[s.name,s]));return{CallExpression(s){let o=Sr(s);if(!o)return;let i=t.get(o);if(!i||i.allowUsingWithArgs&&ro(s))return;let c=i.allowUseInside||[];io(s,c)&&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 p=i.hookAlternative;return p?s.callee.type===M.AST_NODE_TYPES.Identifier?a.replaceText(s.callee,p):s.callee.type===M.AST_NODE_TYPES.MemberExpression&&s.callee.property.type===M.AST_NODE_TYPES.Identifier?a.replaceText(s.callee.property,p):null:null}}]:[]})}}}});var G=require("@typescript-eslint/utils"),yt=Te(require("zod/v4"));var so=G.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),hr="prefer-single-line-if",oo=yt.default.object({maxLineLength:yt.default.number().optional(),maxNonSimpleConditionLength:yt.default.number().optional()}),ao=so({name:hr,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:[j(oo)]},defaultOptions:[{}],create(e,[n]){let r=e.sourceCode;return{IfStatement(t){if(t.consequent.type!==G.AST_NODE_TYPES.BlockStatement||t.loc.start.line===t.loc.end.line||r.getCommentsInside(t.consequent).length>0||t.alternate||t.consequent.body.length!==1)return;let o=t.consequent.body[0];if(!o)return;if(o.type===G.AST_NODE_TYPES.ReturnStatement){if(!br(o))return}else if(!(o.type===G.AST_NODE_TYPES.ContinueStatement||o.type===G.AST_NODE_TYPES.BreakStatement))return;if(t.test.type===G.AST_NODE_TYPES.LogicalExpression||t.test.type===G.AST_NODE_TYPES.ConditionalExpression)return;let i;if(n.maxNonSimpleConditionLength){let g=Tr(t.test);if(!g&&t.test.type===G.AST_NODE_TYPES.UnaryExpression&&t.test.operator==="!"){let l=t.test.argument;Tr(l)&&(g=!0)}if(g&&(i=r.getText(t.test),i.length>n.maxNonSimpleConditionLength))return}i||(i=r.getText(t.test));let c=r.getText(o);if(i.includes(`
18
- `))return;let a=r.getTokenAfter(t);if(a&&a.type===G.AST_TOKEN_TYPES.Punctuator&&a.value==="}"){let g=r.getTokenAfter(a);if(g&&g.type===G.AST_TOKEN_TYPES.Keyword&&(g.value==="else"||g.value==="catch"))return}let p=lo(r,t),m=`if (${i}) ${c}`;n.maxLineLength&&m.length+p.length>n.maxLineLength||e.report({node:t,messageId:"noSingleLineCurly",fix:g=>g.replaceText(t,m)})}}}});function Tr(e){return e.type===G.AST_NODE_TYPES.CallExpression||e.type===G.AST_NODE_TYPES.BinaryExpression||e.type===G.AST_NODE_TYPES.MemberExpression&&Er(e)}function Er(e){return e.object.type===G.AST_NODE_TYPES.MemberExpression?Er(e.object):e.object.type!==G.AST_NODE_TYPES.Identifier}function lo(e,n){return e.text.slice(n.range[0]-n.loc.start.column,n.range[0])}function br(e){if(!e.argument)return!0;let n=e.argument;return n.type===G.AST_NODE_TYPES.ArrayExpression&&n.elements.length===0||n.type===G.AST_NODE_TYPES.ObjectExpression&&n.properties.length===0||n.type===G.AST_NODE_TYPES.Literal||n.type===G.AST_NODE_TYPES.Identifier||n.type===G.AST_NODE_TYPES.TemplateLiteral||n.type===G.AST_NODE_TYPES.TaggedTemplateExpression?!0:n.type===G.AST_NODE_TYPES.CallExpression?n.arguments.length===0:n.type===G.AST_NODE_TYPES.UnaryExpression?br(n):!1}var sn={name:hr,rule:ao};var P=require("@typescript-eslint/utils"),an=require("zod/v4");var po=P.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),Ir="react-compiler-extra",co=an.z.object({runOnlyWithEnableCompilerDirective:an.z.boolean().optional()}),uo=/eslint +react-compiler\/react-compiler: +\["error/;function Rr(e){return e.type===P.AST_NODE_TYPES.Identifier?e.name.startsWith("use"):!1}function fo(e){return e.type===P.AST_NODE_TYPES.Identifier?e.name.startsWith("use"):e.type===P.AST_NODE_TYPES.MemberExpression&&e.property.type===P.AST_NODE_TYPES.Identifier?e.property.name.startsWith("use"):!1}function Ce(e){if(!e)return!1;switch(e.type){case P.AST_NODE_TYPES.JSXElement:case P.AST_NODE_TYPES.JSXFragment:return!0;case P.AST_NODE_TYPES.ConditionalExpression:return Ce(e.consequent)||Ce(e.alternate);case P.AST_NODE_TYPES.LogicalExpression:return e.operator==="&&"?Ce(e.right):e.operator==="||"?Ce(e.left)||Ce(e.right):!1;case P.AST_NODE_TYPES.CallExpression:if(e.callee.type===P.AST_NODE_TYPES.MemberExpression&&e.callee.object.type===P.AST_NODE_TYPES.Identifier&&e.callee.object.name==="React"&&e.callee.property.type===P.AST_NODE_TYPES.Identifier&&e.callee.property.name==="createElement")return!0;for(let n of e.arguments)if(n.type!==P.AST_NODE_TYPES.SpreadElement&&Ce(n))return!0;return!1;default:return!1}}function mo(e){let n=e.typeAnnotation;if(n.type===P.AST_NODE_TYPES.TSTypeReference){if(n.typeName.type===P.AST_NODE_TYPES.Identifier)return n.typeName.name==="FC";if(n.typeName.type===P.AST_NODE_TYPES.TSQualifiedName&&n.typeName.left.type===P.AST_NODE_TYPES.Identifier&&n.typeName.right.type===P.AST_NODE_TYPES.Identifier)return n.typeName.left.name==="React"&&n.typeName.right.name==="FC"}return!1}var yo=/^[A-Z][a-zA-Z0-9]*$/;function tt(e){return yo.test(e)}function ln(e){return e.startsWith("use")&&e.length>3}function pn(e,n,r,t){if(r&&mo(r))return n?tt(n.name):e.type===P.AST_NODE_TYPES.FunctionDeclaration&&e.id?tt(e.id.name):!0;if(n&&ln(n.name)||e.type===P.AST_NODE_TYPES.FunctionDeclaration&&e.id&&ln(e.id.name))return!0;if(t){let s=n?.name||e.type===P.AST_NODE_TYPES.FunctionDeclaration&&e.id?.name;if(s&&tt(s)&&wr(e.body,t).containsJSX)return!0}return!1}function et(e){if(e.body.type===P.AST_NODE_TYPES.BlockStatement){for(let n of e.body.body)if(n.type===P.AST_NODE_TYPES.ExpressionStatement&&n.expression.type===P.AST_NODE_TYPES.Literal&&typeof n.expression.value=="string"&&n.expression.value==="use memo")return!0}return!1}function wr(e,n){let r={containsJSX:!1,containsHookCalls:!1};return De(e,t=>{if(r.containsJSX&&r.containsHookCalls)return!0;switch(t.type){case P.AST_NODE_TYPES.JSXElement:case P.AST_NODE_TYPES.JSXFragment:r.containsJSX=!0;break;case P.AST_NODE_TYPES.CallExpression:Rr(t.callee)&&(r.containsHookCalls=!0),Ce(t)&&(r.containsJSX=!0);break;case P.AST_NODE_TYPES.ReturnStatement:t.argument&&Ce(t.argument)&&(r.containsJSX=!0);break;case P.AST_NODE_TYPES.VariableDeclarator:t.init&&Ce(t.init)&&(r.containsJSX=!0);break;case P.AST_NODE_TYPES.AssignmentExpression:Ce(t.right)&&(r.containsJSX=!0);break}},n),r}function xr(e,n){let r=e.body,t=wr(r,n);return t.containsJSX||t.containsHookCalls}var go=/\bthis[.[]/;function Cr(e){return go.test(e)}function So(e,n){let r={containsJSX:!1,containsHookCalls:!1};return De(e,t=>{if(r.containsHookCalls||(t.type===P.AST_NODE_TYPES.FunctionDeclaration||t.type===P.AST_NODE_TYPES.FunctionExpression||t.type===P.AST_NODE_TYPES.ArrowFunctionExpression)&&t!==e)return!0;t.type===P.AST_NODE_TYPES.CallExpression&&fo(t.callee)&&(r.containsHookCalls=!0)},n),r}function Ar(e){return tt(e)||ln(e)}function on(e,n,r,t){if(!So(e.body,n).containsHookCalls)return!1;let o=pn(e,r,t,n);if(!o&&t){let i=r?.name||e.type===P.AST_NODE_TYPES.FunctionDeclaration&&e.id?.name;i&&tt(i)&&(o=!0)}return!o}var To=po({name:Ir,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:[j(co)]},defaultOptions:[{}],create(e,[n]){let r=!1;if(n.runOnlyWithEnableCompilerDirective){for(let o of e.sourceCode.getAllComments())if(uo.test(o.value)){r=!0;break}if(!r)return{}}function t(o){for(let i of o.properties)if(i.type===P.AST_NODE_TYPES.Property&&i.method&&i.value.type===P.AST_NODE_TYPES.FunctionExpression){let c=e.sourceCode,a=c.getText(i.key),p=i.value,m=c.getText(p.body);if(Cr(m))e.report({node:i,messageId:"thisKeywordInMethod"});else{let g=p.params.map(u=>c.getText(u)).join(", "),l="";p.generator?l=`${a}: function* (${g}) ${m}`:l=`${a}: (${g}) => ${m}`,e.report({node:i,messageId:"objectMethodIsNotSupported",fix:u=>u.replaceText(i,l)})}}}function s(o){for(let i of o.properties)if(i.type===P.AST_NODE_TYPES.Property&&i.value.type===P.AST_NODE_TYPES.ObjectExpression){for(let c of i.value.properties)if(c.type===P.AST_NODE_TYPES.Property&&c.method&&c.value.type===P.AST_NODE_TYPES.FunctionExpression){let p=e.sourceCode.getText(c.value.body);Cr(p)&&e.report({node:c,messageId:"thisKeywordInMethod"})}}}return{CallExpression(o){if(Rr(o.callee))for(let i of o.arguments){if(i.type===P.AST_NODE_TYPES.ObjectExpression&&(t(i),s(i)),i.type===P.AST_NODE_TYPES.ArrowFunctionExpression&&(i.body.type===P.AST_NODE_TYPES.ObjectExpression&&(t(i.body),s(i.body)),i.body.type===P.AST_NODE_TYPES.BlockStatement))for(let c of i.body.body)c.type===P.AST_NODE_TYPES.ReturnStatement&&c.argument?.type===P.AST_NODE_TYPES.ObjectExpression&&(t(c.argument),s(c.argument));if(i.type===P.AST_NODE_TYPES.FunctionExpression)for(let c of i.body.body)c.type===P.AST_NODE_TYPES.ReturnStatement&&c.argument?.type===P.AST_NODE_TYPES.ObjectExpression&&(t(c.argument),s(c.argument))}},VariableDeclarator(o){if(o.id.type===P.AST_NODE_TYPES.Identifier&&o.init&&(o.init.type===P.AST_NODE_TYPES.ArrowFunctionExpression||o.init.type===P.AST_NODE_TYPES.FunctionExpression)){let i=o.init,c=o.id,a=o.id.typeAnnotation;if(et(i)&&!Ar(c.name)){e.report({node:i,messageId:"useMemoDirectiveNaming"});return}if(on(i,e.sourceCode,c,a)){e.report({node:i,messageId:"functionCallingHooksMustBeComponent"});return}if(pn(i,c,a,e.sourceCode)){let p=xr(i,e.sourceCode),m=et(i);!p&&!m&&e.report({node:i,messageId:"fcComponentShouldReturnJsx",suggest:[{messageId:"addUseMemoDirective",fix(g){if(i.body.type===P.AST_NODE_TYPES.BlockStatement){let l=i.body.range[0]+1;return g.insertTextAfterRange([l,l],`
17
+ `)}return""}return{Program(){let a=[];for(let l of n.body)l.type===ye.AST_NODE_TYPES.ExpressionStatement&&l.expression.type===ye.AST_NODE_TYPES.CallExpression&&l.expression.callee.type===ye.AST_NODE_TYPES.Identifier&&l.expression.callee.name==="describe"&&l.expression.arguments.length===2&&a.push(l.expression);if(!i(a))return;let[p]=a;if(!p)return;let f=s(p);if(o(f))return;let g=n.body.find(l=>l.type===ye.AST_NODE_TYPES.ExpressionStatement&&l.expression===p);!g||g.type!==ye.AST_NODE_TYPES.ExpressionStatement||e.report({node:p,messageId:"unnecessaryDescribe",suggest:[{messageId:"removeDescribe",fix(l){let u=c(p);return u?l.replaceText(g,u):null}}]})}}}});var et=require("@typescript-eslint/utils"),xe=he(require("zod/v4"));var $s=xe.object({methods:xe.union([xe.array(xe.string()),xe.literal("array")])}),Yt=M({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:[j($s)]},defaultOptions:[{methods:"array"}],create(e,[t]){let r=t.methods,n=new Set(["find","filter","map","forEach","some","every","reduce","findIndex","sort"]);function s(c){return Array.isArray(r)?r.includes(c):n.has(c)}function o(c){let{callee:a}=c;if(a.type===et.AST_NODE_TYPES.MemberExpression){let p=a.property;if(p.type===et.AST_NODE_TYPES.Identifier)return p.name}return null}function i(c,a){if(c.type!==et.AST_NODE_TYPES.Identifier||!c.typeAnnotation)return;let p=a.parent;if(p.type===et.AST_NODE_TYPES.CallExpression){let f=o(p);f&&s(f)&&p.arguments.indexOf(a)===0&&e.report({node:c.typeAnnotation,messageId:"unnecessaryTypeAnnotation",fix(l){return c.typeAnnotation?l.remove(c.typeAnnotation):null}})}}return{ArrowFunctionExpression(c){for(let a of c.params)i(a,c)},FunctionExpression(c){for(let a of c.params)i(a,c)}}}});var me=require("@typescript-eslint/utils");var qt=M({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===me.AST_NODE_TYPES.ObjectPattern||!t.init||t.init.type!==me.AST_NODE_TYPES.ObjectExpression||t.id.type===me.AST_NODE_TYPES.Identifier&&t.id.typeAnnotation||t.parent.parent.type===me.AST_NODE_TYPES.ExportNamedDeclaration)return;let r=new Map;for(let i of t.init.properties)i.type===me.AST_NODE_TYPES.Property&&i.key.type===me.AST_NODE_TYPES.Identifier&&r.set(i.key.name,i);if(r.size===0||t.id.type!==me.AST_NODE_TYPES.Identifier)return;let n=Us(t,e.sourceCode);if(n.length===0)return;let s=t.init.properties.some(i=>i.type!==me.AST_NODE_TYPES.Property?!1:i.value.type===me.AST_NODE_TYPES.FunctionExpression),o=new Set;for(let i of n){if(i.identifier.parent.type!==me.AST_NODE_TYPES.MemberExpression)return;let c=i.identifier.parent;if(c.object!==i.identifier)return;if(c.computed)if(c.property.type===me.AST_NODE_TYPES.Literal&&typeof c.property.value=="string")o.add(c.property.value);else return;else{if(c.property.type!==me.AST_NODE_TYPES.Identifier)return;o.add(c.property.name)}if(c.parent.type===me.AST_NODE_TYPES.CallExpression&&s)return}for(let[i,c]of r)o.has(i)||e.report({node:c,messageId:"unusedObjectProperty",data:{name:i}})}}}});function Us(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 z=require("@typescript-eslint/utils"),Zt=require("zod/v4");var Ws=Zt.z.object({ignoreArgsMatching:Zt.z.string().optional()}),Gt=M({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:[j(Ws)]},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===z.AST_NODE_TYPES.ExportNamedDeclaration||i.type===z.AST_NODE_TYPES.ExportDefaultDeclaration||i.parent?.type===z.AST_NODE_TYPES.ExportNamedDeclaration||i.parent?.type===z.AST_NODE_TYPES.ExportDefaultDeclaration}function o(i){let c=[];for(let a=0;a<i.length;a++){let p=i[a];if(!p||p.type!==z.AST_NODE_TYPES.Identifier)continue;let f=p.name;if(!n(f)){if(p.optional&&p.typeAnnotation&&p.typeAnnotation.typeAnnotation.type===z.AST_NODE_TYPES.TSTypeLiteral){let g=p.typeAnnotation.typeAnnotation,l=[];for(let u of g.members)u.type===z.AST_NODE_TYPES.TSPropertySignature&&u.key.type===z.AST_NODE_TYPES.Identifier&&l.push({name:u.key.name,optional:u.optional===!0});l.some(u=>u.optional)?c.push({param:p,index:a,name:f,isObjectParam:!0,objectProps:l}):c.push({param:p,index:a,name:f,isObjectParam:!1})}else if(p.optional)c.push({param:p,index:a,name:f,isObjectParam:!1});else if(p.typeAnnotation&&p.typeAnnotation.typeAnnotation.type===z.AST_NODE_TYPES.TSTypeLiteral){let g=p.typeAnnotation.typeAnnotation,l=[];for(let u of g.members)u.type===z.AST_NODE_TYPES.TSPropertySignature&&u.key.type===z.AST_NODE_TYPES.Identifier&&l.push({name:u.key.name,optional:u.optional===!0});l.some(u=>u.optional)&&c.push({param:p,index:a,name:f,isObjectParam:!0,objectProps:l})}}}return c}return{FunctionDeclaration(i){if(s(i))return;let c=o(i.params);c.length!==0&&r.push({node:i,declarationNode:i,optionalParams:c})},VariableDeclarator(i){if(i.id.type!==z.AST_NODE_TYPES.Identifier||!i.init||i.init.type!==z.AST_NODE_TYPES.ArrowFunctionExpression&&i.init.type!==z.AST_NODE_TYPES.FunctionExpression||s(i.parent.parent))return;let a=[...o(i.init.params)];if(i.id.typeAnnotation&&i.id.typeAnnotation.typeAnnotation.type===z.AST_NODE_TYPES.TSTypeReference){let p=i.id.typeAnnotation.typeAnnotation;if(p.typeName.type===z.AST_NODE_TYPES.Identifier&&p.typeName.name==="FC"){let f=p.typeArguments;if(f&&f.params.length===1){let g=f.params[0];if(g&&g.type===z.AST_NODE_TYPES.TSTypeLiteral){let l=[];for(let u of g.members)u.type===z.AST_NODE_TYPES.TSPropertySignature&&u.key.type===z.AST_NODE_TYPES.Identifier&&l.push({name:u.key.name,optional:u.optional===!0});l.some(u=>u.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 p=a.references.filter(l=>l.identifier!==a.identifiers[0]);if(p.length===0)continue;let f=!1;for(let l of p){let u=l.identifier.parent;if(u.type===z.AST_NODE_TYPES.CallExpression&&l.identifier.type===z.AST_NODE_TYPES.Identifier&&u.arguments.includes(l.identifier)){f=!0;break}if(u.type===z.AST_NODE_TYPES.ReturnStatement){f=!0;break}if(u.type===z.AST_NODE_TYPES.Property&&u.parent.type===z.AST_NODE_TYPES.ObjectExpression&&u.parent.parent.type===z.AST_NODE_TYPES.ReturnStatement){f=!0;break}if(u.type===z.AST_NODE_TYPES.JSXExpressionContainer){f=!0;break}}if(f)continue;let g=[];for(let l of p){let u=l.identifier.parent;if(u.type===z.AST_NODE_TYPES.CallExpression&&u.callee===l.identifier){let y=u.arguments.length,T=u.arguments.some(m=>m.type===z.AST_NODE_TYPES.SpreadElement);if(T){f=!0;break}let h={argCount:y,hasSpread:T};for(let m of i.optionalParams)if(m.isObjectParam&&m.index<y){let E=u.arguments[m.index];if(E?.type===z.AST_NODE_TYPES.ObjectExpression){let x={};for(let d of E.properties)d.type===z.AST_NODE_TYPES.Property&&d.key.type===z.AST_NODE_TYPES.Identifier&&(x[d.key.name]=!0);h.objectArgs||(h.objectArgs=[]),h.objectArgs[m.index]=x}else if(E){f=!0;break}}g.push(h)}else if(u.type===z.AST_NODE_TYPES.JSXOpeningElement&&u.name===l.identifier){let y=u.attributes.some(h=>h.type===z.AST_NODE_TYPES.JSXSpreadAttribute);if(y){f=!0;break}let T={argCount:1,hasSpread:y};for(let h of i.optionalParams)if(h.isObjectParam&&h.index===0){let m={};for(let E of u.attributes)E.type===z.AST_NODE_TYPES.JSXAttribute&&E.name.type===z.AST_NODE_TYPES.JSXIdentifier&&(m[E.name.name]=!0);T.objectArgs||(T.objectArgs=[]),T.objectArgs[0]=m}g.push(T)}}if(!(f||g.length===0))for(let l of i.optionalParams)if(l.isObjectParam&&l.objectProps)for(let u of l.objectProps){if(!u.optional)continue;let y=!1;for(let T of g)if(T.objectArgs&&T.objectArgs[l.index]){let h=T.objectArgs[l.index];if(h&&h[u.name]){y=!0;break}}y||e.report({node:l.param,messageId:"unusedOptionalProp",data:{name:u.name}})}else{let u=!1;for(let y of g)if(y.argCount>l.index){u=!0;break}u||e.report({node:l.param,messageId:"unusedOptionalArg",data:{name:l.name}})}}}}}});var Y=require("@typescript-eslint/utils"),Me=require("zod/v4");var zs=Me.z.object({selectors:Me.z.array(Me.z.object({name:Me.z.string(),selectorProp:Me.z.string().optional(),selectorArgPos:Me.z.number().optional(),returnProp:Me.z.string().optional()}))}),Js=Y.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),cr="no-unused-selected-values",Kt={name:cr,rule:Js({name:cr,meta:{type:"suggestion",docs:{description:"Disallow unused values in selector objects"},messages:{unusedSelectedValue:'The selected value "{{name}}" is not being used'},schema:[j(zs)]},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===Y.AST_NODE_TYPES.CallExpression&&(o=s.init),!o)return;let i=Xs(o);if(!i)return;let c=n.get(i);if(!c)return;let a=Vs(o,c.selectorArgPos??0,c.selectorProp);if(!a)return;let p=Hs(a);if(!p)return;let f=ur(p.properties,void 0);if(!f)return;if(s.id.type===Y.AST_NODE_TYPES.ObjectPattern){let u=ur(s.id.properties,c.returnProp);if(!u)return;for(let[y,T]of f)u.has(y)||e.report({node:T,messageId:"unusedSelectedValue",data:{name:y}});return}if(s.id.type!==Y.AST_NODE_TYPES.Identifier||c.returnProp)return;let g=Bs(s,e.sourceCode);if(g.length===0)return;let l=new Set;for(let u of g){if(u.identifier.parent.type!==Y.AST_NODE_TYPES.MemberExpression)return;let y=u.identifier.parent.property;if(y.type!==Y.AST_NODE_TYPES.Identifier)return;l.add(y.name)}for(let[u,y]of f)l.has(u)||e.report({node:y,messageId:"unusedSelectedValue",data:{name:u}})}}}})};function Vs(e,t,r){let n=e.arguments[t];if(!n)return null;if(n.type===Y.AST_NODE_TYPES.ArrowFunctionExpression||n.type===Y.AST_NODE_TYPES.FunctionExpression)return n;if(r&&n.type===Y.AST_NODE_TYPES.ObjectExpression){let s=n.properties.find(i=>i.type===Y.AST_NODE_TYPES.Property&&i.key.type===Y.AST_NODE_TYPES.Identifier&&i.key.name===r);if(s?.type!==Y.AST_NODE_TYPES.Property)return null;let o=s.value;if(o.type===Y.AST_NODE_TYPES.ArrowFunctionExpression||o.type===Y.AST_NODE_TYPES.FunctionExpression)return o}return null}function Xs(e){return e.callee.type===Y.AST_NODE_TYPES.Identifier?e.callee.name:e.callee.type===Y.AST_NODE_TYPES.MemberExpression&&e.callee.property.type===Y.AST_NODE_TYPES.Identifier?e.callee.property.name:null}function Hs(e){if(e.body.type===Y.AST_NODE_TYPES.ObjectExpression)return e.body;if(e.body.type===Y.AST_NODE_TYPES.BlockStatement){let t=e.body.body.filter(r=>r.type===Y.AST_NODE_TYPES.ReturnStatement);return t.length!==1||!t[0]||t[0].argument?.type!==Y.AST_NODE_TYPES.ObjectExpression?null:t[0].argument}return null}function ur(e,t){let r=e;if(t){let s=e.find(o=>o.type===Y.AST_NODE_TYPES.Property&&o.key.type===Y.AST_NODE_TYPES.Identifier&&o.key.name===t);if(s?.type!==Y.AST_NODE_TYPES.Property||s.value.type!==Y.AST_NODE_TYPES.ObjectPattern)return null;r=s.value.properties}let n=new Map;for(let s of r){if(s.type!==Y.AST_NODE_TYPES.Property||s.key.type!==Y.AST_NODE_TYPES.Identifier)return null;n.set(s.key.name,s)}return n.size>0?n:null}function Bs(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 Qt=M({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 c=Ys(o);c&&(n=c);return}let i=qs(o,e.sourceCode);if(i){s=!0;for(let c of i)n.delete(c);if(n.size!==0)for(let[c,a]of n)e.report({node:a,messageId:"unusedField",data:{name:c}})}}}}});function Ys(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=Pt(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?Zs(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 qs(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||!Pt(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=Hn(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 Zs(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 H=require("@typescript-eslint/utils"),tt=require("zod/v4");var Gs=H.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`);function fr(e){let t=[];for(let r of e.members)r.type===H.AST_NODE_TYPES.TSPropertySignature&&r.key.type===H.AST_NODE_TYPES.Identifier&&t.push([r.key.name,r]);return t}function mr(e,...t){for(let r of t)e.set(...r);return e}var Ks=tt.z.object({forceCheckOnFCPropTypesWithName:tt.z.array(tt.z.string()).optional(),alwaysCheckFunctionOptionTypes:tt.z.boolean().optional()}),yr="no-unused-type-props-in-args",en=null,Qs=Gs({name:yr,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:[j(Ks)],fixable:"code"},defaultOptions:[{alwaysCheckFunctionOptionTypes:!0}],create(e,[t]){let{forceCheckOnFCPropTypesWithName:r,alwaysCheckFunctionOptionTypes:n=!0}=t;r&&!en&&(en=r.map(a=>new RegExp(a)));function s(a,p,f,g,l=!0,u=!1){let y=f.name,T=e.sourceCode.getScope(p).references.find(d=>d.identifier.name===y)?.resolved,h=a&&en?.some(d=>d.test(y)),m=u&&n;if(!T||!h&&T.references.filter(d=>d.isTypeReference).length>1||!T.defs[0])return;let E=T.defs[0].node,x=E.parent?.type===H.AST_NODE_TYPES.ExportNamedDeclaration;if(!(l&&x&&!m)){if(E.type===H.AST_NODE_TYPES.TSTypeAliasDeclaration){o(a,p,g,E.typeAnnotation,!0,u);return}if(E.type===H.AST_NODE_TYPES.TSInterfaceDeclaration){o(a,p,g,E.body,!0,u);return}}}function o(a,p,f,g,l,u=!1){if(g.type===H.AST_NODE_TYPES.TSInterfaceBody){for(let y of g.body)y.type===H.AST_NODE_TYPES.TSPropertySignature&&y.key.type===H.AST_NODE_TYPES.Identifier&&f.set(y.key.name,y);return}if(g.type===H.AST_NODE_TYPES.TSTypeLiteral){mr(f,...fr(g));return}if(g.type===H.AST_NODE_TYPES.TSIntersectionType){for(let y of g.types)o(a,p,f,y,!0,u);return}l||g.type===H.AST_NODE_TYPES.TSTypeReference&&g.typeName.type===H.AST_NODE_TYPES.Identifier&&s(a,p,g.typeName,f,!0,u)}function i(a,p,f,g=!1){for(let l of f)if(l.type===H.AST_NODE_TYPES.ObjectPattern&&l.typeAnnotation){let u=new Map;if(o(a,p,u,l.typeAnnotation.typeAnnotation,!1,g),u.size===0)continue;c(l,u)}else l.type===H.AST_NODE_TYPES.AssignmentPattern&&l.left.type===H.AST_NODE_TYPES.ObjectPattern&&i(a,p,[l.left],g)}function c(a,p){let f=[];if(a.properties.at(-1)?.type===H.AST_NODE_TYPES.RestElement)return;for(let y of a.properties)y.type===H.AST_NODE_TYPES.Property&&y.key.type===H.AST_NODE_TYPES.Identifier&&f.push(y.key.name);let l=[],u=[];for(let[y,T]of p)f.includes(y)||(u.push(y),l.push({node:T,messageId:"unusedObjectTypeProperty",data:{propertyName:y}}));for(let[y,T]of l.entries())e.report({...T,fix:y===l.length-1?h=>{let m=a.properties.at(-1),E=u.join(", ");return m?m.type===H.AST_NODE_TYPES.RestElement?null:h.insertTextAfter(m,`, ${E}`):h.insertTextBeforeRange([a.range[0]+1,a.range[1]],E)}:void 0})}return{VariableDeclaration(a){let p=a.declarations[0],f=new Map,g=p.id.type===H.AST_NODE_TYPES.Identifier&&p.id.typeAnnotation?.typeAnnotation.type===H.AST_NODE_TYPES.TSTypeReference&&p.id.typeAnnotation.typeAnnotation.typeName.type===H.AST_NODE_TYPES.Identifier&&p.id.typeAnnotation.typeAnnotation.typeName.name==="FC"&&p.id.typeAnnotation.typeAnnotation.typeArguments?.params[0];if(g){if(g.type===H.AST_NODE_TYPES.TSTypeReference&&g.typeName.type===H.AST_NODE_TYPES.Identifier)s(!0,a,g.typeName,f,!1);else if(g.type===H.AST_NODE_TYPES.TSTypeLiteral)mr(f,...fr(g));else if(g.type===H.AST_NODE_TYPES.TSIntersectionType)for(let l of g.types)l.type===H.AST_NODE_TYPES.TSTypeReference&&l.typeName.type===H.AST_NODE_TYPES.Identifier?s(!0,a,l.typeName,f,!1):o(!0,a,f,l,!0);if(f.size!==0&&p.init?.type===H.AST_NODE_TYPES.ArrowFunctionExpression){let l=p.init.params[0];if(!l){e.report({node:p.init,messageId:"missingComponentParam"});return}l.type===H.AST_NODE_TYPES.ObjectPattern&&c(l,f)}}},FunctionDeclaration(a){i(!1,a,a.params,n)},ArrowFunctionExpression(a){i(!1,a,a.params,n)}}}}),tn={name:yr,rule:Qs};var Se=require("@typescript-eslint/utils");var nn=M({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===Se.AST_NODE_TYPES.Identifier?t.has(n.callee.name):n.callee.type===Se.AST_NODE_TYPES.MemberExpression&&n.callee.object.type===Se.AST_NODE_TYPES.Identifier&&n.callee.property.type===Se.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===Se.AST_NODE_TYPES.ImportSpecifier&&s.imported.type===Se.AST_NODE_TYPES.Identifier&&s.imported.name==="useRef"&&t.add(s.local.name)},VariableDeclarator(n){if(n.init&&n.init.type===Se.AST_NODE_TYPES.CallExpression&&r(n.init)&&n.id.type===Se.AST_NODE_TYPES.Identifier){let o=e.sourceCode.getScope(n).set.get(n.id.name);if(o){let i=!1;for(let c of o.references){let p=c.identifier.parent;if(p!==n&&!(p.type===Se.AST_NODE_TYPES.JSXExpressionContainer&&p.parent.type===Se.AST_NODE_TYPES.JSXAttribute&&p.parent.name.type===Se.AST_NODE_TYPES.JSXIdentifier&&p.parent.name.name==="ref")){i=!0;break}}i||e.report({node:n.id,messageId:"refNotRead",data:{name:n.id.name}})}}}}}});var Be=require("@typescript-eslint/utils"),eo=Be.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),gr="prefer-named-functions",dr=new Map,to=eo({name:gr,meta:{hasSuggestions:!0,type:"suggestion",docs:{description:"Prevent using arrow functions when a named function can be used instead"},schema:[{type:"object",properties:{ignoreRegex:{type:"string"},disallowArrowFnWithImplicitReturns:{type:"boolean"}}}],messages:{suggestion:"Convert to named function",default:'Function {{functionName}} should be defined as a named function "function {{functionName}} () {}" instead of an arrow function',withIgnoreRegex:'Function {{functionName}} should be defined as a named function "function {{functionName}} () {}", if not possible to use `function` you can also use a name that matches the rule ignore regex'}},defaultOptions:[{}],create(e,[t]){let r=null;if(t.ignoreRegex){let n=dr.get(t.ignoreRegex);n?r=n:(r=new RegExp(t.ignoreRegex),dr.set(t.ignoreRegex,r))}return{VariableDeclarator(n){if(n.init&&n.init.type===Be.AST_NODE_TYPES.ArrowFunctionExpression&&n.id.type===Be.AST_NODE_TYPES.Identifier){let s=n.id.name;if(n.id.typeAnnotation||r&&r.test(s)||!t.disallowArrowFnWithImplicitReturns&&n.init.body.type!==Be.AST_NODE_TYPES.BlockStatement)return;let o=n.parent,i=n.init.params,c=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:p=>p.replaceText(o,`${a.async?"async ":""}function ${s}(${i.map(f=>e.sourceCode.getText(f)).join(", ")||""}) ${e.sourceCode.getText(c)}`)}]})}}}}}),rn={name:gr,rule:to};var _=require("@typescript-eslint/utils"),Ce=require("zod/v4");var no=Ce.z.object({disallowedFunctions:Ce.z.array(Ce.z.object({name:Ce.z.string(),allowUsingWithArgs:Ce.z.boolean().optional(),hookAlternative:Ce.z.string().optional(),message:Ce.z.string().optional(),allowUseInside:Ce.z.array(Ce.z.string()).optional()}))}),ro=/^use[A-Z]/,io=/^[A-Z]/;function dt(e){return ro.test(e)}function Sr(e){return io.test(e)}function so(e){return e.type===_.AST_NODE_TYPES.Identifier?dt(e.name):e.type===_.AST_NODE_TYPES.MemberExpression&&e.property.type===_.AST_NODE_TYPES.Identifier?dt(e.property.name):!1}function Tr(e,t){return e.type===_.AST_NODE_TYPES.Identifier?e.name===t:e.type===_.AST_NODE_TYPES.MemberExpression&&e.object.type===_.AST_NODE_TYPES.Identifier&&e.property.type===_.AST_NODE_TYPES.Identifier?e.object.name==="React"&&e.property.name===t:!1}function hr(e){return!!(e.parent&&e.parent.type===_.AST_NODE_TYPES.CallExpression&&Tr(e.parent.callee,"forwardRef"))}function Er(e){return!!(e.parent&&e.parent.type===_.AST_NODE_TYPES.CallExpression&&Tr(e.parent.callee,"memo"))}function sn(e){if(e.type===_.AST_NODE_TYPES.FunctionDeclaration||e.type===_.AST_NODE_TYPES.FunctionExpression&&e.id)return e.id||void 0;if(e.type===_.AST_NODE_TYPES.FunctionExpression||e.type===_.AST_NODE_TYPES.ArrowFunctionExpression){if(e.parent.type===_.AST_NODE_TYPES.VariableDeclarator&&e.parent.init===e)return e.parent.id;if(e.parent.type===_.AST_NODE_TYPES.AssignmentExpression&&e.parent.right===e&&e.parent.operator==="=")return e.parent.left;if(e.parent.type===_.AST_NODE_TYPES.Property&&e.parent.value===e&&!e.parent.computed)return e.parent.key;if(e.parent.type===_.AST_NODE_TYPES.AssignmentPattern&&e.parent.right===e)return e.parent.left}}function oo(e){let t=e.parent,r=!1;for(;t;){if(t.type===_.AST_NODE_TYPES.FunctionDeclaration||t.type===_.AST_NODE_TYPES.FunctionExpression||t.type===_.AST_NODE_TYPES.ArrowFunctionExpression){let n=sn(t);if(n&&n.type===_.AST_NODE_TYPES.Identifier){if(Sr(n.name)||dt(n.name))return!r;r=!0}else{if(hr(t)||Er(t))return!r;if(t.parent.type===_.AST_NODE_TYPES.CallExpression){let s=t.parent;so(s.callee)||(r=!0)}else t.parent.type===_.AST_NODE_TYPES.JSXExpressionContainer||(r=!0)}}t=t.parent}return!1}function br(e){return e.callee.type===_.AST_NODE_TYPES.Identifier?e.callee.name:e.callee.type===_.AST_NODE_TYPES.MemberExpression&&e.callee.property.type===_.AST_NODE_TYPES.Identifier?e.callee.property.name:null}function ao(e,t){if(!t.length)return!1;let r=e.parent;for(;r;){if(r.type===_.AST_NODE_TYPES.FunctionDeclaration||r.type===_.AST_NODE_TYPES.FunctionExpression||r.type===_.AST_NODE_TYPES.ArrowFunctionExpression){let n=sn(r);if(n&&n.type===_.AST_NODE_TYPES.Identifier&&t.includes(n.name))return!0}else if(r.type===_.AST_NODE_TYPES.CallExpression){let n=br(r);if(n&&t.includes(n))return!0}r=r.parent}return!1}function lo(e){return e.arguments.length>0&&!e.arguments.every(t=>t.type===_.AST_NODE_TYPES.Identifier&&t.name==="undefined")}function po(e,t){let r=!1,n=e.parent;for(;n;){if(n.type===_.AST_NODE_TYPES.FunctionDeclaration||n.type===_.AST_NODE_TYPES.FunctionExpression||n.type===_.AST_NODE_TYPES.ArrowFunctionExpression){let s=sn(n);if(s&&s.type===_.AST_NODE_TYPES.Identifier){if(Sr(s.name)||dt(s.name)){r=!0;break}}else if(hr(n)||Er(n)){r=!0;break}}n=n.parent}return r?t.length===0?oo(e):!ao(e,t):!1}var on=M({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:[j(no)],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=br(s);if(!o)return;let i=n.get(o);if(!i||i.allowUsingWithArgs&&lo(s))return;let c=i.allowUseInside||[];po(s,c)&&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 p=i.hookAlternative;return p?s.callee.type===_.AST_NODE_TYPES.Identifier?a.replaceText(s.callee,p):s.callee.type===_.AST_NODE_TYPES.MemberExpression&&s.callee.property.type===_.AST_NODE_TYPES.Identifier?a.replaceText(s.callee.property,p):null:null}}]:[]})}}}});var G=require("@typescript-eslint/utils"),gt=he(require("zod/v4"));var co=G.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),Cr="prefer-single-line-if",uo=gt.default.object({maxLineLength:gt.default.number().optional(),maxNonSimpleConditionLength:gt.default.number().optional()}),fo=co({name:Cr,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:[j(uo)]},defaultOptions:[{}],create(e,[t]){let r=e.sourceCode;return{IfStatement(n){if(n.consequent.type!==G.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===G.AST_NODE_TYPES.ReturnStatement){if(!Ir(o))return}else if(!(o.type===G.AST_NODE_TYPES.ContinueStatement||o.type===G.AST_NODE_TYPES.BreakStatement))return;if(n.test.type===G.AST_NODE_TYPES.LogicalExpression||n.test.type===G.AST_NODE_TYPES.ConditionalExpression)return;let i;if(t.maxNonSimpleConditionLength){let g=xr(n.test);if(!g&&n.test.type===G.AST_NODE_TYPES.UnaryExpression&&n.test.operator==="!"){let l=n.test.argument;xr(l)&&(g=!0)}if(g&&(i=r.getText(n.test),i.length>t.maxNonSimpleConditionLength))return}i||(i=r.getText(n.test));let c=r.getText(o);if(i.includes(`
18
+ `))return;let a=r.getTokenAfter(n);if(a&&a.type===G.AST_TOKEN_TYPES.Punctuator&&a.value==="}"){let g=r.getTokenAfter(a);if(g&&g.type===G.AST_TOKEN_TYPES.Keyword&&(g.value==="else"||g.value==="catch"))return}let p=mo(r,n),f=`if (${i}) ${c}`;t.maxLineLength&&f.length+p.length>t.maxLineLength||e.report({node:n,messageId:"noSingleLineCurly",fix:g=>g.replaceText(n,f)})}}}});function xr(e){return e.type===G.AST_NODE_TYPES.CallExpression||e.type===G.AST_NODE_TYPES.BinaryExpression||e.type===G.AST_NODE_TYPES.MemberExpression&&Ar(e)}function Ar(e){return e.object.type===G.AST_NODE_TYPES.MemberExpression?Ar(e.object):e.object.type!==G.AST_NODE_TYPES.Identifier}function mo(e,t){return e.text.slice(t.range[0]-t.loc.start.column,t.range[0])}function Ir(e){if(!e.argument)return!0;let t=e.argument;return t.type===G.AST_NODE_TYPES.ArrayExpression&&t.elements.length===0||t.type===G.AST_NODE_TYPES.ObjectExpression&&t.properties.length===0||t.type===G.AST_NODE_TYPES.Literal||t.type===G.AST_NODE_TYPES.Identifier||t.type===G.AST_NODE_TYPES.TemplateLiteral||t.type===G.AST_NODE_TYPES.TaggedTemplateExpression?!0:t.type===G.AST_NODE_TYPES.CallExpression?t.arguments.length===0:t.type===G.AST_NODE_TYPES.UnaryExpression?Ir(t):!1}var an={name:Cr,rule:fo};var P=require("@typescript-eslint/utils"),pn=require("zod/v4");var yo=P.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),kr="react-compiler-extra",go=pn.z.object({runOnlyWithEnableCompilerDirective:pn.z.boolean().optional()}),So=/eslint +react-compiler\/react-compiler: +\["error/;function Fr(e){return e.type===P.AST_NODE_TYPES.Identifier?e.name.startsWith("use"):!1}function To(e){return e.type===P.AST_NODE_TYPES.Identifier?e.name.startsWith("use"):e.type===P.AST_NODE_TYPES.MemberExpression&&e.property.type===P.AST_NODE_TYPES.Identifier?e.property.name.startsWith("use"):!1}function Ae(e){if(!e)return!1;switch(e.type){case P.AST_NODE_TYPES.JSXElement:case P.AST_NODE_TYPES.JSXFragment:return!0;case P.AST_NODE_TYPES.ConditionalExpression:return Ae(e.consequent)||Ae(e.alternate);case P.AST_NODE_TYPES.LogicalExpression:return e.operator==="&&"?Ae(e.right):e.operator==="||"?Ae(e.left)||Ae(e.right):!1;case P.AST_NODE_TYPES.CallExpression:if(e.callee.type===P.AST_NODE_TYPES.MemberExpression&&e.callee.object.type===P.AST_NODE_TYPES.Identifier&&e.callee.object.name==="React"&&e.callee.property.type===P.AST_NODE_TYPES.Identifier&&e.callee.property.name==="createElement")return!0;for(let t of e.arguments)if(t.type!==P.AST_NODE_TYPES.SpreadElement&&Ae(t))return!0;return!1;default:return!1}}function ho(e){let t=e.typeAnnotation;if(t.type===P.AST_NODE_TYPES.TSTypeReference){if(t.typeName.type===P.AST_NODE_TYPES.Identifier)return t.typeName.name==="FC";if(t.typeName.type===P.AST_NODE_TYPES.TSQualifiedName&&t.typeName.left.type===P.AST_NODE_TYPES.Identifier&&t.typeName.right.type===P.AST_NODE_TYPES.Identifier)return t.typeName.left.name==="React"&&t.typeName.right.name==="FC"}return!1}var Eo=/^[A-Z][a-zA-Z0-9]*$/;function rt(e){return Eo.test(e)}function cn(e){return e.startsWith("use")&&e.length>3}function un(e,t,r,n){if(r&&ho(r))return t?rt(t.name):e.type===P.AST_NODE_TYPES.FunctionDeclaration&&e.id?rt(e.id.name):!0;if(t&&cn(t.name)||e.type===P.AST_NODE_TYPES.FunctionDeclaration&&e.id&&cn(e.id.name))return!0;if(n){let s=t?.name||e.type===P.AST_NODE_TYPES.FunctionDeclaration&&e.id?.name;if(s&&rt(s)&&Pr(e.body,n).containsJSX)return!0}return!1}function nt(e){if(e.body.type===P.AST_NODE_TYPES.BlockStatement){for(let t of e.body.body)if(t.type===P.AST_NODE_TYPES.ExpressionStatement&&t.expression.type===P.AST_NODE_TYPES.Literal&&typeof t.expression.value=="string"&&t.expression.value==="use memo")return!0}return!1}function Pr(e,t){let r={containsJSX:!1,containsHookCalls:!1};return Le(e,n=>{if(r.containsJSX&&r.containsHookCalls)return!0;switch(n.type){case P.AST_NODE_TYPES.JSXElement:case P.AST_NODE_TYPES.JSXFragment:r.containsJSX=!0;break;case P.AST_NODE_TYPES.CallExpression:Fr(n.callee)&&(r.containsHookCalls=!0),Ae(n)&&(r.containsJSX=!0);break;case P.AST_NODE_TYPES.ReturnStatement:n.argument&&Ae(n.argument)&&(r.containsJSX=!0);break;case P.AST_NODE_TYPES.VariableDeclarator:n.init&&Ae(n.init)&&(r.containsJSX=!0);break;case P.AST_NODE_TYPES.AssignmentExpression:Ae(n.right)&&(r.containsJSX=!0);break}},t),r}function Rr(e,t){let r=e.body,n=Pr(r,t);return n.containsJSX||n.containsHookCalls}var bo=/\bthis[.[]/;function wr(e){return bo.test(e)}function xo(e,t){let r={containsJSX:!1,containsHookCalls:!1};return Le(e,n=>{if(r.containsHookCalls||(n.type===P.AST_NODE_TYPES.FunctionDeclaration||n.type===P.AST_NODE_TYPES.FunctionExpression||n.type===P.AST_NODE_TYPES.ArrowFunctionExpression)&&n!==e)return!0;n.type===P.AST_NODE_TYPES.CallExpression&&To(n.callee)&&(r.containsHookCalls=!0)},t),r}function vr(e){return rt(e)||cn(e)}function ln(e,t,r,n){if(!xo(e.body,t).containsHookCalls)return!1;let o=un(e,r,n,t);if(!o&&n){let i=r?.name||e.type===P.AST_NODE_TYPES.FunctionDeclaration&&e.id?.name;i&&rt(i)&&(o=!0)}return!o}var Co=yo({name:kr,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:[j(go)]},defaultOptions:[{}],create(e,[t]){let r=!1;if(t.runOnlyWithEnableCompilerDirective){for(let o of e.sourceCode.getAllComments())if(So.test(o.value)){r=!0;break}if(!r)return{}}function n(o){for(let i of o.properties)if(i.type===P.AST_NODE_TYPES.Property&&i.method&&i.value.type===P.AST_NODE_TYPES.FunctionExpression){let c=e.sourceCode,a=c.getText(i.key),p=i.value,f=c.getText(p.body);if(wr(f))e.report({node:i,messageId:"thisKeywordInMethod"});else{let g=p.params.map(u=>c.getText(u)).join(", "),l="";p.generator?l=`${a}: function* (${g}) ${f}`:l=`${a}: (${g}) => ${f}`,e.report({node:i,messageId:"objectMethodIsNotSupported",fix:u=>u.replaceText(i,l)})}}}function s(o){for(let i of o.properties)if(i.type===P.AST_NODE_TYPES.Property&&i.value.type===P.AST_NODE_TYPES.ObjectExpression){for(let c of i.value.properties)if(c.type===P.AST_NODE_TYPES.Property&&c.method&&c.value.type===P.AST_NODE_TYPES.FunctionExpression){let p=e.sourceCode.getText(c.value.body);wr(p)&&e.report({node:c,messageId:"thisKeywordInMethod"})}}}return{CallExpression(o){if(Fr(o.callee))for(let i of o.arguments){if(i.type===P.AST_NODE_TYPES.ObjectExpression&&(n(i),s(i)),i.type===P.AST_NODE_TYPES.ArrowFunctionExpression&&(i.body.type===P.AST_NODE_TYPES.ObjectExpression&&(n(i.body),s(i.body)),i.body.type===P.AST_NODE_TYPES.BlockStatement))for(let c of i.body.body)c.type===P.AST_NODE_TYPES.ReturnStatement&&c.argument?.type===P.AST_NODE_TYPES.ObjectExpression&&(n(c.argument),s(c.argument));if(i.type===P.AST_NODE_TYPES.FunctionExpression)for(let c of i.body.body)c.type===P.AST_NODE_TYPES.ReturnStatement&&c.argument?.type===P.AST_NODE_TYPES.ObjectExpression&&(n(c.argument),s(c.argument))}},VariableDeclarator(o){if(o.id.type===P.AST_NODE_TYPES.Identifier&&o.init&&(o.init.type===P.AST_NODE_TYPES.ArrowFunctionExpression||o.init.type===P.AST_NODE_TYPES.FunctionExpression)){let i=o.init,c=o.id,a=o.id.typeAnnotation;if(nt(i)&&!vr(c.name)){e.report({node:i,messageId:"useMemoDirectiveNaming"});return}if(ln(i,e.sourceCode,c,a)){e.report({node:i,messageId:"functionCallingHooksMustBeComponent"});return}if(un(i,c,a,e.sourceCode)){let p=Rr(i,e.sourceCode),f=nt(i);!p&&!f&&e.report({node:i,messageId:"fcComponentShouldReturnJsx",suggest:[{messageId:"addUseMemoDirective",fix(g){if(i.body.type===P.AST_NODE_TYPES.BlockStatement){let l=i.body.range[0]+1;return g.insertTextAfterRange([l,l],`
19
19
  "use memo"
20
- `)}return null}}]})}}},FunctionDeclaration(o){if(o.id&&et(o)&&!Ar(o.id.name)){e.report({node:o,messageId:"useMemoDirectiveNaming"});return}if(on(o,e.sourceCode)){e.report({node:o,messageId:"functionCallingHooksMustBeComponent"});return}if(pn(o,void 0,void 0,e.sourceCode)){let i=xr(o,e.sourceCode),c=et(o);!i&&!c&&e.report({node:o,messageId:"fcComponentShouldReturnJsx",suggest:[{messageId:"addUseMemoDirective",fix(a){let p=o.body.range[0]+1;return a.insertTextAfterRange([p,p],`
20
+ `)}return null}}]})}}},FunctionDeclaration(o){if(o.id&&nt(o)&&!vr(o.id.name)){e.report({node:o,messageId:"useMemoDirectiveNaming"});return}if(ln(o,e.sourceCode)){e.report({node:o,messageId:"functionCallingHooksMustBeComponent"});return}if(un(o,void 0,void 0,e.sourceCode)){let i=Rr(o,e.sourceCode),c=nt(o);!i&&!c&&e.report({node:o,messageId:"fcComponentShouldReturnJsx",suggest:[{messageId:"addUseMemoDirective",fix(a){let p=o.body.range[0]+1;return a.insertTextAfterRange([p,p],`
21
21
  "use memo"
22
- `)}}]})}},FunctionExpression(o){if(et(o)){e.report({node:o,messageId:"useMemoDirectiveNaming"});return}on(o,e.sourceCode)&&e.report({node:o,messageId:"functionCallingHooksMustBeComponent"})}}}}),cn={name:Ir,rule:To};var ce=require("@typescript-eslint/utils"),he=require("zod/v4");var ho=ce.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),vr="react-compiler-migration",Eo=he.z.object({disallowHooks:he.z.array(he.z.object({name:he.z.string(),replacement:he.z.string()})).optional(),disallowMethods:he.z.array(he.z.object({name:he.z.string(),replacement:he.z.string().optional(),requireTrueProp:he.z.string().optional()})).optional()}),bo=/eslint +react-compiler\/react-compiler: +\["error/;function xo(e){return e.type===ce.AST_NODE_TYPES.Identifier?e.name.startsWith("use"):e.type===ce.AST_NODE_TYPES.MemberExpression&&e.property.type===ce.AST_NODE_TYPES.Identifier?e.property.name.startsWith("use"):!1}var Co=ho({name:vr,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:[j(Eo)]},defaultOptions:[{disallowHooks:[],disallowMethods:[]}],create(e,[n]){let r=!1;for(let t of e.sourceCode.getAllComments())if(bo.test(t.value)){r=!0;break}return r?{CallExpression(t){if(n.disallowHooks?.length){let s=null,o=null;if(t.callee.type===ce.AST_NODE_TYPES.Identifier?(s=t.callee.name,o=t.callee):t.callee.type===ce.AST_NODE_TYPES.MemberExpression&&t.callee.property.type===ce.AST_NODE_TYPES.Identifier&&(s=t.callee.property.name,o=t.callee.property),s){let i=n.disallowHooks.find(c=>c.name===s);i&&o&&e.report({node:t,messageId:"disallowedFunctionOrMethod",data:{functionOrMethod:i.name,replacement:i.replacement},suggest:[{messageId:"replace",data:{replacement:i.replacement},fix:c=>c.replaceText(o,i.replacement)}]})}}if(n.disallowMethods?.length&&xo(t.callee)){for(let s of t.arguments)if(s.type===ce.AST_NODE_TYPES.ObjectExpression){for(let o of s.properties)if(o.type===ce.AST_NODE_TYPES.Property&&o.key.type===ce.AST_NODE_TYPES.Identifier){let i=o.key.name,c=n.disallowMethods.find(a=>a.name===i);if(c){if(c.requireTrueProp){let a=c.requireTrueProp,p=!1;for(let m of s.properties)if(m.type===ce.AST_NODE_TYPES.Property&&m.key.type===ce.AST_NODE_TYPES.Identifier&&m.key.name===a&&m.value.type===ce.AST_NODE_TYPES.Literal&&m.value.value===!0){p=!0;break}if(!p){e.report({node:o,messageId:"disallowedMethodWithMissingRequireTrueProp",data:{method:c.name,requireTrueProp:a}});continue}}c.replacement&&e.report({node:o,messageId:"disallowedFunctionOrMethod",data:{functionOrMethod:c.name,replacement:c.replacement},suggest:[{messageId:"replace",data:{replacement:c.replacement},fix:a=>c.replacement?a.replaceText(o.key,c.replacement):null}]})}}}}}}:{}}}),un={name:vr,rule:Co};var F=require("@typescript-eslint/utils"),mn=require("zod");var Ao=mn.z.object({runOnlyWithEnableCompilerDirective:mn.z.boolean().optional()}),Io=/eslint +react-compiler\/react-compiler: +\["error/,Ro=/^\d+$/,wo=/[\s_-]+/,vo=/[a-z][A-Z]/,Fo=/^(.+?)([A-Z][a-z]+s?)$/,ko=/^[a-z][a-zA-Z]*$/;function Fr(e,n){let r=[];if(e.type===F.AST_NODE_TYPES.JSXElement){for(let t of e.openingElement.attributes)if(t.type===F.AST_NODE_TYPES.JSXAttribute&&t.name.type===F.AST_NODE_TYPES.JSXIdentifier&&t.value?.type===F.AST_NODE_TYPES.JSXExpressionContainer&&t.value.expression.type!==F.AST_NODE_TYPES.JSXEmptyExpression){let s=t.name.name,o=t.value.expression,i=!1;De(o,c=>{switch(c.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},n),i&&r.push(s)}}return{hasUnstable:r.length>0,problematicProps:r}}function Po(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 n of e.body.body)if(n.type===F.AST_NODE_TYPES.ReturnStatement&&n.argument&&(n.argument.type===F.AST_NODE_TYPES.JSXElement||n.argument.type===F.AST_NODE_TYPES.JSXFragment))return!0}return!1}function Oo(e,n){let r=e.callee;if(r.type===F.AST_NODE_TYPES.MemberExpression){let t=r.object;if(t.type===F.AST_NODE_TYPES.Identifier){let s=t.name,o=No(s);if(o!==s)return yn(o)}}if(n.length>0){let t=n[0];if(t&&t.type===F.AST_NODE_TYPES.Identifier)return yn(t.name)}return"ListItem"}function No(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(vo)){let t=e.match(Fo);if(t){let s=t[1],o=t[2];if(!s||!o)return fn(e);let i=fn(o);if(i!==o)return s+i}}return fn(e)}function fn(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 yn(e){return e.match(ko)?e.charAt(0).toUpperCase()+e.slice(1):e.split(wo).map(n=>n.charAt(0).toUpperCase()+n.slice(1).toLowerCase()).join("")}function kr(e,n,r){let t=[],s=new Set,o=new Set(["console","document","window","Math","Object","Array","String","Number","Boolean","undefined","null"]);De(e,i=>{if(i.type===F.AST_NODE_TYPES.Identifier&&!n.includes(i.name)&&!o.has(i.name)&&!Ro.test(i.name)){let c=i.parent;if(c.type===F.AST_NODE_TYPES.Property&&c.key===i||c.type===F.AST_NODE_TYPES.MemberExpression&&c.property===i&&!c.computed||c.type===F.AST_NODE_TYPES.JSXOpeningElement||c.type===F.AST_NODE_TYPES.JSXClosingElement||c.type===F.AST_NODE_TYPES.JSXAttribute&&c.name.type===F.AST_NODE_TYPES.JSXIdentifier&&c.name.name===i.name)return!1;s.add(i.name)}return!1},r);for(let i of s)n.includes(i)||t.push({name:i,type:"unknown"});return t}function Pr(e,n,r,t,s){let i=[...r.map(g=>g.type===F.AST_NODE_TYPES.Identifier?g.name:"item").map((g,l)=>({name:g,type:l===0?`${e}Type`:l===1?"number":"unknown"})),...t],c=i.map(g=>{let l=g.type;return g.name.includes("on")&&l==="any"&&(l="unknown"),` ${g.name}: ${l};`}).join(`
23
- `),a=i.map(g=>g.name).join(", "),p=s.getText(n),m=`${e}Props`;return`type ${m} = {
22
+ `)}}]})}},FunctionExpression(o){if(nt(o)){e.report({node:o,messageId:"useMemoDirectiveNaming"});return}ln(o,e.sourceCode)&&e.report({node:o,messageId:"functionCallingHooksMustBeComponent"})}}}}),fn={name:kr,rule:Co};var ce=require("@typescript-eslint/utils"),Ee=require("zod/v4");var Ao=ce.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),Or="react-compiler-migration",Io=Ee.z.object({disallowHooks:Ee.z.array(Ee.z.object({name:Ee.z.string(),replacement:Ee.z.string()})).optional(),disallowMethods:Ee.z.array(Ee.z.object({name:Ee.z.string(),replacement:Ee.z.string().optional(),requireTrueProp:Ee.z.string().optional()})).optional()}),Ro=/eslint +react-compiler\/react-compiler: +\["error/;function wo(e){return e.type===ce.AST_NODE_TYPES.Identifier?e.name.startsWith("use"):e.type===ce.AST_NODE_TYPES.MemberExpression&&e.property.type===ce.AST_NODE_TYPES.Identifier?e.property.name.startsWith("use"):!1}var vo=Ao({name:Or,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:[j(Io)]},defaultOptions:[{disallowHooks:[],disallowMethods:[]}],create(e,[t]){let r=!1;for(let n of e.sourceCode.getAllComments())if(Ro.test(n.value)){r=!0;break}return r?{CallExpression(n){if(t.disallowHooks?.length){let s=null,o=null;if(n.callee.type===ce.AST_NODE_TYPES.Identifier?(s=n.callee.name,o=n.callee):n.callee.type===ce.AST_NODE_TYPES.MemberExpression&&n.callee.property.type===ce.AST_NODE_TYPES.Identifier&&(s=n.callee.property.name,o=n.callee.property),s){let i=t.disallowHooks.find(c=>c.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:c=>c.replaceText(o,i.replacement)}]})}}if(t.disallowMethods?.length&&wo(n.callee)){for(let s of n.arguments)if(s.type===ce.AST_NODE_TYPES.ObjectExpression){for(let o of s.properties)if(o.type===ce.AST_NODE_TYPES.Property&&o.key.type===ce.AST_NODE_TYPES.Identifier){let i=o.key.name,c=t.disallowMethods.find(a=>a.name===i);if(c){if(c.requireTrueProp){let a=c.requireTrueProp,p=!1;for(let f of s.properties)if(f.type===ce.AST_NODE_TYPES.Property&&f.key.type===ce.AST_NODE_TYPES.Identifier&&f.key.name===a&&f.value.type===ce.AST_NODE_TYPES.Literal&&f.value.value===!0){p=!0;break}if(!p){e.report({node:o,messageId:"disallowedMethodWithMissingRequireTrueProp",data:{method:c.name,requireTrueProp:a}});continue}}c.replacement&&e.report({node:o,messageId:"disallowedFunctionOrMethod",data:{functionOrMethod:c.name,replacement:c.replacement},suggest:[{messageId:"replace",data:{replacement:c.replacement},fix:a=>c.replacement?a.replaceText(o.key,c.replacement):null}]})}}}}}}:{}}}),mn={name:Or,rule:vo};var k=require("@typescript-eslint/utils"),dn=require("zod");var ko=dn.z.object({runOnlyWithEnableCompilerDirective:dn.z.boolean().optional()}),Fo=/eslint +react-compiler\/react-compiler: +\["error/,Po=/^\d+$/,Oo=/[\s_-]+/,No=/[a-z][A-Z]/,Do=/^(.+?)([A-Z][a-z]+s?)$/,Lo=/^[a-z][a-zA-Z]*$/;function Nr(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;Le(o,c=>{switch(c.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 jo(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 Mo(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=_o(s);if(o!==s)return gn(o)}}if(t.length>0){let n=t[0];if(n&&n.type===k.AST_NODE_TYPES.Identifier)return gn(n.name)}return"ListItem"}function _o(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(No)){let n=e.match(Do);if(n){let s=n[1],o=n[2];if(!s||!o)return yn(e);let i=yn(o);if(i!==o)return s+i}}return yn(e)}function yn(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 gn(e){return e.match(Lo)?e.charAt(0).toUpperCase()+e.slice(1):e.split(Oo).map(t=>t.charAt(0).toUpperCase()+t.slice(1).toLowerCase()).join("")}function Dr(e,t,r){let n=[],s=new Set,o=new Set(["console","document","window","Math","Object","Array","String","Number","Boolean","undefined","null"]);Le(e,i=>{if(i.type===k.AST_NODE_TYPES.Identifier&&!t.includes(i.name)&&!o.has(i.name)&&!Po.test(i.name)){let c=i.parent;if(c.type===k.AST_NODE_TYPES.Property&&c.key===i||c.type===k.AST_NODE_TYPES.MemberExpression&&c.property===i&&!c.computed||c.type===k.AST_NODE_TYPES.JSXOpeningElement||c.type===k.AST_NODE_TYPES.JSXClosingElement||c.type===k.AST_NODE_TYPES.JSXAttribute&&c.name.type===k.AST_NODE_TYPES.JSXIdentifier&&c.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 Lr(e,t,r,n,s){let i=[...r.map(g=>g.type===k.AST_NODE_TYPES.Identifier?g.name:"item").map((g,l)=>({name:g,type:l===0?`${e}Type`:l===1?"number":"unknown"})),...n],c=i.map(g=>{let l=g.type;return g.name.includes("on")&&l==="any"&&(l="unknown"),` ${g.name}: ${l};`}).join(`
23
+ `),a=i.map(g=>g.name).join(", "),p=s.getText(t),f=`${e}Props`;return`type ${f} = {
24
24
  ${c}
25
25
  };
26
26
 
27
- const ${e}: FC<${m}> = ({ ${a} }) => {
27
+ const ${e}: FC<${f}> = ({ ${a} }) => {
28
28
  return (
29
29
  ${p}
30
30
  );
31
- };`}function Do(e,n,r,t){let s=n.map(i=>i.type===F.AST_NODE_TYPES.Identifier?i.name:"item"),o=[t?`key={${t}}`:`key={${s[0]}.id}`,...s.map(i=>`${i}={${i}}`),...r.map(i=>`${i.name}={${i.name}}`)].filter(Boolean);return`<${e} ${o.join(" ")} />`}function Lo(e){if(e.type===F.AST_NODE_TYPES.JSXElement&&e.openingElement.name.type===F.AST_NODE_TYPES.JSXIdentifier){let n=e.openingElement.name.name;if(n!=="div"&&n!=="span")return yn(n)}return"ListItem"}function jo(e,n,r){let t=[r?`key={${r}}`:"",...n.map(s=>`${s.name}={${s.name}}`)].filter(Boolean);return`<${e}${t.length>0?` ${t.join(" ")}`:""} />`}function Or(e,n){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 n.getText(r.value.expression);return null}var dn=U({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:[j(Ao)],hasSuggestions:!0},defaultOptions:[{runOnlyWithEnableCompilerDirective:!1}],create(e,[n]){let{sourceCode:r}=e;if(n.runOnlyWithEnableCompilerDirective){let t=!1;for(let s of r.getAllComments())if(Io.test(s.value)){t=!0;break}if(!t)return{}}return{CallExpression(t){t.callee.type===F.AST_NODE_TYPES.MemberExpression&&t.callee.property.type===F.AST_NODE_TYPES.Identifier&&(t.callee.property.name==="map"||t.callee.property.name==="push")&&(t.callee.property.name==="map"?Mo(t,r,e):$o(t,r,e))}}}});function Mo(e,n,r){let t=e.arguments[0];if(!t||t.type!==F.AST_NODE_TYPES.ArrowFunctionExpression&&t.type!==F.AST_NODE_TYPES.FunctionExpression||!Po(t))return;let s=null;if(t.body.type===F.AST_NODE_TYPES.JSXElement||t.body.type===F.AST_NODE_TYPES.JSXFragment?s=t.body:t.body.type===F.AST_NODE_TYPES.BlockStatement&&t.body.body[0]?.type===F.AST_NODE_TYPES.ReturnStatement&&t.body.body[0].argument&&(t.body.body[0].argument.type===F.AST_NODE_TYPES.JSXElement||t.body.body[0].argument.type===F.AST_NODE_TYPES.JSXFragment)&&(s=t.body.body[0].argument),!s)return;let o=Fr(s,n);if(!o.hasUnstable)return;let i=Oo(e,t.params),c=t.params.map(g=>g.type===F.AST_NODE_TYPES.Identifier?g.name:"item"),a=kr(s,c,n),p=s.type===F.AST_NODE_TYPES.JSXElement?Or(s,n):null,m=o.problematicProps.length===1?`prop "${o.problematicProps[0]}"`:`props "${o.problematicProps.join('", "')}"`;r.report({node:s,messageId:"unstableValueInMap",data:{problematicProps:m},suggest:[{messageId:"extractComponent",data:{componentName:i},fix:g=>{let l=Pr(i,s,t.params,a,n),u=Do(i,t.params,a,p),y=e;for(;y.parent.type!==F.AST_NODE_TYPES.Program&&!(y.type===F.AST_NODE_TYPES.FunctionDeclaration||y.type===F.AST_NODE_TYPES.VariableDeclarator&&y.init&&(y.init.type===F.AST_NODE_TYPES.ArrowFunctionExpression||y.init.type===F.AST_NODE_TYPES.FunctionExpression));)y=y.parent;let T=[];return T.push(g.insertTextAfter(y,`
31
+ };`}function $o(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 Uo(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 gn(t)}return"ListItem"}function Wo(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 jr(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 Sn=M({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:[j(ko)],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(Fo.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"?zo(n,r,e):Jo(n,r,e))}}}});function zo(e,t,r){let n=e.arguments[0];if(!n||n.type!==k.AST_NODE_TYPES.ArrowFunctionExpression&&n.type!==k.AST_NODE_TYPES.FunctionExpression||!jo(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=Nr(s,t);if(!o.hasUnstable)return;let i=Mo(e,n.params),c=n.params.map(g=>g.type===k.AST_NODE_TYPES.Identifier?g.name:"item"),a=Dr(s,c,t),p=s.type===k.AST_NODE_TYPES.JSXElement?jr(s,t):null,f=o.problematicProps.length===1?`prop "${o.problematicProps[0]}"`:`props "${o.problematicProps.join('", "')}"`;r.report({node:s,messageId:"unstableValueInMap",data:{problematicProps:f},suggest:[{messageId:"extractComponent",data:{componentName:i},fix:g=>{let l=Lr(i,s,n.params,a,t),u=$o(i,n.params,a,p),y=e;for(;y.parent.type!==k.AST_NODE_TYPES.Program&&!(y.type===k.AST_NODE_TYPES.FunctionDeclaration||y.type===k.AST_NODE_TYPES.VariableDeclarator&&y.init&&(y.init.type===k.AST_NODE_TYPES.ArrowFunctionExpression||y.init.type===k.AST_NODE_TYPES.FunctionExpression));)y=y.parent;let T=[];return T.push(g.insertTextAfter(y,`
32
32
 
33
- ${l}`)),T.push(g.replaceText(s,u)),T}}]})}function $o(e,n,r){let t=e.arguments[0];if(!t||t.type!==F.AST_NODE_TYPES.JSXElement&&t.type!==F.AST_NODE_TYPES.JSXFragment)return;let s=t,o=Fr(s,n);if(!o.hasUnstable)return;let i=Lo(s),c=kr(s,[],n),a=s.type===F.AST_NODE_TYPES.JSXElement?Or(s,n):null,p=o.problematicProps.length===1?`prop "${o.problematicProps[0]}"`:`props "${o.problematicProps.join('", "')}"`;r.report({node:s,messageId:"unstableValueInMap",data:{problematicProps:p},suggest:[{messageId:"extractComponent",data:{componentName:i},fix:m=>{let g=Pr(i,s,[],c,n),l=jo(i,c,a),u=e;for(;u.parent.type!==F.AST_NODE_TYPES.Program&&!(u.type===F.AST_NODE_TYPES.FunctionDeclaration||u.type===F.AST_NODE_TYPES.VariableDeclarator&&u.init&&(u.init.type===F.AST_NODE_TYPES.ArrowFunctionExpression||u.init.type===F.AST_NODE_TYPES.FunctionExpression));)u=u.parent;let y=[];return y.push(m.insertTextAfter(u,`
33
+ ${l}`)),T.push(g.replaceText(s,u)),T}}]})}function Jo(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=Nr(s,t);if(!o.hasUnstable)return;let i=Uo(s),c=Dr(s,[],t),a=s.type===k.AST_NODE_TYPES.JSXElement?jr(s,t):null,p=o.problematicProps.length===1?`prop "${o.problematicProps[0]}"`:`props "${o.problematicProps.join('", "')}"`;r.report({node:s,messageId:"unstableValueInMap",data:{problematicProps:p},suggest:[{messageId:"extractComponent",data:{componentName:i},fix:f=>{let g=Lr(i,s,[],c,t),l=Wo(i,c,a),u=e;for(;u.parent.type!==k.AST_NODE_TYPES.Program&&!(u.type===k.AST_NODE_TYPES.FunctionDeclaration||u.type===k.AST_NODE_TYPES.VariableDeclarator&&u.init&&(u.init.type===k.AST_NODE_TYPES.ArrowFunctionExpression||u.init.type===k.AST_NODE_TYPES.FunctionExpression));)u=u.parent;let y=[];return y.push(f.insertTextAfter(u,`
34
34
 
35
- ${g}`)),y.push(m.replaceText(s,l)),y}}]})}var dt=require("@typescript-eslint/utils"),_o=dt.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),Nr="require-description",Uo=/^(eslint(?:-env|-enable|-disable(?:(?:-next)?-line)?)?|exported|globals?)(?:\s|$)/u,Wo=/^eslint-disable-(next-)?line$/u,zo=_o({name:Nr,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,[n]){let r=e.sourceCode,t=new Set(n.ignore||[]);return{Program(){for(let s of r.getAllComments()){let o=Jo(s);o!=null&&(t.has(o.kind)||o.description||e.report({loc:Ho(s.loc),messageId:"missingDescription"}))}}}}}),Dr={name:Nr,rule:zo};function Jo(e){let{text:n,description:r}=Xo(e.value);if(!n)return null;let t=Uo.exec(n);if(!t)return null;let s=t[1];if(!s)return null;let o=Wo.test(s);if(e.type===dt.TSESTree.AST_TOKEN_TYPES.Line&&!o||o&&e.loc.start.line!==e.loc.end.line)return null;let i=n.slice(t.index+s.length);return{kind:s,value:i.trim(),description:r}}var Vo=/\s-{2,}\s/u;function Xo(e){let n=e.split(Vo);return{text:n[0]?.trim(),description:n.length>1?n[1]?.trim()??null:null}}function Ho(e){return{start:{line:e.start.line,column:-1},end:e.end}}var J=require("@typescript-eslint/utils"),Ae=require("zod/v4");var Bo=Ae.z.object({varsToCheck:Ae.z.array(Ae.z.object({selector:Ae.z.string().optional(),fromFnCall:Ae.z.string().optional(),prop:Ae.z.string().or(Ae.z.array(Ae.z.string())),errorMsg:Ae.z.string().optional()}))}),gn=U({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:[j(Bo)]},defaultOptions:[{varsToCheck:[]}],create(e,[n]){let r=new Map;function t(i,c,a,p){let m=new Set;for(let l of i.properties)l.type===J.AST_NODE_TYPES.Property&&l.key.type===J.AST_NODE_TYPES.Identifier&&m.add(l.key.name);let g=c.filter(l=>!m.has(l));if(g.length>0)if(g.length===1)e.report({node:i,messageId:"propNotRead",data:{prop:g[0],fnName:p,customMsg:a||""}});else{let l=g.map(u=>`"${u}"`).join(", ");e.report({node:i,messageId:"propsNotRead",data:{props:l,fnName:p,customMsg:a||""}})}}function s(i){if(i.init?.type===J.AST_NODE_TYPES.CallExpression){if(i.init.callee.type===J.AST_NODE_TYPES.Identifier)return i.init.callee.name;if(i.init.callee.type===J.AST_NODE_TYPES.MemberExpression&&i.init.callee.property.type===J.AST_NODE_TYPES.Identifier)return i.init.callee.object.type===J.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 n.varsToCheck)i.selector&&(o[i.selector]=c=>{if(c.type===J.AST_NODE_TYPES.VariableDeclarator&&c.id.type===J.AST_NODE_TYPES.Identifier&&r.set(c.id.name,{props:Array.isArray(i.prop)?i.prop:[i.prop],errorMsg:i.errorMsg,node:c.id,fnName:s(c)}),c.type===J.AST_NODE_TYPES.VariableDeclarator&&c.id.type===J.AST_NODE_TYPES.ObjectPattern){let a=Array.isArray(i.prop)?i.prop:[i.prop];t(c.id,a,i.errorMsg,s(c))}});for(let i of n.varsToCheck)if(i.fromFnCall){let c=i.fromFnCall;if(c.startsWith("*.")){let p=`VariableDeclarator > CallExpression > MemberExpression[property.name="${c.slice(2)}"]`;o[p]=m=>{if(m.type!==J.AST_NODE_TYPES.MemberExpression||m.parent.type!==J.AST_NODE_TYPES.CallExpression)return;let g=m.parent;if(g.parent.type!==J.AST_NODE_TYPES.VariableDeclarator)return;let l=g.parent;if(l.id.type===J.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===J.AST_NODE_TYPES.ObjectPattern){let u=Array.isArray(i.prop)?i.prop:[i.prop];t(l.id,u,i.errorMsg,i.fromFnCall||"unknown function")}}}else if(c.includes(".")){let[a,p]=c.split("."),m=`VariableDeclarator > CallExpression > MemberExpression[object.name="${a}"][property.name="${p}"]`;o[m]=g=>{if(g.type!==J.AST_NODE_TYPES.MemberExpression||g.parent.type!==J.AST_NODE_TYPES.CallExpression)return;let l=g.parent;if(l.parent.type!==J.AST_NODE_TYPES.VariableDeclarator)return;let u=l.parent;if(u.id.type===J.AST_NODE_TYPES.Identifier)r.set(u.id.name,{props:Array.isArray(i.prop)?i.prop:[i.prop],errorMsg:i.errorMsg,node:u.id,fnName:i.fromFnCall||"unknown function"});else if(u.id.type===J.AST_NODE_TYPES.ObjectPattern){let y=Array.isArray(i.prop)?i.prop:[i.prop];t(u.id,y,i.errorMsg,i.fromFnCall||"unknown function")}}}else{let a=`VariableDeclarator > CallExpression > Identifier[name="${c}"]`;o[a]=p=>{if(p.type!==J.AST_NODE_TYPES.Identifier||p.parent.type!==J.AST_NODE_TYPES.CallExpression)return;let m=p.parent;if(m.parent.type!==J.AST_NODE_TYPES.VariableDeclarator)return;let g=m.parent;if(g.id.type===J.AST_NODE_TYPES.Identifier)r.set(g.id.name,{props:Array.isArray(i.prop)?i.prop:[i.prop],errorMsg:i.errorMsg,node:g.id,fnName:i.fromFnCall||"unknown function"});else if(g.id.type===J.AST_NODE_TYPES.ObjectPattern){let l=Array.isArray(i.prop)?i.prop:[i.prop];t(g.id,l,i.errorMsg,i.fromFnCall||"unknown function")}}}}return{...o,"Program:exit"(){for(let[i,{props:c,errorMsg:a,node:p,fnName:m}]of r){let l=e.sourceCode.getScope(p).set.get(i);if(l){let u=new Set(c);for(let y of l.references){let T=y.identifier,h=T.parent;if(!(h.type===J.AST_NODE_TYPES.VariableDeclarator&&h.id===T)){if(h.type===J.AST_NODE_TYPES.MemberExpression&&h.object===T&&h.property.type===J.AST_NODE_TYPES.Identifier&&u.has(h.property.name)){if(u.delete(h.property.name),u.size===0)break;continue}if(h.type===J.AST_NODE_TYPES.VariableDeclarator&&h.init===T&&h.id.type===J.AST_NODE_TYPES.ObjectPattern){for(let f of h.id.properties)f.type===J.AST_NODE_TYPES.Property&&f.key.type===J.AST_NODE_TYPES.Identifier&&u.has(f.key.name)&&u.delete(f.key.name);if(u.size===0)break;continue}if(!(h.type===J.AST_NODE_TYPES.MemberExpression&&h.object===T&&h.property.type===J.AST_NODE_TYPES.Identifier&&!c.includes(h.property.name))){u.clear();break}}}if(u.size>0){let y=Array.from(u);if(y.length===1)e.report({node:p,messageId:"propNotRead",data:{prop:y[0],fnName:m,customMsg:a||""}});else{let T=y.map(h=>`"${h}"`).join(", ");e.report({node:p,messageId:"propsNotRead",data:{props:T,fnName:m,customMsg:a||""}})}}}}}}}});function Mr(e){return/^use[A-Z0-9]/.test(e)}function gt(e){return e.type==="Identifier"?Mr(e.name):e.type==="MemberExpression"&&!e.computed&&gt(e.property)?e.object.type==="Identifier":!1}function $r(e){return e.type==="Identifier"&&/^[A-Z]/.test(e.name)}function _r(e,n){return e.name===n||e.type==="MemberExpression"&&e.object.name==="React"&&e.property.name===n}function Ur(e){return!!(e.parent&&e.parent.callee&&_r(e.parent.callee,"forwardRef"))}function Wr(e){return!!(e.parent&&e.parent.callee&&_r(e.parent.callee,"memo"))}function Sn(e){for(;e;){let n=Jr(e);if(n&&($r(n)||gt(n))||Ur(e)||Wr(e))return!0;e=e.parent}return!1}function Lr(e){return!1}function Tn(e){return!1}var Yo=/eslint +react-compiler\/react-compiler: +\["error/,zr={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(Yo.test(a.value))return{CallExpression(p){let m=null;p.callee.name==="useMemo"?m="useMemo":p.callee.name==="useCallback"&&(m="useCallback"),m&&e.report({node:p,message:`"${m}" is not necessary when using React Compiler.`})}}}let n=typeof e.getSource=="function"?a=>n(a):a=>e.sourceCode.getText(a),r=typeof e.getScope=="function"?()=>r():a=>e.sourceCode.getScope(a),t=null,s=[],o=[],i=new WeakSet;function c(a){for(let p of a.references){let m=p.identifier.parent;if(m.type==="VariableDeclarator"&&m.init&&m.init.type==="CallExpression"&&m.init.callee&&Lr(m.init.callee))for(let g of p.resolved.references)g!==p&&i.add(g.identifier)}}return{onCodePathSegmentStart:a=>o.push(a),onCodePathSegmentEnd:()=>o.pop(),onCodePathStart:()=>s.push(new Map),onCodePathEnd(a,p){let m=s.pop();if(m.size===0)return;let g=new Set;function l(d,b){let{cache:S}=l,C=S.get(d.id),w=new Set(b);if(w.has(d.id)){let I=[...w],O=I.slice(I.indexOf(d.id)+1);for(let $ of O)g.add($);return BigInt("0")}if(w.add(d.id),C!==void 0)return C;if(a.thrownSegments.includes(d))C=BigInt("0");else if(d.prevSegments.length===0)C=BigInt("1");else{C=BigInt("0");for(let I of d.prevSegments)C+=l(I,w)}return d.reachable&&C===BigInt("0")?S.delete(d.id):S.set(d.id,C),C}function u(d,b){let{cache:S}=u,C=S.get(d.id),w=new Set(b);if(w.has(d.id)){let I=Array.from(w),O=I.slice(I.indexOf(d.id)+1);for(let $ of O)g.add($);return BigInt("0")}if(w.add(d.id),C!==void 0)return C;if(a.thrownSegments.includes(d))C=BigInt("0");else if(d.nextSegments.length===0)C=BigInt("1");else{C=BigInt("0");for(let I of d.nextSegments)C+=u(I,w)}return S.set(d.id,C),C}function y(d){let{cache:b}=y,S=b.get(d.id);if(S===null)return 1/0;if(S!==void 0)return S;if(b.set(d.id,null),d.prevSegments.length===0)S=1;else{S=1/0;for(let C of d.prevSegments){let w=y(C);w<S&&(S=w)}S+=1}return b.set(d.id,S),S}l.cache=new Map,u.cache=new Map,y.cache=new Map;let T=u(a.initialSegment),h=Jr(p),f=Sn(p),E=h?$r(h)||gt(h):Ur(p)||Wr(p),x=1/0;for(let d of a.finalSegments){if(!d.reachable)continue;let b=y(d);b<x&&(x=b)}for(let[d,b]of m){if(!d.reachable)continue;let S=d.nextSegments.length===0?x<=y(d):x<y(d),C=l(d)*u(d),w=g.has(d.id);for(let I of b)if(w&&!Tn(I)&&e.report({node:I,message:`React Hook "${n(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.`}),E){if(p.async&&e.report({node:I,message:`React Hook "${n(I)}" cannot be called in an async function.`}),!w&&C!==T&&!Tn(I)){let $=`React Hook "${n(I)}" is called conditionally. React Hooks must be called in the exact same order in every component render.`+(S?" Did you accidentally call a React Hook after an early return?":"");e.report({node:I,message:$})}}else if(p.parent&&(p.parent.type==="MethodDefinition"||p.parent.type==="ClassProperty")&&p.parent.value===p){let O=`React Hook "${n(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:O})}else if(h){let O=`React Hook "${n(I)}" is called in function "${n(h)}" 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:O})}else if(p.type==="Program"){let O=`React Hook "${n(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:O})}else if(f&&!Tn(I)){if(p.parent.type==="CallExpression"&&p.parent.callee.type==="Identifier"&&p.parent.callee.name==="useCallback"){let $=p.parent;if($.parent.type==="VariableDeclarator"&&Mr($.parent.id.name))return}let O=`React Hook "${n(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:O})}}},CallExpression(a){if(gt(a.callee)){let p=jr(s),m=jr(o),g=p.get(m);g||(g=[],p.set(m,g)),g.push(a.callee)}a.callee.type==="Identifier"&&(a.callee.name==="useEffect"||Lr(a.callee))&&a.arguments.length>0&&(t=a)},Identifier(a){t==null&&i.has(a)&&a.parent.type!=="CallExpression"&&e.report({node:a,message:`\`${n(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===t&&(t=null)},FunctionDeclaration(a){Sn(a)&&c(r(a))},ArrowFunctionExpression(a){Sn(a)&&c(r(a))}}}};function Jr(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 jr(e){return e[e.length-1]}var ie=require("@typescript-eslint/utils"),ue=Te(require("zod/v4"));var qo=/^\s+$/,hn=/\r?\n/,Zo=/^(\s*)/,Go=/^(\s*)\S/,Ko=/\r?\n/,Qo=ue.object({indent:ue.union([ue.string().regex(qo),ue.number().int().min(1)]).optional(),tags:ue.array(ue.string()).optional(),functions:ue.array(ue.string()).optional(),comments:ue.array(ue.string()).optional()}),En=U({name:"template-indent",meta:{type:"suggestion",docs:{description:"Fix whitespace-insensitive template indentation"},fixable:"code",schema:[j(Qo)],messages:{improperlyIndented:"Templates should be properly indented."}},defaultOptions:[{}],create(e){let n=e.sourceCode,{comments:r=["HTML","indent"],functions:t=["dedent","stripIndent"],tags:s=["outdent","dedent","gql","sql","html","styled"],indent:o}=e.options[0],i=r.map(f=>f.toLowerCase());function c(f){let E=f.split(hn),x=E.filter(b=>b.trim()!=="");if(x.length===0)return f;let d=Number.POSITIVE_INFINITY;for(let b of x){let S=b.match(Zo);S&&(d=Math.min(d,S[1]?.length??0))}return!isFinite(d)||d===0?f:E.map(b=>b.slice(d)).join(`
36
- `)}function a(f,E,x){return f.split(hn).map(b=>b.trim()===""?b:x.repeat(E)+b).join(`
37
- `)}function p(f){if(f.type===ie.AST_NODE_TYPES.Identifier)return f.name;if(f.type===ie.AST_NODE_TYPES.MemberExpression){let E=f.object.type===ie.AST_NODE_TYPES.Identifier?f.object.name:null,x=f.property.type===ie.AST_NODE_TYPES.Identifier?f.property.name:null;return E&&x?`${E}.${x}`:x}return null}function m(f,E){if(!f)return!1;for(let x of E)if(x.includes(".")){let d=x.split(".");if(f.type===ie.AST_NODE_TYPES.MemberExpression&&f.object.type===ie.AST_NODE_TYPES.Identifier&&f.property.type===ie.AST_NODE_TYPES.Identifier&&f.object.name===d[0]&&f.property.name===d[1])return!0}else if(f.type===ie.AST_NODE_TYPES.Identifier&&f.name===x)return!0;return!1}function g(f,E){let x=f.parent;if(x.type!==ie.AST_NODE_TYPES.TaggedTemplateExpression)return!1;let d=p(x.tag);return d?E.includes(d):!1}function l(f,E){if(!f||f.type!==ie.AST_NODE_TYPES.CallExpression)return!1;let{method:x,argumentsLength:d,optionalCall:b=!0,optionalMember:S=!0}=E;return d!==void 0&&f.arguments.length!==d||!b&&f.optional||f.callee.type!==ie.AST_NODE_TYPES.MemberExpression||!S&&f.callee.optional||f.callee.property.type!==ie.AST_NODE_TYPES.Identifier?!1:f.callee.property.name===x}function u(f,E){if(!f||f.type!==ie.AST_NODE_TYPES.CallExpression)return!1;let{name:x,argumentsLength:d,optionalCall:b=!0}=E;return d!==void 0&&f.arguments.length!==d||!b&&f.optional||f.callee.type!==ie.AST_NODE_TYPES.Identifier?!1:f.callee.name===x}function y(f){return l(f.parent,{method:"toMatchInlineSnapshot",argumentsLength:1,optionalCall:!1,optionalMember:!1})&&f.parent.type===ie.AST_NODE_TYPES.CallExpression&&f.parent.arguments[0]===f&&u(f.parent.callee.type===ie.AST_NODE_TYPES.MemberExpression?f.parent.callee.object:null,{name:"expect",argumentsLength:1,optionalCall:!1,optionalMember:!1})}function T(f){if(i.length>0){let E=n.getTokenBefore(f,{includeComments:!0});if(E?.type===ie.AST_TOKEN_TYPES.Block&&i.includes(E.value.trim().toLowerCase()))return!0}return!!(y(f)||s.length>0&&g(f,s)||t.length>0&&f.parent.type===ie.AST_NODE_TYPES.CallExpression&&f.parent.arguments.includes(f)&&m(f.parent.callee,t))}function h(f){let E=`__PLACEHOLDER__${Math.random()}`,x=f.quasis.map(Z=>n.getText(Z).slice(1,Z.tail?-1:-2)).join(E),d=x.match(Ko);if(!d)return;let b=d[0],S=n.lines[n.getLocFromIndex(f.range[0]).line-1];if(!S)return;let w=S.match(Go)?.[1]??"",I;typeof o=="string"?I=o:typeof o=="number"?I=" ".repeat(o):I=w.startsWith(" ")?" ":" ";let $=c(x).replace(new RegExp(`^${b}|${b}[ ]*$`,"g"),""),ne=b+a($,1,w+I)+b+w,Q=x.includes(`\r
35
+ ${g}`)),y.push(f.replaceText(s,l)),y}}]})}var St=require("@typescript-eslint/utils"),Vo=St.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),Mr="require-description",Xo=/^(eslint(?:-env|-enable|-disable(?:(?:-next)?-line)?)?|exported|globals?)(?:\s|$)/u,Ho=/^eslint-disable-(next-)?line$/u,Bo=Vo({name:Mr,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=Yo(s);o!=null&&(n.has(o.kind)||o.description||e.report({loc:Go(s.loc),messageId:"missingDescription"}))}}}}}),_r={name:Mr,rule:Bo};function Yo(e){let{text:t,description:r}=Zo(e.value);if(!t)return null;let n=Xo.exec(t);if(!n)return null;let s=n[1];if(!s)return null;let o=Ho.test(s);if(e.type===St.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 qo=/\s-{2,}\s/u;function Zo(e){let t=e.split(qo);return{text:t[0]?.trim(),description:t.length>1?t[1]?.trim()??null:null}}function Go(e){return{start:{line:e.start.line,column:-1},end:e.end}}var J=require("@typescript-eslint/utils"),Ie=require("zod/v4");var Ko=Ie.z.object({varsToCheck:Ie.z.array(Ie.z.object({selector:Ie.z.string().optional(),fromFnCall:Ie.z.string().optional(),prop:Ie.z.string().or(Ie.z.array(Ie.z.string())),errorMsg:Ie.z.string().optional()}))}),Tn=M({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:[j(Ko)]},defaultOptions:[{varsToCheck:[]}],create(e,[t]){let r=new Map;function n(i,c,a,p){let f=new Set;for(let l of i.properties)l.type===J.AST_NODE_TYPES.Property&&l.key.type===J.AST_NODE_TYPES.Identifier&&f.add(l.key.name);let g=c.filter(l=>!f.has(l));if(g.length>0)if(g.length===1)e.report({node:i,messageId:"propNotRead",data:{prop:g[0],fnName:p,customMsg:a||""}});else{let l=g.map(u=>`"${u}"`).join(", ");e.report({node:i,messageId:"propsNotRead",data:{props:l,fnName:p,customMsg:a||""}})}}function s(i){if(i.init?.type===J.AST_NODE_TYPES.CallExpression){if(i.init.callee.type===J.AST_NODE_TYPES.Identifier)return i.init.callee.name;if(i.init.callee.type===J.AST_NODE_TYPES.MemberExpression&&i.init.callee.property.type===J.AST_NODE_TYPES.Identifier)return i.init.callee.object.type===J.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]=c=>{if(c.type===J.AST_NODE_TYPES.VariableDeclarator&&c.id.type===J.AST_NODE_TYPES.Identifier&&r.set(c.id.name,{props:Array.isArray(i.prop)?i.prop:[i.prop],errorMsg:i.errorMsg,node:c.id,fnName:s(c)}),c.type===J.AST_NODE_TYPES.VariableDeclarator&&c.id.type===J.AST_NODE_TYPES.ObjectPattern){let a=Array.isArray(i.prop)?i.prop:[i.prop];n(c.id,a,i.errorMsg,s(c))}});for(let i of t.varsToCheck)if(i.fromFnCall){let c=i.fromFnCall;if(c.startsWith("*.")){let p=`VariableDeclarator > CallExpression > MemberExpression[property.name="${c.slice(2)}"]`;o[p]=f=>{if(f.type!==J.AST_NODE_TYPES.MemberExpression||f.parent.type!==J.AST_NODE_TYPES.CallExpression)return;let g=f.parent;if(g.parent.type!==J.AST_NODE_TYPES.VariableDeclarator)return;let l=g.parent;if(l.id.type===J.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===J.AST_NODE_TYPES.ObjectPattern){let u=Array.isArray(i.prop)?i.prop:[i.prop];n(l.id,u,i.errorMsg,i.fromFnCall||"unknown function")}}}else if(c.includes(".")){let[a,p]=c.split("."),f=`VariableDeclarator > CallExpression > MemberExpression[object.name="${a}"][property.name="${p}"]`;o[f]=g=>{if(g.type!==J.AST_NODE_TYPES.MemberExpression||g.parent.type!==J.AST_NODE_TYPES.CallExpression)return;let l=g.parent;if(l.parent.type!==J.AST_NODE_TYPES.VariableDeclarator)return;let u=l.parent;if(u.id.type===J.AST_NODE_TYPES.Identifier)r.set(u.id.name,{props:Array.isArray(i.prop)?i.prop:[i.prop],errorMsg:i.errorMsg,node:u.id,fnName:i.fromFnCall||"unknown function"});else if(u.id.type===J.AST_NODE_TYPES.ObjectPattern){let y=Array.isArray(i.prop)?i.prop:[i.prop];n(u.id,y,i.errorMsg,i.fromFnCall||"unknown function")}}}else{let a=`VariableDeclarator > CallExpression > Identifier[name="${c}"]`;o[a]=p=>{if(p.type!==J.AST_NODE_TYPES.Identifier||p.parent.type!==J.AST_NODE_TYPES.CallExpression)return;let f=p.parent;if(f.parent.type!==J.AST_NODE_TYPES.VariableDeclarator)return;let g=f.parent;if(g.id.type===J.AST_NODE_TYPES.Identifier)r.set(g.id.name,{props:Array.isArray(i.prop)?i.prop:[i.prop],errorMsg:i.errorMsg,node:g.id,fnName:i.fromFnCall||"unknown function"});else if(g.id.type===J.AST_NODE_TYPES.ObjectPattern){let l=Array.isArray(i.prop)?i.prop:[i.prop];n(g.id,l,i.errorMsg,i.fromFnCall||"unknown function")}}}}return{...o,"Program:exit"(){for(let[i,{props:c,errorMsg:a,node:p,fnName:f}]of r){let l=e.sourceCode.getScope(p).set.get(i);if(l){let u=new Set(c);for(let y of l.references){let T=y.identifier,h=T.parent;if(!(h.type===J.AST_NODE_TYPES.VariableDeclarator&&h.id===T)){if(h.type===J.AST_NODE_TYPES.MemberExpression&&h.object===T&&h.property.type===J.AST_NODE_TYPES.Identifier&&u.has(h.property.name)){if(u.delete(h.property.name),u.size===0)break;continue}if(h.type===J.AST_NODE_TYPES.VariableDeclarator&&h.init===T&&h.id.type===J.AST_NODE_TYPES.ObjectPattern){for(let m of h.id.properties)m.type===J.AST_NODE_TYPES.Property&&m.key.type===J.AST_NODE_TYPES.Identifier&&u.has(m.key.name)&&u.delete(m.key.name);if(u.size===0)break;continue}if(!(h.type===J.AST_NODE_TYPES.MemberExpression&&h.object===T&&h.property.type===J.AST_NODE_TYPES.Identifier&&!c.includes(h.property.name))){u.clear();break}}}if(u.size>0){let y=Array.from(u);if(y.length===1)e.report({node:p,messageId:"propNotRead",data:{prop:y[0],fnName:f,customMsg:a||""}});else{let T=y.map(h=>`"${h}"`).join(", ");e.report({node:p,messageId:"propsNotRead",data:{props:T,fnName:f,customMsg:a||""}})}}}}}}}});function Wr(e){return/^use[A-Z0-9]/.test(e)}function Tt(e){return e.type==="Identifier"?Wr(e.name):e.type==="MemberExpression"&&!e.computed&&Tt(e.property)?e.object.type==="Identifier":!1}function zr(e){return e.type==="Identifier"&&/^[A-Z]/.test(e.name)}function Jr(e,t){return e.name===t||e.type==="MemberExpression"&&e.object.name==="React"&&e.property.name===t}function Vr(e){return!!(e.parent&&e.parent.callee&&Jr(e.parent.callee,"forwardRef"))}function Xr(e){return!!(e.parent&&e.parent.callee&&Jr(e.parent.callee,"memo"))}function hn(e){for(;e;){let t=Br(e);if(t&&(zr(t)||Tt(t))||Vr(e)||Xr(e))return!0;e=e.parent}return!1}function $r(e){return!1}function En(e){return!1}var Qo=/eslint +react-compiler\/react-compiler: +\["error/,Hr={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(Qo.test(a.value))return{CallExpression(p){let f=null;p.callee.name==="useMemo"?f="useMemo":p.callee.name==="useCallback"&&(f="useCallback"),f&&e.report({node:p,message:`"${f}" 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 c(a){for(let p of a.references){let f=p.identifier.parent;if(f.type==="VariableDeclarator"&&f.init&&f.init.type==="CallExpression"&&f.init.callee&&$r(f.init.callee))for(let g of p.resolved.references)g!==p&&i.add(g.identifier)}}return{onCodePathSegmentStart:a=>o.push(a),onCodePathSegmentEnd:()=>o.pop(),onCodePathStart:()=>s.push(new Map),onCodePathEnd(a,p){let f=s.pop();if(f.size===0)return;let g=new Set;function l(d,b){let{cache:S}=l,C=S.get(d.id),w=new Set(b);if(w.has(d.id)){let I=[...w],O=I.slice(I.indexOf(d.id)+1);for(let $ of O)g.add($);return BigInt("0")}if(w.add(d.id),C!==void 0)return C;if(a.thrownSegments.includes(d))C=BigInt("0");else if(d.prevSegments.length===0)C=BigInt("1");else{C=BigInt("0");for(let I of d.prevSegments)C+=l(I,w)}return d.reachable&&C===BigInt("0")?S.delete(d.id):S.set(d.id,C),C}function u(d,b){let{cache:S}=u,C=S.get(d.id),w=new Set(b);if(w.has(d.id)){let I=Array.from(w),O=I.slice(I.indexOf(d.id)+1);for(let $ of O)g.add($);return BigInt("0")}if(w.add(d.id),C!==void 0)return C;if(a.thrownSegments.includes(d))C=BigInt("0");else if(d.nextSegments.length===0)C=BigInt("1");else{C=BigInt("0");for(let I of d.nextSegments)C+=u(I,w)}return S.set(d.id,C),C}function y(d){let{cache:b}=y,S=b.get(d.id);if(S===null)return 1/0;if(S!==void 0)return S;if(b.set(d.id,null),d.prevSegments.length===0)S=1;else{S=1/0;for(let C of d.prevSegments){let w=y(C);w<S&&(S=w)}S+=1}return b.set(d.id,S),S}l.cache=new Map,u.cache=new Map,y.cache=new Map;let T=u(a.initialSegment),h=Br(p),m=hn(p),E=h?zr(h)||Tt(h):Vr(p)||Xr(p),x=1/0;for(let d of a.finalSegments){if(!d.reachable)continue;let b=y(d);b<x&&(x=b)}for(let[d,b]of f){if(!d.reachable)continue;let S=d.nextSegments.length===0?x<=y(d):x<y(d),C=l(d)*u(d),w=g.has(d.id);for(let I of b)if(w&&!En(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.`}),E){if(p.async&&e.report({node:I,message:`React Hook "${t(I)}" cannot be called in an async function.`}),!w&&C!==T&&!En(I)){let $=`React Hook "${t(I)}" is called conditionally. React Hooks must be called in the exact same order in every component render.`+(S?" Did you accidentally call a React Hook after an early return?":"");e.report({node:I,message:$})}}else if(p.parent&&(p.parent.type==="MethodDefinition"||p.parent.type==="ClassProperty")&&p.parent.value===p){let O=`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:O})}else if(h){let O=`React Hook "${t(I)}" is called in function "${t(h)}" 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:O})}else if(p.type==="Program"){let O=`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:O})}else if(m&&!En(I)){if(p.parent.type==="CallExpression"&&p.parent.callee.type==="Identifier"&&p.parent.callee.name==="useCallback"){let $=p.parent;if($.parent.type==="VariableDeclarator"&&Wr($.parent.id.name))return}let O=`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:O})}}},CallExpression(a){if(Tt(a.callee)){let p=Ur(s),f=Ur(o),g=p.get(f);g||(g=[],p.set(f,g)),g.push(a.callee)}a.callee.type==="Identifier"&&(a.callee.name==="useEffect"||$r(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){hn(a)&&c(r(a))},ArrowFunctionExpression(a){hn(a)&&c(r(a))}}}};function Br(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 Ur(e){return e[e.length-1]}var ie=require("@typescript-eslint/utils"),ue=he(require("zod/v4"));var ea=/^\s+$/,bn=/\r?\n/,ta=/^(\s*)/,na=/^(\s*)\S/,ra=/\r?\n/,ia=ue.object({indent:ue.union([ue.string().regex(ea),ue.number().int().min(1)]).optional(),tags:ue.array(ue.string()).optional(),functions:ue.array(ue.string()).optional(),comments:ue.array(ue.string()).optional()}),xn=M({name:"template-indent",meta:{type:"suggestion",docs:{description:"Fix whitespace-insensitive template indentation"},fixable:"code",schema:[j(ia)],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 c(m){let E=m.split(bn),x=E.filter(b=>b.trim()!=="");if(x.length===0)return m;let d=Number.POSITIVE_INFINITY;for(let b of x){let S=b.match(ta);S&&(d=Math.min(d,S[1]?.length??0))}return!isFinite(d)||d===0?m:E.map(b=>b.slice(d)).join(`
36
+ `)}function a(m,E,x){return m.split(bn).map(b=>b.trim()===""?b:x.repeat(E)+b).join(`
37
+ `)}function p(m){if(m.type===ie.AST_NODE_TYPES.Identifier)return m.name;if(m.type===ie.AST_NODE_TYPES.MemberExpression){let E=m.object.type===ie.AST_NODE_TYPES.Identifier?m.object.name:null,x=m.property.type===ie.AST_NODE_TYPES.Identifier?m.property.name:null;return E&&x?`${E}.${x}`:x}return null}function f(m,E){if(!m)return!1;for(let x of E)if(x.includes(".")){let d=x.split(".");if(m.type===ie.AST_NODE_TYPES.MemberExpression&&m.object.type===ie.AST_NODE_TYPES.Identifier&&m.property.type===ie.AST_NODE_TYPES.Identifier&&m.object.name===d[0]&&m.property.name===d[1])return!0}else if(m.type===ie.AST_NODE_TYPES.Identifier&&m.name===x)return!0;return!1}function g(m,E){let x=m.parent;if(x.type!==ie.AST_NODE_TYPES.TaggedTemplateExpression)return!1;let d=p(x.tag);return d?E.includes(d):!1}function l(m,E){if(!m||m.type!==ie.AST_NODE_TYPES.CallExpression)return!1;let{method:x,argumentsLength:d,optionalCall:b=!0,optionalMember:S=!0}=E;return d!==void 0&&m.arguments.length!==d||!b&&m.optional||m.callee.type!==ie.AST_NODE_TYPES.MemberExpression||!S&&m.callee.optional||m.callee.property.type!==ie.AST_NODE_TYPES.Identifier?!1:m.callee.property.name===x}function u(m,E){if(!m||m.type!==ie.AST_NODE_TYPES.CallExpression)return!1;let{name:x,argumentsLength:d,optionalCall:b=!0}=E;return d!==void 0&&m.arguments.length!==d||!b&&m.optional||m.callee.type!==ie.AST_NODE_TYPES.Identifier?!1:m.callee.name===x}function y(m){return l(m.parent,{method:"toMatchInlineSnapshot",argumentsLength:1,optionalCall:!1,optionalMember:!1})&&m.parent.type===ie.AST_NODE_TYPES.CallExpression&&m.parent.arguments[0]===m&&u(m.parent.callee.type===ie.AST_NODE_TYPES.MemberExpression?m.parent.callee.object:null,{name:"expect",argumentsLength:1,optionalCall:!1,optionalMember:!1})}function T(m){if(i.length>0){let E=t.getTokenBefore(m,{includeComments:!0});if(E?.type===ie.AST_TOKEN_TYPES.Block&&i.includes(E.value.trim().toLowerCase()))return!0}return!!(y(m)||s.length>0&&g(m,s)||n.length>0&&m.parent.type===ie.AST_NODE_TYPES.CallExpression&&m.parent.arguments.includes(m)&&f(m.parent.callee,n))}function h(m){let E=`__PLACEHOLDER__${Math.random()}`,x=m.quasis.map(Z=>t.getText(Z).slice(1,Z.tail?-1:-2)).join(E),d=x.match(ra);if(!d)return;let b=d[0],S=t.lines[t.getLocFromIndex(m.range[0]).line-1];if(!S)return;let w=S.match(na)?.[1]??"",I;typeof o=="string"?I=o:typeof o=="number"?I=" ".repeat(o):I=w.startsWith(" ")?" ":" ";let $=c(x).replace(new RegExp(`^${b}|${b}[ ]*$`,"g"),""),ne=b+a($,1,w+I)+b+w,Q=x.includes(`\r
38
38
  `)?`\r
39
39
  `:`
40
- `,se=x.split(hn),oe=se.map((Z,Ee)=>Ee!==se.length-1&&Z===I+w?"":Z).join(Q);if(ne!==oe)return{node:f,messageId:"improperlyIndented",fix:Z=>ne.split(E).map((Ee,We)=>{let pe=f.quasis[We];return pe?Z.replaceTextRange([pe.range[0]+1,pe.range[1]-(pe.tail?1:2)],Ee):[]}).flat()}}return{TemplateLiteral(f){if(!T(f))return;let E=h(f);if(E)return e.report(E)}}}});var bn=require("@typescript-eslint/utils");function ea(e){if(!("regex"in e))return!1;let n=e.regex.flags;return n.includes("g")||n.includes("y")}function ta(e){let n=e.parent;return n?.type===bn.AST_NODE_TYPES.NewExpression&&n.callee.type===bn.AST_NODE_TYPES.Identifier&&n.callee.name==="RegExp"}var xn=U({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 n(r){ea(r)||ta(r)||e.report({node:r,messageId:"regexShouldBeTopLevel"})}return{"FunctionDeclaration Literal[regex], FunctionExpression Literal[regex], ArrowFunctionExpression Literal[regex], MethodDefinition Literal[regex]":n}}});var le=require("@typescript-eslint/utils"),He=require("zod/v4");var na=He.z.object({checkOnly:He.z.array(He.z.enum(["function-args","FC","generic-args-at-fn-calls"])).optional(),checkTypesFromSelectors:He.z.array(He.z.string()).optional()}),Cn=U({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:[j(na)],messages:{moveTypeAboveUsage:"Type definition should be placed directly above its first usage."}},defaultOptions:[{}],create(e,[n]){let r=e.sourceCode,t=new Map,s=[];function o(u){for(let y of s)if(u.range[0]>=y.range[0]&&u.range[1]<=y.range[1])return y;return null}function i(u){let y=u.parent;for(;y;){if(y.type===le.AST_NODE_TYPES.FunctionDeclaration||y.type===le.AST_NODE_TYPES.FunctionExpression||y.type===le.AST_NODE_TYPES.ArrowFunctionExpression){let T=y.params;for(let h of T)if(u.range[0]>=h.range[0]&&u.range[1]<=h.range[1])return!0;break}y=y.parent}return!1}function c(u){let y=u.parent;for(;y;){if(y.type===le.AST_NODE_TYPES.TSTypeParameterInstantiation){let T=y.parent;if(T.type===le.AST_NODE_TYPES.TSTypeReference&&T.typeName.type===le.AST_NODE_TYPES.Identifier&&(T.typeName.name==="FC"||T.typeName.name==="React.FC")||T.type===le.AST_NODE_TYPES.TSTypeReference&&T.typeName.type===le.AST_NODE_TYPES.TSQualifiedName&&T.typeName.right.name==="FC")return!0}y=y.parent}return!1}function a(u){let y=u.parent;for(;y;){if(y.type===le.AST_NODE_TYPES.TSTypeParameterInstantiation){let T=y.parent;if(T.type===le.AST_NODE_TYPES.CallExpression||T.type===le.AST_NODE_TYPES.NewExpression)return!0}y=y.parent}return!1}function p(u){let y=u.parent;for(;y;){if(y.type===le.AST_NODE_TYPES.TSTypeAliasDeclaration||y.type===le.AST_NODE_TYPES.TSInterfaceDeclaration)return!0;y=y.parent}return!1}let m=[];function g(u){let y=[],T=new Map;for(let{typeName:f,firstUsage:E}of u){let x=T.get(E)||[];x.push(f),T.set(E,x)}for(let{typeName:f,firstUsage:E,firstUsagePosition:x,firstUsageInFunctionArgs:d}of u){let b=t.get(f);if(!b||b.statement===E)continue;let S=s.indexOf(b.statement),C=s.indexOf(E);if(S===-1||C===-1)continue;let w=!!(n.checkOnly&&n.checkOnly.includes("function-args")&&d),O=(T.get(E)||[]).length>1;(w||O?S>C:S>C||S!==C-1)&&y.push({typeName:f,typeDef:b,targetStatement:E,firstUsagePosition:x})}if(y.length===0)return;y.sort((f,E)=>{let x=f.firstUsagePosition-E.firstUsagePosition;if(x!==0)return x;let d=s.indexOf(f.typeDef.statement),b=s.indexOf(E.typeDef.statement);return d-b});let h=y[0];h&&e.report({node:h.typeDef.node,messageId:"moveTypeAboveUsage",fix:l(y)})}function l(u){return function*(y){let T=new Map;for(let h of u){let f=T.get(h.targetStatement)||[];f.push(h),T.set(h.targetStatement,f)}for(let[,h]of T)h.sort((f,E)=>{let x=f.firstUsagePosition-E.firstUsagePosition;if(x!==0)return x;let d=s.indexOf(f.typeDef.statement),b=s.indexOf(E.typeDef.statement);return d-b});for(let h of u){let{typeDef:f}=h,E=f.statement,x=r.getCommentsBefore(E),d=E.range[0],b=E.range[1];x.length>0&&x[0]&&(d=x[0].range[0]),yield y.removeRange([d,b])}for(let[h,f]of T){let E=r.getCommentsBefore(h),x=E.length>0&&E[0]?E[0].range[0]:h.range[0],d=[];for(let b of f){let S=b.typeDef.statement,C=r.getText(S),w=r.getCommentsBefore(S),I=C;w.length>0&&(I=`${w.map($=>r.getText($)).join(`
40
+ `,se=x.split(bn),oe=se.map((Z,be)=>be!==se.length-1&&Z===I+w?"":Z).join(Q);if(ne!==oe)return{node:m,messageId:"improperlyIndented",fix:Z=>ne.split(E).map((be,Je)=>{let pe=m.quasis[Je];return pe?Z.replaceTextRange([pe.range[0]+1,pe.range[1]-(pe.tail?1:2)],be):[]}).flat()}}return{TemplateLiteral(m){if(!T(m))return;let E=h(m);if(E)return e.report(E)}}}});var Cn=require("@typescript-eslint/utils");function sa(e){if(!("regex"in e))return!1;let t=e.regex.flags;return t.includes("g")||t.includes("y")}function oa(e){let t=e.parent;return t?.type===Cn.AST_NODE_TYPES.NewExpression&&t.callee.type===Cn.AST_NODE_TYPES.Identifier&&t.callee.name==="RegExp"}var An=M({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){sa(r)||oa(r)||e.report({node:r,messageId:"regexShouldBeTopLevel"})}return{"FunctionDeclaration Literal[regex], FunctionExpression Literal[regex], ArrowFunctionExpression Literal[regex], MethodDefinition Literal[regex]":t}}});var le=require("@typescript-eslint/utils"),Ye=require("zod/v4");var aa=Ye.z.object({checkOnly:Ye.z.array(Ye.z.enum(["function-args","FC","generic-args-at-fn-calls"])).optional(),checkTypesFromSelectors:Ye.z.array(Ye.z.string()).optional()}),In=M({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:[j(aa)],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(u){for(let y of s)if(u.range[0]>=y.range[0]&&u.range[1]<=y.range[1])return y;return null}function i(u){let y=u.parent;for(;y;){if(y.type===le.AST_NODE_TYPES.FunctionDeclaration||y.type===le.AST_NODE_TYPES.FunctionExpression||y.type===le.AST_NODE_TYPES.ArrowFunctionExpression){let T=y.params;for(let h of T)if(u.range[0]>=h.range[0]&&u.range[1]<=h.range[1])return!0;break}y=y.parent}return!1}function c(u){let y=u.parent;for(;y;){if(y.type===le.AST_NODE_TYPES.TSTypeParameterInstantiation){let T=y.parent;if(T.type===le.AST_NODE_TYPES.TSTypeReference&&T.typeName.type===le.AST_NODE_TYPES.Identifier&&(T.typeName.name==="FC"||T.typeName.name==="React.FC")||T.type===le.AST_NODE_TYPES.TSTypeReference&&T.typeName.type===le.AST_NODE_TYPES.TSQualifiedName&&T.typeName.right.name==="FC")return!0}y=y.parent}return!1}function a(u){let y=u.parent;for(;y;){if(y.type===le.AST_NODE_TYPES.TSTypeParameterInstantiation){let T=y.parent;if(T.type===le.AST_NODE_TYPES.CallExpression||T.type===le.AST_NODE_TYPES.NewExpression)return!0}y=y.parent}return!1}function p(u){let y=u.parent;for(;y;){if(y.type===le.AST_NODE_TYPES.TSTypeAliasDeclaration||y.type===le.AST_NODE_TYPES.TSInterfaceDeclaration)return!0;y=y.parent}return!1}let f=[];function g(u){let y=[],T=new Map;for(let{typeName:m,firstUsage:E}of u){let x=T.get(E)||[];x.push(m),T.set(E,x)}for(let{typeName:m,firstUsage:E,firstUsagePosition:x,firstUsageInFunctionArgs:d}of u){let b=n.get(m);if(!b||b.statement===E)continue;let S=s.indexOf(b.statement),C=s.indexOf(E);if(S===-1||C===-1)continue;let w=!!(t.checkOnly&&t.checkOnly.includes("function-args")&&d),O=(T.get(E)||[]).length>1;(w||O?S>C:S>C||S!==C-1)&&y.push({typeName:m,typeDef:b,targetStatement:E,firstUsagePosition:x})}if(y.length===0)return;y.sort((m,E)=>{let x=m.firstUsagePosition-E.firstUsagePosition;if(x!==0)return x;let d=s.indexOf(m.typeDef.statement),b=s.indexOf(E.typeDef.statement);return d-b});let h=y[0];h&&e.report({node:h.typeDef.node,messageId:"moveTypeAboveUsage",fix:l(y)})}function l(u){return function*(y){let T=new Map;for(let h of u){let m=T.get(h.targetStatement)||[];m.push(h),T.set(h.targetStatement,m)}for(let[,h]of T)h.sort((m,E)=>{let x=m.firstUsagePosition-E.firstUsagePosition;if(x!==0)return x;let d=s.indexOf(m.typeDef.statement),b=s.indexOf(E.typeDef.statement);return d-b});for(let h of u){let{typeDef:m}=h,E=m.statement,x=r.getCommentsBefore(E),d=E.range[0],b=E.range[1];x.length>0&&x[0]&&(d=x[0].range[0]),yield y.removeRange([d,b])}for(let[h,m]of T){let E=r.getCommentsBefore(h),x=E.length>0&&E[0]?E[0].range[0]:h.range[0],d=[];for(let b of m){let S=b.typeDef.statement,C=r.getText(S),w=r.getCommentsBefore(S),I=C;w.length>0&&(I=`${w.map($=>r.getText($)).join(`
41
41
  `)}
42
42
  ${C}`),d.push(I)}yield y.insertTextBeforeRange([x,x],`${d.join(`
43
43
 
44
44
  `)}
45
45
 
46
- `)}}}return{Program(u){s.push(...u.body)},TSTypeAliasDeclaration(u){if(s.some(T=>T.type===le.AST_NODE_TYPES.ExportNamedDeclaration&&T.declaration===u?!0:T===u)){let T=o(u);T&&t.set(u.id.name,{node:u,name:u.id.name,statement:T})}},TSInterfaceDeclaration(u){if(s.some(T=>T.type===le.AST_NODE_TYPES.ExportNamedDeclaration&&T.declaration===u?!0:T===u)){let T=o(u);T&&t.set(u.id.name,{node:u,name:u.id.name,statement:T})}},TSTypeReference(u){if(u.typeName.type===le.AST_NODE_TYPES.Identifier){let y=i(u),T=c(u),h=a(u);m.push({typeName:u.typeName.name,node:u,inFunctionArgs:y,inFCProps:T,inGenericArgAtFunctionCall:h,usagePosition:u.range[0]})}},"Program:exit"(){let u=new Map;function y(h){if(!n.checkOnly||n.checkOnly.length===0)return!0;for(let f of n.checkOnly)if(f==="function-args"&&h.inFunctionArgs||f==="FC"&&h.inFCProps||f==="generic-args-at-fn-calls"&&h.inGenericArgAtFunctionCall)return!0;return!1}for(let h of m){let{typeName:f,node:E}=h;if(!t.has(f)||!y(h))continue;let x=o(E),d=t.get(f);if(!x||!d||x===d.statement)continue;u.has(f)||u.set(f,[]);let b=u.get(f);if(!b)return;b.includes(x)||b.push(x)}let T=[];for(let[h,f]of u)if(f.length>0){if(f.length===0)continue;let E=f[0];if(!E)continue;let x=Number.MAX_SAFE_INTEGER,d=!1;for(let S of f)S.range[0]<E.range[0]&&(E=S);for(let S of m)y(S)&&S.typeName===h&&o(S.node)===E&&S.usagePosition<x&&(x=S.usagePosition,d=S.inFunctionArgs);if(!!(n.checkOnly&&n.checkOnly.length>0)){let S=Number.MAX_SAFE_INTEGER;for(let w of m){if(w.typeName!==h)continue;let I=o(w.node);if(!I)continue;let O=s.indexOf(I);O!==-1&&O<S&&(S=O)}let C=s.indexOf(E);if(S!==Number.MAX_SAFE_INTEGER&&C!==-1&&S<C)continue}else{let S=Number.MAX_SAFE_INTEGER;for(let w of m){if(w.typeName!==h||p(w.node))continue;let I=o(w.node);if(!I)continue;let O=s.indexOf(I);O!==-1&&O<S&&(S=O)}let C=s.indexOf(E);if(S!==Number.MAX_SAFE_INTEGER&&C!==-1&&S<C)continue}T.push({typeName:h,firstUsage:E,firstUsagePosition:x,firstUsageInFunctionArgs:d})}T.length>0&&g(T)}}}});var X=require("@typescript-eslint/utils"),Be=Te(require("zod/v4"));var ra=["tsx"],ia=/^[A-Z][A-Za-z0-9]*$/,sa=Be.object({extensions:Be.array(Be.string()).optional()}),An=U({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:[j(sa)]},defaultOptions:[{}],create(e,[n]){let r=e.getFilename(),t=n.extensions??ra,s=!1;for(let d of t)if(r.endsWith(d)){s=!0;break}if(!s)return{};let o=e.sourceCode,i=new Set,c=new Map;function a(d){return ia.test(d)}function p(d){if(d.type!==X.AST_NODE_TYPES.CallExpression)return!1;let b=d.callee;return b.type===X.AST_NODE_TYPES.Identifier?b.name==="memo"||b.name==="forwardRef":b.type===X.AST_NODE_TYPES.MemberExpression&&b.property.type===X.AST_NODE_TYPES.Identifier?b.property.name==="memo"||b.property.name==="forwardRef":!1}function m(d){if(d.type===X.AST_NODE_TYPES.JSXElement||d.type===X.AST_NODE_TYPES.JSXFragment)return!0;if(d.type===X.AST_NODE_TYPES.ArrayExpression){for(let b of d.elements)if(b&&(b.type===X.AST_NODE_TYPES.JSXElement||b.type===X.AST_NODE_TYPES.JSXFragment))return!0}return!1}function g(d){if(d.type!==X.AST_NODE_TYPES.ArrowFunctionExpression)return!1;let b=d.body;if(b.type===X.AST_NODE_TYPES.ArrowFunctionExpression){let S=b.body;if(m(S))return!0}return!1}function l(d){if(d.id.type!==X.AST_NODE_TYPES.Identifier)return;let b=d.id.name,S=d.init;if(S){if(a(b)&&(S.type===X.AST_NODE_TYPES.ArrowFunctionExpression||S.type===X.AST_NODE_TYPES.FunctionExpression||p(S))){i.add(b);return}S.type===X.AST_NODE_TYPES.Identifier&&c.set(b,S.name),a(b)||g(S)&&i.add(b)}}function u(d){if(d.type===X.AST_NODE_TYPES.VariableDeclaration){for(let b of d.declarations)l(b);return}if(d.type===X.AST_NODE_TYPES.FunctionDeclaration&&d.id){a(d.id.name)&&i.add(d.id.name);return}if(d.type===X.AST_NODE_TYPES.ExportNamedDeclaration&&d.declaration){let b=d.declaration;if(b.type===X.AST_NODE_TYPES.VariableDeclaration){for(let S of b.declarations)l(S);return}if(b.type===X.AST_NODE_TYPES.FunctionDeclaration&&b.id){a(b.id.name)&&i.add(b.id.name);return}}}for(let d of o.ast.body)u(d);function y(d,b=new Set){if(i.has(d))return!0;if(b.has(d))return!1;b.add(d);let S=c.get(d);return S?y(S,b):!1}let T=[];function h(d,b,S){T.push({node:d,isType:b,isComponent:S})}for(let d of o.ast.body){if(d.type===X.AST_NODE_TYPES.ExportNamedDeclaration){let b=d.exportKind==="type";if(d.declaration){let S=d.declaration;if(S.type===X.AST_NODE_TYPES.TSTypeAliasDeclaration||S.type===X.AST_NODE_TYPES.TSInterfaceDeclaration){h(S,!0,!1);continue}if(S.type===X.AST_NODE_TYPES.VariableDeclaration){for(let C of S.declarations){if(C.id.type!==X.AST_NODE_TYPES.Identifier)continue;let w=C.id.name,I=y(w);h(C,b,I)}continue}if(S.type===X.AST_NODE_TYPES.FunctionDeclaration){let C=S.id?.name,w=C?y(C)||a(C):!1;h(S,b,w);continue}h(S,b,!1);continue}if(d.specifiers.length>0)for(let S of d.specifiers){if(S.local.type!==X.AST_NODE_TYPES.Identifier)continue;let C=S.local.name,w=y(C);h(S,b,w)}continue}if(d.type===X.AST_NODE_TYPES.ExportDefaultDeclaration){let b=d.declaration;if(b.type===X.AST_NODE_TYPES.Identifier){let S=y(b.name)||a(b.name);h(d,!1,S);continue}if(b.type===X.AST_NODE_TYPES.FunctionDeclaration||b.type===X.AST_NODE_TYPES.ArrowFunctionExpression||b.type===X.AST_NODE_TYPES.FunctionExpression||b.type===X.AST_NODE_TYPES.CallExpression){h(d,!1,!0);continue}h(d,!1,!1);continue}}let f=!1;for(let d of T)if(!d.isType&&d.isComponent){f=!0;break}if(!f)return{};let E=[];for(let d of T)d.isType||E.push(d);let x=-1;for(let[d,b]of E.entries())if(b.isComponent){x=d;break}if(x===-1)return{};for(let[d,b]of E.entries())if(d!==x){e.report({node:b.node,messageId:"multipleExports"});break}return{}}});var Fe=require("@typescript-eslint/utils"),St=require("zod/v4");function Tt(e){return e.charAt(0).toUpperCase()+e.slice(1)}function oa(e){return e.callee.type===Fe.AST_NODE_TYPES.Identifier?e.callee.name==="useState":e.callee.type===Fe.AST_NODE_TYPES.MemberExpression&&e.callee.object.type===Fe.AST_NODE_TYPES.Identifier&&e.callee.property.type===Fe.AST_NODE_TYPES.Identifier?e.callee.object.name==="React"&&e.callee.property.name==="useState":!1}var aa=St.z.object({ignorePrefixes:St.z.array(St.z.string()).optional()});function Vr(e,n){for(let r of n)if(e.startsWith(r))return e.slice(r.length);return e}function la(e){return`set${Tt(e)}`}var In=U({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:[j(aa)]},defaultOptions:[{ignorePrefixes:[]}],create(e,[n]){return{VariableDeclarator(r){if(!r.init||r.init.type!==Fe.AST_NODE_TYPES.CallExpression||!oa(r.init)||r.id.type!==Fe.AST_NODE_TYPES.ArrayPattern||r.id.elements.length!==2)return;let[t,s]=r.id.elements;if(!t||!s||t.type!==Fe.AST_NODE_TYPES.Identifier||s.type!==Fe.AST_NODE_TYPES.Identifier)return;let o=t.name,i=s.name,c=n.ignorePrefixes||[],a=Vr(o,c),p=Vr(i,c);if(a===""){if(!p.startsWith("set")){let g=`set${Tt(o)}`;e.report({node:s,messageId:"incorrectSetterName",data:{expectedName:Tt(o),actualName:i},suggest:[{messageId:"useSuggestedName",data:{expectedSetterName:g},fix:l=>l.replaceText(s,g)}]})}return}let m=la(a);p!==m&&e.report({node:s,messageId:"incorrectSetterName",data:{expectedName:Tt(a),actualName:i},suggest:[{messageId:"useSuggestedName",data:{expectedSetterName:m},fix:g=>g.replaceText(s,m)}]})}}}});var Xr={[Qt.name]:Qt.rule,[Nt.name]:Nt.rule,[Ot.name]:Ot.rule,"rules-of-hooks":zr,"exhaustive-deps":Mn,"require-description":Dr.rule,[Dt.name]:Dt.rule,[jt.name]:jt.rule,[tn.name]:tn.rule,[bt.name]:bt.rule,[Pt.name]:Pt.rule,[$t.name]:$t.rule,[Ze.name]:Ze.rule,[sn.name]:sn.rule,[Mt.name]:Mt.rule,[Lt.name]:Lt.rule,[Ut.name]:Ut.rule,[Ct.name]:Ct.rule,[un.name]:un.rule,[cn.name]:cn.rule,[dn.name]:dn.rule,[kt.name]:kt.rule,[Vt.name]:Vt.rule,[Xt.name]:Xt.rule,[Ht.name]:Ht.rule,[Zt.name]:Zt.rule,[Gt.name]:Gt.rule,[Bt.name]:Bt.rule,[qt.name]:qt.rule,[rn.name]:rn.rule,[zt.name]:zt.rule,[Wt.name]:Wt.rule,[xn.name]:xn.rule,[en.name]:en.rule,[gn.name]:gn.rule,[En.name]:En.rule,[Cn.name]:Cn.rule,[An.name]:An.rule,[In.name]:In.rule,[Ze.name]:Ze.rule};var pa={rules:Xr};0&&(module.exports={extendedLintPlugin});
46
+ `)}}}return{Program(u){s.push(...u.body)},TSTypeAliasDeclaration(u){if(s.some(T=>T.type===le.AST_NODE_TYPES.ExportNamedDeclaration&&T.declaration===u?!0:T===u)){let T=o(u);T&&n.set(u.id.name,{node:u,name:u.id.name,statement:T})}},TSInterfaceDeclaration(u){if(s.some(T=>T.type===le.AST_NODE_TYPES.ExportNamedDeclaration&&T.declaration===u?!0:T===u)){let T=o(u);T&&n.set(u.id.name,{node:u,name:u.id.name,statement:T})}},TSTypeReference(u){if(u.typeName.type===le.AST_NODE_TYPES.Identifier){let y=i(u),T=c(u),h=a(u);f.push({typeName:u.typeName.name,node:u,inFunctionArgs:y,inFCProps:T,inGenericArgAtFunctionCall:h,usagePosition:u.range[0]})}},"Program:exit"(){let u=new Map;function y(h){if(!t.checkOnly||t.checkOnly.length===0)return!0;for(let m of t.checkOnly)if(m==="function-args"&&h.inFunctionArgs||m==="FC"&&h.inFCProps||m==="generic-args-at-fn-calls"&&h.inGenericArgAtFunctionCall)return!0;return!1}for(let h of f){let{typeName:m,node:E}=h;if(!n.has(m)||!y(h))continue;let x=o(E),d=n.get(m);if(!x||!d||x===d.statement)continue;u.has(m)||u.set(m,[]);let b=u.get(m);if(!b)return;b.includes(x)||b.push(x)}let T=[];for(let[h,m]of u)if(m.length>0){if(m.length===0)continue;let E=m[0];if(!E)continue;let x=Number.MAX_SAFE_INTEGER,d=!1;for(let S of m)S.range[0]<E.range[0]&&(E=S);for(let S of f)y(S)&&S.typeName===h&&o(S.node)===E&&S.usagePosition<x&&(x=S.usagePosition,d=S.inFunctionArgs);if(!!(t.checkOnly&&t.checkOnly.length>0)){let S=Number.MAX_SAFE_INTEGER;for(let w of f){if(w.typeName!==h)continue;let I=o(w.node);if(!I)continue;let O=s.indexOf(I);O!==-1&&O<S&&(S=O)}let C=s.indexOf(E);if(S!==Number.MAX_SAFE_INTEGER&&C!==-1&&S<C)continue}else{let S=Number.MAX_SAFE_INTEGER;for(let w of f){if(w.typeName!==h||p(w.node))continue;let I=o(w.node);if(!I)continue;let O=s.indexOf(I);O!==-1&&O<S&&(S=O)}let C=s.indexOf(E);if(S!==Number.MAX_SAFE_INTEGER&&C!==-1&&S<C)continue}T.push({typeName:h,firstUsage:E,firstUsagePosition:x,firstUsageInFunctionArgs:d})}T.length>0&&g(T)}}}});var X=require("@typescript-eslint/utils"),qe=he(require("zod/v4"));var la=["tsx"],pa=/^[A-Z][A-Za-z0-9]*$/,ca=qe.object({extensions:qe.array(qe.string()).optional()}),Rn=M({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:[j(ca)]},defaultOptions:[{}],create(e,[t]){let r=e.getFilename(),n=t.extensions??la,s=!1;for(let d of n)if(r.endsWith(d)){s=!0;break}if(!s)return{};let o=e.sourceCode,i=new Set,c=new Map;function a(d){return pa.test(d)}function p(d){if(d.type!==X.AST_NODE_TYPES.CallExpression)return!1;let b=d.callee;return b.type===X.AST_NODE_TYPES.Identifier?b.name==="memo"||b.name==="forwardRef":b.type===X.AST_NODE_TYPES.MemberExpression&&b.property.type===X.AST_NODE_TYPES.Identifier?b.property.name==="memo"||b.property.name==="forwardRef":!1}function f(d){if(d.type===X.AST_NODE_TYPES.JSXElement||d.type===X.AST_NODE_TYPES.JSXFragment)return!0;if(d.type===X.AST_NODE_TYPES.ArrayExpression){for(let b of d.elements)if(b&&(b.type===X.AST_NODE_TYPES.JSXElement||b.type===X.AST_NODE_TYPES.JSXFragment))return!0}return!1}function g(d){if(d.type!==X.AST_NODE_TYPES.ArrowFunctionExpression)return!1;let b=d.body;if(b.type===X.AST_NODE_TYPES.ArrowFunctionExpression){let S=b.body;if(f(S))return!0}return!1}function l(d){if(d.id.type!==X.AST_NODE_TYPES.Identifier)return;let b=d.id.name,S=d.init;if(S){if(a(b)&&(S.type===X.AST_NODE_TYPES.ArrowFunctionExpression||S.type===X.AST_NODE_TYPES.FunctionExpression||p(S))){i.add(b);return}S.type===X.AST_NODE_TYPES.Identifier&&c.set(b,S.name),a(b)||g(S)&&i.add(b)}}function u(d){if(d.type===X.AST_NODE_TYPES.VariableDeclaration){for(let b of d.declarations)l(b);return}if(d.type===X.AST_NODE_TYPES.FunctionDeclaration&&d.id){a(d.id.name)&&i.add(d.id.name);return}if(d.type===X.AST_NODE_TYPES.ExportNamedDeclaration&&d.declaration){let b=d.declaration;if(b.type===X.AST_NODE_TYPES.VariableDeclaration){for(let S of b.declarations)l(S);return}if(b.type===X.AST_NODE_TYPES.FunctionDeclaration&&b.id){a(b.id.name)&&i.add(b.id.name);return}}}for(let d of o.ast.body)u(d);function y(d,b=new Set){if(i.has(d))return!0;if(b.has(d))return!1;b.add(d);let S=c.get(d);return S?y(S,b):!1}let T=[];function h(d,b,S){T.push({node:d,isType:b,isComponent:S})}for(let d of o.ast.body){if(d.type===X.AST_NODE_TYPES.ExportNamedDeclaration){let b=d.exportKind==="type";if(d.declaration){let S=d.declaration;if(S.type===X.AST_NODE_TYPES.TSTypeAliasDeclaration||S.type===X.AST_NODE_TYPES.TSInterfaceDeclaration){h(S,!0,!1);continue}if(S.type===X.AST_NODE_TYPES.VariableDeclaration){for(let C of S.declarations){if(C.id.type!==X.AST_NODE_TYPES.Identifier)continue;let w=C.id.name,I=y(w);h(C,b,I)}continue}if(S.type===X.AST_NODE_TYPES.FunctionDeclaration){let C=S.id?.name,w=C?y(C)||a(C):!1;h(S,b,w);continue}h(S,b,!1);continue}if(d.specifiers.length>0)for(let S of d.specifiers){if(S.local.type!==X.AST_NODE_TYPES.Identifier)continue;let C=S.local.name,w=y(C);h(S,b,w)}continue}if(d.type===X.AST_NODE_TYPES.ExportDefaultDeclaration){let b=d.declaration;if(b.type===X.AST_NODE_TYPES.Identifier){let S=y(b.name)||a(b.name);h(d,!1,S);continue}if(b.type===X.AST_NODE_TYPES.FunctionDeclaration||b.type===X.AST_NODE_TYPES.ArrowFunctionExpression||b.type===X.AST_NODE_TYPES.FunctionExpression||b.type===X.AST_NODE_TYPES.CallExpression){h(d,!1,!0);continue}h(d,!1,!1);continue}}let m=!1;for(let d of T)if(!d.isType&&d.isComponent){m=!0;break}if(!m)return{};let E=[];for(let d of T)d.isType||E.push(d);let x=-1;for(let[d,b]of E.entries())if(b.isComponent){x=d;break}if(x===-1)return{};for(let[d,b]of E.entries())if(d!==x){e.report({node:b.node,messageId:"multipleExports"});break}return{}}});var Fe=require("@typescript-eslint/utils"),ht=require("zod/v4");function Et(e){return e.charAt(0).toUpperCase()+e.slice(1)}function ua(e){return e.callee.type===Fe.AST_NODE_TYPES.Identifier?e.callee.name==="useState":e.callee.type===Fe.AST_NODE_TYPES.MemberExpression&&e.callee.object.type===Fe.AST_NODE_TYPES.Identifier&&e.callee.property.type===Fe.AST_NODE_TYPES.Identifier?e.callee.object.name==="React"&&e.callee.property.name==="useState":!1}var fa=ht.z.object({ignorePrefixes:ht.z.array(ht.z.string()).optional()});function Yr(e,t){for(let r of t)if(e.startsWith(r))return e.slice(r.length);return e}function ma(e){return`set${Et(e)}`}var wn=M({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:[j(fa)]},defaultOptions:[{ignorePrefixes:[]}],create(e,[t]){return{VariableDeclarator(r){if(!r.init||r.init.type!==Fe.AST_NODE_TYPES.CallExpression||!ua(r.init)||r.id.type!==Fe.AST_NODE_TYPES.ArrayPattern||r.id.elements.length!==2)return;let[n,s]=r.id.elements;if(!n||!s||n.type!==Fe.AST_NODE_TYPES.Identifier||s.type!==Fe.AST_NODE_TYPES.Identifier)return;let o=n.name,i=s.name,c=t.ignorePrefixes||[],a=Yr(o,c),p=Yr(i,c);if(a===""){if(!p.startsWith("set")){let g=`set${Et(o)}`;e.report({node:s,messageId:"incorrectSetterName",data:{expectedName:Et(o),actualName:i},suggest:[{messageId:"useSuggestedName",data:{expectedSetterName:g},fix:l=>l.replaceText(s,g)}]})}return}let f=ma(a);p!==f&&e.report({node:s,messageId:"incorrectSetterName",data:{expectedName:Et(a),actualName:i},suggest:[{messageId:"useSuggestedName",data:{expectedSetterName:f},fix:g=>g.replaceText(s,f)}]})}}}});var fe=require("@typescript-eslint/utils"),ze=require("zod/v4");var ya=ze.z.object({name:ze.z.string(),defaults:ze.z.array(ze.z.unknown())}),da=ze.z.object({functions:ze.z.array(ya)});function vn(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)=>vn(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 c=o.value,a=i.value;if(!vn(c,a))return!1}return!0}function qr(e){if(e.type===fe.AST_NODE_TYPES.SpreadElement)return Symbol("COMPLEX_EXPRESSION");switch(e.type){case fe.AST_NODE_TYPES.Literal:return e.value;case fe.AST_NODE_TYPES.ObjectExpression:{let t={};for(let r of e.properties)r.type===fe.AST_NODE_TYPES.Property&&r.key.type===fe.AST_NODE_TYPES.Identifier&&!r.computed&&(r.value.type===fe.AST_NODE_TYPES.Literal?t[r.key.name]=r.value.value:r.value.type===fe.AST_NODE_TYPES.ObjectExpression?t[r.key.name]=qr(r.value):t[r.key.name]=Symbol("COMPLEX_EXPRESSION"));return t}case fe.AST_NODE_TYPES.ArrayExpression:return e.elements.map(t=>{if(!(!t||t.type===fe.AST_NODE_TYPES.SpreadElement))return t.type===fe.AST_NODE_TYPES.Literal?t.value:Symbol("COMPLEX_EXPRESSION")});default:return Symbol("COMPLEX_EXPRESSION")}}function ga(e){return e.type===fe.AST_NODE_TYPES.Identifier?e.name:e.type===fe.AST_NODE_TYPES.MemberExpression&&e.property.type===fe.AST_NODE_TYPES.Identifier&&!e.computed?e.property.name:null}var kn=M({name:"no-redundant-function-params",meta:{type:"suggestion",docs:{description:"Disallow calling functions with redundant default parameters"},messages:{redundantParam:"Function call has redundant default parameter(s) that can be omitted"},fixable:"code",schema:[j(da)]},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=ga(n.callee);if(!s)return;let o=r.get(s);if(!o)return;let i=n.arguments;if(i.length===0)return;let c=-1;for(let a=0;a<i.length;a++){if(a>=o.length){c=a;continue}let p=o[a],f=i[a];if(!f||f.type===fe.AST_NODE_TYPES.SpreadElement){c=a;continue}let g=qr(f);(p===void 0||!vn(g,p))&&(c=a)}c<i.length-1&&e.report({node:n,messageId:"redundantParam",fix(a){if(c===-1){let p=e.sourceCode.getTokenAfter(n.callee),f=e.sourceCode.getLastToken(n);if(p&&f)return a.replaceTextRange([p.range[1],f.range[0]],"")}else{let p=i[c],f=e.sourceCode.getLastToken(n);if(f&&p)return a.replaceTextRange([p.range[1],f.range[0]],"")}return null}})}}}});var Zr={[tn.name]:tn.rule,[Lt.name]:Lt.rule,[Dt.name]:Dt.rule,"rules-of-hooks":Hr,"exhaustive-deps":Wn,"require-description":_r.rule,[jt.name]:jt.rule,[_t.name]:_t.rule,[rn.name]:rn.rule,[Ct.name]:Ct.rule,[Nt.name]:Nt.rule,[Ut.name]:Ut.rule,[Ke.name]:Ke.rule,[an.name]:an.rule,[$t.name]:$t.rule,[Mt.name]:Mt.rule,[zt.name]:zt.rule,[It.name]:It.rule,[mn.name]:mn.rule,[fn.name]:fn.rule,[Sn.name]:Sn.rule,[Ot.name]:Ot.rule,[Ht.name]:Ht.rule,[Bt.name]:Bt.rule,[Yt.name]:Yt.rule,[Kt.name]:Kt.rule,[Qt.name]:Qt.rule,[qt.name]:qt.rule,[Gt.name]:Gt.rule,[on.name]:on.rule,[Vt.name]:Vt.rule,[Jt.name]:Jt.rule,[An.name]:An.rule,[nn.name]:nn.rule,[Tn.name]:Tn.rule,[xn.name]:xn.rule,[In.name]:In.rule,[Rn.name]:Rn.rule,[wn.name]:wn.rule,[kn.name]:kn.rule,[Ke.name]:Ke.rule};var Sa={rules:Zr};0&&(module.exports={extendedLintPlugin});