@ls-stack/extended-lint 0.66.0 → 0.67.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
- "use strict";var zr=Object.create;var tt=Object.defineProperty;var Jr=Object.getOwnPropertyDescriptor;var Vr=Object.getOwnPropertyNames;var Xr=Object.getPrototypeOf,Hr=Object.prototype.hasOwnProperty;var Br=(e,n)=>{for(var r in n)tt(e,r,{get:n[r],enumerable:!0})},xn=(e,n,r,t)=>{if(n&&typeof n=="object"||typeof n=="function")for(let o of Vr(n))!Hr.call(e,o)&&o!==r&&tt(e,o,{get:()=>n[o],enumerable:!(t=Jr(n,o))||t.enumerable});return e};var he=(e,n,r)=>(r=e!=null?zr(Xr(e)):{},xn(n||!e||!e.__esModule?tt(r,"default",{value:e,enumerable:!0}):r,e)),Yr=e=>xn(tt({},"__esModule",{value:!0}),e);var Zo={};Br(Zo,{extendedLintPlugin:()=>qo});module.exports=Yr(Zo);var oe=require("@typescript-eslint/utils"),v=require("zod/v4");var Cn=require("@typescript-eslint/utils"),An=he(require("zod/v4"));function V(e){let r=Cn.ESLintUtils.RuleCreator(t=>`https://github.com/lucasols/extended-lint#${t}`)(e);return{name:e.name,rule:r}}function j(e){return An.toJSONSchema(e)}var qr=v.z.object({disallow:v.z.array(v.z.object({selector:v.z.string(),message:v.z.string(),replace:v.z.optional(v.z.union([v.z.string(),v.z.object({regex:v.z.string(),with:v.z.string()})])),replaceType:v.z.optional(v.z.enum(["suggestion","autofix"]))})).optional(),disallowFnCalls:v.z.optional(v.z.array(v.z.object({fn:v.z.string(),withArgs:v.z.optional(v.z.array(v.z.object({atIndex:v.z.number(),value:v.z.union([v.z.string(),v.z.number(),v.z.boolean()])}))),message:v.z.string(),replaceWith:v.z.optional(v.z.string()),ignoreRegex:v.z.optional(v.z.string())}))),__dev_simulateFileName:v.z.optional(v.z.string()),mustMatchSyntax:v.z.optional(v.z.array(v.z.object({includeRegex:v.z.string(),mustCallFn:v.z.optional(v.z.array(v.z.object({anyCall:v.z.array(v.z.object({fn:v.z.string(),withArgs:v.z.array(v.z.object({atIndex:v.z.number(),literal:v.z.union([v.z.string(),v.z.number(),v.z.boolean()])}))})),message:v.z.optional(v.z.string())}))),mustMatchSelector:v.z.optional(v.z.array(v.z.object({selector:v.z.string(),message:v.z.string()}))),mustHaveExport:v.z.optional(v.z.array(v.z.object({name:v.z.string(),type:v.z.enum(["function","variable","any"]).default("any"),message:v.z.string()})))})))}),gt=V({name:"advanced-no-restricted-syntax",meta:{type:"suggestion",docs:{description:"Disallow specific syntax patterns"},schema:[j(qr)],messages:{default:"{{message}}"},fixable:"code",hasSuggestions:!0},defaultOptions:[{disallow:[]}],create(e,[n]){let r={},{mustMatchSyntax:t,__dev_simulateFileName:o,disallow:a,disallowFnCalls:i}=n,c=o??e.filename,l=[],p=new Map,m=new Set,d=new Map,s=new Set,u=new Map;function y(E){for(let C of E.specifiers)C.type===oe.AST_NODE_TYPES.ImportSpecifier&&C.imported.type===oe.AST_NODE_TYPES.Identifier&&C.imported.name!==C.local.name&&u.set(C.local.name,C.imported.name)}function g(E){if(E.declaration){if(E.declaration.type===oe.AST_NODE_TYPES.FunctionDeclaration&&E.declaration.id){let C=E.declaration.id.name;for(let w of Array.from(s)){let[R,L]=w.split(":");R===C&&(L==="function"||L==="any")&&s.delete(w)}}else if(E.declaration.type===oe.AST_NODE_TYPES.VariableDeclaration){for(let C of E.declaration.declarations)if(C.id.type===oe.AST_NODE_TYPES.Identifier){let w=C.id.name;for(let R of Array.from(s)){let[L,U]=R.split(":");L===w&&(U==="variable"||U==="any")&&s.delete(R)}}}}for(let C of E.specifiers)if(C.exported.type===oe.AST_NODE_TYPES.Identifier){let w=C.exported.name;for(let R of Array.from(s)){let[L,U]=R.split(":");L===w&&U==="any"&&s.delete(R)}}}function S(E){E.id.type===oe.AST_NODE_TYPES.Identifier&&E.init?.type===oe.AST_NODE_TYPES.Identifier&&u.set(E.id.name,E.init.name)}function f(E){return u.get(E)??E}function T(E,C){return f(E)===C||E===C}for(let{includeRegex:E,mustCallFn:C,mustMatchSelector:w,mustHaveExport:R}of t??[]){let U=function(te){let K=te;for(let{name:ie,value:se}of L??[])K=K.replaceAll(ie,se);return K};var I=U;let L=Zr(c,new RegExp(E));if(L){for(let{anyCall:te,message:K}of C??[]){let ie=`Expected file to call the function: ${te.map(({fn:se})=>se).join(" or ")}`;m.add(ie),l.push(se=>{let{callee:q}=se;if(q.type===oe.AST_NODE_TYPES.Identifier){for(let{fn:Te,withArgs:_e}of te)if(q.name===Te){m.delete(ie);for(let ae of _e){let ve=se.arguments[ae.atIndex],me=typeof ae.literal=="string"?U(ae.literal):ae.literal;if(!ve){e.report({node:se,messageId:"default",data:{message:`Missing argument with value "${me}" at index ${ae.atIndex}${K?`: ${U(K)}`:""}`}});continue}if(ve.type!==oe.AST_NODE_TYPES.Literal){e.report({node:ve,messageId:"default",data:{message:`Argument at position ${ae.atIndex} should the literal "${me}"${K?`: ${U(K)}`:""}`}});continue}ve.value!==me&&e.report({node:ve,messageId:"default",data:{message:`Argument should have the value "${me}"${K?`: ${U(K)}`:""}`},fix:Le=>Le.replaceText(ve,typeof me=="string"?`'${me}'`:String(me))})}break}}})}for(let{selector:te,message:K}of w??[])d.set(te,U(K)),p.set(U(te),()=>{d.delete(te)});for(let{name:te,type:K,message:ie}of R??[]){let se=U(te),q=U(ie);s.add(`${se}:${K}:${q}`)}}}for(let{fn:E,withArgs:C,message:w,replaceWith:R,ignoreRegex:L}of i??[])L&&new RegExp(L).test(c)||l.push(U=>{let{callee:te}=U;if(te.type!==oe.AST_NODE_TYPES.Identifier||!T(te.name,E))return;if(C)for(let ie of C){let se=U.arguments[ie.atIndex];if(!se){e.report({node:U,messageId:"default",data:{message:`Missing argument with value "${ie.value}" at index ${ie.atIndex}: ${w}`}});return}if(se.type!==oe.AST_NODE_TYPES.Literal||se.value!==ie.value)return}let K=ie=>R?ie.replaceText(U,R):null;e.report({node:U,messageId:"default",data:{message:w},suggest:R?[{messageId:"default",data:{message:`Replace with "${R}"`},fix:K}]:void 0})});function b(E,C){let w=r[E];w?r[E]=R=>{w(R),C(R)}:r[E]=C}for(let{selector:E,message:C,replace:w,replaceType:R="suggestion"}of a??[]){if(E==="CallExpression"){l.push(L=>{h(w,L,C,R)});continue}r[E]=L=>{h(w,L,C,R)}}if(p.size>0)for(let[E,C]of p)b(E,C);return l.length>0&&(r.CallExpression=E=>{if(E.type===oe.AST_NODE_TYPES.CallExpression)for(let C of l)C(E)}),r.ImportDeclaration=E=>{E.type===oe.AST_NODE_TYPES.ImportDeclaration&&y(E)},r.ExportNamedDeclaration=E=>{E.type===oe.AST_NODE_TYPES.ExportNamedDeclaration&&g(E)},r.VariableDeclarator=E=>{E.type===oe.AST_NODE_TYPES.VariableDeclarator&&S(E)},r["Program:exit"]=E=>{for(let C of m)e.report({node:E,messageId:"default",data:{message:C}});for(let[,C]of d)e.report({node:E,messageId:"default",data:{message:C}});for(let C of s){let[w,R,L]=C.split(":");e.report({node:E,messageId:"default",data:{message:`Missing required export "${w}" of type ${R}: ${L}`}})}},r;function h(E,C,w,R){let L=U=>{if(!E)return null;if(typeof E=="string")return U.replaceText(C,E);{let te=new RegExp(E.regex),K=e.sourceCode.getText(C);return U.replaceText(C,K.replace(te,E.with))}};e.report({node:C,messageId:"default",data:{message:w},fix:E&&R==="autofix"?L:void 0,suggest:E&&R==="suggestion"?[{messageId:"default",data:{message:`Replace with "${typeof E=="string"?E:E.with}"`},fix:L}]:void 0})}}});function Zr(e,n){let r=[],t=n.exec(e);if(!t)return null;let[o,...a]=t;r.push({name:"$0_lowercase",value:o.toLowerCase()}),r.push({name:"$0_capitalize",value:In(o)}),r.push({name:"$0_uncapitalize",value:Rn(o)}),r.push({name:"$0",value:o});for(let i=0;i<a.length;i++){let c=`$${i+1}`,l=a[i];l!==void 0&&(r.push({name:`${c}_lowercase`,value:l.toLowerCase()}),r.push({name:`${c}_capitalize`,value:In(l)}),r.push({name:`${c}_uncapitalize`,value:Rn(l)}),r.push({name:c,value:l}))}return r}function In(e){return e.charAt(0).toUpperCase()+e.slice(1)}function Rn(e){return e.charAt(0).toLowerCase()+e.slice(1)}var J=require("@typescript-eslint/utils"),Fe=require("zod/v4");var Gr=J.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),vn="collapse-simple-objs-in-one-line",Kr=Fe.z.object({maxLineLength:Fe.z.number().optional(),maxProperties:Fe.z.number().optional(),nestedObjMaxLineLength:Fe.z.number().optional(),nestedObjMaxProperties:Fe.z.number().optional(),ignoreTypesWithSuffix:Fe.z.array(Fe.z.string()).optional()}),Qr=Gr({name:vn,meta:{type:"suggestion",fixable:"code",docs:{description:"Format simple objects and types in one line"},messages:{singleLineProp:"Object/type should be written in a single line"},schema:[j(Kr)]},defaultOptions:[{}],create(e,[n]){let r=e.sourceCode,t=n.ignoreTypesWithSuffix??[],o=n.maxProperties??2,a=n.nestedObjMaxLineLength??n.maxLineLength,i=n.nestedObjMaxProperties??3;function c(p){if(p.type===J.AST_NODE_TYPES.ObjectExpression){let m=p.parent.type===J.AST_NODE_TYPES.Property,d=m?i:o,s=p.properties.length;if(s>d)return!1;if(s===1){let y=p.properties[0];return!y||y.type===J.AST_NODE_TYPES.Property&&y.value.type===J.AST_NODE_TYPES.ObjectExpression||y.type===J.AST_NODE_TYPES.Property&&y.value.type===J.AST_NODE_TYPES.ArrayExpression&&!y.value.elements.every(S=>S&&St(S))?!1:{text:r.getText(y),isNested:m,propsSize:s}}let u=[];for(let y of p.properties){if(y.type===J.AST_NODE_TYPES.Property&&!St(y.value))return!1;u.push(r.getText(y))}return{text:u.join(", "),isNested:m,propsSize:s}}else{let m=p.parent.parent?.type===J.AST_NODE_TYPES.TSPropertySignature,d=m?i:o,s=p.members.length;if(s>d)return!1;if(t.length>0&&p.parent.type===J.AST_NODE_TYPES.TSTypeAliasDeclaration){let y=p.parent.id.name;if(t.some(g=>y.endsWith(g)))return!1}if(s===1){let y=p.members[0];return!y||y.type===J.AST_NODE_TYPES.TSPropertySignature&&y.typeAnnotation?.typeAnnotation.type===J.AST_NODE_TYPES.TSTypeLiteral?!1:{text:r.getText(y),isNested:m,propsSize:1}}if(p.parent.type===J.AST_NODE_TYPES.TSIntersectionType||p.parent.type===J.AST_NODE_TYPES.TSUnionType&&p.parent.types[0]!==p)return!1;let u=[];for(let y of p.members){if(y.type!==J.AST_NODE_TYPES.TSPropertySignature)return!1;let g=y.typeAnnotation?.typeAnnotation;if(!g||g.type===J.AST_NODE_TYPES.TSTypeLiteral||!wn(g))return!1;if(g.type===J.AST_NODE_TYPES.TSTypeReference&&g.typeArguments){if(g.typeArguments.params.length>1)return!1;let f=g.typeArguments.params[0];if(!f||!wn(f))return!1}let S=r.getText(y).trim();(S.endsWith(";")||S.endsWith(","))&&(S=S.slice(0,-1)),u.push(S)}return{text:u.join("; "),isNested:m,propsSize:s}}}function l(p){if(p.loc.start.line===p.loc.end.line)return;if(p.parent.type!==J.AST_NODE_TYPES.JSXExpressionContainer){let g=0,S=!1,f=r.getTokenAfter(p,{filter:b=>b.type!==J.AST_TOKEN_TYPES.Punctuator||S?!0:b.value===","?(g++,!1):b.value===";"?(g++,S=!0,!1):b.value===")"||b.value==="}"?(g++,!1):!0});if(g>4)return;let T=f?.type===J.AST_TOKEN_TYPES.Template&&f.value.startsWith(`}
2
- `);if(f?.loc.start.line===p.loc.end.line&&!T)return}let m=c(p);if(!m)return;let d=m.text;if(d.includes(`
3
- `)||r.getCommentsInside(p).length>0)return;d.endsWith(";")&&(d=d.slice(0,-1));let s=`{ ${d} }`,u=ti(r,p),y=m.isNested&&m.propsSize>2?a:n.maxLineLength;y&&s.length+u.length+ei(p,r)>y||e.report({node:p,messageId:"singleLineProp",fix:g=>g.replaceText(p,s)})}return{TSTypeLiteral:l,ObjectExpression:l}}});function wn(e){return e.type===J.AST_NODE_TYPES.TSLiteralType||e.type===J.AST_NODE_TYPES.TSTypeReference||e.type===J.AST_NODE_TYPES.TSNumberKeyword||e.type===J.AST_NODE_TYPES.TSStringKeyword||e.type===J.AST_NODE_TYPES.TSBooleanKeyword||e.type===J.AST_NODE_TYPES.TSNullKeyword||e.type===J.AST_NODE_TYPES.TSUndefinedKeyword}function St(e,n){return!!(e.type===J.AST_NODE_TYPES.Literal||e.type===J.AST_NODE_TYPES.Identifier||e.type===J.AST_NODE_TYPES.TemplateLiteral||e.type===J.AST_NODE_TYPES.TaggedTemplateExpression||!n&&e.type===J.AST_NODE_TYPES.ArrayExpression&&e.elements.every(r=>r&&St(r,!0)))}function ei(e,n){let r=n.getLastToken(e);if(!r)return 0;let t=n.text.indexOf(`
4
- `,r.range[1]);return(t!==-1?t:n.text.length)-r.range[1]}function ti(e,n){return e.text.slice(n.range[0]-n.loc.start.column,n.range[0])}var Tt={name:vn,rule:Qr};var ni=/eslint +react-compiler\/react-compiler: +\["error/,Fn={meta:{type:"suggestion",docs:{description:"verifies the list of dependencies for Hooks like useEffect and similar",recommended:!0,url:"https://github.com/facebook/react/issues/14920"},fixable:"code",hasSuggestions:!0,schema:[{type:"object",additionalProperties:!1,ignoreIfReactCompilerIsEnabled:!1,enableDangerousAutofixThisMayCauseInfiniteLoops:!1,properties:{additionalHooks:{type:"string"},ignoreIfReactCompilerIsEnabled:{type:"boolean"},enableDangerousAutofixThisMayCauseInfiniteLoops:{type:"boolean"}}}]},create(e){let n=!1,r=typeof e.getSource=="function"?f=>r(f):f=>e.sourceCode.getText(f),t=typeof e.getScope=="function"?()=>t():f=>e.sourceCode.getScope(f),o=e.options&&e.options[0]&&e.options[0].additionalHooks?new RegExp(e.options[0].additionalHooks):void 0,a=e.options&&e.options[0]&&e.options[0].enableDangerousAutofixThisMayCauseInfiniteLoops||!1,i={additionalHooks:o,enableDangerousAutofixThisMayCauseInfiniteLoops:a};function c(f){a&&Array.isArray(f.suggest)&&f.suggest.length>0&&(f.fix=f.suggest[0].fix),e.report(f)}let l=e.getSourceCode().scopeManager,p=new WeakMap,m=new WeakSet,d=new WeakMap,s=new WeakMap,u=new WeakSet;function y(f,T){return function(b){if(T.has(b))return T.get(b);let h=f(b);return T.set(b,h),h}}function g(f,T,b,h,I){I&&f.async&&c({node:f,message:`Effect callbacks are synchronous to prevent race conditions. Put the async function inside:
1
+ "use strict";var Xr=Object.create;var nt=Object.defineProperty;var Hr=Object.getOwnPropertyDescriptor;var Br=Object.getOwnPropertyNames;var Yr=Object.getPrototypeOf,qr=Object.prototype.hasOwnProperty;var Zr=(e,n)=>{for(var r in n)nt(e,r,{get:n[r],enumerable:!0})},In=(e,n,r,t)=>{if(n&&typeof n=="object"||typeof n=="function")for(let o of Br(n))!qr.call(e,o)&&o!==r&&nt(e,o,{get:()=>n[o],enumerable:!(t=Hr(n,o))||t.enumerable});return e};var Se=(e,n,r)=>(r=e!=null?Xr(Yr(e)):{},In(n||!e||!e.__esModule?nt(r,"default",{value:e,enumerable:!0}):r,e)),Gr=e=>In(nt({},"__esModule",{value:!0}),e);var ta={};Zr(ta,{extendedLintPlugin:()=>ea});module.exports=Gr(ta);var oe=require("@typescript-eslint/utils"),v=require("zod/v4");var Rn=require("@typescript-eslint/utils"),wn=Se(require("zod/v4"));function W(e){let r=Rn.ESLintUtils.RuleCreator(t=>`https://github.com/lucasols/extended-lint#${t}`)(e);return{name:e.name,rule:r}}function j(e){return wn.toJSONSchema(e)}var Kr=v.z.object({disallow:v.z.array(v.z.object({selector:v.z.string(),message:v.z.string(),replace:v.z.optional(v.z.union([v.z.string(),v.z.object({regex:v.z.string(),with:v.z.string()})])),replaceType:v.z.optional(v.z.enum(["suggestion","autofix"]))})).optional(),disallowFnCalls:v.z.optional(v.z.array(v.z.object({fn:v.z.string(),withArgs:v.z.optional(v.z.array(v.z.object({atIndex:v.z.number(),value:v.z.union([v.z.string(),v.z.number(),v.z.boolean()])}))),message:v.z.string(),replaceWith:v.z.optional(v.z.string()),ignoreRegex:v.z.optional(v.z.string())}))),__dev_simulateFileName:v.z.optional(v.z.string()),mustMatchSyntax:v.z.optional(v.z.array(v.z.object({includeRegex:v.z.string(),mustCallFn:v.z.optional(v.z.array(v.z.object({anyCall:v.z.array(v.z.object({fn:v.z.string(),withArgs:v.z.array(v.z.object({atIndex:v.z.number(),literal:v.z.union([v.z.string(),v.z.number(),v.z.boolean()])}))})),message:v.z.optional(v.z.string())}))),mustMatchSelector:v.z.optional(v.z.array(v.z.object({selector:v.z.string(),message:v.z.string()}))),mustHaveExport:v.z.optional(v.z.array(v.z.object({name:v.z.string(),type:v.z.enum(["function","variable","any"]).default("any"),message:v.z.string()})))})))}),St=W({name:"advanced-no-restricted-syntax",meta:{type:"suggestion",docs:{description:"Disallow specific syntax patterns"},schema:[j(Kr)],messages:{default:"{{message}}"},fixable:"code",hasSuggestions:!0},defaultOptions:[{disallow:[]}],create(e,[n]){let r={},{mustMatchSyntax:t,__dev_simulateFileName:o,disallow:a,disallowFnCalls:i}=n,p=o??e.filename,l=[],c=new Map,m=new Set,d=new Map,s=new Set,u=new Map;function y(E){for(let C of E.specifiers)C.type===oe.AST_NODE_TYPES.ImportSpecifier&&C.imported.type===oe.AST_NODE_TYPES.Identifier&&C.imported.name!==C.local.name&&u.set(C.local.name,C.imported.name)}function g(E){if(E.declaration){if(E.declaration.type===oe.AST_NODE_TYPES.FunctionDeclaration&&E.declaration.id){let C=E.declaration.id.name;for(let w of Array.from(s)){let[R,L]=w.split(":");R===C&&(L==="function"||L==="any")&&s.delete(w)}}else if(E.declaration.type===oe.AST_NODE_TYPES.VariableDeclaration){for(let C of E.declaration.declarations)if(C.id.type===oe.AST_NODE_TYPES.Identifier){let w=C.id.name;for(let R of Array.from(s)){let[L,U]=R.split(":");L===w&&(U==="variable"||U==="any")&&s.delete(R)}}}}for(let C of E.specifiers)if(C.exported.type===oe.AST_NODE_TYPES.Identifier){let w=C.exported.name;for(let R of Array.from(s)){let[L,U]=R.split(":");L===w&&U==="any"&&s.delete(R)}}}function S(E){E.id.type===oe.AST_NODE_TYPES.Identifier&&E.init?.type===oe.AST_NODE_TYPES.Identifier&&u.set(E.id.name,E.init.name)}function f(E){return u.get(E)??E}function T(E,C){return f(E)===C||E===C}for(let{includeRegex:E,mustCallFn:C,mustMatchSelector:w,mustHaveExport:R}of t??[]){let U=function(te){let K=te;for(let{name:ie,value:se}of L??[])K=K.replaceAll(ie,se);return K};var I=U;let L=Qr(p,new RegExp(E));if(L){for(let{anyCall:te,message:K}of C??[]){let ie=`Expected file to call the function: ${te.map(({fn:se})=>se).join(" or ")}`;m.add(ie),l.push(se=>{let{callee:q}=se;if(q.type===oe.AST_NODE_TYPES.Identifier){for(let{fn:he,withArgs:_e}of te)if(q.name===he){m.delete(ie);for(let ae of _e){let ve=se.arguments[ae.atIndex],me=typeof ae.literal=="string"?U(ae.literal):ae.literal;if(!ve){e.report({node:se,messageId:"default",data:{message:`Missing argument with value "${me}" at index ${ae.atIndex}${K?`: ${U(K)}`:""}`}});continue}if(ve.type!==oe.AST_NODE_TYPES.Literal){e.report({node:ve,messageId:"default",data:{message:`Argument at position ${ae.atIndex} should the literal "${me}"${K?`: ${U(K)}`:""}`}});continue}ve.value!==me&&e.report({node:ve,messageId:"default",data:{message:`Argument should have the value "${me}"${K?`: ${U(K)}`:""}`},fix:Le=>Le.replaceText(ve,typeof me=="string"?`'${me}'`:String(me))})}break}}})}for(let{selector:te,message:K}of w??[])d.set(te,U(K)),c.set(U(te),()=>{d.delete(te)});for(let{name:te,type:K,message:ie}of R??[]){let se=U(te),q=U(ie);s.add(`${se}:${K}:${q}`)}}}for(let{fn:E,withArgs:C,message:w,replaceWith:R,ignoreRegex:L}of i??[])L&&new RegExp(L).test(p)||l.push(U=>{let{callee:te}=U;if(te.type!==oe.AST_NODE_TYPES.Identifier||!T(te.name,E))return;if(C)for(let ie of C){let se=U.arguments[ie.atIndex];if(!se){e.report({node:U,messageId:"default",data:{message:`Missing argument with value "${ie.value}" at index ${ie.atIndex}: ${w}`}});return}if(se.type!==oe.AST_NODE_TYPES.Literal||se.value!==ie.value)return}let K=ie=>R?ie.replaceText(U,R):null;e.report({node:U,messageId:"default",data:{message:w},suggest:R?[{messageId:"default",data:{message:`Replace with "${R}"`},fix:K}]:void 0})});function b(E,C){let w=r[E];w?r[E]=R=>{w(R),C(R)}:r[E]=C}for(let{selector:E,message:C,replace:w,replaceType:R="suggestion"}of a??[]){if(E==="CallExpression"){l.push(L=>{h(w,L,C,R)});continue}r[E]=L=>{h(w,L,C,R)}}if(c.size>0)for(let[E,C]of c)b(E,C);return l.length>0&&(r.CallExpression=E=>{if(E.type===oe.AST_NODE_TYPES.CallExpression)for(let C of l)C(E)}),r.ImportDeclaration=E=>{E.type===oe.AST_NODE_TYPES.ImportDeclaration&&y(E)},r.ExportNamedDeclaration=E=>{E.type===oe.AST_NODE_TYPES.ExportNamedDeclaration&&g(E)},r.VariableDeclarator=E=>{E.type===oe.AST_NODE_TYPES.VariableDeclarator&&S(E)},r["Program:exit"]=E=>{for(let C of m)e.report({node:E,messageId:"default",data:{message:C}});for(let[,C]of d)e.report({node:E,messageId:"default",data:{message:C}});for(let C of s){let[w,R,L]=C.split(":");e.report({node:E,messageId:"default",data:{message:`Missing required export "${w}" of type ${R}: ${L}`}})}},r;function h(E,C,w,R){let L=U=>{if(!E)return null;if(typeof E=="string")return U.replaceText(C,E);{let te=new RegExp(E.regex),K=e.sourceCode.getText(C);return U.replaceText(C,K.replace(te,E.with))}};e.report({node:C,messageId:"default",data:{message:w},fix:E&&R==="autofix"?L:void 0,suggest:E&&R==="suggestion"?[{messageId:"default",data:{message:`Replace with "${typeof E=="string"?E:E.with}"`},fix:L}]:void 0})}}});function Qr(e,n){let r=[],t=n.exec(e);if(!t)return null;let[o,...a]=t;r.push({name:"$0_lowercase",value:o.toLowerCase()}),r.push({name:"$0_capitalize",value:vn(o)}),r.push({name:"$0_uncapitalize",value:kn(o)}),r.push({name:"$0",value:o});for(let i=0;i<a.length;i++){let p=`$${i+1}`,l=a[i];l!==void 0&&(r.push({name:`${p}_lowercase`,value:l.toLowerCase()}),r.push({name:`${p}_capitalize`,value:vn(l)}),r.push({name:`${p}_uncapitalize`,value:kn(l)}),r.push({name:p,value:l}))}return r}function vn(e){return e.charAt(0).toUpperCase()+e.slice(1)}function kn(e){return e.charAt(0).toLowerCase()+e.slice(1)}var V=require("@typescript-eslint/utils"),Fe=require("zod/v4");var ei=V.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),Pn="collapse-simple-objs-in-one-line",ti=Fe.z.object({maxLineLength:Fe.z.number().optional(),maxProperties:Fe.z.number().optional(),nestedObjMaxLineLength:Fe.z.number().optional(),nestedObjMaxProperties:Fe.z.number().optional(),ignoreTypesWithSuffix:Fe.z.array(Fe.z.string()).optional()}),ni=ei({name:Pn,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(ti)]},defaultOptions:[{}],create(e,[n]){let r=e.sourceCode,t=n.ignoreTypesWithSuffix??[],o=n.maxProperties??2,a=n.nestedObjMaxLineLength??n.maxLineLength,i=n.nestedObjMaxProperties??3;function p(c){if(c.type===V.AST_NODE_TYPES.ObjectExpression){let m=c.parent.type===V.AST_NODE_TYPES.Property,d=m?i:o,s=c.properties.length;if(s>d)return!1;if(s===1){let y=c.properties[0];return!y||y.type===V.AST_NODE_TYPES.Property&&y.value.type===V.AST_NODE_TYPES.ObjectExpression||y.type===V.AST_NODE_TYPES.Property&&y.value.type===V.AST_NODE_TYPES.ArrayExpression&&!y.value.elements.every(S=>S&&Tt(S))?!1:{text:r.getText(y),isNested:m,propsSize:s}}let u=[];for(let y of c.properties){if(y.type===V.AST_NODE_TYPES.Property&&!Tt(y.value))return!1;u.push(r.getText(y))}return{text:u.join(", "),isNested:m,propsSize:s}}else{let m=c.parent.parent?.type===V.AST_NODE_TYPES.TSPropertySignature,d=m?i:o,s=c.members.length;if(s>d)return!1;if(t.length>0&&c.parent.type===V.AST_NODE_TYPES.TSTypeAliasDeclaration){let y=c.parent.id.name;if(t.some(g=>y.endsWith(g)))return!1}if(s===1){let y=c.members[0];return!y||y.type===V.AST_NODE_TYPES.TSPropertySignature&&y.typeAnnotation?.typeAnnotation.type===V.AST_NODE_TYPES.TSTypeLiteral?!1:{text:r.getText(y),isNested:m,propsSize:1}}if(c.parent.type===V.AST_NODE_TYPES.TSIntersectionType||c.parent.type===V.AST_NODE_TYPES.TSUnionType&&c.parent.types[0]!==c)return!1;let u=[];for(let y of c.members){if(y.type!==V.AST_NODE_TYPES.TSPropertySignature)return!1;let g=y.typeAnnotation?.typeAnnotation;if(!g||g.type===V.AST_NODE_TYPES.TSTypeLiteral||!Fn(g))return!1;if(g.type===V.AST_NODE_TYPES.TSTypeReference&&g.typeArguments){if(g.typeArguments.params.length>1)return!1;let f=g.typeArguments.params[0];if(!f||!Fn(f))return!1}let S=r.getText(y).trim();(S.endsWith(";")||S.endsWith(","))&&(S=S.slice(0,-1)),u.push(S)}return{text:u.join("; "),isNested:m,propsSize:s}}}function l(c){if(c.loc.start.line===c.loc.end.line)return;if(c.parent.type!==V.AST_NODE_TYPES.JSXExpressionContainer){let g=0,S=!1,f=r.getTokenAfter(c,{filter:b=>b.type!==V.AST_TOKEN_TYPES.Punctuator||S?!0:b.value===","?(g++,!1):b.value===";"?(g++,S=!0,!1):b.value===")"||b.value==="}"?(g++,!1):!0});if(g>4)return;let T=f?.type===V.AST_TOKEN_TYPES.Template&&f.value.startsWith(`}
2
+ `);if(f?.loc.start.line===c.loc.end.line&&!T)return}let m=p(c);if(!m)return;let d=m.text;if(d.includes(`
3
+ `)||r.getCommentsInside(c).length>0)return;d.endsWith(";")&&(d=d.slice(0,-1));let s=`{ ${d} }`,u=ii(r,c),y=m.isNested&&m.propsSize>2?a:n.maxLineLength;y&&s.length+u.length+ri(c,r)>y||e.report({node:c,messageId:"singleLineProp",fix:g=>g.replaceText(c,s)})}return{TSTypeLiteral:l,ObjectExpression:l}}});function Fn(e){return e.type===V.AST_NODE_TYPES.TSLiteralType||e.type===V.AST_NODE_TYPES.TSTypeReference||e.type===V.AST_NODE_TYPES.TSNumberKeyword||e.type===V.AST_NODE_TYPES.TSStringKeyword||e.type===V.AST_NODE_TYPES.TSBooleanKeyword||e.type===V.AST_NODE_TYPES.TSNullKeyword||e.type===V.AST_NODE_TYPES.TSUndefinedKeyword}function Tt(e,n){return!!(e.type===V.AST_NODE_TYPES.Literal||e.type===V.AST_NODE_TYPES.Identifier||e.type===V.AST_NODE_TYPES.TemplateLiteral||e.type===V.AST_NODE_TYPES.TaggedTemplateExpression||!n&&e.type===V.AST_NODE_TYPES.ArrayExpression&&e.elements.every(r=>r&&Tt(r,!0)))}function ri(e,n){let r=n.getLastToken(e);if(!r)return 0;let t=n.text.indexOf(`
4
+ `,r.range[1]);return(t!==-1?t:n.text.length)-r.range[1]}function ii(e,n){return e.text.slice(n.range[0]-n.loc.start.column,n.range[0])}var ht={name:Pn,rule:ni};var si=/eslint +react-compiler\/react-compiler: +\["error/,Nn={meta:{type:"suggestion",docs:{description:"verifies the list of dependencies for Hooks like useEffect and similar",recommended:!0,url:"https://github.com/facebook/react/issues/14920"},fixable:"code",hasSuggestions:!0,schema:[{type:"object",additionalProperties:!1,ignoreIfReactCompilerIsEnabled:!1,enableDangerousAutofixThisMayCauseInfiniteLoops:!1,properties:{additionalHooks:{type:"string"},ignoreIfReactCompilerIsEnabled:{type:"boolean"},enableDangerousAutofixThisMayCauseInfiniteLoops:{type:"boolean"}}}]},create(e){let n=!1,r=typeof e.getSource=="function"?f=>r(f):f=>e.sourceCode.getText(f),t=typeof e.getScope=="function"?()=>t():f=>e.sourceCode.getScope(f),o=e.options&&e.options[0]&&e.options[0].additionalHooks?new RegExp(e.options[0].additionalHooks):void 0,a=e.options&&e.options[0]&&e.options[0].enableDangerousAutofixThisMayCauseInfiniteLoops||!1,i={additionalHooks:o,enableDangerousAutofixThisMayCauseInfiniteLoops:a};function p(f){a&&Array.isArray(f.suggest)&&f.suggest.length>0&&(f.fix=f.suggest[0].fix),e.report(f)}let l=e.getSourceCode().scopeManager,c=new WeakMap,m=new WeakSet,d=new WeakMap,s=new WeakMap,u=new WeakSet;function y(f,T){return function(b){if(T.has(b))return T.get(b);let h=f(b);return T.set(b,h),h}}function g(f,T,b,h,I){I&&f.async&&p({node:f,message:`Effect callbacks are synchronous to prevent race conditions. Put the async function inside:
5
5
 
6
6
  useEffect(() => {
7
7
  async function fetchData() {
@@ -12,35 +12,35 @@ useEffect(() => {
12
12
  fetchData();
13
13
  }, [someId]); // Or [] if effect doesn't need props or state
14
14
 
15
- Learn more about data fetching with Hooks: https://reactjs.org/link/hooks-data-fetching`});let E=l.acquire(f),C=new Set,w=null;{let x=E.upper;for(;x&&(C.add(x),x.type!=="function");)x=x.upper;if(!x)return;w=x}let R=Array.isArray;function L(x){if(!R(x.defs))return!1;let A=x.defs[0];if(A==null||A.node.type!=="VariableDeclarator")return!1;let F=A.node.init;if(F==null)return!1;for(;F.type==="TSAsExpression";)F=F.expression;let O=A.node.parent;if(O==null&&(bt(w.block,A.node.id),O=A.node.parent,O==null))return!1;if(O.kind==="const"&&F.type==="Literal"&&(typeof F.value=="string"||typeof F.value=="number"||F.value===null))return!0;if(F.type!=="CallExpression")return!1;let D=F.callee;if(D.type==="MemberExpression"&&D.object.name==="React"&&D.property!=null&&!D.computed&&(D=D.property),D.type!=="Identifier")return!1;let N=A.node.id,{name:$}=D;if($==="useRef"&&N.type==="Identifier")return!0;if(ai(D)&&N.type==="Identifier"){for(let _ of x.references)_!==N&&u.add(_.identifier);return!0}else if($==="useState"||$==="useReducer"){if(N.type==="ArrayPattern"&&N.elements.length===2&&R(x.identifiers)){if(N.elements[1]===x.identifiers[0]){if($==="useState"){let _=x.references,ye=0;for(let Ae=0;Ae<_.length;Ae++){if(_[Ae].isWrite()&&ye++,ye>1)return!1;p.set(_[Ae].identifier,N.elements[0])}}return!0}else if(N.elements[0]===x.identifiers[0]){if($==="useState"){let _=x.references;for(let ye=0;ye<_.length;ye++)m.add(_[ye].identifier)}return!1}}}else if($==="useTransition"&&N.type==="ArrayPattern"&&N.elements.length===2&&Array.isArray(x.identifiers)&&N.elements[1]===x.identifiers[0])return!0;return!1}function U(x){if(!R(x.defs))return!1;let A=x.defs[0];if(A==null||A.node==null||A.node.id==null)return!1;let F=A.node,O=w.childScopes,D=null,N;for(N=0;N<O.length;N++){let $=O[N],_=$.block;if(F.type==="FunctionDeclaration"&&_===F||F.type==="VariableDeclarator"&&_.parent===F){D=$;break}}if(D==null)return!1;for(N=0;N<D.through.length;N++){let $=D.through[N];if($.resolved!=null&&C.has($.resolved.scope)&&!te($.resolved))return!1}return!0}let te=y(L,d),K=y(U,s),ie=new Map;function se(x){let A=x.from,F=!1;for(;A.block!==f;)A.type==="function"&&(F=A.block.parent!=null&&A.block.parent.type==="ReturnStatement"),A=A.upper;return F}let q=new Map,Te=new Map;_e(E);function _e(x){for(let A of x.references){if(!A.resolved||!C.has(A.resolved.scope))continue;let F=bt(f,A.identifier),O=Pn(F),D=Ie(O,Te);if(I&&O.type==="Identifier"&&(O.parent.type==="MemberExpression"||O.parent.type==="OptionalMemberExpression")&&!O.parent.computed&&O.parent.property.type==="Identifier"&&O.parent.property.name==="current"&&se(A)&&ie.set(D,{reference:A,dependencyNode:O}),O.parent.type==="TSTypeQuery"||O.parent.type==="TSTypeReference")continue;let N=A.resolved.defs[0];if(N!=null&&!(N.node!=null&&N.node.init===f.parent)&&N.type!=="TypeParameter")if(q.has(D))q.get(D).references.push(A);else{let $=A.resolved,_=te($)||K($);q.set(D,{isStable:_,references:[A]})}}for(let A of x.childScopes)_e(A)}ie.forEach(({reference:x,dependencyNode:A},F)=>{let O=x.resolved.references,D=!1;for(let N=0;N<O.length;N++){let{identifier:$}=O[N],{parent:_}=$;if(_!=null&&_.type==="MemberExpression"&&!_.computed&&_.property.type==="Identifier"&&_.property.name==="current"&&_.parent.type==="AssignmentExpression"&&_.parent.left===_){D=!0;break}}D||c({node:A.parent.property,message:`The ref value '${F}.current' will likely have changed by the time this effect cleanup function runs. If this ref points to a node rendered by React, copy '${F}.current' to a variable inside the effect, and use that variable in the cleanup function.`})});let ae=new Set;function ve(x,A){ae.has(A)||(ae.add(A),c({node:x,message:`Assignments to the '${A}' variable from inside React Hook ${r(b)} 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(b)}.`}))}let me=new Set;if(q.forEach(({isStable:x,references:A},F)=>{x&&me.add(F),A.forEach(O=>{O.writeExpr&&ve(O.writeExpr,F)})}),ae.size>0)return;if(!T){let x=null;if(q.forEach(({isStable:A,references:F},O)=>{x||F.forEach(D=>{if(x)return;let N=D.identifier;if(!p.has(N))return;let _=D.from;for(;_.type!=="function";)_=_.upper;_.block===f&&(x=O)})}),x){let{suggestedDependencies:A}=ht({dependencies:q,declaredDependencies:[],stableDependencies:me,externalDependencies:new Set,isEffect:!0});c({node:b,message:`React Hook ${h} contains a call to '${x}'. Without a list of dependencies, this can lead to an infinite chain of updates. To fix this, pass [`+A.join(", ")+`] as a second argument to the ${h} Hook.`,suggest:[{desc:`Add dependencies array: [${A.join(", ")}]`,fix(F){return F.insertTextAfter(f,`, [${A.join(", ")}]`)}}]})}return}let Le=[],Xe=new Set;T.type!=="ArrayExpression"?c({node:T,message:`React Hook ${r(b)} 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.`}):T.elements.forEach(x=>{if(x===null)return;if(x.type==="SpreadElement"){c({node:x,message:`React Hook ${r(b)} has a spread element in its dependency array. This means we can't statically verify whether you've passed the correct dependencies.`});return}u.has(x)&&c({node:x,message:`Functions returned from \`useEffectEvent\` must not be included in the dependency array. Remove \`${r(x)}\` from the list.`,suggest:[{desc:`Remove the dependency \`${r(x)}\``,fix(D){return D.removeRange(x.range)}}]});let A;try{A=Ie(x,Te)}catch(D){if(/Unsupported node type/.test(D.message)){x.type==="Literal"?q.has(x.value)?c({node:x,message:`The ${x.raw} literal is not a valid dependency because it never changes. Did you mean to include ${x.value} in the array instead?`}):c({node:x,message:`The ${x.raw} literal is not a valid dependency because it never changes. You can safely remove it.`}):c({node:x,message:`React Hook ${r(b)} has a complex expression in the dependency array. Extract it to a separate variable so it can be statically checked.`});return}else throw D}let F=x;for(;F.type==="MemberExpression"||F.type==="OptionalMemberExpression"||F.type==="ChainExpression";)F=F.object||F.expression.object;let O=!w.through.some(D=>D.identifier===F);Le.push({key:A,node:x}),O||Xe.add(A)});let{suggestedDependencies:$r,unnecessaryDependencies:Qe,missingDependencies:ke,duplicateDependencies:hn}=ht({dependencies:q,declaredDependencies:Le,stableDependencies:me,externalDependencies:Xe,isEffect:I}),et=$r;if(hn.size+ke.size+Qe.size===0){if(n)return;ri({declaredDependencies:Le,declaredDependenciesNode:T,componentScope:w,scope:E}).forEach(({construction:A,isUsedOutsideOfHook:F,depType:O})=>{let D=O==="function"?"useCallback":"useMemo",N=O==="function"?"definition":"initialization",$=`wrap the ${N} of '${A.name.name}' in its own ${D}() Hook.`,_=F?`To fix this, ${$}`:`Move it inside the ${h} callback. Alternatively, ${$}`,ye=O==="conditional"||O==="logical expression"?"could make":"makes",Ae=`The '${A.name.name}' ${O} ${ye} the dependencies of ${h} Hook (at line ${T.loc.start.line}) change on every render. ${_}`,En;F&&A.type==="Variable"&&O==="function"&&(En=[{desc:`Wrap the ${N} of '${A.name.name}' in its own ${D}() Hook.`,fix(bn){let[Ur,Wr]=D==="useMemo"?["useMemo(() => { return ","; })"]:["useCallback(",")"];return[bn.insertTextBefore(A.node.init,Ur),bn.insertTextAfter(A.node.init,Wr)]}}]),c({node:A.node,message:Ae,suggest:En})});return}!I&&ke.size>0&&(et=ht({dependencies:q,declaredDependencies:[],stableDependencies:me,externalDependencies:Xe,isEffect:I}).suggestedDependencies);function _r(){if(Le.length===0)return!0;let x=Le.map(F=>F.key),A=x.slice().sort();return x.join(",")===A.join(",")}_r()&&et.sort();function yt(x){let A=x.split("."),F="";for(let O=0;O<A.length;O++){if(O!==0){let D=A.slice(0,O+1).join("."),N=Te.get(D)===!0;F+=N?"?.":"."}F+=A[O]}return F}function dt(x,A,F,O){return x.size===0?null:(x.size>1?"":A+" ")+F+" "+(x.size>1?"dependencies":"dependency")+": "+si(Array.from(x).sort().map(D=>"'"+yt(D)+"'"))+`. Either ${O} ${x.size>1?"them":"it"} or remove the dependency array.`}let ge="";if(Qe.size>0){let x=null;if(Array.from(Qe.keys()).forEach(A=>{x===null&&A.endsWith(".current")&&(x=A)}),x!==null)ge=` Mutable values like '${x}' aren't valid dependencies because mutating them doesn't re-render the component.`;else if(Xe.size>0){let A=Array.from(Xe)[0];E.set.has(A)||(ge=` Outer scope values like '${A}' aren't valid dependencies because mutating them doesn't re-render the component.`)}}if(!ge&&ke.has("props")){let x=q.get("props");if(x==null)return;let A=x.references;if(!Array.isArray(A))return;let F=!0;for(let O=0;O<A.length;O++){let D=A[O],N=bt(w.block,D.identifier);if(!N){F=!1;break}let $=N.parent;if($==null){F=!1;break}if($.type!=="MemberExpression"&&$.type!=="OptionalMemberExpression"){F=!1;break}}F&&(ge=` 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(b)}.`)}if(!ge&&ke.size>0){let x=null;ke.forEach(A=>{if(x)return;let F=w.set.get(A),O=q.get(A);if(O.references[0].resolved!==F)return;let D=F.defs[0];if(D==null||D.name==null||D.type!=="Parameter")return;let N=!1,$;for(let _=0;_<O.references.length;_++)if($=O.references[_].identifier,$!=null&&$.parent!=null&&($.parent.type==="CallExpression"||$.parent.type==="OptionalCallExpression")&&$.parent.callee===$){N=!0;break}N&&(x=A)}),x!==null&&(ge=` If '${x}' changes too often, find the parent component that defines it and wrap that definition in useCallback.`)}if(!ge&&ke.size>0){let x=null;if(ke.forEach(A=>{if(x!==null)return;let O=q.get(A).references,D,N;for(let $=0;$<O.length;$++){for(D=O[$].identifier,N=D.parent;N!=null&&N!==w.block;){if(N.type==="CallExpression"){let _=p.get(N.callee);if(_!=null){if(_.name===A)x={missingDep:A,setter:N.callee.name,form:"updater"};else if(m.has(D))x={missingDep:A,setter:N.callee.name,form:"reducer"};else{let ye=O[$].resolved;if(ye!=null){let Ae=ye.defs[0];Ae!=null&&Ae.type==="Parameter"&&(x={missingDep:A,setter:N.callee.name,form:"inlineReducer"})}}break}}N=N.parent}if(x!==null)break}}),x!==null)switch(x.form){case"reducer":ge=` You can also replace multiple useState variables with useReducer if '${x.setter}' needs the current value of '${x.missingDep}'.`;break;case"inlineReducer":ge=` If '${x.setter}' needs the current value of '${x.missingDep}', you can also switch to useReducer instead of useState and read '${x.missingDep}' in the reducer.`;break;case"updater":ge=` You can also do a functional update '${x.setter}(${x.missingDep.slice(0,1)} => ...)' if you only need '${x.missingDep}' in the '${x.setter}' call.`;break;default:throw new Error("Unknown case.")}}c({node:T,message:`React Hook ${r(b)} has `+(dt(ke,"a","missing","include")||dt(Qe,"an","unnecessary","exclude")||dt(hn,"a","duplicate","omit"))+ge,suggest:[{desc:`Update the dependencies array to be: [${et.map(yt).join(", ")}]`,fix(x){return x.replaceText(T,`[${et.map(yt).join(", ")}]`)}}]})}function S(f){let T=ii(f.callee,i);if(T===-1)return;let b=f.arguments[T],h=f.callee,I=On(h).name,E=f.arguments[T+1],C=/Effect($|[^a-z])/g.test(I);if(!b){c({node:h,message:`React Hook ${I} requires an effect callback. Did you forget to pass a callback to the hook?`});return}if(!(n&&!C)){if(!E&&!C){(I==="useMemo"||I==="useCallback")&&c({node:h,message:`React Hook ${I} does nothing when called with only one argument. Did you forget to pass an array of dependencies?`});return}switch(b.type){case"FunctionExpression":case"ArrowFunctionExpression":g(b,E,h,I,C);return;case"Identifier":if(!E||E.elements&&E.elements.some(L=>L&&L.type==="Identifier"&&L.name===b.name))return;let w=t(f).set.get(b.name);if(w==null||w.defs==null)return;let R=w.defs[0];if(!R||!R.node||R.type!=="Variable"&&R.type!=="FunctionName")break;switch(R.node.type){case"FunctionDeclaration":g(R.node,E,h,I,C);return;case"VariableDeclarator":let L=R.node.init;if(!L)break;switch(L.type){case"ArrowFunctionExpression":case"FunctionExpression":g(L,E,h,I,C);return}break}break;default:c({node:h,message:`React Hook ${I} received a function whose dependencies are unknown. Pass an inline function instead.`});return}c({node:h,message:`React Hook ${I} has a missing dependency: '${b.name}'. Either include it or remove the dependency array.`,suggest:[{desc:`Update the dependencies array to be: [${b.name}]`,fix(w){return w.replaceText(E,`[${b.name}]`)}}]})}}if(e.options[0]?.ignoreIfReactCompilerIsEnabled){for(let f of e.sourceCode.getAllComments())if(ni.test(f.value))return n=!0,{CallExpression:T=>S(T,!0)}}return{CallExpression:f=>S(f)}}};function ht({dependencies:e,declaredDependencies:n,stableDependencies:r,externalDependencies:t,isEffect:o}){let a=i();function i(){return{isUsed:!1,isSatisfiedRecursively:!1,isSubtreeUsed:!1,children:new Map}}e.forEach((g,S)=>{let f=c(a,S);f.isUsed=!0,l(a,S,T=>{T.isSubtreeUsed=!0})}),n.forEach(({key:g})=>{let S=c(a,g);S.isSatisfiedRecursively=!0}),r.forEach(g=>{let S=c(a,g);S.isSatisfiedRecursively=!0});function c(g,S){let f=S.split("."),T=g;for(let b of f){let h=T.children.get(b);h||(h=i(),T.children.set(b,h)),T=h}return T}function l(g,S,f){let T=S.split("."),b=g;for(let h of T){let I=b.children.get(h);if(!I)return;f(I),b=I}}let p=new Set,m=new Set;d(a,p,m,g=>g);function d(g,S,f,T){g.children.forEach((b,h)=>{let I=T(h);if(b.isSatisfiedRecursively){b.isSubtreeUsed&&f.add(I);return}if(b.isUsed){S.add(I);return}d(b,S,f,E=>I+"."+E)})}let s=[],u=new Set,y=new Set;return n.forEach(({key:g})=>{m.has(g)?s.indexOf(g)===-1?s.push(g):y.add(g):u.add(g)}),p.forEach(g=>{s.push(g)}),{suggestedDependencies:s,unnecessaryDependencies:u,duplicateDependencies:y,missingDependencies:p}}function Pe(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 Pe(e.consequent)!=null||Pe(e.alternate)!=null?"conditional":null;case"LogicalExpression":return Pe(e.left)!=null||Pe(e.right)!=null?"logical expression":null;case"JSXFragment":return"JSX fragment";case"JSXElement":return"JSX element";case"AssignmentExpression":return Pe(e.right)!=null?"assignment expression":null;case"NewExpression":return"object construction";case"Literal":return e.value instanceof RegExp?"regular expression":null;case"TypeCastExpression":return Pe(e.expression);case"TSAsExpression":return Pe(e.expression)}return null}function ri({declaredDependencies:e,declaredDependenciesNode:n,componentScope:r,scope:t}){let o=e.map(({key:i})=>{let c=r.variables.find(p=>p.name===i);if(c==null)return null;let l=c.defs[0];if(l==null)return null;if(l.type==="Variable"&&l.node.type==="VariableDeclarator"&&l.node.id.type==="Identifier"&&l.node.init!=null){let p=Pe(l.node.init);if(p!=null)return[c,p]}return l.type==="FunctionName"&&l.node.type==="FunctionDeclaration"?[c,"function"]:l.type==="ClassName"&&l.node.type==="ClassDeclaration"?[c,"class"]:null}).filter(Boolean);function a(i){let c=!1;for(let l=0;l<i.references.length;l++){let p=i.references[l];if(p.writeExpr){if(c)return!0;c=!0;continue}let m=p.from;for(;m!==t&&m!=null;)m=m.upper;if(m!==t&&!Nn(n,p.identifier))return!0}return!1}return o.map(([i,c])=>({construction:i.defs[0],depType:c,isUsedOutsideOfHook:a(i)}))}function Pn(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)?Pn(e.parent):e.type==="MemberExpression"&&e.parent&&e.parent.type==="AssignmentExpression"&&e.parent.left===e?e.object:e}function Et(e,n,r){n&&(e.optional?n.has(r)||n.set(r,!0):n.has(r)||n.set(r,!1))}function Ie(e,n){if(e.type==="Identifier"||e.type==="JSXIdentifier"){let r=e.name;return n&&n.set(r,!1),r}else if(e.type==="MemberExpression"&&!e.computed){let r=Ie(e.object,n),t=Ie(e.property,null),o=`${r}.${t}`;return Et(e,n,o),o}else if(e.type==="OptionalMemberExpression"&&!e.computed){let r=Ie(e.object,n),t=Ie(e.property,null),o=`${r}.${t}`;return Et(e,n,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 t=Ie(r.object,n),o=Ie(r.property,null),a=`${t}.${o}`;return Et(r,n,a),a}else throw new Error(`Unsupported node type: ${e.type}`)}function On(e,n){return e.type==="MemberExpression"&&e.object.type==="Identifier"&&e.object.name==="React"&&e.property.type==="Identifier"&&!e.computed?e.property:e}function ii(e,n){let r=On(e);if(r.type!=="Identifier")return-1;switch(r.name){case"useEffect":case"useLayoutEffect":case"useCallback":case"useMemo":return 0;case"useImperativeHandle":return 1;default:if(r===e&&n&&n.additionalHooks){let t;try{t=Ie(r,null)}catch(o){if(/Unsupported node type/.test(o.message))return 0;throw o}return n.additionalHooks.test(t)?0:-1}else return-1}}function bt(e,n){let r=[e],t=null;for(;r.length;){if(t=r.shift(),oi(t,n))return t;if(Nn(t,n))for(let[o,a]of Object.entries(t))o!=="parent"&&(kn(a)?(a.parent=t,r.push(a)):Array.isArray(a)&&a.forEach(i=>{kn(i)&&(i.parent=t,r.push(i))}))}return null}function si(e){let n="";for(let r=0;r<e.length;r++)n+=e[r],r===0&&e.length===2?n+=" and ":r===e.length-2&&e.length>2?n+=", and ":r<e.length-1&&(n+=", ");return n}function kn(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&typeof e.type=="string"}function oi(e,n){return(e.type==="Identifier"||e.type==="JSXIdentifier")&&e.type===n.type&&e.name===n.name&&e.range[0]===n.range[0]&&e.range[1]===n.range[1]}function Nn(e,n){return e.range[0]<=n.range[0]&&e.range[1]>=n.range[1]}function ai(e){return!1}var G=require("@typescript-eslint/utils"),ne=he(require("typescript")),Mn=require("zod/v4");var xt=require("@typescript-eslint/utils");function Ue(e,n,r=1/0){if(r!==0&&e.parent)return e.type===n?e:Ue(e.parent,n,r===1/0?r:r-1)}function*Ct(e){yield e,e.parent&&(yield*Ct(e.parent))}function At(e,n){for(let r of e){let t=n(r);if(t!=null&&t!==!1)return t}}function Ln(e,n,r){let o=r.getDeclaredVariables(e).find(a=>a.name===n||a.identifiers[0]?.parent.type===xt.AST_NODE_TYPES.Property&&a.identifiers[0].parent.key.type===xt.AST_NODE_TYPES.Identifier&&a.identifiers[0].parent.key.name===n);return o?o.references.filter(a=>!a.init):[]}function Dn(e){return e===null||typeof e!="object"||!("type"in e)?!1:typeof e.type=="string"}function li(e,n){return e[n]}function Oe(e,n,r){let t=r.visitorKeys,o=new Set;function a(i){if(o.has(i))return!1;if(o.add(i),n(i)===!0)return!0;let l=t[i.type];if(l)for(let p of l){let m=li(i,p);if(m){if(Array.isArray(m)){for(let d of m)if(Dn(d)&&a(d))return!0}else if(Dn(m)&&a(m))return!0}}return!1}a(e)}var pi=G.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),jn="improved-no-unnecessary-condition",ci=Mn.z.object({}),ui=["string","number","bigint","boolean","symbol","undefined","object","function","never"],fi=new Set(ui),It={name:jn,rule:pi({name:jn,meta:{type:"suggestion",docs:{description:"Extends checks of `no-unnecessary-condition` rule"},messages:{unnecessaryTypeofCondition:'This condition is unnecessary. The type of "{{name}}" is always "{{type}}".',alwaysFalseTypeofCondition:'This condition will always be false. The type of "{{name}}" is "{{actualType}}" so the condition has no overlap with "{{conditionType}}".',unnecessaryStartsWithCondition:"This startsWith check is unnecessary as it always evaluates to true.",alwaysFalseStartsWithCondition:"This startsWith check will always be false.",unnecessaryEndsWithCondition:"This endsWith check is unnecessary as it always evaluates to true.",alwaysFalseEndsWithCondition:"This endsWith check will always be false.",unnecessaryIncludesCondition:"This includes check is unnecessary as it always evaluates to true.",alwaysFalseIncludesCondition:"This includes check will always be false.",unnecessaryLengthCondition:"This length comparison is unnecessary as it always evaluates to true.",alwaysFalseLengthCondition:"This length comparison will always be false."},schema:[j(ci)]},defaultOptions:[{}],create(e){let n=G.ESLintUtils.getParserServices(e,!0),r=n.program?.getTypeChecker();if(!r||!n.program)throw new Error("TypeScript services or program not available");function t(s){return s.type===G.AST_NODE_TYPES.UnaryExpression&&s.operator==="typeof"}function o(s){return s.flags&ne.default.TypeFlags.Any||s.flags&ne.default.TypeFlags.Unknown?null:s.flags&ne.default.TypeFlags.StringLike?["string"]:s.flags&ne.default.TypeFlags.NumberLike?["number"]:s.flags&ne.default.TypeFlags.BigIntLike?["bigint"]:s.flags&ne.default.TypeFlags.BooleanLike?["boolean"]:s.flags&ne.default.TypeFlags.ESSymbolLike?["symbol"]:s.flags&ne.default.TypeFlags.Undefined||s.flags&ne.default.TypeFlags.Void?["undefined"]:s.flags&ne.default.TypeFlags.Null?["object"]:s.getCallSignatures().length>0?["function"]:s.flags&ne.default.TypeFlags.Object?s.getProperties().length===0?["string","number","bigint","boolean","symbol","object","function"]:["object"]:s.flags&ne.default.TypeFlags.NonPrimitive?["object"]:s.flags&ne.default.TypeFlags.Never?["never"]:null}function a(s){if(!r)return null;let u=n.esTreeNodeToTSNodeMap.get(s),y=r.getTypeAtLocation(u.expression);if(y.flags&ne.default.TypeFlags.Any||y.flags&ne.default.TypeFlags.Unknown)return null;let g=[];if(y.isUnion()){for(let f of y.types){let T=o(f);if(T)g.push(...T);else return null}return g}let S=o(y);return S?(g.push(...S),g):null}function i(s){if(!(s.operator==="==="||s.operator==="!=="))return;let y=null,g=null;if(t(s.left)?(y=s.left,g=s.right.type===G.AST_NODE_TYPES.Literal&&typeof s.right.value=="string"?s.right.value:null):t(s.right)&&(y=s.right,g=s.left.type===G.AST_NODE_TYPES.Literal&&typeof s.left.value=="string"?s.left.value:null),!y||!g||!mi(g,fi))return;let S=a(y);if(!S)return;let f=s.operator==="!==",T=S.includes(g);S.length===1?T&&!f?e.report({node:s,messageId:"unnecessaryTypeofCondition",data:{name:We(y,e),type:g}}):!T&&f?e.report({node:s,messageId:"unnecessaryTypeofCondition",data:{name:We(y,e),type:Array.from(S)[0]}}):!T&&!f?e.report({node:s,messageId:"alwaysFalseTypeofCondition",data:{name:We(y,e),actualType:nt(S),conditionType:g}}):T&&f&&e.report({node:s,messageId:"alwaysFalseTypeofCondition",data:{name:We(y,e),actualType:nt(S),conditionType:g}}):!T&&!f?e.report({node:s,messageId:"alwaysFalseTypeofCondition",data:{name:We(y,e),actualType:nt(S),conditionType:g}}):!T&&f&&e.report({node:s,messageId:"unnecessaryTypeofCondition",data:{name:We(y,e),type:nt(S)}})}function c(s){if(s.flags&ne.default.TypeFlags.Any||s.flags&ne.default.TypeFlags.Unknown)return null;if(s.isUnion()){let u=[];for(let y of s.types)if(y.flags&ne.default.TypeFlags.StringLiteral){let g=y.value;u.push(g)}else return null;return u}return s.flags&ne.default.TypeFlags.StringLiteral?[s.value]:null}function l(s){if(!r)return null;let u=n.esTreeNodeToTSNodeMap.get(s),y=r.getTypeAtLocation(u),g=c(y);if(g)return g;let S=r.getSymbolAtLocation(u);if(S){let f=r.getTypeOfSymbolAtLocation(S,u),T=c(f);if(T)return T}return null}function p(s){let u=e.sourceCode.ast,y=null;return Oe(u,g=>{if(g.type===G.AST_NODE_TYPES.VariableDeclarator&&g.id.type===G.AST_NODE_TYPES.Identifier&&g.id.name===s.name&&g.id.typeAnnotation){let S=g.id.typeAnnotation.typeAnnotation;if(S.type===G.AST_NODE_TYPES.TSUnionType){let f=[];for(let T of S.types)if(T.type===G.AST_NODE_TYPES.TSLiteralType&&T.literal.type===G.AST_NODE_TYPES.Literal&&typeof T.literal.value=="string")f.push(T.literal.value);else return!0;return y=f,!0}if(S.type===G.AST_NODE_TYPES.TSLiteralType&&S.literal.type===G.AST_NODE_TYPES.Literal&&typeof S.literal.value=="string")return y=[S.literal.value],!0}return!1},e.sourceCode),y}function m(s){if(s.callee.type!==G.AST_NODE_TYPES.MemberExpression||s.callee.property.type!==G.AST_NODE_TYPES.Identifier||s.callee.computed)return;let u=s.callee.property.name;if(u!=="startsWith"&&u!=="endsWith"&&u!=="includes"||s.arguments.length!==1)return;let[y]=s.arguments;if(!y||y.type!==G.AST_NODE_TYPES.Literal||typeof y.value!="string")return;let g=s.callee.object,S=l(g);if(!S&&g.type===G.AST_NODE_TYPES.Identifier&&(S=p(g)),!S||S.length===0)return;let f=y.value;if(u==="includes"&&S.length>1)return;let T=0,b=0;for(let h of S)if((u==="startsWith"?h.startsWith(f):u==="endsWith"?h.endsWith(f):h.includes(f))?T++:b++,T>0&&b>0)return;if(T>0&&b===0){let h=u==="startsWith"?"unnecessaryStartsWithCondition":u==="endsWith"?"unnecessaryEndsWithCondition":"unnecessaryIncludesCondition";e.report({node:s,messageId:h})}else if(b>0&&T===0){let h=u==="startsWith"?"alwaysFalseStartsWithCondition":u==="endsWith"?"alwaysFalseEndsWithCondition":"alwaysFalseIncludesCondition";e.report({node:s,messageId:h})}}function d(s){if(!new Set(["===","!==",">",">=","<","<="]).has(s.operator))return;function y(I){if(I.type!==G.AST_NODE_TYPES.MemberExpression||I.computed||I.property.type!==G.AST_NODE_TYPES.Identifier||I.property.name!=="length")return null;let E=I.object,C=l(E);if(!C||C.length===0)return null;let w=[];for(let R of C)w.push(R.length);return{values:w}}let g=y(s.left),S=y(s.right),f=null,T=null;if(g?s.right.type===G.AST_NODE_TYPES.Literal&&typeof s.right.value=="number"&&(f=g.values,T=s.right.value):S&&s.left.type===G.AST_NODE_TYPES.Literal&&typeof s.left.value=="number"&&(f=S.values,T=s.left.value),!f||T===null)return;let b=0,h=0;for(let I of f){let E=!1;if(s.operator==="==="?E=I===T:s.operator==="!=="?E=I!==T:s.operator===">"?E=I>T:s.operator===">="?E=I>=T:s.operator==="<"?E=I<T:s.operator==="<="&&(E=I<=T),E?b++:h++,b>0&&h>0)return}b>0&&h===0?e.report({node:s,messageId:"unnecessaryLengthCondition"}):h>0&&b===0&&e.report({node:s,messageId:"alwaysFalseLengthCondition"})}return{BinaryExpression(s){i(s),d(s)},CallExpression:m}}})};function nt(e){return Array.from(new Set(e)).join(" | ")||"never"}function We(e,n){let r=e.argument;return r.type===G.AST_NODE_TYPES.Identifier?r.name:n.sourceCode.getText(r)}function mi(e,n){return n.has(e)}var it=require("@typescript-eslint/utils"),rt=require("zod/v4");var yi=it.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),$n="no-call-with-explicit-generics",di=rt.z.object({functions:rt.z.array(rt.z.string())}),gi=yi({name:$n,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(di)]},defaultOptions:[{functions:[]}],create(e,[n]){let r=new Set(n.functions);return{CallExpression(t){let{callee:o}=t;o.type===it.AST_NODE_TYPES.Identifier&&r.has(o.name)&&t.typeArguments&&e.report({node:t,messageId:"noExplicitGenerics",data:{functionName:o.name}})}}}}),Rt={name:$n,rule:gi};var je=require("@typescript-eslint/utils"),Si=je.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),_n="no-call-with-inferred-generics",Ti=Si({name:_n,meta:{type:"problem",docs:{description:"Disable calling configured functions with infered generics"},messages:{missingGenericDeclaration:"Function '{{ functionName }}' should be called with at least {{ minGenerics }} generic(s) (ex: `fn<Generic>()`) defined",anyUsedInGenerics:"Function '{{ functionName }}' should not be called with 'any' in generics"},schema:[{type:"object",properties:{functions:{type:"array",items:{type:"object",properties:{name:{type:"string"},minGenerics:{type:"number"},allowAny:{type:"boolean"},disallowTypes:{type:"array",items:{type:"string"}}},required:["name"]}},anyAliases:{type:"array",items:{type:"string"}}},required:["functions"]}]},defaultOptions:[{functions:[]}],create(e,[n]){let r=new Map(n.functions.map(t=>[t.name,t]));return{CallExpression(t){let{callee:o}=t;if(o.type!==je.AST_NODE_TYPES.Identifier)return;let a=r.get(o.name);if(!a)return;let{minGenerics:i=1,allowAny:c,disallowTypes:l=n.disallowTypes}=a;(t.typeArguments?.params.length||0)<(i||0)&&e.report({node:t,messageId:"missingGenericDeclaration",data:{functionName:o.name,minGenerics:i||0}}),!(c&&!l)&&t.typeArguments?.params.some(m=>!c&&m.type===je.AST_NODE_TYPES.TSAnyKeyword||l&&m.type===je.AST_NODE_TYPES.TSTypeReference&&m.typeName.type===je.AST_NODE_TYPES.Identifier&&l.includes(m.typeName.name))&&e.report({node:t,messageId:"anyUsedInGenerics",data:{functionName:o.name}})}}}}),wt={name:_n,rule:Ti};var zn=require("@typescript-eslint/utils"),hi=zn.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),Jn="no-commented-out-code",Ei=["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:"],bi=/^\s*return\s+/,xi=/\w=("|'|`)/,Ci=/\w+:\s*('|"|`)/,Ai=/\[['"][^'"]*['"]\]:\s*('|"|`|[^'"`\s])/,Ii=/\w+-\w+:/,Ri=/\w+_\w+:/,wi=/\?\s+\w/,vi=/:\s+\w/,ki=/^\s*('|"|`)[^'"]*('|"|`),?\s*$/,Fi=/^\s*\d+[,}]/,Pi=/^\s*\[[^\]]*\][,}]/,Oi=/^\s*\{[^}]*\}[,}]/,Ni=/\.\w+\(/,Di=/\[\w+\]/,Li=/^\s*(['"`]).+?\1\s*:/,ji=/^<[A-Z]\w*(\s|>|\/)/,Mi=/^<[a-z]+(\s|>|\/)/,$i=/<[A-Z]\w*(\s.*)?>/,_i=/<\/[A-Z]\w*>/,Ui=/<[a-z]+(\s.*)?>/,Wi=/<\/[a-z]+>/,zi=/^\s*[*\s]*$/,Ji=/^[a-zA-Z]/,Vi=/^[A-Z][A-Za-z]*(?:\s+\d+)?(?:\s+[a-z]+)*:\s+[A-Za-z]/,Xi=/```[\s\S]*?```/g,Hi=/`[^`]*`/g,Un=/[a-zA-Z0-9]/,Bi=/\.[A-Za-z_][A-Za-z0-9_]*\(/,Yi=/[{}[\]()`=<>]/,qi=/:\s*(['"`[{(]|\w+\s*=>)/,Zi=/\bif\s*\(|\belse\b|=>/,Q={returnStatement:bi,stringAssignment:xi,objectPropertyWithQuotes:Ci,computedPropertyAssignment:Ai,kebabCaseProperty:Ii,snakeCaseProperty:Ri,ternaryOperator:wi,colonWithWord:vi,quotedString:ki,numberWithComma:Fi,arrayWithComma:Pi,objectWithComma:Oi,methodCall:Ni,arrayAccess:Di,quotedPropertyKey:Li,jsxSelfClosing:ji,jsxElement:Mi,jsxOpeningTag:$i,jsxClosingTag:_i,htmlOpeningTag:Ui,htmlClosingTag:Wi,jsdocComment:zi};function Gi(e){if(e.includes(":")){let r=e.split(":")[0]?.trim();if(r&&Ji.test(r)&&r.includes(" "))return!0}let n=e.trim();return n.length===0||Bi.test(n)||Yi.test(n)||qi.test(n)||Zi.test(n)?!1:!!(n.includes(":")&&Vi.test(n))}var Ki=[") {","return;",Q.returnStatement,"if (","else {","else if (","/>","</","< ","},",": {"," } = ","={",Q.stringAssignment,");",Q.objectPropertyWithQuotes,Q.computedPropertyAssignment,Q.kebabCaseProperty,Q.snakeCaseProperty,"&&","||","()",Q.ternaryOperator,Q.colonWithWord,Q.quotedString,Q.numberWithComma,Q.arrayWithComma,Q.objectWithComma,Q.methodCall,Q.arrayAccess,"?.(","??","=>",Q.quotedPropertyKey],Qi=["/>","</",Q.jsxSelfClosing,Q.jsxElement,Q.jsxOpeningTag,Q.jsxClosingTag,Q.htmlOpeningTag,Q.htmlClosingTag],Wn=["INFO:","TODO:","DOCS:","FIX:","FIXME:","HACK:","NOTE:","WARNING:","WARN:","BUG:","ISSUE:","TEMP:","TEMPORARY:","XXX:","REVIEW:","eslint"],es=hi({name:Jn,meta:{type:"problem",docs:{description:"Disallow commented code"},messages:{commentedOutCode:"Commented code is not allowed. Detected pattern: `{{ wrongPattern }}` Use a comment starting with one of these prefixes if you want to keep this code commented out: {{ allowedPrefixes }}"},schema:[]},defaultOptions:[],create(e){function n(t,o){if(t.startsWith("/"))return!1;let a=t.trimStart();if(t.startsWith("*")||a.startsWith("eslint-disable")||t.includes("@deprecated")||t.includes("@example")||t.includes("@param")||t.includes("@returns")||t.includes("@throws")||t.includes("typescript-eslint")||t.includes("@ts-")||t.includes("prettier-ignore")||Q.jsdocComment.test(t))return!1;for(let i of Wn)if(a.startsWith(i))return!1;if(t.includes("https://")||Gi(a))return!1;if(o==="Block"){for(let i of Qi)if(typeof i=="string"){if(t.includes(i))return{wrongPattern:i}}else if(i.test(t))return{wrongPattern:`regex(${i.toString()})`};return!1}for(let i of Ei)if(a.startsWith(i))return{wrongPattern:i};for(let i of Ki)if(typeof i=="string"){if(t.includes(i))return{wrongPattern:i}}else if(i.test(t))return{wrongPattern:`regex(${i.toString()})`};return!1}function r(t,o){let a=t,i=a.trim();if(i.startsWith("`")&&(i.endsWith("`,")||i.endsWith("`;")||i.endsWith("`")))return a;if(o==="Block"&&a.includes("```")){let p=a.split(Xi);p.some(d=>Un.test(d))&&(a=p.join(""))}if(!a.includes("`"))return a;let c=a.split(Hi);return c.some(p=>Un.test(p))?c.join(""):a}return{Program(){let o=e.sourceCode.getAllComments();for(let a of o){let i=r(a.value,a.type),c=n(i,a.type);c&&e.report({node:a,messageId:"commentedOutCode",data:{wrongPattern:c.wrongPattern,allowedPrefixes:Wn.join(", ")}})}}}}}),vt={name:Jn,rule:es};var st=require("@typescript-eslint/utils"),ts=st.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),Vn="no-default-export",ns=ts({name:Vn,meta:{type:"problem",docs:{description:"Disallow default exports"},schema:[],messages:{noDefaultExport:"Default exports are not allowed, use named exports instead."}},defaultOptions:[],create(e){return{ExportDefaultDeclaration(n){e.report({node:n,messageId:"noDefaultExport"})},ExportNamedDeclaration(n){for(let r of n.specifiers)r.exported.type===st.TSESTree.AST_NODE_TYPES.Identifier&&r.exported.name==="default"&&e.report({node:n,messageId:"noDefaultExport"})}}}}),kt={name:Vn,rule:ns};var Xn=require("@typescript-eslint/utils"),rs=Xn.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),Hn="no-leaked-text-in-jsx",is=[",",";","[","]","(",")"],ss=rs({name:Hn,meta:{type:"problem",docs:{description:"Prevents leaking of text in JSX that should be wrapped in an expression container"},messages:{leakedTextInJSX:'Text "{{ text }}" should be wrapped in a JSX expression container.'},schema:[],fixable:"code"},defaultOptions:[],create(e){return{JSXText(n){let r=n.value.trim();if(!r)return;let t="";is.includes(r)?t=r:r.includes("&&")?t="&&":r.includes("||")?t="||":r.endsWith("? (")&&(t="? ("),t&&e.report({node:n,messageId:"leakedTextInJSX",data:{text:t}})}}}}),Ft={name:Hn,rule:ss};var Ne=require("@typescript-eslint/utils"),os=Ne.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),Yn="no-non-camel-case-functions",as=/^(\$?[a-z][a-zA-Z0-9]*)$/;function Bn(e){if(e.typeName.type!==Ne.AST_NODE_TYPES.TSQualifiedName)return!1;let{left:n,right:r}=e.typeName;return n.type===Ne.AST_NODE_TYPES.Identifier&&n.name==="JSX"&&r.name==="Element"}var ls=os({name:Yn,meta:{type:"suggestion",docs:{description:"Enforce camelCase naming convention for function declarations"},schema:[],messages:{nonCamelCaseFunction:'Function name "{{functionName}}" should be in camelCase format. If this fn is a React component and can\'t use the `FC` type, add a explicit "JSX.Element" return type to it'}},defaultOptions:[],create(e){return{FunctionDeclaration(n){if(n.id&&!as.test(n.id.name)){let r=n.returnType?.typeAnnotation;if(r&&(r.type===Ne.AST_NODE_TYPES.TSTypeReference?Bn(r):r.type===Ne.AST_NODE_TYPES.TSUnionType&&r.types.some(o=>o.type===Ne.AST_NODE_TYPES.TSTypeReference&&Bn(o))))return;e.report({node:n.id,messageId:"nonCamelCaseFunction",data:{functionName:n.id.name}})}}}}}),Pt={name:Yn,rule:ls};var H=require("@typescript-eslint/utils");var ps=H.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),qn="no-optional-root-props",cs=ps({name:qn,meta:{type:"problem",docs:{description:"Prevents usage of optional properties at the root of a type if that type is a local type alias or interface referenced only once"},messages:{optionalNotAllowed:'Optional property "{{ propertyName }}" is not allowed on a local type used only once. Use `prop: undefined | ...` instead.',suggestion:"Use `prop: undefined | ...` instead."},hasSuggestions:!0,schema:[]},defaultOptions:[],create(e){function n(t){let a=e.sourceCode.getDeclaredVariables(t)[0];if(!a||a.references.length!==1)return!1;let i=a.references[0];if(!i)return!1;for(let c of Ct(i.identifier)){if("returnType"in c||c.type===H.TSESTree.AST_NODE_TYPES.ExportNamedDeclaration)return!1;let l=c.parent;if(!l)return!1;if(l.type===H.TSESTree.AST_NODE_TYPES.TSTypeParameterInstantiation&&l.parent.type===H.TSESTree.AST_NODE_TYPES.TSTypeReference&&l.parent.typeName.type===H.TSESTree.AST_NODE_TYPES.Identifier&&l.parent.typeName.name==="FC"){let m=Ue(l.parent.parent,H.TSESTree.AST_NODE_TYPES.VariableDeclaration,4);if(!m)return!1;let d=ot(m,e.sourceCode);return d?!(d.parent.type===H.TSESTree.AST_NODE_TYPES.CallExpression&&d.parent.callee.type===H.TSESTree.AST_NODE_TYPES.Identifier&&d.parent.callee.name==="memo"):!1}if(c.type===H.TSESTree.AST_NODE_TYPES.AssignmentPattern)return!1;if(l.type===H.TSESTree.AST_NODE_TYPES.ArrowFunctionExpression){let p=Ue(l,H.TSESTree.AST_NODE_TYPES.VariableDeclaration);return p?!!ot(p,e.sourceCode):!1}if(l.type===H.TSESTree.AST_NODE_TYPES.FunctionDeclaration)return!!ot(l,e.sourceCode)}return!1}function r(t){t.key.type!==H.TSESTree.AST_NODE_TYPES.Identifier||!t.optional||e.report({node:t.key,messageId:"optionalNotAllowed",data:{propertyName:t.key.name},suggest:[{messageId:"suggestion",fix:o=>{let a=Ue(t,H.TSESTree.AST_NODE_TYPES.TSPropertySignature);if(!a)return null;let i=e.sourceCode.getText(a);return o.replaceText(a,i.replace("?:",": undefined |"))}}]})}return{TSTypeAliasDeclaration(t){if(t.typeAnnotation.type===H.TSESTree.AST_NODE_TYPES.TSTypeLiteral&&!(at(t)||!n(t)))for(let o of t.typeAnnotation.members)o.type===H.TSESTree.AST_NODE_TYPES.TSPropertySignature&&r(o)},TSInterfaceDeclaration(t){if(!(at(t)||!n(t)))for(let o of t.body.body)o.type===H.TSESTree.AST_NODE_TYPES.TSPropertySignature&&r(o)},TSTypeReference(t){if(t.typeName.type!==H.TSESTree.AST_NODE_TYPES.Identifier||t.typeName.name!=="FC"||!t.typeArguments?.params[0])return;let o=t.typeArguments.params[0];if(o.type!==H.TSESTree.AST_NODE_TYPES.TSTypeLiteral)return;let a=Ue(t.parent,H.TSESTree.AST_NODE_TYPES.VariableDeclaration,4);if(!a)return;let i=ot(a,e.sourceCode);if(!(!i||i.parent.type===H.TSESTree.AST_NODE_TYPES.CallExpression&&i.parent.callee.type===H.TSESTree.AST_NODE_TYPES.Identifier&&i.parent.callee.name==="memo"))for(let l of o.members)l.type===H.TSESTree.AST_NODE_TYPES.TSPropertySignature&&r(l)}}}});function at(e){return e?e.parent?.type===H.TSESTree.AST_NODE_TYPES.ExportNamedDeclaration||e.parent?.type===H.TSESTree.AST_NODE_TYPES.ExportDefaultDeclaration:!1}function ot(e,n){if(at(e))return;let r;if(e.type===H.TSESTree.AST_NODE_TYPES.VariableDeclaration){if(e.declarations.length!==1)return;e.declarations[0].id.type===H.TSESTree.AST_NODE_TYPES.Identifier&&(r=e.declarations[0].id)}else{if(!e.id)return;r=e.id}if(!r)return;let t=n.getScope(e);e.type===H.TSESTree.AST_NODE_TYPES.FunctionDeclaration&&t.upper&&(t=t.upper);let o=t.variables.find(i=>i.identifiers.includes(r));if(!o)return;let a=o.references.filter(i=>i.identifier!==r);if(!(a.length!==1||!a[0])&&!at(a[0].identifier.parent.parent))return a[0].identifier}var Ot={name:qn,rule:cs};var He=require("@typescript-eslint/utils");var Be=V({name:"no-reexport",meta:{type:"problem",docs:{description:"Disallow re-exports to prevent indirection"},schema:[],messages:{noReexport:"Re-exports are not allowed. Use direct exports only."}},defaultOptions:[],create(e){let n=new Set;function r(t){return t?t.type===He.AST_NODE_TYPES.Identifier?n.has(t.name):t.type===He.AST_NODE_TYPES.MemberExpression?r(t.object):!1:!1}return{ImportDeclaration(t){for(let o of t.specifiers)n.add(o.local.name)},ExportNamedDeclaration(t){if(t.source){e.report({node:t,messageId:"noReexport"});return}if(t.declaration?.type===He.AST_NODE_TYPES.VariableDeclaration)for(let o of t.declaration.declarations)r(o.init)&&e.report({node:t,messageId:"noReexport"});t.specifiers.length>0&&e.report({node:t,messageId:"noReexport"})},ExportDefaultDeclaration(t){t.declaration.type===He.AST_NODE_TYPES.Identifier&&n.has(t.declaration.name)&&e.report({node:t,messageId:"noReexport"})},ExportAllDeclaration(t){e.report({node:t,messageId:"noReexport"})}}}});var Zn=require("@typescript-eslint/utils"),lt=he(require("path")),Re=require("zod/v4");var us=Zn.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),Gn="no-relative-imports",fs=Re.z.object({find:Re.z.string(),replacement:Re.z.string()}),ms=Re.z.object({aliases:Re.z.array(fs),rootDir:Re.z.string().optional(),allowNotFoundAliases:Re.z.boolean().optional(),_dev_simulateFileName:Re.z.string().optional()}),ys=us({name:Gn,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(ms)]},defaultOptions:[{aliases:[],rootDir:void 0}],create(e,[n]){let r=n._dev_simulateFileName??e.filename;function t(i){return i.startsWith(".")||i.startsWith("..")}function o(i,c){let l=lt.default.dirname(c);return lt.default.resolve(l,i)}function a(i){let c=n.rootDir??process.cwd(),l=lt.default.relative(c,i);if(l.startsWith("."))return null;l.startsWith("/")||(l=`/${l}`);for(let{find:p,replacement:m}of n.aliases)if(l.startsWith(m)){let d=l.replace(m,p);return{alias:p,newPath:d}}return null}return{ImportDeclaration(i){let c=i.source.value;if(!t(c))return;let l=o(c,r),p=a(l);!p&&n.allowNotFoundAliases||e.report({node:i,messageId:p?"noRelativeImportsWithAlias":"noRelativeImports",data:{alias:p?.alias},fix:p?m=>m.replaceText(i.source,`'${p.newPath}'`):void 0})}}}}),Nt={name:Gn,rule:ys};var ee=require("@typescript-eslint/utils"),Dt=require("zod/v4");var ds=Dt.z.object({customMessage:Dt.z.string().optional()}),Lt=V({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(ds)],messages:{noStaticStyleProp:"Static style props are not allowed use css instead.{{customMessage}}"}},defaultOptions:[{}],create(e,[n]){function r(t){switch(t.type){case ee.AST_NODE_TYPES.Literal:return!0;case ee.AST_NODE_TYPES.ObjectExpression:return t.properties.every(o=>o.type===ee.AST_NODE_TYPES.Property?o.computed||o.value.type===ee.AST_NODE_TYPES.Identifier&&o.key.type===ee.AST_NODE_TYPES.Identifier&&o.key.name===o.value.name?!1:r(o.value):!1);case ee.AST_NODE_TYPES.ArrayExpression:return t.elements.every(o=>o?o.type===ee.AST_NODE_TYPES.SpreadElement?!1:r(o):!0);case ee.AST_NODE_TYPES.TemplateLiteral:return t.expressions.length===0;case ee.AST_NODE_TYPES.ConditionalExpression:case ee.AST_NODE_TYPES.LogicalExpression:case ee.AST_NODE_TYPES.BinaryExpression:case ee.AST_NODE_TYPES.UnaryExpression:case ee.AST_NODE_TYPES.CallExpression:case ee.AST_NODE_TYPES.MemberExpression:case ee.AST_NODE_TYPES.Identifier:case ee.AST_NODE_TYPES.ArrowFunctionExpression:case ee.AST_NODE_TYPES.FunctionExpression:return!1;default:return!1}}return{JSXAttribute(t){if(t.name.type===ee.AST_NODE_TYPES.JSXIdentifier&&t.name.name==="style"&&t.value){let o=null;t.value.type===ee.AST_NODE_TYPES.JSXExpressionContainer?t.value.expression.type!==ee.AST_NODE_TYPES.JSXEmptyExpression&&(o=t.value.expression):t.value.type===ee.AST_NODE_TYPES.Literal&&(o=t.value),o&&r(o)&&e.report({node:t,messageId:"noStaticStyleProp",data:{customMessage:n.customMessage?` ${n.customMessage}`:""}})}}}}});var Ye=require("@typescript-eslint/utils"),Me=he(require("zod/v4"));var gs=Me.object({alternativeMsgs:Me.object({inArrayFind:Me.string().optional(),inArrayFilter:Me.string().optional()}).optional(),__dev_simulateFileName:Me.string().optional()});function Ss(e){return e.typeAnnotation.type!==Ye.AST_NODE_TYPES.TSTypePredicate?!1:e.typeAnnotation.asserts===!1}var Ts=/(typeGuards|type-guards)\.(ts|tsx)$/;function hs(e){return Ts.test(e)}function Es(e){let n=e.parent;for(;n;){if(n.type===Ye.AST_NODE_TYPES.CallExpression&&n.callee.type===Ye.AST_NODE_TYPES.MemberExpression&&n.callee.property.type===Ye.AST_NODE_TYPES.Identifier){let r=n.callee.property.name;if(r==="filter"||r==="find")return{method:r}}n=n.parent}return null}var jt=V({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(gs)],hasSuggestions:!0},defaultOptions:[{}],create(e,[n]){let r=n.__dev_simulateFileName??e.filename;if(hs(r))return{};function t(o){if(!Ss(o))return;let a=Es(o);if(n.alternativeMsgs&&a){let i=a.method==="filter"?n.alternativeMsgs.inArrayFilter:n.alternativeMsgs.inArrayFind;if(i){let c=a.method==="filter"?"useFilterWithTypeCheck":"useFindWithTypeCheck";e.report({node:o,messageId:c,data:{message:i}});return}}e.report({node:o,messageId:"typeGuardNotAllowed"})}return{"FunctionDeclaration > :matches(TSTypeAnnotation)":t,"ArrowFunctionExpression > :matches(TSTypeAnnotation)":t,"MethodDefinition > FunctionExpression > :matches(TSTypeAnnotation)":t}}});var $e=require("@typescript-eslint/utils");var bs="no-unnecessary-async-on-jsx-props";function xs(e){if(e.body.type!==$e.AST_NODE_TYPES.BlockStatement)return!1;let n=e.body.body;if(n.length!==1)return!1;let r=n[0];return!r||r.type!==$e.AST_NODE_TYPES.ExpressionStatement?!1:r.expression.type===$e.AST_NODE_TYPES.AwaitExpression}var Mt=V({name:bs,meta:{type:"suggestion",fixable:"code",docs:{description:"Disallow unnecessary async/await in JSX props where a single await provides no benefit"},messages:{unnecessaryAsyncInJsxProp:"Unnecessary async/await in JSX prop. The single await expression provides no benefit here."},schema:[]},defaultOptions:[],create(e){function n(r){xs(r)&&e.report({node:r,messageId:"unnecessaryAsyncInJsxProp",fix(t){let o=e.sourceCode,a=[],i=o.getFirstToken(r,l=>l.value==="async");if(i){let l=o.getTokenAfter(i);l?a.push(t.replaceTextRange([i.range[0],l.range[0]],"")):a.push(t.remove(i))}function c(l){if(l.type===$e.AST_NODE_TYPES.AwaitExpression){let p=o.getFirstToken(l);if(p&&p.value==="await"){let m=o.getTokenAfter(p);m?a.push(t.replaceTextRange([p.range[0],m.range[0]],"")):a.push(t.remove(p))}}if(l.type===$e.AST_NODE_TYPES.BlockStatement)for(let p of l.body)c(p);else l.type===$e.AST_NODE_TYPES.ExpressionStatement&&c(l.expression)}return c(r.body),a}})}return{"JSXAttribute ArrowFunctionExpression[async=true]":n,"JSXAttribute FunctionExpression[async=true]":n}}});var we=require("@typescript-eslint/utils"),$t=he(require("typescript")),ze=he(require("zod/v4"));var Cs=we.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),Kn="no-unnecessary-casting",As=ze.default.object({additionalCastFunctions:ze.default.array(ze.default.object({name:ze.default.string(),expectedType:ze.default.enum(["string","number"])})).optional()}),_t={name:Kn,rule:Cs({name:Kn,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(As)],fixable:"code"},defaultOptions:[{}],create(e){let r=e.options[0].additionalCastFunctions||[],t=[{name:"Number",expectedType:"number"},{name:"String",expectedType:"string"},...r],o=we.ESLintUtils.getParserServices(e,!0),a=o.program?.getTypeChecker();if(!a||!o.program)throw new Error("TypeScript services or program not available");function i(m,d){switch(m.type){case we.AST_NODE_TYPES.Literal:return d==="number"?typeof m.value=="number":typeof m.value=="string";case we.AST_NODE_TYPES.TemplateLiteral:return d==="string";case we.AST_NODE_TYPES.UnaryExpression:return d==="number"?m.operator==="+"||m.operator==="-"||m.operator==="~":!1;default:return!1}}function c(m,d){return d==="number"?!!(m.flags&$t.TypeFlags.NumberLike):!!(m.flags&$t.TypeFlags.StringLike)}function l(m,d){return s=>s.replaceText(m,e.sourceCode.getText(d))}function p(m){if(!a||m.arguments.length!==1)return;let d=m.arguments[0];if(!d||d.type===we.AST_NODE_TYPES.SpreadElement)return;let{callee:s}=m;if(s.type!==we.AST_NODE_TYPES.Identifier)return;let u=s.name,y=t.find(S=>S.name===u);if(!y)return;if(i(d,y.expectedType)||c(a.getTypeAtLocation(o.esTreeNodeToTSNodeMap.get(d)),y.expectedType)){let S,f;u==="Number"?S="unnecessaryNumberCasting":u==="String"?S="unnecessaryStringCasting":(S="unnecessaryCustomCasting",f={name:y.name,type:y.expectedType}),e.report({node:m,messageId:S,...f?{data:f}:{},fix:l(m,d)})}}return{CallExpression:p}}})};var fe=require("@typescript-eslint/utils"),pt=he(require("zod/v4"));var Is=pt.object({ignoreWithDescription:pt.string().optional()}),Ut=V({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(Is)]},defaultOptions:[{}],create(e,[n]){let r=e.getSourceCode(),t=r.ast;function o(l){let p=l.arguments[0];return p&&p.type===fe.AST_NODE_TYPES.Literal&&typeof p.value=="string"?p.value:null}function a(l){return!l||!n.ignoreWithDescription?!1:new RegExp(n.ignoreWithDescription).test(l)}function i(l){return l.length!==1?!1:t.body.filter(m=>{if(m.type===fe.AST_NODE_TYPES.ExpressionStatement){let d=m.expression;if(d.type===fe.AST_NODE_TYPES.CallExpression&&d.callee.type===fe.AST_NODE_TYPES.Identifier){let s=d.callee.name;return["test","it","beforeEach","afterEach","beforeAll","afterAll"].includes(s)}}return!1}).length===0}function c(l){let p=l.arguments[1];if(p&&(p.type===fe.AST_NODE_TYPES.FunctionExpression||p.type===fe.AST_NODE_TYPES.ArrowFunctionExpression)&&p.body.type===fe.AST_NODE_TYPES.BlockStatement){let m=p.body.body;return m.length===0?"":m.map(s=>r.text.slice(s.range[0],s.range[1])).join(`
15
+ Learn more about data fetching with Hooks: https://reactjs.org/link/hooks-data-fetching`});let E=l.acquire(f),C=new Set,w=null;{let x=E.upper;for(;x&&(C.add(x),x.type!=="function");)x=x.upper;if(!x)return;w=x}let R=Array.isArray;function L(x){if(!R(x.defs))return!1;let A=x.defs[0];if(A==null||A.node.type!=="VariableDeclarator")return!1;let F=A.node.init;if(F==null)return!1;for(;F.type==="TSAsExpression";)F=F.expression;let O=A.node.parent;if(O==null&&(xt(w.block,A.node.id),O=A.node.parent,O==null))return!1;if(O.kind==="const"&&F.type==="Literal"&&(typeof F.value=="string"||typeof F.value=="number"||F.value===null))return!0;if(F.type!=="CallExpression")return!1;let D=F.callee;if(D.type==="MemberExpression"&&D.object.name==="React"&&D.property!=null&&!D.computed&&(D=D.property),D.type!=="Identifier")return!1;let N=A.node.id,{name:$}=D;if($==="useRef"&&N.type==="Identifier")return!0;if(ci(D)&&N.type==="Identifier"){for(let _ of x.references)_!==N&&u.add(_.identifier);return!0}else if($==="useState"||$==="useReducer"){if(N.type==="ArrayPattern"&&N.elements.length===2&&R(x.identifiers)){if(N.elements[1]===x.identifiers[0]){if($==="useState"){let _=x.references,ye=0;for(let Ae=0;Ae<_.length;Ae++){if(_[Ae].isWrite()&&ye++,ye>1)return!1;c.set(_[Ae].identifier,N.elements[0])}}return!0}else if(N.elements[0]===x.identifiers[0]){if($==="useState"){let _=x.references;for(let ye=0;ye<_.length;ye++)m.add(_[ye].identifier)}return!1}}}else if($==="useTransition"&&N.type==="ArrayPattern"&&N.elements.length===2&&Array.isArray(x.identifiers)&&N.elements[1]===x.identifiers[0])return!0;return!1}function U(x){if(!R(x.defs))return!1;let A=x.defs[0];if(A==null||A.node==null||A.node.id==null)return!1;let F=A.node,O=w.childScopes,D=null,N;for(N=0;N<O.length;N++){let $=O[N],_=$.block;if(F.type==="FunctionDeclaration"&&_===F||F.type==="VariableDeclarator"&&_.parent===F){D=$;break}}if(D==null)return!1;for(N=0;N<D.through.length;N++){let $=D.through[N];if($.resolved!=null&&C.has($.resolved.scope)&&!te($.resolved))return!1}return!0}let te=y(L,d),K=y(U,s),ie=new Map;function se(x){let A=x.from,F=!1;for(;A.block!==f;)A.type==="function"&&(F=A.block.parent!=null&&A.block.parent.type==="ReturnStatement"),A=A.upper;return F}let q=new Map,he=new Map;_e(E);function _e(x){for(let A of x.references){if(!A.resolved||!C.has(A.resolved.scope))continue;let F=xt(f,A.identifier),O=Dn(F),D=Ie(O,he);if(I&&O.type==="Identifier"&&(O.parent.type==="MemberExpression"||O.parent.type==="OptionalMemberExpression")&&!O.parent.computed&&O.parent.property.type==="Identifier"&&O.parent.property.name==="current"&&se(A)&&ie.set(D,{reference:A,dependencyNode:O}),O.parent.type==="TSTypeQuery"||O.parent.type==="TSTypeReference")continue;let N=A.resolved.defs[0];if(N!=null&&!(N.node!=null&&N.node.init===f.parent)&&N.type!=="TypeParameter")if(q.has(D))q.get(D).references.push(A);else{let $=A.resolved,_=te($)||K($);q.set(D,{isStable:_,references:[A]})}}for(let A of x.childScopes)_e(A)}ie.forEach(({reference:x,dependencyNode:A},F)=>{let O=x.resolved.references,D=!1;for(let N=0;N<O.length;N++){let{identifier:$}=O[N],{parent:_}=$;if(_!=null&&_.type==="MemberExpression"&&!_.computed&&_.property.type==="Identifier"&&_.property.name==="current"&&_.parent.type==="AssignmentExpression"&&_.parent.left===_){D=!0;break}}D||p({node:A.parent.property,message:`The ref value '${F}.current' will likely have changed by the time this effect cleanup function runs. If this ref points to a node rendered by React, copy '${F}.current' to a variable inside the effect, and use that variable in the cleanup function.`})});let ae=new Set;function ve(x,A){ae.has(A)||(ae.add(A),p({node:x,message:`Assignments to the '${A}' variable from inside React Hook ${r(b)} 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(b)}.`}))}let me=new Set;if(q.forEach(({isStable:x,references:A},F)=>{x&&me.add(F),A.forEach(O=>{O.writeExpr&&ve(O.writeExpr,F)})}),ae.size>0)return;if(!T){let x=null;if(q.forEach(({isStable:A,references:F},O)=>{x||F.forEach(D=>{if(x)return;let N=D.identifier;if(!c.has(N))return;let _=D.from;for(;_.type!=="function";)_=_.upper;_.block===f&&(x=O)})}),x){let{suggestedDependencies:A}=Et({dependencies:q,declaredDependencies:[],stableDependencies:me,externalDependencies:new Set,isEffect:!0});p({node:b,message:`React Hook ${h} contains a call to '${x}'. Without a list of dependencies, this can lead to an infinite chain of updates. To fix this, pass [`+A.join(", ")+`] as a second argument to the ${h} Hook.`,suggest:[{desc:`Add dependencies array: [${A.join(", ")}]`,fix(F){return F.insertTextAfter(f,`, [${A.join(", ")}]`)}}]})}return}let Le=[],He=new Set;T.type!=="ArrayExpression"?p({node:T,message:`React Hook ${r(b)} 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.`}):T.elements.forEach(x=>{if(x===null)return;if(x.type==="SpreadElement"){p({node:x,message:`React Hook ${r(b)} has a spread element in its dependency array. This means we can't statically verify whether you've passed the correct dependencies.`});return}u.has(x)&&p({node:x,message:`Functions returned from \`useEffectEvent\` must not be included in the dependency array. Remove \`${r(x)}\` from the list.`,suggest:[{desc:`Remove the dependency \`${r(x)}\``,fix(D){return D.removeRange(x.range)}}]});let A;try{A=Ie(x,he)}catch(D){if(/Unsupported node type/.test(D.message)){x.type==="Literal"?q.has(x.value)?p({node:x,message:`The ${x.raw} literal is not a valid dependency because it never changes. Did you mean to include ${x.value} in the array instead?`}):p({node:x,message:`The ${x.raw} literal is not a valid dependency because it never changes. You can safely remove it.`}):p({node:x,message:`React Hook ${r(b)} has a complex expression in the dependency array. Extract it to a separate variable so it can be statically checked.`});return}else throw D}let F=x;for(;F.type==="MemberExpression"||F.type==="OptionalMemberExpression"||F.type==="ChainExpression";)F=F.object||F.expression.object;let O=!w.through.some(D=>D.identifier===F);Le.push({key:A,node:x}),O||He.add(A)});let{suggestedDependencies:Wr,unnecessaryDependencies:et,missingDependencies:ke,duplicateDependencies:xn}=Et({dependencies:q,declaredDependencies:Le,stableDependencies:me,externalDependencies:He,isEffect:I}),tt=Wr;if(xn.size+ke.size+et.size===0){if(n)return;oi({declaredDependencies:Le,declaredDependenciesNode:T,componentScope:w,scope:E}).forEach(({construction:A,isUsedOutsideOfHook:F,depType:O})=>{let D=O==="function"?"useCallback":"useMemo",N=O==="function"?"definition":"initialization",$=`wrap the ${N} of '${A.name.name}' in its own ${D}() Hook.`,_=F?`To fix this, ${$}`:`Move it inside the ${h} callback. Alternatively, ${$}`,ye=O==="conditional"||O==="logical expression"?"could make":"makes",Ae=`The '${A.name.name}' ${O} ${ye} the dependencies of ${h} Hook (at line ${T.loc.start.line}) change on every render. ${_}`,Cn;F&&A.type==="Variable"&&O==="function"&&(Cn=[{desc:`Wrap the ${N} of '${A.name.name}' in its own ${D}() Hook.`,fix(An){let[Jr,Vr]=D==="useMemo"?["useMemo(() => { return ","; })"]:["useCallback(",")"];return[An.insertTextBefore(A.node.init,Jr),An.insertTextAfter(A.node.init,Vr)]}}]),p({node:A.node,message:Ae,suggest:Cn})});return}!I&&ke.size>0&&(tt=Et({dependencies:q,declaredDependencies:[],stableDependencies:me,externalDependencies:He,isEffect:I}).suggestedDependencies);function zr(){if(Le.length===0)return!0;let x=Le.map(F=>F.key),A=x.slice().sort();return x.join(",")===A.join(",")}zr()&&tt.sort();function dt(x){let A=x.split("."),F="";for(let O=0;O<A.length;O++){if(O!==0){let D=A.slice(0,O+1).join("."),N=he.get(D)===!0;F+=N?"?.":"."}F+=A[O]}return F}function gt(x,A,F,O){return x.size===0?null:(x.size>1?"":A+" ")+F+" "+(x.size>1?"dependencies":"dependency")+": "+li(Array.from(x).sort().map(D=>"'"+dt(D)+"'"))+`. Either ${O} ${x.size>1?"them":"it"} or remove the dependency array.`}let ge="";if(et.size>0){let x=null;if(Array.from(et.keys()).forEach(A=>{x===null&&A.endsWith(".current")&&(x=A)}),x!==null)ge=` Mutable values like '${x}' aren't valid dependencies because mutating them doesn't re-render the component.`;else if(He.size>0){let A=Array.from(He)[0];E.set.has(A)||(ge=` Outer scope values like '${A}' aren't valid dependencies because mutating them doesn't re-render the component.`)}}if(!ge&&ke.has("props")){let x=q.get("props");if(x==null)return;let A=x.references;if(!Array.isArray(A))return;let F=!0;for(let O=0;O<A.length;O++){let D=A[O],N=xt(w.block,D.identifier);if(!N){F=!1;break}let $=N.parent;if($==null){F=!1;break}if($.type!=="MemberExpression"&&$.type!=="OptionalMemberExpression"){F=!1;break}}F&&(ge=` 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(b)}.`)}if(!ge&&ke.size>0){let x=null;ke.forEach(A=>{if(x)return;let F=w.set.get(A),O=q.get(A);if(O.references[0].resolved!==F)return;let D=F.defs[0];if(D==null||D.name==null||D.type!=="Parameter")return;let N=!1,$;for(let _=0;_<O.references.length;_++)if($=O.references[_].identifier,$!=null&&$.parent!=null&&($.parent.type==="CallExpression"||$.parent.type==="OptionalCallExpression")&&$.parent.callee===$){N=!0;break}N&&(x=A)}),x!==null&&(ge=` If '${x}' changes too often, find the parent component that defines it and wrap that definition in useCallback.`)}if(!ge&&ke.size>0){let x=null;if(ke.forEach(A=>{if(x!==null)return;let O=q.get(A).references,D,N;for(let $=0;$<O.length;$++){for(D=O[$].identifier,N=D.parent;N!=null&&N!==w.block;){if(N.type==="CallExpression"){let _=c.get(N.callee);if(_!=null){if(_.name===A)x={missingDep:A,setter:N.callee.name,form:"updater"};else if(m.has(D))x={missingDep:A,setter:N.callee.name,form:"reducer"};else{let ye=O[$].resolved;if(ye!=null){let Ae=ye.defs[0];Ae!=null&&Ae.type==="Parameter"&&(x={missingDep:A,setter:N.callee.name,form:"inlineReducer"})}}break}}N=N.parent}if(x!==null)break}}),x!==null)switch(x.form){case"reducer":ge=` You can also replace multiple useState variables with useReducer if '${x.setter}' needs the current value of '${x.missingDep}'.`;break;case"inlineReducer":ge=` If '${x.setter}' needs the current value of '${x.missingDep}', you can also switch to useReducer instead of useState and read '${x.missingDep}' in the reducer.`;break;case"updater":ge=` You can also do a functional update '${x.setter}(${x.missingDep.slice(0,1)} => ...)' if you only need '${x.missingDep}' in the '${x.setter}' call.`;break;default:throw new Error("Unknown case.")}}p({node:T,message:`React Hook ${r(b)} has `+(gt(ke,"a","missing","include")||gt(et,"an","unnecessary","exclude")||gt(xn,"a","duplicate","omit"))+ge,suggest:[{desc:`Update the dependencies array to be: [${tt.map(dt).join(", ")}]`,fix(x){return x.replaceText(T,`[${tt.map(dt).join(", ")}]`)}}]})}function S(f){let T=ai(f.callee,i);if(T===-1)return;let b=f.arguments[T],h=f.callee,I=Ln(h).name,E=f.arguments[T+1],C=/Effect($|[^a-z])/g.test(I);if(!b){p({node:h,message:`React Hook ${I} requires an effect callback. Did you forget to pass a callback to the hook?`});return}if(!(n&&!C)){if(!E&&!C){(I==="useMemo"||I==="useCallback")&&p({node:h,message:`React Hook ${I} does nothing when called with only one argument. Did you forget to pass an array of dependencies?`});return}switch(b.type){case"FunctionExpression":case"ArrowFunctionExpression":g(b,E,h,I,C);return;case"Identifier":if(!E||E.elements&&E.elements.some(L=>L&&L.type==="Identifier"&&L.name===b.name))return;let w=t(f).set.get(b.name);if(w==null||w.defs==null)return;let R=w.defs[0];if(!R||!R.node||R.type!=="Variable"&&R.type!=="FunctionName")break;switch(R.node.type){case"FunctionDeclaration":g(R.node,E,h,I,C);return;case"VariableDeclarator":let L=R.node.init;if(!L)break;switch(L.type){case"ArrowFunctionExpression":case"FunctionExpression":g(L,E,h,I,C);return}break}break;default:p({node:h,message:`React Hook ${I} received a function whose dependencies are unknown. Pass an inline function instead.`});return}p({node:h,message:`React Hook ${I} has a missing dependency: '${b.name}'. Either include it or remove the dependency array.`,suggest:[{desc:`Update the dependencies array to be: [${b.name}]`,fix(w){return w.replaceText(E,`[${b.name}]`)}}]})}}if(e.options[0]?.ignoreIfReactCompilerIsEnabled){for(let f of e.sourceCode.getAllComments())if(si.test(f.value))return n=!0,{CallExpression:T=>S(T,!0)}}return{CallExpression:f=>S(f)}}};function Et({dependencies:e,declaredDependencies:n,stableDependencies:r,externalDependencies:t,isEffect:o}){let a=i();function i(){return{isUsed:!1,isSatisfiedRecursively:!1,isSubtreeUsed:!1,children:new Map}}e.forEach((g,S)=>{let f=p(a,S);f.isUsed=!0,l(a,S,T=>{T.isSubtreeUsed=!0})}),n.forEach(({key:g})=>{let S=p(a,g);S.isSatisfiedRecursively=!0}),r.forEach(g=>{let S=p(a,g);S.isSatisfiedRecursively=!0});function p(g,S){let f=S.split("."),T=g;for(let b of f){let h=T.children.get(b);h||(h=i(),T.children.set(b,h)),T=h}return T}function l(g,S,f){let T=S.split("."),b=g;for(let h of T){let I=b.children.get(h);if(!I)return;f(I),b=I}}let c=new Set,m=new Set;d(a,c,m,g=>g);function d(g,S,f,T){g.children.forEach((b,h)=>{let I=T(h);if(b.isSatisfiedRecursively){b.isSubtreeUsed&&f.add(I);return}if(b.isUsed){S.add(I);return}d(b,S,f,E=>I+"."+E)})}let s=[],u=new Set,y=new Set;return n.forEach(({key:g})=>{m.has(g)?s.indexOf(g)===-1?s.push(g):y.add(g):u.add(g)}),c.forEach(g=>{s.push(g)}),{suggestedDependencies:s,unnecessaryDependencies:u,duplicateDependencies:y,missingDependencies:c}}function Pe(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 Pe(e.consequent)!=null||Pe(e.alternate)!=null?"conditional":null;case"LogicalExpression":return Pe(e.left)!=null||Pe(e.right)!=null?"logical expression":null;case"JSXFragment":return"JSX fragment";case"JSXElement":return"JSX element";case"AssignmentExpression":return Pe(e.right)!=null?"assignment expression":null;case"NewExpression":return"object construction";case"Literal":return e.value instanceof RegExp?"regular expression":null;case"TypeCastExpression":return Pe(e.expression);case"TSAsExpression":return Pe(e.expression)}return null}function oi({declaredDependencies:e,declaredDependenciesNode:n,componentScope:r,scope:t}){let o=e.map(({key:i})=>{let p=r.variables.find(c=>c.name===i);if(p==null)return null;let l=p.defs[0];if(l==null)return null;if(l.type==="Variable"&&l.node.type==="VariableDeclarator"&&l.node.id.type==="Identifier"&&l.node.init!=null){let c=Pe(l.node.init);if(c!=null)return[p,c]}return l.type==="FunctionName"&&l.node.type==="FunctionDeclaration"?[p,"function"]:l.type==="ClassName"&&l.node.type==="ClassDeclaration"?[p,"class"]:null}).filter(Boolean);function a(i){let p=!1;for(let l=0;l<i.references.length;l++){let c=i.references[l];if(c.writeExpr){if(p)return!0;p=!0;continue}let m=c.from;for(;m!==t&&m!=null;)m=m.upper;if(m!==t&&!jn(n,c.identifier))return!0}return!1}return o.map(([i,p])=>({construction:i.defs[0],depType:p,isUsedOutsideOfHook:a(i)}))}function Dn(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)?Dn(e.parent):e.type==="MemberExpression"&&e.parent&&e.parent.type==="AssignmentExpression"&&e.parent.left===e?e.object:e}function bt(e,n,r){n&&(e.optional?n.has(r)||n.set(r,!0):n.has(r)||n.set(r,!1))}function Ie(e,n){if(e.type==="Identifier"||e.type==="JSXIdentifier"){let r=e.name;return n&&n.set(r,!1),r}else if(e.type==="MemberExpression"&&!e.computed){let r=Ie(e.object,n),t=Ie(e.property,null),o=`${r}.${t}`;return bt(e,n,o),o}else if(e.type==="OptionalMemberExpression"&&!e.computed){let r=Ie(e.object,n),t=Ie(e.property,null),o=`${r}.${t}`;return bt(e,n,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 t=Ie(r.object,n),o=Ie(r.property,null),a=`${t}.${o}`;return bt(r,n,a),a}else throw new Error(`Unsupported node type: ${e.type}`)}function Ln(e,n){return e.type==="MemberExpression"&&e.object.type==="Identifier"&&e.object.name==="React"&&e.property.type==="Identifier"&&!e.computed?e.property:e}function ai(e,n){let r=Ln(e);if(r.type!=="Identifier")return-1;switch(r.name){case"useEffect":case"useLayoutEffect":case"useCallback":case"useMemo":return 0;case"useImperativeHandle":return 1;default:if(r===e&&n&&n.additionalHooks){let t;try{t=Ie(r,null)}catch(o){if(/Unsupported node type/.test(o.message))return 0;throw o}return n.additionalHooks.test(t)?0:-1}else return-1}}function xt(e,n){let r=[e],t=null;for(;r.length;){if(t=r.shift(),pi(t,n))return t;if(jn(t,n))for(let[o,a]of Object.entries(t))o!=="parent"&&(On(a)?(a.parent=t,r.push(a)):Array.isArray(a)&&a.forEach(i=>{On(i)&&(i.parent=t,r.push(i))}))}return null}function li(e){let n="";for(let r=0;r<e.length;r++)n+=e[r],r===0&&e.length===2?n+=" and ":r===e.length-2&&e.length>2?n+=", and ":r<e.length-1&&(n+=", ");return n}function On(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&typeof e.type=="string"}function pi(e,n){return(e.type==="Identifier"||e.type==="JSXIdentifier")&&e.type===n.type&&e.name===n.name&&e.range[0]===n.range[0]&&e.range[1]===n.range[1]}function jn(e,n){return e.range[0]<=n.range[0]&&e.range[1]>=n.range[1]}function ci(e){return!1}var G=require("@typescript-eslint/utils"),ne=Se(require("typescript")),Un=require("zod/v4");var Ct=require("@typescript-eslint/utils");function Ue(e,n,r=1/0){if(r!==0&&e.parent)return e.type===n?e:Ue(e.parent,n,r===1/0?r:r-1)}function*At(e){yield e,e.parent&&(yield*At(e.parent))}function It(e,n){for(let r of e){let t=n(r);if(t!=null&&t!==!1)return t}}function $n(e,n,r){let o=r.getDeclaredVariables(e).find(a=>a.name===n||a.identifiers[0]?.parent.type===Ct.AST_NODE_TYPES.Property&&a.identifiers[0].parent.key.type===Ct.AST_NODE_TYPES.Identifier&&a.identifiers[0].parent.key.name===n);return o?o.references.filter(a=>!a.init):[]}function Mn(e){return e===null||typeof e!="object"||!("type"in e)?!1:typeof e.type=="string"}function ui(e,n){return e[n]}function Oe(e,n,r){let t=r.visitorKeys,o=new Set;function a(i){if(o.has(i))return!1;if(o.add(i),n(i)===!0)return!0;let l=t[i.type];if(l)for(let c of l){let m=ui(i,c);if(m){if(Array.isArray(m)){for(let d of m)if(Mn(d)&&a(d))return!0}else if(Mn(m)&&a(m))return!0}}return!1}a(e)}var fi=G.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),_n="improved-no-unnecessary-condition",mi=Un.z.object({}),yi=["string","number","bigint","boolean","symbol","undefined","object","function","never"],di=new Set(yi),Rt={name:_n,rule:fi({name:_n,meta:{type:"suggestion",docs:{description:"Extends checks of `no-unnecessary-condition` rule"},messages:{unnecessaryTypeofCondition:'This condition is unnecessary. The type of "{{name}}" is always "{{type}}".',alwaysFalseTypeofCondition:'This condition will always be false. The type of "{{name}}" is "{{actualType}}" so the condition has no overlap with "{{conditionType}}".',unnecessaryStartsWithCondition:"This startsWith check is unnecessary as it always evaluates to true.",alwaysFalseStartsWithCondition:"This startsWith check will always be false.",unnecessaryEndsWithCondition:"This endsWith check is unnecessary as it always evaluates to true.",alwaysFalseEndsWithCondition:"This endsWith check will always be false.",unnecessaryIncludesCondition:"This includes check is unnecessary as it always evaluates to true.",alwaysFalseIncludesCondition:"This includes check will always be false.",unnecessaryLengthCondition:"This length comparison is unnecessary as it always evaluates to true.",alwaysFalseLengthCondition:"This length comparison will always be false."},schema:[j(mi)]},defaultOptions:[{}],create(e){let n=G.ESLintUtils.getParserServices(e,!0),r=n.program?.getTypeChecker();if(!r||!n.program)throw new Error("TypeScript services or program not available");function t(s){return s.type===G.AST_NODE_TYPES.UnaryExpression&&s.operator==="typeof"}function o(s){return s.flags&ne.default.TypeFlags.Any||s.flags&ne.default.TypeFlags.Unknown?null:s.flags&ne.default.TypeFlags.StringLike?["string"]:s.flags&ne.default.TypeFlags.NumberLike?["number"]:s.flags&ne.default.TypeFlags.BigIntLike?["bigint"]:s.flags&ne.default.TypeFlags.BooleanLike?["boolean"]:s.flags&ne.default.TypeFlags.ESSymbolLike?["symbol"]:s.flags&ne.default.TypeFlags.Undefined||s.flags&ne.default.TypeFlags.Void?["undefined"]:s.flags&ne.default.TypeFlags.Null?["object"]:s.getCallSignatures().length>0?["function"]:s.flags&ne.default.TypeFlags.Object?s.getProperties().length===0?["string","number","bigint","boolean","symbol","object","function"]:["object"]:s.flags&ne.default.TypeFlags.NonPrimitive?["object"]:s.flags&ne.default.TypeFlags.Never?["never"]:null}function a(s){if(!r)return null;let u=n.esTreeNodeToTSNodeMap.get(s),y=r.getTypeAtLocation(u.expression);if(y.flags&ne.default.TypeFlags.Any||y.flags&ne.default.TypeFlags.Unknown)return null;let g=[];if(y.isUnion()){for(let f of y.types){let T=o(f);if(T)g.push(...T);else return null}return g}let S=o(y);return S?(g.push(...S),g):null}function i(s){if(!(s.operator==="==="||s.operator==="!=="))return;let y=null,g=null;if(t(s.left)?(y=s.left,g=s.right.type===G.AST_NODE_TYPES.Literal&&typeof s.right.value=="string"?s.right.value:null):t(s.right)&&(y=s.right,g=s.left.type===G.AST_NODE_TYPES.Literal&&typeof s.left.value=="string"?s.left.value:null),!y||!g||!gi(g,di))return;let S=a(y);if(!S)return;let f=s.operator==="!==",T=S.includes(g);S.length===1?T&&!f?e.report({node:s,messageId:"unnecessaryTypeofCondition",data:{name:We(y,e),type:g}}):!T&&f?e.report({node:s,messageId:"unnecessaryTypeofCondition",data:{name:We(y,e),type:Array.from(S)[0]}}):!T&&!f?e.report({node:s,messageId:"alwaysFalseTypeofCondition",data:{name:We(y,e),actualType:rt(S),conditionType:g}}):T&&f&&e.report({node:s,messageId:"alwaysFalseTypeofCondition",data:{name:We(y,e),actualType:rt(S),conditionType:g}}):!T&&!f?e.report({node:s,messageId:"alwaysFalseTypeofCondition",data:{name:We(y,e),actualType:rt(S),conditionType:g}}):!T&&f&&e.report({node:s,messageId:"unnecessaryTypeofCondition",data:{name:We(y,e),type:rt(S)}})}function p(s){if(s.flags&ne.default.TypeFlags.Any||s.flags&ne.default.TypeFlags.Unknown)return null;if(s.isUnion()){let u=[];for(let y of s.types)if(y.flags&ne.default.TypeFlags.StringLiteral){let g=y.value;u.push(g)}else return null;return u}return s.flags&ne.default.TypeFlags.StringLiteral?[s.value]:null}function l(s){if(!r)return null;let u=n.esTreeNodeToTSNodeMap.get(s),y=r.getTypeAtLocation(u),g=p(y);if(g)return g;let S=r.getSymbolAtLocation(u);if(S){let f=r.getTypeOfSymbolAtLocation(S,u),T=p(f);if(T)return T}return null}function c(s){let u=e.sourceCode.ast,y=null;return Oe(u,g=>{if(g.type===G.AST_NODE_TYPES.VariableDeclarator&&g.id.type===G.AST_NODE_TYPES.Identifier&&g.id.name===s.name&&g.id.typeAnnotation){let S=g.id.typeAnnotation.typeAnnotation;if(S.type===G.AST_NODE_TYPES.TSUnionType){let f=[];for(let T of S.types)if(T.type===G.AST_NODE_TYPES.TSLiteralType&&T.literal.type===G.AST_NODE_TYPES.Literal&&typeof T.literal.value=="string")f.push(T.literal.value);else return!0;return y=f,!0}if(S.type===G.AST_NODE_TYPES.TSLiteralType&&S.literal.type===G.AST_NODE_TYPES.Literal&&typeof S.literal.value=="string")return y=[S.literal.value],!0}return!1},e.sourceCode),y}function m(s){if(s.callee.type!==G.AST_NODE_TYPES.MemberExpression||s.callee.property.type!==G.AST_NODE_TYPES.Identifier||s.callee.computed)return;let u=s.callee.property.name;if(u!=="startsWith"&&u!=="endsWith"&&u!=="includes"||s.arguments.length!==1)return;let[y]=s.arguments;if(!y||y.type!==G.AST_NODE_TYPES.Literal||typeof y.value!="string")return;let g=s.callee.object,S=l(g);if(!S&&g.type===G.AST_NODE_TYPES.Identifier&&(S=c(g)),!S||S.length===0)return;let f=y.value;if(u==="includes"&&S.length>1)return;let T=0,b=0;for(let h of S)if((u==="startsWith"?h.startsWith(f):u==="endsWith"?h.endsWith(f):h.includes(f))?T++:b++,T>0&&b>0)return;if(T>0&&b===0){let h=u==="startsWith"?"unnecessaryStartsWithCondition":u==="endsWith"?"unnecessaryEndsWithCondition":"unnecessaryIncludesCondition";e.report({node:s,messageId:h})}else if(b>0&&T===0){let h=u==="startsWith"?"alwaysFalseStartsWithCondition":u==="endsWith"?"alwaysFalseEndsWithCondition":"alwaysFalseIncludesCondition";e.report({node:s,messageId:h})}}function d(s){if(!new Set(["===","!==",">",">=","<","<="]).has(s.operator))return;function y(I){if(I.type!==G.AST_NODE_TYPES.MemberExpression||I.computed||I.property.type!==G.AST_NODE_TYPES.Identifier||I.property.name!=="length")return null;let E=I.object,C=l(E);if(!C||C.length===0)return null;let w=[];for(let R of C)w.push(R.length);return{values:w}}let g=y(s.left),S=y(s.right),f=null,T=null;if(g?s.right.type===G.AST_NODE_TYPES.Literal&&typeof s.right.value=="number"&&(f=g.values,T=s.right.value):S&&s.left.type===G.AST_NODE_TYPES.Literal&&typeof s.left.value=="number"&&(f=S.values,T=s.left.value),!f||T===null)return;let b=0,h=0;for(let I of f){let E=!1;if(s.operator==="==="?E=I===T:s.operator==="!=="?E=I!==T:s.operator===">"?E=I>T:s.operator===">="?E=I>=T:s.operator==="<"?E=I<T:s.operator==="<="&&(E=I<=T),E?b++:h++,b>0&&h>0)return}b>0&&h===0?e.report({node:s,messageId:"unnecessaryLengthCondition"}):h>0&&b===0&&e.report({node:s,messageId:"alwaysFalseLengthCondition"})}return{BinaryExpression(s){i(s),d(s)},CallExpression:m}}})};function rt(e){return Array.from(new Set(e)).join(" | ")||"never"}function We(e,n){let r=e.argument;return r.type===G.AST_NODE_TYPES.Identifier?r.name:n.sourceCode.getText(r)}function gi(e,n){return n.has(e)}var st=require("@typescript-eslint/utils"),it=require("zod/v4");var Si=st.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),Wn="no-call-with-explicit-generics",Ti=it.z.object({functions:it.z.array(it.z.string())}),hi=Si({name:Wn,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(Ti)]},defaultOptions:[{functions:[]}],create(e,[n]){let r=new Set(n.functions);return{CallExpression(t){let{callee:o}=t;o.type===st.AST_NODE_TYPES.Identifier&&r.has(o.name)&&t.typeArguments&&e.report({node:t,messageId:"noExplicitGenerics",data:{functionName:o.name}})}}}}),wt={name:Wn,rule:hi};var je=require("@typescript-eslint/utils"),Ei=je.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),zn="no-call-with-inferred-generics",bi=Ei({name:zn,meta:{type:"problem",docs:{description:"Disable calling configured functions with infered generics"},messages:{missingGenericDeclaration:"Function '{{ functionName }}' should be called with at least {{ minGenerics }} generic(s) (ex: `fn<Generic>()`) defined",anyUsedInGenerics:"Function '{{ functionName }}' should not be called with 'any' in generics"},schema:[{type:"object",properties:{functions:{type:"array",items:{type:"object",properties:{name:{type:"string"},minGenerics:{type:"number"},allowAny:{type:"boolean"},disallowTypes:{type:"array",items:{type:"string"}}},required:["name"]}},anyAliases:{type:"array",items:{type:"string"}}},required:["functions"]}]},defaultOptions:[{functions:[]}],create(e,[n]){let r=new Map(n.functions.map(t=>[t.name,t]));return{CallExpression(t){let{callee:o}=t;if(o.type!==je.AST_NODE_TYPES.Identifier)return;let a=r.get(o.name);if(!a)return;let{minGenerics:i=1,allowAny:p,disallowTypes:l=n.disallowTypes}=a;(t.typeArguments?.params.length||0)<(i||0)&&e.report({node:t,messageId:"missingGenericDeclaration",data:{functionName:o.name,minGenerics:i||0}}),!(p&&!l)&&t.typeArguments?.params.some(m=>!p&&m.type===je.AST_NODE_TYPES.TSAnyKeyword||l&&m.type===je.AST_NODE_TYPES.TSTypeReference&&m.typeName.type===je.AST_NODE_TYPES.Identifier&&l.includes(m.typeName.name))&&e.report({node:t,messageId:"anyUsedInGenerics",data:{functionName:o.name}})}}}}),vt={name:zn,rule:bi};var Xn=require("@typescript-eslint/utils"),xi=Xn.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),Hn="no-commented-out-code",Ci=["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:"],Ai=/^\s*return\s+/,Ii=/\w=("|'|`)/,Ri=/\w+:\s*('|"|`)/,wi=/\[['"][^'"]*['"]\]:\s*('|"|`|[^'"`\s])/,vi=/\w+-\w+:/,ki=/\w+_\w+:/,Fi=/\?\s+\w/,Pi=/:\s+\w/,Oi=/^\s*('|"|`)[^'"]*('|"|`),?\s*$/,Ni=/^\s*\d+[,}]/,Di=/^\s*\[[^\]]*\][,}]/,Li=/^\s*\{[^}]*\}[,}]/,ji=/\.\w+\(/,Mi=/\[\w+\]/,$i=/^\s*(['"`]).+?\1\s*:/,_i=/^<[A-Z]\w*(\s|>|\/)/,Ui=/^<[a-z]+(\s|>|\/)/,Wi=/<[A-Z]\w*(\s.*)?>/,zi=/<\/[A-Z]\w*>/,Ji=/<[a-z]+(\s.*)?>/,Vi=/<\/[a-z]+>/,Xi=/^\s*[*\s]*$/,Hi=/^[a-zA-Z]/,Bi=/^[A-Z][A-Za-z]*(?:\s+\d+)?(?:\s+[a-z]+)*:\s+[A-Za-z]/,Yi=/```[\s\S]*?```/g,qi=/`[^`]*`/g,Jn=/[a-zA-Z0-9]/,Zi=/\.[A-Za-z_][A-Za-z0-9_]*\(/,Gi=/[{}[\]()`=<>]/,Ki=/:\s*(['"`[{(]|\w+\s*=>)/,Qi=/\bif\s*\(|\belse\b|=>/,Q={returnStatement:Ai,stringAssignment:Ii,objectPropertyWithQuotes:Ri,computedPropertyAssignment:wi,kebabCaseProperty:vi,snakeCaseProperty:ki,ternaryOperator:Fi,colonWithWord:Pi,quotedString:Oi,numberWithComma:Ni,arrayWithComma:Di,objectWithComma:Li,methodCall:ji,arrayAccess:Mi,quotedPropertyKey:$i,jsxSelfClosing:_i,jsxElement:Ui,jsxOpeningTag:Wi,jsxClosingTag:zi,htmlOpeningTag:Ji,htmlClosingTag:Vi,jsdocComment:Xi};function es(e){if(e.includes(":")){let r=e.split(":")[0]?.trim();if(r&&Hi.test(r)&&r.includes(" "))return!0}let n=e.trim();return n.length===0||Zi.test(n)||Gi.test(n)||Ki.test(n)||Qi.test(n)?!1:!!(n.includes(":")&&Bi.test(n))}var ts=[") {","return;",Q.returnStatement,"if (","else {","else if (","/>","</","< ","},",": {"," } = ","={",Q.stringAssignment,");",Q.objectPropertyWithQuotes,Q.computedPropertyAssignment,Q.kebabCaseProperty,Q.snakeCaseProperty,"&&","||","()",Q.ternaryOperator,Q.colonWithWord,Q.quotedString,Q.numberWithComma,Q.arrayWithComma,Q.objectWithComma,Q.methodCall,Q.arrayAccess,"?.(","??","=>",Q.quotedPropertyKey],ns=["/>","</",Q.jsxSelfClosing,Q.jsxElement,Q.jsxOpeningTag,Q.jsxClosingTag,Q.htmlOpeningTag,Q.htmlClosingTag],Vn=["INFO:","TODO:","DOCS:","FIX:","FIXME:","HACK:","NOTE:","WARNING:","WARN:","BUG:","ISSUE:","TEMP:","TEMPORARY:","XXX:","REVIEW:","eslint"],rs=xi({name:Hn,meta:{type:"problem",docs:{description:"Disallow commented code"},messages:{commentedOutCode:"Commented code is not allowed. Detected pattern: `{{ wrongPattern }}` Use a comment starting with one of these prefixes if you want to keep this code commented out: {{ allowedPrefixes }}"},schema:[]},defaultOptions:[],create(e){function n(t,o){if(t.startsWith("/"))return!1;let a=t.trimStart();if(t.startsWith("*")||a.startsWith("eslint-disable")||t.includes("@deprecated")||t.includes("@example")||t.includes("@param")||t.includes("@returns")||t.includes("@throws")||t.includes("typescript-eslint")||t.includes("@ts-")||t.includes("prettier-ignore")||Q.jsdocComment.test(t))return!1;for(let i of Vn)if(a.startsWith(i))return!1;if(t.includes("https://")||es(a))return!1;if(o==="Block"){for(let i of ns)if(typeof i=="string"){if(t.includes(i))return{wrongPattern:i}}else if(i.test(t))return{wrongPattern:`regex(${i.toString()})`};return!1}for(let i of Ci)if(a.startsWith(i))return{wrongPattern:i};for(let i of ts)if(typeof i=="string"){if(t.includes(i))return{wrongPattern:i}}else if(i.test(t))return{wrongPattern:`regex(${i.toString()})`};return!1}function r(t,o){let a=t,i=a.trim();if(i.startsWith("`")&&(i.endsWith("`,")||i.endsWith("`;")||i.endsWith("`")))return a;if(o==="Block"&&a.includes("```")){let c=a.split(Yi);c.some(d=>Jn.test(d))&&(a=c.join(""))}if(!a.includes("`"))return a;let p=a.split(qi);return p.some(c=>Jn.test(c))?p.join(""):a}return{Program(){let o=e.sourceCode.getAllComments();for(let a of o){let i=r(a.value,a.type),p=n(i,a.type);p&&e.report({node:a,messageId:"commentedOutCode",data:{wrongPattern:p.wrongPattern,allowedPrefixes:Vn.join(", ")}})}}}}}),kt={name:Hn,rule:rs};var ot=require("@typescript-eslint/utils"),is=ot.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),Bn="no-default-export",ss=is({name:Bn,meta:{type:"problem",docs:{description:"Disallow default exports"},schema:[],messages:{noDefaultExport:"Default exports are not allowed, use named exports instead."}},defaultOptions:[],create(e){return{ExportDefaultDeclaration(n){e.report({node:n,messageId:"noDefaultExport"})},ExportNamedDeclaration(n){for(let r of n.specifiers)r.exported.type===ot.TSESTree.AST_NODE_TYPES.Identifier&&r.exported.name==="default"&&e.report({node:n,messageId:"noDefaultExport"})}}}}),Ft={name:Bn,rule:ss};var Yn=require("@typescript-eslint/utils"),os=Yn.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),qn="no-leaked-text-in-jsx",as=[",",";","[","]","(",")"],ls=os({name:qn,meta:{type:"problem",docs:{description:"Prevents leaking of text in JSX that should be wrapped in an expression container"},messages:{leakedTextInJSX:'Text "{{ text }}" should be wrapped in a JSX expression container.'},schema:[],fixable:"code"},defaultOptions:[],create(e){return{JSXText(n){let r=n.value.trim();if(!r)return;let t="";as.includes(r)?t=r:r.includes("&&")?t="&&":r.includes("||")?t="||":r.endsWith("? (")&&(t="? ("),t&&e.report({node:n,messageId:"leakedTextInJSX",data:{text:t}})}}}}),Pt={name:qn,rule:ls};var Ne=require("@typescript-eslint/utils"),ps=Ne.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),Gn="no-non-camel-case-functions",cs=/^(\$?[a-z][a-zA-Z0-9]*)$/;function Zn(e){if(e.typeName.type!==Ne.AST_NODE_TYPES.TSQualifiedName)return!1;let{left:n,right:r}=e.typeName;return n.type===Ne.AST_NODE_TYPES.Identifier&&n.name==="JSX"&&r.name==="Element"}var us=ps({name:Gn,meta:{type:"suggestion",docs:{description:"Enforce camelCase naming convention for function declarations"},schema:[],messages:{nonCamelCaseFunction:'Function name "{{functionName}}" should be in camelCase format. If this fn is a React component and can\'t use the `FC` type, add a explicit "JSX.Element" return type to it'}},defaultOptions:[],create(e){return{FunctionDeclaration(n){if(n.id&&!cs.test(n.id.name)){let r=n.returnType?.typeAnnotation;if(r&&(r.type===Ne.AST_NODE_TYPES.TSTypeReference?Zn(r):r.type===Ne.AST_NODE_TYPES.TSUnionType&&r.types.some(o=>o.type===Ne.AST_NODE_TYPES.TSTypeReference&&Zn(o))))return;e.report({node:n.id,messageId:"nonCamelCaseFunction",data:{functionName:n.id.name}})}}}}}),Ot={name:Gn,rule:us};var H=require("@typescript-eslint/utils");var fs=H.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),Kn="no-optional-root-props",ms=fs({name:Kn,meta:{type:"problem",docs:{description:"Prevents usage of optional properties at the root of a type if that type is a local type alias or interface referenced only once"},messages:{optionalNotAllowed:'Optional property "{{ propertyName }}" is not allowed on a local type used only once. Use `prop: undefined | ...` instead.',suggestion:"Use `prop: undefined | ...` instead."},hasSuggestions:!0,schema:[]},defaultOptions:[],create(e){function n(t){let a=e.sourceCode.getDeclaredVariables(t)[0];if(!a||a.references.length!==1)return!1;let i=a.references[0];if(!i)return!1;for(let p of At(i.identifier)){if("returnType"in p||p.type===H.TSESTree.AST_NODE_TYPES.ExportNamedDeclaration)return!1;let l=p.parent;if(!l)return!1;if(l.type===H.TSESTree.AST_NODE_TYPES.TSTypeParameterInstantiation&&l.parent.type===H.TSESTree.AST_NODE_TYPES.TSTypeReference&&l.parent.typeName.type===H.TSESTree.AST_NODE_TYPES.Identifier&&l.parent.typeName.name==="FC"){let m=Ue(l.parent.parent,H.TSESTree.AST_NODE_TYPES.VariableDeclaration,4);if(!m)return!1;let d=at(m,e.sourceCode);return d?!(d.parent.type===H.TSESTree.AST_NODE_TYPES.CallExpression&&d.parent.callee.type===H.TSESTree.AST_NODE_TYPES.Identifier&&d.parent.callee.name==="memo"):!1}if(p.type===H.TSESTree.AST_NODE_TYPES.AssignmentPattern)return!1;if(l.type===H.TSESTree.AST_NODE_TYPES.ArrowFunctionExpression){let c=Ue(l,H.TSESTree.AST_NODE_TYPES.VariableDeclaration);return c?!!at(c,e.sourceCode):!1}if(l.type===H.TSESTree.AST_NODE_TYPES.FunctionDeclaration)return!!at(l,e.sourceCode)}return!1}function r(t){t.key.type!==H.TSESTree.AST_NODE_TYPES.Identifier||!t.optional||e.report({node:t.key,messageId:"optionalNotAllowed",data:{propertyName:t.key.name},suggest:[{messageId:"suggestion",fix:o=>{let a=Ue(t,H.TSESTree.AST_NODE_TYPES.TSPropertySignature);if(!a)return null;let i=e.sourceCode.getText(a);return o.replaceText(a,i.replace("?:",": undefined |"))}}]})}return{TSTypeAliasDeclaration(t){if(t.typeAnnotation.type===H.TSESTree.AST_NODE_TYPES.TSTypeLiteral&&!(lt(t)||!n(t)))for(let o of t.typeAnnotation.members)o.type===H.TSESTree.AST_NODE_TYPES.TSPropertySignature&&r(o)},TSInterfaceDeclaration(t){if(!(lt(t)||!n(t)))for(let o of t.body.body)o.type===H.TSESTree.AST_NODE_TYPES.TSPropertySignature&&r(o)},TSTypeReference(t){if(t.typeName.type!==H.TSESTree.AST_NODE_TYPES.Identifier||t.typeName.name!=="FC"||!t.typeArguments?.params[0])return;let o=t.typeArguments.params[0];if(o.type!==H.TSESTree.AST_NODE_TYPES.TSTypeLiteral)return;let a=Ue(t.parent,H.TSESTree.AST_NODE_TYPES.VariableDeclaration,4);if(!a)return;let i=at(a,e.sourceCode);if(!(!i||i.parent.type===H.TSESTree.AST_NODE_TYPES.CallExpression&&i.parent.callee.type===H.TSESTree.AST_NODE_TYPES.Identifier&&i.parent.callee.name==="memo"))for(let l of o.members)l.type===H.TSESTree.AST_NODE_TYPES.TSPropertySignature&&r(l)}}}});function lt(e){return e?e.parent?.type===H.TSESTree.AST_NODE_TYPES.ExportNamedDeclaration||e.parent?.type===H.TSESTree.AST_NODE_TYPES.ExportDefaultDeclaration:!1}function at(e,n){if(lt(e))return;let r;if(e.type===H.TSESTree.AST_NODE_TYPES.VariableDeclaration){if(e.declarations.length!==1)return;e.declarations[0].id.type===H.TSESTree.AST_NODE_TYPES.Identifier&&(r=e.declarations[0].id)}else{if(!e.id)return;r=e.id}if(!r)return;let t=n.getScope(e);e.type===H.TSESTree.AST_NODE_TYPES.FunctionDeclaration&&t.upper&&(t=t.upper);let o=t.variables.find(i=>i.identifiers.includes(r));if(!o)return;let a=o.references.filter(i=>i.identifier!==r);if(!(a.length!==1||!a[0])&&!lt(a[0].identifier.parent.parent))return a[0].identifier}var Nt={name:Kn,rule:ms};var Be=require("@typescript-eslint/utils");var Ye=W({name:"no-reexport",meta:{type:"problem",docs:{description:"Disallow re-exports to prevent indirection"},schema:[],messages:{noReexport:"Re-exports are not allowed. Use direct exports only."}},defaultOptions:[],create(e){let n=new Set;function r(t){return t?t.type===Be.AST_NODE_TYPES.Identifier?n.has(t.name):t.type===Be.AST_NODE_TYPES.MemberExpression?r(t.object):!1:!1}return{ImportDeclaration(t){for(let o of t.specifiers)n.add(o.local.name)},ExportNamedDeclaration(t){if(t.source){e.report({node:t,messageId:"noReexport"});return}if(t.declaration?.type===Be.AST_NODE_TYPES.VariableDeclaration)for(let o of t.declaration.declarations)r(o.init)&&e.report({node:t,messageId:"noReexport"});t.specifiers.length>0&&e.report({node:t,messageId:"noReexport"})},ExportDefaultDeclaration(t){t.declaration.type===Be.AST_NODE_TYPES.Identifier&&n.has(t.declaration.name)&&e.report({node:t,messageId:"noReexport"})},ExportAllDeclaration(t){e.report({node:t,messageId:"noReexport"})}}}});var Qn=require("@typescript-eslint/utils"),pt=Se(require("path")),Re=require("zod/v4");var ys=Qn.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),er="no-relative-imports",ds=Re.z.object({find:Re.z.string(),replacement:Re.z.string()}),gs=Re.z.object({aliases:Re.z.array(ds),rootDir:Re.z.string().optional(),allowNotFoundAliases:Re.z.boolean().optional(),_dev_simulateFileName:Re.z.string().optional()}),Ss=ys({name:er,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(gs)]},defaultOptions:[{aliases:[],rootDir:void 0}],create(e,[n]){let r=n._dev_simulateFileName??e.filename;function t(i){return i.startsWith(".")||i.startsWith("..")}function o(i,p){let l=pt.default.dirname(p);return pt.default.resolve(l,i)}function a(i){let p=n.rootDir??process.cwd(),l=pt.default.relative(p,i);if(l.startsWith("."))return null;l.startsWith("/")||(l=`/${l}`);for(let{find:c,replacement:m}of n.aliases)if(l.startsWith(m)){let d=l.replace(m,c);return{alias:c,newPath:d}}return null}return{ImportDeclaration(i){let p=i.source.value;if(!t(p))return;let l=o(p,r),c=a(l);!c&&n.allowNotFoundAliases||e.report({node:i,messageId:c?"noRelativeImportsWithAlias":"noRelativeImports",data:{alias:c?.alias},fix:c?m=>m.replaceText(i.source,`'${c.newPath}'`):void 0})}}}}),Dt={name:er,rule:Ss};var ee=require("@typescript-eslint/utils"),Lt=require("zod/v4");var Ts=Lt.z.object({customMessage:Lt.z.string().optional()}),jt=W({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(Ts)],messages:{noStaticStyleProp:"Static style props are not allowed use css instead.{{customMessage}}"}},defaultOptions:[{}],create(e,[n]){function r(t){switch(t.type){case ee.AST_NODE_TYPES.Literal:return!0;case ee.AST_NODE_TYPES.ObjectExpression:return t.properties.every(o=>o.type===ee.AST_NODE_TYPES.Property?o.computed||o.value.type===ee.AST_NODE_TYPES.Identifier&&o.key.type===ee.AST_NODE_TYPES.Identifier&&o.key.name===o.value.name?!1:r(o.value):!1);case ee.AST_NODE_TYPES.ArrayExpression:return t.elements.every(o=>o?o.type===ee.AST_NODE_TYPES.SpreadElement?!1:r(o):!0);case ee.AST_NODE_TYPES.TemplateLiteral:return t.expressions.length===0;case ee.AST_NODE_TYPES.ConditionalExpression:case ee.AST_NODE_TYPES.LogicalExpression:case ee.AST_NODE_TYPES.BinaryExpression:case ee.AST_NODE_TYPES.UnaryExpression:case ee.AST_NODE_TYPES.CallExpression:case ee.AST_NODE_TYPES.MemberExpression:case ee.AST_NODE_TYPES.Identifier:case ee.AST_NODE_TYPES.ArrowFunctionExpression:case ee.AST_NODE_TYPES.FunctionExpression:return!1;default:return!1}}return{JSXAttribute(t){if(t.name.type===ee.AST_NODE_TYPES.JSXIdentifier&&t.name.name==="style"&&t.value){let o=null;t.value.type===ee.AST_NODE_TYPES.JSXExpressionContainer?t.value.expression.type!==ee.AST_NODE_TYPES.JSXEmptyExpression&&(o=t.value.expression):t.value.type===ee.AST_NODE_TYPES.Literal&&(o=t.value),o&&r(o)&&e.report({node:t,messageId:"noStaticStyleProp",data:{customMessage:n.customMessage?` ${n.customMessage}`:""}})}}}}});var qe=require("@typescript-eslint/utils"),Me=Se(require("zod/v4"));var hs=Me.object({alternativeMsgs:Me.object({inArrayFind:Me.string().optional(),inArrayFilter:Me.string().optional()}).optional(),__dev_simulateFileName:Me.string().optional()});function Es(e){return e.typeAnnotation.type!==qe.AST_NODE_TYPES.TSTypePredicate?!1:e.typeAnnotation.asserts===!1}var bs=/(typeGuards|type-guards)\.(ts|tsx)$/;function xs(e){return bs.test(e)}function Cs(e){let n=e.parent;for(;n;){if(n.type===qe.AST_NODE_TYPES.CallExpression&&n.callee.type===qe.AST_NODE_TYPES.MemberExpression&&n.callee.property.type===qe.AST_NODE_TYPES.Identifier){let r=n.callee.property.name;if(r==="filter"||r==="find")return{method:r}}n=n.parent}return null}var Mt=W({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(hs)],hasSuggestions:!0},defaultOptions:[{}],create(e,[n]){let r=n.__dev_simulateFileName??e.filename;if(xs(r))return{};function t(o){if(!Es(o))return;let a=Cs(o);if(n.alternativeMsgs&&a){let i=a.method==="filter"?n.alternativeMsgs.inArrayFilter:n.alternativeMsgs.inArrayFind;if(i){let p=a.method==="filter"?"useFilterWithTypeCheck":"useFindWithTypeCheck";e.report({node:o,messageId:p,data:{message:i}});return}}e.report({node:o,messageId:"typeGuardNotAllowed"})}return{"FunctionDeclaration > :matches(TSTypeAnnotation)":t,"ArrowFunctionExpression > :matches(TSTypeAnnotation)":t,"MethodDefinition > FunctionExpression > :matches(TSTypeAnnotation)":t}}});var $e=require("@typescript-eslint/utils");var As="no-unnecessary-async-on-jsx-props";function Is(e){if(e.body.type!==$e.AST_NODE_TYPES.BlockStatement)return!1;let n=e.body.body;if(n.length!==1)return!1;let r=n[0];return!r||r.type!==$e.AST_NODE_TYPES.ExpressionStatement?!1:r.expression.type===$e.AST_NODE_TYPES.AwaitExpression}var $t=W({name:As,meta:{type:"suggestion",fixable:"code",docs:{description:"Disallow unnecessary async/await in JSX props where a single await provides no benefit"},messages:{unnecessaryAsyncInJsxProp:"Unnecessary async/await in JSX prop. The single await expression provides no benefit here."},schema:[]},defaultOptions:[],create(e){function n(r){Is(r)&&e.report({node:r,messageId:"unnecessaryAsyncInJsxProp",fix(t){let o=e.sourceCode,a=[],i=o.getFirstToken(r,l=>l.value==="async");if(i){let l=o.getTokenAfter(i);l?a.push(t.replaceTextRange([i.range[0],l.range[0]],"")):a.push(t.remove(i))}function p(l){if(l.type===$e.AST_NODE_TYPES.AwaitExpression){let c=o.getFirstToken(l);if(c&&c.value==="await"){let m=o.getTokenAfter(c);m?a.push(t.replaceTextRange([c.range[0],m.range[0]],"")):a.push(t.remove(c))}}if(l.type===$e.AST_NODE_TYPES.BlockStatement)for(let c of l.body)p(c);else l.type===$e.AST_NODE_TYPES.ExpressionStatement&&p(l.expression)}return p(r.body),a}})}return{"JSXAttribute ArrowFunctionExpression[async=true]":n,"JSXAttribute FunctionExpression[async=true]":n}}});var we=require("@typescript-eslint/utils"),_t=Se(require("typescript")),ze=Se(require("zod/v4"));var Rs=we.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),tr="no-unnecessary-casting",ws=ze.default.object({additionalCastFunctions:ze.default.array(ze.default.object({name:ze.default.string(),expectedType:ze.default.enum(["string","number"])})).optional()}),Ut={name:tr,rule:Rs({name:tr,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(ws)],fixable:"code"},defaultOptions:[{}],create(e){let r=e.options[0].additionalCastFunctions||[],t=[{name:"Number",expectedType:"number"},{name:"String",expectedType:"string"},...r],o=we.ESLintUtils.getParserServices(e,!0),a=o.program?.getTypeChecker();if(!a||!o.program)throw new Error("TypeScript services or program not available");function i(m,d){switch(m.type){case we.AST_NODE_TYPES.Literal:return d==="number"?typeof m.value=="number":typeof m.value=="string";case we.AST_NODE_TYPES.TemplateLiteral:return d==="string";case we.AST_NODE_TYPES.UnaryExpression:return d==="number"?m.operator==="+"||m.operator==="-"||m.operator==="~":!1;default:return!1}}function p(m,d){return d==="number"?!!(m.flags&_t.TypeFlags.NumberLike):!!(m.flags&_t.TypeFlags.StringLike)}function l(m,d){return s=>s.replaceText(m,e.sourceCode.getText(d))}function c(m){if(!a||m.arguments.length!==1)return;let d=m.arguments[0];if(!d||d.type===we.AST_NODE_TYPES.SpreadElement)return;let{callee:s}=m;if(s.type!==we.AST_NODE_TYPES.Identifier)return;let u=s.name,y=t.find(S=>S.name===u);if(!y)return;if(i(d,y.expectedType)||p(a.getTypeAtLocation(o.esTreeNodeToTSNodeMap.get(d)),y.expectedType)){let S,f;u==="Number"?S="unnecessaryNumberCasting":u==="String"?S="unnecessaryStringCasting":(S="unnecessaryCustomCasting",f={name:y.name,type:y.expectedType}),e.report({node:m,messageId:S,...f?{data:f}:{},fix:l(m,d)})}}return{CallExpression:c}}})};var fe=require("@typescript-eslint/utils"),ct=Se(require("zod/v4"));var vs=ct.object({ignoreWithDescription:ct.string().optional()}),Wt=W({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(vs)]},defaultOptions:[{}],create(e,[n]){let r=e.getSourceCode(),t=r.ast;function o(l){let c=l.arguments[0];return c&&c.type===fe.AST_NODE_TYPES.Literal&&typeof c.value=="string"?c.value:null}function a(l){return!l||!n.ignoreWithDescription?!1:new RegExp(n.ignoreWithDescription).test(l)}function i(l){return l.length!==1?!1:t.body.filter(m=>{if(m.type===fe.AST_NODE_TYPES.ExpressionStatement){let d=m.expression;if(d.type===fe.AST_NODE_TYPES.CallExpression&&d.callee.type===fe.AST_NODE_TYPES.Identifier){let s=d.callee.name;return["test","it","beforeEach","afterEach","beforeAll","afterAll"].includes(s)}}return!1}).length===0}function p(l){let c=l.arguments[1];if(c&&(c.type===fe.AST_NODE_TYPES.FunctionExpression||c.type===fe.AST_NODE_TYPES.ArrowFunctionExpression)&&c.body.type===fe.AST_NODE_TYPES.BlockStatement){let m=c.body.body;return m.length===0?"":m.map(s=>r.text.slice(s.range[0],s.range[1])).join(`
16
16
 
17
- `)}return""}return{Program(){let l=[];for(let s of t.body)s.type===fe.AST_NODE_TYPES.ExpressionStatement&&s.expression.type===fe.AST_NODE_TYPES.CallExpression&&s.expression.callee.type===fe.AST_NODE_TYPES.Identifier&&s.expression.callee.name==="describe"&&s.expression.arguments.length===2&&l.push(s.expression);if(!i(l))return;let[p]=l;if(!p)return;let m=o(p);if(a(m))return;let d=t.body.find(s=>s.type===fe.AST_NODE_TYPES.ExpressionStatement&&s.expression===p);!d||d.type!==fe.AST_NODE_TYPES.ExpressionStatement||e.report({node:p,messageId:"unnecessaryDescribe",suggest:[{messageId:"removeDescribe",fix(s){let u=c(p);return u?s.replaceText(d,u):null}}]})}}}});var qe=require("@typescript-eslint/utils"),Ee=he(require("zod/v4"));var Rs=Ee.object({methods:Ee.union([Ee.array(Ee.string()),Ee.literal("array")])}),Wt=V({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(Rs)]},defaultOptions:[{methods:"array"}],create(e,[n]){let r=n.methods,t=new Set(["find","filter","map","forEach","some","every","reduce","findIndex","sort"]);function o(c){return Array.isArray(r)?r.includes(c):t.has(c)}function a(c){let{callee:l}=c;if(l.type===qe.AST_NODE_TYPES.MemberExpression){let p=l.property;if(p.type===qe.AST_NODE_TYPES.Identifier)return p.name}return null}function i(c,l){if(c.type!==qe.AST_NODE_TYPES.Identifier||!c.typeAnnotation)return;let p=l.parent;if(p.type===qe.AST_NODE_TYPES.CallExpression){let m=a(p);m&&o(m)&&p.arguments.indexOf(l)===0&&e.report({node:c.typeAnnotation,messageId:"unnecessaryTypeAnnotation",fix(s){return c.typeAnnotation?s.remove(c.typeAnnotation):null}})}}return{ArrowFunctionExpression(c){for(let l of c.params)i(l,c)},FunctionExpression(c){for(let l of c.params)i(l,c)}}}});var ue=require("@typescript-eslint/utils");var zt=V({name:"no-unused-obj-props",meta:{type:"suggestion",docs:{description:"Disallow unused properties when it is safe to remove them"},messages:{unusedObjectProperty:'The object property "{{name}}" is not being used',unusedReturnObjectProperty:'The object property "{{name}}" returned by this function is not being used'},schema:[]},defaultOptions:[],create(e){return{VariableDeclarator(n){if(n.id.type===ue.AST_NODE_TYPES.ObjectPattern||!n.init||n.init.type!==ue.AST_NODE_TYPES.ObjectExpression||n.id.type===ue.AST_NODE_TYPES.Identifier&&n.id.typeAnnotation||n.parent.parent.type===ue.AST_NODE_TYPES.ExportNamedDeclaration)return;let r=new Map;for(let i of n.init.properties)i.type===ue.AST_NODE_TYPES.Property&&i.key.type===ue.AST_NODE_TYPES.Identifier&&r.set(i.key.name,i);if(r.size===0||n.id.type!==ue.AST_NODE_TYPES.Identifier)return;let t=ws(n,e.sourceCode);if(t.length===0)return;let o=n.init.properties.some(i=>i.type!==ue.AST_NODE_TYPES.Property?!1:i.value.type===ue.AST_NODE_TYPES.FunctionExpression),a=new Set;for(let i of t){if(i.identifier.parent.type!==ue.AST_NODE_TYPES.MemberExpression)return;let c=i.identifier.parent;if(c.object!==i.identifier)return;if(c.computed)if(c.property.type===ue.AST_NODE_TYPES.Literal&&typeof c.property.value=="string")a.add(c.property.value);else return;else{if(c.property.type!==ue.AST_NODE_TYPES.Identifier)return;a.add(c.property.name)}if(c.parent.type===ue.AST_NODE_TYPES.CallExpression&&o)return}for(let[i,c]of r)a.has(i)||e.report({node:c,messageId:"unusedObjectProperty",data:{name:i}})}}}});function ws(e,n){let r=n.getDeclaredVariables(e);if(r.length!==1)return[];let t=r[0];return t?t.references.filter(o=>o.identifier!==e.id):[]}var W=require("@typescript-eslint/utils"),Jt=require("zod/v4");var vs=Jt.z.object({ignoreArgsMatching:Jt.z.string().optional()}),Vt=V({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(vs)]},defaultOptions:[{}],create(e,[n]){let r=[];function t(i){return n.ignoreArgsMatching?new RegExp(n.ignoreArgsMatching).test(i):!1}function o(i){return i.type===W.AST_NODE_TYPES.ExportNamedDeclaration||i.type===W.AST_NODE_TYPES.ExportDefaultDeclaration||i.parent?.type===W.AST_NODE_TYPES.ExportNamedDeclaration||i.parent?.type===W.AST_NODE_TYPES.ExportDefaultDeclaration}function a(i){let c=[];for(let l=0;l<i.length;l++){let p=i[l];if(!p||p.type!==W.AST_NODE_TYPES.Identifier)continue;let m=p.name;if(!t(m)){if(p.optional&&p.typeAnnotation&&p.typeAnnotation.typeAnnotation.type===W.AST_NODE_TYPES.TSTypeLiteral){let d=p.typeAnnotation.typeAnnotation,s=[];for(let u of d.members)u.type===W.AST_NODE_TYPES.TSPropertySignature&&u.key.type===W.AST_NODE_TYPES.Identifier&&s.push({name:u.key.name,optional:u.optional===!0});s.some(u=>u.optional)?c.push({param:p,index:l,name:m,isObjectParam:!0,objectProps:s}):c.push({param:p,index:l,name:m,isObjectParam:!1})}else if(p.optional)c.push({param:p,index:l,name:m,isObjectParam:!1});else if(p.typeAnnotation&&p.typeAnnotation.typeAnnotation.type===W.AST_NODE_TYPES.TSTypeLiteral){let d=p.typeAnnotation.typeAnnotation,s=[];for(let u of d.members)u.type===W.AST_NODE_TYPES.TSPropertySignature&&u.key.type===W.AST_NODE_TYPES.Identifier&&s.push({name:u.key.name,optional:u.optional===!0});s.some(u=>u.optional)&&c.push({param:p,index:l,name:m,isObjectParam:!0,objectProps:s})}}}return c}return{FunctionDeclaration(i){if(o(i))return;let c=a(i.params);c.length!==0&&r.push({node:i,declarationNode:i,optionalParams:c})},VariableDeclarator(i){if(i.id.type!==W.AST_NODE_TYPES.Identifier||!i.init||i.init.type!==W.AST_NODE_TYPES.ArrowFunctionExpression&&i.init.type!==W.AST_NODE_TYPES.FunctionExpression||o(i.parent.parent))return;let l=[...a(i.init.params)];if(i.id.typeAnnotation&&i.id.typeAnnotation.typeAnnotation.type===W.AST_NODE_TYPES.TSTypeReference){let p=i.id.typeAnnotation.typeAnnotation;if(p.typeName.type===W.AST_NODE_TYPES.Identifier&&p.typeName.name==="FC"){let m=p.typeArguments;if(m&&m.params.length===1){let d=m.params[0];if(d&&d.type===W.AST_NODE_TYPES.TSTypeLiteral){let s=[];for(let u of d.members)u.type===W.AST_NODE_TYPES.TSPropertySignature&&u.key.type===W.AST_NODE_TYPES.Identifier&&s.push({name:u.key.name,optional:u.optional===!0});s.some(u=>u.optional)&&l.push({param:i.id,index:0,name:"props",isObjectParam:!0,objectProps:s})}}}}l.length!==0&&r.push({node:i.init,declarationNode:i,optionalParams:l})},"Program:exit"(){for(let i of r){let l=e.sourceCode.getDeclaredVariables(i.declarationNode)[0];if(!l)continue;let p=l.references.filter(s=>s.identifier!==l.identifiers[0]);if(p.length===0)continue;let m=!1;for(let s of p){let u=s.identifier.parent;if(u.type===W.AST_NODE_TYPES.CallExpression&&s.identifier.type===W.AST_NODE_TYPES.Identifier&&u.arguments.includes(s.identifier)){m=!0;break}if(u.type===W.AST_NODE_TYPES.ReturnStatement){m=!0;break}if(u.type===W.AST_NODE_TYPES.Property&&u.parent.type===W.AST_NODE_TYPES.ObjectExpression&&u.parent.parent.type===W.AST_NODE_TYPES.ReturnStatement){m=!0;break}if(u.type===W.AST_NODE_TYPES.JSXExpressionContainer){m=!0;break}}if(m)continue;let d=[];for(let s of p){let u=s.identifier.parent;if(u.type===W.AST_NODE_TYPES.CallExpression&&u.callee===s.identifier){let y=u.arguments.length,g=u.arguments.some(f=>f.type===W.AST_NODE_TYPES.SpreadElement);if(g){m=!0;break}let S={argCount:y,hasSpread:g};for(let f of i.optionalParams)if(f.isObjectParam&&f.index<y){let T=u.arguments[f.index];if(T?.type===W.AST_NODE_TYPES.ObjectExpression){let b={};for(let h of T.properties)h.type===W.AST_NODE_TYPES.Property&&h.key.type===W.AST_NODE_TYPES.Identifier&&(b[h.key.name]=!0);S.objectArgs||(S.objectArgs=[]),S.objectArgs[f.index]=b}else if(T){m=!0;break}}d.push(S)}else if(u.type===W.AST_NODE_TYPES.JSXOpeningElement&&u.name===s.identifier){let y=u.attributes.some(S=>S.type===W.AST_NODE_TYPES.JSXSpreadAttribute);if(y){m=!0;break}let g={argCount:1,hasSpread:y};for(let S of i.optionalParams)if(S.isObjectParam&&S.index===0){let f={};for(let T of u.attributes)T.type===W.AST_NODE_TYPES.JSXAttribute&&T.name.type===W.AST_NODE_TYPES.JSXIdentifier&&(f[T.name.name]=!0);g.objectArgs||(g.objectArgs=[]),g.objectArgs[0]=f}d.push(g)}}if(!(m||d.length===0))for(let s of i.optionalParams)if(s.isObjectParam&&s.objectProps)for(let u of s.objectProps){if(!u.optional)continue;let y=!1;for(let g of d)if(g.objectArgs&&g.objectArgs[s.index]){let S=g.objectArgs[s.index];if(S&&S[u.name]){y=!0;break}}y||e.report({node:s.param,messageId:"unusedOptionalProp",data:{name:u.name}})}else{let u=!1;for(let y of d)if(y.argCount>s.index){u=!0;break}u||e.report({node:s.param,messageId:"unusedOptionalArg",data:{name:s.name}})}}}}}});var B=require("@typescript-eslint/utils"),De=require("zod/v4");var ks=De.z.object({selectors:De.z.array(De.z.object({name:De.z.string(),selectorProp:De.z.string().optional(),selectorArgPos:De.z.number().optional(),returnProp:De.z.string().optional()}))}),Fs=B.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),Qn="no-unused-selected-values",Xt={name:Qn,rule:Fs({name:Qn,meta:{type:"suggestion",docs:{description:"Disallow unused values in selector objects"},messages:{unusedSelectedValue:'The selected value "{{name}}" is not being used'},schema:[j(ks)]},defaultOptions:[{selectors:[]}],create(e,[n]){let{selectors:r=[]}=n,t=new Map(r.map(o=>[o.name,o]));return{VariableDeclarator(o){let a=null;if(o.init?.type===B.AST_NODE_TYPES.CallExpression&&(a=o.init),!a)return;let i=Os(a);if(!i)return;let c=t.get(i);if(!c)return;let l=Ps(a,c.selectorArgPos??0,c.selectorProp);if(!l)return;let p=Ns(l);if(!p)return;let m=er(p.properties,void 0);if(!m)return;if(o.id.type===B.AST_NODE_TYPES.ObjectPattern){let u=er(o.id.properties,c.returnProp);if(!u)return;for(let[y,g]of m)u.has(y)||e.report({node:g,messageId:"unusedSelectedValue",data:{name:y}});return}if(o.id.type!==B.AST_NODE_TYPES.Identifier||c.returnProp)return;let d=Ds(o,e.sourceCode);if(d.length===0)return;let s=new Set;for(let u of d){if(u.identifier.parent.type!==B.AST_NODE_TYPES.MemberExpression)return;let y=u.identifier.parent.property;if(y.type!==B.AST_NODE_TYPES.Identifier)return;s.add(y.name)}for(let[u,y]of m)s.has(u)||e.report({node:y,messageId:"unusedSelectedValue",data:{name:u}})}}}})};function Ps(e,n,r){let t=e.arguments[n];if(!t)return null;if(t.type===B.AST_NODE_TYPES.ArrowFunctionExpression||t.type===B.AST_NODE_TYPES.FunctionExpression)return t;if(r&&t.type===B.AST_NODE_TYPES.ObjectExpression){let o=t.properties.find(i=>i.type===B.AST_NODE_TYPES.Property&&i.key.type===B.AST_NODE_TYPES.Identifier&&i.key.name===r);if(o?.type!==B.AST_NODE_TYPES.Property)return null;let a=o.value;if(a.type===B.AST_NODE_TYPES.ArrowFunctionExpression||a.type===B.AST_NODE_TYPES.FunctionExpression)return a}return null}function Os(e){return e.callee.type===B.AST_NODE_TYPES.Identifier?e.callee.name:e.callee.type===B.AST_NODE_TYPES.MemberExpression&&e.callee.property.type===B.AST_NODE_TYPES.Identifier?e.callee.property.name:null}function Ns(e){if(e.body.type===B.AST_NODE_TYPES.ObjectExpression)return e.body;if(e.body.type===B.AST_NODE_TYPES.BlockStatement){let n=e.body.body.filter(r=>r.type===B.AST_NODE_TYPES.ReturnStatement);return n.length!==1||!n[0]||n[0].argument?.type!==B.AST_NODE_TYPES.ObjectExpression?null:n[0].argument}return null}function er(e,n){let r=e;if(n){let o=e.find(a=>a.type===B.AST_NODE_TYPES.Property&&a.key.type===B.AST_NODE_TYPES.Identifier&&a.key.name===n);if(o?.type!==B.AST_NODE_TYPES.Property||o.value.type!==B.AST_NODE_TYPES.ObjectPattern)return null;r=o.value.properties}let t=new Map;for(let o of r){if(o.type!==B.AST_NODE_TYPES.Property||o.key.type!==B.AST_NODE_TYPES.Identifier)return null;t.set(o.key.name,o)}return t.size>0?t:null}function Ds(e,n){let r=n.getDeclaredVariables(e);if(r.length!==1)return[];let t=r[0];return t?t.references.filter(o=>o.identifier!==e.id):[]}var Y=require("@typescript-eslint/utils");var Ht=V({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(a=>a.type===Y.AST_NODE_TYPES.ImportDeclaration&&a.source.value==="t-state-form"))return{};let t=null,o=!1;return{CallExpression(a){if(o)return;if(!t){let c=Ls(a);c&&(t=c);return}let i=js(a,e.sourceCode);if(i){o=!0;for(let c of i)t.delete(c);if(t.size!==0)for(let[c,l]of t)e.report({node:l,messageId:"unusedField",data:{name:c}})}}}}});function Ls(e){if(!(e.callee.type===Y.AST_NODE_TYPES.Identifier&&e.callee.name==="useForm"))return null;let r=e.arguments[0];if(!r||r.type!==Y.AST_NODE_TYPES.ObjectExpression)return null;let t=At(r.properties,a=>a.type!==Y.AST_NODE_TYPES.Property||a.key.type!==Y.AST_NODE_TYPES.Identifier||a.key.name!=="initialConfig"?null:a.value.type===Y.AST_NODE_TYPES.ObjectExpression?a.value:a.value.type===Y.AST_NODE_TYPES.ArrowFunctionExpression||a.value.type===Y.AST_NODE_TYPES.FunctionExpression?Ms(a.value):null);if(!t)return null;let o=new Map;for(let a of t.properties)a.type===Y.AST_NODE_TYPES.Property&&a.key.type===Y.AST_NODE_TYPES.Identifier&&o.set(a.key.name,a);return o}function js(e,n){if(!(e.callee.type===Y.AST_NODE_TYPES.Identifier&&e.callee.name==="useFormState")||e.parent.type!==Y.AST_NODE_TYPES.VariableDeclarator||e.parent.id.type!==Y.AST_NODE_TYPES.ObjectPattern||!At(e.parent.id.properties,i=>i.type===Y.AST_NODE_TYPES.Property&&i.key.type===Y.AST_NODE_TYPES.Identifier&&i.key.name==="formFields"&&i))return null;let o=Ln(e.parent,"formFields",n),a=new Set;for(let{identifier:i}of o){if(i.type!==Y.AST_NODE_TYPES.Identifier||i.parent.type===Y.AST_NODE_TYPES.Property&&i.parent.parent.type===Y.AST_NODE_TYPES.ObjectExpression&&i.parent.parent.parent.type===Y.AST_NODE_TYPES.ReturnStatement||i.parent.type===Y.AST_NODE_TYPES.ReturnStatement)return null;if(i.parent.type===Y.AST_NODE_TYPES.MemberExpression){if(i.parent.object.type!==Y.AST_NODE_TYPES.Identifier||i.parent.property.type!==Y.AST_NODE_TYPES.Identifier)return null;a.add(i.parent.property.name)}}return a}function Ms(e){if(e.body.type===Y.AST_NODE_TYPES.ObjectExpression)return e.body;if(e.body.type===Y.AST_NODE_TYPES.BlockStatement){let n=e.body.body.filter(r=>r.type===Y.AST_NODE_TYPES.ReturnStatement);return n.length!==1||!n[0]||n[0].argument?.type!==Y.AST_NODE_TYPES.ObjectExpression?null:n[0].argument}return null}var X=require("@typescript-eslint/utils"),Ze=require("zod/v4");var $s=X.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`);function tr(e){let n=[];for(let r of e.members)r.type===X.AST_NODE_TYPES.TSPropertySignature&&r.key.type===X.AST_NODE_TYPES.Identifier&&n.push([r.key.name,r]);return n}function nr(e,...n){for(let r of n)e.set(...r);return e}var _s=Ze.z.object({forceCheckOnFCPropTypesWithName:Ze.z.array(Ze.z.string()).optional(),alwaysCheckFunctionOptionTypes:Ze.z.boolean().optional()}),rr="no-unused-type-props-in-args",Bt=null,Us=$s({name:rr,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(_s)],fixable:"code"},defaultOptions:[{alwaysCheckFunctionOptionTypes:!0}],create(e,[n]){let{forceCheckOnFCPropTypesWithName:r,alwaysCheckFunctionOptionTypes:t=!0}=n;r&&!Bt&&(Bt=r.map(l=>new RegExp(l)));function o(l,p,m,d,s=!0,u=!1){let y=m.name,g=e.sourceCode.getScope(p).references.find(h=>h.identifier.name===y)?.resolved,S=l&&Bt?.some(h=>h.test(y)),f=u&&t;if(!g||!S&&g.references.filter(h=>h.isTypeReference).length>1||!g.defs[0])return;let T=g.defs[0].node,b=T.parent?.type===X.AST_NODE_TYPES.ExportNamedDeclaration;if(!(s&&b&&!f)){if(T.type===X.AST_NODE_TYPES.TSTypeAliasDeclaration){a(l,p,d,T.typeAnnotation,!0,u);return}if(T.type===X.AST_NODE_TYPES.TSInterfaceDeclaration){a(l,p,d,T.body,!0,u);return}}}function a(l,p,m,d,s,u=!1){if(d.type===X.AST_NODE_TYPES.TSInterfaceBody){for(let y of d.body)y.type===X.AST_NODE_TYPES.TSPropertySignature&&y.key.type===X.AST_NODE_TYPES.Identifier&&m.set(y.key.name,y);return}if(d.type===X.AST_NODE_TYPES.TSTypeLiteral){nr(m,...tr(d));return}if(d.type===X.AST_NODE_TYPES.TSIntersectionType){for(let y of d.types)a(l,p,m,y,!0,u);return}s||d.type===X.AST_NODE_TYPES.TSTypeReference&&d.typeName.type===X.AST_NODE_TYPES.Identifier&&o(l,p,d.typeName,m,!0,u)}function i(l,p,m,d=!1){for(let s of m)if(s.type===X.AST_NODE_TYPES.ObjectPattern&&s.typeAnnotation){let u=new Map;if(a(l,p,u,s.typeAnnotation.typeAnnotation,!1,d),u.size===0)continue;c(s,u)}else s.type===X.AST_NODE_TYPES.AssignmentPattern&&s.left.type===X.AST_NODE_TYPES.ObjectPattern&&i(l,p,[s.left],d)}function c(l,p){let m=[];if(l.properties.at(-1)?.type===X.AST_NODE_TYPES.RestElement)return;for(let y of l.properties)y.type===X.AST_NODE_TYPES.Property&&y.key.type===X.AST_NODE_TYPES.Identifier&&m.push(y.key.name);let s=[],u=[];for(let[y,g]of p)m.includes(y)||(u.push(y),s.push({node:g,messageId:"unusedObjectTypeProperty",data:{propertyName:y}}));for(let[y,g]of s.entries())e.report({...g,fix:y===s.length-1?S=>{let f=l.properties.at(-1),T=u.join(", ");return f?f.type===X.AST_NODE_TYPES.RestElement?null:S.insertTextAfter(f,`, ${T}`):S.insertTextBeforeRange([l.range[0]+1,l.range[1]],T)}:void 0})}return{VariableDeclaration(l){let p=l.declarations[0],m=new Map,d=p.id.type===X.AST_NODE_TYPES.Identifier&&p.id.typeAnnotation?.typeAnnotation.type===X.AST_NODE_TYPES.TSTypeReference&&p.id.typeAnnotation.typeAnnotation.typeName.type===X.AST_NODE_TYPES.Identifier&&p.id.typeAnnotation.typeAnnotation.typeName.name==="FC"&&p.id.typeAnnotation.typeAnnotation.typeArguments?.params[0];if(d){if(d.type===X.AST_NODE_TYPES.TSTypeReference&&d.typeName.type===X.AST_NODE_TYPES.Identifier)o(!0,l,d.typeName,m,!1);else if(d.type===X.AST_NODE_TYPES.TSTypeLiteral)nr(m,...tr(d));else if(d.type===X.AST_NODE_TYPES.TSIntersectionType)for(let s of d.types)s.type===X.AST_NODE_TYPES.TSTypeReference&&s.typeName.type===X.AST_NODE_TYPES.Identifier?o(!0,l,s.typeName,m,!1):a(!0,l,m,s,!0);if(m.size!==0&&p.init?.type===X.AST_NODE_TYPES.ArrowFunctionExpression){let s=p.init.params[0];if(!s){e.report({node:p.init,messageId:"missingComponentParam"});return}s.type===X.AST_NODE_TYPES.ObjectPattern&&c(s,m)}}},FunctionDeclaration(l){i(!1,l,l.params,t)},ArrowFunctionExpression(l){i(!1,l,l.params,t)}}}}),Yt={name:rr,rule:Us};var de=require("@typescript-eslint/utils");var qt=V({name:"no-write-only-ref",meta:{type:"problem",docs:{description:"Disallow creating refs that are never read"},messages:{refNotRead:'Ref "{{name}}" is never read. Consider removing it if not needed.'},schema:[]},defaultOptions:[],create(e){let n=new Set;function r(t){return t.callee.type===de.AST_NODE_TYPES.Identifier?n.has(t.callee.name):t.callee.type===de.AST_NODE_TYPES.MemberExpression&&t.callee.object.type===de.AST_NODE_TYPES.Identifier&&t.callee.property.type===de.AST_NODE_TYPES.Identifier?t.callee.property.name==="useRef":!1}return{ImportDeclaration(t){if(t.source.value==="react")for(let o of t.specifiers)o.type===de.AST_NODE_TYPES.ImportSpecifier&&o.imported.type===de.AST_NODE_TYPES.Identifier&&o.imported.name==="useRef"&&n.add(o.local.name)},VariableDeclarator(t){if(t.init&&t.init.type===de.AST_NODE_TYPES.CallExpression&&r(t.init)&&t.id.type===de.AST_NODE_TYPES.Identifier){let a=e.sourceCode.getScope(t).set.get(t.id.name);if(a){let i=!1;for(let c of a.references){let p=c.identifier.parent;if(p!==t&&!(p.type===de.AST_NODE_TYPES.JSXExpressionContainer&&p.parent.type===de.AST_NODE_TYPES.JSXAttribute&&p.parent.name.type===de.AST_NODE_TYPES.JSXIdentifier&&p.parent.name.name==="ref")){i=!0;break}}i||e.report({node:t.id,messageId:"refNotRead",data:{name:t.id.name}})}}}}}});var Je=require("@typescript-eslint/utils"),Ws=Je.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),sr="prefer-named-functions",ir=new Map,zs=Ws({name:sr,meta:{hasSuggestions:!0,type:"suggestion",docs:{description:"Prevent using arrow functions when a named function can be used instead"},schema:[{type:"object",properties:{ignoreRegex:{type:"string"},disallowArrowFnWithImplicitReturns:{type:"boolean"}}}],messages:{suggestion:"Convert to named function",default:'Function {{functionName}} should be defined as a named function "function {{functionName}} () {}" instead of an arrow function',withIgnoreRegex:'Function {{functionName}} should be defined as a named function "function {{functionName}} () {}", if not possible to use `function` you can also use a name that matches the rule ignore regex'}},defaultOptions:[{}],create(e,[n]){let r=null;if(n.ignoreRegex){let t=ir.get(n.ignoreRegex);t?r=t:(r=new RegExp(n.ignoreRegex),ir.set(n.ignoreRegex,r))}return{VariableDeclarator(t){if(t.init&&t.init.type===Je.AST_NODE_TYPES.ArrowFunctionExpression&&t.id.type===Je.AST_NODE_TYPES.Identifier){let o=t.id.name;if(t.id.typeAnnotation||r&&r.test(o)||!n.disallowArrowFnWithImplicitReturns&&t.init.body.type!==Je.AST_NODE_TYPES.BlockStatement)return;let a=t.parent,i=t.init.params,c=t.init.body,l=t.init;e.report({node:t.id,messageId:r?"withIgnoreRegex":"default",data:{functionName:o,ignoreRegex:n.ignoreRegex},suggest:[{messageId:"suggestion",fix:p=>p.replaceText(a,`${l.async?"async ":""}function ${o}(${i.map(m=>e.sourceCode.getText(m)).join(", ")||""}) ${e.sourceCode.getText(c)}`)}]})}}}}}),Zt={name:sr,rule:zs};var M=require("@typescript-eslint/utils"),be=require("zod/v4");var Js=be.z.object({disallowedFunctions:be.z.array(be.z.object({name:be.z.string(),allowUsingWithArgs:be.z.boolean().optional(),hookAlternative:be.z.string().optional(),message:be.z.string().optional(),allowUseInside:be.z.array(be.z.string()).optional()}))}),Vs=/^use[A-Z]/,Xs=/^[A-Z]/;function ct(e){return Vs.test(e)}function or(e){return Xs.test(e)}function Hs(e){return e.type===M.AST_NODE_TYPES.Identifier?ct(e.name):e.type===M.AST_NODE_TYPES.MemberExpression&&e.property.type===M.AST_NODE_TYPES.Identifier?ct(e.property.name):!1}function ar(e,n){return e.type===M.AST_NODE_TYPES.Identifier?e.name===n:e.type===M.AST_NODE_TYPES.MemberExpression&&e.object.type===M.AST_NODE_TYPES.Identifier&&e.property.type===M.AST_NODE_TYPES.Identifier?e.object.name==="React"&&e.property.name===n:!1}function lr(e){return!!(e.parent&&e.parent.type===M.AST_NODE_TYPES.CallExpression&&ar(e.parent.callee,"forwardRef"))}function pr(e){return!!(e.parent&&e.parent.type===M.AST_NODE_TYPES.CallExpression&&ar(e.parent.callee,"memo"))}function Gt(e){if(e.type===M.AST_NODE_TYPES.FunctionDeclaration||e.type===M.AST_NODE_TYPES.FunctionExpression&&e.id)return e.id||void 0;if(e.type===M.AST_NODE_TYPES.FunctionExpression||e.type===M.AST_NODE_TYPES.ArrowFunctionExpression){if(e.parent.type===M.AST_NODE_TYPES.VariableDeclarator&&e.parent.init===e)return e.parent.id;if(e.parent.type===M.AST_NODE_TYPES.AssignmentExpression&&e.parent.right===e&&e.parent.operator==="=")return e.parent.left;if(e.parent.type===M.AST_NODE_TYPES.Property&&e.parent.value===e&&!e.parent.computed)return e.parent.key;if(e.parent.type===M.AST_NODE_TYPES.AssignmentPattern&&e.parent.right===e)return e.parent.left}}function Bs(e){let n=e.parent,r=!1;for(;n;){if(n.type===M.AST_NODE_TYPES.FunctionDeclaration||n.type===M.AST_NODE_TYPES.FunctionExpression||n.type===M.AST_NODE_TYPES.ArrowFunctionExpression){let t=Gt(n);if(t&&t.type===M.AST_NODE_TYPES.Identifier){if(or(t.name)||ct(t.name))return!r;r=!0}else{if(lr(n)||pr(n))return!r;if(n.parent.type===M.AST_NODE_TYPES.CallExpression){let o=n.parent;Hs(o.callee)||(r=!0)}else n.parent.type===M.AST_NODE_TYPES.JSXExpressionContainer||(r=!0)}}n=n.parent}return!1}function cr(e){return e.callee.type===M.AST_NODE_TYPES.Identifier?e.callee.name:e.callee.type===M.AST_NODE_TYPES.MemberExpression&&e.callee.property.type===M.AST_NODE_TYPES.Identifier?e.callee.property.name:null}function Ys(e,n){if(!n.length)return!1;let r=e.parent;for(;r;){if(r.type===M.AST_NODE_TYPES.FunctionDeclaration||r.type===M.AST_NODE_TYPES.FunctionExpression||r.type===M.AST_NODE_TYPES.ArrowFunctionExpression){let t=Gt(r);if(t&&t.type===M.AST_NODE_TYPES.Identifier&&n.includes(t.name))return!0}else if(r.type===M.AST_NODE_TYPES.CallExpression){let t=cr(r);if(t&&n.includes(t))return!0}r=r.parent}return!1}function qs(e){return e.arguments.length>0&&!e.arguments.every(n=>n.type===M.AST_NODE_TYPES.Identifier&&n.name==="undefined")}function Zs(e,n){let r=!1,t=e.parent;for(;t;){if(t.type===M.AST_NODE_TYPES.FunctionDeclaration||t.type===M.AST_NODE_TYPES.FunctionExpression||t.type===M.AST_NODE_TYPES.ArrowFunctionExpression){let o=Gt(t);if(o&&o.type===M.AST_NODE_TYPES.Identifier){if(or(o.name)||ct(o.name)){r=!0;break}}else if(lr(t)||pr(t)){r=!0;break}}t=t.parent}return r?n.length===0?Bs(e):!Ys(e,n):!1}var Kt=V({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(Js)],hasSuggestions:!0},defaultOptions:[{disallowedFunctions:[]}],create(e,[n]){let{disallowedFunctions:r}=n,t=new Map(r.map(o=>[o.name,o]));return{CallExpression(o){let a=cr(o);if(!a)return;let i=t.get(a);if(!i||i.allowUsingWithArgs&&qs(o))return;let c=i.allowUseInside||[];Zs(o,c)&&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:l=>{let p=i.hookAlternative;return p?o.callee.type===M.AST_NODE_TYPES.Identifier?l.replaceText(o.callee,p):o.callee.type===M.AST_NODE_TYPES.MemberExpression&&o.callee.property.type===M.AST_NODE_TYPES.Identifier?l.replaceText(o.callee.property,p):null:null}}]:[]})}}}});var Z=require("@typescript-eslint/utils"),ut=he(require("zod/v4"));var Gs=Z.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),fr="prefer-single-line-if",Ks=ut.default.object({maxLineLength:ut.default.number().optional(),maxNonSimpleConditionLength:ut.default.number().optional()}),Qs=Gs({name:fr,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(Ks)]},defaultOptions:[{}],create(e,[n]){let r=e.sourceCode;return{IfStatement(t){if(t.consequent.type!==Z.AST_NODE_TYPES.BlockStatement||t.loc.start.line===t.loc.end.line||r.getCommentsInside(t.consequent).length>0||t.alternate||t.consequent.body.length!==1)return;let a=t.consequent.body[0];if(!a)return;if(a.type===Z.AST_NODE_TYPES.ReturnStatement){if(!yr(a))return}else if(!(a.type===Z.AST_NODE_TYPES.ContinueStatement||a.type===Z.AST_NODE_TYPES.BreakStatement))return;if(t.test.type===Z.AST_NODE_TYPES.LogicalExpression||t.test.type===Z.AST_NODE_TYPES.ConditionalExpression)return;let i;if(n.maxNonSimpleConditionLength){let d=ur(t.test);if(!d&&t.test.type===Z.AST_NODE_TYPES.UnaryExpression&&t.test.operator==="!"){let s=t.test.argument;ur(s)&&(d=!0)}if(d&&(i=r.getText(t.test),i.length>n.maxNonSimpleConditionLength))return}i||(i=r.getText(t.test));let c=r.getText(a);if(i.includes(`
18
- `))return;let l=r.getTokenAfter(t);if(l&&l.type===Z.AST_TOKEN_TYPES.Punctuator&&l.value==="}"){let d=r.getTokenAfter(l);if(d&&d.type===Z.AST_TOKEN_TYPES.Keyword&&(d.value==="else"||d.value==="catch"))return}let p=eo(r,t),m=`if (${i}) ${c}`;n.maxLineLength&&m.length+p.length>n.maxLineLength||e.report({node:t,messageId:"noSingleLineCurly",fix:d=>d.replaceText(t,m)})}}}});function ur(e){return e.type===Z.AST_NODE_TYPES.CallExpression||e.type===Z.AST_NODE_TYPES.BinaryExpression||e.type===Z.AST_NODE_TYPES.MemberExpression&&mr(e)}function mr(e){return e.object.type===Z.AST_NODE_TYPES.MemberExpression?mr(e.object):e.object.type!==Z.AST_NODE_TYPES.Identifier}function eo(e,n){return e.text.slice(n.range[0]-n.loc.start.column,n.range[0])}function yr(e){if(!e.argument)return!0;let n=e.argument;return n.type===Z.AST_NODE_TYPES.ArrayExpression&&n.elements.length===0||n.type===Z.AST_NODE_TYPES.ObjectExpression&&n.properties.length===0||n.type===Z.AST_NODE_TYPES.Literal||n.type===Z.AST_NODE_TYPES.Identifier||n.type===Z.AST_NODE_TYPES.TemplateLiteral||n.type===Z.AST_NODE_TYPES.TaggedTemplateExpression?!0:n.type===Z.AST_NODE_TYPES.CallExpression?n.arguments.length===0:n.type===Z.AST_NODE_TYPES.UnaryExpression?yr(n):!1}var Qt={name:fr,rule:Qs};var P=require("@typescript-eslint/utils"),tn=require("zod/v4");var to=P.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),Tr="react-compiler-extra",no=tn.z.object({runOnlyWithEnableCompilerDirective:tn.z.boolean().optional()}),ro=/eslint +react-compiler\/react-compiler: +\["error/;function hr(e){return e.type===P.AST_NODE_TYPES.Identifier?e.name.startsWith("use"):!1}function io(e){return e.type===P.AST_NODE_TYPES.Identifier?e.name.startsWith("use"):e.type===P.AST_NODE_TYPES.MemberExpression&&e.property.type===P.AST_NODE_TYPES.Identifier?e.property.name.startsWith("use"):!1}function xe(e){if(!e)return!1;switch(e.type){case P.AST_NODE_TYPES.JSXElement:case P.AST_NODE_TYPES.JSXFragment:return!0;case P.AST_NODE_TYPES.ConditionalExpression:return xe(e.consequent)||xe(e.alternate);case P.AST_NODE_TYPES.LogicalExpression:return e.operator==="&&"?xe(e.right):e.operator==="||"?xe(e.left)||xe(e.right):!1;case P.AST_NODE_TYPES.CallExpression:if(e.callee.type===P.AST_NODE_TYPES.MemberExpression&&e.callee.object.type===P.AST_NODE_TYPES.Identifier&&e.callee.object.name==="React"&&e.callee.property.type===P.AST_NODE_TYPES.Identifier&&e.callee.property.name==="createElement")return!0;for(let n of e.arguments)if(n.type!==P.AST_NODE_TYPES.SpreadElement&&xe(n))return!0;return!1;default:return!1}}function so(e){let n=e.typeAnnotation;if(n.type===P.AST_NODE_TYPES.TSTypeReference){if(n.typeName.type===P.AST_NODE_TYPES.Identifier)return n.typeName.name==="FC";if(n.typeName.type===P.AST_NODE_TYPES.TSQualifiedName&&n.typeName.left.type===P.AST_NODE_TYPES.Identifier&&n.typeName.right.type===P.AST_NODE_TYPES.Identifier)return n.typeName.left.name==="React"&&n.typeName.right.name==="FC"}return!1}var oo=/^[A-Z][a-zA-Z0-9]*$/;function Ke(e){return oo.test(e)}function nn(e){return e.startsWith("use")&&e.length>3}function rn(e,n,r,t){if(r&&so(r))return n?Ke(n.name):e.type===P.AST_NODE_TYPES.FunctionDeclaration&&e.id?Ke(e.id.name):!0;if(n&&nn(n.name)||e.type===P.AST_NODE_TYPES.FunctionDeclaration&&e.id&&nn(e.id.name))return!0;if(t){let o=n?.name||e.type===P.AST_NODE_TYPES.FunctionDeclaration&&e.id?.name;if(o&&Ke(o)&&Er(e.body,t).containsJSX)return!0}return!1}function Ge(e){if(e.body.type===P.AST_NODE_TYPES.BlockStatement){for(let n of e.body.body)if(n.type===P.AST_NODE_TYPES.ExpressionStatement&&n.expression.type===P.AST_NODE_TYPES.Literal&&typeof n.expression.value=="string"&&n.expression.value==="use memo")return!0}return!1}function Er(e,n){let r={containsJSX:!1,containsHookCalls:!1};return Oe(e,t=>{if(r.containsJSX&&r.containsHookCalls)return!0;switch(t.type){case P.AST_NODE_TYPES.JSXElement:case P.AST_NODE_TYPES.JSXFragment:r.containsJSX=!0;break;case P.AST_NODE_TYPES.CallExpression:hr(t.callee)&&(r.containsHookCalls=!0),xe(t)&&(r.containsJSX=!0);break;case P.AST_NODE_TYPES.ReturnStatement:t.argument&&xe(t.argument)&&(r.containsJSX=!0);break;case P.AST_NODE_TYPES.VariableDeclarator:t.init&&xe(t.init)&&(r.containsJSX=!0);break;case P.AST_NODE_TYPES.AssignmentExpression:xe(t.right)&&(r.containsJSX=!0);break}},n),r}function dr(e,n){let r=e.body,t=Er(r,n);return t.containsJSX||t.containsHookCalls}var ao=/\bthis[.[]/;function gr(e){return ao.test(e)}function lo(e,n){let r={containsJSX:!1,containsHookCalls:!1};return Oe(e,t=>{if(r.containsHookCalls||(t.type===P.AST_NODE_TYPES.FunctionDeclaration||t.type===P.AST_NODE_TYPES.FunctionExpression||t.type===P.AST_NODE_TYPES.ArrowFunctionExpression)&&t!==e)return!0;t.type===P.AST_NODE_TYPES.CallExpression&&io(t.callee)&&(r.containsHookCalls=!0)},n),r}function Sr(e){return Ke(e)||nn(e)}function en(e,n,r,t){if(!lo(e.body,n).containsHookCalls)return!1;let a=rn(e,r,t,n);if(!a&&t){let i=r?.name||e.type===P.AST_NODE_TYPES.FunctionDeclaration&&e.id?.name;i&&Ke(i)&&(a=!0)}return!a}var po=to({name:Tr,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(no)]},defaultOptions:[{}],create(e,[n]){let r=!1;if(n.runOnlyWithEnableCompilerDirective){for(let a of e.sourceCode.getAllComments())if(ro.test(a.value)){r=!0;break}if(!r)return{}}function t(a){for(let i of a.properties)if(i.type===P.AST_NODE_TYPES.Property&&i.method&&i.value.type===P.AST_NODE_TYPES.FunctionExpression){let c=e.sourceCode,l=c.getText(i.key),p=i.value,m=c.getText(p.body);if(gr(m))e.report({node:i,messageId:"thisKeywordInMethod"});else{let d=p.params.map(u=>c.getText(u)).join(", "),s="";p.generator?s=`${l}: function* (${d}) ${m}`:s=`${l}: (${d}) => ${m}`,e.report({node:i,messageId:"objectMethodIsNotSupported",fix:u=>u.replaceText(i,s)})}}}function o(a){for(let i of a.properties)if(i.type===P.AST_NODE_TYPES.Property&&i.value.type===P.AST_NODE_TYPES.ObjectExpression){for(let c of i.value.properties)if(c.type===P.AST_NODE_TYPES.Property&&c.method&&c.value.type===P.AST_NODE_TYPES.FunctionExpression){let p=e.sourceCode.getText(c.value.body);gr(p)&&e.report({node:c,messageId:"thisKeywordInMethod"})}}}return{CallExpression(a){if(hr(a.callee))for(let i of a.arguments){if(i.type===P.AST_NODE_TYPES.ObjectExpression&&(t(i),o(i)),i.type===P.AST_NODE_TYPES.ArrowFunctionExpression&&(i.body.type===P.AST_NODE_TYPES.ObjectExpression&&(t(i.body),o(i.body)),i.body.type===P.AST_NODE_TYPES.BlockStatement))for(let c of i.body.body)c.type===P.AST_NODE_TYPES.ReturnStatement&&c.argument?.type===P.AST_NODE_TYPES.ObjectExpression&&(t(c.argument),o(c.argument));if(i.type===P.AST_NODE_TYPES.FunctionExpression)for(let c of i.body.body)c.type===P.AST_NODE_TYPES.ReturnStatement&&c.argument?.type===P.AST_NODE_TYPES.ObjectExpression&&(t(c.argument),o(c.argument))}},VariableDeclarator(a){if(a.id.type===P.AST_NODE_TYPES.Identifier&&a.init&&(a.init.type===P.AST_NODE_TYPES.ArrowFunctionExpression||a.init.type===P.AST_NODE_TYPES.FunctionExpression)){let i=a.init,c=a.id,l=a.id.typeAnnotation;if(Ge(i)&&!Sr(c.name)){e.report({node:i,messageId:"useMemoDirectiveNaming"});return}if(en(i,e.sourceCode,c,l)){e.report({node:i,messageId:"functionCallingHooksMustBeComponent"});return}if(rn(i,c,l,e.sourceCode)){let p=dr(i,e.sourceCode),m=Ge(i);!p&&!m&&e.report({node:i,messageId:"fcComponentShouldReturnJsx",suggest:[{messageId:"addUseMemoDirective",fix(d){if(i.body.type===P.AST_NODE_TYPES.BlockStatement){let s=i.body.range[0]+1;return d.insertTextAfterRange([s,s],`
17
+ `)}return""}return{Program(){let l=[];for(let s of t.body)s.type===fe.AST_NODE_TYPES.ExpressionStatement&&s.expression.type===fe.AST_NODE_TYPES.CallExpression&&s.expression.callee.type===fe.AST_NODE_TYPES.Identifier&&s.expression.callee.name==="describe"&&s.expression.arguments.length===2&&l.push(s.expression);if(!i(l))return;let[c]=l;if(!c)return;let m=o(c);if(a(m))return;let d=t.body.find(s=>s.type===fe.AST_NODE_TYPES.ExpressionStatement&&s.expression===c);!d||d.type!==fe.AST_NODE_TYPES.ExpressionStatement||e.report({node:c,messageId:"unnecessaryDescribe",suggest:[{messageId:"removeDescribe",fix(s){let u=p(c);return u?s.replaceText(d,u):null}}]})}}}});var Ze=require("@typescript-eslint/utils"),Ee=Se(require("zod/v4"));var ks=Ee.object({methods:Ee.union([Ee.array(Ee.string()),Ee.literal("array")])}),zt=W({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(ks)]},defaultOptions:[{methods:"array"}],create(e,[n]){let r=n.methods,t=new Set(["find","filter","map","forEach","some","every","reduce","findIndex","sort"]);function o(p){return Array.isArray(r)?r.includes(p):t.has(p)}function a(p){let{callee:l}=p;if(l.type===Ze.AST_NODE_TYPES.MemberExpression){let c=l.property;if(c.type===Ze.AST_NODE_TYPES.Identifier)return c.name}return null}function i(p,l){if(p.type!==Ze.AST_NODE_TYPES.Identifier||!p.typeAnnotation)return;let c=l.parent;if(c.type===Ze.AST_NODE_TYPES.CallExpression){let m=a(c);m&&o(m)&&c.arguments.indexOf(l)===0&&e.report({node:p.typeAnnotation,messageId:"unnecessaryTypeAnnotation",fix(s){return p.typeAnnotation?s.remove(p.typeAnnotation):null}})}}return{ArrowFunctionExpression(p){for(let l of p.params)i(l,p)},FunctionExpression(p){for(let l of p.params)i(l,p)}}}});var ue=require("@typescript-eslint/utils");var Jt=W({name:"no-unused-obj-props",meta:{type:"suggestion",docs:{description:"Disallow unused properties when it is safe to remove them"},messages:{unusedObjectProperty:'The object property "{{name}}" is not being used',unusedReturnObjectProperty:'The object property "{{name}}" returned by this function is not being used'},schema:[]},defaultOptions:[],create(e){return{VariableDeclarator(n){if(n.id.type===ue.AST_NODE_TYPES.ObjectPattern||!n.init||n.init.type!==ue.AST_NODE_TYPES.ObjectExpression||n.id.type===ue.AST_NODE_TYPES.Identifier&&n.id.typeAnnotation||n.parent.parent.type===ue.AST_NODE_TYPES.ExportNamedDeclaration)return;let r=new Map;for(let i of n.init.properties)i.type===ue.AST_NODE_TYPES.Property&&i.key.type===ue.AST_NODE_TYPES.Identifier&&r.set(i.key.name,i);if(r.size===0||n.id.type!==ue.AST_NODE_TYPES.Identifier)return;let t=Fs(n,e.sourceCode);if(t.length===0)return;let o=n.init.properties.some(i=>i.type!==ue.AST_NODE_TYPES.Property?!1:i.value.type===ue.AST_NODE_TYPES.FunctionExpression),a=new Set;for(let i of t){if(i.identifier.parent.type!==ue.AST_NODE_TYPES.MemberExpression)return;let p=i.identifier.parent;if(p.object!==i.identifier)return;if(p.computed)if(p.property.type===ue.AST_NODE_TYPES.Literal&&typeof p.property.value=="string")a.add(p.property.value);else return;else{if(p.property.type!==ue.AST_NODE_TYPES.Identifier)return;a.add(p.property.name)}if(p.parent.type===ue.AST_NODE_TYPES.CallExpression&&o)return}for(let[i,p]of r)a.has(i)||e.report({node:p,messageId:"unusedObjectProperty",data:{name:i}})}}}});function Fs(e,n){let r=n.getDeclaredVariables(e);if(r.length!==1)return[];let t=r[0];return t?t.references.filter(o=>o.identifier!==e.id):[]}var z=require("@typescript-eslint/utils"),Vt=require("zod/v4");var Ps=Vt.z.object({ignoreArgsMatching:Vt.z.string().optional()}),Xt=W({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(Ps)]},defaultOptions:[{}],create(e,[n]){let r=[];function t(i){return n.ignoreArgsMatching?new RegExp(n.ignoreArgsMatching).test(i):!1}function o(i){return i.type===z.AST_NODE_TYPES.ExportNamedDeclaration||i.type===z.AST_NODE_TYPES.ExportDefaultDeclaration||i.parent?.type===z.AST_NODE_TYPES.ExportNamedDeclaration||i.parent?.type===z.AST_NODE_TYPES.ExportDefaultDeclaration}function a(i){let p=[];for(let l=0;l<i.length;l++){let c=i[l];if(!c||c.type!==z.AST_NODE_TYPES.Identifier)continue;let m=c.name;if(!t(m)){if(c.optional&&c.typeAnnotation&&c.typeAnnotation.typeAnnotation.type===z.AST_NODE_TYPES.TSTypeLiteral){let d=c.typeAnnotation.typeAnnotation,s=[];for(let u of d.members)u.type===z.AST_NODE_TYPES.TSPropertySignature&&u.key.type===z.AST_NODE_TYPES.Identifier&&s.push({name:u.key.name,optional:u.optional===!0});s.some(u=>u.optional)?p.push({param:c,index:l,name:m,isObjectParam:!0,objectProps:s}):p.push({param:c,index:l,name:m,isObjectParam:!1})}else if(c.optional)p.push({param:c,index:l,name:m,isObjectParam:!1});else if(c.typeAnnotation&&c.typeAnnotation.typeAnnotation.type===z.AST_NODE_TYPES.TSTypeLiteral){let d=c.typeAnnotation.typeAnnotation,s=[];for(let u of d.members)u.type===z.AST_NODE_TYPES.TSPropertySignature&&u.key.type===z.AST_NODE_TYPES.Identifier&&s.push({name:u.key.name,optional:u.optional===!0});s.some(u=>u.optional)&&p.push({param:c,index:l,name:m,isObjectParam:!0,objectProps:s})}}}return p}return{FunctionDeclaration(i){if(o(i))return;let p=a(i.params);p.length!==0&&r.push({node:i,declarationNode:i,optionalParams:p})},VariableDeclarator(i){if(i.id.type!==z.AST_NODE_TYPES.Identifier||!i.init||i.init.type!==z.AST_NODE_TYPES.ArrowFunctionExpression&&i.init.type!==z.AST_NODE_TYPES.FunctionExpression||o(i.parent.parent))return;let l=[...a(i.init.params)];if(i.id.typeAnnotation&&i.id.typeAnnotation.typeAnnotation.type===z.AST_NODE_TYPES.TSTypeReference){let c=i.id.typeAnnotation.typeAnnotation;if(c.typeName.type===z.AST_NODE_TYPES.Identifier&&c.typeName.name==="FC"){let m=c.typeArguments;if(m&&m.params.length===1){let d=m.params[0];if(d&&d.type===z.AST_NODE_TYPES.TSTypeLiteral){let s=[];for(let u of d.members)u.type===z.AST_NODE_TYPES.TSPropertySignature&&u.key.type===z.AST_NODE_TYPES.Identifier&&s.push({name:u.key.name,optional:u.optional===!0});s.some(u=>u.optional)&&l.push({param:i.id,index:0,name:"props",isObjectParam:!0,objectProps:s})}}}}l.length!==0&&r.push({node:i.init,declarationNode:i,optionalParams:l})},"Program:exit"(){for(let i of r){let l=e.sourceCode.getDeclaredVariables(i.declarationNode)[0];if(!l)continue;let c=l.references.filter(s=>s.identifier!==l.identifiers[0]);if(c.length===0)continue;let m=!1;for(let s of c){let u=s.identifier.parent;if(u.type===z.AST_NODE_TYPES.CallExpression&&s.identifier.type===z.AST_NODE_TYPES.Identifier&&u.arguments.includes(s.identifier)){m=!0;break}if(u.type===z.AST_NODE_TYPES.ReturnStatement){m=!0;break}if(u.type===z.AST_NODE_TYPES.Property&&u.parent.type===z.AST_NODE_TYPES.ObjectExpression&&u.parent.parent.type===z.AST_NODE_TYPES.ReturnStatement){m=!0;break}if(u.type===z.AST_NODE_TYPES.JSXExpressionContainer){m=!0;break}}if(m)continue;let d=[];for(let s of c){let u=s.identifier.parent;if(u.type===z.AST_NODE_TYPES.CallExpression&&u.callee===s.identifier){let y=u.arguments.length,g=u.arguments.some(f=>f.type===z.AST_NODE_TYPES.SpreadElement);if(g){m=!0;break}let S={argCount:y,hasSpread:g};for(let f of i.optionalParams)if(f.isObjectParam&&f.index<y){let T=u.arguments[f.index];if(T?.type===z.AST_NODE_TYPES.ObjectExpression){let b={};for(let h of T.properties)h.type===z.AST_NODE_TYPES.Property&&h.key.type===z.AST_NODE_TYPES.Identifier&&(b[h.key.name]=!0);S.objectArgs||(S.objectArgs=[]),S.objectArgs[f.index]=b}else if(T){m=!0;break}}d.push(S)}else if(u.type===z.AST_NODE_TYPES.JSXOpeningElement&&u.name===s.identifier){let y=u.attributes.some(S=>S.type===z.AST_NODE_TYPES.JSXSpreadAttribute);if(y){m=!0;break}let g={argCount:1,hasSpread:y};for(let S of i.optionalParams)if(S.isObjectParam&&S.index===0){let f={};for(let T of u.attributes)T.type===z.AST_NODE_TYPES.JSXAttribute&&T.name.type===z.AST_NODE_TYPES.JSXIdentifier&&(f[T.name.name]=!0);g.objectArgs||(g.objectArgs=[]),g.objectArgs[0]=f}d.push(g)}}if(!(m||d.length===0))for(let s of i.optionalParams)if(s.isObjectParam&&s.objectProps)for(let u of s.objectProps){if(!u.optional)continue;let y=!1;for(let g of d)if(g.objectArgs&&g.objectArgs[s.index]){let S=g.objectArgs[s.index];if(S&&S[u.name]){y=!0;break}}y||e.report({node:s.param,messageId:"unusedOptionalProp",data:{name:u.name}})}else{let u=!1;for(let y of d)if(y.argCount>s.index){u=!0;break}u||e.report({node:s.param,messageId:"unusedOptionalArg",data:{name:s.name}})}}}}}});var B=require("@typescript-eslint/utils"),De=require("zod/v4");var Os=De.z.object({selectors:De.z.array(De.z.object({name:De.z.string(),selectorProp:De.z.string().optional(),selectorArgPos:De.z.number().optional(),returnProp:De.z.string().optional()}))}),Ns=B.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),nr="no-unused-selected-values",Ht={name:nr,rule:Ns({name:nr,meta:{type:"suggestion",docs:{description:"Disallow unused values in selector objects"},messages:{unusedSelectedValue:'The selected value "{{name}}" is not being used'},schema:[j(Os)]},defaultOptions:[{selectors:[]}],create(e,[n]){let{selectors:r=[]}=n,t=new Map(r.map(o=>[o.name,o]));return{VariableDeclarator(o){let a=null;if(o.init?.type===B.AST_NODE_TYPES.CallExpression&&(a=o.init),!a)return;let i=Ls(a);if(!i)return;let p=t.get(i);if(!p)return;let l=Ds(a,p.selectorArgPos??0,p.selectorProp);if(!l)return;let c=js(l);if(!c)return;let m=rr(c.properties,void 0);if(!m)return;if(o.id.type===B.AST_NODE_TYPES.ObjectPattern){let u=rr(o.id.properties,p.returnProp);if(!u)return;for(let[y,g]of m)u.has(y)||e.report({node:g,messageId:"unusedSelectedValue",data:{name:y}});return}if(o.id.type!==B.AST_NODE_TYPES.Identifier||p.returnProp)return;let d=Ms(o,e.sourceCode);if(d.length===0)return;let s=new Set;for(let u of d){if(u.identifier.parent.type!==B.AST_NODE_TYPES.MemberExpression)return;let y=u.identifier.parent.property;if(y.type!==B.AST_NODE_TYPES.Identifier)return;s.add(y.name)}for(let[u,y]of m)s.has(u)||e.report({node:y,messageId:"unusedSelectedValue",data:{name:u}})}}}})};function Ds(e,n,r){let t=e.arguments[n];if(!t)return null;if(t.type===B.AST_NODE_TYPES.ArrowFunctionExpression||t.type===B.AST_NODE_TYPES.FunctionExpression)return t;if(r&&t.type===B.AST_NODE_TYPES.ObjectExpression){let o=t.properties.find(i=>i.type===B.AST_NODE_TYPES.Property&&i.key.type===B.AST_NODE_TYPES.Identifier&&i.key.name===r);if(o?.type!==B.AST_NODE_TYPES.Property)return null;let a=o.value;if(a.type===B.AST_NODE_TYPES.ArrowFunctionExpression||a.type===B.AST_NODE_TYPES.FunctionExpression)return a}return null}function Ls(e){return e.callee.type===B.AST_NODE_TYPES.Identifier?e.callee.name:e.callee.type===B.AST_NODE_TYPES.MemberExpression&&e.callee.property.type===B.AST_NODE_TYPES.Identifier?e.callee.property.name:null}function js(e){if(e.body.type===B.AST_NODE_TYPES.ObjectExpression)return e.body;if(e.body.type===B.AST_NODE_TYPES.BlockStatement){let n=e.body.body.filter(r=>r.type===B.AST_NODE_TYPES.ReturnStatement);return n.length!==1||!n[0]||n[0].argument?.type!==B.AST_NODE_TYPES.ObjectExpression?null:n[0].argument}return null}function rr(e,n){let r=e;if(n){let o=e.find(a=>a.type===B.AST_NODE_TYPES.Property&&a.key.type===B.AST_NODE_TYPES.Identifier&&a.key.name===n);if(o?.type!==B.AST_NODE_TYPES.Property||o.value.type!==B.AST_NODE_TYPES.ObjectPattern)return null;r=o.value.properties}let t=new Map;for(let o of r){if(o.type!==B.AST_NODE_TYPES.Property||o.key.type!==B.AST_NODE_TYPES.Identifier)return null;t.set(o.key.name,o)}return t.size>0?t:null}function Ms(e,n){let r=n.getDeclaredVariables(e);if(r.length!==1)return[];let t=r[0];return t?t.references.filter(o=>o.identifier!==e.id):[]}var Y=require("@typescript-eslint/utils");var Bt=W({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(a=>a.type===Y.AST_NODE_TYPES.ImportDeclaration&&a.source.value==="t-state-form"))return{};let t=null,o=!1;return{CallExpression(a){if(o)return;if(!t){let p=$s(a);p&&(t=p);return}let i=_s(a,e.sourceCode);if(i){o=!0;for(let p of i)t.delete(p);if(t.size!==0)for(let[p,l]of t)e.report({node:l,messageId:"unusedField",data:{name:p}})}}}}});function $s(e){if(!(e.callee.type===Y.AST_NODE_TYPES.Identifier&&e.callee.name==="useForm"))return null;let r=e.arguments[0];if(!r||r.type!==Y.AST_NODE_TYPES.ObjectExpression)return null;let t=It(r.properties,a=>a.type!==Y.AST_NODE_TYPES.Property||a.key.type!==Y.AST_NODE_TYPES.Identifier||a.key.name!=="initialConfig"?null:a.value.type===Y.AST_NODE_TYPES.ObjectExpression?a.value:a.value.type===Y.AST_NODE_TYPES.ArrowFunctionExpression||a.value.type===Y.AST_NODE_TYPES.FunctionExpression?Us(a.value):null);if(!t)return null;let o=new Map;for(let a of t.properties)a.type===Y.AST_NODE_TYPES.Property&&a.key.type===Y.AST_NODE_TYPES.Identifier&&o.set(a.key.name,a);return o}function _s(e,n){if(!(e.callee.type===Y.AST_NODE_TYPES.Identifier&&e.callee.name==="useFormState")||e.parent.type!==Y.AST_NODE_TYPES.VariableDeclarator||e.parent.id.type!==Y.AST_NODE_TYPES.ObjectPattern||!It(e.parent.id.properties,i=>i.type===Y.AST_NODE_TYPES.Property&&i.key.type===Y.AST_NODE_TYPES.Identifier&&i.key.name==="formFields"&&i))return null;let o=$n(e.parent,"formFields",n),a=new Set;for(let{identifier:i}of o){if(i.type!==Y.AST_NODE_TYPES.Identifier||i.parent.type===Y.AST_NODE_TYPES.Property&&i.parent.parent.type===Y.AST_NODE_TYPES.ObjectExpression&&i.parent.parent.parent.type===Y.AST_NODE_TYPES.ReturnStatement||i.parent.type===Y.AST_NODE_TYPES.ReturnStatement)return null;if(i.parent.type===Y.AST_NODE_TYPES.MemberExpression){if(i.parent.object.type!==Y.AST_NODE_TYPES.Identifier||i.parent.property.type!==Y.AST_NODE_TYPES.Identifier)return null;a.add(i.parent.property.name)}}return a}function Us(e){if(e.body.type===Y.AST_NODE_TYPES.ObjectExpression)return e.body;if(e.body.type===Y.AST_NODE_TYPES.BlockStatement){let n=e.body.body.filter(r=>r.type===Y.AST_NODE_TYPES.ReturnStatement);return n.length!==1||!n[0]||n[0].argument?.type!==Y.AST_NODE_TYPES.ObjectExpression?null:n[0].argument}return null}var X=require("@typescript-eslint/utils"),Ge=require("zod/v4");var Ws=X.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`);function ir(e){let n=[];for(let r of e.members)r.type===X.AST_NODE_TYPES.TSPropertySignature&&r.key.type===X.AST_NODE_TYPES.Identifier&&n.push([r.key.name,r]);return n}function sr(e,...n){for(let r of n)e.set(...r);return e}var zs=Ge.z.object({forceCheckOnFCPropTypesWithName:Ge.z.array(Ge.z.string()).optional(),alwaysCheckFunctionOptionTypes:Ge.z.boolean().optional()}),or="no-unused-type-props-in-args",Yt=null,Js=Ws({name:or,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(zs)],fixable:"code"},defaultOptions:[{alwaysCheckFunctionOptionTypes:!0}],create(e,[n]){let{forceCheckOnFCPropTypesWithName:r,alwaysCheckFunctionOptionTypes:t=!0}=n;r&&!Yt&&(Yt=r.map(l=>new RegExp(l)));function o(l,c,m,d,s=!0,u=!1){let y=m.name,g=e.sourceCode.getScope(c).references.find(h=>h.identifier.name===y)?.resolved,S=l&&Yt?.some(h=>h.test(y)),f=u&&t;if(!g||!S&&g.references.filter(h=>h.isTypeReference).length>1||!g.defs[0])return;let T=g.defs[0].node,b=T.parent?.type===X.AST_NODE_TYPES.ExportNamedDeclaration;if(!(s&&b&&!f)){if(T.type===X.AST_NODE_TYPES.TSTypeAliasDeclaration){a(l,c,d,T.typeAnnotation,!0,u);return}if(T.type===X.AST_NODE_TYPES.TSInterfaceDeclaration){a(l,c,d,T.body,!0,u);return}}}function a(l,c,m,d,s,u=!1){if(d.type===X.AST_NODE_TYPES.TSInterfaceBody){for(let y of d.body)y.type===X.AST_NODE_TYPES.TSPropertySignature&&y.key.type===X.AST_NODE_TYPES.Identifier&&m.set(y.key.name,y);return}if(d.type===X.AST_NODE_TYPES.TSTypeLiteral){sr(m,...ir(d));return}if(d.type===X.AST_NODE_TYPES.TSIntersectionType){for(let y of d.types)a(l,c,m,y,!0,u);return}s||d.type===X.AST_NODE_TYPES.TSTypeReference&&d.typeName.type===X.AST_NODE_TYPES.Identifier&&o(l,c,d.typeName,m,!0,u)}function i(l,c,m,d=!1){for(let s of m)if(s.type===X.AST_NODE_TYPES.ObjectPattern&&s.typeAnnotation){let u=new Map;if(a(l,c,u,s.typeAnnotation.typeAnnotation,!1,d),u.size===0)continue;p(s,u)}else s.type===X.AST_NODE_TYPES.AssignmentPattern&&s.left.type===X.AST_NODE_TYPES.ObjectPattern&&i(l,c,[s.left],d)}function p(l,c){let m=[];if(l.properties.at(-1)?.type===X.AST_NODE_TYPES.RestElement)return;for(let y of l.properties)y.type===X.AST_NODE_TYPES.Property&&y.key.type===X.AST_NODE_TYPES.Identifier&&m.push(y.key.name);let s=[],u=[];for(let[y,g]of c)m.includes(y)||(u.push(y),s.push({node:g,messageId:"unusedObjectTypeProperty",data:{propertyName:y}}));for(let[y,g]of s.entries())e.report({...g,fix:y===s.length-1?S=>{let f=l.properties.at(-1),T=u.join(", ");return f?f.type===X.AST_NODE_TYPES.RestElement?null:S.insertTextAfter(f,`, ${T}`):S.insertTextBeforeRange([l.range[0]+1,l.range[1]],T)}:void 0})}return{VariableDeclaration(l){let c=l.declarations[0],m=new Map,d=c.id.type===X.AST_NODE_TYPES.Identifier&&c.id.typeAnnotation?.typeAnnotation.type===X.AST_NODE_TYPES.TSTypeReference&&c.id.typeAnnotation.typeAnnotation.typeName.type===X.AST_NODE_TYPES.Identifier&&c.id.typeAnnotation.typeAnnotation.typeName.name==="FC"&&c.id.typeAnnotation.typeAnnotation.typeArguments?.params[0];if(d){if(d.type===X.AST_NODE_TYPES.TSTypeReference&&d.typeName.type===X.AST_NODE_TYPES.Identifier)o(!0,l,d.typeName,m,!1);else if(d.type===X.AST_NODE_TYPES.TSTypeLiteral)sr(m,...ir(d));else if(d.type===X.AST_NODE_TYPES.TSIntersectionType)for(let s of d.types)s.type===X.AST_NODE_TYPES.TSTypeReference&&s.typeName.type===X.AST_NODE_TYPES.Identifier?o(!0,l,s.typeName,m,!1):a(!0,l,m,s,!0);if(m.size!==0&&c.init?.type===X.AST_NODE_TYPES.ArrowFunctionExpression){let s=c.init.params[0];if(!s){e.report({node:c.init,messageId:"missingComponentParam"});return}s.type===X.AST_NODE_TYPES.ObjectPattern&&p(s,m)}}},FunctionDeclaration(l){i(!1,l,l.params,t)},ArrowFunctionExpression(l){i(!1,l,l.params,t)}}}}),qt={name:or,rule:Js};var de=require("@typescript-eslint/utils");var Zt=W({name:"no-write-only-ref",meta:{type:"problem",docs:{description:"Disallow creating refs that are never read"},messages:{refNotRead:'Ref "{{name}}" is never read. Consider removing it if not needed.'},schema:[]},defaultOptions:[],create(e){let n=new Set;function r(t){return t.callee.type===de.AST_NODE_TYPES.Identifier?n.has(t.callee.name):t.callee.type===de.AST_NODE_TYPES.MemberExpression&&t.callee.object.type===de.AST_NODE_TYPES.Identifier&&t.callee.property.type===de.AST_NODE_TYPES.Identifier?t.callee.property.name==="useRef":!1}return{ImportDeclaration(t){if(t.source.value==="react")for(let o of t.specifiers)o.type===de.AST_NODE_TYPES.ImportSpecifier&&o.imported.type===de.AST_NODE_TYPES.Identifier&&o.imported.name==="useRef"&&n.add(o.local.name)},VariableDeclarator(t){if(t.init&&t.init.type===de.AST_NODE_TYPES.CallExpression&&r(t.init)&&t.id.type===de.AST_NODE_TYPES.Identifier){let a=e.sourceCode.getScope(t).set.get(t.id.name);if(a){let i=!1;for(let p of a.references){let c=p.identifier.parent;if(c!==t&&!(c.type===de.AST_NODE_TYPES.JSXExpressionContainer&&c.parent.type===de.AST_NODE_TYPES.JSXAttribute&&c.parent.name.type===de.AST_NODE_TYPES.JSXIdentifier&&c.parent.name.name==="ref")){i=!0;break}}i||e.report({node:t.id,messageId:"refNotRead",data:{name:t.id.name}})}}}}}});var Je=require("@typescript-eslint/utils"),Vs=Je.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),lr="prefer-named-functions",ar=new Map,Xs=Vs({name:lr,meta:{hasSuggestions:!0,type:"suggestion",docs:{description:"Prevent using arrow functions when a named function can be used instead"},schema:[{type:"object",properties:{ignoreRegex:{type:"string"},disallowArrowFnWithImplicitReturns:{type:"boolean"}}}],messages:{suggestion:"Convert to named function",default:'Function {{functionName}} should be defined as a named function "function {{functionName}} () {}" instead of an arrow function',withIgnoreRegex:'Function {{functionName}} should be defined as a named function "function {{functionName}} () {}", if not possible to use `function` you can also use a name that matches the rule ignore regex'}},defaultOptions:[{}],create(e,[n]){let r=null;if(n.ignoreRegex){let t=ar.get(n.ignoreRegex);t?r=t:(r=new RegExp(n.ignoreRegex),ar.set(n.ignoreRegex,r))}return{VariableDeclarator(t){if(t.init&&t.init.type===Je.AST_NODE_TYPES.ArrowFunctionExpression&&t.id.type===Je.AST_NODE_TYPES.Identifier){let o=t.id.name;if(t.id.typeAnnotation||r&&r.test(o)||!n.disallowArrowFnWithImplicitReturns&&t.init.body.type!==Je.AST_NODE_TYPES.BlockStatement)return;let a=t.parent,i=t.init.params,p=t.init.body,l=t.init;e.report({node:t.id,messageId:r?"withIgnoreRegex":"default",data:{functionName:o,ignoreRegex:n.ignoreRegex},suggest:[{messageId:"suggestion",fix:c=>c.replaceText(a,`${l.async?"async ":""}function ${o}(${i.map(m=>e.sourceCode.getText(m)).join(", ")||""}) ${e.sourceCode.getText(p)}`)}]})}}}}}),Gt={name:lr,rule:Xs};var M=require("@typescript-eslint/utils"),be=require("zod/v4");var Hs=be.z.object({disallowedFunctions:be.z.array(be.z.object({name:be.z.string(),allowUsingWithArgs:be.z.boolean().optional(),hookAlternative:be.z.string().optional(),message:be.z.string().optional(),allowUseInside:be.z.array(be.z.string()).optional()}))}),Bs=/^use[A-Z]/,Ys=/^[A-Z]/;function ut(e){return Bs.test(e)}function pr(e){return Ys.test(e)}function qs(e){return e.type===M.AST_NODE_TYPES.Identifier?ut(e.name):e.type===M.AST_NODE_TYPES.MemberExpression&&e.property.type===M.AST_NODE_TYPES.Identifier?ut(e.property.name):!1}function cr(e,n){return e.type===M.AST_NODE_TYPES.Identifier?e.name===n:e.type===M.AST_NODE_TYPES.MemberExpression&&e.object.type===M.AST_NODE_TYPES.Identifier&&e.property.type===M.AST_NODE_TYPES.Identifier?e.object.name==="React"&&e.property.name===n:!1}function ur(e){return!!(e.parent&&e.parent.type===M.AST_NODE_TYPES.CallExpression&&cr(e.parent.callee,"forwardRef"))}function fr(e){return!!(e.parent&&e.parent.type===M.AST_NODE_TYPES.CallExpression&&cr(e.parent.callee,"memo"))}function Kt(e){if(e.type===M.AST_NODE_TYPES.FunctionDeclaration||e.type===M.AST_NODE_TYPES.FunctionExpression&&e.id)return e.id||void 0;if(e.type===M.AST_NODE_TYPES.FunctionExpression||e.type===M.AST_NODE_TYPES.ArrowFunctionExpression){if(e.parent.type===M.AST_NODE_TYPES.VariableDeclarator&&e.parent.init===e)return e.parent.id;if(e.parent.type===M.AST_NODE_TYPES.AssignmentExpression&&e.parent.right===e&&e.parent.operator==="=")return e.parent.left;if(e.parent.type===M.AST_NODE_TYPES.Property&&e.parent.value===e&&!e.parent.computed)return e.parent.key;if(e.parent.type===M.AST_NODE_TYPES.AssignmentPattern&&e.parent.right===e)return e.parent.left}}function Zs(e){let n=e.parent,r=!1;for(;n;){if(n.type===M.AST_NODE_TYPES.FunctionDeclaration||n.type===M.AST_NODE_TYPES.FunctionExpression||n.type===M.AST_NODE_TYPES.ArrowFunctionExpression){let t=Kt(n);if(t&&t.type===M.AST_NODE_TYPES.Identifier){if(pr(t.name)||ut(t.name))return!r;r=!0}else{if(ur(n)||fr(n))return!r;if(n.parent.type===M.AST_NODE_TYPES.CallExpression){let o=n.parent;qs(o.callee)||(r=!0)}else n.parent.type===M.AST_NODE_TYPES.JSXExpressionContainer||(r=!0)}}n=n.parent}return!1}function mr(e){return e.callee.type===M.AST_NODE_TYPES.Identifier?e.callee.name:e.callee.type===M.AST_NODE_TYPES.MemberExpression&&e.callee.property.type===M.AST_NODE_TYPES.Identifier?e.callee.property.name:null}function Gs(e,n){if(!n.length)return!1;let r=e.parent;for(;r;){if(r.type===M.AST_NODE_TYPES.FunctionDeclaration||r.type===M.AST_NODE_TYPES.FunctionExpression||r.type===M.AST_NODE_TYPES.ArrowFunctionExpression){let t=Kt(r);if(t&&t.type===M.AST_NODE_TYPES.Identifier&&n.includes(t.name))return!0}else if(r.type===M.AST_NODE_TYPES.CallExpression){let t=mr(r);if(t&&n.includes(t))return!0}r=r.parent}return!1}function Ks(e){return e.arguments.length>0&&!e.arguments.every(n=>n.type===M.AST_NODE_TYPES.Identifier&&n.name==="undefined")}function Qs(e,n){let r=!1,t=e.parent;for(;t;){if(t.type===M.AST_NODE_TYPES.FunctionDeclaration||t.type===M.AST_NODE_TYPES.FunctionExpression||t.type===M.AST_NODE_TYPES.ArrowFunctionExpression){let o=Kt(t);if(o&&o.type===M.AST_NODE_TYPES.Identifier){if(pr(o.name)||ut(o.name)){r=!0;break}}else if(ur(t)||fr(t)){r=!0;break}}t=t.parent}return r?n.length===0?Zs(e):!Gs(e,n):!1}var Qt=W({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(Hs)],hasSuggestions:!0},defaultOptions:[{disallowedFunctions:[]}],create(e,[n]){let{disallowedFunctions:r}=n,t=new Map(r.map(o=>[o.name,o]));return{CallExpression(o){let a=mr(o);if(!a)return;let i=t.get(a);if(!i||i.allowUsingWithArgs&&Ks(o))return;let p=i.allowUseInside||[];Qs(o,p)&&e.report({node:o,messageId:"preferHookAlternative",data:{message:i.message?` ${i.message}`:` use ${i.hookAlternative} instead`},suggest:i.hookAlternative?[{messageId:"preferHookAlternative",data:{message:`Replace with ${i.hookAlternative}`,hookAlternative:i.hookAlternative},fix:l=>{let c=i.hookAlternative;return c?o.callee.type===M.AST_NODE_TYPES.Identifier?l.replaceText(o.callee,c):o.callee.type===M.AST_NODE_TYPES.MemberExpression&&o.callee.property.type===M.AST_NODE_TYPES.Identifier?l.replaceText(o.callee.property,c):null:null}}]:[]})}}}});var Z=require("@typescript-eslint/utils"),ft=Se(require("zod/v4"));var eo=Z.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),dr="prefer-single-line-if",to=ft.default.object({maxLineLength:ft.default.number().optional(),maxNonSimpleConditionLength:ft.default.number().optional()}),no=eo({name:dr,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(to)]},defaultOptions:[{}],create(e,[n]){let r=e.sourceCode;return{IfStatement(t){if(t.consequent.type!==Z.AST_NODE_TYPES.BlockStatement||t.loc.start.line===t.loc.end.line||r.getCommentsInside(t.consequent).length>0||t.alternate||t.consequent.body.length!==1)return;let a=t.consequent.body[0];if(!a)return;if(a.type===Z.AST_NODE_TYPES.ReturnStatement){if(!Sr(a))return}else if(!(a.type===Z.AST_NODE_TYPES.ContinueStatement||a.type===Z.AST_NODE_TYPES.BreakStatement))return;if(t.test.type===Z.AST_NODE_TYPES.LogicalExpression||t.test.type===Z.AST_NODE_TYPES.ConditionalExpression)return;let i;if(n.maxNonSimpleConditionLength){let d=yr(t.test);if(!d&&t.test.type===Z.AST_NODE_TYPES.UnaryExpression&&t.test.operator==="!"){let s=t.test.argument;yr(s)&&(d=!0)}if(d&&(i=r.getText(t.test),i.length>n.maxNonSimpleConditionLength))return}i||(i=r.getText(t.test));let p=r.getText(a);if(i.includes(`
18
+ `))return;let l=r.getTokenAfter(t);if(l&&l.type===Z.AST_TOKEN_TYPES.Punctuator&&l.value==="}"){let d=r.getTokenAfter(l);if(d&&d.type===Z.AST_TOKEN_TYPES.Keyword&&(d.value==="else"||d.value==="catch"))return}let c=ro(r,t),m=`if (${i}) ${p}`;n.maxLineLength&&m.length+c.length>n.maxLineLength||e.report({node:t,messageId:"noSingleLineCurly",fix:d=>d.replaceText(t,m)})}}}});function yr(e){return e.type===Z.AST_NODE_TYPES.CallExpression||e.type===Z.AST_NODE_TYPES.BinaryExpression||e.type===Z.AST_NODE_TYPES.MemberExpression&&gr(e)}function gr(e){return e.object.type===Z.AST_NODE_TYPES.MemberExpression?gr(e.object):e.object.type!==Z.AST_NODE_TYPES.Identifier}function ro(e,n){return e.text.slice(n.range[0]-n.loc.start.column,n.range[0])}function Sr(e){if(!e.argument)return!0;let n=e.argument;return n.type===Z.AST_NODE_TYPES.ArrayExpression&&n.elements.length===0||n.type===Z.AST_NODE_TYPES.ObjectExpression&&n.properties.length===0||n.type===Z.AST_NODE_TYPES.Literal||n.type===Z.AST_NODE_TYPES.Identifier||n.type===Z.AST_NODE_TYPES.TemplateLiteral||n.type===Z.AST_NODE_TYPES.TaggedTemplateExpression?!0:n.type===Z.AST_NODE_TYPES.CallExpression?n.arguments.length===0:n.type===Z.AST_NODE_TYPES.UnaryExpression?Sr(n):!1}var en={name:dr,rule:no};var P=require("@typescript-eslint/utils"),nn=require("zod/v4");var io=P.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),br="react-compiler-extra",so=nn.z.object({runOnlyWithEnableCompilerDirective:nn.z.boolean().optional()}),oo=/eslint +react-compiler\/react-compiler: +\["error/;function xr(e){return e.type===P.AST_NODE_TYPES.Identifier?e.name.startsWith("use"):!1}function ao(e){return e.type===P.AST_NODE_TYPES.Identifier?e.name.startsWith("use"):e.type===P.AST_NODE_TYPES.MemberExpression&&e.property.type===P.AST_NODE_TYPES.Identifier?e.property.name.startsWith("use"):!1}function xe(e){if(!e)return!1;switch(e.type){case P.AST_NODE_TYPES.JSXElement:case P.AST_NODE_TYPES.JSXFragment:return!0;case P.AST_NODE_TYPES.ConditionalExpression:return xe(e.consequent)||xe(e.alternate);case P.AST_NODE_TYPES.LogicalExpression:return e.operator==="&&"?xe(e.right):e.operator==="||"?xe(e.left)||xe(e.right):!1;case P.AST_NODE_TYPES.CallExpression:if(e.callee.type===P.AST_NODE_TYPES.MemberExpression&&e.callee.object.type===P.AST_NODE_TYPES.Identifier&&e.callee.object.name==="React"&&e.callee.property.type===P.AST_NODE_TYPES.Identifier&&e.callee.property.name==="createElement")return!0;for(let n of e.arguments)if(n.type!==P.AST_NODE_TYPES.SpreadElement&&xe(n))return!0;return!1;default:return!1}}function lo(e){let n=e.typeAnnotation;if(n.type===P.AST_NODE_TYPES.TSTypeReference){if(n.typeName.type===P.AST_NODE_TYPES.Identifier)return n.typeName.name==="FC";if(n.typeName.type===P.AST_NODE_TYPES.TSQualifiedName&&n.typeName.left.type===P.AST_NODE_TYPES.Identifier&&n.typeName.right.type===P.AST_NODE_TYPES.Identifier)return n.typeName.left.name==="React"&&n.typeName.right.name==="FC"}return!1}var po=/^[A-Z][a-zA-Z0-9]*$/;function Qe(e){return po.test(e)}function rn(e){return e.startsWith("use")&&e.length>3}function sn(e,n,r,t){if(r&&lo(r))return n?Qe(n.name):e.type===P.AST_NODE_TYPES.FunctionDeclaration&&e.id?Qe(e.id.name):!0;if(n&&rn(n.name)||e.type===P.AST_NODE_TYPES.FunctionDeclaration&&e.id&&rn(e.id.name))return!0;if(t){let o=n?.name||e.type===P.AST_NODE_TYPES.FunctionDeclaration&&e.id?.name;if(o&&Qe(o)&&Cr(e.body,t).containsJSX)return!0}return!1}function Ke(e){if(e.body.type===P.AST_NODE_TYPES.BlockStatement){for(let n of e.body.body)if(n.type===P.AST_NODE_TYPES.ExpressionStatement&&n.expression.type===P.AST_NODE_TYPES.Literal&&typeof n.expression.value=="string"&&n.expression.value==="use memo")return!0}return!1}function Cr(e,n){let r={containsJSX:!1,containsHookCalls:!1};return Oe(e,t=>{if(r.containsJSX&&r.containsHookCalls)return!0;switch(t.type){case P.AST_NODE_TYPES.JSXElement:case P.AST_NODE_TYPES.JSXFragment:r.containsJSX=!0;break;case P.AST_NODE_TYPES.CallExpression:xr(t.callee)&&(r.containsHookCalls=!0),xe(t)&&(r.containsJSX=!0);break;case P.AST_NODE_TYPES.ReturnStatement:t.argument&&xe(t.argument)&&(r.containsJSX=!0);break;case P.AST_NODE_TYPES.VariableDeclarator:t.init&&xe(t.init)&&(r.containsJSX=!0);break;case P.AST_NODE_TYPES.AssignmentExpression:xe(t.right)&&(r.containsJSX=!0);break}},n),r}function Tr(e,n){let r=e.body,t=Cr(r,n);return t.containsJSX||t.containsHookCalls}var co=/\bthis[.[]/;function hr(e){return co.test(e)}function uo(e,n){let r={containsJSX:!1,containsHookCalls:!1};return Oe(e,t=>{if(r.containsHookCalls||(t.type===P.AST_NODE_TYPES.FunctionDeclaration||t.type===P.AST_NODE_TYPES.FunctionExpression||t.type===P.AST_NODE_TYPES.ArrowFunctionExpression)&&t!==e)return!0;t.type===P.AST_NODE_TYPES.CallExpression&&ao(t.callee)&&(r.containsHookCalls=!0)},n),r}function Er(e){return Qe(e)||rn(e)}function tn(e,n,r,t){if(!uo(e.body,n).containsHookCalls)return!1;let a=sn(e,r,t,n);if(!a&&t){let i=r?.name||e.type===P.AST_NODE_TYPES.FunctionDeclaration&&e.id?.name;i&&Qe(i)&&(a=!0)}return!a}var fo=io({name:br,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(so)]},defaultOptions:[{}],create(e,[n]){let r=!1;if(n.runOnlyWithEnableCompilerDirective){for(let a of e.sourceCode.getAllComments())if(oo.test(a.value)){r=!0;break}if(!r)return{}}function t(a){for(let i of a.properties)if(i.type===P.AST_NODE_TYPES.Property&&i.method&&i.value.type===P.AST_NODE_TYPES.FunctionExpression){let p=e.sourceCode,l=p.getText(i.key),c=i.value,m=p.getText(c.body);if(hr(m))e.report({node:i,messageId:"thisKeywordInMethod"});else{let d=c.params.map(u=>p.getText(u)).join(", "),s="";c.generator?s=`${l}: function* (${d}) ${m}`:s=`${l}: (${d}) => ${m}`,e.report({node:i,messageId:"objectMethodIsNotSupported",fix:u=>u.replaceText(i,s)})}}}function o(a){for(let i of a.properties)if(i.type===P.AST_NODE_TYPES.Property&&i.value.type===P.AST_NODE_TYPES.ObjectExpression){for(let p of i.value.properties)if(p.type===P.AST_NODE_TYPES.Property&&p.method&&p.value.type===P.AST_NODE_TYPES.FunctionExpression){let c=e.sourceCode.getText(p.value.body);hr(c)&&e.report({node:p,messageId:"thisKeywordInMethod"})}}}return{CallExpression(a){if(xr(a.callee))for(let i of a.arguments){if(i.type===P.AST_NODE_TYPES.ObjectExpression&&(t(i),o(i)),i.type===P.AST_NODE_TYPES.ArrowFunctionExpression&&(i.body.type===P.AST_NODE_TYPES.ObjectExpression&&(t(i.body),o(i.body)),i.body.type===P.AST_NODE_TYPES.BlockStatement))for(let p of i.body.body)p.type===P.AST_NODE_TYPES.ReturnStatement&&p.argument?.type===P.AST_NODE_TYPES.ObjectExpression&&(t(p.argument),o(p.argument));if(i.type===P.AST_NODE_TYPES.FunctionExpression)for(let p of i.body.body)p.type===P.AST_NODE_TYPES.ReturnStatement&&p.argument?.type===P.AST_NODE_TYPES.ObjectExpression&&(t(p.argument),o(p.argument))}},VariableDeclarator(a){if(a.id.type===P.AST_NODE_TYPES.Identifier&&a.init&&(a.init.type===P.AST_NODE_TYPES.ArrowFunctionExpression||a.init.type===P.AST_NODE_TYPES.FunctionExpression)){let i=a.init,p=a.id,l=a.id.typeAnnotation;if(Ke(i)&&!Er(p.name)){e.report({node:i,messageId:"useMemoDirectiveNaming"});return}if(tn(i,e.sourceCode,p,l)){e.report({node:i,messageId:"functionCallingHooksMustBeComponent"});return}if(sn(i,p,l,e.sourceCode)){let c=Tr(i,e.sourceCode),m=Ke(i);!c&&!m&&e.report({node:i,messageId:"fcComponentShouldReturnJsx",suggest:[{messageId:"addUseMemoDirective",fix(d){if(i.body.type===P.AST_NODE_TYPES.BlockStatement){let s=i.body.range[0]+1;return d.insertTextAfterRange([s,s],`
19
19
  "use memo"
20
- `)}return null}}]})}}},FunctionDeclaration(a){if(a.id&&Ge(a)&&!Sr(a.id.name)){e.report({node:a,messageId:"useMemoDirectiveNaming"});return}if(en(a,e.sourceCode)){e.report({node:a,messageId:"functionCallingHooksMustBeComponent"});return}if(rn(a,void 0,void 0,e.sourceCode)){let i=dr(a,e.sourceCode),c=Ge(a);!i&&!c&&e.report({node:a,messageId:"fcComponentShouldReturnJsx",suggest:[{messageId:"addUseMemoDirective",fix(l){let p=a.body.range[0]+1;return l.insertTextAfterRange([p,p],`
20
+ `)}return null}}]})}}},FunctionDeclaration(a){if(a.id&&Ke(a)&&!Er(a.id.name)){e.report({node:a,messageId:"useMemoDirectiveNaming"});return}if(tn(a,e.sourceCode)){e.report({node:a,messageId:"functionCallingHooksMustBeComponent"});return}if(sn(a,void 0,void 0,e.sourceCode)){let i=Tr(a,e.sourceCode),p=Ke(a);!i&&!p&&e.report({node:a,messageId:"fcComponentShouldReturnJsx",suggest:[{messageId:"addUseMemoDirective",fix(l){let c=a.body.range[0]+1;return l.insertTextAfterRange([c,c],`
21
21
  "use memo"
22
- `)}}]})}},FunctionExpression(a){if(Ge(a)){e.report({node:a,messageId:"useMemoDirectiveNaming"});return}en(a,e.sourceCode)&&e.report({node:a,messageId:"functionCallingHooksMustBeComponent"})}}}}),sn={name:Tr,rule:po};var le=require("@typescript-eslint/utils"),Se=require("zod/v4");var co=le.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),br="react-compiler-migration",uo=Se.z.object({disallowHooks:Se.z.array(Se.z.object({name:Se.z.string(),replacement:Se.z.string()})).optional(),disallowMethods:Se.z.array(Se.z.object({name:Se.z.string(),replacement:Se.z.string().optional(),requireTrueProp:Se.z.string().optional()})).optional()}),fo=/eslint +react-compiler\/react-compiler: +\["error/;function mo(e){return e.type===le.AST_NODE_TYPES.Identifier?e.name.startsWith("use"):e.type===le.AST_NODE_TYPES.MemberExpression&&e.property.type===le.AST_NODE_TYPES.Identifier?e.property.name.startsWith("use"):!1}var yo=co({name:br,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(uo)]},defaultOptions:[{disallowHooks:[],disallowMethods:[]}],create(e,[n]){let r=!1;for(let t of e.sourceCode.getAllComments())if(fo.test(t.value)){r=!0;break}return r?{CallExpression(t){if(n.disallowHooks?.length){let o=null,a=null;if(t.callee.type===le.AST_NODE_TYPES.Identifier?(o=t.callee.name,a=t.callee):t.callee.type===le.AST_NODE_TYPES.MemberExpression&&t.callee.property.type===le.AST_NODE_TYPES.Identifier&&(o=t.callee.property.name,a=t.callee.property),o){let i=n.disallowHooks.find(c=>c.name===o);i&&a&&e.report({node:t,messageId:"disallowedFunctionOrMethod",data:{functionOrMethod:i.name,replacement:i.replacement},suggest:[{messageId:"replace",data:{replacement:i.replacement},fix:c=>c.replaceText(a,i.replacement)}]})}}if(n.disallowMethods?.length&&mo(t.callee)){for(let o of t.arguments)if(o.type===le.AST_NODE_TYPES.ObjectExpression){for(let a of o.properties)if(a.type===le.AST_NODE_TYPES.Property&&a.key.type===le.AST_NODE_TYPES.Identifier){let i=a.key.name,c=n.disallowMethods.find(l=>l.name===i);if(c){if(c.requireTrueProp){let l=c.requireTrueProp,p=!1;for(let m of o.properties)if(m.type===le.AST_NODE_TYPES.Property&&m.key.type===le.AST_NODE_TYPES.Identifier&&m.key.name===l&&m.value.type===le.AST_NODE_TYPES.Literal&&m.value.value===!0){p=!0;break}if(!p){e.report({node:a,messageId:"disallowedMethodWithMissingRequireTrueProp",data:{method:c.name,requireTrueProp:l}});continue}}c.replacement&&e.report({node:a,messageId:"disallowedFunctionOrMethod",data:{functionOrMethod:c.name,replacement:c.replacement},suggest:[{messageId:"replace",data:{replacement:c.replacement},fix:l=>c.replacement?l.replaceText(a.key,c.replacement):null}]})}}}}}}:{}}}),on={name:br,rule:yo};var k=require("@typescript-eslint/utils"),ln=require("zod");var go=ln.z.object({runOnlyWithEnableCompilerDirective:ln.z.boolean().optional()}),So=/eslint +react-compiler\/react-compiler: +\["error/,To=/^\d+$/,ho=/[\s_-]+/,Eo=/[a-z][A-Z]/,bo=/^(.+?)([A-Z][a-z]+s?)$/,xo=/^[a-z][a-zA-Z]*$/;function xr(e,n){let r=[];if(e.type===k.AST_NODE_TYPES.JSXElement){for(let t of e.openingElement.attributes)if(t.type===k.AST_NODE_TYPES.JSXAttribute&&t.name.type===k.AST_NODE_TYPES.JSXIdentifier&&t.value?.type===k.AST_NODE_TYPES.JSXExpressionContainer&&t.value.expression.type!==k.AST_NODE_TYPES.JSXEmptyExpression){let o=t.name.name,a=t.value.expression,i=!1;Oe(a,c=>{switch(c.type){case k.AST_NODE_TYPES.ObjectExpression:case k.AST_NODE_TYPES.ArrowFunctionExpression:case k.AST_NODE_TYPES.FunctionExpression:case k.AST_NODE_TYPES.ArrayExpression:return i=!0,!0}return!1},n),i&&r.push(o)}}return{hasUnstable:r.length>0,problematicProps:r}}function Co(e){if(e.body.type===k.AST_NODE_TYPES.JSXElement||e.body.type===k.AST_NODE_TYPES.JSXFragment)return!0;if(e.body.type===k.AST_NODE_TYPES.BlockStatement){for(let n of e.body.body)if(n.type===k.AST_NODE_TYPES.ReturnStatement&&n.argument&&(n.argument.type===k.AST_NODE_TYPES.JSXElement||n.argument.type===k.AST_NODE_TYPES.JSXFragment))return!0}return!1}function Ao(e,n){let r=e.callee;if(r.type===k.AST_NODE_TYPES.MemberExpression){let t=r.object;if(t.type===k.AST_NODE_TYPES.Identifier){let o=t.name,a=Io(o);if(a!==o)return pn(a)}}if(n.length>0){let t=n[0];if(t&&t.type===k.AST_NODE_TYPES.Identifier)return pn(t.name)}return"ListItem"}function Io(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(Eo)){let t=e.match(bo);if(t){let o=t[1],a=t[2];if(!o||!a)return an(e);let i=an(a);if(i!==a)return o+i}}return an(e)}function an(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 pn(e){return e.match(xo)?e.charAt(0).toUpperCase()+e.slice(1):e.split(ho).map(n=>n.charAt(0).toUpperCase()+n.slice(1).toLowerCase()).join("")}function Cr(e,n,r){let t=[],o=new Set,a=new Set(["console","document","window","Math","Object","Array","String","Number","Boolean","undefined","null"]);Oe(e,i=>{if(i.type===k.AST_NODE_TYPES.Identifier&&!n.includes(i.name)&&!a.has(i.name)&&!To.test(i.name)){let c=i.parent;if(c.type===k.AST_NODE_TYPES.Property&&c.key===i||c.type===k.AST_NODE_TYPES.MemberExpression&&c.property===i&&!c.computed||c.type===k.AST_NODE_TYPES.JSXOpeningElement||c.type===k.AST_NODE_TYPES.JSXClosingElement||c.type===k.AST_NODE_TYPES.JSXAttribute&&c.name.type===k.AST_NODE_TYPES.JSXIdentifier&&c.name.name===i.name)return!1;o.add(i.name)}return!1},r);for(let i of o)n.includes(i)||t.push({name:i,type:"unknown"});return t}function Ar(e,n,r,t,o){let i=[...r.map(d=>d.type===k.AST_NODE_TYPES.Identifier?d.name:"item").map((d,s)=>({name:d,type:s===0?`${e}Type`:s===1?"number":"unknown"})),...t],c=i.map(d=>{let s=d.type;return d.name.includes("on")&&s==="any"&&(s="unknown"),` ${d.name}: ${s};`}).join(`
23
- `),l=i.map(d=>d.name).join(", "),p=o.getText(n),m=`${e}Props`;return`type ${m} = {
24
- ${c}
22
+ `)}}]})}},FunctionExpression(a){if(Ke(a)){e.report({node:a,messageId:"useMemoDirectiveNaming"});return}tn(a,e.sourceCode)&&e.report({node:a,messageId:"functionCallingHooksMustBeComponent"})}}}}),on={name:br,rule:fo};var le=require("@typescript-eslint/utils"),Te=require("zod/v4");var mo=le.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),Ar="react-compiler-migration",yo=Te.z.object({disallowHooks:Te.z.array(Te.z.object({name:Te.z.string(),replacement:Te.z.string()})).optional(),disallowMethods:Te.z.array(Te.z.object({name:Te.z.string(),replacement:Te.z.string().optional(),requireTrueProp:Te.z.string().optional()})).optional()}),go=/eslint +react-compiler\/react-compiler: +\["error/;function So(e){return e.type===le.AST_NODE_TYPES.Identifier?e.name.startsWith("use"):e.type===le.AST_NODE_TYPES.MemberExpression&&e.property.type===le.AST_NODE_TYPES.Identifier?e.property.name.startsWith("use"):!1}var To=mo({name:Ar,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(yo)]},defaultOptions:[{disallowHooks:[],disallowMethods:[]}],create(e,[n]){let r=!1;for(let t of e.sourceCode.getAllComments())if(go.test(t.value)){r=!0;break}return r?{CallExpression(t){if(n.disallowHooks?.length){let o=null,a=null;if(t.callee.type===le.AST_NODE_TYPES.Identifier?(o=t.callee.name,a=t.callee):t.callee.type===le.AST_NODE_TYPES.MemberExpression&&t.callee.property.type===le.AST_NODE_TYPES.Identifier&&(o=t.callee.property.name,a=t.callee.property),o){let i=n.disallowHooks.find(p=>p.name===o);i&&a&&e.report({node:t,messageId:"disallowedFunctionOrMethod",data:{functionOrMethod:i.name,replacement:i.replacement},suggest:[{messageId:"replace",data:{replacement:i.replacement},fix:p=>p.replaceText(a,i.replacement)}]})}}if(n.disallowMethods?.length&&So(t.callee)){for(let o of t.arguments)if(o.type===le.AST_NODE_TYPES.ObjectExpression){for(let a of o.properties)if(a.type===le.AST_NODE_TYPES.Property&&a.key.type===le.AST_NODE_TYPES.Identifier){let i=a.key.name,p=n.disallowMethods.find(l=>l.name===i);if(p){if(p.requireTrueProp){let l=p.requireTrueProp,c=!1;for(let m of o.properties)if(m.type===le.AST_NODE_TYPES.Property&&m.key.type===le.AST_NODE_TYPES.Identifier&&m.key.name===l&&m.value.type===le.AST_NODE_TYPES.Literal&&m.value.value===!0){c=!0;break}if(!c){e.report({node:a,messageId:"disallowedMethodWithMissingRequireTrueProp",data:{method:p.name,requireTrueProp:l}});continue}}p.replacement&&e.report({node:a,messageId:"disallowedFunctionOrMethod",data:{functionOrMethod:p.name,replacement:p.replacement},suggest:[{messageId:"replace",data:{replacement:p.replacement},fix:l=>p.replacement?l.replaceText(a.key,p.replacement):null}]})}}}}}}:{}}}),an={name:Ar,rule:To};var k=require("@typescript-eslint/utils"),pn=require("zod");var ho=pn.z.object({runOnlyWithEnableCompilerDirective:pn.z.boolean().optional()}),Eo=/eslint +react-compiler\/react-compiler: +\["error/,bo=/^\d+$/,xo=/[\s_-]+/,Co=/[a-z][A-Z]/,Ao=/^(.+?)([A-Z][a-z]+s?)$/,Io=/^[a-z][a-zA-Z]*$/;function Ir(e,n){let r=[];if(e.type===k.AST_NODE_TYPES.JSXElement){for(let t of e.openingElement.attributes)if(t.type===k.AST_NODE_TYPES.JSXAttribute&&t.name.type===k.AST_NODE_TYPES.JSXIdentifier&&t.value?.type===k.AST_NODE_TYPES.JSXExpressionContainer&&t.value.expression.type!==k.AST_NODE_TYPES.JSXEmptyExpression){let o=t.name.name,a=t.value.expression,i=!1;Oe(a,p=>{switch(p.type){case k.AST_NODE_TYPES.ObjectExpression:case k.AST_NODE_TYPES.ArrowFunctionExpression:case k.AST_NODE_TYPES.FunctionExpression:case k.AST_NODE_TYPES.ArrayExpression:return i=!0,!0}return!1},n),i&&r.push(o)}}return{hasUnstable:r.length>0,problematicProps:r}}function Ro(e){if(e.body.type===k.AST_NODE_TYPES.JSXElement||e.body.type===k.AST_NODE_TYPES.JSXFragment)return!0;if(e.body.type===k.AST_NODE_TYPES.BlockStatement){for(let n of e.body.body)if(n.type===k.AST_NODE_TYPES.ReturnStatement&&n.argument&&(n.argument.type===k.AST_NODE_TYPES.JSXElement||n.argument.type===k.AST_NODE_TYPES.JSXFragment))return!0}return!1}function wo(e,n){let r=e.callee;if(r.type===k.AST_NODE_TYPES.MemberExpression){let t=r.object;if(t.type===k.AST_NODE_TYPES.Identifier){let o=t.name,a=vo(o);if(a!==o)return cn(a)}}if(n.length>0){let t=n[0];if(t&&t.type===k.AST_NODE_TYPES.Identifier)return cn(t.name)}return"ListItem"}function vo(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(Co)){let t=e.match(Ao);if(t){let o=t[1],a=t[2];if(!o||!a)return ln(e);let i=ln(a);if(i!==a)return o+i}}return ln(e)}function ln(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 cn(e){return e.match(Io)?e.charAt(0).toUpperCase()+e.slice(1):e.split(xo).map(n=>n.charAt(0).toUpperCase()+n.slice(1).toLowerCase()).join("")}function Rr(e,n,r){let t=[],o=new Set,a=new Set(["console","document","window","Math","Object","Array","String","Number","Boolean","undefined","null"]);Oe(e,i=>{if(i.type===k.AST_NODE_TYPES.Identifier&&!n.includes(i.name)&&!a.has(i.name)&&!bo.test(i.name)){let p=i.parent;if(p.type===k.AST_NODE_TYPES.Property&&p.key===i||p.type===k.AST_NODE_TYPES.MemberExpression&&p.property===i&&!p.computed||p.type===k.AST_NODE_TYPES.JSXOpeningElement||p.type===k.AST_NODE_TYPES.JSXClosingElement||p.type===k.AST_NODE_TYPES.JSXAttribute&&p.name.type===k.AST_NODE_TYPES.JSXIdentifier&&p.name.name===i.name)return!1;o.add(i.name)}return!1},r);for(let i of o)n.includes(i)||t.push({name:i,type:"unknown"});return t}function wr(e,n,r,t,o){let i=[...r.map(d=>d.type===k.AST_NODE_TYPES.Identifier?d.name:"item").map((d,s)=>({name:d,type:s===0?`${e}Type`:s===1?"number":"unknown"})),...t],p=i.map(d=>{let s=d.type;return d.name.includes("on")&&s==="any"&&(s="unknown"),` ${d.name}: ${s};`}).join(`
23
+ `),l=i.map(d=>d.name).join(", "),c=o.getText(n),m=`${e}Props`;return`type ${m} = {
24
+ ${p}
25
25
  };
26
26
 
27
27
  const ${e}: FC<${m}> = ({ ${l} }) => {
28
28
  return (
29
- ${p}
29
+ ${c}
30
30
  );
31
- };`}function Ro(e,n,r,t){let o=n.map(i=>i.type===k.AST_NODE_TYPES.Identifier?i.name:"item"),a=[t?`key={${t}}`:`key={${o[0]}.id}`,...o.map(i=>`${i}={${i}}`),...r.map(i=>`${i.name}={${i.name}}`)].filter(Boolean);return`<${e} ${a.join(" ")} />`}function wo(e){if(e.type===k.AST_NODE_TYPES.JSXElement&&e.openingElement.name.type===k.AST_NODE_TYPES.JSXIdentifier){let n=e.openingElement.name.name;if(n!=="div"&&n!=="span")return pn(n)}return"ListItem"}function vo(e,n,r){let t=[r?`key={${r}}`:"",...n.map(o=>`${o.name}={${o.name}}`)].filter(Boolean);return`<${e}${t.length>0?` ${t.join(" ")}`:""} />`}function Ir(e,n){for(let r of e.openingElement.attributes)if(r.type===k.AST_NODE_TYPES.JSXAttribute&&r.name.type===k.AST_NODE_TYPES.JSXIdentifier&&r.name.name==="key"&&r.value&&r.value.type===k.AST_NODE_TYPES.JSXExpressionContainer&&r.value.expression.type!==k.AST_NODE_TYPES.JSXEmptyExpression)return n.getText(r.value.expression);return null}var cn=V({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(go)],hasSuggestions:!0},defaultOptions:[{runOnlyWithEnableCompilerDirective:!1}],create(e,[n]){let{sourceCode:r}=e;if(n.runOnlyWithEnableCompilerDirective){let t=!1;for(let o of r.getAllComments())if(So.test(o.value)){t=!0;break}if(!t)return{}}return{CallExpression(t){t.callee.type===k.AST_NODE_TYPES.MemberExpression&&t.callee.property.type===k.AST_NODE_TYPES.Identifier&&(t.callee.property.name==="map"||t.callee.property.name==="push")&&(t.callee.property.name==="map"?ko(t,r,e):Fo(t,r,e))}}}});function ko(e,n,r){let t=e.arguments[0];if(!t||t.type!==k.AST_NODE_TYPES.ArrowFunctionExpression&&t.type!==k.AST_NODE_TYPES.FunctionExpression||!Co(t))return;let o=null;if(t.body.type===k.AST_NODE_TYPES.JSXElement||t.body.type===k.AST_NODE_TYPES.JSXFragment?o=t.body:t.body.type===k.AST_NODE_TYPES.BlockStatement&&t.body.body[0]?.type===k.AST_NODE_TYPES.ReturnStatement&&t.body.body[0].argument&&(t.body.body[0].argument.type===k.AST_NODE_TYPES.JSXElement||t.body.body[0].argument.type===k.AST_NODE_TYPES.JSXFragment)&&(o=t.body.body[0].argument),!o)return;let a=xr(o,n);if(!a.hasUnstable)return;let i=Ao(e,t.params),c=t.params.map(d=>d.type===k.AST_NODE_TYPES.Identifier?d.name:"item"),l=Cr(o,c,n),p=o.type===k.AST_NODE_TYPES.JSXElement?Ir(o,n):null,m=a.problematicProps.length===1?`prop "${a.problematicProps[0]}"`:`props "${a.problematicProps.join('", "')}"`;r.report({node:o,messageId:"unstableValueInMap",data:{problematicProps:m},suggest:[{messageId:"extractComponent",data:{componentName:i},fix:d=>{let s=Ar(i,o,t.params,l,n),u=Ro(i,t.params,l,p),y=e;for(;y.parent.type!==k.AST_NODE_TYPES.Program&&!(y.type===k.AST_NODE_TYPES.FunctionDeclaration||y.type===k.AST_NODE_TYPES.VariableDeclarator&&y.init&&(y.init.type===k.AST_NODE_TYPES.ArrowFunctionExpression||y.init.type===k.AST_NODE_TYPES.FunctionExpression));)y=y.parent;let g=[];return g.push(d.insertTextAfter(y,`
31
+ };`}function ko(e,n,r,t){let o=n.map(i=>i.type===k.AST_NODE_TYPES.Identifier?i.name:"item"),a=[t?`key={${t}}`:`key={${o[0]}.id}`,...o.map(i=>`${i}={${i}}`),...r.map(i=>`${i.name}={${i.name}}`)].filter(Boolean);return`<${e} ${a.join(" ")} />`}function Fo(e){if(e.type===k.AST_NODE_TYPES.JSXElement&&e.openingElement.name.type===k.AST_NODE_TYPES.JSXIdentifier){let n=e.openingElement.name.name;if(n!=="div"&&n!=="span")return cn(n)}return"ListItem"}function Po(e,n,r){let t=[r?`key={${r}}`:"",...n.map(o=>`${o.name}={${o.name}}`)].filter(Boolean);return`<${e}${t.length>0?` ${t.join(" ")}`:""} />`}function vr(e,n){for(let r of e.openingElement.attributes)if(r.type===k.AST_NODE_TYPES.JSXAttribute&&r.name.type===k.AST_NODE_TYPES.JSXIdentifier&&r.name.name==="key"&&r.value&&r.value.type===k.AST_NODE_TYPES.JSXExpressionContainer&&r.value.expression.type!==k.AST_NODE_TYPES.JSXEmptyExpression)return n.getText(r.value.expression);return null}var un=W({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(ho)],hasSuggestions:!0},defaultOptions:[{runOnlyWithEnableCompilerDirective:!1}],create(e,[n]){let{sourceCode:r}=e;if(n.runOnlyWithEnableCompilerDirective){let t=!1;for(let o of r.getAllComments())if(Eo.test(o.value)){t=!0;break}if(!t)return{}}return{CallExpression(t){t.callee.type===k.AST_NODE_TYPES.MemberExpression&&t.callee.property.type===k.AST_NODE_TYPES.Identifier&&(t.callee.property.name==="map"||t.callee.property.name==="push")&&(t.callee.property.name==="map"?Oo(t,r,e):No(t,r,e))}}}});function Oo(e,n,r){let t=e.arguments[0];if(!t||t.type!==k.AST_NODE_TYPES.ArrowFunctionExpression&&t.type!==k.AST_NODE_TYPES.FunctionExpression||!Ro(t))return;let o=null;if(t.body.type===k.AST_NODE_TYPES.JSXElement||t.body.type===k.AST_NODE_TYPES.JSXFragment?o=t.body:t.body.type===k.AST_NODE_TYPES.BlockStatement&&t.body.body[0]?.type===k.AST_NODE_TYPES.ReturnStatement&&t.body.body[0].argument&&(t.body.body[0].argument.type===k.AST_NODE_TYPES.JSXElement||t.body.body[0].argument.type===k.AST_NODE_TYPES.JSXFragment)&&(o=t.body.body[0].argument),!o)return;let a=Ir(o,n);if(!a.hasUnstable)return;let i=wo(e,t.params),p=t.params.map(d=>d.type===k.AST_NODE_TYPES.Identifier?d.name:"item"),l=Rr(o,p,n),c=o.type===k.AST_NODE_TYPES.JSXElement?vr(o,n):null,m=a.problematicProps.length===1?`prop "${a.problematicProps[0]}"`:`props "${a.problematicProps.join('", "')}"`;r.report({node:o,messageId:"unstableValueInMap",data:{problematicProps:m},suggest:[{messageId:"extractComponent",data:{componentName:i},fix:d=>{let s=wr(i,o,t.params,l,n),u=ko(i,t.params,l,c),y=e;for(;y.parent.type!==k.AST_NODE_TYPES.Program&&!(y.type===k.AST_NODE_TYPES.FunctionDeclaration||y.type===k.AST_NODE_TYPES.VariableDeclarator&&y.init&&(y.init.type===k.AST_NODE_TYPES.ArrowFunctionExpression||y.init.type===k.AST_NODE_TYPES.FunctionExpression));)y=y.parent;let g=[];return g.push(d.insertTextAfter(y,`
32
32
 
33
- ${s}`)),g.push(d.replaceText(o,u)),g}}]})}function Fo(e,n,r){let t=e.arguments[0];if(!t||t.type!==k.AST_NODE_TYPES.JSXElement&&t.type!==k.AST_NODE_TYPES.JSXFragment)return;let o=t,a=xr(o,n);if(!a.hasUnstable)return;let i=wo(o),c=Cr(o,[],n),l=o.type===k.AST_NODE_TYPES.JSXElement?Ir(o,n):null,p=a.problematicProps.length===1?`prop "${a.problematicProps[0]}"`:`props "${a.problematicProps.join('", "')}"`;r.report({node:o,messageId:"unstableValueInMap",data:{problematicProps:p},suggest:[{messageId:"extractComponent",data:{componentName:i},fix:m=>{let d=Ar(i,o,[],c,n),s=vo(i,c,l),u=e;for(;u.parent.type!==k.AST_NODE_TYPES.Program&&!(u.type===k.AST_NODE_TYPES.FunctionDeclaration||u.type===k.AST_NODE_TYPES.VariableDeclarator&&u.init&&(u.init.type===k.AST_NODE_TYPES.ArrowFunctionExpression||u.init.type===k.AST_NODE_TYPES.FunctionExpression));)u=u.parent;let y=[];return y.push(m.insertTextAfter(u,`
33
+ ${s}`)),g.push(d.replaceText(o,u)),g}}]})}function No(e,n,r){let t=e.arguments[0];if(!t||t.type!==k.AST_NODE_TYPES.JSXElement&&t.type!==k.AST_NODE_TYPES.JSXFragment)return;let o=t,a=Ir(o,n);if(!a.hasUnstable)return;let i=Fo(o),p=Rr(o,[],n),l=o.type===k.AST_NODE_TYPES.JSXElement?vr(o,n):null,c=a.problematicProps.length===1?`prop "${a.problematicProps[0]}"`:`props "${a.problematicProps.join('", "')}"`;r.report({node:o,messageId:"unstableValueInMap",data:{problematicProps:c},suggest:[{messageId:"extractComponent",data:{componentName:i},fix:m=>{let d=wr(i,o,[],p,n),s=Po(i,p,l),u=e;for(;u.parent.type!==k.AST_NODE_TYPES.Program&&!(u.type===k.AST_NODE_TYPES.FunctionDeclaration||u.type===k.AST_NODE_TYPES.VariableDeclarator&&u.init&&(u.init.type===k.AST_NODE_TYPES.ArrowFunctionExpression||u.init.type===k.AST_NODE_TYPES.FunctionExpression));)u=u.parent;let y=[];return y.push(m.insertTextAfter(u,`
34
34
 
35
- ${d}`)),y.push(m.replaceText(o,s)),y}}]})}var ft=require("@typescript-eslint/utils"),Po=ft.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),Rr="require-description",Oo=/^(eslint(?:-env|-enable|-disable(?:(?:-next)?-line)?)?|exported|globals?)(?:\s|$)/u,No=/^eslint-disable-(next-)?line$/u,Do=Po({name:Rr,meta:{type:"problem",docs:{description:"Require descriptions for eslint directives."},messages:{missingDescription:"Unexpected undescribed directive comment. Include descriptions to explain why the comment is necessary."},schema:[{type:"object",properties:{ignore:{type:"array",items:{type:"string",enum:["eslint","eslint-disable","eslint-disable-line","eslint-disable-next-line","eslint-enable","eslint-env","exported","global","globals"]},additionalItems:!1,uniqueItems:!0}},additionalProperties:!1}]},defaultOptions:[{ignore:[]}],create(e,[n]){let r=e.sourceCode,t=new Set(n.ignore||[]);return{Program(){for(let o of r.getAllComments()){let a=Lo(o);a!=null&&(t.has(a.kind)||a.description||e.report({loc:$o(o.loc),messageId:"missingDescription"}))}}}}}),wr={name:Rr,rule:Do};function Lo(e){let{text:n,description:r}=Mo(e.value);if(!n)return null;let t=Oo.exec(n);if(!t)return null;let o=t[1];if(!o)return null;let a=No.test(o);if(e.type===ft.TSESTree.AST_TOKEN_TYPES.Line&&!a||a&&e.loc.start.line!==e.loc.end.line)return null;let i=n.slice(t.index+o.length);return{kind:o,value:i.trim(),description:r}}var jo=/\s-{2,}\s/u;function Mo(e){let n=e.split(jo);return{text:n[0]?.trim(),description:n.length>1?n[1]?.trim()??null:null}}function $o(e){return{start:{line:e.start.line,column:-1},end:e.end}}var z=require("@typescript-eslint/utils"),Ce=require("zod/v4");var _o=Ce.z.object({varsToCheck:Ce.z.array(Ce.z.object({selector:Ce.z.string().optional(),fromFnCall:Ce.z.string().optional(),prop:Ce.z.string().or(Ce.z.array(Ce.z.string())),errorMsg:Ce.z.string().optional()}))}),un=V({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(_o)]},defaultOptions:[{varsToCheck:[]}],create(e,[n]){let r=new Map;function t(i,c,l,p){let m=new Set;for(let s of i.properties)s.type===z.AST_NODE_TYPES.Property&&s.key.type===z.AST_NODE_TYPES.Identifier&&m.add(s.key.name);let d=c.filter(s=>!m.has(s));if(d.length>0)if(d.length===1)e.report({node:i,messageId:"propNotRead",data:{prop:d[0],fnName:p,customMsg:l||""}});else{let s=d.map(u=>`"${u}"`).join(", ");e.report({node:i,messageId:"propsNotRead",data:{props:s,fnName:p,customMsg:l||""}})}}function o(i){if(i.init?.type===z.AST_NODE_TYPES.CallExpression){if(i.init.callee.type===z.AST_NODE_TYPES.Identifier)return i.init.callee.name;if(i.init.callee.type===z.AST_NODE_TYPES.MemberExpression&&i.init.callee.property.type===z.AST_NODE_TYPES.Identifier)return i.init.callee.object.type===z.AST_NODE_TYPES.Identifier?`${i.init.callee.object.name}.${i.init.callee.property.name}`:i.init.callee.property.name}return"unknown function"}let a={};for(let i of n.varsToCheck)i.selector&&(a[i.selector]=c=>{if(c.type===z.AST_NODE_TYPES.VariableDeclarator&&c.id.type===z.AST_NODE_TYPES.Identifier&&r.set(c.id.name,{props:Array.isArray(i.prop)?i.prop:[i.prop],errorMsg:i.errorMsg,node:c.id,fnName:o(c)}),c.type===z.AST_NODE_TYPES.VariableDeclarator&&c.id.type===z.AST_NODE_TYPES.ObjectPattern){let l=Array.isArray(i.prop)?i.prop:[i.prop];t(c.id,l,i.errorMsg,o(c))}});for(let i of n.varsToCheck)if(i.fromFnCall){let c=i.fromFnCall;if(c.startsWith("*.")){let p=`VariableDeclarator > CallExpression > MemberExpression[property.name="${c.slice(2)}"]`;a[p]=m=>{if(m.type!==z.AST_NODE_TYPES.MemberExpression||m.parent.type!==z.AST_NODE_TYPES.CallExpression)return;let d=m.parent;if(d.parent.type!==z.AST_NODE_TYPES.VariableDeclarator)return;let s=d.parent;if(s.id.type===z.AST_NODE_TYPES.Identifier)r.set(s.id.name,{props:Array.isArray(i.prop)?i.prop:[i.prop],errorMsg:i.errorMsg,node:s.id,fnName:i.fromFnCall||"unknown function"});else if(s.id.type===z.AST_NODE_TYPES.ObjectPattern){let u=Array.isArray(i.prop)?i.prop:[i.prop];t(s.id,u,i.errorMsg,i.fromFnCall||"unknown function")}}}else if(c.includes(".")){let[l,p]=c.split("."),m=`VariableDeclarator > CallExpression > MemberExpression[object.name="${l}"][property.name="${p}"]`;a[m]=d=>{if(d.type!==z.AST_NODE_TYPES.MemberExpression||d.parent.type!==z.AST_NODE_TYPES.CallExpression)return;let s=d.parent;if(s.parent.type!==z.AST_NODE_TYPES.VariableDeclarator)return;let u=s.parent;if(u.id.type===z.AST_NODE_TYPES.Identifier)r.set(u.id.name,{props:Array.isArray(i.prop)?i.prop:[i.prop],errorMsg:i.errorMsg,node:u.id,fnName:i.fromFnCall||"unknown function"});else if(u.id.type===z.AST_NODE_TYPES.ObjectPattern){let y=Array.isArray(i.prop)?i.prop:[i.prop];t(u.id,y,i.errorMsg,i.fromFnCall||"unknown function")}}}else{let l=`VariableDeclarator > CallExpression > Identifier[name="${c}"]`;a[l]=p=>{if(p.type!==z.AST_NODE_TYPES.Identifier||p.parent.type!==z.AST_NODE_TYPES.CallExpression)return;let m=p.parent;if(m.parent.type!==z.AST_NODE_TYPES.VariableDeclarator)return;let d=m.parent;if(d.id.type===z.AST_NODE_TYPES.Identifier)r.set(d.id.name,{props:Array.isArray(i.prop)?i.prop:[i.prop],errorMsg:i.errorMsg,node:d.id,fnName:i.fromFnCall||"unknown function"});else if(d.id.type===z.AST_NODE_TYPES.ObjectPattern){let s=Array.isArray(i.prop)?i.prop:[i.prop];t(d.id,s,i.errorMsg,i.fromFnCall||"unknown function")}}}}return{...a,"Program:exit"(){for(let[i,{props:c,errorMsg:l,node:p,fnName:m}]of r){let s=e.sourceCode.getScope(p).set.get(i);if(s){let u=new Set(c);for(let y of s.references){let g=y.identifier,S=g.parent;if(!(S.type===z.AST_NODE_TYPES.VariableDeclarator&&S.id===g)){if(S.type===z.AST_NODE_TYPES.MemberExpression&&S.object===g&&S.property.type===z.AST_NODE_TYPES.Identifier&&u.has(S.property.name)){if(u.delete(S.property.name),u.size===0)break;continue}if(S.type===z.AST_NODE_TYPES.VariableDeclarator&&S.init===g&&S.id.type===z.AST_NODE_TYPES.ObjectPattern){for(let f of S.id.properties)f.type===z.AST_NODE_TYPES.Property&&f.key.type===z.AST_NODE_TYPES.Identifier&&u.has(f.key.name)&&u.delete(f.key.name);if(u.size===0)break;continue}if(!(S.type===z.AST_NODE_TYPES.MemberExpression&&S.object===g&&S.property.type===z.AST_NODE_TYPES.Identifier&&!c.includes(S.property.name))){u.clear();break}}}if(u.size>0){let y=Array.from(u);if(y.length===1)e.report({node:p,messageId:"propNotRead",data:{prop:y[0],fnName:m,customMsg:l||""}});else{let g=y.map(S=>`"${S}"`).join(", ");e.report({node:p,messageId:"propsNotRead",data:{props:g,fnName:m,customMsg:l||""}})}}}}}}}});function Fr(e){return/^use[A-Z0-9]/.test(e)}function mt(e){return e.type==="Identifier"?Fr(e.name):e.type==="MemberExpression"&&!e.computed&&mt(e.property)?e.object.type==="Identifier":!1}function Pr(e){return e.type==="Identifier"&&/^[A-Z]/.test(e.name)}function Or(e,n){return e.name===n||e.type==="MemberExpression"&&e.object.name==="React"&&e.property.name===n}function Nr(e){return!!(e.parent&&e.parent.callee&&Or(e.parent.callee,"forwardRef"))}function Dr(e){return!!(e.parent&&e.parent.callee&&Or(e.parent.callee,"memo"))}function fn(e){for(;e;){let n=jr(e);if(n&&(Pr(n)||mt(n))||Nr(e)||Dr(e))return!0;e=e.parent}return!1}function vr(e){return!1}function mn(e){return!1}var Uo=/eslint +react-compiler\/react-compiler: +\["error/,Lr={meta:{type:"problem",docs:{description:"enforces the Rules of Hooks",recommended:!0,url:"https://reactjs.org/docs/hooks-rules.html"},schema:[{type:"object",ignoreIfReactCompilerIsEnabled:!1,properties:{ignoreIfReactCompilerIsEnabled:{type:"boolean"}}}]},create(e){if(e.options[0]?.ignoreIfReactCompilerIsEnabled){for(let l of e.sourceCode.getAllComments())if(Uo.test(l.value))return{CallExpression(p){let m=null;p.callee.name==="useMemo"?m="useMemo":p.callee.name==="useCallback"&&(m="useCallback"),m&&e.report({node:p,message:`"${m}" is not necessary when using React Compiler.`})}}}let n=typeof e.getSource=="function"?l=>n(l):l=>e.sourceCode.getText(l),r=typeof e.getScope=="function"?()=>r():l=>e.sourceCode.getScope(l),t=null,o=[],a=[],i=new WeakSet;function c(l){for(let p of l.references){let m=p.identifier.parent;if(m.type==="VariableDeclarator"&&m.init&&m.init.type==="CallExpression"&&m.init.callee&&vr(m.init.callee))for(let d of p.resolved.references)d!==p&&i.add(d.identifier)}}return{onCodePathSegmentStart:l=>a.push(l),onCodePathSegmentEnd:()=>a.pop(),onCodePathStart:()=>o.push(new Map),onCodePathEnd(l,p){let m=o.pop();if(m.size===0)return;let d=new Set;function s(h,I){let{cache:E}=s,C=E.get(h.id),w=new Set(I);if(w.has(h.id)){let R=[...w],L=R.slice(R.indexOf(h.id)+1);for(let U of L)d.add(U);return BigInt("0")}if(w.add(h.id),C!==void 0)return C;if(l.thrownSegments.includes(h))C=BigInt("0");else if(h.prevSegments.length===0)C=BigInt("1");else{C=BigInt("0");for(let R of h.prevSegments)C+=s(R,w)}return h.reachable&&C===BigInt("0")?E.delete(h.id):E.set(h.id,C),C}function u(h,I){let{cache:E}=u,C=E.get(h.id),w=new Set(I);if(w.has(h.id)){let R=Array.from(w),L=R.slice(R.indexOf(h.id)+1);for(let U of L)d.add(U);return BigInt("0")}if(w.add(h.id),C!==void 0)return C;if(l.thrownSegments.includes(h))C=BigInt("0");else if(h.nextSegments.length===0)C=BigInt("1");else{C=BigInt("0");for(let R of h.nextSegments)C+=u(R,w)}return E.set(h.id,C),C}function y(h){let{cache:I}=y,E=I.get(h.id);if(E===null)return 1/0;if(E!==void 0)return E;if(I.set(h.id,null),h.prevSegments.length===0)E=1;else{E=1/0;for(let C of h.prevSegments){let w=y(C);w<E&&(E=w)}E+=1}return I.set(h.id,E),E}s.cache=new Map,u.cache=new Map,y.cache=new Map;let g=u(l.initialSegment),S=jr(p),f=fn(p),T=S?Pr(S)||mt(S):Nr(p)||Dr(p),b=1/0;for(let h of l.finalSegments){if(!h.reachable)continue;let I=y(h);I<b&&(b=I)}for(let[h,I]of m){if(!h.reachable)continue;let E=h.nextSegments.length===0?b<=y(h):b<y(h),C=s(h)*u(h),w=d.has(h.id);for(let R of I)if(w&&!mn(R)&&e.report({node:R,message:`React Hook "${n(R)}" 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.`}),T){if(p.async&&e.report({node:R,message:`React Hook "${n(R)}" cannot be called in an async function.`}),!w&&C!==g&&!mn(R)){let U=`React Hook "${n(R)}" is called conditionally. React Hooks must be called in the exact same order in every component render.`+(E?" Did you accidentally call a React Hook after an early return?":"");e.report({node:R,message:U})}}else if(p.parent&&(p.parent.type==="MethodDefinition"||p.parent.type==="ClassProperty")&&p.parent.value===p){let L=`React Hook "${n(R)}" 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:R,message:L})}else if(S){let L=`React Hook "${n(R)}" is called in function "${n(S)}" that is neither a React function component nor a custom React Hook function. React component names must start with an uppercase letter. React Hook names must start with the word "use".`;e.report({node:R,message:L})}else if(p.type==="Program"){let L=`React Hook "${n(R)}" 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:R,message:L})}else if(f&&!mn(R)){if(p.parent.type==="CallExpression"&&p.parent.callee.type==="Identifier"&&p.parent.callee.name==="useCallback"){let U=p.parent;if(U.parent.type==="VariableDeclarator"&&Fr(U.parent.id.name))return}let L=`React Hook "${n(R)}" 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:R,message:L})}}},CallExpression(l){if(mt(l.callee)){let p=kr(o),m=kr(a),d=p.get(m);d||(d=[],p.set(m,d)),d.push(l.callee)}l.callee.type==="Identifier"&&(l.callee.name==="useEffect"||vr(l.callee))&&l.arguments.length>0&&(t=l)},Identifier(l){t==null&&i.has(l)&&l.parent.type!=="CallExpression"&&e.report({node:l,message:`\`${n(l)}\` 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"(l){l===t&&(t=null)},FunctionDeclaration(l){fn(l)&&c(r(l))},ArrowFunctionExpression(l){fn(l)&&c(r(l))}}}};function jr(e){return e.type==="FunctionDeclaration"||e.type==="FunctionExpression"&&e.id?e.id:e.type==="FunctionExpression"||e.type==="ArrowFunctionExpression"?e.parent.type==="VariableDeclarator"&&e.parent.init===e?e.parent.id:e.parent.type==="AssignmentExpression"&&e.parent.right===e&&e.parent.operator==="="?e.parent.left:e.parent.type==="Property"&&e.parent.value===e&&!e.parent.computed?e.parent.key:e.parent.type==="AssignmentPattern"&&e.parent.right===e&&!e.parent.computed?e.parent.left:void 0:void 0}function kr(e){return e[e.length-1]}var re=require("@typescript-eslint/utils"),pe=he(require("zod/v4"));var Wo=/^\s+$/,yn=/\r?\n/,zo=/^(\s*)/,Jo=/^(\s*)\S/,Vo=/\r?\n/,Xo=pe.object({indent:pe.union([pe.string().regex(Wo),pe.number().int().min(1)]).optional(),tags:pe.array(pe.string()).optional(),functions:pe.array(pe.string()).optional(),comments:pe.array(pe.string()).optional()}),dn=V({name:"template-indent",meta:{type:"suggestion",docs:{description:"Fix whitespace-insensitive template indentation"},fixable:"code",schema:[j(Xo)],messages:{improperlyIndented:"Templates should be properly indented."}},defaultOptions:[{}],create(e){let n=e.sourceCode,{comments:r=["HTML","indent"],functions:t=["dedent","stripIndent"],tags:o=["outdent","dedent","gql","sql","html","styled"],indent:a}=e.options[0],i=r.map(f=>f.toLowerCase());function c(f){let T=f.split(yn),b=T.filter(I=>I.trim()!=="");if(b.length===0)return f;let h=Number.POSITIVE_INFINITY;for(let I of b){let E=I.match(zo);E&&(h=Math.min(h,E[1]?.length??0))}return!isFinite(h)||h===0?f:T.map(I=>I.slice(h)).join(`
36
- `)}function l(f,T,b){return f.split(yn).map(I=>I.trim()===""?I:b.repeat(T)+I).join(`
37
- `)}function p(f){if(f.type===re.AST_NODE_TYPES.Identifier)return f.name;if(f.type===re.AST_NODE_TYPES.MemberExpression){let T=f.object.type===re.AST_NODE_TYPES.Identifier?f.object.name:null,b=f.property.type===re.AST_NODE_TYPES.Identifier?f.property.name:null;return T&&b?`${T}.${b}`:b}return null}function m(f,T){if(!f)return!1;for(let b of T)if(b.includes(".")){let h=b.split(".");if(f.type===re.AST_NODE_TYPES.MemberExpression&&f.object.type===re.AST_NODE_TYPES.Identifier&&f.property.type===re.AST_NODE_TYPES.Identifier&&f.object.name===h[0]&&f.property.name===h[1])return!0}else if(f.type===re.AST_NODE_TYPES.Identifier&&f.name===b)return!0;return!1}function d(f,T){let b=f.parent;if(b.type!==re.AST_NODE_TYPES.TaggedTemplateExpression)return!1;let h=p(b.tag);return h?T.includes(h):!1}function s(f,T){if(!f||f.type!==re.AST_NODE_TYPES.CallExpression)return!1;let{method:b,argumentsLength:h,optionalCall:I=!0,optionalMember:E=!0}=T;return h!==void 0&&f.arguments.length!==h||!I&&f.optional||f.callee.type!==re.AST_NODE_TYPES.MemberExpression||!E&&f.callee.optional||f.callee.property.type!==re.AST_NODE_TYPES.Identifier?!1:f.callee.property.name===b}function u(f,T){if(!f||f.type!==re.AST_NODE_TYPES.CallExpression)return!1;let{name:b,argumentsLength:h,optionalCall:I=!0}=T;return h!==void 0&&f.arguments.length!==h||!I&&f.optional||f.callee.type!==re.AST_NODE_TYPES.Identifier?!1:f.callee.name===b}function y(f){return s(f.parent,{method:"toMatchInlineSnapshot",argumentsLength:1,optionalCall:!1,optionalMember:!1})&&f.parent.type===re.AST_NODE_TYPES.CallExpression&&f.parent.arguments[0]===f&&u(f.parent.callee.type===re.AST_NODE_TYPES.MemberExpression?f.parent.callee.object:null,{name:"expect",argumentsLength:1,optionalCall:!1,optionalMember:!1})}function g(f){if(i.length>0){let T=n.getTokenBefore(f,{includeComments:!0});if(T?.type===re.AST_TOKEN_TYPES.Block&&i.includes(T.value.trim().toLowerCase()))return!0}return!!(y(f)||o.length>0&&d(f,o)||t.length>0&&f.parent.type===re.AST_NODE_TYPES.CallExpression&&f.parent.arguments.includes(f)&&m(f.parent.callee,t))}function S(f){let T=`__PLACEHOLDER__${Math.random()}`,b=f.quasis.map(q=>n.getText(q).slice(1,q.tail?-1:-2)).join(T),h=b.match(Vo);if(!h)return;let I=h[0],E=n.lines[n.getLocFromIndex(f.range[0]).line-1];if(!E)return;let w=E.match(Jo)?.[1]??"",R;typeof a=="string"?R=a:typeof a=="number"?R=" ".repeat(a):R=w.startsWith(" ")?" ":" ";let U=c(b).replace(new RegExp(`^${I}|${I}[ ]*$`,"g"),""),te=I+l(U,1,w+R)+I+w,K=b.includes(`\r
35
+ ${d}`)),y.push(m.replaceText(o,s)),y}}]})}var mt=require("@typescript-eslint/utils"),Do=mt.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),kr="require-description",Lo=/^(eslint(?:-env|-enable|-disable(?:(?:-next)?-line)?)?|exported|globals?)(?:\s|$)/u,jo=/^eslint-disable-(next-)?line$/u,Mo=Do({name:kr,meta:{type:"problem",docs:{description:"Require descriptions for eslint directives."},messages:{missingDescription:"Unexpected undescribed directive comment. Include descriptions to explain why the comment is necessary."},schema:[{type:"object",properties:{ignore:{type:"array",items:{type:"string",enum:["eslint","eslint-disable","eslint-disable-line","eslint-disable-next-line","eslint-enable","eslint-env","exported","global","globals"]},additionalItems:!1,uniqueItems:!0}},additionalProperties:!1}]},defaultOptions:[{ignore:[]}],create(e,[n]){let r=e.sourceCode,t=new Set(n.ignore||[]);return{Program(){for(let o of r.getAllComments()){let a=$o(o);a!=null&&(t.has(a.kind)||a.description||e.report({loc:Wo(o.loc),messageId:"missingDescription"}))}}}}}),Fr={name:kr,rule:Mo};function $o(e){let{text:n,description:r}=Uo(e.value);if(!n)return null;let t=Lo.exec(n);if(!t)return null;let o=t[1];if(!o)return null;let a=jo.test(o);if(e.type===mt.TSESTree.AST_TOKEN_TYPES.Line&&!a||a&&e.loc.start.line!==e.loc.end.line)return null;let i=n.slice(t.index+o.length);return{kind:o,value:i.trim(),description:r}}var _o=/\s-{2,}\s/u;function Uo(e){let n=e.split(_o);return{text:n[0]?.trim(),description:n.length>1?n[1]?.trim()??null:null}}function Wo(e){return{start:{line:e.start.line,column:-1},end:e.end}}var J=require("@typescript-eslint/utils"),Ce=require("zod/v4");var zo=Ce.z.object({varsToCheck:Ce.z.array(Ce.z.object({selector:Ce.z.string().optional(),fromFnCall:Ce.z.string().optional(),prop:Ce.z.string().or(Ce.z.array(Ce.z.string())),errorMsg:Ce.z.string().optional()}))}),fn=W({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(zo)]},defaultOptions:[{varsToCheck:[]}],create(e,[n]){let r=new Map;function t(i,p,l,c){let m=new Set;for(let s of i.properties)s.type===J.AST_NODE_TYPES.Property&&s.key.type===J.AST_NODE_TYPES.Identifier&&m.add(s.key.name);let d=p.filter(s=>!m.has(s));if(d.length>0)if(d.length===1)e.report({node:i,messageId:"propNotRead",data:{prop:d[0],fnName:c,customMsg:l||""}});else{let s=d.map(u=>`"${u}"`).join(", ");e.report({node:i,messageId:"propsNotRead",data:{props:s,fnName:c,customMsg:l||""}})}}function o(i){if(i.init?.type===J.AST_NODE_TYPES.CallExpression){if(i.init.callee.type===J.AST_NODE_TYPES.Identifier)return i.init.callee.name;if(i.init.callee.type===J.AST_NODE_TYPES.MemberExpression&&i.init.callee.property.type===J.AST_NODE_TYPES.Identifier)return i.init.callee.object.type===J.AST_NODE_TYPES.Identifier?`${i.init.callee.object.name}.${i.init.callee.property.name}`:i.init.callee.property.name}return"unknown function"}let a={};for(let i of n.varsToCheck)i.selector&&(a[i.selector]=p=>{if(p.type===J.AST_NODE_TYPES.VariableDeclarator&&p.id.type===J.AST_NODE_TYPES.Identifier&&r.set(p.id.name,{props:Array.isArray(i.prop)?i.prop:[i.prop],errorMsg:i.errorMsg,node:p.id,fnName:o(p)}),p.type===J.AST_NODE_TYPES.VariableDeclarator&&p.id.type===J.AST_NODE_TYPES.ObjectPattern){let l=Array.isArray(i.prop)?i.prop:[i.prop];t(p.id,l,i.errorMsg,o(p))}});for(let i of n.varsToCheck)if(i.fromFnCall){let p=i.fromFnCall;if(p.startsWith("*.")){let c=`VariableDeclarator > CallExpression > MemberExpression[property.name="${p.slice(2)}"]`;a[c]=m=>{if(m.type!==J.AST_NODE_TYPES.MemberExpression||m.parent.type!==J.AST_NODE_TYPES.CallExpression)return;let d=m.parent;if(d.parent.type!==J.AST_NODE_TYPES.VariableDeclarator)return;let s=d.parent;if(s.id.type===J.AST_NODE_TYPES.Identifier)r.set(s.id.name,{props:Array.isArray(i.prop)?i.prop:[i.prop],errorMsg:i.errorMsg,node:s.id,fnName:i.fromFnCall||"unknown function"});else if(s.id.type===J.AST_NODE_TYPES.ObjectPattern){let u=Array.isArray(i.prop)?i.prop:[i.prop];t(s.id,u,i.errorMsg,i.fromFnCall||"unknown function")}}}else if(p.includes(".")){let[l,c]=p.split("."),m=`VariableDeclarator > CallExpression > MemberExpression[object.name="${l}"][property.name="${c}"]`;a[m]=d=>{if(d.type!==J.AST_NODE_TYPES.MemberExpression||d.parent.type!==J.AST_NODE_TYPES.CallExpression)return;let s=d.parent;if(s.parent.type!==J.AST_NODE_TYPES.VariableDeclarator)return;let u=s.parent;if(u.id.type===J.AST_NODE_TYPES.Identifier)r.set(u.id.name,{props:Array.isArray(i.prop)?i.prop:[i.prop],errorMsg:i.errorMsg,node:u.id,fnName:i.fromFnCall||"unknown function"});else if(u.id.type===J.AST_NODE_TYPES.ObjectPattern){let y=Array.isArray(i.prop)?i.prop:[i.prop];t(u.id,y,i.errorMsg,i.fromFnCall||"unknown function")}}}else{let l=`VariableDeclarator > CallExpression > Identifier[name="${p}"]`;a[l]=c=>{if(c.type!==J.AST_NODE_TYPES.Identifier||c.parent.type!==J.AST_NODE_TYPES.CallExpression)return;let m=c.parent;if(m.parent.type!==J.AST_NODE_TYPES.VariableDeclarator)return;let d=m.parent;if(d.id.type===J.AST_NODE_TYPES.Identifier)r.set(d.id.name,{props:Array.isArray(i.prop)?i.prop:[i.prop],errorMsg:i.errorMsg,node:d.id,fnName:i.fromFnCall||"unknown function"});else if(d.id.type===J.AST_NODE_TYPES.ObjectPattern){let s=Array.isArray(i.prop)?i.prop:[i.prop];t(d.id,s,i.errorMsg,i.fromFnCall||"unknown function")}}}}return{...a,"Program:exit"(){for(let[i,{props:p,errorMsg:l,node:c,fnName:m}]of r){let s=e.sourceCode.getScope(c).set.get(i);if(s){let u=new Set(p);for(let y of s.references){let g=y.identifier,S=g.parent;if(!(S.type===J.AST_NODE_TYPES.VariableDeclarator&&S.id===g)){if(S.type===J.AST_NODE_TYPES.MemberExpression&&S.object===g&&S.property.type===J.AST_NODE_TYPES.Identifier&&u.has(S.property.name)){if(u.delete(S.property.name),u.size===0)break;continue}if(S.type===J.AST_NODE_TYPES.VariableDeclarator&&S.init===g&&S.id.type===J.AST_NODE_TYPES.ObjectPattern){for(let f of S.id.properties)f.type===J.AST_NODE_TYPES.Property&&f.key.type===J.AST_NODE_TYPES.Identifier&&u.has(f.key.name)&&u.delete(f.key.name);if(u.size===0)break;continue}if(!(S.type===J.AST_NODE_TYPES.MemberExpression&&S.object===g&&S.property.type===J.AST_NODE_TYPES.Identifier&&!p.includes(S.property.name))){u.clear();break}}}if(u.size>0){let y=Array.from(u);if(y.length===1)e.report({node:c,messageId:"propNotRead",data:{prop:y[0],fnName:m,customMsg:l||""}});else{let g=y.map(S=>`"${S}"`).join(", ");e.report({node:c,messageId:"propsNotRead",data:{props:g,fnName:m,customMsg:l||""}})}}}}}}}});function Nr(e){return/^use[A-Z0-9]/.test(e)}function yt(e){return e.type==="Identifier"?Nr(e.name):e.type==="MemberExpression"&&!e.computed&&yt(e.property)?e.object.type==="Identifier":!1}function Dr(e){return e.type==="Identifier"&&/^[A-Z]/.test(e.name)}function Lr(e,n){return e.name===n||e.type==="MemberExpression"&&e.object.name==="React"&&e.property.name===n}function jr(e){return!!(e.parent&&e.parent.callee&&Lr(e.parent.callee,"forwardRef"))}function Mr(e){return!!(e.parent&&e.parent.callee&&Lr(e.parent.callee,"memo"))}function mn(e){for(;e;){let n=_r(e);if(n&&(Dr(n)||yt(n))||jr(e)||Mr(e))return!0;e=e.parent}return!1}function Pr(e){return!1}function yn(e){return!1}var Jo=/eslint +react-compiler\/react-compiler: +\["error/,$r={meta:{type:"problem",docs:{description:"enforces the Rules of Hooks",recommended:!0,url:"https://reactjs.org/docs/hooks-rules.html"},schema:[{type:"object",ignoreIfReactCompilerIsEnabled:!1,properties:{ignoreIfReactCompilerIsEnabled:{type:"boolean"}}}]},create(e){if(e.options[0]?.ignoreIfReactCompilerIsEnabled){for(let l of e.sourceCode.getAllComments())if(Jo.test(l.value))return{CallExpression(c){let m=null;c.callee.name==="useMemo"?m="useMemo":c.callee.name==="useCallback"&&(m="useCallback"),m&&e.report({node:c,message:`"${m}" is not necessary when using React Compiler.`})}}}let n=typeof e.getSource=="function"?l=>n(l):l=>e.sourceCode.getText(l),r=typeof e.getScope=="function"?()=>r():l=>e.sourceCode.getScope(l),t=null,o=[],a=[],i=new WeakSet;function p(l){for(let c of l.references){let m=c.identifier.parent;if(m.type==="VariableDeclarator"&&m.init&&m.init.type==="CallExpression"&&m.init.callee&&Pr(m.init.callee))for(let d of c.resolved.references)d!==c&&i.add(d.identifier)}}return{onCodePathSegmentStart:l=>a.push(l),onCodePathSegmentEnd:()=>a.pop(),onCodePathStart:()=>o.push(new Map),onCodePathEnd(l,c){let m=o.pop();if(m.size===0)return;let d=new Set;function s(h,I){let{cache:E}=s,C=E.get(h.id),w=new Set(I);if(w.has(h.id)){let R=[...w],L=R.slice(R.indexOf(h.id)+1);for(let U of L)d.add(U);return BigInt("0")}if(w.add(h.id),C!==void 0)return C;if(l.thrownSegments.includes(h))C=BigInt("0");else if(h.prevSegments.length===0)C=BigInt("1");else{C=BigInt("0");for(let R of h.prevSegments)C+=s(R,w)}return h.reachable&&C===BigInt("0")?E.delete(h.id):E.set(h.id,C),C}function u(h,I){let{cache:E}=u,C=E.get(h.id),w=new Set(I);if(w.has(h.id)){let R=Array.from(w),L=R.slice(R.indexOf(h.id)+1);for(let U of L)d.add(U);return BigInt("0")}if(w.add(h.id),C!==void 0)return C;if(l.thrownSegments.includes(h))C=BigInt("0");else if(h.nextSegments.length===0)C=BigInt("1");else{C=BigInt("0");for(let R of h.nextSegments)C+=u(R,w)}return E.set(h.id,C),C}function y(h){let{cache:I}=y,E=I.get(h.id);if(E===null)return 1/0;if(E!==void 0)return E;if(I.set(h.id,null),h.prevSegments.length===0)E=1;else{E=1/0;for(let C of h.prevSegments){let w=y(C);w<E&&(E=w)}E+=1}return I.set(h.id,E),E}s.cache=new Map,u.cache=new Map,y.cache=new Map;let g=u(l.initialSegment),S=_r(c),f=mn(c),T=S?Dr(S)||yt(S):jr(c)||Mr(c),b=1/0;for(let h of l.finalSegments){if(!h.reachable)continue;let I=y(h);I<b&&(b=I)}for(let[h,I]of m){if(!h.reachable)continue;let E=h.nextSegments.length===0?b<=y(h):b<y(h),C=s(h)*u(h),w=d.has(h.id);for(let R of I)if(w&&!yn(R)&&e.report({node:R,message:`React Hook "${n(R)}" 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.`}),T){if(c.async&&e.report({node:R,message:`React Hook "${n(R)}" cannot be called in an async function.`}),!w&&C!==g&&!yn(R)){let U=`React Hook "${n(R)}" is called conditionally. React Hooks must be called in the exact same order in every component render.`+(E?" Did you accidentally call a React Hook after an early return?":"");e.report({node:R,message:U})}}else if(c.parent&&(c.parent.type==="MethodDefinition"||c.parent.type==="ClassProperty")&&c.parent.value===c){let L=`React Hook "${n(R)}" 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:R,message:L})}else if(S){let L=`React Hook "${n(R)}" is called in function "${n(S)}" that is neither a React function component nor a custom React Hook function. React component names must start with an uppercase letter. React Hook names must start with the word "use".`;e.report({node:R,message:L})}else if(c.type==="Program"){let L=`React Hook "${n(R)}" 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:R,message:L})}else if(f&&!yn(R)){if(c.parent.type==="CallExpression"&&c.parent.callee.type==="Identifier"&&c.parent.callee.name==="useCallback"){let U=c.parent;if(U.parent.type==="VariableDeclarator"&&Nr(U.parent.id.name))return}let L=`React Hook "${n(R)}" 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:R,message:L})}}},CallExpression(l){if(yt(l.callee)){let c=Or(o),m=Or(a),d=c.get(m);d||(d=[],c.set(m,d)),d.push(l.callee)}l.callee.type==="Identifier"&&(l.callee.name==="useEffect"||Pr(l.callee))&&l.arguments.length>0&&(t=l)},Identifier(l){t==null&&i.has(l)&&l.parent.type!=="CallExpression"&&e.report({node:l,message:`\`${n(l)}\` 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"(l){l===t&&(t=null)},FunctionDeclaration(l){mn(l)&&p(r(l))},ArrowFunctionExpression(l){mn(l)&&p(r(l))}}}};function _r(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 Or(e){return e[e.length-1]}var re=require("@typescript-eslint/utils"),pe=Se(require("zod/v4"));var Vo=/^\s+$/,dn=/\r?\n/,Xo=/^(\s*)/,Ho=/^(\s*)\S/,Bo=/\r?\n/,Yo=pe.object({indent:pe.union([pe.string().regex(Vo),pe.number().int().min(1)]).optional(),tags:pe.array(pe.string()).optional(),functions:pe.array(pe.string()).optional(),comments:pe.array(pe.string()).optional()}),gn=W({name:"template-indent",meta:{type:"suggestion",docs:{description:"Fix whitespace-insensitive template indentation"},fixable:"code",schema:[j(Yo)],messages:{improperlyIndented:"Templates should be properly indented."}},defaultOptions:[{}],create(e){let n=e.sourceCode,{comments:r=["HTML","indent"],functions:t=["dedent","stripIndent"],tags:o=["outdent","dedent","gql","sql","html","styled"],indent:a}=e.options[0],i=r.map(f=>f.toLowerCase());function p(f){let T=f.split(dn),b=T.filter(I=>I.trim()!=="");if(b.length===0)return f;let h=Number.POSITIVE_INFINITY;for(let I of b){let E=I.match(Xo);E&&(h=Math.min(h,E[1]?.length??0))}return!isFinite(h)||h===0?f:T.map(I=>I.slice(h)).join(`
36
+ `)}function l(f,T,b){return f.split(dn).map(I=>I.trim()===""?I:b.repeat(T)+I).join(`
37
+ `)}function c(f){if(f.type===re.AST_NODE_TYPES.Identifier)return f.name;if(f.type===re.AST_NODE_TYPES.MemberExpression){let T=f.object.type===re.AST_NODE_TYPES.Identifier?f.object.name:null,b=f.property.type===re.AST_NODE_TYPES.Identifier?f.property.name:null;return T&&b?`${T}.${b}`:b}return null}function m(f,T){if(!f)return!1;for(let b of T)if(b.includes(".")){let h=b.split(".");if(f.type===re.AST_NODE_TYPES.MemberExpression&&f.object.type===re.AST_NODE_TYPES.Identifier&&f.property.type===re.AST_NODE_TYPES.Identifier&&f.object.name===h[0]&&f.property.name===h[1])return!0}else if(f.type===re.AST_NODE_TYPES.Identifier&&f.name===b)return!0;return!1}function d(f,T){let b=f.parent;if(b.type!==re.AST_NODE_TYPES.TaggedTemplateExpression)return!1;let h=c(b.tag);return h?T.includes(h):!1}function s(f,T){if(!f||f.type!==re.AST_NODE_TYPES.CallExpression)return!1;let{method:b,argumentsLength:h,optionalCall:I=!0,optionalMember:E=!0}=T;return h!==void 0&&f.arguments.length!==h||!I&&f.optional||f.callee.type!==re.AST_NODE_TYPES.MemberExpression||!E&&f.callee.optional||f.callee.property.type!==re.AST_NODE_TYPES.Identifier?!1:f.callee.property.name===b}function u(f,T){if(!f||f.type!==re.AST_NODE_TYPES.CallExpression)return!1;let{name:b,argumentsLength:h,optionalCall:I=!0}=T;return h!==void 0&&f.arguments.length!==h||!I&&f.optional||f.callee.type!==re.AST_NODE_TYPES.Identifier?!1:f.callee.name===b}function y(f){return s(f.parent,{method:"toMatchInlineSnapshot",argumentsLength:1,optionalCall:!1,optionalMember:!1})&&f.parent.type===re.AST_NODE_TYPES.CallExpression&&f.parent.arguments[0]===f&&u(f.parent.callee.type===re.AST_NODE_TYPES.MemberExpression?f.parent.callee.object:null,{name:"expect",argumentsLength:1,optionalCall:!1,optionalMember:!1})}function g(f){if(i.length>0){let T=n.getTokenBefore(f,{includeComments:!0});if(T?.type===re.AST_TOKEN_TYPES.Block&&i.includes(T.value.trim().toLowerCase()))return!0}return!!(y(f)||o.length>0&&d(f,o)||t.length>0&&f.parent.type===re.AST_NODE_TYPES.CallExpression&&f.parent.arguments.includes(f)&&m(f.parent.callee,t))}function S(f){let T=`__PLACEHOLDER__${Math.random()}`,b=f.quasis.map(q=>n.getText(q).slice(1,q.tail?-1:-2)).join(T),h=b.match(Bo);if(!h)return;let I=h[0],E=n.lines[n.getLocFromIndex(f.range[0]).line-1];if(!E)return;let w=E.match(Ho)?.[1]??"",R;typeof a=="string"?R=a:typeof a=="number"?R=" ".repeat(a):R=w.startsWith(" ")?" ":" ";let U=p(b).replace(new RegExp(`^${I}|${I}[ ]*$`,"g"),""),te=I+l(U,1,w+R)+I+w,K=b.includes(`\r
38
38
  `)?`\r
39
39
  `:`
40
- `,ie=b.split(yn),se=ie.map((q,Te)=>Te!==ie.length-1&&q===R+w?"":q).join(K);if(te!==se)return{node:f,messageId:"improperlyIndented",fix:q=>te.split(T).map((Te,_e)=>{let ae=f.quasis[_e];return ae?q.replaceTextRange([ae.range[0]+1,ae.range[1]-(ae.tail?1:2)],Te):[]}).flat()}}return{TemplateLiteral(f){if(!g(f))return;let T=S(f);if(T)return e.report(T)}}}});var gn=require("@typescript-eslint/utils");function Ho(e){if(!("regex"in e))return!1;let n=e.regex.flags;return n.includes("g")||n.includes("y")}function Bo(e){let n=e.parent;return n?.type===gn.AST_NODE_TYPES.NewExpression&&n.callee.type===gn.AST_NODE_TYPES.Identifier&&n.callee.name==="RegExp"}var Sn=V({name:"use-top-level-regex",meta:{type:"suggestion",docs:{description:"Require regex literals to be declared at the top level to avoid performance issues"},messages:{regexShouldBeTopLevel:"Move this regex literal to the top level to avoid creating new RegExp objects on each function call."},schema:[],hasSuggestions:!1},defaultOptions:[],create(e){function n(r){Ho(r)||Bo(r)||e.report({node:r,messageId:"regexShouldBeTopLevel"})}return{"FunctionDeclaration Literal[regex], FunctionExpression Literal[regex], ArrowFunctionExpression Literal[regex], MethodDefinition Literal[regex]":n}}});var ce=require("@typescript-eslint/utils"),Ve=require("zod/v4");var Yo=Ve.z.object({checkOnly:Ve.z.array(Ve.z.enum(["function-args","FC","generic-args-at-fn-calls"])).optional(),checkTypesFromSelectors:Ve.z.array(Ve.z.string()).optional()}),Tn=V({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(Yo)],messages:{moveTypeAboveUsage:"Type definition should be placed directly above its first usage."}},defaultOptions:[{}],create(e,[n]){let r=e.sourceCode,t=new Map,o=[];function a(s){for(let u of o)if(s.range[0]>=u.range[0]&&s.range[1]<=u.range[1])return u;return null}function i(s){let u=s.parent;for(;u;){if(u.type===ce.AST_NODE_TYPES.FunctionDeclaration||u.type===ce.AST_NODE_TYPES.FunctionExpression||u.type===ce.AST_NODE_TYPES.ArrowFunctionExpression){let y=u.params;for(let g of y)if(s.range[0]>=g.range[0]&&s.range[1]<=g.range[1])return!0;break}u=u.parent}return!1}function c(s){let u=s.parent;for(;u;){if(u.type===ce.AST_NODE_TYPES.TSTypeParameterInstantiation){let y=u.parent;if(y.type===ce.AST_NODE_TYPES.TSTypeReference&&y.typeName.type===ce.AST_NODE_TYPES.Identifier&&(y.typeName.name==="FC"||y.typeName.name==="React.FC")||y.type===ce.AST_NODE_TYPES.TSTypeReference&&y.typeName.type===ce.AST_NODE_TYPES.TSQualifiedName&&y.typeName.right.name==="FC")return!0}u=u.parent}return!1}function l(s){let u=s.parent;for(;u;){if(u.type===ce.AST_NODE_TYPES.TSTypeParameterInstantiation){let y=u.parent;if(y.type===ce.AST_NODE_TYPES.CallExpression||y.type===ce.AST_NODE_TYPES.NewExpression)return!0}u=u.parent}return!1}let p=[];function m(s){let u=[],y=new Map;for(let{typeName:S,firstUsage:f}of s){let T=y.get(f)||[];T.push(S),y.set(f,T)}for(let{typeName:S,firstUsage:f,firstUsagePosition:T,firstUsageInFunctionArgs:b}of s){let h=t.get(S);if(!h||h.statement===f)continue;let I=o.indexOf(h.statement),E=o.indexOf(f);if(I===-1||E===-1)continue;let C=!!(n.checkOnly&&n.checkOnly.includes("function-args")&&b),R=(y.get(f)||[]).length>1;(C||R?I>E:I>E||I!==E-1)&&u.push({typeName:S,typeDef:h,targetStatement:f,firstUsagePosition:T})}if(u.length===0)return;u.sort((S,f)=>{let T=S.firstUsagePosition-f.firstUsagePosition;if(T!==0)return T;let b=o.indexOf(S.typeDef.statement),h=o.indexOf(f.typeDef.statement);return b-h});let g=u[0];g&&e.report({node:g.typeDef.node,messageId:"moveTypeAboveUsage",fix:d(u)})}function d(s){return function*(u){let y=new Map;for(let g of s){let S=y.get(g.targetStatement)||[];S.push(g),y.set(g.targetStatement,S)}for(let[,g]of y)g.sort((S,f)=>{let T=S.firstUsagePosition-f.firstUsagePosition;if(T!==0)return T;let b=o.indexOf(S.typeDef.statement),h=o.indexOf(f.typeDef.statement);return b-h});for(let g of s){let{typeDef:S}=g,f=S.statement,T=r.getCommentsBefore(f),b=f.range[0],h=f.range[1];T.length>0&&T[0]&&(b=T[0].range[0]),yield u.removeRange([b,h])}for(let[g,S]of y){let f=r.getCommentsBefore(g),T=f.length>0&&f[0]?f[0].range[0]:g.range[0],b=[];for(let h of S){let I=h.typeDef.statement,E=r.getText(I),C=r.getCommentsBefore(I),w=E;C.length>0&&(w=`${C.map(L=>r.getText(L)).join(`
40
+ `,ie=b.split(dn),se=ie.map((q,he)=>he!==ie.length-1&&q===R+w?"":q).join(K);if(te!==se)return{node:f,messageId:"improperlyIndented",fix:q=>te.split(T).map((he,_e)=>{let ae=f.quasis[_e];return ae?q.replaceTextRange([ae.range[0]+1,ae.range[1]-(ae.tail?1:2)],he):[]}).flat()}}return{TemplateLiteral(f){if(!g(f))return;let T=S(f);if(T)return e.report(T)}}}});var Sn=require("@typescript-eslint/utils");function qo(e){if(!("regex"in e))return!1;let n=e.regex.flags;return n.includes("g")||n.includes("y")}function Zo(e){let n=e.parent;return n?.type===Sn.AST_NODE_TYPES.NewExpression&&n.callee.type===Sn.AST_NODE_TYPES.Identifier&&n.callee.name==="RegExp"}var Tn=W({name:"use-top-level-regex",meta:{type:"suggestion",docs:{description:"Require regex literals to be declared at the top level to avoid performance issues"},messages:{regexShouldBeTopLevel:"Move this regex literal to the top level to avoid creating new RegExp objects on each function call."},schema:[],hasSuggestions:!1},defaultOptions:[],create(e){function n(r){qo(r)||Zo(r)||e.report({node:r,messageId:"regexShouldBeTopLevel"})}return{"FunctionDeclaration Literal[regex], FunctionExpression Literal[regex], ArrowFunctionExpression Literal[regex], MethodDefinition Literal[regex]":n}}});var ce=require("@typescript-eslint/utils"),Ve=require("zod/v4");var Go=Ve.z.object({checkOnly:Ve.z.array(Ve.z.enum(["function-args","FC","generic-args-at-fn-calls"])).optional(),checkTypesFromSelectors:Ve.z.array(Ve.z.string()).optional()}),hn=W({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(Go)],messages:{moveTypeAboveUsage:"Type definition should be placed directly above its first usage."}},defaultOptions:[{}],create(e,[n]){let r=e.sourceCode,t=new Map,o=[];function a(s){for(let u of o)if(s.range[0]>=u.range[0]&&s.range[1]<=u.range[1])return u;return null}function i(s){let u=s.parent;for(;u;){if(u.type===ce.AST_NODE_TYPES.FunctionDeclaration||u.type===ce.AST_NODE_TYPES.FunctionExpression||u.type===ce.AST_NODE_TYPES.ArrowFunctionExpression){let y=u.params;for(let g of y)if(s.range[0]>=g.range[0]&&s.range[1]<=g.range[1])return!0;break}u=u.parent}return!1}function p(s){let u=s.parent;for(;u;){if(u.type===ce.AST_NODE_TYPES.TSTypeParameterInstantiation){let y=u.parent;if(y.type===ce.AST_NODE_TYPES.TSTypeReference&&y.typeName.type===ce.AST_NODE_TYPES.Identifier&&(y.typeName.name==="FC"||y.typeName.name==="React.FC")||y.type===ce.AST_NODE_TYPES.TSTypeReference&&y.typeName.type===ce.AST_NODE_TYPES.TSQualifiedName&&y.typeName.right.name==="FC")return!0}u=u.parent}return!1}function l(s){let u=s.parent;for(;u;){if(u.type===ce.AST_NODE_TYPES.TSTypeParameterInstantiation){let y=u.parent;if(y.type===ce.AST_NODE_TYPES.CallExpression||y.type===ce.AST_NODE_TYPES.NewExpression)return!0}u=u.parent}return!1}let c=[];function m(s){let u=[],y=new Map;for(let{typeName:S,firstUsage:f}of s){let T=y.get(f)||[];T.push(S),y.set(f,T)}for(let{typeName:S,firstUsage:f,firstUsagePosition:T,firstUsageInFunctionArgs:b}of s){let h=t.get(S);if(!h||h.statement===f)continue;let I=o.indexOf(h.statement),E=o.indexOf(f);if(I===-1||E===-1)continue;let C=!!(n.checkOnly&&n.checkOnly.includes("function-args")&&b),R=(y.get(f)||[]).length>1;(C||R?I>E:I>E||I!==E-1)&&u.push({typeName:S,typeDef:h,targetStatement:f,firstUsagePosition:T})}if(u.length===0)return;u.sort((S,f)=>{let T=S.firstUsagePosition-f.firstUsagePosition;if(T!==0)return T;let b=o.indexOf(S.typeDef.statement),h=o.indexOf(f.typeDef.statement);return b-h});let g=u[0];g&&e.report({node:g.typeDef.node,messageId:"moveTypeAboveUsage",fix:d(u)})}function d(s){return function*(u){let y=new Map;for(let g of s){let S=y.get(g.targetStatement)||[];S.push(g),y.set(g.targetStatement,S)}for(let[,g]of y)g.sort((S,f)=>{let T=S.firstUsagePosition-f.firstUsagePosition;if(T!==0)return T;let b=o.indexOf(S.typeDef.statement),h=o.indexOf(f.typeDef.statement);return b-h});for(let g of s){let{typeDef:S}=g,f=S.statement,T=r.getCommentsBefore(f),b=f.range[0],h=f.range[1];T.length>0&&T[0]&&(b=T[0].range[0]),yield u.removeRange([b,h])}for(let[g,S]of y){let f=r.getCommentsBefore(g),T=f.length>0&&f[0]?f[0].range[0]:g.range[0],b=[];for(let h of S){let I=h.typeDef.statement,E=r.getText(I),C=r.getCommentsBefore(I),w=E;C.length>0&&(w=`${C.map(L=>r.getText(L)).join(`
41
41
  `)}
42
42
  ${E}`),b.push(w)}yield u.insertTextBeforeRange([T,T],`${b.join(`
43
43
 
44
44
  `)}
45
45
 
46
- `)}}}return{Program(s){o.push(...s.body)},TSTypeAliasDeclaration(s){if(o.some(y=>y.type===ce.AST_NODE_TYPES.ExportNamedDeclaration&&y.declaration===s?!0:y===s)){let y=a(s);y&&t.set(s.id.name,{node:s,name:s.id.name,statement:y})}},TSInterfaceDeclaration(s){if(o.some(y=>y.type===ce.AST_NODE_TYPES.ExportNamedDeclaration&&y.declaration===s?!0:y===s)){let y=a(s);y&&t.set(s.id.name,{node:s,name:s.id.name,statement:y})}},TSTypeReference(s){if(s.typeName.type===ce.AST_NODE_TYPES.Identifier){let u=i(s),y=c(s),g=l(s);p.push({typeName:s.typeName.name,node:s,inFunctionArgs:u,inFCProps:y,inGenericArgAtFunctionCall:g,usagePosition:s.range[0]})}},"Program:exit"(){let s=new Map,u=p.filter(g=>{if(!n.checkOnly||n.checkOnly.length===0)return!0;for(let S of n.checkOnly)if(S==="function-args"&&g.inFunctionArgs||S==="FC"&&g.inFCProps||S==="generic-args-at-fn-calls"&&g.inGenericArgAtFunctionCall)return!0;return!1});for(let g of u){let{typeName:S,node:f}=g;if(t.has(S)){let T=a(f),b=t.get(S);if(T&&b&&T!==b.statement){s.has(S)||s.set(S,[]);let h=s.get(S);if(!h)return;h.includes(T)||h.push(T)}}}let y=[];for(let[g,S]of s)if(S.length>0){let f=S[0];if(!f)continue;let T=Number.MAX_SAFE_INTEGER,b=!1;for(let h of S)h.range[0]<f.range[0]&&(f=h);for(let h of u)h.typeName===g&&a(h.node)===f&&h.usagePosition<T&&(T=h.usagePosition,b=h.inFunctionArgs);y.push({typeName:g,firstUsage:f,firstUsagePosition:T,firstUsageInFunctionArgs:b})}y.length>0&&m(y)}}}});var Mr={[Yt.name]:Yt.rule,[vt.name]:vt.rule,[wt.name]:wt.rule,"rules-of-hooks":Lr,"exhaustive-deps":Fn,"require-description":wr.rule,[kt.name]:kt.rule,[Pt.name]:Pt.rule,[Zt.name]:Zt.rule,[gt.name]:gt.rule,[Rt.name]:Rt.rule,[Nt.name]:Nt.rule,[Be.name]:Be.rule,[Qt.name]:Qt.rule,[Ot.name]:Ot.rule,[Ft.name]:Ft.rule,[Lt.name]:Lt.rule,[Tt.name]:Tt.rule,[on.name]:on.rule,[sn.name]:sn.rule,[cn.name]:cn.rule,[It.name]:It.rule,[_t.name]:_t.rule,[Ut.name]:Ut.rule,[Wt.name]:Wt.rule,[Xt.name]:Xt.rule,[Ht.name]:Ht.rule,[zt.name]:zt.rule,[Vt.name]:Vt.rule,[Kt.name]:Kt.rule,[Mt.name]:Mt.rule,[jt.name]:jt.rule,[Sn.name]:Sn.rule,[qt.name]:qt.rule,[un.name]:un.rule,[dn.name]:dn.rule,[Tn.name]:Tn.rule,[Be.name]:Be.rule};var qo={rules:Mr};0&&(module.exports={extendedLintPlugin});
46
+ `)}}}return{Program(s){o.push(...s.body)},TSTypeAliasDeclaration(s){if(o.some(y=>y.type===ce.AST_NODE_TYPES.ExportNamedDeclaration&&y.declaration===s?!0:y===s)){let y=a(s);y&&t.set(s.id.name,{node:s,name:s.id.name,statement:y})}},TSInterfaceDeclaration(s){if(o.some(y=>y.type===ce.AST_NODE_TYPES.ExportNamedDeclaration&&y.declaration===s?!0:y===s)){let y=a(s);y&&t.set(s.id.name,{node:s,name:s.id.name,statement:y})}},TSTypeReference(s){if(s.typeName.type===ce.AST_NODE_TYPES.Identifier){let u=i(s),y=p(s),g=l(s);c.push({typeName:s.typeName.name,node:s,inFunctionArgs:u,inFCProps:y,inGenericArgAtFunctionCall:g,usagePosition:s.range[0]})}},"Program:exit"(){let s=new Map,u=c.filter(g=>{if(!n.checkOnly||n.checkOnly.length===0)return!0;for(let S of n.checkOnly)if(S==="function-args"&&g.inFunctionArgs||S==="FC"&&g.inFCProps||S==="generic-args-at-fn-calls"&&g.inGenericArgAtFunctionCall)return!0;return!1});for(let g of u){let{typeName:S,node:f}=g;if(t.has(S)){let T=a(f),b=t.get(S);if(T&&b&&T!==b.statement){s.has(S)||s.set(S,[]);let h=s.get(S);if(!h)return;h.includes(T)||h.push(T)}}}let y=[];for(let[g,S]of s)if(S.length>0){let f=S[0];if(!f)continue;let T=Number.MAX_SAFE_INTEGER,b=!1;for(let h of S)h.range[0]<f.range[0]&&(f=h);for(let h of u)h.typeName===g&&a(h.node)===f&&h.usagePosition<T&&(T=h.usagePosition,b=h.inFunctionArgs);y.push({typeName:g,firstUsage:f,firstUsagePosition:T,firstUsageInFunctionArgs:b})}y.length>0&&m(y)}}}});var En=require("@typescript-eslint/utils"),Xe=Se(require("zod/v4"));var Ko=["tsx"],Qo=Xe.object({extensions:Xe.array(Xe.string()).optional()}),bn=W({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. Type-only exports are allowed."},schema:[j(Qo)]},defaultOptions:[{}],create(e,[n]){let r=e.filename,t=e.sourceCode,o=n.extensions||Ko;function a(){if(!o.some(c=>r.endsWith(`.${c}`)))return!1;let l=t.text;return l.includes("jsx")||l.includes("<")||l.includes("React")||l.includes("from 'react'")||l.includes('from "react"')}if(!a())return{};let i=[];return{ExportDefaultDeclaration(p){i.push(p),i.length>1&&e.report({node:p,messageId:"multipleExports"})},ExportNamedDeclaration(p){p.exportKind!=="type"&&(p.specifiers.length>0&&!p.specifiers.some(c=>c.exportKind!=="type")||p.declaration&&(p.declaration.type===En.AST_NODE_TYPES.TSTypeAliasDeclaration||p.declaration.type===En.AST_NODE_TYPES.TSInterfaceDeclaration)||(i.push(p),i.length>1&&e.report({node:p,messageId:"multipleExports"})))}}}});var Ur={[qt.name]:qt.rule,[kt.name]:kt.rule,[vt.name]:vt.rule,"rules-of-hooks":$r,"exhaustive-deps":Nn,"require-description":Fr.rule,[Ft.name]:Ft.rule,[Ot.name]:Ot.rule,[Gt.name]:Gt.rule,[St.name]:St.rule,[wt.name]:wt.rule,[Dt.name]:Dt.rule,[Ye.name]:Ye.rule,[en.name]:en.rule,[Nt.name]:Nt.rule,[Pt.name]:Pt.rule,[jt.name]:jt.rule,[ht.name]:ht.rule,[an.name]:an.rule,[on.name]:on.rule,[un.name]:un.rule,[Rt.name]:Rt.rule,[Ut.name]:Ut.rule,[Wt.name]:Wt.rule,[zt.name]:zt.rule,[Ht.name]:Ht.rule,[Bt.name]:Bt.rule,[Jt.name]:Jt.rule,[Xt.name]:Xt.rule,[Qt.name]:Qt.rule,[$t.name]:$t.rule,[Mt.name]:Mt.rule,[Tn.name]:Tn.rule,[Zt.name]:Zt.rule,[fn.name]:fn.rule,[gn.name]:gn.rule,[hn.name]:hn.rule,[bn.name]:bn.rule,[Ye.name]:Ye.rule};var ea={rules:Ur};0&&(module.exports={extendedLintPlugin});