@ls-stack/extended-lint 0.65.0 → 0.66.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
- "use strict";var _r=Object.create;var et=Object.defineProperty;var Ur=Object.getOwnPropertyDescriptor;var Wr=Object.getOwnPropertyNames;var zr=Object.getPrototypeOf,Jr=Object.prototype.hasOwnProperty;var Vr=(e,n)=>{for(var r in n)et(e,r,{get:n[r],enumerable:!0})},hn=(e,n,r,t)=>{if(n&&typeof n=="object"||typeof n=="function")for(let s of Wr(n))!Jr.call(e,s)&&s!==r&&et(e,s,{get:()=>n[s],enumerable:!(t=Ur(n,s))||t.enumerable});return e};var Ce=(e,n,r)=>(r=e!=null?_r(zr(e)):{},hn(n||!e||!e.__esModule?et(r,"default",{value:e,enumerable:!0}):r,e)),Xr=e=>hn(et({},"__esModule",{value:!0}),e);var Ho={};Vr(Ho,{extendedLintPlugin:()=>Xo});module.exports=Xr(Ho);var oe=require("@typescript-eslint/utils"),v=require("zod/v4");var En=require("@typescript-eslint/utils"),bn=Ce(require("zod/v4"));function X(e){let r=En.ESLintUtils.RuleCreator(t=>`https://github.com/lucasols/extended-lint#${t}`)(e);return{name:e.name,rule:r}}function j(e){return bn.toJSONSchema(e)}var Hr=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()})))})))}),yt=X({name:"advanced-no-restricted-syntax",meta:{type:"suggestion",docs:{description:"Disallow specific syntax patterns"},schema:[j(Hr)],messages:{default:"{{message}}"},fixable:"code",hasSuggestions:!0},defaultOptions:[{disallow:[]}],create(e,[n]){let r={},{mustMatchSyntax:t,__dev_simulateFileName:s,disallow:a,disallowFnCalls:i}=n,p=s??e.filename,l=[],c=new Map,y=new Set,d=new Map,o=new Set,u=new Map;function m(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(o)){let[R,L]=w.split(":");R===C&&(L==="function"||L==="any")&&o.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(o)){let[L,U]=R.split(":");L===w&&(U==="variable"||U==="any")&&o.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(o)){let[L,U]=R.split(":");L===w&&U==="any"&&o.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=Br(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 ")}`;y.add(ie),l.push(se=>{let{callee:q}=se;if(q.type===oe.AST_NODE_TYPES.Identifier){for(let{fn:Se,withArgs:$e}of te)if(q.name===Se){y.delete(ie);for(let ae of $e){let we=se.arguments[ae.atIndex],fe=typeof ae.literal=="string"?U(ae.literal):ae.literal;if(!we){e.report({node:se,messageId:"default",data:{message:`Missing argument with value "${fe}" at index ${ae.atIndex}${K?`: ${U(K)}`:""}`}});continue}if(we.type!==oe.AST_NODE_TYPES.Literal){e.report({node:we,messageId:"default",data:{message:`Argument at position ${ae.atIndex} should the literal "${fe}"${K?`: ${U(K)}`:""}`}});continue}we.value!==fe&&e.report({node:we,messageId:"default",data:{message:`Argument should have the value "${fe}"${K?`: ${U(K)}`:""}`},fix:De=>De.replaceText(we,typeof fe=="string"?`'${fe}'`:String(fe))})}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);o.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&&m(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 y)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 o){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 Br(e,n){let r=[],t=n.exec(e);if(!t)return null;let[s,...a]=t;r.push({name:"$0_lowercase",value:s.toLowerCase()}),r.push({name:"$0_capitalize",value:xn(s)}),r.push({name:"$0_uncapitalize",value:Cn(s)}),r.push({name:"$0",value:s});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:xn(l)}),r.push({name:`${p}_uncapitalize`,value:Cn(l)}),r.push({name:p,value:l}))}return r}function xn(e){return e.charAt(0).toUpperCase()+e.slice(1)}function Cn(e){return e.charAt(0).toLowerCase()+e.slice(1)}var z=require("@typescript-eslint/utils"),ke=require("zod/v4");var Yr=z.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),In="collapse-simple-objs-in-one-line",qr=ke.z.object({maxLineLength:ke.z.number().optional(),maxProperties:ke.z.number().optional(),nestedObjMaxLineLength:ke.z.number().optional(),nestedObjMaxProperties:ke.z.number().optional(),ignoreTypesWithSuffix:ke.z.array(ke.z.string()).optional()}),Zr=Yr({name:In,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(qr)]},defaultOptions:[{}],create(e,[n]){let r=e.sourceCode,t=n.ignoreTypesWithSuffix??[],s=n.maxProperties??2,a=n.nestedObjMaxLineLength??n.maxLineLength,i=n.nestedObjMaxProperties??3;function p(c){if(c.type===z.AST_NODE_TYPES.ObjectExpression){let y=c.parent.type===z.AST_NODE_TYPES.Property,d=y?i:s,o=c.properties.length;if(o>d)return!1;if(o===1){let m=c.properties[0];return!m||m.type===z.AST_NODE_TYPES.Property&&m.value.type===z.AST_NODE_TYPES.ObjectExpression||m.type===z.AST_NODE_TYPES.Property&&m.value.type===z.AST_NODE_TYPES.ArrayExpression&&!m.value.elements.every(S=>S&&dt(S))?!1:{text:r.getText(m),isNested:y,propsSize:o}}let u=[];for(let m of c.properties){if(m.type===z.AST_NODE_TYPES.Property&&!dt(m.value))return!1;u.push(r.getText(m))}return{text:u.join(", "),isNested:y,propsSize:o}}else{let y=c.parent.parent?.type===z.AST_NODE_TYPES.TSPropertySignature,d=y?i:s,o=c.members.length;if(o>d)return!1;if(t.length>0&&c.parent.type===z.AST_NODE_TYPES.TSTypeAliasDeclaration){let m=c.parent.id.name;if(t.some(g=>m.endsWith(g)))return!1}if(o===1){let m=c.members[0];return!m||m.type===z.AST_NODE_TYPES.TSPropertySignature&&m.typeAnnotation?.typeAnnotation.type===z.AST_NODE_TYPES.TSTypeLiteral?!1:{text:r.getText(m),isNested:y,propsSize:1}}if(c.parent.type===z.AST_NODE_TYPES.TSIntersectionType||c.parent.type===z.AST_NODE_TYPES.TSUnionType&&c.parent.types[0]!==c)return!1;let u=[];for(let m of c.members){if(m.type!==z.AST_NODE_TYPES.TSPropertySignature)return!1;let g=m.typeAnnotation?.typeAnnotation;if(!g||g.type===z.AST_NODE_TYPES.TSTypeLiteral||!An(g))return!1;if(g.type===z.AST_NODE_TYPES.TSTypeReference&&g.typeArguments){if(g.typeArguments.params.length>1)return!1;let f=g.typeArguments.params[0];if(!f||!An(f))return!1}let S=r.getText(m).trim();(S.endsWith(";")||S.endsWith(","))&&(S=S.slice(0,-1)),u.push(S)}return{text:u.join("; "),isNested:y,propsSize:o}}}function l(c){if(c.loc.start.line===c.loc.end.line)return;if(c.parent.type!==z.AST_NODE_TYPES.JSXExpressionContainer){let g=0,S=!1,f=r.getTokenAfter(c,{filter:b=>b.type!==z.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===z.AST_TOKEN_TYPES.Template&&f.value.startsWith(`}
2
- `);if(f?.loc.start.line===c.loc.end.line&&!T)return}let y=p(c);if(!y)return;let d=y.text;if(d.includes(`
3
- `)||r.getCommentsInside(c).length>0)return;d.endsWith(";")&&(d=d.slice(0,-1));let o=`{ ${d} }`,u=Kr(r,c),m=y.isNested&&y.propsSize>2?a:n.maxLineLength;m&&o.length+u.length+Gr(c,r)>m||e.report({node:c,messageId:"singleLineProp",fix:g=>g.replaceText(c,o)})}return{TSTypeLiteral:l,ObjectExpression:l}}});function An(e){return e.type===z.AST_NODE_TYPES.TSLiteralType||e.type===z.AST_NODE_TYPES.TSTypeReference||e.type===z.AST_NODE_TYPES.TSNumberKeyword||e.type===z.AST_NODE_TYPES.TSStringKeyword||e.type===z.AST_NODE_TYPES.TSBooleanKeyword||e.type===z.AST_NODE_TYPES.TSNullKeyword||e.type===z.AST_NODE_TYPES.TSUndefinedKeyword}function dt(e,n){return!!(e.type===z.AST_NODE_TYPES.Literal||e.type===z.AST_NODE_TYPES.Identifier||e.type===z.AST_NODE_TYPES.TemplateLiteral||e.type===z.AST_NODE_TYPES.TaggedTemplateExpression||!n&&e.type===z.AST_NODE_TYPES.ArrayExpression&&e.elements.every(r=>r&&dt(r,!0)))}function Gr(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 Kr(e,n){return e.text.slice(n.range[0]-n.loc.start.column,n.range[0])}var gt={name:In,rule:Zr};var Qr=/eslint +react-compiler\/react-compiler: +\["error/,wn={meta:{type:"suggestion",docs:{description:"verifies the list of dependencies for Hooks like useEffect and similar",recommended:!0,url:"https://github.com/facebook/react/issues/14920"},fixable:"code",hasSuggestions:!0,schema:[{type:"object",additionalProperties:!1,ignoreIfReactCompilerIsEnabled:!1,enableDangerousAutofixThisMayCauseInfiniteLoops:!1,properties:{additionalHooks:{type:"string"},ignoreIfReactCompilerIsEnabled:{type:"boolean"},enableDangerousAutofixThisMayCauseInfiniteLoops:{type:"boolean"}}}]},create(e){let n=!1,r=typeof e.getSource=="function"?f=>r(f):f=>e.sourceCode.getText(f),t=typeof e.getScope=="function"?()=>t():f=>e.sourceCode.getScope(f),s=e.options&&e.options[0]&&e.options[0].additionalHooks?new RegExp(e.options[0].additionalHooks):void 0,a=e.options&&e.options[0]&&e.options[0].enableDangerousAutofixThisMayCauseInfiniteLoops||!1,i={additionalHooks:s,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,y=new WeakSet,d=new WeakMap,o=new WeakMap,u=new WeakSet;function m(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:
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:
5
5
 
6
6
  useEffect(() => {
7
7
  async function fetchData() {
@@ -12,33 +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&&(ht(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(ii(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,me=0;for(let xe=0;xe<_.length;xe++){if(_[xe].isWrite()&&me++,me>1)return!1;c.set(_[xe].identifier,N.elements[0])}}return!0}else if(N.elements[0]===x.identifiers[0]){if($==="useState"){let _=x.references;for(let me=0;me<_.length;me++)y.add(_[me].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=m(L,d),K=m(U,o),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,Se=new Map;$e(E);function $e(x){for(let A of x.references){if(!A.resolved||!C.has(A.resolved.scope))continue;let F=ht(f,A.identifier),O=vn(F),D=Ae(O,Se);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 we(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 fe=new Set;if(q.forEach(({isStable:x,references:A},F)=>{x&&fe.add(F),A.forEach(O=>{O.writeExpr&&we(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}=St({dependencies:q,declaredDependencies:[],stableDependencies:fe,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 De=[],Ve=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=Ae(x,Se)}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);De.push({key:A,node:x}),O||Ve.add(A)});let{suggestedDependencies:Lr,unnecessaryDependencies:Ke,missingDependencies:ve,duplicateDependencies:gn}=St({dependencies:q,declaredDependencies:De,stableDependencies:fe,externalDependencies:Ve,isEffect:I}),Qe=Lr;if(gn.size+ve.size+Ke.size===0){if(n)return;ei({declaredDependencies:De,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, ${$}`,me=O==="conditional"||O==="logical expression"?"could make":"makes",xe=`The '${A.name.name}' ${O} ${me} the dependencies of ${h} Hook (at line ${T.loc.start.line}) change on every render. ${_}`,Sn;F&&A.type==="Variable"&&O==="function"&&(Sn=[{desc:`Wrap the ${N} of '${A.name.name}' in its own ${D}() Hook.`,fix(Tn){let[Mr,$r]=D==="useMemo"?["useMemo(() => { return ","; })"]:["useCallback(",")"];return[Tn.insertTextBefore(A.node.init,Mr),Tn.insertTextAfter(A.node.init,$r)]}}]),p({node:A.node,message:xe,suggest:Sn})});return}!I&&ve.size>0&&(Qe=St({dependencies:q,declaredDependencies:[],stableDependencies:fe,externalDependencies:Ve,isEffect:I}).suggestedDependencies);function jr(){if(De.length===0)return!0;let x=De.map(F=>F.key),A=x.slice().sort();return x.join(",")===A.join(",")}jr()&&Qe.sort();function ft(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=Se.get(D)===!0;F+=N?"?.":"."}F+=A[O]}return F}function mt(x,A,F,O){return x.size===0?null:(x.size>1?"":A+" ")+F+" "+(x.size>1?"dependencies":"dependency")+": "+ni(Array.from(x).sort().map(D=>"'"+ft(D)+"'"))+`. Either ${O} ${x.size>1?"them":"it"} or remove the dependency array.`}let de="";if(Ke.size>0){let x=null;if(Array.from(Ke.keys()).forEach(A=>{x===null&&A.endsWith(".current")&&(x=A)}),x!==null)de=` Mutable values like '${x}' aren't valid dependencies because mutating them doesn't re-render the component.`;else if(Ve.size>0){let A=Array.from(Ve)[0];E.set.has(A)||(de=` Outer scope values like '${A}' aren't valid dependencies because mutating them doesn't re-render the component.`)}}if(!de&&ve.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=ht(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&&(de=` However, 'props' will change when *any* prop changes, so the preferred fix is to destructure the 'props' object outside of the ${h} call and refer to those specific props inside ${r(b)}.`)}if(!de&&ve.size>0){let x=null;ve.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&&(de=` If '${x}' changes too often, find the parent component that defines it and wrap that definition in useCallback.`)}if(!de&&ve.size>0){let x=null;if(ve.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(y.has(D))x={missingDep:A,setter:N.callee.name,form:"reducer"};else{let me=O[$].resolved;if(me!=null){let xe=me.defs[0];xe!=null&&xe.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":de=` You can also replace multiple useState variables with useReducer if '${x.setter}' needs the current value of '${x.missingDep}'.`;break;case"inlineReducer":de=` 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":de=` 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 `+(mt(ve,"a","missing","include")||mt(Ke,"an","unnecessary","exclude")||mt(gn,"a","duplicate","omit"))+de,suggest:[{desc:`Update the dependencies array to be: [${Qe.map(ft).join(", ")}]`,fix(x){return x.replaceText(T,`[${Qe.map(ft).join(", ")}]`)}}]})}function S(f){let T=ti(f.callee,i);if(T===-1)return;let b=f.arguments[T],h=f.callee,I=kn(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(Qr.test(f.value))return n=!0,{CallExpression:T=>S(T,!0)}}return{CallExpression:f=>S(f)}}};function St({dependencies:e,declaredDependencies:n,stableDependencies:r,externalDependencies:t,isEffect:s}){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,y=new Set;d(a,c,y,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 o=[],u=new Set,m=new Set;return n.forEach(({key:g})=>{y.has(g)?o.indexOf(g)===-1?o.push(g):m.add(g):u.add(g)}),c.forEach(g=>{o.push(g)}),{suggestedDependencies:o,unnecessaryDependencies:u,duplicateDependencies:m,missingDependencies:c}}function Fe(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 Fe(e.consequent)!=null||Fe(e.alternate)!=null?"conditional":null;case"LogicalExpression":return Fe(e.left)!=null||Fe(e.right)!=null?"logical expression":null;case"JSXFragment":return"JSX fragment";case"JSXElement":return"JSX element";case"AssignmentExpression":return Fe(e.right)!=null?"assignment expression":null;case"NewExpression":return"object construction";case"Literal":return e.value instanceof RegExp?"regular expression":null;case"TypeCastExpression":return Fe(e.expression);case"TSAsExpression":return Fe(e.expression)}return null}function ei({declaredDependencies:e,declaredDependenciesNode:n,componentScope:r,scope:t}){let s=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=Fe(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 y=c.from;for(;y!==t&&y!=null;)y=y.upper;if(y!==t&&!Fn(n,c.identifier))return!0}return!1}return s.map(([i,p])=>({construction:i.defs[0],depType:p,isUsedOutsideOfHook:a(i)}))}function vn(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)?vn(e.parent):e.type==="MemberExpression"&&e.parent&&e.parent.type==="AssignmentExpression"&&e.parent.left===e?e.object:e}function Tt(e,n,r){n&&(e.optional?n.has(r)||n.set(r,!0):n.has(r)||n.set(r,!1))}function Ae(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=Ae(e.object,n),t=Ae(e.property,null),s=`${r}.${t}`;return Tt(e,n,s),s}else if(e.type==="OptionalMemberExpression"&&!e.computed){let r=Ae(e.object,n),t=Ae(e.property,null),s=`${r}.${t}`;return Tt(e,n,s),s}else if(e.type==="ChainExpression"&&!e.computed){let r=e.expression;if(r.type==="CallExpression")throw new Error(`Unsupported node type: ${r.type}`);let t=Ae(r.object,n),s=Ae(r.property,null),a=`${t}.${s}`;return Tt(r,n,a),a}else throw new Error(`Unsupported node type: ${e.type}`)}function kn(e,n){return e.type==="MemberExpression"&&e.object.type==="Identifier"&&e.object.name==="React"&&e.property.type==="Identifier"&&!e.computed?e.property:e}function ti(e,n){let r=kn(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=Ae(r,null)}catch(s){if(/Unsupported node type/.test(s.message))return 0;throw s}return n.additionalHooks.test(t)?0:-1}else return-1}}function ht(e,n){let r=[e],t=null;for(;r.length;){if(t=r.shift(),ri(t,n))return t;if(Fn(t,n))for(let[s,a]of Object.entries(t))s!=="parent"&&(Rn(a)?(a.parent=t,r.push(a)):Array.isArray(a)&&a.forEach(i=>{Rn(i)&&(i.parent=t,r.push(i))}))}return null}function ni(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 Rn(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&typeof e.type=="string"}function ri(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 Fn(e,n){return e.range[0]<=n.range[0]&&e.range[1]>=n.range[1]}function ii(e){return!1}var G=require("@typescript-eslint/utils"),ne=Ce(require("typescript")),Dn=require("zod/v4");var Et=require("@typescript-eslint/utils");function _e(e,n,r=1/0){if(r!==0&&e.parent)return e.type===n?e:_e(e.parent,n,r===1/0?r:r-1)}function*bt(e){yield e,e.parent&&(yield*bt(e.parent))}function xt(e,n){for(let r of e){let t=n(r);if(t!=null&&t!==!1)return t}}function On(e,n,r){let s=r.getDeclaredVariables(e).find(a=>a.name===n||a.identifiers[0]?.parent.type===Et.AST_NODE_TYPES.Property&&a.identifiers[0].parent.key.type===Et.AST_NODE_TYPES.Identifier&&a.identifiers[0].parent.key.name===n);return s?s.references.filter(a=>!a.init):[]}function Pn(e){return e===null||typeof e!="object"||!("type"in e)?!1:typeof e.type=="string"}function si(e,n){return e[n]}function Pe(e,n,r){let t=r.visitorKeys,s=new Set;function a(i){if(s.has(i))return!1;if(s.add(i),n(i)===!0)return!0;let l=t[i.type];if(l)for(let c of l){let y=si(i,c);if(y){if(Array.isArray(y)){for(let d of y)if(Pn(d)&&a(d))return!0}else if(Pn(y)&&a(y))return!0}}return!1}a(e)}var oi=G.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),Nn="improved-no-unnecessary-condition",ai=Dn.z.object({}),li=["string","number","bigint","boolean","symbol","undefined","object","function","never"],pi=new Set(li),Ct={name:Nn,rule:oi({name:Nn,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(ai)]},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(o){return o.type===G.AST_NODE_TYPES.UnaryExpression&&o.operator==="typeof"}function s(o){return o.flags&ne.default.TypeFlags.Any||o.flags&ne.default.TypeFlags.Unknown?null:o.flags&ne.default.TypeFlags.StringLike?["string"]:o.flags&ne.default.TypeFlags.NumberLike?["number"]:o.flags&ne.default.TypeFlags.BigIntLike?["bigint"]:o.flags&ne.default.TypeFlags.BooleanLike?["boolean"]:o.flags&ne.default.TypeFlags.ESSymbolLike?["symbol"]:o.flags&ne.default.TypeFlags.Undefined||o.flags&ne.default.TypeFlags.Void?["undefined"]:o.flags&ne.default.TypeFlags.Null?["object"]:o.getCallSignatures().length>0?["function"]:o.flags&ne.default.TypeFlags.Object?o.getProperties().length===0?["string","number","bigint","boolean","symbol","object","function"]:["object"]:o.flags&ne.default.TypeFlags.NonPrimitive?["object"]:o.flags&ne.default.TypeFlags.Never?["never"]:null}function a(o){if(!r)return null;let u=n.esTreeNodeToTSNodeMap.get(o),m=r.getTypeAtLocation(u.expression);if(m.flags&ne.default.TypeFlags.Any||m.flags&ne.default.TypeFlags.Unknown)return null;let g=[];if(m.isUnion()){for(let f of m.types){let T=s(f);if(T)g.push(...T);else return null}return g}let S=s(m);return S?(g.push(...S),g):null}function i(o){if(!(o.operator==="==="||o.operator==="!=="))return;let m=null,g=null;if(t(o.left)?(m=o.left,g=o.right.type===G.AST_NODE_TYPES.Literal&&typeof o.right.value=="string"?o.right.value:null):t(o.right)&&(m=o.right,g=o.left.type===G.AST_NODE_TYPES.Literal&&typeof o.left.value=="string"?o.left.value:null),!m||!g||!ci(g,pi))return;let S=a(m);if(!S)return;let f=o.operator==="!==",T=S.includes(g);S.length===1?T&&!f?e.report({node:o,messageId:"unnecessaryTypeofCondition",data:{name:Ue(m,e),type:g}}):!T&&f?e.report({node:o,messageId:"unnecessaryTypeofCondition",data:{name:Ue(m,e),type:Array.from(S)[0]}}):!T&&!f?e.report({node:o,messageId:"alwaysFalseTypeofCondition",data:{name:Ue(m,e),actualType:tt(S),conditionType:g}}):T&&f&&e.report({node:o,messageId:"alwaysFalseTypeofCondition",data:{name:Ue(m,e),actualType:tt(S),conditionType:g}}):!T&&!f?e.report({node:o,messageId:"alwaysFalseTypeofCondition",data:{name:Ue(m,e),actualType:tt(S),conditionType:g}}):!T&&f&&e.report({node:o,messageId:"unnecessaryTypeofCondition",data:{name:Ue(m,e),type:tt(S)}})}function p(o){if(o.flags&ne.default.TypeFlags.Any||o.flags&ne.default.TypeFlags.Unknown)return null;if(o.isUnion()){let u=[];for(let m of o.types)if(m.flags&ne.default.TypeFlags.StringLiteral){let g=m.value;u.push(g)}else return null;return u}return o.flags&ne.default.TypeFlags.StringLiteral?[o.value]:null}function l(o){if(!r)return null;let u=n.esTreeNodeToTSNodeMap.get(o),m=r.getTypeAtLocation(u),g=p(m);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(o){let u=e.sourceCode.ast,m=null;return Pe(u,g=>{if(g.type===G.AST_NODE_TYPES.VariableDeclarator&&g.id.type===G.AST_NODE_TYPES.Identifier&&g.id.name===o.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 m=f,!0}if(S.type===G.AST_NODE_TYPES.TSLiteralType&&S.literal.type===G.AST_NODE_TYPES.Literal&&typeof S.literal.value=="string")return m=[S.literal.value],!0}return!1},e.sourceCode),m}function y(o){if(o.callee.type!==G.AST_NODE_TYPES.MemberExpression||o.callee.property.type!==G.AST_NODE_TYPES.Identifier||o.callee.computed)return;let u=o.callee.property.name;if(u!=="startsWith"&&u!=="endsWith"&&u!=="includes"||o.arguments.length!==1)return;let[m]=o.arguments;if(!m||m.type!==G.AST_NODE_TYPES.Literal||typeof m.value!="string")return;let g=o.callee.object,S=l(g);if(!S&&g.type===G.AST_NODE_TYPES.Identifier&&(S=c(g)),!S||S.length===0)return;let f=m.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:o,messageId:h})}else if(b>0&&T===0){let h=u==="startsWith"?"alwaysFalseStartsWithCondition":u==="endsWith"?"alwaysFalseEndsWithCondition":"alwaysFalseIncludesCondition";e.report({node:o,messageId:h})}}function d(o){if(!new Set(["===","!==",">",">=","<","<="]).has(o.operator))return;function m(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=m(o.left),S=m(o.right),f=null,T=null;if(g?o.right.type===G.AST_NODE_TYPES.Literal&&typeof o.right.value=="number"&&(f=g.values,T=o.right.value):S&&o.left.type===G.AST_NODE_TYPES.Literal&&typeof o.left.value=="number"&&(f=S.values,T=o.left.value),!f||T===null)return;let b=0,h=0;for(let I of f){let E=!1;if(o.operator==="==="?E=I===T:o.operator==="!=="?E=I!==T:o.operator===">"?E=I>T:o.operator===">="?E=I>=T:o.operator==="<"?E=I<T:o.operator==="<="&&(E=I<=T),E?b++:h++,b>0&&h>0)return}b>0&&h===0?e.report({node:o,messageId:"unnecessaryLengthCondition"}):h>0&&b===0&&e.report({node:o,messageId:"alwaysFalseLengthCondition"})}return{BinaryExpression(o){i(o),d(o)},CallExpression:y}}})};function tt(e){return Array.from(new Set(e)).join(" | ")||"never"}function Ue(e,n){let r=e.argument;return r.type===G.AST_NODE_TYPES.Identifier?r.name:n.sourceCode.getText(r)}function ci(e,n){return n.has(e)}var rt=require("@typescript-eslint/utils"),nt=require("zod/v4");var ui=rt.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),Ln="no-call-with-explicit-generics",fi=nt.z.object({functions:nt.z.array(nt.z.string())}),mi=ui({name:Ln,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(fi)]},defaultOptions:[{functions:[]}],create(e,[n]){let r=new Set(n.functions);return{CallExpression(t){let{callee:s}=t;s.type===rt.AST_NODE_TYPES.Identifier&&r.has(s.name)&&t.typeArguments&&e.report({node:t,messageId:"noExplicitGenerics",data:{functionName:s.name}})}}}}),At={name:Ln,rule:mi};var Le=require("@typescript-eslint/utils"),yi=Le.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),jn="no-call-with-inferred-generics",di=yi({name:jn,meta:{type:"problem",docs:{description:"Disable calling configured functions with infered generics"},messages:{missingGenericDeclaration:"Function '{{ functionName }}' should be called with at least {{ minGenerics }} generic(s) (ex: `fn<Generic>()`) defined",anyUsedInGenerics:"Function '{{ functionName }}' should not be called with 'any' in generics"},schema:[{type:"object",properties:{functions:{type:"array",items:{type:"object",properties:{name:{type:"string"},minGenerics:{type:"number"},allowAny:{type:"boolean"},disallowTypes:{type:"array",items:{type:"string"}}},required:["name"]}},anyAliases:{type:"array",items:{type:"string"}}},required:["functions"]}]},defaultOptions:[{functions:[]}],create(e,[n]){let r=new Map(n.functions.map(t=>[t.name,t]));return{CallExpression(t){let{callee:s}=t;if(s.type!==Le.AST_NODE_TYPES.Identifier)return;let a=r.get(s.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:s.name,minGenerics:i||0}}),!(p&&!l)&&t.typeArguments?.params.some(y=>!p&&y.type===Le.AST_NODE_TYPES.TSAnyKeyword||l&&y.type===Le.AST_NODE_TYPES.TSTypeReference&&y.typeName.type===Le.AST_NODE_TYPES.Identifier&&l.includes(y.typeName.name))&&e.report({node:t,messageId:"anyUsedInGenerics",data:{functionName:s.name}})}}}}),It={name:jn,rule:di};var _n=require("@typescript-eslint/utils"),gi=_n.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),Un="no-commented-out-code",Si=["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:"],Ti=/^\s*return\s+/,hi=/\w=("|'|`)/,Ei=/\w+:\s*('|"|`)/,bi=/\[['"][^'"]*['"]\]:\s*('|"|`|[^'"`\s])/,xi=/\w+-\w+:/,Ci=/\w+_\w+:/,Ai=/\?\s+\w/,Ii=/:\s+\w/,Ri=/^\s*('|"|`)[^'"]*('|"|`),?\s*$/,wi=/^\s*\d+[,}]/,vi=/^\s*\[[^\]]*\][,}]/,ki=/^\s*\{[^}]*\}[,}]/,Fi=/\.\w+\(/,Pi=/\[\w+\]/,Oi=/^\s*(['"`]).+?\1\s*:/,Ni=/^<[A-Z]\w*(\s|>|\/)/,Di=/^<[a-z]+(\s|>|\/)/,Li=/<[A-Z]\w*(\s.*)?>/,ji=/<\/[A-Z]\w*>/,Mi=/<[a-z]+(\s.*)?>/,$i=/<\/[a-z]+>/,_i=/^\s*[*\s]*$/,Ui=/^[a-zA-Z]/,Wi=/^[A-Z][A-Za-z]*(?:\s+\d+)?(?:\s+[a-z]+)*:\s+[A-Za-z]/,zi=/```[\s\S]*?```/g,Ji=/`[^`]*`/g,Mn=/[a-zA-Z0-9]/,Vi=/\.[A-Za-z_][A-Za-z0-9_]*\(/,Xi=/[{}[\]()`=<>]/,Hi=/:\s*(['"`[{(]|\w+\s*=>)/,Bi=/\bif\s*\(|\belse\b|=>/,Q={returnStatement:Ti,stringAssignment:hi,objectPropertyWithQuotes:Ei,computedPropertyAssignment:bi,kebabCaseProperty:xi,snakeCaseProperty:Ci,ternaryOperator:Ai,colonWithWord:Ii,quotedString:Ri,numberWithComma:wi,arrayWithComma:vi,objectWithComma:ki,methodCall:Fi,arrayAccess:Pi,quotedPropertyKey:Oi,jsxSelfClosing:Ni,jsxElement:Di,jsxOpeningTag:Li,jsxClosingTag:ji,htmlOpeningTag:Mi,htmlClosingTag:$i,jsdocComment:_i};function Yi(e){if(e.includes(":")){let r=e.split(":")[0]?.trim();if(r&&Ui.test(r)&&r.includes(" "))return!0}let n=e.trim();return n.length===0||Vi.test(n)||Xi.test(n)||Hi.test(n)||Bi.test(n)?!1:!!(n.includes(":")&&Wi.test(n))}var qi=[") {","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],Zi=["/>","</",Q.jsxSelfClosing,Q.jsxElement,Q.jsxOpeningTag,Q.jsxClosingTag,Q.htmlOpeningTag,Q.htmlClosingTag],$n=["INFO:","TODO:","DOCS:","FIX:","FIXME:","HACK:","NOTE:","WARNING:","WARN:","BUG:","ISSUE:","TEMP:","TEMPORARY:","XXX:","REVIEW:","eslint"],Gi=gi({name:Un,meta:{type:"problem",docs:{description:"Disallow commented code"},messages:{commentedOutCode:"Commented code is not allowed. Detected pattern: `{{ wrongPattern }}` Use a comment starting with one of these prefixes if you want to keep this code commented out: {{ allowedPrefixes }}"},schema:[]},defaultOptions:[],create(e){function n(t,s){if(t.startsWith("/"))return!1;let 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 $n)if(a.startsWith(i))return!1;if(t.includes("https://")||Yi(a))return!1;if(s==="Block"){for(let i of Zi)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 Si)if(a.startsWith(i))return{wrongPattern:i};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}function r(t,s){let a=t,i=a.trim();if(i.startsWith("`")&&(i.endsWith("`,")||i.endsWith("`;")||i.endsWith("`")))return a;if(s==="Block"&&a.includes("```")){let c=a.split(zi);c.some(d=>Mn.test(d))&&(a=c.join(""))}if(!a.includes("`"))return a;let p=a.split(Ji);return p.some(c=>Mn.test(c))?p.join(""):a}return{Program(){let s=e.sourceCode.getAllComments();for(let a of s){let i=r(a.value,a.type),p=n(i,a.type);p&&e.report({node:a,messageId:"commentedOutCode",data:{wrongPattern:p.wrongPattern,allowedPrefixes:$n.join(", ")}})}}}}}),Rt={name:Un,rule:Gi};var it=require("@typescript-eslint/utils"),Ki=it.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),Wn="no-default-export",Qi=Ki({name:Wn,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===it.TSESTree.AST_NODE_TYPES.Identifier&&r.exported.name==="default"&&e.report({node:n,messageId:"noDefaultExport"})}}}}),wt={name:Wn,rule:Qi};var zn=require("@typescript-eslint/utils"),es=zn.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),Jn="no-leaked-text-in-jsx",ts=[",",";","[","]","(",")"],ns=es({name:Jn,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="";ts.includes(r)?t=r:r.includes("&&")?t="&&":r.includes("||")?t="||":r.endsWith("? (")&&(t="? ("),t&&e.report({node:n,messageId:"leakedTextInJSX",data:{text:t}})}}}}),vt={name:Jn,rule:ns};var Oe=require("@typescript-eslint/utils"),rs=Oe.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),Xn="no-non-camel-case-functions",is=/^(\$?[a-z][a-zA-Z0-9]*)$/;function Vn(e){if(e.typeName.type!==Oe.AST_NODE_TYPES.TSQualifiedName)return!1;let{left:n,right:r}=e.typeName;return n.type===Oe.AST_NODE_TYPES.Identifier&&n.name==="JSX"&&r.name==="Element"}var ss=rs({name:Xn,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&&!is.test(n.id.name)){let r=n.returnType?.typeAnnotation;if(r&&(r.type===Oe.AST_NODE_TYPES.TSTypeReference?Vn(r):r.type===Oe.AST_NODE_TYPES.TSUnionType&&r.types.some(s=>s.type===Oe.AST_NODE_TYPES.TSTypeReference&&Vn(s))))return;e.report({node:n.id,messageId:"nonCamelCaseFunction",data:{functionName:n.id.name}})}}}}}),kt={name:Xn,rule:ss};var H=require("@typescript-eslint/utils");var os=H.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),Hn="no-optional-root-props",as=os({name:Hn,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 bt(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 y=_e(l.parent.parent,H.TSESTree.AST_NODE_TYPES.VariableDeclaration,4);if(!y)return!1;let d=st(y,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=_e(l,H.TSESTree.AST_NODE_TYPES.VariableDeclaration);return c?!!st(c,e.sourceCode):!1}if(l.type===H.TSESTree.AST_NODE_TYPES.FunctionDeclaration)return!!st(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:s=>{let a=_e(t,H.TSESTree.AST_NODE_TYPES.TSPropertySignature);if(!a)return null;let i=e.sourceCode.getText(a);return s.replaceText(a,i.replace("?:",": undefined |"))}}]})}return{TSTypeAliasDeclaration(t){if(t.typeAnnotation.type===H.TSESTree.AST_NODE_TYPES.TSTypeLiteral&&!(ot(t)||!n(t)))for(let s of t.typeAnnotation.members)s.type===H.TSESTree.AST_NODE_TYPES.TSPropertySignature&&r(s)},TSInterfaceDeclaration(t){if(!(ot(t)||!n(t)))for(let s of t.body.body)s.type===H.TSESTree.AST_NODE_TYPES.TSPropertySignature&&r(s)},TSTypeReference(t){if(t.typeName.type!==H.TSESTree.AST_NODE_TYPES.Identifier||t.typeName.name!=="FC"||!t.typeArguments?.params[0])return;let s=t.typeArguments.params[0];if(s.type!==H.TSESTree.AST_NODE_TYPES.TSTypeLiteral)return;let a=_e(t.parent,H.TSESTree.AST_NODE_TYPES.VariableDeclaration,4);if(!a)return;let i=st(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 s.members)l.type===H.TSESTree.AST_NODE_TYPES.TSPropertySignature&&r(l)}}}});function ot(e){return e?e.parent?.type===H.TSESTree.AST_NODE_TYPES.ExportNamedDeclaration||e.parent?.type===H.TSESTree.AST_NODE_TYPES.ExportDefaultDeclaration:!1}function st(e,n){if(ot(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 s=t.variables.find(i=>i.identifiers.includes(r));if(!s)return;let a=s.references.filter(i=>i.identifier!==r);if(!(a.length!==1||!a[0])&&!ot(a[0].identifier.parent.parent))return a[0].identifier}var Ft={name:Hn,rule:as};var Xe=require("@typescript-eslint/utils");var He=X({name:"no-reexport",meta:{type:"problem",docs:{description:"Disallow re-exports to prevent indirection"},schema:[],messages:{noReexport:"Re-exports are not allowed. Use direct exports only."}},defaultOptions:[],create(e){let n=new Set;function r(t){return t?t.type===Xe.AST_NODE_TYPES.Identifier?n.has(t.name):t.type===Xe.AST_NODE_TYPES.MemberExpression?r(t.object):!1:!1}return{ImportDeclaration(t){for(let s of t.specifiers)n.add(s.local.name)},ExportNamedDeclaration(t){if(t.source){e.report({node:t,messageId:"noReexport"});return}if(t.declaration?.type===Xe.AST_NODE_TYPES.VariableDeclaration)for(let s of t.declaration.declarations)r(s.init)&&e.report({node:t,messageId:"noReexport"});t.specifiers.length>0&&e.report({node:t,messageId:"noReexport"})},ExportDefaultDeclaration(t){t.declaration.type===Xe.AST_NODE_TYPES.Identifier&&n.has(t.declaration.name)&&e.report({node:t,messageId:"noReexport"})},ExportAllDeclaration(t){e.report({node:t,messageId:"noReexport"})}}}});var Bn=require("@typescript-eslint/utils"),at=Ce(require("path")),Ie=require("zod/v4");var ls=Bn.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),Yn="no-relative-imports",ps=Ie.z.object({find:Ie.z.string(),replacement:Ie.z.string()}),cs=Ie.z.object({aliases:Ie.z.array(ps),rootDir:Ie.z.string().optional(),allowNotFoundAliases:Ie.z.boolean().optional(),_dev_simulateFileName:Ie.z.string().optional()}),us=ls({name:Yn,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(cs)]},defaultOptions:[{aliases:[],rootDir:void 0}],create(e,[n]){let r=n._dev_simulateFileName??e.filename;function t(i){return i.startsWith(".")||i.startsWith("..")}function s(i,p){let l=at.default.dirname(p);return at.default.resolve(l,i)}function a(i){let p=n.rootDir??process.cwd(),l=at.default.relative(p,i);if(l.startsWith("."))return null;l.startsWith("/")||(l=`/${l}`);for(let{find:c,replacement:y}of n.aliases)if(l.startsWith(y)){let d=l.replace(y,c);return{alias:c,newPath:d}}return null}return{ImportDeclaration(i){let p=i.source.value;if(!t(p))return;let l=s(p,r),c=a(l);!c&&n.allowNotFoundAliases||e.report({node:i,messageId:c?"noRelativeImportsWithAlias":"noRelativeImports",data:{alias:c?.alias},fix:c?y=>y.replaceText(i.source,`'${c.newPath}'`):void 0})}}}}),Pt={name:Yn,rule:us};var ee=require("@typescript-eslint/utils"),Ot=require("zod/v4");var fs=Ot.z.object({customMessage:Ot.z.string().optional()}),Nt=X({name:"no-static-style-prop",meta:{type:"problem",docs:{description:"Prevent using static style props in JSX, only dynamic values should be allowed"},schema:[j(fs)],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(s=>s.type===ee.AST_NODE_TYPES.Property?s.computed||s.value.type===ee.AST_NODE_TYPES.Identifier&&s.key.type===ee.AST_NODE_TYPES.Identifier&&s.key.name===s.value.name?!1:r(s.value):!1);case ee.AST_NODE_TYPES.ArrayExpression:return t.elements.every(s=>s?s.type===ee.AST_NODE_TYPES.SpreadElement?!1:r(s):!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 s=null;t.value.type===ee.AST_NODE_TYPES.JSXExpressionContainer?t.value.expression.type!==ee.AST_NODE_TYPES.JSXEmptyExpression&&(s=t.value.expression):t.value.type===ee.AST_NODE_TYPES.Literal&&(s=t.value),s&&r(s)&&e.report({node:t,messageId:"noStaticStyleProp",data:{customMessage:n.customMessage?` ${n.customMessage}`:""}})}}}}});var Be=require("@typescript-eslint/utils"),je=Ce(require("zod/v4"));var ms=je.object({alternativeMsgs:je.object({inArrayFind:je.string().optional(),inArrayFilter:je.string().optional()}).optional(),__dev_simulateFileName:je.string().optional()});function ys(e){return e.typeAnnotation.type!==Be.AST_NODE_TYPES.TSTypePredicate?!1:e.typeAnnotation.asserts===!1}var ds=/(typeGuards|type-guards)\.(ts|tsx)$/;function gs(e){return ds.test(e)}function Ss(e){let n=e.parent;for(;n;){if(n.type===Be.AST_NODE_TYPES.CallExpression&&n.callee.type===Be.AST_NODE_TYPES.MemberExpression&&n.callee.property.type===Be.AST_NODE_TYPES.Identifier){let r=n.callee.property.name;if(r==="filter"||r==="find")return{method:r}}n=n.parent}return null}var Dt=X({name:"no-type-guards",meta:{type:"problem",docs:{description:"Disallow type guards unless in *.typeGuards.(ts|tsx) or *.type-guards.(ts|tsx) files"},messages:{typeGuardNotAllowed:"Check if the type guard can be inferred by typescript, in most cases it can, e.g. `.filter((nullable) => nullable !== null)`. If not, type guards are only allowed in *.typeGuards.(ts|tsx) or *.type-guards.(ts|tsx) files",useFilterWithTypeCheck:"{{message}}",useFindWithTypeCheck:"{{message}}"},schema:[j(ms)],hasSuggestions:!0},defaultOptions:[{}],create(e,[n]){let r=n.__dev_simulateFileName??e.filename;if(gs(r))return{};function t(s){if(!ys(s))return;let a=Ss(s);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:s,messageId:p,data:{message:i}});return}}e.report({node:s,messageId:"typeGuardNotAllowed"})}return{"FunctionDeclaration > :matches(TSTypeAnnotation)":t,"ArrowFunctionExpression > :matches(TSTypeAnnotation)":t,"MethodDefinition > FunctionExpression > :matches(TSTypeAnnotation)":t}}});var Me=require("@typescript-eslint/utils");var Ts="no-unnecessary-async-on-jsx-props";function hs(e){if(e.body.type!==Me.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!==Me.AST_NODE_TYPES.ExpressionStatement?!1:r.expression.type===Me.AST_NODE_TYPES.AwaitExpression}var Lt=X({name:Ts,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){hs(r)&&e.report({node:r,messageId:"unnecessaryAsyncInJsxProp",fix(t){let s=e.sourceCode,a=[],i=s.getFirstToken(r,l=>l.value==="async");if(i){let l=s.getTokenAfter(i);l?a.push(t.replaceTextRange([i.range[0],l.range[0]],"")):a.push(t.remove(i))}function p(l){if(l.type===Me.AST_NODE_TYPES.AwaitExpression){let c=s.getFirstToken(l);if(c&&c.value==="await"){let y=s.getTokenAfter(c);y?a.push(t.replaceTextRange([c.range[0],y.range[0]],"")):a.push(t.remove(c))}}if(l.type===Me.AST_NODE_TYPES.BlockStatement)for(let c of l.body)p(c);else l.type===Me.AST_NODE_TYPES.ExpressionStatement&&p(l.expression)}return p(r.body),a}})}return{"JSXAttribute ArrowFunctionExpression[async=true]":n,"JSXAttribute FunctionExpression[async=true]":n}}});var Re=require("@typescript-eslint/utils"),jt=Ce(require("typescript")),We=Ce(require("zod/v4"));var Es=Re.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),qn="no-unnecessary-casting",bs=We.default.object({additionalCastFunctions:We.default.array(We.default.object({name:We.default.string(),expectedType:We.default.enum(["string","number"])})).optional()}),Mt={name:qn,rule:Es({name:qn,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(bs)],fixable:"code"},defaultOptions:[{}],create(e){let r=e.options[0].additionalCastFunctions||[],t=[{name:"Number",expectedType:"number"},{name:"String",expectedType:"string"},...r],s=Re.ESLintUtils.getParserServices(e,!0),a=s.program?.getTypeChecker();if(!a||!s.program)throw new Error("TypeScript services or program not available");function i(y,d){switch(y.type){case Re.AST_NODE_TYPES.Literal:return d==="number"?typeof y.value=="number":typeof y.value=="string";case Re.AST_NODE_TYPES.TemplateLiteral:return d==="string";case Re.AST_NODE_TYPES.UnaryExpression:return d==="number"?y.operator==="+"||y.operator==="-"||y.operator==="~":!1;default:return!1}}function p(y,d){return d==="number"?!!(y.flags&jt.TypeFlags.NumberLike):!!(y.flags&jt.TypeFlags.StringLike)}function l(y,d){return o=>o.replaceText(y,e.sourceCode.getText(d))}function c(y){if(!a||y.arguments.length!==1)return;let d=y.arguments[0];if(!d||d.type===Re.AST_NODE_TYPES.SpreadElement)return;let{callee:o}=y;if(o.type!==Re.AST_NODE_TYPES.Identifier)return;let u=o.name,m=t.find(S=>S.name===u);if(!m)return;if(i(d,m.expectedType)||p(a.getTypeAtLocation(s.esTreeNodeToTSNodeMap.get(d)),m.expectedType)){let S,f;u==="Number"?S="unnecessaryNumberCasting":u==="String"?S="unnecessaryStringCasting":(S="unnecessaryCustomCasting",f={name:m.name,type:m.expectedType}),e.report({node:y,messageId:S,...f?{data:f}:{},fix:l(y,d)})}}return{CallExpression:c}}})};var Ye=require("@typescript-eslint/utils"),Te=Ce(require("zod/v4"));var xs=Te.object({methods:Te.union([Te.array(Te.string()),Te.literal("array")])}),$t=X({name:"no-unnecessary-typing",meta:{type:"suggestion",docs:{description:"Prevents unnecessary explicit type annotations in callback parameters where TypeScript can infer the type"},messages:{unnecessaryTypeAnnotation:"Unnecessary type annotation. TypeScript can infer this type from context."},fixable:"code",schema:[j(xs)]},defaultOptions:[{methods:"array"}],create(e,[n]){let r=n.methods,t=new Set(["find","filter","map","forEach","some","every","reduce","findIndex","sort"]);function s(p){return Array.isArray(r)?r.includes(p):t.has(p)}function a(p){let{callee:l}=p;if(l.type===Ye.AST_NODE_TYPES.MemberExpression){let c=l.property;if(c.type===Ye.AST_NODE_TYPES.Identifier)return c.name}return null}function i(p,l){if(p.type!==Ye.AST_NODE_TYPES.Identifier||!p.typeAnnotation)return;let c=l.parent;if(c.type===Ye.AST_NODE_TYPES.CallExpression){let y=a(c);y&&s(y)&&c.arguments.indexOf(l)===0&&e.report({node:p.typeAnnotation,messageId:"unnecessaryTypeAnnotation",fix(o){return p.typeAnnotation?o.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 _t=X({name:"no-unused-obj-props",meta:{type:"suggestion",docs:{description:"Disallow unused properties when it is safe to remove them"},messages:{unusedObjectProperty:'The object property "{{name}}" is not being used',unusedReturnObjectProperty:'The object property "{{name}}" returned by this function is not being used'},schema:[]},defaultOptions:[],create(e){return{VariableDeclarator(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=Cs(n,e.sourceCode);if(t.length===0)return;let s=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&&s)return}for(let[i,p]of r)a.has(i)||e.report({node:p,messageId:"unusedObjectProperty",data:{name:i}})}}}});function Cs(e,n){let r=n.getDeclaredVariables(e);if(r.length!==1)return[];let t=r[0];return t?t.references.filter(s=>s.identifier!==e.id):[]}var J=require("@typescript-eslint/utils"),Ut=require("zod/v4");var As=Ut.z.object({ignoreArgsMatching:Ut.z.string().optional()}),Wt=X({name:"no-unused-optional-args",meta:{type:"problem",docs:{description:"Detect unused optional function arguments in non-exported functions"},messages:{unusedOptionalArg:"Optional parameter '{{name}}' is never used",unusedOptionalProp:"Optional prop '{{name}}' is never provided"},schema:[j(As)]},defaultOptions:[{}],create(e,[n]){let r=[];function t(i){return n.ignoreArgsMatching?new RegExp(n.ignoreArgsMatching).test(i):!1}function s(i){return i.parent?.type===J.AST_NODE_TYPES.ExportNamedDeclaration||i.parent?.type===J.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!==J.AST_NODE_TYPES.Identifier)continue;let y=c.name;if(!t(y)){if(c.optional&&c.typeAnnotation&&c.typeAnnotation.typeAnnotation.type===J.AST_NODE_TYPES.TSTypeLiteral){let d=c.typeAnnotation.typeAnnotation,o=[];for(let u of d.members)u.type===J.AST_NODE_TYPES.TSPropertySignature&&u.key.type===J.AST_NODE_TYPES.Identifier&&o.push({name:u.key.name,optional:u.optional===!0});o.some(u=>u.optional)?p.push({param:c,index:l,name:y,isObjectParam:!0,objectProps:o}):p.push({param:c,index:l,name:y,isObjectParam:!1})}else if(c.optional)p.push({param:c,index:l,name:y,isObjectParam:!1});else if(c.typeAnnotation&&c.typeAnnotation.typeAnnotation.type===J.AST_NODE_TYPES.TSTypeLiteral){let d=c.typeAnnotation.typeAnnotation,o=[];for(let u of d.members)u.type===J.AST_NODE_TYPES.TSPropertySignature&&u.key.type===J.AST_NODE_TYPES.Identifier&&o.push({name:u.key.name,optional:u.optional===!0});o.some(u=>u.optional)&&p.push({param:c,index:l,name:y,isObjectParam:!0,objectProps:o})}}}return p}return{FunctionDeclaration(i){if(s(i))return;let p=a(i.params);p.length!==0&&r.push({node:i,declarationNode:i,optionalParams:p})},VariableDeclarator(i){if(i.id.type!==J.AST_NODE_TYPES.Identifier||!i.init||i.init.type!==J.AST_NODE_TYPES.ArrowFunctionExpression&&i.init.type!==J.AST_NODE_TYPES.FunctionExpression||s(i.parent.parent))return;let l=[...a(i.init.params)];if(i.id.typeAnnotation&&i.id.typeAnnotation.typeAnnotation.type===J.AST_NODE_TYPES.TSTypeReference){let c=i.id.typeAnnotation.typeAnnotation;if(c.typeName.type===J.AST_NODE_TYPES.Identifier&&c.typeName.name==="FC"){let y=c.typeArguments;if(y&&y.params.length===1){let d=y.params[0];if(d&&d.type===J.AST_NODE_TYPES.TSTypeLiteral){let o=[];for(let u of d.members)u.type===J.AST_NODE_TYPES.TSPropertySignature&&u.key.type===J.AST_NODE_TYPES.Identifier&&o.push({name:u.key.name,optional:u.optional===!0});o.some(u=>u.optional)&&l.push({param:i.id,index:0,name:"props",isObjectParam:!0,objectProps:o})}}}}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(o=>o.identifier!==l.identifiers[0]);if(c.length===0)continue;let y=!1;for(let o of c){let u=o.identifier.parent;if(u.type===J.AST_NODE_TYPES.CallExpression&&o.identifier.type===J.AST_NODE_TYPES.Identifier&&u.arguments.includes(o.identifier)){y=!0;break}if(u.type===J.AST_NODE_TYPES.ReturnStatement){y=!0;break}if(u.type===J.AST_NODE_TYPES.Property&&u.parent.type===J.AST_NODE_TYPES.ObjectExpression&&u.parent.parent.type===J.AST_NODE_TYPES.ReturnStatement){y=!0;break}if(u.type===J.AST_NODE_TYPES.JSXExpressionContainer){y=!0;break}}if(y)continue;let d=[];for(let o of c){let u=o.identifier.parent;if(u.type===J.AST_NODE_TYPES.CallExpression&&u.callee===o.identifier){let m=u.arguments.length,g=u.arguments.some(f=>f.type===J.AST_NODE_TYPES.SpreadElement);if(g){y=!0;break}let S={argCount:m,hasSpread:g};for(let f of i.optionalParams)if(f.isObjectParam&&f.index<m){let T=u.arguments[f.index];if(T?.type===J.AST_NODE_TYPES.ObjectExpression){let b={};for(let h of T.properties)h.type===J.AST_NODE_TYPES.Property&&h.key.type===J.AST_NODE_TYPES.Identifier&&(b[h.key.name]=!0);S.objectArgs||(S.objectArgs=[]),S.objectArgs[f.index]=b}else if(T){y=!0;break}}d.push(S)}else if(u.type===J.AST_NODE_TYPES.JSXOpeningElement&&u.name===o.identifier){let m=u.attributes.some(S=>S.type===J.AST_NODE_TYPES.JSXSpreadAttribute);if(m){y=!0;break}let g={argCount:1,hasSpread:m};for(let S of i.optionalParams)if(S.isObjectParam&&S.index===0){let f={};for(let T of u.attributes)T.type===J.AST_NODE_TYPES.JSXAttribute&&T.name.type===J.AST_NODE_TYPES.JSXIdentifier&&(f[T.name.name]=!0);g.objectArgs||(g.objectArgs=[]),g.objectArgs[0]=f}d.push(g)}}if(!(y||d.length===0))for(let o of i.optionalParams)if(o.isObjectParam&&o.objectProps)for(let u of o.objectProps){if(!u.optional)continue;let m=!1;for(let g of d)if(g.objectArgs&&g.objectArgs[o.index]){let S=g.objectArgs[o.index];if(S&&S[u.name]){m=!0;break}}m||e.report({node:o.param,messageId:"unusedOptionalProp",data:{name:u.name}})}else{let u=!1;for(let m of d)if(m.argCount>o.index){u=!0;break}u||e.report({node:o.param,messageId:"unusedOptionalArg",data:{name:o.name}})}}}}}});var B=require("@typescript-eslint/utils"),Ne=require("zod/v4");var Is=Ne.z.object({selectors:Ne.z.array(Ne.z.object({name:Ne.z.string(),selectorProp:Ne.z.string().optional(),selectorArgPos:Ne.z.number().optional(),returnProp:Ne.z.string().optional()}))}),Rs=B.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),Zn="no-unused-selected-values",zt={name:Zn,rule:Rs({name:Zn,meta:{type:"suggestion",docs:{description:"Disallow unused values in selector objects"},messages:{unusedSelectedValue:'The selected value "{{name}}" is not being used'},schema:[j(Is)]},defaultOptions:[{selectors:[]}],create(e,[n]){let{selectors:r=[]}=n,t=new Map(r.map(s=>[s.name,s]));return{VariableDeclarator(s){let a=null;if(s.init?.type===B.AST_NODE_TYPES.CallExpression&&(a=s.init),!a)return;let i=vs(a);if(!i)return;let p=t.get(i);if(!p)return;let l=ws(a,p.selectorArgPos??0,p.selectorProp);if(!l)return;let c=ks(l);if(!c)return;let y=Gn(c.properties,void 0);if(!y)return;if(s.id.type===B.AST_NODE_TYPES.ObjectPattern){let u=Gn(s.id.properties,p.returnProp);if(!u)return;for(let[m,g]of y)u.has(m)||e.report({node:g,messageId:"unusedSelectedValue",data:{name:m}});return}if(s.id.type!==B.AST_NODE_TYPES.Identifier||p.returnProp)return;let d=Fs(s,e.sourceCode);if(d.length===0)return;let o=new Set;for(let u of d){if(u.identifier.parent.type!==B.AST_NODE_TYPES.MemberExpression)return;let m=u.identifier.parent.property;if(m.type!==B.AST_NODE_TYPES.Identifier)return;o.add(m.name)}for(let[u,m]of y)o.has(u)||e.report({node:m,messageId:"unusedSelectedValue",data:{name:u}})}}}})};function ws(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 s=t.properties.find(i=>i.type===B.AST_NODE_TYPES.Property&&i.key.type===B.AST_NODE_TYPES.Identifier&&i.key.name===r);if(s?.type!==B.AST_NODE_TYPES.Property)return null;let a=s.value;if(a.type===B.AST_NODE_TYPES.ArrowFunctionExpression||a.type===B.AST_NODE_TYPES.FunctionExpression)return a}return null}function vs(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 ks(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 Gn(e,n){let r=e;if(n){let s=e.find(a=>a.type===B.AST_NODE_TYPES.Property&&a.key.type===B.AST_NODE_TYPES.Identifier&&a.key.name===n);if(s?.type!==B.AST_NODE_TYPES.Property||s.value.type!==B.AST_NODE_TYPES.ObjectPattern)return null;r=s.value.properties}let t=new Map;for(let s of r){if(s.type!==B.AST_NODE_TYPES.Property||s.key.type!==B.AST_NODE_TYPES.Identifier)return null;t.set(s.key.name,s)}return t.size>0?t:null}function Fs(e,n){let r=n.getDeclaredVariables(e);if(r.length!==1)return[];let t=r[0];return t?t.references.filter(s=>s.identifier!==e.id):[]}var Y=require("@typescript-eslint/utils");var Jt=X({name:"no-unused-t-state-field",meta:{type:"suggestion",docs:{description:"Prevent declaring unused t-state fields"},messages:{unusedField:'Field "{{name}}" is not being used, you can safely remove it'},schema:[]},defaultOptions:[],create(e){if(!(e.filename.endsWith(".jsx")||e.filename.endsWith(".tsx")))return{};if(!e.sourceCode.ast.body.some(a=>a.type===Y.AST_NODE_TYPES.ImportDeclaration&&a.source.value==="t-state-form"))return{};let t=null,s=!1;return{CallExpression(a){if(s)return;if(!t){let p=Ps(a);p&&(t=p);return}let i=Os(a,e.sourceCode);if(i){s=!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 Ps(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=xt(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?Ns(a.value):null);if(!t)return null;let s=new Map;for(let a of t.properties)a.type===Y.AST_NODE_TYPES.Property&&a.key.type===Y.AST_NODE_TYPES.Identifier&&s.set(a.key.name,a);return s}function Os(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||!xt(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 s=On(e.parent,"formFields",n),a=new Set;for(let{identifier:i}of s){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 Ns(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 V=require("@typescript-eslint/utils"),qe=require("zod/v4");var Ds=V.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`);function Kn(e){let n=[];for(let r of e.members)r.type===V.AST_NODE_TYPES.TSPropertySignature&&r.key.type===V.AST_NODE_TYPES.Identifier&&n.push([r.key.name,r]);return n}function Qn(e,...n){for(let r of n)e.set(...r);return e}var Ls=qe.z.object({forceCheckOnFCPropTypesWithName:qe.z.array(qe.z.string()).optional(),alwaysCheckFunctionOptionTypes:qe.z.boolean().optional()}),er="no-unused-type-props-in-args",Vt=null,js=Ds({name:er,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(Ls)],fixable:"code"},defaultOptions:[{alwaysCheckFunctionOptionTypes:!0}],create(e,[n]){let{forceCheckOnFCPropTypesWithName:r,alwaysCheckFunctionOptionTypes:t=!0}=n;r&&!Vt&&(Vt=r.map(l=>new RegExp(l)));function s(l,c,y,d,o=!0,u=!1){let m=y.name,g=e.sourceCode.getScope(c).references.find(h=>h.identifier.name===m)?.resolved,S=l&&Vt?.some(h=>h.test(m)),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===V.AST_NODE_TYPES.ExportNamedDeclaration;if(!(o&&b&&!f)){if(T.type===V.AST_NODE_TYPES.TSTypeAliasDeclaration){a(l,c,d,T.typeAnnotation,!0,u);return}if(T.type===V.AST_NODE_TYPES.TSInterfaceDeclaration){a(l,c,d,T.body,!0,u);return}}}function a(l,c,y,d,o,u=!1){if(d.type===V.AST_NODE_TYPES.TSInterfaceBody){for(let m of d.body)m.type===V.AST_NODE_TYPES.TSPropertySignature&&m.key.type===V.AST_NODE_TYPES.Identifier&&y.set(m.key.name,m);return}if(d.type===V.AST_NODE_TYPES.TSTypeLiteral){Qn(y,...Kn(d));return}if(d.type===V.AST_NODE_TYPES.TSIntersectionType){for(let m of d.types)a(l,c,y,m,!0,u);return}o||d.type===V.AST_NODE_TYPES.TSTypeReference&&d.typeName.type===V.AST_NODE_TYPES.Identifier&&s(l,c,d.typeName,y,!0,u)}function i(l,c,y,d=!1){for(let o of y)if(o.type===V.AST_NODE_TYPES.ObjectPattern&&o.typeAnnotation){let u=new Map;if(a(l,c,u,o.typeAnnotation.typeAnnotation,!1,d),u.size===0)continue;p(o,u)}else o.type===V.AST_NODE_TYPES.AssignmentPattern&&o.left.type===V.AST_NODE_TYPES.ObjectPattern&&i(l,c,[o.left],d)}function p(l,c){let y=[];if(l.properties.at(-1)?.type===V.AST_NODE_TYPES.RestElement)return;for(let m of l.properties)m.type===V.AST_NODE_TYPES.Property&&m.key.type===V.AST_NODE_TYPES.Identifier&&y.push(m.key.name);let o=[],u=[];for(let[m,g]of c)y.includes(m)||(u.push(m),o.push({node:g,messageId:"unusedObjectTypeProperty",data:{propertyName:m}}));for(let[m,g]of o.entries())e.report({...g,fix:m===o.length-1?S=>{let f=l.properties.at(-1),T=u.join(", ");return f?f.type===V.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],y=new Map,d=c.id.type===V.AST_NODE_TYPES.Identifier&&c.id.typeAnnotation?.typeAnnotation.type===V.AST_NODE_TYPES.TSTypeReference&&c.id.typeAnnotation.typeAnnotation.typeName.type===V.AST_NODE_TYPES.Identifier&&c.id.typeAnnotation.typeAnnotation.typeName.name==="FC"&&c.id.typeAnnotation.typeAnnotation.typeArguments?.params[0];if(d){if(d.type===V.AST_NODE_TYPES.TSTypeReference&&d.typeName.type===V.AST_NODE_TYPES.Identifier)s(!0,l,d.typeName,y,!1);else if(d.type===V.AST_NODE_TYPES.TSTypeLiteral)Qn(y,...Kn(d));else if(d.type===V.AST_NODE_TYPES.TSIntersectionType)for(let o of d.types)o.type===V.AST_NODE_TYPES.TSTypeReference&&o.typeName.type===V.AST_NODE_TYPES.Identifier?s(!0,l,o.typeName,y,!1):a(!0,l,y,o,!0);if(y.size!==0&&c.init?.type===V.AST_NODE_TYPES.ArrowFunctionExpression){let o=c.init.params[0];if(!o){e.report({node:c.init,messageId:"missingComponentParam"});return}o.type===V.AST_NODE_TYPES.ObjectPattern&&p(o,y)}}},FunctionDeclaration(l){i(!1,l,l.params,t)},ArrowFunctionExpression(l){i(!1,l,l.params,t)}}}}),Xt={name:er,rule:js};var ye=require("@typescript-eslint/utils");var Ht=X({name:"no-write-only-ref",meta:{type:"problem",docs:{description:"Disallow creating refs that are never read"},messages:{refNotRead:'Ref "{{name}}" is never read. Consider removing it if not needed.'},schema:[]},defaultOptions:[],create(e){let n=new Set;function r(t){return t.callee.type===ye.AST_NODE_TYPES.Identifier?n.has(t.callee.name):t.callee.type===ye.AST_NODE_TYPES.MemberExpression&&t.callee.object.type===ye.AST_NODE_TYPES.Identifier&&t.callee.property.type===ye.AST_NODE_TYPES.Identifier?t.callee.property.name==="useRef":!1}return{ImportDeclaration(t){if(t.source.value==="react")for(let s of t.specifiers)s.type===ye.AST_NODE_TYPES.ImportSpecifier&&s.imported.type===ye.AST_NODE_TYPES.Identifier&&s.imported.name==="useRef"&&n.add(s.local.name)},VariableDeclarator(t){if(t.init&&t.init.type===ye.AST_NODE_TYPES.CallExpression&&r(t.init)&&t.id.type===ye.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===ye.AST_NODE_TYPES.JSXExpressionContainer&&c.parent.type===ye.AST_NODE_TYPES.JSXAttribute&&c.parent.name.type===ye.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 ze=require("@typescript-eslint/utils"),Ms=ze.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),nr="prefer-named-functions",tr=new Map,$s=Ms({name:nr,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=tr.get(n.ignoreRegex);t?r=t:(r=new RegExp(n.ignoreRegex),tr.set(n.ignoreRegex,r))}return{VariableDeclarator(t){if(t.init&&t.init.type===ze.AST_NODE_TYPES.ArrowFunctionExpression&&t.id.type===ze.AST_NODE_TYPES.Identifier){let s=t.id.name;if(t.id.typeAnnotation||r&&r.test(s)||!n.disallowArrowFnWithImplicitReturns&&t.init.body.type!==ze.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:s,ignoreRegex:n.ignoreRegex},suggest:[{messageId:"suggestion",fix:c=>c.replaceText(a,`${l.async?"async ":""}function ${s}(${i.map(y=>e.sourceCode.getText(y)).join(", ")||""}) ${e.sourceCode.getText(p)}`)}]})}}}}}),Bt={name:nr,rule:$s};var M=require("@typescript-eslint/utils"),he=require("zod/v4");var _s=he.z.object({disallowedFunctions:he.z.array(he.z.object({name:he.z.string(),allowUsingWithArgs:he.z.boolean().optional(),hookAlternative:he.z.string().optional(),message:he.z.string().optional(),allowUseInside:he.z.array(he.z.string()).optional()}))}),Us=/^use[A-Z]/,Ws=/^[A-Z]/;function lt(e){return Us.test(e)}function rr(e){return Ws.test(e)}function zs(e){return e.type===M.AST_NODE_TYPES.Identifier?lt(e.name):e.type===M.AST_NODE_TYPES.MemberExpression&&e.property.type===M.AST_NODE_TYPES.Identifier?lt(e.property.name):!1}function ir(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 sr(e){return!!(e.parent&&e.parent.type===M.AST_NODE_TYPES.CallExpression&&ir(e.parent.callee,"forwardRef"))}function or(e){return!!(e.parent&&e.parent.type===M.AST_NODE_TYPES.CallExpression&&ir(e.parent.callee,"memo"))}function Yt(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 Js(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=Yt(n);if(t&&t.type===M.AST_NODE_TYPES.Identifier){if(rr(t.name)||lt(t.name))return!r;r=!0}else{if(sr(n)||or(n))return!r;if(n.parent.type===M.AST_NODE_TYPES.CallExpression){let s=n.parent;zs(s.callee)||(r=!0)}else n.parent.type===M.AST_NODE_TYPES.JSXExpressionContainer||(r=!0)}}n=n.parent}return!1}function ar(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 Vs(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=Yt(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=ar(r);if(t&&n.includes(t))return!0}r=r.parent}return!1}function Xs(e){return e.arguments.length>0&&!e.arguments.every(n=>n.type===M.AST_NODE_TYPES.Identifier&&n.name==="undefined")}function Hs(e,n){let r=!1,t=e.parent;for(;t;){if(t.type===M.AST_NODE_TYPES.FunctionDeclaration||t.type===M.AST_NODE_TYPES.FunctionExpression||t.type===M.AST_NODE_TYPES.ArrowFunctionExpression){let s=Yt(t);if(s&&s.type===M.AST_NODE_TYPES.Identifier){if(rr(s.name)||lt(s.name)){r=!0;break}}else if(sr(t)||or(t)){r=!0;break}}t=t.parent}return r?n.length===0?Js(e):!Vs(e,n):!1}var qt=X({name:"prefer-react-hook-alternative",meta:{type:"suggestion",docs:{description:"Prefer hook alternatives for certain functions in React components and hooks"},messages:{preferHookAlternative:"This function should not be used in react{{message}}."},schema:[j(_s)],hasSuggestions:!0},defaultOptions:[{disallowedFunctions:[]}],create(e,[n]){let{disallowedFunctions:r}=n,t=new Map(r.map(s=>[s.name,s]));return{CallExpression(s){let a=ar(s);if(!a)return;let i=t.get(a);if(!i||i.allowUsingWithArgs&&Xs(s))return;let p=i.allowUseInside||[];Hs(s,p)&&e.report({node:s,messageId:"preferHookAlternative",data:{message:i.message?` ${i.message}`:` use ${i.hookAlternative} instead`},suggest:i.hookAlternative?[{messageId:"preferHookAlternative",data:{message:`Replace with ${i.hookAlternative}`,hookAlternative:i.hookAlternative},fix:l=>{let c=i.hookAlternative;return c?s.callee.type===M.AST_NODE_TYPES.Identifier?l.replaceText(s.callee,c):s.callee.type===M.AST_NODE_TYPES.MemberExpression&&s.callee.property.type===M.AST_NODE_TYPES.Identifier?l.replaceText(s.callee.property,c):null:null}}]:[]})}}}});var Z=require("@typescript-eslint/utils"),pt=Ce(require("zod/v4"));var Bs=Z.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),pr="prefer-single-line-if",Ys=pt.default.object({maxLineLength:pt.default.number().optional(),maxNonSimpleConditionLength:pt.default.number().optional()}),qs=Bs({name:pr,meta:{type:"suggestion",fixable:"code",docs:{description:"Enforce single-line if in simple if statements"},messages:{noSingleLineCurly:"If return statement with single statement body should be written in a single line"},schema:[j(Ys)]},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(!ur(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=lr(t.test);if(!d&&t.test.type===Z.AST_NODE_TYPES.UnaryExpression&&t.test.operator==="!"){let o=t.test.argument;lr(o)&&(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(`
16
- `))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=Zs(r,t),y=`if (${i}) ${p}`;n.maxLineLength&&y.length+c.length>n.maxLineLength||e.report({node:t,messageId:"noSingleLineCurly",fix:d=>d.replaceText(t,y)})}}}});function lr(e){return e.type===Z.AST_NODE_TYPES.CallExpression||e.type===Z.AST_NODE_TYPES.BinaryExpression||e.type===Z.AST_NODE_TYPES.MemberExpression&&cr(e)}function cr(e){return e.object.type===Z.AST_NODE_TYPES.MemberExpression?cr(e.object):e.object.type!==Z.AST_NODE_TYPES.Identifier}function Zs(e,n){return e.text.slice(n.range[0]-n.loc.start.column,n.range[0])}function ur(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?ur(n):!1}var Zt={name:pr,rule:qs};var P=require("@typescript-eslint/utils"),Kt=require("zod/v4");var Gs=P.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),dr="react-compiler-extra",Ks=Kt.z.object({runOnlyWithEnableCompilerDirective:Kt.z.boolean().optional()}),Qs=/eslint +react-compiler\/react-compiler: +\["error/;function gr(e){return e.type===P.AST_NODE_TYPES.Identifier?e.name.startsWith("use"):!1}function eo(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 Ee(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 Ee(e.consequent)||Ee(e.alternate);case P.AST_NODE_TYPES.LogicalExpression:return e.operator==="&&"?Ee(e.right):e.operator==="||"?Ee(e.left)||Ee(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&&Ee(n))return!0;return!1;default:return!1}}function to(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 no=/^[A-Z][a-zA-Z0-9]*$/;function Ge(e){return no.test(e)}function Qt(e){return e.startsWith("use")&&e.length>3}function en(e,n,r,t){if(r&&to(r))return n?Ge(n.name):e.type===P.AST_NODE_TYPES.FunctionDeclaration&&e.id?Ge(e.id.name):!0;if(n&&Qt(n.name)||e.type===P.AST_NODE_TYPES.FunctionDeclaration&&e.id&&Qt(e.id.name))return!0;if(t){let s=n?.name||e.type===P.AST_NODE_TYPES.FunctionDeclaration&&e.id?.name;if(s&&Ge(s)&&Sr(e.body,t).containsJSX)return!0}return!1}function Ze(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 Sr(e,n){let r={containsJSX:!1,containsHookCalls:!1};return Pe(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:gr(t.callee)&&(r.containsHookCalls=!0),Ee(t)&&(r.containsJSX=!0);break;case P.AST_NODE_TYPES.ReturnStatement:t.argument&&Ee(t.argument)&&(r.containsJSX=!0);break;case P.AST_NODE_TYPES.VariableDeclarator:t.init&&Ee(t.init)&&(r.containsJSX=!0);break;case P.AST_NODE_TYPES.AssignmentExpression:Ee(t.right)&&(r.containsJSX=!0);break}},n),r}function fr(e,n){let r=e.body,t=Sr(r,n);return t.containsJSX||t.containsHookCalls}var ro=/\bthis[.[]/;function mr(e){return ro.test(e)}function io(e,n){let r={containsJSX:!1,containsHookCalls:!1};return Pe(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&&eo(t.callee)&&(r.containsHookCalls=!0)},n),r}function yr(e){return Ge(e)||Qt(e)}function Gt(e,n,r,t){if(!io(e.body,n).containsHookCalls)return!1;let a=en(e,r,t,n);if(!a&&t){let i=r?.name||e.type===P.AST_NODE_TYPES.FunctionDeclaration&&e.id?.name;i&&Ge(i)&&(a=!0)}return!a}var so=Gs({name:dr,meta:{type:"suggestion",fixable:"code",docs:{description:"Extra rules to enforce best practices when using the React compiler"},messages:{objectMethodIsNotSupported:"Object methods such as `{ method() {} }` have limited support to optimizations in the React compiler, use a function expression `{ method: () => {} }` instead.",replaceWithFunctionExpression:"Replace with function expression",thisKeywordInMethod:"Object method uses `this` keyword which would have different behavior if converted to an arrow function. Fix this manually.",fcComponentShouldReturnJsx:'React components and hooks should create JSX elements, call other hooks or use the "use memo" directive for optimal React compiler detection.',addUseMemoDirective:'Add "use memo" directive to opt into React compiler memoization',functionCallingHooksMustBeComponent:'Functions calling hooks must be React components (PascalCase with FC type) or hooks (start with "use").',useMemoDirectiveNaming:'Functions using "use memo" directive must follow React naming conventions (PascalCase for components or start with "use" for hooks).'},hasSuggestions:!0,schema:[j(Ks)]},defaultOptions:[{}],create(e,[n]){let r=!1;if(n.runOnlyWithEnableCompilerDirective){for(let a of e.sourceCode.getAllComments())if(Qs.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,y=p.getText(c.body);if(mr(y))e.report({node:i,messageId:"thisKeywordInMethod"});else{let d=c.params.map(u=>p.getText(u)).join(", "),o="";c.generator?o=`${l}: function* (${d}) ${y}`:o=`${l}: (${d}) => ${y}`,e.report({node:i,messageId:"objectMethodIsNotSupported",fix:u=>u.replaceText(i,o)})}}}function s(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);mr(c)&&e.report({node:p,messageId:"thisKeywordInMethod"})}}}return{CallExpression(a){if(gr(a.callee))for(let i of a.arguments){if(i.type===P.AST_NODE_TYPES.ObjectExpression&&(t(i),s(i)),i.type===P.AST_NODE_TYPES.ArrowFunctionExpression&&(i.body.type===P.AST_NODE_TYPES.ObjectExpression&&(t(i.body),s(i.body)),i.body.type===P.AST_NODE_TYPES.BlockStatement))for(let p of i.body.body)p.type===P.AST_NODE_TYPES.ReturnStatement&&p.argument?.type===P.AST_NODE_TYPES.ObjectExpression&&(t(p.argument),s(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),s(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(Ze(i)&&!yr(p.name)){e.report({node:i,messageId:"useMemoDirectiveNaming"});return}if(Gt(i,e.sourceCode,p,l)){e.report({node:i,messageId:"functionCallingHooksMustBeComponent"});return}if(en(i,p,l,e.sourceCode)){let c=fr(i,e.sourceCode),y=Ze(i);!c&&!y&&e.report({node:i,messageId:"fcComponentShouldReturnJsx",suggest:[{messageId:"addUseMemoDirective",fix(d){if(i.body.type===P.AST_NODE_TYPES.BlockStatement){let o=i.body.range[0]+1;return d.insertTextAfterRange([o,o],`
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(`
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
19
  "use memo"
18
- `)}return null}}]})}}},FunctionDeclaration(a){if(a.id&&Ze(a)&&!yr(a.id.name)){e.report({node:a,messageId:"useMemoDirectiveNaming"});return}if(Gt(a,e.sourceCode)){e.report({node:a,messageId:"functionCallingHooksMustBeComponent"});return}if(en(a,void 0,void 0,e.sourceCode)){let i=fr(a,e.sourceCode),p=Ze(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],`
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],`
19
21
  "use memo"
20
- `)}}]})}},FunctionExpression(a){if(Ze(a)){e.report({node:a,messageId:"useMemoDirectiveNaming"});return}Gt(a,e.sourceCode)&&e.report({node:a,messageId:"functionCallingHooksMustBeComponent"})}}}}),tn={name:dr,rule:so};var le=require("@typescript-eslint/utils"),ge=require("zod/v4");var oo=le.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),Tr="react-compiler-migration",ao=ge.z.object({disallowHooks:ge.z.array(ge.z.object({name:ge.z.string(),replacement:ge.z.string()})).optional(),disallowMethods:ge.z.array(ge.z.object({name:ge.z.string(),replacement:ge.z.string().optional(),requireTrueProp:ge.z.string().optional()})).optional()}),lo=/eslint +react-compiler\/react-compiler: +\["error/;function po(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 co=oo({name:Tr,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(ao)]},defaultOptions:[{disallowHooks:[],disallowMethods:[]}],create(e,[n]){let r=!1;for(let t of e.sourceCode.getAllComments())if(lo.test(t.value)){r=!0;break}return r?{CallExpression(t){if(n.disallowHooks?.length){let s=null,a=null;if(t.callee.type===le.AST_NODE_TYPES.Identifier?(s=t.callee.name,a=t.callee):t.callee.type===le.AST_NODE_TYPES.MemberExpression&&t.callee.property.type===le.AST_NODE_TYPES.Identifier&&(s=t.callee.property.name,a=t.callee.property),s){let i=n.disallowHooks.find(p=>p.name===s);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&&po(t.callee)){for(let s of t.arguments)if(s.type===le.AST_NODE_TYPES.ObjectExpression){for(let a of s.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 y of s.properties)if(y.type===le.AST_NODE_TYPES.Property&&y.key.type===le.AST_NODE_TYPES.Identifier&&y.key.name===l&&y.value.type===le.AST_NODE_TYPES.Literal&&y.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}]})}}}}}}:{}}}),nn={name:Tr,rule:co};var k=require("@typescript-eslint/utils"),sn=require("zod");var uo=sn.z.object({runOnlyWithEnableCompilerDirective:sn.z.boolean().optional()}),fo=/eslint +react-compiler\/react-compiler: +\["error/,mo=/^\d+$/,yo=/[\s_-]+/,go=/[a-z][A-Z]/,So=/^(.+?)([A-Z][a-z]+s?)$/,To=/^[a-z][a-zA-Z]*$/;function hr(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 s=t.name.name,a=t.value.expression,i=!1;Pe(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(s)}}return{hasUnstable:r.length>0,problematicProps:r}}function ho(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 Eo(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 s=t.name,a=bo(s);if(a!==s)return on(a)}}if(n.length>0){let t=n[0];if(t&&t.type===k.AST_NODE_TYPES.Identifier)return on(t.name)}return"ListItem"}function bo(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(go)){let t=e.match(So);if(t){let s=t[1],a=t[2];if(!s||!a)return rn(e);let i=rn(a);if(i!==a)return s+i}}return rn(e)}function rn(e){return e.endsWith("ies")?`${e.slice(0,-3)}y`:e.endsWith("es")&&e.length>3?e.slice(0,-2):e.endsWith("s")&&e.length>1?e.slice(0,-1):e}function on(e){return e.match(To)?e.charAt(0).toUpperCase()+e.slice(1):e.split(yo).map(n=>n.charAt(0).toUpperCase()+n.slice(1).toLowerCase()).join("")}function Er(e,n,r){let t=[],s=new Set,a=new Set(["console","document","window","Math","Object","Array","String","Number","Boolean","undefined","null"]);Pe(e,i=>{if(i.type===k.AST_NODE_TYPES.Identifier&&!n.includes(i.name)&&!a.has(i.name)&&!mo.test(i.name)){let p=i.parent;if(p.type===k.AST_NODE_TYPES.Property&&p.key===i||p.type===k.AST_NODE_TYPES.MemberExpression&&p.property===i&&!p.computed||p.type===k.AST_NODE_TYPES.JSXOpeningElement||p.type===k.AST_NODE_TYPES.JSXClosingElement||p.type===k.AST_NODE_TYPES.JSXAttribute&&p.name.type===k.AST_NODE_TYPES.JSXIdentifier&&p.name.name===i.name)return!1;s.add(i.name)}return!1},r);for(let i of s)n.includes(i)||t.push({name:i,type:"unknown"});return t}function br(e,n,r,t,s){let i=[...r.map(d=>d.type===k.AST_NODE_TYPES.Identifier?d.name:"item").map((d,o)=>({name:d,type:o===0?`${e}Type`:o===1?"number":"unknown"})),...t],p=i.map(d=>{let o=d.type;return d.name.includes("on")&&o==="any"&&(o="unknown"),` ${d.name}: ${o};`}).join(`
21
- `),l=i.map(d=>d.name).join(", "),c=s.getText(n),y=`${e}Props`;return`type ${y} = {
22
- ${p}
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}
23
25
  };
24
26
 
25
- const ${e}: FC<${y}> = ({ ${l} }) => {
27
+ const ${e}: FC<${m}> = ({ ${l} }) => {
26
28
  return (
27
- ${c}
29
+ ${p}
28
30
  );
29
- };`}function xo(e,n,r,t){let s=n.map(i=>i.type===k.AST_NODE_TYPES.Identifier?i.name:"item"),a=[t?`key={${t}}`:`key={${s[0]}.id}`,...s.map(i=>`${i}={${i}}`),...r.map(i=>`${i.name}={${i.name}}`)].filter(Boolean);return`<${e} ${a.join(" ")} />`}function Co(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 on(n)}return"ListItem"}function Ao(e,n,r){let t=[r?`key={${r}}`:"",...n.map(s=>`${s.name}={${s.name}}`)].filter(Boolean);return`<${e}${t.length>0?` ${t.join(" ")}`:""} />`}function xr(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 an=X({name:"react-optimized-collections",meta:{type:"suggestion",docs:{description:"Detect unstable values in map renders that prevent React Compiler optimization"},messages:{unstableValueInMap:"Unstable values in {{problematicProps}} prevent React Compiler from optimizing individual list items. Extract the problematic props to outside the loop or extract the item to a separate component.",extractComponent:"Extract to {{componentName}} component"},schema:[j(uo)],hasSuggestions:!0},defaultOptions:[{runOnlyWithEnableCompilerDirective:!1}],create(e,[n]){let{sourceCode:r}=e;if(n.runOnlyWithEnableCompilerDirective){let t=!1;for(let s of r.getAllComments())if(fo.test(s.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"?Io(t,r,e):Ro(t,r,e))}}}});function Io(e,n,r){let t=e.arguments[0];if(!t||t.type!==k.AST_NODE_TYPES.ArrowFunctionExpression&&t.type!==k.AST_NODE_TYPES.FunctionExpression||!ho(t))return;let s=null;if(t.body.type===k.AST_NODE_TYPES.JSXElement||t.body.type===k.AST_NODE_TYPES.JSXFragment?s=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)&&(s=t.body.body[0].argument),!s)return;let a=hr(s,n);if(!a.hasUnstable)return;let i=Eo(e,t.params),p=t.params.map(d=>d.type===k.AST_NODE_TYPES.Identifier?d.name:"item"),l=Er(s,p,n),c=s.type===k.AST_NODE_TYPES.JSXElement?xr(s,n):null,y=a.problematicProps.length===1?`prop "${a.problematicProps[0]}"`:`props "${a.problematicProps.join('", "')}"`;r.report({node:s,messageId:"unstableValueInMap",data:{problematicProps:y},suggest:[{messageId:"extractComponent",data:{componentName:i},fix:d=>{let o=br(i,s,t.params,l,n),u=xo(i,t.params,l,c),m=e;for(;m.parent.type!==k.AST_NODE_TYPES.Program&&!(m.type===k.AST_NODE_TYPES.FunctionDeclaration||m.type===k.AST_NODE_TYPES.VariableDeclarator&&m.init&&(m.init.type===k.AST_NODE_TYPES.ArrowFunctionExpression||m.init.type===k.AST_NODE_TYPES.FunctionExpression));)m=m.parent;let g=[];return g.push(d.insertTextAfter(m,`
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,`
30
32
 
31
- ${o}`)),g.push(d.replaceText(s,u)),g}}]})}function Ro(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 s=t,a=hr(s,n);if(!a.hasUnstable)return;let i=Co(s),p=Er(s,[],n),l=s.type===k.AST_NODE_TYPES.JSXElement?xr(s,n):null,c=a.problematicProps.length===1?`prop "${a.problematicProps[0]}"`:`props "${a.problematicProps.join('", "')}"`;r.report({node:s,messageId:"unstableValueInMap",data:{problematicProps:c},suggest:[{messageId:"extractComponent",data:{componentName:i},fix:y=>{let d=br(i,s,[],p,n),o=Ao(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 m=[];return m.push(y.insertTextAfter(u,`
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,`
32
34
 
33
- ${d}`)),m.push(y.replaceText(s,o)),m}}]})}var ct=require("@typescript-eslint/utils"),wo=ct.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),Cr="require-description",vo=/^(eslint(?:-env|-enable|-disable(?:(?:-next)?-line)?)?|exported|globals?)(?:\s|$)/u,ko=/^eslint-disable-(next-)?line$/u,Fo=wo({name:Cr,meta:{type:"problem",docs:{description:"Require descriptions for eslint directives."},messages:{missingDescription:"Unexpected undescribed directive comment. Include descriptions to explain why the comment is necessary."},schema:[{type:"object",properties:{ignore:{type:"array",items:{type:"string",enum:["eslint","eslint-disable","eslint-disable-line","eslint-disable-next-line","eslint-enable","eslint-env","exported","global","globals"]},additionalItems:!1,uniqueItems:!0}},additionalProperties:!1}]},defaultOptions:[{ignore:[]}],create(e,[n]){let r=e.sourceCode,t=new Set(n.ignore||[]);return{Program(){for(let s of r.getAllComments()){let a=Po(s);a!=null&&(t.has(a.kind)||a.description||e.report({loc:Do(s.loc),messageId:"missingDescription"}))}}}}}),Ar={name:Cr,rule:Fo};function Po(e){let{text:n,description:r}=No(e.value);if(!n)return null;let t=vo.exec(n);if(!t)return null;let s=t[1];if(!s)return null;let a=ko.test(s);if(e.type===ct.TSESTree.AST_TOKEN_TYPES.Line&&!a||a&&e.loc.start.line!==e.loc.end.line)return null;let i=n.slice(t.index+s.length);return{kind:s,value:i.trim(),description:r}}var Oo=/\s-{2,}\s/u;function No(e){let n=e.split(Oo);return{text:n[0]?.trim(),description:n.length>1?n[1]?.trim()??null:null}}function Do(e){return{start:{line:e.start.line,column:-1},end:e.end}}var W=require("@typescript-eslint/utils"),be=require("zod/v4");var Lo=be.z.object({varsToCheck:be.z.array(be.z.object({selector:be.z.string().optional(),fromFnCall:be.z.string().optional(),prop:be.z.string().or(be.z.array(be.z.string())),errorMsg:be.z.string().optional()}))}),ln=X({name:"require-reads-to-var-prop",meta:{type:"suggestion",docs:{description:"Require specific properties from variables to be read or ensure the variable is passed to functions/components"},messages:{propNotRead:'"{{fnName}}" requires reads to the prop "{{prop}}". {{customMsg}}',propsNotRead:'"{{fnName}}" requires reads to the props {{props}}. {{customMsg}}'},schema:[j(Lo)]},defaultOptions:[{varsToCheck:[]}],create(e,[n]){let r=new Map;function t(i,p,l,c){let y=new Set;for(let o of i.properties)o.type===W.AST_NODE_TYPES.Property&&o.key.type===W.AST_NODE_TYPES.Identifier&&y.add(o.key.name);let d=p.filter(o=>!y.has(o));if(d.length>0)if(d.length===1)e.report({node:i,messageId:"propNotRead",data:{prop:d[0],fnName:c,customMsg:l||""}});else{let o=d.map(u=>`"${u}"`).join(", ");e.report({node:i,messageId:"propsNotRead",data:{props:o,fnName:c,customMsg:l||""}})}}function s(i){if(i.init?.type===W.AST_NODE_TYPES.CallExpression){if(i.init.callee.type===W.AST_NODE_TYPES.Identifier)return i.init.callee.name;if(i.init.callee.type===W.AST_NODE_TYPES.MemberExpression&&i.init.callee.property.type===W.AST_NODE_TYPES.Identifier)return i.init.callee.object.type===W.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===W.AST_NODE_TYPES.VariableDeclarator&&p.id.type===W.AST_NODE_TYPES.Identifier&&r.set(p.id.name,{props:Array.isArray(i.prop)?i.prop:[i.prop],errorMsg:i.errorMsg,node:p.id,fnName:s(p)}),p.type===W.AST_NODE_TYPES.VariableDeclarator&&p.id.type===W.AST_NODE_TYPES.ObjectPattern){let l=Array.isArray(i.prop)?i.prop:[i.prop];t(p.id,l,i.errorMsg,s(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]=y=>{if(y.type!==W.AST_NODE_TYPES.MemberExpression||y.parent.type!==W.AST_NODE_TYPES.CallExpression)return;let d=y.parent;if(d.parent.type!==W.AST_NODE_TYPES.VariableDeclarator)return;let o=d.parent;if(o.id.type===W.AST_NODE_TYPES.Identifier)r.set(o.id.name,{props:Array.isArray(i.prop)?i.prop:[i.prop],errorMsg:i.errorMsg,node:o.id,fnName:i.fromFnCall||"unknown function"});else if(o.id.type===W.AST_NODE_TYPES.ObjectPattern){let u=Array.isArray(i.prop)?i.prop:[i.prop];t(o.id,u,i.errorMsg,i.fromFnCall||"unknown function")}}}else if(p.includes(".")){let[l,c]=p.split("."),y=`VariableDeclarator > CallExpression > MemberExpression[object.name="${l}"][property.name="${c}"]`;a[y]=d=>{if(d.type!==W.AST_NODE_TYPES.MemberExpression||d.parent.type!==W.AST_NODE_TYPES.CallExpression)return;let o=d.parent;if(o.parent.type!==W.AST_NODE_TYPES.VariableDeclarator)return;let u=o.parent;if(u.id.type===W.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===W.AST_NODE_TYPES.ObjectPattern){let m=Array.isArray(i.prop)?i.prop:[i.prop];t(u.id,m,i.errorMsg,i.fromFnCall||"unknown function")}}}else{let l=`VariableDeclarator > CallExpression > Identifier[name="${p}"]`;a[l]=c=>{if(c.type!==W.AST_NODE_TYPES.Identifier||c.parent.type!==W.AST_NODE_TYPES.CallExpression)return;let y=c.parent;if(y.parent.type!==W.AST_NODE_TYPES.VariableDeclarator)return;let d=y.parent;if(d.id.type===W.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===W.AST_NODE_TYPES.ObjectPattern){let o=Array.isArray(i.prop)?i.prop:[i.prop];t(d.id,o,i.errorMsg,i.fromFnCall||"unknown function")}}}}return{...a,"Program:exit"(){for(let[i,{props:p,errorMsg:l,node:c,fnName:y}]of r){let o=e.sourceCode.getScope(c).set.get(i);if(o){let u=new Set(p);for(let m of o.references){let g=m.identifier,S=g.parent;if(!(S.type===W.AST_NODE_TYPES.VariableDeclarator&&S.id===g)){if(S.type===W.AST_NODE_TYPES.MemberExpression&&S.object===g&&S.property.type===W.AST_NODE_TYPES.Identifier&&u.has(S.property.name)){if(u.delete(S.property.name),u.size===0)break;continue}if(S.type===W.AST_NODE_TYPES.VariableDeclarator&&S.init===g&&S.id.type===W.AST_NODE_TYPES.ObjectPattern){for(let f of S.id.properties)f.type===W.AST_NODE_TYPES.Property&&f.key.type===W.AST_NODE_TYPES.Identifier&&u.has(f.key.name)&&u.delete(f.key.name);if(u.size===0)break;continue}if(!(S.type===W.AST_NODE_TYPES.MemberExpression&&S.object===g&&S.property.type===W.AST_NODE_TYPES.Identifier&&!p.includes(S.property.name))){u.clear();break}}}if(u.size>0){let m=Array.from(u);if(m.length===1)e.report({node:c,messageId:"propNotRead",data:{prop:m[0],fnName:y,customMsg:l||""}});else{let g=m.map(S=>`"${S}"`).join(", ");e.report({node:c,messageId:"propsNotRead",data:{props:g,fnName:y,customMsg:l||""}})}}}}}}}});function wr(e){return/^use[A-Z0-9]/.test(e)}function ut(e){return e.type==="Identifier"?wr(e.name):e.type==="MemberExpression"&&!e.computed&&ut(e.property)?e.object.type==="Identifier":!1}function vr(e){return e.type==="Identifier"&&/^[A-Z]/.test(e.name)}function kr(e,n){return e.name===n||e.type==="MemberExpression"&&e.object.name==="React"&&e.property.name===n}function Fr(e){return!!(e.parent&&e.parent.callee&&kr(e.parent.callee,"forwardRef"))}function Pr(e){return!!(e.parent&&e.parent.callee&&kr(e.parent.callee,"memo"))}function pn(e){for(;e;){let n=Nr(e);if(n&&(vr(n)||ut(n))||Fr(e)||Pr(e))return!0;e=e.parent}return!1}function Ir(e){return!1}function cn(e){return!1}var jo=/eslint +react-compiler\/react-compiler: +\["error/,Or={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 y=null;c.callee.name==="useMemo"?y="useMemo":c.callee.name==="useCallback"&&(y="useCallback"),y&&e.report({node:c,message:`"${y}" 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,s=[],a=[],i=new WeakSet;function p(l){for(let c of l.references){let y=c.identifier.parent;if(y.type==="VariableDeclarator"&&y.init&&y.init.type==="CallExpression"&&y.init.callee&&Ir(y.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:()=>s.push(new Map),onCodePathEnd(l,c){let y=s.pop();if(y.size===0)return;let d=new Set;function o(h,I){let{cache:E}=o,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+=o(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 m(h){let{cache:I}=m,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=m(C);w<E&&(E=w)}E+=1}return I.set(h.id,E),E}o.cache=new Map,u.cache=new Map,m.cache=new Map;let g=u(l.initialSegment),S=Nr(c),f=pn(c),T=S?vr(S)||ut(S):Fr(c)||Pr(c),b=1/0;for(let h of l.finalSegments){if(!h.reachable)continue;let I=m(h);I<b&&(b=I)}for(let[h,I]of y){if(!h.reachable)continue;let E=h.nextSegments.length===0?b<=m(h):b<m(h),C=o(h)*u(h),w=d.has(h.id);for(let R of I)if(w&&!cn(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&&!cn(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&&!cn(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"&&wr(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(ut(l.callee)){let c=Rr(s),y=Rr(a),d=c.get(y);d||(d=[],c.set(y,d)),d.push(l.callee)}l.callee.type==="Identifier"&&(l.callee.name==="useEffect"||Ir(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){pn(l)&&p(r(l))},ArrowFunctionExpression(l){pn(l)&&p(r(l))}}}};function Nr(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 Rr(e){return e[e.length-1]}var re=require("@typescript-eslint/utils"),pe=Ce(require("zod/v4"));var Mo=/^\s+$/,un=/\r?\n/,$o=/^(\s*)/,_o=/^(\s*)\S/,Uo=/\r?\n/,Wo=pe.object({indent:pe.union([pe.string().regex(Mo),pe.number().int().min(1)]).optional(),tags:pe.array(pe.string()).optional(),functions:pe.array(pe.string()).optional(),comments:pe.array(pe.string()).optional()}),fn=X({name:"template-indent",meta:{type:"suggestion",docs:{description:"Fix whitespace-insensitive template indentation"},fixable:"code",schema:[j(Wo)],messages:{improperlyIndented:"Templates should be properly indented."}},defaultOptions:[{}],create(e){let n=e.sourceCode,{comments:r=["HTML","indent"],functions:t=["dedent","stripIndent"],tags:s=["outdent","dedent","gql","sql","html","styled"],indent:a}=e.options[0],i=r.map(f=>f.toLowerCase());function p(f){let T=f.split(un),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($o);E&&(h=Math.min(h,E[1]?.length??0))}return!isFinite(h)||h===0?f:T.map(I=>I.slice(h)).join(`
34
- `)}function l(f,T,b){return f.split(un).map(I=>I.trim()===""?I:b.repeat(T)+I).join(`
35
- `)}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 y(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 o(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 m(f){return o(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!!(m(f)||s.length>0&&d(f,s)||t.length>0&&f.parent.type===re.AST_NODE_TYPES.CallExpression&&f.parent.arguments.includes(f)&&y(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(Uo);if(!h)return;let I=h[0],E=n.lines[n.getLocFromIndex(f.range[0]).line-1];if(!E)return;let w=E.match(_o)?.[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
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
36
38
  `)?`\r
37
39
  `:`
38
- `,ie=b.split(un),se=ie.map((q,Se)=>Se!==ie.length-1&&q===R+w?"":q).join(K);if(te!==se)return{node:f,messageId:"improperlyIndented",fix:q=>te.split(T).map((Se,$e)=>{let ae=f.quasis[$e];return ae?q.replaceTextRange([ae.range[0]+1,ae.range[1]-(ae.tail?1:2)],Se):[]}).flat()}}return{TemplateLiteral(f){if(!g(f))return;let T=S(f);if(T)return e.report(T)}}}});var mn=require("@typescript-eslint/utils");function zo(e){if(!("regex"in e))return!1;let n=e.regex.flags;return n.includes("g")||n.includes("y")}function Jo(e){let n=e.parent;return n?.type===mn.AST_NODE_TYPES.NewExpression&&n.callee.type===mn.AST_NODE_TYPES.Identifier&&n.callee.name==="RegExp"}var yn=X({name:"use-top-level-regex",meta:{type:"suggestion",docs:{description:"Require regex literals to be declared at the top level to avoid performance issues"},messages:{regexShouldBeTopLevel:"Move this regex literal to the top level to avoid creating new RegExp objects on each function call."},schema:[],hasSuggestions:!1},defaultOptions:[],create(e){function n(r){zo(r)||Jo(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"),Je=require("zod/v4");var Vo=Je.z.object({checkOnly:Je.z.array(Je.z.enum(["function-args","FC","generic-args-at-fn-calls"])).optional(),checkTypesFromSelectors:Je.z.array(Je.z.string()).optional()}),dn=X({name:"use-types-directly-above-usage",meta:{type:"suggestion",docs:{description:"Require type definitions to be placed directly above their first usage for better readability"},fixable:"code",schema:[j(Vo)],messages:{moveTypeAboveUsage:"Type definition should be placed directly above its first usage."}},defaultOptions:[{}],create(e,[n]){let r=e.sourceCode,t=new Map,s=[];function a(o){for(let u of s)if(o.range[0]>=u.range[0]&&o.range[1]<=u.range[1])return u;return null}function i(o){let u=o.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 m=u.params;for(let g of m)if(o.range[0]>=g.range[0]&&o.range[1]<=g.range[1])return!0;break}u=u.parent}return!1}function p(o){let u=o.parent;for(;u;){if(u.type===ce.AST_NODE_TYPES.TSTypeParameterInstantiation){let m=u.parent;if(m.type===ce.AST_NODE_TYPES.TSTypeReference&&m.typeName.type===ce.AST_NODE_TYPES.Identifier&&(m.typeName.name==="FC"||m.typeName.name==="React.FC")||m.type===ce.AST_NODE_TYPES.TSTypeReference&&m.typeName.type===ce.AST_NODE_TYPES.TSQualifiedName&&m.typeName.right.name==="FC")return!0}u=u.parent}return!1}function l(o){let u=o.parent;for(;u;){if(u.type===ce.AST_NODE_TYPES.TSTypeParameterInstantiation){let m=u.parent;if(m.type===ce.AST_NODE_TYPES.CallExpression||m.type===ce.AST_NODE_TYPES.NewExpression)return!0}u=u.parent}return!1}let c=[];function y(o){let u=[],m=new Map;for(let{typeName:S,firstUsage:f}of o){let T=m.get(f)||[];T.push(S),m.set(f,T)}for(let{typeName:S,firstUsage:f,firstUsagePosition:T,firstUsageInFunctionArgs:b}of o){let h=t.get(S);if(!h||h.statement===f)continue;let I=s.indexOf(h.statement),E=s.indexOf(f);if(I===-1||E===-1)continue;let C=!!(n.checkOnly&&n.checkOnly.includes("function-args")&&b),R=(m.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=s.indexOf(S.typeDef.statement),h=s.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(o){return function*(u){let m=new Map;for(let g of o){let S=m.get(g.targetStatement)||[];S.push(g),m.set(g.targetStatement,S)}for(let[,g]of m)g.sort((S,f)=>{let T=S.firstUsagePosition-f.firstUsagePosition;if(T!==0)return T;let b=s.indexOf(S.typeDef.statement),h=s.indexOf(f.typeDef.statement);return b-h});for(let g of o){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 m){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(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(`
39
41
  `)}
40
42
  ${E}`),b.push(w)}yield u.insertTextBeforeRange([T,T],`${b.join(`
41
43
 
42
44
  `)}
43
45
 
44
- `)}}}return{Program(o){s.push(...o.body)},TSTypeAliasDeclaration(o){if(s.some(m=>m.type===ce.AST_NODE_TYPES.ExportNamedDeclaration&&m.declaration===o?!0:m===o)){let m=a(o);m&&t.set(o.id.name,{node:o,name:o.id.name,statement:m})}},TSInterfaceDeclaration(o){if(s.some(m=>m.type===ce.AST_NODE_TYPES.ExportNamedDeclaration&&m.declaration===o?!0:m===o)){let m=a(o);m&&t.set(o.id.name,{node:o,name:o.id.name,statement:m})}},TSTypeReference(o){if(o.typeName.type===ce.AST_NODE_TYPES.Identifier){let u=i(o),m=p(o),g=l(o);c.push({typeName:o.typeName.name,node:o,inFunctionArgs:u,inFCProps:m,inGenericArgAtFunctionCall:g,usagePosition:o.range[0]})}},"Program:exit"(){let o=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){o.has(S)||o.set(S,[]);let h=o.get(S);if(!h)return;h.includes(T)||h.push(T)}}}let m=[];for(let[g,S]of o)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);m.push({typeName:g,firstUsage:f,firstUsagePosition:T,firstUsageInFunctionArgs:b})}m.length>0&&y(m)}}}});var Dr={[Xt.name]:Xt.rule,[Rt.name]:Rt.rule,[It.name]:It.rule,"rules-of-hooks":Or,"exhaustive-deps":wn,"require-description":Ar.rule,[wt.name]:wt.rule,[kt.name]:kt.rule,[Bt.name]:Bt.rule,[yt.name]:yt.rule,[At.name]:At.rule,[Pt.name]:Pt.rule,[He.name]:He.rule,[Zt.name]:Zt.rule,[Ft.name]:Ft.rule,[vt.name]:vt.rule,[Nt.name]:Nt.rule,[gt.name]:gt.rule,[nn.name]:nn.rule,[tn.name]:tn.rule,[an.name]:an.rule,[Ct.name]:Ct.rule,[Mt.name]:Mt.rule,[$t.name]:$t.rule,[zt.name]:zt.rule,[Jt.name]:Jt.rule,[_t.name]:_t.rule,[Wt.name]:Wt.rule,[qt.name]:qt.rule,[Lt.name]:Lt.rule,[Dt.name]:Dt.rule,[yn.name]:yn.rule,[Ht.name]:Ht.rule,[ln.name]:ln.rule,[fn.name]:fn.rule,[dn.name]:dn.rule,[He.name]:He.rule};var Xo={rules:Dr};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=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});