@ls-stack/extended-lint 0.82.2 → 0.82.3

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 xi=Object.create;var St=Object.defineProperty;var Ci=Object.getOwnPropertyDescriptor;var Ii=Object.getOwnPropertyNames;var Ai=Object.getPrototypeOf,wi=Object.prototype.hasOwnProperty;var Fi=(e,t)=>{for(var r in t)St(e,r,{get:t[r],enumerable:!0})},Kn=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Ii(t))!wi.call(e,o)&&o!==r&&St(e,o,{get:()=>t[o],enumerable:!(n=Ci(t,o))||n.enumerable});return e};var Pe=(e,t,r)=>(r=e!=null?xi(Ai(e)):{},Kn(t||!e||!e.__esModule?St(r,"default",{value:e,enumerable:!0}):r,e)),Ri=e=>Kn(St({},"__esModule",{value:!0}),e);var Ga={};Fi(Ga,{extendedLintPlugin:()=>Za});module.exports=Ri(Ga);var he=require("@typescript-eslint/utils"),M=require("zod/v4");var Qn=require("@typescript-eslint/utils"),er=Pe(require("zod/v4"));function X(e){let r=Qn.ESLintUtils.RuleCreator(n=>`https://github.com/lucasols/extended-lint#${n}`)(e);return{name:e.name,rule:r}}function z(e){return er.toJSONSchema(e)}var vi=M.z.object({disallow:M.z.array(M.z.object({selector:M.z.string(),message:M.z.string(),replace:M.z.optional(M.z.union([M.z.string(),M.z.object({regex:M.z.string(),with:M.z.string()})])),replaceType:M.z.optional(M.z.enum(["suggestion","autofix"]))})).optional(),disallowFnCalls:M.z.optional(M.z.array(M.z.object({fn:M.z.string(),withArgs:M.z.optional(M.z.array(M.z.object({atIndex:M.z.number(),value:M.z.union([M.z.string(),M.z.number(),M.z.boolean()])}))),message:M.z.string(),replaceWith:M.z.optional(M.z.string()),ignoreRegex:M.z.optional(M.z.string())}))),__dev_simulateFileName:M.z.optional(M.z.string()),mustMatchSyntax:M.z.optional(M.z.array(M.z.object({includeRegex:M.z.string(),mustCallFn:M.z.optional(M.z.array(M.z.object({anyCall:M.z.array(M.z.object({fn:M.z.string(),withArgs:M.z.array(M.z.object({atIndex:M.z.number(),literal:M.z.union([M.z.string(),M.z.number(),M.z.boolean()])}))})),message:M.z.optional(M.z.string())}))),mustMatchSelector:M.z.optional(M.z.array(M.z.object({selector:M.z.string(),message:M.z.string()}))),mustHaveExport:M.z.optional(M.z.array(M.z.object({name:M.z.string(),type:M.z.enum(["function","variable","any"]).default("any"),message:M.z.string()})))})))}),Lt=X({name:"advanced-no-restricted-syntax",meta:{type:"suggestion",docs:{description:"Disallow specific syntax patterns"},schema:[z(vi)],messages:{default:"{{message}}"},fixable:"code",hasSuggestions:!0},defaultOptions:[{disallow:[]}],create(e,[t]){let r={},{mustMatchSyntax:n,__dev_simulateFileName:o,disallow:s,disallowFnCalls:i}=t,l=o??e.filename,c=[],a=new Map,u=new Set,f=new Map,y=new Set,x=new Map;function m(b){for(let w of b.specifiers)w.type===he.AST_NODE_TYPES.ImportSpecifier&&w.imported.type===he.AST_NODE_TYPES.Identifier&&w.imported.name!==w.local.name&&x.set(w.local.name,w.imported.name)}function E(b){if(b.declaration){if(b.declaration.type===he.AST_NODE_TYPES.FunctionDeclaration&&b.declaration.id){let w=b.declaration.id.name;for(let k of Array.from(y)){let[N,p]=k.split(":");N===w&&(p==="function"||p==="any")&&y.delete(k)}}else if(b.declaration.type===he.AST_NODE_TYPES.VariableDeclaration){for(let w of b.declaration.declarations)if(w.id.type===he.AST_NODE_TYPES.Identifier){let k=w.id.name;for(let N of Array.from(y)){let[p,F]=N.split(":");p===k&&(F==="variable"||F==="any")&&y.delete(N)}}}}for(let w of b.specifiers)if(w.exported.type===he.AST_NODE_TYPES.Identifier){let k=w.exported.name;for(let N of Array.from(y)){let[p,F]=N.split(":");p===k&&F==="any"&&y.delete(N)}}}function C(b){b.id.type===he.AST_NODE_TYPES.Identifier&&b.init?.type===he.AST_NODE_TYPES.Identifier&&x.set(b.id.name,b.init.name)}function S(b){return x.get(b)??b}function I(b,w){return S(b)===w||b===w}for(let{includeRegex:b,mustCallFn:w,mustMatchSelector:k,mustHaveExport:N}of n??[]){let F=function(d){let g=d;for(let{name:R,value:P}of p??[])g=g.replaceAll(R,P);return g};var h=F;let p=ki(l,new RegExp(b));if(p){for(let{anyCall:d,message:g}of w??[]){let R=`Expected file to call the function: ${d.map(({fn:P})=>P).join(" or ")}`;u.add(R),c.push(P=>{let{callee:j}=P;if(j.type===he.AST_NODE_TYPES.Identifier){for(let{fn:V,withArgs:G}of d)if(j.name===V){u.delete(R);for(let Y of G){let D=P.arguments[Y.atIndex],Z=typeof Y.literal=="string"?F(Y.literal):Y.literal;if(!D){e.report({node:P,messageId:"default",data:{message:`Missing argument with value "${Z}" at index ${Y.atIndex}${g?`: ${F(g)}`:""}`}});continue}if(D.type!==he.AST_NODE_TYPES.Literal){e.report({node:D,messageId:"default",data:{message:`Argument at position ${Y.atIndex} should the literal "${Z}"${g?`: ${F(g)}`:""}`}});continue}D.value!==Z&&e.report({node:D,messageId:"default",data:{message:`Argument should have the value "${Z}"${g?`: ${F(g)}`:""}`},fix:q=>q.replaceText(D,typeof Z=="string"?`'${Z}'`:String(Z))})}break}}})}for(let{selector:d,message:g}of k??[])f.set(d,F(g)),a.set(F(d),()=>{f.delete(d)});for(let{name:d,type:g,message:R}of N??[]){let P=F(d),j=F(R);y.add(`${P}:${g}:${j}`)}}}for(let{fn:b,withArgs:w,message:k,replaceWith:N,ignoreRegex:p}of i??[])p&&new RegExp(p).test(l)||c.push(F=>{let{callee:d}=F;if(d.type!==he.AST_NODE_TYPES.Identifier||!I(d.name,b))return;if(w)for(let R of w){let P=F.arguments[R.atIndex];if(!P){e.report({node:F,messageId:"default",data:{message:`Missing argument with value "${R.value}" at index ${R.atIndex}: ${k}`}});return}if(P.type!==he.AST_NODE_TYPES.Literal||P.value!==R.value)return}let g=R=>N?R.replaceText(F,N):null;e.report({node:F,messageId:"default",data:{message:k},suggest:N?[{messageId:"default",data:{message:`Replace with "${N}"`},fix:g}]:void 0})});function A(b,w){let k=r[b];k?r[b]=N=>{k(N),w(N)}:r[b]=w}for(let{selector:b,message:w,replace:k,replaceType:N="suggestion"}of s??[]){if(b==="CallExpression"){c.push(p=>{T(k,p,w,N)});continue}r[b]=p=>{T(k,p,w,N)}}if(a.size>0)for(let[b,w]of a)A(b,w);return c.length>0&&(r.CallExpression=b=>{if(b.type===he.AST_NODE_TYPES.CallExpression)for(let w of c)w(b)}),r.ImportDeclaration=b=>{b.type===he.AST_NODE_TYPES.ImportDeclaration&&m(b)},r.ExportNamedDeclaration=b=>{b.type===he.AST_NODE_TYPES.ExportNamedDeclaration&&E(b)},r.VariableDeclarator=b=>{b.type===he.AST_NODE_TYPES.VariableDeclarator&&C(b)},r["Program:exit"]=b=>{for(let w of u)e.report({node:b,messageId:"default",data:{message:w}});for(let[,w]of f)e.report({node:b,messageId:"default",data:{message:w}});for(let w of y){let[k,N,p]=w.split(":");e.report({node:b,messageId:"default",data:{message:`Missing required export "${k}" of type ${N}: ${p}`}})}},r;function T(b,w,k,N){let p=F=>{if(!b)return null;if(typeof b=="string")return F.replaceText(w,b);{let d=new RegExp(b.regex),g=e.sourceCode.getText(w);return F.replaceText(w,g.replace(d,b.with))}};e.report({node:w,messageId:"default",data:{message:k},fix:b&&N==="autofix"?p:void 0,suggest:b&&N==="suggestion"?[{messageId:"default",data:{message:`Replace with "${typeof b=="string"?b:b.with}"`},fix:p}]:void 0})}}});function ki(e,t){let r=[],n=t.exec(e);if(!n)return null;let[o,...s]=n;r.push({name:"$0_lowercase",value:o.toLowerCase()}),r.push({name:"$0_capitalize",value:tr(o)}),r.push({name:"$0_uncapitalize",value:nr(o)}),r.push({name:"$0",value:o});for(let i=0;i<s.length;i++){let l=`$${i+1}`,c=s[i];c!==void 0&&(r.push({name:`${l}_lowercase`,value:c.toLowerCase()}),r.push({name:`${l}_capitalize`,value:tr(c)}),r.push({name:`${l}_uncapitalize`,value:nr(c)}),r.push({name:l,value:c}))}return r}function tr(e){return e.charAt(0).toUpperCase()+e.slice(1)}function nr(e){return e.charAt(0).toLowerCase()+e.slice(1)}var re=require("@typescript-eslint/utils"),Be=require("zod/v4");var Pi=re.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),ir="collapse-simple-objs-in-one-line",Oi=Be.z.object({maxLineLength:Be.z.number().optional(),maxProperties:Be.z.number().optional(),nestedObjMaxLineLength:Be.z.number().optional(),nestedObjMaxProperties:Be.z.number().optional(),ignoreTypesWithSuffix:Be.z.array(Be.z.string()).optional()}),Ni=Pi({name:ir,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:[z(Oi)]},defaultOptions:[{}],create(e,[t]){let r=e.sourceCode,n=t.ignoreTypesWithSuffix??[],o=t.maxProperties??2,s=t.nestedObjMaxLineLength??t.maxLineLength,i=t.nestedObjMaxProperties??3;function l(a){if(a.type===re.AST_NODE_TYPES.ObjectExpression){let u=a.parent.type===re.AST_NODE_TYPES.Property,f=u?i:o,y=a.properties.length;if(y>f)return!1;if(y===1){let m=a.properties[0];return!m||m.type===re.AST_NODE_TYPES.Property&&m.value.type===re.AST_NODE_TYPES.ObjectExpression||m.type===re.AST_NODE_TYPES.Property&&m.value.type===re.AST_NODE_TYPES.ArrayExpression&&!m.value.elements.every(C=>C&&Mt(C))?!1:{text:r.getText(m),isNested:u,propsSize:y}}let x=[];for(let m of a.properties){if(m.type===re.AST_NODE_TYPES.Property&&!Mt(m.value))return!1;x.push(r.getText(m))}return{text:x.join(", "),isNested:u,propsSize:y}}else{let u=a.parent.parent?.type===re.AST_NODE_TYPES.TSPropertySignature,f=u?i:o,y=a.members.length;if(y>f)return!1;if(n.length>0&&a.parent.type===re.AST_NODE_TYPES.TSTypeAliasDeclaration){let m=a.parent.id.name;if(n.some(E=>m.endsWith(E)))return!1}if(y===1){let m=a.members[0];return!m||m.type===re.AST_NODE_TYPES.TSPropertySignature&&m.typeAnnotation?.typeAnnotation.type===re.AST_NODE_TYPES.TSTypeLiteral?!1:{text:r.getText(m),isNested:u,propsSize:1}}if(a.parent.type===re.AST_NODE_TYPES.TSIntersectionType||a.parent.type===re.AST_NODE_TYPES.TSUnionType&&a.parent.types[0]!==a)return!1;let x=[];for(let m of a.members){if(m.type!==re.AST_NODE_TYPES.TSPropertySignature)return!1;let E=m.typeAnnotation?.typeAnnotation;if(!E||E.type===re.AST_NODE_TYPES.TSTypeLiteral||!rr(E))return!1;if(E.type===re.AST_NODE_TYPES.TSTypeReference&&E.typeArguments){if(E.typeArguments.params.length>1)return!1;let S=E.typeArguments.params[0];if(!S||!rr(S))return!1}let C=r.getText(m).trim();(C.endsWith(";")||C.endsWith(","))&&(C=C.slice(0,-1)),x.push(C)}return{text:x.join("; "),isNested:u,propsSize:y}}}function c(a){if(a.loc.start.line===a.loc.end.line)return;if(a.parent.type!==re.AST_NODE_TYPES.JSXExpressionContainer){let E=0,C=!1,S=r.getTokenAfter(a,{filter:A=>A.type!==re.AST_TOKEN_TYPES.Punctuator||C?!0:A.value===","?(E++,!1):A.value===";"?(E++,C=!0,!1):A.value===")"||A.value==="}"?(E++,!1):!0});if(E>4)return;let I=S?.type===re.AST_TOKEN_TYPES.Template&&S.value.startsWith(`}
2
- `);if(S?.loc.start.line===a.loc.end.line&&!I)return}let u=l(a);if(!u)return;let f=u.text;if(f.includes(`
3
- `)||r.getCommentsInside(a).length>0)return;f.endsWith(";")&&(f=f.slice(0,-1));let y=`{ ${f} }`,x=ji(r,a),m=u.isNested&&u.propsSize>2?s:t.maxLineLength;m&&y.length+x.length+Di(a,r)>m||e.report({node:a,messageId:"singleLineProp",fix:E=>E.replaceText(a,y)})}return{TSTypeLiteral:c,ObjectExpression:c}}});function rr(e){return e.type===re.AST_NODE_TYPES.TSLiteralType||e.type===re.AST_NODE_TYPES.TSTypeReference||e.type===re.AST_NODE_TYPES.TSNumberKeyword||e.type===re.AST_NODE_TYPES.TSStringKeyword||e.type===re.AST_NODE_TYPES.TSBooleanKeyword||e.type===re.AST_NODE_TYPES.TSNullKeyword||e.type===re.AST_NODE_TYPES.TSUndefinedKeyword}function Mt(e,t){return!!(e.type===re.AST_NODE_TYPES.Literal||e.type===re.AST_NODE_TYPES.Identifier||e.type===re.AST_NODE_TYPES.TemplateLiteral||e.type===re.AST_NODE_TYPES.TaggedTemplateExpression||!t&&e.type===re.AST_NODE_TYPES.ArrayExpression&&e.elements.every(r=>r&&Mt(r,!0)))}function Di(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 ji(e,t){return e.text.slice(t.range[0]-t.loc.start.column,t.range[0])}var _t={name:ir,rule:Ni};var Li=/eslint +react-compiler\/react-compiler: +\["error/;var sr={meta:{type:"suggestion",docs:{description:"verifies the list of dependencies for Hooks like useEffect and similar",recommended:!0,url:"https://github.com/facebook/react/issues/14920"},fixable:"code",hasSuggestions:!0,schema:[{type:"object",additionalProperties:!1,ignoreIfReactCompilerIsEnabled:!1,enableDangerousAutofixThisMayCauseInfiniteLoops:!1,properties:{additionalHooks:{type:"string"},ignoreIfReactCompilerIsEnabled:{type:"boolean"},enableDangerousAutofixThisMayCauseInfiniteLoops:{type:"boolean"},reactCompilerIsEnabled:{type:"boolean"}}}]},create(e){let t=!1,r=typeof e.getSource=="function"?I=>r(I):I=>e.sourceCode.getText(I),n=typeof e.getScope=="function"?()=>n():I=>e.sourceCode.getScope(I),o=e.options&&e.options[0]&&e.options[0].additionalHooks?new RegExp(e.options[0].additionalHooks):void 0,s=e.options&&e.options[0]&&e.options[0].enableDangerousAutofixThisMayCauseInfiniteLoops||!1,i={additionalHooks:o,enableDangerousAutofixThisMayCauseInfiniteLoops:s};function l(I){s&&Array.isArray(I.suggest)&&I.suggest.length>0&&(I.fix=I.suggest[0].fix),e.report(I)}let c=e.getSourceCode().scopeManager,a=new WeakMap,u=new WeakSet,f=new WeakMap,y=new WeakMap,x=new WeakSet;function m(I,A){return function(T){if(A.has(T))return A.get(T);let h=I(T);return A.set(T,h),h}}function E(I,A,T,h,b){b&&I.async&&l({node:I,message:`Effect callbacks are synchronous to prevent race conditions. Put the async function inside:
1
+ "use strict";var wi=Object.create;var St=Object.defineProperty;var Fi=Object.getOwnPropertyDescriptor;var Ri=Object.getOwnPropertyNames;var vi=Object.getPrototypeOf,ki=Object.prototype.hasOwnProperty;var Pi=(e,t)=>{for(var r in t)St(e,r,{get:t[r],enumerable:!0})},Kn=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Ri(t))!ki.call(e,o)&&o!==r&&St(e,o,{get:()=>t[o],enumerable:!(n=Fi(t,o))||n.enumerable});return e};var Pe=(e,t,r)=>(r=e!=null?wi(vi(e)):{},Kn(t||!e||!e.__esModule?St(r,"default",{value:e,enumerable:!0}):r,e)),Oi=e=>Kn(St({},"__esModule",{value:!0}),e);var rl={};Pi(rl,{extendedLintPlugin:()=>nl});module.exports=Oi(rl);var he=require("@typescript-eslint/utils"),M=require("zod/v4");var Qn=require("@typescript-eslint/utils"),er=Pe(require("zod/v4"));function X(e){let r=Qn.ESLintUtils.RuleCreator(n=>`https://github.com/lucasols/extended-lint#${n}`)(e);return{name:e.name,rule:r}}function J(e){return er.toJSONSchema(e)}var Ni=M.z.object({disallow:M.z.array(M.z.object({selector:M.z.string(),message:M.z.string(),replace:M.z.optional(M.z.union([M.z.string(),M.z.object({regex:M.z.string(),with:M.z.string()})])),replaceType:M.z.optional(M.z.enum(["suggestion","autofix"]))})).optional(),disallowFnCalls:M.z.optional(M.z.array(M.z.object({fn:M.z.string(),withArgs:M.z.optional(M.z.array(M.z.object({atIndex:M.z.number(),value:M.z.union([M.z.string(),M.z.number(),M.z.boolean()])}))),message:M.z.string(),replaceWith:M.z.optional(M.z.string()),ignoreRegex:M.z.optional(M.z.string())}))),__dev_simulateFileName:M.z.optional(M.z.string()),mustMatchSyntax:M.z.optional(M.z.array(M.z.object({includeRegex:M.z.string(),mustCallFn:M.z.optional(M.z.array(M.z.object({anyCall:M.z.array(M.z.object({fn:M.z.string(),withArgs:M.z.array(M.z.object({atIndex:M.z.number(),literal:M.z.union([M.z.string(),M.z.number(),M.z.boolean()])}))})),message:M.z.optional(M.z.string())}))),mustMatchSelector:M.z.optional(M.z.array(M.z.object({selector:M.z.string(),message:M.z.string()}))),mustHaveExport:M.z.optional(M.z.array(M.z.object({name:M.z.string(),type:M.z.enum(["function","variable","any"]).default("any"),message:M.z.string()})))})))}),Lt=X({name:"advanced-no-restricted-syntax",meta:{type:"suggestion",docs:{description:"Disallow specific syntax patterns"},schema:[J(Ni)],messages:{default:"{{message}}"},fixable:"code",hasSuggestions:!0},defaultOptions:[{disallow:[]}],create(e,[t]){let r={},{mustMatchSyntax:n,__dev_simulateFileName:o,disallow:s,disallowFnCalls:i}=t,l=o??e.filename,c=[],a=new Map,u=new Set,f=new Map,y=new Set,x=new Map;function m(b){for(let w of b.specifiers)w.type===he.AST_NODE_TYPES.ImportSpecifier&&w.imported.type===he.AST_NODE_TYPES.Identifier&&w.imported.name!==w.local.name&&x.set(w.local.name,w.imported.name)}function E(b){if(b.declaration){if(b.declaration.type===he.AST_NODE_TYPES.FunctionDeclaration&&b.declaration.id){let w=b.declaration.id.name;for(let k of Array.from(y)){let[O,p]=k.split(":");O===w&&(p==="function"||p==="any")&&y.delete(k)}}else if(b.declaration.type===he.AST_NODE_TYPES.VariableDeclaration){for(let w of b.declaration.declarations)if(w.id.type===he.AST_NODE_TYPES.Identifier){let k=w.id.name;for(let O of Array.from(y)){let[p,F]=O.split(":");p===k&&(F==="variable"||F==="any")&&y.delete(O)}}}}for(let w of b.specifiers)if(w.exported.type===he.AST_NODE_TYPES.Identifier){let k=w.exported.name;for(let O of Array.from(y)){let[p,F]=O.split(":");p===k&&F==="any"&&y.delete(O)}}}function C(b){b.id.type===he.AST_NODE_TYPES.Identifier&&b.init?.type===he.AST_NODE_TYPES.Identifier&&x.set(b.id.name,b.init.name)}function T(b){return x.get(b)??b}function I(b,w){return T(b)===w||b===w}for(let{includeRegex:b,mustCallFn:w,mustMatchSelector:k,mustHaveExport:O}of n??[]){let F=function(d){let g=d;for(let{name:R,value:P}of p??[])g=g.replaceAll(R,P);return g};var h=F;let p=Di(l,new RegExp(b));if(p){for(let{anyCall:d,message:g}of w??[]){let R=`Expected file to call the function: ${d.map(({fn:P})=>P).join(" or ")}`;u.add(R),c.push(P=>{let{callee:j}=P;if(j.type===he.AST_NODE_TYPES.Identifier){for(let{fn:V,withArgs:G}of d)if(j.name===V){u.delete(R);for(let H of G){let D=P.arguments[H.atIndex],Z=typeof H.literal=="string"?F(H.literal):H.literal;if(!D){e.report({node:P,messageId:"default",data:{message:`Missing argument with value "${Z}" at index ${H.atIndex}${g?`: ${F(g)}`:""}`}});continue}if(D.type!==he.AST_NODE_TYPES.Literal){e.report({node:D,messageId:"default",data:{message:`Argument at position ${H.atIndex} should the literal "${Z}"${g?`: ${F(g)}`:""}`}});continue}D.value!==Z&&e.report({node:D,messageId:"default",data:{message:`Argument should have the value "${Z}"${g?`: ${F(g)}`:""}`},fix:q=>q.replaceText(D,typeof Z=="string"?`'${Z}'`:String(Z))})}break}}})}for(let{selector:d,message:g}of k??[])f.set(d,F(g)),a.set(F(d),()=>{f.delete(d)});for(let{name:d,type:g,message:R}of O??[]){let P=F(d),j=F(R);y.add(`${P}:${g}:${j}`)}}}for(let{fn:b,withArgs:w,message:k,replaceWith:O,ignoreRegex:p}of i??[])p&&new RegExp(p).test(l)||c.push(F=>{let{callee:d}=F;if(d.type!==he.AST_NODE_TYPES.Identifier||!I(d.name,b))return;if(w)for(let R of w){let P=F.arguments[R.atIndex];if(!P){e.report({node:F,messageId:"default",data:{message:`Missing argument with value "${R.value}" at index ${R.atIndex}: ${k}`}});return}if(P.type!==he.AST_NODE_TYPES.Literal||P.value!==R.value)return}let g=R=>O?R.replaceText(F,O):null;e.report({node:F,messageId:"default",data:{message:k},suggest:O?[{messageId:"default",data:{message:`Replace with "${O}"`},fix:g}]:void 0})});function A(b,w){let k=r[b];k?r[b]=O=>{k(O),w(O)}:r[b]=w}for(let{selector:b,message:w,replace:k,replaceType:O="suggestion"}of s??[]){if(b==="CallExpression"){c.push(p=>{S(k,p,w,O)});continue}r[b]=p=>{S(k,p,w,O)}}if(a.size>0)for(let[b,w]of a)A(b,w);return c.length>0&&(r.CallExpression=b=>{if(b.type===he.AST_NODE_TYPES.CallExpression)for(let w of c)w(b)}),r.ImportDeclaration=b=>{b.type===he.AST_NODE_TYPES.ImportDeclaration&&m(b)},r.ExportNamedDeclaration=b=>{b.type===he.AST_NODE_TYPES.ExportNamedDeclaration&&E(b)},r.VariableDeclarator=b=>{b.type===he.AST_NODE_TYPES.VariableDeclarator&&C(b)},r["Program:exit"]=b=>{for(let w of u)e.report({node:b,messageId:"default",data:{message:w}});for(let[,w]of f)e.report({node:b,messageId:"default",data:{message:w}});for(let w of y){let[k,O,p]=w.split(":");e.report({node:b,messageId:"default",data:{message:`Missing required export "${k}" of type ${O}: ${p}`}})}},r;function S(b,w,k,O){let p=F=>{if(!b)return null;if(typeof b=="string")return F.replaceText(w,b);{let d=new RegExp(b.regex),g=e.sourceCode.getText(w);return F.replaceText(w,g.replace(d,b.with))}};e.report({node:w,messageId:"default",data:{message:k},fix:b&&O==="autofix"?p:void 0,suggest:b&&O==="suggestion"?[{messageId:"default",data:{message:`Replace with "${typeof b=="string"?b:b.with}"`},fix:p}]:void 0})}}});function Di(e,t){let r=[],n=t.exec(e);if(!n)return null;let[o,...s]=n;r.push({name:"$0_lowercase",value:o.toLowerCase()}),r.push({name:"$0_capitalize",value:tr(o)}),r.push({name:"$0_uncapitalize",value:nr(o)}),r.push({name:"$0",value:o});for(let i=0;i<s.length;i++){let l=`$${i+1}`,c=s[i];c!==void 0&&(r.push({name:`${l}_lowercase`,value:c.toLowerCase()}),r.push({name:`${l}_capitalize`,value:tr(c)}),r.push({name:`${l}_uncapitalize`,value:nr(c)}),r.push({name:l,value:c}))}return r}function tr(e){return e.charAt(0).toUpperCase()+e.slice(1)}function nr(e){return e.charAt(0).toLowerCase()+e.slice(1)}var re=require("@typescript-eslint/utils"),Be=require("zod/v4");var ji=re.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),ir="collapse-simple-objs-in-one-line",Li=Be.z.object({maxLineLength:Be.z.number().optional(),maxProperties:Be.z.number().optional(),nestedObjMaxLineLength:Be.z.number().optional(),nestedObjMaxProperties:Be.z.number().optional(),ignoreTypesWithSuffix:Be.z.array(Be.z.string()).optional()}),Mi=ji({name:ir,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(Li)]},defaultOptions:[{}],create(e,[t]){let r=e.sourceCode,n=t.ignoreTypesWithSuffix??[],o=t.maxProperties??2,s=t.nestedObjMaxLineLength??t.maxLineLength,i=t.nestedObjMaxProperties??3;function l(a){if(a.type===re.AST_NODE_TYPES.ObjectExpression){let u=a.parent.type===re.AST_NODE_TYPES.Property,f=u?i:o,y=a.properties.length;if(y>f)return!1;if(y===1){let m=a.properties[0];return!m||m.type===re.AST_NODE_TYPES.Property&&m.value.type===re.AST_NODE_TYPES.ObjectExpression||m.type===re.AST_NODE_TYPES.Property&&m.value.type===re.AST_NODE_TYPES.ArrayExpression&&!m.value.elements.every(C=>C&&Mt(C))?!1:{text:r.getText(m),isNested:u,propsSize:y}}let x=[];for(let m of a.properties){if(m.type===re.AST_NODE_TYPES.Property&&!Mt(m.value))return!1;x.push(r.getText(m))}return{text:x.join(", "),isNested:u,propsSize:y}}else{let u=a.parent.parent?.type===re.AST_NODE_TYPES.TSPropertySignature,f=u?i:o,y=a.members.length;if(y>f)return!1;if(n.length>0&&a.parent.type===re.AST_NODE_TYPES.TSTypeAliasDeclaration){let m=a.parent.id.name;if(n.some(E=>m.endsWith(E)))return!1}if(y===1){let m=a.members[0];return!m||m.type===re.AST_NODE_TYPES.TSPropertySignature&&m.typeAnnotation?.typeAnnotation.type===re.AST_NODE_TYPES.TSTypeLiteral?!1:{text:r.getText(m),isNested:u,propsSize:1}}if(a.parent.type===re.AST_NODE_TYPES.TSIntersectionType||a.parent.type===re.AST_NODE_TYPES.TSUnionType&&a.parent.types[0]!==a)return!1;let x=[];for(let m of a.members){if(m.type!==re.AST_NODE_TYPES.TSPropertySignature)return!1;let E=m.typeAnnotation?.typeAnnotation;if(!E||E.type===re.AST_NODE_TYPES.TSTypeLiteral||!rr(E))return!1;if(E.type===re.AST_NODE_TYPES.TSTypeReference&&E.typeArguments){if(E.typeArguments.params.length>1)return!1;let T=E.typeArguments.params[0];if(!T||!rr(T))return!1}let C=r.getText(m).trim();(C.endsWith(";")||C.endsWith(","))&&(C=C.slice(0,-1)),x.push(C)}return{text:x.join("; "),isNested:u,propsSize:y}}}function c(a){if(a.loc.start.line===a.loc.end.line)return;if(a.parent.type!==re.AST_NODE_TYPES.JSXExpressionContainer){let E=0,C=!1,T=r.getTokenAfter(a,{filter:A=>A.type!==re.AST_TOKEN_TYPES.Punctuator||C?!0:A.value===","?(E++,!1):A.value===";"?(E++,C=!0,!1):A.value===")"||A.value==="}"?(E++,!1):!0});if(E>4)return;let I=T?.type===re.AST_TOKEN_TYPES.Template&&T.value.startsWith(`}
2
+ `);if(T?.loc.start.line===a.loc.end.line&&!I)return}let u=l(a);if(!u)return;let f=u.text;if(f.includes(`
3
+ `)||r.getCommentsInside(a).length>0)return;f.endsWith(";")&&(f=f.slice(0,-1));let y=`{ ${f} }`,x=$i(r,a),m=u.isNested&&u.propsSize>2?s:t.maxLineLength;m&&y.length+x.length+_i(a,r)>m||e.report({node:a,messageId:"singleLineProp",fix:E=>E.replaceText(a,y)})}return{TSTypeLiteral:c,ObjectExpression:c}}});function rr(e){return e.type===re.AST_NODE_TYPES.TSLiteralType||e.type===re.AST_NODE_TYPES.TSTypeReference||e.type===re.AST_NODE_TYPES.TSNumberKeyword||e.type===re.AST_NODE_TYPES.TSStringKeyword||e.type===re.AST_NODE_TYPES.TSBooleanKeyword||e.type===re.AST_NODE_TYPES.TSNullKeyword||e.type===re.AST_NODE_TYPES.TSUndefinedKeyword}function Mt(e,t){return!!(e.type===re.AST_NODE_TYPES.Literal||e.type===re.AST_NODE_TYPES.Identifier||e.type===re.AST_NODE_TYPES.TemplateLiteral||e.type===re.AST_NODE_TYPES.TaggedTemplateExpression||!t&&e.type===re.AST_NODE_TYPES.ArrayExpression&&e.elements.every(r=>r&&Mt(r,!0)))}function _i(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 $i(e,t){return e.text.slice(t.range[0]-t.loc.start.column,t.range[0])}var _t={name:ir,rule:Mi};var Ui=/eslint +react-compiler\/react-compiler: +\["error/;function zi(e){let t=null;if((e.type==="FunctionDeclaration"||e.type==="FunctionExpression"||e.type==="ArrowFunctionExpression"&&e.body.type==="BlockStatement")&&(t=e.body),!t||t.body.length===0)return!1;let r=t.body[0];return r.type==="ExpressionStatement"&&r.expression.type==="Literal"&&r.expression.value==="use no memo"}function Wi(e){let t=e.parent;for(;t;){if(t.type==="FunctionDeclaration"||t.type==="FunctionExpression"||t.type==="ArrowFunctionExpression")return t;t=t.parent}return null}var sr={meta:{type:"suggestion",docs:{description:"verifies the list of dependencies for Hooks like useEffect and similar",recommended:!0,url:"https://github.com/facebook/react/issues/14920"},fixable:"code",hasSuggestions:!0,schema:[{type:"object",additionalProperties:!1,ignoreIfReactCompilerIsEnabled:!1,enableDangerousAutofixThisMayCauseInfiniteLoops:!1,properties:{additionalHooks:{type:"string"},ignoreIfReactCompilerIsEnabled:{type:"boolean"},enableDangerousAutofixThisMayCauseInfiniteLoops:{type:"boolean"},reactCompilerIsEnabled:{type:"boolean"}}}]},create(e){let t=!1,r=typeof e.getSource=="function"?I=>r(I):I=>e.sourceCode.getText(I),n=typeof e.getScope=="function"?()=>n():I=>e.sourceCode.getScope(I),o=e.options&&e.options[0]&&e.options[0].additionalHooks?new RegExp(e.options[0].additionalHooks):void 0,s=e.options&&e.options[0]&&e.options[0].enableDangerousAutofixThisMayCauseInfiniteLoops||!1,i={additionalHooks:o,enableDangerousAutofixThisMayCauseInfiniteLoops:s};function l(I){s&&Array.isArray(I.suggest)&&I.suggest.length>0&&(I.fix=I.suggest[0].fix),e.report(I)}let c=e.getSourceCode().scopeManager,a=new WeakMap,u=new WeakSet,f=new WeakMap,y=new WeakMap,x=new WeakSet;function m(I,A){return function(S){if(A.has(S))return A.get(S);let h=I(S);return A.set(S,h),h}}function E(I,A,S,h,b){b&&I.async&&l({node:I,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,14 +12,14 @@ useEffect(() => {
12
12
  fetchData();
13
13
  }, [someId]); // Or [] if effect doesn't need props or state
14
14
 
15
- Learn more about data fetching with Hooks: https://reactjs.org/link/hooks-data-fetching`});let w=c.acquire(I),k=new Set,N=null;{let v=w.upper;for(;v&&(k.add(v),v.type!=="function");)v=v.upper;if(!v)return;N=v}let p=Array.isArray;function F(v){if(!p(v.defs))return!1;let O=v.defs[0];if(O==null||O.node.type!=="VariableDeclarator")return!1;let $=O.node.init;if($==null)return!1;for(;$.type==="TSAsExpression";)$=$.expression;let W=O.node.parent;if(W==null&&(zt(N.block,O.node.id),W=O.node.parent,W==null))return!1;if(W.kind==="const"&&$.type==="Literal"&&(typeof $.value=="string"||typeof $.value=="number"||$.value===null))return!0;if($.type!=="CallExpression")return!1;let H=$.callee;if(H.type==="MemberExpression"&&H.object.name==="React"&&H.property!=null&&!H.computed&&(H=H.property),H.type!=="Identifier")return!1;let J=O.node.id,{name:Q}=H;if(Q==="useRef"&&J.type==="Identifier")return!0;if(zi(H)&&J.type==="Identifier"){for(let ee of v.references)ee!==J&&x.add(ee.identifier);return!0}else if(Q==="useState"||Q==="useReducer"){if(J.type==="ArrayPattern"&&J.elements.length===2&&p(v.identifiers)){if(J.elements[1]===v.identifiers[0]){if(Q==="useState"){let ee=v.references,ke=0;for(let Ue=0;Ue<ee.length;Ue++){if(ee[Ue].isWrite()&&ke++,ke>1)return!1;a.set(ee[Ue].identifier,J.elements[0])}}return!0}else if(J.elements[0]===v.identifiers[0]){if(Q==="useState"){let ee=v.references;for(let ke=0;ke<ee.length;ke++)u.add(ee[ke].identifier)}return!1}}}else if(Q==="useTransition"&&J.type==="ArrayPattern"&&J.elements.length===2&&Array.isArray(v.identifiers)&&J.elements[1]===v.identifiers[0])return!0;return!1}function d(v){if(!p(v.defs))return!1;let O=v.defs[0];if(O==null||O.node==null||O.node.id==null)return!1;let $=O.node,W=N.childScopes,H=null,J;for(J=0;J<W.length;J++){let Q=W[J],ee=Q.block;if($.type==="FunctionDeclaration"&&ee===$||$.type==="VariableDeclarator"&&ee.parent===$){H=Q;break}}if(H==null)return!1;for(J=0;J<H.through.length;J++){let Q=H.through[J];if(Q.resolved!=null&&k.has(Q.resolved.scope)&&!g(Q.resolved))return!1}return!0}let g=m(F,f),R=m(d,y),P=new Map;function j(v){let O=v.from,$=!1;for(;O.block!==I;)O.type==="function"&&($=O.block.parent!=null&&O.block.parent.type==="ReturnStatement"),O=O.upper;return $}let V=new Map,G=new Map;Y(w);function Y(v){for(let O of v.references){if(!O.resolved||!k.has(O.resolved.scope))continue;let $=zt(I,O.identifier),W=ar($),H=ze(W,G);if(b&&W.type==="Identifier"&&(W.parent.type==="MemberExpression"||W.parent.type==="OptionalMemberExpression")&&!W.parent.computed&&W.parent.property.type==="Identifier"&&W.parent.property.name==="current"&&j(O)&&P.set(H,{reference:O,dependencyNode:W}),W.parent.type==="TSTypeQuery"||W.parent.type==="TSTypeReference")continue;let J=O.resolved.defs[0];if(J!=null&&!(J.node!=null&&J.node.init===I.parent)&&J.type!=="TypeParameter")if(V.has(H))V.get(H).references.push(O);else{let Q=O.resolved,ee=g(Q)||R(Q);V.set(H,{isStable:ee,references:[O]})}}for(let O of v.childScopes)Y(O)}P.forEach(({reference:v,dependencyNode:O},$)=>{let W=v.resolved.references,H=!1;for(let J=0;J<W.length;J++){let{identifier:Q}=W[J],{parent:ee}=Q;if(ee!=null&&ee.type==="MemberExpression"&&!ee.computed&&ee.property.type==="Identifier"&&ee.property.name==="current"&&ee.parent.type==="AssignmentExpression"&&ee.parent.left===ee){H=!0;break}}H||l({node:O.parent.property,message:`The ref value '${$}.current' will likely have changed by the time this effect cleanup function runs. If this ref points to a node rendered by React, copy '${$}.current' to a variable inside the effect, and use that variable in the cleanup function.`})});let D=new Set;function Z(v,O){D.has(O)||(D.add(O),l({node:v,message:`Assignments to the '${O}' variable from inside React Hook ${r(T)} will be lost after each render. To preserve the value over time, store it in a useRef Hook and keep the mutable value in the '.current' property. Otherwise, you can move this variable directly inside ${r(T)}.`}))}let q=new Set;if(V.forEach(({isStable:v,references:O},$)=>{v&&q.add($),O.forEach(W=>{W.writeExpr&&Z(W.writeExpr,$)})}),D.size>0)return;if(!A){let v=null;if(V.forEach(({isStable:O,references:$},W)=>{v||$.forEach(H=>{if(v)return;let J=H.identifier;if(!a.has(J))return;let ee=H.from;for(;ee.type!=="function";)ee=ee.upper;ee.block===I&&(v=W)})}),v){let{suggestedDependencies:O}=$t({dependencies:V,declaredDependencies:[],stableDependencies:q,externalDependencies:new Set,isEffect:!0});l({node:T,message:`React Hook ${h} contains a call to '${v}'. Without a list of dependencies, this can lead to an infinite chain of updates. To fix this, pass [`+O.join(", ")+`] as a second argument to the ${h} Hook.`,suggest:[{desc:`Add dependencies array: [${O.join(", ")}]`,fix($){return $.insertTextAfter(I,`, [${O.join(", ")}]`)}}]})}return}let ue=[],fe=new Set;A.type!=="ArrayExpression"?l({node:A,message:`React Hook ${r(T)} was passed a dependency list that is not an array literal. This means we can't statically verify whether you've passed the correct dependencies.`}):A.elements.forEach(v=>{if(v===null)return;if(v.type==="SpreadElement"){l({node:v,message:`React Hook ${r(T)} has a spread element in its dependency array. This means we can't statically verify whether you've passed the correct dependencies.`});return}x.has(v)&&l({node:v,message:`Functions returned from \`useEffectEvent\` must not be included in the dependency array. Remove \`${r(v)}\` from the list.`,suggest:[{desc:`Remove the dependency \`${r(v)}\``,fix(H){return H.removeRange(v.range)}}]});let O;try{O=ze(v,G)}catch(H){if(/Unsupported node type/.test(H.message)){v.type==="Literal"?V.has(v.value)?l({node:v,message:`The ${v.raw} literal is not a valid dependency because it never changes. Did you mean to include ${v.value} in the array instead?`}):l({node:v,message:`The ${v.raw} literal is not a valid dependency because it never changes. You can safely remove it.`}):l({node:v,message:`React Hook ${r(T)} has a complex expression in the dependency array. Extract it to a separate variable so it can be statically checked.`});return}else throw H}let $=v;for(;$.type==="MemberExpression"||$.type==="OptionalMemberExpression"||$.type==="ChainExpression";)$=$.object||$.expression.object;let W=!N.through.some(H=>H.identifier===$);ue.push({key:O,node:v}),W||fe.add(O)});let{suggestedDependencies:ve,unnecessaryDependencies:Xe,missingDependencies:Se,duplicateDependencies:pt}=$t({dependencies:V,declaredDependencies:ue,stableDependencies:q,externalDependencies:fe,isEffect:b}),tt=ve;if(pt.size+Se.size+Xe.size===0){if(t)return;Mi({declaredDependencies:ue,declaredDependenciesNode:A,componentScope:N,scope:w}).forEach(({construction:O,isUsedOutsideOfHook:$,depType:W})=>{let H=W==="function"?"useCallback":"useMemo",J=W==="function"?"definition":"initialization",Q=`wrap the ${J} of '${O.name.name}' in its own ${H}() Hook.`,ee=$?`To fix this, ${Q}`:`Move it inside the ${h} callback. Alternatively, ${Q}`,ke=W==="conditional"||W==="logical expression"?"could make":"makes",Ue=`The '${O.name.name}' ${W} ${ke} the dependencies of ${h} Hook (at line ${A.loc.start.line}) change on every render. ${ee}`,Zn;$&&O.type==="Variable"&&W==="function"&&(Zn=[{desc:`Wrap the ${J} of '${O.name.name}' in its own ${H}() Hook.`,fix(Gn){let[Ei,bi]=H==="useMemo"?["useMemo(() => { return ","; })"]:["useCallback(",")"];return[Gn.insertTextBefore(O.node.init,Ei),Gn.insertTextAfter(O.node.init,bi)]}}]),l({node:O.node,message:Ue,suggest:Zn})});return}!b&&Se.size>0&&(tt=$t({dependencies:V,declaredDependencies:[],stableDependencies:q,externalDependencies:fe,isEffect:b}).suggestedDependencies);function Ee(){if(ue.length===0)return!0;let v=ue.map($=>$.key),O=v.slice().sort();return v.join(",")===O.join(",")}Ee()&&tt.sort();function Ie(v){let O=v.split("."),$="";for(let W=0;W<O.length;W++){if(W!==0){let H=O.slice(0,W+1).join("."),J=G.get(H)===!0;$+=J?"?.":"."}$+=O[W]}return $}function jt(v,O,$,W){return v.size===0?null:(v.size>1?"":O+" ")+$+" "+(v.size>1?"dependencies":"dependency")+": "+$i(Array.from(v).sort().map(H=>"'"+Ie(H)+"'"))+`. Either ${W} ${v.size>1?"them":"it"} or remove the dependency array.`}let De="";if(Xe.size>0){let v=null;if(Array.from(Xe.keys()).forEach(O=>{v===null&&O.endsWith(".current")&&(v=O)}),v!==null)De=` Mutable values like '${v}' aren't valid dependencies because mutating them doesn't re-render the component.`;else if(fe.size>0){let O=Array.from(fe)[0];w.set.has(O)||(De=` Outer scope values like '${O}' aren't valid dependencies because mutating them doesn't re-render the component.`)}}if(!De&&Se.has("props")){let v=V.get("props");if(v==null)return;let O=v.references;if(!Array.isArray(O))return;let $=!0;for(let W=0;W<O.length;W++){let H=O[W],J=zt(N.block,H.identifier);if(!J){$=!1;break}let Q=J.parent;if(Q==null){$=!1;break}if(Q.type!=="MemberExpression"&&Q.type!=="OptionalMemberExpression"){$=!1;break}}$&&(De=` However, 'props' will change when *any* prop changes, so the preferred fix is to destructure the 'props' object outside of the ${h} call and refer to those specific props inside ${r(T)}.`)}if(!De&&Se.size>0){let v=null;Se.forEach(O=>{if(v)return;let $=N.set.get(O),W=V.get(O);if(W.references[0].resolved!==$)return;let H=$.defs[0];if(H==null||H.name==null||H.type!=="Parameter")return;let J=!1,Q;for(let ee=0;ee<W.references.length;ee++)if(Q=W.references[ee].identifier,Q!=null&&Q.parent!=null&&(Q.parent.type==="CallExpression"||Q.parent.type==="OptionalCallExpression")&&Q.parent.callee===Q){J=!0;break}J&&(v=O)}),v!==null&&(De=` If '${v}' changes too often, find the parent component that defines it and wrap that definition in useCallback.`)}if(!De&&Se.size>0){let v=null;if(Se.forEach(O=>{if(v!==null)return;let W=V.get(O).references,H,J;for(let Q=0;Q<W.length;Q++){for(H=W[Q].identifier,J=H.parent;J!=null&&J!==N.block;){if(J.type==="CallExpression"){let ee=a.get(J.callee);if(ee!=null){if(ee.name===O)v={missingDep:O,setter:J.callee.name,form:"updater"};else if(u.has(H))v={missingDep:O,setter:J.callee.name,form:"reducer"};else{let ke=W[Q].resolved;if(ke!=null){let Ue=ke.defs[0];Ue!=null&&Ue.type==="Parameter"&&(v={missingDep:O,setter:J.callee.name,form:"inlineReducer"})}}break}}J=J.parent}if(v!==null)break}}),v!==null)switch(v.form){case"reducer":De=` You can also replace multiple useState variables with useReducer if '${v.setter}' needs the current value of '${v.missingDep}'.`;break;case"inlineReducer":De=` If '${v.setter}' needs the current value of '${v.missingDep}', you can also switch to useReducer instead of useState and read '${v.missingDep}' in the reducer.`;break;case"updater":De=` You can also do a functional update '${v.setter}(${v.missingDep.slice(0,1)} => ...)' if you only need '${v.missingDep}' in the '${v.setter}' call.`;break;default:throw new Error("Unknown case.")}}l({node:A,message:`React Hook ${r(T)} has `+(jt(Se,"a","missing","include")||jt(Xe,"an","unnecessary","exclude")||jt(pt,"a","duplicate","omit"))+De,suggest:[{desc:`Update the dependencies array to be: [${tt.map(Ie).join(", ")}]`,fix(v){return v.replaceText(A,`[${tt.map(Ie).join(", ")}]`)}}]})}function C(I){let A=_i(I.callee,i);if(A===-1)return;let T=I.arguments[A],h=I.callee,b=lr(h).name,w=I.arguments[A+1],k=/Effect($|[^a-z])/g.test(b);if(!T){l({node:h,message:`React Hook ${b} requires an effect callback. Did you forget to pass a callback to the hook?`});return}if(!(t&&!k)){if(!w&&!k){(b==="useMemo"||b==="useCallback")&&l({node:h,message:`React Hook ${b} does nothing when called with only one argument. Did you forget to pass an array of dependencies?`});return}switch(T.type){case"FunctionExpression":case"ArrowFunctionExpression":E(T,w,h,b,k);return;case"Identifier":if(!w||w.elements&&w.elements.some(F=>F&&F.type==="Identifier"&&F.name===T.name))return;let N=n(I).set.get(T.name);if(N==null||N.defs==null)return;let p=N.defs[0];if(!p||!p.node||p.type!=="Variable"&&p.type!=="FunctionName")break;switch(p.node.type){case"FunctionDeclaration":E(p.node,w,h,b,k);return;case"VariableDeclarator":let F=p.node.init;if(!F)break;switch(F.type){case"ArrowFunctionExpression":case"FunctionExpression":E(F,w,h,b,k);return}break}break;default:l({node:h,message:`React Hook ${b} received a function whose dependencies are unknown. Pass an inline function instead.`});return}l({node:h,message:`React Hook ${b} has a missing dependency: '${T.name}'. Either include it or remove the dependency array.`,suggest:[{desc:`Update the dependencies array to be: [${T.name}]`,fix(N){return N.replaceText(w,`[${T.name}]`)}}]})}}let S=!!e.options[0]?.reactCompilerIsEnabled;if(e.options[0]?.ignoreIfReactCompilerIsEnabled||S){for(let I of e.sourceCode.getAllComments())if(S||Li.test(I.value))return t=!0,{CallExpression:A=>C(A,!0)}}return{CallExpression:I=>C(I)}}};function $t({dependencies:e,declaredDependencies:t,stableDependencies:r,externalDependencies:n,isEffect:o}){let s=i();function i(){return{isUsed:!1,isSatisfiedRecursively:!1,isSubtreeUsed:!1,children:new Map}}e.forEach((E,C)=>{let S=l(s,C);S.isUsed=!0,c(s,C,I=>{I.isSubtreeUsed=!0})}),t.forEach(({key:E})=>{let C=l(s,E);C.isSatisfiedRecursively=!0}),r.forEach(E=>{let C=l(s,E);C.isSatisfiedRecursively=!0});function l(E,C){let S=C.split("."),I=E;for(let A of S){let T=I.children.get(A);T||(T=i(),I.children.set(A,T)),I=T}return I}function c(E,C,S){let I=C.split("."),A=E;for(let T of I){let h=A.children.get(T);if(!h)return;S(h),A=h}}let a=new Set,u=new Set;f(s,a,u,E=>E);function f(E,C,S,I){E.children.forEach((A,T)=>{let h=I(T);if(A.isSatisfiedRecursively){A.isSubtreeUsed&&S.add(h);return}if(A.isUsed){C.add(h);return}f(A,C,S,b=>h+"."+b)})}let y=[],x=new Set,m=new Set;return t.forEach(({key:E})=>{u.has(E)?y.indexOf(E)===-1?y.push(E):m.add(E):x.add(E)}),a.forEach(E=>{y.push(E)}),{suggestedDependencies:y,unnecessaryDependencies:x,duplicateDependencies:m,missingDependencies:a}}function He(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 He(e.consequent)!=null||He(e.alternate)!=null?"conditional":null;case"LogicalExpression":return He(e.left)!=null||He(e.right)!=null?"logical expression":null;case"JSXFragment":return"JSX fragment";case"JSXElement":return"JSX element";case"AssignmentExpression":return He(e.right)!=null?"assignment expression":null;case"NewExpression":return"object construction";case"Literal":return e.value instanceof RegExp?"regular expression":null;case"TypeCastExpression":return He(e.expression);case"TSAsExpression":return He(e.expression)}return null}function Mi({declaredDependencies:e,declaredDependenciesNode:t,componentScope:r,scope:n}){let o=e.map(({key:i})=>{let l=r.variables.find(a=>a.name===i);if(l==null)return null;let c=l.defs[0];if(c==null)return null;if(c.type==="Variable"&&c.node.type==="VariableDeclarator"&&c.node.id.type==="Identifier"&&c.node.init!=null){let a=He(c.node.init);if(a!=null)return[l,a]}return c.type==="FunctionName"&&c.node.type==="FunctionDeclaration"?[l,"function"]:c.type==="ClassName"&&c.node.type==="ClassDeclaration"?[l,"class"]:null}).filter(Boolean);function s(i){let l=!1;for(let c=0;c<i.references.length;c++){let a=i.references[c];if(a.writeExpr){if(l)return!0;l=!0;continue}let u=a.from;for(;u!==n&&u!=null;)u=u.upper;if(u!==n&&!pr(t,a.identifier))return!0}return!1}return o.map(([i,l])=>({construction:i.defs[0],depType:l,isUsedOutsideOfHook:s(i)}))}function ar(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)?ar(e.parent):e.type==="MemberExpression"&&e.parent&&e.parent.type==="AssignmentExpression"&&e.parent.left===e?e.object:e}function Ut(e,t,r){t&&(e.optional?t.has(r)||t.set(r,!0):t.has(r)||t.set(r,!1))}function ze(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=ze(e.object,t),n=ze(e.property,null),o=`${r}.${n}`;return Ut(e,t,o),o}else if(e.type==="OptionalMemberExpression"&&!e.computed){let r=ze(e.object,t),n=ze(e.property,null),o=`${r}.${n}`;return Ut(e,t,o),o}else if(e.type==="ChainExpression"&&!e.computed){let r=e.expression;if(r.type==="CallExpression")throw new Error(`Unsupported node type: ${r.type}`);let n=ze(r.object,t),o=ze(r.property,null),s=`${n}.${o}`;return Ut(r,t,s),s}else throw new Error(`Unsupported node type: ${e.type}`)}function lr(e,t){return e.type==="MemberExpression"&&e.object.type==="Identifier"&&e.object.name==="React"&&e.property.type==="Identifier"&&!e.computed?e.property:e}function _i(e,t){let r=lr(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=ze(r,null)}catch(o){if(/Unsupported node type/.test(o.message))return 0;throw o}return t.additionalHooks.test(n)?0:-1}else return-1}}function zt(e,t){let r=[e],n=null;for(;r.length;){if(n=r.shift(),Ui(n,t))return n;if(pr(n,t))for(let[o,s]of Object.entries(n))o!=="parent"&&(or(s)?(s.parent=n,r.push(s)):Array.isArray(s)&&s.forEach(i=>{or(i)&&(i.parent=n,r.push(i))}))}return null}function $i(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 or(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&typeof e.type=="string"}function Ui(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 pr(e,t){return e.range[0]<=t.range[0]&&e.range[1]>=t.range[1]}function zi(e){return!1}var ae=require("@typescript-eslint/utils"),B=Pe(require("typescript")),Xt=require("zod/v4");var Wt=require("@typescript-eslint/utils");function nt(e,t,r=1/0){if(r!==0&&e.parent)return e.type===t?e:nt(e.parent,t,r===1/0?r:r-1)}function*Jt(e){yield e,e.parent&&(yield*Jt(e.parent))}function Vt(e,t){for(let r of e){let n=t(r);if(n!=null&&n!==!1)return n}}function ur(e,t,r){let o=r.getDeclaredVariables(e).find(s=>s.name===t||s.identifiers[0]?.parent.type===Wt.AST_NODE_TYPES.Property&&s.identifiers[0].parent.key.type===Wt.AST_NODE_TYPES.Identifier&&s.identifiers[0].parent.key.name===t);return o?o.references.filter(s=>!s.init):[]}function cr(e){return e===null||typeof e!="object"||!("type"in e)?!1:typeof e.type=="string"}function Wi(e,t){return e[t]}function je(e,t,r){let n=r.visitorKeys,o=new Set;function s(i){if(o.has(i))return!1;if(o.add(i),t(i)===!0)return!0;let c=n[i.type];if(c)for(let a of c){let u=Wi(i,a);if(u){if(Array.isArray(u)){for(let f of u)if(cr(f)&&s(f))return!0}else if(cr(u)&&s(u))return!0}}return!1}s(e)}var Ji=ae.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),fr="improved-no-unnecessary-condition",Vi=Xt.z.object({alternativeForInCondition:Xt.z.string().optional().describe("Alternative to appear in the error for `in` condition")}),mr={object:"Array",property:"isArray"},Xi=["string","number","bigint","boolean","symbol","undefined","object","function","never"],Bi=new Set(Xi),Bt={name:fr,rule:Ji({name:fr,meta:{type:"suggestion",docs:{description:"Extends checks of `no-unnecessary-condition` rule"},messages:{unnecessaryTypeofCondition:'This condition is unnecessary. The type of "{{name}}" is always "{{type}}".',alwaysFalseTypeofCondition:'This condition will always be false. The type of "{{name}}" is "{{actualType}}" so the condition has no overlap with "{{conditionType}}".',unnecessaryStartsWithCondition:"This startsWith check is unnecessary as it always evaluates to true.",alwaysFalseStartsWithCondition:"This startsWith check will always be false.",unnecessaryEndsWithCondition:"This endsWith check is unnecessary as it always evaluates to true.",alwaysFalseEndsWithCondition:"This endsWith check will always be false.",unnecessaryIncludesCondition:"This includes check is unnecessary as it always evaluates to true.",alwaysFalseIncludesCondition:"This includes check will always be false.",unnecessaryArrayIsArrayCondition:"This Array.isArray check is unnecessary as it always evaluates to true.",alwaysFalseArrayIsArrayCondition:"This Array.isArray check will always be false.",unnecessaryLengthCondition:"This length comparison is unnecessary as it always evaluates to true.",alwaysFalseLengthCondition:"This length comparison will always be false.",unnecessaryInCondition:'This in check is unnecessary. Property "{{property}}" always exists on type "{{type}}".{{alternative}}',alwaysFalseInCondition:'This in check will always be false. Property "{{property}}" does not exist on type "{{type}}".{{alternative}}'},schema:[z(Vi)]},defaultOptions:[{}],create(e,[t]){let r=ae.ESLintUtils.getParserServices(e,!0),n=r.program?.getTypeChecker();if(!n||!r.program)throw new Error("TypeScript services or program not available");function o(p){return p.type===ae.AST_NODE_TYPES.UnaryExpression&&p.operator==="typeof"}function s(p){return p.flags&B.default.TypeFlags.Any||p.flags&B.default.TypeFlags.Unknown?null:p.flags&B.default.TypeFlags.StringLike?["string"]:p.flags&B.default.TypeFlags.NumberLike?["number"]:p.flags&B.default.TypeFlags.BigIntLike?["bigint"]:p.flags&B.default.TypeFlags.BooleanLike?["boolean"]:p.flags&B.default.TypeFlags.ESSymbolLike?["symbol"]:p.flags&B.default.TypeFlags.Undefined||p.flags&B.default.TypeFlags.Void?["undefined"]:p.flags&B.default.TypeFlags.Null?["object"]:p.getCallSignatures().length>0?["function"]:p.flags&B.default.TypeFlags.Object?p.getProperties().length===0?["string","number","bigint","boolean","symbol","object","function"]:["object"]:p.flags&B.default.TypeFlags.NonPrimitive?["object"]:p.flags&B.default.TypeFlags.Never?["never"]:null}function i(p){if(!n)return null;let F=r.esTreeNodeToTSNodeMap.get(p),d=n.getTypeAtLocation(F.expression);if(d.flags&B.default.TypeFlags.Any||d.flags&B.default.TypeFlags.Unknown)return null;let g=[];if(d.isUnion()){for(let P of d.types){let j=s(P);if(j)g.push(...j);else return null}return g}let R=s(d);return R?(g.push(...R),g):null}function l(p){if(!(p.operator==="==="||p.operator==="!=="))return;let d=null,g=null;if(o(p.left)?(d=p.left,g=p.right.type===ae.AST_NODE_TYPES.Literal&&typeof p.right.value=="string"?p.right.value:null):o(p.right)&&(d=p.right,g=p.left.type===ae.AST_NODE_TYPES.Literal&&typeof p.left.value=="string"?p.left.value:null),!d||!g||!Hi(g,Bi))return;let R=i(d);if(!R)return;let P=p.operator==="!==",j=R.includes(g);R.length===1?j&&!P?e.report({node:p,messageId:"unnecessaryTypeofCondition",data:{name:rt(d,e),type:g}}):!j&&P?e.report({node:p,messageId:"unnecessaryTypeofCondition",data:{name:rt(d,e),type:Array.from(R)[0]}}):!j&&!P?e.report({node:p,messageId:"alwaysFalseTypeofCondition",data:{name:rt(d,e),actualType:Tt(R),conditionType:g}}):j&&P&&e.report({node:p,messageId:"alwaysFalseTypeofCondition",data:{name:rt(d,e),actualType:Tt(R),conditionType:g}}):!j&&!P?e.report({node:p,messageId:"alwaysFalseTypeofCondition",data:{name:rt(d,e),actualType:Tt(R),conditionType:g}}):!j&&P&&e.report({node:p,messageId:"unnecessaryTypeofCondition",data:{name:rt(d,e),type:Tt(R)}})}function c(p){if(p.flags&B.default.TypeFlags.Any||p.flags&B.default.TypeFlags.Unknown)return null;if(p.isUnion()){let F=[];for(let d of p.types)if(d.flags&B.default.TypeFlags.StringLiteral){let g=d.value;F.push(g)}else return null;return F}return p.flags&B.default.TypeFlags.StringLiteral?[p.value]:null}function a(p){if(!n)return null;let F=r.esTreeNodeToTSNodeMap.get(p),d=n.getTypeAtLocation(F),g=c(d);if(g)return g;let R=n.getSymbolAtLocation(F);if(R){let P=n.getTypeOfSymbolAtLocation(R,F),j=c(P);if(j)return j}return null}function u(p){let F=e.sourceCode.ast,d=null;return je(F,g=>{if(g.type===ae.AST_NODE_TYPES.VariableDeclarator&&g.id.type===ae.AST_NODE_TYPES.Identifier&&g.id.name===p.name&&g.id.typeAnnotation){let R=g.id.typeAnnotation.typeAnnotation;if(R.type===ae.AST_NODE_TYPES.TSUnionType){let P=[];for(let j of R.types)if(j.type===ae.AST_NODE_TYPES.TSLiteralType&&j.literal.type===ae.AST_NODE_TYPES.Literal&&typeof j.literal.value=="string")P.push(j.literal.value);else return!0;return d=P,!0}if(R.type===ae.AST_NODE_TYPES.TSLiteralType&&R.literal.type===ae.AST_NODE_TYPES.Literal&&typeof R.literal.value=="string")return d=[R.literal.value],!0}return!1},e.sourceCode),d}function f(p){return p==="Array"||p==="ReadonlyArray"?!0:p.endsWith(".Array")||p.endsWith(".ReadonlyArray")}function y(p){if(!n)return!1;if(n.isArrayType(p)||n.isTupleType(p))return!0;let F=n.getApparentType(p);if(F!==p&&(n.isArrayType(F)||n.isTupleType(F)))return!0;if(p.aliasSymbol){let g=n.getFullyQualifiedName(p.aliasSymbol);if(f(g))return!0}let d=p.getSymbol();if(d){let g=n.getFullyQualifiedName(d);if(f(g))return!0}return!1}function x(p){if(!n)return!1;if(p.flags&B.default.TypeFlags.StringLike||p.flags&B.default.TypeFlags.NumberLike||p.flags&B.default.TypeFlags.BigIntLike||p.flags&B.default.TypeFlags.BooleanLike||p.flags&B.default.TypeFlags.ESSymbolLike||p.flags&B.default.TypeFlags.EnumLike||p.flags&B.default.TypeFlags.Null||p.flags&B.default.TypeFlags.Undefined||p.flags&B.default.TypeFlags.Void||p.flags&B.default.TypeFlags.Never)return!0;let F=p.getSymbol();if(F){let d=n.getFullyQualifiedName(F);if(d==="__function"||d==="__object"&&!y(p))return!0}return!1}function m(p){if(p.flags&B.default.TypeFlags.Any||p.flags&B.default.TypeFlags.Unknown)return"unknown";if(p.isUnion()){let F=!0,d=!0;for(let g of p.types){let R=m(g);if(R==="unknown")return"unknown";R!=="alwaysTrue"&&(F=!1),R!=="alwaysFalse"&&(d=!1)}return F?"alwaysTrue":d?"alwaysFalse":"unknown"}return y(p)?"alwaysTrue":x(p)?"alwaysFalse":"unknown"}function E(p){return!p.computed&&p.object.type===ae.AST_NODE_TYPES.Identifier&&p.object.name===mr.object&&p.property.type===ae.AST_NODE_TYPES.Identifier&&p.property.name===mr.property}function C(p){if(!n||p.callee.type!==ae.AST_NODE_TYPES.MemberExpression||!E(p.callee)||p.arguments.length===0)return;let[F]=p.arguments;if(!F||F.type===ae.AST_NODE_TYPES.SpreadElement)return;let d=r.esTreeNodeToTSNodeMap.get(F),g=n.getTypeAtLocation(d),R=m(g);R==="alwaysTrue"?e.report({node:p,messageId:"unnecessaryArrayIsArrayCondition"}):R==="alwaysFalse"&&e.report({node:p,messageId:"alwaysFalseArrayIsArrayCondition"})}function S(p){if(p.callee.type!==ae.AST_NODE_TYPES.MemberExpression||p.callee.property.type!==ae.AST_NODE_TYPES.Identifier||p.callee.computed)return;let F=p.callee.property.name;if(F!=="startsWith"&&F!=="endsWith"&&F!=="includes"||p.arguments.length!==1)return;let[d]=p.arguments;if(!d||d.type!==ae.AST_NODE_TYPES.Literal||typeof d.value!="string")return;let g=p.callee.object,R=a(g);if(!R&&g.type===ae.AST_NODE_TYPES.Identifier&&(R=u(g)),!R||R.length===0)return;let P=d.value;if(F==="includes"&&R.length>1)return;let j=0,V=0;for(let G of R)if((F==="startsWith"?G.startsWith(P):F==="endsWith"?G.endsWith(P):G.includes(P))?j++:V++,j>0&&V>0)return;if(j>0&&V===0){let G=F==="startsWith"?"unnecessaryStartsWithCondition":F==="endsWith"?"unnecessaryEndsWithCondition":"unnecessaryIncludesCondition";e.report({node:p,messageId:G})}else if(V>0&&j===0){let G=F==="startsWith"?"alwaysFalseStartsWithCondition":F==="endsWith"?"alwaysFalseEndsWithCondition":"alwaysFalseIncludesCondition";e.report({node:p,messageId:G})}}function I(p){if(!new Set(["===","!==",">",">=","<","<="]).has(p.operator))return;function d(Y){if(Y.type!==ae.AST_NODE_TYPES.MemberExpression||Y.computed||Y.property.type!==ae.AST_NODE_TYPES.Identifier||Y.property.name!=="length")return null;let D=Y.object,Z=a(D);if(!Z||Z.length===0)return null;let q=[];for(let ue of Z)q.push(ue.length);return{values:q}}let g=d(p.left),R=d(p.right),P=null,j=null;if(g?p.right.type===ae.AST_NODE_TYPES.Literal&&typeof p.right.value=="number"&&(P=g.values,j=p.right.value):R&&p.left.type===ae.AST_NODE_TYPES.Literal&&typeof p.left.value=="number"&&(P=R.values,j=p.left.value),!P||j===null)return;let V=0,G=0;for(let Y of P){let D=!1;if(p.operator==="==="?D=Y===j:p.operator==="!=="?D=Y!==j:p.operator===">"?D=Y>j:p.operator===">="?D=Y>=j:p.operator==="<"?D=Y<j:p.operator==="<="&&(D=Y<=j),D?V++:G++,V>0&&G>0)return}V>0&&G===0?e.report({node:p,messageId:"unnecessaryLengthCondition"}):G>0&&V===0&&e.report({node:p,messageId:"alwaysFalseLengthCondition"})}function A(p){if(p.type===ae.AST_NODE_TYPES.Literal&&typeof p.value=="string")return p.value;let F=a(p);if(!F||F.length!==1)return null;let[d]=F;return d??null}function T(p){return(p.flags&B.default.TypeFlags.Intersection)!==0}function h(p){return(p.flags&B.default.TypeFlags.Object)!==0}function b(p){return!n||n.getIndexTypeOfType(p,B.default.IndexKind.String)?!0:!!n.getIndexTypeOfType(p,B.default.IndexKind.Number)}function w(p,F){if(!n||b(p)||p.getProperties().length===0)return"unknown";let d=n.getPropertyOfType(p,F);return d?d.flags&B.default.SymbolFlags.Optional?"optional":"required":"absent"}function k(p,F){if(p.flags&B.default.TypeFlags.Any||p.flags&B.default.TypeFlags.Unknown||p.flags&B.default.TypeFlags.Never||p.flags&B.default.TypeFlags.TypeParameter||p.flags&B.default.TypeFlags.IndexedAccess||p.flags&B.default.TypeFlags.StringLike||p.flags&B.default.TypeFlags.NumberLike||p.flags&B.default.TypeFlags.BigIntLike||p.flags&B.default.TypeFlags.BooleanLike||p.flags&B.default.TypeFlags.EnumLike||p.flags&B.default.TypeFlags.ESSymbolLike||p.flags&B.default.TypeFlags.NonPrimitive||p.flags&B.default.TypeFlags.Null||p.flags&B.default.TypeFlags.Undefined||p.flags&B.default.TypeFlags.Void)return"unknown";if(p.isUnion()){let d=!0,g=!0;for(let R of p.types){let P=k(R,F);if(P==="unknown"||(P!=="required"&&(d=!1),P!=="absent"&&(g=!1),P==="optional"))return"unknown"}return d?"required":g?"absent":"unknown"}if(T(p)){let d=p,g=!1,R=!1;for(let P of d.types){let j=k(P,F);if(j==="unknown")return"unknown";j==="required"?g=!0:j==="optional"&&(R=!0)}return g?"required":R?"optional":"absent"}return h(p)?w(p,F):"unknown"}function N(p){if(p.operator!=="in"||p.left.type===ae.AST_NODE_TYPES.PrivateIdentifier)return;let F=A(p.left);if(!F)return;let d=p.right,g=r.esTreeNodeToTSNodeMap.get(d);if(!n)return;let R=n.getTypeAtLocation(g),P=k(R,F);P==="required"?e.report({node:p,messageId:"unnecessaryInCondition",data:{property:F,type:n.typeToString(R),alternative:t.alternativeForInCondition?`If this a valid condition, you can use as alternative: ${t.alternativeForInCondition}`:""}}):P==="absent"&&e.report({node:p,messageId:"alwaysFalseInCondition",data:{property:F,type:n.typeToString(R),alternative:t.alternativeForInCondition?`If this a valid condition, you can use as alternative: ${t.alternativeForInCondition}`:""}})}return{BinaryExpression(p){l(p),I(p),N(p)},CallExpression(p){S(p),C(p)}}}})};function Tt(e){return Array.from(new Set(e)).join(" | ")||"never"}function rt(e,t){let r=e.argument;return r.type===ae.AST_NODE_TYPES.Identifier?r.name:t.sourceCode.getText(r)}function Hi(e,t){return t.has(e)}var Et=require("@typescript-eslint/utils"),ht=require("zod/v4");var Yi=Et.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),yr="no-call-with-explicit-generics",qi=ht.z.object({functions:ht.z.array(ht.z.string())}),Zi=Yi({name:yr,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:[z(qi)]},defaultOptions:[{functions:[]}],create(e,[t]){let r=new Set(t.functions);return{CallExpression(n){let{callee:o}=n;o.type===Et.AST_NODE_TYPES.Identifier&&r.has(o.name)&&n.typeArguments&&e.report({node:n,messageId:"noExplicitGenerics",data:{functionName:o.name}})}}}}),Ht={name:yr,rule:Zi};var Ge=require("@typescript-eslint/utils"),Gi=Ge.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),dr="no-call-with-inferred-generics",Ki=Gi({name:dr,meta:{type:"problem",docs:{description:"Disable calling configured functions with infered generics"},messages:{missingGenericDeclaration:"Function '{{ functionName }}' should be called with at least {{ minGenerics }} generic(s) (ex: `fn<Generic>()`) defined",anyUsedInGenerics:"Function '{{ functionName }}' should not be called with 'any' in generics"},schema:[{type:"object",properties:{functions:{type:"array",items:{type:"object",properties:{name:{type:"string"},minGenerics:{type:"number"},allowAny:{type:"boolean"},disallowTypes:{type:"array",items:{type:"string"}}},required:["name"]}},anyAliases:{type:"array",items:{type:"string"}}},required:["functions"]}]},defaultOptions:[{functions:[]}],create(e,[t]){let r=new Map(t.functions.map(n=>[n.name,n]));return{CallExpression(n){let{callee:o}=n;if(o.type!==Ge.AST_NODE_TYPES.Identifier)return;let s=r.get(o.name);if(!s)return;let{minGenerics:i=1,allowAny:l,disallowTypes:c=t.disallowTypes}=s;(n.typeArguments?.params.length||0)<(i||0)&&e.report({node:n,messageId:"missingGenericDeclaration",data:{functionName:o.name,minGenerics:i||0}}),!(l&&!c)&&n.typeArguments?.params.some(u=>!l&&u.type===Ge.AST_NODE_TYPES.TSAnyKeyword||c&&u.type===Ge.AST_NODE_TYPES.TSTypeReference&&u.typeName.type===Ge.AST_NODE_TYPES.Identifier&&c.includes(u.typeName.name))&&e.report({node:n,messageId:"anyUsedInGenerics",data:{functionName:o.name}})}}}}),Yt={name:dr,rule:Ki};var Tr=require("@typescript-eslint/utils"),Qi=Tr.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),hr="no-commented-out-code",eo=["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:"],to=/^\s*return\s+/,no=/\w=("|'|`)/,ro=/\w+:\s*('|"|`)/,io=/\[['"][^'"]*['"]\]:\s*('|"|`|[^'"`\s])/,oo=/\w+-\w+:/,so=/\w+_\w+:/,ao=/\?\s+\w/,lo=/:\s+\w/,po=/^\s*('|"|`)[^'"]*('|"|`),?\s*$/,co=/^\s*\d+[,}]/,uo=/^\s*\[[^\]]*\][,}]/,fo=/^\s*\{[^}]*\}[,}]/,mo=/\.\w+\(/,yo=/\[\w+\]/,go=/^\s*(['"`]).+?\1\s*:/,So=/^<[A-Z]\w*(\s|>|\/)/,To=/^<[a-z]+(\s|>|\/)/,ho=/<[A-Z]\w*(\s.*)?>/,Eo=/<\/[A-Z]\w*>/,bo=/<[a-z]+(\s.*)?>/,xo=/<\/[a-z]+>/,Co=/^\s*[*\s]*$/,Io=/^[a-zA-Z]/,Ao=/^[A-Z][A-Za-z]*(?:\s+\d+)?(?:\s+[a-z]+)*:\s+[A-Za-z]/,wo=/```[\s\S]*?```/g,Fo=/`[^`]*`/g,gr=/[a-zA-Z0-9]/,Ro=/\.[A-Za-z_][A-Za-z0-9_]*\(/,vo=/[{}[\]()`=<>]/,ko=/:\s*(['"`[{(]|\w+\s*=>)/,Po=/\bif\s*\(|\belse\b|=>/,me={returnStatement:to,stringAssignment:no,objectPropertyWithQuotes:ro,computedPropertyAssignment:io,kebabCaseProperty:oo,snakeCaseProperty:so,ternaryOperator:ao,colonWithWord:lo,quotedString:po,numberWithComma:co,arrayWithComma:uo,objectWithComma:fo,methodCall:mo,arrayAccess:yo,quotedPropertyKey:go,jsxSelfClosing:So,jsxElement:To,jsxOpeningTag:ho,jsxClosingTag:Eo,htmlOpeningTag:bo,htmlClosingTag:xo,jsdocComment:Co};function Oo(e){if(e.includes(":")){let r=e.split(":")[0]?.trim();if(r&&Io.test(r)&&r.includes(" "))return!0}let t=e.trim();return t.length===0||Ro.test(t)||vo.test(t)||ko.test(t)||Po.test(t)?!1:!!(t.includes(":")&&Ao.test(t))}var No=[") {","return;",me.returnStatement,"if (","else {","else if (","/>","</","< ","},",": {"," } = ","={",me.stringAssignment,");",me.objectPropertyWithQuotes,me.computedPropertyAssignment,me.kebabCaseProperty,me.snakeCaseProperty,"&&","||","()",me.ternaryOperator,me.colonWithWord,me.quotedString,me.numberWithComma,me.arrayWithComma,me.objectWithComma,me.methodCall,me.arrayAccess,"?.(","??","=>",me.quotedPropertyKey],Do=["/>","</",me.jsxSelfClosing,me.jsxElement,me.jsxOpeningTag,me.jsxClosingTag,me.htmlOpeningTag,me.htmlClosingTag],Sr=["INFO:","TODO:","DOCS:","FIX:","FIXME:","HACK:","NOTE:","WARNING:","WARN:","BUG:","ISSUE:","TEMP:","TEMPORARY:","XXX:","REVIEW:","eslint"],jo=Qi({name:hr,meta:{type:"problem",docs:{description:"Disallow commented code"},messages:{commentedOutCode:"Commented code is not allowed. Detected pattern: `{{ wrongPattern }}` Use a comment starting with one of these prefixes if you want to keep this code commented out: {{ allowedPrefixes }}"},schema:[]},defaultOptions:[],create(e){function t(n,o){if(n.startsWith("/"))return!1;let s=n.trimStart();if(n.startsWith("*")||s.startsWith("eslint-disable")||n.includes("@deprecated")||n.includes("@example")||n.includes("@param")||n.includes("@returns")||n.includes("@throws")||n.includes("typescript-eslint")||n.includes("@ts-")||n.includes("prettier-ignore")||me.jsdocComment.test(n))return!1;for(let i of Sr)if(s.startsWith(i))return!1;if(n.includes("https://")||Oo(s))return!1;if(o==="Block"){for(let i of Do)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 eo)if(s.startsWith(i))return{wrongPattern:i};for(let i of No)if(typeof i=="string"){if(n.includes(i))return{wrongPattern:i}}else if(i.test(n))return{wrongPattern:`regex(${i.toString()})`};return!1}function r(n,o){let s=n,i=s.trim();if(i.startsWith("`")&&(i.endsWith("`,")||i.endsWith("`;")||i.endsWith("`")))return s;if(o==="Block"&&s.includes("```")){let a=s.split(wo);a.some(f=>gr.test(f))&&(s=a.join(""))}if(!s.includes("`"))return s;let l=s.split(Fo);return l.some(a=>gr.test(a))?l.join(""):s}return{Program(){let o=e.sourceCode.getAllComments();for(let s of o){let i=r(s.value,s.type),l=t(i,s.type);l&&e.report({node:s,messageId:"commentedOutCode",data:{wrongPattern:l.wrongPattern,allowedPrefixes:Sr.join(", ")}})}}}}}),qt={name:hr,rule:jo};var bt=require("@typescript-eslint/utils"),Lo=bt.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),Er="no-default-export",Mo=Lo({name:Er,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===bt.TSESTree.AST_NODE_TYPES.Identifier&&r.exported.name==="default"&&e.report({node:t,messageId:"noDefaultExport"})}}}}),Zt={name:Er,rule:Mo};var br=require("@typescript-eslint/utils"),_o=br.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),xr="no-leaked-text-in-jsx",$o=[",",";","[","]","(",")"],Uo=_o({name:xr,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="";$o.includes(r)?n=r:r.includes("&&")?n="&&":r.includes("||")?n="||":r.endsWith("? (")&&(n="? ("),n&&e.report({node:t,messageId:"leakedTextInJSX",data:{text:n}})}}}}),Gt={name:xr,rule:Uo};var Ye=require("@typescript-eslint/utils"),zo=Ye.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),Ir="no-non-camel-case-functions",Wo=/^(\$?[a-z][a-zA-Z0-9]*)$/;function Cr(e){if(e.typeName.type!==Ye.AST_NODE_TYPES.TSQualifiedName)return!1;let{left:t,right:r}=e.typeName;return t.type===Ye.AST_NODE_TYPES.Identifier&&t.name==="JSX"&&r.name==="Element"}var Jo=zo({name:Ir,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&&!Wo.test(t.id.name)){let r=t.returnType?.typeAnnotation;if(r&&(r.type===Ye.AST_NODE_TYPES.TSTypeReference?Cr(r):r.type===Ye.AST_NODE_TYPES.TSUnionType&&r.types.some(o=>o.type===Ye.AST_NODE_TYPES.TSTypeReference&&Cr(o))))return;e.report({node:t.id,messageId:"nonCamelCaseFunction",data:{functionName:t.id.name}})}}}}}),Kt={name:Ir,rule:Jo};var se=require("@typescript-eslint/utils");var Vo=se.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),Ar="no-optional-root-props",Xo=Vo({name:Ar,meta:{type:"problem",docs:{description:"Prevents usage of optional properties at the root of a type if that type is a local type alias or interface referenced only once"},messages:{optionalNotAllowed:'Optional property "{{ propertyName }}" is not allowed on a local type used only once. Use `prop: undefined | ...` instead.',suggestion:"Use `prop: undefined | ...` instead."},hasSuggestions:!0,schema:[]},defaultOptions:[],create(e){function t(n){let s=e.sourceCode.getDeclaredVariables(n)[0];if(!s||s.references.length!==1)return!1;let i=s.references[0];if(!i)return!1;for(let l of Jt(i.identifier)){if("returnType"in l||l.type===se.TSESTree.AST_NODE_TYPES.ExportNamedDeclaration)return!1;let c=l.parent;if(!c)return!1;if(c.type===se.TSESTree.AST_NODE_TYPES.TSTypeParameterInstantiation&&c.parent.type===se.TSESTree.AST_NODE_TYPES.TSTypeReference&&c.parent.typeName.type===se.TSESTree.AST_NODE_TYPES.Identifier&&c.parent.typeName.name==="FC"){let u=nt(c.parent.parent,se.TSESTree.AST_NODE_TYPES.VariableDeclaration,4);if(!u)return!1;let f=xt(u,e.sourceCode);return f?!(f.parent.type===se.TSESTree.AST_NODE_TYPES.CallExpression&&f.parent.callee.type===se.TSESTree.AST_NODE_TYPES.Identifier&&f.parent.callee.name==="memo"):!1}if(l.type===se.TSESTree.AST_NODE_TYPES.AssignmentPattern)return!1;if(c.type===se.TSESTree.AST_NODE_TYPES.ArrowFunctionExpression){let a=nt(c,se.TSESTree.AST_NODE_TYPES.VariableDeclaration);return a?!!xt(a,e.sourceCode):!1}if(c.type===se.TSESTree.AST_NODE_TYPES.FunctionDeclaration)return!!xt(c,e.sourceCode)}return!1}function r(n){n.key.type!==se.TSESTree.AST_NODE_TYPES.Identifier||!n.optional||e.report({node:n.key,messageId:"optionalNotAllowed",data:{propertyName:n.key.name},suggest:[{messageId:"suggestion",fix:o=>{let s=nt(n,se.TSESTree.AST_NODE_TYPES.TSPropertySignature);if(!s)return null;let i=e.sourceCode.getText(s);return o.replaceText(s,i.replace("?:",": undefined |"))}}]})}return{TSTypeAliasDeclaration(n){if(n.typeAnnotation.type===se.TSESTree.AST_NODE_TYPES.TSTypeLiteral&&!(Ct(n)||!t(n)))for(let o of n.typeAnnotation.members)o.type===se.TSESTree.AST_NODE_TYPES.TSPropertySignature&&r(o)},TSInterfaceDeclaration(n){if(!(Ct(n)||!t(n)))for(let o of n.body.body)o.type===se.TSESTree.AST_NODE_TYPES.TSPropertySignature&&r(o)},TSTypeReference(n){if(n.typeName.type!==se.TSESTree.AST_NODE_TYPES.Identifier||n.typeName.name!=="FC"||!n.typeArguments?.params[0])return;let o=n.typeArguments.params[0];if(o.type!==se.TSESTree.AST_NODE_TYPES.TSTypeLiteral)return;let s=nt(n.parent,se.TSESTree.AST_NODE_TYPES.VariableDeclaration,4);if(!s)return;let i=xt(s,e.sourceCode);if(!(!i||i.parent.type===se.TSESTree.AST_NODE_TYPES.CallExpression&&i.parent.callee.type===se.TSESTree.AST_NODE_TYPES.Identifier&&i.parent.callee.name==="memo"))for(let c of o.members)c.type===se.TSESTree.AST_NODE_TYPES.TSPropertySignature&&r(c)}}}});function Ct(e){return e?e.parent?.type===se.TSESTree.AST_NODE_TYPES.ExportNamedDeclaration||e.parent?.type===se.TSESTree.AST_NODE_TYPES.ExportDefaultDeclaration:!1}function xt(e,t){if(Ct(e))return;let r;if(e.type===se.TSESTree.AST_NODE_TYPES.VariableDeclaration){if(e.declarations.length!==1)return;e.declarations[0].id.type===se.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===se.TSESTree.AST_NODE_TYPES.FunctionDeclaration&&n.upper&&(n=n.upper);let o=n.variables.find(i=>i.identifiers.includes(r));if(!o)return;let s=o.references.filter(i=>i.identifier!==r);if(!(s.length!==1||!s[0])&&!Ct(s[0].identifier.parent.parent))return s[0].identifier}var Qt={name:Ar,rule:Xo};var ct=require("@typescript-eslint/utils");var ut=X({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===ct.AST_NODE_TYPES.Identifier?t.has(n.name):n.type===ct.AST_NODE_TYPES.MemberExpression?r(n.object):!1:!1}return{ImportDeclaration(n){for(let o of n.specifiers)t.add(o.local.name)},ExportNamedDeclaration(n){if(n.source){e.report({node:n,messageId:"noReexport"});return}if(n.declaration?.type===ct.AST_NODE_TYPES.VariableDeclaration)for(let o of n.declaration.declarations)r(o.init)&&e.report({node:n,messageId:"noReexport"});n.specifiers.length>0&&e.report({node:n,messageId:"noReexport"})},ExportDefaultDeclaration(n){n.declaration.type===ct.AST_NODE_TYPES.Identifier&&t.has(n.declaration.name)&&e.report({node:n,messageId:"noReexport"})},ExportAllDeclaration(n){e.report({node:n,messageId:"noReexport"})}}}});var wr=require("@typescript-eslint/utils"),It=Pe(require("path")),We=require("zod/v4");var Bo=wr.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),Fr="no-relative-imports",Ho=We.z.object({find:We.z.string(),replacement:We.z.string()}),Yo=We.z.object({aliases:We.z.array(Ho),rootDir:We.z.string().optional(),allowNotFoundAliases:We.z.boolean().optional(),_dev_simulateFileName:We.z.string().optional()}),qo=Bo({name:Fr,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:[z(Yo)]},defaultOptions:[{aliases:[],rootDir:void 0}],create(e,[t]){let r=t._dev_simulateFileName??e.filename;function n(i){return i.startsWith(".")||i.startsWith("..")}function o(i,l){let c=It.default.dirname(l);return It.default.resolve(c,i)}function s(i){let l=t.rootDir??process.cwd(),c=It.default.relative(l,i);if(c.startsWith("."))return null;c.startsWith("/")||(c=`/${c}`);for(let{find:a,replacement:u}of t.aliases)if(c.startsWith(u)){let f=c.replace(u,a);return{alias:a,newPath:f}}return null}return{ImportDeclaration(i){let l=i.source.value;if(!n(l))return;let c=o(l,r),a=s(c);!a&&t.allowNotFoundAliases||e.report({node:i,messageId:a?"noRelativeImportsWithAlias":"noRelativeImports",data:{alias:a?.alias},fix:a?u=>u.replaceText(i.source,`'${a.newPath}'`):void 0})}}}}),en={name:Fr,rule:qo};var ye=require("@typescript-eslint/utils"),tn=require("zod/v4");var Zo=tn.z.object({customMessage:tn.z.string().optional()}),nn=X({name:"no-static-style-prop",meta:{type:"problem",docs:{description:"Prevent using static style props in JSX, only dynamic values should be allowed"},schema:[z(Zo)],messages:{noStaticStyleProp:"Static style props are not allowed use css instead.{{customMessage}}"}},defaultOptions:[{}],create(e,[t]){function r(n){switch(n.type){case ye.AST_NODE_TYPES.Literal:return!0;case ye.AST_NODE_TYPES.ObjectExpression:return n.properties.every(o=>o.type===ye.AST_NODE_TYPES.Property?o.computed||o.value.type===ye.AST_NODE_TYPES.Identifier&&o.key.type===ye.AST_NODE_TYPES.Identifier&&o.key.name===o.value.name?!1:r(o.value):!1);case ye.AST_NODE_TYPES.ArrayExpression:return n.elements.every(o=>o?o.type===ye.AST_NODE_TYPES.SpreadElement?!1:r(o):!0);case ye.AST_NODE_TYPES.TemplateLiteral:return n.expressions.length===0;case ye.AST_NODE_TYPES.ConditionalExpression:case ye.AST_NODE_TYPES.LogicalExpression:case ye.AST_NODE_TYPES.BinaryExpression:case ye.AST_NODE_TYPES.UnaryExpression:case ye.AST_NODE_TYPES.CallExpression:case ye.AST_NODE_TYPES.MemberExpression:case ye.AST_NODE_TYPES.Identifier:case ye.AST_NODE_TYPES.ArrowFunctionExpression:case ye.AST_NODE_TYPES.FunctionExpression:return!1;default:return!1}}return{JSXAttribute(n){if(n.name.type===ye.AST_NODE_TYPES.JSXIdentifier&&n.name.name==="style"&&n.value){let o=null;n.value.type===ye.AST_NODE_TYPES.JSXExpressionContainer?n.value.expression.type!==ye.AST_NODE_TYPES.JSXEmptyExpression&&(o=n.value.expression):n.value.type===ye.AST_NODE_TYPES.Literal&&(o=n.value),o&&r(o)&&e.report({node:n,messageId:"noStaticStyleProp",data:{customMessage:t.customMessage?` ${t.customMessage}`:""}})}}}}});var ft=require("@typescript-eslint/utils"),Ke=Pe(require("zod/v4"));var Go=Ke.object({alternativeMsgs:Ke.object({inArrayFind:Ke.string().optional(),inArrayFilter:Ke.string().optional()}).optional(),__dev_simulateFileName:Ke.string().optional()});function Ko(e){return e.typeAnnotation.type!==ft.AST_NODE_TYPES.TSTypePredicate?!1:e.typeAnnotation.asserts===!1}var Qo=/(typeGuards|type-guards)\.(ts|tsx)$/;function es(e){return Qo.test(e)}function ts(e){let t=e.parent;for(;t;){if(t.type===ft.AST_NODE_TYPES.CallExpression&&t.callee.type===ft.AST_NODE_TYPES.MemberExpression&&t.callee.property.type===ft.AST_NODE_TYPES.Identifier){let r=t.callee.property.name;if(r==="filter"||r==="find")return{method:r}}t=t.parent}return null}var rn=X({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:[z(Go)],hasSuggestions:!0},defaultOptions:[{}],create(e,[t]){let r=t.__dev_simulateFileName??e.filename;if(es(r))return{};function n(o){if(!Ko(o))return;let s=ts(o);if(t.alternativeMsgs&&s){let i=s.method==="filter"?t.alternativeMsgs.inArrayFilter:t.alternativeMsgs.inArrayFind;if(i){let l=s.method==="filter"?"useFilterWithTypeCheck":"useFindWithTypeCheck";e.report({node:o,messageId:l,data:{message:i}});return}}e.report({node:o,messageId:"typeGuardNotAllowed"})}return{"FunctionDeclaration > :matches(TSTypeAnnotation)":n,"ArrowFunctionExpression > :matches(TSTypeAnnotation)":n,"MethodDefinition > FunctionExpression > :matches(TSTypeAnnotation)":n}}});var Qe=require("@typescript-eslint/utils");var ns="no-unnecessary-async-on-jsx-props";function rs(e){if(e.body.type!==Qe.AST_NODE_TYPES.BlockStatement)return!1;let t=e.body.body;if(t.length!==1)return!1;let r=t[0];return!r||r.type!==Qe.AST_NODE_TYPES.ExpressionStatement?!1:r.expression.type===Qe.AST_NODE_TYPES.AwaitExpression}var on=X({name:ns,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){rs(r)&&e.report({node:r,messageId:"unnecessaryAsyncInJsxProp",fix(n){let o=e.sourceCode,s=[],i=o.getFirstToken(r,c=>c.value==="async");if(i){let c=o.getTokenAfter(i);c?s.push(n.replaceTextRange([i.range[0],c.range[0]],"")):s.push(n.remove(i))}function l(c){if(c.type===Qe.AST_NODE_TYPES.AwaitExpression){let a=o.getFirstToken(c);if(a&&a.value==="await"){let u=o.getTokenAfter(a);u?s.push(n.replaceTextRange([a.range[0],u.range[0]],"")):s.push(n.remove(a))}}if(c.type===Qe.AST_NODE_TYPES.BlockStatement)for(let a of c.body)l(a);else c.type===Qe.AST_NODE_TYPES.ExpressionStatement&&l(c.expression)}return l(r.body),s}})}return{"JSXAttribute ArrowFunctionExpression[async=true]":t,"JSXAttribute FunctionExpression[async=true]":t}}});var Je=require("@typescript-eslint/utils"),sn=Pe(require("typescript")),it=Pe(require("zod/v4"));var is=Je.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),Rr="no-unnecessary-casting",os=it.default.object({additionalCastFunctions:it.default.array(it.default.object({name:it.default.string(),expectedType:it.default.enum(["string","number"])})).optional()}),an={name:Rr,rule:is({name:Rr,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:[z(os)],fixable:"code"},defaultOptions:[{}],create(e){let r=e.options[0].additionalCastFunctions||[],n=[{name:"Number",expectedType:"number"},{name:"String",expectedType:"string"},...r],o=Je.ESLintUtils.getParserServices(e,!0),s=o.program?.getTypeChecker();if(!s||!o.program)throw new Error("TypeScript services or program not available");function i(u,f){switch(u.type){case Je.AST_NODE_TYPES.Literal:return f==="number"?typeof u.value=="number":typeof u.value=="string";case Je.AST_NODE_TYPES.TemplateLiteral:return f==="string";case Je.AST_NODE_TYPES.UnaryExpression:return f==="number"?u.operator==="+"||u.operator==="-"||u.operator==="~":!1;default:return!1}}function l(u,f){return f==="number"?!!(u.flags&sn.TypeFlags.NumberLike):!!(u.flags&sn.TypeFlags.StringLike)}function c(u,f){return y=>y.replaceText(u,e.sourceCode.getText(f))}function a(u){if(!s||u.arguments.length!==1)return;let f=u.arguments[0];if(!f||f.type===Je.AST_NODE_TYPES.SpreadElement)return;let{callee:y}=u;if(y.type!==Je.AST_NODE_TYPES.Identifier)return;let x=y.name,m=n.find(C=>C.name===x);if(!m)return;if(i(f,m.expectedType)||l(s.getTypeAtLocation(o.esTreeNodeToTSNodeMap.get(f)),m.expectedType)){let C,S;x==="Number"?C="unnecessaryNumberCasting":x==="String"?C="unnecessaryStringCasting":(C="unnecessaryCustomCasting",S={name:m.name,type:m.expectedType}),e.report({node:u,messageId:C,...S?{data:S}:{},fix:c(u,f)})}}return{CallExpression:a}}})};var we=require("@typescript-eslint/utils"),At=Pe(require("zod/v4"));var ss=At.object({ignoreWithDescription:At.string().optional()}),ln=X({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:[z(ss)]},defaultOptions:[{}],create(e,[t]){let r=e.getSourceCode(),n=r.ast;function o(c){let a=c.arguments[0];return a&&a.type===we.AST_NODE_TYPES.Literal&&typeof a.value=="string"?a.value:null}function s(c){return!c||!t.ignoreWithDescription?!1:new RegExp(t.ignoreWithDescription).test(c)}function i(c){return c.length!==1?!1:n.body.filter(u=>{if(u.type===we.AST_NODE_TYPES.ExpressionStatement){let f=u.expression;if(f.type===we.AST_NODE_TYPES.CallExpression&&f.callee.type===we.AST_NODE_TYPES.Identifier){let y=f.callee.name;return["test","it","beforeEach","afterEach","beforeAll","afterAll"].includes(y)}}return!1}).length===0}function l(c){let a=c.arguments[1];if(a&&(a.type===we.AST_NODE_TYPES.FunctionExpression||a.type===we.AST_NODE_TYPES.ArrowFunctionExpression)&&a.body.type===we.AST_NODE_TYPES.BlockStatement){let u=a.body.body;return u.length===0?"":u.map(y=>r.text.slice(y.range[0],y.range[1])).join(`
15
+ Learn more about data fetching with Hooks: https://reactjs.org/link/hooks-data-fetching`});let w=c.acquire(I),k=new Set,O=null;{let v=w.upper;for(;v&&(k.add(v),v.type!=="function");)v=v.upper;if(!v)return;O=v}let p=Array.isArray;function F(v){if(!p(v.defs))return!1;let N=v.defs[0];if(N==null||N.node.type!=="VariableDeclarator")return!1;let z=N.node.init;if(z==null)return!1;for(;z.type==="TSAsExpression";)z=z.expression;let W=N.node.parent;if(W==null&&(zt(O.block,N.node.id),W=N.node.parent,W==null))return!1;if(W.kind==="const"&&z.type==="Literal"&&(typeof z.value=="string"||typeof z.value=="number"||z.value===null))return!0;if(z.type!=="CallExpression")return!1;let Y=z.callee;if(Y.type==="MemberExpression"&&Y.object.name==="React"&&Y.property!=null&&!Y.computed&&(Y=Y.property),Y.type!=="Identifier")return!1;let $=N.node.id,{name:K}=Y;if(K==="useRef"&&$.type==="Identifier")return!0;if(Hi(Y)&&$.type==="Identifier"){for(let ee of v.references)ee!==$&&x.add(ee.identifier);return!0}else if(K==="useState"||K==="useReducer"){if($.type==="ArrayPattern"&&$.elements.length===2&&p(v.identifiers)){if($.elements[1]===v.identifiers[0]){if(K==="useState"){let ee=v.references,we=0;for(let Ue=0;Ue<ee.length;Ue++){if(ee[Ue].isWrite()&&we++,we>1)return!1;a.set(ee[Ue].identifier,$.elements[0])}}return!0}else if($.elements[0]===v.identifiers[0]){if(K==="useState"){let ee=v.references;for(let we=0;we<ee.length;we++)u.add(ee[we].identifier)}return!1}}}else if(K==="useTransition"&&$.type==="ArrayPattern"&&$.elements.length===2&&Array.isArray(v.identifiers)&&$.elements[1]===v.identifiers[0])return!0;return!1}function d(v){if(!p(v.defs))return!1;let N=v.defs[0];if(N==null||N.node==null||N.node.id==null)return!1;let z=N.node,W=O.childScopes,Y=null,$;for($=0;$<W.length;$++){let K=W[$],ee=K.block;if(z.type==="FunctionDeclaration"&&ee===z||z.type==="VariableDeclarator"&&ee.parent===z){Y=K;break}}if(Y==null)return!1;for($=0;$<Y.through.length;$++){let K=Y.through[$];if(K.resolved!=null&&k.has(K.resolved.scope)&&!g(K.resolved))return!1}return!0}let g=m(F,f),R=m(d,y),P=new Map;function j(v){let N=v.from,z=!1;for(;N.block!==I;)N.type==="function"&&(z=N.block.parent!=null&&N.block.parent.type==="ReturnStatement"),N=N.upper;return z}let V=new Map,G=new Map;H(w);function H(v){for(let N of v.references){if(!N.resolved||!k.has(N.resolved.scope))continue;let z=zt(I,N.identifier),W=ar(z),Y=ze(W,G);if(b&&W.type==="Identifier"&&(W.parent.type==="MemberExpression"||W.parent.type==="OptionalMemberExpression")&&!W.parent.computed&&W.parent.property.type==="Identifier"&&W.parent.property.name==="current"&&j(N)&&P.set(Y,{reference:N,dependencyNode:W}),W.parent.type==="TSTypeQuery"||W.parent.type==="TSTypeReference")continue;let $=N.resolved.defs[0];if($!=null&&!($.node!=null&&$.node.init===I.parent)&&$.type!=="TypeParameter")if(V.has(Y))V.get(Y).references.push(N);else{let K=N.resolved,ee=g(K)||R(K);V.set(Y,{isStable:ee,references:[N]})}}for(let N of v.childScopes)H(N)}P.forEach(({reference:v,dependencyNode:N},z)=>{let W=v.resolved.references,Y=!1;for(let $=0;$<W.length;$++){let{identifier:K}=W[$],{parent:ee}=K;if(ee!=null&&ee.type==="MemberExpression"&&!ee.computed&&ee.property.type==="Identifier"&&ee.property.name==="current"&&ee.parent.type==="AssignmentExpression"&&ee.parent.left===ee){Y=!0;break}}Y||l({node:N.parent.property,message:`The ref value '${z}.current' will likely have changed by the time this effect cleanup function runs. If this ref points to a node rendered by React, copy '${z}.current' to a variable inside the effect, and use that variable in the cleanup function.`})});let D=new Set;function Z(v,N){D.has(N)||(D.add(N),l({node:v,message:`Assignments to the '${N}' variable from inside React Hook ${r(S)} 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(S)}.`}))}let q=new Set;if(V.forEach(({isStable:v,references:N},z)=>{v&&q.add(z),N.forEach(W=>{W.writeExpr&&Z(W.writeExpr,z)})}),D.size>0)return;if(!A){let v=null;if(V.forEach(({isStable:N,references:z},W)=>{v||z.forEach(Y=>{if(v)return;let $=Y.identifier;if(!a.has($))return;let ee=Y.from;for(;ee.type!=="function";)ee=ee.upper;ee.block===I&&(v=W)})}),v){let{suggestedDependencies:N}=$t({dependencies:V,declaredDependencies:[],stableDependencies:q,externalDependencies:new Set,isEffect:!0});l({node:S,message:`React Hook ${h} contains a call to '${v}'. Without a list of dependencies, this can lead to an infinite chain of updates. To fix this, pass [`+N.join(", ")+`] as a second argument to the ${h} Hook.`,suggest:[{desc:`Add dependencies array: [${N.join(", ")}]`,fix(z){return z.insertTextAfter(I,`, [${N.join(", ")}]`)}}]})}return}let ue=[],fe=new Set;A.type!=="ArrayExpression"?l({node:A,message:`React Hook ${r(S)} was passed a dependency list that is not an array literal. This means we can't statically verify whether you've passed the correct dependencies.`}):A.elements.forEach(v=>{if(v===null)return;if(v.type==="SpreadElement"){l({node:v,message:`React Hook ${r(S)} has a spread element in its dependency array. This means we can't statically verify whether you've passed the correct dependencies.`});return}x.has(v)&&l({node:v,message:`Functions returned from \`useEffectEvent\` must not be included in the dependency array. Remove \`${r(v)}\` from the list.`,suggest:[{desc:`Remove the dependency \`${r(v)}\``,fix(Y){return Y.removeRange(v.range)}}]});let N;try{N=ze(v,G)}catch(Y){if(/Unsupported node type/.test(Y.message)){v.type==="Literal"?V.has(v.value)?l({node:v,message:`The ${v.raw} literal is not a valid dependency because it never changes. Did you mean to include ${v.value} in the array instead?`}):l({node:v,message:`The ${v.raw} literal is not a valid dependency because it never changes. You can safely remove it.`}):l({node:v,message:`React Hook ${r(S)} has a complex expression in the dependency array. Extract it to a separate variable so it can be statically checked.`});return}else throw Y}let z=v;for(;z.type==="MemberExpression"||z.type==="OptionalMemberExpression"||z.type==="ChainExpression";)z=z.object||z.expression.object;let W=!O.through.some(Y=>Y.identifier===z);ue.push({key:N,node:v}),W||fe.add(N)});let{suggestedDependencies:ke,unnecessaryDependencies:Xe,missingDependencies:Se,duplicateDependencies:pt}=$t({dependencies:V,declaredDependencies:ue,stableDependencies:q,externalDependencies:fe,isEffect:b}),tt=ke;if(pt.size+Se.size+Xe.size===0){let v=Wi(S),N=v&&zi(v);if(t&&!N)return;Ji({declaredDependencies:ue,declaredDependenciesNode:A,componentScope:O,scope:w}).forEach(({construction:W,isUsedOutsideOfHook:Y,depType:$})=>{let K=$==="function"?"useCallback":"useMemo",ee=$==="function"?"definition":"initialization",we=`wrap the ${ee} of '${W.name.name}' in its own ${K}() Hook.`,Ue=Y?`To fix this, ${we}`:`Move it inside the ${h} callback. Alternatively, ${we}`,xi=$==="conditional"||$==="logical expression"?"could make":"makes",Ci=`The '${W.name.name}' ${$} ${xi} the dependencies of ${h} Hook (at line ${A.loc.start.line}) change on every render. ${Ue}`,Zn;Y&&W.type==="Variable"&&$==="function"&&(Zn=[{desc:`Wrap the ${ee} of '${W.name.name}' in its own ${K}() Hook.`,fix(Gn){let[Ii,Ai]=K==="useMemo"?["useMemo(() => { return ","; })"]:["useCallback(",")"];return[Gn.insertTextBefore(W.node.init,Ii),Gn.insertTextAfter(W.node.init,Ai)]}}]),l({node:W.node,message:Ci,suggest:Zn})});return}!b&&Se.size>0&&(tt=$t({dependencies:V,declaredDependencies:[],stableDependencies:q,externalDependencies:fe,isEffect:b}).suggestedDependencies);function Ee(){if(ue.length===0)return!0;let v=ue.map(z=>z.key),N=v.slice().sort();return v.join(",")===N.join(",")}Ee()&&tt.sort();function Ie(v){let N=v.split("."),z="";for(let W=0;W<N.length;W++){if(W!==0){let Y=N.slice(0,W+1).join("."),$=G.get(Y)===!0;z+=$?"?.":"."}z+=N[W]}return z}function jt(v,N,z,W){return v.size===0?null:(v.size>1?"":N+" ")+z+" "+(v.size>1?"dependencies":"dependency")+": "+Xi(Array.from(v).sort().map(Y=>"'"+Ie(Y)+"'"))+`. Either ${W} ${v.size>1?"them":"it"} or remove the dependency array.`}let De="";if(Xe.size>0){let v=null;if(Array.from(Xe.keys()).forEach(N=>{v===null&&N.endsWith(".current")&&(v=N)}),v!==null)De=` Mutable values like '${v}' aren't valid dependencies because mutating them doesn't re-render the component.`;else if(fe.size>0){let N=Array.from(fe)[0];w.set.has(N)||(De=` Outer scope values like '${N}' aren't valid dependencies because mutating them doesn't re-render the component.`)}}if(!De&&Se.has("props")){let v=V.get("props");if(v==null)return;let N=v.references;if(!Array.isArray(N))return;let z=!0;for(let W=0;W<N.length;W++){let Y=N[W],$=zt(O.block,Y.identifier);if(!$){z=!1;break}let K=$.parent;if(K==null){z=!1;break}if(K.type!=="MemberExpression"&&K.type!=="OptionalMemberExpression"){z=!1;break}}z&&(De=` However, 'props' will change when *any* prop changes, so the preferred fix is to destructure the 'props' object outside of the ${h} call and refer to those specific props inside ${r(S)}.`)}if(!De&&Se.size>0){let v=null;Se.forEach(N=>{if(v)return;let z=O.set.get(N),W=V.get(N);if(W.references[0].resolved!==z)return;let Y=z.defs[0];if(Y==null||Y.name==null||Y.type!=="Parameter")return;let $=!1,K;for(let ee=0;ee<W.references.length;ee++)if(K=W.references[ee].identifier,K!=null&&K.parent!=null&&(K.parent.type==="CallExpression"||K.parent.type==="OptionalCallExpression")&&K.parent.callee===K){$=!0;break}$&&(v=N)}),v!==null&&(De=` If '${v}' changes too often, find the parent component that defines it and wrap that definition in useCallback.`)}if(!De&&Se.size>0){let v=null;if(Se.forEach(N=>{if(v!==null)return;let W=V.get(N).references,Y,$;for(let K=0;K<W.length;K++){for(Y=W[K].identifier,$=Y.parent;$!=null&&$!==O.block;){if($.type==="CallExpression"){let ee=a.get($.callee);if(ee!=null){if(ee.name===N)v={missingDep:N,setter:$.callee.name,form:"updater"};else if(u.has(Y))v={missingDep:N,setter:$.callee.name,form:"reducer"};else{let we=W[K].resolved;if(we!=null){let Ue=we.defs[0];Ue!=null&&Ue.type==="Parameter"&&(v={missingDep:N,setter:$.callee.name,form:"inlineReducer"})}}break}}$=$.parent}if(v!==null)break}}),v!==null)switch(v.form){case"reducer":De=` You can also replace multiple useState variables with useReducer if '${v.setter}' needs the current value of '${v.missingDep}'.`;break;case"inlineReducer":De=` If '${v.setter}' needs the current value of '${v.missingDep}', you can also switch to useReducer instead of useState and read '${v.missingDep}' in the reducer.`;break;case"updater":De=` You can also do a functional update '${v.setter}(${v.missingDep.slice(0,1)} => ...)' if you only need '${v.missingDep}' in the '${v.setter}' call.`;break;default:throw new Error("Unknown case.")}}l({node:A,message:`React Hook ${r(S)} has `+(jt(Se,"a","missing","include")||jt(Xe,"an","unnecessary","exclude")||jt(pt,"a","duplicate","omit"))+De,suggest:[{desc:`Update the dependencies array to be: [${tt.map(Ie).join(", ")}]`,fix(v){return v.replaceText(A,`[${tt.map(Ie).join(", ")}]`)}}]})}function C(I){let A=Vi(I.callee,i);if(A===-1)return;let S=I.arguments[A],h=I.callee,b=lr(h).name,w=I.arguments[A+1],k=/Effect($|[^a-z])/g.test(b);if(!S){l({node:h,message:`React Hook ${b} requires an effect callback. Did you forget to pass a callback to the hook?`});return}if(!(t&&!k)){if(!w&&!k){(b==="useMemo"||b==="useCallback")&&l({node:h,message:`React Hook ${b} does nothing when called with only one argument. Did you forget to pass an array of dependencies?`});return}switch(S.type){case"FunctionExpression":case"ArrowFunctionExpression":E(S,w,h,b,k);return;case"Identifier":if(!w||w.elements&&w.elements.some(F=>F&&F.type==="Identifier"&&F.name===S.name))return;let O=n(I).set.get(S.name);if(O==null||O.defs==null)return;let p=O.defs[0];if(!p||!p.node||p.type!=="Variable"&&p.type!=="FunctionName")break;switch(p.node.type){case"FunctionDeclaration":E(p.node,w,h,b,k);return;case"VariableDeclarator":let F=p.node.init;if(!F)break;switch(F.type){case"ArrowFunctionExpression":case"FunctionExpression":E(F,w,h,b,k);return}break}break;default:l({node:h,message:`React Hook ${b} received a function whose dependencies are unknown. Pass an inline function instead.`});return}l({node:h,message:`React Hook ${b} has a missing dependency: '${S.name}'. Either include it or remove the dependency array.`,suggest:[{desc:`Update the dependencies array to be: [${S.name}]`,fix(O){return O.replaceText(w,`[${S.name}]`)}}]})}}if(!!e.options[0]?.reactCompilerIsEnabled)return t=!0,{CallExpression:I=>C(I)};if(e.options[0]?.ignoreIfReactCompilerIsEnabled){for(let I of e.sourceCode.getAllComments())if(Ui.test(I.value))return t=!0,{CallExpression:A=>C(A)}}return{CallExpression:I=>C(I)}}};function $t({dependencies:e,declaredDependencies:t,stableDependencies:r,externalDependencies:n,isEffect:o}){let s=i();function i(){return{isUsed:!1,isSatisfiedRecursively:!1,isSubtreeUsed:!1,children:new Map}}e.forEach((E,C)=>{let T=l(s,C);T.isUsed=!0,c(s,C,I=>{I.isSubtreeUsed=!0})}),t.forEach(({key:E})=>{let C=l(s,E);C.isSatisfiedRecursively=!0}),r.forEach(E=>{let C=l(s,E);C.isSatisfiedRecursively=!0});function l(E,C){let T=C.split("."),I=E;for(let A of T){let S=I.children.get(A);S||(S=i(),I.children.set(A,S)),I=S}return I}function c(E,C,T){let I=C.split("."),A=E;for(let S of I){let h=A.children.get(S);if(!h)return;T(h),A=h}}let a=new Set,u=new Set;f(s,a,u,E=>E);function f(E,C,T,I){E.children.forEach((A,S)=>{let h=I(S);if(A.isSatisfiedRecursively){A.isSubtreeUsed&&T.add(h);return}if(A.isUsed){C.add(h);return}f(A,C,T,b=>h+"."+b)})}let y=[],x=new Set,m=new Set;return t.forEach(({key:E})=>{u.has(E)?y.indexOf(E)===-1?y.push(E):m.add(E):x.add(E)}),a.forEach(E=>{y.push(E)}),{suggestedDependencies:y,unnecessaryDependencies:x,duplicateDependencies:m,missingDependencies:a}}function He(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 He(e.consequent)!=null||He(e.alternate)!=null?"conditional":null;case"LogicalExpression":return He(e.left)!=null||He(e.right)!=null?"logical expression":null;case"JSXFragment":return"JSX fragment";case"JSXElement":return"JSX element";case"AssignmentExpression":return He(e.right)!=null?"assignment expression":null;case"NewExpression":return"object construction";case"Literal":return e.value instanceof RegExp?"regular expression":null;case"TypeCastExpression":return He(e.expression);case"TSAsExpression":return He(e.expression)}return null}function Ji({declaredDependencies:e,declaredDependenciesNode:t,componentScope:r,scope:n}){let o=e.map(({key:i})=>{let l=r.variables.find(a=>a.name===i);if(l==null)return null;let c=l.defs[0];if(c==null)return null;if(c.type==="Variable"&&c.node.type==="VariableDeclarator"&&c.node.id.type==="Identifier"&&c.node.init!=null){let a=He(c.node.init);if(a!=null)return[l,a]}return c.type==="FunctionName"&&c.node.type==="FunctionDeclaration"?[l,"function"]:c.type==="ClassName"&&c.node.type==="ClassDeclaration"?[l,"class"]:null}).filter(Boolean);function s(i){let l=!1;for(let c=0;c<i.references.length;c++){let a=i.references[c];if(a.writeExpr){if(l)return!0;l=!0;continue}let u=a.from;for(;u!==n&&u!=null;)u=u.upper;if(u!==n&&!pr(t,a.identifier))return!0}return!1}return o.map(([i,l])=>({construction:i.defs[0],depType:l,isUsedOutsideOfHook:s(i)}))}function ar(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)?ar(e.parent):e.type==="MemberExpression"&&e.parent&&e.parent.type==="AssignmentExpression"&&e.parent.left===e?e.object:e}function Ut(e,t,r){t&&(e.optional?t.has(r)||t.set(r,!0):t.has(r)||t.set(r,!1))}function ze(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=ze(e.object,t),n=ze(e.property,null),o=`${r}.${n}`;return Ut(e,t,o),o}else if(e.type==="OptionalMemberExpression"&&!e.computed){let r=ze(e.object,t),n=ze(e.property,null),o=`${r}.${n}`;return Ut(e,t,o),o}else if(e.type==="ChainExpression"&&!e.computed){let r=e.expression;if(r.type==="CallExpression")throw new Error(`Unsupported node type: ${r.type}`);let n=ze(r.object,t),o=ze(r.property,null),s=`${n}.${o}`;return Ut(r,t,s),s}else throw new Error(`Unsupported node type: ${e.type}`)}function lr(e,t){return e.type==="MemberExpression"&&e.object.type==="Identifier"&&e.object.name==="React"&&e.property.type==="Identifier"&&!e.computed?e.property:e}function Vi(e,t){let r=lr(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=ze(r,null)}catch(o){if(/Unsupported node type/.test(o.message))return 0;throw o}return t.additionalHooks.test(n)?0:-1}else return-1}}function zt(e,t){let r=[e],n=null;for(;r.length;){if(n=r.shift(),Bi(n,t))return n;if(pr(n,t))for(let[o,s]of Object.entries(n))o!=="parent"&&(or(s)?(s.parent=n,r.push(s)):Array.isArray(s)&&s.forEach(i=>{or(i)&&(i.parent=n,r.push(i))}))}return null}function Xi(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 or(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&typeof e.type=="string"}function Bi(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 pr(e,t){return e.range[0]<=t.range[0]&&e.range[1]>=t.range[1]}function Hi(e){return!1}var ae=require("@typescript-eslint/utils"),B=Pe(require("typescript")),Xt=require("zod/v4");var Wt=require("@typescript-eslint/utils");function nt(e,t,r=1/0){if(r!==0&&e.parent)return e.type===t?e:nt(e.parent,t,r===1/0?r:r-1)}function*Jt(e){yield e,e.parent&&(yield*Jt(e.parent))}function Vt(e,t){for(let r of e){let n=t(r);if(n!=null&&n!==!1)return n}}function ur(e,t,r){let o=r.getDeclaredVariables(e).find(s=>s.name===t||s.identifiers[0]?.parent.type===Wt.AST_NODE_TYPES.Property&&s.identifiers[0].parent.key.type===Wt.AST_NODE_TYPES.Identifier&&s.identifiers[0].parent.key.name===t);return o?o.references.filter(s=>!s.init):[]}function cr(e){return e===null||typeof e!="object"||!("type"in e)?!1:typeof e.type=="string"}function Yi(e,t){return e[t]}function je(e,t,r){let n=r.visitorKeys,o=new Set;function s(i){if(o.has(i))return!1;if(o.add(i),t(i)===!0)return!0;let c=n[i.type];if(c)for(let a of c){let u=Yi(i,a);if(u){if(Array.isArray(u)){for(let f of u)if(cr(f)&&s(f))return!0}else if(cr(u)&&s(u))return!0}}return!1}s(e)}var qi=ae.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),fr="improved-no-unnecessary-condition",Zi=Xt.z.object({alternativeForInCondition:Xt.z.string().optional().describe("Alternative to appear in the error for `in` condition")}),mr={object:"Array",property:"isArray"},Gi=["string","number","bigint","boolean","symbol","undefined","object","function","never"],Ki=new Set(Gi),Bt={name:fr,rule:qi({name:fr,meta:{type:"suggestion",docs:{description:"Extends checks of `no-unnecessary-condition` rule"},messages:{unnecessaryTypeofCondition:'This condition is unnecessary. The type of "{{name}}" is always "{{type}}".',alwaysFalseTypeofCondition:'This condition will always be false. The type of "{{name}}" is "{{actualType}}" so the condition has no overlap with "{{conditionType}}".',unnecessaryStartsWithCondition:"This startsWith check is unnecessary as it always evaluates to true.",alwaysFalseStartsWithCondition:"This startsWith check will always be false.",unnecessaryEndsWithCondition:"This endsWith check is unnecessary as it always evaluates to true.",alwaysFalseEndsWithCondition:"This endsWith check will always be false.",unnecessaryIncludesCondition:"This includes check is unnecessary as it always evaluates to true.",alwaysFalseIncludesCondition:"This includes check will always be false.",unnecessaryArrayIsArrayCondition:"This Array.isArray check is unnecessary as it always evaluates to true.",alwaysFalseArrayIsArrayCondition:"This Array.isArray check will always be false.",unnecessaryLengthCondition:"This length comparison is unnecessary as it always evaluates to true.",alwaysFalseLengthCondition:"This length comparison will always be false.",unnecessaryInCondition:'This in check is unnecessary. Property "{{property}}" always exists on type "{{type}}".{{alternative}}',alwaysFalseInCondition:'This in check will always be false. Property "{{property}}" does not exist on type "{{type}}".{{alternative}}'},schema:[J(Zi)]},defaultOptions:[{}],create(e,[t]){let r=ae.ESLintUtils.getParserServices(e,!0),n=r.program?.getTypeChecker();if(!n||!r.program)throw new Error("TypeScript services or program not available");function o(p){return p.type===ae.AST_NODE_TYPES.UnaryExpression&&p.operator==="typeof"}function s(p){return p.flags&B.default.TypeFlags.Any||p.flags&B.default.TypeFlags.Unknown?null:p.flags&B.default.TypeFlags.StringLike?["string"]:p.flags&B.default.TypeFlags.NumberLike?["number"]:p.flags&B.default.TypeFlags.BigIntLike?["bigint"]:p.flags&B.default.TypeFlags.BooleanLike?["boolean"]:p.flags&B.default.TypeFlags.ESSymbolLike?["symbol"]:p.flags&B.default.TypeFlags.Undefined||p.flags&B.default.TypeFlags.Void?["undefined"]:p.flags&B.default.TypeFlags.Null?["object"]:p.getCallSignatures().length>0?["function"]:p.flags&B.default.TypeFlags.Object?p.getProperties().length===0?["string","number","bigint","boolean","symbol","object","function"]:["object"]:p.flags&B.default.TypeFlags.NonPrimitive?["object"]:p.flags&B.default.TypeFlags.Never?["never"]:null}function i(p){if(!n)return null;let F=r.esTreeNodeToTSNodeMap.get(p),d=n.getTypeAtLocation(F.expression);if(d.flags&B.default.TypeFlags.Any||d.flags&B.default.TypeFlags.Unknown)return null;let g=[];if(d.isUnion()){for(let P of d.types){let j=s(P);if(j)g.push(...j);else return null}return g}let R=s(d);return R?(g.push(...R),g):null}function l(p){if(!(p.operator==="==="||p.operator==="!=="))return;let d=null,g=null;if(o(p.left)?(d=p.left,g=p.right.type===ae.AST_NODE_TYPES.Literal&&typeof p.right.value=="string"?p.right.value:null):o(p.right)&&(d=p.right,g=p.left.type===ae.AST_NODE_TYPES.Literal&&typeof p.left.value=="string"?p.left.value:null),!d||!g||!Qi(g,Ki))return;let R=i(d);if(!R)return;let P=p.operator==="!==",j=R.includes(g);R.length===1?j&&!P?e.report({node:p,messageId:"unnecessaryTypeofCondition",data:{name:rt(d,e),type:g}}):!j&&P?e.report({node:p,messageId:"unnecessaryTypeofCondition",data:{name:rt(d,e),type:Array.from(R)[0]}}):!j&&!P?e.report({node:p,messageId:"alwaysFalseTypeofCondition",data:{name:rt(d,e),actualType:Tt(R),conditionType:g}}):j&&P&&e.report({node:p,messageId:"alwaysFalseTypeofCondition",data:{name:rt(d,e),actualType:Tt(R),conditionType:g}}):!j&&!P?e.report({node:p,messageId:"alwaysFalseTypeofCondition",data:{name:rt(d,e),actualType:Tt(R),conditionType:g}}):!j&&P&&e.report({node:p,messageId:"unnecessaryTypeofCondition",data:{name:rt(d,e),type:Tt(R)}})}function c(p){if(p.flags&B.default.TypeFlags.Any||p.flags&B.default.TypeFlags.Unknown)return null;if(p.isUnion()){let F=[];for(let d of p.types)if(d.flags&B.default.TypeFlags.StringLiteral){let g=d.value;F.push(g)}else return null;return F}return p.flags&B.default.TypeFlags.StringLiteral?[p.value]:null}function a(p){if(!n)return null;let F=r.esTreeNodeToTSNodeMap.get(p),d=n.getTypeAtLocation(F),g=c(d);if(g)return g;let R=n.getSymbolAtLocation(F);if(R){let P=n.getTypeOfSymbolAtLocation(R,F),j=c(P);if(j)return j}return null}function u(p){let F=e.sourceCode.ast,d=null;return je(F,g=>{if(g.type===ae.AST_NODE_TYPES.VariableDeclarator&&g.id.type===ae.AST_NODE_TYPES.Identifier&&g.id.name===p.name&&g.id.typeAnnotation){let R=g.id.typeAnnotation.typeAnnotation;if(R.type===ae.AST_NODE_TYPES.TSUnionType){let P=[];for(let j of R.types)if(j.type===ae.AST_NODE_TYPES.TSLiteralType&&j.literal.type===ae.AST_NODE_TYPES.Literal&&typeof j.literal.value=="string")P.push(j.literal.value);else return!0;return d=P,!0}if(R.type===ae.AST_NODE_TYPES.TSLiteralType&&R.literal.type===ae.AST_NODE_TYPES.Literal&&typeof R.literal.value=="string")return d=[R.literal.value],!0}return!1},e.sourceCode),d}function f(p){return p==="Array"||p==="ReadonlyArray"?!0:p.endsWith(".Array")||p.endsWith(".ReadonlyArray")}function y(p){if(!n)return!1;if(n.isArrayType(p)||n.isTupleType(p))return!0;let F=n.getApparentType(p);if(F!==p&&(n.isArrayType(F)||n.isTupleType(F)))return!0;if(p.aliasSymbol){let g=n.getFullyQualifiedName(p.aliasSymbol);if(f(g))return!0}let d=p.getSymbol();if(d){let g=n.getFullyQualifiedName(d);if(f(g))return!0}return!1}function x(p){if(!n)return!1;if(p.flags&B.default.TypeFlags.StringLike||p.flags&B.default.TypeFlags.NumberLike||p.flags&B.default.TypeFlags.BigIntLike||p.flags&B.default.TypeFlags.BooleanLike||p.flags&B.default.TypeFlags.ESSymbolLike||p.flags&B.default.TypeFlags.EnumLike||p.flags&B.default.TypeFlags.Null||p.flags&B.default.TypeFlags.Undefined||p.flags&B.default.TypeFlags.Void||p.flags&B.default.TypeFlags.Never)return!0;let F=p.getSymbol();if(F){let d=n.getFullyQualifiedName(F);if(d==="__function"||d==="__object"&&!y(p))return!0}return!1}function m(p){if(p.flags&B.default.TypeFlags.Any||p.flags&B.default.TypeFlags.Unknown)return"unknown";if(p.isUnion()){let F=!0,d=!0;for(let g of p.types){let R=m(g);if(R==="unknown")return"unknown";R!=="alwaysTrue"&&(F=!1),R!=="alwaysFalse"&&(d=!1)}return F?"alwaysTrue":d?"alwaysFalse":"unknown"}return y(p)?"alwaysTrue":x(p)?"alwaysFalse":"unknown"}function E(p){return!p.computed&&p.object.type===ae.AST_NODE_TYPES.Identifier&&p.object.name===mr.object&&p.property.type===ae.AST_NODE_TYPES.Identifier&&p.property.name===mr.property}function C(p){if(!n||p.callee.type!==ae.AST_NODE_TYPES.MemberExpression||!E(p.callee)||p.arguments.length===0)return;let[F]=p.arguments;if(!F||F.type===ae.AST_NODE_TYPES.SpreadElement)return;let d=r.esTreeNodeToTSNodeMap.get(F),g=n.getTypeAtLocation(d),R=m(g);R==="alwaysTrue"?e.report({node:p,messageId:"unnecessaryArrayIsArrayCondition"}):R==="alwaysFalse"&&e.report({node:p,messageId:"alwaysFalseArrayIsArrayCondition"})}function T(p){if(p.callee.type!==ae.AST_NODE_TYPES.MemberExpression||p.callee.property.type!==ae.AST_NODE_TYPES.Identifier||p.callee.computed)return;let F=p.callee.property.name;if(F!=="startsWith"&&F!=="endsWith"&&F!=="includes"||p.arguments.length!==1)return;let[d]=p.arguments;if(!d||d.type!==ae.AST_NODE_TYPES.Literal||typeof d.value!="string")return;let g=p.callee.object,R=a(g);if(!R&&g.type===ae.AST_NODE_TYPES.Identifier&&(R=u(g)),!R||R.length===0)return;let P=d.value;if(F==="includes"&&R.length>1)return;let j=0,V=0;for(let G of R)if((F==="startsWith"?G.startsWith(P):F==="endsWith"?G.endsWith(P):G.includes(P))?j++:V++,j>0&&V>0)return;if(j>0&&V===0){let G=F==="startsWith"?"unnecessaryStartsWithCondition":F==="endsWith"?"unnecessaryEndsWithCondition":"unnecessaryIncludesCondition";e.report({node:p,messageId:G})}else if(V>0&&j===0){let G=F==="startsWith"?"alwaysFalseStartsWithCondition":F==="endsWith"?"alwaysFalseEndsWithCondition":"alwaysFalseIncludesCondition";e.report({node:p,messageId:G})}}function I(p){if(!new Set(["===","!==",">",">=","<","<="]).has(p.operator))return;function d(H){if(H.type!==ae.AST_NODE_TYPES.MemberExpression||H.computed||H.property.type!==ae.AST_NODE_TYPES.Identifier||H.property.name!=="length")return null;let D=H.object,Z=a(D);if(!Z||Z.length===0)return null;let q=[];for(let ue of Z)q.push(ue.length);return{values:q}}let g=d(p.left),R=d(p.right),P=null,j=null;if(g?p.right.type===ae.AST_NODE_TYPES.Literal&&typeof p.right.value=="number"&&(P=g.values,j=p.right.value):R&&p.left.type===ae.AST_NODE_TYPES.Literal&&typeof p.left.value=="number"&&(P=R.values,j=p.left.value),!P||j===null)return;let V=0,G=0;for(let H of P){let D=!1;if(p.operator==="==="?D=H===j:p.operator==="!=="?D=H!==j:p.operator===">"?D=H>j:p.operator===">="?D=H>=j:p.operator==="<"?D=H<j:p.operator==="<="&&(D=H<=j),D?V++:G++,V>0&&G>0)return}V>0&&G===0?e.report({node:p,messageId:"unnecessaryLengthCondition"}):G>0&&V===0&&e.report({node:p,messageId:"alwaysFalseLengthCondition"})}function A(p){if(p.type===ae.AST_NODE_TYPES.Literal&&typeof p.value=="string")return p.value;let F=a(p);if(!F||F.length!==1)return null;let[d]=F;return d??null}function S(p){return(p.flags&B.default.TypeFlags.Intersection)!==0}function h(p){return(p.flags&B.default.TypeFlags.Object)!==0}function b(p){return!n||n.getIndexTypeOfType(p,B.default.IndexKind.String)?!0:!!n.getIndexTypeOfType(p,B.default.IndexKind.Number)}function w(p,F){if(!n||b(p)||p.getProperties().length===0)return"unknown";let d=n.getPropertyOfType(p,F);return d?d.flags&B.default.SymbolFlags.Optional?"optional":"required":"absent"}function k(p,F){if(p.flags&B.default.TypeFlags.Any||p.flags&B.default.TypeFlags.Unknown||p.flags&B.default.TypeFlags.Never||p.flags&B.default.TypeFlags.TypeParameter||p.flags&B.default.TypeFlags.IndexedAccess||p.flags&B.default.TypeFlags.StringLike||p.flags&B.default.TypeFlags.NumberLike||p.flags&B.default.TypeFlags.BigIntLike||p.flags&B.default.TypeFlags.BooleanLike||p.flags&B.default.TypeFlags.EnumLike||p.flags&B.default.TypeFlags.ESSymbolLike||p.flags&B.default.TypeFlags.NonPrimitive||p.flags&B.default.TypeFlags.Null||p.flags&B.default.TypeFlags.Undefined||p.flags&B.default.TypeFlags.Void)return"unknown";if(p.isUnion()){let d=!0,g=!0;for(let R of p.types){let P=k(R,F);if(P==="unknown"||(P!=="required"&&(d=!1),P!=="absent"&&(g=!1),P==="optional"))return"unknown"}return d?"required":g?"absent":"unknown"}if(S(p)){let d=p,g=!1,R=!1;for(let P of d.types){let j=k(P,F);if(j==="unknown")return"unknown";j==="required"?g=!0:j==="optional"&&(R=!0)}return g?"required":R?"optional":"absent"}return h(p)?w(p,F):"unknown"}function O(p){if(p.operator!=="in"||p.left.type===ae.AST_NODE_TYPES.PrivateIdentifier)return;let F=A(p.left);if(!F)return;let d=p.right,g=r.esTreeNodeToTSNodeMap.get(d);if(!n)return;let R=n.getTypeAtLocation(g),P=k(R,F);P==="required"?e.report({node:p,messageId:"unnecessaryInCondition",data:{property:F,type:n.typeToString(R),alternative:t.alternativeForInCondition?`If this a valid condition, you can use as alternative: ${t.alternativeForInCondition}`:""}}):P==="absent"&&e.report({node:p,messageId:"alwaysFalseInCondition",data:{property:F,type:n.typeToString(R),alternative:t.alternativeForInCondition?`If this a valid condition, you can use as alternative: ${t.alternativeForInCondition}`:""}})}return{BinaryExpression(p){l(p),I(p),O(p)},CallExpression(p){T(p),C(p)}}}})};function Tt(e){return Array.from(new Set(e)).join(" | ")||"never"}function rt(e,t){let r=e.argument;return r.type===ae.AST_NODE_TYPES.Identifier?r.name:t.sourceCode.getText(r)}function Qi(e,t){return t.has(e)}var Et=require("@typescript-eslint/utils"),ht=require("zod/v4");var eo=Et.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),yr="no-call-with-explicit-generics",to=ht.z.object({functions:ht.z.array(ht.z.string())}),no=eo({name:yr,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(to)]},defaultOptions:[{functions:[]}],create(e,[t]){let r=new Set(t.functions);return{CallExpression(n){let{callee:o}=n;o.type===Et.AST_NODE_TYPES.Identifier&&r.has(o.name)&&n.typeArguments&&e.report({node:n,messageId:"noExplicitGenerics",data:{functionName:o.name}})}}}}),Ht={name:yr,rule:no};var Ge=require("@typescript-eslint/utils"),ro=Ge.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),dr="no-call-with-inferred-generics",io=ro({name:dr,meta:{type:"problem",docs:{description:"Disable calling configured functions with infered generics"},messages:{missingGenericDeclaration:"Function '{{ functionName }}' should be called with at least {{ minGenerics }} generic(s) (ex: `fn<Generic>()`) defined",anyUsedInGenerics:"Function '{{ functionName }}' should not be called with 'any' in generics"},schema:[{type:"object",properties:{functions:{type:"array",items:{type:"object",properties:{name:{type:"string"},minGenerics:{type:"number"},allowAny:{type:"boolean"},disallowTypes:{type:"array",items:{type:"string"}}},required:["name"]}},anyAliases:{type:"array",items:{type:"string"}}},required:["functions"]}]},defaultOptions:[{functions:[]}],create(e,[t]){let r=new Map(t.functions.map(n=>[n.name,n]));return{CallExpression(n){let{callee:o}=n;if(o.type!==Ge.AST_NODE_TYPES.Identifier)return;let s=r.get(o.name);if(!s)return;let{minGenerics:i=1,allowAny:l,disallowTypes:c=t.disallowTypes}=s;(n.typeArguments?.params.length||0)<(i||0)&&e.report({node:n,messageId:"missingGenericDeclaration",data:{functionName:o.name,minGenerics:i||0}}),!(l&&!c)&&n.typeArguments?.params.some(u=>!l&&u.type===Ge.AST_NODE_TYPES.TSAnyKeyword||c&&u.type===Ge.AST_NODE_TYPES.TSTypeReference&&u.typeName.type===Ge.AST_NODE_TYPES.Identifier&&c.includes(u.typeName.name))&&e.report({node:n,messageId:"anyUsedInGenerics",data:{functionName:o.name}})}}}}),Yt={name:dr,rule:io};var Tr=require("@typescript-eslint/utils"),oo=Tr.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),hr="no-commented-out-code",so=["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:"],ao=/^\s*return\s+/,lo=/\w=("|'|`)/,po=/\w+:\s*('|"|`)/,co=/\[['"][^'"]*['"]\]:\s*('|"|`|[^'"`\s])/,uo=/\w+-\w+:/,fo=/\w+_\w+:/,mo=/\?\s+\w/,yo=/:\s+\w/,go=/^\s*('|"|`)[^'"]*('|"|`),?\s*$/,So=/^\s*\d+[,}]/,To=/^\s*\[[^\]]*\][,}]/,ho=/^\s*\{[^}]*\}[,}]/,Eo=/\.\w+\(/,bo=/\[\w+\]/,xo=/^\s*(['"`]).+?\1\s*:/,Co=/^<[A-Z]\w*(\s|>|\/)/,Io=/^<[a-z]+(\s|>|\/)/,Ao=/<[A-Z]\w*(\s.*)?>/,wo=/<\/[A-Z]\w*>/,Fo=/<[a-z]+(\s.*)?>/,Ro=/<\/[a-z]+>/,vo=/^\s*[*\s]*$/,ko=/^[a-zA-Z]/,Po=/^[A-Z][A-Za-z]*(?:\s+\d+)?(?:\s+[a-z]+)*:\s+[A-Za-z]/,Oo=/```[\s\S]*?```/g,No=/`[^`]*`/g,gr=/[a-zA-Z0-9]/,Do=/\.[A-Za-z_][A-Za-z0-9_]*\(/,jo=/[{}[\]()`=<>]/,Lo=/:\s*(['"`[{(]|\w+\s*=>)/,Mo=/\bif\s*\(|\belse\b|=>/,me={returnStatement:ao,stringAssignment:lo,objectPropertyWithQuotes:po,computedPropertyAssignment:co,kebabCaseProperty:uo,snakeCaseProperty:fo,ternaryOperator:mo,colonWithWord:yo,quotedString:go,numberWithComma:So,arrayWithComma:To,objectWithComma:ho,methodCall:Eo,arrayAccess:bo,quotedPropertyKey:xo,jsxSelfClosing:Co,jsxElement:Io,jsxOpeningTag:Ao,jsxClosingTag:wo,htmlOpeningTag:Fo,htmlClosingTag:Ro,jsdocComment:vo};function _o(e){if(e.includes(":")){let r=e.split(":")[0]?.trim();if(r&&ko.test(r)&&r.includes(" "))return!0}let t=e.trim();return t.length===0||Do.test(t)||jo.test(t)||Lo.test(t)||Mo.test(t)?!1:!!(t.includes(":")&&Po.test(t))}var $o=[") {","return;",me.returnStatement,"if (","else {","else if (","/>","</","< ","},",": {"," } = ","={",me.stringAssignment,");",me.objectPropertyWithQuotes,me.computedPropertyAssignment,me.kebabCaseProperty,me.snakeCaseProperty,"&&","||","()",me.ternaryOperator,me.colonWithWord,me.quotedString,me.numberWithComma,me.arrayWithComma,me.objectWithComma,me.methodCall,me.arrayAccess,"?.(","??","=>",me.quotedPropertyKey],Uo=["/>","</",me.jsxSelfClosing,me.jsxElement,me.jsxOpeningTag,me.jsxClosingTag,me.htmlOpeningTag,me.htmlClosingTag],Sr=["INFO:","TODO:","DOCS:","FIX:","FIXME:","HACK:","NOTE:","WARNING:","WARN:","BUG:","ISSUE:","TEMP:","TEMPORARY:","XXX:","REVIEW:","eslint"],zo=oo({name:hr,meta:{type:"problem",docs:{description:"Disallow commented code"},messages:{commentedOutCode:"Commented code is not allowed. Detected pattern: `{{ wrongPattern }}` Use a comment starting with one of these prefixes if you want to keep this code commented out: {{ allowedPrefixes }}"},schema:[]},defaultOptions:[],create(e){function t(n,o){if(n.startsWith("/"))return!1;let s=n.trimStart();if(n.startsWith("*")||s.startsWith("eslint-disable")||n.includes("@deprecated")||n.includes("@example")||n.includes("@param")||n.includes("@returns")||n.includes("@throws")||n.includes("typescript-eslint")||n.includes("@ts-")||n.includes("prettier-ignore")||me.jsdocComment.test(n))return!1;for(let i of Sr)if(s.startsWith(i))return!1;if(n.includes("https://")||_o(s))return!1;if(o==="Block"){for(let i of Uo)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 so)if(s.startsWith(i))return{wrongPattern:i};for(let i of $o)if(typeof i=="string"){if(n.includes(i))return{wrongPattern:i}}else if(i.test(n))return{wrongPattern:`regex(${i.toString()})`};return!1}function r(n,o){let s=n,i=s.trim();if(i.startsWith("`")&&(i.endsWith("`,")||i.endsWith("`;")||i.endsWith("`")))return s;if(o==="Block"&&s.includes("```")){let a=s.split(Oo);a.some(f=>gr.test(f))&&(s=a.join(""))}if(!s.includes("`"))return s;let l=s.split(No);return l.some(a=>gr.test(a))?l.join(""):s}return{Program(){let o=e.sourceCode.getAllComments();for(let s of o){let i=r(s.value,s.type),l=t(i,s.type);l&&e.report({node:s,messageId:"commentedOutCode",data:{wrongPattern:l.wrongPattern,allowedPrefixes:Sr.join(", ")}})}}}}}),qt={name:hr,rule:zo};var bt=require("@typescript-eslint/utils"),Wo=bt.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),Er="no-default-export",Jo=Wo({name:Er,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===bt.TSESTree.AST_NODE_TYPES.Identifier&&r.exported.name==="default"&&e.report({node:t,messageId:"noDefaultExport"})}}}}),Zt={name:Er,rule:Jo};var br=require("@typescript-eslint/utils"),Vo=br.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),xr="no-leaked-text-in-jsx",Xo=[",",";","[","]","(",")"],Bo=Vo({name:xr,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="";Xo.includes(r)?n=r:r.includes("&&")?n="&&":r.includes("||")?n="||":r.endsWith("? (")&&(n="? ("),n&&e.report({node:t,messageId:"leakedTextInJSX",data:{text:n}})}}}}),Gt={name:xr,rule:Bo};var Ye=require("@typescript-eslint/utils"),Ho=Ye.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),Ir="no-non-camel-case-functions",Yo=/^(\$?[a-z][a-zA-Z0-9]*)$/;function Cr(e){if(e.typeName.type!==Ye.AST_NODE_TYPES.TSQualifiedName)return!1;let{left:t,right:r}=e.typeName;return t.type===Ye.AST_NODE_TYPES.Identifier&&t.name==="JSX"&&r.name==="Element"}var qo=Ho({name:Ir,meta:{type:"suggestion",docs:{description:"Enforce camelCase naming convention for function declarations"},schema:[],messages:{nonCamelCaseFunction:'Function name "{{functionName}}" should be in camelCase format. If this fn is a React component and can\'t use the `FC` type, add a explicit "JSX.Element" return type to it'}},defaultOptions:[],create(e){return{FunctionDeclaration(t){if(t.id&&!Yo.test(t.id.name)){let r=t.returnType?.typeAnnotation;if(r&&(r.type===Ye.AST_NODE_TYPES.TSTypeReference?Cr(r):r.type===Ye.AST_NODE_TYPES.TSUnionType&&r.types.some(o=>o.type===Ye.AST_NODE_TYPES.TSTypeReference&&Cr(o))))return;e.report({node:t.id,messageId:"nonCamelCaseFunction",data:{functionName:t.id.name}})}}}}}),Kt={name:Ir,rule:qo};var se=require("@typescript-eslint/utils");var Zo=se.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),Ar="no-optional-root-props",Go=Zo({name:Ar,meta:{type:"problem",docs:{description:"Prevents usage of optional properties at the root of a type if that type is a local type alias or interface referenced only once"},messages:{optionalNotAllowed:'Optional property "{{ propertyName }}" is not allowed on a local type used only once. Use `prop: undefined | ...` instead.',suggestion:"Use `prop: undefined | ...` instead."},hasSuggestions:!0,schema:[]},defaultOptions:[],create(e){function t(n){let s=e.sourceCode.getDeclaredVariables(n)[0];if(!s||s.references.length!==1)return!1;let i=s.references[0];if(!i)return!1;for(let l of Jt(i.identifier)){if("returnType"in l||l.type===se.TSESTree.AST_NODE_TYPES.ExportNamedDeclaration)return!1;let c=l.parent;if(!c)return!1;if(c.type===se.TSESTree.AST_NODE_TYPES.TSTypeParameterInstantiation&&c.parent.type===se.TSESTree.AST_NODE_TYPES.TSTypeReference&&c.parent.typeName.type===se.TSESTree.AST_NODE_TYPES.Identifier&&c.parent.typeName.name==="FC"){let u=nt(c.parent.parent,se.TSESTree.AST_NODE_TYPES.VariableDeclaration,4);if(!u)return!1;let f=xt(u,e.sourceCode);return f?!(f.parent.type===se.TSESTree.AST_NODE_TYPES.CallExpression&&f.parent.callee.type===se.TSESTree.AST_NODE_TYPES.Identifier&&f.parent.callee.name==="memo"):!1}if(l.type===se.TSESTree.AST_NODE_TYPES.AssignmentPattern)return!1;if(c.type===se.TSESTree.AST_NODE_TYPES.ArrowFunctionExpression){let a=nt(c,se.TSESTree.AST_NODE_TYPES.VariableDeclaration);return a?!!xt(a,e.sourceCode):!1}if(c.type===se.TSESTree.AST_NODE_TYPES.FunctionDeclaration)return!!xt(c,e.sourceCode)}return!1}function r(n){n.key.type!==se.TSESTree.AST_NODE_TYPES.Identifier||!n.optional||e.report({node:n.key,messageId:"optionalNotAllowed",data:{propertyName:n.key.name},suggest:[{messageId:"suggestion",fix:o=>{let s=nt(n,se.TSESTree.AST_NODE_TYPES.TSPropertySignature);if(!s)return null;let i=e.sourceCode.getText(s);return o.replaceText(s,i.replace("?:",": undefined |"))}}]})}return{TSTypeAliasDeclaration(n){if(n.typeAnnotation.type===se.TSESTree.AST_NODE_TYPES.TSTypeLiteral&&!(Ct(n)||!t(n)))for(let o of n.typeAnnotation.members)o.type===se.TSESTree.AST_NODE_TYPES.TSPropertySignature&&r(o)},TSInterfaceDeclaration(n){if(!(Ct(n)||!t(n)))for(let o of n.body.body)o.type===se.TSESTree.AST_NODE_TYPES.TSPropertySignature&&r(o)},TSTypeReference(n){if(n.typeName.type!==se.TSESTree.AST_NODE_TYPES.Identifier||n.typeName.name!=="FC"||!n.typeArguments?.params[0])return;let o=n.typeArguments.params[0];if(o.type!==se.TSESTree.AST_NODE_TYPES.TSTypeLiteral)return;let s=nt(n.parent,se.TSESTree.AST_NODE_TYPES.VariableDeclaration,4);if(!s)return;let i=xt(s,e.sourceCode);if(!(!i||i.parent.type===se.TSESTree.AST_NODE_TYPES.CallExpression&&i.parent.callee.type===se.TSESTree.AST_NODE_TYPES.Identifier&&i.parent.callee.name==="memo"))for(let c of o.members)c.type===se.TSESTree.AST_NODE_TYPES.TSPropertySignature&&r(c)}}}});function Ct(e){return e?e.parent?.type===se.TSESTree.AST_NODE_TYPES.ExportNamedDeclaration||e.parent?.type===se.TSESTree.AST_NODE_TYPES.ExportDefaultDeclaration:!1}function xt(e,t){if(Ct(e))return;let r;if(e.type===se.TSESTree.AST_NODE_TYPES.VariableDeclaration){if(e.declarations.length!==1)return;e.declarations[0].id.type===se.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===se.TSESTree.AST_NODE_TYPES.FunctionDeclaration&&n.upper&&(n=n.upper);let o=n.variables.find(i=>i.identifiers.includes(r));if(!o)return;let s=o.references.filter(i=>i.identifier!==r);if(!(s.length!==1||!s[0])&&!Ct(s[0].identifier.parent.parent))return s[0].identifier}var Qt={name:Ar,rule:Go};var ct=require("@typescript-eslint/utils");var ut=X({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===ct.AST_NODE_TYPES.Identifier?t.has(n.name):n.type===ct.AST_NODE_TYPES.MemberExpression?r(n.object):!1:!1}return{ImportDeclaration(n){for(let o of n.specifiers)t.add(o.local.name)},ExportNamedDeclaration(n){if(n.source){e.report({node:n,messageId:"noReexport"});return}if(n.declaration?.type===ct.AST_NODE_TYPES.VariableDeclaration)for(let o of n.declaration.declarations)r(o.init)&&e.report({node:n,messageId:"noReexport"});n.specifiers.length>0&&e.report({node:n,messageId:"noReexport"})},ExportDefaultDeclaration(n){n.declaration.type===ct.AST_NODE_TYPES.Identifier&&t.has(n.declaration.name)&&e.report({node:n,messageId:"noReexport"})},ExportAllDeclaration(n){e.report({node:n,messageId:"noReexport"})}}}});var wr=require("@typescript-eslint/utils"),It=Pe(require("path")),We=require("zod/v4");var Ko=wr.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),Fr="no-relative-imports",Qo=We.z.object({find:We.z.string(),replacement:We.z.string()}),es=We.z.object({aliases:We.z.array(Qo),rootDir:We.z.string().optional(),allowNotFoundAliases:We.z.boolean().optional(),_dev_simulateFileName:We.z.string().optional()}),ts=Ko({name:Fr,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(es)]},defaultOptions:[{aliases:[],rootDir:void 0}],create(e,[t]){let r=t._dev_simulateFileName??e.filename;function n(i){return i.startsWith(".")||i.startsWith("..")}function o(i,l){let c=It.default.dirname(l);return It.default.resolve(c,i)}function s(i){let l=t.rootDir??process.cwd(),c=It.default.relative(l,i);if(c.startsWith("."))return null;c.startsWith("/")||(c=`/${c}`);for(let{find:a,replacement:u}of t.aliases)if(c.startsWith(u)){let f=c.replace(u,a);return{alias:a,newPath:f}}return null}return{ImportDeclaration(i){let l=i.source.value;if(!n(l))return;let c=o(l,r),a=s(c);!a&&t.allowNotFoundAliases||e.report({node:i,messageId:a?"noRelativeImportsWithAlias":"noRelativeImports",data:{alias:a?.alias},fix:a?u=>u.replaceText(i.source,`'${a.newPath}'`):void 0})}}}}),en={name:Fr,rule:ts};var ye=require("@typescript-eslint/utils"),tn=require("zod/v4");var ns=tn.z.object({customMessage:tn.z.string().optional()}),nn=X({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(ns)],messages:{noStaticStyleProp:"Static style props are not allowed use css instead.{{customMessage}}"}},defaultOptions:[{}],create(e,[t]){function r(n){switch(n.type){case ye.AST_NODE_TYPES.Literal:return!0;case ye.AST_NODE_TYPES.ObjectExpression:return n.properties.every(o=>o.type===ye.AST_NODE_TYPES.Property?o.computed||o.value.type===ye.AST_NODE_TYPES.Identifier&&o.key.type===ye.AST_NODE_TYPES.Identifier&&o.key.name===o.value.name?!1:r(o.value):!1);case ye.AST_NODE_TYPES.ArrayExpression:return n.elements.every(o=>o?o.type===ye.AST_NODE_TYPES.SpreadElement?!1:r(o):!0);case ye.AST_NODE_TYPES.TemplateLiteral:return n.expressions.length===0;case ye.AST_NODE_TYPES.ConditionalExpression:case ye.AST_NODE_TYPES.LogicalExpression:case ye.AST_NODE_TYPES.BinaryExpression:case ye.AST_NODE_TYPES.UnaryExpression:case ye.AST_NODE_TYPES.CallExpression:case ye.AST_NODE_TYPES.MemberExpression:case ye.AST_NODE_TYPES.Identifier:case ye.AST_NODE_TYPES.ArrowFunctionExpression:case ye.AST_NODE_TYPES.FunctionExpression:return!1;default:return!1}}return{JSXAttribute(n){if(n.name.type===ye.AST_NODE_TYPES.JSXIdentifier&&n.name.name==="style"&&n.value){let o=null;n.value.type===ye.AST_NODE_TYPES.JSXExpressionContainer?n.value.expression.type!==ye.AST_NODE_TYPES.JSXEmptyExpression&&(o=n.value.expression):n.value.type===ye.AST_NODE_TYPES.Literal&&(o=n.value),o&&r(o)&&e.report({node:n,messageId:"noStaticStyleProp",data:{customMessage:t.customMessage?` ${t.customMessage}`:""}})}}}}});var ft=require("@typescript-eslint/utils"),Ke=Pe(require("zod/v4"));var rs=Ke.object({alternativeMsgs:Ke.object({inArrayFind:Ke.string().optional(),inArrayFilter:Ke.string().optional()}).optional(),__dev_simulateFileName:Ke.string().optional()});function is(e){return e.typeAnnotation.type!==ft.AST_NODE_TYPES.TSTypePredicate?!1:e.typeAnnotation.asserts===!1}var os=/(typeGuards|type-guards)\.(ts|tsx)$/;function ss(e){return os.test(e)}function as(e){let t=e.parent;for(;t;){if(t.type===ft.AST_NODE_TYPES.CallExpression&&t.callee.type===ft.AST_NODE_TYPES.MemberExpression&&t.callee.property.type===ft.AST_NODE_TYPES.Identifier){let r=t.callee.property.name;if(r==="filter"||r==="find")return{method:r}}t=t.parent}return null}var rn=X({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(rs)],hasSuggestions:!0},defaultOptions:[{}],create(e,[t]){let r=t.__dev_simulateFileName??e.filename;if(ss(r))return{};function n(o){if(!is(o))return;let s=as(o);if(t.alternativeMsgs&&s){let i=s.method==="filter"?t.alternativeMsgs.inArrayFilter:t.alternativeMsgs.inArrayFind;if(i){let l=s.method==="filter"?"useFilterWithTypeCheck":"useFindWithTypeCheck";e.report({node:o,messageId:l,data:{message:i}});return}}e.report({node:o,messageId:"typeGuardNotAllowed"})}return{"FunctionDeclaration > :matches(TSTypeAnnotation)":n,"ArrowFunctionExpression > :matches(TSTypeAnnotation)":n,"MethodDefinition > FunctionExpression > :matches(TSTypeAnnotation)":n}}});var Qe=require("@typescript-eslint/utils");var ls="no-unnecessary-async-on-jsx-props";function ps(e){if(e.body.type!==Qe.AST_NODE_TYPES.BlockStatement)return!1;let t=e.body.body;if(t.length!==1)return!1;let r=t[0];return!r||r.type!==Qe.AST_NODE_TYPES.ExpressionStatement?!1:r.expression.type===Qe.AST_NODE_TYPES.AwaitExpression}var on=X({name:ls,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){ps(r)&&e.report({node:r,messageId:"unnecessaryAsyncInJsxProp",fix(n){let o=e.sourceCode,s=[],i=o.getFirstToken(r,c=>c.value==="async");if(i){let c=o.getTokenAfter(i);c?s.push(n.replaceTextRange([i.range[0],c.range[0]],"")):s.push(n.remove(i))}function l(c){if(c.type===Qe.AST_NODE_TYPES.AwaitExpression){let a=o.getFirstToken(c);if(a&&a.value==="await"){let u=o.getTokenAfter(a);u?s.push(n.replaceTextRange([a.range[0],u.range[0]],"")):s.push(n.remove(a))}}if(c.type===Qe.AST_NODE_TYPES.BlockStatement)for(let a of c.body)l(a);else c.type===Qe.AST_NODE_TYPES.ExpressionStatement&&l(c.expression)}return l(r.body),s}})}return{"JSXAttribute ArrowFunctionExpression[async=true]":t,"JSXAttribute FunctionExpression[async=true]":t}}});var Je=require("@typescript-eslint/utils"),sn=Pe(require("typescript")),it=Pe(require("zod/v4"));var cs=Je.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),Rr="no-unnecessary-casting",us=it.default.object({additionalCastFunctions:it.default.array(it.default.object({name:it.default.string(),expectedType:it.default.enum(["string","number"])})).optional()}),an={name:Rr,rule:cs({name:Rr,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(us)],fixable:"code"},defaultOptions:[{}],create(e){let r=e.options[0].additionalCastFunctions||[],n=[{name:"Number",expectedType:"number"},{name:"String",expectedType:"string"},...r],o=Je.ESLintUtils.getParserServices(e,!0),s=o.program?.getTypeChecker();if(!s||!o.program)throw new Error("TypeScript services or program not available");function i(u,f){switch(u.type){case Je.AST_NODE_TYPES.Literal:return f==="number"?typeof u.value=="number":typeof u.value=="string";case Je.AST_NODE_TYPES.TemplateLiteral:return f==="string";case Je.AST_NODE_TYPES.UnaryExpression:return f==="number"?u.operator==="+"||u.operator==="-"||u.operator==="~":!1;default:return!1}}function l(u,f){return f==="number"?!!(u.flags&sn.TypeFlags.NumberLike):!!(u.flags&sn.TypeFlags.StringLike)}function c(u,f){return y=>y.replaceText(u,e.sourceCode.getText(f))}function a(u){if(!s||u.arguments.length!==1)return;let f=u.arguments[0];if(!f||f.type===Je.AST_NODE_TYPES.SpreadElement)return;let{callee:y}=u;if(y.type!==Je.AST_NODE_TYPES.Identifier)return;let x=y.name,m=n.find(C=>C.name===x);if(!m)return;if(i(f,m.expectedType)||l(s.getTypeAtLocation(o.esTreeNodeToTSNodeMap.get(f)),m.expectedType)){let C,T;x==="Number"?C="unnecessaryNumberCasting":x==="String"?C="unnecessaryStringCasting":(C="unnecessaryCustomCasting",T={name:m.name,type:m.expectedType}),e.report({node:u,messageId:C,...T?{data:T}:{},fix:c(u,f)})}}return{CallExpression:a}}})};var Fe=require("@typescript-eslint/utils"),At=Pe(require("zod/v4"));var fs=At.object({ignoreWithDescription:At.string().optional()}),ln=X({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(fs)]},defaultOptions:[{}],create(e,[t]){let r=e.getSourceCode(),n=r.ast;function o(c){let a=c.arguments[0];return a&&a.type===Fe.AST_NODE_TYPES.Literal&&typeof a.value=="string"?a.value:null}function s(c){return!c||!t.ignoreWithDescription?!1:new RegExp(t.ignoreWithDescription).test(c)}function i(c){return c.length!==1?!1:n.body.filter(u=>{if(u.type===Fe.AST_NODE_TYPES.ExpressionStatement){let f=u.expression;if(f.type===Fe.AST_NODE_TYPES.CallExpression&&f.callee.type===Fe.AST_NODE_TYPES.Identifier){let y=f.callee.name;return["test","it","beforeEach","afterEach","beforeAll","afterAll"].includes(y)}}return!1}).length===0}function l(c){let a=c.arguments[1];if(a&&(a.type===Fe.AST_NODE_TYPES.FunctionExpression||a.type===Fe.AST_NODE_TYPES.ArrowFunctionExpression)&&a.body.type===Fe.AST_NODE_TYPES.BlockStatement){let u=a.body.body;return u.length===0?"":u.map(y=>r.text.slice(y.range[0],y.range[1])).join(`
16
16
 
17
- `)}return""}return{Program(){let c=[];for(let y of n.body)y.type===we.AST_NODE_TYPES.ExpressionStatement&&y.expression.type===we.AST_NODE_TYPES.CallExpression&&y.expression.callee.type===we.AST_NODE_TYPES.Identifier&&y.expression.callee.name==="describe"&&y.expression.arguments.length===2&&c.push(y.expression);if(!i(c))return;let[a]=c;if(!a)return;let u=o(a);if(s(u))return;let f=n.body.find(y=>y.type===we.AST_NODE_TYPES.ExpressionStatement&&y.expression===a);!f||f.type!==we.AST_NODE_TYPES.ExpressionStatement||e.report({node:a,messageId:"unnecessaryDescribe",suggest:[{messageId:"removeDescribe",fix(y){let x=l(a);return x?y.replaceText(f,x):null}}]})}}}});var mt=require("@typescript-eslint/utils"),Le=Pe(require("zod/v4"));var as=Le.object({methods:Le.union([Le.array(Le.string()),Le.literal("array")])}),pn=X({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:[z(as)]},defaultOptions:[{methods:"array"}],create(e,[t]){let r=t.methods,n=new Set(["find","filter","map","forEach","some","every","reduce","findIndex","sort"]);function o(l){return Array.isArray(r)?r.includes(l):n.has(l)}function s(l){let{callee:c}=l;if(c.type===mt.AST_NODE_TYPES.MemberExpression){let a=c.property;if(a.type===mt.AST_NODE_TYPES.Identifier)return a.name}return null}function i(l,c){if(l.type!==mt.AST_NODE_TYPES.Identifier||!l.typeAnnotation)return;let a=c.parent;if(a.type===mt.AST_NODE_TYPES.CallExpression){let u=s(a);u&&o(u)&&a.arguments.indexOf(c)===0&&e.report({node:l.typeAnnotation,messageId:"unnecessaryTypeAnnotation",fix(y){return l.typeAnnotation?y.remove(l.typeAnnotation):null}})}}return{ArrowFunctionExpression(l){for(let c of l.params)i(c,l)},FunctionExpression(l){for(let c of l.params)i(c,l)}}}});var Ae=require("@typescript-eslint/utils");var cn=X({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===Ae.AST_NODE_TYPES.ObjectPattern||!t.init||t.init.type!==Ae.AST_NODE_TYPES.ObjectExpression||t.id.type===Ae.AST_NODE_TYPES.Identifier&&t.id.typeAnnotation||t.parent.parent.type===Ae.AST_NODE_TYPES.ExportNamedDeclaration)return;let r=new Map;for(let i of t.init.properties)i.type===Ae.AST_NODE_TYPES.Property&&i.key.type===Ae.AST_NODE_TYPES.Identifier&&r.set(i.key.name,i);if(r.size===0||t.id.type!==Ae.AST_NODE_TYPES.Identifier)return;let n=ls(t,e.sourceCode);if(n.length===0)return;let o=t.init.properties.some(i=>i.type!==Ae.AST_NODE_TYPES.Property?!1:i.value.type===Ae.AST_NODE_TYPES.FunctionExpression),s=new Set;for(let i of n){if(i.identifier.parent.type!==Ae.AST_NODE_TYPES.MemberExpression)return;let l=i.identifier.parent;if(l.object!==i.identifier)return;if(l.computed)if(l.property.type===Ae.AST_NODE_TYPES.Literal&&typeof l.property.value=="string")s.add(l.property.value);else return;else{if(l.property.type!==Ae.AST_NODE_TYPES.Identifier)return;s.add(l.property.name)}if(l.parent.type===Ae.AST_NODE_TYPES.CallExpression&&o)return}for(let[i,l]of r)s.has(i)||e.report({node:l,messageId:"unusedObjectProperty",data:{name:i}})}}}});function ls(e,t){let r=t.getDeclaredVariables(e);if(r.length!==1)return[];let n=r[0];return n?n.references.filter(o=>o.identifier!==e.id):[]}var te=require("@typescript-eslint/utils"),un=require("zod/v4");var ps=un.z.object({ignoreArgsMatching:un.z.string().optional()}),fn=X({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:[z(ps)]},defaultOptions:[{}],create(e,[t]){let r=[];function n(i){return t.ignoreArgsMatching?new RegExp(t.ignoreArgsMatching).test(i):!1}function o(i){return i.type===te.AST_NODE_TYPES.ExportNamedDeclaration||i.type===te.AST_NODE_TYPES.ExportDefaultDeclaration||i.parent?.type===te.AST_NODE_TYPES.ExportNamedDeclaration||i.parent?.type===te.AST_NODE_TYPES.ExportDefaultDeclaration}function s(i){let l=[];for(let c=0;c<i.length;c++){let a=i[c];if(!a||a.type!==te.AST_NODE_TYPES.Identifier)continue;let u=a.name;if(!n(u)){if(a.optional&&a.typeAnnotation&&a.typeAnnotation.typeAnnotation.type===te.AST_NODE_TYPES.TSTypeLiteral){let f=a.typeAnnotation.typeAnnotation,y=[];for(let x of f.members)x.type===te.AST_NODE_TYPES.TSPropertySignature&&x.key.type===te.AST_NODE_TYPES.Identifier&&y.push({name:x.key.name,optional:x.optional===!0});y.some(x=>x.optional)?l.push({param:a,index:c,name:u,isObjectParam:!0,objectProps:y}):l.push({param:a,index:c,name:u,isObjectParam:!1})}else if(a.optional)l.push({param:a,index:c,name:u,isObjectParam:!1});else if(a.typeAnnotation&&a.typeAnnotation.typeAnnotation.type===te.AST_NODE_TYPES.TSTypeLiteral){let f=a.typeAnnotation.typeAnnotation,y=[];for(let x of f.members)x.type===te.AST_NODE_TYPES.TSPropertySignature&&x.key.type===te.AST_NODE_TYPES.Identifier&&y.push({name:x.key.name,optional:x.optional===!0});y.some(x=>x.optional)&&l.push({param:a,index:c,name:u,isObjectParam:!0,objectProps:y})}}}return l}return{FunctionDeclaration(i){if(o(i))return;let l=s(i.params);l.length!==0&&r.push({node:i,declarationNode:i,optionalParams:l})},VariableDeclarator(i){if(i.id.type!==te.AST_NODE_TYPES.Identifier||!i.init||i.init.type!==te.AST_NODE_TYPES.ArrowFunctionExpression&&i.init.type!==te.AST_NODE_TYPES.FunctionExpression||o(i.parent.parent))return;let c=[...s(i.init.params)];if(i.id.typeAnnotation&&i.id.typeAnnotation.typeAnnotation.type===te.AST_NODE_TYPES.TSTypeReference){let a=i.id.typeAnnotation.typeAnnotation;if(a.typeName.type===te.AST_NODE_TYPES.Identifier&&a.typeName.name==="FC"){let u=a.typeArguments;if(u&&u.params.length===1){let f=u.params[0];if(f&&f.type===te.AST_NODE_TYPES.TSTypeLiteral){let y=[];for(let x of f.members)x.type===te.AST_NODE_TYPES.TSPropertySignature&&x.key.type===te.AST_NODE_TYPES.Identifier&&y.push({name:x.key.name,optional:x.optional===!0});y.some(x=>x.optional)&&c.push({param:i.id,index:0,name:"props",isObjectParam:!0,objectProps:y})}}}}c.length!==0&&r.push({node:i.init,declarationNode:i,optionalParams:c})},"Program:exit"(){for(let i of r){let c=e.sourceCode.getDeclaredVariables(i.declarationNode)[0];if(!c)continue;let a=c.references.filter(y=>y.identifier!==c.identifiers[0]);if(a.length===0)continue;let u=!1;for(let y of a){let x=y.identifier.parent;if(x.type===te.AST_NODE_TYPES.CallExpression&&y.identifier.type===te.AST_NODE_TYPES.Identifier&&x.arguments.includes(y.identifier)){u=!0;break}if(x.type===te.AST_NODE_TYPES.ReturnStatement){u=!0;break}if(x.type===te.AST_NODE_TYPES.Property&&x.parent.type===te.AST_NODE_TYPES.ObjectExpression&&x.parent.parent.type===te.AST_NODE_TYPES.ReturnStatement){u=!0;break}if(x.type===te.AST_NODE_TYPES.JSXExpressionContainer){u=!0;break}}if(u)continue;let f=[];for(let y of a){let x=y.identifier.parent;if(x.type===te.AST_NODE_TYPES.CallExpression&&x.callee===y.identifier){let m=x.arguments.length,E=x.arguments.some(S=>S.type===te.AST_NODE_TYPES.SpreadElement);if(E){u=!0;break}let C={argCount:m,hasSpread:E};for(let S of i.optionalParams)if(S.isObjectParam&&S.index<m){let I=x.arguments[S.index];if(I?.type===te.AST_NODE_TYPES.ObjectExpression){let A={};for(let T of I.properties)T.type===te.AST_NODE_TYPES.Property&&T.key.type===te.AST_NODE_TYPES.Identifier&&(A[T.key.name]=!0);C.objectArgs||(C.objectArgs=[]),C.objectArgs[S.index]=A}else if(I){u=!0;break}}f.push(C)}else if(x.type===te.AST_NODE_TYPES.JSXOpeningElement&&x.name===y.identifier){let m=x.attributes.some(C=>C.type===te.AST_NODE_TYPES.JSXSpreadAttribute);if(m){u=!0;break}let E={argCount:1,hasSpread:m};for(let C of i.optionalParams)if(C.isObjectParam&&C.index===0){let S={};for(let I of x.attributes)I.type===te.AST_NODE_TYPES.JSXAttribute&&I.name.type===te.AST_NODE_TYPES.JSXIdentifier&&(S[I.name.name]=!0);E.objectArgs||(E.objectArgs=[]),E.objectArgs[0]=S}f.push(E)}}if(!(u||f.length===0))for(let y of i.optionalParams)if(y.isObjectParam&&y.objectProps)for(let x of y.objectProps){if(!x.optional)continue;let m=!1;for(let E of f)if(E.objectArgs&&E.objectArgs[y.index]){let C=E.objectArgs[y.index];if(C&&C[x.name]){m=!0;break}}m||e.report({node:y.param,messageId:"unusedOptionalProp",data:{name:x.name}})}else{let x=!1;for(let m of f)if(m.argCount>y.index){x=!0;break}x||e.report({node:y.param,messageId:"unusedOptionalArg",data:{name:y.name}})}}}}}});var le=require("@typescript-eslint/utils"),qe=require("zod/v4");var cs=qe.z.object({selectors:qe.z.array(qe.z.object({name:qe.z.string(),selectorProp:qe.z.string().optional(),selectorArgPos:qe.z.number().optional(),returnProp:qe.z.string().optional()}))}),us=le.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),vr="no-unused-selected-values",mn={name:vr,rule:us({name:vr,meta:{type:"suggestion",docs:{description:"Disallow unused values in selector objects"},messages:{unusedSelectedValue:'The selected value "{{name}}" is not being used'},schema:[z(cs)]},defaultOptions:[{selectors:[]}],create(e,[t]){let{selectors:r=[]}=t,n=new Map(r.map(o=>[o.name,o]));return{VariableDeclarator(o){let s=null;if(o.init?.type===le.AST_NODE_TYPES.CallExpression&&(s=o.init),!s)return;let i=ms(s);if(!i)return;let l=n.get(i);if(!l)return;let c=fs(s,l.selectorArgPos??0,l.selectorProp);if(!c)return;let a=ys(c);if(!a)return;let u=kr(a.properties,void 0);if(!u)return;if(o.id.type===le.AST_NODE_TYPES.ObjectPattern){let x=kr(o.id.properties,l.returnProp);if(!x)return;for(let[m,E]of u)x.has(m)||e.report({node:E,messageId:"unusedSelectedValue",data:{name:m}});return}if(o.id.type!==le.AST_NODE_TYPES.Identifier||l.returnProp)return;let f=ds(o,e.sourceCode);if(f.length===0)return;let y=new Set;for(let x of f){if(x.identifier.parent.type!==le.AST_NODE_TYPES.MemberExpression)return;let m=x.identifier.parent.property;if(m.type!==le.AST_NODE_TYPES.Identifier)return;y.add(m.name)}for(let[x,m]of u)y.has(x)||e.report({node:m,messageId:"unusedSelectedValue",data:{name:x}})}}}})};function fs(e,t,r){let n=e.arguments[t];if(!n)return null;if(n.type===le.AST_NODE_TYPES.ArrowFunctionExpression||n.type===le.AST_NODE_TYPES.FunctionExpression)return n;if(r&&n.type===le.AST_NODE_TYPES.ObjectExpression){let o=n.properties.find(i=>i.type===le.AST_NODE_TYPES.Property&&i.key.type===le.AST_NODE_TYPES.Identifier&&i.key.name===r);if(o?.type!==le.AST_NODE_TYPES.Property)return null;let s=o.value;if(s.type===le.AST_NODE_TYPES.ArrowFunctionExpression||s.type===le.AST_NODE_TYPES.FunctionExpression)return s}return null}function ms(e){return e.callee.type===le.AST_NODE_TYPES.Identifier?e.callee.name:e.callee.type===le.AST_NODE_TYPES.MemberExpression&&e.callee.property.type===le.AST_NODE_TYPES.Identifier?e.callee.property.name:null}function ys(e){if(e.body.type===le.AST_NODE_TYPES.ObjectExpression)return e.body;if(e.body.type===le.AST_NODE_TYPES.BlockStatement){let t=e.body.body.filter(r=>r.type===le.AST_NODE_TYPES.ReturnStatement);return t.length!==1||!t[0]||t[0].argument?.type!==le.AST_NODE_TYPES.ObjectExpression?null:t[0].argument}return null}function kr(e,t){let r=e;if(t){let o=e.find(s=>s.type===le.AST_NODE_TYPES.Property&&s.key.type===le.AST_NODE_TYPES.Identifier&&s.key.name===t);if(o?.type!==le.AST_NODE_TYPES.Property||o.value.type!==le.AST_NODE_TYPES.ObjectPattern)return null;r=o.value.properties}let n=new Map;for(let o of r){if(o.type!==le.AST_NODE_TYPES.Property||o.key.type!==le.AST_NODE_TYPES.Identifier)return null;n.set(o.key.name,o)}return n.size>0?n:null}function ds(e,t){let r=t.getDeclaredVariables(e);if(r.length!==1)return[];let n=r[0];return n?n.references.filter(o=>o.identifier!==e.id):[]}var pe=require("@typescript-eslint/utils");var yn=X({name:"no-unused-t-state-field",meta:{type:"suggestion",docs:{description:"Prevent declaring unused t-state fields"},messages:{unusedField:'Field "{{name}}" is not being used, you can safely remove it'},schema:[]},defaultOptions:[],create(e){if(!(e.filename.endsWith(".jsx")||e.filename.endsWith(".tsx")))return{};if(!e.sourceCode.ast.body.some(s=>s.type===pe.AST_NODE_TYPES.ImportDeclaration&&s.source.value==="t-state-form"))return{};let n=null,o=!1;return{CallExpression(s){if(o)return;if(!n){let l=gs(s);l&&(n=l);return}let i=Ss(s,e.sourceCode);if(i){o=!0;for(let l of i)n.delete(l);if(n.size!==0)for(let[l,c]of n)e.report({node:c,messageId:"unusedField",data:{name:l}})}}}}});function gs(e){if(!(e.callee.type===pe.AST_NODE_TYPES.Identifier&&e.callee.name==="useForm"))return null;let r=e.arguments[0];if(!r||r.type!==pe.AST_NODE_TYPES.ObjectExpression)return null;let n=Vt(r.properties,s=>s.type!==pe.AST_NODE_TYPES.Property||s.key.type!==pe.AST_NODE_TYPES.Identifier||s.key.name!=="initialConfig"?null:s.value.type===pe.AST_NODE_TYPES.ObjectExpression?s.value:s.value.type===pe.AST_NODE_TYPES.ArrowFunctionExpression||s.value.type===pe.AST_NODE_TYPES.FunctionExpression?Ts(s.value):null);if(!n)return null;let o=new Map;for(let s of n.properties)s.type===pe.AST_NODE_TYPES.Property&&s.key.type===pe.AST_NODE_TYPES.Identifier&&o.set(s.key.name,s);return o}function Ss(e,t){if(!(e.callee.type===pe.AST_NODE_TYPES.Identifier&&e.callee.name==="useFormState")||e.parent.type!==pe.AST_NODE_TYPES.VariableDeclarator||e.parent.id.type!==pe.AST_NODE_TYPES.ObjectPattern||!Vt(e.parent.id.properties,i=>i.type===pe.AST_NODE_TYPES.Property&&i.key.type===pe.AST_NODE_TYPES.Identifier&&i.key.name==="formFields"&&i))return null;let o=ur(e.parent,"formFields",t),s=new Set;for(let{identifier:i}of o){if(i.type!==pe.AST_NODE_TYPES.Identifier||i.parent.type===pe.AST_NODE_TYPES.Property&&i.parent.parent.type===pe.AST_NODE_TYPES.ObjectExpression&&i.parent.parent.parent.type===pe.AST_NODE_TYPES.ReturnStatement||i.parent.type===pe.AST_NODE_TYPES.ReturnStatement)return null;if(i.parent.type===pe.AST_NODE_TYPES.MemberExpression){if(i.parent.object.type!==pe.AST_NODE_TYPES.Identifier||i.parent.property.type!==pe.AST_NODE_TYPES.Identifier)return null;s.add(i.parent.property.name)}}return s}function Ts(e){if(e.body.type===pe.AST_NODE_TYPES.ObjectExpression)return e.body;if(e.body.type===pe.AST_NODE_TYPES.BlockStatement){let t=e.body.body.filter(r=>r.type===pe.AST_NODE_TYPES.ReturnStatement);return t.length!==1||!t[0]||t[0].argument?.type!==pe.AST_NODE_TYPES.ObjectExpression?null:t[0].argument}return null}var oe=require("@typescript-eslint/utils"),yt=require("zod/v4");var hs=oe.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`);function Pr(e){let t=[];for(let r of e.members)r.type===oe.AST_NODE_TYPES.TSPropertySignature&&r.key.type===oe.AST_NODE_TYPES.Identifier&&t.push([r.key.name,r]);return t}function Or(e,...t){for(let r of t)e.set(...r);return e}var Es=yt.z.object({forceCheckOnFCPropTypesWithName:yt.z.array(yt.z.string()).optional(),alwaysCheckFunctionOptionTypes:yt.z.boolean().optional()}),Nr="no-unused-type-props-in-args",dn=null,bs=hs({name:Nr,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:[z(Es)],fixable:"code"},defaultOptions:[{alwaysCheckFunctionOptionTypes:!0}],create(e,[t]){let{forceCheckOnFCPropTypesWithName:r,alwaysCheckFunctionOptionTypes:n=!0}=t;r&&!dn&&(dn=r.map(c=>new RegExp(c)));function o(c,a,u,f,y=!0,x=!1){let m=u.name,E=e.sourceCode.getScope(a).references.find(T=>T.identifier.name===m)?.resolved,C=c&&dn?.some(T=>T.test(m)),S=x&&n;if(!E||!C&&E.references.filter(T=>T.isTypeReference).length>1||!E.defs[0])return;let I=E.defs[0].node,A=I.parent?.type===oe.AST_NODE_TYPES.ExportNamedDeclaration;if(!(y&&A&&!S)){if(I.type===oe.AST_NODE_TYPES.TSTypeAliasDeclaration){s(c,a,f,I.typeAnnotation,!0,x);return}if(I.type===oe.AST_NODE_TYPES.TSInterfaceDeclaration){s(c,a,f,I.body,!0,x);return}}}function s(c,a,u,f,y,x=!1){if(f.type===oe.AST_NODE_TYPES.TSInterfaceBody){for(let m of f.body)m.type===oe.AST_NODE_TYPES.TSPropertySignature&&m.key.type===oe.AST_NODE_TYPES.Identifier&&u.set(m.key.name,m);return}if(f.type===oe.AST_NODE_TYPES.TSTypeLiteral){Or(u,...Pr(f));return}if(f.type===oe.AST_NODE_TYPES.TSIntersectionType){for(let m of f.types)s(c,a,u,m,!0,x);return}y||f.type===oe.AST_NODE_TYPES.TSTypeReference&&f.typeName.type===oe.AST_NODE_TYPES.Identifier&&o(c,a,f.typeName,u,!0,x)}function i(c,a,u,f=!1){for(let y of u)if(y.type===oe.AST_NODE_TYPES.ObjectPattern&&y.typeAnnotation){let x=new Map;if(s(c,a,x,y.typeAnnotation.typeAnnotation,!1,f),x.size===0)continue;l(y,x)}else y.type===oe.AST_NODE_TYPES.AssignmentPattern&&y.left.type===oe.AST_NODE_TYPES.ObjectPattern&&i(c,a,[y.left],f)}function l(c,a){let u=[];if(c.properties.at(-1)?.type===oe.AST_NODE_TYPES.RestElement)return;for(let m of c.properties)m.type===oe.AST_NODE_TYPES.Property&&m.key.type===oe.AST_NODE_TYPES.Identifier&&u.push(m.key.name);let y=[],x=[];for(let[m,E]of a)u.includes(m)||(x.push(m),y.push({node:E,messageId:"unusedObjectTypeProperty",data:{propertyName:m}}));for(let[m,E]of y.entries())e.report({...E,fix:m===y.length-1?C=>{let S=c.properties.at(-1),I=x.join(", ");return S?S.type===oe.AST_NODE_TYPES.RestElement?null:C.insertTextAfter(S,`, ${I}`):C.insertTextBeforeRange([c.range[0]+1,c.range[1]],I)}:void 0})}return{VariableDeclaration(c){let a=c.declarations[0],u=new Map,f=a.id.type===oe.AST_NODE_TYPES.Identifier&&a.id.typeAnnotation?.typeAnnotation.type===oe.AST_NODE_TYPES.TSTypeReference&&a.id.typeAnnotation.typeAnnotation.typeName.type===oe.AST_NODE_TYPES.Identifier&&a.id.typeAnnotation.typeAnnotation.typeName.name==="FC"&&a.id.typeAnnotation.typeAnnotation.typeArguments?.params[0];if(f){if(f.type===oe.AST_NODE_TYPES.TSTypeReference&&f.typeName.type===oe.AST_NODE_TYPES.Identifier)o(!0,c,f.typeName,u,!1);else if(f.type===oe.AST_NODE_TYPES.TSTypeLiteral)Or(u,...Pr(f));else if(f.type===oe.AST_NODE_TYPES.TSIntersectionType)for(let y of f.types)y.type===oe.AST_NODE_TYPES.TSTypeReference&&y.typeName.type===oe.AST_NODE_TYPES.Identifier?o(!0,c,y.typeName,u,!1):s(!0,c,u,y,!0);if(u.size!==0&&a.init?.type===oe.AST_NODE_TYPES.ArrowFunctionExpression){let y=a.init.params[0];if(!y){e.report({node:a.init,messageId:"missingComponentParam"});return}y.type===oe.AST_NODE_TYPES.ObjectPattern&&l(y,u)}}},FunctionDeclaration(c){i(!1,c,c.params,n)},ArrowFunctionExpression(c){i(!1,c,c.params,n)}}}}),gn={name:Nr,rule:bs};var Oe=require("@typescript-eslint/utils");var Sn=X({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===Oe.AST_NODE_TYPES.Identifier?t.has(n.callee.name):n.callee.type===Oe.AST_NODE_TYPES.MemberExpression&&n.callee.object.type===Oe.AST_NODE_TYPES.Identifier&&n.callee.property.type===Oe.AST_NODE_TYPES.Identifier?n.callee.property.name==="useRef":!1}return{ImportDeclaration(n){if(n.source.value==="react")for(let o of n.specifiers)o.type===Oe.AST_NODE_TYPES.ImportSpecifier&&o.imported.type===Oe.AST_NODE_TYPES.Identifier&&o.imported.name==="useRef"&&t.add(o.local.name)},VariableDeclarator(n){if(n.init&&n.init.type===Oe.AST_NODE_TYPES.CallExpression&&r(n.init)&&n.id.type===Oe.AST_NODE_TYPES.Identifier){let s=e.sourceCode.getScope(n).set.get(n.id.name);if(s){let i=!1;for(let l of s.references){let a=l.identifier.parent;if(a!==n&&!(a.type===Oe.AST_NODE_TYPES.JSXExpressionContainer&&a.parent.type===Oe.AST_NODE_TYPES.JSXAttribute&&a.parent.name.type===Oe.AST_NODE_TYPES.JSXIdentifier&&a.parent.name.name==="ref")){i=!0;break}}i||e.report({node:n.id,messageId:"refNotRead",data:{name:n.id.name}})}}}}}});var ot=require("@typescript-eslint/utils"),xs=ot.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),jr="prefer-named-functions",Dr=new Map,Cs=xs({name:jr,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===ot.AST_NODE_TYPES.ArrowFunctionExpression&&n.id.type===ot.AST_NODE_TYPES.Identifier){let o=n.id.name;if(n.id.typeAnnotation||r&&r.test(o)||!t.disallowArrowFnWithImplicitReturns&&n.init.body.type!==ot.AST_NODE_TYPES.BlockStatement)return;let s=n.parent,i=n.init.params,l=n.init.body,c=n.init;e.report({node:n.id,messageId:r?"withIgnoreRegex":"default",data:{functionName:o,ignoreRegex:t.ignoreRegex},suggest:[{messageId:"suggestion",fix:a=>a.replaceText(s,`${c.async?"async ":""}function ${o}(${i.map(u=>e.sourceCode.getText(u)).join(", ")||""}) ${e.sourceCode.getText(l)}`)}]})}}}}}),Tn={name:jr,rule:Cs};var K=require("@typescript-eslint/utils"),Me=require("zod/v4");var Is=Me.z.object({disallowedFunctions:Me.z.array(Me.z.object({name:Me.z.string(),allowUsingWithArgs:Me.z.boolean().optional(),hookAlternative:Me.z.string().optional(),message:Me.z.string().optional(),allowUseInside:Me.z.array(Me.z.string()).optional()}))}),As=/^use[A-Z]/,ws=/^[A-Z]/;function wt(e){return As.test(e)}function Lr(e){return ws.test(e)}function Fs(e){return e.type===K.AST_NODE_TYPES.Identifier?wt(e.name):e.type===K.AST_NODE_TYPES.MemberExpression&&e.property.type===K.AST_NODE_TYPES.Identifier?wt(e.property.name):!1}function Mr(e,t){return e.type===K.AST_NODE_TYPES.Identifier?e.name===t:e.type===K.AST_NODE_TYPES.MemberExpression&&e.object.type===K.AST_NODE_TYPES.Identifier&&e.property.type===K.AST_NODE_TYPES.Identifier?e.object.name==="React"&&e.property.name===t:!1}function _r(e){return!!(e.parent&&e.parent.type===K.AST_NODE_TYPES.CallExpression&&Mr(e.parent.callee,"forwardRef"))}function $r(e){return!!(e.parent&&e.parent.type===K.AST_NODE_TYPES.CallExpression&&Mr(e.parent.callee,"memo"))}function hn(e){if(e.type===K.AST_NODE_TYPES.FunctionDeclaration||e.type===K.AST_NODE_TYPES.FunctionExpression&&e.id)return e.id||void 0;if(e.type===K.AST_NODE_TYPES.FunctionExpression||e.type===K.AST_NODE_TYPES.ArrowFunctionExpression){if(e.parent.type===K.AST_NODE_TYPES.VariableDeclarator&&e.parent.init===e)return e.parent.id;if(e.parent.type===K.AST_NODE_TYPES.AssignmentExpression&&e.parent.right===e&&e.parent.operator==="=")return e.parent.left;if(e.parent.type===K.AST_NODE_TYPES.Property&&e.parent.value===e&&!e.parent.computed)return e.parent.key;if(e.parent.type===K.AST_NODE_TYPES.AssignmentPattern&&e.parent.right===e)return e.parent.left}}function Rs(e){let t=e.parent,r=!1;for(;t;){if(t.type===K.AST_NODE_TYPES.FunctionDeclaration||t.type===K.AST_NODE_TYPES.FunctionExpression||t.type===K.AST_NODE_TYPES.ArrowFunctionExpression){let n=hn(t);if(n&&n.type===K.AST_NODE_TYPES.Identifier){if(Lr(n.name)||wt(n.name))return!r;r=!0}else{if(_r(t)||$r(t))return!r;if(t.parent.type===K.AST_NODE_TYPES.CallExpression){let o=t.parent;Fs(o.callee)||(r=!0)}else t.parent.type===K.AST_NODE_TYPES.JSXExpressionContainer||(r=!0)}}t=t.parent}return!1}function Ur(e){return e.callee.type===K.AST_NODE_TYPES.Identifier?e.callee.name:e.callee.type===K.AST_NODE_TYPES.MemberExpression&&e.callee.property.type===K.AST_NODE_TYPES.Identifier?e.callee.property.name:null}function vs(e,t){if(!t.length)return!1;let r=e.parent;for(;r;){if(r.type===K.AST_NODE_TYPES.FunctionDeclaration||r.type===K.AST_NODE_TYPES.FunctionExpression||r.type===K.AST_NODE_TYPES.ArrowFunctionExpression){let n=hn(r);if(n&&n.type===K.AST_NODE_TYPES.Identifier&&t.includes(n.name))return!0}else if(r.type===K.AST_NODE_TYPES.CallExpression){let n=Ur(r);if(n&&t.includes(n))return!0}r=r.parent}return!1}function ks(e){return e.arguments.length>0&&!e.arguments.every(t=>t.type===K.AST_NODE_TYPES.Identifier&&t.name==="undefined")}function Ps(e,t){let r=!1,n=e.parent;for(;n;){if(n.type===K.AST_NODE_TYPES.FunctionDeclaration||n.type===K.AST_NODE_TYPES.FunctionExpression||n.type===K.AST_NODE_TYPES.ArrowFunctionExpression){let o=hn(n);if(o&&o.type===K.AST_NODE_TYPES.Identifier){if(Lr(o.name)||wt(o.name)){r=!0;break}}else if(_r(n)||$r(n)){r=!0;break}}n=n.parent}return r?t.length===0?Rs(e):!vs(e,t):!1}var En=X({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:[z(Is)],hasSuggestions:!0},defaultOptions:[{disallowedFunctions:[]}],create(e,[t]){let{disallowedFunctions:r}=t,n=new Map(r.map(o=>[o.name,o]));return{CallExpression(o){let s=Ur(o);if(!s)return;let i=n.get(s);if(!i||i.allowUsingWithArgs&&ks(o))return;let l=i.allowUseInside||[];Ps(o,l)&&e.report({node:o,messageId:"preferHookAlternative",data:{message:i.message?` ${i.message}`:` use ${i.hookAlternative} instead`},suggest:i.hookAlternative?[{messageId:"preferHookAlternative",data:{message:`Replace with ${i.hookAlternative}`,hookAlternative:i.hookAlternative},fix:c=>{let a=i.hookAlternative;return a?o.callee.type===K.AST_NODE_TYPES.Identifier?c.replaceText(o.callee,a):o.callee.type===K.AST_NODE_TYPES.MemberExpression&&o.callee.property.type===K.AST_NODE_TYPES.Identifier?c.replaceText(o.callee.property,a):null:null}}]:[]})}}}});var ce=require("@typescript-eslint/utils"),Ft=Pe(require("zod/v4"));var Os=ce.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),Wr="prefer-single-line-if",Ns=Ft.default.object({maxLineLength:Ft.default.number().optional(),maxNonSimpleConditionLength:Ft.default.number().optional()}),Ds=Os({name:Wr,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:[z(Ns)]},defaultOptions:[{}],create(e,[t]){let r=e.sourceCode;return{IfStatement(n){if(n.consequent.type!==ce.AST_NODE_TYPES.BlockStatement||n.loc.start.line===n.loc.end.line||r.getCommentsInside(n.consequent).length>0||n.alternate||n.consequent.body.length!==1)return;let s=n.consequent.body[0];if(!s)return;if(s.type===ce.AST_NODE_TYPES.ReturnStatement){if(!Vr(s))return}else if(!(s.type===ce.AST_NODE_TYPES.ContinueStatement||s.type===ce.AST_NODE_TYPES.BreakStatement))return;if(n.test.type===ce.AST_NODE_TYPES.LogicalExpression||n.test.type===ce.AST_NODE_TYPES.ConditionalExpression)return;let i;if(t.maxNonSimpleConditionLength){let f=zr(n.test);if(!f&&n.test.type===ce.AST_NODE_TYPES.UnaryExpression&&n.test.operator==="!"){let y=n.test.argument;zr(y)&&(f=!0)}if(f&&(i=r.getText(n.test),i.length>t.maxNonSimpleConditionLength))return}i||(i=r.getText(n.test));let l=r.getText(s);if(i.includes(`
18
- `))return;let c=r.getTokenAfter(n);if(c&&c.type===ce.AST_TOKEN_TYPES.Punctuator&&c.value==="}"){let f=r.getTokenAfter(c);if(f&&f.type===ce.AST_TOKEN_TYPES.Keyword&&(f.value==="else"||f.value==="catch"))return}let a=js(r,n),u=`if (${i}) ${l}`;t.maxLineLength&&u.length+a.length>t.maxLineLength||e.report({node:n,messageId:"noSingleLineCurly",fix:f=>f.replaceText(n,u)})}}}});function zr(e){return e.type===ce.AST_NODE_TYPES.CallExpression||e.type===ce.AST_NODE_TYPES.BinaryExpression||e.type===ce.AST_NODE_TYPES.MemberExpression&&Jr(e)}function Jr(e){return e.object.type===ce.AST_NODE_TYPES.MemberExpression?Jr(e.object):e.object.type!==ce.AST_NODE_TYPES.Identifier}function js(e,t){return e.text.slice(t.range[0]-t.loc.start.column,t.range[0])}function Vr(e){if(!e.argument)return!0;let t=e.argument;return t.type===ce.AST_NODE_TYPES.ArrayExpression&&t.elements.length===0||t.type===ce.AST_NODE_TYPES.ObjectExpression&&t.properties.length===0||t.type===ce.AST_NODE_TYPES.Literal||t.type===ce.AST_NODE_TYPES.Identifier||t.type===ce.AST_NODE_TYPES.TemplateLiteral||t.type===ce.AST_NODE_TYPES.TaggedTemplateExpression?!0:t.type===ce.AST_NODE_TYPES.CallExpression?t.arguments.length===0:t.type===ce.AST_NODE_TYPES.UnaryExpression?Vr(t):!1}var bn={name:Wr,rule:Ds};var U=require("@typescript-eslint/utils"),Cn=require("zod/v4");var Ls=U.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),Yr="react-compiler-extra",Ms=Cn.z.object({runOnlyWithEnableCompilerDirective:Cn.z.boolean().optional()}),_s=/eslint +react-compiler\/react-compiler: +\["error/;function qr(e){return e.type===U.AST_NODE_TYPES.Identifier?e.name.startsWith("use"):!1}function $s(e){return e.type===U.AST_NODE_TYPES.Identifier?e.name.startsWith("use"):e.type===U.AST_NODE_TYPES.MemberExpression&&e.property.type===U.AST_NODE_TYPES.Identifier?e.property.name.startsWith("use"):!1}function _e(e){if(!e)return!1;switch(e.type){case U.AST_NODE_TYPES.JSXElement:case U.AST_NODE_TYPES.JSXFragment:return!0;case U.AST_NODE_TYPES.ConditionalExpression:return _e(e.consequent)||_e(e.alternate);case U.AST_NODE_TYPES.LogicalExpression:return e.operator==="&&"?_e(e.right):e.operator==="||"?_e(e.left)||_e(e.right):!1;case U.AST_NODE_TYPES.CallExpression:if(e.callee.type===U.AST_NODE_TYPES.MemberExpression&&e.callee.object.type===U.AST_NODE_TYPES.Identifier&&e.callee.object.name==="React"&&e.callee.property.type===U.AST_NODE_TYPES.Identifier&&e.callee.property.name==="createElement")return!0;for(let t of e.arguments)if(t.type!==U.AST_NODE_TYPES.SpreadElement&&_e(t))return!0;return!1;default:return!1}}function Us(e){let t=e.typeAnnotation;if(t.type===U.AST_NODE_TYPES.TSTypeReference){if(t.typeName.type===U.AST_NODE_TYPES.Identifier)return t.typeName.name==="FC";if(t.typeName.type===U.AST_NODE_TYPES.TSQualifiedName&&t.typeName.left.type===U.AST_NODE_TYPES.Identifier&&t.typeName.right.type===U.AST_NODE_TYPES.Identifier)return t.typeName.left.name==="React"&&t.typeName.right.name==="FC"}return!1}var zs=/^[A-Z][a-zA-Z0-9]*$/;function gt(e){return zs.test(e)}function In(e){return e.startsWith("use")&&e.length>3}function An(e,t,r,n){if(r&&Us(r))return t?gt(t.name):e.type===U.AST_NODE_TYPES.FunctionDeclaration&&e.id?gt(e.id.name):!0;if(t&&In(t.name)||e.type===U.AST_NODE_TYPES.FunctionDeclaration&&e.id&&In(e.id.name))return!0;if(n){let o=t?.name||e.type===U.AST_NODE_TYPES.FunctionDeclaration&&e.id?.name;if(o&&gt(o)&&Zr(e.body,n).containsJSX)return!0}return!1}function dt(e){if(e.body.type===U.AST_NODE_TYPES.BlockStatement){for(let t of e.body.body)if(t.type===U.AST_NODE_TYPES.ExpressionStatement&&t.expression.type===U.AST_NODE_TYPES.Literal&&typeof t.expression.value=="string"&&t.expression.value==="use memo")return!0}return!1}function Zr(e,t){let r={containsJSX:!1,containsHookCalls:!1};return je(e,n=>{if(r.containsJSX&&r.containsHookCalls)return!0;switch(n.type){case U.AST_NODE_TYPES.JSXElement:case U.AST_NODE_TYPES.JSXFragment:r.containsJSX=!0;break;case U.AST_NODE_TYPES.CallExpression:qr(n.callee)&&(r.containsHookCalls=!0),_e(n)&&(r.containsJSX=!0);break;case U.AST_NODE_TYPES.ReturnStatement:n.argument&&_e(n.argument)&&(r.containsJSX=!0);break;case U.AST_NODE_TYPES.VariableDeclarator:n.init&&_e(n.init)&&(r.containsJSX=!0);break;case U.AST_NODE_TYPES.AssignmentExpression:_e(n.right)&&(r.containsJSX=!0);break}},t),r}function Xr(e,t){let r=e.body,n=Zr(r,t);return n.containsJSX||n.containsHookCalls}var Ws=/\bthis[.[]/;function Br(e){return Ws.test(e)}function Js(e,t){let r={containsJSX:!1,containsHookCalls:!1};return je(e,n=>{if(r.containsHookCalls||(n.type===U.AST_NODE_TYPES.FunctionDeclaration||n.type===U.AST_NODE_TYPES.FunctionExpression||n.type===U.AST_NODE_TYPES.ArrowFunctionExpression)&&n!==e)return!0;n.type===U.AST_NODE_TYPES.CallExpression&&$s(n.callee)&&(r.containsHookCalls=!0)},t),r}function Hr(e){return gt(e)||In(e)}function xn(e,t,r,n){if(!Js(e.body,t).containsHookCalls)return!1;let s=An(e,r,n,t);if(!s&&n){let i=r?.name||e.type===U.AST_NODE_TYPES.FunctionDeclaration&&e.id?.name;i&&gt(i)&&(s=!0)}return!s}var Vs=Ls({name:Yr,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:[z(Ms)]},defaultOptions:[{}],create(e,[t]){let r=!1;if(t.runOnlyWithEnableCompilerDirective){for(let s of e.sourceCode.getAllComments())if(_s.test(s.value)){r=!0;break}if(!r)return{}}function n(s){for(let i of s.properties)if(i.type===U.AST_NODE_TYPES.Property&&i.method&&i.value.type===U.AST_NODE_TYPES.FunctionExpression){let l=e.sourceCode,c=l.getText(i.key),a=i.value,u=l.getText(a.body);if(Br(u))e.report({node:i,messageId:"thisKeywordInMethod"});else{let f=a.params.map(x=>l.getText(x)).join(", "),y="";a.generator?y=`${c}: function* (${f}) ${u}`:y=`${c}: (${f}) => ${u}`,e.report({node:i,messageId:"objectMethodIsNotSupported",fix:x=>x.replaceText(i,y)})}}}function o(s){for(let i of s.properties)if(i.type===U.AST_NODE_TYPES.Property&&i.value.type===U.AST_NODE_TYPES.ObjectExpression){for(let l of i.value.properties)if(l.type===U.AST_NODE_TYPES.Property&&l.method&&l.value.type===U.AST_NODE_TYPES.FunctionExpression){let a=e.sourceCode.getText(l.value.body);Br(a)&&e.report({node:l,messageId:"thisKeywordInMethod"})}}}return{CallExpression(s){if(qr(s.callee))for(let i of s.arguments){if(i.type===U.AST_NODE_TYPES.ObjectExpression&&(n(i),o(i)),i.type===U.AST_NODE_TYPES.ArrowFunctionExpression&&(i.body.type===U.AST_NODE_TYPES.ObjectExpression&&(n(i.body),o(i.body)),i.body.type===U.AST_NODE_TYPES.BlockStatement))for(let l of i.body.body)l.type===U.AST_NODE_TYPES.ReturnStatement&&l.argument?.type===U.AST_NODE_TYPES.ObjectExpression&&(n(l.argument),o(l.argument));if(i.type===U.AST_NODE_TYPES.FunctionExpression)for(let l of i.body.body)l.type===U.AST_NODE_TYPES.ReturnStatement&&l.argument?.type===U.AST_NODE_TYPES.ObjectExpression&&(n(l.argument),o(l.argument))}},VariableDeclarator(s){if(s.id.type===U.AST_NODE_TYPES.Identifier&&s.init&&(s.init.type===U.AST_NODE_TYPES.ArrowFunctionExpression||s.init.type===U.AST_NODE_TYPES.FunctionExpression)){let i=s.init,l=s.id,c=s.id.typeAnnotation;if(dt(i)&&!Hr(l.name)){e.report({node:i,messageId:"useMemoDirectiveNaming"});return}if(xn(i,e.sourceCode,l,c)){e.report({node:i,messageId:"functionCallingHooksMustBeComponent"});return}if(An(i,l,c,e.sourceCode)){let a=Xr(i,e.sourceCode),u=dt(i);!a&&!u&&e.report({node:i,messageId:"fcComponentShouldReturnJsx",suggest:[{messageId:"addUseMemoDirective",fix(f){if(i.body.type===U.AST_NODE_TYPES.BlockStatement){let y=i.body.range[0]+1;return f.insertTextAfterRange([y,y],`
17
+ `)}return""}return{Program(){let c=[];for(let y of n.body)y.type===Fe.AST_NODE_TYPES.ExpressionStatement&&y.expression.type===Fe.AST_NODE_TYPES.CallExpression&&y.expression.callee.type===Fe.AST_NODE_TYPES.Identifier&&y.expression.callee.name==="describe"&&y.expression.arguments.length===2&&c.push(y.expression);if(!i(c))return;let[a]=c;if(!a)return;let u=o(a);if(s(u))return;let f=n.body.find(y=>y.type===Fe.AST_NODE_TYPES.ExpressionStatement&&y.expression===a);!f||f.type!==Fe.AST_NODE_TYPES.ExpressionStatement||e.report({node:a,messageId:"unnecessaryDescribe",suggest:[{messageId:"removeDescribe",fix(y){let x=l(a);return x?y.replaceText(f,x):null}}]})}}}});var mt=require("@typescript-eslint/utils"),Le=Pe(require("zod/v4"));var ms=Le.object({methods:Le.union([Le.array(Le.string()),Le.literal("array")])}),pn=X({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(ms)]},defaultOptions:[{methods:"array"}],create(e,[t]){let r=t.methods,n=new Set(["find","filter","map","forEach","some","every","reduce","findIndex","sort"]);function o(l){return Array.isArray(r)?r.includes(l):n.has(l)}function s(l){let{callee:c}=l;if(c.type===mt.AST_NODE_TYPES.MemberExpression){let a=c.property;if(a.type===mt.AST_NODE_TYPES.Identifier)return a.name}return null}function i(l,c){if(l.type!==mt.AST_NODE_TYPES.Identifier||!l.typeAnnotation)return;let a=c.parent;if(a.type===mt.AST_NODE_TYPES.CallExpression){let u=s(a);u&&o(u)&&a.arguments.indexOf(c)===0&&e.report({node:l.typeAnnotation,messageId:"unnecessaryTypeAnnotation",fix(y){return l.typeAnnotation?y.remove(l.typeAnnotation):null}})}}return{ArrowFunctionExpression(l){for(let c of l.params)i(c,l)},FunctionExpression(l){for(let c of l.params)i(c,l)}}}});var Ae=require("@typescript-eslint/utils");var cn=X({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===Ae.AST_NODE_TYPES.ObjectPattern||!t.init||t.init.type!==Ae.AST_NODE_TYPES.ObjectExpression||t.id.type===Ae.AST_NODE_TYPES.Identifier&&t.id.typeAnnotation||t.parent.parent.type===Ae.AST_NODE_TYPES.ExportNamedDeclaration)return;let r=new Map;for(let i of t.init.properties)i.type===Ae.AST_NODE_TYPES.Property&&i.key.type===Ae.AST_NODE_TYPES.Identifier&&r.set(i.key.name,i);if(r.size===0||t.id.type!==Ae.AST_NODE_TYPES.Identifier)return;let n=ys(t,e.sourceCode);if(n.length===0)return;let o=t.init.properties.some(i=>i.type!==Ae.AST_NODE_TYPES.Property?!1:i.value.type===Ae.AST_NODE_TYPES.FunctionExpression),s=new Set;for(let i of n){if(i.identifier.parent.type!==Ae.AST_NODE_TYPES.MemberExpression)return;let l=i.identifier.parent;if(l.object!==i.identifier)return;if(l.computed)if(l.property.type===Ae.AST_NODE_TYPES.Literal&&typeof l.property.value=="string")s.add(l.property.value);else return;else{if(l.property.type!==Ae.AST_NODE_TYPES.Identifier)return;s.add(l.property.name)}if(l.parent.type===Ae.AST_NODE_TYPES.CallExpression&&o)return}for(let[i,l]of r)s.has(i)||e.report({node:l,messageId:"unusedObjectProperty",data:{name:i}})}}}});function ys(e,t){let r=t.getDeclaredVariables(e);if(r.length!==1)return[];let n=r[0];return n?n.references.filter(o=>o.identifier!==e.id):[]}var te=require("@typescript-eslint/utils"),un=require("zod/v4");var ds=un.z.object({ignoreArgsMatching:un.z.string().optional()}),fn=X({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(ds)]},defaultOptions:[{}],create(e,[t]){let r=[];function n(i){return t.ignoreArgsMatching?new RegExp(t.ignoreArgsMatching).test(i):!1}function o(i){return i.type===te.AST_NODE_TYPES.ExportNamedDeclaration||i.type===te.AST_NODE_TYPES.ExportDefaultDeclaration||i.parent?.type===te.AST_NODE_TYPES.ExportNamedDeclaration||i.parent?.type===te.AST_NODE_TYPES.ExportDefaultDeclaration}function s(i){let l=[];for(let c=0;c<i.length;c++){let a=i[c];if(!a||a.type!==te.AST_NODE_TYPES.Identifier)continue;let u=a.name;if(!n(u)){if(a.optional&&a.typeAnnotation&&a.typeAnnotation.typeAnnotation.type===te.AST_NODE_TYPES.TSTypeLiteral){let f=a.typeAnnotation.typeAnnotation,y=[];for(let x of f.members)x.type===te.AST_NODE_TYPES.TSPropertySignature&&x.key.type===te.AST_NODE_TYPES.Identifier&&y.push({name:x.key.name,optional:x.optional===!0});y.some(x=>x.optional)?l.push({param:a,index:c,name:u,isObjectParam:!0,objectProps:y}):l.push({param:a,index:c,name:u,isObjectParam:!1})}else if(a.optional)l.push({param:a,index:c,name:u,isObjectParam:!1});else if(a.typeAnnotation&&a.typeAnnotation.typeAnnotation.type===te.AST_NODE_TYPES.TSTypeLiteral){let f=a.typeAnnotation.typeAnnotation,y=[];for(let x of f.members)x.type===te.AST_NODE_TYPES.TSPropertySignature&&x.key.type===te.AST_NODE_TYPES.Identifier&&y.push({name:x.key.name,optional:x.optional===!0});y.some(x=>x.optional)&&l.push({param:a,index:c,name:u,isObjectParam:!0,objectProps:y})}}}return l}return{FunctionDeclaration(i){if(o(i))return;let l=s(i.params);l.length!==0&&r.push({node:i,declarationNode:i,optionalParams:l})},VariableDeclarator(i){if(i.id.type!==te.AST_NODE_TYPES.Identifier||!i.init||i.init.type!==te.AST_NODE_TYPES.ArrowFunctionExpression&&i.init.type!==te.AST_NODE_TYPES.FunctionExpression||o(i.parent.parent))return;let c=[...s(i.init.params)];if(i.id.typeAnnotation&&i.id.typeAnnotation.typeAnnotation.type===te.AST_NODE_TYPES.TSTypeReference){let a=i.id.typeAnnotation.typeAnnotation;if(a.typeName.type===te.AST_NODE_TYPES.Identifier&&a.typeName.name==="FC"){let u=a.typeArguments;if(u&&u.params.length===1){let f=u.params[0];if(f&&f.type===te.AST_NODE_TYPES.TSTypeLiteral){let y=[];for(let x of f.members)x.type===te.AST_NODE_TYPES.TSPropertySignature&&x.key.type===te.AST_NODE_TYPES.Identifier&&y.push({name:x.key.name,optional:x.optional===!0});y.some(x=>x.optional)&&c.push({param:i.id,index:0,name:"props",isObjectParam:!0,objectProps:y})}}}}c.length!==0&&r.push({node:i.init,declarationNode:i,optionalParams:c})},"Program:exit"(){for(let i of r){let c=e.sourceCode.getDeclaredVariables(i.declarationNode)[0];if(!c)continue;let a=c.references.filter(y=>y.identifier!==c.identifiers[0]);if(a.length===0)continue;let u=!1;for(let y of a){let x=y.identifier.parent;if(x.type===te.AST_NODE_TYPES.CallExpression&&y.identifier.type===te.AST_NODE_TYPES.Identifier&&x.arguments.includes(y.identifier)){u=!0;break}if(x.type===te.AST_NODE_TYPES.ReturnStatement){u=!0;break}if(x.type===te.AST_NODE_TYPES.Property&&x.parent.type===te.AST_NODE_TYPES.ObjectExpression&&x.parent.parent.type===te.AST_NODE_TYPES.ReturnStatement){u=!0;break}if(x.type===te.AST_NODE_TYPES.JSXExpressionContainer){u=!0;break}}if(u)continue;let f=[];for(let y of a){let x=y.identifier.parent;if(x.type===te.AST_NODE_TYPES.CallExpression&&x.callee===y.identifier){let m=x.arguments.length,E=x.arguments.some(T=>T.type===te.AST_NODE_TYPES.SpreadElement);if(E){u=!0;break}let C={argCount:m,hasSpread:E};for(let T of i.optionalParams)if(T.isObjectParam&&T.index<m){let I=x.arguments[T.index];if(I?.type===te.AST_NODE_TYPES.ObjectExpression){let A={};for(let S of I.properties)S.type===te.AST_NODE_TYPES.Property&&S.key.type===te.AST_NODE_TYPES.Identifier&&(A[S.key.name]=!0);C.objectArgs||(C.objectArgs=[]),C.objectArgs[T.index]=A}else if(I){u=!0;break}}f.push(C)}else if(x.type===te.AST_NODE_TYPES.JSXOpeningElement&&x.name===y.identifier){let m=x.attributes.some(C=>C.type===te.AST_NODE_TYPES.JSXSpreadAttribute);if(m){u=!0;break}let E={argCount:1,hasSpread:m};for(let C of i.optionalParams)if(C.isObjectParam&&C.index===0){let T={};for(let I of x.attributes)I.type===te.AST_NODE_TYPES.JSXAttribute&&I.name.type===te.AST_NODE_TYPES.JSXIdentifier&&(T[I.name.name]=!0);E.objectArgs||(E.objectArgs=[]),E.objectArgs[0]=T}f.push(E)}}if(!(u||f.length===0))for(let y of i.optionalParams)if(y.isObjectParam&&y.objectProps)for(let x of y.objectProps){if(!x.optional)continue;let m=!1;for(let E of f)if(E.objectArgs&&E.objectArgs[y.index]){let C=E.objectArgs[y.index];if(C&&C[x.name]){m=!0;break}}m||e.report({node:y.param,messageId:"unusedOptionalProp",data:{name:x.name}})}else{let x=!1;for(let m of f)if(m.argCount>y.index){x=!0;break}x||e.report({node:y.param,messageId:"unusedOptionalArg",data:{name:y.name}})}}}}}});var le=require("@typescript-eslint/utils"),qe=require("zod/v4");var gs=qe.z.object({selectors:qe.z.array(qe.z.object({name:qe.z.string(),selectorProp:qe.z.string().optional(),selectorArgPos:qe.z.number().optional(),returnProp:qe.z.string().optional()}))}),Ss=le.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),vr="no-unused-selected-values",mn={name:vr,rule:Ss({name:vr,meta:{type:"suggestion",docs:{description:"Disallow unused values in selector objects"},messages:{unusedSelectedValue:'The selected value "{{name}}" is not being used'},schema:[J(gs)]},defaultOptions:[{selectors:[]}],create(e,[t]){let{selectors:r=[]}=t,n=new Map(r.map(o=>[o.name,o]));return{VariableDeclarator(o){let s=null;if(o.init?.type===le.AST_NODE_TYPES.CallExpression&&(s=o.init),!s)return;let i=hs(s);if(!i)return;let l=n.get(i);if(!l)return;let c=Ts(s,l.selectorArgPos??0,l.selectorProp);if(!c)return;let a=Es(c);if(!a)return;let u=kr(a.properties,void 0);if(!u)return;if(o.id.type===le.AST_NODE_TYPES.ObjectPattern){let x=kr(o.id.properties,l.returnProp);if(!x)return;for(let[m,E]of u)x.has(m)||e.report({node:E,messageId:"unusedSelectedValue",data:{name:m}});return}if(o.id.type!==le.AST_NODE_TYPES.Identifier||l.returnProp)return;let f=bs(o,e.sourceCode);if(f.length===0)return;let y=new Set;for(let x of f){if(x.identifier.parent.type!==le.AST_NODE_TYPES.MemberExpression)return;let m=x.identifier.parent.property;if(m.type!==le.AST_NODE_TYPES.Identifier)return;y.add(m.name)}for(let[x,m]of u)y.has(x)||e.report({node:m,messageId:"unusedSelectedValue",data:{name:x}})}}}})};function Ts(e,t,r){let n=e.arguments[t];if(!n)return null;if(n.type===le.AST_NODE_TYPES.ArrowFunctionExpression||n.type===le.AST_NODE_TYPES.FunctionExpression)return n;if(r&&n.type===le.AST_NODE_TYPES.ObjectExpression){let o=n.properties.find(i=>i.type===le.AST_NODE_TYPES.Property&&i.key.type===le.AST_NODE_TYPES.Identifier&&i.key.name===r);if(o?.type!==le.AST_NODE_TYPES.Property)return null;let s=o.value;if(s.type===le.AST_NODE_TYPES.ArrowFunctionExpression||s.type===le.AST_NODE_TYPES.FunctionExpression)return s}return null}function hs(e){return e.callee.type===le.AST_NODE_TYPES.Identifier?e.callee.name:e.callee.type===le.AST_NODE_TYPES.MemberExpression&&e.callee.property.type===le.AST_NODE_TYPES.Identifier?e.callee.property.name:null}function Es(e){if(e.body.type===le.AST_NODE_TYPES.ObjectExpression)return e.body;if(e.body.type===le.AST_NODE_TYPES.BlockStatement){let t=e.body.body.filter(r=>r.type===le.AST_NODE_TYPES.ReturnStatement);return t.length!==1||!t[0]||t[0].argument?.type!==le.AST_NODE_TYPES.ObjectExpression?null:t[0].argument}return null}function kr(e,t){let r=e;if(t){let o=e.find(s=>s.type===le.AST_NODE_TYPES.Property&&s.key.type===le.AST_NODE_TYPES.Identifier&&s.key.name===t);if(o?.type!==le.AST_NODE_TYPES.Property||o.value.type!==le.AST_NODE_TYPES.ObjectPattern)return null;r=o.value.properties}let n=new Map;for(let o of r){if(o.type!==le.AST_NODE_TYPES.Property||o.key.type!==le.AST_NODE_TYPES.Identifier)return null;n.set(o.key.name,o)}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(o=>o.identifier!==e.id):[]}var pe=require("@typescript-eslint/utils");var yn=X({name:"no-unused-t-state-field",meta:{type:"suggestion",docs:{description:"Prevent declaring unused t-state fields"},messages:{unusedField:'Field "{{name}}" is not being used, you can safely remove it'},schema:[]},defaultOptions:[],create(e){if(!(e.filename.endsWith(".jsx")||e.filename.endsWith(".tsx")))return{};if(!e.sourceCode.ast.body.some(s=>s.type===pe.AST_NODE_TYPES.ImportDeclaration&&s.source.value==="t-state-form"))return{};let n=null,o=!1;return{CallExpression(s){if(o)return;if(!n){let l=xs(s);l&&(n=l);return}let i=Cs(s,e.sourceCode);if(i){o=!0;for(let l of i)n.delete(l);if(n.size!==0)for(let[l,c]of n)e.report({node:c,messageId:"unusedField",data:{name:l}})}}}}});function xs(e){if(!(e.callee.type===pe.AST_NODE_TYPES.Identifier&&e.callee.name==="useForm"))return null;let r=e.arguments[0];if(!r||r.type!==pe.AST_NODE_TYPES.ObjectExpression)return null;let n=Vt(r.properties,s=>s.type!==pe.AST_NODE_TYPES.Property||s.key.type!==pe.AST_NODE_TYPES.Identifier||s.key.name!=="initialConfig"?null:s.value.type===pe.AST_NODE_TYPES.ObjectExpression?s.value:s.value.type===pe.AST_NODE_TYPES.ArrowFunctionExpression||s.value.type===pe.AST_NODE_TYPES.FunctionExpression?Is(s.value):null);if(!n)return null;let o=new Map;for(let s of n.properties)s.type===pe.AST_NODE_TYPES.Property&&s.key.type===pe.AST_NODE_TYPES.Identifier&&o.set(s.key.name,s);return o}function Cs(e,t){if(!(e.callee.type===pe.AST_NODE_TYPES.Identifier&&e.callee.name==="useFormState")||e.parent.type!==pe.AST_NODE_TYPES.VariableDeclarator||e.parent.id.type!==pe.AST_NODE_TYPES.ObjectPattern||!Vt(e.parent.id.properties,i=>i.type===pe.AST_NODE_TYPES.Property&&i.key.type===pe.AST_NODE_TYPES.Identifier&&i.key.name==="formFields"&&i))return null;let o=ur(e.parent,"formFields",t),s=new Set;for(let{identifier:i}of o){if(i.type!==pe.AST_NODE_TYPES.Identifier||i.parent.type===pe.AST_NODE_TYPES.Property&&i.parent.parent.type===pe.AST_NODE_TYPES.ObjectExpression&&i.parent.parent.parent.type===pe.AST_NODE_TYPES.ReturnStatement||i.parent.type===pe.AST_NODE_TYPES.ReturnStatement)return null;if(i.parent.type===pe.AST_NODE_TYPES.MemberExpression){if(i.parent.object.type!==pe.AST_NODE_TYPES.Identifier||i.parent.property.type!==pe.AST_NODE_TYPES.Identifier)return null;s.add(i.parent.property.name)}}return s}function Is(e){if(e.body.type===pe.AST_NODE_TYPES.ObjectExpression)return e.body;if(e.body.type===pe.AST_NODE_TYPES.BlockStatement){let t=e.body.body.filter(r=>r.type===pe.AST_NODE_TYPES.ReturnStatement);return t.length!==1||!t[0]||t[0].argument?.type!==pe.AST_NODE_TYPES.ObjectExpression?null:t[0].argument}return null}var oe=require("@typescript-eslint/utils"),yt=require("zod/v4");var As=oe.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`);function Pr(e){let t=[];for(let r of e.members)r.type===oe.AST_NODE_TYPES.TSPropertySignature&&r.key.type===oe.AST_NODE_TYPES.Identifier&&t.push([r.key.name,r]);return t}function Or(e,...t){for(let r of t)e.set(...r);return e}var ws=yt.z.object({forceCheckOnFCPropTypesWithName:yt.z.array(yt.z.string()).optional(),alwaysCheckFunctionOptionTypes:yt.z.boolean().optional()}),Nr="no-unused-type-props-in-args",dn=null,Fs=As({name:Nr,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(ws)],fixable:"code"},defaultOptions:[{alwaysCheckFunctionOptionTypes:!0}],create(e,[t]){let{forceCheckOnFCPropTypesWithName:r,alwaysCheckFunctionOptionTypes:n=!0}=t;r&&!dn&&(dn=r.map(c=>new RegExp(c)));function o(c,a,u,f,y=!0,x=!1){let m=u.name,E=e.sourceCode.getScope(a).references.find(S=>S.identifier.name===m)?.resolved,C=c&&dn?.some(S=>S.test(m)),T=x&&n;if(!E||!C&&E.references.filter(S=>S.isTypeReference).length>1||!E.defs[0])return;let I=E.defs[0].node,A=I.parent?.type===oe.AST_NODE_TYPES.ExportNamedDeclaration;if(!(y&&A&&!T)){if(I.type===oe.AST_NODE_TYPES.TSTypeAliasDeclaration){s(c,a,f,I.typeAnnotation,!0,x);return}if(I.type===oe.AST_NODE_TYPES.TSInterfaceDeclaration){s(c,a,f,I.body,!0,x);return}}}function s(c,a,u,f,y,x=!1){if(f.type===oe.AST_NODE_TYPES.TSInterfaceBody){for(let m of f.body)m.type===oe.AST_NODE_TYPES.TSPropertySignature&&m.key.type===oe.AST_NODE_TYPES.Identifier&&u.set(m.key.name,m);return}if(f.type===oe.AST_NODE_TYPES.TSTypeLiteral){Or(u,...Pr(f));return}if(f.type===oe.AST_NODE_TYPES.TSIntersectionType){for(let m of f.types)s(c,a,u,m,!0,x);return}y||f.type===oe.AST_NODE_TYPES.TSTypeReference&&f.typeName.type===oe.AST_NODE_TYPES.Identifier&&o(c,a,f.typeName,u,!0,x)}function i(c,a,u,f=!1){for(let y of u)if(y.type===oe.AST_NODE_TYPES.ObjectPattern&&y.typeAnnotation){let x=new Map;if(s(c,a,x,y.typeAnnotation.typeAnnotation,!1,f),x.size===0)continue;l(y,x)}else y.type===oe.AST_NODE_TYPES.AssignmentPattern&&y.left.type===oe.AST_NODE_TYPES.ObjectPattern&&i(c,a,[y.left],f)}function l(c,a){let u=[];if(c.properties.at(-1)?.type===oe.AST_NODE_TYPES.RestElement)return;for(let m of c.properties)m.type===oe.AST_NODE_TYPES.Property&&m.key.type===oe.AST_NODE_TYPES.Identifier&&u.push(m.key.name);let y=[],x=[];for(let[m,E]of a)u.includes(m)||(x.push(m),y.push({node:E,messageId:"unusedObjectTypeProperty",data:{propertyName:m}}));for(let[m,E]of y.entries())e.report({...E,fix:m===y.length-1?C=>{let T=c.properties.at(-1),I=x.join(", ");return T?T.type===oe.AST_NODE_TYPES.RestElement?null:C.insertTextAfter(T,`, ${I}`):C.insertTextBeforeRange([c.range[0]+1,c.range[1]],I)}:void 0})}return{VariableDeclaration(c){let a=c.declarations[0],u=new Map,f=a.id.type===oe.AST_NODE_TYPES.Identifier&&a.id.typeAnnotation?.typeAnnotation.type===oe.AST_NODE_TYPES.TSTypeReference&&a.id.typeAnnotation.typeAnnotation.typeName.type===oe.AST_NODE_TYPES.Identifier&&a.id.typeAnnotation.typeAnnotation.typeName.name==="FC"&&a.id.typeAnnotation.typeAnnotation.typeArguments?.params[0];if(f){if(f.type===oe.AST_NODE_TYPES.TSTypeReference&&f.typeName.type===oe.AST_NODE_TYPES.Identifier)o(!0,c,f.typeName,u,!1);else if(f.type===oe.AST_NODE_TYPES.TSTypeLiteral)Or(u,...Pr(f));else if(f.type===oe.AST_NODE_TYPES.TSIntersectionType)for(let y of f.types)y.type===oe.AST_NODE_TYPES.TSTypeReference&&y.typeName.type===oe.AST_NODE_TYPES.Identifier?o(!0,c,y.typeName,u,!1):s(!0,c,u,y,!0);if(u.size!==0&&a.init?.type===oe.AST_NODE_TYPES.ArrowFunctionExpression){let y=a.init.params[0];if(!y){e.report({node:a.init,messageId:"missingComponentParam"});return}y.type===oe.AST_NODE_TYPES.ObjectPattern&&l(y,u)}}},FunctionDeclaration(c){i(!1,c,c.params,n)},ArrowFunctionExpression(c){i(!1,c,c.params,n)}}}}),gn={name:Nr,rule:Fs};var Oe=require("@typescript-eslint/utils");var Sn=X({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===Oe.AST_NODE_TYPES.Identifier?t.has(n.callee.name):n.callee.type===Oe.AST_NODE_TYPES.MemberExpression&&n.callee.object.type===Oe.AST_NODE_TYPES.Identifier&&n.callee.property.type===Oe.AST_NODE_TYPES.Identifier?n.callee.property.name==="useRef":!1}return{ImportDeclaration(n){if(n.source.value==="react")for(let o of n.specifiers)o.type===Oe.AST_NODE_TYPES.ImportSpecifier&&o.imported.type===Oe.AST_NODE_TYPES.Identifier&&o.imported.name==="useRef"&&t.add(o.local.name)},VariableDeclarator(n){if(n.init&&n.init.type===Oe.AST_NODE_TYPES.CallExpression&&r(n.init)&&n.id.type===Oe.AST_NODE_TYPES.Identifier){let s=e.sourceCode.getScope(n).set.get(n.id.name);if(s){let i=!1;for(let l of s.references){let a=l.identifier.parent;if(a!==n&&!(a.type===Oe.AST_NODE_TYPES.JSXExpressionContainer&&a.parent.type===Oe.AST_NODE_TYPES.JSXAttribute&&a.parent.name.type===Oe.AST_NODE_TYPES.JSXIdentifier&&a.parent.name.name==="ref")){i=!0;break}}i||e.report({node:n.id,messageId:"refNotRead",data:{name:n.id.name}})}}}}}});var ot=require("@typescript-eslint/utils"),Rs=ot.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),jr="prefer-named-functions",Dr=new Map,vs=Rs({name:jr,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===ot.AST_NODE_TYPES.ArrowFunctionExpression&&n.id.type===ot.AST_NODE_TYPES.Identifier){let o=n.id.name;if(n.id.typeAnnotation||r&&r.test(o)||!t.disallowArrowFnWithImplicitReturns&&n.init.body.type!==ot.AST_NODE_TYPES.BlockStatement)return;let s=n.parent,i=n.init.params,l=n.init.body,c=n.init;e.report({node:n.id,messageId:r?"withIgnoreRegex":"default",data:{functionName:o,ignoreRegex:t.ignoreRegex},suggest:[{messageId:"suggestion",fix:a=>a.replaceText(s,`${c.async?"async ":""}function ${o}(${i.map(u=>e.sourceCode.getText(u)).join(", ")||""}) ${e.sourceCode.getText(l)}`)}]})}}}}}),Tn={name:jr,rule:vs};var Q=require("@typescript-eslint/utils"),Me=require("zod/v4");var ks=Me.z.object({disallowedFunctions:Me.z.array(Me.z.object({name:Me.z.string(),allowUsingWithArgs:Me.z.boolean().optional(),hookAlternative:Me.z.string().optional(),message:Me.z.string().optional(),allowUseInside:Me.z.array(Me.z.string()).optional()}))}),Ps=/^use[A-Z]/,Os=/^[A-Z]/;function wt(e){return Ps.test(e)}function Lr(e){return Os.test(e)}function Ns(e){return e.type===Q.AST_NODE_TYPES.Identifier?wt(e.name):e.type===Q.AST_NODE_TYPES.MemberExpression&&e.property.type===Q.AST_NODE_TYPES.Identifier?wt(e.property.name):!1}function Mr(e,t){return e.type===Q.AST_NODE_TYPES.Identifier?e.name===t:e.type===Q.AST_NODE_TYPES.MemberExpression&&e.object.type===Q.AST_NODE_TYPES.Identifier&&e.property.type===Q.AST_NODE_TYPES.Identifier?e.object.name==="React"&&e.property.name===t:!1}function _r(e){return!!(e.parent&&e.parent.type===Q.AST_NODE_TYPES.CallExpression&&Mr(e.parent.callee,"forwardRef"))}function $r(e){return!!(e.parent&&e.parent.type===Q.AST_NODE_TYPES.CallExpression&&Mr(e.parent.callee,"memo"))}function hn(e){if(e.type===Q.AST_NODE_TYPES.FunctionDeclaration||e.type===Q.AST_NODE_TYPES.FunctionExpression&&e.id)return e.id||void 0;if(e.type===Q.AST_NODE_TYPES.FunctionExpression||e.type===Q.AST_NODE_TYPES.ArrowFunctionExpression){if(e.parent.type===Q.AST_NODE_TYPES.VariableDeclarator&&e.parent.init===e)return e.parent.id;if(e.parent.type===Q.AST_NODE_TYPES.AssignmentExpression&&e.parent.right===e&&e.parent.operator==="=")return e.parent.left;if(e.parent.type===Q.AST_NODE_TYPES.Property&&e.parent.value===e&&!e.parent.computed)return e.parent.key;if(e.parent.type===Q.AST_NODE_TYPES.AssignmentPattern&&e.parent.right===e)return e.parent.left}}function Ds(e){let t=e.parent,r=!1;for(;t;){if(t.type===Q.AST_NODE_TYPES.FunctionDeclaration||t.type===Q.AST_NODE_TYPES.FunctionExpression||t.type===Q.AST_NODE_TYPES.ArrowFunctionExpression){let n=hn(t);if(n&&n.type===Q.AST_NODE_TYPES.Identifier){if(Lr(n.name)||wt(n.name))return!r;r=!0}else{if(_r(t)||$r(t))return!r;if(t.parent.type===Q.AST_NODE_TYPES.CallExpression){let o=t.parent;Ns(o.callee)||(r=!0)}else t.parent.type===Q.AST_NODE_TYPES.JSXExpressionContainer||(r=!0)}}t=t.parent}return!1}function Ur(e){return e.callee.type===Q.AST_NODE_TYPES.Identifier?e.callee.name:e.callee.type===Q.AST_NODE_TYPES.MemberExpression&&e.callee.property.type===Q.AST_NODE_TYPES.Identifier?e.callee.property.name:null}function js(e,t){if(!t.length)return!1;let r=e.parent;for(;r;){if(r.type===Q.AST_NODE_TYPES.FunctionDeclaration||r.type===Q.AST_NODE_TYPES.FunctionExpression||r.type===Q.AST_NODE_TYPES.ArrowFunctionExpression){let n=hn(r);if(n&&n.type===Q.AST_NODE_TYPES.Identifier&&t.includes(n.name))return!0}else if(r.type===Q.AST_NODE_TYPES.CallExpression){let n=Ur(r);if(n&&t.includes(n))return!0}r=r.parent}return!1}function Ls(e){return e.arguments.length>0&&!e.arguments.every(t=>t.type===Q.AST_NODE_TYPES.Identifier&&t.name==="undefined")}function Ms(e,t){let r=!1,n=e.parent;for(;n;){if(n.type===Q.AST_NODE_TYPES.FunctionDeclaration||n.type===Q.AST_NODE_TYPES.FunctionExpression||n.type===Q.AST_NODE_TYPES.ArrowFunctionExpression){let o=hn(n);if(o&&o.type===Q.AST_NODE_TYPES.Identifier){if(Lr(o.name)||wt(o.name)){r=!0;break}}else if(_r(n)||$r(n)){r=!0;break}}n=n.parent}return r?t.length===0?Ds(e):!js(e,t):!1}var En=X({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(ks)],hasSuggestions:!0},defaultOptions:[{disallowedFunctions:[]}],create(e,[t]){let{disallowedFunctions:r}=t,n=new Map(r.map(o=>[o.name,o]));return{CallExpression(o){let s=Ur(o);if(!s)return;let i=n.get(s);if(!i||i.allowUsingWithArgs&&Ls(o))return;let l=i.allowUseInside||[];Ms(o,l)&&e.report({node:o,messageId:"preferHookAlternative",data:{message:i.message?` ${i.message}`:` use ${i.hookAlternative} instead`},suggest:i.hookAlternative?[{messageId:"preferHookAlternative",data:{message:`Replace with ${i.hookAlternative}`,hookAlternative:i.hookAlternative},fix:c=>{let a=i.hookAlternative;return a?o.callee.type===Q.AST_NODE_TYPES.Identifier?c.replaceText(o.callee,a):o.callee.type===Q.AST_NODE_TYPES.MemberExpression&&o.callee.property.type===Q.AST_NODE_TYPES.Identifier?c.replaceText(o.callee.property,a):null:null}}]:[]})}}}});var ce=require("@typescript-eslint/utils"),Ft=Pe(require("zod/v4"));var _s=ce.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),Wr="prefer-single-line-if",$s=Ft.default.object({maxLineLength:Ft.default.number().optional(),maxNonSimpleConditionLength:Ft.default.number().optional()}),Us=_s({name:Wr,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($s)]},defaultOptions:[{}],create(e,[t]){let r=e.sourceCode;return{IfStatement(n){if(n.consequent.type!==ce.AST_NODE_TYPES.BlockStatement||n.loc.start.line===n.loc.end.line||r.getCommentsInside(n.consequent).length>0||n.alternate||n.consequent.body.length!==1)return;let s=n.consequent.body[0];if(!s)return;if(s.type===ce.AST_NODE_TYPES.ReturnStatement){if(!Vr(s))return}else if(!(s.type===ce.AST_NODE_TYPES.ContinueStatement||s.type===ce.AST_NODE_TYPES.BreakStatement))return;if(n.test.type===ce.AST_NODE_TYPES.LogicalExpression||n.test.type===ce.AST_NODE_TYPES.ConditionalExpression)return;let i;if(t.maxNonSimpleConditionLength){let f=zr(n.test);if(!f&&n.test.type===ce.AST_NODE_TYPES.UnaryExpression&&n.test.operator==="!"){let y=n.test.argument;zr(y)&&(f=!0)}if(f&&(i=r.getText(n.test),i.length>t.maxNonSimpleConditionLength))return}i||(i=r.getText(n.test));let l=r.getText(s);if(i.includes(`
18
+ `))return;let c=r.getTokenAfter(n);if(c&&c.type===ce.AST_TOKEN_TYPES.Punctuator&&c.value==="}"){let f=r.getTokenAfter(c);if(f&&f.type===ce.AST_TOKEN_TYPES.Keyword&&(f.value==="else"||f.value==="catch"))return}let a=zs(r,n),u=`if (${i}) ${l}`;t.maxLineLength&&u.length+a.length>t.maxLineLength||e.report({node:n,messageId:"noSingleLineCurly",fix:f=>f.replaceText(n,u)})}}}});function zr(e){return e.type===ce.AST_NODE_TYPES.CallExpression||e.type===ce.AST_NODE_TYPES.BinaryExpression||e.type===ce.AST_NODE_TYPES.MemberExpression&&Jr(e)}function Jr(e){return e.object.type===ce.AST_NODE_TYPES.MemberExpression?Jr(e.object):e.object.type!==ce.AST_NODE_TYPES.Identifier}function zs(e,t){return e.text.slice(t.range[0]-t.loc.start.column,t.range[0])}function Vr(e){if(!e.argument)return!0;let t=e.argument;return t.type===ce.AST_NODE_TYPES.ArrayExpression&&t.elements.length===0||t.type===ce.AST_NODE_TYPES.ObjectExpression&&t.properties.length===0||t.type===ce.AST_NODE_TYPES.Literal||t.type===ce.AST_NODE_TYPES.Identifier||t.type===ce.AST_NODE_TYPES.TemplateLiteral||t.type===ce.AST_NODE_TYPES.TaggedTemplateExpression?!0:t.type===ce.AST_NODE_TYPES.CallExpression?t.arguments.length===0:t.type===ce.AST_NODE_TYPES.UnaryExpression?Vr(t):!1}var bn={name:Wr,rule:Us};var U=require("@typescript-eslint/utils"),Cn=require("zod/v4");var Ws=U.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),Yr="react-compiler-extra",Js=Cn.z.object({runOnlyWithEnableCompilerDirective:Cn.z.boolean().optional()}),Vs=/eslint +react-compiler\/react-compiler: +\["error/;function qr(e){return e.type===U.AST_NODE_TYPES.Identifier?e.name.startsWith("use"):!1}function Xs(e){return e.type===U.AST_NODE_TYPES.Identifier?e.name.startsWith("use"):e.type===U.AST_NODE_TYPES.MemberExpression&&e.property.type===U.AST_NODE_TYPES.Identifier?e.property.name.startsWith("use"):!1}function _e(e){if(!e)return!1;switch(e.type){case U.AST_NODE_TYPES.JSXElement:case U.AST_NODE_TYPES.JSXFragment:return!0;case U.AST_NODE_TYPES.ConditionalExpression:return _e(e.consequent)||_e(e.alternate);case U.AST_NODE_TYPES.LogicalExpression:return e.operator==="&&"?_e(e.right):e.operator==="||"?_e(e.left)||_e(e.right):!1;case U.AST_NODE_TYPES.CallExpression:if(e.callee.type===U.AST_NODE_TYPES.MemberExpression&&e.callee.object.type===U.AST_NODE_TYPES.Identifier&&e.callee.object.name==="React"&&e.callee.property.type===U.AST_NODE_TYPES.Identifier&&e.callee.property.name==="createElement")return!0;for(let t of e.arguments)if(t.type!==U.AST_NODE_TYPES.SpreadElement&&_e(t))return!0;return!1;default:return!1}}function Bs(e){let t=e.typeAnnotation;if(t.type===U.AST_NODE_TYPES.TSTypeReference){if(t.typeName.type===U.AST_NODE_TYPES.Identifier)return t.typeName.name==="FC";if(t.typeName.type===U.AST_NODE_TYPES.TSQualifiedName&&t.typeName.left.type===U.AST_NODE_TYPES.Identifier&&t.typeName.right.type===U.AST_NODE_TYPES.Identifier)return t.typeName.left.name==="React"&&t.typeName.right.name==="FC"}return!1}var Hs=/^[A-Z][a-zA-Z0-9]*$/;function gt(e){return Hs.test(e)}function In(e){return e.startsWith("use")&&e.length>3}function An(e,t,r,n){if(r&&Bs(r))return t?gt(t.name):e.type===U.AST_NODE_TYPES.FunctionDeclaration&&e.id?gt(e.id.name):!0;if(t&&In(t.name)||e.type===U.AST_NODE_TYPES.FunctionDeclaration&&e.id&&In(e.id.name))return!0;if(n){let o=t?.name||e.type===U.AST_NODE_TYPES.FunctionDeclaration&&e.id?.name;if(o&&gt(o)&&Zr(e.body,n).containsJSX)return!0}return!1}function dt(e){if(e.body.type===U.AST_NODE_TYPES.BlockStatement){for(let t of e.body.body)if(t.type===U.AST_NODE_TYPES.ExpressionStatement&&t.expression.type===U.AST_NODE_TYPES.Literal&&typeof t.expression.value=="string"&&t.expression.value==="use memo")return!0}return!1}function Zr(e,t){let r={containsJSX:!1,containsHookCalls:!1};return je(e,n=>{if(r.containsJSX&&r.containsHookCalls)return!0;switch(n.type){case U.AST_NODE_TYPES.JSXElement:case U.AST_NODE_TYPES.JSXFragment:r.containsJSX=!0;break;case U.AST_NODE_TYPES.CallExpression:qr(n.callee)&&(r.containsHookCalls=!0),_e(n)&&(r.containsJSX=!0);break;case U.AST_NODE_TYPES.ReturnStatement:n.argument&&_e(n.argument)&&(r.containsJSX=!0);break;case U.AST_NODE_TYPES.VariableDeclarator:n.init&&_e(n.init)&&(r.containsJSX=!0);break;case U.AST_NODE_TYPES.AssignmentExpression:_e(n.right)&&(r.containsJSX=!0);break}},t),r}function Xr(e,t){let r=e.body,n=Zr(r,t);return n.containsJSX||n.containsHookCalls}var Ys=/\bthis[.[]/;function Br(e){return Ys.test(e)}function qs(e,t){let r={containsJSX:!1,containsHookCalls:!1};return je(e,n=>{if(r.containsHookCalls||(n.type===U.AST_NODE_TYPES.FunctionDeclaration||n.type===U.AST_NODE_TYPES.FunctionExpression||n.type===U.AST_NODE_TYPES.ArrowFunctionExpression)&&n!==e)return!0;n.type===U.AST_NODE_TYPES.CallExpression&&Xs(n.callee)&&(r.containsHookCalls=!0)},t),r}function Hr(e){return gt(e)||In(e)}function xn(e,t,r,n){if(!qs(e.body,t).containsHookCalls)return!1;let s=An(e,r,n,t);if(!s&&n){let i=r?.name||e.type===U.AST_NODE_TYPES.FunctionDeclaration&&e.id?.name;i&&gt(i)&&(s=!0)}return!s}var Zs=Ws({name:Yr,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(Js)]},defaultOptions:[{}],create(e,[t]){let r=!1;if(t.runOnlyWithEnableCompilerDirective){for(let s of e.sourceCode.getAllComments())if(Vs.test(s.value)){r=!0;break}if(!r)return{}}function n(s){for(let i of s.properties)if(i.type===U.AST_NODE_TYPES.Property&&i.method&&i.value.type===U.AST_NODE_TYPES.FunctionExpression){let l=e.sourceCode,c=l.getText(i.key),a=i.value,u=l.getText(a.body);if(Br(u))e.report({node:i,messageId:"thisKeywordInMethod"});else{let f=a.params.map(x=>l.getText(x)).join(", "),y="";a.generator?y=`${c}: function* (${f}) ${u}`:y=`${c}: (${f}) => ${u}`,e.report({node:i,messageId:"objectMethodIsNotSupported",fix:x=>x.replaceText(i,y)})}}}function o(s){for(let i of s.properties)if(i.type===U.AST_NODE_TYPES.Property&&i.value.type===U.AST_NODE_TYPES.ObjectExpression){for(let l of i.value.properties)if(l.type===U.AST_NODE_TYPES.Property&&l.method&&l.value.type===U.AST_NODE_TYPES.FunctionExpression){let a=e.sourceCode.getText(l.value.body);Br(a)&&e.report({node:l,messageId:"thisKeywordInMethod"})}}}return{CallExpression(s){if(qr(s.callee))for(let i of s.arguments){if(i.type===U.AST_NODE_TYPES.ObjectExpression&&(n(i),o(i)),i.type===U.AST_NODE_TYPES.ArrowFunctionExpression&&(i.body.type===U.AST_NODE_TYPES.ObjectExpression&&(n(i.body),o(i.body)),i.body.type===U.AST_NODE_TYPES.BlockStatement))for(let l of i.body.body)l.type===U.AST_NODE_TYPES.ReturnStatement&&l.argument?.type===U.AST_NODE_TYPES.ObjectExpression&&(n(l.argument),o(l.argument));if(i.type===U.AST_NODE_TYPES.FunctionExpression)for(let l of i.body.body)l.type===U.AST_NODE_TYPES.ReturnStatement&&l.argument?.type===U.AST_NODE_TYPES.ObjectExpression&&(n(l.argument),o(l.argument))}},VariableDeclarator(s){if(s.id.type===U.AST_NODE_TYPES.Identifier&&s.init&&(s.init.type===U.AST_NODE_TYPES.ArrowFunctionExpression||s.init.type===U.AST_NODE_TYPES.FunctionExpression)){let i=s.init,l=s.id,c=s.id.typeAnnotation;if(dt(i)&&!Hr(l.name)){e.report({node:i,messageId:"useMemoDirectiveNaming"});return}if(xn(i,e.sourceCode,l,c)){e.report({node:i,messageId:"functionCallingHooksMustBeComponent"});return}if(An(i,l,c,e.sourceCode)){let a=Xr(i,e.sourceCode),u=dt(i);!a&&!u&&e.report({node:i,messageId:"fcComponentShouldReturnJsx",suggest:[{messageId:"addUseMemoDirective",fix(f){if(i.body.type===U.AST_NODE_TYPES.BlockStatement){let y=i.body.range[0]+1;return f.insertTextAfterRange([y,y],`
19
19
  "use memo"
20
20
  `)}return null}}]})}}},FunctionDeclaration(s){if(s.id&&dt(s)&&!Hr(s.id.name)){e.report({node:s,messageId:"useMemoDirectiveNaming"});return}if(xn(s,e.sourceCode)){e.report({node:s,messageId:"functionCallingHooksMustBeComponent"});return}if(An(s,void 0,void 0,e.sourceCode)){let i=Xr(s,e.sourceCode),l=dt(s);!i&&!l&&e.report({node:s,messageId:"fcComponentShouldReturnJsx",suggest:[{messageId:"addUseMemoDirective",fix(c){let a=s.body.range[0]+1;return c.insertTextAfterRange([a,a],`
21
21
  "use memo"
22
- `)}}]})}},FunctionExpression(s){if(dt(s)){e.report({node:s,messageId:"useMemoDirectiveNaming"});return}xn(s,e.sourceCode)&&e.report({node:s,messageId:"functionCallingHooksMustBeComponent"})}}}}),wn={name:Yr,rule:Vs};var be=require("@typescript-eslint/utils"),Ne=require("zod/v4");var Xs=be.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),Gr="react-compiler-migration",Bs=Ne.z.object({disallowHooks:Ne.z.array(Ne.z.object({name:Ne.z.string(),replacement:Ne.z.string()})).optional(),disallowMethods:Ne.z.array(Ne.z.object({name:Ne.z.string(),replacement:Ne.z.string().optional(),requireTrueProp:Ne.z.string().optional()})).optional(),runOnlyWithEnableCompilerDirective:Ne.z.boolean()}),Hs=/eslint +react-compiler\/react-compiler: +\["error/;function Ys(e){return e.type===be.AST_NODE_TYPES.Identifier?e.name.startsWith("use"):e.type===be.AST_NODE_TYPES.MemberExpression&&e.property.type===be.AST_NODE_TYPES.Identifier?e.property.name.startsWith("use"):!1}var qs=Xs({name:Gr,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:[z(Bs)]},defaultOptions:[{disallowHooks:[],disallowMethods:[],runOnlyWithEnableCompilerDirective:!1}],create(e,[t]){let r=!0;if(t.runOnlyWithEnableCompilerDirective){r=!1;for(let n of e.sourceCode.getAllComments())if(Hs.test(n.value)){r=!0;break}}return r?{CallExpression(n){if(t.disallowHooks?.length){let o=null,s=null;if(n.callee.type===be.AST_NODE_TYPES.Identifier?(o=n.callee.name,s=n.callee):n.callee.type===be.AST_NODE_TYPES.MemberExpression&&n.callee.property.type===be.AST_NODE_TYPES.Identifier&&(o=n.callee.property.name,s=n.callee.property),o){let i=t.disallowHooks.find(l=>l.name===o);i&&s&&e.report({node:n,messageId:"disallowedFunctionOrMethod",data:{functionOrMethod:i.name,replacement:i.replacement},suggest:[{messageId:"replace",data:{replacement:i.replacement},fix:l=>l.replaceText(s,i.replacement)}]})}}if(t.disallowMethods?.length&&Ys(n.callee)){for(let o of n.arguments)if(o.type===be.AST_NODE_TYPES.ObjectExpression){for(let s of o.properties)if(s.type===be.AST_NODE_TYPES.Property&&s.key.type===be.AST_NODE_TYPES.Identifier){let i=s.key.name,l=t.disallowMethods.find(c=>c.name===i);if(l){if(l.requireTrueProp){let c=l.requireTrueProp,a=!1;for(let u of o.properties)if(u.type===be.AST_NODE_TYPES.Property&&u.key.type===be.AST_NODE_TYPES.Identifier&&u.key.name===c&&u.value.type===be.AST_NODE_TYPES.Literal&&u.value.value===!0){a=!0;break}if(!a){e.report({node:s,messageId:"disallowedMethodWithMissingRequireTrueProp",data:{method:l.name,requireTrueProp:c}});continue}}l.replacement&&e.report({node:s,messageId:"disallowedFunctionOrMethod",data:{functionOrMethod:l.name,replacement:l.replacement},suggest:[{messageId:"replace",data:{replacement:l.replacement},fix:c=>l.replacement?c.replaceText(s.key,l.replacement):null}]})}}}}}}:{}}}),Fn={name:Gr,rule:qs};var _=require("@typescript-eslint/utils"),vn=require("zod");var Zs=vn.z.object({runOnlyWithEnableCompilerDirective:vn.z.boolean().optional()}),Gs=/eslint +react-compiler\/react-compiler: +\["error/,Ks=/^\d+$/,Qs=/[\s_-]+/,ea=/[a-z][A-Z]/,ta=/^(.+?)([A-Z][a-z]+s?)$/,na=/^[a-z][a-zA-Z]*$/;function Kr(e,t){let r=[];if(e.type===_.AST_NODE_TYPES.JSXElement){for(let n of e.openingElement.attributes)if(n.type===_.AST_NODE_TYPES.JSXAttribute&&n.name.type===_.AST_NODE_TYPES.JSXIdentifier&&n.value?.type===_.AST_NODE_TYPES.JSXExpressionContainer&&n.value.expression.type!==_.AST_NODE_TYPES.JSXEmptyExpression){let o=n.name.name,s=n.value.expression,i=!1;je(s,l=>{switch(l.type){case _.AST_NODE_TYPES.ObjectExpression:case _.AST_NODE_TYPES.ArrowFunctionExpression:case _.AST_NODE_TYPES.FunctionExpression:case _.AST_NODE_TYPES.ArrayExpression:return i=!0,!0}return!1},t),i&&r.push(o)}}return{hasUnstable:r.length>0,problematicProps:r}}function ra(e){if(e.body.type===_.AST_NODE_TYPES.JSXElement||e.body.type===_.AST_NODE_TYPES.JSXFragment)return!0;if(e.body.type===_.AST_NODE_TYPES.BlockStatement){for(let t of e.body.body)if(t.type===_.AST_NODE_TYPES.ReturnStatement&&t.argument&&(t.argument.type===_.AST_NODE_TYPES.JSXElement||t.argument.type===_.AST_NODE_TYPES.JSXFragment))return!0}return!1}function ia(e,t){let r=e.callee;if(r.type===_.AST_NODE_TYPES.MemberExpression){let n=r.object;if(n.type===_.AST_NODE_TYPES.Identifier){let o=n.name,s=oa(o);if(s!==o)return kn(s)}}if(t.length>0){let n=t[0];if(n&&n.type===_.AST_NODE_TYPES.Identifier)return kn(n.name)}return"ListItem"}function oa(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(ea)){let n=e.match(ta);if(n){let o=n[1],s=n[2];if(!o||!s)return Rn(e);let i=Rn(s);if(i!==s)return o+i}}return Rn(e)}function Rn(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 kn(e){return e.match(na)?e.charAt(0).toUpperCase()+e.slice(1):e.split(Qs).map(t=>t.charAt(0).toUpperCase()+t.slice(1).toLowerCase()).join("")}function Qr(e,t,r){let n=[],o=new Set,s=new Set(["console","document","window","Math","Object","Array","String","Number","Boolean","undefined","null"]);je(e,i=>{if(i.type===_.AST_NODE_TYPES.Identifier&&!t.includes(i.name)&&!s.has(i.name)&&!Ks.test(i.name)){let l=i.parent;if(l.type===_.AST_NODE_TYPES.Property&&l.key===i||l.type===_.AST_NODE_TYPES.MemberExpression&&l.property===i&&!l.computed||l.type===_.AST_NODE_TYPES.JSXOpeningElement||l.type===_.AST_NODE_TYPES.JSXClosingElement||l.type===_.AST_NODE_TYPES.JSXAttribute&&l.name.type===_.AST_NODE_TYPES.JSXIdentifier&&l.name.name===i.name)return!1;o.add(i.name)}return!1},r);for(let i of o)t.includes(i)||n.push({name:i,type:"unknown"});return n}function ei(e,t,r,n,o){let i=[...r.map(f=>f.type===_.AST_NODE_TYPES.Identifier?f.name:"item").map((f,y)=>({name:f,type:y===0?`${e}Type`:y===1?"number":"unknown"})),...n],l=i.map(f=>{let y=f.type;return f.name.includes("on")&&y==="any"&&(y="unknown"),` ${f.name}: ${y};`}).join(`
22
+ `)}}]})}},FunctionExpression(s){if(dt(s)){e.report({node:s,messageId:"useMemoDirectiveNaming"});return}xn(s,e.sourceCode)&&e.report({node:s,messageId:"functionCallingHooksMustBeComponent"})}}}}),wn={name:Yr,rule:Zs};var be=require("@typescript-eslint/utils"),Ne=require("zod/v4");var Gs=be.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),Gr="react-compiler-migration",Ks=Ne.z.object({disallowHooks:Ne.z.array(Ne.z.object({name:Ne.z.string(),replacement:Ne.z.string()})).optional(),disallowMethods:Ne.z.array(Ne.z.object({name:Ne.z.string(),replacement:Ne.z.string().optional(),requireTrueProp:Ne.z.string().optional()})).optional(),runOnlyWithEnableCompilerDirective:Ne.z.boolean()}),Qs=/eslint +react-compiler\/react-compiler: +\["error/;function ea(e){return e.type===be.AST_NODE_TYPES.Identifier?e.name.startsWith("use"):e.type===be.AST_NODE_TYPES.MemberExpression&&e.property.type===be.AST_NODE_TYPES.Identifier?e.property.name.startsWith("use"):!1}var ta=Gs({name:Gr,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(Ks)]},defaultOptions:[{disallowHooks:[],disallowMethods:[],runOnlyWithEnableCompilerDirective:!1}],create(e,[t]){let r=!0;if(t.runOnlyWithEnableCompilerDirective){r=!1;for(let n of e.sourceCode.getAllComments())if(Qs.test(n.value)){r=!0;break}}return r?{CallExpression(n){if(t.disallowHooks?.length){let o=null,s=null;if(n.callee.type===be.AST_NODE_TYPES.Identifier?(o=n.callee.name,s=n.callee):n.callee.type===be.AST_NODE_TYPES.MemberExpression&&n.callee.property.type===be.AST_NODE_TYPES.Identifier&&(o=n.callee.property.name,s=n.callee.property),o){let i=t.disallowHooks.find(l=>l.name===o);i&&s&&e.report({node:n,messageId:"disallowedFunctionOrMethod",data:{functionOrMethod:i.name,replacement:i.replacement},suggest:[{messageId:"replace",data:{replacement:i.replacement},fix:l=>l.replaceText(s,i.replacement)}]})}}if(t.disallowMethods?.length&&ea(n.callee)){for(let o of n.arguments)if(o.type===be.AST_NODE_TYPES.ObjectExpression){for(let s of o.properties)if(s.type===be.AST_NODE_TYPES.Property&&s.key.type===be.AST_NODE_TYPES.Identifier){let i=s.key.name,l=t.disallowMethods.find(c=>c.name===i);if(l){if(l.requireTrueProp){let c=l.requireTrueProp,a=!1;for(let u of o.properties)if(u.type===be.AST_NODE_TYPES.Property&&u.key.type===be.AST_NODE_TYPES.Identifier&&u.key.name===c&&u.value.type===be.AST_NODE_TYPES.Literal&&u.value.value===!0){a=!0;break}if(!a){e.report({node:s,messageId:"disallowedMethodWithMissingRequireTrueProp",data:{method:l.name,requireTrueProp:c}});continue}}l.replacement&&e.report({node:s,messageId:"disallowedFunctionOrMethod",data:{functionOrMethod:l.name,replacement:l.replacement},suggest:[{messageId:"replace",data:{replacement:l.replacement},fix:c=>l.replacement?c.replaceText(s.key,l.replacement):null}]})}}}}}}:{}}}),Fn={name:Gr,rule:ta};var _=require("@typescript-eslint/utils"),vn=require("zod");var na=vn.z.object({runOnlyWithEnableCompilerDirective:vn.z.boolean().optional()}),ra=/eslint +react-compiler\/react-compiler: +\["error/,ia=/^\d+$/,oa=/[\s_-]+/,sa=/[a-z][A-Z]/,aa=/^(.+?)([A-Z][a-z]+s?)$/,la=/^[a-z][a-zA-Z]*$/;function Kr(e,t){let r=[];if(e.type===_.AST_NODE_TYPES.JSXElement){for(let n of e.openingElement.attributes)if(n.type===_.AST_NODE_TYPES.JSXAttribute&&n.name.type===_.AST_NODE_TYPES.JSXIdentifier&&n.value?.type===_.AST_NODE_TYPES.JSXExpressionContainer&&n.value.expression.type!==_.AST_NODE_TYPES.JSXEmptyExpression){let o=n.name.name,s=n.value.expression,i=!1;je(s,l=>{switch(l.type){case _.AST_NODE_TYPES.ObjectExpression:case _.AST_NODE_TYPES.ArrowFunctionExpression:case _.AST_NODE_TYPES.FunctionExpression:case _.AST_NODE_TYPES.ArrayExpression:return i=!0,!0}return!1},t),i&&r.push(o)}}return{hasUnstable:r.length>0,problematicProps:r}}function pa(e){if(e.body.type===_.AST_NODE_TYPES.JSXElement||e.body.type===_.AST_NODE_TYPES.JSXFragment)return!0;if(e.body.type===_.AST_NODE_TYPES.BlockStatement){for(let t of e.body.body)if(t.type===_.AST_NODE_TYPES.ReturnStatement&&t.argument&&(t.argument.type===_.AST_NODE_TYPES.JSXElement||t.argument.type===_.AST_NODE_TYPES.JSXFragment))return!0}return!1}function ca(e,t){let r=e.callee;if(r.type===_.AST_NODE_TYPES.MemberExpression){let n=r.object;if(n.type===_.AST_NODE_TYPES.Identifier){let o=n.name,s=ua(o);if(s!==o)return kn(s)}}if(t.length>0){let n=t[0];if(n&&n.type===_.AST_NODE_TYPES.Identifier)return kn(n.name)}return"ListItem"}function ua(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(sa)){let n=e.match(aa);if(n){let o=n[1],s=n[2];if(!o||!s)return Rn(e);let i=Rn(s);if(i!==s)return o+i}}return Rn(e)}function Rn(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 kn(e){return e.match(la)?e.charAt(0).toUpperCase()+e.slice(1):e.split(oa).map(t=>t.charAt(0).toUpperCase()+t.slice(1).toLowerCase()).join("")}function Qr(e,t,r){let n=[],o=new Set,s=new Set(["console","document","window","Math","Object","Array","String","Number","Boolean","undefined","null"]);je(e,i=>{if(i.type===_.AST_NODE_TYPES.Identifier&&!t.includes(i.name)&&!s.has(i.name)&&!ia.test(i.name)){let l=i.parent;if(l.type===_.AST_NODE_TYPES.Property&&l.key===i||l.type===_.AST_NODE_TYPES.MemberExpression&&l.property===i&&!l.computed||l.type===_.AST_NODE_TYPES.JSXOpeningElement||l.type===_.AST_NODE_TYPES.JSXClosingElement||l.type===_.AST_NODE_TYPES.JSXAttribute&&l.name.type===_.AST_NODE_TYPES.JSXIdentifier&&l.name.name===i.name)return!1;o.add(i.name)}return!1},r);for(let i of o)t.includes(i)||n.push({name:i,type:"unknown"});return n}function ei(e,t,r,n,o){let i=[...r.map(f=>f.type===_.AST_NODE_TYPES.Identifier?f.name:"item").map((f,y)=>({name:f,type:y===0?`${e}Type`:y===1?"number":"unknown"})),...n],l=i.map(f=>{let y=f.type;return f.name.includes("on")&&y==="any"&&(y="unknown"),` ${f.name}: ${y};`}).join(`
23
23
  `),c=i.map(f=>f.name).join(", "),a=o.getText(t),u=`${e}Props`;return`type ${u} = {
24
24
  ${l}
25
25
  };
@@ -28,28 +28,28 @@ const ${e}: FC<${u}> = ({ ${c} }) => {
28
28
  return (
29
29
  ${a}
30
30
  );
31
- };`}function sa(e,t,r,n){let o=t.map(i=>i.type===_.AST_NODE_TYPES.Identifier?i.name:"item"),s=[n?`key={${n}}`:`key={${o[0]}.id}`,...o.map(i=>`${i}={${i}}`),...r.map(i=>`${i.name}={${i.name}}`)].filter(Boolean);return`<${e} ${s.join(" ")} />`}function aa(e){if(e.type===_.AST_NODE_TYPES.JSXElement&&e.openingElement.name.type===_.AST_NODE_TYPES.JSXIdentifier){let t=e.openingElement.name.name;if(t!=="div"&&t!=="span")return kn(t)}return"ListItem"}function la(e,t,r){let n=[r?`key={${r}}`:"",...t.map(o=>`${o.name}={${o.name}}`)].filter(Boolean);return`<${e}${n.length>0?` ${n.join(" ")}`:""} />`}function ti(e,t){for(let r of e.openingElement.attributes)if(r.type===_.AST_NODE_TYPES.JSXAttribute&&r.name.type===_.AST_NODE_TYPES.JSXIdentifier&&r.name.name==="key"&&r.value&&r.value.type===_.AST_NODE_TYPES.JSXExpressionContainer&&r.value.expression.type!==_.AST_NODE_TYPES.JSXEmptyExpression)return t.getText(r.value.expression);return null}var Pn=X({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:[z(Zs)],hasSuggestions:!0},defaultOptions:[{runOnlyWithEnableCompilerDirective:!1}],create(e,[t]){let{sourceCode:r}=e;if(t.runOnlyWithEnableCompilerDirective){let n=!1;for(let o of r.getAllComments())if(Gs.test(o.value)){n=!0;break}if(!n)return{}}return{CallExpression(n){n.callee.type===_.AST_NODE_TYPES.MemberExpression&&n.callee.property.type===_.AST_NODE_TYPES.Identifier&&(n.callee.property.name==="map"||n.callee.property.name==="push")&&(n.callee.property.name==="map"?pa(n,r,e):ca(n,r,e))}}}});function pa(e,t,r){let n=e.arguments[0];if(!n||n.type!==_.AST_NODE_TYPES.ArrowFunctionExpression&&n.type!==_.AST_NODE_TYPES.FunctionExpression||!ra(n))return;let o=null;if(n.body.type===_.AST_NODE_TYPES.JSXElement||n.body.type===_.AST_NODE_TYPES.JSXFragment?o=n.body:n.body.type===_.AST_NODE_TYPES.BlockStatement&&n.body.body[0]?.type===_.AST_NODE_TYPES.ReturnStatement&&n.body.body[0].argument&&(n.body.body[0].argument.type===_.AST_NODE_TYPES.JSXElement||n.body.body[0].argument.type===_.AST_NODE_TYPES.JSXFragment)&&(o=n.body.body[0].argument),!o)return;let s=Kr(o,t);if(!s.hasUnstable)return;let i=ia(e,n.params),l=n.params.map(f=>f.type===_.AST_NODE_TYPES.Identifier?f.name:"item"),c=Qr(o,l,t),a=o.type===_.AST_NODE_TYPES.JSXElement?ti(o,t):null,u=s.problematicProps.length===1?`prop "${s.problematicProps[0]}"`:`props "${s.problematicProps.join('", "')}"`;r.report({node:o,messageId:"unstableValueInMap",data:{problematicProps:u},suggest:[{messageId:"extractComponent",data:{componentName:i},fix:f=>{let y=ei(i,o,n.params,c,t),x=sa(i,n.params,c,a),m=e;for(;m.parent.type!==_.AST_NODE_TYPES.Program&&!(m.type===_.AST_NODE_TYPES.FunctionDeclaration||m.type===_.AST_NODE_TYPES.VariableDeclarator&&m.init&&(m.init.type===_.AST_NODE_TYPES.ArrowFunctionExpression||m.init.type===_.AST_NODE_TYPES.FunctionExpression));)m=m.parent;let E=[];return E.push(f.insertTextAfter(m,`
31
+ };`}function fa(e,t,r,n){let o=t.map(i=>i.type===_.AST_NODE_TYPES.Identifier?i.name:"item"),s=[n?`key={${n}}`:`key={${o[0]}.id}`,...o.map(i=>`${i}={${i}}`),...r.map(i=>`${i.name}={${i.name}}`)].filter(Boolean);return`<${e} ${s.join(" ")} />`}function ma(e){if(e.type===_.AST_NODE_TYPES.JSXElement&&e.openingElement.name.type===_.AST_NODE_TYPES.JSXIdentifier){let t=e.openingElement.name.name;if(t!=="div"&&t!=="span")return kn(t)}return"ListItem"}function ya(e,t,r){let n=[r?`key={${r}}`:"",...t.map(o=>`${o.name}={${o.name}}`)].filter(Boolean);return`<${e}${n.length>0?` ${n.join(" ")}`:""} />`}function ti(e,t){for(let r of e.openingElement.attributes)if(r.type===_.AST_NODE_TYPES.JSXAttribute&&r.name.type===_.AST_NODE_TYPES.JSXIdentifier&&r.name.name==="key"&&r.value&&r.value.type===_.AST_NODE_TYPES.JSXExpressionContainer&&r.value.expression.type!==_.AST_NODE_TYPES.JSXEmptyExpression)return t.getText(r.value.expression);return null}var Pn=X({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(na)],hasSuggestions:!0},defaultOptions:[{runOnlyWithEnableCompilerDirective:!1}],create(e,[t]){let{sourceCode:r}=e;if(t.runOnlyWithEnableCompilerDirective){let n=!1;for(let o of r.getAllComments())if(ra.test(o.value)){n=!0;break}if(!n)return{}}return{CallExpression(n){n.callee.type===_.AST_NODE_TYPES.MemberExpression&&n.callee.property.type===_.AST_NODE_TYPES.Identifier&&(n.callee.property.name==="map"||n.callee.property.name==="push")&&(n.callee.property.name==="map"?da(n,r,e):ga(n,r,e))}}}});function da(e,t,r){let n=e.arguments[0];if(!n||n.type!==_.AST_NODE_TYPES.ArrowFunctionExpression&&n.type!==_.AST_NODE_TYPES.FunctionExpression||!pa(n))return;let o=null;if(n.body.type===_.AST_NODE_TYPES.JSXElement||n.body.type===_.AST_NODE_TYPES.JSXFragment?o=n.body:n.body.type===_.AST_NODE_TYPES.BlockStatement&&n.body.body[0]?.type===_.AST_NODE_TYPES.ReturnStatement&&n.body.body[0].argument&&(n.body.body[0].argument.type===_.AST_NODE_TYPES.JSXElement||n.body.body[0].argument.type===_.AST_NODE_TYPES.JSXFragment)&&(o=n.body.body[0].argument),!o)return;let s=Kr(o,t);if(!s.hasUnstable)return;let i=ca(e,n.params),l=n.params.map(f=>f.type===_.AST_NODE_TYPES.Identifier?f.name:"item"),c=Qr(o,l,t),a=o.type===_.AST_NODE_TYPES.JSXElement?ti(o,t):null,u=s.problematicProps.length===1?`prop "${s.problematicProps[0]}"`:`props "${s.problematicProps.join('", "')}"`;r.report({node:o,messageId:"unstableValueInMap",data:{problematicProps:u},suggest:[{messageId:"extractComponent",data:{componentName:i},fix:f=>{let y=ei(i,o,n.params,c,t),x=fa(i,n.params,c,a),m=e;for(;m.parent.type!==_.AST_NODE_TYPES.Program&&!(m.type===_.AST_NODE_TYPES.FunctionDeclaration||m.type===_.AST_NODE_TYPES.VariableDeclarator&&m.init&&(m.init.type===_.AST_NODE_TYPES.ArrowFunctionExpression||m.init.type===_.AST_NODE_TYPES.FunctionExpression));)m=m.parent;let E=[];return E.push(f.insertTextAfter(m,`
32
32
 
33
- ${y}`)),E.push(f.replaceText(o,x)),E}}]})}function ca(e,t,r){let n=e.arguments[0];if(!n||n.type!==_.AST_NODE_TYPES.JSXElement&&n.type!==_.AST_NODE_TYPES.JSXFragment)return;let o=n,s=Kr(o,t);if(!s.hasUnstable)return;let i=aa(o),l=Qr(o,[],t),c=o.type===_.AST_NODE_TYPES.JSXElement?ti(o,t):null,a=s.problematicProps.length===1?`prop "${s.problematicProps[0]}"`:`props "${s.problematicProps.join('", "')}"`;r.report({node:o,messageId:"unstableValueInMap",data:{problematicProps:a},suggest:[{messageId:"extractComponent",data:{componentName:i},fix:u=>{let f=ei(i,o,[],l,t),y=la(i,l,c),x=e;for(;x.parent.type!==_.AST_NODE_TYPES.Program&&!(x.type===_.AST_NODE_TYPES.FunctionDeclaration||x.type===_.AST_NODE_TYPES.VariableDeclarator&&x.init&&(x.init.type===_.AST_NODE_TYPES.ArrowFunctionExpression||x.init.type===_.AST_NODE_TYPES.FunctionExpression));)x=x.parent;let m=[];return m.push(u.insertTextAfter(x,`
33
+ ${y}`)),E.push(f.replaceText(o,x)),E}}]})}function ga(e,t,r){let n=e.arguments[0];if(!n||n.type!==_.AST_NODE_TYPES.JSXElement&&n.type!==_.AST_NODE_TYPES.JSXFragment)return;let o=n,s=Kr(o,t);if(!s.hasUnstable)return;let i=ma(o),l=Qr(o,[],t),c=o.type===_.AST_NODE_TYPES.JSXElement?ti(o,t):null,a=s.problematicProps.length===1?`prop "${s.problematicProps[0]}"`:`props "${s.problematicProps.join('", "')}"`;r.report({node:o,messageId:"unstableValueInMap",data:{problematicProps:a},suggest:[{messageId:"extractComponent",data:{componentName:i},fix:u=>{let f=ei(i,o,[],l,t),y=ya(i,l,c),x=e;for(;x.parent.type!==_.AST_NODE_TYPES.Program&&!(x.type===_.AST_NODE_TYPES.FunctionDeclaration||x.type===_.AST_NODE_TYPES.VariableDeclarator&&x.init&&(x.init.type===_.AST_NODE_TYPES.ArrowFunctionExpression||x.init.type===_.AST_NODE_TYPES.FunctionExpression));)x=x.parent;let m=[];return m.push(u.insertTextAfter(x,`
34
34
 
35
- ${f}`)),m.push(u.replaceText(o,y)),m}}]})}var Rt=require("@typescript-eslint/utils"),ua=Rt.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),ni="require-description",fa=/^(eslint(?:-env|-enable|-disable(?:(?:-next)?-line)?)?|exported|globals?)(?:\s|$)/u,ma=/^eslint-disable-(next-)?line$/u,ya=ua({name:ni,meta:{type:"problem",docs:{description:"Require descriptions for eslint directives."},messages:{missingDescription:"Unexpected undescribed directive comment. Include descriptions to explain why the comment is necessary."},schema:[{type:"object",properties:{ignore:{type:"array",items:{type:"string",enum:["eslint","eslint-disable","eslint-disable-line","eslint-disable-next-line","eslint-enable","eslint-env","exported","global","globals"]},additionalItems:!1,uniqueItems:!0}},additionalProperties:!1}]},defaultOptions:[{ignore:[]}],create(e,[t]){let r=e.sourceCode,n=new Set(t.ignore||[]);return{Program(){for(let o of r.getAllComments()){let s=da(o);s!=null&&(n.has(s.kind)||s.description||e.report({loc:Ta(o.loc),messageId:"missingDescription"}))}}}}}),ri={name:ni,rule:ya};function da(e){let{text:t,description:r}=Sa(e.value);if(!t)return null;let n=fa.exec(t);if(!n)return null;let o=n[1];if(!o)return null;let s=ma.test(o);if(e.type===Rt.TSESTree.AST_TOKEN_TYPES.Line&&!s||s&&e.loc.start.line!==e.loc.end.line)return null;let i=t.slice(n.index+o.length);return{kind:o,value:i.trim(),description:r}}var ga=/\s-{2,}\s/u;function Sa(e){let t=e.split(ga);return{text:t[0]?.trim(),description:t.length>1?t[1]?.trim()??null:null}}function Ta(e){return{start:{line:e.start.line,column:-1},end:e.end}}var ne=require("@typescript-eslint/utils"),$e=require("zod/v4");var ha=$e.z.object({varsToCheck:$e.z.array($e.z.object({selector:$e.z.string().optional(),fromFnCall:$e.z.string().optional(),prop:$e.z.string().or($e.z.array($e.z.string())),errorMsg:$e.z.string().optional()}))}),On=X({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:[z(ha)]},defaultOptions:[{varsToCheck:[]}],create(e,[t]){let r=new Map;function n(i,l,c,a){let u=new Set;for(let y of i.properties)y.type===ne.AST_NODE_TYPES.Property&&y.key.type===ne.AST_NODE_TYPES.Identifier&&u.add(y.key.name);let f=l.filter(y=>!u.has(y));if(f.length>0)if(f.length===1)e.report({node:i,messageId:"propNotRead",data:{prop:f[0],fnName:a,customMsg:c||""}});else{let y=f.map(x=>`"${x}"`).join(", ");e.report({node:i,messageId:"propsNotRead",data:{props:y,fnName:a,customMsg:c||""}})}}function o(i){if(i.init?.type===ne.AST_NODE_TYPES.CallExpression){if(i.init.callee.type===ne.AST_NODE_TYPES.Identifier)return i.init.callee.name;if(i.init.callee.type===ne.AST_NODE_TYPES.MemberExpression&&i.init.callee.property.type===ne.AST_NODE_TYPES.Identifier)return i.init.callee.object.type===ne.AST_NODE_TYPES.Identifier?`${i.init.callee.object.name}.${i.init.callee.property.name}`:i.init.callee.property.name}return"unknown function"}let s={};for(let i of t.varsToCheck)i.selector&&(s[i.selector]=l=>{if(l.type===ne.AST_NODE_TYPES.VariableDeclarator&&l.id.type===ne.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:o(l)}),l.type===ne.AST_NODE_TYPES.VariableDeclarator&&l.id.type===ne.AST_NODE_TYPES.ObjectPattern){let c=Array.isArray(i.prop)?i.prop:[i.prop];n(l.id,c,i.errorMsg,o(l))}});for(let i of t.varsToCheck)if(i.fromFnCall){let l=i.fromFnCall;if(l.startsWith("*.")){let a=`VariableDeclarator > CallExpression > MemberExpression[property.name="${l.slice(2)}"]`;s[a]=u=>{if(u.type!==ne.AST_NODE_TYPES.MemberExpression||u.parent.type!==ne.AST_NODE_TYPES.CallExpression)return;let f=u.parent;if(f.parent.type!==ne.AST_NODE_TYPES.VariableDeclarator)return;let y=f.parent;if(y.id.type===ne.AST_NODE_TYPES.Identifier)r.set(y.id.name,{props:Array.isArray(i.prop)?i.prop:[i.prop],errorMsg:i.errorMsg,node:y.id,fnName:i.fromFnCall||"unknown function"});else if(y.id.type===ne.AST_NODE_TYPES.ObjectPattern){let x=Array.isArray(i.prop)?i.prop:[i.prop];n(y.id,x,i.errorMsg,i.fromFnCall||"unknown function")}}}else if(l.includes(".")){let[c,a]=l.split("."),u=`VariableDeclarator > CallExpression > MemberExpression[object.name="${c}"][property.name="${a}"]`;s[u]=f=>{if(f.type!==ne.AST_NODE_TYPES.MemberExpression||f.parent.type!==ne.AST_NODE_TYPES.CallExpression)return;let y=f.parent;if(y.parent.type!==ne.AST_NODE_TYPES.VariableDeclarator)return;let x=y.parent;if(x.id.type===ne.AST_NODE_TYPES.Identifier)r.set(x.id.name,{props:Array.isArray(i.prop)?i.prop:[i.prop],errorMsg:i.errorMsg,node:x.id,fnName:i.fromFnCall||"unknown function"});else if(x.id.type===ne.AST_NODE_TYPES.ObjectPattern){let m=Array.isArray(i.prop)?i.prop:[i.prop];n(x.id,m,i.errorMsg,i.fromFnCall||"unknown function")}}}else{let c=`VariableDeclarator > CallExpression > Identifier[name="${l}"]`;s[c]=a=>{if(a.type!==ne.AST_NODE_TYPES.Identifier||a.parent.type!==ne.AST_NODE_TYPES.CallExpression)return;let u=a.parent;if(u.parent.type!==ne.AST_NODE_TYPES.VariableDeclarator)return;let f=u.parent;if(f.id.type===ne.AST_NODE_TYPES.Identifier)r.set(f.id.name,{props:Array.isArray(i.prop)?i.prop:[i.prop],errorMsg:i.errorMsg,node:f.id,fnName:i.fromFnCall||"unknown function"});else if(f.id.type===ne.AST_NODE_TYPES.ObjectPattern){let y=Array.isArray(i.prop)?i.prop:[i.prop];n(f.id,y,i.errorMsg,i.fromFnCall||"unknown function")}}}}return{...s,"Program:exit"(){for(let[i,{props:l,errorMsg:c,node:a,fnName:u}]of r){let y=e.sourceCode.getScope(a).set.get(i);if(y){let x=new Set(l);for(let m of y.references){let E=m.identifier,C=E.parent;if(!(C.type===ne.AST_NODE_TYPES.VariableDeclarator&&C.id===E)){if(C.type===ne.AST_NODE_TYPES.MemberExpression&&C.object===E&&C.property.type===ne.AST_NODE_TYPES.Identifier&&x.has(C.property.name)){if(x.delete(C.property.name),x.size===0)break;continue}if(C.type===ne.AST_NODE_TYPES.VariableDeclarator&&C.init===E&&C.id.type===ne.AST_NODE_TYPES.ObjectPattern){for(let S of C.id.properties)S.type===ne.AST_NODE_TYPES.Property&&S.key.type===ne.AST_NODE_TYPES.Identifier&&x.has(S.key.name)&&x.delete(S.key.name);if(x.size===0)break;continue}if(!(C.type===ne.AST_NODE_TYPES.MemberExpression&&C.object===E&&C.property.type===ne.AST_NODE_TYPES.Identifier&&!l.includes(C.property.name))){x.clear();break}}}if(x.size>0){let m=Array.from(x);if(m.length===1)e.report({node:a,messageId:"propNotRead",data:{prop:m[0],fnName:u,customMsg:c||""}});else{let E=m.map(C=>`"${C}"`).join(", ");e.report({node:a,messageId:"propsNotRead",data:{props:E,fnName:u,customMsg:c||""}})}}}}}}}});function si(e){return/^use[A-Z0-9]/.test(e)}function vt(e){return e.type==="Identifier"?si(e.name):e.type==="MemberExpression"&&!e.computed&&vt(e.property)?e.object.type==="Identifier":!1}function ai(e){return e.type==="Identifier"&&/^[A-Z]/.test(e.name)}function li(e,t){return e.name===t||e.type==="MemberExpression"&&e.object.name==="React"&&e.property.name===t}function pi(e){return!!(e.parent&&e.parent.callee&&li(e.parent.callee,"forwardRef"))}function ci(e){return!!(e.parent&&e.parent.callee&&li(e.parent.callee,"memo"))}function Nn(e){for(;e;){let t=fi(e);if(t&&(ai(t)||vt(t))||pi(e)||ci(e))return!0;e=e.parent}return!1}function ii(e){return!1}function Dn(e){return!1}var Ea=/eslint +react-compiler\/react-compiler: +\["error/;var ui={meta:{type:"problem",docs:{description:"enforces the Rules of Hooks",recommended:!0,url:"https://reactjs.org/docs/hooks-rules.html"},schema:[{type:"object",ignoreIfReactCompilerIsEnabled:!1,properties:{ignoreIfReactCompilerIsEnabled:{type:"boolean"},reactCompilerIsEnabled:{type:"boolean"}}}]},create(e){let t=!!e.options[0]?.reactCompilerIsEnabled;if(t)return{CallExpression(a){let u=null;a.callee.name==="useMemo"?u="useMemo":a.callee.name==="useCallback"&&(u="useCallback"),u&&e.report({node:a,message:`"${u}" is not necessary when using React Compiler.`})}};if(e.options[0]?.ignoreIfReactCompilerIsEnabled||t){for(let a of e.sourceCode.getAllComments())if(Ea.test(a.value))return{CallExpression(u){let f=null;u.callee.name==="useMemo"?f="useMemo":u.callee.name==="useCallback"&&(f="useCallback"),f&&e.report({node:u,message:`"${f}" is not necessary when using React Compiler.`})}}}let r=typeof e.getSource=="function"?a=>r(a):a=>e.sourceCode.getText(a),n=typeof e.getScope=="function"?()=>n():a=>e.sourceCode.getScope(a),o=null,s=[],i=[],l=new WeakSet;function c(a){for(let u of a.references){let f=u.identifier.parent;if(f.type==="VariableDeclarator"&&f.init&&f.init.type==="CallExpression"&&f.init.callee&&ii(f.init.callee))for(let y of u.resolved.references)y!==u&&l.add(y.identifier)}}return{onCodePathSegmentStart:a=>i.push(a),onCodePathSegmentEnd:()=>i.pop(),onCodePathStart:()=>s.push(new Map),onCodePathEnd(a,u){let f=s.pop();if(f.size===0)return;let y=new Set;function x(h,b){let{cache:w}=x,k=w.get(h.id),N=new Set(b);if(N.has(h.id)){let p=[...N],F=p.slice(p.indexOf(h.id)+1);for(let d of F)y.add(d);return BigInt("0")}if(N.add(h.id),k!==void 0)return k;if(a.thrownSegments.includes(h))k=BigInt("0");else if(h.prevSegments.length===0)k=BigInt("1");else{k=BigInt("0");for(let p of h.prevSegments)k+=x(p,N)}return h.reachable&&k===BigInt("0")?w.delete(h.id):w.set(h.id,k),k}function m(h,b){let{cache:w}=m,k=w.get(h.id),N=new Set(b);if(N.has(h.id)){let p=Array.from(N),F=p.slice(p.indexOf(h.id)+1);for(let d of F)y.add(d);return BigInt("0")}if(N.add(h.id),k!==void 0)return k;if(a.thrownSegments.includes(h))k=BigInt("0");else if(h.nextSegments.length===0)k=BigInt("1");else{k=BigInt("0");for(let p of h.nextSegments)k+=m(p,N)}return w.set(h.id,k),k}function E(h){let{cache:b}=E,w=b.get(h.id);if(w===null)return 1/0;if(w!==void 0)return w;if(b.set(h.id,null),h.prevSegments.length===0)w=1;else{w=1/0;for(let k of h.prevSegments){let N=E(k);N<w&&(w=N)}w+=1}return b.set(h.id,w),w}x.cache=new Map,m.cache=new Map,E.cache=new Map;let C=m(a.initialSegment),S=fi(u),I=Nn(u),A=S?ai(S)||vt(S):pi(u)||ci(u),T=1/0;for(let h of a.finalSegments){if(!h.reachable)continue;let b=E(h);b<T&&(T=b)}for(let[h,b]of f){if(!h.reachable)continue;let w=h.nextSegments.length===0?T<=E(h):T<E(h),k=x(h)*m(h),N=y.has(h.id);for(let p of b)if(N&&!Dn(p)&&e.report({node:p,message:`React Hook "${r(p)}" may be executed more than once. Possibly because it is called in a loop. React Hooks must be called in the exact same order in every component render.`}),A){if(u.async&&e.report({node:p,message:`React Hook "${r(p)}" cannot be called in an async function.`}),!N&&k!==C&&!Dn(p)){let d=`React Hook "${r(p)}" is called conditionally. React Hooks must be called in the exact same order in every component render.`+(w?" Did you accidentally call a React Hook after an early return?":"");e.report({node:p,message:d})}}else if(u.parent&&(u.parent.type==="MethodDefinition"||u.parent.type==="ClassProperty")&&u.parent.value===u){let F=`React Hook "${r(p)}" cannot be called in a class component. React Hooks must be called in a React function component or a custom React Hook function.`;e.report({node:p,message:F})}else if(S){let F=`React Hook "${r(p)}" is called in function "${r(S)}" that is neither a React function component nor a custom React Hook function. React component names must start with an uppercase letter. React Hook names must start with the word "use".`;e.report({node:p,message:F})}else if(u.type==="Program"){let F=`React Hook "${r(p)}" cannot be called at the top level. React Hooks must be called in a React function component or a custom React Hook function.`;e.report({node:p,message:F})}else if(I&&!Dn(p)){if(u.parent.type==="CallExpression"&&u.parent.callee.type==="Identifier"&&u.parent.callee.name==="useCallback"){let d=u.parent;if(d.parent.type==="VariableDeclarator"&&si(d.parent.id.name))return}let F=`React Hook "${r(p)}" cannot be called inside a callback. React Hooks must be called in a React function component or a custom React Hook function.`;e.report({node:p,message:F})}}},CallExpression(a){if(vt(a.callee)){let u=oi(s),f=oi(i),y=u.get(f);y||(y=[],u.set(f,y)),y.push(a.callee)}a.callee.type==="Identifier"&&(a.callee.name==="useEffect"||ii(a.callee))&&a.arguments.length>0&&(o=a)},Identifier(a){o==null&&l.has(a)&&a.parent.type!=="CallExpression"&&e.report({node:a,message:`\`${r(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===o&&(o=null)},FunctionDeclaration(a){Nn(a)&&c(n(a))},ArrowFunctionExpression(a){Nn(a)&&c(n(a))}}}};function fi(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 oi(e){return e[e.length-1]}var ge=require("@typescript-eslint/utils"),xe=Pe(require("zod/v4"));var ba=/^\s+$/,jn=/\r?\n/,xa=/^(\s*)/,Ca=/^(\s*)\S/,Ia=/\r?\n/,Aa=xe.object({indent:xe.union([xe.string().regex(ba),xe.number().int().min(1)]).optional(),tags:xe.array(xe.string()).optional(),functions:xe.array(xe.string()).optional(),comments:xe.array(xe.string()).optional()}),Ln=X({name:"template-indent",meta:{type:"suggestion",docs:{description:"Fix whitespace-insensitive template indentation"},fixable:"code",schema:[z(Aa)],messages:{improperlyIndented:"Templates should be properly indented."}},defaultOptions:[{}],create(e){let t=e.sourceCode,{comments:r=["HTML","indent"],functions:n=["dedent","stripIndent"],tags:o=["outdent","dedent","gql","sql","html","styled"],indent:s}=e.options[0],i=r.map(S=>S.toLowerCase());function l(S){let I=S.split(jn),A=I.filter(h=>h.trim()!=="");if(A.length===0)return S;let T=Number.POSITIVE_INFINITY;for(let h of A){let b=h.match(xa);b&&(T=Math.min(T,b[1]?.length??0))}return!isFinite(T)||T===0?S:I.map(h=>h.slice(T)).join(`
36
- `)}function c(S,I,A){return S.split(jn).map(h=>h.trim()===""?h:A.repeat(I)+h).join(`
37
- `)}function a(S){if(S.type===ge.AST_NODE_TYPES.Identifier)return S.name;if(S.type===ge.AST_NODE_TYPES.MemberExpression){let I=S.object.type===ge.AST_NODE_TYPES.Identifier?S.object.name:null,A=S.property.type===ge.AST_NODE_TYPES.Identifier?S.property.name:null;return I&&A?`${I}.${A}`:A}return null}function u(S,I){if(!S)return!1;for(let A of I)if(A.includes(".")){let T=A.split(".");if(S.type===ge.AST_NODE_TYPES.MemberExpression&&S.object.type===ge.AST_NODE_TYPES.Identifier&&S.property.type===ge.AST_NODE_TYPES.Identifier&&S.object.name===T[0]&&S.property.name===T[1])return!0}else if(S.type===ge.AST_NODE_TYPES.Identifier&&S.name===A)return!0;return!1}function f(S,I){let A=S.parent;if(A.type!==ge.AST_NODE_TYPES.TaggedTemplateExpression)return!1;let T=a(A.tag);return T?I.includes(T):!1}function y(S,I){if(!S||S.type!==ge.AST_NODE_TYPES.CallExpression)return!1;let{method:A,argumentsLength:T,optionalCall:h=!0,optionalMember:b=!0}=I;return T!==void 0&&S.arguments.length!==T||!h&&S.optional||S.callee.type!==ge.AST_NODE_TYPES.MemberExpression||!b&&S.callee.optional||S.callee.property.type!==ge.AST_NODE_TYPES.Identifier?!1:S.callee.property.name===A}function x(S,I){if(!S||S.type!==ge.AST_NODE_TYPES.CallExpression)return!1;let{name:A,argumentsLength:T,optionalCall:h=!0}=I;return T!==void 0&&S.arguments.length!==T||!h&&S.optional||S.callee.type!==ge.AST_NODE_TYPES.Identifier?!1:S.callee.name===A}function m(S){return y(S.parent,{method:"toMatchInlineSnapshot",argumentsLength:1,optionalCall:!1,optionalMember:!1})&&S.parent.type===ge.AST_NODE_TYPES.CallExpression&&S.parent.arguments[0]===S&&x(S.parent.callee.type===ge.AST_NODE_TYPES.MemberExpression?S.parent.callee.object:null,{name:"expect",argumentsLength:1,optionalCall:!1,optionalMember:!1})}function E(S){if(i.length>0){let I=t.getTokenBefore(S,{includeComments:!0});if(I?.type===ge.AST_TOKEN_TYPES.Block&&i.includes(I.value.trim().toLowerCase()))return!0}return!!(m(S)||o.length>0&&f(S,o)||n.length>0&&S.parent.type===ge.AST_NODE_TYPES.CallExpression&&S.parent.arguments.includes(S)&&u(S.parent.callee,n))}function C(S){let I=`__PLACEHOLDER__${Math.random()}`,A=S.quasis.map(j=>t.getText(j).slice(1,j.tail?-1:-2)).join(I),T=A.match(Ia);if(!T)return;let h=T[0],b=t.lines[t.getLocFromIndex(S.range[0]).line-1];if(!b)return;let k=b.match(Ca)?.[1]??"",N;typeof s=="string"?N=s:typeof s=="number"?N=" ".repeat(s):N=k.startsWith(" ")?" ":" ";let F=l(A).replace(new RegExp(`^${h}|${h}[ ]*$`,"g"),""),d=h+c(F,1,k+N)+h+k,g=A.includes(`\r
35
+ ${f}`)),m.push(u.replaceText(o,y)),m}}]})}var Rt=require("@typescript-eslint/utils"),Sa=Rt.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),ni="require-description",Ta=/^(eslint(?:-env|-enable|-disable(?:(?:-next)?-line)?)?|exported|globals?)(?:\s|$)/u,ha=/^eslint-disable-(next-)?line$/u,Ea=Sa({name:ni,meta:{type:"problem",docs:{description:"Require descriptions for eslint directives."},messages:{missingDescription:"Unexpected undescribed directive comment. Include descriptions to explain why the comment is necessary."},schema:[{type:"object",properties:{ignore:{type:"array",items:{type:"string",enum:["eslint","eslint-disable","eslint-disable-line","eslint-disable-next-line","eslint-enable","eslint-env","exported","global","globals"]},additionalItems:!1,uniqueItems:!0}},additionalProperties:!1}]},defaultOptions:[{ignore:[]}],create(e,[t]){let r=e.sourceCode,n=new Set(t.ignore||[]);return{Program(){for(let o of r.getAllComments()){let s=ba(o);s!=null&&(n.has(s.kind)||s.description||e.report({loc:Ia(o.loc),messageId:"missingDescription"}))}}}}}),ri={name:ni,rule:Ea};function ba(e){let{text:t,description:r}=Ca(e.value);if(!t)return null;let n=Ta.exec(t);if(!n)return null;let o=n[1];if(!o)return null;let s=ha.test(o);if(e.type===Rt.TSESTree.AST_TOKEN_TYPES.Line&&!s||s&&e.loc.start.line!==e.loc.end.line)return null;let i=t.slice(n.index+o.length);return{kind:o,value:i.trim(),description:r}}var xa=/\s-{2,}\s/u;function Ca(e){let t=e.split(xa);return{text:t[0]?.trim(),description:t.length>1?t[1]?.trim()??null:null}}function Ia(e){return{start:{line:e.start.line,column:-1},end:e.end}}var ne=require("@typescript-eslint/utils"),$e=require("zod/v4");var Aa=$e.z.object({varsToCheck:$e.z.array($e.z.object({selector:$e.z.string().optional(),fromFnCall:$e.z.string().optional(),prop:$e.z.string().or($e.z.array($e.z.string())),errorMsg:$e.z.string().optional()}))}),On=X({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(Aa)]},defaultOptions:[{varsToCheck:[]}],create(e,[t]){let r=new Map;function n(i,l,c,a){let u=new Set;for(let y of i.properties)y.type===ne.AST_NODE_TYPES.Property&&y.key.type===ne.AST_NODE_TYPES.Identifier&&u.add(y.key.name);let f=l.filter(y=>!u.has(y));if(f.length>0)if(f.length===1)e.report({node:i,messageId:"propNotRead",data:{prop:f[0],fnName:a,customMsg:c||""}});else{let y=f.map(x=>`"${x}"`).join(", ");e.report({node:i,messageId:"propsNotRead",data:{props:y,fnName:a,customMsg:c||""}})}}function o(i){if(i.init?.type===ne.AST_NODE_TYPES.CallExpression){if(i.init.callee.type===ne.AST_NODE_TYPES.Identifier)return i.init.callee.name;if(i.init.callee.type===ne.AST_NODE_TYPES.MemberExpression&&i.init.callee.property.type===ne.AST_NODE_TYPES.Identifier)return i.init.callee.object.type===ne.AST_NODE_TYPES.Identifier?`${i.init.callee.object.name}.${i.init.callee.property.name}`:i.init.callee.property.name}return"unknown function"}let s={};for(let i of t.varsToCheck)i.selector&&(s[i.selector]=l=>{if(l.type===ne.AST_NODE_TYPES.VariableDeclarator&&l.id.type===ne.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:o(l)}),l.type===ne.AST_NODE_TYPES.VariableDeclarator&&l.id.type===ne.AST_NODE_TYPES.ObjectPattern){let c=Array.isArray(i.prop)?i.prop:[i.prop];n(l.id,c,i.errorMsg,o(l))}});for(let i of t.varsToCheck)if(i.fromFnCall){let l=i.fromFnCall;if(l.startsWith("*.")){let a=`VariableDeclarator > CallExpression > MemberExpression[property.name="${l.slice(2)}"]`;s[a]=u=>{if(u.type!==ne.AST_NODE_TYPES.MemberExpression||u.parent.type!==ne.AST_NODE_TYPES.CallExpression)return;let f=u.parent;if(f.parent.type!==ne.AST_NODE_TYPES.VariableDeclarator)return;let y=f.parent;if(y.id.type===ne.AST_NODE_TYPES.Identifier)r.set(y.id.name,{props:Array.isArray(i.prop)?i.prop:[i.prop],errorMsg:i.errorMsg,node:y.id,fnName:i.fromFnCall||"unknown function"});else if(y.id.type===ne.AST_NODE_TYPES.ObjectPattern){let x=Array.isArray(i.prop)?i.prop:[i.prop];n(y.id,x,i.errorMsg,i.fromFnCall||"unknown function")}}}else if(l.includes(".")){let[c,a]=l.split("."),u=`VariableDeclarator > CallExpression > MemberExpression[object.name="${c}"][property.name="${a}"]`;s[u]=f=>{if(f.type!==ne.AST_NODE_TYPES.MemberExpression||f.parent.type!==ne.AST_NODE_TYPES.CallExpression)return;let y=f.parent;if(y.parent.type!==ne.AST_NODE_TYPES.VariableDeclarator)return;let x=y.parent;if(x.id.type===ne.AST_NODE_TYPES.Identifier)r.set(x.id.name,{props:Array.isArray(i.prop)?i.prop:[i.prop],errorMsg:i.errorMsg,node:x.id,fnName:i.fromFnCall||"unknown function"});else if(x.id.type===ne.AST_NODE_TYPES.ObjectPattern){let m=Array.isArray(i.prop)?i.prop:[i.prop];n(x.id,m,i.errorMsg,i.fromFnCall||"unknown function")}}}else{let c=`VariableDeclarator > CallExpression > Identifier[name="${l}"]`;s[c]=a=>{if(a.type!==ne.AST_NODE_TYPES.Identifier||a.parent.type!==ne.AST_NODE_TYPES.CallExpression)return;let u=a.parent;if(u.parent.type!==ne.AST_NODE_TYPES.VariableDeclarator)return;let f=u.parent;if(f.id.type===ne.AST_NODE_TYPES.Identifier)r.set(f.id.name,{props:Array.isArray(i.prop)?i.prop:[i.prop],errorMsg:i.errorMsg,node:f.id,fnName:i.fromFnCall||"unknown function"});else if(f.id.type===ne.AST_NODE_TYPES.ObjectPattern){let y=Array.isArray(i.prop)?i.prop:[i.prop];n(f.id,y,i.errorMsg,i.fromFnCall||"unknown function")}}}}return{...s,"Program:exit"(){for(let[i,{props:l,errorMsg:c,node:a,fnName:u}]of r){let y=e.sourceCode.getScope(a).set.get(i);if(y){let x=new Set(l);for(let m of y.references){let E=m.identifier,C=E.parent;if(!(C.type===ne.AST_NODE_TYPES.VariableDeclarator&&C.id===E)){if(C.type===ne.AST_NODE_TYPES.MemberExpression&&C.object===E&&C.property.type===ne.AST_NODE_TYPES.Identifier&&x.has(C.property.name)){if(x.delete(C.property.name),x.size===0)break;continue}if(C.type===ne.AST_NODE_TYPES.VariableDeclarator&&C.init===E&&C.id.type===ne.AST_NODE_TYPES.ObjectPattern){for(let T of C.id.properties)T.type===ne.AST_NODE_TYPES.Property&&T.key.type===ne.AST_NODE_TYPES.Identifier&&x.has(T.key.name)&&x.delete(T.key.name);if(x.size===0)break;continue}if(!(C.type===ne.AST_NODE_TYPES.MemberExpression&&C.object===E&&C.property.type===ne.AST_NODE_TYPES.Identifier&&!l.includes(C.property.name))){x.clear();break}}}if(x.size>0){let m=Array.from(x);if(m.length===1)e.report({node:a,messageId:"propNotRead",data:{prop:m[0],fnName:u,customMsg:c||""}});else{let E=m.map(C=>`"${C}"`).join(", ");e.report({node:a,messageId:"propsNotRead",data:{props:E,fnName:u,customMsg:c||""}})}}}}}}}});function li(e){return/^use[A-Z0-9]/.test(e)}function vt(e){return e.type==="Identifier"?li(e.name):e.type==="MemberExpression"&&!e.computed&&vt(e.property)?e.object.type==="Identifier":!1}function pi(e){return e.type==="Identifier"&&/^[A-Z]/.test(e.name)}function ci(e,t){return e.name===t||e.type==="MemberExpression"&&e.object.name==="React"&&e.property.name===t}function ui(e){return!!(e.parent&&e.parent.callee&&ci(e.parent.callee,"forwardRef"))}function fi(e){return!!(e.parent&&e.parent.callee&&ci(e.parent.callee,"memo"))}function Nn(e){for(;e;){let t=yi(e);if(t&&(pi(t)||vt(t))||ui(e)||fi(e))return!0;e=e.parent}return!1}function ii(e){return!1}function Dn(e){return!1}var wa=/eslint +react-compiler\/react-compiler: +\["error/;function oi(e){let t=null;if((e.type==="FunctionDeclaration"||e.type==="FunctionExpression"||e.type==="ArrowFunctionExpression"&&e.body.type==="BlockStatement")&&(t=e.body),!t||t.body.length===0)return!1;let r=t.body[0];return r.type==="ExpressionStatement"&&r.expression.type==="Literal"&&r.expression.value==="use no memo"}function si(e){let t=e.parent;for(;t;){if(t.type==="FunctionDeclaration"||t.type==="FunctionExpression"||t.type==="ArrowFunctionExpression")return t;t=t.parent}return null}var mi={meta:{type:"problem",docs:{description:"enforces the Rules of Hooks",recommended:!0,url:"https://reactjs.org/docs/hooks-rules.html"},schema:[{type:"object",ignoreIfReactCompilerIsEnabled:!1,properties:{ignoreIfReactCompilerIsEnabled:{type:"boolean"},reactCompilerIsEnabled:{type:"boolean"}}}]},create(e){let t=!!e.options[0]?.reactCompilerIsEnabled;if(t)return{CallExpression(a){let u=si(a);if(u&&oi(u))return;let f=null;a.callee.name==="useMemo"?f="useMemo":a.callee.name==="useCallback"&&(f="useCallback"),f&&e.report({node:a,message:`"${f}" is not necessary when using React Compiler.`})}};if(e.options[0]?.ignoreIfReactCompilerIsEnabled||t){for(let a of e.sourceCode.getAllComments())if(wa.test(a.value))return{CallExpression(u){let f=si(u);if(f&&oi(f))return;let y=null;u.callee.name==="useMemo"?y="useMemo":u.callee.name==="useCallback"&&(y="useCallback"),y&&e.report({node:u,message:`"${y}" is not necessary when using React Compiler.`})}}}let r=typeof e.getSource=="function"?a=>r(a):a=>e.sourceCode.getText(a),n=typeof e.getScope=="function"?()=>n():a=>e.sourceCode.getScope(a),o=null,s=[],i=[],l=new WeakSet;function c(a){for(let u of a.references){let f=u.identifier.parent;if(f.type==="VariableDeclarator"&&f.init&&f.init.type==="CallExpression"&&f.init.callee&&ii(f.init.callee))for(let y of u.resolved.references)y!==u&&l.add(y.identifier)}}return{onCodePathSegmentStart:a=>i.push(a),onCodePathSegmentEnd:()=>i.pop(),onCodePathStart:()=>s.push(new Map),onCodePathEnd(a,u){let f=s.pop();if(f.size===0)return;let y=new Set;function x(h,b){let{cache:w}=x,k=w.get(h.id),O=new Set(b);if(O.has(h.id)){let p=[...O],F=p.slice(p.indexOf(h.id)+1);for(let d of F)y.add(d);return BigInt("0")}if(O.add(h.id),k!==void 0)return k;if(a.thrownSegments.includes(h))k=BigInt("0");else if(h.prevSegments.length===0)k=BigInt("1");else{k=BigInt("0");for(let p of h.prevSegments)k+=x(p,O)}return h.reachable&&k===BigInt("0")?w.delete(h.id):w.set(h.id,k),k}function m(h,b){let{cache:w}=m,k=w.get(h.id),O=new Set(b);if(O.has(h.id)){let p=Array.from(O),F=p.slice(p.indexOf(h.id)+1);for(let d of F)y.add(d);return BigInt("0")}if(O.add(h.id),k!==void 0)return k;if(a.thrownSegments.includes(h))k=BigInt("0");else if(h.nextSegments.length===0)k=BigInt("1");else{k=BigInt("0");for(let p of h.nextSegments)k+=m(p,O)}return w.set(h.id,k),k}function E(h){let{cache:b}=E,w=b.get(h.id);if(w===null)return 1/0;if(w!==void 0)return w;if(b.set(h.id,null),h.prevSegments.length===0)w=1;else{w=1/0;for(let k of h.prevSegments){let O=E(k);O<w&&(w=O)}w+=1}return b.set(h.id,w),w}x.cache=new Map,m.cache=new Map,E.cache=new Map;let C=m(a.initialSegment),T=yi(u),I=Nn(u),A=T?pi(T)||vt(T):ui(u)||fi(u),S=1/0;for(let h of a.finalSegments){if(!h.reachable)continue;let b=E(h);b<S&&(S=b)}for(let[h,b]of f){if(!h.reachable)continue;let w=h.nextSegments.length===0?S<=E(h):S<E(h),k=x(h)*m(h),O=y.has(h.id);for(let p of b)if(O&&!Dn(p)&&e.report({node:p,message:`React Hook "${r(p)}" may be executed more than once. Possibly because it is called in a loop. React Hooks must be called in the exact same order in every component render.`}),A){if(u.async&&e.report({node:p,message:`React Hook "${r(p)}" cannot be called in an async function.`}),!O&&k!==C&&!Dn(p)){let d=`React Hook "${r(p)}" is called conditionally. React Hooks must be called in the exact same order in every component render.`+(w?" Did you accidentally call a React Hook after an early return?":"");e.report({node:p,message:d})}}else if(u.parent&&(u.parent.type==="MethodDefinition"||u.parent.type==="ClassProperty")&&u.parent.value===u){let F=`React Hook "${r(p)}" cannot be called in a class component. React Hooks must be called in a React function component or a custom React Hook function.`;e.report({node:p,message:F})}else if(T){let F=`React Hook "${r(p)}" is called in function "${r(T)}" that is neither a React function component nor a custom React Hook function. React component names must start with an uppercase letter. React Hook names must start with the word "use".`;e.report({node:p,message:F})}else if(u.type==="Program"){let F=`React Hook "${r(p)}" cannot be called at the top level. React Hooks must be called in a React function component or a custom React Hook function.`;e.report({node:p,message:F})}else if(I&&!Dn(p)){if(u.parent.type==="CallExpression"&&u.parent.callee.type==="Identifier"&&u.parent.callee.name==="useCallback"){let d=u.parent;if(d.parent.type==="VariableDeclarator"&&li(d.parent.id.name))return}let F=`React Hook "${r(p)}" cannot be called inside a callback. React Hooks must be called in a React function component or a custom React Hook function.`;e.report({node:p,message:F})}}},CallExpression(a){if(vt(a.callee)){let u=ai(s),f=ai(i),y=u.get(f);y||(y=[],u.set(f,y)),y.push(a.callee)}a.callee.type==="Identifier"&&(a.callee.name==="useEffect"||ii(a.callee))&&a.arguments.length>0&&(o=a)},Identifier(a){o==null&&l.has(a)&&a.parent.type!=="CallExpression"&&e.report({node:a,message:`\`${r(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===o&&(o=null)},FunctionDeclaration(a){Nn(a)&&c(n(a))},ArrowFunctionExpression(a){Nn(a)&&c(n(a))}}}};function yi(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 ai(e){return e[e.length-1]}var ge=require("@typescript-eslint/utils"),xe=Pe(require("zod/v4"));var Fa=/^\s+$/,jn=/\r?\n/,Ra=/^(\s*)/,va=/^(\s*)\S/,ka=/\r?\n/,Pa=xe.object({indent:xe.union([xe.string().regex(Fa),xe.number().int().min(1)]).optional(),tags:xe.array(xe.string()).optional(),functions:xe.array(xe.string()).optional(),comments:xe.array(xe.string()).optional()}),Ln=X({name:"template-indent",meta:{type:"suggestion",docs:{description:"Fix whitespace-insensitive template indentation"},fixable:"code",schema:[J(Pa)],messages:{improperlyIndented:"Templates should be properly indented."}},defaultOptions:[{}],create(e){let t=e.sourceCode,{comments:r=["HTML","indent"],functions:n=["dedent","stripIndent"],tags:o=["outdent","dedent","gql","sql","html","styled"],indent:s}=e.options[0],i=r.map(T=>T.toLowerCase());function l(T){let I=T.split(jn),A=I.filter(h=>h.trim()!=="");if(A.length===0)return T;let S=Number.POSITIVE_INFINITY;for(let h of A){let b=h.match(Ra);b&&(S=Math.min(S,b[1]?.length??0))}return!isFinite(S)||S===0?T:I.map(h=>h.slice(S)).join(`
36
+ `)}function c(T,I,A){return T.split(jn).map(h=>h.trim()===""?h:A.repeat(I)+h).join(`
37
+ `)}function a(T){if(T.type===ge.AST_NODE_TYPES.Identifier)return T.name;if(T.type===ge.AST_NODE_TYPES.MemberExpression){let I=T.object.type===ge.AST_NODE_TYPES.Identifier?T.object.name:null,A=T.property.type===ge.AST_NODE_TYPES.Identifier?T.property.name:null;return I&&A?`${I}.${A}`:A}return null}function u(T,I){if(!T)return!1;for(let A of I)if(A.includes(".")){let S=A.split(".");if(T.type===ge.AST_NODE_TYPES.MemberExpression&&T.object.type===ge.AST_NODE_TYPES.Identifier&&T.property.type===ge.AST_NODE_TYPES.Identifier&&T.object.name===S[0]&&T.property.name===S[1])return!0}else if(T.type===ge.AST_NODE_TYPES.Identifier&&T.name===A)return!0;return!1}function f(T,I){let A=T.parent;if(A.type!==ge.AST_NODE_TYPES.TaggedTemplateExpression)return!1;let S=a(A.tag);return S?I.includes(S):!1}function y(T,I){if(!T||T.type!==ge.AST_NODE_TYPES.CallExpression)return!1;let{method:A,argumentsLength:S,optionalCall:h=!0,optionalMember:b=!0}=I;return S!==void 0&&T.arguments.length!==S||!h&&T.optional||T.callee.type!==ge.AST_NODE_TYPES.MemberExpression||!b&&T.callee.optional||T.callee.property.type!==ge.AST_NODE_TYPES.Identifier?!1:T.callee.property.name===A}function x(T,I){if(!T||T.type!==ge.AST_NODE_TYPES.CallExpression)return!1;let{name:A,argumentsLength:S,optionalCall:h=!0}=I;return S!==void 0&&T.arguments.length!==S||!h&&T.optional||T.callee.type!==ge.AST_NODE_TYPES.Identifier?!1:T.callee.name===A}function m(T){return y(T.parent,{method:"toMatchInlineSnapshot",argumentsLength:1,optionalCall:!1,optionalMember:!1})&&T.parent.type===ge.AST_NODE_TYPES.CallExpression&&T.parent.arguments[0]===T&&x(T.parent.callee.type===ge.AST_NODE_TYPES.MemberExpression?T.parent.callee.object:null,{name:"expect",argumentsLength:1,optionalCall:!1,optionalMember:!1})}function E(T){if(i.length>0){let I=t.getTokenBefore(T,{includeComments:!0});if(I?.type===ge.AST_TOKEN_TYPES.Block&&i.includes(I.value.trim().toLowerCase()))return!0}return!!(m(T)||o.length>0&&f(T,o)||n.length>0&&T.parent.type===ge.AST_NODE_TYPES.CallExpression&&T.parent.arguments.includes(T)&&u(T.parent.callee,n))}function C(T){let I=`__PLACEHOLDER__${Math.random()}`,A=T.quasis.map(j=>t.getText(j).slice(1,j.tail?-1:-2)).join(I),S=A.match(ka);if(!S)return;let h=S[0],b=t.lines[t.getLocFromIndex(T.range[0]).line-1];if(!b)return;let k=b.match(va)?.[1]??"",O;typeof s=="string"?O=s:typeof s=="number"?O=" ".repeat(s):O=k.startsWith(" ")?" ":" ";let F=l(A).replace(new RegExp(`^${h}|${h}[ ]*$`,"g"),""),d=h+c(F,1,k+O)+h+k,g=A.includes(`\r
38
38
  `)?`\r
39
39
  `:`
40
- `,R=A.split(jn),P=R.map((j,V)=>V!==R.length-1&&j===N+k?"":j).join(g);if(d!==P)return{node:S,messageId:"improperlyIndented",fix:j=>d.split(I).map((V,G)=>{let Y=S.quasis[G];return Y?j.replaceTextRange([Y.range[0]+1,Y.range[1]-(Y.tail?1:2)],V):[]}).flat()}}return{TemplateLiteral(S){if(!E(S))return;let I=C(S);if(I)return e.report(I)}}}});var Mn=require("@typescript-eslint/utils");function wa(e){if(!("regex"in e))return!1;let t=e.regex.flags;return t.includes("g")||t.includes("y")}function Fa(e){let t=e.parent;return t?.type===Mn.AST_NODE_TYPES.NewExpression&&t.callee.type===Mn.AST_NODE_TYPES.Identifier&&t.callee.name==="RegExp"}var _n=X({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){wa(r)||Fa(r)||e.report({node:r,messageId:"regexShouldBeTopLevel"})}return{"FunctionDeclaration Literal[regex], FunctionExpression Literal[regex], ArrowFunctionExpression Literal[regex], MethodDefinition Literal[regex]":t}}});var Te=require("@typescript-eslint/utils"),st=require("zod/v4");var Ra=st.z.object({checkOnly:st.z.array(st.z.enum(["function-args","FC","generic-args-at-fn-calls"])).optional(),checkTypesFromSelectors:st.z.array(st.z.string()).optional()}),$n=X({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:[z(Ra)],messages:{moveTypeAboveUsage:"Type definition should be placed directly above its first usage."}},defaultOptions:[{}],create(e,[t]){let r=e.sourceCode,n=new Map,o=[];function s(m){for(let E of o)if(m.range[0]>=E.range[0]&&m.range[1]<=E.range[1])return E;return null}function i(m){let E=m.parent;for(;E;){if(E.type===Te.AST_NODE_TYPES.FunctionDeclaration||E.type===Te.AST_NODE_TYPES.FunctionExpression||E.type===Te.AST_NODE_TYPES.ArrowFunctionExpression){let C=E.params;for(let S of C)if(m.range[0]>=S.range[0]&&m.range[1]<=S.range[1])return!0;break}E=E.parent}return!1}function l(m){let E=m.parent;for(;E;){if(E.type===Te.AST_NODE_TYPES.TSTypeParameterInstantiation){let C=E.parent;if(C.type===Te.AST_NODE_TYPES.TSTypeReference&&C.typeName.type===Te.AST_NODE_TYPES.Identifier&&(C.typeName.name==="FC"||C.typeName.name==="React.FC")||C.type===Te.AST_NODE_TYPES.TSTypeReference&&C.typeName.type===Te.AST_NODE_TYPES.TSQualifiedName&&C.typeName.right.name==="FC")return!0}E=E.parent}return!1}function c(m){let E=m.parent;for(;E;){if(E.type===Te.AST_NODE_TYPES.TSTypeParameterInstantiation){let C=E.parent;if(C.type===Te.AST_NODE_TYPES.CallExpression||C.type===Te.AST_NODE_TYPES.NewExpression)return!0}E=E.parent}return!1}function a(m){let E=m.parent;for(;E;){if(E.type===Te.AST_NODE_TYPES.TSTypeAliasDeclaration||E.type===Te.AST_NODE_TYPES.TSInterfaceDeclaration)return!0;E=E.parent}return!1}function u(m){return m.parent.type===Te.AST_NODE_TYPES.TSIndexedAccessType&&m.parent.objectType===m}let f=[];function y(m){let E=[],C=new Map;for(let{typeName:I,firstUsage:A}of m){let T=C.get(A)||[];T.push(I),C.set(A,T)}for(let{typeName:I,firstUsage:A,firstUsagePosition:T,firstUsageInFunctionArgs:h}of m){let b=n.get(I);if(!b||b.statement===A)continue;let w=o.indexOf(b.statement),k=o.indexOf(A);if(w===-1||k===-1)continue;let N=!!(t.checkOnly&&t.checkOnly.includes("function-args")&&h),F=(C.get(A)||[]).length>1;(N||F?w>k:w>k||w!==k-1)&&E.push({typeName:I,typeDef:b,targetStatement:A,firstUsagePosition:T})}if(E.length===0)return;E.sort((I,A)=>{let T=I.firstUsagePosition-A.firstUsagePosition;if(T!==0)return T;let h=o.indexOf(I.typeDef.statement),b=o.indexOf(A.typeDef.statement);return h-b});let S=E[0];S&&e.report({node:S.typeDef.node,messageId:"moveTypeAboveUsage",fix:x(E)})}function x(m){return function*(E){let C=new Map;for(let S of m){let I=C.get(S.targetStatement)||[];I.push(S),C.set(S.targetStatement,I)}for(let[,S]of C)S.sort((I,A)=>{let T=I.firstUsagePosition-A.firstUsagePosition;if(T!==0)return T;let h=o.indexOf(I.typeDef.statement),b=o.indexOf(A.typeDef.statement);return h-b});for(let S of m){let{typeDef:I}=S,A=I.statement,T=r.getCommentsBefore(A),h=A.range[0],b=A.range[1];T.length>0&&T[0]&&(h=T[0].range[0]),yield E.removeRange([h,b])}for(let[S,I]of C){let A=r.getCommentsBefore(S),T=A.length>0&&A[0]?A[0].range[0]:S.range[0],h=[];for(let b of I){let w=b.typeDef.statement,k=r.getText(w),N=r.getCommentsBefore(w),p=k;N.length>0&&(p=`${N.map(d=>r.getText(d)).join(`
40
+ `,R=A.split(jn),P=R.map((j,V)=>V!==R.length-1&&j===O+k?"":j).join(g);if(d!==P)return{node:T,messageId:"improperlyIndented",fix:j=>d.split(I).map((V,G)=>{let H=T.quasis[G];return H?j.replaceTextRange([H.range[0]+1,H.range[1]-(H.tail?1:2)],V):[]}).flat()}}return{TemplateLiteral(T){if(!E(T))return;let I=C(T);if(I)return e.report(I)}}}});var Mn=require("@typescript-eslint/utils");function Oa(e){if(!("regex"in e))return!1;let t=e.regex.flags;return t.includes("g")||t.includes("y")}function Na(e){let t=e.parent;return t?.type===Mn.AST_NODE_TYPES.NewExpression&&t.callee.type===Mn.AST_NODE_TYPES.Identifier&&t.callee.name==="RegExp"}var _n=X({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){Oa(r)||Na(r)||e.report({node:r,messageId:"regexShouldBeTopLevel"})}return{"FunctionDeclaration Literal[regex], FunctionExpression Literal[regex], ArrowFunctionExpression Literal[regex], MethodDefinition Literal[regex]":t}}});var Te=require("@typescript-eslint/utils"),st=require("zod/v4");var Da=st.z.object({checkOnly:st.z.array(st.z.enum(["function-args","FC","generic-args-at-fn-calls"])).optional(),checkTypesFromSelectors:st.z.array(st.z.string()).optional()}),$n=X({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(Da)],messages:{moveTypeAboveUsage:"Type definition should be placed directly above its first usage."}},defaultOptions:[{}],create(e,[t]){let r=e.sourceCode,n=new Map,o=[];function s(m){for(let E of o)if(m.range[0]>=E.range[0]&&m.range[1]<=E.range[1])return E;return null}function i(m){let E=m.parent;for(;E;){if(E.type===Te.AST_NODE_TYPES.FunctionDeclaration||E.type===Te.AST_NODE_TYPES.FunctionExpression||E.type===Te.AST_NODE_TYPES.ArrowFunctionExpression){let C=E.params;for(let T of C)if(m.range[0]>=T.range[0]&&m.range[1]<=T.range[1])return!0;break}E=E.parent}return!1}function l(m){let E=m.parent;for(;E;){if(E.type===Te.AST_NODE_TYPES.TSTypeParameterInstantiation){let C=E.parent;if(C.type===Te.AST_NODE_TYPES.TSTypeReference&&C.typeName.type===Te.AST_NODE_TYPES.Identifier&&(C.typeName.name==="FC"||C.typeName.name==="React.FC")||C.type===Te.AST_NODE_TYPES.TSTypeReference&&C.typeName.type===Te.AST_NODE_TYPES.TSQualifiedName&&C.typeName.right.name==="FC")return!0}E=E.parent}return!1}function c(m){let E=m.parent;for(;E;){if(E.type===Te.AST_NODE_TYPES.TSTypeParameterInstantiation){let C=E.parent;if(C.type===Te.AST_NODE_TYPES.CallExpression||C.type===Te.AST_NODE_TYPES.NewExpression)return!0}E=E.parent}return!1}function a(m){let E=m.parent;for(;E;){if(E.type===Te.AST_NODE_TYPES.TSTypeAliasDeclaration||E.type===Te.AST_NODE_TYPES.TSInterfaceDeclaration)return!0;E=E.parent}return!1}function u(m){return m.parent.type===Te.AST_NODE_TYPES.TSIndexedAccessType&&m.parent.objectType===m}let f=[];function y(m){let E=[],C=new Map;for(let{typeName:I,firstUsage:A}of m){let S=C.get(A)||[];S.push(I),C.set(A,S)}for(let{typeName:I,firstUsage:A,firstUsagePosition:S,firstUsageInFunctionArgs:h}of m){let b=n.get(I);if(!b||b.statement===A)continue;let w=o.indexOf(b.statement),k=o.indexOf(A);if(w===-1||k===-1)continue;let O=!!(t.checkOnly&&t.checkOnly.includes("function-args")&&h),F=(C.get(A)||[]).length>1;(O||F?w>k:w>k||w!==k-1)&&E.push({typeName:I,typeDef:b,targetStatement:A,firstUsagePosition:S})}if(E.length===0)return;E.sort((I,A)=>{let S=I.firstUsagePosition-A.firstUsagePosition;if(S!==0)return S;let h=o.indexOf(I.typeDef.statement),b=o.indexOf(A.typeDef.statement);return h-b});let T=E[0];T&&e.report({node:T.typeDef.node,messageId:"moveTypeAboveUsage",fix:x(E)})}function x(m){return function*(E){let C=new Map;for(let T of m){let I=C.get(T.targetStatement)||[];I.push(T),C.set(T.targetStatement,I)}for(let[,T]of C)T.sort((I,A)=>{let S=I.firstUsagePosition-A.firstUsagePosition;if(S!==0)return S;let h=o.indexOf(I.typeDef.statement),b=o.indexOf(A.typeDef.statement);return h-b});for(let T of m){let{typeDef:I}=T,A=I.statement,S=r.getCommentsBefore(A),h=A.range[0],b=A.range[1];S.length>0&&S[0]&&(h=S[0].range[0]),yield E.removeRange([h,b])}for(let[T,I]of C){let A=r.getCommentsBefore(T),S=A.length>0&&A[0]?A[0].range[0]:T.range[0],h=[];for(let b of I){let w=b.typeDef.statement,k=r.getText(w),O=r.getCommentsBefore(w),p=k;O.length>0&&(p=`${O.map(d=>r.getText(d)).join(`
41
41
  `)}
42
- ${k}`),h.push(p)}yield E.insertTextBeforeRange([T,T],`${h.join(`
42
+ ${k}`),h.push(p)}yield E.insertTextBeforeRange([S,S],`${h.join(`
43
43
 
44
44
  `)}
45
45
 
46
- `)}}}return{Program(m){o.push(...m.body)},TSTypeAliasDeclaration(m){if(o.some(C=>C.type===Te.AST_NODE_TYPES.ExportNamedDeclaration&&C.declaration===m?!0:C===m)){let C=s(m);C&&n.set(m.id.name,{node:m,name:m.id.name,statement:C})}},TSInterfaceDeclaration(m){if(o.some(C=>C.type===Te.AST_NODE_TYPES.ExportNamedDeclaration&&C.declaration===m?!0:C===m)){let C=s(m);C&&n.set(m.id.name,{node:m,name:m.id.name,statement:C})}},TSTypeReference(m){if(m.typeName.type===Te.AST_NODE_TYPES.Identifier){if(u(m))return;let E=i(m),C=l(m),S=c(m);f.push({typeName:m.typeName.name,node:m,inFunctionArgs:E,inFCProps:C,inGenericArgAtFunctionCall:S,usagePosition:m.range[0]})}},"Program:exit"(){let m=new Map;function E(S){if(!t.checkOnly||t.checkOnly.length===0)return!0;for(let I of t.checkOnly)if(I==="function-args"&&S.inFunctionArgs||I==="FC"&&S.inFCProps||I==="generic-args-at-fn-calls"&&S.inGenericArgAtFunctionCall)return!0;return!1}for(let S of f){let{typeName:I,node:A}=S;if(!n.has(I)||!E(S))continue;let T=s(A),h=n.get(I);if(!T||!h||T===h.statement)continue;m.has(I)||m.set(I,[]);let b=m.get(I);if(!b)return;b.includes(T)||b.push(T)}let C=[];for(let[S,I]of m)if(I.length>0){if(I.length===0)continue;let A=I[0];if(!A)continue;let T=Number.MAX_SAFE_INTEGER,h=!1;for(let w of I)w.range[0]<A.range[0]&&(A=w);for(let w of f)E(w)&&w.typeName===S&&s(w.node)===A&&w.usagePosition<T&&(T=w.usagePosition,h=w.inFunctionArgs);if(!!(t.checkOnly&&t.checkOnly.length>0)){let w=Number.MAX_SAFE_INTEGER;for(let N of f){if(N.typeName!==S)continue;let p=s(N.node);if(!p)continue;let F=o.indexOf(p);F!==-1&&F<w&&(w=F)}let k=o.indexOf(A);if(w!==Number.MAX_SAFE_INTEGER&&k!==-1&&w<k)continue}else{let w=Number.MAX_SAFE_INTEGER;for(let N of f){if(N.typeName!==S||a(N.node))continue;let p=s(N.node);if(!p)continue;let F=o.indexOf(p);F!==-1&&F<w&&(w=F)}let k=o.indexOf(A);if(w!==Number.MAX_SAFE_INTEGER&&k!==-1&&w<k)continue}C.push({typeName:S,firstUsage:A,firstUsagePosition:T,firstUsageInFunctionArgs:h})}C.length>0&&y(C)}}}});var ie=require("@typescript-eslint/utils"),at=Pe(require("zod/v4"));var va=["tsx"],ka=/^[A-Z][A-Za-z0-9]*$/,Pa=at.object({extensions:at.array(at.string()).optional()}),Un=X({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:[z(Pa)]},defaultOptions:[{}],create(e,[t]){let r=e.getFilename(),n=t.extensions??va,o=!1;for(let T of n)if(r.endsWith(T)){o=!0;break}if(!o)return{};let s=e.sourceCode,i=new Set,l=new Map;function c(T){return ka.test(T)}function a(T){if(T.type!==ie.AST_NODE_TYPES.CallExpression)return!1;let h=T.callee;return h.type===ie.AST_NODE_TYPES.Identifier?h.name==="memo"||h.name==="forwardRef":h.type===ie.AST_NODE_TYPES.MemberExpression&&h.property.type===ie.AST_NODE_TYPES.Identifier?h.property.name==="memo"||h.property.name==="forwardRef":!1}function u(T){if(T.type===ie.AST_NODE_TYPES.JSXElement||T.type===ie.AST_NODE_TYPES.JSXFragment)return!0;if(T.type===ie.AST_NODE_TYPES.ArrayExpression){for(let h of T.elements)if(h&&(h.type===ie.AST_NODE_TYPES.JSXElement||h.type===ie.AST_NODE_TYPES.JSXFragment))return!0}return!1}function f(T){if(T.type!==ie.AST_NODE_TYPES.ArrowFunctionExpression)return!1;let h=T.body;if(h.type===ie.AST_NODE_TYPES.ArrowFunctionExpression){let b=h.body;if(u(b))return!0}return!1}function y(T){if(T.id.type!==ie.AST_NODE_TYPES.Identifier)return;let h=T.id.name,b=T.init;if(b){if(c(h)&&(b.type===ie.AST_NODE_TYPES.ArrowFunctionExpression||b.type===ie.AST_NODE_TYPES.FunctionExpression||a(b))){i.add(h);return}b.type===ie.AST_NODE_TYPES.Identifier&&l.set(h,b.name),c(h)||f(b)&&i.add(h)}}function x(T){if(T.type===ie.AST_NODE_TYPES.VariableDeclaration){for(let h of T.declarations)y(h);return}if(T.type===ie.AST_NODE_TYPES.FunctionDeclaration&&T.id){c(T.id.name)&&i.add(T.id.name);return}if(T.type===ie.AST_NODE_TYPES.ExportNamedDeclaration&&T.declaration){let h=T.declaration;if(h.type===ie.AST_NODE_TYPES.VariableDeclaration){for(let b of h.declarations)y(b);return}if(h.type===ie.AST_NODE_TYPES.FunctionDeclaration&&h.id){c(h.id.name)&&i.add(h.id.name);return}}}for(let T of s.ast.body)x(T);function m(T,h=new Set){if(i.has(T))return!0;if(h.has(T))return!1;h.add(T);let b=l.get(T);return b?m(b,h):!1}let E=[];function C(T,h,b){E.push({node:T,isType:h,isComponent:b})}for(let T of s.ast.body){if(T.type===ie.AST_NODE_TYPES.ExportNamedDeclaration){let h=T.exportKind==="type";if(T.declaration){let b=T.declaration;if(b.type===ie.AST_NODE_TYPES.TSTypeAliasDeclaration||b.type===ie.AST_NODE_TYPES.TSInterfaceDeclaration){C(b,!0,!1);continue}if(b.type===ie.AST_NODE_TYPES.VariableDeclaration){for(let w of b.declarations){if(w.id.type!==ie.AST_NODE_TYPES.Identifier)continue;let k=w.id.name,N=m(k);C(w,h,N)}continue}if(b.type===ie.AST_NODE_TYPES.FunctionDeclaration){let w=b.id?.name,k=w?m(w)||c(w):!1;C(b,h,k);continue}C(b,h,!1);continue}if(T.specifiers.length>0)for(let b of T.specifiers){if(b.local.type!==ie.AST_NODE_TYPES.Identifier)continue;let w=b.local.name,k=m(w);C(b,h,k)}continue}if(T.type===ie.AST_NODE_TYPES.ExportDefaultDeclaration){let h=T.declaration;if(h.type===ie.AST_NODE_TYPES.Identifier){let b=m(h.name)||c(h.name);C(T,!1,b);continue}if(h.type===ie.AST_NODE_TYPES.FunctionDeclaration||h.type===ie.AST_NODE_TYPES.ArrowFunctionExpression||h.type===ie.AST_NODE_TYPES.FunctionExpression||h.type===ie.AST_NODE_TYPES.CallExpression){C(T,!1,!0);continue}C(T,!1,!1);continue}}let S=!1;for(let T of E)if(!T.isType&&T.isComponent){S=!0;break}if(!S)return{};let I=[];for(let T of E)T.isType||I.push(T);let A=-1;for(let[T,h]of I.entries())if(h.isComponent){A=T;break}if(A===-1)return{};for(let[T,h]of I.entries())if(T!==A){e.report({node:h.node,messageId:"multipleExports"});break}return{}}});var Ve=require("@typescript-eslint/utils"),kt=require("zod/v4");function Pt(e){return e.charAt(0).toUpperCase()+e.slice(1)}function Oa(e){return e.callee.type===Ve.AST_NODE_TYPES.Identifier?e.callee.name==="useState":e.callee.type===Ve.AST_NODE_TYPES.MemberExpression&&e.callee.object.type===Ve.AST_NODE_TYPES.Identifier&&e.callee.property.type===Ve.AST_NODE_TYPES.Identifier?e.callee.object.name==="React"&&e.callee.property.name==="useState":!1}var Na=kt.z.object({ignorePrefixes:kt.z.array(kt.z.string()).optional()});function mi(e,t){for(let r of t)if(e.startsWith(r))return e.slice(r.length);return e}function Da(e){return`set${Pt(e)}`}var zn=X({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:[z(Na)]},defaultOptions:[{ignorePrefixes:[]}],create(e,[t]){return{VariableDeclarator(r){if(!r.init||r.init.type!==Ve.AST_NODE_TYPES.CallExpression||!Oa(r.init)||r.id.type!==Ve.AST_NODE_TYPES.ArrayPattern||r.id.elements.length!==2)return;let[n,o]=r.id.elements;if(!n||!o||n.type!==Ve.AST_NODE_TYPES.Identifier||o.type!==Ve.AST_NODE_TYPES.Identifier)return;let s=n.name,i=o.name,l=t.ignorePrefixes||[],c=mi(s,l),a=mi(i,l);if(c===""){if(!a.startsWith("set")){let f=`set${Pt(s)}`;e.report({node:o,messageId:"incorrectSetterName",data:{expectedName:Pt(s),actualName:i},suggest:[{messageId:"useSuggestedName",data:{expectedSetterName:f},fix:y=>y.replaceText(o,f)}]})}return}let u=Da(c);a!==u&&e.report({node:o,messageId:"incorrectSetterName",data:{expectedName:Pt(c),actualName:i},suggest:[{messageId:"useSuggestedName",data:{expectedSetterName:u},fix:f=>f.replaceText(o,u)}]})}}}});var de=require("@typescript-eslint/utils"),et=require("zod/v4");var ja=et.z.object({name:et.z.string(),defaults:et.z.array(et.z.unknown())}),La=et.z.object({functions:et.z.array(ja)});function Ot(e,t){if(e===t)return!0;if(e===null||t===null||e===void 0||t===void 0)return e===t;if(typeof e!=typeof t||typeof e!="object"||Array.isArray(e)!==Array.isArray(t))return!1;if(Array.isArray(e)&&Array.isArray(t))return e.length!==t.length?!1:e.every((o,s)=>Ot(o,t[s]));let r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(let o of r){if(!n.includes(o))return!1;let s=Object.getOwnPropertyDescriptor(e,o),i=Object.getOwnPropertyDescriptor(t,o);if(!s||!i)return!1;let l=s.value,c=i.value;if(!Ot(l,c))return!1}return!0}function Ma(e,t){let r=new Set;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return r;for(let n in e){if(!(n in t))continue;let o=Object.getOwnPropertyDescriptor(e,n),s=Object.getOwnPropertyDescriptor(t,n);o&&s&&Ot(o.value,s.value)&&r.add(n)}return r}function yi(e){if(e.type===de.AST_NODE_TYPES.SpreadElement)return Symbol("COMPLEX_EXPRESSION");switch(e.type){case de.AST_NODE_TYPES.Literal:return e.value;case de.AST_NODE_TYPES.ObjectExpression:{let t={};for(let r of e.properties)r.type===de.AST_NODE_TYPES.Property&&r.key.type===de.AST_NODE_TYPES.Identifier&&!r.computed&&(r.value.type===de.AST_NODE_TYPES.Literal?t[r.key.name]=r.value.value:r.value.type===de.AST_NODE_TYPES.ObjectExpression?t[r.key.name]=yi(r.value):t[r.key.name]=Symbol("COMPLEX_EXPRESSION"));return t}case de.AST_NODE_TYPES.ArrayExpression:return e.elements.map(t=>{if(!(!t||t.type===de.AST_NODE_TYPES.SpreadElement))return t.type===de.AST_NODE_TYPES.Literal?t.value:Symbol("COMPLEX_EXPRESSION")});default:return Symbol("COMPLEX_EXPRESSION")}}function _a(e){return e.type===de.AST_NODE_TYPES.Identifier?e.name:e.type===de.AST_NODE_TYPES.MemberExpression&&e.property.type===de.AST_NODE_TYPES.Identifier&&!e.computed?e.property.name:null}var Wn=X({name:"no-redundant-function-params",meta:{type:"suggestion",docs:{description:"Disallow calling functions with redundant default parameters"},messages:{redundantParams:"Function call has redundant parameters matching its default values and can be removed: {{details}}"},fixable:"code",schema:[z(La)]},defaultOptions:[{functions:[]}],create(e,[t]){let r=new Map;for(let n of t.functions)r.set(n.name,n.defaults);return{CallExpression(n){let o=_a(n.callee);if(!o)return;let s=r.get(o);if(!s)return;let i=n.arguments;if(i.length===0)return;let l=-1,c=!1,a=new Map,u=new Set,f=new Map,y=[];for(let m=0;m<i.length;m++){if(m>=s.length){l=m;continue}let E=s[m],C=i[m];if(!C||C.type===de.AST_NODE_TYPES.SpreadElement){l=m;continue}let S=yi(C);if(E===void 0){l=m;continue}if(Ot(S,E)){C.type===de.AST_NODE_TYPES.ObjectExpression?(u.add(m),y.push({type:"object",position:m+1})):(f.set(m,S),y.push({type:"simple",position:m+1,value:S}));continue}if(C.type===de.AST_NODE_TYPES.ObjectExpression&&C.properties.length===0&&typeof E=="object"&&E!==null&&Object.keys(E).length>0){u.add(m),y.push({type:"object",position:m+1});continue}let I=Ma(S,E);if(I.size>0){let A=typeof E=="object"&&E!==null?Object.keys(E).length:0;if(C.type===de.AST_NODE_TYPES.ObjectExpression&&C.properties.length===I.size&&C.properties.length===A){u.add(m),y.push({type:"object",position:m+1});continue}else c=!0,a.set(m,I),y.push({type:"partialObject",position:m+1,redundantProperties:Array.from(I)}),l=m}else l=m}if(l<i.length-1||c||u.size>0){let m=function(){let C=[];for(let S of y)if(S.type==="simple")C.push(`Param ${S.position} with value ${JSON.stringify(S.value)}`);else if(S.type==="object")C.push(`Param ${S.position} (object)`);else{let I=S.redundantProperties||[],A=s?s[S.position-1]:void 0;if(typeof A=="object"&&A!==null){let T=A;for(let h of I)if(h in T){let b=Object.getOwnPropertyDescriptor(T,h);b&&C.push(`Param ${S.position} property "${h}" with value ${JSON.stringify(b.value)}`)}}}return{messageId:"redundantParams",data:{details:C.join(", ")}}};var x=m;let E=m();e.report({node:n,messageId:E.messageId,data:E.data,fix(C){let S=[];if(c)for(let[A,T]of a){let h=i[A];if(h&&h.type===de.AST_NODE_TYPES.ObjectExpression){let b=[];for(let k of h.properties)k.type===de.AST_NODE_TYPES.Property&&k.key.type===de.AST_NODE_TYPES.Identifier&&!k.computed&&T.has(k.key.name)||b.push(k);let w=b.map(k=>e.sourceCode.getText(k));S.push(C.replaceText(h,`{ ${w.join(", ")} }`))}}let I=-1;for(let A=i.length-1;A>=0;A--)if(!u.has(A)&&A<=l){I=A;break}if(I<i.length-1)if(I===-1){let A=e.sourceCode.getTokenAfter(n.callee),T=e.sourceCode.getLastToken(n);A&&T&&S.push(C.replaceTextRange([A.range[1],T.range[0]],""))}else{let A=i[I],T=e.sourceCode.getLastToken(n);T&&A&&S.push(C.replaceTextRange([A.range[1],T.range[0]],""))}return S.length>0?S:null}})}}}}});var Fe=require("@typescript-eslint/utils");function $a(e){let t=e.parent;for(;t;){if(t.type===Fe.AST_NODE_TYPES.AwaitExpression||t.type===Fe.AST_NODE_TYPES.MemberExpression&&t.object===e&&t.property.type===Fe.AST_NODE_TYPES.Identifier&&t.property.name==="then"||t.type===Fe.AST_NODE_TYPES.ArrowFunctionExpression&&t.body===e)return!0;if(t.type===Fe.AST_NODE_TYPES.ArrayExpression&&t.parent.type===Fe.AST_NODE_TYPES.CallExpression){let r=t.parent;if(r.callee.type===Fe.AST_NODE_TYPES.MemberExpression&&r.callee.object.type===Fe.AST_NODE_TYPES.Identifier&&r.callee.object.name==="Promise"&&r.callee.property.type===Fe.AST_NODE_TYPES.Identifier&&["all","allSettled","race"].includes(r.callee.property.name))return!0}if(t.parent)t=t.parent;else break}return!1}function Ua(e){let{callee:t}=e;return t.type===Fe.AST_NODE_TYPES.Identifier&&t.name==="require"||t.type===Fe.AST_NODE_TYPES.MemberExpression&&t.object.type===Fe.AST_NODE_TYPES.Identifier&&t.object.name==="require"}var Jn=X({name:"no-sync-dynamic-import",meta:{type:"problem",docs:{description:"Disallow synchronous dynamic imports and require statements, only allow async dynamic imports with await"},messages:{syncDynamicImport:"Synchronous dynamic import() is not allowed. Use regular import statement or await import() for dynamic imports.",requireNotAllowed:"require() statements are not allowed. Use ES6 import statements instead."},schema:[]},defaultOptions:[],create(e){return{ImportExpression(t){$a(t)||e.report({node:t,messageId:"syncDynamicImport"})},TSImportType(t){e.report({node:t,messageId:"syncDynamicImport"})},CallExpression(t){Ua(t)&&e.report({node:t,messageId:"requireNotAllowed"})}}}});var L=require("@typescript-eslint/utils"),Nt=require("zod/v4");var za=Nt.z.object({mainComponentRegex:Nt.z.string().optional(),mainComponentSelector:Nt.z.string().optional()}),Wa=/^[A-Z][A-Za-z0-9]*$/,Vn=X({name:"sort-react-components-and-styles",meta:{type:"suggestion",docs:{description:"Sort React components and styles with styles placed above their first usage"},fixable:"code",schema:[z(za)],messages:{stylesShouldBeAboveUsage:"Style definitions should be placed above the first component that uses them",mainComponentShouldBeFirst:"Main component should be placed before other components"}},defaultOptions:[{}],create(e,[t]){let r=e.sourceCode,n=t.mainComponentRegex?new RegExp(t.mainComponentRegex):void 0,o=t.mainComponentSelector;if(!e.filename.endsWith(".tsx"))return{};let i=new Set,l=new Map,c=[],a=[],u=new Set;function f(d){let g=d.node;if(g.type===L.AST_NODE_TYPES.VariableDeclaration){for(let R of g.declarations)if(R.id.type===L.AST_NODE_TYPES.Identifier&&R.id.name===d.name&&R.init)return R.init}if(g.type===L.AST_NODE_TYPES.ExportNamedDeclaration){let R=g.declaration;if(R&&R.type===L.AST_NODE_TYPES.VariableDeclaration){for(let P of R.declarations)if(P.id.type===L.AST_NODE_TYPES.Identifier&&P.id.name===d.name&&P.init)return P.init}}return null}function y(d){let g=new Set;return je(d,R=>(R.type===L.AST_NODE_TYPES.Identifier&&R.name!=="styled"&&R.name!=="css"&&g.add(R.name),!1),r),g}function x(d){return Wa.test(d)}function m(d){if(d.type!==L.AST_NODE_TYPES.CallExpression)return!1;let g=d.callee;return g.type===L.AST_NODE_TYPES.Identifier?g.name==="memo"||g.name==="forwardRef":g.type===L.AST_NODE_TYPES.MemberExpression&&g.property.type===L.AST_NODE_TYPES.Identifier?g.property.name==="memo"||g.property.name==="forwardRef":!1}function E(d){if(d.type===L.AST_NODE_TYPES.JSXElement||d.type===L.AST_NODE_TYPES.JSXFragment)return!0;if(d.type===L.AST_NODE_TYPES.BlockStatement){for(let g of d.body)if(g.type===L.AST_NODE_TYPES.ReturnStatement&&g.argument)return E(g.argument)}if(d.type===L.AST_NODE_TYPES.ArrayExpression){for(let g of d.elements)if(g&&(g.type===L.AST_NODE_TYPES.JSXElement||g.type===L.AST_NODE_TYPES.JSXFragment))return!0}return!1}function C(d){if(d.type!==L.AST_NODE_TYPES.ArrowFunctionExpression)return!1;let g=d.body;if(g.type===L.AST_NODE_TYPES.ArrowFunctionExpression){let R=g.body;if(E(R))return!0}return!1}function S(d){if(d.type===L.AST_NODE_TYPES.TaggedTemplateExpression){let g=d.tag;if(g.type===L.AST_NODE_TYPES.MemberExpression&&g.object.type===L.AST_NODE_TYPES.Identifier&&g.object.name==="styled")return!0;if(g.type===L.AST_NODE_TYPES.CallExpression){let R=g.callee;if(R.type===L.AST_NODE_TYPES.Identifier&&R.name==="styled")return!0}}return!1}function I(d){if(d.type===L.AST_NODE_TYPES.TaggedTemplateExpression){let g=d.tag;if(g.type===L.AST_NODE_TYPES.Identifier&&g.name==="css")return!0}return!1}function A(d,g){if(d.id.type!==L.AST_NODE_TYPES.Identifier)return;let R=d.id.name,P=d.init;if(P){if(S(P)||I(P)){a.push({node:g,name:R});return}if((x(R)||P.type===L.AST_NODE_TYPES.ArrowFunctionExpression)&&(P.type===L.AST_NODE_TYPES.ArrowFunctionExpression||P.type===L.AST_NODE_TYPES.FunctionExpression||m(P))){if(P.type===L.AST_NODE_TYPES.ArrowFunctionExpression||P.type===L.AST_NODE_TYPES.FunctionExpression){if(E(P.body)){i.add(R);return}}else if(m(P)){i.add(R);return}}P.type===L.AST_NODE_TYPES.Identifier&&l.set(R,P.name),x(R)||C(P)&&i.add(R)}}function T(d){return d.type===L.AST_NODE_TYPES.ExportDefaultDeclaration||d.type===L.AST_NODE_TYPES.ExportNamedDeclaration}function h(d){if(d.type===L.AST_NODE_TYPES.FunctionDeclaration)return d.id?d.id.name:null;if(d.type===L.AST_NODE_TYPES.VariableDeclaration){let g=d.declarations[0];if(g&&g.id.type===L.AST_NODE_TYPES.Identifier)return g.id.name}if(d.type===L.AST_NODE_TYPES.ExportDefaultDeclaration){let g=d.declaration;if(g.type===L.AST_NODE_TYPES.FunctionDeclaration)return g.id?g.id.name:"default";if(g.type===L.AST_NODE_TYPES.Identifier)return g.name}if(d.type===L.AST_NODE_TYPES.ExportNamedDeclaration){let g=d.declaration;if(g&&g.type===L.AST_NODE_TYPES.FunctionDeclaration)return g.id?g.id.name:null;if(g&&g.type===L.AST_NODE_TYPES.VariableDeclaration){let R=g.declarations[0];if(R&&R.id.type===L.AST_NODE_TYPES.Identifier)return R.id.name}}return null}function b(d,g){return o?u.has(d):n?n.test(g):T(d)}function w(d){let g=new Set;je(d.node,R=>{if(R.type===L.AST_NODE_TYPES.Identifier)for(let P of a)P.name===R.name&&(g.add(P.name),(P.firstUsagePosition===void 0||R.range[0]<P.firstUsagePosition)&&(P.firstUsagePosition=R.range[0]));if(R.type===L.AST_NODE_TYPES.JSXElement){let P=R.openingElement;if(P.name.type===L.AST_NODE_TYPES.JSXIdentifier)for(let j of a)j.name===P.name.name&&(g.add(j.name),(j.firstUsagePosition===void 0||P.name.range[0]<j.firstUsagePosition)&&(j.firstUsagePosition=P.name.range[0]))}return!1},r),d.usedStyles=g}function k(d){if(d.type===L.AST_NODE_TYPES.VariableDeclaration){for(let g of d.declarations)A(g,d);return}if(d.type===L.AST_NODE_TYPES.FunctionDeclaration){x(d.id.name)&&E(d.body)&&i.add(d.id.name);return}if(d.type===L.AST_NODE_TYPES.ExportNamedDeclaration&&d.declaration){let g=d.declaration;if(g.type===L.AST_NODE_TYPES.VariableDeclaration){for(let R of g.declarations)A(R,d);return}if(g.type===L.AST_NODE_TYPES.FunctionDeclaration&&g.id){x(g.id.name)&&E(g.body)&&i.add(g.id.name);return}}if(d.type===L.AST_NODE_TYPES.ExportDefaultDeclaration){let g=d.declaration;g.type===L.AST_NODE_TYPES.Identifier&&i.add(g.name),(g.type===L.AST_NODE_TYPES.FunctionDeclaration||g.type===L.AST_NODE_TYPES.ArrowFunctionExpression||g.type===L.AST_NODE_TYPES.FunctionExpression)&&(g.type===L.AST_NODE_TYPES.FunctionDeclaration?g.id?i.add(g.id.name):i.add("default"):E(g.body)&&i.add("default"))}}function N(d,g=new Set){if(i.has(d))return!0;if(g.has(d))return!1;g.add(d);let R=l.get(d);return R?N(R,g):!1}let p={};return o&&(p[o]=d=>{let g=d;for(;g.parent&&g.parent.type!==L.AST_NODE_TYPES.Program;)g=g.parent;g.parent&&(g.type===L.AST_NODE_TYPES.VariableDeclaration||g.type===L.AST_NODE_TYPES.FunctionDeclaration||g.type===L.AST_NODE_TYPES.ExportNamedDeclaration||g.type===L.AST_NODE_TYPES.ExportDefaultDeclaration)&&u.add(g)}),p["Program:exit"]=d=>{let g=0;for(let D of d.body){if(D.type===L.AST_NODE_TYPES.ImportDeclaration){g+=1;continue}break}for(let D of d.body)k(D);for(let D of d.body){let Z=h(D);if(Z&&N(Z)){let q=b(D,Z);c.push({node:D,name:Z,isMainComponent:q,usedStyles:new Set,isExported:T(D)})}}if(!o&&n&&!c.some(D=>D.isMainComponent))for(let D of c)D.isExported&&(D.isMainComponent=!0);for(let D of c)w(D);let R=new Set;for(let D of a)R.add(D.name);let P=new Map;for(let D=0;D<d.body.length;D+=1){let Z=d.body[D];for(let q of a)q.node===Z&&P.set(q.name,D)}let j=new Map;for(let D of a){let Z=f(D),q=new Set;if(Z){let ue=y(Z);for(let fe of ue)R.has(fe)&&fe!==D.name&&q.add(fe)}j.set(D.name,q)}let V=new Map;for(let D of a){let Z=j.get(D.name);if(!Z)continue;let q=P.get(D.name);if(q!==void 0)for(let ue of Z){let fe=V.get(ue);(fe===void 0||q<fe)&&V.set(ue,q)}}let G=[];for(let D of a){if(D.firstUsagePosition===void 0)continue;let Z=d.body.indexOf(D.node),q=-1;for(let Ee of c){if(!Ee.usedStyles.has(D.name))continue;let Ie=d.body.indexOf(Ee.node);(q===-1||Ie<q)&&(q=Ie)}let ue=V.get(D.name);if(ue!==void 0&&(q===-1||ue<q)&&(q=ue),q===-1)continue;let fe=-1;for(let Ee of c){let Ie=d.body.indexOf(Ee.node);Ie<q&&Ie>fe&&(fe=Ie)}let ve=Z<q,Xe=Z>fe,Se=-1,pt=j.get(D.name);if(pt)for(let Ee of pt){let Ie=P.get(Ee);Ie!==void 0&&Ie>Se&&(Se=Ie)}let tt=Z>Se;if(!(ve&&Xe&&tt)){let Ee=fe+1;if(Se+1>Ee&&(Ee=Se+1),Ee<g&&(Ee=g),Ee>q)continue;G.push({style:D,targetPosition:Ee})}}let Y=null;if(c.length>1){let D=c.map(q=>({c:q,idx:d.body.indexOf(q.node)})).sort((q,ue)=>q.idx-ue.idx)[0]?.c,Z=c.find(q=>q.isMainComponent)||null;D&&Z&&D.node!==Z.node&&(Y={component:Z,targetBefore:D.node})}if(G.length>0||Y){let D=G[0]?.style.node||Y?.component.node||d,Z=G.length>0?"stylesShouldBeAboveUsage":"mainComponentShouldBeFirst";e.report({node:D,messageId:Z,fix:F(G,Y,d.body)})}},p;function F(d,g,R){return function*(P){d.sort((V,G)=>V.targetPosition-G.targetPosition);for(let{style:V}of d){let G=r.getCommentsBefore(V.node),Y=V.node.range[0],D=V.node.range[1];G.length>0&&G[0]&&(Y=G[0].range[0]),Y===V.node.range[0]&&r.text.slice(0,Y).trim().length===0&&(Y=0),yield P.removeRange([Y,D])}let j=new Map;for(let V of d){let G=j.get(V.targetPosition)||[];G.push(V),j.set(V.targetPosition,G)}for(let[V,G]of j){let Y=R[V];if(!Y)continue;let D=r.getCommentsBefore(Y),Z=D.length>0&&D[0]?D[0].range[0]:Y.range[0],q=[];for(let{style:ue}of G){let fe=r.getCommentsBefore(ue.node),ve=r.getText(ue.node);fe.length>0&&(ve=`${fe.map(Se=>r.getText(Se)).join(`
46
+ `)}}}return{Program(m){o.push(...m.body)},TSTypeAliasDeclaration(m){if(o.some(C=>C.type===Te.AST_NODE_TYPES.ExportNamedDeclaration&&C.declaration===m?!0:C===m)){let C=s(m);C&&n.set(m.id.name,{node:m,name:m.id.name,statement:C})}},TSInterfaceDeclaration(m){if(o.some(C=>C.type===Te.AST_NODE_TYPES.ExportNamedDeclaration&&C.declaration===m?!0:C===m)){let C=s(m);C&&n.set(m.id.name,{node:m,name:m.id.name,statement:C})}},TSTypeReference(m){if(m.typeName.type===Te.AST_NODE_TYPES.Identifier){if(u(m))return;let E=i(m),C=l(m),T=c(m);f.push({typeName:m.typeName.name,node:m,inFunctionArgs:E,inFCProps:C,inGenericArgAtFunctionCall:T,usagePosition:m.range[0]})}},"Program:exit"(){let m=new Map;function E(T){if(!t.checkOnly||t.checkOnly.length===0)return!0;for(let I of t.checkOnly)if(I==="function-args"&&T.inFunctionArgs||I==="FC"&&T.inFCProps||I==="generic-args-at-fn-calls"&&T.inGenericArgAtFunctionCall)return!0;return!1}for(let T of f){let{typeName:I,node:A}=T;if(!n.has(I)||!E(T))continue;let S=s(A),h=n.get(I);if(!S||!h||S===h.statement)continue;m.has(I)||m.set(I,[]);let b=m.get(I);if(!b)return;b.includes(S)||b.push(S)}let C=[];for(let[T,I]of m)if(I.length>0){if(I.length===0)continue;let A=I[0];if(!A)continue;let S=Number.MAX_SAFE_INTEGER,h=!1;for(let w of I)w.range[0]<A.range[0]&&(A=w);for(let w of f)E(w)&&w.typeName===T&&s(w.node)===A&&w.usagePosition<S&&(S=w.usagePosition,h=w.inFunctionArgs);if(!!(t.checkOnly&&t.checkOnly.length>0)){let w=Number.MAX_SAFE_INTEGER;for(let O of f){if(O.typeName!==T)continue;let p=s(O.node);if(!p)continue;let F=o.indexOf(p);F!==-1&&F<w&&(w=F)}let k=o.indexOf(A);if(w!==Number.MAX_SAFE_INTEGER&&k!==-1&&w<k)continue}else{let w=Number.MAX_SAFE_INTEGER;for(let O of f){if(O.typeName!==T||a(O.node))continue;let p=s(O.node);if(!p)continue;let F=o.indexOf(p);F!==-1&&F<w&&(w=F)}let k=o.indexOf(A);if(w!==Number.MAX_SAFE_INTEGER&&k!==-1&&w<k)continue}C.push({typeName:T,firstUsage:A,firstUsagePosition:S,firstUsageInFunctionArgs:h})}C.length>0&&y(C)}}}});var ie=require("@typescript-eslint/utils"),at=Pe(require("zod/v4"));var ja=["tsx"],La=/^[A-Z][A-Za-z0-9]*$/,Ma=at.object({extensions:at.array(at.string()).optional()}),Un=X({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(Ma)]},defaultOptions:[{}],create(e,[t]){let r=e.getFilename(),n=t.extensions??ja,o=!1;for(let S of n)if(r.endsWith(S)){o=!0;break}if(!o)return{};let s=e.sourceCode,i=new Set,l=new Map;function c(S){return La.test(S)}function a(S){if(S.type!==ie.AST_NODE_TYPES.CallExpression)return!1;let h=S.callee;return h.type===ie.AST_NODE_TYPES.Identifier?h.name==="memo"||h.name==="forwardRef":h.type===ie.AST_NODE_TYPES.MemberExpression&&h.property.type===ie.AST_NODE_TYPES.Identifier?h.property.name==="memo"||h.property.name==="forwardRef":!1}function u(S){if(S.type===ie.AST_NODE_TYPES.JSXElement||S.type===ie.AST_NODE_TYPES.JSXFragment)return!0;if(S.type===ie.AST_NODE_TYPES.ArrayExpression){for(let h of S.elements)if(h&&(h.type===ie.AST_NODE_TYPES.JSXElement||h.type===ie.AST_NODE_TYPES.JSXFragment))return!0}return!1}function f(S){if(S.type!==ie.AST_NODE_TYPES.ArrowFunctionExpression)return!1;let h=S.body;if(h.type===ie.AST_NODE_TYPES.ArrowFunctionExpression){let b=h.body;if(u(b))return!0}return!1}function y(S){if(S.id.type!==ie.AST_NODE_TYPES.Identifier)return;let h=S.id.name,b=S.init;if(b){if(c(h)&&(b.type===ie.AST_NODE_TYPES.ArrowFunctionExpression||b.type===ie.AST_NODE_TYPES.FunctionExpression||a(b))){i.add(h);return}b.type===ie.AST_NODE_TYPES.Identifier&&l.set(h,b.name),c(h)||f(b)&&i.add(h)}}function x(S){if(S.type===ie.AST_NODE_TYPES.VariableDeclaration){for(let h of S.declarations)y(h);return}if(S.type===ie.AST_NODE_TYPES.FunctionDeclaration&&S.id){c(S.id.name)&&i.add(S.id.name);return}if(S.type===ie.AST_NODE_TYPES.ExportNamedDeclaration&&S.declaration){let h=S.declaration;if(h.type===ie.AST_NODE_TYPES.VariableDeclaration){for(let b of h.declarations)y(b);return}if(h.type===ie.AST_NODE_TYPES.FunctionDeclaration&&h.id){c(h.id.name)&&i.add(h.id.name);return}}}for(let S of s.ast.body)x(S);function m(S,h=new Set){if(i.has(S))return!0;if(h.has(S))return!1;h.add(S);let b=l.get(S);return b?m(b,h):!1}let E=[];function C(S,h,b){E.push({node:S,isType:h,isComponent:b})}for(let S of s.ast.body){if(S.type===ie.AST_NODE_TYPES.ExportNamedDeclaration){let h=S.exportKind==="type";if(S.declaration){let b=S.declaration;if(b.type===ie.AST_NODE_TYPES.TSTypeAliasDeclaration||b.type===ie.AST_NODE_TYPES.TSInterfaceDeclaration){C(b,!0,!1);continue}if(b.type===ie.AST_NODE_TYPES.VariableDeclaration){for(let w of b.declarations){if(w.id.type!==ie.AST_NODE_TYPES.Identifier)continue;let k=w.id.name,O=m(k);C(w,h,O)}continue}if(b.type===ie.AST_NODE_TYPES.FunctionDeclaration){let w=b.id?.name,k=w?m(w)||c(w):!1;C(b,h,k);continue}C(b,h,!1);continue}if(S.specifiers.length>0)for(let b of S.specifiers){if(b.local.type!==ie.AST_NODE_TYPES.Identifier)continue;let w=b.local.name,k=m(w);C(b,h,k)}continue}if(S.type===ie.AST_NODE_TYPES.ExportDefaultDeclaration){let h=S.declaration;if(h.type===ie.AST_NODE_TYPES.Identifier){let b=m(h.name)||c(h.name);C(S,!1,b);continue}if(h.type===ie.AST_NODE_TYPES.FunctionDeclaration||h.type===ie.AST_NODE_TYPES.ArrowFunctionExpression||h.type===ie.AST_NODE_TYPES.FunctionExpression||h.type===ie.AST_NODE_TYPES.CallExpression){C(S,!1,!0);continue}C(S,!1,!1);continue}}let T=!1;for(let S of E)if(!S.isType&&S.isComponent){T=!0;break}if(!T)return{};let I=[];for(let S of E)S.isType||I.push(S);let A=-1;for(let[S,h]of I.entries())if(h.isComponent){A=S;break}if(A===-1)return{};for(let[S,h]of I.entries())if(S!==A){e.report({node:h.node,messageId:"multipleExports"});break}return{}}});var Ve=require("@typescript-eslint/utils"),kt=require("zod/v4");function Pt(e){return e.charAt(0).toUpperCase()+e.slice(1)}function _a(e){return e.callee.type===Ve.AST_NODE_TYPES.Identifier?e.callee.name==="useState":e.callee.type===Ve.AST_NODE_TYPES.MemberExpression&&e.callee.object.type===Ve.AST_NODE_TYPES.Identifier&&e.callee.property.type===Ve.AST_NODE_TYPES.Identifier?e.callee.object.name==="React"&&e.callee.property.name==="useState":!1}var $a=kt.z.object({ignorePrefixes:kt.z.array(kt.z.string()).optional()});function di(e,t){for(let r of t)if(e.startsWith(r))return e.slice(r.length);return e}function Ua(e){return`set${Pt(e)}`}var zn=X({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($a)]},defaultOptions:[{ignorePrefixes:[]}],create(e,[t]){return{VariableDeclarator(r){if(!r.init||r.init.type!==Ve.AST_NODE_TYPES.CallExpression||!_a(r.init)||r.id.type!==Ve.AST_NODE_TYPES.ArrayPattern||r.id.elements.length!==2)return;let[n,o]=r.id.elements;if(!n||!o||n.type!==Ve.AST_NODE_TYPES.Identifier||o.type!==Ve.AST_NODE_TYPES.Identifier)return;let s=n.name,i=o.name,l=t.ignorePrefixes||[],c=di(s,l),a=di(i,l);if(c===""){if(!a.startsWith("set")){let f=`set${Pt(s)}`;e.report({node:o,messageId:"incorrectSetterName",data:{expectedName:Pt(s),actualName:i},suggest:[{messageId:"useSuggestedName",data:{expectedSetterName:f},fix:y=>y.replaceText(o,f)}]})}return}let u=Ua(c);a!==u&&e.report({node:o,messageId:"incorrectSetterName",data:{expectedName:Pt(c),actualName:i},suggest:[{messageId:"useSuggestedName",data:{expectedSetterName:u},fix:f=>f.replaceText(o,u)}]})}}}});var de=require("@typescript-eslint/utils"),et=require("zod/v4");var za=et.z.object({name:et.z.string(),defaults:et.z.array(et.z.unknown())}),Wa=et.z.object({functions:et.z.array(za)});function Ot(e,t){if(e===t)return!0;if(e===null||t===null||e===void 0||t===void 0)return e===t;if(typeof e!=typeof t||typeof e!="object"||Array.isArray(e)!==Array.isArray(t))return!1;if(Array.isArray(e)&&Array.isArray(t))return e.length!==t.length?!1:e.every((o,s)=>Ot(o,t[s]));let r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(let o of r){if(!n.includes(o))return!1;let s=Object.getOwnPropertyDescriptor(e,o),i=Object.getOwnPropertyDescriptor(t,o);if(!s||!i)return!1;let l=s.value,c=i.value;if(!Ot(l,c))return!1}return!0}function Ja(e,t){let r=new Set;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return r;for(let n in e){if(!(n in t))continue;let o=Object.getOwnPropertyDescriptor(e,n),s=Object.getOwnPropertyDescriptor(t,n);o&&s&&Ot(o.value,s.value)&&r.add(n)}return r}function gi(e){if(e.type===de.AST_NODE_TYPES.SpreadElement)return Symbol("COMPLEX_EXPRESSION");switch(e.type){case de.AST_NODE_TYPES.Literal:return e.value;case de.AST_NODE_TYPES.ObjectExpression:{let t={};for(let r of e.properties)r.type===de.AST_NODE_TYPES.Property&&r.key.type===de.AST_NODE_TYPES.Identifier&&!r.computed&&(r.value.type===de.AST_NODE_TYPES.Literal?t[r.key.name]=r.value.value:r.value.type===de.AST_NODE_TYPES.ObjectExpression?t[r.key.name]=gi(r.value):t[r.key.name]=Symbol("COMPLEX_EXPRESSION"));return t}case de.AST_NODE_TYPES.ArrayExpression:return e.elements.map(t=>{if(!(!t||t.type===de.AST_NODE_TYPES.SpreadElement))return t.type===de.AST_NODE_TYPES.Literal?t.value:Symbol("COMPLEX_EXPRESSION")});default:return Symbol("COMPLEX_EXPRESSION")}}function Va(e){return e.type===de.AST_NODE_TYPES.Identifier?e.name:e.type===de.AST_NODE_TYPES.MemberExpression&&e.property.type===de.AST_NODE_TYPES.Identifier&&!e.computed?e.property.name:null}var Wn=X({name:"no-redundant-function-params",meta:{type:"suggestion",docs:{description:"Disallow calling functions with redundant default parameters"},messages:{redundantParams:"Function call has redundant parameters matching its default values and can be removed: {{details}}"},fixable:"code",schema:[J(Wa)]},defaultOptions:[{functions:[]}],create(e,[t]){let r=new Map;for(let n of t.functions)r.set(n.name,n.defaults);return{CallExpression(n){let o=Va(n.callee);if(!o)return;let s=r.get(o);if(!s)return;let i=n.arguments;if(i.length===0)return;let l=-1,c=!1,a=new Map,u=new Set,f=new Map,y=[];for(let m=0;m<i.length;m++){if(m>=s.length){l=m;continue}let E=s[m],C=i[m];if(!C||C.type===de.AST_NODE_TYPES.SpreadElement){l=m;continue}let T=gi(C);if(E===void 0){l=m;continue}if(Ot(T,E)){C.type===de.AST_NODE_TYPES.ObjectExpression?(u.add(m),y.push({type:"object",position:m+1})):(f.set(m,T),y.push({type:"simple",position:m+1,value:T}));continue}if(C.type===de.AST_NODE_TYPES.ObjectExpression&&C.properties.length===0&&typeof E=="object"&&E!==null&&Object.keys(E).length>0){u.add(m),y.push({type:"object",position:m+1});continue}let I=Ja(T,E);if(I.size>0){let A=typeof E=="object"&&E!==null?Object.keys(E).length:0;if(C.type===de.AST_NODE_TYPES.ObjectExpression&&C.properties.length===I.size&&C.properties.length===A){u.add(m),y.push({type:"object",position:m+1});continue}else c=!0,a.set(m,I),y.push({type:"partialObject",position:m+1,redundantProperties:Array.from(I)}),l=m}else l=m}if(l<i.length-1||c||u.size>0){let m=function(){let C=[];for(let T of y)if(T.type==="simple")C.push(`Param ${T.position} with value ${JSON.stringify(T.value)}`);else if(T.type==="object")C.push(`Param ${T.position} (object)`);else{let I=T.redundantProperties||[],A=s?s[T.position-1]:void 0;if(typeof A=="object"&&A!==null){let S=A;for(let h of I)if(h in S){let b=Object.getOwnPropertyDescriptor(S,h);b&&C.push(`Param ${T.position} property "${h}" with value ${JSON.stringify(b.value)}`)}}}return{messageId:"redundantParams",data:{details:C.join(", ")}}};var x=m;let E=m();e.report({node:n,messageId:E.messageId,data:E.data,fix(C){let T=[];if(c)for(let[A,S]of a){let h=i[A];if(h&&h.type===de.AST_NODE_TYPES.ObjectExpression){let b=[];for(let k of h.properties)k.type===de.AST_NODE_TYPES.Property&&k.key.type===de.AST_NODE_TYPES.Identifier&&!k.computed&&S.has(k.key.name)||b.push(k);let w=b.map(k=>e.sourceCode.getText(k));T.push(C.replaceText(h,`{ ${w.join(", ")} }`))}}let I=-1;for(let A=i.length-1;A>=0;A--)if(!u.has(A)&&A<=l){I=A;break}if(I<i.length-1)if(I===-1){let A=e.sourceCode.getTokenAfter(n.callee),S=e.sourceCode.getLastToken(n);A&&S&&T.push(C.replaceTextRange([A.range[1],S.range[0]],""))}else{let A=i[I],S=e.sourceCode.getLastToken(n);S&&A&&T.push(C.replaceTextRange([A.range[1],S.range[0]],""))}return T.length>0?T:null}})}}}}});var Re=require("@typescript-eslint/utils");function Xa(e){let t=e.parent;for(;t;){if(t.type===Re.AST_NODE_TYPES.AwaitExpression||t.type===Re.AST_NODE_TYPES.MemberExpression&&t.object===e&&t.property.type===Re.AST_NODE_TYPES.Identifier&&t.property.name==="then"||t.type===Re.AST_NODE_TYPES.ArrowFunctionExpression&&t.body===e)return!0;if(t.type===Re.AST_NODE_TYPES.ArrayExpression&&t.parent.type===Re.AST_NODE_TYPES.CallExpression){let r=t.parent;if(r.callee.type===Re.AST_NODE_TYPES.MemberExpression&&r.callee.object.type===Re.AST_NODE_TYPES.Identifier&&r.callee.object.name==="Promise"&&r.callee.property.type===Re.AST_NODE_TYPES.Identifier&&["all","allSettled","race"].includes(r.callee.property.name))return!0}if(t.parent)t=t.parent;else break}return!1}function Ba(e){let{callee:t}=e;return t.type===Re.AST_NODE_TYPES.Identifier&&t.name==="require"||t.type===Re.AST_NODE_TYPES.MemberExpression&&t.object.type===Re.AST_NODE_TYPES.Identifier&&t.object.name==="require"}var Jn=X({name:"no-sync-dynamic-import",meta:{type:"problem",docs:{description:"Disallow synchronous dynamic imports and require statements, only allow async dynamic imports with await"},messages:{syncDynamicImport:"Synchronous dynamic import() is not allowed. Use regular import statement or await import() for dynamic imports.",requireNotAllowed:"require() statements are not allowed. Use ES6 import statements instead."},schema:[]},defaultOptions:[],create(e){return{ImportExpression(t){Xa(t)||e.report({node:t,messageId:"syncDynamicImport"})},TSImportType(t){e.report({node:t,messageId:"syncDynamicImport"})},CallExpression(t){Ba(t)&&e.report({node:t,messageId:"requireNotAllowed"})}}}});var L=require("@typescript-eslint/utils"),Nt=require("zod/v4");var Ha=Nt.z.object({mainComponentRegex:Nt.z.string().optional(),mainComponentSelector:Nt.z.string().optional()}),Ya=/^[A-Z][A-Za-z0-9]*$/,Vn=X({name:"sort-react-components-and-styles",meta:{type:"suggestion",docs:{description:"Sort React components and styles with styles placed above their first usage"},fixable:"code",schema:[J(Ha)],messages:{stylesShouldBeAboveUsage:"Style definitions should be placed above the first component that uses them",mainComponentShouldBeFirst:"Main component should be placed before other components"}},defaultOptions:[{}],create(e,[t]){let r=e.sourceCode,n=t.mainComponentRegex?new RegExp(t.mainComponentRegex):void 0,o=t.mainComponentSelector;if(!e.filename.endsWith(".tsx"))return{};let i=new Set,l=new Map,c=[],a=[],u=new Set;function f(d){let g=d.node;if(g.type===L.AST_NODE_TYPES.VariableDeclaration){for(let R of g.declarations)if(R.id.type===L.AST_NODE_TYPES.Identifier&&R.id.name===d.name&&R.init)return R.init}if(g.type===L.AST_NODE_TYPES.ExportNamedDeclaration){let R=g.declaration;if(R&&R.type===L.AST_NODE_TYPES.VariableDeclaration){for(let P of R.declarations)if(P.id.type===L.AST_NODE_TYPES.Identifier&&P.id.name===d.name&&P.init)return P.init}}return null}function y(d){let g=new Set;return je(d,R=>(R.type===L.AST_NODE_TYPES.Identifier&&R.name!=="styled"&&R.name!=="css"&&g.add(R.name),!1),r),g}function x(d){return Ya.test(d)}function m(d){if(d.type!==L.AST_NODE_TYPES.CallExpression)return!1;let g=d.callee;return g.type===L.AST_NODE_TYPES.Identifier?g.name==="memo"||g.name==="forwardRef":g.type===L.AST_NODE_TYPES.MemberExpression&&g.property.type===L.AST_NODE_TYPES.Identifier?g.property.name==="memo"||g.property.name==="forwardRef":!1}function E(d){if(d.type===L.AST_NODE_TYPES.JSXElement||d.type===L.AST_NODE_TYPES.JSXFragment)return!0;if(d.type===L.AST_NODE_TYPES.BlockStatement){for(let g of d.body)if(g.type===L.AST_NODE_TYPES.ReturnStatement&&g.argument)return E(g.argument)}if(d.type===L.AST_NODE_TYPES.ArrayExpression){for(let g of d.elements)if(g&&(g.type===L.AST_NODE_TYPES.JSXElement||g.type===L.AST_NODE_TYPES.JSXFragment))return!0}return!1}function C(d){if(d.type!==L.AST_NODE_TYPES.ArrowFunctionExpression)return!1;let g=d.body;if(g.type===L.AST_NODE_TYPES.ArrowFunctionExpression){let R=g.body;if(E(R))return!0}return!1}function T(d){if(d.type===L.AST_NODE_TYPES.TaggedTemplateExpression){let g=d.tag;if(g.type===L.AST_NODE_TYPES.MemberExpression&&g.object.type===L.AST_NODE_TYPES.Identifier&&g.object.name==="styled")return!0;if(g.type===L.AST_NODE_TYPES.CallExpression){let R=g.callee;if(R.type===L.AST_NODE_TYPES.Identifier&&R.name==="styled")return!0}}return!1}function I(d){if(d.type===L.AST_NODE_TYPES.TaggedTemplateExpression){let g=d.tag;if(g.type===L.AST_NODE_TYPES.Identifier&&g.name==="css")return!0}return!1}function A(d,g){if(d.id.type!==L.AST_NODE_TYPES.Identifier)return;let R=d.id.name,P=d.init;if(P){if(T(P)||I(P)){a.push({node:g,name:R});return}if((x(R)||P.type===L.AST_NODE_TYPES.ArrowFunctionExpression)&&(P.type===L.AST_NODE_TYPES.ArrowFunctionExpression||P.type===L.AST_NODE_TYPES.FunctionExpression||m(P))){if(P.type===L.AST_NODE_TYPES.ArrowFunctionExpression||P.type===L.AST_NODE_TYPES.FunctionExpression){if(E(P.body)){i.add(R);return}}else if(m(P)){i.add(R);return}}P.type===L.AST_NODE_TYPES.Identifier&&l.set(R,P.name),x(R)||C(P)&&i.add(R)}}function S(d){return d.type===L.AST_NODE_TYPES.ExportDefaultDeclaration||d.type===L.AST_NODE_TYPES.ExportNamedDeclaration}function h(d){if(d.type===L.AST_NODE_TYPES.FunctionDeclaration)return d.id?d.id.name:null;if(d.type===L.AST_NODE_TYPES.VariableDeclaration){let g=d.declarations[0];if(g&&g.id.type===L.AST_NODE_TYPES.Identifier)return g.id.name}if(d.type===L.AST_NODE_TYPES.ExportDefaultDeclaration){let g=d.declaration;if(g.type===L.AST_NODE_TYPES.FunctionDeclaration)return g.id?g.id.name:"default";if(g.type===L.AST_NODE_TYPES.Identifier)return g.name}if(d.type===L.AST_NODE_TYPES.ExportNamedDeclaration){let g=d.declaration;if(g&&g.type===L.AST_NODE_TYPES.FunctionDeclaration)return g.id?g.id.name:null;if(g&&g.type===L.AST_NODE_TYPES.VariableDeclaration){let R=g.declarations[0];if(R&&R.id.type===L.AST_NODE_TYPES.Identifier)return R.id.name}}return null}function b(d,g){return o?u.has(d):n?n.test(g):S(d)}function w(d){let g=new Set;je(d.node,R=>{if(R.type===L.AST_NODE_TYPES.Identifier)for(let P of a)P.name===R.name&&(g.add(P.name),(P.firstUsagePosition===void 0||R.range[0]<P.firstUsagePosition)&&(P.firstUsagePosition=R.range[0]));if(R.type===L.AST_NODE_TYPES.JSXElement){let P=R.openingElement;if(P.name.type===L.AST_NODE_TYPES.JSXIdentifier)for(let j of a)j.name===P.name.name&&(g.add(j.name),(j.firstUsagePosition===void 0||P.name.range[0]<j.firstUsagePosition)&&(j.firstUsagePosition=P.name.range[0]))}return!1},r),d.usedStyles=g}function k(d){if(d.type===L.AST_NODE_TYPES.VariableDeclaration){for(let g of d.declarations)A(g,d);return}if(d.type===L.AST_NODE_TYPES.FunctionDeclaration){x(d.id.name)&&E(d.body)&&i.add(d.id.name);return}if(d.type===L.AST_NODE_TYPES.ExportNamedDeclaration&&d.declaration){let g=d.declaration;if(g.type===L.AST_NODE_TYPES.VariableDeclaration){for(let R of g.declarations)A(R,d);return}if(g.type===L.AST_NODE_TYPES.FunctionDeclaration&&g.id){x(g.id.name)&&E(g.body)&&i.add(g.id.name);return}}if(d.type===L.AST_NODE_TYPES.ExportDefaultDeclaration){let g=d.declaration;g.type===L.AST_NODE_TYPES.Identifier&&i.add(g.name),(g.type===L.AST_NODE_TYPES.FunctionDeclaration||g.type===L.AST_NODE_TYPES.ArrowFunctionExpression||g.type===L.AST_NODE_TYPES.FunctionExpression)&&(g.type===L.AST_NODE_TYPES.FunctionDeclaration?g.id?i.add(g.id.name):i.add("default"):E(g.body)&&i.add("default"))}}function O(d,g=new Set){if(i.has(d))return!0;if(g.has(d))return!1;g.add(d);let R=l.get(d);return R?O(R,g):!1}let p={};return o&&(p[o]=d=>{let g=d;for(;g.parent&&g.parent.type!==L.AST_NODE_TYPES.Program;)g=g.parent;g.parent&&(g.type===L.AST_NODE_TYPES.VariableDeclaration||g.type===L.AST_NODE_TYPES.FunctionDeclaration||g.type===L.AST_NODE_TYPES.ExportNamedDeclaration||g.type===L.AST_NODE_TYPES.ExportDefaultDeclaration)&&u.add(g)}),p["Program:exit"]=d=>{let g=0;for(let D of d.body){if(D.type===L.AST_NODE_TYPES.ImportDeclaration){g+=1;continue}break}for(let D of d.body)k(D);for(let D of d.body){let Z=h(D);if(Z&&O(Z)){let q=b(D,Z);c.push({node:D,name:Z,isMainComponent:q,usedStyles:new Set,isExported:S(D)})}}if(!o&&n&&!c.some(D=>D.isMainComponent))for(let D of c)D.isExported&&(D.isMainComponent=!0);for(let D of c)w(D);let R=new Set;for(let D of a)R.add(D.name);let P=new Map;for(let D=0;D<d.body.length;D+=1){let Z=d.body[D];for(let q of a)q.node===Z&&P.set(q.name,D)}let j=new Map;for(let D of a){let Z=f(D),q=new Set;if(Z){let ue=y(Z);for(let fe of ue)R.has(fe)&&fe!==D.name&&q.add(fe)}j.set(D.name,q)}let V=new Map;for(let D of a){let Z=j.get(D.name);if(!Z)continue;let q=P.get(D.name);if(q!==void 0)for(let ue of Z){let fe=V.get(ue);(fe===void 0||q<fe)&&V.set(ue,q)}}let G=[];for(let D of a){if(D.firstUsagePosition===void 0)continue;let Z=d.body.indexOf(D.node),q=-1;for(let Ee of c){if(!Ee.usedStyles.has(D.name))continue;let Ie=d.body.indexOf(Ee.node);(q===-1||Ie<q)&&(q=Ie)}let ue=V.get(D.name);if(ue!==void 0&&(q===-1||ue<q)&&(q=ue),q===-1)continue;let fe=-1;for(let Ee of c){let Ie=d.body.indexOf(Ee.node);Ie<q&&Ie>fe&&(fe=Ie)}let ke=Z<q,Xe=Z>fe,Se=-1,pt=j.get(D.name);if(pt)for(let Ee of pt){let Ie=P.get(Ee);Ie!==void 0&&Ie>Se&&(Se=Ie)}let tt=Z>Se;if(!(ke&&Xe&&tt)){let Ee=fe+1;if(Se+1>Ee&&(Ee=Se+1),Ee<g&&(Ee=g),Ee>q)continue;G.push({style:D,targetPosition:Ee})}}let H=null;if(c.length>1){let D=c.map(q=>({c:q,idx:d.body.indexOf(q.node)})).sort((q,ue)=>q.idx-ue.idx)[0]?.c,Z=c.find(q=>q.isMainComponent)||null;D&&Z&&D.node!==Z.node&&(H={component:Z,targetBefore:D.node})}if(G.length>0||H){let D=G[0]?.style.node||H?.component.node||d,Z=G.length>0?"stylesShouldBeAboveUsage":"mainComponentShouldBeFirst";e.report({node:D,messageId:Z,fix:F(G,H,d.body)})}},p;function F(d,g,R){return function*(P){d.sort((V,G)=>V.targetPosition-G.targetPosition);for(let{style:V}of d){let G=r.getCommentsBefore(V.node),H=V.node.range[0],D=V.node.range[1];G.length>0&&G[0]&&(H=G[0].range[0]),H===V.node.range[0]&&r.text.slice(0,H).trim().length===0&&(H=0),yield P.removeRange([H,D])}let j=new Map;for(let V of d){let G=j.get(V.targetPosition)||[];G.push(V),j.set(V.targetPosition,G)}for(let[V,G]of j){let H=R[V];if(!H)continue;let D=r.getCommentsBefore(H),Z=D.length>0&&D[0]?D[0].range[0]:H.range[0],q=[];for(let{style:ue}of G){let fe=r.getCommentsBefore(ue.node),ke=r.getText(ue.node);fe.length>0&&(ke=`${fe.map(Se=>r.getText(Se)).join(`
47
47
  `)}
48
- ${ve}`),q.push(ve)}yield P.insertTextBeforeRange([Z,Z],`${q.join(`
48
+ ${ke}`),q.push(ke)}yield P.insertTextBeforeRange([Z,Z],`${q.join(`
49
49
 
50
50
  `)}
51
51
 
52
- `)}if(g){let{component:V,targetBefore:G}=g,Y=r.getCommentsBefore(V.node),D=V.node.range[0],Z=V.node.range[1];Y.length>0&&Y[0]&&(D=Y[0].range[0]),D===V.node.range[0]&&r.text.slice(0,D).trim().length===0&&(D=0);let q=r.getCommentsBefore(G),ue=q.length>0&&q[0]?q[0].range[0]:G.range[0],fe=(()=>{let ve=r.getText(V.node);return Y.length>0&&(ve=`${Y.map(Se=>r.getText(Se)).join(`
52
+ `)}if(g){let{component:V,targetBefore:G}=g,H=r.getCommentsBefore(V.node),D=V.node.range[0],Z=V.node.range[1];H.length>0&&H[0]&&(D=H[0].range[0]),D===V.node.range[0]&&r.text.slice(0,D).trim().length===0&&(D=0);let q=r.getCommentsBefore(G),ue=q.length>0&&q[0]?q[0].range[0]:G.range[0],fe=(()=>{let ke=r.getText(V.node);return H.length>0&&(ke=`${H.map(Se=>r.getText(Se)).join(`
53
53
  `)}
54
- ${ve}`),ve})();yield P.removeRange([D,Z]),yield P.insertTextBeforeRange([ue,ue],`${fe}
55
- `)}}}}});var Dt=require("@typescript-eslint/utils"),Xn=Pe(require("typescript")),di=require("zod/v4");var Ja=di.z.object({}),Bn=X({name:"no-unnecessary-void-on-promise",meta:{type:"suggestion",docs:{description:"Disallow void operator on non-Promise function calls to avoid unnecessary void keywords added by no-floating-promises"},messages:{unnecessaryVoid:"Unnecessary void operator on non-Promise function call",removeVoid:"Remove void operator"},hasSuggestions:!0,schema:[z(Ja)]},defaultOptions:[{}],create(e){let t=Dt.ESLintUtils.getParserServices(e,!0),r=t.program?.getTypeChecker();if(!r||!t.program)throw new Error("TypeScript services or program not available");function n(o,s){if(o.flags&Xn.default.TypeFlags.Any||o.flags&Xn.default.TypeFlags.Unknown)return!1;let i=o.getProperty("then");return i?s.getTypeOfSymbol(i).getCallSignatures().length>0:!1}return{UnaryExpression(o){if(o.operator!=="void"||o.argument.type!==Dt.AST_NODE_TYPES.CallExpression)return;let s=t.esTreeNodeToTSNodeMap.get(o.argument),i=r.getTypeAtLocation(s);if(!n(i,r)){let c=e.sourceCode.getText(o.argument);e.report({node:o,messageId:"unnecessaryVoid",suggest:[{messageId:"removeVoid",fix(a){return a.replaceText(o,c)}}]})}}}}});var Ce=require("@typescript-eslint/utils"),lt=require("zod/v4");var Va=lt.z.object({functions:lt.z.array(lt.z.string()).optional(),selectors:lt.z.array(lt.z.string()).optional()});function gi(e){let t=e.parent;for(;t;){if(t.type===Ce.AST_NODE_TYPES.FunctionDeclaration||t.type===Ce.AST_NODE_TYPES.FunctionExpression||t.type===Ce.AST_NODE_TYPES.ArrowFunctionExpression)return!0;t=t.parent}return!1}function Si(e){if(e.type===Ce.AST_NODE_TYPES.TaggedTemplateExpression){let{tag:r}=e;return r.type===Ce.AST_NODE_TYPES.Identifier?r.name:r.type===Ce.AST_NODE_TYPES.MemberExpression&&r.property.type===Ce.AST_NODE_TYPES.Identifier?r.property.name:null}let{callee:t}=e;return t.type===Ce.AST_NODE_TYPES.Identifier?t.name:t.type===Ce.AST_NODE_TYPES.MemberExpression&&t.property.type===Ce.AST_NODE_TYPES.Identifier?t.property.name:null}var Hn=X({name:"require-lazy-execution",meta:{type:"problem",docs:{description:"Require certain function calls to be executed lazily (inside functions, not at module level)"},messages:{moduleLevel:'Function "{{ functionName }}" must only be called inside functions or getters, not at module level'},schema:[z(Va)]},defaultOptions:[{functions:[],selectors:[]}],create(e){let[t]=e.options,r=new Set(t.functions??[]),n=t.selectors??[];function o(i){if(gi(i))return;let l=Si(i);l&&r.has(l)&&e.report({node:i,messageId:"moduleLevel",data:{functionName:l}})}let s={CallExpression(i){i.type===Ce.AST_NODE_TYPES.CallExpression&&o(i)},TaggedTemplateExpression(i){i.type===Ce.AST_NODE_TYPES.TaggedTemplateExpression&&o(i)}};for(let i of n)s[i]=l=>{if(l.type!==Ce.AST_NODE_TYPES.CallExpression&&l.type!==Ce.AST_NODE_TYPES.TaggedTemplateExpression||gi(l))return;let c=Si(l);c&&e.report({node:l,messageId:"moduleLevel",data:{functionName:c}})};return s}});var Re=require("@typescript-eslint/utils");function Xa(e,t){let{body:r}=e;if(r.type!==Re.AST_NODE_TYPES.BlockStatement)return t.getText(r);let n=r.body[0];return!n||n.type!==Re.AST_NODE_TYPES.ReturnStatement?"":n.argument?t.getText(n.argument):"undefined"}function Ba(e){let t=e.parent;if(t.type!==Re.AST_NODE_TYPES.ReturnStatement)return null;let r=t.parent;if(r.type!==Re.AST_NODE_TYPES.BlockStatement||r.body.length!==1)return null;let n=r.parent;return n.type!==Re.AST_NODE_TYPES.FunctionDeclaration&&n.type!==Re.AST_NODE_TYPES.ArrowFunctionExpression&&n.type!==Re.AST_NODE_TYPES.FunctionExpression?null:{parentFunction:n,returnStatement:t}}var Yn=X({name:"no-unnecessary-iife",meta:{type:"suggestion",fixable:"code",docs:{description:"Disallow unnecessary immediately invoked function expressions"},messages:{unnecessaryIife:"Unnecessary IIFE. Can be simplified to the returned expression."},schema:[]},defaultOptions:[],create(e){let t=e.sourceCode;return{CallExpression(r){let{callee:n,arguments:o}=r;if(o.length>0||n.type!==Re.AST_NODE_TYPES.FunctionExpression&&n.type!==Re.AST_NODE_TYPES.ArrowFunctionExpression||n.async||n.params.length>0)return;let{body:s}=n;if(s.type===Re.AST_NODE_TYPES.BlockStatement){if(s.body.length!==1){let a=Ba(r);if(a){if(t.getCommentsInside(n).length>0)return;let f=t.getText(s);e.report({node:r,messageId:"unnecessaryIife",fix:y=>{let{parentFunction:x}=a;return x.body.type!==Re.AST_NODE_TYPES.BlockStatement?null:y.replaceText(x.body,f)}})}return}let c=s.body[0];if(!c||c.type!==Re.AST_NODE_TYPES.ReturnStatement)return}if(t.getCommentsInside(n).length>0)return;let l=Xa(n,t);e.report({node:r,messageId:"unnecessaryIife",fix:c=>c.replaceText(r,l)})}}}});var Ze=require("zod/v4");var Ha="no-restricted-comments",Ya=Ze.z.object({regex:Ze.z.string().optional(),includes:Ze.z.string().optional(),message:Ze.z.string().optional(),autoFix:Ze.z.boolean().optional()}),qa=Ze.z.object({patterns:Ze.z.array(Ya)}),qn=X({name:Ha,meta:{type:"problem",docs:{description:"Disallow comments matching specific patterns"},fixable:"code",hasSuggestions:!0,schema:[z(qa)],messages:{restrictedComment:"Comment matches restricted pattern '{{pattern}}'",restrictedCommentWithMessage:"{{message}}",removeComment:"Remove this comment"}},defaultOptions:[{patterns:[]}],create(e,[t]){let r=e.sourceCode,n=new Map;function o(i){let l=n.get(i);return l||(l=new RegExp(i),n.set(i,l)),l}function s(i,l){return l.regex?o(l.regex).test(i):l.includes?i.includes(l.includes):!1}return{Program(){let i=r.getAllComments();for(let c of i)for(let a of t.patterns)if(s(c.value,a)){let f=function(y){return y.remove(c)};var l=f;let u=a.regex??a.includes??"";a.message?e.report({loc:c.loc,messageId:"restrictedCommentWithMessage",data:{message:a.message},fix:a.autoFix?f:void 0,suggest:a.autoFix?void 0:[{messageId:"removeComment",fix:f}]}):e.report({loc:c.loc,messageId:"restrictedComment",data:{pattern:u},fix:a.autoFix?f:void 0,suggest:a.autoFix?void 0:[{messageId:"removeComment",fix:f}]});break}}}}});var Ti={[gn.name]:gn.rule,[qt.name]:qt.rule,[Yt.name]:Yt.rule,"rules-of-hooks":ui,"exhaustive-deps":sr,"require-description":ri.rule,[Zt.name]:Zt.rule,[Kt.name]:Kt.rule,[Tn.name]:Tn.rule,[Lt.name]:Lt.rule,[Ht.name]:Ht.rule,[en.name]:en.rule,[ut.name]:ut.rule,[bn.name]:bn.rule,[Qt.name]:Qt.rule,[Gt.name]:Gt.rule,[nn.name]:nn.rule,[_t.name]:_t.rule,[Fn.name]:Fn.rule,[wn.name]:wn.rule,[Pn.name]:Pn.rule,[Bt.name]:Bt.rule,[an.name]:an.rule,[ln.name]:ln.rule,[pn.name]:pn.rule,[mn.name]:mn.rule,[yn.name]:yn.rule,[cn.name]:cn.rule,[fn.name]:fn.rule,[En.name]:En.rule,[on.name]:on.rule,[rn.name]:rn.rule,[_n.name]:_n.rule,[Sn.name]:Sn.rule,[On.name]:On.rule,[Ln.name]:Ln.rule,[$n.name]:$n.rule,[Un.name]:Un.rule,[zn.name]:zn.rule,[Wn.name]:Wn.rule,[Jn.name]:Jn.rule,[Vn.name]:Vn.rule,[Bn.name]:Bn.rule,[Hn.name]:Hn.rule,[ut.name]:ut.rule,[Yn.name]:Yn.rule,[qn.name]:qn.rule};var Za={rules:Ti};0&&(module.exports={extendedLintPlugin});
54
+ ${ke}`),ke})();yield P.removeRange([D,Z]),yield P.insertTextBeforeRange([ue,ue],`${fe}
55
+ `)}}}}});var Dt=require("@typescript-eslint/utils"),Xn=Pe(require("typescript")),Si=require("zod/v4");var qa=Si.z.object({}),Bn=X({name:"no-unnecessary-void-on-promise",meta:{type:"suggestion",docs:{description:"Disallow void operator on non-Promise function calls to avoid unnecessary void keywords added by no-floating-promises"},messages:{unnecessaryVoid:"Unnecessary void operator on non-Promise function call",removeVoid:"Remove void operator"},hasSuggestions:!0,schema:[J(qa)]},defaultOptions:[{}],create(e){let t=Dt.ESLintUtils.getParserServices(e,!0),r=t.program?.getTypeChecker();if(!r||!t.program)throw new Error("TypeScript services or program not available");function n(o,s){if(o.flags&Xn.default.TypeFlags.Any||o.flags&Xn.default.TypeFlags.Unknown)return!1;let i=o.getProperty("then");return i?s.getTypeOfSymbol(i).getCallSignatures().length>0:!1}return{UnaryExpression(o){if(o.operator!=="void"||o.argument.type!==Dt.AST_NODE_TYPES.CallExpression)return;let s=t.esTreeNodeToTSNodeMap.get(o.argument),i=r.getTypeAtLocation(s);if(!n(i,r)){let c=e.sourceCode.getText(o.argument);e.report({node:o,messageId:"unnecessaryVoid",suggest:[{messageId:"removeVoid",fix(a){return a.replaceText(o,c)}}]})}}}}});var Ce=require("@typescript-eslint/utils"),lt=require("zod/v4");var Za=lt.z.object({functions:lt.z.array(lt.z.string()).optional(),selectors:lt.z.array(lt.z.string()).optional()});function Ti(e){let t=e.parent;for(;t;){if(t.type===Ce.AST_NODE_TYPES.FunctionDeclaration||t.type===Ce.AST_NODE_TYPES.FunctionExpression||t.type===Ce.AST_NODE_TYPES.ArrowFunctionExpression)return!0;t=t.parent}return!1}function hi(e){if(e.type===Ce.AST_NODE_TYPES.TaggedTemplateExpression){let{tag:r}=e;return r.type===Ce.AST_NODE_TYPES.Identifier?r.name:r.type===Ce.AST_NODE_TYPES.MemberExpression&&r.property.type===Ce.AST_NODE_TYPES.Identifier?r.property.name:null}let{callee:t}=e;return t.type===Ce.AST_NODE_TYPES.Identifier?t.name:t.type===Ce.AST_NODE_TYPES.MemberExpression&&t.property.type===Ce.AST_NODE_TYPES.Identifier?t.property.name:null}var Hn=X({name:"require-lazy-execution",meta:{type:"problem",docs:{description:"Require certain function calls to be executed lazily (inside functions, not at module level)"},messages:{moduleLevel:'Function "{{ functionName }}" must only be called inside functions or getters, not at module level'},schema:[J(Za)]},defaultOptions:[{functions:[],selectors:[]}],create(e){let[t]=e.options,r=new Set(t.functions??[]),n=t.selectors??[];function o(i){if(Ti(i))return;let l=hi(i);l&&r.has(l)&&e.report({node:i,messageId:"moduleLevel",data:{functionName:l}})}let s={CallExpression(i){i.type===Ce.AST_NODE_TYPES.CallExpression&&o(i)},TaggedTemplateExpression(i){i.type===Ce.AST_NODE_TYPES.TaggedTemplateExpression&&o(i)}};for(let i of n)s[i]=l=>{if(l.type!==Ce.AST_NODE_TYPES.CallExpression&&l.type!==Ce.AST_NODE_TYPES.TaggedTemplateExpression||Ti(l))return;let c=hi(l);c&&e.report({node:l,messageId:"moduleLevel",data:{functionName:c}})};return s}});var ve=require("@typescript-eslint/utils");function Ga(e,t){let{body:r}=e;if(r.type!==ve.AST_NODE_TYPES.BlockStatement)return t.getText(r);let n=r.body[0];return!n||n.type!==ve.AST_NODE_TYPES.ReturnStatement?"":n.argument?t.getText(n.argument):"undefined"}function Ka(e){let t=e.parent;if(t.type!==ve.AST_NODE_TYPES.ReturnStatement)return null;let r=t.parent;if(r.type!==ve.AST_NODE_TYPES.BlockStatement||r.body.length!==1)return null;let n=r.parent;return n.type!==ve.AST_NODE_TYPES.FunctionDeclaration&&n.type!==ve.AST_NODE_TYPES.ArrowFunctionExpression&&n.type!==ve.AST_NODE_TYPES.FunctionExpression?null:{parentFunction:n,returnStatement:t}}var Yn=X({name:"no-unnecessary-iife",meta:{type:"suggestion",fixable:"code",docs:{description:"Disallow unnecessary immediately invoked function expressions"},messages:{unnecessaryIife:"Unnecessary IIFE. Can be simplified to the returned expression."},schema:[]},defaultOptions:[],create(e){let t=e.sourceCode;return{CallExpression(r){let{callee:n,arguments:o}=r;if(o.length>0||n.type!==ve.AST_NODE_TYPES.FunctionExpression&&n.type!==ve.AST_NODE_TYPES.ArrowFunctionExpression||n.async||n.params.length>0)return;let{body:s}=n;if(s.type===ve.AST_NODE_TYPES.BlockStatement){if(s.body.length!==1){let a=Ka(r);if(a){if(t.getCommentsInside(n).length>0)return;let f=t.getText(s);e.report({node:r,messageId:"unnecessaryIife",fix:y=>{let{parentFunction:x}=a;return x.body.type!==ve.AST_NODE_TYPES.BlockStatement?null:y.replaceText(x.body,f)}})}return}let c=s.body[0];if(!c||c.type!==ve.AST_NODE_TYPES.ReturnStatement)return}if(t.getCommentsInside(n).length>0)return;let l=Ga(n,t);e.report({node:r,messageId:"unnecessaryIife",fix:c=>c.replaceText(r,l)})}}}});var Ze=require("zod/v4");var Qa="no-restricted-comments",el=Ze.z.object({regex:Ze.z.string().optional(),includes:Ze.z.string().optional(),message:Ze.z.string().optional(),autoFix:Ze.z.boolean().optional()}),tl=Ze.z.object({patterns:Ze.z.array(el)}),qn=X({name:Qa,meta:{type:"problem",docs:{description:"Disallow comments matching specific patterns"},fixable:"code",hasSuggestions:!0,schema:[J(tl)],messages:{restrictedComment:"Comment matches restricted pattern '{{pattern}}'",restrictedCommentWithMessage:"{{message}}",removeComment:"Remove this comment"}},defaultOptions:[{patterns:[]}],create(e,[t]){let r=e.sourceCode,n=new Map;function o(i){let l=n.get(i);return l||(l=new RegExp(i),n.set(i,l)),l}function s(i,l){return l.regex?o(l.regex).test(i):l.includes?i.includes(l.includes):!1}return{Program(){let i=r.getAllComments();for(let c of i)for(let a of t.patterns)if(s(c.value,a)){let f=function(y){return y.remove(c)};var l=f;let u=a.regex??a.includes??"";a.message?e.report({loc:c.loc,messageId:"restrictedCommentWithMessage",data:{message:a.message},fix:a.autoFix?f:void 0,suggest:a.autoFix?void 0:[{messageId:"removeComment",fix:f}]}):e.report({loc:c.loc,messageId:"restrictedComment",data:{pattern:u},fix:a.autoFix?f:void 0,suggest:a.autoFix?void 0:[{messageId:"removeComment",fix:f}]});break}}}}});var Ei={[gn.name]:gn.rule,[qt.name]:qt.rule,[Yt.name]:Yt.rule,"rules-of-hooks":mi,"exhaustive-deps":sr,"require-description":ri.rule,[Zt.name]:Zt.rule,[Kt.name]:Kt.rule,[Tn.name]:Tn.rule,[Lt.name]:Lt.rule,[Ht.name]:Ht.rule,[en.name]:en.rule,[ut.name]:ut.rule,[bn.name]:bn.rule,[Qt.name]:Qt.rule,[Gt.name]:Gt.rule,[nn.name]:nn.rule,[_t.name]:_t.rule,[Fn.name]:Fn.rule,[wn.name]:wn.rule,[Pn.name]:Pn.rule,[Bt.name]:Bt.rule,[an.name]:an.rule,[ln.name]:ln.rule,[pn.name]:pn.rule,[mn.name]:mn.rule,[yn.name]:yn.rule,[cn.name]:cn.rule,[fn.name]:fn.rule,[En.name]:En.rule,[on.name]:on.rule,[rn.name]:rn.rule,[_n.name]:_n.rule,[Sn.name]:Sn.rule,[On.name]:On.rule,[Ln.name]:Ln.rule,[$n.name]:$n.rule,[Un.name]:Un.rule,[zn.name]:zn.rule,[Wn.name]:Wn.rule,[Jn.name]:Jn.rule,[Vn.name]:Vn.rule,[Bn.name]:Bn.rule,[Hn.name]:Hn.rule,[ut.name]:ut.rule,[Yn.name]:Yn.rule,[qn.name]:qn.rule};var nl={rules:Ei};0&&(module.exports={extendedLintPlugin});