@ls-stack/extended-lint 0.91.0 → 1.0.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,55 +1,44 @@
1
- "use strict";var Hi=Object.create;var Ft=Object.defineProperty;var Yi=Object.getOwnPropertyDescriptor;var qi=Object.getOwnPropertyNames;var Zi=Object.getPrototypeOf,Gi=Object.prototype.hasOwnProperty;var Ki=(e,t)=>{for(var r in t)Ft(e,r,{get:t[r],enumerable:!0})},mr=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of qi(t))!Gi.call(e,s)&&s!==r&&Ft(e,s,{get:()=>t[s],enumerable:!(n=Yi(t,s))||n.enumerable});return e};var Re=(e,t,r)=>(r=e!=null?Hi(Zi(e)):{},mr(t||!e||!e.__esModule?Ft(r,"default",{value:e,enumerable:!0}):r,e)),Qi=e=>mr(Ft({},"__esModule",{value:!0}),e);var ql={};Ki(ql,{default:()=>Yl,extendedLintPlugin:()=>zi});module.exports=Qi(ql);var xe=require("@typescript-eslint/utils"),_=require("zod/v4");var yr=require("@typescript-eslint/utils"),dr=Re(require("zod/v4"));function z(e){let r=yr.ESLintUtils.RuleCreator(n=>`https://github.com/lucasols/extended-lint#${n}`)(e);return{name:e.name,rule:r}}function U(e){return dr.toJSONSchema(e)}var es=_.z.object({disallow:_.z.array(_.z.object({selector:_.z.string(),message:_.z.string(),replace:_.z.optional(_.z.union([_.z.string(),_.z.object({regex:_.z.string(),with:_.z.string()})])),replaceType:_.z.optional(_.z.enum(["suggestion","autofix"]))})).optional(),disallowFnCalls:_.z.optional(_.z.array(_.z.object({fn:_.z.string(),withArgs:_.z.optional(_.z.array(_.z.object({atIndex:_.z.number(),value:_.z.union([_.z.string(),_.z.number(),_.z.boolean()])}))),message:_.z.string(),replaceWith:_.z.optional(_.z.string()),ignoreRegex:_.z.optional(_.z.string())}))),__dev_simulateFileName:_.z.optional(_.z.string()),mustMatchSyntax:_.z.optional(_.z.array(_.z.object({includeRegex:_.z.string(),excludeRegex:_.z.optional(_.z.string()),mustCallFn:_.z.optional(_.z.array(_.z.object({anyCall:_.z.array(_.z.object({fn:_.z.string(),withArgs:_.z.array(_.z.object({atIndex:_.z.number(),literal:_.z.union([_.z.string(),_.z.number(),_.z.boolean()])}))})),message:_.z.optional(_.z.string())}))),mustMatchSelector:_.z.optional(_.z.array(_.z.object({selector:_.z.string(),message:_.z.string()}))),mustHaveExport:_.z.optional(_.z.array(_.z.object({name:_.z.string(),type:_.z.enum(["function","variable","any"]).default("any"),message:_.z.string()})))})))}),Bt=z({name:"advanced-no-restricted-syntax",meta:{type:"suggestion",docs:{description:"Disallow specific syntax patterns"},schema:[U(es)],messages:{default:"{{message}}"},fixable:"code",hasSuggestions:!0},defaultOptions:[{disallow:[]}],create(e,[t]){let r={},{mustMatchSyntax:n,__dev_simulateFileName:s,disallow:o,disallowFnCalls:i}=t,a=s??e.filename,l=[],p=new Map,m=new Set,y=new Map,u=new Set,d=new Map;function c(C){for(let w of C.specifiers)w.type===xe.AST_NODE_TYPES.ImportSpecifier&&w.imported.type===xe.AST_NODE_TYPES.Identifier&&w.imported.name!==w.local.name&&d.set(w.local.name,w.imported.name)}function g(C){if(C.declaration){if(C.declaration.type===xe.AST_NODE_TYPES.FunctionDeclaration&&C.declaration.id){let w=C.declaration.id.name;for(let N of Array.from(u)){let[k,O]=N.split(":");k===w&&(O==="function"||O==="any")&&u.delete(N)}}else if(C.declaration.type===xe.AST_NODE_TYPES.VariableDeclaration){for(let w of C.declaration.declarations)if(w.id.type===xe.AST_NODE_TYPES.Identifier){let N=w.id.name;for(let k of Array.from(u)){let[O,f]=k.split(":");O===N&&(f==="variable"||f==="any")&&u.delete(k)}}}}for(let w of C.specifiers)if(w.exported.type===xe.AST_NODE_TYPES.Identifier){let N=w.exported.name;for(let k of Array.from(u)){let[O,f]=k.split(":");O===N&&f==="any"&&u.delete(k)}}}function h(C){C.id.type===xe.AST_NODE_TYPES.Identifier&&C.init?.type===xe.AST_NODE_TYPES.Identifier&&d.set(C.id.name,C.init.name)}function S(C){return d.get(C)??C}function I(C,w){return S(C)===w||C===w}for(let{includeRegex:C,excludeRegex:w,mustCallFn:N,mustMatchSelector:k,mustHaveExport:O}of n??[]){let x=function(E){let F=E;for(let{name:R,value:M}of f??[])F=F.replaceAll(R,M);return F};var b=x;let f=ts(a,new RegExp(C));if(f&&!(w&&new RegExp(w).test(a))){for(let{anyCall:E,message:F}of N??[]){let R=`Expected file to call the function: ${E.map(({fn:M})=>M).join(" or ")}`;m.add(R),l.push(M=>{let{callee:P}=M;if(P.type===xe.AST_NODE_TYPES.Identifier){for(let{fn:ee,withArgs:Z}of E)if(P.name===ee){m.delete(R);for(let D of Z){let q=M.arguments[D.atIndex],B=typeof D.literal=="string"?x(D.literal):D.literal;if(!q){e.report({node:M,messageId:"default",data:{message:`Missing argument with value "${B}" at index ${D.atIndex}${F?`: ${x(F)}`:""}`}});continue}if(q.type!==xe.AST_NODE_TYPES.Literal){e.report({node:q,messageId:"default",data:{message:`Argument at position ${D.atIndex} should the literal "${B}"${F?`: ${x(F)}`:""}`}});continue}q.value!==B&&e.report({node:q,messageId:"default",data:{message:`Argument should have the value "${B}"${F?`: ${x(F)}`:""}`},fix:ue=>ue.replaceText(q,typeof B=="string"?`'${B}'`:String(B))})}break}}})}for(let{selector:E,message:F}of k??[])y.set(E,x(F)),p.set(x(E),()=>{y.delete(E)});for(let{name:E,type:F,message:R}of O??[]){let M=x(E),P=x(R);u.add(`${M}:${F}:${P}`)}}}for(let{fn:C,withArgs:w,message:N,replaceWith:k,ignoreRegex:O}of i??[])O&&new RegExp(O).test(a)||l.push(f=>{let{callee:x}=f;if(x.type!==xe.AST_NODE_TYPES.Identifier||!I(x.name,C))return;if(w)for(let F of w){let R=f.arguments[F.atIndex];if(!R){e.report({node:f,messageId:"default",data:{message:`Missing argument with value "${F.value}" at index ${F.atIndex}: ${N}`}});return}if(R.type!==xe.AST_NODE_TYPES.Literal||R.value!==F.value)return}let E=F=>k?F.replaceText(f,k):null;e.report({node:f,messageId:"default",data:{message:N},suggest:k?[{messageId:"default",data:{message:`Replace with "${k}"`},fix:E}]:void 0})});function A(C,w){let N=r[C];N?r[C]=k=>{N(k),w(k)}:r[C]=w}for(let{selector:C,message:w,replace:N,replaceType:k="suggestion"}of o??[]){if(C==="CallExpression"){l.push(O=>{T(N,O,w,k)});continue}r[C]=O=>{T(N,O,w,k)}}if(p.size>0)for(let[C,w]of p)A(C,w);return l.length>0&&(r.CallExpression=C=>{if(C.type===xe.AST_NODE_TYPES.CallExpression)for(let w of l)w(C)}),r.ImportDeclaration=C=>{C.type===xe.AST_NODE_TYPES.ImportDeclaration&&c(C)},r.ExportNamedDeclaration=C=>{C.type===xe.AST_NODE_TYPES.ExportNamedDeclaration&&g(C)},r.VariableDeclarator=C=>{C.type===xe.AST_NODE_TYPES.VariableDeclarator&&h(C)},r["Program:exit"]=C=>{for(let w of m)e.report({node:C,messageId:"default",data:{message:w}});for(let[,w]of y)e.report({node:C,messageId:"default",data:{message:w}});for(let w of u){let[N,k,O]=w.split(":");e.report({node:C,messageId:"default",data:{message:`Missing required export "${N}" of type ${k}: ${O}`}})}},r;function T(C,w,N,k){let O=f=>{if(!C)return null;if(typeof C=="string")return f.replaceText(w,C);{let x=new RegExp(C.regex),E=e.sourceCode.getText(w);return f.replaceText(w,E.replace(x,C.with))}};e.report({node:w,messageId:"default",data:{message:N},fix:C&&k==="autofix"?O:void 0,suggest:C&&k==="suggestion"?[{messageId:"default",data:{message:`Replace with "${typeof C=="string"?C:C.with}"`},fix:O}]:void 0})}}});function ts(e,t){let r=[],n=t.exec(e);if(!n)return null;let[s,...o]=n;r.push({name:"$0_lowercase",value:s.toLowerCase()}),r.push({name:"$0_capitalize",value:gr(s)}),r.push({name:"$0_uncapitalize",value:Sr(s)}),r.push({name:"$0",value:s});for(let i=0;i<o.length;i++){let a=`$${i+1}`,l=o[i];l!==void 0&&(r.push({name:`${a}_lowercase`,value:l.toLowerCase()}),r.push({name:`${a}_capitalize`,value:gr(l)}),r.push({name:`${a}_uncapitalize`,value:Sr(l)}),r.push({name:a,value:l}))}return r}function gr(e){return e.charAt(0).toUpperCase()+e.slice(1)}function Sr(e){return e.charAt(0).toLowerCase()+e.slice(1)}var re=require("@typescript-eslint/utils"),Ge=require("zod/v4");var ns=re.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),Er="collapse-simple-objs-in-one-line",rs=Ge.z.object({maxLineLength:Ge.z.number().optional(),maxProperties:Ge.z.number().optional(),nestedObjMaxLineLength:Ge.z.number().optional(),nestedObjMaxProperties:Ge.z.number().optional(),ignoreTypesWithSuffix:Ge.z.array(Ge.z.string()).optional()}),is=ns({name:Er,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:[U(rs)]},defaultOptions:[{}],create(e,[t]){let r=e.sourceCode,n=t.ignoreTypesWithSuffix??[],s=t.maxProperties??2,o=t.nestedObjMaxLineLength??t.maxLineLength,i=t.nestedObjMaxProperties??3;function a(p){if(p.type===re.AST_NODE_TYPES.ObjectExpression){let m=p.parent.type===re.AST_NODE_TYPES.Property,y=m?i:s,u=p.properties.length;if(u>y)return!1;if(u===1){let c=p.properties[0];return!c||c.type===re.AST_NODE_TYPES.Property&&c.value.type===re.AST_NODE_TYPES.ObjectExpression||c.type===re.AST_NODE_TYPES.Property&&c.value.type===re.AST_NODE_TYPES.ArrayExpression&&!c.value.elements.every(h=>h&&Ht(h))?!1:{text:r.getText(c),isNested:m,propsSize:u}}let d=[];for(let c of p.properties){if(c.type===re.AST_NODE_TYPES.Property&&!Ht(c.value))return!1;d.push(r.getText(c))}return{text:d.join(", "),isNested:m,propsSize:u}}else{let m=p.parent.parent?.type===re.AST_NODE_TYPES.TSPropertySignature,y=m?i:s,u=p.members.length;if(u>y)return!1;if(n.length>0&&p.parent.type===re.AST_NODE_TYPES.TSTypeAliasDeclaration){let c=p.parent.id.name;if(n.some(g=>c.endsWith(g)))return!1}if(u===1){let c=p.members[0];return!c||c.type===re.AST_NODE_TYPES.TSPropertySignature&&c.typeAnnotation?.typeAnnotation.type===re.AST_NODE_TYPES.TSTypeLiteral?!1:{text:r.getText(c),isNested:m,propsSize:1}}if(p.parent.type===re.AST_NODE_TYPES.TSIntersectionType||p.parent.type===re.AST_NODE_TYPES.TSUnionType&&p.parent.types[0]!==p)return!1;let d=[];for(let c of p.members){if(c.type!==re.AST_NODE_TYPES.TSPropertySignature)return!1;let g=c.typeAnnotation?.typeAnnotation;if(!g||g.type===re.AST_NODE_TYPES.TSTypeLiteral||!Tr(g))return!1;if(g.type===re.AST_NODE_TYPES.TSTypeReference&&g.typeArguments){if(g.typeArguments.params.length>1)return!1;let S=g.typeArguments.params[0];if(!S||!Tr(S))return!1}let h=r.getText(c).trim();(h.endsWith(";")||h.endsWith(","))&&(h=h.slice(0,-1)),d.push(h)}return{text:d.join("; "),isNested:m,propsSize:u}}}function l(p){if(p.loc.start.line===p.loc.end.line)return;if(p.parent.type!==re.AST_NODE_TYPES.JSXExpressionContainer){let g=0,h=!1,S=r.getTokenAfter(p,{filter:A=>A.type!==re.AST_TOKEN_TYPES.Punctuator||h?!0:A.value===","?(g++,!1):A.value===";"?(g++,h=!0,!1):A.value===")"||A.value==="}"?(g++,!1):!0});if(g>4)return;let I=S?.type===re.AST_TOKEN_TYPES.Template&&S.value.startsWith(`}
2
- `);if(S?.loc.start.line===p.loc.end.line&&!I)return}let m=a(p);if(!m)return;let y=m.text;if(y.includes(`
3
- `)||r.getCommentsInside(p).length>0)return;y.endsWith(";")&&(y=y.slice(0,-1));let u=`{ ${y} }`,d=os(r,p),c=m.isNested&&m.propsSize>2?o:t.maxLineLength;c&&u.length+d.length+ss(p,r)>c||e.report({node:p,messageId:"singleLineProp",fix:g=>g.replaceText(p,u)})}return{TSTypeLiteral:l,ObjectExpression:l}}});function Tr(e){return e.type===re.AST_NODE_TYPES.TSLiteralType||e.type===re.AST_NODE_TYPES.TSTypeReference||e.type===re.AST_NODE_TYPES.TSNumberKeyword||e.type===re.AST_NODE_TYPES.TSStringKeyword||e.type===re.AST_NODE_TYPES.TSBooleanKeyword||e.type===re.AST_NODE_TYPES.TSNullKeyword||e.type===re.AST_NODE_TYPES.TSUndefinedKeyword}function Ht(e,t){return!!(e.type===re.AST_NODE_TYPES.Literal||e.type===re.AST_NODE_TYPES.Identifier||e.type===re.AST_NODE_TYPES.TemplateLiteral||e.type===re.AST_NODE_TYPES.TaggedTemplateExpression||!t&&e.type===re.AST_NODE_TYPES.ArrayExpression&&e.elements.every(r=>r&&Ht(r,!0)))}function ss(e,t){let r=t.getLastToken(e);if(!r)return 0;let n=t.text.indexOf(`
4
- `,r.range[1]);return(n!==-1?n:t.text.length)-r.range[1]}function os(e,t){return e.text.slice(t.range[0]-t.loc.start.column,t.range[0])}var Yt={name:Er,rule:is};var as=/eslint +react-compiler\/react-compiler: +\["error/;function hr(e){let t=null;if((e.type==="FunctionDeclaration"||e.type==="FunctionExpression"||e.type==="ArrowFunctionExpression"&&e.body.type==="BlockStatement")&&(t=e.body),!t||t.body.length===0)return!1;let r=t.body[0];return r.type==="ExpressionStatement"&&r.expression.type==="Literal"&&r.expression.value==="use no memo"}function br(e){let t=e.parent;for(;t;){if(t.type==="FunctionDeclaration"||t.type==="FunctionExpression"||t.type==="ArrowFunctionExpression")return t;t=t.parent}return null}var Cr={meta:{type:"suggestion",docs:{description:"verifies the list of dependencies for Hooks like useEffect and similar",recommended:!0,url:"https://github.com/facebook/react/issues/14920"},fixable:"code",hasSuggestions:!0,schema:[{type:"object",additionalProperties:!1,ignoreIfReactCompilerIsEnabled:!1,enableDangerousAutofixThisMayCauseInfiniteLoops:!1,properties:{additionalHooks:{type:"string"},ignoreIfReactCompilerIsEnabled:{type:"boolean"},enableDangerousAutofixThisMayCauseInfiniteLoops:{type:"boolean"},reactCompilerIsEnabled:{type:"boolean"}}}]},create(e){let t=!1,r=typeof e.getSource=="function"?I=>r(I):I=>e.sourceCode.getText(I),n=typeof e.getScope=="function"?()=>n():I=>e.sourceCode.getScope(I),s=e.options&&e.options[0]&&e.options[0].additionalHooks?new RegExp(e.options[0].additionalHooks):void 0,o=e.options&&e.options[0]&&e.options[0].enableDangerousAutofixThisMayCauseInfiniteLoops||!1,i={additionalHooks:s,enableDangerousAutofixThisMayCauseInfiniteLoops:o};function a(I){o&&Array.isArray(I.suggest)&&I.suggest.length>0&&(I.fix=I.suggest[0].fix),e.report(I)}let l=e.getSourceCode().scopeManager,p=new WeakMap,m=new WeakSet,y=new WeakMap,u=new WeakMap,d=new WeakSet;function c(I,A){return function(T){if(A.has(T))return A.get(T);let b=I(T);return A.set(T,b),b}}function g(I,A,T,b,C){C&&I.async&&a({node:I,message:`Effect callbacks are synchronous to prevent race conditions. Put the async function inside:
5
-
6
- useEffect(() => {
7
- async function fetchData() {
8
- // You can await here
9
- const response = await MyAPI.getData(someId);
10
- // ...
11
- }
12
- fetchData();
13
- }, [someId]); // Or [] if effect doesn't need props or state
14
-
15
- Learn more about data fetching with Hooks: https://reactjs.org/link/hooks-data-fetching`});let w=l.acquire(I),N=new Set,k=null;{let v=w.upper;for(;v&&(N.add(v),v.type!=="function");)v=v.upper;if(!v)return;k=v}let O=Array.isArray;function f(v){if(!O(v.defs))return!1;let L=v.defs[0];if(L==null||L.node.type!=="VariableDeclarator")return!1;let J=L.node.init;if(J==null)return!1;for(;J.type==="TSAsExpression";)J=J.expression;let X=L.node.parent;if(X==null&&(Gt(k.block,L.node.id),X=L.node.parent,X==null))return!1;if(X.kind==="const"&&J.type==="Literal"&&(typeof J.value=="string"||typeof J.value=="number"||J.value===null))return!0;if(J.type!=="CallExpression")return!1;let Y=J.callee;if(Y.type==="MemberExpression"&&Y.object.name==="React"&&Y.property!=null&&!Y.computed&&(Y=Y.property),Y.type!=="Identifier")return!1;let W=L.node.id,{name:G}=Y;if(G==="useRef"&&W.type==="Identifier")return!0;if(fs(Y)&&W.type==="Identifier"){for(let Q of v.references)Q!==W&&d.add(Q.identifier);return!0}else if(G==="useState"||G==="useReducer"){if(W.type==="ArrayPattern"&&W.elements.length===2&&O(v.identifiers)){if(W.elements[1]===v.identifiers[0]){if(G==="useState"){let Q=v.references,ve=0;for(let Xe=0;Xe<Q.length;Xe++){if(Q[Xe].isWrite()&&ve++,ve>1)return!1;p.set(Q[Xe].identifier,W.elements[0])}}return!0}else if(W.elements[0]===v.identifiers[0]){if(G==="useState"){let Q=v.references;for(let ve=0;ve<Q.length;ve++)m.add(Q[ve].identifier)}return!1}}}else if(G==="useTransition"&&W.type==="ArrayPattern"&&W.elements.length===2&&Array.isArray(v.identifiers)&&W.elements[1]===v.identifiers[0])return!0;return!1}function x(v){if(!O(v.defs))return!1;let L=v.defs[0];if(L==null||L.node==null||L.node.id==null)return!1;let J=L.node,X=k.childScopes,Y=null,W;for(W=0;W<X.length;W++){let G=X[W],Q=G.block;if(J.type==="FunctionDeclaration"&&Q===J||J.type==="VariableDeclarator"&&Q.parent===J){Y=G;break}}if(Y==null)return!1;for(W=0;W<Y.through.length;W++){let G=Y.through[W];if(G.resolved!=null&&N.has(G.resolved.scope)&&!E(G.resolved))return!1}return!0}let E=c(f,y),F=c(x,u),R=new Map;function M(v){let L=v.from,J=!1;for(;L.block!==I;)L.type==="function"&&(J=L.block.parent!=null&&L.block.parent.type==="ReturnStatement"),L=L.upper;return J}let P=new Map,ee=new Map;Z(w);function Z(v){for(let L of v.references){if(!L.resolved||!N.has(L.resolved.scope))continue;let J=Gt(I,L.identifier),X=Ir(J),Y=Be(X,ee);if(C&&X.type==="Identifier"&&(X.parent.type==="MemberExpression"||X.parent.type==="OptionalMemberExpression")&&!X.parent.computed&&X.parent.property.type==="Identifier"&&X.parent.property.name==="current"&&M(L)&&R.set(Y,{reference:L,dependencyNode:X}),X.parent.type==="TSTypeQuery"||X.parent.type==="TSTypeReference")continue;let W=L.resolved.defs[0];if(W!=null&&!(W.node!=null&&W.node.init===I.parent)&&W.type!=="TypeParameter")if(P.has(Y))P.get(Y).references.push(L);else{let G=L.resolved,Q=E(G)||F(G);P.set(Y,{isStable:Q,references:[L]})}}for(let L of v.childScopes)Z(L)}R.forEach(({reference:v,dependencyNode:L},J)=>{let X=v.resolved.references,Y=!1;for(let W=0;W<X.length;W++){let{identifier:G}=X[W],{parent:Q}=G;if(Q!=null&&Q.type==="MemberExpression"&&!Q.computed&&Q.property.type==="Identifier"&&Q.property.name==="current"&&Q.parent.type==="AssignmentExpression"&&Q.parent.left===Q){Y=!0;break}}Y||a({node:L.parent.property,message:`The ref value '${J}.current' will likely have changed by the time this effect cleanup function runs. If this ref points to a node rendered by React, copy '${J}.current' to a variable inside the effect, and use that variable in the cleanup function.`})});let D=new Set;function q(v,L){D.has(L)||(D.add(L),a({node:v,message:`Assignments to the '${L}' variable from inside React Hook ${r(T)} will be lost after each render. To preserve the value over time, store it in a useRef Hook and keep the mutable value in the '.current' property. Otherwise, you can move this variable directly inside ${r(T)}.`}))}let B=new Set;if(P.forEach(({isStable:v,references:L},J)=>{v&&B.add(J),L.forEach(X=>{X.writeExpr&&q(X.writeExpr,J)})}),D.size>0)return;if(!A){let v=null;if(P.forEach(({isStable:L,references:J},X)=>{v||J.forEach(Y=>{if(v)return;let W=Y.identifier;if(!p.has(W))return;let Q=Y.from;for(;Q.type!=="function";)Q=Q.upper;Q.block===I&&(v=X)})}),v){let{suggestedDependencies:L}=qt({dependencies:P,declaredDependencies:[],stableDependencies:B,externalDependencies:new Set,isEffect:!0});a({node:T,message:`React Hook ${b} contains a call to '${v}'. Without a list of dependencies, this can lead to an infinite chain of updates. To fix this, pass [`+L.join(", ")+`] as a second argument to the ${b} Hook.`,suggest:[{desc:`Add dependencies array: [${L.join(", ")}]`,fix(J){return J.insertTextAfter(I,`, [${L.join(", ")}]`)}}]})}return}let ue=[],me=new Set;A.type!=="ArrayExpression"?a({node:A,message:`React Hook ${r(T)} was passed a dependency list that is not an array literal. This means we can't statically verify whether you've passed the correct dependencies.`}):A.elements.forEach(v=>{if(v===null)return;if(v.type==="SpreadElement"){a({node:v,message:`React Hook ${r(T)} has a spread element in its dependency array. This means we can't statically verify whether you've passed the correct dependencies.`});return}d.has(v)&&a({node:v,message:`Functions returned from \`useEffectEvent\` must not be included in the dependency array. Remove \`${r(v)}\` from the list.`,suggest:[{desc:`Remove the dependency \`${r(v)}\``,fix(Y){return Y.removeRange(v.range)}}]});let L;try{L=Be(v,ee)}catch(Y){if(/Unsupported node type/.test(Y.message)){v.type==="Literal"?P.has(v.value)?a({node:v,message:`The ${v.raw} literal is not a valid dependency because it never changes. Did you mean to include ${v.value} in the array instead?`}):a({node:v,message:`The ${v.raw} literal is not a valid dependency because it never changes. You can safely remove it.`}):a({node:v,message:`React Hook ${r(T)} has a complex expression in the dependency array. Extract it to a separate variable so it can be statically checked.`});return}else throw Y}let J=v;for(;J.type==="MemberExpression"||J.type==="OptionalMemberExpression"||J.type==="ChainExpression";)J=J.object||J.expression.object;let X=!k.through.some(Y=>Y.identifier===J);ue.push({key:L,node:v}),X||me.add(L)});let{suggestedDependencies:Oe,unnecessaryDependencies:Ze,missingDependencies:he,duplicateDependencies:Et}=qt({dependencies:P,declaredDependencies:ue,stableDependencies:B,externalDependencies:me,isEffect:C}),pt=Oe;if(Et.size+he.size+Ze.size===0){let v=br(T),L=v&&hr(v);if(t&&!L)return;ls({declaredDependencies:ue,declaredDependenciesNode:A,componentScope:k,scope:w}).forEach(({construction:X,isUsedOutsideOfHook:Y,depType:W})=>{let G=W==="function"?"useCallback":"useMemo",Q=W==="function"?"definition":"initialization",ve=`wrap the ${Q} of '${X.name.name}' in its own ${G}() Hook.`,Xe=Y?`To fix this, ${ve}`:`Move it inside the ${b} callback. Alternatively, ${ve}`,Wi=W==="conditional"||W==="logical expression"?"could make":"makes",Ji=`The '${X.name.name}' ${W} ${Wi} the dependencies of ${b} Hook (at line ${A.loc.start.line}) change on every render. ${Xe}`,ur;Y&&X.type==="Variable"&&W==="function"&&(ur=[{desc:`Wrap the ${Q} of '${X.name.name}' in its own ${G}() Hook.`,fix(fr){let[Xi,Bi]=G==="useMemo"?["useMemo(() => { return ","; })"]:["useCallback(",")"];return[fr.insertTextBefore(X.node.init,Xi),fr.insertTextAfter(X.node.init,Bi)]}}]),a({node:X.node,message:Ji,suggest:ur})});return}!C&&he.size>0&&(pt=qt({dependencies:P,declaredDependencies:[],stableDependencies:B,externalDependencies:me,isEffect:C}).suggestedDependencies);function Ce(){if(ue.length===0)return!0;let v=ue.map(J=>J.key),L=v.slice().sort();return v.join(",")===L.join(",")}Ce()&&pt.sort();function we(v){let L=v.split("."),J="";for(let X=0;X<L.length;X++){if(X!==0){let Y=L.slice(0,X+1).join("."),W=ee.get(Y)===!0;J+=W?"?.":"."}J+=L[X]}return J}function Xt(v,L,J,X){return v.size===0?null:(v.size>1?"":L+" ")+J+" "+(v.size>1?"dependencies":"dependency")+": "+cs(Array.from(v).sort().map(Y=>"'"+we(Y)+"'"))+`. Either ${X} ${v.size>1?"them":"it"} or remove the dependency array.`}let $e="";if(Ze.size>0){let v=null;if(Array.from(Ze.keys()).forEach(L=>{v===null&&L.endsWith(".current")&&(v=L)}),v!==null)$e=` Mutable values like '${v}' aren't valid dependencies because mutating them doesn't re-render the component.`;else if(me.size>0){let L=Array.from(me)[0];w.set.has(L)||($e=` Outer scope values like '${L}' aren't valid dependencies because mutating them doesn't re-render the component.`)}}if(!$e&&he.has("props")){let v=P.get("props");if(v==null)return;let L=v.references;if(!Array.isArray(L))return;let J=!0;for(let X=0;X<L.length;X++){let Y=L[X],W=Gt(k.block,Y.identifier);if(!W){J=!1;break}let G=W.parent;if(G==null){J=!1;break}if(G.type!=="MemberExpression"&&G.type!=="OptionalMemberExpression"){J=!1;break}}J&&($e=` However, 'props' will change when *any* prop changes, so the preferred fix is to destructure the 'props' object outside of the ${b} call and refer to those specific props inside ${r(T)}.`)}if(!$e&&he.size>0){let v=null;he.forEach(L=>{if(v)return;let J=k.set.get(L),X=P.get(L);if(X.references[0].resolved!==J)return;let Y=J.defs[0];if(Y==null||Y.name==null||Y.type!=="Parameter")return;let W=!1,G;for(let Q=0;Q<X.references.length;Q++)if(G=X.references[Q].identifier,G!=null&&G.parent!=null&&(G.parent.type==="CallExpression"||G.parent.type==="OptionalCallExpression")&&G.parent.callee===G){W=!0;break}W&&(v=L)}),v!==null&&($e=` If '${v}' changes too often, find the parent component that defines it and wrap that definition in useCallback.`)}if(!$e&&he.size>0){let v=null;if(he.forEach(L=>{if(v!==null)return;let X=P.get(L).references,Y,W;for(let G=0;G<X.length;G++){for(Y=X[G].identifier,W=Y.parent;W!=null&&W!==k.block;){if(W.type==="CallExpression"){let Q=p.get(W.callee);if(Q!=null){if(Q.name===L)v={missingDep:L,setter:W.callee.name,form:"updater"};else if(m.has(Y))v={missingDep:L,setter:W.callee.name,form:"reducer"};else{let ve=X[G].resolved;if(ve!=null){let Xe=ve.defs[0];Xe!=null&&Xe.type==="Parameter"&&(v={missingDep:L,setter:W.callee.name,form:"inlineReducer"})}}break}}W=W.parent}if(v!==null)break}}),v!==null)switch(v.form){case"reducer":$e=` You can also replace multiple useState variables with useReducer if '${v.setter}' needs the current value of '${v.missingDep}'.`;break;case"inlineReducer":$e=` If '${v.setter}' needs the current value of '${v.missingDep}', you can also switch to useReducer instead of useState and read '${v.missingDep}' in the reducer.`;break;case"updater":$e=` You can also do a functional update '${v.setter}(${v.missingDep.slice(0,1)} => ...)' if you only need '${v.missingDep}' in the '${v.setter}' call.`;break;default:throw new Error("Unknown case.")}}a({node:A,message:`React Hook ${r(T)} has `+(Xt(he,"a","missing","include")||Xt(Ze,"an","unnecessary","exclude")||Xt(Et,"a","duplicate","omit"))+$e,suggest:[{desc:`Update the dependencies array to be: [${pt.map(we).join(", ")}]`,fix(v){return v.replaceText(A,`[${pt.map(we).join(", ")}]`)}}]})}function h(I){let A=ps(I.callee,i);if(A===-1)return;let T=I.arguments[A],b=I.callee,C=Ar(b).name,w=I.arguments[A+1],N=/Effect($|[^a-z])/g.test(C);if(!T){a({node:b,message:`React Hook ${C} requires an effect callback. Did you forget to pass a callback to the hook?`});return}if(t&&!N){let k=br(b);if(!(k&&hr(k)))return}if(!w&&!N){(C==="useMemo"||C==="useCallback")&&a({node:b,message:`React Hook ${C} does nothing when called with only one argument. Did you forget to pass an array of dependencies?`});return}switch(T.type){case"FunctionExpression":case"ArrowFunctionExpression":g(T,w,b,C,N);return;case"Identifier":if(!w||w.elements&&w.elements.some(f=>f&&f.type==="Identifier"&&f.name===T.name))return;let k=n(I).set.get(T.name);if(k==null||k.defs==null)return;let O=k.defs[0];if(!O||!O.node||O.type!=="Variable"&&O.type!=="FunctionName")break;switch(O.node.type){case"FunctionDeclaration":g(O.node,w,b,C,N);return;case"VariableDeclarator":let f=O.node.init;if(!f)break;switch(f.type){case"ArrowFunctionExpression":case"FunctionExpression":g(f,w,b,C,N);return}break}break;default:a({node:b,message:`React Hook ${C} received a function whose dependencies are unknown. Pass an inline function instead.`});return}a({node:b,message:`React Hook ${C} has a missing dependency: '${T.name}'. Either include it or remove the dependency array.`,suggest:[{desc:`Update the dependencies array to be: [${T.name}]`,fix(k){return k.replaceText(w,`[${T.name}]`)}}]})}if(!!e.options[0]?.reactCompilerIsEnabled)return t=!0,{CallExpression:I=>h(I)};if(e.options[0]?.ignoreIfReactCompilerIsEnabled){for(let I of e.sourceCode.getAllComments())if(as.test(I.value))return t=!0,{CallExpression:A=>h(A)}}return{CallExpression:I=>h(I)}}};function qt({dependencies:e,declaredDependencies:t,stableDependencies:r,externalDependencies:n,isEffect:s}){let o=i();function i(){return{isUsed:!1,isSatisfiedRecursively:!1,isSubtreeUsed:!1,children:new Map}}e.forEach((g,h)=>{let S=a(o,h);S.isUsed=!0,l(o,h,I=>{I.isSubtreeUsed=!0})}),t.forEach(({key:g})=>{let h=a(o,g);h.isSatisfiedRecursively=!0}),r.forEach(g=>{let h=a(o,g);h.isSatisfiedRecursively=!0});function a(g,h){let S=h.split("."),I=g;for(let A of S){let T=I.children.get(A);T||(T=i(),I.children.set(A,T)),I=T}return I}function l(g,h,S){let I=h.split("."),A=g;for(let T of I){let b=A.children.get(T);if(!b)return;S(b),A=b}}let p=new Set,m=new Set;y(o,p,m,g=>g);function y(g,h,S,I){g.children.forEach((A,T)=>{let b=I(T);if(A.isSatisfiedRecursively){A.isSubtreeUsed&&S.add(b);return}if(A.isUsed){h.add(b);return}y(A,h,S,C=>b+"."+C)})}let u=[],d=new Set,c=new Set;return t.forEach(({key:g})=>{m.has(g)?u.indexOf(g)===-1?u.push(g):c.add(g):d.add(g)}),p.forEach(g=>{u.push(g)}),{suggestedDependencies:u,unnecessaryDependencies:d,duplicateDependencies:c,missingDependencies:p}}function Ke(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 Ke(e.consequent)!=null||Ke(e.alternate)!=null?"conditional":null;case"LogicalExpression":return Ke(e.left)!=null||Ke(e.right)!=null?"logical expression":null;case"JSXFragment":return"JSX fragment";case"JSXElement":return"JSX element";case"AssignmentExpression":return Ke(e.right)!=null?"assignment expression":null;case"NewExpression":return"object construction";case"Literal":return e.value instanceof RegExp?"regular expression":null;case"TypeCastExpression":return Ke(e.expression);case"TSAsExpression":return Ke(e.expression)}return null}function ls({declaredDependencies:e,declaredDependenciesNode:t,componentScope:r,scope:n}){let s=e.map(({key:i})=>{let a=r.variables.find(p=>p.name===i);if(a==null)return null;let l=a.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=Ke(l.node.init);if(p!=null)return[a,p]}return l.type==="FunctionName"&&l.node.type==="FunctionDeclaration"?[a,"function"]:l.type==="ClassName"&&l.node.type==="ClassDeclaration"?[a,"class"]:null}).filter(Boolean);function o(i){let a=!1;for(let l=0;l<i.references.length;l++){let p=i.references[l];if(p.writeExpr){if(a)return!0;a=!0;continue}let m=p.from;for(;m!==n&&m!=null;)m=m.upper;if(m!==n&&!wr(t,p.identifier))return!0}return!1}return s.map(([i,a])=>({construction:i.defs[0],depType:a,isUsedOutsideOfHook:o(i)}))}function Ir(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)?Ir(e.parent):e.type==="MemberExpression"&&e.parent&&e.parent.type==="AssignmentExpression"&&e.parent.left===e?e.object:e}function Zt(e,t,r){t&&(e.optional?t.has(r)||t.set(r,!0):t.has(r)||t.set(r,!1))}function Be(e,t){if(e.type==="Identifier"||e.type==="JSXIdentifier"){let r=e.name;return t&&t.set(r,!1),r}else if(e.type==="MemberExpression"&&!e.computed){let r=Be(e.object,t),n=Be(e.property,null),s=`${r}.${n}`;return Zt(e,t,s),s}else if(e.type==="OptionalMemberExpression"&&!e.computed){let r=Be(e.object,t),n=Be(e.property,null),s=`${r}.${n}`;return Zt(e,t,s),s}else if(e.type==="ChainExpression"&&!e.computed){let r=e.expression;if(r.type==="CallExpression")throw new Error(`Unsupported node type: ${r.type}`);let n=Be(r.object,t),s=Be(r.property,null),o=`${n}.${s}`;return Zt(r,t,o),o}else throw new Error(`Unsupported node type: ${e.type}`)}function Ar(e,t){return e.type==="MemberExpression"&&e.object.type==="Identifier"&&e.object.name==="React"&&e.property.type==="Identifier"&&!e.computed?e.property:e}function ps(e,t){let r=Ar(e);if(r.type!=="Identifier")return-1;switch(r.name){case"useEffect":case"useLayoutEffect":case"useCallback":case"useMemo":return 0;case"useImperativeHandle":return 1;default:if(r===e&&t&&t.additionalHooks){let n;try{n=Be(r,null)}catch(s){if(/Unsupported node type/.test(s.message))return 0;throw s}return t.additionalHooks.test(n)?0:-1}else return-1}}function Gt(e,t){let r=[e],n=null;for(;r.length;){if(n=r.shift(),us(n,t))return n;if(wr(n,t))for(let[s,o]of Object.entries(n))s!=="parent"&&(xr(o)?(o.parent=n,r.push(o)):Array.isArray(o)&&o.forEach(i=>{xr(i)&&(i.parent=n,r.push(i))}))}return null}function cs(e){let t="";for(let r=0;r<e.length;r++)t+=e[r],r===0&&e.length===2?t+=" and ":r===e.length-2&&e.length>2?t+=", and ":r<e.length-1&&(t+=", ");return t}function xr(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&typeof e.type=="string"}function us(e,t){return(e.type==="Identifier"||e.type==="JSXIdentifier")&&e.type===t.type&&e.name===t.name&&e.range[0]===t.range[0]&&e.range[1]===t.range[1]}function wr(e,t){return e.range[0]<=t.range[0]&&e.range[1]>=t.range[1]}function fs(e){return!1}var le=require("@typescript-eslint/utils"),H=Re(require("typescript")),tn=require("zod/v4");var Kt=require("@typescript-eslint/utils");function ct(e,t,r=1/0){if(r!==0&&e.parent)return e.type===t?e:ct(e.parent,t,r===1/0?r:r-1)}function*Qt(e){yield e,e.parent&&(yield*Qt(e.parent))}function en(e,t){for(let r of e){let n=t(r);if(n!=null&&n!==!1)return n}}function vr(e,t,r){let s=r.getDeclaredVariables(e).find(o=>o.name===t||o.identifiers[0]?.parent.type===Kt.AST_NODE_TYPES.Property&&o.identifiers[0].parent.key.type===Kt.AST_NODE_TYPES.Identifier&&o.identifiers[0].parent.key.name===t);return s?s.references.filter(o=>!o.init):[]}function Fr(e){return e===null||typeof e!="object"||!("type"in e)?!1:typeof e.type=="string"}function ms(e,t){return e[t]}function _e(e,t,r){let n=r.visitorKeys,s=new Set;function o(i){if(s.has(i))return!1;if(s.add(i),t(i)===!0)return!0;let l=n[i.type];if(l)for(let p of l){let m=ms(i,p);if(m){if(Array.isArray(m)){for(let y of m)if(Fr(y)&&o(y))return!0}else if(Fr(m)&&o(m))return!0}}return!1}o(e)}var ys=le.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),Rr="improved-no-unnecessary-condition",ds=tn.z.object({alternativeForInCondition:tn.z.string().optional().describe("Alternative to appear in the error for `in` condition")}),Nr={object:"Array",property:"isArray"},gs=["string","number","bigint","boolean","symbol","undefined","object","function","never"],Ss=new Set(gs),nn={name:Rr,rule:ys({name:Rr,meta:{type:"suggestion",docs:{description:"Extends checks of `no-unnecessary-condition` rule"},messages:{unnecessaryTypeofCondition:'This condition is unnecessary. The type of "{{name}}" is always "{{type}}".',alwaysFalseTypeofCondition:'This condition will always be false. The type of "{{name}}" is "{{actualType}}" so the condition has no overlap with "{{conditionType}}".',unnecessaryStartsWithCondition:"This startsWith check is unnecessary as it always evaluates to true.",alwaysFalseStartsWithCondition:"This startsWith check will always be false.",unnecessaryEndsWithCondition:"This endsWith check is unnecessary as it always evaluates to true.",alwaysFalseEndsWithCondition:"This endsWith check will always be false.",unnecessaryIncludesCondition:"This includes check is unnecessary as it always evaluates to true.",alwaysFalseIncludesCondition:"This includes check will always be false.",unnecessaryArrayIsArrayCondition:"This Array.isArray check is unnecessary as it always evaluates to true.",alwaysFalseArrayIsArrayCondition:"This Array.isArray check will always be false.",unnecessaryLengthCondition:"This length comparison is unnecessary as it always evaluates to true.",alwaysFalseLengthCondition:"This length comparison will always be false.",unnecessaryInCondition:'This in check is unnecessary. Property "{{property}}" always exists on type "{{type}}".{{alternative}}',alwaysFalseInCondition:'This in check will always be false. Property "{{property}}" does not exist on type "{{type}}".{{alternative}}'},schema:[U(ds)]},defaultOptions:[{}],create(e,[t]){let r=le.ESLintUtils.getParserServices(e,!0),n=r.program?.getTypeChecker();if(!n||!r.program)throw new Error("TypeScript services or program not available");function s(f){return f.type===le.AST_NODE_TYPES.UnaryExpression&&f.operator==="typeof"}function o(f){return f.flags&H.default.TypeFlags.Any||f.flags&H.default.TypeFlags.Unknown?null:f.flags&H.default.TypeFlags.StringLike?["string"]:f.flags&H.default.TypeFlags.NumberLike?["number"]:f.flags&H.default.TypeFlags.BigIntLike?["bigint"]:f.flags&H.default.TypeFlags.BooleanLike?["boolean"]:f.flags&H.default.TypeFlags.ESSymbolLike?["symbol"]:f.flags&H.default.TypeFlags.Undefined||f.flags&H.default.TypeFlags.Void?["undefined"]:f.flags&H.default.TypeFlags.Null?["object"]:f.getCallSignatures().length>0?["function"]:f.flags&H.default.TypeFlags.Object?f.getProperties().length===0?["string","number","bigint","boolean","symbol","object","function"]:["object"]:f.flags&H.default.TypeFlags.NonPrimitive?["object"]:f.flags&H.default.TypeFlags.Never?["never"]:null}function i(f){if(!n)return null;let x=r.esTreeNodeToTSNodeMap.get(f),E=n.getTypeAtLocation(x.expression);if(E.flags&H.default.TypeFlags.Any||E.flags&H.default.TypeFlags.Unknown)return null;let F=[];if(E.isUnion()){for(let M of E.types){let P=o(M);if(P)F.push(...P);else return null}return F}let R=o(E);return R?(F.push(...R),F):null}function a(f){if(!(f.operator==="==="||f.operator==="!=="))return;let E=null,F=null;if(s(f.left)?(E=f.left,F=f.right.type===le.AST_NODE_TYPES.Literal&&typeof f.right.value=="string"?f.right.value:null):s(f.right)&&(E=f.right,F=f.left.type===le.AST_NODE_TYPES.Literal&&typeof f.left.value=="string"?f.left.value:null),!E||!F||!Ts(F,Ss))return;let R=i(E);if(!R)return;let M=f.operator==="!==",P=R.includes(F);R.length===1?P&&!M?e.report({node:f,messageId:"unnecessaryTypeofCondition",data:{name:ut(E,e),type:F}}):!P&&M?e.report({node:f,messageId:"unnecessaryTypeofCondition",data:{name:ut(E,e),type:Array.from(R)[0]}}):!P&&!M?e.report({node:f,messageId:"alwaysFalseTypeofCondition",data:{name:ut(E,e),actualType:vt(R),conditionType:F}}):P&&M&&e.report({node:f,messageId:"alwaysFalseTypeofCondition",data:{name:ut(E,e),actualType:vt(R),conditionType:F}}):!P&&!M?e.report({node:f,messageId:"alwaysFalseTypeofCondition",data:{name:ut(E,e),actualType:vt(R),conditionType:F}}):!P&&M&&e.report({node:f,messageId:"unnecessaryTypeofCondition",data:{name:ut(E,e),type:vt(R)}})}function l(f){if(f.flags&H.default.TypeFlags.Any||f.flags&H.default.TypeFlags.Unknown)return null;if(f.isUnion()){let x=[];for(let E of f.types)if(E.flags&H.default.TypeFlags.StringLiteral){let F=E.value;x.push(F)}else return null;return x}return f.flags&H.default.TypeFlags.StringLiteral?[f.value]:null}function p(f){if(!n)return null;let x=r.esTreeNodeToTSNodeMap.get(f),E=n.getTypeAtLocation(x),F=l(E);if(F)return F;let R=n.getSymbolAtLocation(x);if(R){let M=n.getTypeOfSymbolAtLocation(R,x),P=l(M);if(P)return P}return null}function m(f){let x=e.sourceCode.ast,E=null;return _e(x,F=>{if(F.type===le.AST_NODE_TYPES.VariableDeclarator&&F.id.type===le.AST_NODE_TYPES.Identifier&&F.id.name===f.name&&F.id.typeAnnotation){let R=F.id.typeAnnotation.typeAnnotation;if(R.type===le.AST_NODE_TYPES.TSUnionType){let M=[];for(let P of R.types)if(P.type===le.AST_NODE_TYPES.TSLiteralType&&P.literal.type===le.AST_NODE_TYPES.Literal&&typeof P.literal.value=="string")M.push(P.literal.value);else return!0;return E=M,!0}if(R.type===le.AST_NODE_TYPES.TSLiteralType&&R.literal.type===le.AST_NODE_TYPES.Literal&&typeof R.literal.value=="string")return E=[R.literal.value],!0}return!1},e.sourceCode),E}function y(f){return f==="Array"||f==="ReadonlyArray"?!0:f.endsWith(".Array")||f.endsWith(".ReadonlyArray")}function u(f){if(!n)return!1;if(n.isArrayType(f)||n.isTupleType(f))return!0;let x=n.getApparentType(f);if(x!==f&&(n.isArrayType(x)||n.isTupleType(x)))return!0;if(f.aliasSymbol){let F=n.getFullyQualifiedName(f.aliasSymbol);if(y(F))return!0}let E=f.getSymbol();if(E){let F=n.getFullyQualifiedName(E);if(y(F))return!0}return!1}function d(f){return n?f.getProperties().length===0&&n.getIndexInfosOfType(f).length===0&&f.getCallSignatures().length===0&&f.getConstructSignatures().length===0:!1}function c(f){return n?!!(f.flags&H.default.TypeFlags.StringLike||f.flags&H.default.TypeFlags.NumberLike||f.flags&H.default.TypeFlags.BigIntLike||f.flags&H.default.TypeFlags.BooleanLike||f.flags&H.default.TypeFlags.ESSymbolLike||f.flags&H.default.TypeFlags.EnumLike||f.flags&H.default.TypeFlags.Null||f.flags&H.default.TypeFlags.Undefined||f.flags&H.default.TypeFlags.Void||f.flags&H.default.TypeFlags.Never||f.flags&H.default.TypeFlags.Object&&!f.isClassOrInterface()&&!u(f)&&!d(f)):!1}function g(f){if(f.flags&H.default.TypeFlags.Any||f.flags&H.default.TypeFlags.Unknown)return"unknown";if(f.isUnion()){let x=!0,E=!0;for(let F of f.types){let R=g(F);if(R==="unknown")return"unknown";R!=="alwaysTrue"&&(x=!1),R!=="alwaysFalse"&&(E=!1)}return x?"alwaysTrue":E?"alwaysFalse":"unknown"}return u(f)?"alwaysTrue":c(f)?"alwaysFalse":"unknown"}function h(f){return!f.computed&&f.object.type===le.AST_NODE_TYPES.Identifier&&f.object.name===Nr.object&&f.property.type===le.AST_NODE_TYPES.Identifier&&f.property.name===Nr.property}function S(f){if(!n||f.callee.type!==le.AST_NODE_TYPES.MemberExpression||!h(f.callee)||f.arguments.length===0)return;let[x]=f.arguments;if(!x||x.type===le.AST_NODE_TYPES.SpreadElement)return;let E=r.esTreeNodeToTSNodeMap.get(x),F=n.getTypeAtLocation(E),R=g(F);R==="alwaysTrue"?e.report({node:f,messageId:"unnecessaryArrayIsArrayCondition"}):R==="alwaysFalse"&&e.report({node:f,messageId:"alwaysFalseArrayIsArrayCondition"})}function I(f){if(f.callee.type!==le.AST_NODE_TYPES.MemberExpression||f.callee.property.type!==le.AST_NODE_TYPES.Identifier||f.callee.computed)return;let x=f.callee.property.name;if(x!=="startsWith"&&x!=="endsWith"&&x!=="includes"||f.arguments.length!==1)return;let[E]=f.arguments;if(!E||E.type!==le.AST_NODE_TYPES.Literal||typeof E.value!="string")return;let F=f.callee.object,R=p(F);if(!R&&F.type===le.AST_NODE_TYPES.Identifier&&(R=m(F)),!R||R.length===0)return;let M=E.value;if(x==="includes"&&R.length>1)return;let P=0,ee=0;for(let Z of R)if((x==="startsWith"?Z.startsWith(M):x==="endsWith"?Z.endsWith(M):Z.includes(M))?P++:ee++,P>0&&ee>0)return;if(P>0&&ee===0){let Z=x==="startsWith"?"unnecessaryStartsWithCondition":x==="endsWith"?"unnecessaryEndsWithCondition":"unnecessaryIncludesCondition";e.report({node:f,messageId:Z})}else if(ee>0&&P===0){let Z=x==="startsWith"?"alwaysFalseStartsWithCondition":x==="endsWith"?"alwaysFalseEndsWithCondition":"alwaysFalseIncludesCondition";e.report({node:f,messageId:Z})}}function A(f){if(!new Set(["===","!==",">",">=","<","<="]).has(f.operator))return;function E(D){if(D.type!==le.AST_NODE_TYPES.MemberExpression||D.computed||D.property.type!==le.AST_NODE_TYPES.Identifier||D.property.name!=="length")return null;let q=D.object,B=p(q);if(!B||B.length===0)return null;let ue=[];for(let me of B)ue.push(me.length);return{values:ue}}let F=E(f.left),R=E(f.right),M=null,P=null;if(F?f.right.type===le.AST_NODE_TYPES.Literal&&typeof f.right.value=="number"&&(M=F.values,P=f.right.value):R&&f.left.type===le.AST_NODE_TYPES.Literal&&typeof f.left.value=="number"&&(M=R.values,P=f.left.value),!M||P===null)return;let ee=0,Z=0;for(let D of M){let q=!1;if(f.operator==="==="?q=D===P:f.operator==="!=="?q=D!==P:f.operator===">"?q=D>P:f.operator===">="?q=D>=P:f.operator==="<"?q=D<P:f.operator==="<="&&(q=D<=P),q?ee++:Z++,ee>0&&Z>0)return}ee>0&&Z===0?e.report({node:f,messageId:"unnecessaryLengthCondition"}):Z>0&&ee===0&&e.report({node:f,messageId:"alwaysFalseLengthCondition"})}function T(f){if(f.type===le.AST_NODE_TYPES.Literal&&typeof f.value=="string")return f.value;let x=p(f);if(!x||x.length!==1)return null;let[E]=x;return E??null}function b(f){return(f.flags&H.default.TypeFlags.Intersection)!==0}function C(f){return(f.flags&H.default.TypeFlags.Object)!==0}function w(f){return!n||n.getIndexTypeOfType(f,H.default.IndexKind.String)?!0:!!n.getIndexTypeOfType(f,H.default.IndexKind.Number)}function N(f,x){if(!n||w(f)||f.getProperties().length===0)return"unknown";let E=n.getPropertyOfType(f,x);return E?E.flags&H.default.SymbolFlags.Optional?"optional":"required":"absent"}function k(f,x){if(f.flags&H.default.TypeFlags.Any||f.flags&H.default.TypeFlags.Unknown||f.flags&H.default.TypeFlags.Never||f.flags&H.default.TypeFlags.TypeParameter||f.flags&H.default.TypeFlags.IndexedAccess||f.flags&H.default.TypeFlags.StringLike||f.flags&H.default.TypeFlags.NumberLike||f.flags&H.default.TypeFlags.BigIntLike||f.flags&H.default.TypeFlags.BooleanLike||f.flags&H.default.TypeFlags.EnumLike||f.flags&H.default.TypeFlags.ESSymbolLike||f.flags&H.default.TypeFlags.NonPrimitive||f.flags&H.default.TypeFlags.Null||f.flags&H.default.TypeFlags.Undefined||f.flags&H.default.TypeFlags.Void)return"unknown";if(f.isUnion()){let E=!0,F=!0;for(let R of f.types){let M=k(R,x);if(M==="unknown"||(M!=="required"&&(E=!1),M!=="absent"&&(F=!1),M==="optional"))return"unknown"}return E?"required":F?"absent":"unknown"}if(b(f)){let E=f,F=!1,R=!1;for(let M of E.types){let P=k(M,x);if(P==="unknown")return"unknown";P==="required"?F=!0:P==="optional"&&(R=!0)}return F?"required":R?"optional":"absent"}return C(f)?N(f,x):"unknown"}function O(f){if(f.operator!=="in"||f.left.type===le.AST_NODE_TYPES.PrivateIdentifier)return;let x=T(f.left);if(!x)return;let E=f.right,F=r.esTreeNodeToTSNodeMap.get(E);if(!n)return;let R=n.getTypeAtLocation(F),M=k(R,x);M==="required"?e.report({node:f,messageId:"unnecessaryInCondition",data:{property:x,type:n.typeToString(R),alternative:t.alternativeForInCondition?`If this a valid condition, you can use as alternative: ${t.alternativeForInCondition}`:""}}):M==="absent"&&e.report({node:f,messageId:"alwaysFalseInCondition",data:{property:x,type:n.typeToString(R),alternative:t.alternativeForInCondition?`If this a valid condition, you can use as alternative: ${t.alternativeForInCondition}`:""}})}return{BinaryExpression(f){a(f),A(f),O(f)},CallExpression(f){I(f),S(f)}}}})};function vt(e){return Array.from(new Set(e)).join(" | ")||"never"}function ut(e,t){let r=e.argument;return r.type===le.AST_NODE_TYPES.Identifier?r.name:t.sourceCode.getText(r)}function Ts(e,t){return t.has(e)}var ht=require("@typescript-eslint/utils"),st=require("zod/v4");var Es=st.z.object({functions:st.z.array(st.z.string().or(st.z.object({name:st.z.string(),message:st.z.string()})))});function hs(e){if(e.type===ht.AST_NODE_TYPES.Identifier)return e.name;if(e.type===ht.AST_NODE_TYPES.MemberExpression&&e.property.type===ht.AST_NODE_TYPES.Identifier&&e.object.type===ht.AST_NODE_TYPES.Identifier)return`${e.object.name}.${e.property.name}`}var rn=z({name:"no-call-with-explicit-generics",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)",noExplicitGenericsCustom:"{{ message }}"},schema:[U(Es)]},defaultOptions:[{functions:[]}],create(e,[t]){let r=new Map,n=new Map;for(let o of t.functions){let i=typeof o=="string"?o:o.name,a=typeof o=="string"?void 0:o.message;i.startsWith("*.")?n.set(i.slice(2),a):r.set(i,a)}function s(o){if(r.has(o))return{message:r.get(o)};let i=o.indexOf(".");if(i!==-1){let a=o.slice(i+1);if(n.has(a))return{message:n.get(a)}}}return{CallExpression(o){let i=hs(o.callee);if(!i||!o.typeArguments)return;let a=s(i);a&&(a.message?e.report({node:o,messageId:"noExplicitGenericsCustom",data:{message:a.message}}):e.report({node:o,messageId:"noExplicitGenerics",data:{functionName:i}}))}}}});var De=require("@typescript-eslint/utils"),bs=De.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),kr="no-call-with-inferred-generics",xs=bs({name:kr,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",typeOfUsedInGenerics:"Function '{{ functionName }}' should not be called with 'typeof' in generics",unknownUsedInGenerics:"Function '{{ functionName }}' should not be called with 'unknown' 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"}},disallowTypeOf:{type:"boolean"},disallowUnknown:{type:"boolean"}},required:["name"]}},anyAliases:{type:"array",items:{type:"string"}}},required:["functions"]}]},defaultOptions:[{functions:[]}],create(e,[t]){let r=new Map(t.functions.map(o=>[o.name,o])),n=t.functions.some(o=>o.disallowTypeOf),s=new Set;return{...n&&{TSTypeAliasDeclaration(o){o.typeAnnotation.type===De.AST_NODE_TYPES.TSTypeQuery&&s.add(o.id.name)}},CallExpression(o){let{callee:i}=o;if(i.type!==De.AST_NODE_TYPES.Identifier)return;let a=r.get(i.name);if(!a)return;let{minGenerics:l=1,allowAny:p,disallowTypes:m=t.disallowTypes,disallowTypeOf:y,disallowUnknown:u}=a;(o.typeArguments?.params.length||0)<(l||0)&&e.report({node:o,messageId:"missingGenericDeclaration",data:{functionName:i.name,minGenerics:l||0}}),!(p&&!m)&&(o.typeArguments?.params.some(c=>!p&&c.type===De.AST_NODE_TYPES.TSAnyKeyword||m&&c.type===De.AST_NODE_TYPES.TSTypeReference&&c.typeName.type===De.AST_NODE_TYPES.Identifier&&m.includes(c.typeName.name))&&e.report({node:o,messageId:"anyUsedInGenerics",data:{functionName:i.name}}),u&&o.typeArguments?.params.some(c=>c.type===De.AST_NODE_TYPES.TSUnknownKeyword)&&e.report({node:o,messageId:"unknownUsedInGenerics",data:{functionName:i.name}}),y&&o.typeArguments?.params.some(c=>c.type===De.AST_NODE_TYPES.TSTypeQuery||c.type===De.AST_NODE_TYPES.TSTypeReference&&c.typeName.type===De.AST_NODE_TYPES.Identifier&&s.has(c.typeName.name))&&e.report({node:o,messageId:"typeOfUsedInGenerics",data:{functionName:i.name}}))}}}}),sn={name:kr,rule:xs};var Dr=require("@typescript-eslint/utils"),Cs=Dr.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),Lr="no-commented-out-code",Is=["function ","class ","interface ","enum ","namespace ","import ","export ","const ","let ","var ","return ","throw ","try {","catch (","finally {","async ","await ","case ","switch (","while (","for (","default:"],As=/^\s*return\s+/,ws=/^\s*type\s+[\p{ID_Start}$_][\p{ID_Continue}$\u200C\u200D]*\s*(?:=|<)/u,Fs=/^\s*(?:break|continue)(?:;|\s+[A-Za-z_$][\w$]*;?)?\s*$/,vs=/\w=("|'|`)/,Rs=/\w+:\s*('|"|`)/,Ns=/\[['"][^'"]*['"]\]:\s*('|"|`|[^'"`\s])/,ks=/\w+-\w+:/,Ps=/\w+_\w+:/,Os=/\?\s+\w/,Ds=/:\s+\w/,Ls=/^\s*('|"|`)[^'"]*('|"|`),?\s*$/,js=/^\s*\d+[,}]/,Ms=/^\s*\[[^\]]*\][,}]/,$s=/^\s*\{[^}]*\}[,}]/,_s=/\.\w+\(/,Us=/\[\w+\]/,zs=/^\s*(['"`]).+?\1\s*:/,Vs=/^<[A-Z]\w*(\s|>|\/)/,Ws=/^<[a-z]+(\s|>|\/)/,Js=/<[A-Z]\w*(\s.*)?>/,Xs=/<\/[A-Z]\w*>/,Bs=/<[a-z]+(\s.*)?>/,Hs=/<\/[a-z]+>/,Ys=/^\s*[*\s]*$/,qs=/^[a-zA-Z]/,Zs=/^[A-Z][A-Za-z]*(?:\s+\d+)?(?:\s+[a-z]+)*:\s+[A-Za-z]/,Gs=/^[a-z][A-Za-z0-9_/-]*:\s+[A-Za-z][\w'-]*(?:\s+[A-Za-z][\w'-]*){2,}/,Ks=/\s\([A-Za-z][\w\s,.'/-]*\)/g,Qs=/```[\s\S]*?```/g,eo=/`[^`]*`/g,Pr=/[a-zA-Z0-9]/,to=/\.[A-Za-z_][A-Za-z0-9_]*\(/,no=/[{}[\]()`=<>]/,ro=/:\s*(['"`[{(]|\w+\s*=>)/,io=/\bif\s*\(|\belse\b|=>/,de={returnStatement:As,typeAliasDeclaration:ws,stringAssignment:vs,objectPropertyWithQuotes:Rs,computedPropertyAssignment:Ns,kebabCaseProperty:ks,snakeCaseProperty:Ps,ternaryOperator:Os,colonWithWord:Ds,quotedString:Ls,numberWithComma:js,arrayWithComma:Ms,objectWithComma:$s,methodCall:_s,arrayAccess:Us,quotedPropertyKey:zs,jsxSelfClosing:Vs,jsxElement:Ws,jsxOpeningTag:Js,jsxClosingTag:Xs,htmlOpeningTag:Bs,htmlClosingTag:Hs,jsdocComment:Ys};function so(e){if(e.includes(":")){let n=e.split(":")[0]?.trim();if(n&&qs.test(n)&&n.includes(" "))return!0}let t=e.trim();if(t.length===0||to.test(t))return!1;let r=t.includes("(")?t.replace(Ks,""):t;return no.test(r)||ro.test(t)||io.test(t)?!1:!!(t.includes(":")&&(Zs.test(t)||Gs.test(t)))}var oo=[") {","return;",de.returnStatement,de.typeAliasDeclaration,Fs,"if (","else {","else if (","/>","</","< ","},",": {"," } = ","={",de.stringAssignment,");",de.objectPropertyWithQuotes,de.computedPropertyAssignment,de.kebabCaseProperty,de.snakeCaseProperty,"&&","||","()",de.ternaryOperator,de.colonWithWord,de.quotedString,de.numberWithComma,de.arrayWithComma,de.objectWithComma,de.methodCall,de.arrayAccess,"?.(","??","=>",de.quotedPropertyKey],ao=["/>","</",de.jsxSelfClosing,de.jsxElement,de.jsxOpeningTag,de.jsxClosingTag,de.htmlOpeningTag,de.htmlClosingTag],Or=["INFO:","TODO:","DOCS:","FIX:","FIXME:","HACK:","NOTE:","WARNING:","WARN:","BUG:","ISSUE:","TEMP:","TEMPORARY:","XXX:","REVIEW:","eslint","cspell:","spell-checker:"],lo=Cs({name:Lr,meta:{type:"problem",docs:{description:"Disallow commented code"},messages:{commentedOutCode:"Commented code is not allowed. Detected pattern: `{{ wrongPattern }}` Use a comment starting with one of these prefixes if you want to keep this code commented out: {{ allowedPrefixes }}"},schema:[]},defaultOptions:[],create(e){function t(n,s){if(n.startsWith("/"))return!1;let o=n.trimStart();if(n.startsWith("*")||o.startsWith("eslint-disable")||n.includes("@deprecated")||n.includes("@example")||n.includes("@param")||n.includes("@returns")||n.includes("@throws")||n.includes("typescript-eslint")||n.includes("@ts-")||n.includes("prettier-ignore")||de.jsdocComment.test(n))return!1;for(let i of Or)if(o.startsWith(i))return!1;if(n.includes("https://")||so(o))return!1;if(s==="Block"){for(let i of ao)if(typeof i=="string"){if(n.includes(i))return{wrongPattern:i}}else if(i.test(n))return{wrongPattern:`regex(${i.toString()})`};return!1}for(let i of Is)if(o.startsWith(i))return{wrongPattern:i};for(let i of oo)if(typeof i=="string"){if(n.includes(i))return{wrongPattern:i}}else if(i.test(n))return{wrongPattern:`regex(${i.toString()})`};return!1}function r(n,s){let o=n,i=o.trim();if(i.startsWith("`")&&(i.endsWith("`,")||i.endsWith("`;")||i.endsWith("`")))return o;if(s==="Block"&&o.includes("```")){let p=o.split(Qs);p.some(y=>Pr.test(y))&&(o=p.join(""))}if(!o.includes("`"))return o;let a=o.split(eo);return a.some(p=>Pr.test(p))?a.join(""):o}return{Program(){let s=e.sourceCode.getAllComments();for(let o of s){let i=r(o.value,o.type),a=t(i,o.type);a&&e.report({node:o,messageId:"commentedOutCode",data:{wrongPattern:a.wrongPattern,allowedPrefixes:Or.join(", ")}})}}}}}),on={name:Lr,rule:lo};var Rt=require("@typescript-eslint/utils"),po=Rt.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),jr="no-default-export",co=po({name:jr,meta:{type:"problem",docs:{description:"Disallow default exports"},schema:[],messages:{noDefaultExport:"Default exports are not allowed, use named exports instead."}},defaultOptions:[],create(e){return{ExportDefaultDeclaration(t){e.report({node:t,messageId:"noDefaultExport"})},ExportNamedDeclaration(t){for(let r of t.specifiers)r.exported.type===Rt.TSESTree.AST_NODE_TYPES.Identifier&&r.exported.name==="default"&&e.report({node:t,messageId:"noDefaultExport"})}}}}),an={name:jr,rule:co};var Mr=require("@typescript-eslint/utils"),uo=Mr.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),$r="no-leaked-text-in-jsx",fo=[",",";","[","]","(",")"],mo=uo({name:$r,meta:{type:"problem",docs:{description:"Prevents leaking of text in JSX that should be wrapped in an expression container"},messages:{leakedTextInJSX:'Text "{{ text }}" should be wrapped in a JSX expression container.'},schema:[],fixable:"code"},defaultOptions:[],create(e){return{JSXText(t){let r=t.value.trim();if(!r)return;let n="";fo.includes(r)?n=r:r.includes("&&")?n="&&":r.includes("||")?n="||":r.endsWith("? (")&&(n="? ("),n&&e.report({node:t,messageId:"leakedTextInJSX",data:{text:n}})}}}}),ln={name:$r,rule:mo};var Qe=require("@typescript-eslint/utils"),yo=Qe.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),Ur="no-non-camel-case-functions",go=/^(\$?[a-z][a-zA-Z0-9]*)$/;function _r(e){if(e.typeName.type!==Qe.AST_NODE_TYPES.TSQualifiedName)return!1;let{left:t,right:r}=e.typeName;return t.type===Qe.AST_NODE_TYPES.Identifier&&t.name==="JSX"&&r.name==="Element"}var So=yo({name:Ur,meta:{type:"suggestion",docs:{description:"Enforce camelCase naming convention for function declarations"},schema:[],messages:{nonCamelCaseFunction:'Function name "{{functionName}}" should be in camelCase format. If this fn is a React component and can\'t use the `FC` type, add a explicit "JSX.Element" return type to it'}},defaultOptions:[],create(e){return{FunctionDeclaration(t){if(t.id&&!go.test(t.id.name)){let r=t.returnType?.typeAnnotation;if(r&&(r.type===Qe.AST_NODE_TYPES.TSTypeReference?_r(r):r.type===Qe.AST_NODE_TYPES.TSUnionType&&r.types.some(s=>s.type===Qe.AST_NODE_TYPES.TSTypeReference&&_r(s))))return;e.report({node:t.id,messageId:"nonCamelCaseFunction",data:{functionName:t.id.name}})}}}}}),pn={name:Ur,rule:So};var ae=require("@typescript-eslint/utils");var To=ae.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),zr="no-optional-root-props",Eo=To({name:zr,meta:{type:"problem",docs:{description:"Prevents usage of optional properties at the root of a type if that type is a local type alias or interface referenced only once"},messages:{optionalNotAllowed:'Optional property "{{ propertyName }}" is not allowed on a local type used only once. Use `prop: undefined | ...` instead.',suggestion:"Use `prop: undefined | ...` instead."},hasSuggestions:!0,schema:[]},defaultOptions:[],create(e){function t(n){let o=e.sourceCode.getDeclaredVariables(n)[0];if(!o||o.references.length!==1)return!1;let i=o.references[0];if(!i)return!1;for(let a of Qt(i.identifier)){if("returnType"in a||a.type===ae.TSESTree.AST_NODE_TYPES.ExportNamedDeclaration)return!1;let l=a.parent;if(!l)return!1;if(l.type===ae.TSESTree.AST_NODE_TYPES.TSTypeParameterInstantiation&&l.parent.type===ae.TSESTree.AST_NODE_TYPES.TSTypeReference&&l.parent.typeName.type===ae.TSESTree.AST_NODE_TYPES.Identifier&&l.parent.typeName.name==="FC"){let m=ct(l.parent.parent,ae.TSESTree.AST_NODE_TYPES.VariableDeclaration,4);if(!m)return!1;let y=Nt(m,e.sourceCode);return y?!(y.parent.type===ae.TSESTree.AST_NODE_TYPES.CallExpression&&y.parent.callee.type===ae.TSESTree.AST_NODE_TYPES.Identifier&&y.parent.callee.name==="memo"):!1}if(a.type===ae.TSESTree.AST_NODE_TYPES.AssignmentPattern)return!1;if(l.type===ae.TSESTree.AST_NODE_TYPES.ArrowFunctionExpression){let p=ct(l,ae.TSESTree.AST_NODE_TYPES.VariableDeclaration);return p?!!Nt(p,e.sourceCode):!1}if(l.type===ae.TSESTree.AST_NODE_TYPES.FunctionDeclaration)return!!Nt(l,e.sourceCode)}return!1}function r(n){n.key.type!==ae.TSESTree.AST_NODE_TYPES.Identifier||!n.optional||e.report({node:n.key,messageId:"optionalNotAllowed",data:{propertyName:n.key.name},suggest:[{messageId:"suggestion",fix:s=>{let o=ct(n,ae.TSESTree.AST_NODE_TYPES.TSPropertySignature);if(!o)return null;let i=e.sourceCode.getText(o);return s.replaceText(o,i.replace("?:",": undefined |"))}}]})}return{TSTypeAliasDeclaration(n){if(n.typeAnnotation.type===ae.TSESTree.AST_NODE_TYPES.TSTypeLiteral&&!(kt(n)||!t(n)))for(let s of n.typeAnnotation.members)s.type===ae.TSESTree.AST_NODE_TYPES.TSPropertySignature&&r(s)},TSInterfaceDeclaration(n){if(!(kt(n)||!t(n)))for(let s of n.body.body)s.type===ae.TSESTree.AST_NODE_TYPES.TSPropertySignature&&r(s)},TSTypeReference(n){if(n.typeName.type!==ae.TSESTree.AST_NODE_TYPES.Identifier||n.typeName.name!=="FC"||!n.typeArguments?.params[0])return;let s=n.typeArguments.params[0];if(s.type!==ae.TSESTree.AST_NODE_TYPES.TSTypeLiteral)return;let o=ct(n.parent,ae.TSESTree.AST_NODE_TYPES.VariableDeclaration,4);if(!o)return;let i=Nt(o,e.sourceCode);if(!(!i||i.parent.type===ae.TSESTree.AST_NODE_TYPES.CallExpression&&i.parent.callee.type===ae.TSESTree.AST_NODE_TYPES.Identifier&&i.parent.callee.name==="memo"))for(let l of s.members)l.type===ae.TSESTree.AST_NODE_TYPES.TSPropertySignature&&r(l)}}}});function kt(e){return e?e.parent?.type===ae.TSESTree.AST_NODE_TYPES.ExportNamedDeclaration||e.parent?.type===ae.TSESTree.AST_NODE_TYPES.ExportDefaultDeclaration:!1}function Nt(e,t){if(kt(e))return;let r;if(e.type===ae.TSESTree.AST_NODE_TYPES.VariableDeclaration){if(e.declarations.length!==1)return;e.declarations[0].id.type===ae.TSESTree.AST_NODE_TYPES.Identifier&&(r=e.declarations[0].id)}else{if(!e.id)return;r=e.id}if(!r)return;let n=t.getScope(e);e.type===ae.TSESTree.AST_NODE_TYPES.FunctionDeclaration&&n.upper&&(n=n.upper);let s=n.variables.find(i=>i.identifiers.includes(r));if(!s)return;let o=s.references.filter(i=>i.identifier!==r);if(!(o.length!==1||!o[0])&&!kt(o[0].identifier.parent.parent))return o[0].identifier}var cn={name:zr,rule:Eo};var et=require("@typescript-eslint/utils");var bt=z({name:"no-reexport",meta:{type:"problem",docs:{description:"Disallow re-exports to prevent indirection"},schema:[],messages:{noReexport:"Re-exports are not allowed. Use direct exports only."}},defaultOptions:[],create(e){let t=new Set;function r(s){return s?s.type===et.AST_NODE_TYPES.Identifier?t.has(s.name):s.type===et.AST_NODE_TYPES.MemberExpression?r(s.object):!1:!1}function n(s){return s.type!==et.AST_NODE_TYPES.TSTypeReference||s.typeArguments?!1:s.typeName.type===et.AST_NODE_TYPES.Identifier&&t.has(s.typeName.name)}return{ImportDeclaration(s){for(let o of s.specifiers)t.add(o.local.name)},ExportNamedDeclaration(s){if(s.source){e.report({node:s,messageId:"noReexport"});return}if(s.declaration?.type===et.AST_NODE_TYPES.VariableDeclaration)for(let o of s.declaration.declarations)r(o.init)&&e.report({node:s,messageId:"noReexport"});s.declaration?.type===et.AST_NODE_TYPES.TSTypeAliasDeclaration&&n(s.declaration.typeAnnotation)&&e.report({node:s,messageId:"noReexport"}),s.specifiers.length>0&&e.report({node:s,messageId:"noReexport"})},ExportDefaultDeclaration(s){s.declaration.type===et.AST_NODE_TYPES.Identifier&&t.has(s.declaration.name)&&e.report({node:s,messageId:"noReexport"})},ExportAllDeclaration(s){e.report({node:s,messageId:"noReexport"})}}}});var Vr=require("@typescript-eslint/utils"),Pt=Re(require("path")),He=require("zod/v4");var ho=Vr.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),Wr="no-relative-imports",bo=He.z.object({find:He.z.string(),replacement:He.z.string()}),xo=He.z.object({aliases:He.z.array(bo),rootDir:He.z.string().optional(),allowNotFoundAliases:He.z.boolean().optional(),_dev_simulateFileName:He.z.string().optional()}),Co=ho({name:Wr,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:[U(xo)]},defaultOptions:[{aliases:[],rootDir:void 0}],create(e,[t]){let r=t._dev_simulateFileName??e.filename;function n(i){return i.startsWith(".")||i.startsWith("..")}function s(i,a){let l=Pt.default.dirname(a);return Pt.default.resolve(l,i)}function o(i){let a=t.rootDir??process.cwd(),l=Pt.default.relative(a,i);if(l.startsWith("."))return null;l.startsWith("/")||(l=`/${l}`);for(let{find:p,replacement:m}of t.aliases)if(l.startsWith(m)){let y=l.replace(m,p);return{alias:p,newPath:y}}return null}return{ImportDeclaration(i){let a=i.source.value;if(!n(a))return;let l=s(a,r),p=o(l);!p&&t.allowNotFoundAliases||e.report({node:i,messageId:p?"noRelativeImportsWithAlias":"noRelativeImports",data:{alias:p?.alias},fix:p?m=>m.replaceText(i.source,`'${p.newPath}'`):void 0})}}}}),un={name:Wr,rule:Co};var Se=require("@typescript-eslint/utils"),fn=require("zod/v4");var Io=fn.z.object({customMessage:fn.z.string().optional()}),mn=z({name:"no-static-style-prop",meta:{type:"problem",docs:{description:"Prevent using static style props in JSX, only dynamic values should be allowed"},schema:[U(Io)],messages:{noStaticStyleProp:"Static style props are not allowed use css instead.{{customMessage}}"}},defaultOptions:[{}],create(e,[t]){function r(n){switch(n.type){case Se.AST_NODE_TYPES.Literal:return!0;case Se.AST_NODE_TYPES.ObjectExpression:return n.properties.every(s=>s.type===Se.AST_NODE_TYPES.Property?s.computed||s.value.type===Se.AST_NODE_TYPES.Identifier&&s.key.type===Se.AST_NODE_TYPES.Identifier&&s.key.name===s.value.name?!1:r(s.value):!1);case Se.AST_NODE_TYPES.ArrayExpression:return n.elements.every(s=>s?s.type===Se.AST_NODE_TYPES.SpreadElement?!1:r(s):!0);case Se.AST_NODE_TYPES.TemplateLiteral:return n.expressions.length===0;case Se.AST_NODE_TYPES.ConditionalExpression:case Se.AST_NODE_TYPES.LogicalExpression:case Se.AST_NODE_TYPES.BinaryExpression:case Se.AST_NODE_TYPES.UnaryExpression:case Se.AST_NODE_TYPES.CallExpression:case Se.AST_NODE_TYPES.MemberExpression:case Se.AST_NODE_TYPES.Identifier:case Se.AST_NODE_TYPES.ArrowFunctionExpression:case Se.AST_NODE_TYPES.FunctionExpression:return!1;default:return!1}}return{JSXAttribute(n){if(n.name.type===Se.AST_NODE_TYPES.JSXIdentifier&&n.name.name==="style"&&n.value){let s=null;n.value.type===Se.AST_NODE_TYPES.JSXExpressionContainer?n.value.expression.type!==Se.AST_NODE_TYPES.JSXEmptyExpression&&(s=n.value.expression):n.value.type===Se.AST_NODE_TYPES.Literal&&(s=n.value),s&&r(s)&&e.report({node:n,messageId:"noStaticStyleProp",data:{customMessage:t.customMessage?` ${t.customMessage}`:""}})}}}}});var xt=require("@typescript-eslint/utils"),ot=Re(require("zod/v4"));var Ao=ot.object({alternativeMsgs:ot.object({inArrayFind:ot.string().optional(),inArrayFilter:ot.string().optional()}).optional(),__dev_simulateFileName:ot.string().optional()});function wo(e){return e.typeAnnotation.type!==xt.AST_NODE_TYPES.TSTypePredicate?!1:e.typeAnnotation.asserts===!1}var Fo=/(typeGuards|type-guards)\.(ts|tsx)$/;function vo(e){return Fo.test(e)}function Ro(e){let t=e.parent;for(;t;){if(t.type===xt.AST_NODE_TYPES.CallExpression&&t.callee.type===xt.AST_NODE_TYPES.MemberExpression&&t.callee.property.type===xt.AST_NODE_TYPES.Identifier){let r=t.callee.property.name;if(r==="filter"||r==="find")return{method:r}}t=t.parent}return null}var yn=z({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:[U(Ao)],hasSuggestions:!0},defaultOptions:[{}],create(e,[t]){let r=t.__dev_simulateFileName??e.filename;if(vo(r))return{};function n(s){if(!wo(s))return;let o=Ro(s);if(t.alternativeMsgs&&o){let i=o.method==="filter"?t.alternativeMsgs.inArrayFilter:t.alternativeMsgs.inArrayFind;if(i){let a=o.method==="filter"?"useFilterWithTypeCheck":"useFindWithTypeCheck";e.report({node:s,messageId:a,data:{message:i}});return}}e.report({node:s,messageId:"typeGuardNotAllowed"})}return{"FunctionDeclaration > :matches(TSTypeAnnotation)":n,"ArrowFunctionExpression > :matches(TSTypeAnnotation)":n,"MethodDefinition > FunctionExpression > :matches(TSTypeAnnotation)":n}}});var at=require("@typescript-eslint/utils");var No="no-unnecessary-async-on-jsx-props";function ko(e){if(e.body.type!==at.AST_NODE_TYPES.BlockStatement)return!1;let t=e.body.body;if(t.length!==1)return!1;let r=t[0];return!r||r.type!==at.AST_NODE_TYPES.ExpressionStatement?!1:r.expression.type===at.AST_NODE_TYPES.AwaitExpression}var dn=z({name:No,meta:{type:"suggestion",fixable:"code",docs:{description:"Disallow unnecessary async/await in JSX props where a single await provides no benefit"},messages:{unnecessaryAsyncInJsxProp:"Unnecessary async/await in JSX prop. The single await expression provides no benefit here."},schema:[]},defaultOptions:[],create(e){function t(r){ko(r)&&e.report({node:r,messageId:"unnecessaryAsyncInJsxProp",fix(n){let s=e.sourceCode,o=[],i=s.getFirstToken(r,l=>l.value==="async");if(i){let l=s.getTokenAfter(i);l?o.push(n.replaceTextRange([i.range[0],l.range[0]],"")):o.push(n.remove(i))}function a(l){if(l.type===at.AST_NODE_TYPES.AwaitExpression){let p=s.getFirstToken(l);if(p&&p.value==="await"){let m=s.getTokenAfter(p);m?o.push(n.replaceTextRange([p.range[0],m.range[0]],"")):o.push(n.remove(p))}}if(l.type===at.AST_NODE_TYPES.BlockStatement)for(let p of l.body)a(p);else l.type===at.AST_NODE_TYPES.ExpressionStatement&&a(l.expression)}return a(r.body),o}})}return{"JSXAttribute ArrowFunctionExpression[async=true]":t,"JSXAttribute FunctionExpression[async=true]":t}}});var Ye=require("@typescript-eslint/utils"),gn=Re(require("typescript")),ft=Re(require("zod/v4"));var Po=Ye.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),Jr="no-unnecessary-casting",Oo=ft.default.object({additionalCastFunctions:ft.default.array(ft.default.object({name:ft.default.string(),expectedType:ft.default.enum(["string","number"])})).optional()}),Sn={name:Jr,rule:Po({name:Jr,meta:{type:"suggestion",docs:{description:"Prevents unnecessary Number and String castings"},deprecated:{message:"Use the strict-casting rule instead"},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:[U(Oo)],fixable:"code"},defaultOptions:[{}],create(e){let r=e.options[0].additionalCastFunctions||[],n=[{name:"Number",expectedType:"number"},{name:"String",expectedType:"string"},...r],s=Ye.ESLintUtils.getParserServices(e,!0),o=s.program?.getTypeChecker();if(!o||!s.program)throw new Error("TypeScript services or program not available");function i(m,y){switch(m.type){case Ye.AST_NODE_TYPES.Literal:return y==="number"?typeof m.value=="number":typeof m.value=="string";case Ye.AST_NODE_TYPES.TemplateLiteral:return y==="string";case Ye.AST_NODE_TYPES.UnaryExpression:return y==="number"?m.operator==="+"||m.operator==="-"||m.operator==="~":!1;default:return!1}}function a(m,y){return y==="number"?!!(m.flags&gn.TypeFlags.NumberLike):!!(m.flags&gn.TypeFlags.StringLike)}function l(m,y){return u=>u.replaceText(m,e.sourceCode.getText(y))}function p(m){if(!o||m.arguments.length!==1)return;let y=m.arguments[0];if(!y||y.type===Ye.AST_NODE_TYPES.SpreadElement)return;let{callee:u}=m;if(u.type!==Ye.AST_NODE_TYPES.Identifier)return;let d=u.name,c=n.find(h=>h.name===d);if(!c)return;if(i(y,c.expectedType)||a(o.getTypeAtLocation(s.esTreeNodeToTSNodeMap.get(y)),c.expectedType)){let h,S;d==="Number"?h="unnecessaryNumberCasting":d==="String"?h="unnecessaryStringCasting":(h="unnecessaryCustomCasting",S={name:c.name,type:c.expectedType}),e.report({node:m,messageId:h,...S?{data:S}:{},fix:l(m,y)})}}return{CallExpression:p}}})};var Ne=require("@typescript-eslint/utils"),Ot=Re(require("zod/v4"));var Do=Ot.object({ignoreWithDescription:Ot.string().optional()}),Tn=z({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:[U(Do)]},defaultOptions:[{}],create(e,[t]){let r=e.getSourceCode(),n=r.ast;function s(l){let p=l.arguments[0];return p&&p.type===Ne.AST_NODE_TYPES.Literal&&typeof p.value=="string"?p.value:null}function o(l){return!l||!t.ignoreWithDescription?!1:new RegExp(t.ignoreWithDescription).test(l)}function i(l){return l.length!==1?!1:n.body.filter(m=>{if(m.type===Ne.AST_NODE_TYPES.ExpressionStatement){let y=m.expression;if(y.type===Ne.AST_NODE_TYPES.CallExpression&&y.callee.type===Ne.AST_NODE_TYPES.Identifier){let u=y.callee.name;return["test","it","beforeEach","afterEach","beforeAll","afterAll"].includes(u)}}return!1}).length===0}function a(l){let p=l.arguments[1];if(p&&(p.type===Ne.AST_NODE_TYPES.FunctionExpression||p.type===Ne.AST_NODE_TYPES.ArrowFunctionExpression)&&p.body.type===Ne.AST_NODE_TYPES.BlockStatement){let m=p.body.body;return m.length===0?"":m.map(u=>r.text.slice(u.range[0],u.range[1])).join(`
16
-
17
- `)}return""}return{Program(){let l=[];for(let u of n.body)u.type===Ne.AST_NODE_TYPES.ExpressionStatement&&u.expression.type===Ne.AST_NODE_TYPES.CallExpression&&u.expression.callee.type===Ne.AST_NODE_TYPES.Identifier&&u.expression.callee.name==="describe"&&u.expression.arguments.length===2&&l.push(u.expression);if(!i(l))return;let[p]=l;if(!p)return;let m=s(p);if(o(m))return;let y=n.body.find(u=>u.type===Ne.AST_NODE_TYPES.ExpressionStatement&&u.expression===p);!y||y.type!==Ne.AST_NODE_TYPES.ExpressionStatement||e.report({node:p,messageId:"unnecessaryDescribe",suggest:[{messageId:"removeDescribe",fix(u){let d=a(p);return d?u.replaceText(y,d):null}}]})}}}});var Ct=require("@typescript-eslint/utils"),Ue=Re(require("zod/v4"));var Lo=Ue.object({methods:Ue.union([Ue.array(Ue.string()),Ue.literal("array")])}),En=z({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:[U(Lo)]},defaultOptions:[{methods:"array"}],create(e,[t]){let r=t.methods,n=new Set(["find","filter","map","forEach","some","every","reduce","findIndex","sort"]);function s(a){return Array.isArray(r)?r.includes(a):n.has(a)}function o(a){let{callee:l}=a;if(l.type===Ct.AST_NODE_TYPES.MemberExpression){let p=l.property;if(p.type===Ct.AST_NODE_TYPES.Identifier)return p.name}return null}function i(a,l){if(a.type!==Ct.AST_NODE_TYPES.Identifier||!a.typeAnnotation)return;let p=l.parent;if(p.type===Ct.AST_NODE_TYPES.CallExpression){let m=o(p);m&&s(m)&&p.arguments.indexOf(l)===0&&e.report({node:a.typeAnnotation,messageId:"unnecessaryTypeAnnotation",fix(u){return a.typeAnnotation?u.remove(a.typeAnnotation):null}})}}return{ArrowFunctionExpression(a){for(let l of a.params)i(l,a)},FunctionExpression(a){for(let l of a.params)i(l,a)}}}});var Fe=require("@typescript-eslint/utils");var hn=z({name:"no-unused-obj-props",meta:{type:"suggestion",docs:{description:"Disallow unused properties when it is safe to remove them"},messages:{unusedObjectProperty:'The object property "{{name}}" is not being used',unusedReturnObjectProperty:'The object property "{{name}}" returned by this function is not being used'},schema:[]},defaultOptions:[],create(e){return{VariableDeclarator(t){if(t.id.type===Fe.AST_NODE_TYPES.ObjectPattern||!t.init||t.init.type!==Fe.AST_NODE_TYPES.ObjectExpression||t.id.type===Fe.AST_NODE_TYPES.Identifier&&t.id.typeAnnotation||t.parent.parent.type===Fe.AST_NODE_TYPES.ExportNamedDeclaration)return;let r=new Map;for(let i of t.init.properties)i.type===Fe.AST_NODE_TYPES.Property&&i.key.type===Fe.AST_NODE_TYPES.Identifier&&r.set(i.key.name,i);if(r.size===0||t.id.type!==Fe.AST_NODE_TYPES.Identifier)return;let n=jo(t,e.sourceCode);if(n.length===0)return;let s=t.init.properties.some(i=>i.type!==Fe.AST_NODE_TYPES.Property?!1:i.value.type===Fe.AST_NODE_TYPES.FunctionExpression),o=new Set;for(let i of n){if(i.identifier.parent.type!==Fe.AST_NODE_TYPES.MemberExpression)return;let a=i.identifier.parent;if(a.object!==i.identifier)return;if(a.computed)if(a.property.type===Fe.AST_NODE_TYPES.Literal&&typeof a.property.value=="string")o.add(a.property.value);else return;else{if(a.property.type!==Fe.AST_NODE_TYPES.Identifier)return;o.add(a.property.name)}if(a.parent.type===Fe.AST_NODE_TYPES.CallExpression&&s)return}for(let[i,a]of r)o.has(i)||e.report({node:a,messageId:"unusedObjectProperty",data:{name:i}})}}}});function jo(e,t){let r=t.getDeclaredVariables(e);if(r.length!==1)return[];let n=r[0];return n?n.references.filter(s=>s.identifier!==e.id):[]}var te=require("@typescript-eslint/utils"),bn=require("zod/v4");var Mo=bn.z.object({ignoreArgsMatching:bn.z.string().optional()}),xn=z({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:[U(Mo)]},defaultOptions:[{}],create(e,[t]){let r=[];function n(i){return t.ignoreArgsMatching?new RegExp(t.ignoreArgsMatching).test(i):!1}function s(i){return i.type===te.AST_NODE_TYPES.ExportNamedDeclaration||i.type===te.AST_NODE_TYPES.ExportDefaultDeclaration||i.parent?.type===te.AST_NODE_TYPES.ExportNamedDeclaration||i.parent?.type===te.AST_NODE_TYPES.ExportDefaultDeclaration}function o(i){let a=[];for(let l=0;l<i.length;l++){let p=i[l];if(!p||p.type!==te.AST_NODE_TYPES.Identifier)continue;let m=p.name;if(!n(m)){if(p.optional&&p.typeAnnotation&&p.typeAnnotation.typeAnnotation.type===te.AST_NODE_TYPES.TSTypeLiteral){let y=p.typeAnnotation.typeAnnotation,u=[];for(let d of y.members)d.type===te.AST_NODE_TYPES.TSPropertySignature&&d.key.type===te.AST_NODE_TYPES.Identifier&&u.push({name:d.key.name,optional:d.optional===!0});u.some(d=>d.optional)?a.push({param:p,index:l,name:m,isObjectParam:!0,objectProps:u}):a.push({param:p,index:l,name:m,isObjectParam:!1})}else if(p.optional)a.push({param:p,index:l,name:m,isObjectParam:!1});else if(p.typeAnnotation&&p.typeAnnotation.typeAnnotation.type===te.AST_NODE_TYPES.TSTypeLiteral){let y=p.typeAnnotation.typeAnnotation,u=[];for(let d of y.members)d.type===te.AST_NODE_TYPES.TSPropertySignature&&d.key.type===te.AST_NODE_TYPES.Identifier&&u.push({name:d.key.name,optional:d.optional===!0});u.some(d=>d.optional)&&a.push({param:p,index:l,name:m,isObjectParam:!0,objectProps:u})}}}return a}return{FunctionDeclaration(i){if(s(i))return;let a=o(i.params);a.length!==0&&r.push({node:i,declarationNode:i,optionalParams:a})},VariableDeclarator(i){if(i.id.type!==te.AST_NODE_TYPES.Identifier||!i.init||i.init.type!==te.AST_NODE_TYPES.ArrowFunctionExpression&&i.init.type!==te.AST_NODE_TYPES.FunctionExpression||s(i.parent.parent))return;let l=[...o(i.init.params)];if(i.id.typeAnnotation&&i.id.typeAnnotation.typeAnnotation.type===te.AST_NODE_TYPES.TSTypeReference){let p=i.id.typeAnnotation.typeAnnotation;if(p.typeName.type===te.AST_NODE_TYPES.Identifier&&p.typeName.name==="FC"){let m=p.typeArguments;if(m&&m.params.length===1){let y=m.params[0];if(y&&y.type===te.AST_NODE_TYPES.TSTypeLiteral){let u=[];for(let d of y.members)d.type===te.AST_NODE_TYPES.TSPropertySignature&&d.key.type===te.AST_NODE_TYPES.Identifier&&u.push({name:d.key.name,optional:d.optional===!0});u.some(d=>d.optional)&&l.push({param:i.id,index:0,name:"props",isObjectParam:!0,objectProps:u})}}}}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(u=>u.identifier!==l.identifiers[0]);if(p.length===0)continue;let m=!1;for(let u of p){let d=u.identifier.parent;if(d.type===te.AST_NODE_TYPES.CallExpression&&u.identifier.type===te.AST_NODE_TYPES.Identifier&&d.arguments.includes(u.identifier)){m=!0;break}if(d.type===te.AST_NODE_TYPES.ReturnStatement){m=!0;break}if(d.type===te.AST_NODE_TYPES.Property&&d.parent.type===te.AST_NODE_TYPES.ObjectExpression&&d.parent.parent.type===te.AST_NODE_TYPES.ReturnStatement){m=!0;break}if(d.type===te.AST_NODE_TYPES.JSXExpressionContainer){m=!0;break}}if(m)continue;let y=[];for(let u of p){let d=u.identifier.parent;if(d.type===te.AST_NODE_TYPES.CallExpression&&d.callee===u.identifier){let c=d.arguments.length,g=d.arguments.some(S=>S.type===te.AST_NODE_TYPES.SpreadElement);if(g){m=!0;break}let h={argCount:c,hasSpread:g};for(let S of i.optionalParams)if(S.isObjectParam&&S.index<c){let I=d.arguments[S.index];if(I?.type===te.AST_NODE_TYPES.ObjectExpression){let A={};for(let T of I.properties)T.type===te.AST_NODE_TYPES.Property&&T.key.type===te.AST_NODE_TYPES.Identifier&&(A[T.key.name]=!0);h.objectArgs||(h.objectArgs=[]),h.objectArgs[S.index]=A}else if(I){m=!0;break}}y.push(h)}else if(d.type===te.AST_NODE_TYPES.JSXOpeningElement&&d.name===u.identifier){let c=d.attributes.some(h=>h.type===te.AST_NODE_TYPES.JSXSpreadAttribute);if(c){m=!0;break}let g={argCount:1,hasSpread:c};for(let h of i.optionalParams)if(h.isObjectParam&&h.index===0){let S={};for(let I of d.attributes)I.type===te.AST_NODE_TYPES.JSXAttribute&&I.name.type===te.AST_NODE_TYPES.JSXIdentifier&&(S[I.name.name]=!0);g.objectArgs||(g.objectArgs=[]),g.objectArgs[0]=S}y.push(g)}}if(!(m||y.length===0))for(let u of i.optionalParams)if(u.isObjectParam&&u.objectProps)for(let d of u.objectProps){if(!d.optional)continue;let c=!1;for(let g of y)if(g.objectArgs&&g.objectArgs[u.index]){let h=g.objectArgs[u.index];if(h&&h[d.name]){c=!0;break}}c||e.report({node:u.param,messageId:"unusedOptionalProp",data:{name:d.name}})}else{let d=!1;for(let c of y)if(c.argCount>u.index){d=!0;break}d||e.report({node:u.param,messageId:"unusedOptionalArg",data:{name:u.name}})}}}}}});var pe=require("@typescript-eslint/utils"),tt=require("zod/v4");var $o=tt.z.object({selectors:tt.z.array(tt.z.object({name:tt.z.string(),selectorProp:tt.z.string().optional(),selectorArgPos:tt.z.number().optional(),returnProp:tt.z.string().optional()}))}),_o=pe.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),Xr="no-unused-selected-values",Cn={name:Xr,rule:_o({name:Xr,meta:{type:"suggestion",docs:{description:"Disallow unused values in selector objects"},messages:{unusedSelectedValue:'The selected value "{{name}}" is not being used'},schema:[U($o)]},defaultOptions:[{selectors:[]}],create(e,[t]){let{selectors:r=[]}=t,n=new Map(r.map(s=>[s.name,s]));return{VariableDeclarator(s){let o=null;if(s.init?.type===pe.AST_NODE_TYPES.CallExpression&&(o=s.init),!o)return;let i=zo(o);if(!i)return;let a=n.get(i);if(!a)return;let l=Uo(o,a.selectorArgPos??0,a.selectorProp);if(!l)return;let p=Vo(l);if(!p)return;let m=Br(p.properties,void 0);if(!m)return;if(s.id.type===pe.AST_NODE_TYPES.ObjectPattern){let d=Br(s.id.properties,a.returnProp);if(!d)return;for(let[c,g]of m)d.has(c)||e.report({node:g,messageId:"unusedSelectedValue",data:{name:c}});return}if(s.id.type!==pe.AST_NODE_TYPES.Identifier||a.returnProp)return;let y=Wo(s,e.sourceCode);if(y.length===0)return;let u=new Set;for(let d of y){if(d.identifier.parent.type!==pe.AST_NODE_TYPES.MemberExpression)return;let c=d.identifier.parent.property;if(c.type!==pe.AST_NODE_TYPES.Identifier)return;u.add(c.name)}for(let[d,c]of m)u.has(d)||e.report({node:c,messageId:"unusedSelectedValue",data:{name:d}})}}}})};function Uo(e,t,r){let n=e.arguments[t];if(!n)return null;if(n.type===pe.AST_NODE_TYPES.ArrowFunctionExpression||n.type===pe.AST_NODE_TYPES.FunctionExpression)return n;if(r&&n.type===pe.AST_NODE_TYPES.ObjectExpression){let s=n.properties.find(i=>i.type===pe.AST_NODE_TYPES.Property&&i.key.type===pe.AST_NODE_TYPES.Identifier&&i.key.name===r);if(s?.type!==pe.AST_NODE_TYPES.Property)return null;let o=s.value;if(o.type===pe.AST_NODE_TYPES.ArrowFunctionExpression||o.type===pe.AST_NODE_TYPES.FunctionExpression)return o}return null}function zo(e){return e.callee.type===pe.AST_NODE_TYPES.Identifier?e.callee.name:e.callee.type===pe.AST_NODE_TYPES.MemberExpression&&e.callee.property.type===pe.AST_NODE_TYPES.Identifier?e.callee.property.name:null}function Vo(e){if(e.body.type===pe.AST_NODE_TYPES.ObjectExpression)return e.body;if(e.body.type===pe.AST_NODE_TYPES.BlockStatement){let t=e.body.body.filter(r=>r.type===pe.AST_NODE_TYPES.ReturnStatement);return t.length!==1||!t[0]||t[0].argument?.type!==pe.AST_NODE_TYPES.ObjectExpression?null:t[0].argument}return null}function Br(e,t){let r=e;if(t){let s=e.find(o=>o.type===pe.AST_NODE_TYPES.Property&&o.key.type===pe.AST_NODE_TYPES.Identifier&&o.key.name===t);if(s?.type!==pe.AST_NODE_TYPES.Property||s.value.type!==pe.AST_NODE_TYPES.ObjectPattern)return null;r=s.value.properties}let n=new Map;for(let s of r){if(s.type!==pe.AST_NODE_TYPES.Property||s.key.type!==pe.AST_NODE_TYPES.Identifier)return null;n.set(s.key.name,s)}return n.size>0?n:null}function Wo(e,t){let r=t.getDeclaredVariables(e);if(r.length!==1)return[];let n=r[0];return n?n.references.filter(s=>s.identifier!==e.id):[]}var ce=require("@typescript-eslint/utils");var In=z({name:"no-unused-t-state-field",meta:{type:"suggestion",docs:{description:"Prevent declaring unused t-state fields"},messages:{unusedField:'Field "{{name}}" is not being used, you can safely remove it'},schema:[]},defaultOptions:[],create(e){if(!(e.filename.endsWith(".jsx")||e.filename.endsWith(".tsx")))return{};if(!e.sourceCode.ast.body.some(o=>o.type===ce.AST_NODE_TYPES.ImportDeclaration&&o.source.value==="t-state-form"))return{};let n=null,s=!1;return{CallExpression(o){if(s)return;if(!n){let a=Jo(o);a&&(n=a);return}let i=Xo(o,e.sourceCode);if(i){s=!0;for(let a of i)n.delete(a);if(n.size!==0)for(let[a,l]of n)e.report({node:l,messageId:"unusedField",data:{name:a}})}}}}});function Jo(e){if(!(e.callee.type===ce.AST_NODE_TYPES.Identifier&&e.callee.name==="useForm"))return null;let r=e.arguments[0];if(!r||r.type!==ce.AST_NODE_TYPES.ObjectExpression)return null;let n=en(r.properties,o=>o.type!==ce.AST_NODE_TYPES.Property||o.key.type!==ce.AST_NODE_TYPES.Identifier||o.key.name!=="initialConfig"?null:o.value.type===ce.AST_NODE_TYPES.ObjectExpression?o.value:o.value.type===ce.AST_NODE_TYPES.ArrowFunctionExpression||o.value.type===ce.AST_NODE_TYPES.FunctionExpression?Bo(o.value):null);if(!n)return null;let s=new Map;for(let o of n.properties)o.type===ce.AST_NODE_TYPES.Property&&o.key.type===ce.AST_NODE_TYPES.Identifier&&s.set(o.key.name,o);return s}function Xo(e,t){if(!(e.callee.type===ce.AST_NODE_TYPES.Identifier&&e.callee.name==="useFormState")||e.parent.type!==ce.AST_NODE_TYPES.VariableDeclarator||e.parent.id.type!==ce.AST_NODE_TYPES.ObjectPattern||!en(e.parent.id.properties,i=>i.type===ce.AST_NODE_TYPES.Property&&i.key.type===ce.AST_NODE_TYPES.Identifier&&i.key.name==="formFields"&&i))return null;let s=vr(e.parent,"formFields",t),o=new Set;for(let{identifier:i}of s){if(i.type!==ce.AST_NODE_TYPES.Identifier||i.parent.type===ce.AST_NODE_TYPES.Property&&i.parent.parent.type===ce.AST_NODE_TYPES.ObjectExpression&&i.parent.parent.parent.type===ce.AST_NODE_TYPES.ReturnStatement||i.parent.type===ce.AST_NODE_TYPES.ReturnStatement)return null;if(i.parent.type===ce.AST_NODE_TYPES.MemberExpression){if(i.parent.object.type!==ce.AST_NODE_TYPES.Identifier||i.parent.property.type!==ce.AST_NODE_TYPES.Identifier)return null;o.add(i.parent.property.name)}}return o}function Bo(e){if(e.body.type===ce.AST_NODE_TYPES.ObjectExpression)return e.body;if(e.body.type===ce.AST_NODE_TYPES.BlockStatement){let t=e.body.body.filter(r=>r.type===ce.AST_NODE_TYPES.ReturnStatement);return t.length!==1||!t[0]||t[0].argument?.type!==ce.AST_NODE_TYPES.ObjectExpression?null:t[0].argument}return null}var se=require("@typescript-eslint/utils"),It=require("zod/v4");var Ho=se.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`);function Hr(e){let t=[];for(let r of e.members)r.type===se.AST_NODE_TYPES.TSPropertySignature&&r.key.type===se.AST_NODE_TYPES.Identifier&&t.push([r.key.name,r]);return t}function Yr(e,...t){for(let r of t)e.set(...r);return e}var Yo=It.z.object({forceCheckOnFCPropTypesWithName:It.z.array(It.z.string()).optional(),alwaysCheckFunctionOptionTypes:It.z.boolean().optional()}),qr="no-unused-type-props-in-args",An=null,qo=Ho({name:qr,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:[U(Yo)],fixable:"code"},defaultOptions:[{alwaysCheckFunctionOptionTypes:!0}],create(e,[t]){let{forceCheckOnFCPropTypesWithName:r,alwaysCheckFunctionOptionTypes:n=!0}=t;r&&!An&&(An=r.map(l=>new RegExp(l)));function s(l,p,m,y,u=!0,d=!1){let c=m.name,g=e.sourceCode.getScope(p).references.find(T=>T.identifier.name===c)?.resolved,h=l&&An?.some(T=>T.test(c)),S=d&&n;if(!g||!h&&g.references.filter(T=>T.isTypeReference).length>1||!g.defs[0])return;let I=g.defs[0].node,A=I.parent?.type===se.AST_NODE_TYPES.ExportNamedDeclaration;if(!(u&&A&&!S)){if(I.type===se.AST_NODE_TYPES.TSTypeAliasDeclaration){o(l,p,y,I.typeAnnotation,!0,d);return}if(I.type===se.AST_NODE_TYPES.TSInterfaceDeclaration){o(l,p,y,I.body,!0,d);return}}}function o(l,p,m,y,u,d=!1){if(y.type===se.AST_NODE_TYPES.TSInterfaceBody){for(let c of y.body)c.type===se.AST_NODE_TYPES.TSPropertySignature&&c.key.type===se.AST_NODE_TYPES.Identifier&&m.set(c.key.name,c);return}if(y.type===se.AST_NODE_TYPES.TSTypeLiteral){Yr(m,...Hr(y));return}if(y.type===se.AST_NODE_TYPES.TSIntersectionType){for(let c of y.types)o(l,p,m,c,!0,d);return}u||y.type===se.AST_NODE_TYPES.TSTypeReference&&y.typeName.type===se.AST_NODE_TYPES.Identifier&&s(l,p,y.typeName,m,!0,d)}function i(l,p,m,y=!1){for(let u of m)if(u.type===se.AST_NODE_TYPES.ObjectPattern&&u.typeAnnotation){let d=new Map;if(o(l,p,d,u.typeAnnotation.typeAnnotation,!1,y),d.size===0)continue;a(u,d)}else u.type===se.AST_NODE_TYPES.AssignmentPattern&&u.left.type===se.AST_NODE_TYPES.ObjectPattern&&i(l,p,[u.left],y)}function a(l,p){let m=[];if(l.properties.at(-1)?.type===se.AST_NODE_TYPES.RestElement)return;for(let c of l.properties)c.type===se.AST_NODE_TYPES.Property&&c.key.type===se.AST_NODE_TYPES.Identifier&&m.push(c.key.name);let u=[],d=[];for(let[c,g]of p)m.includes(c)||(d.push(c),u.push({node:g,messageId:"unusedObjectTypeProperty",data:{propertyName:c}}));for(let[c,g]of u.entries())e.report({...g,fix:c===u.length-1?h=>{let S=l.properties.at(-1),I=d.join(", ");return S?S.type===se.AST_NODE_TYPES.RestElement?null:h.insertTextAfter(S,`, ${I}`):h.insertTextBeforeRange([l.range[0]+1,l.range[1]],I)}:void 0})}return{VariableDeclaration(l){let p=l.declarations[0],m=new Map,y=p.id.type===se.AST_NODE_TYPES.Identifier&&p.id.typeAnnotation?.typeAnnotation.type===se.AST_NODE_TYPES.TSTypeReference&&p.id.typeAnnotation.typeAnnotation.typeName.type===se.AST_NODE_TYPES.Identifier&&p.id.typeAnnotation.typeAnnotation.typeName.name==="FC"&&p.id.typeAnnotation.typeAnnotation.typeArguments?.params[0];if(y){if(y.type===se.AST_NODE_TYPES.TSTypeReference&&y.typeName.type===se.AST_NODE_TYPES.Identifier)s(!0,l,y.typeName,m,!1);else if(y.type===se.AST_NODE_TYPES.TSTypeLiteral)Yr(m,...Hr(y));else if(y.type===se.AST_NODE_TYPES.TSIntersectionType)for(let u of y.types)u.type===se.AST_NODE_TYPES.TSTypeReference&&u.typeName.type===se.AST_NODE_TYPES.Identifier?s(!0,l,u.typeName,m,!1):o(!0,l,m,u,!0);if(m.size!==0&&p.init?.type===se.AST_NODE_TYPES.ArrowFunctionExpression){let u=p.init.params[0];if(!u){e.report({node:p.init,messageId:"missingComponentParam"});return}u.type===se.AST_NODE_TYPES.ObjectPattern&&a(u,m)}}},FunctionDeclaration(l){i(!1,l,l.params,n)},ArrowFunctionExpression(l){i(!1,l,l.params,n)}}}}),wn={name:qr,rule:qo};var Le=require("@typescript-eslint/utils");var Fn=z({name:"no-write-only-ref",meta:{type:"problem",docs:{description:"Disallow creating refs that are never read"},messages:{refNotRead:'Ref "{{name}}" is never read. Consider removing it if not needed.'},schema:[]},defaultOptions:[],create(e){let t=new Set;function r(n){return n.callee.type===Le.AST_NODE_TYPES.Identifier?t.has(n.callee.name):n.callee.type===Le.AST_NODE_TYPES.MemberExpression&&n.callee.object.type===Le.AST_NODE_TYPES.Identifier&&n.callee.property.type===Le.AST_NODE_TYPES.Identifier?n.callee.property.name==="useRef":!1}return{ImportDeclaration(n){if(n.source.value==="react")for(let s of n.specifiers)s.type===Le.AST_NODE_TYPES.ImportSpecifier&&s.imported.type===Le.AST_NODE_TYPES.Identifier&&s.imported.name==="useRef"&&t.add(s.local.name)},VariableDeclarator(n){if(n.init&&n.init.type===Le.AST_NODE_TYPES.CallExpression&&r(n.init)&&n.id.type===Le.AST_NODE_TYPES.Identifier){let o=e.sourceCode.getScope(n).set.get(n.id.name);if(o){let i=!1;for(let a of o.references){let p=a.identifier.parent;if(p!==n&&!(p.type===Le.AST_NODE_TYPES.JSXExpressionContainer&&p.parent.type===Le.AST_NODE_TYPES.JSXAttribute&&p.parent.name.type===Le.AST_NODE_TYPES.JSXIdentifier&&p.parent.name.name==="ref")){i=!0;break}}i||e.report({node:n.id,messageId:"refNotRead",data:{name:n.id.name}})}}}}}});var mt=require("@typescript-eslint/utils"),Zo=mt.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),Gr="prefer-named-functions",Zr=new Map,Go=Zo({name:Gr,meta:{hasSuggestions:!0,type:"suggestion",docs:{description:"Prevent using arrow functions when a named function can be used instead"},schema:[{type:"object",properties:{ignoreRegex:{type:"string"},disallowArrowFnWithImplicitReturns:{type:"boolean"}}}],messages:{suggestion:"Convert to named function",default:'Function {{functionName}} should be defined as a named function "function {{functionName}} () {}" instead of an arrow function',withIgnoreRegex:'Function {{functionName}} should be defined as a named function "function {{functionName}} () {}", if not possible to use `function` you can also use a name that matches the rule ignore regex'}},defaultOptions:[{}],create(e,[t]){let r=null;if(t.ignoreRegex){let n=Zr.get(t.ignoreRegex);n?r=n:(r=new RegExp(t.ignoreRegex),Zr.set(t.ignoreRegex,r))}return{VariableDeclarator(n){if(n.init&&n.init.type===mt.AST_NODE_TYPES.ArrowFunctionExpression&&n.id.type===mt.AST_NODE_TYPES.Identifier){let s=n.id.name;if(n.id.typeAnnotation||r&&r.test(s)||!t.disallowArrowFnWithImplicitReturns&&n.init.body.type!==mt.AST_NODE_TYPES.BlockStatement)return;let o=n.parent,i=n.init.params,a=n.init.body,l=n.init;e.report({node:n.id,messageId:r?"withIgnoreRegex":"default",data:{functionName:s,ignoreRegex:t.ignoreRegex},suggest:[{messageId:"suggestion",fix:p=>p.replaceText(o,`${l.async?"async ":""}function ${s}(${i.map(m=>e.sourceCode.getText(m)).join(", ")||""}) ${e.sourceCode.getText(a)}`)}]})}}}}}),vn={name:Gr,rule:Go};var K=require("@typescript-eslint/utils"),ze=require("zod/v4");var Ko=ze.z.object({disallowedFunctions:ze.z.array(ze.z.object({name:ze.z.string(),allowUsingWithArgs:ze.z.boolean().optional(),hookAlternative:ze.z.string().optional(),message:ze.z.string().optional(),allowUseInside:ze.z.array(ze.z.string()).optional()}))}),Qo=/^use[A-Z]/,ea=/^[A-Z]/;function Dt(e){return Qo.test(e)}function Kr(e){return ea.test(e)}function ta(e){return e.type===K.AST_NODE_TYPES.Identifier?Dt(e.name):e.type===K.AST_NODE_TYPES.MemberExpression&&e.property.type===K.AST_NODE_TYPES.Identifier?Dt(e.property.name):!1}function Qr(e,t){return e.type===K.AST_NODE_TYPES.Identifier?e.name===t:e.type===K.AST_NODE_TYPES.MemberExpression&&e.object.type===K.AST_NODE_TYPES.Identifier&&e.property.type===K.AST_NODE_TYPES.Identifier?e.object.name==="React"&&e.property.name===t:!1}function ei(e){return!!(e.parent&&e.parent.type===K.AST_NODE_TYPES.CallExpression&&Qr(e.parent.callee,"forwardRef"))}function ti(e){return!!(e.parent&&e.parent.type===K.AST_NODE_TYPES.CallExpression&&Qr(e.parent.callee,"memo"))}function Rn(e){if(e.type===K.AST_NODE_TYPES.FunctionDeclaration||e.type===K.AST_NODE_TYPES.FunctionExpression&&e.id)return e.id||void 0;if(e.type===K.AST_NODE_TYPES.FunctionExpression||e.type===K.AST_NODE_TYPES.ArrowFunctionExpression){if(e.parent.type===K.AST_NODE_TYPES.VariableDeclarator&&e.parent.init===e)return e.parent.id;if(e.parent.type===K.AST_NODE_TYPES.AssignmentExpression&&e.parent.right===e&&e.parent.operator==="=")return e.parent.left;if(e.parent.type===K.AST_NODE_TYPES.Property&&e.parent.value===e&&!e.parent.computed)return e.parent.key;if(e.parent.type===K.AST_NODE_TYPES.AssignmentPattern&&e.parent.right===e)return e.parent.left}}function na(e){let t=e.parent,r=!1;for(;t;){if(t.type===K.AST_NODE_TYPES.FunctionDeclaration||t.type===K.AST_NODE_TYPES.FunctionExpression||t.type===K.AST_NODE_TYPES.ArrowFunctionExpression){let n=Rn(t);if(n&&n.type===K.AST_NODE_TYPES.Identifier){if(Kr(n.name)||Dt(n.name))return!r;r=!0}else{if(ei(t)||ti(t))return!r;if(t.parent.type===K.AST_NODE_TYPES.CallExpression){let s=t.parent;ta(s.callee)||(r=!0)}else t.parent.type===K.AST_NODE_TYPES.JSXExpressionContainer||(r=!0)}}t=t.parent}return!1}function ni(e){return e.callee.type===K.AST_NODE_TYPES.Identifier?e.callee.name:e.callee.type===K.AST_NODE_TYPES.MemberExpression&&e.callee.property.type===K.AST_NODE_TYPES.Identifier?e.callee.property.name:null}function ra(e,t){if(!t.length)return!1;let r=e.parent;for(;r;){if(r.type===K.AST_NODE_TYPES.FunctionDeclaration||r.type===K.AST_NODE_TYPES.FunctionExpression||r.type===K.AST_NODE_TYPES.ArrowFunctionExpression){let n=Rn(r);if(n&&n.type===K.AST_NODE_TYPES.Identifier&&t.includes(n.name))return!0}else if(r.type===K.AST_NODE_TYPES.CallExpression){let n=ni(r);if(n&&t.includes(n))return!0}r=r.parent}return!1}function ia(e){return e.arguments.length>0&&!e.arguments.every(t=>t.type===K.AST_NODE_TYPES.Identifier&&t.name==="undefined")}function sa(e,t){let r=!1,n=e.parent;for(;n;){if(n.type===K.AST_NODE_TYPES.FunctionDeclaration||n.type===K.AST_NODE_TYPES.FunctionExpression||n.type===K.AST_NODE_TYPES.ArrowFunctionExpression){let s=Rn(n);if(s&&s.type===K.AST_NODE_TYPES.Identifier){if(Kr(s.name)||Dt(s.name)){r=!0;break}}else if(ei(n)||ti(n)){r=!0;break}}n=n.parent}return r?t.length===0?na(e):!ra(e,t):!1}var Nn=z({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:[U(Ko)],hasSuggestions:!0},defaultOptions:[{disallowedFunctions:[]}],create(e,[t]){let{disallowedFunctions:r}=t,n=new Map(r.map(s=>[s.name,s]));return{CallExpression(s){let o=ni(s);if(!o)return;let i=n.get(o);if(!i||i.allowUsingWithArgs&&ia(s))return;let a=i.allowUseInside||[];sa(s,a)&&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 p=i.hookAlternative;return p?s.callee.type===K.AST_NODE_TYPES.Identifier?l.replaceText(s.callee,p):s.callee.type===K.AST_NODE_TYPES.MemberExpression&&s.callee.property.type===K.AST_NODE_TYPES.Identifier?l.replaceText(s.callee.property,p):null:null}}]:[]})}}}});var fe=require("@typescript-eslint/utils"),Lt=Re(require("zod/v4"));var oa=fe.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),ii="prefer-single-line-if",aa=Lt.default.object({maxLineLength:Lt.default.number().optional(),maxNonSimpleConditionLength:Lt.default.number().optional()}),la=oa({name:ii,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:[U(aa)]},defaultOptions:[{}],create(e,[t]){let r=e.sourceCode;return{IfStatement(n){if(n.consequent.type!==fe.AST_NODE_TYPES.BlockStatement||n.loc.start.line===n.loc.end.line||r.getCommentsInside(n.consequent).length>0||n.alternate||n.consequent.body.length!==1)return;let o=n.consequent.body[0];if(!o)return;if(o.type===fe.AST_NODE_TYPES.ReturnStatement){if(!oi(o))return}else if(!(o.type===fe.AST_NODE_TYPES.ContinueStatement||o.type===fe.AST_NODE_TYPES.BreakStatement))return;if(n.test.type===fe.AST_NODE_TYPES.LogicalExpression||n.test.type===fe.AST_NODE_TYPES.ConditionalExpression)return;let i;if(t.maxNonSimpleConditionLength){let y=ri(n.test);if(!y&&n.test.type===fe.AST_NODE_TYPES.UnaryExpression&&n.test.operator==="!"){let u=n.test.argument;ri(u)&&(y=!0)}if(y&&(i=r.getText(n.test),i.length>t.maxNonSimpleConditionLength))return}i||(i=r.getText(n.test));let a=r.getText(o);if(i.includes(`
18
- `))return;let l=r.getTokenAfter(n);if(l&&l.type===fe.AST_TOKEN_TYPES.Punctuator&&l.value==="}"){let y=r.getTokenAfter(l);if(y&&y.type===fe.AST_TOKEN_TYPES.Keyword&&(y.value==="else"||y.value==="catch"))return}let p=pa(r,n),m=`if (${i}) ${a}`;t.maxLineLength&&m.length+p.length>t.maxLineLength||e.report({node:n,messageId:"noSingleLineCurly",fix:y=>y.replaceText(n,m)})}}}});function ri(e){return e.type===fe.AST_NODE_TYPES.CallExpression||e.type===fe.AST_NODE_TYPES.BinaryExpression||e.type===fe.AST_NODE_TYPES.MemberExpression&&si(e)}function si(e){return e.object.type===fe.AST_NODE_TYPES.MemberExpression?si(e.object):e.object.type!==fe.AST_NODE_TYPES.Identifier}function pa(e,t){return e.text.slice(t.range[0]-t.loc.start.column,t.range[0])}function oi(e){if(!e.argument)return!0;let t=e.argument;return t.type===fe.AST_NODE_TYPES.ArrayExpression&&t.elements.length===0||t.type===fe.AST_NODE_TYPES.ObjectExpression&&t.properties.length===0||t.type===fe.AST_NODE_TYPES.Literal||t.type===fe.AST_NODE_TYPES.Identifier||t.type===fe.AST_NODE_TYPES.TemplateLiteral||t.type===fe.AST_NODE_TYPES.TaggedTemplateExpression?!0:t.type===fe.AST_NODE_TYPES.CallExpression?t.arguments.length===0:t.type===fe.AST_NODE_TYPES.UnaryExpression?oi(t):!1}var kn={name:ii,rule:la};var j=require("@typescript-eslint/utils"),On=require("zod/v4");var ca=j.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),ui="react-compiler-extra",ua=On.z.object({runOnlyWithEnableCompilerDirective:On.z.boolean().optional()}),fa=/eslint +react-compiler\/react-compiler: +\["error/;function yt(e){let t=null;if((e.type===j.AST_NODE_TYPES.FunctionDeclaration||e.type===j.AST_NODE_TYPES.FunctionExpression||e.type===j.AST_NODE_TYPES.ArrowFunctionExpression&&e.body.type===j.AST_NODE_TYPES.BlockStatement)&&(t=e.body),!t||t.body.length===0)return!1;let r=t.body[0];return r?r.type===j.AST_NODE_TYPES.ExpressionStatement&&r.expression.type===j.AST_NODE_TYPES.Literal&&r.expression.value==="use no memo":!1}function ai(e){let t=e.parent;for(;t;){if(t.type===j.AST_NODE_TYPES.FunctionDeclaration||t.type===j.AST_NODE_TYPES.FunctionExpression||t.type===j.AST_NODE_TYPES.ArrowFunctionExpression)return t;t=t.parent}return null}function ma(e){return e.type===j.AST_NODE_TYPES.Identifier?e.name.startsWith("use"):!1}function fi(e){return e.type===j.AST_NODE_TYPES.Identifier?e.name.startsWith("use"):e.type===j.AST_NODE_TYPES.MemberExpression&&e.property.type===j.AST_NODE_TYPES.Identifier?e.property.name.startsWith("use"):!1}function Ve(e){if(!e)return!1;switch(e.type){case j.AST_NODE_TYPES.JSXElement:case j.AST_NODE_TYPES.JSXFragment:return!0;case j.AST_NODE_TYPES.ConditionalExpression:return Ve(e.consequent)||Ve(e.alternate);case j.AST_NODE_TYPES.LogicalExpression:return e.operator==="&&"?Ve(e.right):e.operator==="||"?Ve(e.left)||Ve(e.right):!1;case j.AST_NODE_TYPES.CallExpression:if(e.callee.type===j.AST_NODE_TYPES.MemberExpression&&e.callee.object.type===j.AST_NODE_TYPES.Identifier&&e.callee.object.name==="React"&&e.callee.property.type===j.AST_NODE_TYPES.Identifier&&e.callee.property.name==="createElement")return!0;for(let t of e.arguments)if(t.type!==j.AST_NODE_TYPES.SpreadElement&&Ve(t))return!0;return!1;default:return!1}}function ya(e){let t=e.typeAnnotation;if(t.type===j.AST_NODE_TYPES.TSTypeReference){if(t.typeName.type===j.AST_NODE_TYPES.Identifier)return t.typeName.name==="FC";if(t.typeName.type===j.AST_NODE_TYPES.TSQualifiedName&&t.typeName.left.type===j.AST_NODE_TYPES.Identifier&&t.typeName.right.type===j.AST_NODE_TYPES.Identifier)return t.typeName.left.name==="React"&&t.typeName.right.name==="FC"}return!1}var da=/^[A-Z][a-zA-Z0-9]*$/;function wt(e){return da.test(e)}function jt(e){return e.startsWith("use")&&e.length>3}function Dn(e,t,r,n){if(r&&ya(r))return t?wt(t.name):e.type===j.AST_NODE_TYPES.FunctionDeclaration&&e.id?wt(e.id.name):!0;if(t&&jt(t.name)||e.type===j.AST_NODE_TYPES.FunctionDeclaration&&e.id&&jt(e.id.name))return!0;if(n){let s=t?.name||e.type===j.AST_NODE_TYPES.FunctionDeclaration&&e.id?.name;if(s&&wt(s)&&mi(e.body,n).containsJSX)return!0}return!1}function At(e){if(e.body.type===j.AST_NODE_TYPES.BlockStatement){for(let t of e.body.body)if(t.type===j.AST_NODE_TYPES.ExpressionStatement&&t.expression.type===j.AST_NODE_TYPES.Literal&&typeof t.expression.value=="string"&&t.expression.value==="use memo")return!0}return!1}function mi(e,t){let r={containsJSX:!1,containsHookCalls:!1};return _e(e,n=>{if(r.containsJSX&&r.containsHookCalls)return!0;switch(n.type){case j.AST_NODE_TYPES.JSXElement:case j.AST_NODE_TYPES.JSXFragment:r.containsJSX=!0;break;case j.AST_NODE_TYPES.CallExpression:ma(n.callee)&&(r.containsHookCalls=!0),Ve(n)&&(r.containsJSX=!0);break;case j.AST_NODE_TYPES.ReturnStatement:n.argument&&Ve(n.argument)&&(r.containsJSX=!0);break;case j.AST_NODE_TYPES.VariableDeclarator:n.init&&Ve(n.init)&&(r.containsJSX=!0);break;case j.AST_NODE_TYPES.AssignmentExpression:Ve(n.right)&&(r.containsJSX=!0);break}},t),r}function li(e,t){let r=e.body,n=mi(r,t);return n.containsJSX||n.containsHookCalls}var ga=/\bthis[.[]/;function pi(e){return ga.test(e)}function Sa(e,t){let r={containsJSX:!1,containsHookCalls:!1};return _e(e,n=>{if(r.containsHookCalls||(n.type===j.AST_NODE_TYPES.FunctionDeclaration||n.type===j.AST_NODE_TYPES.FunctionExpression||n.type===j.AST_NODE_TYPES.ArrowFunctionExpression)&&n!==e)return!0;n.type===j.AST_NODE_TYPES.CallExpression&&fi(n.callee)&&(r.containsHookCalls=!0)},t),r}function ci(e){return wt(e)||jt(e)}function Pn(e,t,r,n){if(!Sa(e.body,t).containsHookCalls)return!1;let o=Dn(e,r,n,t);if(!o&&n){let i=r?.name||e.type===j.AST_NODE_TYPES.FunctionDeclaration&&e.id?.name;i&&wt(i)&&(o=!0)}return!o}var Ta=ca({name:ui,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:[U(ua)]},defaultOptions:[{}],create(e,[t]){let r=!1;if(t.runOnlyWithEnableCompilerDirective){for(let i of e.sourceCode.getAllComments())if(fa.test(i.value)){r=!0;break}if(!r)return{}}function n(i){for(let a of i.properties)if(a.type===j.AST_NODE_TYPES.Property&&a.method&&a.value.type===j.AST_NODE_TYPES.FunctionExpression){let l=e.sourceCode,p=l.getText(a.key),m=a.value,y=l.getText(m.body);if(pi(y))e.report({node:a,messageId:"thisKeywordInMethod"});else{let u=m.params.map(c=>l.getText(c)).join(", "),d="";m.generator?d=`${p}: function* (${u}) ${y}`:m.async?d=`${p}: async (${u}) => ${y}`:d=`${p}: (${u}) => ${y}`,e.report({node:a,messageId:"objectMethodIsNotSupported",fix:c=>c.replaceText(a,d)})}}}function s(i){for(let a of i.properties)if(a.type===j.AST_NODE_TYPES.Property&&a.value.type===j.AST_NODE_TYPES.ObjectExpression){for(let l of a.value.properties)if(l.type===j.AST_NODE_TYPES.Property&&l.method&&l.value.type===j.AST_NODE_TYPES.FunctionExpression){let m=e.sourceCode.getText(l.value.body);pi(m)&&e.report({node:l,messageId:"thisKeywordInMethod"})}}}function o(i){let a=ai(i);return a!==null&&yt(a)}return{CallExpression(i){if(fi(i.callee))for(let a of i.arguments){if(a.type===j.AST_NODE_TYPES.ObjectExpression){if(o(i))return;n(a),s(a)}if(a.type===j.AST_NODE_TYPES.ArrowFunctionExpression){if(a.body.type===j.AST_NODE_TYPES.ObjectExpression){if(o(i))return;n(a.body),s(a.body)}if(a.body.type===j.AST_NODE_TYPES.BlockStatement){for(let l of a.body.body)if(l.type===j.AST_NODE_TYPES.ReturnStatement&&l.argument?.type===j.AST_NODE_TYPES.ObjectExpression){if(o(i))return;n(l.argument),s(l.argument)}}}if(a.type===j.AST_NODE_TYPES.FunctionExpression){for(let l of a.body.body)if(l.type===j.AST_NODE_TYPES.ReturnStatement&&l.argument?.type===j.AST_NODE_TYPES.ObjectExpression){if(o(i))return;n(l.argument),s(l.argument)}}}},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)){let a=i.init,l=i.id,p=i.id.typeAnnotation;if(At(a)&&!ci(l.name)){e.report({node:a,messageId:"useMemoDirectiveNaming"});return}if(Pn(a,e.sourceCode,l,p)){if(yt(a))return;e.report({node:a,messageId:"functionCallingHooksMustBeComponent"});return}if(Dn(a,l,p,e.sourceCode)){let m=li(a,e.sourceCode),y=At(a);if(!m&&!y){if(yt(a))return;e.report({node:a,messageId:"fcComponentShouldReturnJsx",suggest:[{messageId:"addUseMemoDirective",fix(u){if(a.body.type===j.AST_NODE_TYPES.BlockStatement){let d=a.body.range[0]+1;return u.insertTextAfterRange([d,d],`
1
+ "use strict";var kr=Object.create;var rt=Object.defineProperty;var jr=Object.getOwnPropertyDescriptor;var Mr=Object.getOwnPropertyNames;var Lr=Object.getPrototypeOf,_r=Object.prototype.hasOwnProperty;var $r=(e,t)=>{for(var o in t)rt(e,o,{get:t[o],enumerable:!0})},Nn=(e,t,o,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Mr(t))!_r.call(e,i)&&i!==o&&rt(e,i,{get:()=>t[i],enumerable:!(r=jr(t,i))||r.enumerable});return e};var Oe=(e,t,o)=>(o=e!=null?kr(Lr(e)):{},Nn(t||!e||!e.__esModule?rt(o,"default",{value:e,enumerable:!0}):o,e)),zr=e=>Nn(rt({},"__esModule",{value:!0}),e);var Ta={};$r(Ta,{default:()=>Sa,extendedLintPlugin:()=>Dr});module.exports=zr(Ta);var le=require("@typescript-eslint/utils"),w=require("zod/v4");var Rn=require("@typescript-eslint/utils"),wn=Oe(require("zod/v4"));function v(e){let o=Rn.ESLintUtils.RuleCreator(r=>`https://github.com/lucasols/extended-lint#${r}`)(e);return{name:e.name,rule:o}}function k(e){return wn.toJSONSchema(e)}var Ur=w.z.object({disallow:w.z.array(w.z.object({selector:w.z.string(),message:w.z.string(),replace:w.z.optional(w.z.union([w.z.string(),w.z.object({regex:w.z.string(),with:w.z.string()})])),replaceType:w.z.optional(w.z.enum(["suggestion","autofix"]))})).optional(),disallowFnCalls:w.z.optional(w.z.array(w.z.object({fn:w.z.string(),withArgs:w.z.optional(w.z.array(w.z.object({atIndex:w.z.number(),value:w.z.union([w.z.string(),w.z.number(),w.z.boolean()])}))),message:w.z.string(),replaceWith:w.z.optional(w.z.string()),ignoreRegex:w.z.optional(w.z.string())}))),__dev_simulateFileName:w.z.optional(w.z.string()),mustMatchSyntax:w.z.optional(w.z.array(w.z.object({includeRegex:w.z.string(),excludeRegex:w.z.optional(w.z.string()),mustCallFn:w.z.optional(w.z.array(w.z.object({anyCall:w.z.array(w.z.object({fn:w.z.string(),withArgs:w.z.array(w.z.object({atIndex:w.z.number(),literal:w.z.union([w.z.string(),w.z.number(),w.z.boolean()])}))})),message:w.z.optional(w.z.string())}))),mustMatchSelector:w.z.optional(w.z.array(w.z.object({selector:w.z.string(),message:w.z.string()}))),mustHaveExport:w.z.optional(w.z.array(w.z.object({name:w.z.string(),type:w.z.enum(["function","variable","any"]).default("any"),message:w.z.string()})))})))}),Et=v({name:"advanced-no-restricted-syntax",meta:{type:"suggestion",docs:{description:"Disallow specific syntax patterns"},schema:[k(Ur)],messages:{default:"{{message}}"},fixable:"code",hasSuggestions:!0},defaultOptions:[{disallow:[]}],create(e,[t]){let o={},{mustMatchSyntax:r,__dev_simulateFileName:i,disallow:s,disallowFnCalls:n}=t,a=i??e.filename,p=[],l=new Map,d=new Set,m=new Map,u=new Set,f=new Map;function c(E){for(let I of E.specifiers)I.type===le.AST_NODE_TYPES.ImportSpecifier&&I.imported.type===le.AST_NODE_TYPES.Identifier&&I.imported.name!==I.local.name&&f.set(I.local.name,I.imported.name)}function g(E){if(E.declaration){if(E.declaration.type===le.AST_NODE_TYPES.FunctionDeclaration&&E.declaration.id){let I=E.declaration.id.name;for(let D of Array.from(u)){let[M,U]=D.split(":");M===I&&(U==="function"||U==="any")&&u.delete(D)}}else if(E.declaration.type===le.AST_NODE_TYPES.VariableDeclaration){for(let I of E.declaration.declarations)if(I.id.type===le.AST_NODE_TYPES.Identifier){let D=I.id.name;for(let M of Array.from(u)){let[U,Z]=M.split(":");U===D&&(Z==="variable"||Z==="any")&&u.delete(M)}}}}for(let I of E.specifiers)if(I.exported.type===le.AST_NODE_TYPES.Identifier){let D=I.exported.name;for(let M of Array.from(u)){let[U,Z]=M.split(":");U===D&&Z==="any"&&u.delete(M)}}}function T(E){E.id.type===le.AST_NODE_TYPES.Identifier&&E.init?.type===le.AST_NODE_TYPES.Identifier&&f.set(E.id.name,E.init.name)}function y(E){return f.get(E)??E}function C(E,I){return y(E)===I||E===I}for(let{includeRegex:E,excludeRegex:I,mustCallFn:D,mustMatchSelector:M,mustHaveExport:U}of r??[]){let h=function(x){let P=x;for(let{name:j,value:Y}of Z??[])P=P.replaceAll(j,Y);return P};var b=h;let Z=Jr(a,new RegExp(E));if(Z&&!(I&&new RegExp(I).test(a))){for(let{anyCall:x,message:P}of D??[]){let j=`Expected file to call the function: ${x.map(({fn:Y})=>Y).join(" or ")}`;d.add(j),p.push(Y=>{let{callee:q}=Y;if(q.type===le.AST_NODE_TYPES.Identifier){for(let{fn:ne,withArgs:Q}of x)if(q.name===ne){d.delete(j);for(let F of Q){let J=Y.arguments[F.atIndex],L=typeof F.literal=="string"?h(F.literal):F.literal;if(!J){e.report({node:Y,messageId:"default",data:{message:`Missing argument with value "${L}" at index ${F.atIndex}${P?`: ${h(P)}`:""}`}});continue}if(J.type!==le.AST_NODE_TYPES.Literal){e.report({node:J,messageId:"default",data:{message:`Argument at position ${F.atIndex} should the literal "${L}"${P?`: ${h(P)}`:""}`}});continue}J.value!==L&&e.report({node:J,messageId:"default",data:{message:`Argument should have the value "${L}"${P?`: ${h(P)}`:""}`},fix:ae=>ae.replaceText(J,typeof L=="string"?`'${L}'`:String(L))})}break}}})}for(let{selector:x,message:P}of M??[])m.set(x,h(P)),l.set(h(x),()=>{m.delete(x)});for(let{name:x,type:P,message:j}of U??[]){let Y=h(x),q=h(j);u.add(`${Y}:${P}:${q}`)}}}for(let{fn:E,withArgs:I,message:D,replaceWith:M,ignoreRegex:U}of n??[])U&&new RegExp(U).test(a)||p.push(Z=>{let{callee:h}=Z;if(h.type!==le.AST_NODE_TYPES.Identifier||!C(h.name,E))return;if(I)for(let P of I){let j=Z.arguments[P.atIndex];if(!j){e.report({node:Z,messageId:"default",data:{message:`Missing argument with value "${P.value}" at index ${P.atIndex}: ${D}`}});return}if(j.type!==le.AST_NODE_TYPES.Literal||j.value!==P.value)return}let x=P=>M?P.replaceText(Z,M):null;e.report({node:Z,messageId:"default",data:{message:D},suggest:M?[{messageId:"default",data:{message:`Replace with "${M}"`},fix:x}]:void 0})});function A(E,I){let D=o[E];D?o[E]=M=>{D(M),I(M)}:o[E]=I}for(let{selector:E,message:I,replace:D,replaceType:M="suggestion"}of s??[]){if(E==="CallExpression"){p.push(U=>{S(D,U,I,M)});continue}o[E]=U=>{S(D,U,I,M)}}if(l.size>0)for(let[E,I]of l)A(E,I);return p.length>0&&(o.CallExpression=E=>{if(E.type===le.AST_NODE_TYPES.CallExpression)for(let I of p)I(E)}),o.ImportDeclaration=E=>{E.type===le.AST_NODE_TYPES.ImportDeclaration&&c(E)},o.ExportNamedDeclaration=E=>{E.type===le.AST_NODE_TYPES.ExportNamedDeclaration&&g(E)},o.VariableDeclarator=E=>{E.type===le.AST_NODE_TYPES.VariableDeclarator&&T(E)},o["Program:exit"]=E=>{for(let I of d)e.report({node:E,messageId:"default",data:{message:I}});for(let[,I]of m)e.report({node:E,messageId:"default",data:{message:I}});for(let I of u){let[D,M,U]=I.split(":");e.report({node:E,messageId:"default",data:{message:`Missing required export "${D}" of type ${M}: ${U}`}})}},o;function S(E,I,D,M){let U=Z=>{if(!E)return null;if(typeof E=="string")return Z.replaceText(I,E);{let h=new RegExp(E.regex),x=e.sourceCode.getText(I);return Z.replaceText(I,x.replace(h,E.with))}};e.report({node:I,messageId:"default",data:{message:D},fix:E&&M==="autofix"?U:void 0,suggest:E&&M==="suggestion"?[{messageId:"default",data:{message:`Replace with "${typeof E=="string"?E:E.with}"`},fix:U}]:void 0})}}});function Jr(e,t){let o=[],r=t.exec(e);if(!r)return null;let[i,...s]=r;o.push({name:"$0_lowercase",value:i.toLowerCase()}),o.push({name:"$0_capitalize",value:Fn(i)}),o.push({name:"$0_uncapitalize",value:On(i)}),o.push({name:"$0",value:i});for(let n=0;n<s.length;n++){let a=`$${n+1}`,p=s[n];p!==void 0&&(o.push({name:`${a}_lowercase`,value:p.toLowerCase()}),o.push({name:`${a}_capitalize`,value:Fn(p)}),o.push({name:`${a}_uncapitalize`,value:On(p)}),o.push({name:a,value:p}))}return o}function Fn(e){return e.charAt(0).toUpperCase()+e.slice(1)}function On(e){return e.charAt(0).toLowerCase()+e.slice(1)}var V=require("@typescript-eslint/utils"),De=require("zod/v4");var Vr=V.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),vn="collapse-simple-objs-in-one-line",Xr=De.z.object({maxLineLength:De.z.number().optional(),maxProperties:De.z.number().optional(),nestedObjMaxLineLength:De.z.number().optional(),nestedObjMaxProperties:De.z.number().optional(),ignoreTypesWithSuffix:De.z.array(De.z.string()).optional()}),Wr=Vr({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:[k(Xr)]},defaultOptions:[{}],create(e,[t]){let o=e.sourceCode,r=t.ignoreTypesWithSuffix??[],i=t.maxProperties??2,s=t.nestedObjMaxLineLength??t.maxLineLength,n=t.nestedObjMaxProperties??3;function a(l){if(l.type===V.AST_NODE_TYPES.ObjectExpression){let d=l.parent.type===V.AST_NODE_TYPES.Property,m=d?n:i,u=l.properties.length;if(u>m)return!1;if(u===1){let c=l.properties[0];return!c||c.type===V.AST_NODE_TYPES.Property&&c.value.type===V.AST_NODE_TYPES.ObjectExpression||c.type===V.AST_NODE_TYPES.Property&&c.value.type===V.AST_NODE_TYPES.ArrayExpression&&!c.value.elements.every(T=>T&&xt(T))?!1:{text:o.getText(c),isNested:d,propsSize:u}}let f=[];for(let c of l.properties){if(c.type===V.AST_NODE_TYPES.Property&&!xt(c.value))return!1;f.push(o.getText(c))}return{text:f.join(", "),isNested:d,propsSize:u}}else{let d=l.parent.parent?.type===V.AST_NODE_TYPES.TSPropertySignature,m=d?n:i,u=l.members.length;if(u>m)return!1;if(r.length>0&&l.parent.type===V.AST_NODE_TYPES.TSTypeAliasDeclaration){let c=l.parent.id.name;if(r.some(g=>c.endsWith(g)))return!1}if(u===1){let c=l.members[0];return!c||c.type===V.AST_NODE_TYPES.TSPropertySignature&&c.typeAnnotation?.typeAnnotation.type===V.AST_NODE_TYPES.TSTypeLiteral?!1:{text:o.getText(c),isNested:d,propsSize:1}}if(l.parent.type===V.AST_NODE_TYPES.TSIntersectionType||l.parent.type===V.AST_NODE_TYPES.TSUnionType&&l.parent.types[0]!==l)return!1;let f=[];for(let c of l.members){if(c.type!==V.AST_NODE_TYPES.TSPropertySignature)return!1;let g=c.typeAnnotation?.typeAnnotation;if(!g||g.type===V.AST_NODE_TYPES.TSTypeLiteral||!Dn(g))return!1;if(g.type===V.AST_NODE_TYPES.TSTypeReference&&g.typeArguments){if(g.typeArguments.params.length>1)return!1;let y=g.typeArguments.params[0];if(!y||!Dn(y))return!1}let T=o.getText(c).trim();(T.endsWith(";")||T.endsWith(","))&&(T=T.slice(0,-1)),f.push(T)}return{text:f.join("; "),isNested:d,propsSize:u}}}function p(l){if(l.loc.start.line===l.loc.end.line)return;if(l.parent.type!==V.AST_NODE_TYPES.JSXExpressionContainer){let g=0,T=!1,y=o.getTokenAfter(l,{filter:A=>A.type!==V.AST_TOKEN_TYPES.Punctuator||T?!0:A.value===","?(g++,!1):A.value===";"?(g++,T=!0,!1):A.value===")"||A.value==="}"?(g++,!1):!0});if(g>4)return;let C=y?.type===V.AST_TOKEN_TYPES.Template&&y.value.startsWith(`}
2
+ `);if(y?.loc.start.line===l.loc.end.line&&!C)return}let d=a(l);if(!d)return;let m=d.text;if(m.includes(`
3
+ `)||o.getCommentsInside(l).length>0)return;m.endsWith(";")&&(m=m.slice(0,-1));let u=`{ ${m} }`,f=Yr(o,l),c=d.isNested&&d.propsSize>2?s:t.maxLineLength;c&&u.length+f.length+Br(l,o)>c||e.report({node:l,messageId:"singleLineProp",fix:g=>g.replaceText(l,u)})}return{TSTypeLiteral:p,ObjectExpression:p}}});function Dn(e){return e.type===V.AST_NODE_TYPES.TSLiteralType||e.type===V.AST_NODE_TYPES.TSTypeReference||e.type===V.AST_NODE_TYPES.TSNumberKeyword||e.type===V.AST_NODE_TYPES.TSStringKeyword||e.type===V.AST_NODE_TYPES.TSBooleanKeyword||e.type===V.AST_NODE_TYPES.TSNullKeyword||e.type===V.AST_NODE_TYPES.TSUndefinedKeyword}function xt(e,t){return!!(e.type===V.AST_NODE_TYPES.Literal||e.type===V.AST_NODE_TYPES.Identifier||e.type===V.AST_NODE_TYPES.TemplateLiteral||e.type===V.AST_NODE_TYPES.TaggedTemplateExpression||!t&&e.type===V.AST_NODE_TYPES.ArrayExpression&&e.elements.every(o=>o&&xt(o,!0)))}function Br(e,t){let o=t.getLastToken(e);if(!o)return 0;let r=t.text.indexOf(`
4
+ `,o.range[1]);return(r!==-1?r:t.text.length)-o.range[1]}function Yr(e,t){return e.text.slice(t.range[0]-t.loc.start.column,t.range[0])}var ht={name:vn,rule:Wr};var Ge=require("@typescript-eslint/utils"),$e=require("zod/v4");var qr=$e.z.object({functions:$e.z.array($e.z.string().or($e.z.object({name:$e.z.string(),message:$e.z.string()})))});function Zr(e){if(e.type===Ge.AST_NODE_TYPES.Identifier)return e.name;if(e.type===Ge.AST_NODE_TYPES.MemberExpression&&e.property.type===Ge.AST_NODE_TYPES.Identifier&&e.object.type===Ge.AST_NODE_TYPES.Identifier)return`${e.object.name}.${e.property.name}`}var bt=v({name:"no-call-with-explicit-generics",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)",noExplicitGenericsCustom:"{{ message }}"},schema:[k(qr)]},defaultOptions:[{functions:[]}],create(e,[t]){let o=new Map,r=new Map;for(let s of t.functions){let n=typeof s=="string"?s:s.name,a=typeof s=="string"?void 0:s.message;n.startsWith("*.")?r.set(n.slice(2),a):o.set(n,a)}function i(s){if(o.has(s))return{message:o.get(s)};let n=s.indexOf(".");if(n!==-1){let a=s.slice(n+1);if(r.has(a))return{message:r.get(a)}}}return{CallExpression(s){let n=Zr(s.callee);if(!n||!s.typeArguments)return;let a=i(n);a&&(a.message?e.report({node:s,messageId:"noExplicitGenericsCustom",data:{message:a.message}}):e.report({node:s,messageId:"noExplicitGenerics",data:{functionName:n}}))}}}});var Te=require("@typescript-eslint/utils"),Gr=Te.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),kn="no-call-with-inferred-generics",Hr=Gr({name:kn,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",typeOfUsedInGenerics:"Function '{{ functionName }}' should not be called with 'typeof' in generics",unknownUsedInGenerics:"Function '{{ functionName }}' should not be called with 'unknown' 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"}},disallowTypeOf:{type:"boolean"},disallowUnknown:{type:"boolean"}},required:["name"]}},anyAliases:{type:"array",items:{type:"string"}}},required:["functions"]}]},defaultOptions:[{functions:[]}],create(e,[t]){let o=new Map(t.functions.map(s=>[s.name,s])),r=t.functions.some(s=>s.disallowTypeOf),i=new Set;return{...r&&{TSTypeAliasDeclaration(s){s.typeAnnotation.type===Te.AST_NODE_TYPES.TSTypeQuery&&i.add(s.id.name)}},CallExpression(s){let{callee:n}=s;if(n.type!==Te.AST_NODE_TYPES.Identifier)return;let a=o.get(n.name);if(!a)return;let{minGenerics:p=1,allowAny:l,disallowTypes:d=t.disallowTypes,disallowTypeOf:m,disallowUnknown:u}=a;(s.typeArguments?.params.length||0)<(p||0)&&e.report({node:s,messageId:"missingGenericDeclaration",data:{functionName:n.name,minGenerics:p||0}}),!(l&&!d)&&(s.typeArguments?.params.some(c=>!l&&c.type===Te.AST_NODE_TYPES.TSAnyKeyword||d&&c.type===Te.AST_NODE_TYPES.TSTypeReference&&c.typeName.type===Te.AST_NODE_TYPES.Identifier&&d.includes(c.typeName.name))&&e.report({node:s,messageId:"anyUsedInGenerics",data:{functionName:n.name}}),u&&s.typeArguments?.params.some(c=>c.type===Te.AST_NODE_TYPES.TSUnknownKeyword)&&e.report({node:s,messageId:"unknownUsedInGenerics",data:{functionName:n.name}}),m&&s.typeArguments?.params.some(c=>c.type===Te.AST_NODE_TYPES.TSTypeQuery||c.type===Te.AST_NODE_TYPES.TSTypeReference&&c.typeName.type===Te.AST_NODE_TYPES.Identifier&&i.has(c.typeName.name))&&e.report({node:s,messageId:"typeOfUsedInGenerics",data:{functionName:n.name}}))}}}}),Ct={name:kn,rule:Hr};var Ln=require("@typescript-eslint/utils"),Kr=Ln.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),_n="no-commented-out-code",Qr=["function ","class ","interface ","enum ","namespace ","import ","export ","const ","let ","var ","return ","throw ","try {","catch (","finally {","async ","await ","case ","switch (","while (","for (","default:"],eo=/^\s*return\s+/,to=/^\s*type\s+[\p{ID_Start}$_][\p{ID_Continue}$\u200C\u200D]*\s*(?:=|<)/u,no=/^\s*(?:break|continue)(?:;|\s+[A-Za-z_$][\w$]*;?)?\s*$/,ro=/\w=("|'|`)/,oo=/\w+:\s*('|"|`)/,io=/\[['"][^'"]*['"]\]:\s*('|"|`|[^'"`\s])/,so=/\w+-\w+:/,ao=/\w+_\w+:/,po=/\?\s+\w/,lo=/:\s+\w/,co=/^\s*('|"|`)[^'"]*('|"|`),?\s*$/,uo=/^\s*\d+[,}]/,fo=/^\s*\[[^\]]*\][,}]/,mo=/^\s*\{[^}]*\}[,}]/,yo=/\.\w+\(/,go=/\[\w+\]/,So=/^\s*(['"`]).+?\1\s*:/,To=/^<[A-Z]\w*(\s|>|\/)/,Eo=/^<[a-z]+(\s|>|\/)/,xo=/<[A-Z]\w*(\s.*)?>/,ho=/<\/[A-Z]\w*>/,bo=/<[a-z]+(\s.*)?>/,Co=/<\/[a-z]+>/,Ao=/^\s*[*\s]*$/,Io=/^[a-zA-Z]/,Po=/^[A-Z][A-Za-z]*(?:\s+\d+)?(?:\s+[a-z]+)*:\s+[A-Za-z]/,No=/^[a-z][A-Za-z0-9_/-]*:\s+[A-Za-z][\w'-]*(?:\s+[A-Za-z][\w'-]*){2,}/,Ro=/\s\([A-Za-z][\w\s,.'/-]*\)/g,wo=/```[\s\S]*?```/g,Fo=/`[^`]*`/g,jn=/[a-zA-Z0-9]/,Oo=/\.[A-Za-z_][A-Za-z0-9_]*\(/,Do=/[{}[\]()`=<>]/,vo=/:\s*(['"`[{(]|\w+\s*=>)/,ko=/\bif\s*\(|\belse\b|=>/,re={returnStatement:eo,typeAliasDeclaration:to,stringAssignment:ro,objectPropertyWithQuotes:oo,computedPropertyAssignment:io,kebabCaseProperty:so,snakeCaseProperty:ao,ternaryOperator:po,colonWithWord:lo,quotedString:co,numberWithComma:uo,arrayWithComma:fo,objectWithComma:mo,methodCall:yo,arrayAccess:go,quotedPropertyKey:So,jsxSelfClosing:To,jsxElement:Eo,jsxOpeningTag:xo,jsxClosingTag:ho,htmlOpeningTag:bo,htmlClosingTag:Co,jsdocComment:Ao};function jo(e){if(e.includes(":")){let r=e.split(":")[0]?.trim();if(r&&Io.test(r)&&r.includes(" "))return!0}let t=e.trim();if(t.length===0||Oo.test(t))return!1;let o=t.includes("(")?t.replace(Ro,""):t;return Do.test(o)||vo.test(t)||ko.test(t)?!1:!!(t.includes(":")&&(Po.test(t)||No.test(t)))}var Mo=[") {","return;",re.returnStatement,re.typeAliasDeclaration,no,"if (","else {","else if (","/>","</","< ","},",": {"," } = ","={",re.stringAssignment,");",re.objectPropertyWithQuotes,re.computedPropertyAssignment,re.kebabCaseProperty,re.snakeCaseProperty,"&&","||","()",re.ternaryOperator,re.colonWithWord,re.quotedString,re.numberWithComma,re.arrayWithComma,re.objectWithComma,re.methodCall,re.arrayAccess,"?.(","??","=>",re.quotedPropertyKey],Lo=["/>","</",re.jsxSelfClosing,re.jsxElement,re.jsxOpeningTag,re.jsxClosingTag,re.htmlOpeningTag,re.htmlClosingTag],Mn=["INFO:","TODO:","DOCS:","FIX:","FIXME:","HACK:","NOTE:","WARNING:","WARN:","BUG:","ISSUE:","TEMP:","TEMPORARY:","XXX:","REVIEW:","eslint","cspell:","spell-checker:"],_o=Kr({name:_n,meta:{type:"problem",docs:{description:"Disallow commented code"},messages:{commentedOutCode:"Commented code is not allowed. Detected pattern: `{{ wrongPattern }}` Use a comment starting with one of these prefixes if you want to keep this code commented out: {{ allowedPrefixes }}"},schema:[]},defaultOptions:[],create(e){function t(r,i){if(r.startsWith("/"))return!1;let s=r.trimStart();if(r.startsWith("*")||s.startsWith("eslint-disable")||r.includes("@deprecated")||r.includes("@example")||r.includes("@param")||r.includes("@returns")||r.includes("@throws")||r.includes("typescript-eslint")||r.includes("@ts-")||r.includes("prettier-ignore")||re.jsdocComment.test(r))return!1;for(let n of Mn)if(s.startsWith(n))return!1;if(r.includes("https://")||jo(s))return!1;if(i==="Block"){for(let n of Lo)if(typeof n=="string"){if(r.includes(n))return{wrongPattern:n}}else if(n.test(r))return{wrongPattern:`regex(${n.toString()})`};return!1}for(let n of Qr)if(s.startsWith(n))return{wrongPattern:n};for(let n of Mo)if(typeof n=="string"){if(r.includes(n))return{wrongPattern:n}}else if(n.test(r))return{wrongPattern:`regex(${n.toString()})`};return!1}function o(r,i){let s=r,n=s.trim();if(n.startsWith("`")&&(n.endsWith("`,")||n.endsWith("`;")||n.endsWith("`")))return s;if(i==="Block"&&s.includes("```")){let l=s.split(wo);l.some(m=>jn.test(m))&&(s=l.join(""))}if(!s.includes("`"))return s;let a=s.split(Fo);return a.some(l=>jn.test(l))?a.join(""):s}return{Program(){let i=e.sourceCode.getAllComments();for(let s of i){let n=o(s.value,s.type),a=t(n,s.type);a&&e.report({node:s,messageId:"commentedOutCode",data:{wrongPattern:a.wrongPattern,allowedPrefixes:Mn.join(", ")}})}}}}}),At={name:_n,rule:_o};var ot=require("@typescript-eslint/utils"),$o=ot.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),$n="no-default-export",zo=$o({name:$n,meta:{type:"problem",docs:{description:"Disallow default exports"},schema:[],messages:{noDefaultExport:"Default exports are not allowed, use named exports instead."}},defaultOptions:[],create(e){return{ExportDefaultDeclaration(t){e.report({node:t,messageId:"noDefaultExport"})},ExportNamedDeclaration(t){for(let o of t.specifiers)o.exported.type===ot.TSESTree.AST_NODE_TYPES.Identifier&&o.exported.name==="default"&&e.report({node:t,messageId:"noDefaultExport"})}}}}),It={name:$n,rule:zo};var zn=require("@typescript-eslint/utils"),Uo=zn.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),Un="no-leaked-text-in-jsx",Jo=[",",";","[","]","(",")"],Vo=Uo({name:Un,meta:{type:"problem",docs:{description:"Prevents leaking of text in JSX that should be wrapped in an expression container"},messages:{leakedTextInJSX:'Text "{{ text }}" should be wrapped in a JSX expression container.'},schema:[],fixable:"code"},defaultOptions:[],create(e){return{JSXText(t){let o=t.value.trim();if(!o)return;let r="";Jo.includes(o)?r=o:o.includes("&&")?r="&&":o.includes("||")?r="||":o.endsWith("? (")&&(r="? ("),r&&e.report({node:t,messageId:"leakedTextInJSX",data:{text:r}})}}}}),Pt={name:Un,rule:Vo};var ve=require("@typescript-eslint/utils"),Xo=ve.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),Vn="no-non-camel-case-functions",Wo=/^(\$?[a-z][a-zA-Z0-9]*)$/;function Jn(e){if(e.typeName.type!==ve.AST_NODE_TYPES.TSQualifiedName)return!1;let{left:t,right:o}=e.typeName;return t.type===ve.AST_NODE_TYPES.Identifier&&t.name==="JSX"&&o.name==="Element"}var Bo=Xo({name:Vn,meta:{type:"suggestion",docs:{description:"Enforce camelCase naming convention for function declarations"},schema:[],messages:{nonCamelCaseFunction:'Function name "{{functionName}}" should be in camelCase format. If this fn is a React component and can\'t use the `FC` type, add a explicit "JSX.Element" return type to it'}},defaultOptions:[],create(e){return{FunctionDeclaration(t){if(t.id&&!Wo.test(t.id.name)){let o=t.returnType?.typeAnnotation;if(o&&(o.type===ve.AST_NODE_TYPES.TSTypeReference?Jn(o):o.type===ve.AST_NODE_TYPES.TSUnionType&&o.types.some(i=>i.type===ve.AST_NODE_TYPES.TSTypeReference&&Jn(i))))return;e.report({node:t.id,messageId:"nonCamelCaseFunction",data:{functionName:t.id.name}})}}}}}),Nt={name:Vn,rule:Bo};var G=require("@typescript-eslint/utils");var Rt=require("@typescript-eslint/utils");function Ve(e,t,o=1/0){if(o!==0&&e.parent)return e.type===t?e:Ve(e.parent,t,o===1/0?o:o-1)}function*wt(e){yield e,e.parent&&(yield*wt(e.parent))}function Ft(e,t){for(let o of e){let r=t(o);if(r!=null&&r!==!1)return r}}function Wn(e,t,o){let i=o.getDeclaredVariables(e).find(s=>s.name===t||s.identifiers[0]?.parent.type===Rt.AST_NODE_TYPES.Property&&s.identifiers[0].parent.key.type===Rt.AST_NODE_TYPES.Identifier&&s.identifiers[0].parent.key.name===t);return i?i.references.filter(s=>!s.init):[]}function Xn(e){return e===null||typeof e!="object"||!("type"in e)?!1:typeof e.type=="string"}function Yo(e,t){return e[t]}function Re(e,t,o){let r=o.visitorKeys,i=new Set;function s(n){if(i.has(n))return!1;if(i.add(n),t(n)===!0)return!0;let p=r[n.type];if(p)for(let l of p){let d=Yo(n,l);if(d){if(Array.isArray(d)){for(let m of d)if(Xn(m)&&s(m))return!0}else if(Xn(d)&&s(d))return!0}}return!1}s(e)}var qo=G.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),Bn="no-optional-root-props",Zo=qo({name:Bn,meta:{type:"problem",docs:{description:"Prevents usage of optional properties at the root of a type if that type is a local type alias or interface referenced only once"},messages:{optionalNotAllowed:'Optional property "{{ propertyName }}" is not allowed on a local type used only once. Use `prop: undefined | ...` instead.',suggestion:"Use `prop: undefined | ...` instead."},hasSuggestions:!0,schema:[]},defaultOptions:[],create(e){function t(r){let s=e.sourceCode.getDeclaredVariables(r)[0];if(!s||s.references.length!==1)return!1;let n=s.references[0];if(!n)return!1;for(let a of wt(n.identifier)){if("returnType"in a||a.type===G.TSESTree.AST_NODE_TYPES.ExportNamedDeclaration)return!1;let p=a.parent;if(!p)return!1;if(p.type===G.TSESTree.AST_NODE_TYPES.TSTypeParameterInstantiation&&p.parent.type===G.TSESTree.AST_NODE_TYPES.TSTypeReference&&p.parent.typeName.type===G.TSESTree.AST_NODE_TYPES.Identifier&&p.parent.typeName.name==="FC"){let d=Ve(p.parent.parent,G.TSESTree.AST_NODE_TYPES.VariableDeclaration,4);if(!d)return!1;let m=it(d,e.sourceCode);return m?!(m.parent.type===G.TSESTree.AST_NODE_TYPES.CallExpression&&m.parent.callee.type===G.TSESTree.AST_NODE_TYPES.Identifier&&m.parent.callee.name==="memo"):!1}if(a.type===G.TSESTree.AST_NODE_TYPES.AssignmentPattern)return!1;if(p.type===G.TSESTree.AST_NODE_TYPES.ArrowFunctionExpression){let l=Ve(p,G.TSESTree.AST_NODE_TYPES.VariableDeclaration);return l?!!it(l,e.sourceCode):!1}if(p.type===G.TSESTree.AST_NODE_TYPES.FunctionDeclaration)return!!it(p,e.sourceCode)}return!1}function o(r){r.key.type!==G.TSESTree.AST_NODE_TYPES.Identifier||!r.optional||e.report({node:r.key,messageId:"optionalNotAllowed",data:{propertyName:r.key.name},suggest:[{messageId:"suggestion",fix:i=>{let s=Ve(r,G.TSESTree.AST_NODE_TYPES.TSPropertySignature);if(!s)return null;let n=e.sourceCode.getText(s);return i.replaceText(s,n.replace("?:",": undefined |"))}}]})}return{TSTypeAliasDeclaration(r){if(r.typeAnnotation.type===G.TSESTree.AST_NODE_TYPES.TSTypeLiteral&&!(st(r)||!t(r)))for(let i of r.typeAnnotation.members)i.type===G.TSESTree.AST_NODE_TYPES.TSPropertySignature&&o(i)},TSInterfaceDeclaration(r){if(!(st(r)||!t(r)))for(let i of r.body.body)i.type===G.TSESTree.AST_NODE_TYPES.TSPropertySignature&&o(i)},TSTypeReference(r){if(r.typeName.type!==G.TSESTree.AST_NODE_TYPES.Identifier||r.typeName.name!=="FC"||!r.typeArguments?.params[0])return;let i=r.typeArguments.params[0];if(i.type!==G.TSESTree.AST_NODE_TYPES.TSTypeLiteral)return;let s=Ve(r.parent,G.TSESTree.AST_NODE_TYPES.VariableDeclaration,4);if(!s)return;let n=it(s,e.sourceCode);if(!(!n||n.parent.type===G.TSESTree.AST_NODE_TYPES.CallExpression&&n.parent.callee.type===G.TSESTree.AST_NODE_TYPES.Identifier&&n.parent.callee.name==="memo"))for(let p of i.members)p.type===G.TSESTree.AST_NODE_TYPES.TSPropertySignature&&o(p)}}}});function st(e){return e?e.parent?.type===G.TSESTree.AST_NODE_TYPES.ExportNamedDeclaration||e.parent?.type===G.TSESTree.AST_NODE_TYPES.ExportDefaultDeclaration:!1}function it(e,t){if(st(e))return;let o;if(e.type===G.TSESTree.AST_NODE_TYPES.VariableDeclaration){if(e.declarations.length!==1)return;e.declarations[0].id.type===G.TSESTree.AST_NODE_TYPES.Identifier&&(o=e.declarations[0].id)}else{if(!e.id)return;o=e.id}if(!o)return;let r=t.getScope(e);e.type===G.TSESTree.AST_NODE_TYPES.FunctionDeclaration&&r.upper&&(r=r.upper);let i=r.variables.find(n=>n.identifiers.includes(o));if(!i)return;let s=i.references.filter(n=>n.identifier!==o);if(!(s.length!==1||!s[0])&&!st(s[0].identifier.parent.parent))return s[0].identifier}var Ot={name:Bn,rule:Zo};var ke=require("@typescript-eslint/utils");var He=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 t=new Set;function o(i){return i?i.type===ke.AST_NODE_TYPES.Identifier?t.has(i.name):i.type===ke.AST_NODE_TYPES.MemberExpression?o(i.object):!1:!1}function r(i){return i.type!==ke.AST_NODE_TYPES.TSTypeReference||i.typeArguments?!1:i.typeName.type===ke.AST_NODE_TYPES.Identifier&&t.has(i.typeName.name)}return{ImportDeclaration(i){for(let s of i.specifiers)t.add(s.local.name)},ExportNamedDeclaration(i){if(i.source){e.report({node:i,messageId:"noReexport"});return}if(i.declaration?.type===ke.AST_NODE_TYPES.VariableDeclaration)for(let s of i.declaration.declarations)o(s.init)&&e.report({node:i,messageId:"noReexport"});i.declaration?.type===ke.AST_NODE_TYPES.TSTypeAliasDeclaration&&r(i.declaration.typeAnnotation)&&e.report({node:i,messageId:"noReexport"}),i.specifiers.length>0&&e.report({node:i,messageId:"noReexport"})},ExportDefaultDeclaration(i){i.declaration.type===ke.AST_NODE_TYPES.Identifier&&t.has(i.declaration.name)&&e.report({node:i,messageId:"noReexport"})},ExportAllDeclaration(i){e.report({node:i,messageId:"noReexport"})}}}});var Yn=require("@typescript-eslint/utils"),at=Oe(require("path")),we=require("zod/v4");var Go=Yn.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),qn="no-relative-imports",Ho=we.z.object({find:we.z.string(),replacement:we.z.string()}),Ko=we.z.object({aliases:we.z.array(Ho),rootDir:we.z.string().optional(),allowNotFoundAliases:we.z.boolean().optional(),_dev_simulateFileName:we.z.string().optional()}),Qo=Go({name:qn,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:[k(Ko)]},defaultOptions:[{aliases:[],rootDir:void 0}],create(e,[t]){let o=t._dev_simulateFileName??e.filename;function r(n){return n.startsWith(".")||n.startsWith("..")}function i(n,a){let p=at.default.dirname(a);return at.default.resolve(p,n)}function s(n){let a=t.rootDir??process.cwd(),p=at.default.relative(a,n);if(p.startsWith("."))return null;p.startsWith("/")||(p=`/${p}`);for(let{find:l,replacement:d}of t.aliases)if(p.startsWith(d)){let m=p.replace(d,l);return{alias:l,newPath:m}}return null}return{ImportDeclaration(n){let a=n.source.value;if(!r(a))return;let p=i(a,o),l=s(p);!l&&t.allowNotFoundAliases||e.report({node:n,messageId:l?"noRelativeImportsWithAlias":"noRelativeImports",data:{alias:l?.alias},fix:l?d=>d.replaceText(n.source,`'${l.newPath}'`):void 0})}}}}),Dt={name:qn,rule:Qo};var oe=require("@typescript-eslint/utils"),vt=require("zod/v4");var ei=vt.z.object({customMessage:vt.z.string().optional()}),kt=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:[k(ei)],messages:{noStaticStyleProp:"Static style props are not allowed use css instead.{{customMessage}}"}},defaultOptions:[{}],create(e,[t]){function o(r){switch(r.type){case oe.AST_NODE_TYPES.Literal:return!0;case oe.AST_NODE_TYPES.ObjectExpression:return r.properties.every(i=>i.type===oe.AST_NODE_TYPES.Property?i.computed||i.value.type===oe.AST_NODE_TYPES.Identifier&&i.key.type===oe.AST_NODE_TYPES.Identifier&&i.key.name===i.value.name?!1:o(i.value):!1);case oe.AST_NODE_TYPES.ArrayExpression:return r.elements.every(i=>i?i.type===oe.AST_NODE_TYPES.SpreadElement?!1:o(i):!0);case oe.AST_NODE_TYPES.TemplateLiteral:return r.expressions.length===0;case oe.AST_NODE_TYPES.ConditionalExpression:case oe.AST_NODE_TYPES.LogicalExpression:case oe.AST_NODE_TYPES.BinaryExpression:case oe.AST_NODE_TYPES.UnaryExpression:case oe.AST_NODE_TYPES.CallExpression:case oe.AST_NODE_TYPES.MemberExpression:case oe.AST_NODE_TYPES.Identifier:case oe.AST_NODE_TYPES.ArrowFunctionExpression:case oe.AST_NODE_TYPES.FunctionExpression:return!1;default:return!1}}return{JSXAttribute(r){if(r.name.type===oe.AST_NODE_TYPES.JSXIdentifier&&r.name.name==="style"&&r.value){let i=null;r.value.type===oe.AST_NODE_TYPES.JSXExpressionContainer?r.value.expression.type!==oe.AST_NODE_TYPES.JSXEmptyExpression&&(i=r.value.expression):r.value.type===oe.AST_NODE_TYPES.Literal&&(i=r.value),i&&o(i)&&e.report({node:r,messageId:"noStaticStyleProp",data:{customMessage:t.customMessage?` ${t.customMessage}`:""}})}}}}});var Ke=require("@typescript-eslint/utils"),ze=Oe(require("zod/v4"));var ti=ze.object({alternativeMsgs:ze.object({inArrayFind:ze.string().optional(),inArrayFilter:ze.string().optional()}).optional(),__dev_simulateFileName:ze.string().optional()});function ni(e){return e.typeAnnotation.type!==Ke.AST_NODE_TYPES.TSTypePredicate?!1:e.typeAnnotation.asserts===!1}var ri=/(typeGuards|type-guards)\.(ts|tsx)$/;function oi(e){return ri.test(e)}function ii(e){let t=e.parent;for(;t;){if(t.type===Ke.AST_NODE_TYPES.CallExpression&&t.callee.type===Ke.AST_NODE_TYPES.MemberExpression&&t.callee.property.type===Ke.AST_NODE_TYPES.Identifier){let o=t.callee.property.name;if(o==="filter"||o==="find")return{method:o}}t=t.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:[k(ti)],hasSuggestions:!0},defaultOptions:[{}],create(e,[t]){let o=t.__dev_simulateFileName??e.filename;if(oi(o))return{};function r(i){if(!ni(i))return;let s=ii(i);if(t.alternativeMsgs&&s){let n=s.method==="filter"?t.alternativeMsgs.inArrayFilter:t.alternativeMsgs.inArrayFind;if(n){let a=s.method==="filter"?"useFilterWithTypeCheck":"useFindWithTypeCheck";e.report({node:i,messageId:a,data:{message:n}});return}}e.report({node:i,messageId:"typeGuardNotAllowed"})}return{"FunctionDeclaration > :matches(TSTypeAnnotation)":r,"ArrowFunctionExpression > :matches(TSTypeAnnotation)":r,"MethodDefinition > FunctionExpression > :matches(TSTypeAnnotation)":r}}});var Ue=require("@typescript-eslint/utils");var si="no-unnecessary-async-on-jsx-props";function ai(e){if(e.body.type!==Ue.AST_NODE_TYPES.BlockStatement)return!1;let t=e.body.body;if(t.length!==1)return!1;let o=t[0];return!o||o.type!==Ue.AST_NODE_TYPES.ExpressionStatement?!1:o.expression.type===Ue.AST_NODE_TYPES.AwaitExpression}var Mt=v({name:si,meta:{type:"suggestion",fixable:"code",docs:{description:"Disallow unnecessary async/await in JSX props where a single await provides no benefit"},messages:{unnecessaryAsyncInJsxProp:"Unnecessary async/await in JSX prop. The single await expression provides no benefit here."},schema:[]},defaultOptions:[],create(e){function t(o){ai(o)&&e.report({node:o,messageId:"unnecessaryAsyncInJsxProp",fix(r){let i=e.sourceCode,s=[],n=i.getFirstToken(o,p=>p.value==="async");if(n){let p=i.getTokenAfter(n);p?s.push(r.replaceTextRange([n.range[0],p.range[0]],"")):s.push(r.remove(n))}function a(p){if(p.type===Ue.AST_NODE_TYPES.AwaitExpression){let l=i.getFirstToken(p);if(l&&l.value==="await"){let d=i.getTokenAfter(l);d?s.push(r.replaceTextRange([l.range[0],d.range[0]],"")):s.push(r.remove(l))}}if(p.type===Ue.AST_NODE_TYPES.BlockStatement)for(let l of p.body)a(l);else p.type===Ue.AST_NODE_TYPES.ExpressionStatement&&a(p.expression)}return a(o.body),s}})}return{"JSXAttribute ArrowFunctionExpression[async=true]":t,"JSXAttribute FunctionExpression[async=true]":t}}});var ye=require("@typescript-eslint/utils"),pt=Oe(require("zod/v4"));var pi=pt.object({ignoreWithDescription:pt.string().optional()}),Lt=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:[k(pi)]},defaultOptions:[{}],create(e,[t]){let o=e.getSourceCode(),r=o.ast;function i(p){let l=p.arguments[0];return l&&l.type===ye.AST_NODE_TYPES.Literal&&typeof l.value=="string"?l.value:null}function s(p){return!p||!t.ignoreWithDescription?!1:new RegExp(t.ignoreWithDescription).test(p)}function n(p){return p.length!==1?!1:r.body.filter(d=>{if(d.type===ye.AST_NODE_TYPES.ExpressionStatement){let m=d.expression;if(m.type===ye.AST_NODE_TYPES.CallExpression&&m.callee.type===ye.AST_NODE_TYPES.Identifier){let u=m.callee.name;return["test","it","beforeEach","afterEach","beforeAll","afterAll"].includes(u)}}return!1}).length===0}function a(p){let l=p.arguments[1];if(l&&(l.type===ye.AST_NODE_TYPES.FunctionExpression||l.type===ye.AST_NODE_TYPES.ArrowFunctionExpression)&&l.body.type===ye.AST_NODE_TYPES.BlockStatement){let d=l.body.body;return d.length===0?"":d.map(u=>o.text.slice(u.range[0],u.range[1])).join(`
5
+
6
+ `)}return""}return{Program(){let p=[];for(let u of r.body)u.type===ye.AST_NODE_TYPES.ExpressionStatement&&u.expression.type===ye.AST_NODE_TYPES.CallExpression&&u.expression.callee.type===ye.AST_NODE_TYPES.Identifier&&u.expression.callee.name==="describe"&&u.expression.arguments.length===2&&p.push(u.expression);if(!n(p))return;let[l]=p;if(!l)return;let d=i(l);if(s(d))return;let m=r.body.find(u=>u.type===ye.AST_NODE_TYPES.ExpressionStatement&&u.expression===l);!m||m.type!==ye.AST_NODE_TYPES.ExpressionStatement||e.report({node:l,messageId:"unnecessaryDescribe",suggest:[{messageId:"removeDescribe",fix(u){let f=a(l);return f?u.replaceText(m,f):null}}]})}}}});var Qe=require("@typescript-eslint/utils"),Ce=Oe(require("zod/v4"));var li=Ce.object({methods:Ce.union([Ce.array(Ce.string()),Ce.literal("array")])}),_t=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:[k(li)]},defaultOptions:[{methods:"array"}],create(e,[t]){let o=t.methods,r=new Set(["find","filter","map","forEach","some","every","reduce","findIndex","sort"]);function i(a){return Array.isArray(o)?o.includes(a):r.has(a)}function s(a){let{callee:p}=a;if(p.type===Qe.AST_NODE_TYPES.MemberExpression){let l=p.property;if(l.type===Qe.AST_NODE_TYPES.Identifier)return l.name}return null}function n(a,p){if(a.type!==Qe.AST_NODE_TYPES.Identifier||!a.typeAnnotation)return;let l=p.parent;if(l.type===Qe.AST_NODE_TYPES.CallExpression){let d=s(l);d&&i(d)&&l.arguments.indexOf(p)===0&&e.report({node:a.typeAnnotation,messageId:"unnecessaryTypeAnnotation",fix(u){return a.typeAnnotation?u.remove(a.typeAnnotation):null}})}}return{ArrowFunctionExpression(a){for(let p of a.params)n(p,a)},FunctionExpression(a){for(let p of a.params)n(p,a)}}}});var me=require("@typescript-eslint/utils");var $t=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(t){if(t.id.type===me.AST_NODE_TYPES.ObjectPattern||!t.init||t.init.type!==me.AST_NODE_TYPES.ObjectExpression||t.id.type===me.AST_NODE_TYPES.Identifier&&t.id.typeAnnotation||t.parent.parent.type===me.AST_NODE_TYPES.ExportNamedDeclaration)return;let o=new Map;for(let n of t.init.properties)n.type===me.AST_NODE_TYPES.Property&&n.key.type===me.AST_NODE_TYPES.Identifier&&o.set(n.key.name,n);if(o.size===0||t.id.type!==me.AST_NODE_TYPES.Identifier)return;let r=ci(t,e.sourceCode);if(r.length===0)return;let i=t.init.properties.some(n=>n.type!==me.AST_NODE_TYPES.Property?!1:n.value.type===me.AST_NODE_TYPES.FunctionExpression),s=new Set;for(let n of r){if(n.identifier.parent.type!==me.AST_NODE_TYPES.MemberExpression)return;let a=n.identifier.parent;if(a.object!==n.identifier)return;if(a.computed)if(a.property.type===me.AST_NODE_TYPES.Literal&&typeof a.property.value=="string")s.add(a.property.value);else return;else{if(a.property.type!==me.AST_NODE_TYPES.Identifier)return;s.add(a.property.name)}if(a.parent.type===me.AST_NODE_TYPES.CallExpression&&i)return}for(let[n,a]of o)s.has(n)||e.report({node:a,messageId:"unusedObjectProperty",data:{name:n}})}}}});function ci(e,t){let o=t.getDeclaredVariables(e);if(o.length!==1)return[];let r=o[0];return r?r.references.filter(i=>i.identifier!==e.id):[]}var $=require("@typescript-eslint/utils"),zt=require("zod/v4");var ui=zt.z.object({ignoreArgsMatching:zt.z.string().optional()}),Ut=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:[k(ui)]},defaultOptions:[{}],create(e,[t]){let o=[];function r(n){return t.ignoreArgsMatching?new RegExp(t.ignoreArgsMatching).test(n):!1}function i(n){return n.type===$.AST_NODE_TYPES.ExportNamedDeclaration||n.type===$.AST_NODE_TYPES.ExportDefaultDeclaration||n.parent?.type===$.AST_NODE_TYPES.ExportNamedDeclaration||n.parent?.type===$.AST_NODE_TYPES.ExportDefaultDeclaration}function s(n){let a=[];for(let p=0;p<n.length;p++){let l=n[p];if(!l||l.type!==$.AST_NODE_TYPES.Identifier)continue;let d=l.name;if(!r(d)){if(l.optional&&l.typeAnnotation&&l.typeAnnotation.typeAnnotation.type===$.AST_NODE_TYPES.TSTypeLiteral){let m=l.typeAnnotation.typeAnnotation,u=[];for(let f of m.members)f.type===$.AST_NODE_TYPES.TSPropertySignature&&f.key.type===$.AST_NODE_TYPES.Identifier&&u.push({name:f.key.name,optional:f.optional===!0});u.some(f=>f.optional)?a.push({param:l,index:p,name:d,isObjectParam:!0,objectProps:u}):a.push({param:l,index:p,name:d,isObjectParam:!1})}else if(l.optional)a.push({param:l,index:p,name:d,isObjectParam:!1});else if(l.typeAnnotation&&l.typeAnnotation.typeAnnotation.type===$.AST_NODE_TYPES.TSTypeLiteral){let m=l.typeAnnotation.typeAnnotation,u=[];for(let f of m.members)f.type===$.AST_NODE_TYPES.TSPropertySignature&&f.key.type===$.AST_NODE_TYPES.Identifier&&u.push({name:f.key.name,optional:f.optional===!0});u.some(f=>f.optional)&&a.push({param:l,index:p,name:d,isObjectParam:!0,objectProps:u})}}}return a}return{FunctionDeclaration(n){if(i(n))return;let a=s(n.params);a.length!==0&&o.push({node:n,declarationNode:n,optionalParams:a})},VariableDeclarator(n){if(n.id.type!==$.AST_NODE_TYPES.Identifier||!n.init||n.init.type!==$.AST_NODE_TYPES.ArrowFunctionExpression&&n.init.type!==$.AST_NODE_TYPES.FunctionExpression||i(n.parent.parent))return;let p=[...s(n.init.params)];if(n.id.typeAnnotation&&n.id.typeAnnotation.typeAnnotation.type===$.AST_NODE_TYPES.TSTypeReference){let l=n.id.typeAnnotation.typeAnnotation;if(l.typeName.type===$.AST_NODE_TYPES.Identifier&&l.typeName.name==="FC"){let d=l.typeArguments;if(d&&d.params.length===1){let m=d.params[0];if(m&&m.type===$.AST_NODE_TYPES.TSTypeLiteral){let u=[];for(let f of m.members)f.type===$.AST_NODE_TYPES.TSPropertySignature&&f.key.type===$.AST_NODE_TYPES.Identifier&&u.push({name:f.key.name,optional:f.optional===!0});u.some(f=>f.optional)&&p.push({param:n.id,index:0,name:"props",isObjectParam:!0,objectProps:u})}}}}p.length!==0&&o.push({node:n.init,declarationNode:n,optionalParams:p})},"Program:exit"(){for(let n of o){let p=e.sourceCode.getDeclaredVariables(n.declarationNode)[0];if(!p)continue;let l=p.references.filter(u=>u.identifier!==p.identifiers[0]);if(l.length===0)continue;let d=!1;for(let u of l){let f=u.identifier.parent;if(f.type===$.AST_NODE_TYPES.CallExpression&&u.identifier.type===$.AST_NODE_TYPES.Identifier&&f.arguments.includes(u.identifier)){d=!0;break}if(f.type===$.AST_NODE_TYPES.ReturnStatement){d=!0;break}if(f.type===$.AST_NODE_TYPES.Property&&f.parent.type===$.AST_NODE_TYPES.ObjectExpression&&f.parent.parent.type===$.AST_NODE_TYPES.ReturnStatement){d=!0;break}if(f.type===$.AST_NODE_TYPES.JSXExpressionContainer){d=!0;break}}if(d)continue;let m=[];for(let u of l){let f=u.identifier.parent;if(f.type===$.AST_NODE_TYPES.CallExpression&&f.callee===u.identifier){let c=f.arguments.length,g=f.arguments.some(y=>y.type===$.AST_NODE_TYPES.SpreadElement);if(g){d=!0;break}let T={argCount:c,hasSpread:g};for(let y of n.optionalParams)if(y.isObjectParam&&y.index<c){let C=f.arguments[y.index];if(C?.type===$.AST_NODE_TYPES.ObjectExpression){let A={};for(let S of C.properties)S.type===$.AST_NODE_TYPES.Property&&S.key.type===$.AST_NODE_TYPES.Identifier&&(A[S.key.name]=!0);T.objectArgs||(T.objectArgs=[]),T.objectArgs[y.index]=A}else if(C){d=!0;break}}m.push(T)}else if(f.type===$.AST_NODE_TYPES.JSXOpeningElement&&f.name===u.identifier){let c=f.attributes.some(T=>T.type===$.AST_NODE_TYPES.JSXSpreadAttribute);if(c){d=!0;break}let g={argCount:1,hasSpread:c};for(let T of n.optionalParams)if(T.isObjectParam&&T.index===0){let y={};for(let C of f.attributes)C.type===$.AST_NODE_TYPES.JSXAttribute&&C.name.type===$.AST_NODE_TYPES.JSXIdentifier&&(y[C.name.name]=!0);g.objectArgs||(g.objectArgs=[]),g.objectArgs[0]=y}m.push(g)}}if(!(d||m.length===0))for(let u of n.optionalParams)if(u.isObjectParam&&u.objectProps)for(let f of u.objectProps){if(!f.optional)continue;let c=!1;for(let g of m)if(g.objectArgs&&g.objectArgs[u.index]){let T=g.objectArgs[u.index];if(T&&T[f.name]){c=!0;break}}c||e.report({node:u.param,messageId:"unusedOptionalProp",data:{name:f.name}})}else{let f=!1;for(let c of m)if(c.argCount>u.index){f=!0;break}f||e.report({node:u.param,messageId:"unusedOptionalArg",data:{name:u.name}})}}}}}});var H=require("@typescript-eslint/utils"),je=require("zod/v4");var fi=je.z.object({selectors:je.z.array(je.z.object({name:je.z.string(),selectorProp:je.z.string().optional(),selectorArgPos:je.z.number().optional(),returnProp:je.z.string().optional()}))}),mi=H.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),Zn="no-unused-selected-values",Jt={name:Zn,rule:mi({name:Zn,meta:{type:"suggestion",docs:{description:"Disallow unused values in selector objects"},messages:{unusedSelectedValue:'The selected value "{{name}}" is not being used'},schema:[k(fi)]},defaultOptions:[{selectors:[]}],create(e,[t]){let{selectors:o=[]}=t,r=new Map(o.map(i=>[i.name,i]));return{VariableDeclarator(i){let s=null;if(i.init?.type===H.AST_NODE_TYPES.CallExpression&&(s=i.init),!s)return;let n=yi(s);if(!n)return;let a=r.get(n);if(!a)return;let p=di(s,a.selectorArgPos??0,a.selectorProp);if(!p)return;let l=gi(p);if(!l)return;let d=Gn(l.properties,void 0);if(!d)return;if(i.id.type===H.AST_NODE_TYPES.ObjectPattern){let f=Gn(i.id.properties,a.returnProp);if(!f)return;for(let[c,g]of d)f.has(c)||e.report({node:g,messageId:"unusedSelectedValue",data:{name:c}});return}if(i.id.type!==H.AST_NODE_TYPES.Identifier||a.returnProp)return;let m=Si(i,e.sourceCode);if(m.length===0)return;let u=new Set;for(let f of m){if(f.identifier.parent.type!==H.AST_NODE_TYPES.MemberExpression)return;let c=f.identifier.parent.property;if(c.type!==H.AST_NODE_TYPES.Identifier)return;u.add(c.name)}for(let[f,c]of d)u.has(f)||e.report({node:c,messageId:"unusedSelectedValue",data:{name:f}})}}}})};function di(e,t,o){let r=e.arguments[t];if(!r)return null;if(r.type===H.AST_NODE_TYPES.ArrowFunctionExpression||r.type===H.AST_NODE_TYPES.FunctionExpression)return r;if(o&&r.type===H.AST_NODE_TYPES.ObjectExpression){let i=r.properties.find(n=>n.type===H.AST_NODE_TYPES.Property&&n.key.type===H.AST_NODE_TYPES.Identifier&&n.key.name===o);if(i?.type!==H.AST_NODE_TYPES.Property)return null;let s=i.value;if(s.type===H.AST_NODE_TYPES.ArrowFunctionExpression||s.type===H.AST_NODE_TYPES.FunctionExpression)return s}return null}function yi(e){return e.callee.type===H.AST_NODE_TYPES.Identifier?e.callee.name:e.callee.type===H.AST_NODE_TYPES.MemberExpression&&e.callee.property.type===H.AST_NODE_TYPES.Identifier?e.callee.property.name:null}function gi(e){if(e.body.type===H.AST_NODE_TYPES.ObjectExpression)return e.body;if(e.body.type===H.AST_NODE_TYPES.BlockStatement){let t=e.body.body.filter(o=>o.type===H.AST_NODE_TYPES.ReturnStatement);return t.length!==1||!t[0]||t[0].argument?.type!==H.AST_NODE_TYPES.ObjectExpression?null:t[0].argument}return null}function Gn(e,t){let o=e;if(t){let i=e.find(s=>s.type===H.AST_NODE_TYPES.Property&&s.key.type===H.AST_NODE_TYPES.Identifier&&s.key.name===t);if(i?.type!==H.AST_NODE_TYPES.Property||i.value.type!==H.AST_NODE_TYPES.ObjectPattern)return null;o=i.value.properties}let r=new Map;for(let i of o){if(i.type!==H.AST_NODE_TYPES.Property||i.key.type!==H.AST_NODE_TYPES.Identifier)return null;r.set(i.key.name,i)}return r.size>0?r:null}function Si(e,t){let o=t.getDeclaredVariables(e);if(o.length!==1)return[];let r=o[0];return r?r.references.filter(i=>i.identifier!==e.id):[]}var K=require("@typescript-eslint/utils");var Vt=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(s=>s.type===K.AST_NODE_TYPES.ImportDeclaration&&s.source.value==="t-state-form"))return{};let r=null,i=!1;return{CallExpression(s){if(i)return;if(!r){let a=Ti(s);a&&(r=a);return}let n=Ei(s,e.sourceCode);if(n){i=!0;for(let a of n)r.delete(a);if(r.size!==0)for(let[a,p]of r)e.report({node:p,messageId:"unusedField",data:{name:a}})}}}}});function Ti(e){if(!(e.callee.type===K.AST_NODE_TYPES.Identifier&&e.callee.name==="useForm"))return null;let o=e.arguments[0];if(!o||o.type!==K.AST_NODE_TYPES.ObjectExpression)return null;let r=Ft(o.properties,s=>s.type!==K.AST_NODE_TYPES.Property||s.key.type!==K.AST_NODE_TYPES.Identifier||s.key.name!=="initialConfig"?null:s.value.type===K.AST_NODE_TYPES.ObjectExpression?s.value:s.value.type===K.AST_NODE_TYPES.ArrowFunctionExpression||s.value.type===K.AST_NODE_TYPES.FunctionExpression?xi(s.value):null);if(!r)return null;let i=new Map;for(let s of r.properties)s.type===K.AST_NODE_TYPES.Property&&s.key.type===K.AST_NODE_TYPES.Identifier&&i.set(s.key.name,s);return i}function Ei(e,t){if(!(e.callee.type===K.AST_NODE_TYPES.Identifier&&e.callee.name==="useFormState")||e.parent.type!==K.AST_NODE_TYPES.VariableDeclarator||e.parent.id.type!==K.AST_NODE_TYPES.ObjectPattern||!Ft(e.parent.id.properties,n=>n.type===K.AST_NODE_TYPES.Property&&n.key.type===K.AST_NODE_TYPES.Identifier&&n.key.name==="formFields"&&n))return null;let i=Wn(e.parent,"formFields",t),s=new Set;for(let{identifier:n}of i){if(n.type!==K.AST_NODE_TYPES.Identifier||n.parent.type===K.AST_NODE_TYPES.Property&&n.parent.parent.type===K.AST_NODE_TYPES.ObjectExpression&&n.parent.parent.parent.type===K.AST_NODE_TYPES.ReturnStatement||n.parent.type===K.AST_NODE_TYPES.ReturnStatement)return null;if(n.parent.type===K.AST_NODE_TYPES.MemberExpression){if(n.parent.object.type!==K.AST_NODE_TYPES.Identifier||n.parent.property.type!==K.AST_NODE_TYPES.Identifier)return null;s.add(n.parent.property.name)}}return s}function xi(e){if(e.body.type===K.AST_NODE_TYPES.ObjectExpression)return e.body;if(e.body.type===K.AST_NODE_TYPES.BlockStatement){let t=e.body.body.filter(o=>o.type===K.AST_NODE_TYPES.ReturnStatement);return t.length!==1||!t[0]||t[0].argument?.type!==K.AST_NODE_TYPES.ObjectExpression?null:t[0].argument}return null}var W=require("@typescript-eslint/utils"),et=require("zod/v4");var hi=W.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`);function Hn(e){let t=[];for(let o of e.members)o.type===W.AST_NODE_TYPES.TSPropertySignature&&o.key.type===W.AST_NODE_TYPES.Identifier&&t.push([o.key.name,o]);return t}function Kn(e,...t){for(let o of t)e.set(...o);return e}var bi=et.z.object({forceCheckOnFCPropTypesWithName:et.z.array(et.z.string()).optional(),alwaysCheckFunctionOptionTypes:et.z.boolean().optional()}),Qn="no-unused-type-props-in-args",Xt=null,Ci=hi({name:Qn,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:[k(bi)],fixable:"code"},defaultOptions:[{alwaysCheckFunctionOptionTypes:!0}],create(e,[t]){let{forceCheckOnFCPropTypesWithName:o,alwaysCheckFunctionOptionTypes:r=!0}=t;o&&!Xt&&(Xt=o.map(p=>new RegExp(p)));function i(p,l,d,m,u=!0,f=!1){let c=d.name,g=e.sourceCode.getScope(l).references.find(S=>S.identifier.name===c)?.resolved,T=p&&Xt?.some(S=>S.test(c)),y=f&&r;if(!g||!T&&g.references.filter(S=>S.isTypeReference).length>1||!g.defs[0])return;let C=g.defs[0].node,A=C.parent?.type===W.AST_NODE_TYPES.ExportNamedDeclaration;if(!(u&&A&&!y)){if(C.type===W.AST_NODE_TYPES.TSTypeAliasDeclaration){s(p,l,m,C.typeAnnotation,!0,f);return}if(C.type===W.AST_NODE_TYPES.TSInterfaceDeclaration){s(p,l,m,C.body,!0,f);return}}}function s(p,l,d,m,u,f=!1){if(m.type===W.AST_NODE_TYPES.TSInterfaceBody){for(let c of m.body)c.type===W.AST_NODE_TYPES.TSPropertySignature&&c.key.type===W.AST_NODE_TYPES.Identifier&&d.set(c.key.name,c);return}if(m.type===W.AST_NODE_TYPES.TSTypeLiteral){Kn(d,...Hn(m));return}if(m.type===W.AST_NODE_TYPES.TSIntersectionType){for(let c of m.types)s(p,l,d,c,!0,f);return}u||m.type===W.AST_NODE_TYPES.TSTypeReference&&m.typeName.type===W.AST_NODE_TYPES.Identifier&&i(p,l,m.typeName,d,!0,f)}function n(p,l,d,m=!1){for(let u of d)if(u.type===W.AST_NODE_TYPES.ObjectPattern&&u.typeAnnotation){let f=new Map;if(s(p,l,f,u.typeAnnotation.typeAnnotation,!1,m),f.size===0)continue;a(u,f)}else u.type===W.AST_NODE_TYPES.AssignmentPattern&&u.left.type===W.AST_NODE_TYPES.ObjectPattern&&n(p,l,[u.left],m)}function a(p,l){let d=[];if(p.properties.at(-1)?.type===W.AST_NODE_TYPES.RestElement)return;for(let c of p.properties)c.type===W.AST_NODE_TYPES.Property&&c.key.type===W.AST_NODE_TYPES.Identifier&&d.push(c.key.name);let u=[],f=[];for(let[c,g]of l)d.includes(c)||(f.push(c),u.push({node:g,messageId:"unusedObjectTypeProperty",data:{propertyName:c}}));for(let[c,g]of u.entries())e.report({...g,fix:c===u.length-1?T=>{let y=p.properties.at(-1),C=f.join(", ");return y?y.type===W.AST_NODE_TYPES.RestElement?null:T.insertTextAfter(y,`, ${C}`):T.insertTextBeforeRange([p.range[0]+1,p.range[1]],C)}:void 0})}return{VariableDeclaration(p){let l=p.declarations[0],d=new Map,m=l.id.type===W.AST_NODE_TYPES.Identifier&&l.id.typeAnnotation?.typeAnnotation.type===W.AST_NODE_TYPES.TSTypeReference&&l.id.typeAnnotation.typeAnnotation.typeName.type===W.AST_NODE_TYPES.Identifier&&l.id.typeAnnotation.typeAnnotation.typeName.name==="FC"&&l.id.typeAnnotation.typeAnnotation.typeArguments?.params[0];if(m){if(m.type===W.AST_NODE_TYPES.TSTypeReference&&m.typeName.type===W.AST_NODE_TYPES.Identifier)i(!0,p,m.typeName,d,!1);else if(m.type===W.AST_NODE_TYPES.TSTypeLiteral)Kn(d,...Hn(m));else if(m.type===W.AST_NODE_TYPES.TSIntersectionType)for(let u of m.types)u.type===W.AST_NODE_TYPES.TSTypeReference&&u.typeName.type===W.AST_NODE_TYPES.Identifier?i(!0,p,u.typeName,d,!1):s(!0,p,d,u,!0);if(d.size!==0&&l.init?.type===W.AST_NODE_TYPES.ArrowFunctionExpression){let u=l.init.params[0];if(!u){e.report({node:l.init,messageId:"missingComponentParam"});return}u.type===W.AST_NODE_TYPES.ObjectPattern&&a(u,d)}}},FunctionDeclaration(p){n(!1,p,p.params,r)},ArrowFunctionExpression(p){n(!1,p,p.params,r)}}}}),Wt={name:Qn,rule:Ci};var Ee=require("@typescript-eslint/utils");var Bt=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 t=new Set;function o(r){return r.callee.type===Ee.AST_NODE_TYPES.Identifier?t.has(r.callee.name):r.callee.type===Ee.AST_NODE_TYPES.MemberExpression&&r.callee.object.type===Ee.AST_NODE_TYPES.Identifier&&r.callee.property.type===Ee.AST_NODE_TYPES.Identifier?r.callee.property.name==="useRef":!1}return{ImportDeclaration(r){if(r.source.value==="react")for(let i of r.specifiers)i.type===Ee.AST_NODE_TYPES.ImportSpecifier&&i.imported.type===Ee.AST_NODE_TYPES.Identifier&&i.imported.name==="useRef"&&t.add(i.local.name)},VariableDeclarator(r){if(r.init&&r.init.type===Ee.AST_NODE_TYPES.CallExpression&&o(r.init)&&r.id.type===Ee.AST_NODE_TYPES.Identifier){let s=e.sourceCode.getScope(r).set.get(r.id.name);if(s){let n=!1;for(let a of s.references){let l=a.identifier.parent;if(l!==r&&!(l.type===Ee.AST_NODE_TYPES.JSXExpressionContainer&&l.parent.type===Ee.AST_NODE_TYPES.JSXAttribute&&l.parent.name.type===Ee.AST_NODE_TYPES.JSXIdentifier&&l.parent.name.name==="ref")){n=!0;break}}n||e.report({node:r.id,messageId:"refNotRead",data:{name:r.id.name}})}}}}}});var Xe=require("@typescript-eslint/utils"),Ai=Xe.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),tr="prefer-named-functions",er=new Map,Ii=Ai({name:tr,meta:{hasSuggestions:!0,type:"suggestion",docs:{description:"Prevent using arrow functions when a named function can be used instead"},schema:[{type:"object",properties:{ignoreRegex:{type:"string"},disallowArrowFnWithImplicitReturns:{type:"boolean"}}}],messages:{suggestion:"Convert to named function",default:'Function {{functionName}} should be defined as a named function "function {{functionName}} () {}" instead of an arrow function',withIgnoreRegex:'Function {{functionName}} should be defined as a named function "function {{functionName}} () {}", if not possible to use `function` you can also use a name that matches the rule ignore regex'}},defaultOptions:[{}],create(e,[t]){let o=null;if(t.ignoreRegex){let r=er.get(t.ignoreRegex);r?o=r:(o=new RegExp(t.ignoreRegex),er.set(t.ignoreRegex,o))}return{VariableDeclarator(r){if(r.init&&r.init.type===Xe.AST_NODE_TYPES.ArrowFunctionExpression&&r.id.type===Xe.AST_NODE_TYPES.Identifier){let i=r.id.name;if(r.id.typeAnnotation||o&&o.test(i)||!t.disallowArrowFnWithImplicitReturns&&r.init.body.type!==Xe.AST_NODE_TYPES.BlockStatement)return;let s=r.parent,n=r.init.params,a=r.init.body,p=r.init;e.report({node:r.id,messageId:o?"withIgnoreRegex":"default",data:{functionName:i,ignoreRegex:t.ignoreRegex},suggest:[{messageId:"suggestion",fix:l=>l.replaceText(s,`${p.async?"async ":""}function ${i}(${n.map(d=>e.sourceCode.getText(d)).join(", ")||""}) ${e.sourceCode.getText(a)}`)}]})}}}}}),Yt={name:tr,rule:Ii};var _=require("@typescript-eslint/utils"),Ae=require("zod/v4");var Pi=Ae.z.object({disallowedFunctions:Ae.z.array(Ae.z.object({name:Ae.z.string(),allowUsingWithArgs:Ae.z.boolean().optional(),hookAlternative:Ae.z.string().optional(),message:Ae.z.string().optional(),allowUseInside:Ae.z.array(Ae.z.string()).optional()}))}),Ni=/^use[A-Z]/,Ri=/^[A-Z]/;function lt(e){return Ni.test(e)}function nr(e){return Ri.test(e)}function wi(e){return e.type===_.AST_NODE_TYPES.Identifier?lt(e.name):e.type===_.AST_NODE_TYPES.MemberExpression&&e.property.type===_.AST_NODE_TYPES.Identifier?lt(e.property.name):!1}function rr(e,t){return e.type===_.AST_NODE_TYPES.Identifier?e.name===t:e.type===_.AST_NODE_TYPES.MemberExpression&&e.object.type===_.AST_NODE_TYPES.Identifier&&e.property.type===_.AST_NODE_TYPES.Identifier?e.object.name==="React"&&e.property.name===t:!1}function or(e){return!!(e.parent&&e.parent.type===_.AST_NODE_TYPES.CallExpression&&rr(e.parent.callee,"forwardRef"))}function ir(e){return!!(e.parent&&e.parent.type===_.AST_NODE_TYPES.CallExpression&&rr(e.parent.callee,"memo"))}function qt(e){if(e.type===_.AST_NODE_TYPES.FunctionDeclaration||e.type===_.AST_NODE_TYPES.FunctionExpression&&e.id)return e.id||void 0;if(e.type===_.AST_NODE_TYPES.FunctionExpression||e.type===_.AST_NODE_TYPES.ArrowFunctionExpression){if(e.parent.type===_.AST_NODE_TYPES.VariableDeclarator&&e.parent.init===e)return e.parent.id;if(e.parent.type===_.AST_NODE_TYPES.AssignmentExpression&&e.parent.right===e&&e.parent.operator==="=")return e.parent.left;if(e.parent.type===_.AST_NODE_TYPES.Property&&e.parent.value===e&&!e.parent.computed)return e.parent.key;if(e.parent.type===_.AST_NODE_TYPES.AssignmentPattern&&e.parent.right===e)return e.parent.left}}function Fi(e){let t=e.parent,o=!1;for(;t;){if(t.type===_.AST_NODE_TYPES.FunctionDeclaration||t.type===_.AST_NODE_TYPES.FunctionExpression||t.type===_.AST_NODE_TYPES.ArrowFunctionExpression){let r=qt(t);if(r&&r.type===_.AST_NODE_TYPES.Identifier){if(nr(r.name)||lt(r.name))return!o;o=!0}else{if(or(t)||ir(t))return!o;if(t.parent.type===_.AST_NODE_TYPES.CallExpression){let i=t.parent;wi(i.callee)||(o=!0)}else t.parent.type===_.AST_NODE_TYPES.JSXExpressionContainer||(o=!0)}}t=t.parent}return!1}function sr(e){return e.callee.type===_.AST_NODE_TYPES.Identifier?e.callee.name:e.callee.type===_.AST_NODE_TYPES.MemberExpression&&e.callee.property.type===_.AST_NODE_TYPES.Identifier?e.callee.property.name:null}function Oi(e,t){if(!t.length)return!1;let o=e.parent;for(;o;){if(o.type===_.AST_NODE_TYPES.FunctionDeclaration||o.type===_.AST_NODE_TYPES.FunctionExpression||o.type===_.AST_NODE_TYPES.ArrowFunctionExpression){let r=qt(o);if(r&&r.type===_.AST_NODE_TYPES.Identifier&&t.includes(r.name))return!0}else if(o.type===_.AST_NODE_TYPES.CallExpression){let r=sr(o);if(r&&t.includes(r))return!0}o=o.parent}return!1}function Di(e){return e.arguments.length>0&&!e.arguments.every(t=>t.type===_.AST_NODE_TYPES.Identifier&&t.name==="undefined")}function vi(e,t){let o=!1,r=e.parent;for(;r;){if(r.type===_.AST_NODE_TYPES.FunctionDeclaration||r.type===_.AST_NODE_TYPES.FunctionExpression||r.type===_.AST_NODE_TYPES.ArrowFunctionExpression){let i=qt(r);if(i&&i.type===_.AST_NODE_TYPES.Identifier){if(nr(i.name)||lt(i.name)){o=!0;break}}else if(or(r)||ir(r)){o=!0;break}}r=r.parent}return o?t.length===0?Fi(e):!Oi(e,t):!1}var Zt=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:[k(Pi)],hasSuggestions:!0},defaultOptions:[{disallowedFunctions:[]}],create(e,[t]){let{disallowedFunctions:o}=t,r=new Map(o.map(i=>[i.name,i]));return{CallExpression(i){let s=sr(i);if(!s)return;let n=r.get(s);if(!n||n.allowUsingWithArgs&&Di(i))return;let a=n.allowUseInside||[];vi(i,a)&&e.report({node:i,messageId:"preferHookAlternative",data:{message:n.message?` ${n.message}`:` use ${n.hookAlternative} instead`},suggest:n.hookAlternative?[{messageId:"preferHookAlternative",data:{message:`Replace with ${n.hookAlternative}`,hookAlternative:n.hookAlternative},fix:p=>{let l=n.hookAlternative;return l?i.callee.type===_.AST_NODE_TYPES.Identifier?p.replaceText(i.callee,l):i.callee.type===_.AST_NODE_TYPES.MemberExpression&&i.callee.property.type===_.AST_NODE_TYPES.Identifier?p.replaceText(i.callee.property,l):null:null}}]:[]})}}}});var ee=require("@typescript-eslint/utils"),ct=Oe(require("zod/v4"));var ki=ee.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),pr="prefer-single-line-if",ji=ct.default.object({maxLineLength:ct.default.number().optional(),maxNonSimpleConditionLength:ct.default.number().optional()}),Mi=ki({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:[k(ji)]},defaultOptions:[{}],create(e,[t]){let o=e.sourceCode;return{IfStatement(r){if(r.consequent.type!==ee.AST_NODE_TYPES.BlockStatement||r.loc.start.line===r.loc.end.line||o.getCommentsInside(r.consequent).length>0||r.alternate||r.consequent.body.length!==1)return;let s=r.consequent.body[0];if(!s)return;if(s.type===ee.AST_NODE_TYPES.ReturnStatement){if(!cr(s))return}else if(!(s.type===ee.AST_NODE_TYPES.ContinueStatement||s.type===ee.AST_NODE_TYPES.BreakStatement))return;if(r.test.type===ee.AST_NODE_TYPES.LogicalExpression||r.test.type===ee.AST_NODE_TYPES.ConditionalExpression)return;let n;if(t.maxNonSimpleConditionLength){let m=ar(r.test);if(!m&&r.test.type===ee.AST_NODE_TYPES.UnaryExpression&&r.test.operator==="!"){let u=r.test.argument;ar(u)&&(m=!0)}if(m&&(n=o.getText(r.test),n.length>t.maxNonSimpleConditionLength))return}n||(n=o.getText(r.test));let a=o.getText(s);if(n.includes(`
7
+ `))return;let p=o.getTokenAfter(r);if(p&&p.type===ee.AST_TOKEN_TYPES.Punctuator&&p.value==="}"){let m=o.getTokenAfter(p);if(m&&m.type===ee.AST_TOKEN_TYPES.Keyword&&(m.value==="else"||m.value==="catch"))return}let l=Li(o,r),d=`if (${n}) ${a}`;t.maxLineLength&&d.length+l.length>t.maxLineLength||e.report({node:r,messageId:"noSingleLineCurly",fix:m=>m.replaceText(r,d)})}}}});function ar(e){return e.type===ee.AST_NODE_TYPES.CallExpression||e.type===ee.AST_NODE_TYPES.BinaryExpression||e.type===ee.AST_NODE_TYPES.MemberExpression&&lr(e)}function lr(e){return e.object.type===ee.AST_NODE_TYPES.MemberExpression?lr(e.object):e.object.type!==ee.AST_NODE_TYPES.Identifier}function Li(e,t){return e.text.slice(t.range[0]-t.loc.start.column,t.range[0])}function cr(e){if(!e.argument)return!0;let t=e.argument;return t.type===ee.AST_NODE_TYPES.ArrayExpression&&t.elements.length===0||t.type===ee.AST_NODE_TYPES.ObjectExpression&&t.properties.length===0||t.type===ee.AST_NODE_TYPES.Literal||t.type===ee.AST_NODE_TYPES.Identifier||t.type===ee.AST_NODE_TYPES.TemplateLiteral||t.type===ee.AST_NODE_TYPES.TaggedTemplateExpression?!0:t.type===ee.AST_NODE_TYPES.CallExpression?t.arguments.length===0:t.type===ee.AST_NODE_TYPES.UnaryExpression?cr(t):!1}var Gt={name:pr,rule:Mi};var N=require("@typescript-eslint/utils"),Kt=require("zod/v4");var _i=N.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),yr="react-compiler-extra",$i=Kt.z.object({runOnlyWithEnableCompilerDirective:Kt.z.boolean().optional()}),zi=/eslint +react-compiler\/react-compiler: +\["error/;function We(e){let t=null;if((e.type===N.AST_NODE_TYPES.FunctionDeclaration||e.type===N.AST_NODE_TYPES.FunctionExpression||e.type===N.AST_NODE_TYPES.ArrowFunctionExpression&&e.body.type===N.AST_NODE_TYPES.BlockStatement)&&(t=e.body),!t||t.body.length===0)return!1;let o=t.body[0];return o?o.type===N.AST_NODE_TYPES.ExpressionStatement&&o.expression.type===N.AST_NODE_TYPES.Literal&&o.expression.value==="use no memo":!1}function ur(e){let t=e.parent;for(;t;){if(t.type===N.AST_NODE_TYPES.FunctionDeclaration||t.type===N.AST_NODE_TYPES.FunctionExpression||t.type===N.AST_NODE_TYPES.ArrowFunctionExpression)return t;t=t.parent}return null}function Ui(e){return e.type===N.AST_NODE_TYPES.Identifier?e.name.startsWith("use"):!1}function gr(e){return e.type===N.AST_NODE_TYPES.Identifier?e.name.startsWith("use"):e.type===N.AST_NODE_TYPES.MemberExpression&&e.property.type===N.AST_NODE_TYPES.Identifier?e.property.name.startsWith("use"):!1}function Ie(e){if(!e)return!1;switch(e.type){case N.AST_NODE_TYPES.JSXElement:case N.AST_NODE_TYPES.JSXFragment:return!0;case N.AST_NODE_TYPES.ConditionalExpression:return Ie(e.consequent)||Ie(e.alternate);case N.AST_NODE_TYPES.LogicalExpression:return e.operator==="&&"?Ie(e.right):e.operator==="||"?Ie(e.left)||Ie(e.right):!1;case N.AST_NODE_TYPES.CallExpression:if(e.callee.type===N.AST_NODE_TYPES.MemberExpression&&e.callee.object.type===N.AST_NODE_TYPES.Identifier&&e.callee.object.name==="React"&&e.callee.property.type===N.AST_NODE_TYPES.Identifier&&e.callee.property.name==="createElement")return!0;for(let t of e.arguments)if(t.type!==N.AST_NODE_TYPES.SpreadElement&&Ie(t))return!0;return!1;default:return!1}}function Ji(e){let t=e.typeAnnotation;if(t.type===N.AST_NODE_TYPES.TSTypeReference){if(t.typeName.type===N.AST_NODE_TYPES.Identifier)return t.typeName.name==="FC";if(t.typeName.type===N.AST_NODE_TYPES.TSQualifiedName&&t.typeName.left.type===N.AST_NODE_TYPES.Identifier&&t.typeName.right.type===N.AST_NODE_TYPES.Identifier)return t.typeName.left.name==="React"&&t.typeName.right.name==="FC"}return!1}var Vi=/^[A-Z][a-zA-Z0-9]*$/;function nt(e){return Vi.test(e)}function ut(e){return e.startsWith("use")&&e.length>3}function Qt(e,t,o,r){if(o&&Ji(o))return t?nt(t.name):e.type===N.AST_NODE_TYPES.FunctionDeclaration&&e.id?nt(e.id.name):!0;if(t&&ut(t.name)||e.type===N.AST_NODE_TYPES.FunctionDeclaration&&e.id&&ut(e.id.name))return!0;if(r){let i=t?.name||e.type===N.AST_NODE_TYPES.FunctionDeclaration&&e.id?.name;if(i&&nt(i)&&Sr(e.body,r).containsJSX)return!0}return!1}function tt(e){if(e.body.type===N.AST_NODE_TYPES.BlockStatement){for(let t of e.body.body)if(t.type===N.AST_NODE_TYPES.ExpressionStatement&&t.expression.type===N.AST_NODE_TYPES.Literal&&typeof t.expression.value=="string"&&t.expression.value==="use memo")return!0}return!1}function Sr(e,t){let o={containsJSX:!1,containsHookCalls:!1};return Re(e,r=>{if(o.containsJSX&&o.containsHookCalls)return!0;switch(r.type){case N.AST_NODE_TYPES.JSXElement:case N.AST_NODE_TYPES.JSXFragment:o.containsJSX=!0;break;case N.AST_NODE_TYPES.CallExpression:Ui(r.callee)&&(o.containsHookCalls=!0),Ie(r)&&(o.containsJSX=!0);break;case N.AST_NODE_TYPES.ReturnStatement:r.argument&&Ie(r.argument)&&(o.containsJSX=!0);break;case N.AST_NODE_TYPES.VariableDeclarator:r.init&&Ie(r.init)&&(o.containsJSX=!0);break;case N.AST_NODE_TYPES.AssignmentExpression:Ie(r.right)&&(o.containsJSX=!0);break}},t),o}function fr(e,t){let o=e.body,r=Sr(o,t);return r.containsJSX||r.containsHookCalls}var Xi=/\bthis[.[]/;function mr(e){return Xi.test(e)}function Wi(e,t){let o={containsJSX:!1,containsHookCalls:!1};return Re(e,r=>{if(o.containsHookCalls||(r.type===N.AST_NODE_TYPES.FunctionDeclaration||r.type===N.AST_NODE_TYPES.FunctionExpression||r.type===N.AST_NODE_TYPES.ArrowFunctionExpression)&&r!==e)return!0;r.type===N.AST_NODE_TYPES.CallExpression&&gr(r.callee)&&(o.containsHookCalls=!0)},t),o}function dr(e){return nt(e)||ut(e)}function Ht(e,t,o,r){if(!Wi(e.body,t).containsHookCalls)return!1;let s=Qt(e,o,r,t);if(!s&&r){let n=o?.name||e.type===N.AST_NODE_TYPES.FunctionDeclaration&&e.id?.name;n&&nt(n)&&(s=!0)}return!s}var Bi=_i({name:yr,meta:{type:"suggestion",fixable:"code",docs:{description:"Extra rules to enforce best practices when using the React compiler"},messages:{objectMethodIsNotSupported:"Object methods such as `{ method() {} }` have limited support to optimizations in the React compiler, use a function expression `{ method: () => {} }` instead.",replaceWithFunctionExpression:"Replace with function expression",thisKeywordInMethod:"Object method uses `this` keyword which would have different behavior if converted to an arrow function. Fix this manually.",fcComponentShouldReturnJsx:'React components and hooks should create JSX elements, call other hooks or use the "use memo" directive for optimal React compiler detection.',addUseMemoDirective:'Add "use memo" directive to opt into React compiler memoization',functionCallingHooksMustBeComponent:'Functions calling hooks must be React components (PascalCase with FC type) or hooks (start with "use").',useMemoDirectiveNaming:'Functions using "use memo" directive must follow React naming conventions (PascalCase for components or start with "use" for hooks).'},hasSuggestions:!0,schema:[k($i)]},defaultOptions:[{}],create(e,[t]){let o=!1;if(t.runOnlyWithEnableCompilerDirective){for(let n of e.sourceCode.getAllComments())if(zi.test(n.value)){o=!0;break}if(!o)return{}}function r(n){for(let a of n.properties)if(a.type===N.AST_NODE_TYPES.Property&&a.method&&a.value.type===N.AST_NODE_TYPES.FunctionExpression){let p=e.sourceCode,l=p.getText(a.key),d=a.value,m=p.getText(d.body);if(mr(m))e.report({node:a,messageId:"thisKeywordInMethod"});else{let u=d.params.map(c=>p.getText(c)).join(", "),f="";d.generator?f=`${l}: function* (${u}) ${m}`:d.async?f=`${l}: async (${u}) => ${m}`:f=`${l}: (${u}) => ${m}`,e.report({node:a,messageId:"objectMethodIsNotSupported",fix:c=>c.replaceText(a,f)})}}}function i(n){for(let a of n.properties)if(a.type===N.AST_NODE_TYPES.Property&&a.value.type===N.AST_NODE_TYPES.ObjectExpression){for(let p of a.value.properties)if(p.type===N.AST_NODE_TYPES.Property&&p.method&&p.value.type===N.AST_NODE_TYPES.FunctionExpression){let d=e.sourceCode.getText(p.value.body);mr(d)&&e.report({node:p,messageId:"thisKeywordInMethod"})}}}function s(n){let a=ur(n);return a!==null&&We(a)}return{CallExpression(n){if(gr(n.callee))for(let a of n.arguments){if(a.type===N.AST_NODE_TYPES.ObjectExpression){if(s(n))return;r(a),i(a)}if(a.type===N.AST_NODE_TYPES.ArrowFunctionExpression){if(a.body.type===N.AST_NODE_TYPES.ObjectExpression){if(s(n))return;r(a.body),i(a.body)}if(a.body.type===N.AST_NODE_TYPES.BlockStatement){for(let p of a.body.body)if(p.type===N.AST_NODE_TYPES.ReturnStatement&&p.argument?.type===N.AST_NODE_TYPES.ObjectExpression){if(s(n))return;r(p.argument),i(p.argument)}}}if(a.type===N.AST_NODE_TYPES.FunctionExpression){for(let p of a.body.body)if(p.type===N.AST_NODE_TYPES.ReturnStatement&&p.argument?.type===N.AST_NODE_TYPES.ObjectExpression){if(s(n))return;r(p.argument),i(p.argument)}}}},VariableDeclarator(n){if(n.id.type===N.AST_NODE_TYPES.Identifier&&n.init&&(n.init.type===N.AST_NODE_TYPES.ArrowFunctionExpression||n.init.type===N.AST_NODE_TYPES.FunctionExpression)){let a=n.init,p=n.id,l=n.id.typeAnnotation;if(tt(a)&&!dr(p.name)){e.report({node:a,messageId:"useMemoDirectiveNaming"});return}if(Ht(a,e.sourceCode,p,l)){if(We(a))return;e.report({node:a,messageId:"functionCallingHooksMustBeComponent"});return}if(Qt(a,p,l,e.sourceCode)){let d=fr(a,e.sourceCode),m=tt(a);if(!d&&!m){if(We(a))return;e.report({node:a,messageId:"fcComponentShouldReturnJsx",suggest:[{messageId:"addUseMemoDirective",fix(u){if(a.body.type===N.AST_NODE_TYPES.BlockStatement){let f=a.body.range[0]+1;return u.insertTextAfterRange([f,f],`
19
8
  "use memo"
20
- `)}return null}}]})}}}},FunctionDeclaration(i){if(i.id&&At(i)&&!ci(i.id.name)){e.report({node:i,messageId:"useMemoDirectiveNaming"});return}if(Pn(i,e.sourceCode)){if(yt(i))return;e.report({node:i,messageId:"functionCallingHooksMustBeComponent"});return}if(Dn(i,void 0,void 0,e.sourceCode)){let a=li(i,e.sourceCode),l=At(i);if(!a&&!l){if(yt(i))return;e.report({node:i,messageId:"fcComponentShouldReturnJsx",suggest:[{messageId:"addUseMemoDirective",fix(p){let m=i.body.range[0]+1;return p.insertTextAfterRange([m,m],`
9
+ `)}return null}}]})}}}},FunctionDeclaration(n){if(n.id&&tt(n)&&!dr(n.id.name)){e.report({node:n,messageId:"useMemoDirectiveNaming"});return}if(Ht(n,e.sourceCode)){if(We(n))return;e.report({node:n,messageId:"functionCallingHooksMustBeComponent"});return}if(Qt(n,void 0,void 0,e.sourceCode)){let a=fr(n,e.sourceCode),p=tt(n);if(!a&&!p){if(We(n))return;e.report({node:n,messageId:"fcComponentShouldReturnJsx",suggest:[{messageId:"addUseMemoDirective",fix(l){let d=n.body.range[0]+1;return l.insertTextAfterRange([d,d],`
21
10
  "use memo"
22
- `)}}]})}}},FunctionExpression(i){if(At(i)){e.report({node:i,messageId:"useMemoDirectiveNaming"});return}if(Pn(i,e.sourceCode)){if(yt(i))return;e.report({node:i,messageId:"functionCallingHooksMustBeComponent"})}},ReturnStatement(i){if(i.argument?.type!==j.AST_NODE_TYPES.ObjectExpression)return;let a=ai(i);if(!a)return;let l;a.type===j.AST_NODE_TYPES.FunctionDeclaration&&a.id?l=a.id.name:(a.type===j.AST_NODE_TYPES.ArrowFunctionExpression||a.type===j.AST_NODE_TYPES.FunctionExpression)&&a.parent.type===j.AST_NODE_TYPES.VariableDeclarator&&a.parent.id.type===j.AST_NODE_TYPES.Identifier&&(l=a.parent.id.name),l&&jt(l)&&(o(i)||(n(i.argument),s(i.argument)))}}}}),Ln={name:ui,rule:Ta};var ye=require("@typescript-eslint/utils"),je=require("zod/v4");var Ea=ye.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),yi="react-compiler-migration",ha=je.z.object({disallowHooks:je.z.array(je.z.object({name:je.z.string(),replacement:je.z.string()})).optional(),disallowMethods:je.z.array(je.z.object({name:je.z.string(),replacement:je.z.string().optional(),requireTrueProp:je.z.string().optional()})).optional(),runOnlyWithEnableCompilerDirective:je.z.boolean().optional()}),ba=/eslint +react-compiler\/react-compiler: +\["error/;function xa(e){let t=null;if((e.type===ye.AST_NODE_TYPES.FunctionDeclaration||e.type===ye.AST_NODE_TYPES.FunctionExpression||e.type===ye.AST_NODE_TYPES.ArrowFunctionExpression&&e.body.type===ye.AST_NODE_TYPES.BlockStatement)&&(t=e.body),!t||t.body.length===0)return!1;let r=t.body[0];return r?r.type===ye.AST_NODE_TYPES.ExpressionStatement&&r.expression.type===ye.AST_NODE_TYPES.Literal&&r.expression.value==="use no memo":!1}function Ca(e){let t=e.parent;for(;t;){if(t.type===ye.AST_NODE_TYPES.FunctionDeclaration||t.type===ye.AST_NODE_TYPES.FunctionExpression||t.type===ye.AST_NODE_TYPES.ArrowFunctionExpression)return t;t=t.parent}return null}function Ia(e){return e.type===ye.AST_NODE_TYPES.Identifier?e.name.startsWith("use"):e.type===ye.AST_NODE_TYPES.MemberExpression&&e.property.type===ye.AST_NODE_TYPES.Identifier?e.property.name.startsWith("use"):!1}var Aa=Ea({name:yi,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:[U(ha)]},defaultOptions:[{disallowHooks:[],disallowMethods:[],runOnlyWithEnableCompilerDirective:!1}],create(e,[t]){let r=!0;if(t.runOnlyWithEnableCompilerDirective){r=!1;for(let s of e.sourceCode.getAllComments())if(ba.test(s.value)){r=!0;break}}if(!r)return{};function n(s){let o=Ca(s);return o!==null&&xa(o)}return{CallExpression(s){if(t.disallowHooks?.length){let o=null,i=null;if(s.callee.type===ye.AST_NODE_TYPES.Identifier?(o=s.callee.name,i=s.callee):s.callee.type===ye.AST_NODE_TYPES.MemberExpression&&s.callee.property.type===ye.AST_NODE_TYPES.Identifier&&(o=s.callee.property.name,i=s.callee.property),o){let a=t.disallowHooks.find(l=>l.name===o);if(a&&i){if(n(s))return;e.report({node:s,messageId:"disallowedFunctionOrMethod",data:{functionOrMethod:a.name,replacement:a.replacement},suggest:[{messageId:"replace",data:{replacement:a.replacement},fix:l=>l.replaceText(i,a.replacement)}]})}}}if(t.disallowMethods?.length&&Ia(s.callee)){for(let o of s.arguments)if(o.type===ye.AST_NODE_TYPES.ObjectExpression){for(let i of o.properties)if(i.type===ye.AST_NODE_TYPES.Property&&i.key.type===ye.AST_NODE_TYPES.Identifier){let a=i.key.name,l=t.disallowMethods.find(p=>p.name===a);if(l){if(n(s))return;if(l.requireTrueProp){let p=l.requireTrueProp,m=!1;for(let y of o.properties)if(y.type===ye.AST_NODE_TYPES.Property&&y.key.type===ye.AST_NODE_TYPES.Identifier&&y.key.name===p&&y.value.type===ye.AST_NODE_TYPES.Literal&&y.value.value===!0){m=!0;break}if(!m){e.report({node:i,messageId:"disallowedMethodWithMissingRequireTrueProp",data:{method:l.name,requireTrueProp:p}});continue}}l.replacement&&e.report({node:i,messageId:"disallowedFunctionOrMethod",data:{functionOrMethod:l.name,replacement:l.replacement},suggest:[{messageId:"replace",data:{replacement:l.replacement},fix:p=>l.replacement?p.replaceText(i.key,l.replacement):null}]})}}}}}}}}),jn={name:yi,rule:Aa};var oe=require("@typescript-eslint/utils"),Mn=require("zod/v4");var wa=/\.(tsx|jsx)$/,Fa=/^[A-Z][A-Za-z0-9]*$/,va=/^[A-Z][A-Z0-9_]*$/,di=80,Ra=Mn.z.object({ignoreConstCaseVarRegex:Mn.z.string().optional()}),_n=z({name:"react-no-module-level-single-use-values",meta:{type:"problem",docs:{description:"Disallow module-level allocated data values and long strings that are only used in one React component, excluding functions, inferable aliases, regex values, and class instantiations except Set/Map"},schema:[U(Ra)],messages:{moveValueInsideComponent:"Module-level `{{valueName}}` is only used in React component `{{componentName}}`. Move it inside the component to improve memory usage."}},defaultOptions:[{}],create(e,[t]){if(!wa.test(e.filename))return{};let r=e.sourceCode,n=za(t.ignoreConstCaseVarRegex),s=Na(r.ast.body);return s.length===0?{}:{VariableDeclarator(o){if(o.id.type!==oe.AST_NODE_TYPES.Identifier||!ka(o)||!Da(o.init))return;let i=o.id.name;if(n&&Ua(i)&&n.test(i))return;let l=r.getDeclaredVariables(o).find(d=>d.name===i);if(!l)return;let p=new Set,m=!1,y=!1;for(let d of l.references){if(d.init)continue;y=!0;let c=Pa(d.identifier,s);if(!c){m=!0;break}if(p.add(c),p.size>1)break}if(!y||m||p.size!==1)return;let[u]=Array.from(p);u&&e.report({node:o.id,messageId:"moveValueInsideComponent",data:{valueName:i,componentName:u}})}}}});function Na(e){let t=[],r=new Set;function n(o,i){Fa.test(o)&&(r.has(o)||(r.add(o),t.push({name:o,range:i.range})))}function s(o){for(let i of o.declarations){if(i.id.type!==oe.AST_NODE_TYPES.Identifier)continue;let a=gi(i.init);a&&n(i.id.name,a)}}for(let o of e){if(o.type===oe.AST_NODE_TYPES.VariableDeclaration){s(o);continue}if(o.type===oe.AST_NODE_TYPES.FunctionDeclaration){n(o.id.name,o);continue}o.type===oe.AST_NODE_TYPES.ExportNamedDeclaration&&o.declaration&&(o.declaration.type===oe.AST_NODE_TYPES.VariableDeclaration?s(o.declaration):o.declaration.type===oe.AST_NODE_TYPES.FunctionDeclaration&&o.declaration.id&&n(o.declaration.id.name,o.declaration))}return t}function ka(e){return e.parent.parent.type===oe.AST_NODE_TYPES.Program}function Pa(e,t){let r=null;for(let n of t){if(!(e.range[0]>=n.range[0]&&e.range[1]<=n.range[1]))continue;if(!r){r=n;continue}let o=r.range[1]-r.range[0];n.range[1]-n.range[0]<o&&(r=n)}return r?.name??null}function gi(e){if(!e)return null;let t=$n(e);if(t.type===oe.AST_NODE_TYPES.ArrowFunctionExpression||t.type===oe.AST_NODE_TYPES.FunctionExpression)return t;if(t.type!==oe.AST_NODE_TYPES.CallExpression||!Oa(t.callee))return null;let r=t.arguments[0];if(!r||r.type===oe.AST_NODE_TYPES.SpreadElement)return null;if(r.type===oe.AST_NODE_TYPES.CallExpression)return gi(r);let n=$n(r);return n.type===oe.AST_NODE_TYPES.ArrowFunctionExpression||n.type===oe.AST_NODE_TYPES.FunctionExpression?n:null}function Oa(e){return e.type===oe.AST_NODE_TYPES.Identifier?e.name==="memo"||e.name==="forwardRef":e.type===oe.AST_NODE_TYPES.MemberExpression?e.property.type===oe.AST_NODE_TYPES.Identifier&&(e.property.name==="memo"||e.property.name==="forwardRef"):!1}function $n(e){let t=e;for(;;){if(t.type===oe.AST_NODE_TYPES.TSAsExpression){t=t.expression;continue}if(t.type===oe.AST_NODE_TYPES.TSSatisfiesExpression){t=t.expression;continue}if(t.type===oe.AST_NODE_TYPES.TSNonNullExpression){t=t.expression;continue}return t}}function Da(e){if(!e)return!1;let t=$n(e);return La(t)?!1:ja(t)?!0:Ma(t)}function La(e){return e.type===oe.AST_NODE_TYPES.Identifier||e.type===oe.AST_NODE_TYPES.MemberExpression}function ja(e){if(e.type===oe.AST_NODE_TYPES.Literal)return typeof e.value=="string"&&e.value.length>=di;if(e.type===oe.AST_NODE_TYPES.TemplateLiteral){if(e.expressions.length>0)return!1;let t=e.quasis[0];return t?t.value.cooked.length>=di:!1}return!1}function Ma(e){return e.type===oe.AST_NODE_TYPES.ArrayExpression||e.type===oe.AST_NODE_TYPES.ObjectExpression||e.type===oe.AST_NODE_TYPES.ClassExpression?!0:e.type===oe.AST_NODE_TYPES.NewExpression?$a(e):!1}function $a(e){let t=_a(e.callee);return t==="Set"||t==="Map"}function _a(e){return e.type===oe.AST_NODE_TYPES.Identifier?e.name:e.type===oe.AST_NODE_TYPES.MemberExpression?e.computed||e.property.type!==oe.AST_NODE_TYPES.Identifier?null:e.property.name:null}function Ua(e){return va.test(e)}function za(e){if(!e)return null;try{return new RegExp(e)}catch{return null}}var V=require("@typescript-eslint/utils"),zn=require("zod");var Va=zn.z.object({runOnlyWithEnableCompilerDirective:zn.z.boolean().optional()}),Wa=/eslint +react-compiler\/react-compiler: +\["error/,Ja=/^\d+$/,Xa=/[\s_-]+/,Ba=/[a-z][A-Z]/,Ha=/^(.+?)([A-Z][a-z]+s?)$/,Ya=/^[a-z][a-zA-Z]*$/;function Si(e,t){let r=[];if(e.type===V.AST_NODE_TYPES.JSXElement){for(let n of e.openingElement.attributes)if(n.type===V.AST_NODE_TYPES.JSXAttribute&&n.name.type===V.AST_NODE_TYPES.JSXIdentifier&&n.value?.type===V.AST_NODE_TYPES.JSXExpressionContainer&&n.value.expression.type!==V.AST_NODE_TYPES.JSXEmptyExpression){let s=n.name.name,o=n.value.expression,i=!1;_e(o,a=>{switch(a.type){case V.AST_NODE_TYPES.ObjectExpression:case V.AST_NODE_TYPES.ArrowFunctionExpression:case V.AST_NODE_TYPES.FunctionExpression:case V.AST_NODE_TYPES.ArrayExpression:return i=!0,!0}return!1},t),i&&r.push(s)}}return{hasUnstable:r.length>0,problematicProps:r}}function qa(e){if(e.body.type===V.AST_NODE_TYPES.JSXElement||e.body.type===V.AST_NODE_TYPES.JSXFragment)return!0;if(e.body.type===V.AST_NODE_TYPES.BlockStatement){for(let t of e.body.body)if(t.type===V.AST_NODE_TYPES.ReturnStatement&&t.argument&&(t.argument.type===V.AST_NODE_TYPES.JSXElement||t.argument.type===V.AST_NODE_TYPES.JSXFragment))return!0}return!1}function Za(e,t){let r=e.callee;if(r.type===V.AST_NODE_TYPES.MemberExpression){let n=r.object;if(n.type===V.AST_NODE_TYPES.Identifier){let s=n.name,o=Ga(s);if(o!==s)return Vn(o)}}if(t.length>0){let n=t[0];if(n&&n.type===V.AST_NODE_TYPES.Identifier)return Vn(n.name)}return"ListItem"}function Ga(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(Ba)){let n=e.match(Ha);if(n){let s=n[1],o=n[2];if(!s||!o)return Un(e);let i=Un(o);if(i!==o)return s+i}}return Un(e)}function Un(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 Vn(e){return e.match(Ya)?e.charAt(0).toUpperCase()+e.slice(1):e.split(Xa).map(t=>t.charAt(0).toUpperCase()+t.slice(1).toLowerCase()).join("")}function Ti(e,t,r){let n=[],s=new Set,o=new Set(["console","document","window","Math","Object","Array","String","Number","Boolean","undefined","null"]);_e(e,i=>{if(i.type===V.AST_NODE_TYPES.Identifier&&!t.includes(i.name)&&!o.has(i.name)&&!Ja.test(i.name)){let a=i.parent;if(a.type===V.AST_NODE_TYPES.Property&&a.key===i||a.type===V.AST_NODE_TYPES.MemberExpression&&a.property===i&&!a.computed||a.type===V.AST_NODE_TYPES.JSXOpeningElement||a.type===V.AST_NODE_TYPES.JSXClosingElement||a.type===V.AST_NODE_TYPES.JSXAttribute&&a.name.type===V.AST_NODE_TYPES.JSXIdentifier&&a.name.name===i.name)return!1;s.add(i.name)}return!1},r);for(let i of s)t.includes(i)||n.push({name:i,type:"unknown"});return n}function Ei(e,t,r,n,s){let i=[...r.map(y=>y.type===V.AST_NODE_TYPES.Identifier?y.name:"item").map((y,u)=>({name:y,type:u===0?`${e}Type`:u===1?"number":"unknown"})),...n],a=i.map(y=>{let u=y.type;return y.name.includes("on")&&u==="any"&&(u="unknown"),` ${y.name}: ${u};`}).join(`
23
- `),l=i.map(y=>y.name).join(", "),p=s.getText(t),m=`${e}Props`;return`type ${m} = {
11
+ `)}}]})}}},FunctionExpression(n){if(tt(n)){e.report({node:n,messageId:"useMemoDirectiveNaming"});return}if(Ht(n,e.sourceCode)){if(We(n))return;e.report({node:n,messageId:"functionCallingHooksMustBeComponent"})}},ReturnStatement(n){if(n.argument?.type!==N.AST_NODE_TYPES.ObjectExpression)return;let a=ur(n);if(!a)return;let p;a.type===N.AST_NODE_TYPES.FunctionDeclaration&&a.id?p=a.id.name:(a.type===N.AST_NODE_TYPES.ArrowFunctionExpression||a.type===N.AST_NODE_TYPES.FunctionExpression)&&a.parent.type===N.AST_NODE_TYPES.VariableDeclarator&&a.parent.id.type===N.AST_NODE_TYPES.Identifier&&(p=a.parent.id.name),p&&ut(p)&&(s(n)||(r(n.argument),i(n.argument)))}}}}),en={name:yr,rule:Bi};var te=require("@typescript-eslint/utils"),xe=require("zod/v4");var Yi=te.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),Tr="react-compiler-migration",qi=xe.z.object({disallowHooks:xe.z.array(xe.z.object({name:xe.z.string(),replacement:xe.z.string()})).optional(),disallowMethods:xe.z.array(xe.z.object({name:xe.z.string(),replacement:xe.z.string().optional(),requireTrueProp:xe.z.string().optional()})).optional(),runOnlyWithEnableCompilerDirective:xe.z.boolean().optional()}),Zi=/eslint +react-compiler\/react-compiler: +\["error/;function Gi(e){let t=null;if((e.type===te.AST_NODE_TYPES.FunctionDeclaration||e.type===te.AST_NODE_TYPES.FunctionExpression||e.type===te.AST_NODE_TYPES.ArrowFunctionExpression&&e.body.type===te.AST_NODE_TYPES.BlockStatement)&&(t=e.body),!t||t.body.length===0)return!1;let o=t.body[0];return o?o.type===te.AST_NODE_TYPES.ExpressionStatement&&o.expression.type===te.AST_NODE_TYPES.Literal&&o.expression.value==="use no memo":!1}function Hi(e){let t=e.parent;for(;t;){if(t.type===te.AST_NODE_TYPES.FunctionDeclaration||t.type===te.AST_NODE_TYPES.FunctionExpression||t.type===te.AST_NODE_TYPES.ArrowFunctionExpression)return t;t=t.parent}return null}function Ki(e){return e.type===te.AST_NODE_TYPES.Identifier?e.name.startsWith("use"):e.type===te.AST_NODE_TYPES.MemberExpression&&e.property.type===te.AST_NODE_TYPES.Identifier?e.property.name.startsWith("use"):!1}var Qi=Yi({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:[k(qi)]},defaultOptions:[{disallowHooks:[],disallowMethods:[],runOnlyWithEnableCompilerDirective:!1}],create(e,[t]){let o=!0;if(t.runOnlyWithEnableCompilerDirective){o=!1;for(let i of e.sourceCode.getAllComments())if(Zi.test(i.value)){o=!0;break}}if(!o)return{};function r(i){let s=Hi(i);return s!==null&&Gi(s)}return{CallExpression(i){if(t.disallowHooks?.length){let s=null,n=null;if(i.callee.type===te.AST_NODE_TYPES.Identifier?(s=i.callee.name,n=i.callee):i.callee.type===te.AST_NODE_TYPES.MemberExpression&&i.callee.property.type===te.AST_NODE_TYPES.Identifier&&(s=i.callee.property.name,n=i.callee.property),s){let a=t.disallowHooks.find(p=>p.name===s);if(a&&n){if(r(i))return;e.report({node:i,messageId:"disallowedFunctionOrMethod",data:{functionOrMethod:a.name,replacement:a.replacement},suggest:[{messageId:"replace",data:{replacement:a.replacement},fix:p=>p.replaceText(n,a.replacement)}]})}}}if(t.disallowMethods?.length&&Ki(i.callee)){for(let s of i.arguments)if(s.type===te.AST_NODE_TYPES.ObjectExpression){for(let n of s.properties)if(n.type===te.AST_NODE_TYPES.Property&&n.key.type===te.AST_NODE_TYPES.Identifier){let a=n.key.name,p=t.disallowMethods.find(l=>l.name===a);if(p){if(r(i))return;if(p.requireTrueProp){let l=p.requireTrueProp,d=!1;for(let m of s.properties)if(m.type===te.AST_NODE_TYPES.Property&&m.key.type===te.AST_NODE_TYPES.Identifier&&m.key.name===l&&m.value.type===te.AST_NODE_TYPES.Literal&&m.value.value===!0){d=!0;break}if(!d){e.report({node:n,messageId:"disallowedMethodWithMissingRequireTrueProp",data:{method:p.name,requireTrueProp:l}});continue}}p.replacement&&e.report({node:n,messageId:"disallowedFunctionOrMethod",data:{functionOrMethod:p.name,replacement:p.replacement},suggest:[{messageId:"replace",data:{replacement:p.replacement},fix:l=>p.replacement?l.replaceText(n.key,p.replacement):null}]})}}}}}}}}),tn={name:Tr,rule:Qi};var B=require("@typescript-eslint/utils"),nn=require("zod/v4");var es=/\.(tsx|jsx)$/,ts=/^[A-Z][A-Za-z0-9]*$/,ns=/^[A-Z][A-Z0-9_]*$/,Er=80,rs=nn.z.object({ignoreConstCaseVarRegex:nn.z.string().optional()}),on=v({name:"react-no-module-level-single-use-values",meta:{type:"problem",docs:{description:"Disallow module-level allocated data values and long strings that are only used in one React component, excluding functions, inferable aliases, regex values, and class instantiations except Set/Map"},schema:[k(rs)],messages:{moveValueInsideComponent:"Module-level `{{valueName}}` is only used in React component `{{componentName}}`. Move it inside the component to improve memory usage."}},defaultOptions:[{}],create(e,[t]){if(!es.test(e.filename))return{};let o=e.sourceCode,r=ys(t.ignoreConstCaseVarRegex),i=os(o.ast.body);return i.length===0?{}:{VariableDeclarator(s){if(s.id.type!==B.AST_NODE_TYPES.Identifier||!is(s)||!ps(s.init))return;let n=s.id.name;if(r&&ds(n)&&r.test(n))return;let p=o.getDeclaredVariables(s).find(f=>f.name===n);if(!p)return;let l=new Set,d=!1,m=!1;for(let f of p.references){if(f.init)continue;m=!0;let c=ss(f.identifier,i);if(!c){d=!0;break}if(l.add(c),l.size>1)break}if(!m||d||l.size!==1)return;let[u]=Array.from(l);u&&e.report({node:s.id,messageId:"moveValueInsideComponent",data:{valueName:n,componentName:u}})}}}});function os(e){let t=[],o=new Set;function r(s,n){ts.test(s)&&(o.has(s)||(o.add(s),t.push({name:s,range:n.range})))}function i(s){for(let n of s.declarations){if(n.id.type!==B.AST_NODE_TYPES.Identifier)continue;let a=xr(n.init);a&&r(n.id.name,a)}}for(let s of e){if(s.type===B.AST_NODE_TYPES.VariableDeclaration){i(s);continue}if(s.type===B.AST_NODE_TYPES.FunctionDeclaration){r(s.id.name,s);continue}s.type===B.AST_NODE_TYPES.ExportNamedDeclaration&&s.declaration&&(s.declaration.type===B.AST_NODE_TYPES.VariableDeclaration?i(s.declaration):s.declaration.type===B.AST_NODE_TYPES.FunctionDeclaration&&s.declaration.id&&r(s.declaration.id.name,s.declaration))}return t}function is(e){return e.parent.parent.type===B.AST_NODE_TYPES.Program}function ss(e,t){let o=null;for(let r of t){if(!(e.range[0]>=r.range[0]&&e.range[1]<=r.range[1]))continue;if(!o){o=r;continue}let s=o.range[1]-o.range[0];r.range[1]-r.range[0]<s&&(o=r)}return o?.name??null}function xr(e){if(!e)return null;let t=rn(e);if(t.type===B.AST_NODE_TYPES.ArrowFunctionExpression||t.type===B.AST_NODE_TYPES.FunctionExpression)return t;if(t.type!==B.AST_NODE_TYPES.CallExpression||!as(t.callee))return null;let o=t.arguments[0];if(!o||o.type===B.AST_NODE_TYPES.SpreadElement)return null;if(o.type===B.AST_NODE_TYPES.CallExpression)return xr(o);let r=rn(o);return r.type===B.AST_NODE_TYPES.ArrowFunctionExpression||r.type===B.AST_NODE_TYPES.FunctionExpression?r:null}function as(e){return e.type===B.AST_NODE_TYPES.Identifier?e.name==="memo"||e.name==="forwardRef":e.type===B.AST_NODE_TYPES.MemberExpression?e.property.type===B.AST_NODE_TYPES.Identifier&&(e.property.name==="memo"||e.property.name==="forwardRef"):!1}function rn(e){let t=e;for(;;){if(t.type===B.AST_NODE_TYPES.TSAsExpression){t=t.expression;continue}if(t.type===B.AST_NODE_TYPES.TSSatisfiesExpression){t=t.expression;continue}if(t.type===B.AST_NODE_TYPES.TSNonNullExpression){t=t.expression;continue}return t}}function ps(e){if(!e)return!1;let t=rn(e);return ls(t)?!1:cs(t)?!0:us(t)}function ls(e){return e.type===B.AST_NODE_TYPES.Identifier||e.type===B.AST_NODE_TYPES.MemberExpression}function cs(e){if(e.type===B.AST_NODE_TYPES.Literal)return typeof e.value=="string"&&e.value.length>=Er;if(e.type===B.AST_NODE_TYPES.TemplateLiteral){if(e.expressions.length>0)return!1;let t=e.quasis[0];return t?t.value.cooked.length>=Er:!1}return!1}function us(e){return e.type===B.AST_NODE_TYPES.ArrayExpression||e.type===B.AST_NODE_TYPES.ObjectExpression||e.type===B.AST_NODE_TYPES.ClassExpression?!0:e.type===B.AST_NODE_TYPES.NewExpression?fs(e):!1}function fs(e){let t=ms(e.callee);return t==="Set"||t==="Map"}function ms(e){return e.type===B.AST_NODE_TYPES.Identifier?e.name:e.type===B.AST_NODE_TYPES.MemberExpression?e.computed||e.property.type!==B.AST_NODE_TYPES.Identifier?null:e.property.name:null}function ds(e){return ns.test(e)}function ys(e){if(!e)return null;try{return new RegExp(e)}catch{return null}}var O=require("@typescript-eslint/utils"),an=require("zod");var gs=an.z.object({runOnlyWithEnableCompilerDirective:an.z.boolean().optional()}),Ss=/eslint +react-compiler\/react-compiler: +\["error/,Ts=/^\d+$/,Es=/[\s_-]+/,xs=/[a-z][A-Z]/,hs=/^(.+?)([A-Z][a-z]+s?)$/,bs=/^[a-z][a-zA-Z]*$/;function hr(e,t){let o=[];if(e.type===O.AST_NODE_TYPES.JSXElement){for(let r of e.openingElement.attributes)if(r.type===O.AST_NODE_TYPES.JSXAttribute&&r.name.type===O.AST_NODE_TYPES.JSXIdentifier&&r.value?.type===O.AST_NODE_TYPES.JSXExpressionContainer&&r.value.expression.type!==O.AST_NODE_TYPES.JSXEmptyExpression){let i=r.name.name,s=r.value.expression,n=!1;Re(s,a=>{switch(a.type){case O.AST_NODE_TYPES.ObjectExpression:case O.AST_NODE_TYPES.ArrowFunctionExpression:case O.AST_NODE_TYPES.FunctionExpression:case O.AST_NODE_TYPES.ArrayExpression:return n=!0,!0}return!1},t),n&&o.push(i)}}return{hasUnstable:o.length>0,problematicProps:o}}function Cs(e){if(e.body.type===O.AST_NODE_TYPES.JSXElement||e.body.type===O.AST_NODE_TYPES.JSXFragment)return!0;if(e.body.type===O.AST_NODE_TYPES.BlockStatement){for(let t of e.body.body)if(t.type===O.AST_NODE_TYPES.ReturnStatement&&t.argument&&(t.argument.type===O.AST_NODE_TYPES.JSXElement||t.argument.type===O.AST_NODE_TYPES.JSXFragment))return!0}return!1}function As(e,t){let o=e.callee;if(o.type===O.AST_NODE_TYPES.MemberExpression){let r=o.object;if(r.type===O.AST_NODE_TYPES.Identifier){let i=r.name,s=Is(i);if(s!==i)return pn(s)}}if(t.length>0){let r=t[0];if(r&&r.type===O.AST_NODE_TYPES.Identifier)return pn(r.name)}return"ListItem"}function Is(e){let o={people:"person",children:"child",feet:"foot",teeth:"tooth",mice:"mouse",men:"man",women:"woman"}[e.toLowerCase()];if(o)return o;if(e.match(xs)){let r=e.match(hs);if(r){let i=r[1],s=r[2];if(!i||!s)return sn(e);let n=sn(s);if(n!==s)return i+n}}return sn(e)}function sn(e){return e.endsWith("ies")?`${e.slice(0,-3)}y`:e.endsWith("es")&&e.length>3?e.slice(0,-2):e.endsWith("s")&&e.length>1?e.slice(0,-1):e}function pn(e){return e.match(bs)?e.charAt(0).toUpperCase()+e.slice(1):e.split(Es).map(t=>t.charAt(0).toUpperCase()+t.slice(1).toLowerCase()).join("")}function br(e,t,o){let r=[],i=new Set,s=new Set(["console","document","window","Math","Object","Array","String","Number","Boolean","undefined","null"]);Re(e,n=>{if(n.type===O.AST_NODE_TYPES.Identifier&&!t.includes(n.name)&&!s.has(n.name)&&!Ts.test(n.name)){let a=n.parent;if(a.type===O.AST_NODE_TYPES.Property&&a.key===n||a.type===O.AST_NODE_TYPES.MemberExpression&&a.property===n&&!a.computed||a.type===O.AST_NODE_TYPES.JSXOpeningElement||a.type===O.AST_NODE_TYPES.JSXClosingElement||a.type===O.AST_NODE_TYPES.JSXAttribute&&a.name.type===O.AST_NODE_TYPES.JSXIdentifier&&a.name.name===n.name)return!1;i.add(n.name)}return!1},o);for(let n of i)t.includes(n)||r.push({name:n,type:"unknown"});return r}function Cr(e,t,o,r,i){let n=[...o.map(m=>m.type===O.AST_NODE_TYPES.Identifier?m.name:"item").map((m,u)=>({name:m,type:u===0?`${e}Type`:u===1?"number":"unknown"})),...r],a=n.map(m=>{let u=m.type;return m.name.includes("on")&&u==="any"&&(u="unknown"),` ${m.name}: ${u};`}).join(`
12
+ `),p=n.map(m=>m.name).join(", "),l=i.getText(t),d=`${e}Props`;return`type ${d} = {
24
13
  ${a}
25
14
  };
26
15
 
27
- const ${e}: FC<${m}> = ({ ${l} }) => {
16
+ const ${e}: FC<${d}> = ({ ${p} }) => {
28
17
  return (
29
- ${p}
18
+ ${l}
30
19
  );
31
- };`}function Ka(e,t,r,n){let s=t.map(i=>i.type===V.AST_NODE_TYPES.Identifier?i.name:"item"),o=[n?`key={${n}}`:`key={${s[0]}.id}`,...s.map(i=>`${i}={${i}}`),...r.map(i=>`${i.name}={${i.name}}`)].filter(Boolean);return`<${e} ${o.join(" ")} />`}function Qa(e){if(e.type===V.AST_NODE_TYPES.JSXElement&&e.openingElement.name.type===V.AST_NODE_TYPES.JSXIdentifier){let t=e.openingElement.name.name;if(t!=="div"&&t!=="span")return Vn(t)}return"ListItem"}function el(e,t,r){let n=[r?`key={${r}}`:"",...t.map(s=>`${s.name}={${s.name}}`)].filter(Boolean);return`<${e}${n.length>0?` ${n.join(" ")}`:""} />`}function hi(e,t){for(let r of e.openingElement.attributes)if(r.type===V.AST_NODE_TYPES.JSXAttribute&&r.name.type===V.AST_NODE_TYPES.JSXIdentifier&&r.name.name==="key"&&r.value&&r.value.type===V.AST_NODE_TYPES.JSXExpressionContainer&&r.value.expression.type!==V.AST_NODE_TYPES.JSXEmptyExpression)return t.getText(r.value.expression);return null}var Wn=z({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:[U(Va)],hasSuggestions:!0},defaultOptions:[{runOnlyWithEnableCompilerDirective:!1}],create(e,[t]){let{sourceCode:r}=e;if(t.runOnlyWithEnableCompilerDirective){let n=!1;for(let s of r.getAllComments())if(Wa.test(s.value)){n=!0;break}if(!n)return{}}return{CallExpression(n){n.callee.type===V.AST_NODE_TYPES.MemberExpression&&n.callee.property.type===V.AST_NODE_TYPES.Identifier&&(n.callee.property.name==="map"||n.callee.property.name==="push")&&(n.callee.property.name==="map"?tl(n,r,e):nl(n,r,e))}}}});function tl(e,t,r){let n=e.arguments[0];if(!n||n.type!==V.AST_NODE_TYPES.ArrowFunctionExpression&&n.type!==V.AST_NODE_TYPES.FunctionExpression||!qa(n))return;let s=null;if(n.body.type===V.AST_NODE_TYPES.JSXElement||n.body.type===V.AST_NODE_TYPES.JSXFragment?s=n.body:n.body.type===V.AST_NODE_TYPES.BlockStatement&&n.body.body[0]?.type===V.AST_NODE_TYPES.ReturnStatement&&n.body.body[0].argument&&(n.body.body[0].argument.type===V.AST_NODE_TYPES.JSXElement||n.body.body[0].argument.type===V.AST_NODE_TYPES.JSXFragment)&&(s=n.body.body[0].argument),!s)return;let o=Si(s,t);if(!o.hasUnstable)return;let i=Za(e,n.params),a=n.params.map(y=>y.type===V.AST_NODE_TYPES.Identifier?y.name:"item"),l=Ti(s,a,t),p=s.type===V.AST_NODE_TYPES.JSXElement?hi(s,t):null,m=o.problematicProps.length===1?`prop "${o.problematicProps[0]}"`:`props "${o.problematicProps.join('", "')}"`;r.report({node:s,messageId:"unstableValueInMap",data:{problematicProps:m},suggest:[{messageId:"extractComponent",data:{componentName:i},fix:y=>{let u=Ei(i,s,n.params,l,t),d=Ka(i,n.params,l,p),c=e;for(;c.parent.type!==V.AST_NODE_TYPES.Program&&!(c.type===V.AST_NODE_TYPES.FunctionDeclaration||c.type===V.AST_NODE_TYPES.VariableDeclarator&&c.init&&(c.init.type===V.AST_NODE_TYPES.ArrowFunctionExpression||c.init.type===V.AST_NODE_TYPES.FunctionExpression));)c=c.parent;let g=[];return g.push(y.insertTextAfter(c,`
20
+ };`}function Ps(e,t,o,r){let i=t.map(n=>n.type===O.AST_NODE_TYPES.Identifier?n.name:"item"),s=[r?`key={${r}}`:`key={${i[0]}.id}`,...i.map(n=>`${n}={${n}}`),...o.map(n=>`${n.name}={${n.name}}`)].filter(Boolean);return`<${e} ${s.join(" ")} />`}function Ns(e){if(e.type===O.AST_NODE_TYPES.JSXElement&&e.openingElement.name.type===O.AST_NODE_TYPES.JSXIdentifier){let t=e.openingElement.name.name;if(t!=="div"&&t!=="span")return pn(t)}return"ListItem"}function Rs(e,t,o){let r=[o?`key={${o}}`:"",...t.map(i=>`${i.name}={${i.name}}`)].filter(Boolean);return`<${e}${r.length>0?` ${r.join(" ")}`:""} />`}function Ar(e,t){for(let o of e.openingElement.attributes)if(o.type===O.AST_NODE_TYPES.JSXAttribute&&o.name.type===O.AST_NODE_TYPES.JSXIdentifier&&o.name.name==="key"&&o.value&&o.value.type===O.AST_NODE_TYPES.JSXExpressionContainer&&o.value.expression.type!==O.AST_NODE_TYPES.JSXEmptyExpression)return t.getText(o.value.expression);return null}var ln=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:[k(gs)],hasSuggestions:!0},defaultOptions:[{runOnlyWithEnableCompilerDirective:!1}],create(e,[t]){let{sourceCode:o}=e;if(t.runOnlyWithEnableCompilerDirective){let r=!1;for(let i of o.getAllComments())if(Ss.test(i.value)){r=!0;break}if(!r)return{}}return{CallExpression(r){r.callee.type===O.AST_NODE_TYPES.MemberExpression&&r.callee.property.type===O.AST_NODE_TYPES.Identifier&&(r.callee.property.name==="map"||r.callee.property.name==="push")&&(r.callee.property.name==="map"?ws(r,o,e):Fs(r,o,e))}}}});function ws(e,t,o){let r=e.arguments[0];if(!r||r.type!==O.AST_NODE_TYPES.ArrowFunctionExpression&&r.type!==O.AST_NODE_TYPES.FunctionExpression||!Cs(r))return;let i=null;if(r.body.type===O.AST_NODE_TYPES.JSXElement||r.body.type===O.AST_NODE_TYPES.JSXFragment?i=r.body:r.body.type===O.AST_NODE_TYPES.BlockStatement&&r.body.body[0]?.type===O.AST_NODE_TYPES.ReturnStatement&&r.body.body[0].argument&&(r.body.body[0].argument.type===O.AST_NODE_TYPES.JSXElement||r.body.body[0].argument.type===O.AST_NODE_TYPES.JSXFragment)&&(i=r.body.body[0].argument),!i)return;let s=hr(i,t);if(!s.hasUnstable)return;let n=As(e,r.params),a=r.params.map(m=>m.type===O.AST_NODE_TYPES.Identifier?m.name:"item"),p=br(i,a,t),l=i.type===O.AST_NODE_TYPES.JSXElement?Ar(i,t):null,d=s.problematicProps.length===1?`prop "${s.problematicProps[0]}"`:`props "${s.problematicProps.join('", "')}"`;o.report({node:i,messageId:"unstableValueInMap",data:{problematicProps:d},suggest:[{messageId:"extractComponent",data:{componentName:n},fix:m=>{let u=Cr(n,i,r.params,p,t),f=Ps(n,r.params,p,l),c=e;for(;c.parent.type!==O.AST_NODE_TYPES.Program&&!(c.type===O.AST_NODE_TYPES.FunctionDeclaration||c.type===O.AST_NODE_TYPES.VariableDeclarator&&c.init&&(c.init.type===O.AST_NODE_TYPES.ArrowFunctionExpression||c.init.type===O.AST_NODE_TYPES.FunctionExpression));)c=c.parent;let g=[];return g.push(m.insertTextAfter(c,`
32
21
 
33
- ${u}`)),g.push(y.replaceText(s,d)),g}}]})}function nl(e,t,r){let n=e.arguments[0];if(!n||n.type!==V.AST_NODE_TYPES.JSXElement&&n.type!==V.AST_NODE_TYPES.JSXFragment)return;let s=n,o=Si(s,t);if(!o.hasUnstable)return;let i=Qa(s),a=Ti(s,[],t),l=s.type===V.AST_NODE_TYPES.JSXElement?hi(s,t):null,p=o.problematicProps.length===1?`prop "${o.problematicProps[0]}"`:`props "${o.problematicProps.join('", "')}"`;r.report({node:s,messageId:"unstableValueInMap",data:{problematicProps:p},suggest:[{messageId:"extractComponent",data:{componentName:i},fix:m=>{let y=Ei(i,s,[],a,t),u=el(i,a,l),d=e;for(;d.parent.type!==V.AST_NODE_TYPES.Program&&!(d.type===V.AST_NODE_TYPES.FunctionDeclaration||d.type===V.AST_NODE_TYPES.VariableDeclarator&&d.init&&(d.init.type===V.AST_NODE_TYPES.ArrowFunctionExpression||d.init.type===V.AST_NODE_TYPES.FunctionExpression));)d=d.parent;let c=[];return c.push(m.insertTextAfter(d,`
22
+ ${u}`)),g.push(m.replaceText(i,f)),g}}]})}function Fs(e,t,o){let r=e.arguments[0];if(!r||r.type!==O.AST_NODE_TYPES.JSXElement&&r.type!==O.AST_NODE_TYPES.JSXFragment)return;let i=r,s=hr(i,t);if(!s.hasUnstable)return;let n=Ns(i),a=br(i,[],t),p=i.type===O.AST_NODE_TYPES.JSXElement?Ar(i,t):null,l=s.problematicProps.length===1?`prop "${s.problematicProps[0]}"`:`props "${s.problematicProps.join('", "')}"`;o.report({node:i,messageId:"unstableValueInMap",data:{problematicProps:l},suggest:[{messageId:"extractComponent",data:{componentName:n},fix:d=>{let m=Cr(n,i,[],a,t),u=Rs(n,a,p),f=e;for(;f.parent.type!==O.AST_NODE_TYPES.Program&&!(f.type===O.AST_NODE_TYPES.FunctionDeclaration||f.type===O.AST_NODE_TYPES.VariableDeclarator&&f.init&&(f.init.type===O.AST_NODE_TYPES.ArrowFunctionExpression||f.init.type===O.AST_NODE_TYPES.FunctionExpression));)f=f.parent;let c=[];return c.push(d.insertTextAfter(f,`
34
23
 
35
- ${y}`)),c.push(m.replaceText(s,u)),c}}]})}var Mt=require("@typescript-eslint/utils"),rl=Mt.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),bi="require-description",il=/^(eslint(?:-env|-enable|-disable(?:(?:-next)?-line)?)?|oxlint-(?:enable|disable(?:(?:-next)?-line)?)|exported|globals?)(?:\s|$)/u,sl=/^(?:eslint|oxlint)-disable-(next-)?line$/u,ol=rl({name:bi,meta:{type:"problem",docs:{description:"Require descriptions for eslint and oxlint 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","oxlint-disable","oxlint-disable-line","oxlint-disable-next-line","oxlint-enable","exported","global","globals"]},additionalItems:!1,uniqueItems:!0}},additionalProperties:!1}]},defaultOptions:[{ignore:[]}],create(e,[t]){let r=e.sourceCode,n=new Set(t.ignore||[]);return{Program(){for(let s of r.getAllComments()){let o=al(s);o!=null&&(n.has(o.kind)||o.description||e.report({loc:cl(s.loc),messageId:"missingDescription"}))}}}}}),xi={name:bi,rule:ol};function al(e){let{text:t,description:r}=pl(e.value);if(!t)return null;let n=il.exec(t);if(!n)return null;let s=n[1];if(!s)return null;let o=sl.test(s);if(e.type===Mt.TSESTree.AST_TOKEN_TYPES.Line&&!o||o&&e.loc.start.line!==e.loc.end.line)return null;let i=t.slice(n.index+s.length);return{kind:s,value:i.trim(),description:r}}var ll=/\s-{2,}\s/u;function pl(e){let t=e.split(ll);return{text:t[0]?.trim(),description:t.length>1?t[1]?.trim()??null:null}}function cl(e){return{start:{line:e.start.line,column:0},end:e.end}}var ne=require("@typescript-eslint/utils"),We=require("zod/v4");var ul=We.z.object({varsToCheck:We.z.array(We.z.object({selector:We.z.string().optional(),fromFnCall:We.z.string().optional(),prop:We.z.string().or(We.z.array(We.z.string())),errorMsg:We.z.string().optional()}))}),Jn=z({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:[U(ul)]},defaultOptions:[{varsToCheck:[]}],create(e,[t]){let r=new Map;function n(i,a,l,p){let m=new Set;for(let u of i.properties)u.type===ne.AST_NODE_TYPES.Property&&u.key.type===ne.AST_NODE_TYPES.Identifier&&m.add(u.key.name);let y=a.filter(u=>!m.has(u));if(y.length>0)if(y.length===1)e.report({node:i,messageId:"propNotRead",data:{prop:y[0],fnName:p,customMsg:l||""}});else{let u=y.map(d=>`"${d}"`).join(", ");e.report({node:i,messageId:"propsNotRead",data:{props:u,fnName:p,customMsg:l||""}})}}function s(i){if(i.init?.type===ne.AST_NODE_TYPES.CallExpression){if(i.init.callee.type===ne.AST_NODE_TYPES.Identifier)return i.init.callee.name;if(i.init.callee.type===ne.AST_NODE_TYPES.MemberExpression&&i.init.callee.property.type===ne.AST_NODE_TYPES.Identifier)return i.init.callee.object.type===ne.AST_NODE_TYPES.Identifier?`${i.init.callee.object.name}.${i.init.callee.property.name}`:i.init.callee.property.name}return"unknown function"}let o={};for(let i of t.varsToCheck)i.selector&&(o[i.selector]=a=>{if(a.type===ne.AST_NODE_TYPES.VariableDeclarator&&a.id.type===ne.AST_NODE_TYPES.Identifier&&r.set(a.id.name,{props:Array.isArray(i.prop)?i.prop:[i.prop],errorMsg:i.errorMsg,node:a.id,fnName:s(a)}),a.type===ne.AST_NODE_TYPES.VariableDeclarator&&a.id.type===ne.AST_NODE_TYPES.ObjectPattern){let l=Array.isArray(i.prop)?i.prop:[i.prop];n(a.id,l,i.errorMsg,s(a))}});for(let i of t.varsToCheck)if(i.fromFnCall){let a=i.fromFnCall;if(a.startsWith("*.")){let p=`VariableDeclarator > CallExpression > MemberExpression[property.name="${a.slice(2)}"]`;o[p]=m=>{if(m.type!==ne.AST_NODE_TYPES.MemberExpression||m.parent.type!==ne.AST_NODE_TYPES.CallExpression)return;let y=m.parent;if(y.parent.type!==ne.AST_NODE_TYPES.VariableDeclarator)return;let u=y.parent;if(u.id.type===ne.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===ne.AST_NODE_TYPES.ObjectPattern){let d=Array.isArray(i.prop)?i.prop:[i.prop];n(u.id,d,i.errorMsg,i.fromFnCall||"unknown function")}}}else if(a.includes(".")){let[l,p]=a.split("."),m=`VariableDeclarator > CallExpression > MemberExpression[object.name="${l}"][property.name="${p}"]`;o[m]=y=>{if(y.type!==ne.AST_NODE_TYPES.MemberExpression||y.parent.type!==ne.AST_NODE_TYPES.CallExpression)return;let u=y.parent;if(u.parent.type!==ne.AST_NODE_TYPES.VariableDeclarator)return;let d=u.parent;if(d.id.type===ne.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===ne.AST_NODE_TYPES.ObjectPattern){let c=Array.isArray(i.prop)?i.prop:[i.prop];n(d.id,c,i.errorMsg,i.fromFnCall||"unknown function")}}}else{let l=`VariableDeclarator > CallExpression > Identifier[name="${a}"]`;o[l]=p=>{if(p.type!==ne.AST_NODE_TYPES.Identifier||p.parent.type!==ne.AST_NODE_TYPES.CallExpression)return;let m=p.parent;if(m.parent.type!==ne.AST_NODE_TYPES.VariableDeclarator)return;let y=m.parent;if(y.id.type===ne.AST_NODE_TYPES.Identifier)r.set(y.id.name,{props:Array.isArray(i.prop)?i.prop:[i.prop],errorMsg:i.errorMsg,node:y.id,fnName:i.fromFnCall||"unknown function"});else if(y.id.type===ne.AST_NODE_TYPES.ObjectPattern){let u=Array.isArray(i.prop)?i.prop:[i.prop];n(y.id,u,i.errorMsg,i.fromFnCall||"unknown function")}}}}return{...o,"Program:exit"(){for(let[i,{props:a,errorMsg:l,node:p,fnName:m}]of r){let u=e.sourceCode.getScope(p).set.get(i);if(u){let d=new Set(a);for(let c of u.references){let g=c.identifier,h=g.parent;if(!(h.type===ne.AST_NODE_TYPES.VariableDeclarator&&h.id===g)){if(h.type===ne.AST_NODE_TYPES.MemberExpression&&h.object===g&&h.property.type===ne.AST_NODE_TYPES.Identifier&&d.has(h.property.name)){if(d.delete(h.property.name),d.size===0)break;continue}if(h.type===ne.AST_NODE_TYPES.VariableDeclarator&&h.init===g&&h.id.type===ne.AST_NODE_TYPES.ObjectPattern){for(let S of h.id.properties)S.type===ne.AST_NODE_TYPES.Property&&S.key.type===ne.AST_NODE_TYPES.Identifier&&d.has(S.key.name)&&d.delete(S.key.name);if(d.size===0)break;continue}if(!(h.type===ne.AST_NODE_TYPES.MemberExpression&&h.object===g&&h.property.type===ne.AST_NODE_TYPES.Identifier&&!a.includes(h.property.name))){d.clear();break}}}if(d.size>0){let c=Array.from(d);if(c.length===1)e.report({node:p,messageId:"propNotRead",data:{prop:c[0],fnName:m,customMsg:l||""}});else{let g=c.map(h=>`"${h}"`).join(", ");e.report({node:p,messageId:"propsNotRead",data:{props:g,fnName:m,customMsg:l||""}})}}}}}}}});function Fi(e){return/^use[A-Z0-9]/.test(e)}function $t(e){return e.type==="Identifier"?Fi(e.name):e.type==="MemberExpression"&&!e.computed&&$t(e.property)?e.object.type==="Identifier":!1}function vi(e){return e.type==="Identifier"&&/^[A-Z]/.test(e.name)}function Ri(e,t){return e.name===t||e.type==="MemberExpression"&&e.object.name==="React"&&e.property.name===t}function Ni(e){return!!(e.parent&&e.parent.callee&&Ri(e.parent.callee,"forwardRef"))}function ki(e){return!!(e.parent&&e.parent.callee&&Ri(e.parent.callee,"memo"))}function Xn(e){for(;e;){let t=Oi(e);if(t&&(vi(t)||$t(t))||Ni(e)||ki(e))return!0;e=e.parent}return!1}function Ci(e){return!1}function Bn(e){return!1}var fl=/eslint +react-compiler\/react-compiler: +\["error/;function Ii(e){let t=null;if((e.type==="FunctionDeclaration"||e.type==="FunctionExpression"||e.type==="ArrowFunctionExpression"&&e.body.type==="BlockStatement")&&(t=e.body),!t||t.body.length===0)return!1;let r=t.body[0];return r.type==="ExpressionStatement"&&r.expression.type==="Literal"&&r.expression.value==="use no memo"}function Ai(e){let t=e.parent;for(;t;){if(t.type==="FunctionDeclaration"||t.type==="FunctionExpression"||t.type==="ArrowFunctionExpression")return t;t=t.parent}return null}var Pi={meta:{type:"problem",docs:{description:"enforces the Rules of Hooks",recommended:!0,url:"https://reactjs.org/docs/hooks-rules.html"},schema:[{type:"object",ignoreIfReactCompilerIsEnabled:!1,properties:{ignoreIfReactCompilerIsEnabled:{type:"boolean"},reactCompilerIsEnabled:{type:"boolean"}}}]},create(e){let t=!!e.options[0]?.reactCompilerIsEnabled;if(t)return{CallExpression(p){let m=null;if(p.callee.name==="useMemo"?m="useMemo":p.callee.name==="useCallback"&&(m="useCallback"),m){let y=Ai(p);if(y&&Ii(y))return;e.report({node:p,message:`"${m}" is not necessary when using React Compiler.`})}}};if(e.options[0]?.ignoreIfReactCompilerIsEnabled||t){for(let p of e.sourceCode.getAllComments())if(fl.test(p.value))return{CallExpression(m){let y=null;if(m.callee.name==="useMemo"?y="useMemo":m.callee.name==="useCallback"&&(y="useCallback"),y){let u=Ai(m);if(u&&Ii(u))return;e.report({node:m,message:`"${y}" is not necessary when using React Compiler.`})}}}}let r=typeof e.getSource=="function"?p=>r(p):p=>e.sourceCode.getText(p),n=typeof e.getScope=="function"?()=>n():p=>e.sourceCode.getScope(p),s=null,o=[],i=[],a=new WeakSet;function l(p){for(let m of p.references){let y=m.identifier.parent;if(y.type==="VariableDeclarator"&&y.init&&y.init.type==="CallExpression"&&y.init.callee&&Ci(y.init.callee))for(let u of m.resolved.references)u!==m&&a.add(u.identifier)}}return{onCodePathSegmentStart:p=>i.push(p),onCodePathSegmentEnd:()=>i.pop(),onCodePathStart:()=>o.push(new Map),onCodePathEnd(p,m){let y=o.pop();if(y.size===0)return;let u=new Set;function d(b,C){let{cache:w}=d,N=w.get(b.id),k=new Set(C);if(k.has(b.id)){let O=[...k],f=O.slice(O.indexOf(b.id)+1);for(let x of f)u.add(x);return BigInt("0")}if(k.add(b.id),N!==void 0)return N;if(p.thrownSegments.includes(b))N=BigInt("0");else if(b.prevSegments.length===0)N=BigInt("1");else{N=BigInt("0");for(let O of b.prevSegments)N+=d(O,k)}return b.reachable&&N===BigInt("0")?w.delete(b.id):w.set(b.id,N),N}function c(b,C){let{cache:w}=c,N=w.get(b.id),k=new Set(C);if(k.has(b.id)){let O=Array.from(k),f=O.slice(O.indexOf(b.id)+1);for(let x of f)u.add(x);return BigInt("0")}if(k.add(b.id),N!==void 0)return N;if(p.thrownSegments.includes(b))N=BigInt("0");else if(b.nextSegments.length===0)N=BigInt("1");else{N=BigInt("0");for(let O of b.nextSegments)N+=c(O,k)}return w.set(b.id,N),N}function g(b){let{cache:C}=g,w=C.get(b.id);if(w===null)return 1/0;if(w!==void 0)return w;if(C.set(b.id,null),b.prevSegments.length===0)w=1;else{w=1/0;for(let N of b.prevSegments){let k=g(N);k<w&&(w=k)}w+=1}return C.set(b.id,w),w}d.cache=new Map,c.cache=new Map,g.cache=new Map;let h=c(p.initialSegment),S=Oi(m),I=Xn(m),A=S?vi(S)||$t(S):Ni(m)||ki(m),T=1/0;for(let b of p.finalSegments){if(!b.reachable)continue;let C=g(b);C<T&&(T=C)}for(let[b,C]of y){if(!b.reachable)continue;let w=b.nextSegments.length===0?T<=g(b):T<g(b),N=d(b)*c(b),k=u.has(b.id);for(let O of C)if(k&&!Bn(O)&&e.report({node:O,message:`React Hook "${r(O)}" may be executed more than once. Possibly because it is called in a loop. React Hooks must be called in the exact same order in every component render.`}),A){if(m.async&&e.report({node:O,message:`React Hook "${r(O)}" cannot be called in an async function.`}),!k&&N!==h&&!Bn(O)){let x=`React Hook "${r(O)}" is called conditionally. React Hooks must be called in the exact same order in every component render.`+(w?" Did you accidentally call a React Hook after an early return?":"");e.report({node:O,message:x})}}else if(m.parent&&(m.parent.type==="MethodDefinition"||m.parent.type==="ClassProperty")&&m.parent.value===m){let f=`React Hook "${r(O)}" 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:O,message:f})}else if(S){let f=`React Hook "${r(O)}" is called in function "${r(S)}" that is neither a React function component nor a custom React Hook function. React component names must start with an uppercase letter. React Hook names must start with the word "use".`;e.report({node:O,message:f})}else if(m.type==="Program"){let f=`React Hook "${r(O)}" 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:O,message:f})}else if(I&&!Bn(O)){if(m.parent.type==="CallExpression"&&m.parent.callee.type==="Identifier"&&m.parent.callee.name==="useCallback"){let x=m.parent;if(x.parent.type==="VariableDeclarator"&&Fi(x.parent.id.name))return}let f=`React Hook "${r(O)}" 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:O,message:f})}}},CallExpression(p){if($t(p.callee)){let m=wi(o),y=wi(i),u=m.get(y);u||(u=[],m.set(y,u)),u.push(p.callee)}p.callee.type==="Identifier"&&(p.callee.name==="useEffect"||Ci(p.callee))&&p.arguments.length>0&&(s=p)},Identifier(p){s==null&&a.has(p)&&p.parent.type!=="CallExpression"&&e.report({node:p,message:`\`${r(p)}\` 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"(p){p===s&&(s=null)},FunctionDeclaration(p){Xn(p)&&l(n(p))},ArrowFunctionExpression(p){Xn(p)&&l(n(p))}}}};function Oi(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 wi(e){return e[e.length-1]}var Ee=require("@typescript-eslint/utils"),Ie=Re(require("zod/v4"));var ml=/^\s+$/,Hn=/\r?\n/,yl=/^(\s*)/,dl=/^(\s*)\S/,gl=/\r?\n/,Sl=Ie.object({indent:Ie.union([Ie.string().regex(ml),Ie.number().int().min(1)]).optional(),tags:Ie.array(Ie.string()).optional(),functions:Ie.array(Ie.string()).optional(),comments:Ie.array(Ie.string()).optional()}),Yn=z({name:"template-indent",meta:{type:"suggestion",docs:{description:"Fix whitespace-insensitive template indentation"},fixable:"code",schema:[U(Sl)],messages:{improperlyIndented:"Templates should be properly indented."}},defaultOptions:[{}],create(e){let t=e.sourceCode,{comments:r=["HTML","indent"],functions:n=["dedent","stripIndent"],tags:s=["outdent","dedent","gql","sql","html","styled"],indent:o}=e.options[0],i=r.map(S=>S.toLowerCase());function a(S){let I=S.split(Hn),A=I.filter(b=>b.trim()!=="");if(A.length===0)return S;let T=Number.POSITIVE_INFINITY;for(let b of A){let C=b.match(yl);C&&(T=Math.min(T,C[1]?.length??0))}return!isFinite(T)||T===0?S:I.map(b=>b.slice(T)).join(`
36
- `)}function l(S,I,A){return S.split(Hn).map(b=>b.trim()===""?b:A.repeat(I)+b).join(`
37
- `)}function p(S){if(S.type===Ee.AST_NODE_TYPES.Identifier)return S.name;if(S.type===Ee.AST_NODE_TYPES.MemberExpression){let I=S.object.type===Ee.AST_NODE_TYPES.Identifier?S.object.name:null,A=S.property.type===Ee.AST_NODE_TYPES.Identifier?S.property.name:null;return I&&A?`${I}.${A}`:A}return null}function m(S,I){if(!S)return!1;for(let A of I)if(A.includes(".")){let T=A.split(".");if(S.type===Ee.AST_NODE_TYPES.MemberExpression&&S.object.type===Ee.AST_NODE_TYPES.Identifier&&S.property.type===Ee.AST_NODE_TYPES.Identifier&&S.object.name===T[0]&&S.property.name===T[1])return!0}else if(S.type===Ee.AST_NODE_TYPES.Identifier&&S.name===A)return!0;return!1}function y(S,I){let A=S.parent;if(A.type!==Ee.AST_NODE_TYPES.TaggedTemplateExpression)return!1;let T=p(A.tag);return T?I.includes(T):!1}function u(S,I){if(!S||S.type!==Ee.AST_NODE_TYPES.CallExpression)return!1;let{method:A,argumentsLength:T,optionalCall:b=!0,optionalMember:C=!0}=I;return T!==void 0&&S.arguments.length!==T||!b&&S.optional||S.callee.type!==Ee.AST_NODE_TYPES.MemberExpression||!C&&S.callee.optional||S.callee.property.type!==Ee.AST_NODE_TYPES.Identifier?!1:S.callee.property.name===A}function d(S,I){if(!S||S.type!==Ee.AST_NODE_TYPES.CallExpression)return!1;let{name:A,argumentsLength:T,optionalCall:b=!0}=I;return T!==void 0&&S.arguments.length!==T||!b&&S.optional||S.callee.type!==Ee.AST_NODE_TYPES.Identifier?!1:S.callee.name===A}function c(S){return u(S.parent,{method:"toMatchInlineSnapshot",argumentsLength:1,optionalCall:!1,optionalMember:!1})&&S.parent.type===Ee.AST_NODE_TYPES.CallExpression&&S.parent.arguments[0]===S&&d(S.parent.callee.type===Ee.AST_NODE_TYPES.MemberExpression?S.parent.callee.object:null,{name:"expect",argumentsLength:1,optionalCall:!1,optionalMember:!1})}function g(S){if(i.length>0){let I=t.getTokenBefore(S,{includeComments:!0});if(I?.type===Ee.AST_TOKEN_TYPES.Block&&i.includes(I.value.trim().toLowerCase()))return!0}return!!(c(S)||s.length>0&&y(S,s)||n.length>0&&S.parent.type===Ee.AST_NODE_TYPES.CallExpression&&S.parent.arguments.includes(S)&&m(S.parent.callee,n))}function h(S){let I=`__PLACEHOLDER__${Math.random()}`,A=S.quasis.map(M=>t.getText(M).slice(1,M.tail?-1:-2)).join(I),T=A.match(gl);if(!T)return;let b=T[0],C=t.lines[t.getLocFromIndex(S.range[0]).line-1];if(!C)return;let N=C.match(dl)?.[1]??"",k;typeof o=="string"?k=o:typeof o=="number"?k=" ".repeat(o):k=N.startsWith(" ")?" ":" ";let f=a(A).replace(new RegExp(`^${b}|${b}[ ]*$`,"g"),""),x=b+l(f,1,N+k)+b+N,E=A.includes(`\r
24
+ ${m}`)),c.push(d.replaceText(i,u)),c}}]})}var ft=require("@typescript-eslint/utils"),Os=ft.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),Ir="require-description",Ds=/^(eslint(?:-env|-enable|-disable(?:(?:-next)?-line)?)?|oxlint-(?:enable|disable(?:(?:-next)?-line)?)|exported|globals?)(?:\s|$)/u,vs=/^(?:eslint|oxlint)-disable-(next-)?line$/u,ks=Os({name:Ir,meta:{type:"problem",docs:{description:"Require descriptions for eslint and oxlint 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","oxlint-disable","oxlint-disable-line","oxlint-disable-next-line","oxlint-enable","exported","global","globals"]},additionalItems:!1,uniqueItems:!0}},additionalProperties:!1}]},defaultOptions:[{ignore:[]}],create(e,[t]){let o=e.sourceCode,r=new Set(t.ignore||[]);return{Program(){for(let i of o.getAllComments()){let s=js(i);s!=null&&(r.has(s.kind)||s.description||e.report({loc:_s(i.loc),messageId:"missingDescription"}))}}}}}),Pr={name:Ir,rule:ks};function js(e){let{text:t,description:o}=Ls(e.value);if(!t)return null;let r=Ds.exec(t);if(!r)return null;let i=r[1];if(!i)return null;let s=vs.test(i);if(e.type===ft.TSESTree.AST_TOKEN_TYPES.Line&&!s||s&&e.loc.start.line!==e.loc.end.line)return null;let n=t.slice(r.index+i.length);return{kind:i,value:n.trim(),description:o}}var Ms=/\s-{2,}\s/u;function Ls(e){let t=e.split(Ms);return{text:t[0]?.trim(),description:t.length>1?t[1]?.trim()??null:null}}function _s(e){return{start:{line:e.start.line,column:0},end:e.end}}var z=require("@typescript-eslint/utils"),Pe=require("zod/v4");var $s=Pe.z.object({varsToCheck:Pe.z.array(Pe.z.object({selector:Pe.z.string().optional(),fromFnCall:Pe.z.string().optional(),prop:Pe.z.string().or(Pe.z.array(Pe.z.string())),errorMsg:Pe.z.string().optional()}))}),cn=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:[k($s)]},defaultOptions:[{varsToCheck:[]}],create(e,[t]){let o=new Map;function r(n,a,p,l){let d=new Set;for(let u of n.properties)u.type===z.AST_NODE_TYPES.Property&&u.key.type===z.AST_NODE_TYPES.Identifier&&d.add(u.key.name);let m=a.filter(u=>!d.has(u));if(m.length>0)if(m.length===1)e.report({node:n,messageId:"propNotRead",data:{prop:m[0],fnName:l,customMsg:p||""}});else{let u=m.map(f=>`"${f}"`).join(", ");e.report({node:n,messageId:"propsNotRead",data:{props:u,fnName:l,customMsg:p||""}})}}function i(n){if(n.init?.type===z.AST_NODE_TYPES.CallExpression){if(n.init.callee.type===z.AST_NODE_TYPES.Identifier)return n.init.callee.name;if(n.init.callee.type===z.AST_NODE_TYPES.MemberExpression&&n.init.callee.property.type===z.AST_NODE_TYPES.Identifier)return n.init.callee.object.type===z.AST_NODE_TYPES.Identifier?`${n.init.callee.object.name}.${n.init.callee.property.name}`:n.init.callee.property.name}return"unknown function"}let s={};for(let n of t.varsToCheck)n.selector&&(s[n.selector]=a=>{if(a.type===z.AST_NODE_TYPES.VariableDeclarator&&a.id.type===z.AST_NODE_TYPES.Identifier&&o.set(a.id.name,{props:Array.isArray(n.prop)?n.prop:[n.prop],errorMsg:n.errorMsg,node:a.id,fnName:i(a)}),a.type===z.AST_NODE_TYPES.VariableDeclarator&&a.id.type===z.AST_NODE_TYPES.ObjectPattern){let p=Array.isArray(n.prop)?n.prop:[n.prop];r(a.id,p,n.errorMsg,i(a))}});for(let n of t.varsToCheck)if(n.fromFnCall){let a=n.fromFnCall;if(a.startsWith("*.")){let l=`VariableDeclarator > CallExpression > MemberExpression[property.name="${a.slice(2)}"]`;s[l]=d=>{if(d.type!==z.AST_NODE_TYPES.MemberExpression||d.parent.type!==z.AST_NODE_TYPES.CallExpression)return;let m=d.parent;if(m.parent.type!==z.AST_NODE_TYPES.VariableDeclarator)return;let u=m.parent;if(u.id.type===z.AST_NODE_TYPES.Identifier)o.set(u.id.name,{props:Array.isArray(n.prop)?n.prop:[n.prop],errorMsg:n.errorMsg,node:u.id,fnName:n.fromFnCall||"unknown function"});else if(u.id.type===z.AST_NODE_TYPES.ObjectPattern){let f=Array.isArray(n.prop)?n.prop:[n.prop];r(u.id,f,n.errorMsg,n.fromFnCall||"unknown function")}}}else if(a.includes(".")){let[p,l]=a.split("."),d=`VariableDeclarator > CallExpression > MemberExpression[object.name="${p}"][property.name="${l}"]`;s[d]=m=>{if(m.type!==z.AST_NODE_TYPES.MemberExpression||m.parent.type!==z.AST_NODE_TYPES.CallExpression)return;let u=m.parent;if(u.parent.type!==z.AST_NODE_TYPES.VariableDeclarator)return;let f=u.parent;if(f.id.type===z.AST_NODE_TYPES.Identifier)o.set(f.id.name,{props:Array.isArray(n.prop)?n.prop:[n.prop],errorMsg:n.errorMsg,node:f.id,fnName:n.fromFnCall||"unknown function"});else if(f.id.type===z.AST_NODE_TYPES.ObjectPattern){let c=Array.isArray(n.prop)?n.prop:[n.prop];r(f.id,c,n.errorMsg,n.fromFnCall||"unknown function")}}}else{let p=`VariableDeclarator > CallExpression > Identifier[name="${a}"]`;s[p]=l=>{if(l.type!==z.AST_NODE_TYPES.Identifier||l.parent.type!==z.AST_NODE_TYPES.CallExpression)return;let d=l.parent;if(d.parent.type!==z.AST_NODE_TYPES.VariableDeclarator)return;let m=d.parent;if(m.id.type===z.AST_NODE_TYPES.Identifier)o.set(m.id.name,{props:Array.isArray(n.prop)?n.prop:[n.prop],errorMsg:n.errorMsg,node:m.id,fnName:n.fromFnCall||"unknown function"});else if(m.id.type===z.AST_NODE_TYPES.ObjectPattern){let u=Array.isArray(n.prop)?n.prop:[n.prop];r(m.id,u,n.errorMsg,n.fromFnCall||"unknown function")}}}}return{...s,"Program:exit"(){for(let[n,{props:a,errorMsg:p,node:l,fnName:d}]of o){let u=e.sourceCode.getScope(l).set.get(n);if(u){let f=new Set(a);for(let c of u.references){let g=c.identifier,T=g.parent;if(!(T.type===z.AST_NODE_TYPES.VariableDeclarator&&T.id===g)){if(T.type===z.AST_NODE_TYPES.MemberExpression&&T.object===g&&T.property.type===z.AST_NODE_TYPES.Identifier&&f.has(T.property.name)){if(f.delete(T.property.name),f.size===0)break;continue}if(T.type===z.AST_NODE_TYPES.VariableDeclarator&&T.init===g&&T.id.type===z.AST_NODE_TYPES.ObjectPattern){for(let y of T.id.properties)y.type===z.AST_NODE_TYPES.Property&&y.key.type===z.AST_NODE_TYPES.Identifier&&f.has(y.key.name)&&f.delete(y.key.name);if(f.size===0)break;continue}if(!(T.type===z.AST_NODE_TYPES.MemberExpression&&T.object===g&&T.property.type===z.AST_NODE_TYPES.Identifier&&!a.includes(T.property.name))){f.clear();break}}}if(f.size>0){let c=Array.from(f);if(c.length===1)e.report({node:l,messageId:"propNotRead",data:{prop:c[0],fnName:d,customMsg:p||""}});else{let g=c.map(T=>`"${T}"`).join(", ");e.report({node:l,messageId:"propsNotRead",data:{props:g,fnName:d,customMsg:p||""}})}}}}}}}});var se=require("@typescript-eslint/utils"),ue=Oe(require("zod/v4"));var zs=/^\s+$/,un=/\r?\n/,Us=/^(\s*)/,Js=/^(\s*)\S/,Vs=/\r?\n/,Xs=ue.object({indent:ue.union([ue.string().regex(zs),ue.number().int().min(1)]).optional(),tags:ue.array(ue.string()).optional(),functions:ue.array(ue.string()).optional(),comments:ue.array(ue.string()).optional()}),fn=v({name:"template-indent",meta:{type:"suggestion",docs:{description:"Fix whitespace-insensitive template indentation"},fixable:"code",schema:[k(Xs)],messages:{improperlyIndented:"Templates should be properly indented."}},defaultOptions:[{}],create(e){let t=e.sourceCode,{comments:o=["HTML","indent"],functions:r=["dedent","stripIndent"],tags:i=["outdent","dedent","gql","sql","html","styled"],indent:s}=e.options[0],n=o.map(y=>y.toLowerCase());function a(y){let C=y.split(un),A=C.filter(b=>b.trim()!=="");if(A.length===0)return y;let S=Number.POSITIVE_INFINITY;for(let b of A){let E=b.match(Us);E&&(S=Math.min(S,E[1]?.length??0))}return!isFinite(S)||S===0?y:C.map(b=>b.slice(S)).join(`
25
+ `)}function p(y,C,A){return y.split(un).map(b=>b.trim()===""?b:A.repeat(C)+b).join(`
26
+ `)}function l(y){if(y.type===se.AST_NODE_TYPES.Identifier)return y.name;if(y.type===se.AST_NODE_TYPES.MemberExpression){let C=y.object.type===se.AST_NODE_TYPES.Identifier?y.object.name:null,A=y.property.type===se.AST_NODE_TYPES.Identifier?y.property.name:null;return C&&A?`${C}.${A}`:A}return null}function d(y,C){if(!y)return!1;for(let A of C)if(A.includes(".")){let S=A.split(".");if(y.type===se.AST_NODE_TYPES.MemberExpression&&y.object.type===se.AST_NODE_TYPES.Identifier&&y.property.type===se.AST_NODE_TYPES.Identifier&&y.object.name===S[0]&&y.property.name===S[1])return!0}else if(y.type===se.AST_NODE_TYPES.Identifier&&y.name===A)return!0;return!1}function m(y,C){let A=y.parent;if(A.type!==se.AST_NODE_TYPES.TaggedTemplateExpression)return!1;let S=l(A.tag);return S?C.includes(S):!1}function u(y,C){if(!y||y.type!==se.AST_NODE_TYPES.CallExpression)return!1;let{method:A,argumentsLength:S,optionalCall:b=!0,optionalMember:E=!0}=C;return S!==void 0&&y.arguments.length!==S||!b&&y.optional||y.callee.type!==se.AST_NODE_TYPES.MemberExpression||!E&&y.callee.optional||y.callee.property.type!==se.AST_NODE_TYPES.Identifier?!1:y.callee.property.name===A}function f(y,C){if(!y||y.type!==se.AST_NODE_TYPES.CallExpression)return!1;let{name:A,argumentsLength:S,optionalCall:b=!0}=C;return S!==void 0&&y.arguments.length!==S||!b&&y.optional||y.callee.type!==se.AST_NODE_TYPES.Identifier?!1:y.callee.name===A}function c(y){return u(y.parent,{method:"toMatchInlineSnapshot",argumentsLength:1,optionalCall:!1,optionalMember:!1})&&y.parent.type===se.AST_NODE_TYPES.CallExpression&&y.parent.arguments[0]===y&&f(y.parent.callee.type===se.AST_NODE_TYPES.MemberExpression?y.parent.callee.object:null,{name:"expect",argumentsLength:1,optionalCall:!1,optionalMember:!1})}function g(y){if(n.length>0){let C=t.getTokenBefore(y,{includeComments:!0});if(C?.type===se.AST_TOKEN_TYPES.Block&&n.includes(C.value.trim().toLowerCase()))return!0}return!!(c(y)||i.length>0&&m(y,i)||r.length>0&&y.parent.type===se.AST_NODE_TYPES.CallExpression&&y.parent.arguments.includes(y)&&d(y.parent.callee,r))}function T(y){let C=`__PLACEHOLDER__${Math.random()}`,A=y.quasis.map(Y=>t.getText(Y).slice(1,Y.tail?-1:-2)).join(C),S=A.match(Vs);if(!S)return;let b=S[0],E=t.lines[t.getLocFromIndex(y.range[0]).line-1];if(!E)return;let D=E.match(Js)?.[1]??"",M;typeof s=="string"?M=s:typeof s=="number"?M=" ".repeat(s):M=D.startsWith(" ")?" ":" ";let Z=a(A).replace(new RegExp(`^${b}|${b}[ ]*$`,"g"),""),h=b+p(Z,1,D+M)+b+D,x=A.includes(`\r
38
27
  `)?`\r
39
28
  `:`
40
- `,F=A.split(Hn),R=F.map((M,P)=>P!==F.length-1&&M===k+N?"":M).join(E);if(x!==R)return{node:S,messageId:"improperlyIndented",fix:M=>x.split(I).map((P,ee)=>{let Z=S.quasis[ee];return Z?M.replaceTextRange([Z.range[0]+1,Z.range[1]-(Z.tail?1:2)],P):[]}).flat()}}return{TemplateLiteral(S){if(!g(S))return;let I=h(S);if(I)return e.report(I)}}}});var qn=require("@typescript-eslint/utils");function Tl(e){if(!("regex"in e))return!1;let t=e.regex.flags;return t.includes("g")||t.includes("y")}function El(e){let t=e.parent;return t?.type===qn.AST_NODE_TYPES.NewExpression&&t.callee.type===qn.AST_NODE_TYPES.Identifier&&t.callee.name==="RegExp"}var Zn=z({name:"use-top-level-regex",meta:{type:"suggestion",docs:{description:"Require regex literals to be declared at the top level to avoid performance issues"},messages:{regexShouldBeTopLevel:"Move this regex literal to the top level to avoid creating new RegExp objects on each function call."},schema:[],hasSuggestions:!1},defaultOptions:[],create(e){function t(r){Tl(r)||El(r)||e.report({node:r,messageId:"regexShouldBeTopLevel"})}return{"FunctionDeclaration Literal[regex], FunctionExpression Literal[regex], ArrowFunctionExpression Literal[regex], MethodDefinition Literal[regex]":t}}});var be=require("@typescript-eslint/utils"),dt=require("zod/v4");var hl=dt.z.object({checkOnly:dt.z.array(dt.z.enum(["function-args","FC","generic-args-at-fn-calls"])).optional(),checkTypesFromSelectors:dt.z.array(dt.z.string()).optional()}),Gn=z({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:[U(hl)],messages:{moveTypeAboveUsage:"Type definition should be placed directly above its first usage."}},defaultOptions:[{}],create(e,[t]){let r=e.sourceCode,n=new Map,s=[];function o(c){for(let g of s)if(c.range[0]>=g.range[0]&&c.range[1]<=g.range[1])return g;return null}function i(c){let g=c.parent;for(;g;){if(g.type===be.AST_NODE_TYPES.FunctionDeclaration||g.type===be.AST_NODE_TYPES.FunctionExpression||g.type===be.AST_NODE_TYPES.ArrowFunctionExpression){let h=g.params;for(let S of h)if(c.range[0]>=S.range[0]&&c.range[1]<=S.range[1])return!0;break}g=g.parent}return!1}function a(c){let g=c.parent;for(;g;){if(g.type===be.AST_NODE_TYPES.TSTypeParameterInstantiation){let h=g.parent;if(h.type===be.AST_NODE_TYPES.TSTypeReference&&h.typeName.type===be.AST_NODE_TYPES.Identifier&&(h.typeName.name==="FC"||h.typeName.name==="React.FC")||h.type===be.AST_NODE_TYPES.TSTypeReference&&h.typeName.type===be.AST_NODE_TYPES.TSQualifiedName&&h.typeName.right.name==="FC")return!0}g=g.parent}return!1}function l(c){let g=c.parent;for(;g;){if(g.type===be.AST_NODE_TYPES.TSTypeParameterInstantiation){let h=g.parent;if(h.type===be.AST_NODE_TYPES.CallExpression||h.type===be.AST_NODE_TYPES.NewExpression)return!0}g=g.parent}return!1}function p(c){let g=c.parent;for(;g;){if(g.type===be.AST_NODE_TYPES.TSTypeAliasDeclaration||g.type===be.AST_NODE_TYPES.TSInterfaceDeclaration)return!0;g=g.parent}return!1}function m(c){return c.parent.type===be.AST_NODE_TYPES.TSIndexedAccessType&&c.parent.objectType===c}let y=[];function u(c){let g=[],h=new Map;for(let{typeName:I,firstUsage:A}of c){let T=h.get(A)||[];T.push(I),h.set(A,T)}for(let{typeName:I,firstUsage:A,firstUsagePosition:T,firstUsageInFunctionArgs:b}of c){let C=n.get(I);if(!C||C.statement===A)continue;let w=s.indexOf(C.statement),N=s.indexOf(A);if(w===-1||N===-1)continue;let k=!!(t.checkOnly&&t.checkOnly.includes("function-args")&&b),f=(h.get(A)||[]).length>1;(k||f?w>N:w>N||w!==N-1)&&g.push({typeName:I,typeDef:C,targetStatement:A,firstUsagePosition:T})}if(g.length===0)return;g.sort((I,A)=>{let T=I.firstUsagePosition-A.firstUsagePosition;if(T!==0)return T;let b=s.indexOf(I.typeDef.statement),C=s.indexOf(A.typeDef.statement);return b-C});let S=g[0];S&&e.report({node:S.typeDef.node,messageId:"moveTypeAboveUsage",fix:d(g)})}function d(c){return function*(g){let h=new Map;for(let S of c){let I=h.get(S.targetStatement)||[];I.push(S),h.set(S.targetStatement,I)}for(let[,S]of h)S.sort((I,A)=>{let T=I.firstUsagePosition-A.firstUsagePosition;if(T!==0)return T;let b=s.indexOf(I.typeDef.statement),C=s.indexOf(A.typeDef.statement);return b-C});for(let S of c){let{typeDef:I}=S,A=I.statement,T=r.getCommentsBefore(A),b=A.range[0],C=A.range[1];T.length>0&&T[0]&&(b=T[0].range[0]),yield g.removeRange([b,C])}for(let[S,I]of h){let A=r.getCommentsBefore(S),T=A.length>0&&A[0]?A[0].range[0]:S.range[0],b=[];for(let C of I){let w=C.typeDef.statement,N=r.getText(w),k=r.getCommentsBefore(w),O=N;k.length>0&&(O=`${k.map(x=>r.getText(x)).join(`
29
+ `,P=A.split(un),j=P.map((Y,q)=>q!==P.length-1&&Y===M+D?"":Y).join(x);if(h!==j)return{node:y,messageId:"improperlyIndented",fix:Y=>h.split(C).map((q,ne)=>{let Q=y.quasis[ne];return Q?Y.replaceTextRange([Q.range[0]+1,Q.range[1]-(Q.tail?1:2)],q):[]}).flat()}}return{TemplateLiteral(y){if(!g(y))return;let C=T(y);if(C)return e.report(C)}}}});var mn=require("@typescript-eslint/utils");function Ws(e){if(!("regex"in e))return!1;let t=e.regex.flags;return t.includes("g")||t.includes("y")}function Bs(e){let t=e.parent;return t?.type===mn.AST_NODE_TYPES.NewExpression&&t.callee.type===mn.AST_NODE_TYPES.Identifier&&t.callee.name==="RegExp"}var dn=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 t(o){Ws(o)||Bs(o)||e.report({node:o,messageId:"regexShouldBeTopLevel"})}return{"FunctionDeclaration Literal[regex], FunctionExpression Literal[regex], ArrowFunctionExpression Literal[regex], MethodDefinition Literal[regex]":t}}});var pe=require("@typescript-eslint/utils"),Be=require("zod/v4");var Ys=Be.z.object({checkOnly:Be.z.array(Be.z.enum(["function-args","FC","generic-args-at-fn-calls"])).optional(),checkTypesFromSelectors:Be.z.array(Be.z.string()).optional()}),yn=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:[k(Ys)],messages:{moveTypeAboveUsage:"Type definition should be placed directly above its first usage."}},defaultOptions:[{}],create(e,[t]){let o=e.sourceCode,r=new Map,i=[];function s(c){for(let g of i)if(c.range[0]>=g.range[0]&&c.range[1]<=g.range[1])return g;return null}function n(c){let g=c.parent;for(;g;){if(g.type===pe.AST_NODE_TYPES.FunctionDeclaration||g.type===pe.AST_NODE_TYPES.FunctionExpression||g.type===pe.AST_NODE_TYPES.ArrowFunctionExpression){let T=g.params;for(let y of T)if(c.range[0]>=y.range[0]&&c.range[1]<=y.range[1])return!0;break}g=g.parent}return!1}function a(c){let g=c.parent;for(;g;){if(g.type===pe.AST_NODE_TYPES.TSTypeParameterInstantiation){let T=g.parent;if(T.type===pe.AST_NODE_TYPES.TSTypeReference&&T.typeName.type===pe.AST_NODE_TYPES.Identifier&&(T.typeName.name==="FC"||T.typeName.name==="React.FC")||T.type===pe.AST_NODE_TYPES.TSTypeReference&&T.typeName.type===pe.AST_NODE_TYPES.TSQualifiedName&&T.typeName.right.name==="FC")return!0}g=g.parent}return!1}function p(c){let g=c.parent;for(;g;){if(g.type===pe.AST_NODE_TYPES.TSTypeParameterInstantiation){let T=g.parent;if(T.type===pe.AST_NODE_TYPES.CallExpression||T.type===pe.AST_NODE_TYPES.NewExpression)return!0}g=g.parent}return!1}function l(c){let g=c.parent;for(;g;){if(g.type===pe.AST_NODE_TYPES.TSTypeAliasDeclaration||g.type===pe.AST_NODE_TYPES.TSInterfaceDeclaration)return!0;g=g.parent}return!1}function d(c){return c.parent.type===pe.AST_NODE_TYPES.TSIndexedAccessType&&c.parent.objectType===c}let m=[];function u(c){let g=[],T=new Map;for(let{typeName:C,firstUsage:A}of c){let S=T.get(A)||[];S.push(C),T.set(A,S)}for(let{typeName:C,firstUsage:A,firstUsagePosition:S,firstUsageInFunctionArgs:b}of c){let E=r.get(C);if(!E||E.statement===A)continue;let I=i.indexOf(E.statement),D=i.indexOf(A);if(I===-1||D===-1)continue;let M=!!(t.checkOnly&&t.checkOnly.includes("function-args")&&b),Z=(T.get(A)||[]).length>1;(M||Z?I>D:I>D||I!==D-1)&&g.push({typeName:C,typeDef:E,targetStatement:A,firstUsagePosition:S})}if(g.length===0)return;g.sort((C,A)=>{let S=C.firstUsagePosition-A.firstUsagePosition;if(S!==0)return S;let b=i.indexOf(C.typeDef.statement),E=i.indexOf(A.typeDef.statement);return b-E});let y=g[0];y&&e.report({node:y.typeDef.node,messageId:"moveTypeAboveUsage",fix:f(g)})}function f(c){return function*(g){let T=new Map;for(let y of c){let C=T.get(y.targetStatement)||[];C.push(y),T.set(y.targetStatement,C)}for(let[,y]of T)y.sort((C,A)=>{let S=C.firstUsagePosition-A.firstUsagePosition;if(S!==0)return S;let b=i.indexOf(C.typeDef.statement),E=i.indexOf(A.typeDef.statement);return b-E});for(let y of c){let{typeDef:C}=y,A=C.statement,S=o.getCommentsBefore(A),b=A.range[0],E=A.range[1];S.length>0&&S[0]&&(b=S[0].range[0]),yield g.removeRange([b,E])}for(let[y,C]of T){let A=o.getCommentsBefore(y),S=A.length>0&&A[0]?A[0].range[0]:y.range[0],b=[];for(let E of C){let I=E.typeDef.statement,D=o.getText(I),M=o.getCommentsBefore(I),U=D;M.length>0&&(U=`${M.map(h=>o.getText(h)).join(`
41
30
  `)}
42
- ${N}`),b.push(O)}yield g.insertTextBeforeRange([T,T],`${b.join(`
31
+ ${D}`),b.push(U)}yield g.insertTextBeforeRange([S,S],`${b.join(`
43
32
 
44
33
  `)}
45
34
 
46
- `)}}}return{Program(c){s.push(...c.body)},TSTypeAliasDeclaration(c){if(s.some(h=>h.type===be.AST_NODE_TYPES.ExportNamedDeclaration&&h.declaration===c?!0:h===c)){let h=o(c);h&&n.set(c.id.name,{node:c,name:c.id.name,statement:h})}},TSInterfaceDeclaration(c){if(s.some(h=>h.type===be.AST_NODE_TYPES.ExportNamedDeclaration&&h.declaration===c?!0:h===c)){let h=o(c);h&&n.set(c.id.name,{node:c,name:c.id.name,statement:h})}},TSTypeReference(c){if(c.typeName.type===be.AST_NODE_TYPES.Identifier){if(m(c))return;let g=i(c),h=a(c),S=l(c);y.push({typeName:c.typeName.name,node:c,inFunctionArgs:g,inFCProps:h,inGenericArgAtFunctionCall:S,usagePosition:c.range[0]})}},"Program:exit"(){let c=new Map;function g(S){if(!t.checkOnly||t.checkOnly.length===0)return!0;for(let I of t.checkOnly)if(I==="function-args"&&S.inFunctionArgs||I==="FC"&&S.inFCProps||I==="generic-args-at-fn-calls"&&S.inGenericArgAtFunctionCall)return!0;return!1}for(let S of y){let{typeName:I,node:A}=S;if(!n.has(I)||!g(S))continue;let T=o(A),b=n.get(I);if(!T||!b||T===b.statement)continue;c.has(I)||c.set(I,[]);let C=c.get(I);if(!C)return;C.includes(T)||C.push(T)}let h=[];for(let[S,I]of c)if(I.length>0){if(I.length===0)continue;let A=I[0];if(!A)continue;let T=Number.MAX_SAFE_INTEGER,b=!1;for(let w of I)w.range[0]<A.range[0]&&(A=w);for(let w of y)g(w)&&w.typeName===S&&o(w.node)===A&&w.usagePosition<T&&(T=w.usagePosition,b=w.inFunctionArgs);if(!!(t.checkOnly&&t.checkOnly.length>0)){let w=Number.MAX_SAFE_INTEGER;for(let k of y){if(k.typeName!==S)continue;let O=o(k.node);if(!O)continue;let f=s.indexOf(O);f!==-1&&f<w&&(w=f)}let N=s.indexOf(A);if(w!==Number.MAX_SAFE_INTEGER&&N!==-1&&w<N)continue}else{let w=Number.MAX_SAFE_INTEGER;for(let k of y){if(k.typeName!==S||p(k.node))continue;let O=o(k.node);if(!O)continue;let f=s.indexOf(O);f!==-1&&f<w&&(w=f)}let N=s.indexOf(A);if(w!==Number.MAX_SAFE_INTEGER&&N!==-1&&w<N)continue}h.push({typeName:S,firstUsage:A,firstUsagePosition:T,firstUsageInFunctionArgs:b})}h.length>0&&u(h)}}}});var ie=require("@typescript-eslint/utils"),gt=Re(require("zod/v4"));var bl=["tsx"],xl=/^[A-Z][A-Za-z0-9]*$/,Cl=gt.object({extensions:gt.array(gt.string()).optional()}),Kn=z({name:"react-single-export",meta:{type:"problem",docs:{description:"Enforces only one export per React component file to support fast refresh"},messages:{multipleExports:"React component files should have only one export to support fast refresh, if you want to export multiple components, use a separate file for each component. Type-only exports are allowed."},schema:[U(Cl)]},defaultOptions:[{}],create(e,[t]){let r=e.getFilename(),n=t.extensions??bl,s=!1;for(let T of n)if(r.endsWith(T)){s=!0;break}if(!s)return{};let o=e.sourceCode,i=new Set,a=new Map;function l(T){return xl.test(T)}function p(T){if(T.type!==ie.AST_NODE_TYPES.CallExpression)return!1;let b=T.callee;return b.type===ie.AST_NODE_TYPES.Identifier?b.name==="memo"||b.name==="forwardRef":b.type===ie.AST_NODE_TYPES.MemberExpression&&b.property.type===ie.AST_NODE_TYPES.Identifier?b.property.name==="memo"||b.property.name==="forwardRef":!1}function m(T){if(T.type===ie.AST_NODE_TYPES.JSXElement||T.type===ie.AST_NODE_TYPES.JSXFragment)return!0;if(T.type===ie.AST_NODE_TYPES.ArrayExpression){for(let b of T.elements)if(b&&(b.type===ie.AST_NODE_TYPES.JSXElement||b.type===ie.AST_NODE_TYPES.JSXFragment))return!0}return!1}function y(T){if(T.type!==ie.AST_NODE_TYPES.ArrowFunctionExpression)return!1;let b=T.body;if(b.type===ie.AST_NODE_TYPES.ArrowFunctionExpression){let C=b.body;if(m(C))return!0}return!1}function u(T){if(T.id.type!==ie.AST_NODE_TYPES.Identifier)return;let b=T.id.name,C=T.init;if(C){if(l(b)&&(C.type===ie.AST_NODE_TYPES.ArrowFunctionExpression||C.type===ie.AST_NODE_TYPES.FunctionExpression||p(C))){i.add(b);return}C.type===ie.AST_NODE_TYPES.Identifier&&a.set(b,C.name),l(b)||y(C)&&i.add(b)}}function d(T){if(T.type===ie.AST_NODE_TYPES.VariableDeclaration){for(let b of T.declarations)u(b);return}if(T.type===ie.AST_NODE_TYPES.FunctionDeclaration&&T.id){l(T.id.name)&&i.add(T.id.name);return}if(T.type===ie.AST_NODE_TYPES.ExportNamedDeclaration&&T.declaration){let b=T.declaration;if(b.type===ie.AST_NODE_TYPES.VariableDeclaration){for(let C of b.declarations)u(C);return}if(b.type===ie.AST_NODE_TYPES.FunctionDeclaration&&b.id){l(b.id.name)&&i.add(b.id.name);return}}}for(let T of o.ast.body)d(T);function c(T,b=new Set){if(i.has(T))return!0;if(b.has(T))return!1;b.add(T);let C=a.get(T);return C?c(C,b):!1}let g=[];function h(T,b,C){g.push({node:T,isType:b,isComponent:C})}for(let T of o.ast.body){if(T.type===ie.AST_NODE_TYPES.ExportNamedDeclaration){let b=T.exportKind==="type";if(T.declaration){let C=T.declaration;if(C.type===ie.AST_NODE_TYPES.TSTypeAliasDeclaration||C.type===ie.AST_NODE_TYPES.TSInterfaceDeclaration){h(C,!0,!1);continue}if(C.type===ie.AST_NODE_TYPES.VariableDeclaration){for(let w of C.declarations){if(w.id.type!==ie.AST_NODE_TYPES.Identifier)continue;let N=w.id.name,k=c(N);h(w,b,k)}continue}if(C.type===ie.AST_NODE_TYPES.FunctionDeclaration){let w=C.id?.name,N=w?c(w)||l(w):!1;h(C,b,N);continue}h(C,b,!1);continue}if(T.specifiers.length>0)for(let C of T.specifiers){if(C.local.type!==ie.AST_NODE_TYPES.Identifier)continue;let w=C.local.name,N=c(w);h(C,b,N)}continue}if(T.type===ie.AST_NODE_TYPES.ExportDefaultDeclaration){let b=T.declaration;if(b.type===ie.AST_NODE_TYPES.Identifier){let C=c(b.name)||l(b.name);h(T,!1,C);continue}if(b.type===ie.AST_NODE_TYPES.FunctionDeclaration||b.type===ie.AST_NODE_TYPES.ArrowFunctionExpression||b.type===ie.AST_NODE_TYPES.FunctionExpression||b.type===ie.AST_NODE_TYPES.CallExpression){h(T,!1,!0);continue}h(T,!1,!1);continue}}let S=!1;for(let T of g)if(!T.isType&&T.isComponent){S=!0;break}if(!S)return{};let I=[];for(let T of g)T.isType||I.push(T);let A=-1;for(let[T,b]of I.entries())if(b.isComponent){A=T;break}if(A===-1)return{};for(let[T,b]of I.entries())if(T!==A){e.report({node:b.node,messageId:"multipleExports"});break}return{}}});var qe=require("@typescript-eslint/utils"),_t=require("zod/v4");function Ut(e){return e.charAt(0).toUpperCase()+e.slice(1)}function Il(e){return e.callee.type===qe.AST_NODE_TYPES.Identifier?e.callee.name==="useState":e.callee.type===qe.AST_NODE_TYPES.MemberExpression&&e.callee.object.type===qe.AST_NODE_TYPES.Identifier&&e.callee.property.type===qe.AST_NODE_TYPES.Identifier?e.callee.object.name==="React"&&e.callee.property.name==="useState":!1}var Al=_t.z.object({ignorePrefixes:_t.z.array(_t.z.string()).optional()});function Di(e,t){for(let r of t)if(e.startsWith(r))return e.slice(r.length);return e}function wl(e){return`set${Ut(e)}`}var Qn=z({name:"use-state-setter-naming",meta:{type:"problem",docs:{description:"Enforce consistent naming convention for useState destructuring where setter should be set{Value}"},messages:{incorrectSetterName:'useState setter should follow the pattern "set{{expectedName}}" with a "set" prefix but got "{{actualName}}"',useSuggestedName:'Use "{{expectedSetterName}}" instead'},hasSuggestions:!0,schema:[U(Al)]},defaultOptions:[{ignorePrefixes:[]}],create(e,[t]){return{VariableDeclarator(r){if(!r.init||r.init.type!==qe.AST_NODE_TYPES.CallExpression||!Il(r.init)||r.id.type!==qe.AST_NODE_TYPES.ArrayPattern||r.id.elements.length!==2)return;let[n,s]=r.id.elements;if(!n||!s||n.type!==qe.AST_NODE_TYPES.Identifier||s.type!==qe.AST_NODE_TYPES.Identifier)return;let o=n.name,i=s.name,a=t.ignorePrefixes||[],l=Di(o,a),p=Di(i,a);if(l===""){if(!p.startsWith("set")){let y=`set${Ut(o)}`;e.report({node:s,messageId:"incorrectSetterName",data:{expectedName:Ut(o),actualName:i},suggest:[{messageId:"useSuggestedName",data:{expectedSetterName:y},fix:u=>u.replaceText(s,y)}]})}return}let m=wl(l);p!==m&&e.report({node:s,messageId:"incorrectSetterName",data:{expectedName:Ut(l),actualName:i},suggest:[{messageId:"useSuggestedName",data:{expectedSetterName:m},fix:y=>y.replaceText(s,m)}]})}}}});var Te=require("@typescript-eslint/utils"),lt=require("zod/v4");var Fl=lt.z.object({name:lt.z.string(),defaults:lt.z.array(lt.z.unknown())}),vl=lt.z.object({functions:lt.z.array(Fl)});function zt(e,t){if(e===t)return!0;if(e===null||t===null||e===void 0||t===void 0)return e===t;if(typeof e!=typeof t||typeof e!="object"||Array.isArray(e)!==Array.isArray(t))return!1;if(Array.isArray(e)&&Array.isArray(t))return e.length!==t.length?!1:e.every((s,o)=>zt(s,t[o]));let r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(let s of r){if(!n.includes(s))return!1;let o=Object.getOwnPropertyDescriptor(e,s),i=Object.getOwnPropertyDescriptor(t,s);if(!o||!i)return!1;let a=o.value,l=i.value;if(!zt(a,l))return!1}return!0}function Rl(e,t){let r=new Set;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return r;for(let n in e){if(!(n in t))continue;let s=Object.getOwnPropertyDescriptor(e,n),o=Object.getOwnPropertyDescriptor(t,n);s&&o&&zt(s.value,o.value)&&r.add(n)}return r}function Li(e){if(e.type===Te.AST_NODE_TYPES.SpreadElement)return Symbol("COMPLEX_EXPRESSION");switch(e.type){case Te.AST_NODE_TYPES.Literal:return e.value;case Te.AST_NODE_TYPES.ObjectExpression:{let t={};for(let r of e.properties)r.type===Te.AST_NODE_TYPES.Property&&r.key.type===Te.AST_NODE_TYPES.Identifier&&!r.computed&&(r.value.type===Te.AST_NODE_TYPES.Literal?t[r.key.name]=r.value.value:r.value.type===Te.AST_NODE_TYPES.ObjectExpression?t[r.key.name]=Li(r.value):t[r.key.name]=Symbol("COMPLEX_EXPRESSION"));return t}case Te.AST_NODE_TYPES.ArrayExpression:return e.elements.map(t=>{if(!(!t||t.type===Te.AST_NODE_TYPES.SpreadElement))return t.type===Te.AST_NODE_TYPES.Literal?t.value:Symbol("COMPLEX_EXPRESSION")});default:return Symbol("COMPLEX_EXPRESSION")}}function Nl(e){return e.type===Te.AST_NODE_TYPES.Identifier?e.name:e.type===Te.AST_NODE_TYPES.MemberExpression&&e.property.type===Te.AST_NODE_TYPES.Identifier&&!e.computed?e.property.name:null}var er=z({name:"no-redundant-function-params",meta:{type:"suggestion",docs:{description:"Disallow calling functions with redundant default parameters"},messages:{redundantParams:"Function call has redundant parameters matching its default values and can be removed: {{details}}"},fixable:"code",schema:[U(vl)]},defaultOptions:[{functions:[]}],create(e,[t]){let r=new Map;for(let n of t.functions)r.set(n.name,n.defaults);return{CallExpression(n){let s=Nl(n.callee);if(!s)return;let o=r.get(s);if(!o)return;let i=n.arguments;if(i.length===0)return;let a=-1,l=!1,p=new Map,m=new Set,y=new Map,u=[];for(let c=0;c<i.length;c++){if(c>=o.length){a=c;continue}let g=o[c],h=i[c];if(!h||h.type===Te.AST_NODE_TYPES.SpreadElement){a=c;continue}let S=Li(h);if(g===void 0){a=c;continue}if(zt(S,g)){h.type===Te.AST_NODE_TYPES.ObjectExpression?(m.add(c),u.push({type:"object",position:c+1})):(y.set(c,S),u.push({type:"simple",position:c+1,value:S}));continue}if(h.type===Te.AST_NODE_TYPES.ObjectExpression&&h.properties.length===0&&typeof g=="object"&&g!==null&&Object.keys(g).length>0){m.add(c),u.push({type:"object",position:c+1});continue}let I=Rl(S,g);if(I.size>0){let A=typeof g=="object"&&g!==null?Object.keys(g).length:0;if(h.type===Te.AST_NODE_TYPES.ObjectExpression&&h.properties.length===I.size&&h.properties.length===A){m.add(c),u.push({type:"object",position:c+1});continue}else l=!0,p.set(c,I),u.push({type:"partialObject",position:c+1,redundantProperties:Array.from(I)}),a=c}else a=c}if(a<i.length-1||l||m.size>0){let c=function(){let h=[];for(let S of u)if(S.type==="simple")h.push(`Param ${S.position} with value ${JSON.stringify(S.value)}`);else if(S.type==="object")h.push(`Param ${S.position} (object)`);else{let I=S.redundantProperties||[],A=o?o[S.position-1]:void 0;if(typeof A=="object"&&A!==null){let T=A;for(let b of I)if(b in T){let C=Object.getOwnPropertyDescriptor(T,b);C&&h.push(`Param ${S.position} property "${b}" with value ${JSON.stringify(C.value)}`)}}}return{messageId:"redundantParams",data:{details:h.join(", ")}}};var d=c;let g=c();e.report({node:n,messageId:g.messageId,data:g.data,fix(h){let S=[];if(l)for(let[A,T]of p){let b=i[A];if(b&&b.type===Te.AST_NODE_TYPES.ObjectExpression){let C=[];for(let N of b.properties)N.type===Te.AST_NODE_TYPES.Property&&N.key.type===Te.AST_NODE_TYPES.Identifier&&!N.computed&&T.has(N.key.name)||C.push(N);let w=C.map(N=>e.sourceCode.getText(N));S.push(h.replaceText(b,`{ ${w.join(", ")} }`))}}let I=-1;for(let A=i.length-1;A>=0;A--)if(!m.has(A)&&A<=a){I=A;break}if(I<i.length-1)if(I===-1){let A=e.sourceCode.getTokenAfter(n.callee),T=e.sourceCode.getLastToken(n);A&&T&&S.push(h.replaceTextRange([A.range[1],T.range[0]],""))}else{let A=i[I],T=e.sourceCode.getLastToken(n);T&&A&&S.push(h.replaceTextRange([A.range[1],T.range[0]],""))}return S.length>0?S:null}})}}}}});var ke=require("@typescript-eslint/utils");function kl(e){let t=e.parent;for(;t;){if(t.type===ke.AST_NODE_TYPES.AwaitExpression||t.type===ke.AST_NODE_TYPES.MemberExpression&&t.object===e&&t.property.type===ke.AST_NODE_TYPES.Identifier&&t.property.name==="then"||t.type===ke.AST_NODE_TYPES.ArrowFunctionExpression&&t.body===e)return!0;if(t.type===ke.AST_NODE_TYPES.ArrayExpression&&t.parent.type===ke.AST_NODE_TYPES.CallExpression){let r=t.parent;if(r.callee.type===ke.AST_NODE_TYPES.MemberExpression&&r.callee.object.type===ke.AST_NODE_TYPES.Identifier&&r.callee.object.name==="Promise"&&r.callee.property.type===ke.AST_NODE_TYPES.Identifier&&["all","allSettled","race"].includes(r.callee.property.name))return!0}if(t.parent)t=t.parent;else break}return!1}function Pl(e){let{callee:t}=e;return t.type===ke.AST_NODE_TYPES.Identifier&&t.name==="require"||t.type===ke.AST_NODE_TYPES.MemberExpression&&t.object.type===ke.AST_NODE_TYPES.Identifier&&t.object.name==="require"}var tr=z({name:"no-sync-dynamic-import",meta:{type:"problem",docs:{description:"Disallow synchronous dynamic imports and require statements, only allow async dynamic imports with await"},messages:{syncDynamicImport:"Synchronous dynamic import() is not allowed. Use regular import statement or await import() for dynamic imports.",requireNotAllowed:"require() statements are not allowed. Use ES6 import statements instead."},schema:[]},defaultOptions:[],create(e){return{ImportExpression(t){kl(t)||e.report({node:t,messageId:"syncDynamicImport"})},TSImportType(t){e.report({node:t,messageId:"syncDynamicImport"})},CallExpression(t){Pl(t)&&e.report({node:t,messageId:"requireNotAllowed"})}}}});var $=require("@typescript-eslint/utils"),Vt=require("zod/v4");var Ol=Vt.z.object({mainComponentRegex:Vt.z.string().optional(),mainComponentSelector:Vt.z.string().optional()}),Dl=/^[A-Z][A-Za-z0-9]*$/,nr=z({name:"sort-react-components-and-styles",meta:{type:"suggestion",docs:{description:"Sort React components and styles with styles placed above their first usage"},fixable:"code",schema:[U(Ol)],messages:{stylesShouldBeAboveUsage:"Style definitions should be placed above the first component that uses them",mainComponentShouldBeFirst:"Main component should be placed before other components"}},defaultOptions:[{}],create(e,[t]){let r=e.sourceCode,n=t.mainComponentRegex?new RegExp(t.mainComponentRegex):void 0,s=t.mainComponentSelector;if(!e.filename.endsWith(".tsx"))return{};let i=new Set,a=new Map,l=[],p=[],m=new Set;function y(x){let E=x.node;if(E.type===$.AST_NODE_TYPES.VariableDeclaration){for(let F of E.declarations)if(F.id.type===$.AST_NODE_TYPES.Identifier&&F.id.name===x.name&&F.init)return F.init}if(E.type===$.AST_NODE_TYPES.ExportNamedDeclaration){let F=E.declaration;if(F&&F.type===$.AST_NODE_TYPES.VariableDeclaration){for(let R of F.declarations)if(R.id.type===$.AST_NODE_TYPES.Identifier&&R.id.name===x.name&&R.init)return R.init}}return null}function u(x){let E=new Set;return _e(x,F=>(F.type===$.AST_NODE_TYPES.Identifier&&F.name!=="styled"&&F.name!=="css"&&E.add(F.name),!1),r),E}function d(x){return Dl.test(x)}function c(x){if(x.type!==$.AST_NODE_TYPES.CallExpression)return!1;let E=x.callee;return E.type===$.AST_NODE_TYPES.Identifier?E.name==="memo"||E.name==="forwardRef":E.type===$.AST_NODE_TYPES.MemberExpression&&E.property.type===$.AST_NODE_TYPES.Identifier?E.property.name==="memo"||E.property.name==="forwardRef":!1}function g(x){if(x.type===$.AST_NODE_TYPES.JSXElement||x.type===$.AST_NODE_TYPES.JSXFragment)return!0;if(x.type===$.AST_NODE_TYPES.BlockStatement){for(let E of x.body)if(E.type===$.AST_NODE_TYPES.ReturnStatement&&E.argument)return g(E.argument)}if(x.type===$.AST_NODE_TYPES.ArrayExpression){for(let E of x.elements)if(E&&(E.type===$.AST_NODE_TYPES.JSXElement||E.type===$.AST_NODE_TYPES.JSXFragment))return!0}return!1}function h(x){if(x.type!==$.AST_NODE_TYPES.ArrowFunctionExpression)return!1;let E=x.body;if(E.type===$.AST_NODE_TYPES.ArrowFunctionExpression){let F=E.body;if(g(F))return!0}return!1}function S(x){if(x.type===$.AST_NODE_TYPES.TaggedTemplateExpression){let E=x.tag;if(E.type===$.AST_NODE_TYPES.MemberExpression&&E.object.type===$.AST_NODE_TYPES.Identifier&&E.object.name==="styled")return!0;if(E.type===$.AST_NODE_TYPES.CallExpression){let F=E.callee;if(F.type===$.AST_NODE_TYPES.Identifier&&F.name==="styled")return!0}}return!1}function I(x){if(x.type===$.AST_NODE_TYPES.TaggedTemplateExpression){let E=x.tag;if(E.type===$.AST_NODE_TYPES.Identifier&&E.name==="css")return!0}return!1}function A(x,E){if(x.id.type!==$.AST_NODE_TYPES.Identifier)return;let F=x.id.name,R=x.init;if(R){if(S(R)||I(R)){p.push({node:E,name:F});return}if((d(F)||R.type===$.AST_NODE_TYPES.ArrowFunctionExpression)&&(R.type===$.AST_NODE_TYPES.ArrowFunctionExpression||R.type===$.AST_NODE_TYPES.FunctionExpression||c(R))){if(R.type===$.AST_NODE_TYPES.ArrowFunctionExpression||R.type===$.AST_NODE_TYPES.FunctionExpression){if(g(R.body)){i.add(F);return}}else if(c(R)){i.add(F);return}}R.type===$.AST_NODE_TYPES.Identifier&&a.set(F,R.name),d(F)||h(R)&&i.add(F)}}function T(x){return x.type===$.AST_NODE_TYPES.ExportDefaultDeclaration||x.type===$.AST_NODE_TYPES.ExportNamedDeclaration}function b(x){if(x.type===$.AST_NODE_TYPES.FunctionDeclaration)return x.id?x.id.name:null;if(x.type===$.AST_NODE_TYPES.VariableDeclaration){let E=x.declarations[0];if(E&&E.id.type===$.AST_NODE_TYPES.Identifier)return E.id.name}if(x.type===$.AST_NODE_TYPES.ExportDefaultDeclaration){let E=x.declaration;if(E.type===$.AST_NODE_TYPES.FunctionDeclaration)return E.id?E.id.name:"default";if(E.type===$.AST_NODE_TYPES.Identifier)return E.name}if(x.type===$.AST_NODE_TYPES.ExportNamedDeclaration){let E=x.declaration;if(E&&E.type===$.AST_NODE_TYPES.FunctionDeclaration)return E.id?E.id.name:null;if(E&&E.type===$.AST_NODE_TYPES.VariableDeclaration){let F=E.declarations[0];if(F&&F.id.type===$.AST_NODE_TYPES.Identifier)return F.id.name}}return null}function C(x,E){return s?m.has(x):n?n.test(E):T(x)}function w(x){let E=new Set;_e(x.node,F=>{if(F.type===$.AST_NODE_TYPES.Identifier)for(let R of p)R.name===F.name&&(E.add(R.name),(R.firstUsagePosition===void 0||F.range[0]<R.firstUsagePosition)&&(R.firstUsagePosition=F.range[0]));if(F.type===$.AST_NODE_TYPES.JSXElement){let R=F.openingElement;if(R.name.type===$.AST_NODE_TYPES.JSXIdentifier)for(let M of p)M.name===R.name.name&&(E.add(M.name),(M.firstUsagePosition===void 0||R.name.range[0]<M.firstUsagePosition)&&(M.firstUsagePosition=R.name.range[0]))}return!1},r),x.usedStyles=E}function N(x){if(x.type===$.AST_NODE_TYPES.VariableDeclaration){for(let E of x.declarations)A(E,x);return}if(x.type===$.AST_NODE_TYPES.FunctionDeclaration){d(x.id.name)&&g(x.body)&&i.add(x.id.name);return}if(x.type===$.AST_NODE_TYPES.ExportNamedDeclaration&&x.declaration){let E=x.declaration;if(E.type===$.AST_NODE_TYPES.VariableDeclaration){for(let F of E.declarations)A(F,x);return}if(E.type===$.AST_NODE_TYPES.FunctionDeclaration&&E.id){d(E.id.name)&&g(E.body)&&i.add(E.id.name);return}}if(x.type===$.AST_NODE_TYPES.ExportDefaultDeclaration){let E=x.declaration;E.type===$.AST_NODE_TYPES.Identifier&&i.add(E.name),(E.type===$.AST_NODE_TYPES.FunctionDeclaration||E.type===$.AST_NODE_TYPES.ArrowFunctionExpression||E.type===$.AST_NODE_TYPES.FunctionExpression)&&(E.type===$.AST_NODE_TYPES.FunctionDeclaration?E.id?i.add(E.id.name):i.add("default"):g(E.body)&&i.add("default"))}}function k(x,E=new Set){if(i.has(x))return!0;if(E.has(x))return!1;E.add(x);let F=a.get(x);return F?k(F,E):!1}let O={};return s&&(O[s]=x=>{let E=x;for(;E.parent&&E.parent.type!==$.AST_NODE_TYPES.Program;)E=E.parent;E.parent&&(E.type===$.AST_NODE_TYPES.VariableDeclaration||E.type===$.AST_NODE_TYPES.FunctionDeclaration||E.type===$.AST_NODE_TYPES.ExportNamedDeclaration||E.type===$.AST_NODE_TYPES.ExportDefaultDeclaration)&&m.add(E)}),O["Program:exit"]=x=>{let E=0;for(let D of x.body){if(D.type===$.AST_NODE_TYPES.ImportDeclaration){E+=1;continue}break}for(let D of x.body)N(D);for(let D of x.body){let q=b(D);if(q&&k(q)){let B=C(D,q);l.push({node:D,name:q,isMainComponent:B,usedStyles:new Set,isExported:T(D)})}}if(!s&&n&&!l.some(D=>D.isMainComponent))for(let D of l)D.isExported&&(D.isMainComponent=!0);for(let D of l)w(D);let F=new Set;for(let D of p)F.add(D.name);let R=new Map;for(let D=0;D<x.body.length;D+=1){let q=x.body[D];for(let B of p)B.node===q&&R.set(B.name,D)}let M=new Map;for(let D of p){let q=y(D),B=new Set;if(q){let ue=u(q);for(let me of ue)F.has(me)&&me!==D.name&&B.add(me)}M.set(D.name,B)}let P=new Map;for(let D of p){let q=M.get(D.name);if(!q)continue;let B=R.get(D.name);if(B!==void 0)for(let ue of q){let me=P.get(ue);(me===void 0||B<me)&&P.set(ue,B)}}let ee=[];for(let D of p){if(D.firstUsagePosition===void 0)continue;let q=x.body.indexOf(D.node),B=-1;for(let Ce of l){if(!Ce.usedStyles.has(D.name))continue;let we=x.body.indexOf(Ce.node);(B===-1||we<B)&&(B=we)}let ue=P.get(D.name);if(ue!==void 0&&(B===-1||ue<B)&&(B=ue),B===-1)continue;let me=-1;for(let Ce of l){let we=x.body.indexOf(Ce.node);we<B&&we>me&&(me=we)}let Oe=q<B,Ze=q>me,he=-1,Et=M.get(D.name);if(Et)for(let Ce of Et){let we=R.get(Ce);we!==void 0&&we>he&&(he=we)}let pt=q>he;if(!(Oe&&Ze&&pt)){let Ce=me+1;if(he+1>Ce&&(Ce=he+1),Ce<E&&(Ce=E),Ce>B)continue;ee.push({style:D,targetPosition:Ce})}}let Z=null;if(l.length>1){let D=l.map(B=>({c:B,idx:x.body.indexOf(B.node)})).sort((B,ue)=>B.idx-ue.idx)[0]?.c,q=l.find(B=>B.isMainComponent)||null;D&&q&&D.node!==q.node&&(Z={component:q,targetBefore:D.node})}if(ee.length>0||Z){let D=ee[0]?.style.node||Z?.component.node||x,q=ee.length>0?"stylesShouldBeAboveUsage":"mainComponentShouldBeFirst";e.report({node:D,messageId:q,fix:f(ee,Z,x.body)})}},O;function f(x,E,F){return function*(R){x.sort((P,ee)=>P.targetPosition-ee.targetPosition);for(let{style:P}of x){let ee=r.getCommentsBefore(P.node),Z=P.node.range[0],D=P.node.range[1];ee.length>0&&ee[0]&&(Z=ee[0].range[0]),Z===P.node.range[0]&&r.text.slice(0,Z).trim().length===0&&(Z=0),yield R.removeRange([Z,D])}let M=new Map;for(let P of x){let ee=M.get(P.targetPosition)||[];ee.push(P),M.set(P.targetPosition,ee)}for(let[P,ee]of M){let Z=F[P];if(!Z)continue;let D=r.getCommentsBefore(Z),q=D.length>0&&D[0]?D[0].range[0]:Z.range[0],B=[];for(let{style:ue}of ee){let me=r.getCommentsBefore(ue.node),Oe=r.getText(ue.node);me.length>0&&(Oe=`${me.map(he=>r.getText(he)).join(`
35
+ `)}}}return{Program(c){i.push(...c.body)},TSTypeAliasDeclaration(c){if(i.some(T=>T.type===pe.AST_NODE_TYPES.ExportNamedDeclaration&&T.declaration===c?!0:T===c)){let T=s(c);T&&r.set(c.id.name,{node:c,name:c.id.name,statement:T})}},TSInterfaceDeclaration(c){if(i.some(T=>T.type===pe.AST_NODE_TYPES.ExportNamedDeclaration&&T.declaration===c?!0:T===c)){let T=s(c);T&&r.set(c.id.name,{node:c,name:c.id.name,statement:T})}},TSTypeReference(c){if(c.typeName.type===pe.AST_NODE_TYPES.Identifier){if(d(c))return;let g=n(c),T=a(c),y=p(c);m.push({typeName:c.typeName.name,node:c,inFunctionArgs:g,inFCProps:T,inGenericArgAtFunctionCall:y,usagePosition:c.range[0]})}},"Program:exit"(){let c=new Map;function g(y){if(!t.checkOnly||t.checkOnly.length===0)return!0;for(let C of t.checkOnly)if(C==="function-args"&&y.inFunctionArgs||C==="FC"&&y.inFCProps||C==="generic-args-at-fn-calls"&&y.inGenericArgAtFunctionCall)return!0;return!1}for(let y of m){let{typeName:C,node:A}=y;if(!r.has(C)||!g(y))continue;let S=s(A),b=r.get(C);if(!S||!b||S===b.statement)continue;c.has(C)||c.set(C,[]);let E=c.get(C);if(!E)return;E.includes(S)||E.push(S)}let T=[];for(let[y,C]of c)if(C.length>0){if(C.length===0)continue;let A=C[0];if(!A)continue;let S=Number.MAX_SAFE_INTEGER,b=!1;for(let I of C)I.range[0]<A.range[0]&&(A=I);for(let I of m)g(I)&&I.typeName===y&&s(I.node)===A&&I.usagePosition<S&&(S=I.usagePosition,b=I.inFunctionArgs);if(!!(t.checkOnly&&t.checkOnly.length>0)){let I=Number.MAX_SAFE_INTEGER;for(let M of m){if(M.typeName!==y)continue;let U=s(M.node);if(!U)continue;let Z=i.indexOf(U);Z!==-1&&Z<I&&(I=Z)}let D=i.indexOf(A);if(I!==Number.MAX_SAFE_INTEGER&&D!==-1&&I<D)continue}else{let I=Number.MAX_SAFE_INTEGER;for(let M of m){if(M.typeName!==y||l(M.node))continue;let U=s(M.node);if(!U)continue;let Z=i.indexOf(U);Z!==-1&&Z<I&&(I=Z)}let D=i.indexOf(A);if(I!==Number.MAX_SAFE_INTEGER&&D!==-1&&I<D)continue}T.push({typeName:y,firstUsage:A,firstUsagePosition:S,firstUsageInFunctionArgs:b})}T.length>0&&u(T)}}}});var X=require("@typescript-eslint/utils"),Ye=Oe(require("zod/v4"));var qs=["tsx"],Zs=/^[A-Z][A-Za-z0-9]*$/,Gs=Ye.object({extensions:Ye.array(Ye.string()).optional()}),gn=v({name:"react-single-export",meta:{type:"problem",docs:{description:"Enforces only one export per React component file to support fast refresh"},messages:{multipleExports:"React component files should have only one export to support fast refresh, if you want to export multiple components, use a separate file for each component. Type-only exports are allowed."},schema:[k(Gs)]},defaultOptions:[{}],create(e,[t]){let o=e.getFilename(),r=t.extensions??qs,i=!1;for(let S of r)if(o.endsWith(S)){i=!0;break}if(!i)return{};let s=e.sourceCode,n=new Set,a=new Map;function p(S){return Zs.test(S)}function l(S){if(S.type!==X.AST_NODE_TYPES.CallExpression)return!1;let b=S.callee;return b.type===X.AST_NODE_TYPES.Identifier?b.name==="memo"||b.name==="forwardRef":b.type===X.AST_NODE_TYPES.MemberExpression&&b.property.type===X.AST_NODE_TYPES.Identifier?b.property.name==="memo"||b.property.name==="forwardRef":!1}function d(S){if(S.type===X.AST_NODE_TYPES.JSXElement||S.type===X.AST_NODE_TYPES.JSXFragment)return!0;if(S.type===X.AST_NODE_TYPES.ArrayExpression){for(let b of S.elements)if(b&&(b.type===X.AST_NODE_TYPES.JSXElement||b.type===X.AST_NODE_TYPES.JSXFragment))return!0}return!1}function m(S){if(S.type!==X.AST_NODE_TYPES.ArrowFunctionExpression)return!1;let b=S.body;if(b.type===X.AST_NODE_TYPES.ArrowFunctionExpression){let E=b.body;if(d(E))return!0}return!1}function u(S){if(S.id.type!==X.AST_NODE_TYPES.Identifier)return;let b=S.id.name,E=S.init;if(E){if(p(b)&&(E.type===X.AST_NODE_TYPES.ArrowFunctionExpression||E.type===X.AST_NODE_TYPES.FunctionExpression||l(E))){n.add(b);return}E.type===X.AST_NODE_TYPES.Identifier&&a.set(b,E.name),p(b)||m(E)&&n.add(b)}}function f(S){if(S.type===X.AST_NODE_TYPES.VariableDeclaration){for(let b of S.declarations)u(b);return}if(S.type===X.AST_NODE_TYPES.FunctionDeclaration&&S.id){p(S.id.name)&&n.add(S.id.name);return}if(S.type===X.AST_NODE_TYPES.ExportNamedDeclaration&&S.declaration){let b=S.declaration;if(b.type===X.AST_NODE_TYPES.VariableDeclaration){for(let E of b.declarations)u(E);return}if(b.type===X.AST_NODE_TYPES.FunctionDeclaration&&b.id){p(b.id.name)&&n.add(b.id.name);return}}}for(let S of s.ast.body)f(S);function c(S,b=new Set){if(n.has(S))return!0;if(b.has(S))return!1;b.add(S);let E=a.get(S);return E?c(E,b):!1}let g=[];function T(S,b,E){g.push({node:S,isType:b,isComponent:E})}for(let S of s.ast.body){if(S.type===X.AST_NODE_TYPES.ExportNamedDeclaration){let b=S.exportKind==="type";if(S.declaration){let E=S.declaration;if(E.type===X.AST_NODE_TYPES.TSTypeAliasDeclaration||E.type===X.AST_NODE_TYPES.TSInterfaceDeclaration){T(E,!0,!1);continue}if(E.type===X.AST_NODE_TYPES.VariableDeclaration){for(let I of E.declarations){if(I.id.type!==X.AST_NODE_TYPES.Identifier)continue;let D=I.id.name,M=c(D);T(I,b,M)}continue}if(E.type===X.AST_NODE_TYPES.FunctionDeclaration){let I=E.id?.name,D=I?c(I)||p(I):!1;T(E,b,D);continue}T(E,b,!1);continue}if(S.specifiers.length>0)for(let E of S.specifiers){if(E.local.type!==X.AST_NODE_TYPES.Identifier)continue;let I=E.local.name,D=c(I);T(E,b,D)}continue}if(S.type===X.AST_NODE_TYPES.ExportDefaultDeclaration){let b=S.declaration;if(b.type===X.AST_NODE_TYPES.Identifier){let E=c(b.name)||p(b.name);T(S,!1,E);continue}if(b.type===X.AST_NODE_TYPES.FunctionDeclaration||b.type===X.AST_NODE_TYPES.ArrowFunctionExpression||b.type===X.AST_NODE_TYPES.FunctionExpression||b.type===X.AST_NODE_TYPES.CallExpression){T(S,!1,!0);continue}T(S,!1,!1);continue}}let y=!1;for(let S of g)if(!S.isType&&S.isComponent){y=!0;break}if(!y)return{};let C=[];for(let S of g)S.isType||C.push(S);let A=-1;for(let[S,b]of C.entries())if(b.isComponent){A=S;break}if(A===-1)return{};for(let[S,b]of C.entries())if(S!==A){e.report({node:b.node,messageId:"multipleExports"});break}return{}}});var Fe=require("@typescript-eslint/utils"),mt=require("zod/v4");function dt(e){return e.charAt(0).toUpperCase()+e.slice(1)}function Hs(e){return e.callee.type===Fe.AST_NODE_TYPES.Identifier?e.callee.name==="useState":e.callee.type===Fe.AST_NODE_TYPES.MemberExpression&&e.callee.object.type===Fe.AST_NODE_TYPES.Identifier&&e.callee.property.type===Fe.AST_NODE_TYPES.Identifier?e.callee.object.name==="React"&&e.callee.property.name==="useState":!1}var Ks=mt.z.object({ignorePrefixes:mt.z.array(mt.z.string()).optional()});function Nr(e,t){for(let o of t)if(e.startsWith(o))return e.slice(o.length);return e}function Qs(e){return`set${dt(e)}`}var Sn=v({name:"use-state-setter-naming",meta:{type:"problem",docs:{description:"Enforce consistent naming convention for useState destructuring where setter should be set{Value}"},messages:{incorrectSetterName:'useState setter should follow the pattern "set{{expectedName}}" with a "set" prefix but got "{{actualName}}"',useSuggestedName:'Use "{{expectedSetterName}}" instead'},hasSuggestions:!0,schema:[k(Ks)]},defaultOptions:[{ignorePrefixes:[]}],create(e,[t]){return{VariableDeclarator(o){if(!o.init||o.init.type!==Fe.AST_NODE_TYPES.CallExpression||!Hs(o.init)||o.id.type!==Fe.AST_NODE_TYPES.ArrayPattern||o.id.elements.length!==2)return;let[r,i]=o.id.elements;if(!r||!i||r.type!==Fe.AST_NODE_TYPES.Identifier||i.type!==Fe.AST_NODE_TYPES.Identifier)return;let s=r.name,n=i.name,a=t.ignorePrefixes||[],p=Nr(s,a),l=Nr(n,a);if(p===""){if(!l.startsWith("set")){let m=`set${dt(s)}`;e.report({node:i,messageId:"incorrectSetterName",data:{expectedName:dt(s),actualName:n},suggest:[{messageId:"useSuggestedName",data:{expectedSetterName:m},fix:u=>u.replaceText(i,m)}]})}return}let d=Qs(p);l!==d&&e.report({node:i,messageId:"incorrectSetterName",data:{expectedName:dt(p),actualName:n},suggest:[{messageId:"useSuggestedName",data:{expectedSetterName:d},fix:m=>m.replaceText(i,d)}]})}}}});var ie=require("@typescript-eslint/utils"),Je=require("zod/v4");var ea=Je.z.object({name:Je.z.string(),defaults:Je.z.array(Je.z.unknown())}),ta=Je.z.object({functions:Je.z.array(ea)});function yt(e,t){if(e===t)return!0;if(e===null||t===null||e===void 0||t===void 0)return e===t;if(typeof e!=typeof t||typeof e!="object"||Array.isArray(e)!==Array.isArray(t))return!1;if(Array.isArray(e)&&Array.isArray(t))return e.length!==t.length?!1:e.every((i,s)=>yt(i,t[s]));let o=Object.keys(e),r=Object.keys(t);if(o.length!==r.length)return!1;for(let i of o){if(!r.includes(i))return!1;let s=Object.getOwnPropertyDescriptor(e,i),n=Object.getOwnPropertyDescriptor(t,i);if(!s||!n)return!1;let a=s.value,p=n.value;if(!yt(a,p))return!1}return!0}function na(e,t){let o=new Set;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return o;for(let r in e){if(!(r in t))continue;let i=Object.getOwnPropertyDescriptor(e,r),s=Object.getOwnPropertyDescriptor(t,r);i&&s&&yt(i.value,s.value)&&o.add(r)}return o}function Rr(e){if(e.type===ie.AST_NODE_TYPES.SpreadElement)return Symbol("COMPLEX_EXPRESSION");switch(e.type){case ie.AST_NODE_TYPES.Literal:return e.value;case ie.AST_NODE_TYPES.ObjectExpression:{let t={};for(let o of e.properties)o.type===ie.AST_NODE_TYPES.Property&&o.key.type===ie.AST_NODE_TYPES.Identifier&&!o.computed&&(o.value.type===ie.AST_NODE_TYPES.Literal?t[o.key.name]=o.value.value:o.value.type===ie.AST_NODE_TYPES.ObjectExpression?t[o.key.name]=Rr(o.value):t[o.key.name]=Symbol("COMPLEX_EXPRESSION"));return t}case ie.AST_NODE_TYPES.ArrayExpression:return e.elements.map(t=>{if(!(!t||t.type===ie.AST_NODE_TYPES.SpreadElement))return t.type===ie.AST_NODE_TYPES.Literal?t.value:Symbol("COMPLEX_EXPRESSION")});default:return Symbol("COMPLEX_EXPRESSION")}}function ra(e){return e.type===ie.AST_NODE_TYPES.Identifier?e.name:e.type===ie.AST_NODE_TYPES.MemberExpression&&e.property.type===ie.AST_NODE_TYPES.Identifier&&!e.computed?e.property.name:null}var Tn=v({name:"no-redundant-function-params",meta:{type:"suggestion",docs:{description:"Disallow calling functions with redundant default parameters"},messages:{redundantParams:"Function call has redundant parameters matching its default values and can be removed: {{details}}"},fixable:"code",schema:[k(ta)]},defaultOptions:[{functions:[]}],create(e,[t]){let o=new Map;for(let r of t.functions)o.set(r.name,r.defaults);return{CallExpression(r){let i=ra(r.callee);if(!i)return;let s=o.get(i);if(!s)return;let n=r.arguments;if(n.length===0)return;let a=-1,p=!1,l=new Map,d=new Set,m=new Map,u=[];for(let c=0;c<n.length;c++){if(c>=s.length){a=c;continue}let g=s[c],T=n[c];if(!T||T.type===ie.AST_NODE_TYPES.SpreadElement){a=c;continue}let y=Rr(T);if(g===void 0){a=c;continue}if(yt(y,g)){T.type===ie.AST_NODE_TYPES.ObjectExpression?(d.add(c),u.push({type:"object",position:c+1})):(m.set(c,y),u.push({type:"simple",position:c+1,value:y}));continue}if(T.type===ie.AST_NODE_TYPES.ObjectExpression&&T.properties.length===0&&typeof g=="object"&&g!==null&&Object.keys(g).length>0){d.add(c),u.push({type:"object",position:c+1});continue}let C=na(y,g);if(C.size>0){let A=typeof g=="object"&&g!==null?Object.keys(g).length:0;if(T.type===ie.AST_NODE_TYPES.ObjectExpression&&T.properties.length===C.size&&T.properties.length===A){d.add(c),u.push({type:"object",position:c+1});continue}else p=!0,l.set(c,C),u.push({type:"partialObject",position:c+1,redundantProperties:Array.from(C)}),a=c}else a=c}if(a<n.length-1||p||d.size>0){let c=function(){let T=[];for(let y of u)if(y.type==="simple")T.push(`Param ${y.position} with value ${JSON.stringify(y.value)}`);else if(y.type==="object")T.push(`Param ${y.position} (object)`);else{let C=y.redundantProperties||[],A=s?s[y.position-1]:void 0;if(typeof A=="object"&&A!==null){let S=A;for(let b of C)if(b in S){let E=Object.getOwnPropertyDescriptor(S,b);E&&T.push(`Param ${y.position} property "${b}" with value ${JSON.stringify(E.value)}`)}}}return{messageId:"redundantParams",data:{details:T.join(", ")}}};var f=c;let g=c();e.report({node:r,messageId:g.messageId,data:g.data,fix(T){let y=[];if(p)for(let[A,S]of l){let b=n[A];if(b&&b.type===ie.AST_NODE_TYPES.ObjectExpression){let E=[];for(let D of b.properties)D.type===ie.AST_NODE_TYPES.Property&&D.key.type===ie.AST_NODE_TYPES.Identifier&&!D.computed&&S.has(D.key.name)||E.push(D);let I=E.map(D=>e.sourceCode.getText(D));y.push(T.replaceText(b,`{ ${I.join(", ")} }`))}}let C=-1;for(let A=n.length-1;A>=0;A--)if(!d.has(A)&&A<=a){C=A;break}if(C<n.length-1)if(C===-1){let A=e.sourceCode.getTokenAfter(r.callee),S=e.sourceCode.getLastToken(r);A&&S&&y.push(T.replaceTextRange([A.range[1],S.range[0]],""))}else{let A=n[C],S=e.sourceCode.getLastToken(r);S&&A&&y.push(T.replaceTextRange([A.range[1],S.range[0]],""))}return y.length>0?y:null}})}}}}});var ge=require("@typescript-eslint/utils");function oa(e){let t=e.parent;for(;t;){if(t.type===ge.AST_NODE_TYPES.AwaitExpression||t.type===ge.AST_NODE_TYPES.MemberExpression&&t.object===e&&t.property.type===ge.AST_NODE_TYPES.Identifier&&t.property.name==="then"||t.type===ge.AST_NODE_TYPES.ArrowFunctionExpression&&t.body===e)return!0;if(t.type===ge.AST_NODE_TYPES.ArrayExpression&&t.parent.type===ge.AST_NODE_TYPES.CallExpression){let o=t.parent;if(o.callee.type===ge.AST_NODE_TYPES.MemberExpression&&o.callee.object.type===ge.AST_NODE_TYPES.Identifier&&o.callee.object.name==="Promise"&&o.callee.property.type===ge.AST_NODE_TYPES.Identifier&&["all","allSettled","race"].includes(o.callee.property.name))return!0}if(t.parent)t=t.parent;else break}return!1}function ia(e){let{callee:t}=e;return t.type===ge.AST_NODE_TYPES.Identifier&&t.name==="require"||t.type===ge.AST_NODE_TYPES.MemberExpression&&t.object.type===ge.AST_NODE_TYPES.Identifier&&t.object.name==="require"}var En=v({name:"no-sync-dynamic-import",meta:{type:"problem",docs:{description:"Disallow synchronous dynamic imports and require statements, only allow async dynamic imports with await"},messages:{syncDynamicImport:"Synchronous dynamic import() is not allowed. Use regular import statement or await import() for dynamic imports.",requireNotAllowed:"require() statements are not allowed. Use ES6 import statements instead."},schema:[]},defaultOptions:[],create(e){return{ImportExpression(t){oa(t)||e.report({node:t,messageId:"syncDynamicImport"})},TSImportType(t){e.report({node:t,messageId:"syncDynamicImport"})},CallExpression(t){ia(t)&&e.report({node:t,messageId:"requireNotAllowed"})}}}});var R=require("@typescript-eslint/utils"),gt=require("zod/v4");var sa=gt.z.object({mainComponentRegex:gt.z.string().optional(),mainComponentSelector:gt.z.string().optional()}),aa=/^[A-Z][A-Za-z0-9]*$/,xn=v({name:"sort-react-components-and-styles",meta:{type:"suggestion",docs:{description:"Sort React components and styles with styles placed above their first usage"},fixable:"code",schema:[k(sa)],messages:{stylesShouldBeAboveUsage:"Style definitions should be placed above the first component that uses them",mainComponentShouldBeFirst:"Main component should be placed before other components"}},defaultOptions:[{}],create(e,[t]){let o=e.sourceCode,r=t.mainComponentRegex?new RegExp(t.mainComponentRegex):void 0,i=t.mainComponentSelector;if(!e.filename.endsWith(".tsx"))return{};let n=new Set,a=new Map,p=[],l=[],d=new Set;function m(h){let x=h.node;if(x.type===R.AST_NODE_TYPES.VariableDeclaration){for(let P of x.declarations)if(P.id.type===R.AST_NODE_TYPES.Identifier&&P.id.name===h.name&&P.init)return P.init}if(x.type===R.AST_NODE_TYPES.ExportNamedDeclaration){let P=x.declaration;if(P&&P.type===R.AST_NODE_TYPES.VariableDeclaration){for(let j of P.declarations)if(j.id.type===R.AST_NODE_TYPES.Identifier&&j.id.name===h.name&&j.init)return j.init}}return null}function u(h){let x=new Set;return Re(h,P=>(P.type===R.AST_NODE_TYPES.Identifier&&P.name!=="styled"&&P.name!=="css"&&x.add(P.name),!1),o),x}function f(h){return aa.test(h)}function c(h){if(h.type!==R.AST_NODE_TYPES.CallExpression)return!1;let x=h.callee;return x.type===R.AST_NODE_TYPES.Identifier?x.name==="memo"||x.name==="forwardRef":x.type===R.AST_NODE_TYPES.MemberExpression&&x.property.type===R.AST_NODE_TYPES.Identifier?x.property.name==="memo"||x.property.name==="forwardRef":!1}function g(h){if(h.type===R.AST_NODE_TYPES.JSXElement||h.type===R.AST_NODE_TYPES.JSXFragment)return!0;if(h.type===R.AST_NODE_TYPES.BlockStatement){for(let x of h.body)if(x.type===R.AST_NODE_TYPES.ReturnStatement&&x.argument)return g(x.argument)}if(h.type===R.AST_NODE_TYPES.ArrayExpression){for(let x of h.elements)if(x&&(x.type===R.AST_NODE_TYPES.JSXElement||x.type===R.AST_NODE_TYPES.JSXFragment))return!0}return!1}function T(h){if(h.type!==R.AST_NODE_TYPES.ArrowFunctionExpression)return!1;let x=h.body;if(x.type===R.AST_NODE_TYPES.ArrowFunctionExpression){let P=x.body;if(g(P))return!0}return!1}function y(h){if(h.type===R.AST_NODE_TYPES.TaggedTemplateExpression){let x=h.tag;if(x.type===R.AST_NODE_TYPES.MemberExpression&&x.object.type===R.AST_NODE_TYPES.Identifier&&x.object.name==="styled")return!0;if(x.type===R.AST_NODE_TYPES.CallExpression){let P=x.callee;if(P.type===R.AST_NODE_TYPES.Identifier&&P.name==="styled")return!0}}return!1}function C(h){if(h.type===R.AST_NODE_TYPES.TaggedTemplateExpression){let x=h.tag;if(x.type===R.AST_NODE_TYPES.Identifier&&x.name==="css")return!0}return!1}function A(h,x){if(h.id.type!==R.AST_NODE_TYPES.Identifier)return;let P=h.id.name,j=h.init;if(j){if(y(j)||C(j)){l.push({node:x,name:P});return}if((f(P)||j.type===R.AST_NODE_TYPES.ArrowFunctionExpression)&&(j.type===R.AST_NODE_TYPES.ArrowFunctionExpression||j.type===R.AST_NODE_TYPES.FunctionExpression||c(j))){if(j.type===R.AST_NODE_TYPES.ArrowFunctionExpression||j.type===R.AST_NODE_TYPES.FunctionExpression){if(g(j.body)){n.add(P);return}}else if(c(j)){n.add(P);return}}j.type===R.AST_NODE_TYPES.Identifier&&a.set(P,j.name),f(P)||T(j)&&n.add(P)}}function S(h){return h.type===R.AST_NODE_TYPES.ExportDefaultDeclaration||h.type===R.AST_NODE_TYPES.ExportNamedDeclaration}function b(h){if(h.type===R.AST_NODE_TYPES.FunctionDeclaration)return h.id?h.id.name:null;if(h.type===R.AST_NODE_TYPES.VariableDeclaration){let x=h.declarations[0];if(x&&x.id.type===R.AST_NODE_TYPES.Identifier)return x.id.name}if(h.type===R.AST_NODE_TYPES.ExportDefaultDeclaration){let x=h.declaration;if(x.type===R.AST_NODE_TYPES.FunctionDeclaration)return x.id?x.id.name:"default";if(x.type===R.AST_NODE_TYPES.Identifier)return x.name}if(h.type===R.AST_NODE_TYPES.ExportNamedDeclaration){let x=h.declaration;if(x&&x.type===R.AST_NODE_TYPES.FunctionDeclaration)return x.id?x.id.name:null;if(x&&x.type===R.AST_NODE_TYPES.VariableDeclaration){let P=x.declarations[0];if(P&&P.id.type===R.AST_NODE_TYPES.Identifier)return P.id.name}}return null}function E(h,x){return i?d.has(h):r?r.test(x):S(h)}function I(h){let x=new Set;Re(h.node,P=>{if(P.type===R.AST_NODE_TYPES.Identifier)for(let j of l)j.name===P.name&&(x.add(j.name),(j.firstUsagePosition===void 0||P.range[0]<j.firstUsagePosition)&&(j.firstUsagePosition=P.range[0]));if(P.type===R.AST_NODE_TYPES.JSXElement){let j=P.openingElement;if(j.name.type===R.AST_NODE_TYPES.JSXIdentifier)for(let Y of l)Y.name===j.name.name&&(x.add(Y.name),(Y.firstUsagePosition===void 0||j.name.range[0]<Y.firstUsagePosition)&&(Y.firstUsagePosition=j.name.range[0]))}return!1},o),h.usedStyles=x}function D(h){if(h.type===R.AST_NODE_TYPES.VariableDeclaration){for(let x of h.declarations)A(x,h);return}if(h.type===R.AST_NODE_TYPES.FunctionDeclaration){f(h.id.name)&&g(h.body)&&n.add(h.id.name);return}if(h.type===R.AST_NODE_TYPES.ExportNamedDeclaration&&h.declaration){let x=h.declaration;if(x.type===R.AST_NODE_TYPES.VariableDeclaration){for(let P of x.declarations)A(P,h);return}if(x.type===R.AST_NODE_TYPES.FunctionDeclaration&&x.id){f(x.id.name)&&g(x.body)&&n.add(x.id.name);return}}if(h.type===R.AST_NODE_TYPES.ExportDefaultDeclaration){let x=h.declaration;x.type===R.AST_NODE_TYPES.Identifier&&n.add(x.name),(x.type===R.AST_NODE_TYPES.FunctionDeclaration||x.type===R.AST_NODE_TYPES.ArrowFunctionExpression||x.type===R.AST_NODE_TYPES.FunctionExpression)&&(x.type===R.AST_NODE_TYPES.FunctionDeclaration?x.id?n.add(x.id.name):n.add("default"):g(x.body)&&n.add("default"))}}function M(h,x=new Set){if(n.has(h))return!0;if(x.has(h))return!1;x.add(h);let P=a.get(h);return P?M(P,x):!1}let U={};return i&&(U[i]=h=>{let x=h;for(;x.parent&&x.parent.type!==R.AST_NODE_TYPES.Program;)x=x.parent;x.parent&&(x.type===R.AST_NODE_TYPES.VariableDeclaration||x.type===R.AST_NODE_TYPES.FunctionDeclaration||x.type===R.AST_NODE_TYPES.ExportNamedDeclaration||x.type===R.AST_NODE_TYPES.ExportDefaultDeclaration)&&d.add(x)}),U["Program:exit"]=h=>{let x=0;for(let F of h.body){if(F.type===R.AST_NODE_TYPES.ImportDeclaration){x+=1;continue}break}for(let F of h.body)D(F);for(let F of h.body){let J=b(F);if(J&&M(J)){let L=E(F,J);p.push({node:F,name:J,isMainComponent:L,usedStyles:new Set,isExported:S(F)})}}if(!i&&r&&!p.some(F=>F.isMainComponent))for(let F of p)F.isExported&&(F.isMainComponent=!0);for(let F of p)I(F);let P=new Set;for(let F of l)P.add(F.name);let j=new Map;for(let F=0;F<h.body.length;F+=1){let J=h.body[F];for(let L of l)L.node===J&&j.set(L.name,F)}let Y=new Map;for(let F of l){let J=m(F),L=new Set;if(J){let ae=u(J);for(let ce of ae)P.has(ce)&&ce!==F.name&&L.add(ce)}Y.set(F.name,L)}let q=new Map;for(let F of l){let J=Y.get(F.name);if(!J)continue;let L=j.get(F.name);if(L!==void 0)for(let ae of J){let ce=q.get(ae);(ce===void 0||L<ce)&&q.set(ae,L)}}let ne=[];for(let F of l){if(F.firstUsagePosition===void 0)continue;let J=h.body.indexOf(F.node),L=-1;for(let de of p){if(!de.usedStyles.has(F.name))continue;let be=h.body.indexOf(de.node);(L===-1||be<L)&&(L=be)}let ae=q.get(F.name);if(ae!==void 0&&(L===-1||ae<L)&&(L=ae),L===-1)continue;let ce=-1;for(let de of p){let be=h.body.indexOf(de.node);be<L&&be>ce&&(ce=be)}let he=J<L,Tt=J>ce,Ne=-1,Pn=Y.get(F.name);if(Pn)for(let de of Pn){let be=j.get(de);be!==void 0&&be>Ne&&(Ne=be)}let vr=J>Ne;if(!(he&&Tt&&vr)){let de=ce+1;if(Ne+1>de&&(de=Ne+1),de<x&&(de=x),de>L)continue;ne.push({style:F,targetPosition:de})}}let Q=null;if(p.length>1){let F=p.map(L=>({c:L,idx:h.body.indexOf(L.node)})).sort((L,ae)=>L.idx-ae.idx)[0]?.c,J=p.find(L=>L.isMainComponent)||null;F&&J&&F.node!==J.node&&(Q={component:J,targetBefore:F.node})}if(ne.length>0||Q){let F=ne[0]?.style.node||Q?.component.node||h,J=ne.length>0?"stylesShouldBeAboveUsage":"mainComponentShouldBeFirst";e.report({node:F,messageId:J,fix:Z(ne,Q,h.body)})}},U;function Z(h,x,P){return function*(j){h.sort((q,ne)=>q.targetPosition-ne.targetPosition);for(let{style:q}of h){let ne=o.getCommentsBefore(q.node),Q=q.node.range[0],F=q.node.range[1];ne.length>0&&ne[0]&&(Q=ne[0].range[0]),Q===q.node.range[0]&&o.text.slice(0,Q).trim().length===0&&(Q=0),yield j.removeRange([Q,F])}let Y=new Map;for(let q of h){let ne=Y.get(q.targetPosition)||[];ne.push(q),Y.set(q.targetPosition,ne)}for(let[q,ne]of Y){let Q=P[q];if(!Q)continue;let F=o.getCommentsBefore(Q),J=F.length>0&&F[0]?F[0].range[0]:Q.range[0],L=[];for(let{style:ae}of ne){let ce=o.getCommentsBefore(ae.node),he=o.getText(ae.node);ce.length>0&&(he=`${ce.map(Ne=>o.getText(Ne)).join(`
47
36
  `)}
48
- ${Oe}`),B.push(Oe)}yield R.insertTextBeforeRange([q,q],`${B.join(`
37
+ ${he}`),L.push(he)}yield j.insertTextBeforeRange([J,J],`${L.join(`
49
38
 
50
39
  `)}
51
40
 
52
- `)}if(E){let{component:P,targetBefore:ee}=E,Z=r.getCommentsBefore(P.node),D=P.node.range[0],q=P.node.range[1];Z.length>0&&Z[0]&&(D=Z[0].range[0]),D===P.node.range[0]&&r.text.slice(0,D).trim().length===0&&(D=0);let B=r.getCommentsBefore(ee),ue=B.length>0&&B[0]?B[0].range[0]:ee.range[0],me=(()=>{let Oe=r.getText(P.node);return Z.length>0&&(Oe=`${Z.map(he=>r.getText(he)).join(`
41
+ `)}if(x){let{component:q,targetBefore:ne}=x,Q=o.getCommentsBefore(q.node),F=q.node.range[0],J=q.node.range[1];Q.length>0&&Q[0]&&(F=Q[0].range[0]),F===q.node.range[0]&&o.text.slice(0,F).trim().length===0&&(F=0);let L=o.getCommentsBefore(ne),ae=L.length>0&&L[0]?L[0].range[0]:ne.range[0],ce=(()=>{let he=o.getText(q.node);return Q.length>0&&(he=`${Q.map(Ne=>o.getText(Ne)).join(`
53
42
  `)}
54
- ${Oe}`),Oe})();yield R.removeRange([D,q]),yield R.insertTextBeforeRange([ue,ue],`${me}
55
- `)}}}}});var Wt=require("@typescript-eslint/utils"),rr=Re(require("typescript")),ji=require("zod/v4");var Ll=ji.z.object({}),ir=z({name:"no-unnecessary-void-on-promise",meta:{type:"suggestion",docs:{description:"Disallow void operator on non-Promise function calls to avoid unnecessary void keywords added by no-floating-promises"},messages:{unnecessaryVoid:"Unnecessary void operator on non-Promise function call",removeVoid:"Remove void operator"},hasSuggestions:!0,schema:[U(Ll)]},defaultOptions:[{}],create(e){let t=Wt.ESLintUtils.getParserServices(e,!0),r=t.program?.getTypeChecker();if(!r||!t.program)throw new Error("TypeScript services or program not available");function n(s,o){if(s.flags&rr.default.TypeFlags.Any||s.flags&rr.default.TypeFlags.Unknown)return!1;let i=s.getProperty("then");return i?o.getTypeOfSymbol(i).getCallSignatures().length>0:!1}return{UnaryExpression(s){if(s.operator!=="void"||s.argument.type!==Wt.AST_NODE_TYPES.CallExpression)return;let o=t.esTreeNodeToTSNodeMap.get(s.argument),i=r.getTypeAtLocation(o);if(!n(i,r)){let l=e.sourceCode.getText(s.argument);e.report({node:s,messageId:"unnecessaryVoid",suggest:[{messageId:"removeVoid",fix(p){return p.replaceText(s,l)}}]})}}}}});var Ae=require("@typescript-eslint/utils"),St=require("zod/v4");var jl=St.z.object({functions:St.z.array(St.z.string()).optional(),selectors:St.z.array(St.z.string()).optional()});function Mi(e){let t=e.parent;for(;t;){if(t.type===Ae.AST_NODE_TYPES.FunctionDeclaration||t.type===Ae.AST_NODE_TYPES.FunctionExpression||t.type===Ae.AST_NODE_TYPES.ArrowFunctionExpression)return!0;t=t.parent}return!1}function $i(e){if(e.type===Ae.AST_NODE_TYPES.TaggedTemplateExpression){let{tag:r}=e;return r.type===Ae.AST_NODE_TYPES.Identifier?r.name:r.type===Ae.AST_NODE_TYPES.MemberExpression&&r.property.type===Ae.AST_NODE_TYPES.Identifier?r.property.name:null}let{callee:t}=e;return t.type===Ae.AST_NODE_TYPES.Identifier?t.name:t.type===Ae.AST_NODE_TYPES.MemberExpression&&t.property.type===Ae.AST_NODE_TYPES.Identifier?t.property.name:null}var sr=z({name:"require-lazy-execution",meta:{type:"problem",docs:{description:"Require certain function calls to be executed lazily (inside functions, not at module level)"},messages:{moduleLevel:'Function "{{ functionName }}" must only be called inside functions or getters, not at module level'},schema:[U(jl)]},defaultOptions:[{functions:[],selectors:[]}],create(e){let[t]=e.options,r=new Set(t.functions??[]),n=t.selectors??[];function s(i){if(Mi(i))return;let a=$i(i);a&&r.has(a)&&e.report({node:i,messageId:"moduleLevel",data:{functionName:a}})}let o={CallExpression(i){i.type===Ae.AST_NODE_TYPES.CallExpression&&s(i)},TaggedTemplateExpression(i){i.type===Ae.AST_NODE_TYPES.TaggedTemplateExpression&&s(i)}};for(let i of n)o[i]=a=>{if(a.type!==Ae.AST_NODE_TYPES.CallExpression&&a.type!==Ae.AST_NODE_TYPES.TaggedTemplateExpression||Mi(a))return;let l=$i(a);l&&e.report({node:a,messageId:"moduleLevel",data:{functionName:l}})};return o}});var Pe=require("@typescript-eslint/utils");function Ml(e,t){let{body:r}=e;if(r.type!==Pe.AST_NODE_TYPES.BlockStatement)return t.getText(r);let n=r.body[0];return!n||n.type!==Pe.AST_NODE_TYPES.ReturnStatement?"":n.argument?t.getText(n.argument):"undefined"}function $l(e){let t=e.parent;if(t.type!==Pe.AST_NODE_TYPES.ReturnStatement)return null;let r=t.parent;if(r.type!==Pe.AST_NODE_TYPES.BlockStatement||r.body.length!==1)return null;let n=r.parent;return n.type!==Pe.AST_NODE_TYPES.FunctionDeclaration&&n.type!==Pe.AST_NODE_TYPES.ArrowFunctionExpression&&n.type!==Pe.AST_NODE_TYPES.FunctionExpression?null:{parentFunction:n,returnStatement:t}}var or=z({name:"no-unnecessary-iife",meta:{type:"suggestion",fixable:"code",docs:{description:"Disallow unnecessary immediately invoked function expressions"},messages:{unnecessaryIife:"Unnecessary IIFE. Can be simplified to the returned expression."},schema:[]},defaultOptions:[],create(e){let t=e.sourceCode;return{CallExpression(r){let{callee:n,arguments:s}=r;if(s.length>0||n.type!==Pe.AST_NODE_TYPES.FunctionExpression&&n.type!==Pe.AST_NODE_TYPES.ArrowFunctionExpression||n.async||n.params.length>0)return;let{body:o}=n;if(o.type===Pe.AST_NODE_TYPES.BlockStatement){if(o.body.length!==1){let p=$l(r);if(p){if(t.getCommentsInside(n).length>0)return;let y=t.getText(o);e.report({node:r,messageId:"unnecessaryIife",fix:u=>{let{parentFunction:d}=p;return d.body.type!==Pe.AST_NODE_TYPES.BlockStatement?null:u.replaceText(d.body,y)}})}return}let l=o.body[0];if(!l||l.type!==Pe.AST_NODE_TYPES.ReturnStatement)return}if(t.getCommentsInside(n).length>0)return;let a=Ml(n,t);e.report({node:r,messageId:"unnecessaryIife",fix:l=>l.replaceText(r,a)})}}}});var nt=require("zod/v4");var _l="no-restricted-comments",Ul=nt.z.object({regex:nt.z.string().optional(),includes:nt.z.string().optional(),message:nt.z.string().optional(),autoFix:nt.z.boolean().optional()}),zl=nt.z.object({patterns:nt.z.array(Ul)}),ar=z({name:_l,meta:{type:"problem",docs:{description:"Disallow comments matching specific patterns"},fixable:"code",hasSuggestions:!0,schema:[U(zl)],messages:{restrictedComment:"Comment matches restricted pattern '{{pattern}}'",restrictedCommentWithMessage:"{{message}}",removeComment:"Remove this comment"}},defaultOptions:[{patterns:[]}],create(e,[t]){let r=e.sourceCode,n=new Map;function s(i){let a=n.get(i);return a||(a=new RegExp(i),n.set(i,a)),a}function o(i,a){return a.regex?s(a.regex).test(i):a.includes?i.includes(a.includes):!1}return{Program(){let i=r.getAllComments();for(let l of i)for(let p of t.patterns)if(o(l.value,p)){let y=function(u){return u.remove(l)};var a=y;let m=p.regex??p.includes??"";p.message?e.report({loc:l.loc,messageId:"restrictedCommentWithMessage",data:{message:p.message},fix:p.autoFix?y:void 0,suggest:p.autoFix?void 0:[{messageId:"removeComment",fix:y}]}):e.report({loc:l.loc,messageId:"restrictedComment",data:{pattern:m},fix:p.autoFix?y:void 0,suggest:p.autoFix?void 0:[{messageId:"removeComment",fix:y}]});break}}}}});var Jt=require("@typescript-eslint/utils"),Tt=require("zod/v4");var Vl=Tt.z.object({allow:Tt.z.record(Tt.z.string(),Tt.z.array(Tt.z.string())).optional()}),lr=z({name:"no-data-attributes-on-components",meta:{type:"problem",docs:{description:"Disallow data-* attributes on custom React components. Use regular props instead."},schema:[U(Vl)],messages:{noDataAttributesOnComponents:"Avoid using data-* attributes on custom components. Use regular props instead or apply data attributes to the underlying DOM element."}},defaultOptions:[{}],create(e,[t]){let r=t.allow??{};function n(i){let a=i.charAt(0);return a===a.toUpperCase()&&a!==a.toLowerCase()}function s(i){return i.type===Jt.AST_NODE_TYPES.JSXIdentifier?{name:i.name,isCustom:n(i.name)}:i.type===Jt.AST_NODE_TYPES.JSXMemberExpression?{name:"",isCustom:!0}:{name:`${i.namespace.name}:${i.name.name}`,isCustom:!1}}function o(i,a){let l=r[i];return l?l.includes(a):!1}return{JSXAttribute(i){if(i.name.type!==Jt.AST_NODE_TYPES.JSXIdentifier)return;let a=i.name.name;if(!a.startsWith("data-"))return;let l=s(i.parent.name);!l||!l.isCustom||l.name&&o(l.name,a)||e.report({node:i,messageId:"noDataAttributesOnComponents"})}}}});var rt=require("@typescript-eslint/utils"),it=require("zod/v4");var Wl=it.z.object({fn:it.z.string().optional(),selector:it.z.string().optional(),commentPrefix:it.z.string(),message:it.z.string().optional()}),Jl=it.z.object({matches:it.z.array(Wl)}),pr=z({name:"require-usage-explanation",meta:{type:"problem",docs:{description:"Require explanatory comments with a specific prefix above matched code patterns"},schema:[U(Jl)],messages:{default:"{{message}}"}},defaultOptions:[{matches:[]}],create(e,[t]){let r=e.sourceCode,n={},s=[];function o(u){let d=u;for(;d.parent;){let c=d.parent.type;if(c===rt.AST_NODE_TYPES.Program||c===rt.AST_NODE_TYPES.BlockStatement||c===rt.AST_NODE_TYPES.SwitchCase)return d;d=d.parent}}function i(u,d){for(let c of u){let g=c.value.trim();if(g.startsWith(d)&&g.slice(d.length).trim().length>0)return!0}return!1}function a(u){let{callee:d}=u;if(d.type===rt.AST_NODE_TYPES.Identifier)return d.name;if(d.type===rt.AST_NODE_TYPES.MemberExpression&&d.property.type===rt.AST_NODE_TYPES.Identifier)return d.property.name}function l(u,d,c){let g=`Add a comment with prefix "${u}" to explain why "${d}" is being used.`;return c?`${g} ${c}`:g}function p(u,d){let c=o(u);if(!c)return!1;let g=u;for(;g!==c&&g.parent;){let S=r.getCommentsBefore(g);if(i(S,d))return!0;g=g.parent}let h=r.getCommentsBefore(c);return!!i(h,d)}function m(u,d){p(u,d.commentPrefix)||e.report({node:u,messageId:"default",data:{message:l(d.commentPrefix,d.label,d.message)}})}function y(u,d){let c=n[u];c?n[u]=g=>{c(g),d(g)}:n[u]=d}for(let u of t.matches){if(u.fn){let d=u.fn,c={commentPrefix:u.commentPrefix,label:d,message:u.message};s.push(g=>{a(g)===d&&m(g,c)})}if(u.selector){let d={commentPrefix:u.commentPrefix,label:u.selector,message:u.message};y(u.selector,c=>{m(c,d)})}}return s.length>0&&y("CallExpression",u=>{if(u.type===rt.AST_NODE_TYPES.CallExpression)for(let d of s)d(u)}),n}});var ge=require("@typescript-eslint/utils"),Me=Re(require("typescript")),Je=require("zod/v4");var Xl=Je.z.object({additionalCastFunctions:Je.z.array(Je.z.object({name:Je.z.string(),expectedType:Je.z.enum(["string","number"])})).optional(),allowNullishCasting:Je.z.boolean().optional(),allowInvalidCasting:Je.z.boolean().optional(),allowAnyCasting:Je.z.boolean().optional(),allowUnknownCasting:Je.z.boolean().optional()}),_i=new Set([ge.AST_NODE_TYPES.Identifier,ge.AST_NODE_TYPES.Literal,ge.AST_NODE_TYPES.TemplateLiteral,ge.AST_NODE_TYPES.MemberExpression,ge.AST_NODE_TYPES.CallExpression]),Bl=Me.TypeFlags.Null|Me.TypeFlags.Undefined|Me.TypeFlags.Void;function Hl(e,t){if(_i.has(e.type))return!1;if(e.type===ge.AST_NODE_TYPES.SequenceExpression)return!0;let r=t.parent;switch(r.type){case ge.AST_NODE_TYPES.VariableDeclarator:case ge.AST_NODE_TYPES.ExpressionStatement:case ge.AST_NODE_TYPES.ReturnStatement:case ge.AST_NODE_TYPES.ArrowFunctionExpression:case ge.AST_NODE_TYPES.Property:case ge.AST_NODE_TYPES.ArrayExpression:case ge.AST_NODE_TYPES.AssignmentExpression:case ge.AST_NODE_TYPES.JSXExpressionContainer:return!1;case ge.AST_NODE_TYPES.CallExpression:case ge.AST_NODE_TYPES.NewExpression:return r.callee===t;default:return!0}}var cr=z({name:"strict-casting",meta:{type:"problem",docs:{description:"Disallow unnecessary, nullish and invalid String()/Number() casts"},schema:[U(Xl)],fixable:"code",hasSuggestions:!0,messages:{unnecessaryCasting:"Unnecessary {{name}}() cast of a value that is already of type {{type}}",nullishStringCasting:"String() cast of a possibly nullish value results in the strings 'null' or 'undefined', handle the nullish case explicitly",nullishNumberCasting:"Number() cast of a possibly nullish value results in 0 for null and NaN for undefined, handle the nullish case explicitly",symbolNumberCasting:"Number() cast of a symbol throws at runtime",nanNumberCasting:'Number() cast of a value of type "{{type}}" will result in NaN',anyCasting:"{{name}}() cast of an `any` value is unsafe, type the value before casting",unknownCasting:"{{name}}() cast of an `unknown` value is unsafe, narrow the value before casting",addNullishFallback:"Add a `?? {{fallback}}` fallback to handle the nullish case"}},defaultOptions:[{}],create(e,[t]){let r=t.allowNullishCasting??!1,n=t.allowInvalidCasting??!1,s=t.allowAnyCasting??!1,o=t.allowUnknownCasting??!1,i=new Map([["String",{expectedType:"string",builtin:!0}],["Number",{expectedType:"number",builtin:!0}]]);for(let u of t.additionalCastFunctions??[])i.set(u.name,{expectedType:u.expectedType,builtin:!1});let a=ge.ESLintUtils.getParserServices(e),l=a.program.getTypeChecker();function p(u){let d=u.isUnion()?u.types:[u],c=[];for(let g of d)if(g.isTypeParameter()){let h=l.getBaseConstraintOfType(g);if(!h)return;h.isUnion()?c.push(...h.types):c.push(h)}else c.push(g);return c}function m(u,d){let g=l.getApparentType(u).getProperty("valueOf");if(!g)return!1;let h=l.getTypeOfSymbolAtLocation(g,d);for(let S of h.getCallSignatures())if(S.getReturnType().flags&Me.TypeFlags.NumberLike)return!0;return!1}function y(u,d,c,g){e.report({node:u,messageId:"unnecessaryCasting",data:{name:c,type:g},fix(h){let S=e.sourceCode.getText(d);return h.replaceText(u,Hl(d,u)?`(${S})`:S)}})}return{CallExpression(u){if(u.callee.type!==ge.AST_NODE_TYPES.Identifier)return;let d=i.get(u.callee.name);if(!d||u.arguments.length!==1)return;let c=u.arguments[0];if(!c||c.type===ge.AST_NODE_TYPES.SpreadElement)return;let g=u.callee.name,{expectedType:h,builtin:S}=d;if(c.type===ge.AST_NODE_TYPES.Literal){if(typeof c.value===h){y(u,c,g,h);return}}else if(c.type===ge.AST_NODE_TYPES.TemplateLiteral&&h==="string"){y(u,c,g,h);return}let I=l.getTypeAtLocation(a.esTreeNodeToTSNodeMap.get(c)),A=p(I);if(!A)return;let T=!1,b=!1;for(let w of A)w.flags&Me.TypeFlags.Any?T=!0:w.flags&Me.TypeFlags.Unknown&&(b=!0);if(T||b){S&&(T&&!s?e.report({node:u,messageId:"anyCasting",data:{name:g}}):b&&!o&&e.report({node:u,messageId:"unknownCasting",data:{name:g}}));return}if(S&&!r&&A.some(N=>N.flags&Bl)){let N=h==="string"?"''":"0";e.report({node:u,messageId:h==="string"?"nullishStringCasting":"nullishNumberCasting",suggest:[{messageId:"addNullishFallback",data:{fallback:N},fix(k){let O=e.sourceCode.getText(c),f=_i.has(c.type)?O:`(${O})`;return k.replaceText(c,`${f} ?? ${N}`)}}]});return}if(S&&h==="number"&&!n){if(A.some(k=>k.flags&Me.TypeFlags.ESSymbolLike)){e.report({node:u,messageId:"symbolNumberCasting"});return}let w=a.esTreeNodeToTSNodeMap.get(c);if(A.some(k=>k.flags&(Me.TypeFlags.Object|Me.TypeFlags.Intersection)&&!m(k,w))){e.report({node:u,messageId:"nanNumberCasting",data:{type:l.typeToString(I)}});return}}let C=h==="string"?Me.TypeFlags.StringLike:Me.TypeFlags.NumberLike;A.every(w=>w.flags&C)&&y(u,c,g,h)}}}});var Ui={[wn.name]:wn.rule,[on.name]:on.rule,[sn.name]:sn.rule,"rules-of-hooks":Pi,"exhaustive-deps":Cr,"require-description":xi.rule,[an.name]:an.rule,[pn.name]:pn.rule,[vn.name]:vn.rule,[Bt.name]:Bt.rule,[rn.name]:rn.rule,[un.name]:un.rule,[bt.name]:bt.rule,[kn.name]:kn.rule,[cn.name]:cn.rule,[ln.name]:ln.rule,[mn.name]:mn.rule,[Yt.name]:Yt.rule,[jn.name]:jn.rule,[Ln.name]:Ln.rule,[_n.name]:_n.rule,[Wn.name]:Wn.rule,[nn.name]:nn.rule,[Sn.name]:Sn.rule,[Tn.name]:Tn.rule,[En.name]:En.rule,[Cn.name]:Cn.rule,[In.name]:In.rule,[hn.name]:hn.rule,[xn.name]:xn.rule,[Nn.name]:Nn.rule,[dn.name]:dn.rule,[yn.name]:yn.rule,[Zn.name]:Zn.rule,[Fn.name]:Fn.rule,[Jn.name]:Jn.rule,[Yn.name]:Yn.rule,[Gn.name]:Gn.rule,[Kn.name]:Kn.rule,[Qn.name]:Qn.rule,[er.name]:er.rule,[tr.name]:tr.rule,[nr.name]:nr.rule,[ir.name]:ir.rule,[sr.name]:sr.rule,[bt.name]:bt.rule,[or.name]:or.rule,[ar.name]:ar.rule,[lr.name]:lr.rule,[pr.name]:pr.rule,[cr.name]:cr.rule};var zi={rules:Ui},Yl=zi;0&&(module.exports={extendedLintPlugin});
43
+ ${he}`),he})();yield j.removeRange([F,J]),yield j.insertTextBeforeRange([ae,ae],`${ce}
44
+ `)}}}}});var fe=require("@typescript-eslint/utils"),qe=require("zod/v4");var pa=qe.z.object({functions:qe.z.array(qe.z.string()).optional(),selectors:qe.z.array(qe.z.string()).optional()});function wr(e){let t=e.parent;for(;t;){if(t.type===fe.AST_NODE_TYPES.FunctionDeclaration||t.type===fe.AST_NODE_TYPES.FunctionExpression||t.type===fe.AST_NODE_TYPES.ArrowFunctionExpression)return!0;t=t.parent}return!1}function Fr(e){if(e.type===fe.AST_NODE_TYPES.TaggedTemplateExpression){let{tag:o}=e;return o.type===fe.AST_NODE_TYPES.Identifier?o.name:o.type===fe.AST_NODE_TYPES.MemberExpression&&o.property.type===fe.AST_NODE_TYPES.Identifier?o.property.name:null}let{callee:t}=e;return t.type===fe.AST_NODE_TYPES.Identifier?t.name:t.type===fe.AST_NODE_TYPES.MemberExpression&&t.property.type===fe.AST_NODE_TYPES.Identifier?t.property.name:null}var hn=v({name:"require-lazy-execution",meta:{type:"problem",docs:{description:"Require certain function calls to be executed lazily (inside functions, not at module level)"},messages:{moduleLevel:'Function "{{ functionName }}" must only be called inside functions or getters, not at module level'},schema:[k(pa)]},defaultOptions:[{functions:[],selectors:[]}],create(e){let[t]=e.options,o=new Set(t.functions??[]),r=t.selectors??[];function i(n){if(wr(n))return;let a=Fr(n);a&&o.has(a)&&e.report({node:n,messageId:"moduleLevel",data:{functionName:a}})}let s={CallExpression(n){n.type===fe.AST_NODE_TYPES.CallExpression&&i(n)},TaggedTemplateExpression(n){n.type===fe.AST_NODE_TYPES.TaggedTemplateExpression&&i(n)}};for(let n of r)s[n]=a=>{if(a.type!==fe.AST_NODE_TYPES.CallExpression&&a.type!==fe.AST_NODE_TYPES.TaggedTemplateExpression||wr(a))return;let p=Fr(a);p&&e.report({node:a,messageId:"moduleLevel",data:{functionName:p}})};return s}});var Se=require("@typescript-eslint/utils");function la(e,t){let{body:o}=e;if(o.type!==Se.AST_NODE_TYPES.BlockStatement)return t.getText(o);let r=o.body[0];return!r||r.type!==Se.AST_NODE_TYPES.ReturnStatement?"":r.argument?t.getText(r.argument):"undefined"}function ca(e){let t=e.parent;if(t.type!==Se.AST_NODE_TYPES.ReturnStatement)return null;let o=t.parent;if(o.type!==Se.AST_NODE_TYPES.BlockStatement||o.body.length!==1)return null;let r=o.parent;return r.type!==Se.AST_NODE_TYPES.FunctionDeclaration&&r.type!==Se.AST_NODE_TYPES.ArrowFunctionExpression&&r.type!==Se.AST_NODE_TYPES.FunctionExpression?null:{parentFunction:r,returnStatement:t}}var bn=v({name:"no-unnecessary-iife",meta:{type:"suggestion",fixable:"code",docs:{description:"Disallow unnecessary immediately invoked function expressions"},messages:{unnecessaryIife:"Unnecessary IIFE. Can be simplified to the returned expression."},schema:[]},defaultOptions:[],create(e){let t=e.sourceCode;return{CallExpression(o){let{callee:r,arguments:i}=o;if(i.length>0||r.type!==Se.AST_NODE_TYPES.FunctionExpression&&r.type!==Se.AST_NODE_TYPES.ArrowFunctionExpression||r.async||r.params.length>0)return;let{body:s}=r;if(s.type===Se.AST_NODE_TYPES.BlockStatement){if(s.body.length!==1){let l=ca(o);if(l){if(t.getCommentsInside(r).length>0)return;let m=t.getText(s);e.report({node:o,messageId:"unnecessaryIife",fix:u=>{let{parentFunction:f}=l;return f.body.type!==Se.AST_NODE_TYPES.BlockStatement?null:u.replaceText(f.body,m)}})}return}let p=s.body[0];if(!p||p.type!==Se.AST_NODE_TYPES.ReturnStatement)return}if(t.getCommentsInside(r).length>0)return;let a=la(r,t);e.report({node:o,messageId:"unnecessaryIife",fix:p=>p.replaceText(o,a)})}}}});var Me=require("zod/v4");var ua="no-restricted-comments",fa=Me.z.object({regex:Me.z.string().optional(),includes:Me.z.string().optional(),message:Me.z.string().optional(),autoFix:Me.z.boolean().optional()}),ma=Me.z.object({patterns:Me.z.array(fa)}),Cn=v({name:ua,meta:{type:"problem",docs:{description:"Disallow comments matching specific patterns"},fixable:"code",hasSuggestions:!0,schema:[k(ma)],messages:{restrictedComment:"Comment matches restricted pattern '{{pattern}}'",restrictedCommentWithMessage:"{{message}}",removeComment:"Remove this comment"}},defaultOptions:[{patterns:[]}],create(e,[t]){let o=e.sourceCode,r=new Map;function i(n){let a=r.get(n);return a||(a=new RegExp(n),r.set(n,a)),a}function s(n,a){return a.regex?i(a.regex).test(n):a.includes?n.includes(a.includes):!1}return{Program(){let n=o.getAllComments();for(let p of n)for(let l of t.patterns)if(s(p.value,l)){let m=function(u){return u.remove(p)};var a=m;let d=l.regex??l.includes??"";l.message?e.report({loc:p.loc,messageId:"restrictedCommentWithMessage",data:{message:l.message},fix:l.autoFix?m:void 0,suggest:l.autoFix?void 0:[{messageId:"removeComment",fix:m}]}):e.report({loc:p.loc,messageId:"restrictedComment",data:{pattern:d},fix:l.autoFix?m:void 0,suggest:l.autoFix?void 0:[{messageId:"removeComment",fix:m}]});break}}}}});var St=require("@typescript-eslint/utils"),Ze=require("zod/v4");var da=Ze.z.object({allow:Ze.z.record(Ze.z.string(),Ze.z.array(Ze.z.string())).optional()}),An=v({name:"no-data-attributes-on-components",meta:{type:"problem",docs:{description:"Disallow data-* attributes on custom React components. Use regular props instead."},schema:[k(da)],messages:{noDataAttributesOnComponents:"Avoid using data-* attributes on custom components. Use regular props instead or apply data attributes to the underlying DOM element."}},defaultOptions:[{}],create(e,[t]){let o=t.allow??{};function r(n){let a=n.charAt(0);return a===a.toUpperCase()&&a!==a.toLowerCase()}function i(n){return n.type===St.AST_NODE_TYPES.JSXIdentifier?{name:n.name,isCustom:r(n.name)}:n.type===St.AST_NODE_TYPES.JSXMemberExpression?{name:"",isCustom:!0}:{name:`${n.namespace.name}:${n.name.name}`,isCustom:!1}}function s(n,a){let p=o[n];return p?p.includes(a):!1}return{JSXAttribute(n){if(n.name.type!==St.AST_NODE_TYPES.JSXIdentifier)return;let a=n.name.name;if(!a.startsWith("data-"))return;let p=i(n.parent.name);!p||!p.isCustom||p.name&&s(p.name,a)||e.report({node:n,messageId:"noDataAttributesOnComponents"})}}}});var Le=require("@typescript-eslint/utils"),_e=require("zod/v4");var ya=_e.z.object({fn:_e.z.string().optional(),selector:_e.z.string().optional(),commentPrefix:_e.z.string(),message:_e.z.string().optional()}),ga=_e.z.object({matches:_e.z.array(ya)}),In=v({name:"require-usage-explanation",meta:{type:"problem",docs:{description:"Require explanatory comments with a specific prefix above matched code patterns"},schema:[k(ga)],messages:{default:"{{message}}"}},defaultOptions:[{matches:[]}],create(e,[t]){let o=e.sourceCode,r={},i=[];function s(u){let f=u;for(;f.parent;){let c=f.parent.type;if(c===Le.AST_NODE_TYPES.Program||c===Le.AST_NODE_TYPES.BlockStatement||c===Le.AST_NODE_TYPES.SwitchCase)return f;f=f.parent}}function n(u,f){for(let c of u){let g=c.value.trim();if(g.startsWith(f)&&g.slice(f.length).trim().length>0)return!0}return!1}function a(u){let{callee:f}=u;if(f.type===Le.AST_NODE_TYPES.Identifier)return f.name;if(f.type===Le.AST_NODE_TYPES.MemberExpression&&f.property.type===Le.AST_NODE_TYPES.Identifier)return f.property.name}function p(u,f,c){let g=`Add a comment with prefix "${u}" to explain why "${f}" is being used.`;return c?`${g} ${c}`:g}function l(u,f){let c=s(u);if(!c)return!1;let g=u;for(;g!==c&&g.parent;){let y=o.getCommentsBefore(g);if(n(y,f))return!0;g=g.parent}let T=o.getCommentsBefore(c);return!!n(T,f)}function d(u,f){l(u,f.commentPrefix)||e.report({node:u,messageId:"default",data:{message:p(f.commentPrefix,f.label,f.message)}})}function m(u,f){let c=r[u];c?r[u]=g=>{c(g),f(g)}:r[u]=f}for(let u of t.matches){if(u.fn){let f=u.fn,c={commentPrefix:u.commentPrefix,label:f,message:u.message};i.push(g=>{a(g)===f&&d(g,c)})}if(u.selector){let f={commentPrefix:u.commentPrefix,label:u.selector,message:u.message};m(u.selector,c=>{d(c,f)})}}return i.length>0&&m("CallExpression",u=>{if(u.type===Le.AST_NODE_TYPES.CallExpression)for(let f of i)f(u)}),r}});var Or={[Wt.name]:Wt.rule,[At.name]:At.rule,[Ct.name]:Ct.rule,"require-description":Pr.rule,[It.name]:It.rule,[Nt.name]:Nt.rule,[Yt.name]:Yt.rule,[Et.name]:Et.rule,[bt.name]:bt.rule,[Dt.name]:Dt.rule,[He.name]:He.rule,[Gt.name]:Gt.rule,[Ot.name]:Ot.rule,[Pt.name]:Pt.rule,[kt.name]:kt.rule,[ht.name]:ht.rule,[tn.name]:tn.rule,[en.name]:en.rule,[on.name]:on.rule,[ln.name]:ln.rule,[Lt.name]:Lt.rule,[_t.name]:_t.rule,[Jt.name]:Jt.rule,[Vt.name]:Vt.rule,[$t.name]:$t.rule,[Ut.name]:Ut.rule,[Zt.name]:Zt.rule,[Mt.name]:Mt.rule,[jt.name]:jt.rule,[dn.name]:dn.rule,[Bt.name]:Bt.rule,[cn.name]:cn.rule,[fn.name]:fn.rule,[yn.name]:yn.rule,[gn.name]:gn.rule,[Sn.name]:Sn.rule,[Tn.name]:Tn.rule,[En.name]:En.rule,[xn.name]:xn.rule,[hn.name]:hn.rule,[He.name]:He.rule,[bn.name]:bn.rule,[Cn.name]:Cn.rule,[An.name]:An.rule,[In.name]:In.rule};var Dr={rules:Or},Sa=Dr;0&&(module.exports={extendedLintPlugin});