@ls-stack/extended-lint 0.73.0 → 0.73.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/extended-lint.js +19 -19
- package/dist/extended-lint.mjs +19 -19
- package/package.json +1 -1
package/dist/extended-lint.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
"use strict";var ai=Object.create;var ft=Object.defineProperty;var li=Object.getOwnPropertyDescriptor;var pi=Object.getOwnPropertyNames;var ci=Object.getPrototypeOf,ui=Object.prototype.hasOwnProperty;var fi=(e,t)=>{for(var r in t)ft(e,r,{get:t[r],enumerable:!0})},Wn=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of pi(t))!ui.call(e,s)&&s!==r&&ft(e,s,{get:()=>t[s],enumerable:!(n=li(t,s))||n.enumerable});return e};var ke=(e,t,r)=>(r=e!=null?ai(ci(e)):{},Wn(t||!e||!e.__esModule?ft(r,"default",{value:e,enumerable:!0}):r,e)),mi=e=>Wn(ft({},"__esModule",{value:!0}),e);var va={};fi(va,{extendedLintPlugin:()=>Pa});module.exports=mi(va);var ge=require("@typescript-eslint/utils"),D=require("zod/v4");var Jn=require("@typescript-eslint/utils"),Vn=ke(require("zod/v4"));function B(e){let r=Jn.ESLintUtils.RuleCreator(n=>`https://github.com/lucasols/extended-lint#${n}`)(e);return{name:e.name,rule:r}}function V(e){return Vn.toJSONSchema(e)}var di=D.z.object({disallow:D.z.array(D.z.object({selector:D.z.string(),message:D.z.string(),replace:D.z.optional(D.z.union([D.z.string(),D.z.object({regex:D.z.string(),with:D.z.string()})])),replaceType:D.z.optional(D.z.enum(["suggestion","autofix"]))})).optional(),disallowFnCalls:D.z.optional(D.z.array(D.z.object({fn:D.z.string(),withArgs:D.z.optional(D.z.array(D.z.object({atIndex:D.z.number(),value:D.z.union([D.z.string(),D.z.number(),D.z.boolean()])}))),message:D.z.string(),replaceWith:D.z.optional(D.z.string()),ignoreRegex:D.z.optional(D.z.string())}))),__dev_simulateFileName:D.z.optional(D.z.string()),mustMatchSyntax:D.z.optional(D.z.array(D.z.object({includeRegex:D.z.string(),mustCallFn:D.z.optional(D.z.array(D.z.object({anyCall:D.z.array(D.z.object({fn:D.z.string(),withArgs:D.z.array(D.z.object({atIndex:D.z.number(),literal:D.z.union([D.z.string(),D.z.number(),D.z.boolean()])}))})),message:D.z.optional(D.z.string())}))),mustMatchSelector:D.z.optional(D.z.array(D.z.object({selector:D.z.string(),message:D.z.string()}))),mustHaveExport:D.z.optional(D.z.array(D.z.object({name:D.z.string(),type:D.z.enum(["function","variable","any"]).default("any"),message:D.z.string()})))})))}),kt=B({name:"advanced-no-restricted-syntax",meta:{type:"suggestion",docs:{description:"Disallow specific syntax patterns"},schema:[V(di)],messages:{default:"{{message}}"},fixable:"code",hasSuggestions:!0},defaultOptions:[{disallow:[]}],create(e,[t]){let r={},{mustMatchSyntax:n,__dev_simulateFileName:s,disallow:a,disallowFnCalls:i}=t,p=s??e.filename,l=[],c=new Map,d=new Set,y=new Map,g=new Set,b=new Map;function f(u){for(let T of u.specifiers)T.type===ge.AST_NODE_TYPES.ImportSpecifier&&T.imported.type===ge.AST_NODE_TYPES.Identifier&&T.imported.name!==T.local.name&&b.set(T.local.name,T.imported.name)}function E(u){if(u.declaration){if(u.declaration.type===ge.AST_NODE_TYPES.FunctionDeclaration&&u.declaration.id){let T=u.declaration.id.name;for(let w of Array.from(g)){let[R,v]=w.split(":");R===T&&(v==="function"||v==="any")&&g.delete(w)}}else if(u.declaration.type===ge.AST_NODE_TYPES.VariableDeclaration){for(let T of u.declaration.declarations)if(T.id.type===ge.AST_NODE_TYPES.Identifier){let w=T.id.name;for(let R of Array.from(g)){let[v,x]=R.split(":");v===w&&(x==="variable"||x==="any")&&g.delete(R)}}}}for(let T of u.specifiers)if(T.exported.type===ge.AST_NODE_TYPES.Identifier){let w=T.exported.name;for(let R of Array.from(g)){let[v,x]=R.split(":");v===w&&x==="any"&&g.delete(R)}}}function h(u){u.id.type===ge.AST_NODE_TYPES.Identifier&&u.init?.type===ge.AST_NODE_TYPES.Identifier&&b.set(u.id.name,u.init.name)}function m(u){return b.get(u)??u}function A(u,T){return m(u)===T||u===T}for(let{includeRegex:u,mustCallFn:T,mustMatchSelector:w,mustHaveExport:R}of n??[]){let x=function(C){let F=C;for(let{name:O,value:Q}of v??[])F=F.replaceAll(O,Q);return F};var S=x;let v=yi(p,new RegExp(u));if(v){for(let{anyCall:C,message:F}of T??[]){let O=`Expected file to call the function: ${C.map(({fn:Q})=>Q).join(" or ")}`;d.add(O),l.push(Q=>{let{callee:U}=Q;if(U.type===ge.AST_NODE_TYPES.Identifier){for(let{fn:re,withArgs:M}of C)if(U.name===re){d.delete(O);for(let W of M){let X=Q.arguments[W.atIndex],ie=typeof W.literal=="string"?x(W.literal):W.literal;if(!X){e.report({node:Q,messageId:"default",data:{message:`Missing argument with value "${ie}" at index ${W.atIndex}${F?`: ${x(F)}`:""}`}});continue}if(X.type!==ge.AST_NODE_TYPES.Literal){e.report({node:X,messageId:"default",data:{message:`Argument at position ${W.atIndex} should the literal "${ie}"${F?`: ${x(F)}`:""}`}});continue}X.value!==ie&&e.report({node:X,messageId:"default",data:{message:`Argument should have the value "${ie}"${F?`: ${x(F)}`:""}`},fix:pe=>pe.replaceText(X,typeof ie=="string"?`'${ie}'`:String(ie))})}break}}})}for(let{selector:C,message:F}of w??[])y.set(C,x(F)),c.set(x(C),()=>{y.delete(C)});for(let{name:C,type:F,message:O}of R??[]){let Q=x(C),U=x(O);g.add(`${Q}:${F}:${U}`)}}}for(let{fn:u,withArgs:T,message:w,replaceWith:R,ignoreRegex:v}of i??[])v&&new RegExp(v).test(p)||l.push(x=>{let{callee:C}=x;if(C.type!==ge.AST_NODE_TYPES.Identifier||!A(C.name,u))return;if(T)for(let O of T){let Q=x.arguments[O.atIndex];if(!Q){e.report({node:x,messageId:"default",data:{message:`Missing argument with value "${O.value}" at index ${O.atIndex}: ${w}`}});return}if(Q.type!==ge.AST_NODE_TYPES.Literal||Q.value!==O.value)return}let F=O=>R?O.replaceText(x,R):null;e.report({node:x,messageId:"default",data:{message:w},suggest:R?[{messageId:"default",data:{message:`Replace with "${R}"`},fix:F}]:void 0})});function I(u,T){let w=r[u];w?r[u]=R=>{w(R),T(R)}:r[u]=T}for(let{selector:u,message:T,replace:w,replaceType:R="suggestion"}of a??[]){if(u==="CallExpression"){l.push(v=>{o(w,v,T,R)});continue}r[u]=v=>{o(w,v,T,R)}}if(c.size>0)for(let[u,T]of c)I(u,T);return l.length>0&&(r.CallExpression=u=>{if(u.type===ge.AST_NODE_TYPES.CallExpression)for(let T of l)T(u)}),r.ImportDeclaration=u=>{u.type===ge.AST_NODE_TYPES.ImportDeclaration&&f(u)},r.ExportNamedDeclaration=u=>{u.type===ge.AST_NODE_TYPES.ExportNamedDeclaration&&E(u)},r.VariableDeclarator=u=>{u.type===ge.AST_NODE_TYPES.VariableDeclarator&&h(u)},r["Program:exit"]=u=>{for(let T of d)e.report({node:u,messageId:"default",data:{message:T}});for(let[,T]of y)e.report({node:u,messageId:"default",data:{message:T}});for(let T of g){let[w,R,v]=T.split(":");e.report({node:u,messageId:"default",data:{message:`Missing required export "${w}" of type ${R}: ${v}`}})}},r;function o(u,T,w,R){let v=x=>{if(!u)return null;if(typeof u=="string")return x.replaceText(T,u);{let C=new RegExp(u.regex),F=e.sourceCode.getText(T);return x.replaceText(T,F.replace(C,u.with))}};e.report({node:T,messageId:"default",data:{message:w},fix:u&&R==="autofix"?v:void 0,suggest:u&&R==="suggestion"?[{messageId:"default",data:{message:`Replace with "${typeof u=="string"?u:u.with}"`},fix:v}]:void 0})}}});function yi(e,t){let r=[],n=t.exec(e);if(!n)return null;let[s,...a]=n;r.push({name:"$0_lowercase",value:s.toLowerCase()}),r.push({name:"$0_capitalize",value:Xn(s)}),r.push({name:"$0_uncapitalize",value:Bn(s)}),r.push({name:"$0",value:s});for(let i=0;i<a.length;i++){let p=`$${i+1}`,l=a[i];l!==void 0&&(r.push({name:`${p}_lowercase`,value:l.toLowerCase()}),r.push({name:`${p}_capitalize`,value:Xn(l)}),r.push({name:`${p}_uncapitalize`,value:Bn(l)}),r.push({name:p,value:l}))}return r}function Xn(e){return e.charAt(0).toUpperCase()+e.slice(1)}function Bn(e){return e.charAt(0).toLowerCase()+e.slice(1)}var ee=require("@typescript-eslint/utils"),Je=require("zod/v4");var gi=ee.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),Yn="collapse-simple-objs-in-one-line",Si=Je.z.object({maxLineLength:Je.z.number().optional(),maxProperties:Je.z.number().optional(),nestedObjMaxLineLength:Je.z.number().optional(),nestedObjMaxProperties:Je.z.number().optional(),ignoreTypesWithSuffix:Je.z.array(Je.z.string()).optional()}),Ti=gi({name:Yn,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:[V(Si)]},defaultOptions:[{}],create(e,[t]){let r=e.sourceCode,n=t.ignoreTypesWithSuffix??[],s=t.maxProperties??2,a=t.nestedObjMaxLineLength??t.maxLineLength,i=t.nestedObjMaxProperties??3;function p(c){if(c.type===ee.AST_NODE_TYPES.ObjectExpression){let d=c.parent.type===ee.AST_NODE_TYPES.Property,y=d?i:s,g=c.properties.length;if(g>y)return!1;if(g===1){let f=c.properties[0];return!f||f.type===ee.AST_NODE_TYPES.Property&&f.value.type===ee.AST_NODE_TYPES.ObjectExpression||f.type===ee.AST_NODE_TYPES.Property&&f.value.type===ee.AST_NODE_TYPES.ArrayExpression&&!f.value.elements.every(h=>h&&Ot(h))?!1:{text:r.getText(f),isNested:d,propsSize:g}}let b=[];for(let f of c.properties){if(f.type===ee.AST_NODE_TYPES.Property&&!Ot(f.value))return!1;b.push(r.getText(f))}return{text:b.join(", "),isNested:d,propsSize:g}}else{let d=c.parent.parent?.type===ee.AST_NODE_TYPES.TSPropertySignature,y=d?i:s,g=c.members.length;if(g>y)return!1;if(n.length>0&&c.parent.type===ee.AST_NODE_TYPES.TSTypeAliasDeclaration){let f=c.parent.id.name;if(n.some(E=>f.endsWith(E)))return!1}if(g===1){let f=c.members[0];return!f||f.type===ee.AST_NODE_TYPES.TSPropertySignature&&f.typeAnnotation?.typeAnnotation.type===ee.AST_NODE_TYPES.TSTypeLiteral?!1:{text:r.getText(f),isNested:d,propsSize:1}}if(c.parent.type===ee.AST_NODE_TYPES.TSIntersectionType||c.parent.type===ee.AST_NODE_TYPES.TSUnionType&&c.parent.types[0]!==c)return!1;let b=[];for(let f of c.members){if(f.type!==ee.AST_NODE_TYPES.TSPropertySignature)return!1;let E=f.typeAnnotation?.typeAnnotation;if(!E||E.type===ee.AST_NODE_TYPES.TSTypeLiteral||!Hn(E))return!1;if(E.type===ee.AST_NODE_TYPES.TSTypeReference&&E.typeArguments){if(E.typeArguments.params.length>1)return!1;let m=E.typeArguments.params[0];if(!m||!Hn(m))return!1}let h=r.getText(f).trim();(h.endsWith(";")||h.endsWith(","))&&(h=h.slice(0,-1)),b.push(h)}return{text:b.join("; "),isNested:d,propsSize:g}}}function l(c){if(c.loc.start.line===c.loc.end.line)return;if(c.parent.type!==ee.AST_NODE_TYPES.JSXExpressionContainer){let E=0,h=!1,m=r.getTokenAfter(c,{filter:I=>I.type!==ee.AST_TOKEN_TYPES.Punctuator||h?!0:I.value===","?(E++,!1):I.value===";"?(E++,h=!0,!1):I.value===")"||I.value==="}"?(E++,!1):!0});if(E>4)return;let A=m?.type===ee.AST_TOKEN_TYPES.Template&&m.value.startsWith(`}
|
|
1
|
+
"use strict";var ai=Object.create;var ft=Object.defineProperty;var li=Object.getOwnPropertyDescriptor;var pi=Object.getOwnPropertyNames;var ci=Object.getPrototypeOf,ui=Object.prototype.hasOwnProperty;var fi=(e,t)=>{for(var r in t)ft(e,r,{get:t[r],enumerable:!0})},zn=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of pi(t))!ui.call(e,s)&&s!==r&&ft(e,s,{get:()=>t[s],enumerable:!(n=li(t,s))||n.enumerable});return e};var Fe=(e,t,r)=>(r=e!=null?ai(ci(e)):{},zn(t||!e||!e.__esModule?ft(r,"default",{value:e,enumerable:!0}):r,e)),mi=e=>zn(ft({},"__esModule",{value:!0}),e);var va={};fi(va,{extendedLintPlugin:()=>Pa});module.exports=mi(va);var Te=require("@typescript-eslint/utils"),j=require("zod/v4");var Wn=require("@typescript-eslint/utils"),Jn=Fe(require("zod/v4"));function X(e){let r=Wn.ESLintUtils.RuleCreator(n=>`https://github.com/lucasols/extended-lint#${n}`)(e);return{name:e.name,rule:r}}function J(e){return Jn.toJSONSchema(e)}var di=j.z.object({disallow:j.z.array(j.z.object({selector:j.z.string(),message:j.z.string(),replace:j.z.optional(j.z.union([j.z.string(),j.z.object({regex:j.z.string(),with:j.z.string()})])),replaceType:j.z.optional(j.z.enum(["suggestion","autofix"]))})).optional(),disallowFnCalls:j.z.optional(j.z.array(j.z.object({fn:j.z.string(),withArgs:j.z.optional(j.z.array(j.z.object({atIndex:j.z.number(),value:j.z.union([j.z.string(),j.z.number(),j.z.boolean()])}))),message:j.z.string(),replaceWith:j.z.optional(j.z.string()),ignoreRegex:j.z.optional(j.z.string())}))),__dev_simulateFileName:j.z.optional(j.z.string()),mustMatchSyntax:j.z.optional(j.z.array(j.z.object({includeRegex:j.z.string(),mustCallFn:j.z.optional(j.z.array(j.z.object({anyCall:j.z.array(j.z.object({fn:j.z.string(),withArgs:j.z.array(j.z.object({atIndex:j.z.number(),literal:j.z.union([j.z.string(),j.z.number(),j.z.boolean()])}))})),message:j.z.optional(j.z.string())}))),mustMatchSelector:j.z.optional(j.z.array(j.z.object({selector:j.z.string(),message:j.z.string()}))),mustHaveExport:j.z.optional(j.z.array(j.z.object({name:j.z.string(),type:j.z.enum(["function","variable","any"]).default("any"),message:j.z.string()})))})))}),Ft=X({name:"advanced-no-restricted-syntax",meta:{type:"suggestion",docs:{description:"Disallow specific syntax patterns"},schema:[J(di)],messages:{default:"{{message}}"},fixable:"code",hasSuggestions:!0},defaultOptions:[{disallow:[]}],create(e,[t]){let r={},{mustMatchSyntax:n,__dev_simulateFileName:s,disallow:a,disallowFnCalls:i}=t,p=s??e.filename,l=[],c=new Map,d=new Set,y=new Map,g=new Set,b=new Map;function f(u){for(let T of u.specifiers)T.type===Te.AST_NODE_TYPES.ImportSpecifier&&T.imported.type===Te.AST_NODE_TYPES.Identifier&&T.imported.name!==T.local.name&&b.set(T.local.name,T.imported.name)}function E(u){if(u.declaration){if(u.declaration.type===Te.AST_NODE_TYPES.FunctionDeclaration&&u.declaration.id){let T=u.declaration.id.name;for(let w of Array.from(g)){let[R,v]=w.split(":");R===T&&(v==="function"||v==="any")&&g.delete(w)}}else if(u.declaration.type===Te.AST_NODE_TYPES.VariableDeclaration){for(let T of u.declaration.declarations)if(T.id.type===Te.AST_NODE_TYPES.Identifier){let w=T.id.name;for(let R of Array.from(g)){let[v,x]=R.split(":");v===w&&(x==="variable"||x==="any")&&g.delete(R)}}}}for(let T of u.specifiers)if(T.exported.type===Te.AST_NODE_TYPES.Identifier){let w=T.exported.name;for(let R of Array.from(g)){let[v,x]=R.split(":");v===w&&x==="any"&&g.delete(R)}}}function h(u){u.id.type===Te.AST_NODE_TYPES.Identifier&&u.init?.type===Te.AST_NODE_TYPES.Identifier&&b.set(u.id.name,u.init.name)}function m(u){return b.get(u)??u}function A(u,T){return m(u)===T||u===T}for(let{includeRegex:u,mustCallFn:T,mustMatchSelector:w,mustHaveExport:R}of n??[]){let x=function(C){let F=C;for(let{name:O,value:Q}of v??[])F=F.replaceAll(O,Q);return F};var S=x;let v=yi(p,new RegExp(u));if(v){for(let{anyCall:C,message:F}of T??[]){let O=`Expected file to call the function: ${C.map(({fn:Q})=>Q).join(" or ")}`;d.add(O),l.push(Q=>{let{callee:z}=Q;if(z.type===Te.AST_NODE_TYPES.Identifier){for(let{fn:re,withArgs:ae}of C)if(z.name===re){d.delete(O);for(let D of ae){let q=Q.arguments[D.atIndex],V=typeof D.literal=="string"?x(D.literal):D.literal;if(!q){e.report({node:Q,messageId:"default",data:{message:`Missing argument with value "${V}" at index ${D.atIndex}${F?`: ${x(F)}`:""}`}});continue}if(q.type!==Te.AST_NODE_TYPES.Literal){e.report({node:q,messageId:"default",data:{message:`Argument at position ${D.atIndex} should the literal "${V}"${F?`: ${x(F)}`:""}`}});continue}q.value!==V&&e.report({node:q,messageId:"default",data:{message:`Argument should have the value "${V}"${F?`: ${x(F)}`:""}`},fix:ce=>ce.replaceText(q,typeof V=="string"?`'${V}'`:String(V))})}break}}})}for(let{selector:C,message:F}of w??[])y.set(C,x(F)),c.set(x(C),()=>{y.delete(C)});for(let{name:C,type:F,message:O}of R??[]){let Q=x(C),z=x(O);g.add(`${Q}:${F}:${z}`)}}}for(let{fn:u,withArgs:T,message:w,replaceWith:R,ignoreRegex:v}of i??[])v&&new RegExp(v).test(p)||l.push(x=>{let{callee:C}=x;if(C.type!==Te.AST_NODE_TYPES.Identifier||!A(C.name,u))return;if(T)for(let O of T){let Q=x.arguments[O.atIndex];if(!Q){e.report({node:x,messageId:"default",data:{message:`Missing argument with value "${O.value}" at index ${O.atIndex}: ${w}`}});return}if(Q.type!==Te.AST_NODE_TYPES.Literal||Q.value!==O.value)return}let F=O=>R?O.replaceText(x,R):null;e.report({node:x,messageId:"default",data:{message:w},suggest:R?[{messageId:"default",data:{message:`Replace with "${R}"`},fix:F}]:void 0})});function I(u,T){let w=r[u];w?r[u]=R=>{w(R),T(R)}:r[u]=T}for(let{selector:u,message:T,replace:w,replaceType:R="suggestion"}of a??[]){if(u==="CallExpression"){l.push(v=>{o(w,v,T,R)});continue}r[u]=v=>{o(w,v,T,R)}}if(c.size>0)for(let[u,T]of c)I(u,T);return l.length>0&&(r.CallExpression=u=>{if(u.type===Te.AST_NODE_TYPES.CallExpression)for(let T of l)T(u)}),r.ImportDeclaration=u=>{u.type===Te.AST_NODE_TYPES.ImportDeclaration&&f(u)},r.ExportNamedDeclaration=u=>{u.type===Te.AST_NODE_TYPES.ExportNamedDeclaration&&E(u)},r.VariableDeclarator=u=>{u.type===Te.AST_NODE_TYPES.VariableDeclarator&&h(u)},r["Program:exit"]=u=>{for(let T of d)e.report({node:u,messageId:"default",data:{message:T}});for(let[,T]of y)e.report({node:u,messageId:"default",data:{message:T}});for(let T of g){let[w,R,v]=T.split(":");e.report({node:u,messageId:"default",data:{message:`Missing required export "${w}" of type ${R}: ${v}`}})}},r;function o(u,T,w,R){let v=x=>{if(!u)return null;if(typeof u=="string")return x.replaceText(T,u);{let C=new RegExp(u.regex),F=e.sourceCode.getText(T);return x.replaceText(T,F.replace(C,u.with))}};e.report({node:T,messageId:"default",data:{message:w},fix:u&&R==="autofix"?v:void 0,suggest:u&&R==="suggestion"?[{messageId:"default",data:{message:`Replace with "${typeof u=="string"?u:u.with}"`},fix:v}]:void 0})}}});function yi(e,t){let r=[],n=t.exec(e);if(!n)return null;let[s,...a]=n;r.push({name:"$0_lowercase",value:s.toLowerCase()}),r.push({name:"$0_capitalize",value:Vn(s)}),r.push({name:"$0_uncapitalize",value:Xn(s)}),r.push({name:"$0",value:s});for(let i=0;i<a.length;i++){let p=`$${i+1}`,l=a[i];l!==void 0&&(r.push({name:`${p}_lowercase`,value:l.toLowerCase()}),r.push({name:`${p}_capitalize`,value:Vn(l)}),r.push({name:`${p}_uncapitalize`,value:Xn(l)}),r.push({name:p,value:l}))}return r}function Vn(e){return e.charAt(0).toUpperCase()+e.slice(1)}function Xn(e){return e.charAt(0).toLowerCase()+e.slice(1)}var ee=require("@typescript-eslint/utils"),Je=require("zod/v4");var gi=ee.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),Hn="collapse-simple-objs-in-one-line",Si=Je.z.object({maxLineLength:Je.z.number().optional(),maxProperties:Je.z.number().optional(),nestedObjMaxLineLength:Je.z.number().optional(),nestedObjMaxProperties:Je.z.number().optional(),ignoreTypesWithSuffix:Je.z.array(Je.z.string()).optional()}),Ti=gi({name:Hn,meta:{type:"suggestion",fixable:"code",docs:{description:"Format simple objects and types in one line"},messages:{singleLineProp:"Object/type should be written in a single line"},schema:[J(Si)]},defaultOptions:[{}],create(e,[t]){let r=e.sourceCode,n=t.ignoreTypesWithSuffix??[],s=t.maxProperties??2,a=t.nestedObjMaxLineLength??t.maxLineLength,i=t.nestedObjMaxProperties??3;function p(c){if(c.type===ee.AST_NODE_TYPES.ObjectExpression){let d=c.parent.type===ee.AST_NODE_TYPES.Property,y=d?i:s,g=c.properties.length;if(g>y)return!1;if(g===1){let f=c.properties[0];return!f||f.type===ee.AST_NODE_TYPES.Property&&f.value.type===ee.AST_NODE_TYPES.ObjectExpression||f.type===ee.AST_NODE_TYPES.Property&&f.value.type===ee.AST_NODE_TYPES.ArrayExpression&&!f.value.elements.every(h=>h&&kt(h))?!1:{text:r.getText(f),isNested:d,propsSize:g}}let b=[];for(let f of c.properties){if(f.type===ee.AST_NODE_TYPES.Property&&!kt(f.value))return!1;b.push(r.getText(f))}return{text:b.join(", "),isNested:d,propsSize:g}}else{let d=c.parent.parent?.type===ee.AST_NODE_TYPES.TSPropertySignature,y=d?i:s,g=c.members.length;if(g>y)return!1;if(n.length>0&&c.parent.type===ee.AST_NODE_TYPES.TSTypeAliasDeclaration){let f=c.parent.id.name;if(n.some(E=>f.endsWith(E)))return!1}if(g===1){let f=c.members[0];return!f||f.type===ee.AST_NODE_TYPES.TSPropertySignature&&f.typeAnnotation?.typeAnnotation.type===ee.AST_NODE_TYPES.TSTypeLiteral?!1:{text:r.getText(f),isNested:d,propsSize:1}}if(c.parent.type===ee.AST_NODE_TYPES.TSIntersectionType||c.parent.type===ee.AST_NODE_TYPES.TSUnionType&&c.parent.types[0]!==c)return!1;let b=[];for(let f of c.members){if(f.type!==ee.AST_NODE_TYPES.TSPropertySignature)return!1;let E=f.typeAnnotation?.typeAnnotation;if(!E||E.type===ee.AST_NODE_TYPES.TSTypeLiteral||!Bn(E))return!1;if(E.type===ee.AST_NODE_TYPES.TSTypeReference&&E.typeArguments){if(E.typeArguments.params.length>1)return!1;let m=E.typeArguments.params[0];if(!m||!Bn(m))return!1}let h=r.getText(f).trim();(h.endsWith(";")||h.endsWith(","))&&(h=h.slice(0,-1)),b.push(h)}return{text:b.join("; "),isNested:d,propsSize:g}}}function l(c){if(c.loc.start.line===c.loc.end.line)return;if(c.parent.type!==ee.AST_NODE_TYPES.JSXExpressionContainer){let E=0,h=!1,m=r.getTokenAfter(c,{filter:I=>I.type!==ee.AST_TOKEN_TYPES.Punctuator||h?!0:I.value===","?(E++,!1):I.value===";"?(E++,h=!0,!1):I.value===")"||I.value==="}"?(E++,!1):!0});if(E>4)return;let A=m?.type===ee.AST_TOKEN_TYPES.Template&&m.value.startsWith(`}
|
|
2
2
|
`);if(m?.loc.start.line===c.loc.end.line&&!A)return}let d=p(c);if(!d)return;let y=d.text;if(y.includes(`
|
|
3
|
-
`)||r.getCommentsInside(c).length>0)return;y.endsWith(";")&&(y=y.slice(0,-1));let g=`{ ${y} }`,b=Ei(r,c),f=d.isNested&&d.propsSize>2?a:t.maxLineLength;f&&g.length+b.length+hi(c,r)>f||e.report({node:c,messageId:"singleLineProp",fix:E=>E.replaceText(c,g)})}return{TSTypeLiteral:l,ObjectExpression:l}}});function
|
|
4
|
-
`,r.range[1]);return(n!==-1?n:t.text.length)-r.range[1]}function Ei(e,t){return e.text.slice(t.range[0]-t.loc.start.column,t.range[0])}var
|
|
3
|
+
`)||r.getCommentsInside(c).length>0)return;y.endsWith(";")&&(y=y.slice(0,-1));let g=`{ ${y} }`,b=Ei(r,c),f=d.isNested&&d.propsSize>2?a:t.maxLineLength;f&&g.length+b.length+hi(c,r)>f||e.report({node:c,messageId:"singleLineProp",fix:E=>E.replaceText(c,g)})}return{TSTypeLiteral:l,ObjectExpression:l}}});function Bn(e){return e.type===ee.AST_NODE_TYPES.TSLiteralType||e.type===ee.AST_NODE_TYPES.TSTypeReference||e.type===ee.AST_NODE_TYPES.TSNumberKeyword||e.type===ee.AST_NODE_TYPES.TSStringKeyword||e.type===ee.AST_NODE_TYPES.TSBooleanKeyword||e.type===ee.AST_NODE_TYPES.TSNullKeyword||e.type===ee.AST_NODE_TYPES.TSUndefinedKeyword}function kt(e,t){return!!(e.type===ee.AST_NODE_TYPES.Literal||e.type===ee.AST_NODE_TYPES.Identifier||e.type===ee.AST_NODE_TYPES.TemplateLiteral||e.type===ee.AST_NODE_TYPES.TaggedTemplateExpression||!t&&e.type===ee.AST_NODE_TYPES.ArrayExpression&&e.elements.every(r=>r&&kt(r,!0)))}function hi(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 Ei(e,t){return e.text.slice(t.range[0]-t.loc.start.column,t.range[0])}var Ot={name:Hn,rule:Ti};var bi=/eslint +react-compiler\/react-compiler: +\["error/,qn={meta:{type:"suggestion",docs:{description:"verifies the list of dependencies for Hooks like useEffect and similar",recommended:!0,url:"https://github.com/facebook/react/issues/14920"},fixable:"code",hasSuggestions:!0,schema:[{type:"object",additionalProperties:!1,ignoreIfReactCompilerIsEnabled:!1,enableDangerousAutofixThisMayCauseInfiniteLoops:!1,properties:{additionalHooks:{type:"string"},ignoreIfReactCompilerIsEnabled:{type:"boolean"},enableDangerousAutofixThisMayCauseInfiniteLoops:{type:"boolean"}}}]},create(e){let t=!1,r=typeof e.getSource=="function"?m=>r(m):m=>e.sourceCode.getText(m),n=typeof e.getScope=="function"?()=>n():m=>e.sourceCode.getScope(m),s=e.options&&e.options[0]&&e.options[0].additionalHooks?new RegExp(e.options[0].additionalHooks):void 0,a=e.options&&e.options[0]&&e.options[0].enableDangerousAutofixThisMayCauseInfiniteLoops||!1,i={additionalHooks:s,enableDangerousAutofixThisMayCauseInfiniteLoops:a};function p(m){a&&Array.isArray(m.suggest)&&m.suggest.length>0&&(m.fix=m.suggest[0].fix),e.report(m)}let l=e.getSourceCode().scopeManager,c=new WeakMap,d=new WeakSet,y=new WeakMap,g=new WeakMap,b=new WeakSet;function f(m,A){return function(I){if(A.has(I))return A.get(I);let o=m(I);return A.set(I,o),o}}function E(m,A,I,o,S){S&&m.async&&p({node:m,message:`Effect callbacks are synchronous to prevent race conditions. Put the async function inside:
|
|
5
5
|
|
|
6
6
|
useEffect(() => {
|
|
7
7
|
async function fetchData() {
|
|
@@ -12,14 +12,14 @@ useEffect(() => {
|
|
|
12
12
|
fetchData();
|
|
13
13
|
}, [someId]); // Or [] if effect doesn't need props or state
|
|
14
14
|
|
|
15
|
-
Learn more about data fetching with Hooks: https://reactjs.org/link/hooks-data-fetching`});let u=l.acquire(m),T=new Set,w=null;{let P=u.upper;for(;P&&(T.add(P),P.type!=="function");)P=P.upper;if(!P)return;w=P}let R=Array.isArray;function v(P){if(!R(P.defs))return!1;let k=P.defs[0];if(k==null||k.node.type!=="VariableDeclarator")return!1;let L=k.node.init;if(L==null)return!1;for(;L.type==="TSAsExpression";)L=L.expression;let _=k.node.parent;if(_==null&&(Lt(w.block,k.node.id),_=k.node.parent,_==null))return!1;if(_.kind==="const"&&L.type==="Literal"&&(typeof L.value=="string"||typeof L.value=="number"||L.value===null))return!0;if(L.type!=="CallExpression")return!1;let J=L.callee;if(J.type==="MemberExpression"&&J.object.name==="React"&&J.property!=null&&!J.computed&&(J=J.property),J.type!=="Identifier")return!1;let z=k.node.id,{name:q}=J;if(q==="useRef"&&z.type==="Identifier")return!0;if(wi(J)&&z.type==="Identifier"){for(let Z of P.references)Z!==z&&b.add(Z.identifier);return!0}else if(q==="useState"||q==="useReducer"){if(z.type==="ArrayPattern"&&z.elements.length===2&&R(P.identifiers)){if(z.elements[1]===P.identifiers[0]){if(q==="useState"){let Z=P.references,Pe=0;for(let $e=0;$e<Z.length;$e++){if(Z[$e].isWrite()&&Pe++,Pe>1)return!1;c.set(Z[$e].identifier,z.elements[0])}}return!0}else if(z.elements[0]===P.identifiers[0]){if(q==="useState"){let Z=P.references;for(let Pe=0;Pe<Z.length;Pe++)d.add(Z[Pe].identifier)}return!1}}}else if(q==="useTransition"&&z.type==="ArrayPattern"&&z.elements.length===2&&Array.isArray(P.identifiers)&&z.elements[1]===P.identifiers[0])return!0;return!1}function x(P){if(!R(P.defs))return!1;let k=P.defs[0];if(k==null||k.node==null||k.node.id==null)return!1;let L=k.node,_=w.childScopes,J=null,z;for(z=0;z<_.length;z++){let q=_[z],Z=q.block;if(L.type==="FunctionDeclaration"&&Z===L||L.type==="VariableDeclarator"&&Z.parent===L){J=q;break}}if(J==null)return!1;for(z=0;z<J.through.length;z++){let q=J.through[z];if(q.resolved!=null&&T.has(q.resolved.scope)&&!C(q.resolved))return!1}return!0}let C=f(v,y),F=f(x,g),O=new Map;function Q(P){let k=P.from,L=!1;for(;k.block!==m;)k.type==="function"&&(L=k.block.parent!=null&&k.block.parent.type==="ReturnStatement"),k=k.upper;return L}let U=new Map,re=new Map;M(u);function M(P){for(let k of P.references){if(!k.resolved||!T.has(k.resolved.scope))continue;let L=Lt(m,k.identifier),_=Gn(L),J=_e(_,re);if(S&&_.type==="Identifier"&&(_.parent.type==="MemberExpression"||_.parent.type==="OptionalMemberExpression")&&!_.parent.computed&&_.parent.property.type==="Identifier"&&_.parent.property.name==="current"&&Q(k)&&O.set(J,{reference:k,dependencyNode:_}),_.parent.type==="TSTypeQuery"||_.parent.type==="TSTypeReference")continue;let z=k.resolved.defs[0];if(z!=null&&!(z.node!=null&&z.node.init===m.parent)&&z.type!=="TypeParameter")if(U.has(J))U.get(J).references.push(k);else{let q=k.resolved,Z=C(q)||F(q);U.set(J,{isStable:Z,references:[k]})}}for(let k of P.childScopes)M(k)}O.forEach(({reference:P,dependencyNode:k},L)=>{let _=P.resolved.references,J=!1;for(let z=0;z<_.length;z++){let{identifier:q}=_[z],{parent:Z}=q;if(Z!=null&&Z.type==="MemberExpression"&&!Z.computed&&Z.property.type==="Identifier"&&Z.property.name==="current"&&Z.parent.type==="AssignmentExpression"&&Z.parent.left===Z){J=!0;break}}J||p({node:k.parent.property,message:`The ref value '${L}.current' will likely have changed by the time this effect cleanup function runs. If this ref points to a node rendered by React, copy '${L}.current' to a variable inside the effect, and use that variable in the cleanup function.`})});let W=new Set;function X(P,k){W.has(k)||(W.add(k),p({node:P,message:`Assignments to the '${k}' variable from inside React Hook ${r(I)} 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(I)}.`}))}let ie=new Set;if(U.forEach(({isStable:P,references:k},L)=>{P&&ie.add(L),k.forEach(_=>{_.writeExpr&&X(_.writeExpr,L)})}),W.size>0)return;if(!A){let P=null;if(U.forEach(({isStable:k,references:L},_)=>{P||L.forEach(J=>{if(P)return;let z=J.identifier;if(!c.has(z))return;let Z=J.from;for(;Z.type!=="function";)Z=Z.upper;Z.block===m&&(P=_)})}),P){let{suggestedDependencies:k}=Dt({dependencies:U,declaredDependencies:[],stableDependencies:ie,externalDependencies:new Set,isEffect:!0});p({node:I,message:`React Hook ${o} contains a call to '${P}'. Without a list of dependencies, this can lead to an infinite chain of updates. To fix this, pass [`+k.join(", ")+`] as a second argument to the ${o} Hook.`,suggest:[{desc:`Add dependencies array: [${k.join(", ")}]`,fix(L){return L.insertTextAfter(m,`, [${k.join(", ")}]`)}}]})}return}let pe=[],Ce=new Set;A.type!=="ArrayExpression"?p({node:A,message:`React Hook ${r(I)} 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(P=>{if(P===null)return;if(P.type==="SpreadElement"){p({node:P,message:`React Hook ${r(I)} has a spread element in its dependency array. This means we can't statically verify whether you've passed the correct dependencies.`});return}b.has(P)&&p({node:P,message:`Functions returned from \`useEffectEvent\` must not be included in the dependency array. Remove \`${r(P)}\` from the list.`,suggest:[{desc:`Remove the dependency \`${r(P)}\``,fix(J){return J.removeRange(P.range)}}]});let k;try{k=_e(P,re)}catch(J){if(/Unsupported node type/.test(J.message)){P.type==="Literal"?U.has(P.value)?p({node:P,message:`The ${P.raw} literal is not a valid dependency because it never changes. Did you mean to include ${P.value} in the array instead?`}):p({node:P,message:`The ${P.raw} literal is not a valid dependency because it never changes. You can safely remove it.`}):p({node:P,message:`React Hook ${r(I)} has a complex expression in the dependency array. Extract it to a separate variable so it can be statically checked.`});return}else throw J}let L=P;for(;L.type==="MemberExpression"||L.type==="OptionalMemberExpression"||L.type==="ChainExpression";)L=L.object||L.expression.object;let _=!w.through.some(J=>J.identifier===L);pe.push({key:k,node:P}),_||Ce.add(k)});let{suggestedDependencies:Ie,unnecessaryDependencies:Ae,missingDependencies:Se,duplicateDependencies:ut}=Dt({dependencies:U,declaredDependencies:pe,stableDependencies:ie,externalDependencies:Ce,isEffect:S}),rt=Ie;if(ut.size+Se.size+Ae.size===0){if(t)return;xi({declaredDependencies:pe,declaredDependenciesNode:A,componentScope:w,scope:u}).forEach(({construction:k,isUsedOutsideOfHook:L,depType:_})=>{let J=_==="function"?"useCallback":"useMemo",z=_==="function"?"definition":"initialization",q=`wrap the ${z} of '${k.name.name}' in its own ${J}() Hook.`,Z=L?`To fix this, ${q}`:`Move it inside the ${o} callback. Alternatively, ${q}`,Pe=_==="conditional"||_==="logical expression"?"could make":"makes",$e=`The '${k.name.name}' ${_} ${Pe} the dependencies of ${o} Hook (at line ${A.loc.start.line}) change on every render. ${Z}`,Un;L&&k.type==="Variable"&&_==="function"&&(Un=[{desc:`Wrap the ${z} of '${k.name.name}' in its own ${J}() Hook.`,fix(zn){let[oi,si]=J==="useMemo"?["useMemo(() => { return ","; })"]:["useCallback(",")"];return[zn.insertTextBefore(k.node.init,oi),zn.insertTextAfter(k.node.init,si)]}}]),p({node:k.node,message:$e,suggest:Un})});return}!S&&Se.size>0&&(rt=Dt({dependencies:U,declaredDependencies:[],stableDependencies:ie,externalDependencies:Ce,isEffect:S}).suggestedDependencies);function Re(){if(pe.length===0)return!0;let P=pe.map(L=>L.key),k=P.slice().sort();return P.join(",")===k.join(",")}Re()&&rt.sort();function vt(P){let k=P.split("."),L="";for(let _=0;_<k.length;_++){if(_!==0){let J=k.slice(0,_+1).join("."),z=re.get(J)===!0;L+=z?"?.":"."}L+=k[_]}return L}function Ft(P,k,L,_){return P.size===0?null:(P.size>1?"":k+" ")+L+" "+(P.size>1?"dependencies":"dependency")+": "+Ii(Array.from(P).sort().map(J=>"'"+vt(J)+"'"))+`. Either ${_} ${P.size>1?"them":"it"} or remove the dependency array.`}let Fe="";if(Ae.size>0){let P=null;if(Array.from(Ae.keys()).forEach(k=>{P===null&&k.endsWith(".current")&&(P=k)}),P!==null)Fe=` Mutable values like '${P}' aren't valid dependencies because mutating them doesn't re-render the component.`;else if(Ce.size>0){let k=Array.from(Ce)[0];u.set.has(k)||(Fe=` Outer scope values like '${k}' aren't valid dependencies because mutating them doesn't re-render the component.`)}}if(!Fe&&Se.has("props")){let P=U.get("props");if(P==null)return;let k=P.references;if(!Array.isArray(k))return;let L=!0;for(let _=0;_<k.length;_++){let J=k[_],z=Lt(w.block,J.identifier);if(!z){L=!1;break}let q=z.parent;if(q==null){L=!1;break}if(q.type!=="MemberExpression"&&q.type!=="OptionalMemberExpression"){L=!1;break}}L&&(Fe=` However, 'props' will change when *any* prop changes, so the preferred fix is to destructure the 'props' object outside of the ${o} call and refer to those specific props inside ${r(I)}.`)}if(!Fe&&Se.size>0){let P=null;Se.forEach(k=>{if(P)return;let L=w.set.get(k),_=U.get(k);if(_.references[0].resolved!==L)return;let J=L.defs[0];if(J==null||J.name==null||J.type!=="Parameter")return;let z=!1,q;for(let Z=0;Z<_.references.length;Z++)if(q=_.references[Z].identifier,q!=null&&q.parent!=null&&(q.parent.type==="CallExpression"||q.parent.type==="OptionalCallExpression")&&q.parent.callee===q){z=!0;break}z&&(P=k)}),P!==null&&(Fe=` If '${P}' changes too often, find the parent component that defines it and wrap that definition in useCallback.`)}if(!Fe&&Se.size>0){let P=null;if(Se.forEach(k=>{if(P!==null)return;let _=U.get(k).references,J,z;for(let q=0;q<_.length;q++){for(J=_[q].identifier,z=J.parent;z!=null&&z!==w.block;){if(z.type==="CallExpression"){let Z=c.get(z.callee);if(Z!=null){if(Z.name===k)P={missingDep:k,setter:z.callee.name,form:"updater"};else if(d.has(J))P={missingDep:k,setter:z.callee.name,form:"reducer"};else{let Pe=_[q].resolved;if(Pe!=null){let $e=Pe.defs[0];$e!=null&&$e.type==="Parameter"&&(P={missingDep:k,setter:z.callee.name,form:"inlineReducer"})}}break}}z=z.parent}if(P!==null)break}}),P!==null)switch(P.form){case"reducer":Fe=` You can also replace multiple useState variables with useReducer if '${P.setter}' needs the current value of '${P.missingDep}'.`;break;case"inlineReducer":Fe=` If '${P.setter}' needs the current value of '${P.missingDep}', you can also switch to useReducer instead of useState and read '${P.missingDep}' in the reducer.`;break;case"updater":Fe=` You can also do a functional update '${P.setter}(${P.missingDep.slice(0,1)} => ...)' if you only need '${P.missingDep}' in the '${P.setter}' call.`;break;default:throw new Error("Unknown case.")}}p({node:A,message:`React Hook ${r(I)} has `+(Ft(Se,"a","missing","include")||Ft(Ae,"an","unnecessary","exclude")||Ft(ut,"a","duplicate","omit"))+Fe,suggest:[{desc:`Update the dependencies array to be: [${rt.map(vt).join(", ")}]`,fix(P){return P.replaceText(A,`[${rt.map(vt).join(", ")}]`)}}]})}function h(m){let A=Ci(m.callee,i);if(A===-1)return;let I=m.arguments[A],o=m.callee,S=Kn(o).name,u=m.arguments[A+1],T=/Effect($|[^a-z])/g.test(S);if(!I){p({node:o,message:`React Hook ${S} requires an effect callback. Did you forget to pass a callback to the hook?`});return}if(!(t&&!T)){if(!u&&!T){(S==="useMemo"||S==="useCallback")&&p({node:o,message:`React Hook ${S} does nothing when called with only one argument. Did you forget to pass an array of dependencies?`});return}switch(I.type){case"FunctionExpression":case"ArrowFunctionExpression":E(I,u,o,S,T);return;case"Identifier":if(!u||u.elements&&u.elements.some(v=>v&&v.type==="Identifier"&&v.name===I.name))return;let w=n(m).set.get(I.name);if(w==null||w.defs==null)return;let R=w.defs[0];if(!R||!R.node||R.type!=="Variable"&&R.type!=="FunctionName")break;switch(R.node.type){case"FunctionDeclaration":E(R.node,u,o,S,T);return;case"VariableDeclarator":let v=R.node.init;if(!v)break;switch(v.type){case"ArrowFunctionExpression":case"FunctionExpression":E(v,u,o,S,T);return}break}break;default:p({node:o,message:`React Hook ${S} received a function whose dependencies are unknown. Pass an inline function instead.`});return}p({node:o,message:`React Hook ${S} has a missing dependency: '${I.name}'. Either include it or remove the dependency array.`,suggest:[{desc:`Update the dependencies array to be: [${I.name}]`,fix(w){return w.replaceText(u,`[${I.name}]`)}}]})}}if(e.options[0]?.ignoreIfReactCompilerIsEnabled){for(let m of e.sourceCode.getAllComments())if(bi.test(m.value))return t=!0,{CallExpression:A=>h(A,!0)}}return{CallExpression:m=>h(m)}}};function Dt({dependencies:e,declaredDependencies:t,stableDependencies:r,externalDependencies:n,isEffect:s}){let a=i();function i(){return{isUsed:!1,isSatisfiedRecursively:!1,isSubtreeUsed:!1,children:new Map}}e.forEach((E,h)=>{let m=p(a,h);m.isUsed=!0,l(a,h,A=>{A.isSubtreeUsed=!0})}),t.forEach(({key:E})=>{let h=p(a,E);h.isSatisfiedRecursively=!0}),r.forEach(E=>{let h=p(a,E);h.isSatisfiedRecursively=!0});function p(E,h){let m=h.split("."),A=E;for(let I of m){let o=A.children.get(I);o||(o=i(),A.children.set(I,o)),A=o}return A}function l(E,h,m){let A=h.split("."),I=E;for(let o of A){let S=I.children.get(o);if(!S)return;m(S),I=S}}let c=new Set,d=new Set;y(a,c,d,E=>E);function y(E,h,m,A){E.children.forEach((I,o)=>{let S=A(o);if(I.isSatisfiedRecursively){I.isSubtreeUsed&&m.add(S);return}if(I.isUsed){h.add(S);return}y(I,h,m,u=>S+"."+u)})}let g=[],b=new Set,f=new Set;return t.forEach(({key:E})=>{d.has(E)?g.indexOf(E)===-1?g.push(E):f.add(E):b.add(E)}),c.forEach(E=>{g.push(E)}),{suggestedDependencies:g,unnecessaryDependencies:b,duplicateDependencies:f,missingDependencies:c}}function Ve(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 Ve(e.consequent)!=null||Ve(e.alternate)!=null?"conditional":null;case"LogicalExpression":return Ve(e.left)!=null||Ve(e.right)!=null?"logical expression":null;case"JSXFragment":return"JSX fragment";case"JSXElement":return"JSX element";case"AssignmentExpression":return Ve(e.right)!=null?"assignment expression":null;case"NewExpression":return"object construction";case"Literal":return e.value instanceof RegExp?"regular expression":null;case"TypeCastExpression":return Ve(e.expression);case"TSAsExpression":return Ve(e.expression)}return null}function xi({declaredDependencies:e,declaredDependenciesNode:t,componentScope:r,scope:n}){let s=e.map(({key:i})=>{let p=r.variables.find(c=>c.name===i);if(p==null)return null;let l=p.defs[0];if(l==null)return null;if(l.type==="Variable"&&l.node.type==="VariableDeclarator"&&l.node.id.type==="Identifier"&&l.node.init!=null){let c=Ve(l.node.init);if(c!=null)return[p,c]}return l.type==="FunctionName"&&l.node.type==="FunctionDeclaration"?[p,"function"]:l.type==="ClassName"&&l.node.type==="ClassDeclaration"?[p,"class"]:null}).filter(Boolean);function a(i){let p=!1;for(let l=0;l<i.references.length;l++){let c=i.references[l];if(c.writeExpr){if(p)return!0;p=!0;continue}let d=c.from;for(;d!==n&&d!=null;)d=d.upper;if(d!==n&&!Qn(t,c.identifier))return!0}return!1}return s.map(([i,p])=>({construction:i.defs[0],depType:p,isUsedOutsideOfHook:a(i)}))}function Gn(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)?Gn(e.parent):e.type==="MemberExpression"&&e.parent&&e.parent.type==="AssignmentExpression"&&e.parent.left===e?e.object:e}function jt(e,t,r){t&&(e.optional?t.has(r)||t.set(r,!0):t.has(r)||t.set(r,!1))}function _e(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=_e(e.object,t),n=_e(e.property,null),s=`${r}.${n}`;return jt(e,t,s),s}else if(e.type==="OptionalMemberExpression"&&!e.computed){let r=_e(e.object,t),n=_e(e.property,null),s=`${r}.${n}`;return jt(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=_e(r.object,t),s=_e(r.property,null),a=`${n}.${s}`;return jt(r,t,a),a}else throw new Error(`Unsupported node type: ${e.type}`)}function Kn(e,t){return e.type==="MemberExpression"&&e.object.type==="Identifier"&&e.object.name==="React"&&e.property.type==="Identifier"&&!e.computed?e.property:e}function Ci(e,t){let r=Kn(e);if(r.type!=="Identifier")return-1;switch(r.name){case"useEffect":case"useLayoutEffect":case"useCallback":case"useMemo":return 0;case"useImperativeHandle":return 1;default:if(r===e&&t&&t.additionalHooks){let n;try{n=_e(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 Lt(e,t){let r=[e],n=null;for(;r.length;){if(n=r.shift(),Ai(n,t))return n;if(Qn(n,t))for(let[s,a]of Object.entries(n))s!=="parent"&&(qn(a)?(a.parent=n,r.push(a)):Array.isArray(a)&&a.forEach(i=>{qn(i)&&(i.parent=n,r.push(i))}))}return null}function Ii(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 qn(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&typeof e.type=="string"}function Ai(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 Qn(e,t){return e.range[0]<=t.range[0]&&e.range[1]>=t.range[1]}function wi(e){return!1}var ce=require("@typescript-eslint/utils"),H=ke(require("typescript")),Ut=require("zod/v4");var Mt=require("@typescript-eslint/utils");function Ge(e,t,r=1/0){if(r!==0&&e.parent)return e.type===t?e:Ge(e.parent,t,r===1/0?r:r-1)}function*$t(e){yield e,e.parent&&(yield*$t(e.parent))}function _t(e,t){for(let r of e){let n=t(r);if(n!=null&&n!==!1)return n}}function tr(e,t,r){let s=r.getDeclaredVariables(e).find(a=>a.name===t||a.identifiers[0]?.parent.type===Mt.AST_NODE_TYPES.Property&&a.identifiers[0].parent.key.type===Mt.AST_NODE_TYPES.Identifier&&a.identifiers[0].parent.key.name===t);return s?s.references.filter(a=>!a.init):[]}function er(e){return e===null||typeof e!="object"||!("type"in e)?!1:typeof e.type=="string"}function Ri(e,t){return e[t]}function Oe(e,t,r){let n=r.visitorKeys,s=new Set;function a(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 c of l){let d=Ri(i,c);if(d){if(Array.isArray(d)){for(let y of d)if(er(y)&&a(y))return!0}else if(er(d)&&a(d))return!0}}return!1}a(e)}var Pi=ce.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),nr="improved-no-unnecessary-condition",vi=Ut.z.object({alternativeForInCondition:Ut.z.string().optional().describe("Alternative to appear in the error for `in` condition")}),Fi=["string","number","bigint","boolean","symbol","undefined","object","function","never"],ki=new Set(Fi),zt={name:nr,rule:Pi({name:nr,meta:{type:"suggestion",docs:{description:"Extends checks of `no-unnecessary-condition` rule"},messages:{unnecessaryTypeofCondition:'This condition is unnecessary. The type of "{{name}}" is always "{{type}}".',alwaysFalseTypeofCondition:'This condition will always be false. The type of "{{name}}" is "{{actualType}}" so the condition has no overlap with "{{conditionType}}".',unnecessaryStartsWithCondition:"This startsWith check is unnecessary as it always evaluates to true.",alwaysFalseStartsWithCondition:"This startsWith check will always be false.",unnecessaryEndsWithCondition:"This endsWith check is unnecessary as it always evaluates to true.",alwaysFalseEndsWithCondition:"This endsWith check will always be false.",unnecessaryIncludesCondition:"This includes check is unnecessary as it always evaluates to true.",alwaysFalseIncludesCondition:"This includes check will always be false.",unnecessaryLengthCondition:"This length comparison is unnecessary as it always evaluates to true.",alwaysFalseLengthCondition:"This length comparison will always be false.",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:[V(vi)]},defaultOptions:[{}],create(e,[t]){let r=ce.ESLintUtils.getParserServices(e,!0),n=r.program?.getTypeChecker();if(!n||!r.program)throw new Error("TypeScript services or program not available");function s(o){return o.type===ce.AST_NODE_TYPES.UnaryExpression&&o.operator==="typeof"}function a(o){return o.flags&H.default.TypeFlags.Any||o.flags&H.default.TypeFlags.Unknown?null:o.flags&H.default.TypeFlags.StringLike?["string"]:o.flags&H.default.TypeFlags.NumberLike?["number"]:o.flags&H.default.TypeFlags.BigIntLike?["bigint"]:o.flags&H.default.TypeFlags.BooleanLike?["boolean"]:o.flags&H.default.TypeFlags.ESSymbolLike?["symbol"]:o.flags&H.default.TypeFlags.Undefined||o.flags&H.default.TypeFlags.Void?["undefined"]:o.flags&H.default.TypeFlags.Null?["object"]:o.getCallSignatures().length>0?["function"]:o.flags&H.default.TypeFlags.Object?o.getProperties().length===0?["string","number","bigint","boolean","symbol","object","function"]:["object"]:o.flags&H.default.TypeFlags.NonPrimitive?["object"]:o.flags&H.default.TypeFlags.Never?["never"]:null}function i(o){if(!n)return null;let S=r.esTreeNodeToTSNodeMap.get(o),u=n.getTypeAtLocation(S.expression);if(u.flags&H.default.TypeFlags.Any||u.flags&H.default.TypeFlags.Unknown)return null;let T=[];if(u.isUnion()){for(let R of u.types){let v=a(R);if(v)T.push(...v);else return null}return T}let w=a(u);return w?(T.push(...w),T):null}function p(o){if(!(o.operator==="==="||o.operator==="!=="))return;let u=null,T=null;if(s(o.left)?(u=o.left,T=o.right.type===ce.AST_NODE_TYPES.Literal&&typeof o.right.value=="string"?o.right.value:null):s(o.right)&&(u=o.right,T=o.left.type===ce.AST_NODE_TYPES.Literal&&typeof o.left.value=="string"?o.left.value:null),!u||!T||!Oi(T,ki))return;let w=i(u);if(!w)return;let R=o.operator==="!==",v=w.includes(T);w.length===1?v&&!R?e.report({node:o,messageId:"unnecessaryTypeofCondition",data:{name:Ke(u,e),type:T}}):!v&&R?e.report({node:o,messageId:"unnecessaryTypeofCondition",data:{name:Ke(u,e),type:Array.from(w)[0]}}):!v&&!R?e.report({node:o,messageId:"alwaysFalseTypeofCondition",data:{name:Ke(u,e),actualType:mt(w),conditionType:T}}):v&&R&&e.report({node:o,messageId:"alwaysFalseTypeofCondition",data:{name:Ke(u,e),actualType:mt(w),conditionType:T}}):!v&&!R?e.report({node:o,messageId:"alwaysFalseTypeofCondition",data:{name:Ke(u,e),actualType:mt(w),conditionType:T}}):!v&&R&&e.report({node:o,messageId:"unnecessaryTypeofCondition",data:{name:Ke(u,e),type:mt(w)}})}function l(o){if(o.flags&H.default.TypeFlags.Any||o.flags&H.default.TypeFlags.Unknown)return null;if(o.isUnion()){let S=[];for(let u of o.types)if(u.flags&H.default.TypeFlags.StringLiteral){let T=u.value;S.push(T)}else return null;return S}return o.flags&H.default.TypeFlags.StringLiteral?[o.value]:null}function c(o){if(!n)return null;let S=r.esTreeNodeToTSNodeMap.get(o),u=n.getTypeAtLocation(S),T=l(u);if(T)return T;let w=n.getSymbolAtLocation(S);if(w){let R=n.getTypeOfSymbolAtLocation(w,S),v=l(R);if(v)return v}return null}function d(o){let S=e.sourceCode.ast,u=null;return Oe(S,T=>{if(T.type===ce.AST_NODE_TYPES.VariableDeclarator&&T.id.type===ce.AST_NODE_TYPES.Identifier&&T.id.name===o.name&&T.id.typeAnnotation){let w=T.id.typeAnnotation.typeAnnotation;if(w.type===ce.AST_NODE_TYPES.TSUnionType){let R=[];for(let v of w.types)if(v.type===ce.AST_NODE_TYPES.TSLiteralType&&v.literal.type===ce.AST_NODE_TYPES.Literal&&typeof v.literal.value=="string")R.push(v.literal.value);else return!0;return u=R,!0}if(w.type===ce.AST_NODE_TYPES.TSLiteralType&&w.literal.type===ce.AST_NODE_TYPES.Literal&&typeof w.literal.value=="string")return u=[w.literal.value],!0}return!1},e.sourceCode),u}function y(o){if(o.callee.type!==ce.AST_NODE_TYPES.MemberExpression||o.callee.property.type!==ce.AST_NODE_TYPES.Identifier||o.callee.computed)return;let S=o.callee.property.name;if(S!=="startsWith"&&S!=="endsWith"&&S!=="includes"||o.arguments.length!==1)return;let[u]=o.arguments;if(!u||u.type!==ce.AST_NODE_TYPES.Literal||typeof u.value!="string")return;let T=o.callee.object,w=c(T);if(!w&&T.type===ce.AST_NODE_TYPES.Identifier&&(w=d(T)),!w||w.length===0)return;let R=u.value;if(S==="includes"&&w.length>1)return;let v=0,x=0;for(let C of w)if((S==="startsWith"?C.startsWith(R):S==="endsWith"?C.endsWith(R):C.includes(R))?v++:x++,v>0&&x>0)return;if(v>0&&x===0){let C=S==="startsWith"?"unnecessaryStartsWithCondition":S==="endsWith"?"unnecessaryEndsWithCondition":"unnecessaryIncludesCondition";e.report({node:o,messageId:C})}else if(x>0&&v===0){let C=S==="startsWith"?"alwaysFalseStartsWithCondition":S==="endsWith"?"alwaysFalseEndsWithCondition":"alwaysFalseIncludesCondition";e.report({node:o,messageId:C})}}function g(o){if(!new Set(["===","!==",">",">=","<","<="]).has(o.operator))return;function u(F){if(F.type!==ce.AST_NODE_TYPES.MemberExpression||F.computed||F.property.type!==ce.AST_NODE_TYPES.Identifier||F.property.name!=="length")return null;let O=F.object,Q=c(O);if(!Q||Q.length===0)return null;let U=[];for(let re of Q)U.push(re.length);return{values:U}}let T=u(o.left),w=u(o.right),R=null,v=null;if(T?o.right.type===ce.AST_NODE_TYPES.Literal&&typeof o.right.value=="number"&&(R=T.values,v=o.right.value):w&&o.left.type===ce.AST_NODE_TYPES.Literal&&typeof o.left.value=="number"&&(R=w.values,v=o.left.value),!R||v===null)return;let x=0,C=0;for(let F of R){let O=!1;if(o.operator==="==="?O=F===v:o.operator==="!=="?O=F!==v:o.operator===">"?O=F>v:o.operator===">="?O=F>=v:o.operator==="<"?O=F<v:o.operator==="<="&&(O=F<=v),O?x++:C++,x>0&&C>0)return}x>0&&C===0?e.report({node:o,messageId:"unnecessaryLengthCondition"}):C>0&&x===0&&e.report({node:o,messageId:"alwaysFalseLengthCondition"})}function b(o){if(o.type===ce.AST_NODE_TYPES.Literal&&typeof o.value=="string")return o.value;let S=c(o);if(!S||S.length!==1)return null;let[u]=S;return u??null}function f(o){return(o.flags&H.default.TypeFlags.Intersection)!==0}function E(o){return(o.flags&H.default.TypeFlags.Object)!==0}function h(o){return!n||n.getIndexTypeOfType(o,H.default.IndexKind.String)?!0:!!n.getIndexTypeOfType(o,H.default.IndexKind.Number)}function m(o,S){if(!n||h(o)||o.getProperties().length===0)return"unknown";let u=n.getPropertyOfType(o,S);return u?u.flags&H.default.SymbolFlags.Optional?"optional":"required":"absent"}function A(o,S){if(o.flags&H.default.TypeFlags.Any||o.flags&H.default.TypeFlags.Unknown||o.flags&H.default.TypeFlags.Never||o.flags&H.default.TypeFlags.TypeParameter||o.flags&H.default.TypeFlags.IndexedAccess||o.flags&H.default.TypeFlags.StringLike||o.flags&H.default.TypeFlags.NumberLike||o.flags&H.default.TypeFlags.BigIntLike||o.flags&H.default.TypeFlags.BooleanLike||o.flags&H.default.TypeFlags.EnumLike||o.flags&H.default.TypeFlags.ESSymbolLike||o.flags&H.default.TypeFlags.NonPrimitive||o.flags&H.default.TypeFlags.Null||o.flags&H.default.TypeFlags.Undefined||o.flags&H.default.TypeFlags.Void)return"unknown";if(o.isUnion()){let u=!0,T=!0;for(let w of o.types){let R=A(w,S);if(R==="unknown"||(R!=="required"&&(u=!1),R!=="absent"&&(T=!1),R==="optional"))return"unknown"}return u?"required":T?"absent":"unknown"}if(f(o)){let u=o,T=!1,w=!1;for(let R of u.types){let v=A(R,S);if(v==="unknown")return"unknown";v==="required"?T=!0:v==="optional"&&(w=!0)}return T?"required":w?"optional":"absent"}return E(o)?m(o,S):"unknown"}function I(o){if(o.operator!=="in"||o.left.type===ce.AST_NODE_TYPES.PrivateIdentifier)return;let S=b(o.left);if(!S)return;let u=o.right,T=r.esTreeNodeToTSNodeMap.get(u);if(!n)return;let w=n.getTypeAtLocation(T),R=A(w,S);R==="required"?e.report({node:o,messageId:"unnecessaryInCondition",data:{property:S,type:n.typeToString(w),alternative:t.alternativeForInCondition?`If this a valid condition, you can use as alternative: ${t.alternativeForInCondition}`:""}}):R==="absent"&&e.report({node:o,messageId:"alwaysFalseInCondition",data:{property:S,type:n.typeToString(w),alternative:t.alternativeForInCondition?`If this a valid condition, you can use as alternative: ${t.alternativeForInCondition}`:""}})}return{BinaryExpression(o){p(o),g(o),I(o)},CallExpression:y}}})};function mt(e){return Array.from(new Set(e)).join(" | ")||"never"}function Ke(e,t){let r=e.argument;return r.type===ce.AST_NODE_TYPES.Identifier?r.name:t.sourceCode.getText(r)}function Oi(e,t){return t.has(e)}var yt=require("@typescript-eslint/utils"),dt=require("zod/v4");var Ni=yt.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),rr="no-call-with-explicit-generics",Di=dt.z.object({functions:dt.z.array(dt.z.string())}),ji=Ni({name:rr,meta:{type:"problem",docs:{description:"Enforce calling configured functions with inferred generics only"},messages:{noExplicitGenerics:"Function '{{ functionName }}' should be called with inferred generics (remove the explicit type parameters)"},schema:[V(Di)]},defaultOptions:[{functions:[]}],create(e,[t]){let r=new Set(t.functions);return{CallExpression(n){let{callee:s}=n;s.type===yt.AST_NODE_TYPES.Identifier&&r.has(s.name)&&n.typeArguments&&e.report({node:n,messageId:"noExplicitGenerics",data:{functionName:s.name}})}}}}),Wt={name:rr,rule:ji};var He=require("@typescript-eslint/utils"),Li=He.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),ir="no-call-with-inferred-generics",Mi=Li({name:ir,meta:{type:"problem",docs:{description:"Disable calling configured functions with infered generics"},messages:{missingGenericDeclaration:"Function '{{ functionName }}' should be called with at least {{ minGenerics }} generic(s) (ex: `fn<Generic>()`) defined",anyUsedInGenerics:"Function '{{ functionName }}' should not be called with 'any' in generics"},schema:[{type:"object",properties:{functions:{type:"array",items:{type:"object",properties:{name:{type:"string"},minGenerics:{type:"number"},allowAny:{type:"boolean"},disallowTypes:{type:"array",items:{type:"string"}}},required:["name"]}},anyAliases:{type:"array",items:{type:"string"}}},required:["functions"]}]},defaultOptions:[{functions:[]}],create(e,[t]){let r=new Map(t.functions.map(n=>[n.name,n]));return{CallExpression(n){let{callee:s}=n;if(s.type!==He.AST_NODE_TYPES.Identifier)return;let a=r.get(s.name);if(!a)return;let{minGenerics:i=1,allowAny:p,disallowTypes:l=t.disallowTypes}=a;(n.typeArguments?.params.length||0)<(i||0)&&e.report({node:n,messageId:"missingGenericDeclaration",data:{functionName:s.name,minGenerics:i||0}}),!(p&&!l)&&n.typeArguments?.params.some(d=>!p&&d.type===He.AST_NODE_TYPES.TSAnyKeyword||l&&d.type===He.AST_NODE_TYPES.TSTypeReference&&d.typeName.type===He.AST_NODE_TYPES.Identifier&&l.includes(d.typeName.name))&&e.report({node:n,messageId:"anyUsedInGenerics",data:{functionName:s.name}})}}}}),Jt={name:ir,rule:Mi};var ar=require("@typescript-eslint/utils"),$i=ar.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),lr="no-commented-out-code",_i=["function ","class ","interface ","type ","enum ","namespace ","import ","export ","const ","let ","var ","return ","throw ","break","continue","try {","catch (","finally {","async ","await ","case ","switch (","while (","for (","default:"],Ui=/^\s*return\s+/,zi=/\w=("|'|`)/,Wi=/\w+:\s*('|"|`)/,Ji=/\[['"][^'"]*['"]\]:\s*('|"|`|[^'"`\s])/,Vi=/\w+-\w+:/,Xi=/\w+_\w+:/,Bi=/\?\s+\w/,Hi=/:\s+\w/,Yi=/^\s*('|"|`)[^'"]*('|"|`),?\s*$/,qi=/^\s*\d+[,}]/,Zi=/^\s*\[[^\]]*\][,}]/,Gi=/^\s*\{[^}]*\}[,}]/,Ki=/\.\w+\(/,Qi=/\[\w+\]/,eo=/^\s*(['"`]).+?\1\s*:/,to=/^<[A-Z]\w*(\s|>|\/)/,no=/^<[a-z]+(\s|>|\/)/,ro=/<[A-Z]\w*(\s.*)?>/,io=/<\/[A-Z]\w*>/,oo=/<[a-z]+(\s.*)?>/,so=/<\/[a-z]+>/,ao=/^\s*[*\s]*$/,lo=/^[a-zA-Z]/,po=/^[A-Z][A-Za-z]*(?:\s+\d+)?(?:\s+[a-z]+)*:\s+[A-Za-z]/,co=/```[\s\S]*?```/g,uo=/`[^`]*`/g,or=/[a-zA-Z0-9]/,fo=/\.[A-Za-z_][A-Za-z0-9_]*\(/,mo=/[{}[\]()`=<>]/,yo=/:\s*(['"`[{(]|\w+\s*=>)/,go=/\bif\s*\(|\belse\b|=>/,ue={returnStatement:Ui,stringAssignment:zi,objectPropertyWithQuotes:Wi,computedPropertyAssignment:Ji,kebabCaseProperty:Vi,snakeCaseProperty:Xi,ternaryOperator:Bi,colonWithWord:Hi,quotedString:Yi,numberWithComma:qi,arrayWithComma:Zi,objectWithComma:Gi,methodCall:Ki,arrayAccess:Qi,quotedPropertyKey:eo,jsxSelfClosing:to,jsxElement:no,jsxOpeningTag:ro,jsxClosingTag:io,htmlOpeningTag:oo,htmlClosingTag:so,jsdocComment:ao};function So(e){if(e.includes(":")){let r=e.split(":")[0]?.trim();if(r&&lo.test(r)&&r.includes(" "))return!0}let t=e.trim();return t.length===0||fo.test(t)||mo.test(t)||yo.test(t)||go.test(t)?!1:!!(t.includes(":")&&po.test(t))}var To=[") {","return;",ue.returnStatement,"if (","else {","else if (","/>","</","< ","},",": {"," } = ","={",ue.stringAssignment,");",ue.objectPropertyWithQuotes,ue.computedPropertyAssignment,ue.kebabCaseProperty,ue.snakeCaseProperty,"&&","||","()",ue.ternaryOperator,ue.colonWithWord,ue.quotedString,ue.numberWithComma,ue.arrayWithComma,ue.objectWithComma,ue.methodCall,ue.arrayAccess,"?.(","??","=>",ue.quotedPropertyKey],ho=["/>","</",ue.jsxSelfClosing,ue.jsxElement,ue.jsxOpeningTag,ue.jsxClosingTag,ue.htmlOpeningTag,ue.htmlClosingTag],sr=["INFO:","TODO:","DOCS:","FIX:","FIXME:","HACK:","NOTE:","WARNING:","WARN:","BUG:","ISSUE:","TEMP:","TEMPORARY:","XXX:","REVIEW:","eslint"],Eo=$i({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 a=n.trimStart();if(n.startsWith("*")||a.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")||ue.jsdocComment.test(n))return!1;for(let i of sr)if(a.startsWith(i))return!1;if(n.includes("https://")||So(a))return!1;if(s==="Block"){for(let i of ho)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 _i)if(a.startsWith(i))return{wrongPattern:i};for(let i of To)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 a=n,i=a.trim();if(i.startsWith("`")&&(i.endsWith("`,")||i.endsWith("`;")||i.endsWith("`")))return a;if(s==="Block"&&a.includes("```")){let c=a.split(co);c.some(y=>or.test(y))&&(a=c.join(""))}if(!a.includes("`"))return a;let p=a.split(uo);return p.some(c=>or.test(c))?p.join(""):a}return{Program(){let s=e.sourceCode.getAllComments();for(let a of s){let i=r(a.value,a.type),p=t(i,a.type);p&&e.report({node:a,messageId:"commentedOutCode",data:{wrongPattern:p.wrongPattern,allowedPrefixes:sr.join(", ")}})}}}}}),Vt={name:lr,rule:Eo};var gt=require("@typescript-eslint/utils"),bo=gt.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),pr="no-default-export",xo=bo({name:pr,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===gt.TSESTree.AST_NODE_TYPES.Identifier&&r.exported.name==="default"&&e.report({node:t,messageId:"noDefaultExport"})}}}}),Xt={name:pr,rule:xo};var cr=require("@typescript-eslint/utils"),Co=cr.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),ur="no-leaked-text-in-jsx",Io=[",",";","[","]","(",")"],Ao=Co({name:ur,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="";Io.includes(r)?n=r:r.includes("&&")?n="&&":r.includes("||")?n="||":r.endsWith("? (")&&(n="? ("),n&&e.report({node:t,messageId:"leakedTextInJSX",data:{text:n}})}}}}),Bt={name:ur,rule:Ao};var Xe=require("@typescript-eslint/utils"),wo=Xe.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),mr="no-non-camel-case-functions",Ro=/^(\$?[a-z][a-zA-Z0-9]*)$/;function fr(e){if(e.typeName.type!==Xe.AST_NODE_TYPES.TSQualifiedName)return!1;let{left:t,right:r}=e.typeName;return t.type===Xe.AST_NODE_TYPES.Identifier&&t.name==="JSX"&&r.name==="Element"}var Po=wo({name:mr,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&&!Ro.test(t.id.name)){let r=t.returnType?.typeAnnotation;if(r&&(r.type===Xe.AST_NODE_TYPES.TSTypeReference?fr(r):r.type===Xe.AST_NODE_TYPES.TSUnionType&&r.types.some(s=>s.type===Xe.AST_NODE_TYPES.TSTypeReference&&fr(s))))return;e.report({node:t.id,messageId:"nonCamelCaseFunction",data:{functionName:t.id.name}})}}}}}),Ht={name:mr,rule:Po};var oe=require("@typescript-eslint/utils");var vo=oe.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),dr="no-optional-root-props",Fo=vo({name:dr,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 a=e.sourceCode.getDeclaredVariables(n)[0];if(!a||a.references.length!==1)return!1;let i=a.references[0];if(!i)return!1;for(let p of $t(i.identifier)){if("returnType"in p||p.type===oe.TSESTree.AST_NODE_TYPES.ExportNamedDeclaration)return!1;let l=p.parent;if(!l)return!1;if(l.type===oe.TSESTree.AST_NODE_TYPES.TSTypeParameterInstantiation&&l.parent.type===oe.TSESTree.AST_NODE_TYPES.TSTypeReference&&l.parent.typeName.type===oe.TSESTree.AST_NODE_TYPES.Identifier&&l.parent.typeName.name==="FC"){let d=Ge(l.parent.parent,oe.TSESTree.AST_NODE_TYPES.VariableDeclaration,4);if(!d)return!1;let y=St(d,e.sourceCode);return y?!(y.parent.type===oe.TSESTree.AST_NODE_TYPES.CallExpression&&y.parent.callee.type===oe.TSESTree.AST_NODE_TYPES.Identifier&&y.parent.callee.name==="memo"):!1}if(p.type===oe.TSESTree.AST_NODE_TYPES.AssignmentPattern)return!1;if(l.type===oe.TSESTree.AST_NODE_TYPES.ArrowFunctionExpression){let c=Ge(l,oe.TSESTree.AST_NODE_TYPES.VariableDeclaration);return c?!!St(c,e.sourceCode):!1}if(l.type===oe.TSESTree.AST_NODE_TYPES.FunctionDeclaration)return!!St(l,e.sourceCode)}return!1}function r(n){n.key.type!==oe.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 a=Ge(n,oe.TSESTree.AST_NODE_TYPES.TSPropertySignature);if(!a)return null;let i=e.sourceCode.getText(a);return s.replaceText(a,i.replace("?:",": undefined |"))}}]})}return{TSTypeAliasDeclaration(n){if(n.typeAnnotation.type===oe.TSESTree.AST_NODE_TYPES.TSTypeLiteral&&!(Tt(n)||!t(n)))for(let s of n.typeAnnotation.members)s.type===oe.TSESTree.AST_NODE_TYPES.TSPropertySignature&&r(s)},TSInterfaceDeclaration(n){if(!(Tt(n)||!t(n)))for(let s of n.body.body)s.type===oe.TSESTree.AST_NODE_TYPES.TSPropertySignature&&r(s)},TSTypeReference(n){if(n.typeName.type!==oe.TSESTree.AST_NODE_TYPES.Identifier||n.typeName.name!=="FC"||!n.typeArguments?.params[0])return;let s=n.typeArguments.params[0];if(s.type!==oe.TSESTree.AST_NODE_TYPES.TSTypeLiteral)return;let a=Ge(n.parent,oe.TSESTree.AST_NODE_TYPES.VariableDeclaration,4);if(!a)return;let i=St(a,e.sourceCode);if(!(!i||i.parent.type===oe.TSESTree.AST_NODE_TYPES.CallExpression&&i.parent.callee.type===oe.TSESTree.AST_NODE_TYPES.Identifier&&i.parent.callee.name==="memo"))for(let l of s.members)l.type===oe.TSESTree.AST_NODE_TYPES.TSPropertySignature&&r(l)}}}});function Tt(e){return e?e.parent?.type===oe.TSESTree.AST_NODE_TYPES.ExportNamedDeclaration||e.parent?.type===oe.TSESTree.AST_NODE_TYPES.ExportDefaultDeclaration:!1}function St(e,t){if(Tt(e))return;let r;if(e.type===oe.TSESTree.AST_NODE_TYPES.VariableDeclaration){if(e.declarations.length!==1)return;e.declarations[0].id.type===oe.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===oe.TSESTree.AST_NODE_TYPES.FunctionDeclaration&&n.upper&&(n=n.upper);let s=n.variables.find(i=>i.identifiers.includes(r));if(!s)return;let a=s.references.filter(i=>i.identifier!==r);if(!(a.length!==1||!a[0])&&!Tt(a[0].identifier.parent.parent))return a[0].identifier}var Yt={name:dr,rule:Fo};var it=require("@typescript-eslint/utils");var ot=B({name:"no-reexport",meta:{type:"problem",docs:{description:"Disallow re-exports to prevent indirection"},schema:[],messages:{noReexport:"Re-exports are not allowed. Use direct exports only."}},defaultOptions:[],create(e){let t=new Set;function r(n){return n?n.type===it.AST_NODE_TYPES.Identifier?t.has(n.name):n.type===it.AST_NODE_TYPES.MemberExpression?r(n.object):!1:!1}return{ImportDeclaration(n){for(let s of n.specifiers)t.add(s.local.name)},ExportNamedDeclaration(n){if(n.source){e.report({node:n,messageId:"noReexport"});return}if(n.declaration?.type===it.AST_NODE_TYPES.VariableDeclaration)for(let s of n.declaration.declarations)r(s.init)&&e.report({node:n,messageId:"noReexport"});n.specifiers.length>0&&e.report({node:n,messageId:"noReexport"})},ExportDefaultDeclaration(n){n.declaration.type===it.AST_NODE_TYPES.Identifier&&t.has(n.declaration.name)&&e.report({node:n,messageId:"noReexport"})},ExportAllDeclaration(n){e.report({node:n,messageId:"noReexport"})}}}});var yr=require("@typescript-eslint/utils"),ht=ke(require("path")),Ue=require("zod/v4");var ko=yr.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),gr="no-relative-imports",Oo=Ue.z.object({find:Ue.z.string(),replacement:Ue.z.string()}),No=Ue.z.object({aliases:Ue.z.array(Oo),rootDir:Ue.z.string().optional(),allowNotFoundAliases:Ue.z.boolean().optional(),_dev_simulateFileName:Ue.z.string().optional()}),Do=ko({name:gr,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:[V(No)]},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,p){let l=ht.default.dirname(p);return ht.default.resolve(l,i)}function a(i){let p=t.rootDir??process.cwd(),l=ht.default.relative(p,i);if(l.startsWith("."))return null;l.startsWith("/")||(l=`/${l}`);for(let{find:c,replacement:d}of t.aliases)if(l.startsWith(d)){let y=l.replace(d,c);return{alias:c,newPath:y}}return null}return{ImportDeclaration(i){let p=i.source.value;if(!n(p))return;let l=s(p,r),c=a(l);!c&&t.allowNotFoundAliases||e.report({node:i,messageId:c?"noRelativeImportsWithAlias":"noRelativeImports",data:{alias:c?.alias},fix:c?d=>d.replaceText(i.source,`'${c.newPath}'`):void 0})}}}}),qt={name:gr,rule:Do};var fe=require("@typescript-eslint/utils"),Zt=require("zod/v4");var jo=Zt.z.object({customMessage:Zt.z.string().optional()}),Gt=B({name:"no-static-style-prop",meta:{type:"problem",docs:{description:"Prevent using static style props in JSX, only dynamic values should be allowed"},schema:[V(jo)],messages:{noStaticStyleProp:"Static style props are not allowed use css instead.{{customMessage}}"}},defaultOptions:[{}],create(e,[t]){function r(n){switch(n.type){case fe.AST_NODE_TYPES.Literal:return!0;case fe.AST_NODE_TYPES.ObjectExpression:return n.properties.every(s=>s.type===fe.AST_NODE_TYPES.Property?s.computed||s.value.type===fe.AST_NODE_TYPES.Identifier&&s.key.type===fe.AST_NODE_TYPES.Identifier&&s.key.name===s.value.name?!1:r(s.value):!1);case fe.AST_NODE_TYPES.ArrayExpression:return n.elements.every(s=>s?s.type===fe.AST_NODE_TYPES.SpreadElement?!1:r(s):!0);case fe.AST_NODE_TYPES.TemplateLiteral:return n.expressions.length===0;case fe.AST_NODE_TYPES.ConditionalExpression:case fe.AST_NODE_TYPES.LogicalExpression:case fe.AST_NODE_TYPES.BinaryExpression:case fe.AST_NODE_TYPES.UnaryExpression:case fe.AST_NODE_TYPES.CallExpression:case fe.AST_NODE_TYPES.MemberExpression:case fe.AST_NODE_TYPES.Identifier:case fe.AST_NODE_TYPES.ArrowFunctionExpression:case fe.AST_NODE_TYPES.FunctionExpression:return!1;default:return!1}}return{JSXAttribute(n){if(n.name.type===fe.AST_NODE_TYPES.JSXIdentifier&&n.name.name==="style"&&n.value){let s=null;n.value.type===fe.AST_NODE_TYPES.JSXExpressionContainer?n.value.expression.type!==fe.AST_NODE_TYPES.JSXEmptyExpression&&(s=n.value.expression):n.value.type===fe.AST_NODE_TYPES.Literal&&(s=n.value),s&&r(s)&&e.report({node:n,messageId:"noStaticStyleProp",data:{customMessage:t.customMessage?` ${t.customMessage}`:""}})}}}}});var st=require("@typescript-eslint/utils"),Ye=ke(require("zod/v4"));var Lo=Ye.object({alternativeMsgs:Ye.object({inArrayFind:Ye.string().optional(),inArrayFilter:Ye.string().optional()}).optional(),__dev_simulateFileName:Ye.string().optional()});function Mo(e){return e.typeAnnotation.type!==st.AST_NODE_TYPES.TSTypePredicate?!1:e.typeAnnotation.asserts===!1}var $o=/(typeGuards|type-guards)\.(ts|tsx)$/;function _o(e){return $o.test(e)}function Uo(e){let t=e.parent;for(;t;){if(t.type===st.AST_NODE_TYPES.CallExpression&&t.callee.type===st.AST_NODE_TYPES.MemberExpression&&t.callee.property.type===st.AST_NODE_TYPES.Identifier){let r=t.callee.property.name;if(r==="filter"||r==="find")return{method:r}}t=t.parent}return null}var Kt=B({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:[V(Lo)],hasSuggestions:!0},defaultOptions:[{}],create(e,[t]){let r=t.__dev_simulateFileName??e.filename;if(_o(r))return{};function n(s){if(!Mo(s))return;let a=Uo(s);if(t.alternativeMsgs&&a){let i=a.method==="filter"?t.alternativeMsgs.inArrayFilter:t.alternativeMsgs.inArrayFind;if(i){let p=a.method==="filter"?"useFilterWithTypeCheck":"useFindWithTypeCheck";e.report({node:s,messageId:p,data:{message:i}});return}}e.report({node:s,messageId:"typeGuardNotAllowed"})}return{"FunctionDeclaration > :matches(TSTypeAnnotation)":n,"ArrowFunctionExpression > :matches(TSTypeAnnotation)":n,"MethodDefinition > FunctionExpression > :matches(TSTypeAnnotation)":n}}});var qe=require("@typescript-eslint/utils");var zo="no-unnecessary-async-on-jsx-props";function Wo(e){if(e.body.type!==qe.AST_NODE_TYPES.BlockStatement)return!1;let t=e.body.body;if(t.length!==1)return!1;let r=t[0];return!r||r.type!==qe.AST_NODE_TYPES.ExpressionStatement?!1:r.expression.type===qe.AST_NODE_TYPES.AwaitExpression}var Qt=B({name:zo,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){Wo(r)&&e.report({node:r,messageId:"unnecessaryAsyncInJsxProp",fix(n){let s=e.sourceCode,a=[],i=s.getFirstToken(r,l=>l.value==="async");if(i){let l=s.getTokenAfter(i);l?a.push(n.replaceTextRange([i.range[0],l.range[0]],"")):a.push(n.remove(i))}function p(l){if(l.type===qe.AST_NODE_TYPES.AwaitExpression){let c=s.getFirstToken(l);if(c&&c.value==="await"){let d=s.getTokenAfter(c);d?a.push(n.replaceTextRange([c.range[0],d.range[0]],"")):a.push(n.remove(c))}}if(l.type===qe.AST_NODE_TYPES.BlockStatement)for(let c of l.body)p(c);else l.type===qe.AST_NODE_TYPES.ExpressionStatement&&p(l.expression)}return p(r.body),a}})}return{"JSXAttribute ArrowFunctionExpression[async=true]":t,"JSXAttribute FunctionExpression[async=true]":t}}});var ze=require("@typescript-eslint/utils"),en=ke(require("typescript")),Qe=ke(require("zod/v4"));var Jo=ze.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),Sr="no-unnecessary-casting",Vo=Qe.default.object({additionalCastFunctions:Qe.default.array(Qe.default.object({name:Qe.default.string(),expectedType:Qe.default.enum(["string","number"])})).optional()}),tn={name:Sr,rule:Jo({name:Sr,meta:{type:"suggestion",docs:{description:"Prevents unnecessary Number and String castings"},messages:{unnecessaryNumberCasting:"Unnecessary Number() casting on a value already of number type",unnecessaryStringCasting:"Unnecessary String() casting on a value already of string type",unnecessaryCustomCasting:"Unnecessary {{name}}() casting on a value already of {{type}} type"},schema:[V(Vo)],fixable:"code"},defaultOptions:[{}],create(e){let r=e.options[0].additionalCastFunctions||[],n=[{name:"Number",expectedType:"number"},{name:"String",expectedType:"string"},...r],s=ze.ESLintUtils.getParserServices(e,!0),a=s.program?.getTypeChecker();if(!a||!s.program)throw new Error("TypeScript services or program not available");function i(d,y){switch(d.type){case ze.AST_NODE_TYPES.Literal:return y==="number"?typeof d.value=="number":typeof d.value=="string";case ze.AST_NODE_TYPES.TemplateLiteral:return y==="string";case ze.AST_NODE_TYPES.UnaryExpression:return y==="number"?d.operator==="+"||d.operator==="-"||d.operator==="~":!1;default:return!1}}function p(d,y){return y==="number"?!!(d.flags&en.TypeFlags.NumberLike):!!(d.flags&en.TypeFlags.StringLike)}function l(d,y){return g=>g.replaceText(d,e.sourceCode.getText(y))}function c(d){if(!a||d.arguments.length!==1)return;let y=d.arguments[0];if(!y||y.type===ze.AST_NODE_TYPES.SpreadElement)return;let{callee:g}=d;if(g.type!==ze.AST_NODE_TYPES.Identifier)return;let b=g.name,f=n.find(h=>h.name===b);if(!f)return;if(i(y,f.expectedType)||p(a.getTypeAtLocation(s.esTreeNodeToTSNodeMap.get(y)),f.expectedType)){let h,m;b==="Number"?h="unnecessaryNumberCasting":b==="String"?h="unnecessaryStringCasting":(h="unnecessaryCustomCasting",m={name:f.name,type:f.expectedType}),e.report({node:d,messageId:h,...m?{data:m}:{},fix:l(d,y)})}}return{CallExpression:c}}})};var be=require("@typescript-eslint/utils"),Et=ke(require("zod/v4"));var Xo=Et.object({ignoreWithDescription:Et.string().optional()}),nn=B({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:[V(Xo)]},defaultOptions:[{}],create(e,[t]){let r=e.getSourceCode(),n=r.ast;function s(l){let c=l.arguments[0];return c&&c.type===be.AST_NODE_TYPES.Literal&&typeof c.value=="string"?c.value:null}function a(l){return!l||!t.ignoreWithDescription?!1:new RegExp(t.ignoreWithDescription).test(l)}function i(l){return l.length!==1?!1:n.body.filter(d=>{if(d.type===be.AST_NODE_TYPES.ExpressionStatement){let y=d.expression;if(y.type===be.AST_NODE_TYPES.CallExpression&&y.callee.type===be.AST_NODE_TYPES.Identifier){let g=y.callee.name;return["test","it","beforeEach","afterEach","beforeAll","afterAll"].includes(g)}}return!1}).length===0}function p(l){let c=l.arguments[1];if(c&&(c.type===be.AST_NODE_TYPES.FunctionExpression||c.type===be.AST_NODE_TYPES.ArrowFunctionExpression)&&c.body.type===be.AST_NODE_TYPES.BlockStatement){let d=c.body.body;return d.length===0?"":d.map(g=>r.text.slice(g.range[0],g.range[1])).join(`
|
|
15
|
+
Learn more about data fetching with Hooks: https://reactjs.org/link/hooks-data-fetching`});let u=l.acquire(m),T=new Set,w=null;{let P=u.upper;for(;P&&(T.add(P),P.type!=="function");)P=P.upper;if(!P)return;w=P}let R=Array.isArray;function v(P){if(!R(P.defs))return!1;let k=P.defs[0];if(k==null||k.node.type!=="VariableDeclarator")return!1;let M=k.node.init;if(M==null)return!1;for(;M.type==="TSAsExpression";)M=M.expression;let _=k.node.parent;if(_==null&&(jt(w.block,k.node.id),_=k.node.parent,_==null))return!1;if(_.kind==="const"&&M.type==="Literal"&&(typeof M.value=="string"||typeof M.value=="number"||M.value===null))return!0;if(M.type!=="CallExpression")return!1;let W=M.callee;if(W.type==="MemberExpression"&&W.object.name==="React"&&W.property!=null&&!W.computed&&(W=W.property),W.type!=="Identifier")return!1;let U=k.node.id,{name:Y}=W;if(Y==="useRef"&&U.type==="Identifier")return!0;if(wi(W)&&U.type==="Identifier"){for(let Z of P.references)Z!==U&&b.add(Z.identifier);return!0}else if(Y==="useState"||Y==="useReducer"){if(U.type==="ArrayPattern"&&U.elements.length===2&&R(P.identifiers)){if(U.elements[1]===P.identifiers[0]){if(Y==="useState"){let Z=P.references,Re=0;for(let Me=0;Me<Z.length;Me++){if(Z[Me].isWrite()&&Re++,Re>1)return!1;c.set(Z[Me].identifier,U.elements[0])}}return!0}else if(U.elements[0]===P.identifiers[0]){if(Y==="useState"){let Z=P.references;for(let Re=0;Re<Z.length;Re++)d.add(Z[Re].identifier)}return!1}}}else if(Y==="useTransition"&&U.type==="ArrayPattern"&&U.elements.length===2&&Array.isArray(P.identifiers)&&U.elements[1]===P.identifiers[0])return!0;return!1}function x(P){if(!R(P.defs))return!1;let k=P.defs[0];if(k==null||k.node==null||k.node.id==null)return!1;let M=k.node,_=w.childScopes,W=null,U;for(U=0;U<_.length;U++){let Y=_[U],Z=Y.block;if(M.type==="FunctionDeclaration"&&Z===M||M.type==="VariableDeclarator"&&Z.parent===M){W=Y;break}}if(W==null)return!1;for(U=0;U<W.through.length;U++){let Y=W.through[U];if(Y.resolved!=null&&T.has(Y.resolved.scope)&&!C(Y.resolved))return!1}return!0}let C=f(v,y),F=f(x,g),O=new Map;function Q(P){let k=P.from,M=!1;for(;k.block!==m;)k.type==="function"&&(M=k.block.parent!=null&&k.block.parent.type==="ReturnStatement"),k=k.upper;return M}let z=new Map,re=new Map;ae(u);function ae(P){for(let k of P.references){if(!k.resolved||!T.has(k.resolved.scope))continue;let M=jt(m,k.identifier),_=Zn(M),W=$e(_,re);if(S&&_.type==="Identifier"&&(_.parent.type==="MemberExpression"||_.parent.type==="OptionalMemberExpression")&&!_.parent.computed&&_.parent.property.type==="Identifier"&&_.parent.property.name==="current"&&Q(k)&&O.set(W,{reference:k,dependencyNode:_}),_.parent.type==="TSTypeQuery"||_.parent.type==="TSTypeReference")continue;let U=k.resolved.defs[0];if(U!=null&&!(U.node!=null&&U.node.init===m.parent)&&U.type!=="TypeParameter")if(z.has(W))z.get(W).references.push(k);else{let Y=k.resolved,Z=C(Y)||F(Y);z.set(W,{isStable:Z,references:[k]})}}for(let k of P.childScopes)ae(k)}O.forEach(({reference:P,dependencyNode:k},M)=>{let _=P.resolved.references,W=!1;for(let U=0;U<_.length;U++){let{identifier:Y}=_[U],{parent:Z}=Y;if(Z!=null&&Z.type==="MemberExpression"&&!Z.computed&&Z.property.type==="Identifier"&&Z.property.name==="current"&&Z.parent.type==="AssignmentExpression"&&Z.parent.left===Z){W=!0;break}}W||p({node:k.parent.property,message:`The ref value '${M}.current' will likely have changed by the time this effect cleanup function runs. If this ref points to a node rendered by React, copy '${M}.current' to a variable inside the effect, and use that variable in the cleanup function.`})});let D=new Set;function q(P,k){D.has(k)||(D.add(k),p({node:P,message:`Assignments to the '${k}' variable from inside React Hook ${r(I)} 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(I)}.`}))}let V=new Set;if(z.forEach(({isStable:P,references:k},M)=>{P&&V.add(M),k.forEach(_=>{_.writeExpr&&q(_.writeExpr,M)})}),D.size>0)return;if(!A){let P=null;if(z.forEach(({isStable:k,references:M},_)=>{P||M.forEach(W=>{if(P)return;let U=W.identifier;if(!c.has(U))return;let Z=W.from;for(;Z.type!=="function";)Z=Z.upper;Z.block===m&&(P=_)})}),P){let{suggestedDependencies:k}=Nt({dependencies:z,declaredDependencies:[],stableDependencies:V,externalDependencies:new Set,isEffect:!0});p({node:I,message:`React Hook ${o} contains a call to '${P}'. Without a list of dependencies, this can lead to an infinite chain of updates. To fix this, pass [`+k.join(", ")+`] as a second argument to the ${o} Hook.`,suggest:[{desc:`Add dependencies array: [${k.join(", ")}]`,fix(M){return M.insertTextAfter(m,`, [${k.join(", ")}]`)}}]})}return}let ce=[],ue=new Set;A.type!=="ArrayExpression"?p({node:A,message:`React Hook ${r(I)} 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(P=>{if(P===null)return;if(P.type==="SpreadElement"){p({node:P,message:`React Hook ${r(I)} has a spread element in its dependency array. This means we can't statically verify whether you've passed the correct dependencies.`});return}b.has(P)&&p({node:P,message:`Functions returned from \`useEffectEvent\` must not be included in the dependency array. Remove \`${r(P)}\` from the list.`,suggest:[{desc:`Remove the dependency \`${r(P)}\``,fix(W){return W.removeRange(P.range)}}]});let k;try{k=$e(P,re)}catch(W){if(/Unsupported node type/.test(W.message)){P.type==="Literal"?z.has(P.value)?p({node:P,message:`The ${P.raw} literal is not a valid dependency because it never changes. Did you mean to include ${P.value} in the array instead?`}):p({node:P,message:`The ${P.raw} literal is not a valid dependency because it never changes. You can safely remove it.`}):p({node:P,message:`React Hook ${r(I)} has a complex expression in the dependency array. Extract it to a separate variable so it can be statically checked.`});return}else throw W}let M=P;for(;M.type==="MemberExpression"||M.type==="OptionalMemberExpression"||M.type==="ChainExpression";)M=M.object||M.expression.object;let _=!w.through.some(W=>W.identifier===M);ce.push({key:k,node:P}),_||ue.add(k)});let{suggestedDependencies:we,unnecessaryDependencies:We,missingDependencies:ge,duplicateDependencies:it}=Nt({dependencies:z,declaredDependencies:ce,stableDependencies:V,externalDependencies:ue,isEffect:S}),Ge=we;if(it.size+ge.size+We.size===0){if(t)return;xi({declaredDependencies:ce,declaredDependenciesNode:A,componentScope:w,scope:u}).forEach(({construction:k,isUsedOutsideOfHook:M,depType:_})=>{let W=_==="function"?"useCallback":"useMemo",U=_==="function"?"definition":"initialization",Y=`wrap the ${U} of '${k.name.name}' in its own ${W}() Hook.`,Z=M?`To fix this, ${Y}`:`Move it inside the ${o} callback. Alternatively, ${Y}`,Re=_==="conditional"||_==="logical expression"?"could make":"makes",Me=`The '${k.name.name}' ${_} ${Re} the dependencies of ${o} Hook (at line ${A.loc.start.line}) change on every render. ${Z}`,_n;M&&k.type==="Variable"&&_==="function"&&(_n=[{desc:`Wrap the ${U} of '${k.name.name}' in its own ${W}() Hook.`,fix(Un){let[oi,si]=W==="useMemo"?["useMemo(() => { return ","; })"]:["useCallback(",")"];return[Un.insertTextBefore(k.node.init,oi),Un.insertTextAfter(k.node.init,si)]}}]),p({node:k.node,message:Me,suggest:_n})});return}!S&&ge.size>0&&(Ge=Nt({dependencies:z,declaredDependencies:[],stableDependencies:V,externalDependencies:ue,isEffect:S}).suggestedDependencies);function he(){if(ce.length===0)return!0;let P=ce.map(M=>M.key),k=P.slice().sort();return P.join(",")===k.join(",")}he()&&Ge.sort();function xe(P){let k=P.split("."),M="";for(let _=0;_<k.length;_++){if(_!==0){let W=k.slice(0,_+1).join("."),U=re.get(W)===!0;M+=U?"?.":"."}M+=k[_]}return M}function vt(P,k,M,_){return P.size===0?null:(P.size>1?"":k+" ")+M+" "+(P.size>1?"dependencies":"dependency")+": "+Ii(Array.from(P).sort().map(W=>"'"+xe(W)+"'"))+`. Either ${_} ${P.size>1?"them":"it"} or remove the dependency array.`}let ve="";if(We.size>0){let P=null;if(Array.from(We.keys()).forEach(k=>{P===null&&k.endsWith(".current")&&(P=k)}),P!==null)ve=` Mutable values like '${P}' aren't valid dependencies because mutating them doesn't re-render the component.`;else if(ue.size>0){let k=Array.from(ue)[0];u.set.has(k)||(ve=` Outer scope values like '${k}' aren't valid dependencies because mutating them doesn't re-render the component.`)}}if(!ve&&ge.has("props")){let P=z.get("props");if(P==null)return;let k=P.references;if(!Array.isArray(k))return;let M=!0;for(let _=0;_<k.length;_++){let W=k[_],U=jt(w.block,W.identifier);if(!U){M=!1;break}let Y=U.parent;if(Y==null){M=!1;break}if(Y.type!=="MemberExpression"&&Y.type!=="OptionalMemberExpression"){M=!1;break}}M&&(ve=` However, 'props' will change when *any* prop changes, so the preferred fix is to destructure the 'props' object outside of the ${o} call and refer to those specific props inside ${r(I)}.`)}if(!ve&&ge.size>0){let P=null;ge.forEach(k=>{if(P)return;let M=w.set.get(k),_=z.get(k);if(_.references[0].resolved!==M)return;let W=M.defs[0];if(W==null||W.name==null||W.type!=="Parameter")return;let U=!1,Y;for(let Z=0;Z<_.references.length;Z++)if(Y=_.references[Z].identifier,Y!=null&&Y.parent!=null&&(Y.parent.type==="CallExpression"||Y.parent.type==="OptionalCallExpression")&&Y.parent.callee===Y){U=!0;break}U&&(P=k)}),P!==null&&(ve=` If '${P}' changes too often, find the parent component that defines it and wrap that definition in useCallback.`)}if(!ve&&ge.size>0){let P=null;if(ge.forEach(k=>{if(P!==null)return;let _=z.get(k).references,W,U;for(let Y=0;Y<_.length;Y++){for(W=_[Y].identifier,U=W.parent;U!=null&&U!==w.block;){if(U.type==="CallExpression"){let Z=c.get(U.callee);if(Z!=null){if(Z.name===k)P={missingDep:k,setter:U.callee.name,form:"updater"};else if(d.has(W))P={missingDep:k,setter:U.callee.name,form:"reducer"};else{let Re=_[Y].resolved;if(Re!=null){let Me=Re.defs[0];Me!=null&&Me.type==="Parameter"&&(P={missingDep:k,setter:U.callee.name,form:"inlineReducer"})}}break}}U=U.parent}if(P!==null)break}}),P!==null)switch(P.form){case"reducer":ve=` You can also replace multiple useState variables with useReducer if '${P.setter}' needs the current value of '${P.missingDep}'.`;break;case"inlineReducer":ve=` If '${P.setter}' needs the current value of '${P.missingDep}', you can also switch to useReducer instead of useState and read '${P.missingDep}' in the reducer.`;break;case"updater":ve=` You can also do a functional update '${P.setter}(${P.missingDep.slice(0,1)} => ...)' if you only need '${P.missingDep}' in the '${P.setter}' call.`;break;default:throw new Error("Unknown case.")}}p({node:A,message:`React Hook ${r(I)} has `+(vt(ge,"a","missing","include")||vt(We,"an","unnecessary","exclude")||vt(it,"a","duplicate","omit"))+ve,suggest:[{desc:`Update the dependencies array to be: [${Ge.map(xe).join(", ")}]`,fix(P){return P.replaceText(A,`[${Ge.map(xe).join(", ")}]`)}}]})}function h(m){let A=Ci(m.callee,i);if(A===-1)return;let I=m.arguments[A],o=m.callee,S=Gn(o).name,u=m.arguments[A+1],T=/Effect($|[^a-z])/g.test(S);if(!I){p({node:o,message:`React Hook ${S} requires an effect callback. Did you forget to pass a callback to the hook?`});return}if(!(t&&!T)){if(!u&&!T){(S==="useMemo"||S==="useCallback")&&p({node:o,message:`React Hook ${S} does nothing when called with only one argument. Did you forget to pass an array of dependencies?`});return}switch(I.type){case"FunctionExpression":case"ArrowFunctionExpression":E(I,u,o,S,T);return;case"Identifier":if(!u||u.elements&&u.elements.some(v=>v&&v.type==="Identifier"&&v.name===I.name))return;let w=n(m).set.get(I.name);if(w==null||w.defs==null)return;let R=w.defs[0];if(!R||!R.node||R.type!=="Variable"&&R.type!=="FunctionName")break;switch(R.node.type){case"FunctionDeclaration":E(R.node,u,o,S,T);return;case"VariableDeclarator":let v=R.node.init;if(!v)break;switch(v.type){case"ArrowFunctionExpression":case"FunctionExpression":E(v,u,o,S,T);return}break}break;default:p({node:o,message:`React Hook ${S} received a function whose dependencies are unknown. Pass an inline function instead.`});return}p({node:o,message:`React Hook ${S} has a missing dependency: '${I.name}'. Either include it or remove the dependency array.`,suggest:[{desc:`Update the dependencies array to be: [${I.name}]`,fix(w){return w.replaceText(u,`[${I.name}]`)}}]})}}if(e.options[0]?.ignoreIfReactCompilerIsEnabled){for(let m of e.sourceCode.getAllComments())if(bi.test(m.value))return t=!0,{CallExpression:A=>h(A,!0)}}return{CallExpression:m=>h(m)}}};function Nt({dependencies:e,declaredDependencies:t,stableDependencies:r,externalDependencies:n,isEffect:s}){let a=i();function i(){return{isUsed:!1,isSatisfiedRecursively:!1,isSubtreeUsed:!1,children:new Map}}e.forEach((E,h)=>{let m=p(a,h);m.isUsed=!0,l(a,h,A=>{A.isSubtreeUsed=!0})}),t.forEach(({key:E})=>{let h=p(a,E);h.isSatisfiedRecursively=!0}),r.forEach(E=>{let h=p(a,E);h.isSatisfiedRecursively=!0});function p(E,h){let m=h.split("."),A=E;for(let I of m){let o=A.children.get(I);o||(o=i(),A.children.set(I,o)),A=o}return A}function l(E,h,m){let A=h.split("."),I=E;for(let o of A){let S=I.children.get(o);if(!S)return;m(S),I=S}}let c=new Set,d=new Set;y(a,c,d,E=>E);function y(E,h,m,A){E.children.forEach((I,o)=>{let S=A(o);if(I.isSatisfiedRecursively){I.isSubtreeUsed&&m.add(S);return}if(I.isUsed){h.add(S);return}y(I,h,m,u=>S+"."+u)})}let g=[],b=new Set,f=new Set;return t.forEach(({key:E})=>{d.has(E)?g.indexOf(E)===-1?g.push(E):f.add(E):b.add(E)}),c.forEach(E=>{g.push(E)}),{suggestedDependencies:g,unnecessaryDependencies:b,duplicateDependencies:f,missingDependencies:c}}function Ve(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 Ve(e.consequent)!=null||Ve(e.alternate)!=null?"conditional":null;case"LogicalExpression":return Ve(e.left)!=null||Ve(e.right)!=null?"logical expression":null;case"JSXFragment":return"JSX fragment";case"JSXElement":return"JSX element";case"AssignmentExpression":return Ve(e.right)!=null?"assignment expression":null;case"NewExpression":return"object construction";case"Literal":return e.value instanceof RegExp?"regular expression":null;case"TypeCastExpression":return Ve(e.expression);case"TSAsExpression":return Ve(e.expression)}return null}function xi({declaredDependencies:e,declaredDependenciesNode:t,componentScope:r,scope:n}){let s=e.map(({key:i})=>{let p=r.variables.find(c=>c.name===i);if(p==null)return null;let l=p.defs[0];if(l==null)return null;if(l.type==="Variable"&&l.node.type==="VariableDeclarator"&&l.node.id.type==="Identifier"&&l.node.init!=null){let c=Ve(l.node.init);if(c!=null)return[p,c]}return l.type==="FunctionName"&&l.node.type==="FunctionDeclaration"?[p,"function"]:l.type==="ClassName"&&l.node.type==="ClassDeclaration"?[p,"class"]:null}).filter(Boolean);function a(i){let p=!1;for(let l=0;l<i.references.length;l++){let c=i.references[l];if(c.writeExpr){if(p)return!0;p=!0;continue}let d=c.from;for(;d!==n&&d!=null;)d=d.upper;if(d!==n&&!Kn(t,c.identifier))return!0}return!1}return s.map(([i,p])=>({construction:i.defs[0],depType:p,isUsedOutsideOfHook:a(i)}))}function Zn(e){return(e.parent.type==="MemberExpression"||e.parent.type==="OptionalMemberExpression")&&e.parent.object===e&&e.parent.property.name!=="current"&&!e.parent.computed&&!(e.parent.parent!=null&&(e.parent.parent.type==="CallExpression"||e.parent.parent.type==="OptionalCallExpression")&&e.parent.parent.callee===e.parent)?Zn(e.parent):e.type==="MemberExpression"&&e.parent&&e.parent.type==="AssignmentExpression"&&e.parent.left===e?e.object:e}function Dt(e,t,r){t&&(e.optional?t.has(r)||t.set(r,!0):t.has(r)||t.set(r,!1))}function $e(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=$e(e.object,t),n=$e(e.property,null),s=`${r}.${n}`;return Dt(e,t,s),s}else if(e.type==="OptionalMemberExpression"&&!e.computed){let r=$e(e.object,t),n=$e(e.property,null),s=`${r}.${n}`;return Dt(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=$e(r.object,t),s=$e(r.property,null),a=`${n}.${s}`;return Dt(r,t,a),a}else throw new Error(`Unsupported node type: ${e.type}`)}function Gn(e,t){return e.type==="MemberExpression"&&e.object.type==="Identifier"&&e.object.name==="React"&&e.property.type==="Identifier"&&!e.computed?e.property:e}function Ci(e,t){let r=Gn(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=$e(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 jt(e,t){let r=[e],n=null;for(;r.length;){if(n=r.shift(),Ai(n,t))return n;if(Kn(n,t))for(let[s,a]of Object.entries(n))s!=="parent"&&(Yn(a)?(a.parent=n,r.push(a)):Array.isArray(a)&&a.forEach(i=>{Yn(i)&&(i.parent=n,r.push(i))}))}return null}function Ii(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 Yn(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&typeof e.type=="string"}function Ai(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 Kn(e,t){return e.range[0]<=t.range[0]&&e.range[1]>=t.range[1]}function wi(e){return!1}var pe=require("@typescript-eslint/utils"),B=Fe(require("typescript")),_t=require("zod/v4");var Lt=require("@typescript-eslint/utils");function Ke(e,t,r=1/0){if(r!==0&&e.parent)return e.type===t?e:Ke(e.parent,t,r===1/0?r:r-1)}function*Mt(e){yield e,e.parent&&(yield*Mt(e.parent))}function $t(e,t){for(let r of e){let n=t(r);if(n!=null&&n!==!1)return n}}function er(e,t,r){let s=r.getDeclaredVariables(e).find(a=>a.name===t||a.identifiers[0]?.parent.type===Lt.AST_NODE_TYPES.Property&&a.identifiers[0].parent.key.type===Lt.AST_NODE_TYPES.Identifier&&a.identifiers[0].parent.key.name===t);return s?s.references.filter(a=>!a.init):[]}function Qn(e){return e===null||typeof e!="object"||!("type"in e)?!1:typeof e.type=="string"}function Ri(e,t){return e[t]}function ke(e,t,r){let n=r.visitorKeys,s=new Set;function a(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 c of l){let d=Ri(i,c);if(d){if(Array.isArray(d)){for(let y of d)if(Qn(y)&&a(y))return!0}else if(Qn(d)&&a(d))return!0}}return!1}a(e)}var Pi=pe.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),tr="improved-no-unnecessary-condition",vi=_t.z.object({alternativeForInCondition:_t.z.string().optional().describe("Alternative to appear in the error for `in` condition")}),Fi=["string","number","bigint","boolean","symbol","undefined","object","function","never"],ki=new Set(Fi),Ut={name:tr,rule:Pi({name:tr,meta:{type:"suggestion",docs:{description:"Extends checks of `no-unnecessary-condition` rule"},messages:{unnecessaryTypeofCondition:'This condition is unnecessary. The type of "{{name}}" is always "{{type}}".',alwaysFalseTypeofCondition:'This condition will always be false. The type of "{{name}}" is "{{actualType}}" so the condition has no overlap with "{{conditionType}}".',unnecessaryStartsWithCondition:"This startsWith check is unnecessary as it always evaluates to true.",alwaysFalseStartsWithCondition:"This startsWith check will always be false.",unnecessaryEndsWithCondition:"This endsWith check is unnecessary as it always evaluates to true.",alwaysFalseEndsWithCondition:"This endsWith check will always be false.",unnecessaryIncludesCondition:"This includes check is unnecessary as it always evaluates to true.",alwaysFalseIncludesCondition:"This includes check will always be false.",unnecessaryLengthCondition:"This length comparison is unnecessary as it always evaluates to true.",alwaysFalseLengthCondition:"This length comparison will always be false.",unnecessaryInCondition:'This in check is unnecessary. Property "{{property}}" always exists on type "{{type}}".{{alternative}}',alwaysFalseInCondition:'This in check will always be false. Property "{{property}}" does not exist on type "{{type}}".{{alternative}}'},schema:[J(vi)]},defaultOptions:[{}],create(e,[t]){let r=pe.ESLintUtils.getParserServices(e,!0),n=r.program?.getTypeChecker();if(!n||!r.program)throw new Error("TypeScript services or program not available");function s(o){return o.type===pe.AST_NODE_TYPES.UnaryExpression&&o.operator==="typeof"}function a(o){return o.flags&B.default.TypeFlags.Any||o.flags&B.default.TypeFlags.Unknown?null:o.flags&B.default.TypeFlags.StringLike?["string"]:o.flags&B.default.TypeFlags.NumberLike?["number"]:o.flags&B.default.TypeFlags.BigIntLike?["bigint"]:o.flags&B.default.TypeFlags.BooleanLike?["boolean"]:o.flags&B.default.TypeFlags.ESSymbolLike?["symbol"]:o.flags&B.default.TypeFlags.Undefined||o.flags&B.default.TypeFlags.Void?["undefined"]:o.flags&B.default.TypeFlags.Null?["object"]:o.getCallSignatures().length>0?["function"]:o.flags&B.default.TypeFlags.Object?o.getProperties().length===0?["string","number","bigint","boolean","symbol","object","function"]:["object"]:o.flags&B.default.TypeFlags.NonPrimitive?["object"]:o.flags&B.default.TypeFlags.Never?["never"]:null}function i(o){if(!n)return null;let S=r.esTreeNodeToTSNodeMap.get(o),u=n.getTypeAtLocation(S.expression);if(u.flags&B.default.TypeFlags.Any||u.flags&B.default.TypeFlags.Unknown)return null;let T=[];if(u.isUnion()){for(let R of u.types){let v=a(R);if(v)T.push(...v);else return null}return T}let w=a(u);return w?(T.push(...w),T):null}function p(o){if(!(o.operator==="==="||o.operator==="!=="))return;let u=null,T=null;if(s(o.left)?(u=o.left,T=o.right.type===pe.AST_NODE_TYPES.Literal&&typeof o.right.value=="string"?o.right.value:null):s(o.right)&&(u=o.right,T=o.left.type===pe.AST_NODE_TYPES.Literal&&typeof o.left.value=="string"?o.left.value:null),!u||!T||!Oi(T,ki))return;let w=i(u);if(!w)return;let R=o.operator==="!==",v=w.includes(T);w.length===1?v&&!R?e.report({node:o,messageId:"unnecessaryTypeofCondition",data:{name:Qe(u,e),type:T}}):!v&&R?e.report({node:o,messageId:"unnecessaryTypeofCondition",data:{name:Qe(u,e),type:Array.from(w)[0]}}):!v&&!R?e.report({node:o,messageId:"alwaysFalseTypeofCondition",data:{name:Qe(u,e),actualType:mt(w),conditionType:T}}):v&&R&&e.report({node:o,messageId:"alwaysFalseTypeofCondition",data:{name:Qe(u,e),actualType:mt(w),conditionType:T}}):!v&&!R?e.report({node:o,messageId:"alwaysFalseTypeofCondition",data:{name:Qe(u,e),actualType:mt(w),conditionType:T}}):!v&&R&&e.report({node:o,messageId:"unnecessaryTypeofCondition",data:{name:Qe(u,e),type:mt(w)}})}function l(o){if(o.flags&B.default.TypeFlags.Any||o.flags&B.default.TypeFlags.Unknown)return null;if(o.isUnion()){let S=[];for(let u of o.types)if(u.flags&B.default.TypeFlags.StringLiteral){let T=u.value;S.push(T)}else return null;return S}return o.flags&B.default.TypeFlags.StringLiteral?[o.value]:null}function c(o){if(!n)return null;let S=r.esTreeNodeToTSNodeMap.get(o),u=n.getTypeAtLocation(S),T=l(u);if(T)return T;let w=n.getSymbolAtLocation(S);if(w){let R=n.getTypeOfSymbolAtLocation(w,S),v=l(R);if(v)return v}return null}function d(o){let S=e.sourceCode.ast,u=null;return ke(S,T=>{if(T.type===pe.AST_NODE_TYPES.VariableDeclarator&&T.id.type===pe.AST_NODE_TYPES.Identifier&&T.id.name===o.name&&T.id.typeAnnotation){let w=T.id.typeAnnotation.typeAnnotation;if(w.type===pe.AST_NODE_TYPES.TSUnionType){let R=[];for(let v of w.types)if(v.type===pe.AST_NODE_TYPES.TSLiteralType&&v.literal.type===pe.AST_NODE_TYPES.Literal&&typeof v.literal.value=="string")R.push(v.literal.value);else return!0;return u=R,!0}if(w.type===pe.AST_NODE_TYPES.TSLiteralType&&w.literal.type===pe.AST_NODE_TYPES.Literal&&typeof w.literal.value=="string")return u=[w.literal.value],!0}return!1},e.sourceCode),u}function y(o){if(o.callee.type!==pe.AST_NODE_TYPES.MemberExpression||o.callee.property.type!==pe.AST_NODE_TYPES.Identifier||o.callee.computed)return;let S=o.callee.property.name;if(S!=="startsWith"&&S!=="endsWith"&&S!=="includes"||o.arguments.length!==1)return;let[u]=o.arguments;if(!u||u.type!==pe.AST_NODE_TYPES.Literal||typeof u.value!="string")return;let T=o.callee.object,w=c(T);if(!w&&T.type===pe.AST_NODE_TYPES.Identifier&&(w=d(T)),!w||w.length===0)return;let R=u.value;if(S==="includes"&&w.length>1)return;let v=0,x=0;for(let C of w)if((S==="startsWith"?C.startsWith(R):S==="endsWith"?C.endsWith(R):C.includes(R))?v++:x++,v>0&&x>0)return;if(v>0&&x===0){let C=S==="startsWith"?"unnecessaryStartsWithCondition":S==="endsWith"?"unnecessaryEndsWithCondition":"unnecessaryIncludesCondition";e.report({node:o,messageId:C})}else if(x>0&&v===0){let C=S==="startsWith"?"alwaysFalseStartsWithCondition":S==="endsWith"?"alwaysFalseEndsWithCondition":"alwaysFalseIncludesCondition";e.report({node:o,messageId:C})}}function g(o){if(!new Set(["===","!==",">",">=","<","<="]).has(o.operator))return;function u(F){if(F.type!==pe.AST_NODE_TYPES.MemberExpression||F.computed||F.property.type!==pe.AST_NODE_TYPES.Identifier||F.property.name!=="length")return null;let O=F.object,Q=c(O);if(!Q||Q.length===0)return null;let z=[];for(let re of Q)z.push(re.length);return{values:z}}let T=u(o.left),w=u(o.right),R=null,v=null;if(T?o.right.type===pe.AST_NODE_TYPES.Literal&&typeof o.right.value=="number"&&(R=T.values,v=o.right.value):w&&o.left.type===pe.AST_NODE_TYPES.Literal&&typeof o.left.value=="number"&&(R=w.values,v=o.left.value),!R||v===null)return;let x=0,C=0;for(let F of R){let O=!1;if(o.operator==="==="?O=F===v:o.operator==="!=="?O=F!==v:o.operator===">"?O=F>v:o.operator===">="?O=F>=v:o.operator==="<"?O=F<v:o.operator==="<="&&(O=F<=v),O?x++:C++,x>0&&C>0)return}x>0&&C===0?e.report({node:o,messageId:"unnecessaryLengthCondition"}):C>0&&x===0&&e.report({node:o,messageId:"alwaysFalseLengthCondition"})}function b(o){if(o.type===pe.AST_NODE_TYPES.Literal&&typeof o.value=="string")return o.value;let S=c(o);if(!S||S.length!==1)return null;let[u]=S;return u??null}function f(o){return(o.flags&B.default.TypeFlags.Intersection)!==0}function E(o){return(o.flags&B.default.TypeFlags.Object)!==0}function h(o){return!n||n.getIndexTypeOfType(o,B.default.IndexKind.String)?!0:!!n.getIndexTypeOfType(o,B.default.IndexKind.Number)}function m(o,S){if(!n||h(o)||o.getProperties().length===0)return"unknown";let u=n.getPropertyOfType(o,S);return u?u.flags&B.default.SymbolFlags.Optional?"optional":"required":"absent"}function A(o,S){if(o.flags&B.default.TypeFlags.Any||o.flags&B.default.TypeFlags.Unknown||o.flags&B.default.TypeFlags.Never||o.flags&B.default.TypeFlags.TypeParameter||o.flags&B.default.TypeFlags.IndexedAccess||o.flags&B.default.TypeFlags.StringLike||o.flags&B.default.TypeFlags.NumberLike||o.flags&B.default.TypeFlags.BigIntLike||o.flags&B.default.TypeFlags.BooleanLike||o.flags&B.default.TypeFlags.EnumLike||o.flags&B.default.TypeFlags.ESSymbolLike||o.flags&B.default.TypeFlags.NonPrimitive||o.flags&B.default.TypeFlags.Null||o.flags&B.default.TypeFlags.Undefined||o.flags&B.default.TypeFlags.Void)return"unknown";if(o.isUnion()){let u=!0,T=!0;for(let w of o.types){let R=A(w,S);if(R==="unknown"||(R!=="required"&&(u=!1),R!=="absent"&&(T=!1),R==="optional"))return"unknown"}return u?"required":T?"absent":"unknown"}if(f(o)){let u=o,T=!1,w=!1;for(let R of u.types){let v=A(R,S);if(v==="unknown")return"unknown";v==="required"?T=!0:v==="optional"&&(w=!0)}return T?"required":w?"optional":"absent"}return E(o)?m(o,S):"unknown"}function I(o){if(o.operator!=="in"||o.left.type===pe.AST_NODE_TYPES.PrivateIdentifier)return;let S=b(o.left);if(!S)return;let u=o.right,T=r.esTreeNodeToTSNodeMap.get(u);if(!n)return;let w=n.getTypeAtLocation(T),R=A(w,S);R==="required"?e.report({node:o,messageId:"unnecessaryInCondition",data:{property:S,type:n.typeToString(w),alternative:t.alternativeForInCondition?`If this a valid condition, you can use as alternative: ${t.alternativeForInCondition}`:""}}):R==="absent"&&e.report({node:o,messageId:"alwaysFalseInCondition",data:{property:S,type:n.typeToString(w),alternative:t.alternativeForInCondition?`If this a valid condition, you can use as alternative: ${t.alternativeForInCondition}`:""}})}return{BinaryExpression(o){p(o),g(o),I(o)},CallExpression:y}}})};function mt(e){return Array.from(new Set(e)).join(" | ")||"never"}function Qe(e,t){let r=e.argument;return r.type===pe.AST_NODE_TYPES.Identifier?r.name:t.sourceCode.getText(r)}function Oi(e,t){return t.has(e)}var yt=require("@typescript-eslint/utils"),dt=require("zod/v4");var Ni=yt.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),nr="no-call-with-explicit-generics",Di=dt.z.object({functions:dt.z.array(dt.z.string())}),ji=Ni({name:nr,meta:{type:"problem",docs:{description:"Enforce calling configured functions with inferred generics only"},messages:{noExplicitGenerics:"Function '{{ functionName }}' should be called with inferred generics (remove the explicit type parameters)"},schema:[J(Di)]},defaultOptions:[{functions:[]}],create(e,[t]){let r=new Set(t.functions);return{CallExpression(n){let{callee:s}=n;s.type===yt.AST_NODE_TYPES.Identifier&&r.has(s.name)&&n.typeArguments&&e.report({node:n,messageId:"noExplicitGenerics",data:{functionName:s.name}})}}}}),zt={name:nr,rule:ji};var He=require("@typescript-eslint/utils"),Li=He.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),rr="no-call-with-inferred-generics",Mi=Li({name:rr,meta:{type:"problem",docs:{description:"Disable calling configured functions with infered generics"},messages:{missingGenericDeclaration:"Function '{{ functionName }}' should be called with at least {{ minGenerics }} generic(s) (ex: `fn<Generic>()`) defined",anyUsedInGenerics:"Function '{{ functionName }}' should not be called with 'any' in generics"},schema:[{type:"object",properties:{functions:{type:"array",items:{type:"object",properties:{name:{type:"string"},minGenerics:{type:"number"},allowAny:{type:"boolean"},disallowTypes:{type:"array",items:{type:"string"}}},required:["name"]}},anyAliases:{type:"array",items:{type:"string"}}},required:["functions"]}]},defaultOptions:[{functions:[]}],create(e,[t]){let r=new Map(t.functions.map(n=>[n.name,n]));return{CallExpression(n){let{callee:s}=n;if(s.type!==He.AST_NODE_TYPES.Identifier)return;let a=r.get(s.name);if(!a)return;let{minGenerics:i=1,allowAny:p,disallowTypes:l=t.disallowTypes}=a;(n.typeArguments?.params.length||0)<(i||0)&&e.report({node:n,messageId:"missingGenericDeclaration",data:{functionName:s.name,minGenerics:i||0}}),!(p&&!l)&&n.typeArguments?.params.some(d=>!p&&d.type===He.AST_NODE_TYPES.TSAnyKeyword||l&&d.type===He.AST_NODE_TYPES.TSTypeReference&&d.typeName.type===He.AST_NODE_TYPES.Identifier&&l.includes(d.typeName.name))&&e.report({node:n,messageId:"anyUsedInGenerics",data:{functionName:s.name}})}}}}),Wt={name:rr,rule:Mi};var sr=require("@typescript-eslint/utils"),$i=sr.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),ar="no-commented-out-code",_i=["function ","class ","interface ","type ","enum ","namespace ","import ","export ","const ","let ","var ","return ","throw ","break","continue","try {","catch (","finally {","async ","await ","case ","switch (","while (","for (","default:"],Ui=/^\s*return\s+/,zi=/\w=("|'|`)/,Wi=/\w+:\s*('|"|`)/,Ji=/\[['"][^'"]*['"]\]:\s*('|"|`|[^'"`\s])/,Vi=/\w+-\w+:/,Xi=/\w+_\w+:/,Bi=/\?\s+\w/,Hi=/:\s+\w/,Yi=/^\s*('|"|`)[^'"]*('|"|`),?\s*$/,qi=/^\s*\d+[,}]/,Zi=/^\s*\[[^\]]*\][,}]/,Gi=/^\s*\{[^}]*\}[,}]/,Ki=/\.\w+\(/,Qi=/\[\w+\]/,eo=/^\s*(['"`]).+?\1\s*:/,to=/^<[A-Z]\w*(\s|>|\/)/,no=/^<[a-z]+(\s|>|\/)/,ro=/<[A-Z]\w*(\s.*)?>/,io=/<\/[A-Z]\w*>/,oo=/<[a-z]+(\s.*)?>/,so=/<\/[a-z]+>/,ao=/^\s*[*\s]*$/,lo=/^[a-zA-Z]/,po=/^[A-Z][A-Za-z]*(?:\s+\d+)?(?:\s+[a-z]+)*:\s+[A-Za-z]/,co=/```[\s\S]*?```/g,uo=/`[^`]*`/g,ir=/[a-zA-Z0-9]/,fo=/\.[A-Za-z_][A-Za-z0-9_]*\(/,mo=/[{}[\]()`=<>]/,yo=/:\s*(['"`[{(]|\w+\s*=>)/,go=/\bif\s*\(|\belse\b|=>/,fe={returnStatement:Ui,stringAssignment:zi,objectPropertyWithQuotes:Wi,computedPropertyAssignment:Ji,kebabCaseProperty:Vi,snakeCaseProperty:Xi,ternaryOperator:Bi,colonWithWord:Hi,quotedString:Yi,numberWithComma:qi,arrayWithComma:Zi,objectWithComma:Gi,methodCall:Ki,arrayAccess:Qi,quotedPropertyKey:eo,jsxSelfClosing:to,jsxElement:no,jsxOpeningTag:ro,jsxClosingTag:io,htmlOpeningTag:oo,htmlClosingTag:so,jsdocComment:ao};function So(e){if(e.includes(":")){let r=e.split(":")[0]?.trim();if(r&&lo.test(r)&&r.includes(" "))return!0}let t=e.trim();return t.length===0||fo.test(t)||mo.test(t)||yo.test(t)||go.test(t)?!1:!!(t.includes(":")&&po.test(t))}var To=[") {","return;",fe.returnStatement,"if (","else {","else if (","/>","</","< ","},",": {"," } = ","={",fe.stringAssignment,");",fe.objectPropertyWithQuotes,fe.computedPropertyAssignment,fe.kebabCaseProperty,fe.snakeCaseProperty,"&&","||","()",fe.ternaryOperator,fe.colonWithWord,fe.quotedString,fe.numberWithComma,fe.arrayWithComma,fe.objectWithComma,fe.methodCall,fe.arrayAccess,"?.(","??","=>",fe.quotedPropertyKey],ho=["/>","</",fe.jsxSelfClosing,fe.jsxElement,fe.jsxOpeningTag,fe.jsxClosingTag,fe.htmlOpeningTag,fe.htmlClosingTag],or=["INFO:","TODO:","DOCS:","FIX:","FIXME:","HACK:","NOTE:","WARNING:","WARN:","BUG:","ISSUE:","TEMP:","TEMPORARY:","XXX:","REVIEW:","eslint"],Eo=$i({name:ar,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 a=n.trimStart();if(n.startsWith("*")||a.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")||fe.jsdocComment.test(n))return!1;for(let i of or)if(a.startsWith(i))return!1;if(n.includes("https://")||So(a))return!1;if(s==="Block"){for(let i of ho)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 _i)if(a.startsWith(i))return{wrongPattern:i};for(let i of To)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 a=n,i=a.trim();if(i.startsWith("`")&&(i.endsWith("`,")||i.endsWith("`;")||i.endsWith("`")))return a;if(s==="Block"&&a.includes("```")){let c=a.split(co);c.some(y=>ir.test(y))&&(a=c.join(""))}if(!a.includes("`"))return a;let p=a.split(uo);return p.some(c=>ir.test(c))?p.join(""):a}return{Program(){let s=e.sourceCode.getAllComments();for(let a of s){let i=r(a.value,a.type),p=t(i,a.type);p&&e.report({node:a,messageId:"commentedOutCode",data:{wrongPattern:p.wrongPattern,allowedPrefixes:or.join(", ")}})}}}}}),Jt={name:ar,rule:Eo};var gt=require("@typescript-eslint/utils"),bo=gt.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),lr="no-default-export",xo=bo({name:lr,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===gt.TSESTree.AST_NODE_TYPES.Identifier&&r.exported.name==="default"&&e.report({node:t,messageId:"noDefaultExport"})}}}}),Vt={name:lr,rule:xo};var pr=require("@typescript-eslint/utils"),Co=pr.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),cr="no-leaked-text-in-jsx",Io=[",",";","[","]","(",")"],Ao=Co({name:cr,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="";Io.includes(r)?n=r:r.includes("&&")?n="&&":r.includes("||")?n="||":r.endsWith("? (")&&(n="? ("),n&&e.report({node:t,messageId:"leakedTextInJSX",data:{text:n}})}}}}),Xt={name:cr,rule:Ao};var Xe=require("@typescript-eslint/utils"),wo=Xe.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),fr="no-non-camel-case-functions",Ro=/^(\$?[a-z][a-zA-Z0-9]*)$/;function ur(e){if(e.typeName.type!==Xe.AST_NODE_TYPES.TSQualifiedName)return!1;let{left:t,right:r}=e.typeName;return t.type===Xe.AST_NODE_TYPES.Identifier&&t.name==="JSX"&&r.name==="Element"}var Po=wo({name:fr,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&&!Ro.test(t.id.name)){let r=t.returnType?.typeAnnotation;if(r&&(r.type===Xe.AST_NODE_TYPES.TSTypeReference?ur(r):r.type===Xe.AST_NODE_TYPES.TSUnionType&&r.types.some(s=>s.type===Xe.AST_NODE_TYPES.TSTypeReference&&ur(s))))return;e.report({node:t.id,messageId:"nonCamelCaseFunction",data:{functionName:t.id.name}})}}}}}),Bt={name:fr,rule:Po};var ie=require("@typescript-eslint/utils");var vo=ie.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),mr="no-optional-root-props",Fo=vo({name:mr,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 a=e.sourceCode.getDeclaredVariables(n)[0];if(!a||a.references.length!==1)return!1;let i=a.references[0];if(!i)return!1;for(let p of Mt(i.identifier)){if("returnType"in p||p.type===ie.TSESTree.AST_NODE_TYPES.ExportNamedDeclaration)return!1;let l=p.parent;if(!l)return!1;if(l.type===ie.TSESTree.AST_NODE_TYPES.TSTypeParameterInstantiation&&l.parent.type===ie.TSESTree.AST_NODE_TYPES.TSTypeReference&&l.parent.typeName.type===ie.TSESTree.AST_NODE_TYPES.Identifier&&l.parent.typeName.name==="FC"){let d=Ke(l.parent.parent,ie.TSESTree.AST_NODE_TYPES.VariableDeclaration,4);if(!d)return!1;let y=St(d,e.sourceCode);return y?!(y.parent.type===ie.TSESTree.AST_NODE_TYPES.CallExpression&&y.parent.callee.type===ie.TSESTree.AST_NODE_TYPES.Identifier&&y.parent.callee.name==="memo"):!1}if(p.type===ie.TSESTree.AST_NODE_TYPES.AssignmentPattern)return!1;if(l.type===ie.TSESTree.AST_NODE_TYPES.ArrowFunctionExpression){let c=Ke(l,ie.TSESTree.AST_NODE_TYPES.VariableDeclaration);return c?!!St(c,e.sourceCode):!1}if(l.type===ie.TSESTree.AST_NODE_TYPES.FunctionDeclaration)return!!St(l,e.sourceCode)}return!1}function r(n){n.key.type!==ie.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 a=Ke(n,ie.TSESTree.AST_NODE_TYPES.TSPropertySignature);if(!a)return null;let i=e.sourceCode.getText(a);return s.replaceText(a,i.replace("?:",": undefined |"))}}]})}return{TSTypeAliasDeclaration(n){if(n.typeAnnotation.type===ie.TSESTree.AST_NODE_TYPES.TSTypeLiteral&&!(Tt(n)||!t(n)))for(let s of n.typeAnnotation.members)s.type===ie.TSESTree.AST_NODE_TYPES.TSPropertySignature&&r(s)},TSInterfaceDeclaration(n){if(!(Tt(n)||!t(n)))for(let s of n.body.body)s.type===ie.TSESTree.AST_NODE_TYPES.TSPropertySignature&&r(s)},TSTypeReference(n){if(n.typeName.type!==ie.TSESTree.AST_NODE_TYPES.Identifier||n.typeName.name!=="FC"||!n.typeArguments?.params[0])return;let s=n.typeArguments.params[0];if(s.type!==ie.TSESTree.AST_NODE_TYPES.TSTypeLiteral)return;let a=Ke(n.parent,ie.TSESTree.AST_NODE_TYPES.VariableDeclaration,4);if(!a)return;let i=St(a,e.sourceCode);if(!(!i||i.parent.type===ie.TSESTree.AST_NODE_TYPES.CallExpression&&i.parent.callee.type===ie.TSESTree.AST_NODE_TYPES.Identifier&&i.parent.callee.name==="memo"))for(let l of s.members)l.type===ie.TSESTree.AST_NODE_TYPES.TSPropertySignature&&r(l)}}}});function Tt(e){return e?e.parent?.type===ie.TSESTree.AST_NODE_TYPES.ExportNamedDeclaration||e.parent?.type===ie.TSESTree.AST_NODE_TYPES.ExportDefaultDeclaration:!1}function St(e,t){if(Tt(e))return;let r;if(e.type===ie.TSESTree.AST_NODE_TYPES.VariableDeclaration){if(e.declarations.length!==1)return;e.declarations[0].id.type===ie.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===ie.TSESTree.AST_NODE_TYPES.FunctionDeclaration&&n.upper&&(n=n.upper);let s=n.variables.find(i=>i.identifiers.includes(r));if(!s)return;let a=s.references.filter(i=>i.identifier!==r);if(!(a.length!==1||!a[0])&&!Tt(a[0].identifier.parent.parent))return a[0].identifier}var Ht={name:mr,rule:Fo};var ot=require("@typescript-eslint/utils");var st=X({name:"no-reexport",meta:{type:"problem",docs:{description:"Disallow re-exports to prevent indirection"},schema:[],messages:{noReexport:"Re-exports are not allowed. Use direct exports only."}},defaultOptions:[],create(e){let t=new Set;function r(n){return n?n.type===ot.AST_NODE_TYPES.Identifier?t.has(n.name):n.type===ot.AST_NODE_TYPES.MemberExpression?r(n.object):!1:!1}return{ImportDeclaration(n){for(let s of n.specifiers)t.add(s.local.name)},ExportNamedDeclaration(n){if(n.source){e.report({node:n,messageId:"noReexport"});return}if(n.declaration?.type===ot.AST_NODE_TYPES.VariableDeclaration)for(let s of n.declaration.declarations)r(s.init)&&e.report({node:n,messageId:"noReexport"});n.specifiers.length>0&&e.report({node:n,messageId:"noReexport"})},ExportDefaultDeclaration(n){n.declaration.type===ot.AST_NODE_TYPES.Identifier&&t.has(n.declaration.name)&&e.report({node:n,messageId:"noReexport"})},ExportAllDeclaration(n){e.report({node:n,messageId:"noReexport"})}}}});var dr=require("@typescript-eslint/utils"),ht=Fe(require("path")),_e=require("zod/v4");var ko=dr.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),yr="no-relative-imports",Oo=_e.z.object({find:_e.z.string(),replacement:_e.z.string()}),No=_e.z.object({aliases:_e.z.array(Oo),rootDir:_e.z.string().optional(),allowNotFoundAliases:_e.z.boolean().optional(),_dev_simulateFileName:_e.z.string().optional()}),Do=ko({name:yr,meta:{type:"problem",fixable:"code",docs:{description:"Prevent relative imports and auto-fix them using configured aliases"},messages:{noRelativeImports:"Relative imports are not allowed. Use one of the valid aliases in tsconfig.json instead.",noRelativeImportsWithAlias:'Relative imports are not allowed. Use the "{{ alias }}" alias instead.'},schema:[J(No)]},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,p){let l=ht.default.dirname(p);return ht.default.resolve(l,i)}function a(i){let p=t.rootDir??process.cwd(),l=ht.default.relative(p,i);if(l.startsWith("."))return null;l.startsWith("/")||(l=`/${l}`);for(let{find:c,replacement:d}of t.aliases)if(l.startsWith(d)){let y=l.replace(d,c);return{alias:c,newPath:y}}return null}return{ImportDeclaration(i){let p=i.source.value;if(!n(p))return;let l=s(p,r),c=a(l);!c&&t.allowNotFoundAliases||e.report({node:i,messageId:c?"noRelativeImportsWithAlias":"noRelativeImports",data:{alias:c?.alias},fix:c?d=>d.replaceText(i.source,`'${c.newPath}'`):void 0})}}}}),Yt={name:yr,rule:Do};var me=require("@typescript-eslint/utils"),qt=require("zod/v4");var jo=qt.z.object({customMessage:qt.z.string().optional()}),Zt=X({name:"no-static-style-prop",meta:{type:"problem",docs:{description:"Prevent using static style props in JSX, only dynamic values should be allowed"},schema:[J(jo)],messages:{noStaticStyleProp:"Static style props are not allowed use css instead.{{customMessage}}"}},defaultOptions:[{}],create(e,[t]){function r(n){switch(n.type){case me.AST_NODE_TYPES.Literal:return!0;case me.AST_NODE_TYPES.ObjectExpression:return n.properties.every(s=>s.type===me.AST_NODE_TYPES.Property?s.computed||s.value.type===me.AST_NODE_TYPES.Identifier&&s.key.type===me.AST_NODE_TYPES.Identifier&&s.key.name===s.value.name?!1:r(s.value):!1);case me.AST_NODE_TYPES.ArrayExpression:return n.elements.every(s=>s?s.type===me.AST_NODE_TYPES.SpreadElement?!1:r(s):!0);case me.AST_NODE_TYPES.TemplateLiteral:return n.expressions.length===0;case me.AST_NODE_TYPES.ConditionalExpression:case me.AST_NODE_TYPES.LogicalExpression:case me.AST_NODE_TYPES.BinaryExpression:case me.AST_NODE_TYPES.UnaryExpression:case me.AST_NODE_TYPES.CallExpression:case me.AST_NODE_TYPES.MemberExpression:case me.AST_NODE_TYPES.Identifier:case me.AST_NODE_TYPES.ArrowFunctionExpression:case me.AST_NODE_TYPES.FunctionExpression:return!1;default:return!1}}return{JSXAttribute(n){if(n.name.type===me.AST_NODE_TYPES.JSXIdentifier&&n.name.name==="style"&&n.value){let s=null;n.value.type===me.AST_NODE_TYPES.JSXExpressionContainer?n.value.expression.type!==me.AST_NODE_TYPES.JSXEmptyExpression&&(s=n.value.expression):n.value.type===me.AST_NODE_TYPES.Literal&&(s=n.value),s&&r(s)&&e.report({node:n,messageId:"noStaticStyleProp",data:{customMessage:t.customMessage?` ${t.customMessage}`:""}})}}}}});var at=require("@typescript-eslint/utils"),Ye=Fe(require("zod/v4"));var Lo=Ye.object({alternativeMsgs:Ye.object({inArrayFind:Ye.string().optional(),inArrayFilter:Ye.string().optional()}).optional(),__dev_simulateFileName:Ye.string().optional()});function Mo(e){return e.typeAnnotation.type!==at.AST_NODE_TYPES.TSTypePredicate?!1:e.typeAnnotation.asserts===!1}var $o=/(typeGuards|type-guards)\.(ts|tsx)$/;function _o(e){return $o.test(e)}function Uo(e){let t=e.parent;for(;t;){if(t.type===at.AST_NODE_TYPES.CallExpression&&t.callee.type===at.AST_NODE_TYPES.MemberExpression&&t.callee.property.type===at.AST_NODE_TYPES.Identifier){let r=t.callee.property.name;if(r==="filter"||r==="find")return{method:r}}t=t.parent}return null}var Gt=X({name:"no-type-guards",meta:{type:"problem",docs:{description:"Disallow type guards unless in *.typeGuards.(ts|tsx) or *.type-guards.(ts|tsx) files"},messages:{typeGuardNotAllowed:"Check if the type guard can be inferred by typescript, in most cases it can, e.g. `.filter((nullable) => nullable !== null)`. If not, type guards are only allowed in *.typeGuards.(ts|tsx) or *.type-guards.(ts|tsx) files",useFilterWithTypeCheck:"{{message}}",useFindWithTypeCheck:"{{message}}"},schema:[J(Lo)],hasSuggestions:!0},defaultOptions:[{}],create(e,[t]){let r=t.__dev_simulateFileName??e.filename;if(_o(r))return{};function n(s){if(!Mo(s))return;let a=Uo(s);if(t.alternativeMsgs&&a){let i=a.method==="filter"?t.alternativeMsgs.inArrayFilter:t.alternativeMsgs.inArrayFind;if(i){let p=a.method==="filter"?"useFilterWithTypeCheck":"useFindWithTypeCheck";e.report({node:s,messageId:p,data:{message:i}});return}}e.report({node:s,messageId:"typeGuardNotAllowed"})}return{"FunctionDeclaration > :matches(TSTypeAnnotation)":n,"ArrowFunctionExpression > :matches(TSTypeAnnotation)":n,"MethodDefinition > FunctionExpression > :matches(TSTypeAnnotation)":n}}});var qe=require("@typescript-eslint/utils");var zo="no-unnecessary-async-on-jsx-props";function Wo(e){if(e.body.type!==qe.AST_NODE_TYPES.BlockStatement)return!1;let t=e.body.body;if(t.length!==1)return!1;let r=t[0];return!r||r.type!==qe.AST_NODE_TYPES.ExpressionStatement?!1:r.expression.type===qe.AST_NODE_TYPES.AwaitExpression}var Kt=X({name:zo,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){Wo(r)&&e.report({node:r,messageId:"unnecessaryAsyncInJsxProp",fix(n){let s=e.sourceCode,a=[],i=s.getFirstToken(r,l=>l.value==="async");if(i){let l=s.getTokenAfter(i);l?a.push(n.replaceTextRange([i.range[0],l.range[0]],"")):a.push(n.remove(i))}function p(l){if(l.type===qe.AST_NODE_TYPES.AwaitExpression){let c=s.getFirstToken(l);if(c&&c.value==="await"){let d=s.getTokenAfter(c);d?a.push(n.replaceTextRange([c.range[0],d.range[0]],"")):a.push(n.remove(c))}}if(l.type===qe.AST_NODE_TYPES.BlockStatement)for(let c of l.body)p(c);else l.type===qe.AST_NODE_TYPES.ExpressionStatement&&p(l.expression)}return p(r.body),a}})}return{"JSXAttribute ArrowFunctionExpression[async=true]":t,"JSXAttribute FunctionExpression[async=true]":t}}});var Ue=require("@typescript-eslint/utils"),Qt=Fe(require("typescript")),et=Fe(require("zod/v4"));var Jo=Ue.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),gr="no-unnecessary-casting",Vo=et.default.object({additionalCastFunctions:et.default.array(et.default.object({name:et.default.string(),expectedType:et.default.enum(["string","number"])})).optional()}),en={name:gr,rule:Jo({name:gr,meta:{type:"suggestion",docs:{description:"Prevents unnecessary Number and String castings"},messages:{unnecessaryNumberCasting:"Unnecessary Number() casting on a value already of number type",unnecessaryStringCasting:"Unnecessary String() casting on a value already of string type",unnecessaryCustomCasting:"Unnecessary {{name}}() casting on a value already of {{type}} type"},schema:[J(Vo)],fixable:"code"},defaultOptions:[{}],create(e){let r=e.options[0].additionalCastFunctions||[],n=[{name:"Number",expectedType:"number"},{name:"String",expectedType:"string"},...r],s=Ue.ESLintUtils.getParserServices(e,!0),a=s.program?.getTypeChecker();if(!a||!s.program)throw new Error("TypeScript services or program not available");function i(d,y){switch(d.type){case Ue.AST_NODE_TYPES.Literal:return y==="number"?typeof d.value=="number":typeof d.value=="string";case Ue.AST_NODE_TYPES.TemplateLiteral:return y==="string";case Ue.AST_NODE_TYPES.UnaryExpression:return y==="number"?d.operator==="+"||d.operator==="-"||d.operator==="~":!1;default:return!1}}function p(d,y){return y==="number"?!!(d.flags&Qt.TypeFlags.NumberLike):!!(d.flags&Qt.TypeFlags.StringLike)}function l(d,y){return g=>g.replaceText(d,e.sourceCode.getText(y))}function c(d){if(!a||d.arguments.length!==1)return;let y=d.arguments[0];if(!y||y.type===Ue.AST_NODE_TYPES.SpreadElement)return;let{callee:g}=d;if(g.type!==Ue.AST_NODE_TYPES.Identifier)return;let b=g.name,f=n.find(h=>h.name===b);if(!f)return;if(i(y,f.expectedType)||p(a.getTypeAtLocation(s.esTreeNodeToTSNodeMap.get(y)),f.expectedType)){let h,m;b==="Number"?h="unnecessaryNumberCasting":b==="String"?h="unnecessaryStringCasting":(h="unnecessaryCustomCasting",m={name:f.name,type:f.expectedType}),e.report({node:d,messageId:h,...m?{data:m}:{},fix:l(d,y)})}}return{CallExpression:c}}})};var Ie=require("@typescript-eslint/utils"),Et=Fe(require("zod/v4"));var Xo=Et.object({ignoreWithDescription:Et.string().optional()}),tn=X({name:"no-unnecessary-describe",meta:{type:"suggestion",docs:{description:"Disallow unnecessary describe blocks that wrap all tests in a file"},messages:{unnecessaryDescribe:"Describe blocks that solely wrap all tests in the file are unnecessary, they just add unnecessary nesting to the code. The file itself should be enough to group tests. Remove it.",removeDescribe:"Remove the describe block"},hasSuggestions:!0,schema:[J(Xo)]},defaultOptions:[{}],create(e,[t]){let r=e.getSourceCode(),n=r.ast;function s(l){let c=l.arguments[0];return c&&c.type===Ie.AST_NODE_TYPES.Literal&&typeof c.value=="string"?c.value:null}function a(l){return!l||!t.ignoreWithDescription?!1:new RegExp(t.ignoreWithDescription).test(l)}function i(l){return l.length!==1?!1:n.body.filter(d=>{if(d.type===Ie.AST_NODE_TYPES.ExpressionStatement){let y=d.expression;if(y.type===Ie.AST_NODE_TYPES.CallExpression&&y.callee.type===Ie.AST_NODE_TYPES.Identifier){let g=y.callee.name;return["test","it","beforeEach","afterEach","beforeAll","afterAll"].includes(g)}}return!1}).length===0}function p(l){let c=l.arguments[1];if(c&&(c.type===Ie.AST_NODE_TYPES.FunctionExpression||c.type===Ie.AST_NODE_TYPES.ArrowFunctionExpression)&&c.body.type===Ie.AST_NODE_TYPES.BlockStatement){let d=c.body.body;return d.length===0?"":d.map(g=>r.text.slice(g.range[0],g.range[1])).join(`
|
|
16
16
|
|
|
17
|
-
`)}return""}return{Program(){let l=[];for(let g of n.body)g.type===be.AST_NODE_TYPES.ExpressionStatement&&g.expression.type===be.AST_NODE_TYPES.CallExpression&&g.expression.callee.type===be.AST_NODE_TYPES.Identifier&&g.expression.callee.name==="describe"&&g.expression.arguments.length===2&&l.push(g.expression);if(!i(l))return;let[c]=l;if(!c)return;let d=s(c);if(a(d))return;let y=n.body.find(g=>g.type===be.AST_NODE_TYPES.ExpressionStatement&&g.expression===c);!y||y.type!==be.AST_NODE_TYPES.ExpressionStatement||e.report({node:c,messageId:"unnecessaryDescribe",suggest:[{messageId:"removeDescribe",fix(g){let b=p(c);return b?g.replaceText(y,b):null}}]})}}}});var at=require("@typescript-eslint/utils"),De=ke(require("zod/v4"));var Bo=De.object({methods:De.union([De.array(De.string()),De.literal("array")])}),rn=B({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:[V(Bo)]},defaultOptions:[{methods:"array"}],create(e,[t]){let r=t.methods,n=new Set(["find","filter","map","forEach","some","every","reduce","findIndex","sort"]);function s(p){return Array.isArray(r)?r.includes(p):n.has(p)}function a(p){let{callee:l}=p;if(l.type===at.AST_NODE_TYPES.MemberExpression){let c=l.property;if(c.type===at.AST_NODE_TYPES.Identifier)return c.name}return null}function i(p,l){if(p.type!==at.AST_NODE_TYPES.Identifier||!p.typeAnnotation)return;let c=l.parent;if(c.type===at.AST_NODE_TYPES.CallExpression){let d=a(c);d&&s(d)&&c.arguments.indexOf(l)===0&&e.report({node:p.typeAnnotation,messageId:"unnecessaryTypeAnnotation",fix(g){return p.typeAnnotation?g.remove(p.typeAnnotation):null}})}}return{ArrowFunctionExpression(p){for(let l of p.params)i(l,p)},FunctionExpression(p){for(let l of p.params)i(l,p)}}}});var Ee=require("@typescript-eslint/utils");var on=B({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===Ee.AST_NODE_TYPES.ObjectPattern||!t.init||t.init.type!==Ee.AST_NODE_TYPES.ObjectExpression||t.id.type===Ee.AST_NODE_TYPES.Identifier&&t.id.typeAnnotation||t.parent.parent.type===Ee.AST_NODE_TYPES.ExportNamedDeclaration)return;let r=new Map;for(let i of t.init.properties)i.type===Ee.AST_NODE_TYPES.Property&&i.key.type===Ee.AST_NODE_TYPES.Identifier&&r.set(i.key.name,i);if(r.size===0||t.id.type!==Ee.AST_NODE_TYPES.Identifier)return;let n=Ho(t,e.sourceCode);if(n.length===0)return;let s=t.init.properties.some(i=>i.type!==Ee.AST_NODE_TYPES.Property?!1:i.value.type===Ee.AST_NODE_TYPES.FunctionExpression),a=new Set;for(let i of n){if(i.identifier.parent.type!==Ee.AST_NODE_TYPES.MemberExpression)return;let p=i.identifier.parent;if(p.object!==i.identifier)return;if(p.computed)if(p.property.type===Ee.AST_NODE_TYPES.Literal&&typeof p.property.value=="string")a.add(p.property.value);else return;else{if(p.property.type!==Ee.AST_NODE_TYPES.Identifier)return;a.add(p.property.name)}if(p.parent.type===Ee.AST_NODE_TYPES.CallExpression&&s)return}for(let[i,p]of r)a.has(i)||e.report({node:p,messageId:"unusedObjectProperty",data:{name:i}})}}}});function Ho(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 G=require("@typescript-eslint/utils"),sn=require("zod/v4");var Yo=sn.z.object({ignoreArgsMatching:sn.z.string().optional()}),an=B({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:[V(Yo)]},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===G.AST_NODE_TYPES.ExportNamedDeclaration||i.type===G.AST_NODE_TYPES.ExportDefaultDeclaration||i.parent?.type===G.AST_NODE_TYPES.ExportNamedDeclaration||i.parent?.type===G.AST_NODE_TYPES.ExportDefaultDeclaration}function a(i){let p=[];for(let l=0;l<i.length;l++){let c=i[l];if(!c||c.type!==G.AST_NODE_TYPES.Identifier)continue;let d=c.name;if(!n(d)){if(c.optional&&c.typeAnnotation&&c.typeAnnotation.typeAnnotation.type===G.AST_NODE_TYPES.TSTypeLiteral){let y=c.typeAnnotation.typeAnnotation,g=[];for(let b of y.members)b.type===G.AST_NODE_TYPES.TSPropertySignature&&b.key.type===G.AST_NODE_TYPES.Identifier&&g.push({name:b.key.name,optional:b.optional===!0});g.some(b=>b.optional)?p.push({param:c,index:l,name:d,isObjectParam:!0,objectProps:g}):p.push({param:c,index:l,name:d,isObjectParam:!1})}else if(c.optional)p.push({param:c,index:l,name:d,isObjectParam:!1});else if(c.typeAnnotation&&c.typeAnnotation.typeAnnotation.type===G.AST_NODE_TYPES.TSTypeLiteral){let y=c.typeAnnotation.typeAnnotation,g=[];for(let b of y.members)b.type===G.AST_NODE_TYPES.TSPropertySignature&&b.key.type===G.AST_NODE_TYPES.Identifier&&g.push({name:b.key.name,optional:b.optional===!0});g.some(b=>b.optional)&&p.push({param:c,index:l,name:d,isObjectParam:!0,objectProps:g})}}}return p}return{FunctionDeclaration(i){if(s(i))return;let p=a(i.params);p.length!==0&&r.push({node:i,declarationNode:i,optionalParams:p})},VariableDeclarator(i){if(i.id.type!==G.AST_NODE_TYPES.Identifier||!i.init||i.init.type!==G.AST_NODE_TYPES.ArrowFunctionExpression&&i.init.type!==G.AST_NODE_TYPES.FunctionExpression||s(i.parent.parent))return;let l=[...a(i.init.params)];if(i.id.typeAnnotation&&i.id.typeAnnotation.typeAnnotation.type===G.AST_NODE_TYPES.TSTypeReference){let c=i.id.typeAnnotation.typeAnnotation;if(c.typeName.type===G.AST_NODE_TYPES.Identifier&&c.typeName.name==="FC"){let d=c.typeArguments;if(d&&d.params.length===1){let y=d.params[0];if(y&&y.type===G.AST_NODE_TYPES.TSTypeLiteral){let g=[];for(let b of y.members)b.type===G.AST_NODE_TYPES.TSPropertySignature&&b.key.type===G.AST_NODE_TYPES.Identifier&&g.push({name:b.key.name,optional:b.optional===!0});g.some(b=>b.optional)&&l.push({param:i.id,index:0,name:"props",isObjectParam:!0,objectProps:g})}}}}l.length!==0&&r.push({node:i.init,declarationNode:i,optionalParams:l})},"Program:exit"(){for(let i of r){let l=e.sourceCode.getDeclaredVariables(i.declarationNode)[0];if(!l)continue;let c=l.references.filter(g=>g.identifier!==l.identifiers[0]);if(c.length===0)continue;let d=!1;for(let g of c){let b=g.identifier.parent;if(b.type===G.AST_NODE_TYPES.CallExpression&&g.identifier.type===G.AST_NODE_TYPES.Identifier&&b.arguments.includes(g.identifier)){d=!0;break}if(b.type===G.AST_NODE_TYPES.ReturnStatement){d=!0;break}if(b.type===G.AST_NODE_TYPES.Property&&b.parent.type===G.AST_NODE_TYPES.ObjectExpression&&b.parent.parent.type===G.AST_NODE_TYPES.ReturnStatement){d=!0;break}if(b.type===G.AST_NODE_TYPES.JSXExpressionContainer){d=!0;break}}if(d)continue;let y=[];for(let g of c){let b=g.identifier.parent;if(b.type===G.AST_NODE_TYPES.CallExpression&&b.callee===g.identifier){let f=b.arguments.length,E=b.arguments.some(m=>m.type===G.AST_NODE_TYPES.SpreadElement);if(E){d=!0;break}let h={argCount:f,hasSpread:E};for(let m of i.optionalParams)if(m.isObjectParam&&m.index<f){let A=b.arguments[m.index];if(A?.type===G.AST_NODE_TYPES.ObjectExpression){let I={};for(let o of A.properties)o.type===G.AST_NODE_TYPES.Property&&o.key.type===G.AST_NODE_TYPES.Identifier&&(I[o.key.name]=!0);h.objectArgs||(h.objectArgs=[]),h.objectArgs[m.index]=I}else if(A){d=!0;break}}y.push(h)}else if(b.type===G.AST_NODE_TYPES.JSXOpeningElement&&b.name===g.identifier){let f=b.attributes.some(h=>h.type===G.AST_NODE_TYPES.JSXSpreadAttribute);if(f){d=!0;break}let E={argCount:1,hasSpread:f};for(let h of i.optionalParams)if(h.isObjectParam&&h.index===0){let m={};for(let A of b.attributes)A.type===G.AST_NODE_TYPES.JSXAttribute&&A.name.type===G.AST_NODE_TYPES.JSXIdentifier&&(m[A.name.name]=!0);E.objectArgs||(E.objectArgs=[]),E.objectArgs[0]=m}y.push(E)}}if(!(d||y.length===0))for(let g of i.optionalParams)if(g.isObjectParam&&g.objectProps)for(let b of g.objectProps){if(!b.optional)continue;let f=!1;for(let E of y)if(E.objectArgs&&E.objectArgs[g.index]){let h=E.objectArgs[g.index];if(h&&h[b.name]){f=!0;break}}f||e.report({node:g.param,messageId:"unusedOptionalProp",data:{name:b.name}})}else{let b=!1;for(let f of y)if(f.argCount>g.index){b=!0;break}b||e.report({node:g.param,messageId:"unusedOptionalArg",data:{name:g.name}})}}}}}});var se=require("@typescript-eslint/utils"),Be=require("zod/v4");var qo=Be.z.object({selectors:Be.z.array(Be.z.object({name:Be.z.string(),selectorProp:Be.z.string().optional(),selectorArgPos:Be.z.number().optional(),returnProp:Be.z.string().optional()}))}),Zo=se.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),Tr="no-unused-selected-values",ln={name:Tr,rule:Zo({name:Tr,meta:{type:"suggestion",docs:{description:"Disallow unused values in selector objects"},messages:{unusedSelectedValue:'The selected value "{{name}}" is not being used'},schema:[V(qo)]},defaultOptions:[{selectors:[]}],create(e,[t]){let{selectors:r=[]}=t,n=new Map(r.map(s=>[s.name,s]));return{VariableDeclarator(s){let a=null;if(s.init?.type===se.AST_NODE_TYPES.CallExpression&&(a=s.init),!a)return;let i=Ko(a);if(!i)return;let p=n.get(i);if(!p)return;let l=Go(a,p.selectorArgPos??0,p.selectorProp);if(!l)return;let c=Qo(l);if(!c)return;let d=hr(c.properties,void 0);if(!d)return;if(s.id.type===se.AST_NODE_TYPES.ObjectPattern){let b=hr(s.id.properties,p.returnProp);if(!b)return;for(let[f,E]of d)b.has(f)||e.report({node:E,messageId:"unusedSelectedValue",data:{name:f}});return}if(s.id.type!==se.AST_NODE_TYPES.Identifier||p.returnProp)return;let y=es(s,e.sourceCode);if(y.length===0)return;let g=new Set;for(let b of y){if(b.identifier.parent.type!==se.AST_NODE_TYPES.MemberExpression)return;let f=b.identifier.parent.property;if(f.type!==se.AST_NODE_TYPES.Identifier)return;g.add(f.name)}for(let[b,f]of d)g.has(b)||e.report({node:f,messageId:"unusedSelectedValue",data:{name:b}})}}}})};function Go(e,t,r){let n=e.arguments[t];if(!n)return null;if(n.type===se.AST_NODE_TYPES.ArrowFunctionExpression||n.type===se.AST_NODE_TYPES.FunctionExpression)return n;if(r&&n.type===se.AST_NODE_TYPES.ObjectExpression){let s=n.properties.find(i=>i.type===se.AST_NODE_TYPES.Property&&i.key.type===se.AST_NODE_TYPES.Identifier&&i.key.name===r);if(s?.type!==se.AST_NODE_TYPES.Property)return null;let a=s.value;if(a.type===se.AST_NODE_TYPES.ArrowFunctionExpression||a.type===se.AST_NODE_TYPES.FunctionExpression)return a}return null}function Ko(e){return e.callee.type===se.AST_NODE_TYPES.Identifier?e.callee.name:e.callee.type===se.AST_NODE_TYPES.MemberExpression&&e.callee.property.type===se.AST_NODE_TYPES.Identifier?e.callee.property.name:null}function Qo(e){if(e.body.type===se.AST_NODE_TYPES.ObjectExpression)return e.body;if(e.body.type===se.AST_NODE_TYPES.BlockStatement){let t=e.body.body.filter(r=>r.type===se.AST_NODE_TYPES.ReturnStatement);return t.length!==1||!t[0]||t[0].argument?.type!==se.AST_NODE_TYPES.ObjectExpression?null:t[0].argument}return null}function hr(e,t){let r=e;if(t){let s=e.find(a=>a.type===se.AST_NODE_TYPES.Property&&a.key.type===se.AST_NODE_TYPES.Identifier&&a.key.name===t);if(s?.type!==se.AST_NODE_TYPES.Property||s.value.type!==se.AST_NODE_TYPES.ObjectPattern)return null;r=s.value.properties}let n=new Map;for(let s of r){if(s.type!==se.AST_NODE_TYPES.Property||s.key.type!==se.AST_NODE_TYPES.Identifier)return null;n.set(s.key.name,s)}return n.size>0?n:null}function es(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 ae=require("@typescript-eslint/utils");var pn=B({name:"no-unused-t-state-field",meta:{type:"suggestion",docs:{description:"Prevent declaring unused t-state fields"},messages:{unusedField:'Field "{{name}}" is not being used, you can safely remove it'},schema:[]},defaultOptions:[],create(e){if(!(e.filename.endsWith(".jsx")||e.filename.endsWith(".tsx")))return{};if(!e.sourceCode.ast.body.some(a=>a.type===ae.AST_NODE_TYPES.ImportDeclaration&&a.source.value==="t-state-form"))return{};let n=null,s=!1;return{CallExpression(a){if(s)return;if(!n){let p=ts(a);p&&(n=p);return}let i=ns(a,e.sourceCode);if(i){s=!0;for(let p of i)n.delete(p);if(n.size!==0)for(let[p,l]of n)e.report({node:l,messageId:"unusedField",data:{name:p}})}}}}});function ts(e){if(!(e.callee.type===ae.AST_NODE_TYPES.Identifier&&e.callee.name==="useForm"))return null;let r=e.arguments[0];if(!r||r.type!==ae.AST_NODE_TYPES.ObjectExpression)return null;let n=_t(r.properties,a=>a.type!==ae.AST_NODE_TYPES.Property||a.key.type!==ae.AST_NODE_TYPES.Identifier||a.key.name!=="initialConfig"?null:a.value.type===ae.AST_NODE_TYPES.ObjectExpression?a.value:a.value.type===ae.AST_NODE_TYPES.ArrowFunctionExpression||a.value.type===ae.AST_NODE_TYPES.FunctionExpression?rs(a.value):null);if(!n)return null;let s=new Map;for(let a of n.properties)a.type===ae.AST_NODE_TYPES.Property&&a.key.type===ae.AST_NODE_TYPES.Identifier&&s.set(a.key.name,a);return s}function ns(e,t){if(!(e.callee.type===ae.AST_NODE_TYPES.Identifier&&e.callee.name==="useFormState")||e.parent.type!==ae.AST_NODE_TYPES.VariableDeclarator||e.parent.id.type!==ae.AST_NODE_TYPES.ObjectPattern||!_t(e.parent.id.properties,i=>i.type===ae.AST_NODE_TYPES.Property&&i.key.type===ae.AST_NODE_TYPES.Identifier&&i.key.name==="formFields"&&i))return null;let s=tr(e.parent,"formFields",t),a=new Set;for(let{identifier:i}of s){if(i.type!==ae.AST_NODE_TYPES.Identifier||i.parent.type===ae.AST_NODE_TYPES.Property&&i.parent.parent.type===ae.AST_NODE_TYPES.ObjectExpression&&i.parent.parent.parent.type===ae.AST_NODE_TYPES.ReturnStatement||i.parent.type===ae.AST_NODE_TYPES.ReturnStatement)return null;if(i.parent.type===ae.AST_NODE_TYPES.MemberExpression){if(i.parent.object.type!==ae.AST_NODE_TYPES.Identifier||i.parent.property.type!==ae.AST_NODE_TYPES.Identifier)return null;a.add(i.parent.property.name)}}return a}function rs(e){if(e.body.type===ae.AST_NODE_TYPES.ObjectExpression)return e.body;if(e.body.type===ae.AST_NODE_TYPES.BlockStatement){let t=e.body.body.filter(r=>r.type===ae.AST_NODE_TYPES.ReturnStatement);return t.length!==1||!t[0]||t[0].argument?.type!==ae.AST_NODE_TYPES.ObjectExpression?null:t[0].argument}return null}var ne=require("@typescript-eslint/utils"),lt=require("zod/v4");var is=ne.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`);function Er(e){let t=[];for(let r of e.members)r.type===ne.AST_NODE_TYPES.TSPropertySignature&&r.key.type===ne.AST_NODE_TYPES.Identifier&&t.push([r.key.name,r]);return t}function br(e,...t){for(let r of t)e.set(...r);return e}var os=lt.z.object({forceCheckOnFCPropTypesWithName:lt.z.array(lt.z.string()).optional(),alwaysCheckFunctionOptionTypes:lt.z.boolean().optional()}),xr="no-unused-type-props-in-args",cn=null,ss=is({name:xr,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:[V(os)],fixable:"code"},defaultOptions:[{alwaysCheckFunctionOptionTypes:!0}],create(e,[t]){let{forceCheckOnFCPropTypesWithName:r,alwaysCheckFunctionOptionTypes:n=!0}=t;r&&!cn&&(cn=r.map(l=>new RegExp(l)));function s(l,c,d,y,g=!0,b=!1){let f=d.name,E=e.sourceCode.getScope(c).references.find(o=>o.identifier.name===f)?.resolved,h=l&&cn?.some(o=>o.test(f)),m=b&&n;if(!E||!h&&E.references.filter(o=>o.isTypeReference).length>1||!E.defs[0])return;let A=E.defs[0].node,I=A.parent?.type===ne.AST_NODE_TYPES.ExportNamedDeclaration;if(!(g&&I&&!m)){if(A.type===ne.AST_NODE_TYPES.TSTypeAliasDeclaration){a(l,c,y,A.typeAnnotation,!0,b);return}if(A.type===ne.AST_NODE_TYPES.TSInterfaceDeclaration){a(l,c,y,A.body,!0,b);return}}}function a(l,c,d,y,g,b=!1){if(y.type===ne.AST_NODE_TYPES.TSInterfaceBody){for(let f of y.body)f.type===ne.AST_NODE_TYPES.TSPropertySignature&&f.key.type===ne.AST_NODE_TYPES.Identifier&&d.set(f.key.name,f);return}if(y.type===ne.AST_NODE_TYPES.TSTypeLiteral){br(d,...Er(y));return}if(y.type===ne.AST_NODE_TYPES.TSIntersectionType){for(let f of y.types)a(l,c,d,f,!0,b);return}g||y.type===ne.AST_NODE_TYPES.TSTypeReference&&y.typeName.type===ne.AST_NODE_TYPES.Identifier&&s(l,c,y.typeName,d,!0,b)}function i(l,c,d,y=!1){for(let g of d)if(g.type===ne.AST_NODE_TYPES.ObjectPattern&&g.typeAnnotation){let b=new Map;if(a(l,c,b,g.typeAnnotation.typeAnnotation,!1,y),b.size===0)continue;p(g,b)}else g.type===ne.AST_NODE_TYPES.AssignmentPattern&&g.left.type===ne.AST_NODE_TYPES.ObjectPattern&&i(l,c,[g.left],y)}function p(l,c){let d=[];if(l.properties.at(-1)?.type===ne.AST_NODE_TYPES.RestElement)return;for(let f of l.properties)f.type===ne.AST_NODE_TYPES.Property&&f.key.type===ne.AST_NODE_TYPES.Identifier&&d.push(f.key.name);let g=[],b=[];for(let[f,E]of c)d.includes(f)||(b.push(f),g.push({node:E,messageId:"unusedObjectTypeProperty",data:{propertyName:f}}));for(let[f,E]of g.entries())e.report({...E,fix:f===g.length-1?h=>{let m=l.properties.at(-1),A=b.join(", ");return m?m.type===ne.AST_NODE_TYPES.RestElement?null:h.insertTextAfter(m,`, ${A}`):h.insertTextBeforeRange([l.range[0]+1,l.range[1]],A)}:void 0})}return{VariableDeclaration(l){let c=l.declarations[0],d=new Map,y=c.id.type===ne.AST_NODE_TYPES.Identifier&&c.id.typeAnnotation?.typeAnnotation.type===ne.AST_NODE_TYPES.TSTypeReference&&c.id.typeAnnotation.typeAnnotation.typeName.type===ne.AST_NODE_TYPES.Identifier&&c.id.typeAnnotation.typeAnnotation.typeName.name==="FC"&&c.id.typeAnnotation.typeAnnotation.typeArguments?.params[0];if(y){if(y.type===ne.AST_NODE_TYPES.TSTypeReference&&y.typeName.type===ne.AST_NODE_TYPES.Identifier)s(!0,l,y.typeName,d,!1);else if(y.type===ne.AST_NODE_TYPES.TSTypeLiteral)br(d,...Er(y));else if(y.type===ne.AST_NODE_TYPES.TSIntersectionType)for(let g of y.types)g.type===ne.AST_NODE_TYPES.TSTypeReference&&g.typeName.type===ne.AST_NODE_TYPES.Identifier?s(!0,l,g.typeName,d,!1):a(!0,l,d,g,!0);if(d.size!==0&&c.init?.type===ne.AST_NODE_TYPES.ArrowFunctionExpression){let g=c.init.params[0];if(!g){e.report({node:c.init,messageId:"missingComponentParam"});return}g.type===ne.AST_NODE_TYPES.ObjectPattern&&p(g,d)}}},FunctionDeclaration(l){i(!1,l,l.params,n)},ArrowFunctionExpression(l){i(!1,l,l.params,n)}}}}),un={name:xr,rule:ss};var ve=require("@typescript-eslint/utils");var fn=B({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===ve.AST_NODE_TYPES.Identifier?t.has(n.callee.name):n.callee.type===ve.AST_NODE_TYPES.MemberExpression&&n.callee.object.type===ve.AST_NODE_TYPES.Identifier&&n.callee.property.type===ve.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===ve.AST_NODE_TYPES.ImportSpecifier&&s.imported.type===ve.AST_NODE_TYPES.Identifier&&s.imported.name==="useRef"&&t.add(s.local.name)},VariableDeclarator(n){if(n.init&&n.init.type===ve.AST_NODE_TYPES.CallExpression&&r(n.init)&&n.id.type===ve.AST_NODE_TYPES.Identifier){let a=e.sourceCode.getScope(n).set.get(n.id.name);if(a){let i=!1;for(let p of a.references){let c=p.identifier.parent;if(c!==n&&!(c.type===ve.AST_NODE_TYPES.JSXExpressionContainer&&c.parent.type===ve.AST_NODE_TYPES.JSXAttribute&&c.parent.name.type===ve.AST_NODE_TYPES.JSXIdentifier&&c.parent.name.name==="ref")){i=!0;break}}i||e.report({node:n.id,messageId:"refNotRead",data:{name:n.id.name}})}}}}}});var et=require("@typescript-eslint/utils"),as=et.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),Ir="prefer-named-functions",Cr=new Map,ls=as({name:Ir,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=Cr.get(t.ignoreRegex);n?r=n:(r=new RegExp(t.ignoreRegex),Cr.set(t.ignoreRegex,r))}return{VariableDeclarator(n){if(n.init&&n.init.type===et.AST_NODE_TYPES.ArrowFunctionExpression&&n.id.type===et.AST_NODE_TYPES.Identifier){let s=n.id.name;if(n.id.typeAnnotation||r&&r.test(s)||!t.disallowArrowFnWithImplicitReturns&&n.init.body.type!==et.AST_NODE_TYPES.BlockStatement)return;let a=n.parent,i=n.init.params,p=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:c=>c.replaceText(a,`${l.async?"async ":""}function ${s}(${i.map(d=>e.sourceCode.getText(d)).join(", ")||""}) ${e.sourceCode.getText(p)}`)}]})}}}}}),mn={name:Ir,rule:ls};var Y=require("@typescript-eslint/utils"),je=require("zod/v4");var ps=je.z.object({disallowedFunctions:je.z.array(je.z.object({name:je.z.string(),allowUsingWithArgs:je.z.boolean().optional(),hookAlternative:je.z.string().optional(),message:je.z.string().optional(),allowUseInside:je.z.array(je.z.string()).optional()}))}),cs=/^use[A-Z]/,us=/^[A-Z]/;function bt(e){return cs.test(e)}function Ar(e){return us.test(e)}function fs(e){return e.type===Y.AST_NODE_TYPES.Identifier?bt(e.name):e.type===Y.AST_NODE_TYPES.MemberExpression&&e.property.type===Y.AST_NODE_TYPES.Identifier?bt(e.property.name):!1}function wr(e,t){return e.type===Y.AST_NODE_TYPES.Identifier?e.name===t:e.type===Y.AST_NODE_TYPES.MemberExpression&&e.object.type===Y.AST_NODE_TYPES.Identifier&&e.property.type===Y.AST_NODE_TYPES.Identifier?e.object.name==="React"&&e.property.name===t:!1}function Rr(e){return!!(e.parent&&e.parent.type===Y.AST_NODE_TYPES.CallExpression&&wr(e.parent.callee,"forwardRef"))}function Pr(e){return!!(e.parent&&e.parent.type===Y.AST_NODE_TYPES.CallExpression&&wr(e.parent.callee,"memo"))}function dn(e){if(e.type===Y.AST_NODE_TYPES.FunctionDeclaration||e.type===Y.AST_NODE_TYPES.FunctionExpression&&e.id)return e.id||void 0;if(e.type===Y.AST_NODE_TYPES.FunctionExpression||e.type===Y.AST_NODE_TYPES.ArrowFunctionExpression){if(e.parent.type===Y.AST_NODE_TYPES.VariableDeclarator&&e.parent.init===e)return e.parent.id;if(e.parent.type===Y.AST_NODE_TYPES.AssignmentExpression&&e.parent.right===e&&e.parent.operator==="=")return e.parent.left;if(e.parent.type===Y.AST_NODE_TYPES.Property&&e.parent.value===e&&!e.parent.computed)return e.parent.key;if(e.parent.type===Y.AST_NODE_TYPES.AssignmentPattern&&e.parent.right===e)return e.parent.left}}function ms(e){let t=e.parent,r=!1;for(;t;){if(t.type===Y.AST_NODE_TYPES.FunctionDeclaration||t.type===Y.AST_NODE_TYPES.FunctionExpression||t.type===Y.AST_NODE_TYPES.ArrowFunctionExpression){let n=dn(t);if(n&&n.type===Y.AST_NODE_TYPES.Identifier){if(Ar(n.name)||bt(n.name))return!r;r=!0}else{if(Rr(t)||Pr(t))return!r;if(t.parent.type===Y.AST_NODE_TYPES.CallExpression){let s=t.parent;fs(s.callee)||(r=!0)}else t.parent.type===Y.AST_NODE_TYPES.JSXExpressionContainer||(r=!0)}}t=t.parent}return!1}function vr(e){return e.callee.type===Y.AST_NODE_TYPES.Identifier?e.callee.name:e.callee.type===Y.AST_NODE_TYPES.MemberExpression&&e.callee.property.type===Y.AST_NODE_TYPES.Identifier?e.callee.property.name:null}function ds(e,t){if(!t.length)return!1;let r=e.parent;for(;r;){if(r.type===Y.AST_NODE_TYPES.FunctionDeclaration||r.type===Y.AST_NODE_TYPES.FunctionExpression||r.type===Y.AST_NODE_TYPES.ArrowFunctionExpression){let n=dn(r);if(n&&n.type===Y.AST_NODE_TYPES.Identifier&&t.includes(n.name))return!0}else if(r.type===Y.AST_NODE_TYPES.CallExpression){let n=vr(r);if(n&&t.includes(n))return!0}r=r.parent}return!1}function ys(e){return e.arguments.length>0&&!e.arguments.every(t=>t.type===Y.AST_NODE_TYPES.Identifier&&t.name==="undefined")}function gs(e,t){let r=!1,n=e.parent;for(;n;){if(n.type===Y.AST_NODE_TYPES.FunctionDeclaration||n.type===Y.AST_NODE_TYPES.FunctionExpression||n.type===Y.AST_NODE_TYPES.ArrowFunctionExpression){let s=dn(n);if(s&&s.type===Y.AST_NODE_TYPES.Identifier){if(Ar(s.name)||bt(s.name)){r=!0;break}}else if(Rr(n)||Pr(n)){r=!0;break}}n=n.parent}return r?t.length===0?ms(e):!ds(e,t):!1}var yn=B({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:[V(ps)],hasSuggestions:!0},defaultOptions:[{disallowedFunctions:[]}],create(e,[t]){let{disallowedFunctions:r}=t,n=new Map(r.map(s=>[s.name,s]));return{CallExpression(s){let a=vr(s);if(!a)return;let i=n.get(a);if(!i||i.allowUsingWithArgs&&ys(s))return;let p=i.allowUseInside||[];gs(s,p)&&e.report({node:s,messageId:"preferHookAlternative",data:{message:i.message?` ${i.message}`:` use ${i.hookAlternative} instead`},suggest:i.hookAlternative?[{messageId:"preferHookAlternative",data:{message:`Replace with ${i.hookAlternative}`,hookAlternative:i.hookAlternative},fix:l=>{let c=i.hookAlternative;return c?s.callee.type===Y.AST_NODE_TYPES.Identifier?l.replaceText(s.callee,c):s.callee.type===Y.AST_NODE_TYPES.MemberExpression&&s.callee.property.type===Y.AST_NODE_TYPES.Identifier?l.replaceText(s.callee.property,c):null:null}}]:[]})}}}});var le=require("@typescript-eslint/utils"),xt=ke(require("zod/v4"));var Ss=le.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),kr="prefer-single-line-if",Ts=xt.default.object({maxLineLength:xt.default.number().optional(),maxNonSimpleConditionLength:xt.default.number().optional()}),hs=Ss({name:kr,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:[V(Ts)]},defaultOptions:[{}],create(e,[t]){let r=e.sourceCode;return{IfStatement(n){if(n.consequent.type!==le.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 a=n.consequent.body[0];if(!a)return;if(a.type===le.AST_NODE_TYPES.ReturnStatement){if(!Nr(a))return}else if(!(a.type===le.AST_NODE_TYPES.ContinueStatement||a.type===le.AST_NODE_TYPES.BreakStatement))return;if(n.test.type===le.AST_NODE_TYPES.LogicalExpression||n.test.type===le.AST_NODE_TYPES.ConditionalExpression)return;let i;if(t.maxNonSimpleConditionLength){let y=Fr(n.test);if(!y&&n.test.type===le.AST_NODE_TYPES.UnaryExpression&&n.test.operator==="!"){let g=n.test.argument;Fr(g)&&(y=!0)}if(y&&(i=r.getText(n.test),i.length>t.maxNonSimpleConditionLength))return}i||(i=r.getText(n.test));let p=r.getText(a);if(i.includes(`
|
|
18
|
-
`))return;let l=r.getTokenAfter(n);if(l&&l.type===le.AST_TOKEN_TYPES.Punctuator&&l.value==="}"){let y=r.getTokenAfter(l);if(y&&y.type===le.AST_TOKEN_TYPES.Keyword&&(y.value==="else"||y.value==="catch"))return}let c=Es(r,n),d=`if (${i}) ${p}`;t.maxLineLength&&d.length+c.length>t.maxLineLength||e.report({node:n,messageId:"noSingleLineCurly",fix:y=>y.replaceText(n,d)})}}}});function
|
|
17
|
+
`)}return""}return{Program(){let l=[];for(let g of n.body)g.type===Ie.AST_NODE_TYPES.ExpressionStatement&&g.expression.type===Ie.AST_NODE_TYPES.CallExpression&&g.expression.callee.type===Ie.AST_NODE_TYPES.Identifier&&g.expression.callee.name==="describe"&&g.expression.arguments.length===2&&l.push(g.expression);if(!i(l))return;let[c]=l;if(!c)return;let d=s(c);if(a(d))return;let y=n.body.find(g=>g.type===Ie.AST_NODE_TYPES.ExpressionStatement&&g.expression===c);!y||y.type!==Ie.AST_NODE_TYPES.ExpressionStatement||e.report({node:c,messageId:"unnecessaryDescribe",suggest:[{messageId:"removeDescribe",fix(g){let b=p(c);return b?g.replaceText(y,b):null}}]})}}}});var lt=require("@typescript-eslint/utils"),Ne=Fe(require("zod/v4"));var Bo=Ne.object({methods:Ne.union([Ne.array(Ne.string()),Ne.literal("array")])}),nn=X({name:"no-unnecessary-typing",meta:{type:"suggestion",docs:{description:"Prevents unnecessary explicit type annotations in callback parameters where TypeScript can infer the type"},messages:{unnecessaryTypeAnnotation:"Unnecessary type annotation. TypeScript can infer this type from context."},fixable:"code",schema:[J(Bo)]},defaultOptions:[{methods:"array"}],create(e,[t]){let r=t.methods,n=new Set(["find","filter","map","forEach","some","every","reduce","findIndex","sort"]);function s(p){return Array.isArray(r)?r.includes(p):n.has(p)}function a(p){let{callee:l}=p;if(l.type===lt.AST_NODE_TYPES.MemberExpression){let c=l.property;if(c.type===lt.AST_NODE_TYPES.Identifier)return c.name}return null}function i(p,l){if(p.type!==lt.AST_NODE_TYPES.Identifier||!p.typeAnnotation)return;let c=l.parent;if(c.type===lt.AST_NODE_TYPES.CallExpression){let d=a(c);d&&s(d)&&c.arguments.indexOf(l)===0&&e.report({node:p.typeAnnotation,messageId:"unnecessaryTypeAnnotation",fix(g){return p.typeAnnotation?g.remove(p.typeAnnotation):null}})}}return{ArrowFunctionExpression(p){for(let l of p.params)i(l,p)},FunctionExpression(p){for(let l of p.params)i(l,p)}}}});var Ce=require("@typescript-eslint/utils");var rn=X({name:"no-unused-obj-props",meta:{type:"suggestion",docs:{description:"Disallow unused properties when it is safe to remove them"},messages:{unusedObjectProperty:'The object property "{{name}}" is not being used',unusedReturnObjectProperty:'The object property "{{name}}" returned by this function is not being used'},schema:[]},defaultOptions:[],create(e){return{VariableDeclarator(t){if(t.id.type===Ce.AST_NODE_TYPES.ObjectPattern||!t.init||t.init.type!==Ce.AST_NODE_TYPES.ObjectExpression||t.id.type===Ce.AST_NODE_TYPES.Identifier&&t.id.typeAnnotation||t.parent.parent.type===Ce.AST_NODE_TYPES.ExportNamedDeclaration)return;let r=new Map;for(let i of t.init.properties)i.type===Ce.AST_NODE_TYPES.Property&&i.key.type===Ce.AST_NODE_TYPES.Identifier&&r.set(i.key.name,i);if(r.size===0||t.id.type!==Ce.AST_NODE_TYPES.Identifier)return;let n=Ho(t,e.sourceCode);if(n.length===0)return;let s=t.init.properties.some(i=>i.type!==Ce.AST_NODE_TYPES.Property?!1:i.value.type===Ce.AST_NODE_TYPES.FunctionExpression),a=new Set;for(let i of n){if(i.identifier.parent.type!==Ce.AST_NODE_TYPES.MemberExpression)return;let p=i.identifier.parent;if(p.object!==i.identifier)return;if(p.computed)if(p.property.type===Ce.AST_NODE_TYPES.Literal&&typeof p.property.value=="string")a.add(p.property.value);else return;else{if(p.property.type!==Ce.AST_NODE_TYPES.Identifier)return;a.add(p.property.name)}if(p.parent.type===Ce.AST_NODE_TYPES.CallExpression&&s)return}for(let[i,p]of r)a.has(i)||e.report({node:p,messageId:"unusedObjectProperty",data:{name:i}})}}}});function Ho(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 G=require("@typescript-eslint/utils"),on=require("zod/v4");var Yo=on.z.object({ignoreArgsMatching:on.z.string().optional()}),sn=X({name:"no-unused-optional-args",meta:{type:"problem",docs:{description:"Detect unused optional function arguments in non-exported functions"},messages:{unusedOptionalArg:"Optional parameter '{{name}}' is never used",unusedOptionalProp:"Optional prop '{{name}}' is never provided"},schema:[J(Yo)]},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===G.AST_NODE_TYPES.ExportNamedDeclaration||i.type===G.AST_NODE_TYPES.ExportDefaultDeclaration||i.parent?.type===G.AST_NODE_TYPES.ExportNamedDeclaration||i.parent?.type===G.AST_NODE_TYPES.ExportDefaultDeclaration}function a(i){let p=[];for(let l=0;l<i.length;l++){let c=i[l];if(!c||c.type!==G.AST_NODE_TYPES.Identifier)continue;let d=c.name;if(!n(d)){if(c.optional&&c.typeAnnotation&&c.typeAnnotation.typeAnnotation.type===G.AST_NODE_TYPES.TSTypeLiteral){let y=c.typeAnnotation.typeAnnotation,g=[];for(let b of y.members)b.type===G.AST_NODE_TYPES.TSPropertySignature&&b.key.type===G.AST_NODE_TYPES.Identifier&&g.push({name:b.key.name,optional:b.optional===!0});g.some(b=>b.optional)?p.push({param:c,index:l,name:d,isObjectParam:!0,objectProps:g}):p.push({param:c,index:l,name:d,isObjectParam:!1})}else if(c.optional)p.push({param:c,index:l,name:d,isObjectParam:!1});else if(c.typeAnnotation&&c.typeAnnotation.typeAnnotation.type===G.AST_NODE_TYPES.TSTypeLiteral){let y=c.typeAnnotation.typeAnnotation,g=[];for(let b of y.members)b.type===G.AST_NODE_TYPES.TSPropertySignature&&b.key.type===G.AST_NODE_TYPES.Identifier&&g.push({name:b.key.name,optional:b.optional===!0});g.some(b=>b.optional)&&p.push({param:c,index:l,name:d,isObjectParam:!0,objectProps:g})}}}return p}return{FunctionDeclaration(i){if(s(i))return;let p=a(i.params);p.length!==0&&r.push({node:i,declarationNode:i,optionalParams:p})},VariableDeclarator(i){if(i.id.type!==G.AST_NODE_TYPES.Identifier||!i.init||i.init.type!==G.AST_NODE_TYPES.ArrowFunctionExpression&&i.init.type!==G.AST_NODE_TYPES.FunctionExpression||s(i.parent.parent))return;let l=[...a(i.init.params)];if(i.id.typeAnnotation&&i.id.typeAnnotation.typeAnnotation.type===G.AST_NODE_TYPES.TSTypeReference){let c=i.id.typeAnnotation.typeAnnotation;if(c.typeName.type===G.AST_NODE_TYPES.Identifier&&c.typeName.name==="FC"){let d=c.typeArguments;if(d&&d.params.length===1){let y=d.params[0];if(y&&y.type===G.AST_NODE_TYPES.TSTypeLiteral){let g=[];for(let b of y.members)b.type===G.AST_NODE_TYPES.TSPropertySignature&&b.key.type===G.AST_NODE_TYPES.Identifier&&g.push({name:b.key.name,optional:b.optional===!0});g.some(b=>b.optional)&&l.push({param:i.id,index:0,name:"props",isObjectParam:!0,objectProps:g})}}}}l.length!==0&&r.push({node:i.init,declarationNode:i,optionalParams:l})},"Program:exit"(){for(let i of r){let l=e.sourceCode.getDeclaredVariables(i.declarationNode)[0];if(!l)continue;let c=l.references.filter(g=>g.identifier!==l.identifiers[0]);if(c.length===0)continue;let d=!1;for(let g of c){let b=g.identifier.parent;if(b.type===G.AST_NODE_TYPES.CallExpression&&g.identifier.type===G.AST_NODE_TYPES.Identifier&&b.arguments.includes(g.identifier)){d=!0;break}if(b.type===G.AST_NODE_TYPES.ReturnStatement){d=!0;break}if(b.type===G.AST_NODE_TYPES.Property&&b.parent.type===G.AST_NODE_TYPES.ObjectExpression&&b.parent.parent.type===G.AST_NODE_TYPES.ReturnStatement){d=!0;break}if(b.type===G.AST_NODE_TYPES.JSXExpressionContainer){d=!0;break}}if(d)continue;let y=[];for(let g of c){let b=g.identifier.parent;if(b.type===G.AST_NODE_TYPES.CallExpression&&b.callee===g.identifier){let f=b.arguments.length,E=b.arguments.some(m=>m.type===G.AST_NODE_TYPES.SpreadElement);if(E){d=!0;break}let h={argCount:f,hasSpread:E};for(let m of i.optionalParams)if(m.isObjectParam&&m.index<f){let A=b.arguments[m.index];if(A?.type===G.AST_NODE_TYPES.ObjectExpression){let I={};for(let o of A.properties)o.type===G.AST_NODE_TYPES.Property&&o.key.type===G.AST_NODE_TYPES.Identifier&&(I[o.key.name]=!0);h.objectArgs||(h.objectArgs=[]),h.objectArgs[m.index]=I}else if(A){d=!0;break}}y.push(h)}else if(b.type===G.AST_NODE_TYPES.JSXOpeningElement&&b.name===g.identifier){let f=b.attributes.some(h=>h.type===G.AST_NODE_TYPES.JSXSpreadAttribute);if(f){d=!0;break}let E={argCount:1,hasSpread:f};for(let h of i.optionalParams)if(h.isObjectParam&&h.index===0){let m={};for(let A of b.attributes)A.type===G.AST_NODE_TYPES.JSXAttribute&&A.name.type===G.AST_NODE_TYPES.JSXIdentifier&&(m[A.name.name]=!0);E.objectArgs||(E.objectArgs=[]),E.objectArgs[0]=m}y.push(E)}}if(!(d||y.length===0))for(let g of i.optionalParams)if(g.isObjectParam&&g.objectProps)for(let b of g.objectProps){if(!b.optional)continue;let f=!1;for(let E of y)if(E.objectArgs&&E.objectArgs[g.index]){let h=E.objectArgs[g.index];if(h&&h[b.name]){f=!0;break}}f||e.report({node:g.param,messageId:"unusedOptionalProp",data:{name:b.name}})}else{let b=!1;for(let f of y)if(f.argCount>g.index){b=!0;break}b||e.report({node:g.param,messageId:"unusedOptionalArg",data:{name:g.name}})}}}}}});var oe=require("@typescript-eslint/utils"),Be=require("zod/v4");var qo=Be.z.object({selectors:Be.z.array(Be.z.object({name:Be.z.string(),selectorProp:Be.z.string().optional(),selectorArgPos:Be.z.number().optional(),returnProp:Be.z.string().optional()}))}),Zo=oe.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),Sr="no-unused-selected-values",an={name:Sr,rule:Zo({name:Sr,meta:{type:"suggestion",docs:{description:"Disallow unused values in selector objects"},messages:{unusedSelectedValue:'The selected value "{{name}}" is not being used'},schema:[J(qo)]},defaultOptions:[{selectors:[]}],create(e,[t]){let{selectors:r=[]}=t,n=new Map(r.map(s=>[s.name,s]));return{VariableDeclarator(s){let a=null;if(s.init?.type===oe.AST_NODE_TYPES.CallExpression&&(a=s.init),!a)return;let i=Ko(a);if(!i)return;let p=n.get(i);if(!p)return;let l=Go(a,p.selectorArgPos??0,p.selectorProp);if(!l)return;let c=Qo(l);if(!c)return;let d=Tr(c.properties,void 0);if(!d)return;if(s.id.type===oe.AST_NODE_TYPES.ObjectPattern){let b=Tr(s.id.properties,p.returnProp);if(!b)return;for(let[f,E]of d)b.has(f)||e.report({node:E,messageId:"unusedSelectedValue",data:{name:f}});return}if(s.id.type!==oe.AST_NODE_TYPES.Identifier||p.returnProp)return;let y=es(s,e.sourceCode);if(y.length===0)return;let g=new Set;for(let b of y){if(b.identifier.parent.type!==oe.AST_NODE_TYPES.MemberExpression)return;let f=b.identifier.parent.property;if(f.type!==oe.AST_NODE_TYPES.Identifier)return;g.add(f.name)}for(let[b,f]of d)g.has(b)||e.report({node:f,messageId:"unusedSelectedValue",data:{name:b}})}}}})};function Go(e,t,r){let n=e.arguments[t];if(!n)return null;if(n.type===oe.AST_NODE_TYPES.ArrowFunctionExpression||n.type===oe.AST_NODE_TYPES.FunctionExpression)return n;if(r&&n.type===oe.AST_NODE_TYPES.ObjectExpression){let s=n.properties.find(i=>i.type===oe.AST_NODE_TYPES.Property&&i.key.type===oe.AST_NODE_TYPES.Identifier&&i.key.name===r);if(s?.type!==oe.AST_NODE_TYPES.Property)return null;let a=s.value;if(a.type===oe.AST_NODE_TYPES.ArrowFunctionExpression||a.type===oe.AST_NODE_TYPES.FunctionExpression)return a}return null}function Ko(e){return e.callee.type===oe.AST_NODE_TYPES.Identifier?e.callee.name:e.callee.type===oe.AST_NODE_TYPES.MemberExpression&&e.callee.property.type===oe.AST_NODE_TYPES.Identifier?e.callee.property.name:null}function Qo(e){if(e.body.type===oe.AST_NODE_TYPES.ObjectExpression)return e.body;if(e.body.type===oe.AST_NODE_TYPES.BlockStatement){let t=e.body.body.filter(r=>r.type===oe.AST_NODE_TYPES.ReturnStatement);return t.length!==1||!t[0]||t[0].argument?.type!==oe.AST_NODE_TYPES.ObjectExpression?null:t[0].argument}return null}function Tr(e,t){let r=e;if(t){let s=e.find(a=>a.type===oe.AST_NODE_TYPES.Property&&a.key.type===oe.AST_NODE_TYPES.Identifier&&a.key.name===t);if(s?.type!==oe.AST_NODE_TYPES.Property||s.value.type!==oe.AST_NODE_TYPES.ObjectPattern)return null;r=s.value.properties}let n=new Map;for(let s of r){if(s.type!==oe.AST_NODE_TYPES.Property||s.key.type!==oe.AST_NODE_TYPES.Identifier)return null;n.set(s.key.name,s)}return n.size>0?n:null}function es(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 se=require("@typescript-eslint/utils");var ln=X({name:"no-unused-t-state-field",meta:{type:"suggestion",docs:{description:"Prevent declaring unused t-state fields"},messages:{unusedField:'Field "{{name}}" is not being used, you can safely remove it'},schema:[]},defaultOptions:[],create(e){if(!(e.filename.endsWith(".jsx")||e.filename.endsWith(".tsx")))return{};if(!e.sourceCode.ast.body.some(a=>a.type===se.AST_NODE_TYPES.ImportDeclaration&&a.source.value==="t-state-form"))return{};let n=null,s=!1;return{CallExpression(a){if(s)return;if(!n){let p=ts(a);p&&(n=p);return}let i=ns(a,e.sourceCode);if(i){s=!0;for(let p of i)n.delete(p);if(n.size!==0)for(let[p,l]of n)e.report({node:l,messageId:"unusedField",data:{name:p}})}}}}});function ts(e){if(!(e.callee.type===se.AST_NODE_TYPES.Identifier&&e.callee.name==="useForm"))return null;let r=e.arguments[0];if(!r||r.type!==se.AST_NODE_TYPES.ObjectExpression)return null;let n=$t(r.properties,a=>a.type!==se.AST_NODE_TYPES.Property||a.key.type!==se.AST_NODE_TYPES.Identifier||a.key.name!=="initialConfig"?null:a.value.type===se.AST_NODE_TYPES.ObjectExpression?a.value:a.value.type===se.AST_NODE_TYPES.ArrowFunctionExpression||a.value.type===se.AST_NODE_TYPES.FunctionExpression?rs(a.value):null);if(!n)return null;let s=new Map;for(let a of n.properties)a.type===se.AST_NODE_TYPES.Property&&a.key.type===se.AST_NODE_TYPES.Identifier&&s.set(a.key.name,a);return s}function ns(e,t){if(!(e.callee.type===se.AST_NODE_TYPES.Identifier&&e.callee.name==="useFormState")||e.parent.type!==se.AST_NODE_TYPES.VariableDeclarator||e.parent.id.type!==se.AST_NODE_TYPES.ObjectPattern||!$t(e.parent.id.properties,i=>i.type===se.AST_NODE_TYPES.Property&&i.key.type===se.AST_NODE_TYPES.Identifier&&i.key.name==="formFields"&&i))return null;let s=er(e.parent,"formFields",t),a=new Set;for(let{identifier:i}of s){if(i.type!==se.AST_NODE_TYPES.Identifier||i.parent.type===se.AST_NODE_TYPES.Property&&i.parent.parent.type===se.AST_NODE_TYPES.ObjectExpression&&i.parent.parent.parent.type===se.AST_NODE_TYPES.ReturnStatement||i.parent.type===se.AST_NODE_TYPES.ReturnStatement)return null;if(i.parent.type===se.AST_NODE_TYPES.MemberExpression){if(i.parent.object.type!==se.AST_NODE_TYPES.Identifier||i.parent.property.type!==se.AST_NODE_TYPES.Identifier)return null;a.add(i.parent.property.name)}}return a}function rs(e){if(e.body.type===se.AST_NODE_TYPES.ObjectExpression)return e.body;if(e.body.type===se.AST_NODE_TYPES.BlockStatement){let t=e.body.body.filter(r=>r.type===se.AST_NODE_TYPES.ReturnStatement);return t.length!==1||!t[0]||t[0].argument?.type!==se.AST_NODE_TYPES.ObjectExpression?null:t[0].argument}return null}var ne=require("@typescript-eslint/utils"),pt=require("zod/v4");var is=ne.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`);function hr(e){let t=[];for(let r of e.members)r.type===ne.AST_NODE_TYPES.TSPropertySignature&&r.key.type===ne.AST_NODE_TYPES.Identifier&&t.push([r.key.name,r]);return t}function Er(e,...t){for(let r of t)e.set(...r);return e}var os=pt.z.object({forceCheckOnFCPropTypesWithName:pt.z.array(pt.z.string()).optional(),alwaysCheckFunctionOptionTypes:pt.z.boolean().optional()}),br="no-unused-type-props-in-args",pn=null,ss=is({name:br,meta:{type:"problem",docs:{description:"Disallow unused undestructured object type properties"},messages:{unusedObjectTypeProperty:"Object type property '{{ propertyName }}' is defined but never used",missingComponentParam:"Component has declared props but no props are used"},schema:[J(os)],fixable:"code"},defaultOptions:[{alwaysCheckFunctionOptionTypes:!0}],create(e,[t]){let{forceCheckOnFCPropTypesWithName:r,alwaysCheckFunctionOptionTypes:n=!0}=t;r&&!pn&&(pn=r.map(l=>new RegExp(l)));function s(l,c,d,y,g=!0,b=!1){let f=d.name,E=e.sourceCode.getScope(c).references.find(o=>o.identifier.name===f)?.resolved,h=l&&pn?.some(o=>o.test(f)),m=b&&n;if(!E||!h&&E.references.filter(o=>o.isTypeReference).length>1||!E.defs[0])return;let A=E.defs[0].node,I=A.parent?.type===ne.AST_NODE_TYPES.ExportNamedDeclaration;if(!(g&&I&&!m)){if(A.type===ne.AST_NODE_TYPES.TSTypeAliasDeclaration){a(l,c,y,A.typeAnnotation,!0,b);return}if(A.type===ne.AST_NODE_TYPES.TSInterfaceDeclaration){a(l,c,y,A.body,!0,b);return}}}function a(l,c,d,y,g,b=!1){if(y.type===ne.AST_NODE_TYPES.TSInterfaceBody){for(let f of y.body)f.type===ne.AST_NODE_TYPES.TSPropertySignature&&f.key.type===ne.AST_NODE_TYPES.Identifier&&d.set(f.key.name,f);return}if(y.type===ne.AST_NODE_TYPES.TSTypeLiteral){Er(d,...hr(y));return}if(y.type===ne.AST_NODE_TYPES.TSIntersectionType){for(let f of y.types)a(l,c,d,f,!0,b);return}g||y.type===ne.AST_NODE_TYPES.TSTypeReference&&y.typeName.type===ne.AST_NODE_TYPES.Identifier&&s(l,c,y.typeName,d,!0,b)}function i(l,c,d,y=!1){for(let g of d)if(g.type===ne.AST_NODE_TYPES.ObjectPattern&&g.typeAnnotation){let b=new Map;if(a(l,c,b,g.typeAnnotation.typeAnnotation,!1,y),b.size===0)continue;p(g,b)}else g.type===ne.AST_NODE_TYPES.AssignmentPattern&&g.left.type===ne.AST_NODE_TYPES.ObjectPattern&&i(l,c,[g.left],y)}function p(l,c){let d=[];if(l.properties.at(-1)?.type===ne.AST_NODE_TYPES.RestElement)return;for(let f of l.properties)f.type===ne.AST_NODE_TYPES.Property&&f.key.type===ne.AST_NODE_TYPES.Identifier&&d.push(f.key.name);let g=[],b=[];for(let[f,E]of c)d.includes(f)||(b.push(f),g.push({node:E,messageId:"unusedObjectTypeProperty",data:{propertyName:f}}));for(let[f,E]of g.entries())e.report({...E,fix:f===g.length-1?h=>{let m=l.properties.at(-1),A=b.join(", ");return m?m.type===ne.AST_NODE_TYPES.RestElement?null:h.insertTextAfter(m,`, ${A}`):h.insertTextBeforeRange([l.range[0]+1,l.range[1]],A)}:void 0})}return{VariableDeclaration(l){let c=l.declarations[0],d=new Map,y=c.id.type===ne.AST_NODE_TYPES.Identifier&&c.id.typeAnnotation?.typeAnnotation.type===ne.AST_NODE_TYPES.TSTypeReference&&c.id.typeAnnotation.typeAnnotation.typeName.type===ne.AST_NODE_TYPES.Identifier&&c.id.typeAnnotation.typeAnnotation.typeName.name==="FC"&&c.id.typeAnnotation.typeAnnotation.typeArguments?.params[0];if(y){if(y.type===ne.AST_NODE_TYPES.TSTypeReference&&y.typeName.type===ne.AST_NODE_TYPES.Identifier)s(!0,l,y.typeName,d,!1);else if(y.type===ne.AST_NODE_TYPES.TSTypeLiteral)Er(d,...hr(y));else if(y.type===ne.AST_NODE_TYPES.TSIntersectionType)for(let g of y.types)g.type===ne.AST_NODE_TYPES.TSTypeReference&&g.typeName.type===ne.AST_NODE_TYPES.Identifier?s(!0,l,g.typeName,d,!1):a(!0,l,d,g,!0);if(d.size!==0&&c.init?.type===ne.AST_NODE_TYPES.ArrowFunctionExpression){let g=c.init.params[0];if(!g){e.report({node:c.init,messageId:"missingComponentParam"});return}g.type===ne.AST_NODE_TYPES.ObjectPattern&&p(g,d)}}},FunctionDeclaration(l){i(!1,l,l.params,n)},ArrowFunctionExpression(l){i(!1,l,l.params,n)}}}}),cn={name:br,rule:ss};var Pe=require("@typescript-eslint/utils");var un=X({name:"no-write-only-ref",meta:{type:"problem",docs:{description:"Disallow creating refs that are never read"},messages:{refNotRead:'Ref "{{name}}" is never read. Consider removing it if not needed.'},schema:[]},defaultOptions:[],create(e){let t=new Set;function r(n){return n.callee.type===Pe.AST_NODE_TYPES.Identifier?t.has(n.callee.name):n.callee.type===Pe.AST_NODE_TYPES.MemberExpression&&n.callee.object.type===Pe.AST_NODE_TYPES.Identifier&&n.callee.property.type===Pe.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===Pe.AST_NODE_TYPES.ImportSpecifier&&s.imported.type===Pe.AST_NODE_TYPES.Identifier&&s.imported.name==="useRef"&&t.add(s.local.name)},VariableDeclarator(n){if(n.init&&n.init.type===Pe.AST_NODE_TYPES.CallExpression&&r(n.init)&&n.id.type===Pe.AST_NODE_TYPES.Identifier){let a=e.sourceCode.getScope(n).set.get(n.id.name);if(a){let i=!1;for(let p of a.references){let c=p.identifier.parent;if(c!==n&&!(c.type===Pe.AST_NODE_TYPES.JSXExpressionContainer&&c.parent.type===Pe.AST_NODE_TYPES.JSXAttribute&&c.parent.name.type===Pe.AST_NODE_TYPES.JSXIdentifier&&c.parent.name.name==="ref")){i=!0;break}}i||e.report({node:n.id,messageId:"refNotRead",data:{name:n.id.name}})}}}}}});var tt=require("@typescript-eslint/utils"),as=tt.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),Cr="prefer-named-functions",xr=new Map,ls=as({name:Cr,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=xr.get(t.ignoreRegex);n?r=n:(r=new RegExp(t.ignoreRegex),xr.set(t.ignoreRegex,r))}return{VariableDeclarator(n){if(n.init&&n.init.type===tt.AST_NODE_TYPES.ArrowFunctionExpression&&n.id.type===tt.AST_NODE_TYPES.Identifier){let s=n.id.name;if(n.id.typeAnnotation||r&&r.test(s)||!t.disallowArrowFnWithImplicitReturns&&n.init.body.type!==tt.AST_NODE_TYPES.BlockStatement)return;let a=n.parent,i=n.init.params,p=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:c=>c.replaceText(a,`${l.async?"async ":""}function ${s}(${i.map(d=>e.sourceCode.getText(d)).join(", ")||""}) ${e.sourceCode.getText(p)}`)}]})}}}}}),fn={name:Cr,rule:ls};var H=require("@typescript-eslint/utils"),De=require("zod/v4");var ps=De.z.object({disallowedFunctions:De.z.array(De.z.object({name:De.z.string(),allowUsingWithArgs:De.z.boolean().optional(),hookAlternative:De.z.string().optional(),message:De.z.string().optional(),allowUseInside:De.z.array(De.z.string()).optional()}))}),cs=/^use[A-Z]/,us=/^[A-Z]/;function bt(e){return cs.test(e)}function Ir(e){return us.test(e)}function fs(e){return e.type===H.AST_NODE_TYPES.Identifier?bt(e.name):e.type===H.AST_NODE_TYPES.MemberExpression&&e.property.type===H.AST_NODE_TYPES.Identifier?bt(e.property.name):!1}function Ar(e,t){return e.type===H.AST_NODE_TYPES.Identifier?e.name===t:e.type===H.AST_NODE_TYPES.MemberExpression&&e.object.type===H.AST_NODE_TYPES.Identifier&&e.property.type===H.AST_NODE_TYPES.Identifier?e.object.name==="React"&&e.property.name===t:!1}function wr(e){return!!(e.parent&&e.parent.type===H.AST_NODE_TYPES.CallExpression&&Ar(e.parent.callee,"forwardRef"))}function Rr(e){return!!(e.parent&&e.parent.type===H.AST_NODE_TYPES.CallExpression&&Ar(e.parent.callee,"memo"))}function mn(e){if(e.type===H.AST_NODE_TYPES.FunctionDeclaration||e.type===H.AST_NODE_TYPES.FunctionExpression&&e.id)return e.id||void 0;if(e.type===H.AST_NODE_TYPES.FunctionExpression||e.type===H.AST_NODE_TYPES.ArrowFunctionExpression){if(e.parent.type===H.AST_NODE_TYPES.VariableDeclarator&&e.parent.init===e)return e.parent.id;if(e.parent.type===H.AST_NODE_TYPES.AssignmentExpression&&e.parent.right===e&&e.parent.operator==="=")return e.parent.left;if(e.parent.type===H.AST_NODE_TYPES.Property&&e.parent.value===e&&!e.parent.computed)return e.parent.key;if(e.parent.type===H.AST_NODE_TYPES.AssignmentPattern&&e.parent.right===e)return e.parent.left}}function ms(e){let t=e.parent,r=!1;for(;t;){if(t.type===H.AST_NODE_TYPES.FunctionDeclaration||t.type===H.AST_NODE_TYPES.FunctionExpression||t.type===H.AST_NODE_TYPES.ArrowFunctionExpression){let n=mn(t);if(n&&n.type===H.AST_NODE_TYPES.Identifier){if(Ir(n.name)||bt(n.name))return!r;r=!0}else{if(wr(t)||Rr(t))return!r;if(t.parent.type===H.AST_NODE_TYPES.CallExpression){let s=t.parent;fs(s.callee)||(r=!0)}else t.parent.type===H.AST_NODE_TYPES.JSXExpressionContainer||(r=!0)}}t=t.parent}return!1}function Pr(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 ds(e,t){if(!t.length)return!1;let r=e.parent;for(;r;){if(r.type===H.AST_NODE_TYPES.FunctionDeclaration||r.type===H.AST_NODE_TYPES.FunctionExpression||r.type===H.AST_NODE_TYPES.ArrowFunctionExpression){let n=mn(r);if(n&&n.type===H.AST_NODE_TYPES.Identifier&&t.includes(n.name))return!0}else if(r.type===H.AST_NODE_TYPES.CallExpression){let n=Pr(r);if(n&&t.includes(n))return!0}r=r.parent}return!1}function ys(e){return e.arguments.length>0&&!e.arguments.every(t=>t.type===H.AST_NODE_TYPES.Identifier&&t.name==="undefined")}function gs(e,t){let r=!1,n=e.parent;for(;n;){if(n.type===H.AST_NODE_TYPES.FunctionDeclaration||n.type===H.AST_NODE_TYPES.FunctionExpression||n.type===H.AST_NODE_TYPES.ArrowFunctionExpression){let s=mn(n);if(s&&s.type===H.AST_NODE_TYPES.Identifier){if(Ir(s.name)||bt(s.name)){r=!0;break}}else if(wr(n)||Rr(n)){r=!0;break}}n=n.parent}return r?t.length===0?ms(e):!ds(e,t):!1}var dn=X({name:"prefer-react-hook-alternative",meta:{type:"suggestion",docs:{description:"Prefer hook alternatives for certain functions in React components and hooks"},messages:{preferHookAlternative:"This function should not be used in react{{message}}."},schema:[J(ps)],hasSuggestions:!0},defaultOptions:[{disallowedFunctions:[]}],create(e,[t]){let{disallowedFunctions:r}=t,n=new Map(r.map(s=>[s.name,s]));return{CallExpression(s){let a=Pr(s);if(!a)return;let i=n.get(a);if(!i||i.allowUsingWithArgs&&ys(s))return;let p=i.allowUseInside||[];gs(s,p)&&e.report({node:s,messageId:"preferHookAlternative",data:{message:i.message?` ${i.message}`:` use ${i.hookAlternative} instead`},suggest:i.hookAlternative?[{messageId:"preferHookAlternative",data:{message:`Replace with ${i.hookAlternative}`,hookAlternative:i.hookAlternative},fix:l=>{let c=i.hookAlternative;return c?s.callee.type===H.AST_NODE_TYPES.Identifier?l.replaceText(s.callee,c):s.callee.type===H.AST_NODE_TYPES.MemberExpression&&s.callee.property.type===H.AST_NODE_TYPES.Identifier?l.replaceText(s.callee.property,c):null:null}}]:[]})}}}});var le=require("@typescript-eslint/utils"),xt=Fe(require("zod/v4"));var Ss=le.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),Fr="prefer-single-line-if",Ts=xt.default.object({maxLineLength:xt.default.number().optional(),maxNonSimpleConditionLength:xt.default.number().optional()}),hs=Ss({name:Fr,meta:{type:"suggestion",fixable:"code",docs:{description:"Enforce single-line if in simple if statements"},messages:{noSingleLineCurly:"If return statement with single statement body should be written in a single line"},schema:[J(Ts)]},defaultOptions:[{}],create(e,[t]){let r=e.sourceCode;return{IfStatement(n){if(n.consequent.type!==le.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 a=n.consequent.body[0];if(!a)return;if(a.type===le.AST_NODE_TYPES.ReturnStatement){if(!Or(a))return}else if(!(a.type===le.AST_NODE_TYPES.ContinueStatement||a.type===le.AST_NODE_TYPES.BreakStatement))return;if(n.test.type===le.AST_NODE_TYPES.LogicalExpression||n.test.type===le.AST_NODE_TYPES.ConditionalExpression)return;let i;if(t.maxNonSimpleConditionLength){let y=vr(n.test);if(!y&&n.test.type===le.AST_NODE_TYPES.UnaryExpression&&n.test.operator==="!"){let g=n.test.argument;vr(g)&&(y=!0)}if(y&&(i=r.getText(n.test),i.length>t.maxNonSimpleConditionLength))return}i||(i=r.getText(n.test));let p=r.getText(a);if(i.includes(`
|
|
18
|
+
`))return;let l=r.getTokenAfter(n);if(l&&l.type===le.AST_TOKEN_TYPES.Punctuator&&l.value==="}"){let y=r.getTokenAfter(l);if(y&&y.type===le.AST_TOKEN_TYPES.Keyword&&(y.value==="else"||y.value==="catch"))return}let c=Es(r,n),d=`if (${i}) ${p}`;t.maxLineLength&&d.length+c.length>t.maxLineLength||e.report({node:n,messageId:"noSingleLineCurly",fix:y=>y.replaceText(n,d)})}}}});function vr(e){return e.type===le.AST_NODE_TYPES.CallExpression||e.type===le.AST_NODE_TYPES.BinaryExpression||e.type===le.AST_NODE_TYPES.MemberExpression&&kr(e)}function kr(e){return e.object.type===le.AST_NODE_TYPES.MemberExpression?kr(e.object):e.object.type!==le.AST_NODE_TYPES.Identifier}function Es(e,t){return e.text.slice(t.range[0]-t.loc.start.column,t.range[0])}function Or(e){if(!e.argument)return!0;let t=e.argument;return t.type===le.AST_NODE_TYPES.ArrayExpression&&t.elements.length===0||t.type===le.AST_NODE_TYPES.ObjectExpression&&t.properties.length===0||t.type===le.AST_NODE_TYPES.Literal||t.type===le.AST_NODE_TYPES.Identifier||t.type===le.AST_NODE_TYPES.TemplateLiteral||t.type===le.AST_NODE_TYPES.TaggedTemplateExpression?!0:t.type===le.AST_NODE_TYPES.CallExpression?t.arguments.length===0:t.type===le.AST_NODE_TYPES.UnaryExpression?Or(t):!1}var yn={name:Fr,rule:hs};var $=require("@typescript-eslint/utils"),Sn=require("zod/v4");var bs=$.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),Lr="react-compiler-extra",xs=Sn.z.object({runOnlyWithEnableCompilerDirective:Sn.z.boolean().optional()}),Cs=/eslint +react-compiler\/react-compiler: +\["error/;function Mr(e){return e.type===$.AST_NODE_TYPES.Identifier?e.name.startsWith("use"):!1}function Is(e){return e.type===$.AST_NODE_TYPES.Identifier?e.name.startsWith("use"):e.type===$.AST_NODE_TYPES.MemberExpression&&e.property.type===$.AST_NODE_TYPES.Identifier?e.property.name.startsWith("use"):!1}function je(e){if(!e)return!1;switch(e.type){case $.AST_NODE_TYPES.JSXElement:case $.AST_NODE_TYPES.JSXFragment:return!0;case $.AST_NODE_TYPES.ConditionalExpression:return je(e.consequent)||je(e.alternate);case $.AST_NODE_TYPES.LogicalExpression:return e.operator==="&&"?je(e.right):e.operator==="||"?je(e.left)||je(e.right):!1;case $.AST_NODE_TYPES.CallExpression:if(e.callee.type===$.AST_NODE_TYPES.MemberExpression&&e.callee.object.type===$.AST_NODE_TYPES.Identifier&&e.callee.object.name==="React"&&e.callee.property.type===$.AST_NODE_TYPES.Identifier&&e.callee.property.name==="createElement")return!0;for(let t of e.arguments)if(t.type!==$.AST_NODE_TYPES.SpreadElement&&je(t))return!0;return!1;default:return!1}}function As(e){let t=e.typeAnnotation;if(t.type===$.AST_NODE_TYPES.TSTypeReference){if(t.typeName.type===$.AST_NODE_TYPES.Identifier)return t.typeName.name==="FC";if(t.typeName.type===$.AST_NODE_TYPES.TSQualifiedName&&t.typeName.left.type===$.AST_NODE_TYPES.Identifier&&t.typeName.right.type===$.AST_NODE_TYPES.Identifier)return t.typeName.left.name==="React"&&t.typeName.right.name==="FC"}return!1}var ws=/^[A-Z][a-zA-Z0-9]*$/;function ut(e){return ws.test(e)}function Tn(e){return e.startsWith("use")&&e.length>3}function hn(e,t,r,n){if(r&&As(r))return t?ut(t.name):e.type===$.AST_NODE_TYPES.FunctionDeclaration&&e.id?ut(e.id.name):!0;if(t&&Tn(t.name)||e.type===$.AST_NODE_TYPES.FunctionDeclaration&&e.id&&Tn(e.id.name))return!0;if(n){let s=t?.name||e.type===$.AST_NODE_TYPES.FunctionDeclaration&&e.id?.name;if(s&&ut(s)&&$r(e.body,n).containsJSX)return!0}return!1}function ct(e){if(e.body.type===$.AST_NODE_TYPES.BlockStatement){for(let t of e.body.body)if(t.type===$.AST_NODE_TYPES.ExpressionStatement&&t.expression.type===$.AST_NODE_TYPES.Literal&&typeof t.expression.value=="string"&&t.expression.value==="use memo")return!0}return!1}function $r(e,t){let r={containsJSX:!1,containsHookCalls:!1};return ke(e,n=>{if(r.containsJSX&&r.containsHookCalls)return!0;switch(n.type){case $.AST_NODE_TYPES.JSXElement:case $.AST_NODE_TYPES.JSXFragment:r.containsJSX=!0;break;case $.AST_NODE_TYPES.CallExpression:Mr(n.callee)&&(r.containsHookCalls=!0),je(n)&&(r.containsJSX=!0);break;case $.AST_NODE_TYPES.ReturnStatement:n.argument&&je(n.argument)&&(r.containsJSX=!0);break;case $.AST_NODE_TYPES.VariableDeclarator:n.init&&je(n.init)&&(r.containsJSX=!0);break;case $.AST_NODE_TYPES.AssignmentExpression:je(n.right)&&(r.containsJSX=!0);break}},t),r}function Nr(e,t){let r=e.body,n=$r(r,t);return n.containsJSX||n.containsHookCalls}var Rs=/\bthis[.[]/;function Dr(e){return Rs.test(e)}function Ps(e,t){let r={containsJSX:!1,containsHookCalls:!1};return ke(e,n=>{if(r.containsHookCalls||(n.type===$.AST_NODE_TYPES.FunctionDeclaration||n.type===$.AST_NODE_TYPES.FunctionExpression||n.type===$.AST_NODE_TYPES.ArrowFunctionExpression)&&n!==e)return!0;n.type===$.AST_NODE_TYPES.CallExpression&&Is(n.callee)&&(r.containsHookCalls=!0)},t),r}function jr(e){return ut(e)||Tn(e)}function gn(e,t,r,n){if(!Ps(e.body,t).containsHookCalls)return!1;let a=hn(e,r,n,t);if(!a&&n){let i=r?.name||e.type===$.AST_NODE_TYPES.FunctionDeclaration&&e.id?.name;i&&ut(i)&&(a=!0)}return!a}var vs=bs({name:Lr,meta:{type:"suggestion",fixable:"code",docs:{description:"Extra rules to enforce best practices when using the React compiler"},messages:{objectMethodIsNotSupported:"Object methods such as `{ method() {} }` have limited support to optimizations in the React compiler, use a function expression `{ method: () => {} }` instead.",replaceWithFunctionExpression:"Replace with function expression",thisKeywordInMethod:"Object method uses `this` keyword which would have different behavior if converted to an arrow function. Fix this manually.",fcComponentShouldReturnJsx:'React components and hooks should create JSX elements, call other hooks or use the "use memo" directive for optimal React compiler detection.',addUseMemoDirective:'Add "use memo" directive to opt into React compiler memoization',functionCallingHooksMustBeComponent:'Functions calling hooks must be React components (PascalCase with FC type) or hooks (start with "use").',useMemoDirectiveNaming:'Functions using "use memo" directive must follow React naming conventions (PascalCase for components or start with "use" for hooks).'},hasSuggestions:!0,schema:[J(xs)]},defaultOptions:[{}],create(e,[t]){let r=!1;if(t.runOnlyWithEnableCompilerDirective){for(let a of e.sourceCode.getAllComments())if(Cs.test(a.value)){r=!0;break}if(!r)return{}}function n(a){for(let i of a.properties)if(i.type===$.AST_NODE_TYPES.Property&&i.method&&i.value.type===$.AST_NODE_TYPES.FunctionExpression){let p=e.sourceCode,l=p.getText(i.key),c=i.value,d=p.getText(c.body);if(Dr(d))e.report({node:i,messageId:"thisKeywordInMethod"});else{let y=c.params.map(b=>p.getText(b)).join(", "),g="";c.generator?g=`${l}: function* (${y}) ${d}`:g=`${l}: (${y}) => ${d}`,e.report({node:i,messageId:"objectMethodIsNotSupported",fix:b=>b.replaceText(i,g)})}}}function s(a){for(let i of a.properties)if(i.type===$.AST_NODE_TYPES.Property&&i.value.type===$.AST_NODE_TYPES.ObjectExpression){for(let p of i.value.properties)if(p.type===$.AST_NODE_TYPES.Property&&p.method&&p.value.type===$.AST_NODE_TYPES.FunctionExpression){let c=e.sourceCode.getText(p.value.body);Dr(c)&&e.report({node:p,messageId:"thisKeywordInMethod"})}}}return{CallExpression(a){if(Mr(a.callee))for(let i of a.arguments){if(i.type===$.AST_NODE_TYPES.ObjectExpression&&(n(i),s(i)),i.type===$.AST_NODE_TYPES.ArrowFunctionExpression&&(i.body.type===$.AST_NODE_TYPES.ObjectExpression&&(n(i.body),s(i.body)),i.body.type===$.AST_NODE_TYPES.BlockStatement))for(let p of i.body.body)p.type===$.AST_NODE_TYPES.ReturnStatement&&p.argument?.type===$.AST_NODE_TYPES.ObjectExpression&&(n(p.argument),s(p.argument));if(i.type===$.AST_NODE_TYPES.FunctionExpression)for(let p of i.body.body)p.type===$.AST_NODE_TYPES.ReturnStatement&&p.argument?.type===$.AST_NODE_TYPES.ObjectExpression&&(n(p.argument),s(p.argument))}},VariableDeclarator(a){if(a.id.type===$.AST_NODE_TYPES.Identifier&&a.init&&(a.init.type===$.AST_NODE_TYPES.ArrowFunctionExpression||a.init.type===$.AST_NODE_TYPES.FunctionExpression)){let i=a.init,p=a.id,l=a.id.typeAnnotation;if(ct(i)&&!jr(p.name)){e.report({node:i,messageId:"useMemoDirectiveNaming"});return}if(gn(i,e.sourceCode,p,l)){e.report({node:i,messageId:"functionCallingHooksMustBeComponent"});return}if(hn(i,p,l,e.sourceCode)){let c=Nr(i,e.sourceCode),d=ct(i);!c&&!d&&e.report({node:i,messageId:"fcComponentShouldReturnJsx",suggest:[{messageId:"addUseMemoDirective",fix(y){if(i.body.type===$.AST_NODE_TYPES.BlockStatement){let g=i.body.range[0]+1;return y.insertTextAfterRange([g,g],`
|
|
19
19
|
"use memo"
|
|
20
|
-
`)}return null}}]})}}},FunctionDeclaration(a){if(a.id&&
|
|
20
|
+
`)}return null}}]})}}},FunctionDeclaration(a){if(a.id&&ct(a)&&!jr(a.id.name)){e.report({node:a,messageId:"useMemoDirectiveNaming"});return}if(gn(a,e.sourceCode)){e.report({node:a,messageId:"functionCallingHooksMustBeComponent"});return}if(hn(a,void 0,void 0,e.sourceCode)){let i=Nr(a,e.sourceCode),p=ct(a);!i&&!p&&e.report({node:a,messageId:"fcComponentShouldReturnJsx",suggest:[{messageId:"addUseMemoDirective",fix(l){let c=a.body.range[0]+1;return l.insertTextAfterRange([c,c],`
|
|
21
21
|
"use memo"
|
|
22
|
-
`)}}]})}},FunctionExpression(a){if(
|
|
22
|
+
`)}}]})}},FunctionExpression(a){if(ct(a)){e.report({node:a,messageId:"useMemoDirectiveNaming"});return}gn(a,e.sourceCode)&&e.report({node:a,messageId:"functionCallingHooksMustBeComponent"})}}}}),En={name:Lr,rule:vs};var Ee=require("@typescript-eslint/utils"),Oe=require("zod/v4");var Fs=Ee.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),_r="react-compiler-migration",ks=Oe.z.object({disallowHooks:Oe.z.array(Oe.z.object({name:Oe.z.string(),replacement:Oe.z.string()})).optional(),disallowMethods:Oe.z.array(Oe.z.object({name:Oe.z.string(),replacement:Oe.z.string().optional(),requireTrueProp:Oe.z.string().optional()})).optional()}),Os=/eslint +react-compiler\/react-compiler: +\["error/;function Ns(e){return e.type===Ee.AST_NODE_TYPES.Identifier?e.name.startsWith("use"):e.type===Ee.AST_NODE_TYPES.MemberExpression&&e.property.type===Ee.AST_NODE_TYPES.Identifier?e.property.name.startsWith("use"):!1}var Ds=Fs({name:_r,meta:{type:"suggestion",fixable:"code",docs:{description:"Rules to help migrate to the new React compiler"},messages:{disallowedFunctionOrMethod:"{{functionOrMethod}} is not supported in react compiler. Use {{replacement}} instead.",replace:"Replace with safe alternative {{replacement}}",disallowedMethodWithMissingRequireTrueProp:"{{method}} is should have a prop named {{requireTrueProp}} set to true when used in react compiler."},hasSuggestions:!0,schema:[J(ks)]},defaultOptions:[{disallowHooks:[],disallowMethods:[]}],create(e,[t]){let r=!1;for(let n of e.sourceCode.getAllComments())if(Os.test(n.value)){r=!0;break}return r?{CallExpression(n){if(t.disallowHooks?.length){let s=null,a=null;if(n.callee.type===Ee.AST_NODE_TYPES.Identifier?(s=n.callee.name,a=n.callee):n.callee.type===Ee.AST_NODE_TYPES.MemberExpression&&n.callee.property.type===Ee.AST_NODE_TYPES.Identifier&&(s=n.callee.property.name,a=n.callee.property),s){let i=t.disallowHooks.find(p=>p.name===s);i&&a&&e.report({node:n,messageId:"disallowedFunctionOrMethod",data:{functionOrMethod:i.name,replacement:i.replacement},suggest:[{messageId:"replace",data:{replacement:i.replacement},fix:p=>p.replaceText(a,i.replacement)}]})}}if(t.disallowMethods?.length&&Ns(n.callee)){for(let s of n.arguments)if(s.type===Ee.AST_NODE_TYPES.ObjectExpression){for(let a of s.properties)if(a.type===Ee.AST_NODE_TYPES.Property&&a.key.type===Ee.AST_NODE_TYPES.Identifier){let i=a.key.name,p=t.disallowMethods.find(l=>l.name===i);if(p){if(p.requireTrueProp){let l=p.requireTrueProp,c=!1;for(let d of s.properties)if(d.type===Ee.AST_NODE_TYPES.Property&&d.key.type===Ee.AST_NODE_TYPES.Identifier&&d.key.name===l&&d.value.type===Ee.AST_NODE_TYPES.Literal&&d.value.value===!0){c=!0;break}if(!c){e.report({node:a,messageId:"disallowedMethodWithMissingRequireTrueProp",data:{method:p.name,requireTrueProp:l}});continue}}p.replacement&&e.report({node:a,messageId:"disallowedFunctionOrMethod",data:{functionOrMethod:p.name,replacement:p.replacement},suggest:[{messageId:"replace",data:{replacement:p.replacement},fix:l=>p.replacement?l.replaceText(a.key,p.replacement):null}]})}}}}}}:{}}}),bn={name:_r,rule:Ds};var L=require("@typescript-eslint/utils"),Cn=require("zod");var js=Cn.z.object({runOnlyWithEnableCompilerDirective:Cn.z.boolean().optional()}),Ls=/eslint +react-compiler\/react-compiler: +\["error/,Ms=/^\d+$/,$s=/[\s_-]+/,_s=/[a-z][A-Z]/,Us=/^(.+?)([A-Z][a-z]+s?)$/,zs=/^[a-z][a-zA-Z]*$/;function Ur(e,t){let r=[];if(e.type===L.AST_NODE_TYPES.JSXElement){for(let n of e.openingElement.attributes)if(n.type===L.AST_NODE_TYPES.JSXAttribute&&n.name.type===L.AST_NODE_TYPES.JSXIdentifier&&n.value?.type===L.AST_NODE_TYPES.JSXExpressionContainer&&n.value.expression.type!==L.AST_NODE_TYPES.JSXEmptyExpression){let s=n.name.name,a=n.value.expression,i=!1;ke(a,p=>{switch(p.type){case L.AST_NODE_TYPES.ObjectExpression:case L.AST_NODE_TYPES.ArrowFunctionExpression:case L.AST_NODE_TYPES.FunctionExpression:case L.AST_NODE_TYPES.ArrayExpression:return i=!0,!0}return!1},t),i&&r.push(s)}}return{hasUnstable:r.length>0,problematicProps:r}}function Ws(e){if(e.body.type===L.AST_NODE_TYPES.JSXElement||e.body.type===L.AST_NODE_TYPES.JSXFragment)return!0;if(e.body.type===L.AST_NODE_TYPES.BlockStatement){for(let t of e.body.body)if(t.type===L.AST_NODE_TYPES.ReturnStatement&&t.argument&&(t.argument.type===L.AST_NODE_TYPES.JSXElement||t.argument.type===L.AST_NODE_TYPES.JSXFragment))return!0}return!1}function Js(e,t){let r=e.callee;if(r.type===L.AST_NODE_TYPES.MemberExpression){let n=r.object;if(n.type===L.AST_NODE_TYPES.Identifier){let s=n.name,a=Vs(s);if(a!==s)return In(a)}}if(t.length>0){let n=t[0];if(n&&n.type===L.AST_NODE_TYPES.Identifier)return In(n.name)}return"ListItem"}function Vs(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(_s)){let n=e.match(Us);if(n){let s=n[1],a=n[2];if(!s||!a)return xn(e);let i=xn(a);if(i!==a)return s+i}}return xn(e)}function xn(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 In(e){return e.match(zs)?e.charAt(0).toUpperCase()+e.slice(1):e.split($s).map(t=>t.charAt(0).toUpperCase()+t.slice(1).toLowerCase()).join("")}function zr(e,t,r){let n=[],s=new Set,a=new Set(["console","document","window","Math","Object","Array","String","Number","Boolean","undefined","null"]);ke(e,i=>{if(i.type===L.AST_NODE_TYPES.Identifier&&!t.includes(i.name)&&!a.has(i.name)&&!Ms.test(i.name)){let p=i.parent;if(p.type===L.AST_NODE_TYPES.Property&&p.key===i||p.type===L.AST_NODE_TYPES.MemberExpression&&p.property===i&&!p.computed||p.type===L.AST_NODE_TYPES.JSXOpeningElement||p.type===L.AST_NODE_TYPES.JSXClosingElement||p.type===L.AST_NODE_TYPES.JSXAttribute&&p.name.type===L.AST_NODE_TYPES.JSXIdentifier&&p.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 Wr(e,t,r,n,s){let i=[...r.map(y=>y.type===L.AST_NODE_TYPES.Identifier?y.name:"item").map((y,g)=>({name:y,type:g===0?`${e}Type`:g===1?"number":"unknown"})),...n],p=i.map(y=>{let g=y.type;return y.name.includes("on")&&g==="any"&&(g="unknown"),` ${y.name}: ${g};`}).join(`
|
|
23
23
|
`),l=i.map(y=>y.name).join(", "),c=s.getText(t),d=`${e}Props`;return`type ${d} = {
|
|
24
24
|
${p}
|
|
25
25
|
};
|
|
@@ -28,28 +28,28 @@ const ${e}: FC<${d}> = ({ ${l} }) => {
|
|
|
28
28
|
return (
|
|
29
29
|
${c}
|
|
30
30
|
);
|
|
31
|
-
};`}function Xs(e,t,r,n){let s=t.map(i=>i.type===
|
|
31
|
+
};`}function Xs(e,t,r,n){let s=t.map(i=>i.type===L.AST_NODE_TYPES.Identifier?i.name:"item"),a=[n?`key={${n}}`:`key={${s[0]}.id}`,...s.map(i=>`${i}={${i}}`),...r.map(i=>`${i.name}={${i.name}}`)].filter(Boolean);return`<${e} ${a.join(" ")} />`}function Bs(e){if(e.type===L.AST_NODE_TYPES.JSXElement&&e.openingElement.name.type===L.AST_NODE_TYPES.JSXIdentifier){let t=e.openingElement.name.name;if(t!=="div"&&t!=="span")return In(t)}return"ListItem"}function Hs(e,t,r){let n=[r?`key={${r}}`:"",...t.map(s=>`${s.name}={${s.name}}`)].filter(Boolean);return`<${e}${n.length>0?` ${n.join(" ")}`:""} />`}function Jr(e,t){for(let r of e.openingElement.attributes)if(r.type===L.AST_NODE_TYPES.JSXAttribute&&r.name.type===L.AST_NODE_TYPES.JSXIdentifier&&r.name.name==="key"&&r.value&&r.value.type===L.AST_NODE_TYPES.JSXExpressionContainer&&r.value.expression.type!==L.AST_NODE_TYPES.JSXEmptyExpression)return t.getText(r.value.expression);return null}var An=X({name:"react-optimized-collections",meta:{type:"suggestion",docs:{description:"Detect unstable values in map renders that prevent React Compiler optimization"},messages:{unstableValueInMap:"Unstable values in {{problematicProps}} prevent React Compiler from optimizing individual list items. Extract the problematic props to outside the loop or extract the item to a separate component.",extractComponent:"Extract to {{componentName}} component"},schema:[J(js)],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(Ls.test(s.value)){n=!0;break}if(!n)return{}}return{CallExpression(n){n.callee.type===L.AST_NODE_TYPES.MemberExpression&&n.callee.property.type===L.AST_NODE_TYPES.Identifier&&(n.callee.property.name==="map"||n.callee.property.name==="push")&&(n.callee.property.name==="map"?Ys(n,r,e):qs(n,r,e))}}}});function Ys(e,t,r){let n=e.arguments[0];if(!n||n.type!==L.AST_NODE_TYPES.ArrowFunctionExpression&&n.type!==L.AST_NODE_TYPES.FunctionExpression||!Ws(n))return;let s=null;if(n.body.type===L.AST_NODE_TYPES.JSXElement||n.body.type===L.AST_NODE_TYPES.JSXFragment?s=n.body:n.body.type===L.AST_NODE_TYPES.BlockStatement&&n.body.body[0]?.type===L.AST_NODE_TYPES.ReturnStatement&&n.body.body[0].argument&&(n.body.body[0].argument.type===L.AST_NODE_TYPES.JSXElement||n.body.body[0].argument.type===L.AST_NODE_TYPES.JSXFragment)&&(s=n.body.body[0].argument),!s)return;let a=Ur(s,t);if(!a.hasUnstable)return;let i=Js(e,n.params),p=n.params.map(y=>y.type===L.AST_NODE_TYPES.Identifier?y.name:"item"),l=zr(s,p,t),c=s.type===L.AST_NODE_TYPES.JSXElement?Jr(s,t):null,d=a.problematicProps.length===1?`prop "${a.problematicProps[0]}"`:`props "${a.problematicProps.join('", "')}"`;r.report({node:s,messageId:"unstableValueInMap",data:{problematicProps:d},suggest:[{messageId:"extractComponent",data:{componentName:i},fix:y=>{let g=Wr(i,s,n.params,l,t),b=Xs(i,n.params,l,c),f=e;for(;f.parent.type!==L.AST_NODE_TYPES.Program&&!(f.type===L.AST_NODE_TYPES.FunctionDeclaration||f.type===L.AST_NODE_TYPES.VariableDeclarator&&f.init&&(f.init.type===L.AST_NODE_TYPES.ArrowFunctionExpression||f.init.type===L.AST_NODE_TYPES.FunctionExpression));)f=f.parent;let E=[];return E.push(y.insertTextAfter(f,`
|
|
32
32
|
|
|
33
|
-
${g}`)),E.push(y.replaceText(s,b)),E}}]})}function qs(e,t,r){let n=e.arguments[0];if(!n||n.type!==
|
|
33
|
+
${g}`)),E.push(y.replaceText(s,b)),E}}]})}function qs(e,t,r){let n=e.arguments[0];if(!n||n.type!==L.AST_NODE_TYPES.JSXElement&&n.type!==L.AST_NODE_TYPES.JSXFragment)return;let s=n,a=Ur(s,t);if(!a.hasUnstable)return;let i=Bs(s),p=zr(s,[],t),l=s.type===L.AST_NODE_TYPES.JSXElement?Jr(s,t):null,c=a.problematicProps.length===1?`prop "${a.problematicProps[0]}"`:`props "${a.problematicProps.join('", "')}"`;r.report({node:s,messageId:"unstableValueInMap",data:{problematicProps:c},suggest:[{messageId:"extractComponent",data:{componentName:i},fix:d=>{let y=Wr(i,s,[],p,t),g=Hs(i,p,l),b=e;for(;b.parent.type!==L.AST_NODE_TYPES.Program&&!(b.type===L.AST_NODE_TYPES.FunctionDeclaration||b.type===L.AST_NODE_TYPES.VariableDeclarator&&b.init&&(b.init.type===L.AST_NODE_TYPES.ArrowFunctionExpression||b.init.type===L.AST_NODE_TYPES.FunctionExpression));)b=b.parent;let f=[];return f.push(d.insertTextAfter(b,`
|
|
34
34
|
|
|
35
|
-
${y}`)),f.push(d.replaceText(s,g)),f}}]})}var Ct=require("@typescript-eslint/utils"),Zs=Ct.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),Xr="require-description",Gs=/^(eslint(?:-env|-enable|-disable(?:(?:-next)?-line)?)?|exported|globals?)(?:\s|$)/u,Ks=/^eslint-disable-(next-)?line$/u,Qs=Zs({name:Xr,meta:{type:"problem",docs:{description:"Require descriptions for eslint directives."},messages:{missingDescription:"Unexpected undescribed directive comment. Include descriptions to explain why the comment is necessary."},schema:[{type:"object",properties:{ignore:{type:"array",items:{type:"string",enum:["eslint","eslint-disable","eslint-disable-line","eslint-disable-next-line","eslint-enable","eslint-env","exported","global","globals"]},additionalItems:!1,uniqueItems:!0}},additionalProperties:!1}]},defaultOptions:[{ignore:[]}],create(e,[t]){let r=e.sourceCode,n=new Set(t.ignore||[]);return{Program(){for(let s of r.getAllComments()){let a=ea(s);a!=null&&(n.has(a.kind)||a.description||e.report({loc:ra(s.loc),messageId:"missingDescription"}))}}}}}),Br={name:Xr,rule:Qs};function ea(e){let{text:t,description:r}=na(e.value);if(!t)return null;let n=Gs.exec(t);if(!n)return null;let s=n[1];if(!s)return null;let a=Ks.test(s);if(e.type===Ct.TSESTree.AST_TOKEN_TYPES.Line&&!a||a&&e.loc.start.line!==e.loc.end.line)return null;let i=t.slice(n.index+s.length);return{kind:s,value:i.trim(),description:r}}var ta=/\s-{2,}\s/u;function na(e){let t=e.split(ta);return{text:t[0]?.trim(),description:t.length>1?t[1]?.trim()??null:null}}function ra(e){return{start:{line:e.start.line,column:-1},end:e.end}}var K=require("@typescript-eslint/utils"),Me=require("zod/v4");var ia=Me.z.object({varsToCheck:Me.z.array(Me.z.object({selector:Me.z.string().optional(),fromFnCall:Me.z.string().optional(),prop:Me.z.string().or(Me.z.array(Me.z.string())),errorMsg:Me.z.string().optional()}))}),Rn=B({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:[V(ia)]},defaultOptions:[{varsToCheck:[]}],create(e,[t]){let r=new Map;function n(i,p,l,c){let d=new Set;for(let g of i.properties)g.type===K.AST_NODE_TYPES.Property&&g.key.type===K.AST_NODE_TYPES.Identifier&&d.add(g.key.name);let y=p.filter(g=>!d.has(g));if(y.length>0)if(y.length===1)e.report({node:i,messageId:"propNotRead",data:{prop:y[0],fnName:c,customMsg:l||""}});else{let g=y.map(b=>`"${b}"`).join(", ");e.report({node:i,messageId:"propsNotRead",data:{props:g,fnName:c,customMsg:l||""}})}}function s(i){if(i.init?.type===K.AST_NODE_TYPES.CallExpression){if(i.init.callee.type===K.AST_NODE_TYPES.Identifier)return i.init.callee.name;if(i.init.callee.type===K.AST_NODE_TYPES.MemberExpression&&i.init.callee.property.type===K.AST_NODE_TYPES.Identifier)return i.init.callee.object.type===K.AST_NODE_TYPES.Identifier?`${i.init.callee.object.name}.${i.init.callee.property.name}`:i.init.callee.property.name}return"unknown function"}let a={};for(let i of t.varsToCheck)i.selector&&(a[i.selector]=p=>{if(p.type===K.AST_NODE_TYPES.VariableDeclarator&&p.id.type===K.AST_NODE_TYPES.Identifier&&r.set(p.id.name,{props:Array.isArray(i.prop)?i.prop:[i.prop],errorMsg:i.errorMsg,node:p.id,fnName:s(p)}),p.type===K.AST_NODE_TYPES.VariableDeclarator&&p.id.type===K.AST_NODE_TYPES.ObjectPattern){let l=Array.isArray(i.prop)?i.prop:[i.prop];n(p.id,l,i.errorMsg,s(p))}});for(let i of t.varsToCheck)if(i.fromFnCall){let p=i.fromFnCall;if(p.startsWith("*.")){let c=`VariableDeclarator > CallExpression > MemberExpression[property.name="${p.slice(2)}"]`;a[c]=d=>{if(d.type!==K.AST_NODE_TYPES.MemberExpression||d.parent.type!==K.AST_NODE_TYPES.CallExpression)return;let y=d.parent;if(y.parent.type!==K.AST_NODE_TYPES.VariableDeclarator)return;let g=y.parent;if(g.id.type===K.AST_NODE_TYPES.Identifier)r.set(g.id.name,{props:Array.isArray(i.prop)?i.prop:[i.prop],errorMsg:i.errorMsg,node:g.id,fnName:i.fromFnCall||"unknown function"});else if(g.id.type===K.AST_NODE_TYPES.ObjectPattern){let b=Array.isArray(i.prop)?i.prop:[i.prop];n(g.id,b,i.errorMsg,i.fromFnCall||"unknown function")}}}else if(p.includes(".")){let[l,c]=p.split("."),d=`VariableDeclarator > CallExpression > MemberExpression[object.name="${l}"][property.name="${c}"]`;a[d]=y=>{if(y.type!==K.AST_NODE_TYPES.MemberExpression||y.parent.type!==K.AST_NODE_TYPES.CallExpression)return;let g=y.parent;if(g.parent.type!==K.AST_NODE_TYPES.VariableDeclarator)return;let b=g.parent;if(b.id.type===K.AST_NODE_TYPES.Identifier)r.set(b.id.name,{props:Array.isArray(i.prop)?i.prop:[i.prop],errorMsg:i.errorMsg,node:b.id,fnName:i.fromFnCall||"unknown function"});else if(b.id.type===K.AST_NODE_TYPES.ObjectPattern){let f=Array.isArray(i.prop)?i.prop:[i.prop];n(b.id,f,i.errorMsg,i.fromFnCall||"unknown function")}}}else{let l=`VariableDeclarator > CallExpression > Identifier[name="${p}"]`;a[l]=c=>{if(c.type!==K.AST_NODE_TYPES.Identifier||c.parent.type!==K.AST_NODE_TYPES.CallExpression)return;let d=c.parent;if(d.parent.type!==K.AST_NODE_TYPES.VariableDeclarator)return;let y=d.parent;if(y.id.type===K.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===K.AST_NODE_TYPES.ObjectPattern){let g=Array.isArray(i.prop)?i.prop:[i.prop];n(y.id,g,i.errorMsg,i.fromFnCall||"unknown function")}}}}return{...a,"Program:exit"(){for(let[i,{props:p,errorMsg:l,node:c,fnName:d}]of r){let g=e.sourceCode.getScope(c).set.get(i);if(g){let b=new Set(p);for(let f of g.references){let E=f.identifier,h=E.parent;if(!(h.type===K.AST_NODE_TYPES.VariableDeclarator&&h.id===E)){if(h.type===K.AST_NODE_TYPES.MemberExpression&&h.object===E&&h.property.type===K.AST_NODE_TYPES.Identifier&&b.has(h.property.name)){if(b.delete(h.property.name),b.size===0)break;continue}if(h.type===K.AST_NODE_TYPES.VariableDeclarator&&h.init===E&&h.id.type===K.AST_NODE_TYPES.ObjectPattern){for(let m of h.id.properties)m.type===K.AST_NODE_TYPES.Property&&m.key.type===K.AST_NODE_TYPES.Identifier&&b.has(m.key.name)&&b.delete(m.key.name);if(b.size===0)break;continue}if(!(h.type===K.AST_NODE_TYPES.MemberExpression&&h.object===E&&h.property.type===K.AST_NODE_TYPES.Identifier&&!p.includes(h.property.name))){b.clear();break}}}if(b.size>0){let f=Array.from(b);if(f.length===1)e.report({node:c,messageId:"propNotRead",data:{prop:f[0],fnName:d,customMsg:l||""}});else{let E=f.map(h=>`"${h}"`).join(", ");e.report({node:c,messageId:"propsNotRead",data:{props:E,fnName:d,customMsg:l||""}})}}}}}}}});function qr(e){return/^use[A-Z0-9]/.test(e)}function It(e){return e.type==="Identifier"?qr(e.name):e.type==="MemberExpression"&&!e.computed&&It(e.property)?e.object.type==="Identifier":!1}function Zr(e){return e.type==="Identifier"&&/^[A-Z]/.test(e.name)}function Gr(e,t){return e.name===t||e.type==="MemberExpression"&&e.object.name==="React"&&e.property.name===t}function Kr(e){return!!(e.parent&&e.parent.callee&&Gr(e.parent.callee,"forwardRef"))}function Qr(e){return!!(e.parent&&e.parent.callee&&Gr(e.parent.callee,"memo"))}function Pn(e){for(;e;){let t=ti(e);if(t&&(Zr(t)||It(t))||Kr(e)||Qr(e))return!0;e=e.parent}return!1}function Hr(e){return!1}function vn(e){return!1}var oa=/eslint +react-compiler\/react-compiler: +\["error/,ei={meta:{type:"problem",docs:{description:"enforces the Rules of Hooks",recommended:!0,url:"https://reactjs.org/docs/hooks-rules.html"},schema:[{type:"object",ignoreIfReactCompilerIsEnabled:!1,properties:{ignoreIfReactCompilerIsEnabled:{type:"boolean"}}}]},create(e){if(e.options[0]?.ignoreIfReactCompilerIsEnabled){for(let l of e.sourceCode.getAllComments())if(oa.test(l.value))return{CallExpression(c){let d=null;c.callee.name==="useMemo"?d="useMemo":c.callee.name==="useCallback"&&(d="useCallback"),d&&e.report({node:c,message:`"${d}" is not necessary when using React Compiler.`})}}}let t=typeof e.getSource=="function"?l=>t(l):l=>e.sourceCode.getText(l),r=typeof e.getScope=="function"?()=>r():l=>e.sourceCode.getScope(l),n=null,s=[],a=[],i=new WeakSet;function p(l){for(let c of l.references){let d=c.identifier.parent;if(d.type==="VariableDeclarator"&&d.init&&d.init.type==="CallExpression"&&d.init.callee&&Hr(d.init.callee))for(let y of c.resolved.references)y!==c&&i.add(y.identifier)}}return{onCodePathSegmentStart:l=>a.push(l),onCodePathSegmentEnd:()=>a.pop(),onCodePathStart:()=>s.push(new Map),onCodePathEnd(l,c){let d=s.pop();if(d.size===0)return;let y=new Set;function g(o,S){let{cache:u}=g,T=u.get(o.id),w=new Set(S);if(w.has(o.id)){let R=[...w],v=R.slice(R.indexOf(o.id)+1);for(let x of v)y.add(x);return BigInt("0")}if(w.add(o.id),T!==void 0)return T;if(l.thrownSegments.includes(o))T=BigInt("0");else if(o.prevSegments.length===0)T=BigInt("1");else{T=BigInt("0");for(let R of o.prevSegments)T+=g(R,w)}return o.reachable&&T===BigInt("0")?u.delete(o.id):u.set(o.id,T),T}function b(o,S){let{cache:u}=b,T=u.get(o.id),w=new Set(S);if(w.has(o.id)){let R=Array.from(w),v=R.slice(R.indexOf(o.id)+1);for(let x of v)y.add(x);return BigInt("0")}if(w.add(o.id),T!==void 0)return T;if(l.thrownSegments.includes(o))T=BigInt("0");else if(o.nextSegments.length===0)T=BigInt("1");else{T=BigInt("0");for(let R of o.nextSegments)T+=b(R,w)}return u.set(o.id,T),T}function f(o){let{cache:S}=f,u=S.get(o.id);if(u===null)return 1/0;if(u!==void 0)return u;if(S.set(o.id,null),o.prevSegments.length===0)u=1;else{u=1/0;for(let T of o.prevSegments){let w=f(T);w<u&&(u=w)}u+=1}return S.set(o.id,u),u}g.cache=new Map,b.cache=new Map,f.cache=new Map;let E=b(l.initialSegment),h=ti(c),m=Pn(c),A=h?Zr(h)||It(h):Kr(c)||Qr(c),I=1/0;for(let o of l.finalSegments){if(!o.reachable)continue;let S=f(o);S<I&&(I=S)}for(let[o,S]of d){if(!o.reachable)continue;let u=o.nextSegments.length===0?I<=f(o):I<f(o),T=g(o)*b(o),w=y.has(o.id);for(let R of S)if(w&&!vn(R)&&e.report({node:R,message:`React Hook "${t(R)}" may be executed more than once. Possibly because it is called in a loop. React Hooks must be called in the exact same order in every component render.`}),A){if(c.async&&e.report({node:R,message:`React Hook "${t(R)}" cannot be called in an async function.`}),!w&&T!==E&&!vn(R)){let x=`React Hook "${t(R)}" is called conditionally. React Hooks must be called in the exact same order in every component render.`+(u?" Did you accidentally call a React Hook after an early return?":"");e.report({node:R,message:x})}}else if(c.parent&&(c.parent.type==="MethodDefinition"||c.parent.type==="ClassProperty")&&c.parent.value===c){let v=`React Hook "${t(R)}" cannot be called in a class component. React Hooks must be called in a React function component or a custom React Hook function.`;e.report({node:R,message:v})}else if(h){let v=`React Hook "${t(R)}" is called in function "${t(h)}" that is neither a React function component nor a custom React Hook function. React component names must start with an uppercase letter. React Hook names must start with the word "use".`;e.report({node:R,message:v})}else if(c.type==="Program"){let v=`React Hook "${t(R)}" cannot be called at the top level. React Hooks must be called in a React function component or a custom React Hook function.`;e.report({node:R,message:v})}else if(m&&!vn(R)){if(c.parent.type==="CallExpression"&&c.parent.callee.type==="Identifier"&&c.parent.callee.name==="useCallback"){let x=c.parent;if(x.parent.type==="VariableDeclarator"&&qr(x.parent.id.name))return}let v=`React Hook "${t(R)}" cannot be called inside a callback. React Hooks must be called in a React function component or a custom React Hook function.`;e.report({node:R,message:v})}}},CallExpression(l){if(It(l.callee)){let c=Yr(s),d=Yr(a),y=c.get(d);y||(y=[],c.set(d,y)),y.push(l.callee)}l.callee.type==="Identifier"&&(l.callee.name==="useEffect"||Hr(l.callee))&&l.arguments.length>0&&(n=l)},Identifier(l){n==null&&i.has(l)&&l.parent.type!=="CallExpression"&&e.report({node:l,message:`\`${t(l)}\` is a function created with React Hook "useEffectEvent", and can only be called from the same component. They cannot be assigned to variables or passed down.`})},"CallExpression:exit"(l){l===n&&(n=null)},FunctionDeclaration(l){Pn(l)&&p(r(l))},ArrowFunctionExpression(l){Pn(l)&&p(r(l))}}}};function ti(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 Yr(e){return e[e.length-1]}var de=require("@typescript-eslint/utils"),he=ke(require("zod/v4"));var sa=/^\s+$/,Fn=/\r?\n/,aa=/^(\s*)/,la=/^(\s*)\S/,pa=/\r?\n/,ca=he.object({indent:he.union([he.string().regex(sa),he.number().int().min(1)]).optional(),tags:he.array(he.string()).optional(),functions:he.array(he.string()).optional(),comments:he.array(he.string()).optional()}),kn=B({name:"template-indent",meta:{type:"suggestion",docs:{description:"Fix whitespace-insensitive template indentation"},fixable:"code",schema:[V(ca)],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:a}=e.options[0],i=r.map(m=>m.toLowerCase());function p(m){let A=m.split(Fn),I=A.filter(S=>S.trim()!=="");if(I.length===0)return m;let o=Number.POSITIVE_INFINITY;for(let S of I){let u=S.match(aa);u&&(o=Math.min(o,u[1]?.length??0))}return!isFinite(o)||o===0?m:A.map(S=>S.slice(o)).join(`
|
|
36
|
-
`)}function l(m,A,I){return m.split(
|
|
37
|
-
`)}function c(m){if(m.type===
|
|
35
|
+
${y}`)),f.push(d.replaceText(s,g)),f}}]})}var Ct=require("@typescript-eslint/utils"),Zs=Ct.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),Vr="require-description",Gs=/^(eslint(?:-env|-enable|-disable(?:(?:-next)?-line)?)?|exported|globals?)(?:\s|$)/u,Ks=/^eslint-disable-(next-)?line$/u,Qs=Zs({name:Vr,meta:{type:"problem",docs:{description:"Require descriptions for eslint directives."},messages:{missingDescription:"Unexpected undescribed directive comment. Include descriptions to explain why the comment is necessary."},schema:[{type:"object",properties:{ignore:{type:"array",items:{type:"string",enum:["eslint","eslint-disable","eslint-disable-line","eslint-disable-next-line","eslint-enable","eslint-env","exported","global","globals"]},additionalItems:!1,uniqueItems:!0}},additionalProperties:!1}]},defaultOptions:[{ignore:[]}],create(e,[t]){let r=e.sourceCode,n=new Set(t.ignore||[]);return{Program(){for(let s of r.getAllComments()){let a=ea(s);a!=null&&(n.has(a.kind)||a.description||e.report({loc:ra(s.loc),messageId:"missingDescription"}))}}}}}),Xr={name:Vr,rule:Qs};function ea(e){let{text:t,description:r}=na(e.value);if(!t)return null;let n=Gs.exec(t);if(!n)return null;let s=n[1];if(!s)return null;let a=Ks.test(s);if(e.type===Ct.TSESTree.AST_TOKEN_TYPES.Line&&!a||a&&e.loc.start.line!==e.loc.end.line)return null;let i=t.slice(n.index+s.length);return{kind:s,value:i.trim(),description:r}}var ta=/\s-{2,}\s/u;function na(e){let t=e.split(ta);return{text:t[0]?.trim(),description:t.length>1?t[1]?.trim()??null:null}}function ra(e){return{start:{line:e.start.line,column:-1},end:e.end}}var K=require("@typescript-eslint/utils"),Le=require("zod/v4");var ia=Le.z.object({varsToCheck:Le.z.array(Le.z.object({selector:Le.z.string().optional(),fromFnCall:Le.z.string().optional(),prop:Le.z.string().or(Le.z.array(Le.z.string())),errorMsg:Le.z.string().optional()}))}),wn=X({name:"require-reads-to-var-prop",meta:{type:"suggestion",docs:{description:"Require specific properties from variables to be read or ensure the variable is passed to functions/components"},messages:{propNotRead:'"{{fnName}}" requires reads to the prop "{{prop}}". {{customMsg}}',propsNotRead:'"{{fnName}}" requires reads to the props {{props}}. {{customMsg}}'},schema:[J(ia)]},defaultOptions:[{varsToCheck:[]}],create(e,[t]){let r=new Map;function n(i,p,l,c){let d=new Set;for(let g of i.properties)g.type===K.AST_NODE_TYPES.Property&&g.key.type===K.AST_NODE_TYPES.Identifier&&d.add(g.key.name);let y=p.filter(g=>!d.has(g));if(y.length>0)if(y.length===1)e.report({node:i,messageId:"propNotRead",data:{prop:y[0],fnName:c,customMsg:l||""}});else{let g=y.map(b=>`"${b}"`).join(", ");e.report({node:i,messageId:"propsNotRead",data:{props:g,fnName:c,customMsg:l||""}})}}function s(i){if(i.init?.type===K.AST_NODE_TYPES.CallExpression){if(i.init.callee.type===K.AST_NODE_TYPES.Identifier)return i.init.callee.name;if(i.init.callee.type===K.AST_NODE_TYPES.MemberExpression&&i.init.callee.property.type===K.AST_NODE_TYPES.Identifier)return i.init.callee.object.type===K.AST_NODE_TYPES.Identifier?`${i.init.callee.object.name}.${i.init.callee.property.name}`:i.init.callee.property.name}return"unknown function"}let a={};for(let i of t.varsToCheck)i.selector&&(a[i.selector]=p=>{if(p.type===K.AST_NODE_TYPES.VariableDeclarator&&p.id.type===K.AST_NODE_TYPES.Identifier&&r.set(p.id.name,{props:Array.isArray(i.prop)?i.prop:[i.prop],errorMsg:i.errorMsg,node:p.id,fnName:s(p)}),p.type===K.AST_NODE_TYPES.VariableDeclarator&&p.id.type===K.AST_NODE_TYPES.ObjectPattern){let l=Array.isArray(i.prop)?i.prop:[i.prop];n(p.id,l,i.errorMsg,s(p))}});for(let i of t.varsToCheck)if(i.fromFnCall){let p=i.fromFnCall;if(p.startsWith("*.")){let c=`VariableDeclarator > CallExpression > MemberExpression[property.name="${p.slice(2)}"]`;a[c]=d=>{if(d.type!==K.AST_NODE_TYPES.MemberExpression||d.parent.type!==K.AST_NODE_TYPES.CallExpression)return;let y=d.parent;if(y.parent.type!==K.AST_NODE_TYPES.VariableDeclarator)return;let g=y.parent;if(g.id.type===K.AST_NODE_TYPES.Identifier)r.set(g.id.name,{props:Array.isArray(i.prop)?i.prop:[i.prop],errorMsg:i.errorMsg,node:g.id,fnName:i.fromFnCall||"unknown function"});else if(g.id.type===K.AST_NODE_TYPES.ObjectPattern){let b=Array.isArray(i.prop)?i.prop:[i.prop];n(g.id,b,i.errorMsg,i.fromFnCall||"unknown function")}}}else if(p.includes(".")){let[l,c]=p.split("."),d=`VariableDeclarator > CallExpression > MemberExpression[object.name="${l}"][property.name="${c}"]`;a[d]=y=>{if(y.type!==K.AST_NODE_TYPES.MemberExpression||y.parent.type!==K.AST_NODE_TYPES.CallExpression)return;let g=y.parent;if(g.parent.type!==K.AST_NODE_TYPES.VariableDeclarator)return;let b=g.parent;if(b.id.type===K.AST_NODE_TYPES.Identifier)r.set(b.id.name,{props:Array.isArray(i.prop)?i.prop:[i.prop],errorMsg:i.errorMsg,node:b.id,fnName:i.fromFnCall||"unknown function"});else if(b.id.type===K.AST_NODE_TYPES.ObjectPattern){let f=Array.isArray(i.prop)?i.prop:[i.prop];n(b.id,f,i.errorMsg,i.fromFnCall||"unknown function")}}}else{let l=`VariableDeclarator > CallExpression > Identifier[name="${p}"]`;a[l]=c=>{if(c.type!==K.AST_NODE_TYPES.Identifier||c.parent.type!==K.AST_NODE_TYPES.CallExpression)return;let d=c.parent;if(d.parent.type!==K.AST_NODE_TYPES.VariableDeclarator)return;let y=d.parent;if(y.id.type===K.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===K.AST_NODE_TYPES.ObjectPattern){let g=Array.isArray(i.prop)?i.prop:[i.prop];n(y.id,g,i.errorMsg,i.fromFnCall||"unknown function")}}}}return{...a,"Program:exit"(){for(let[i,{props:p,errorMsg:l,node:c,fnName:d}]of r){let g=e.sourceCode.getScope(c).set.get(i);if(g){let b=new Set(p);for(let f of g.references){let E=f.identifier,h=E.parent;if(!(h.type===K.AST_NODE_TYPES.VariableDeclarator&&h.id===E)){if(h.type===K.AST_NODE_TYPES.MemberExpression&&h.object===E&&h.property.type===K.AST_NODE_TYPES.Identifier&&b.has(h.property.name)){if(b.delete(h.property.name),b.size===0)break;continue}if(h.type===K.AST_NODE_TYPES.VariableDeclarator&&h.init===E&&h.id.type===K.AST_NODE_TYPES.ObjectPattern){for(let m of h.id.properties)m.type===K.AST_NODE_TYPES.Property&&m.key.type===K.AST_NODE_TYPES.Identifier&&b.has(m.key.name)&&b.delete(m.key.name);if(b.size===0)break;continue}if(!(h.type===K.AST_NODE_TYPES.MemberExpression&&h.object===E&&h.property.type===K.AST_NODE_TYPES.Identifier&&!p.includes(h.property.name))){b.clear();break}}}if(b.size>0){let f=Array.from(b);if(f.length===1)e.report({node:c,messageId:"propNotRead",data:{prop:f[0],fnName:d,customMsg:l||""}});else{let E=f.map(h=>`"${h}"`).join(", ");e.report({node:c,messageId:"propsNotRead",data:{props:E,fnName:d,customMsg:l||""}})}}}}}}}});function Yr(e){return/^use[A-Z0-9]/.test(e)}function It(e){return e.type==="Identifier"?Yr(e.name):e.type==="MemberExpression"&&!e.computed&&It(e.property)?e.object.type==="Identifier":!1}function qr(e){return e.type==="Identifier"&&/^[A-Z]/.test(e.name)}function Zr(e,t){return e.name===t||e.type==="MemberExpression"&&e.object.name==="React"&&e.property.name===t}function Gr(e){return!!(e.parent&&e.parent.callee&&Zr(e.parent.callee,"forwardRef"))}function Kr(e){return!!(e.parent&&e.parent.callee&&Zr(e.parent.callee,"memo"))}function Rn(e){for(;e;){let t=ei(e);if(t&&(qr(t)||It(t))||Gr(e)||Kr(e))return!0;e=e.parent}return!1}function Br(e){return!1}function Pn(e){return!1}var oa=/eslint +react-compiler\/react-compiler: +\["error/,Qr={meta:{type:"problem",docs:{description:"enforces the Rules of Hooks",recommended:!0,url:"https://reactjs.org/docs/hooks-rules.html"},schema:[{type:"object",ignoreIfReactCompilerIsEnabled:!1,properties:{ignoreIfReactCompilerIsEnabled:{type:"boolean"}}}]},create(e){if(e.options[0]?.ignoreIfReactCompilerIsEnabled){for(let l of e.sourceCode.getAllComments())if(oa.test(l.value))return{CallExpression(c){let d=null;c.callee.name==="useMemo"?d="useMemo":c.callee.name==="useCallback"&&(d="useCallback"),d&&e.report({node:c,message:`"${d}" is not necessary when using React Compiler.`})}}}let t=typeof e.getSource=="function"?l=>t(l):l=>e.sourceCode.getText(l),r=typeof e.getScope=="function"?()=>r():l=>e.sourceCode.getScope(l),n=null,s=[],a=[],i=new WeakSet;function p(l){for(let c of l.references){let d=c.identifier.parent;if(d.type==="VariableDeclarator"&&d.init&&d.init.type==="CallExpression"&&d.init.callee&&Br(d.init.callee))for(let y of c.resolved.references)y!==c&&i.add(y.identifier)}}return{onCodePathSegmentStart:l=>a.push(l),onCodePathSegmentEnd:()=>a.pop(),onCodePathStart:()=>s.push(new Map),onCodePathEnd(l,c){let d=s.pop();if(d.size===0)return;let y=new Set;function g(o,S){let{cache:u}=g,T=u.get(o.id),w=new Set(S);if(w.has(o.id)){let R=[...w],v=R.slice(R.indexOf(o.id)+1);for(let x of v)y.add(x);return BigInt("0")}if(w.add(o.id),T!==void 0)return T;if(l.thrownSegments.includes(o))T=BigInt("0");else if(o.prevSegments.length===0)T=BigInt("1");else{T=BigInt("0");for(let R of o.prevSegments)T+=g(R,w)}return o.reachable&&T===BigInt("0")?u.delete(o.id):u.set(o.id,T),T}function b(o,S){let{cache:u}=b,T=u.get(o.id),w=new Set(S);if(w.has(o.id)){let R=Array.from(w),v=R.slice(R.indexOf(o.id)+1);for(let x of v)y.add(x);return BigInt("0")}if(w.add(o.id),T!==void 0)return T;if(l.thrownSegments.includes(o))T=BigInt("0");else if(o.nextSegments.length===0)T=BigInt("1");else{T=BigInt("0");for(let R of o.nextSegments)T+=b(R,w)}return u.set(o.id,T),T}function f(o){let{cache:S}=f,u=S.get(o.id);if(u===null)return 1/0;if(u!==void 0)return u;if(S.set(o.id,null),o.prevSegments.length===0)u=1;else{u=1/0;for(let T of o.prevSegments){let w=f(T);w<u&&(u=w)}u+=1}return S.set(o.id,u),u}g.cache=new Map,b.cache=new Map,f.cache=new Map;let E=b(l.initialSegment),h=ei(c),m=Rn(c),A=h?qr(h)||It(h):Gr(c)||Kr(c),I=1/0;for(let o of l.finalSegments){if(!o.reachable)continue;let S=f(o);S<I&&(I=S)}for(let[o,S]of d){if(!o.reachable)continue;let u=o.nextSegments.length===0?I<=f(o):I<f(o),T=g(o)*b(o),w=y.has(o.id);for(let R of S)if(w&&!Pn(R)&&e.report({node:R,message:`React Hook "${t(R)}" may be executed more than once. Possibly because it is called in a loop. React Hooks must be called in the exact same order in every component render.`}),A){if(c.async&&e.report({node:R,message:`React Hook "${t(R)}" cannot be called in an async function.`}),!w&&T!==E&&!Pn(R)){let x=`React Hook "${t(R)}" is called conditionally. React Hooks must be called in the exact same order in every component render.`+(u?" Did you accidentally call a React Hook after an early return?":"");e.report({node:R,message:x})}}else if(c.parent&&(c.parent.type==="MethodDefinition"||c.parent.type==="ClassProperty")&&c.parent.value===c){let v=`React Hook "${t(R)}" cannot be called in a class component. React Hooks must be called in a React function component or a custom React Hook function.`;e.report({node:R,message:v})}else if(h){let v=`React Hook "${t(R)}" is called in function "${t(h)}" that is neither a React function component nor a custom React Hook function. React component names must start with an uppercase letter. React Hook names must start with the word "use".`;e.report({node:R,message:v})}else if(c.type==="Program"){let v=`React Hook "${t(R)}" cannot be called at the top level. React Hooks must be called in a React function component or a custom React Hook function.`;e.report({node:R,message:v})}else if(m&&!Pn(R)){if(c.parent.type==="CallExpression"&&c.parent.callee.type==="Identifier"&&c.parent.callee.name==="useCallback"){let x=c.parent;if(x.parent.type==="VariableDeclarator"&&Yr(x.parent.id.name))return}let v=`React Hook "${t(R)}" cannot be called inside a callback. React Hooks must be called in a React function component or a custom React Hook function.`;e.report({node:R,message:v})}}},CallExpression(l){if(It(l.callee)){let c=Hr(s),d=Hr(a),y=c.get(d);y||(y=[],c.set(d,y)),y.push(l.callee)}l.callee.type==="Identifier"&&(l.callee.name==="useEffect"||Br(l.callee))&&l.arguments.length>0&&(n=l)},Identifier(l){n==null&&i.has(l)&&l.parent.type!=="CallExpression"&&e.report({node:l,message:`\`${t(l)}\` is a function created with React Hook "useEffectEvent", and can only be called from the same component. They cannot be assigned to variables or passed down.`})},"CallExpression:exit"(l){l===n&&(n=null)},FunctionDeclaration(l){Rn(l)&&p(r(l))},ArrowFunctionExpression(l){Rn(l)&&p(r(l))}}}};function ei(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 Hr(e){return e[e.length-1]}var ye=require("@typescript-eslint/utils"),be=Fe(require("zod/v4"));var sa=/^\s+$/,vn=/\r?\n/,aa=/^(\s*)/,la=/^(\s*)\S/,pa=/\r?\n/,ca=be.object({indent:be.union([be.string().regex(sa),be.number().int().min(1)]).optional(),tags:be.array(be.string()).optional(),functions:be.array(be.string()).optional(),comments:be.array(be.string()).optional()}),Fn=X({name:"template-indent",meta:{type:"suggestion",docs:{description:"Fix whitespace-insensitive template indentation"},fixable:"code",schema:[J(ca)],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:a}=e.options[0],i=r.map(m=>m.toLowerCase());function p(m){let A=m.split(vn),I=A.filter(S=>S.trim()!=="");if(I.length===0)return m;let o=Number.POSITIVE_INFINITY;for(let S of I){let u=S.match(aa);u&&(o=Math.min(o,u[1]?.length??0))}return!isFinite(o)||o===0?m:A.map(S=>S.slice(o)).join(`
|
|
36
|
+
`)}function l(m,A,I){return m.split(vn).map(S=>S.trim()===""?S:I.repeat(A)+S).join(`
|
|
37
|
+
`)}function c(m){if(m.type===ye.AST_NODE_TYPES.Identifier)return m.name;if(m.type===ye.AST_NODE_TYPES.MemberExpression){let A=m.object.type===ye.AST_NODE_TYPES.Identifier?m.object.name:null,I=m.property.type===ye.AST_NODE_TYPES.Identifier?m.property.name:null;return A&&I?`${A}.${I}`:I}return null}function d(m,A){if(!m)return!1;for(let I of A)if(I.includes(".")){let o=I.split(".");if(m.type===ye.AST_NODE_TYPES.MemberExpression&&m.object.type===ye.AST_NODE_TYPES.Identifier&&m.property.type===ye.AST_NODE_TYPES.Identifier&&m.object.name===o[0]&&m.property.name===o[1])return!0}else if(m.type===ye.AST_NODE_TYPES.Identifier&&m.name===I)return!0;return!1}function y(m,A){let I=m.parent;if(I.type!==ye.AST_NODE_TYPES.TaggedTemplateExpression)return!1;let o=c(I.tag);return o?A.includes(o):!1}function g(m,A){if(!m||m.type!==ye.AST_NODE_TYPES.CallExpression)return!1;let{method:I,argumentsLength:o,optionalCall:S=!0,optionalMember:u=!0}=A;return o!==void 0&&m.arguments.length!==o||!S&&m.optional||m.callee.type!==ye.AST_NODE_TYPES.MemberExpression||!u&&m.callee.optional||m.callee.property.type!==ye.AST_NODE_TYPES.Identifier?!1:m.callee.property.name===I}function b(m,A){if(!m||m.type!==ye.AST_NODE_TYPES.CallExpression)return!1;let{name:I,argumentsLength:o,optionalCall:S=!0}=A;return o!==void 0&&m.arguments.length!==o||!S&&m.optional||m.callee.type!==ye.AST_NODE_TYPES.Identifier?!1:m.callee.name===I}function f(m){return g(m.parent,{method:"toMatchInlineSnapshot",argumentsLength:1,optionalCall:!1,optionalMember:!1})&&m.parent.type===ye.AST_NODE_TYPES.CallExpression&&m.parent.arguments[0]===m&&b(m.parent.callee.type===ye.AST_NODE_TYPES.MemberExpression?m.parent.callee.object:null,{name:"expect",argumentsLength:1,optionalCall:!1,optionalMember:!1})}function E(m){if(i.length>0){let A=t.getTokenBefore(m,{includeComments:!0});if(A?.type===ye.AST_TOKEN_TYPES.Block&&i.includes(A.value.trim().toLowerCase()))return!0}return!!(f(m)||s.length>0&&y(m,s)||n.length>0&&m.parent.type===ye.AST_NODE_TYPES.CallExpression&&m.parent.arguments.includes(m)&&d(m.parent.callee,n))}function h(m){let A=`__PLACEHOLDER__${Math.random()}`,I=m.quasis.map(z=>t.getText(z).slice(1,z.tail?-1:-2)).join(A),o=I.match(pa);if(!o)return;let S=o[0],u=t.lines[t.getLocFromIndex(m.range[0]).line-1];if(!u)return;let w=u.match(la)?.[1]??"",R;typeof a=="string"?R=a:typeof a=="number"?R=" ".repeat(a):R=w.startsWith(" ")?" ":" ";let x=p(I).replace(new RegExp(`^${S}|${S}[ ]*$`,"g"),""),C=S+l(x,1,w+R)+S+w,F=I.includes(`\r
|
|
38
38
|
`)?`\r
|
|
39
39
|
`:`
|
|
40
|
-
`,O=I.split(
|
|
40
|
+
`,O=I.split(vn),Q=O.map((z,re)=>re!==O.length-1&&z===R+w?"":z).join(F);if(C!==Q)return{node:m,messageId:"improperlyIndented",fix:z=>C.split(A).map((re,ae)=>{let D=m.quasis[ae];return D?z.replaceTextRange([D.range[0]+1,D.range[1]-(D.tail?1:2)],re):[]}).flat()}}return{TemplateLiteral(m){if(!E(m))return;let A=h(m);if(A)return e.report(A)}}}});var kn=require("@typescript-eslint/utils");function ua(e){if(!("regex"in e))return!1;let t=e.regex.flags;return t.includes("g")||t.includes("y")}function fa(e){let t=e.parent;return t?.type===kn.AST_NODE_TYPES.NewExpression&&t.callee.type===kn.AST_NODE_TYPES.Identifier&&t.callee.name==="RegExp"}var On=X({name:"use-top-level-regex",meta:{type:"suggestion",docs:{description:"Require regex literals to be declared at the top level to avoid performance issues"},messages:{regexShouldBeTopLevel:"Move this regex literal to the top level to avoid creating new RegExp objects on each function call."},schema:[],hasSuggestions:!1},defaultOptions:[],create(e){function t(r){ua(r)||fa(r)||e.report({node:r,messageId:"regexShouldBeTopLevel"})}return{"FunctionDeclaration Literal[regex], FunctionExpression Literal[regex], ArrowFunctionExpression Literal[regex], MethodDefinition Literal[regex]":t}}});var Se=require("@typescript-eslint/utils"),nt=require("zod/v4");var ma=nt.z.object({checkOnly:nt.z.array(nt.z.enum(["function-args","FC","generic-args-at-fn-calls"])).optional(),checkTypesFromSelectors:nt.z.array(nt.z.string()).optional()}),Nn=X({name:"use-types-directly-above-usage",meta:{type:"suggestion",docs:{description:"Require type definitions to be placed directly above their first usage for better readability"},fixable:"code",schema:[J(ma)],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 a(f){for(let E of s)if(f.range[0]>=E.range[0]&&f.range[1]<=E.range[1])return E;return null}function i(f){let E=f.parent;for(;E;){if(E.type===Se.AST_NODE_TYPES.FunctionDeclaration||E.type===Se.AST_NODE_TYPES.FunctionExpression||E.type===Se.AST_NODE_TYPES.ArrowFunctionExpression){let h=E.params;for(let m of h)if(f.range[0]>=m.range[0]&&f.range[1]<=m.range[1])return!0;break}E=E.parent}return!1}function p(f){let E=f.parent;for(;E;){if(E.type===Se.AST_NODE_TYPES.TSTypeParameterInstantiation){let h=E.parent;if(h.type===Se.AST_NODE_TYPES.TSTypeReference&&h.typeName.type===Se.AST_NODE_TYPES.Identifier&&(h.typeName.name==="FC"||h.typeName.name==="React.FC")||h.type===Se.AST_NODE_TYPES.TSTypeReference&&h.typeName.type===Se.AST_NODE_TYPES.TSQualifiedName&&h.typeName.right.name==="FC")return!0}E=E.parent}return!1}function l(f){let E=f.parent;for(;E;){if(E.type===Se.AST_NODE_TYPES.TSTypeParameterInstantiation){let h=E.parent;if(h.type===Se.AST_NODE_TYPES.CallExpression||h.type===Se.AST_NODE_TYPES.NewExpression)return!0}E=E.parent}return!1}function c(f){let E=f.parent;for(;E;){if(E.type===Se.AST_NODE_TYPES.TSTypeAliasDeclaration||E.type===Se.AST_NODE_TYPES.TSInterfaceDeclaration)return!0;E=E.parent}return!1}function d(f){return f.parent.type===Se.AST_NODE_TYPES.TSIndexedAccessType&&f.parent.objectType===f}let y=[];function g(f){let E=[],h=new Map;for(let{typeName:A,firstUsage:I}of f){let o=h.get(I)||[];o.push(A),h.set(I,o)}for(let{typeName:A,firstUsage:I,firstUsagePosition:o,firstUsageInFunctionArgs:S}of f){let u=n.get(A);if(!u||u.statement===I)continue;let T=s.indexOf(u.statement),w=s.indexOf(I);if(T===-1||w===-1)continue;let R=!!(t.checkOnly&&t.checkOnly.includes("function-args")&&S),x=(h.get(I)||[]).length>1;(R||x?T>w:T>w||T!==w-1)&&E.push({typeName:A,typeDef:u,targetStatement:I,firstUsagePosition:o})}if(E.length===0)return;E.sort((A,I)=>{let o=A.firstUsagePosition-I.firstUsagePosition;if(o!==0)return o;let S=s.indexOf(A.typeDef.statement),u=s.indexOf(I.typeDef.statement);return S-u});let m=E[0];m&&e.report({node:m.typeDef.node,messageId:"moveTypeAboveUsage",fix:b(E)})}function b(f){return function*(E){let h=new Map;for(let m of f){let A=h.get(m.targetStatement)||[];A.push(m),h.set(m.targetStatement,A)}for(let[,m]of h)m.sort((A,I)=>{let o=A.firstUsagePosition-I.firstUsagePosition;if(o!==0)return o;let S=s.indexOf(A.typeDef.statement),u=s.indexOf(I.typeDef.statement);return S-u});for(let m of f){let{typeDef:A}=m,I=A.statement,o=r.getCommentsBefore(I),S=I.range[0],u=I.range[1];o.length>0&&o[0]&&(S=o[0].range[0]),yield E.removeRange([S,u])}for(let[m,A]of h){let I=r.getCommentsBefore(m),o=I.length>0&&I[0]?I[0].range[0]:m.range[0],S=[];for(let u of A){let T=u.typeDef.statement,w=r.getText(T),R=r.getCommentsBefore(T),v=w;R.length>0&&(v=`${R.map(C=>r.getText(C)).join(`
|
|
41
41
|
`)}
|
|
42
42
|
${w}`),S.push(v)}yield E.insertTextBeforeRange([o,o],`${S.join(`
|
|
43
43
|
|
|
44
44
|
`)}
|
|
45
45
|
|
|
46
|
-
`)}}}return{Program(f){s.push(...f.body)},TSTypeAliasDeclaration(f){if(s.some(h=>h.type===ye.AST_NODE_TYPES.ExportNamedDeclaration&&h.declaration===f?!0:h===f)){let h=a(f);h&&n.set(f.id.name,{node:f,name:f.id.name,statement:h})}},TSInterfaceDeclaration(f){if(s.some(h=>h.type===ye.AST_NODE_TYPES.ExportNamedDeclaration&&h.declaration===f?!0:h===f)){let h=a(f);h&&n.set(f.id.name,{node:f,name:f.id.name,statement:h})}},TSTypeReference(f){if(f.typeName.type===ye.AST_NODE_TYPES.Identifier){if(d(f))return;let E=i(f),h=p(f),m=l(f);y.push({typeName:f.typeName.name,node:f,inFunctionArgs:E,inFCProps:h,inGenericArgAtFunctionCall:m,usagePosition:f.range[0]})}},"Program:exit"(){let f=new Map;function E(m){if(!t.checkOnly||t.checkOnly.length===0)return!0;for(let A of t.checkOnly)if(A==="function-args"&&m.inFunctionArgs||A==="FC"&&m.inFCProps||A==="generic-args-at-fn-calls"&&m.inGenericArgAtFunctionCall)return!0;return!1}for(let m of y){let{typeName:A,node:I}=m;if(!n.has(A)||!E(m))continue;let o=a(I),S=n.get(A);if(!o||!S||o===S.statement)continue;f.has(A)||f.set(A,[]);let u=f.get(A);if(!u)return;u.includes(o)||u.push(o)}let h=[];for(let[m,A]of f)if(A.length>0){if(A.length===0)continue;let I=A[0];if(!I)continue;let o=Number.MAX_SAFE_INTEGER,S=!1;for(let T of A)T.range[0]<I.range[0]&&(I=T);for(let T of y)E(T)&&T.typeName===m&&a(T.node)===I&&T.usagePosition<o&&(o=T.usagePosition,S=T.inFunctionArgs);if(!!(t.checkOnly&&t.checkOnly.length>0)){let T=Number.MAX_SAFE_INTEGER;for(let R of y){if(R.typeName!==m)continue;let v=a(R.node);if(!v)continue;let x=s.indexOf(v);x!==-1&&x<T&&(T=x)}let w=s.indexOf(I);if(T!==Number.MAX_SAFE_INTEGER&&w!==-1&&T<w)continue}else{let T=Number.MAX_SAFE_INTEGER;for(let R of y){if(R.typeName!==m||c(R.node))continue;let v=a(R.node);if(!v)continue;let x=s.indexOf(v);x!==-1&&x<T&&(T=x)}let w=s.indexOf(I);if(T!==Number.MAX_SAFE_INTEGER&&w!==-1&&T<w)continue}h.push({typeName:m,firstUsage:I,firstUsagePosition:o,firstUsageInFunctionArgs:S})}h.length>0&&g(h)}}}});var te=require("@typescript-eslint/utils"),nt=ke(require("zod/v4"));var da=["tsx"],ya=/^[A-Z][A-Za-z0-9]*$/,ga=nt.object({extensions:nt.array(nt.string()).optional()}),jn=B({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:[V(ga)]},defaultOptions:[{}],create(e,[t]){let r=e.getFilename(),n=t.extensions??da,s=!1;for(let o of n)if(r.endsWith(o)){s=!0;break}if(!s)return{};let a=e.sourceCode,i=new Set,p=new Map;function l(o){return ya.test(o)}function c(o){if(o.type!==te.AST_NODE_TYPES.CallExpression)return!1;let S=o.callee;return S.type===te.AST_NODE_TYPES.Identifier?S.name==="memo"||S.name==="forwardRef":S.type===te.AST_NODE_TYPES.MemberExpression&&S.property.type===te.AST_NODE_TYPES.Identifier?S.property.name==="memo"||S.property.name==="forwardRef":!1}function d(o){if(o.type===te.AST_NODE_TYPES.JSXElement||o.type===te.AST_NODE_TYPES.JSXFragment)return!0;if(o.type===te.AST_NODE_TYPES.ArrayExpression){for(let S of o.elements)if(S&&(S.type===te.AST_NODE_TYPES.JSXElement||S.type===te.AST_NODE_TYPES.JSXFragment))return!0}return!1}function y(o){if(o.type!==te.AST_NODE_TYPES.ArrowFunctionExpression)return!1;let S=o.body;if(S.type===te.AST_NODE_TYPES.ArrowFunctionExpression){let u=S.body;if(d(u))return!0}return!1}function g(o){if(o.id.type!==te.AST_NODE_TYPES.Identifier)return;let S=o.id.name,u=o.init;if(u){if(l(S)&&(u.type===te.AST_NODE_TYPES.ArrowFunctionExpression||u.type===te.AST_NODE_TYPES.FunctionExpression||c(u))){i.add(S);return}u.type===te.AST_NODE_TYPES.Identifier&&p.set(S,u.name),l(S)||y(u)&&i.add(S)}}function b(o){if(o.type===te.AST_NODE_TYPES.VariableDeclaration){for(let S of o.declarations)g(S);return}if(o.type===te.AST_NODE_TYPES.FunctionDeclaration&&o.id){l(o.id.name)&&i.add(o.id.name);return}if(o.type===te.AST_NODE_TYPES.ExportNamedDeclaration&&o.declaration){let S=o.declaration;if(S.type===te.AST_NODE_TYPES.VariableDeclaration){for(let u of S.declarations)g(u);return}if(S.type===te.AST_NODE_TYPES.FunctionDeclaration&&S.id){l(S.id.name)&&i.add(S.id.name);return}}}for(let o of a.ast.body)b(o);function f(o,S=new Set){if(i.has(o))return!0;if(S.has(o))return!1;S.add(o);let u=p.get(o);return u?f(u,S):!1}let E=[];function h(o,S,u){E.push({node:o,isType:S,isComponent:u})}for(let o of a.ast.body){if(o.type===te.AST_NODE_TYPES.ExportNamedDeclaration){let S=o.exportKind==="type";if(o.declaration){let u=o.declaration;if(u.type===te.AST_NODE_TYPES.TSTypeAliasDeclaration||u.type===te.AST_NODE_TYPES.TSInterfaceDeclaration){h(u,!0,!1);continue}if(u.type===te.AST_NODE_TYPES.VariableDeclaration){for(let T of u.declarations){if(T.id.type!==te.AST_NODE_TYPES.Identifier)continue;let w=T.id.name,R=f(w);h(T,S,R)}continue}if(u.type===te.AST_NODE_TYPES.FunctionDeclaration){let T=u.id?.name,w=T?f(T)||l(T):!1;h(u,S,w);continue}h(u,S,!1);continue}if(o.specifiers.length>0)for(let u of o.specifiers){if(u.local.type!==te.AST_NODE_TYPES.Identifier)continue;let T=u.local.name,w=f(T);h(u,S,w)}continue}if(o.type===te.AST_NODE_TYPES.ExportDefaultDeclaration){let S=o.declaration;if(S.type===te.AST_NODE_TYPES.Identifier){let u=f(S.name)||l(S.name);h(o,!1,u);continue}if(S.type===te.AST_NODE_TYPES.FunctionDeclaration||S.type===te.AST_NODE_TYPES.ArrowFunctionExpression||S.type===te.AST_NODE_TYPES.FunctionExpression||S.type===te.AST_NODE_TYPES.CallExpression){h(o,!1,!0);continue}h(o,!1,!1);continue}}let m=!1;for(let o of E)if(!o.isType&&o.isComponent){m=!0;break}if(!m)return{};let A=[];for(let o of E)o.isType||A.push(o);let I=-1;for(let[o,S]of A.entries())if(S.isComponent){I=o;break}if(I===-1)return{};for(let[o,S]of A.entries())if(o!==I){e.report({node:S.node,messageId:"multipleExports"});break}return{}}});var We=require("@typescript-eslint/utils"),At=require("zod/v4");function wt(e){return e.charAt(0).toUpperCase()+e.slice(1)}function Sa(e){return e.callee.type===We.AST_NODE_TYPES.Identifier?e.callee.name==="useState":e.callee.type===We.AST_NODE_TYPES.MemberExpression&&e.callee.object.type===We.AST_NODE_TYPES.Identifier&&e.callee.property.type===We.AST_NODE_TYPES.Identifier?e.callee.object.name==="React"&&e.callee.property.name==="useState":!1}var Ta=At.z.object({ignorePrefixes:At.z.array(At.z.string()).optional()});function ni(e,t){for(let r of t)if(e.startsWith(r))return e.slice(r.length);return e}function ha(e){return`set${wt(e)}`}var Ln=B({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:[V(Ta)]},defaultOptions:[{ignorePrefixes:[]}],create(e,[t]){return{VariableDeclarator(r){if(!r.init||r.init.type!==We.AST_NODE_TYPES.CallExpression||!Sa(r.init)||r.id.type!==We.AST_NODE_TYPES.ArrayPattern||r.id.elements.length!==2)return;let[n,s]=r.id.elements;if(!n||!s||n.type!==We.AST_NODE_TYPES.Identifier||s.type!==We.AST_NODE_TYPES.Identifier)return;let a=n.name,i=s.name,p=t.ignorePrefixes||[],l=ni(a,p),c=ni(i,p);if(l===""){if(!c.startsWith("set")){let y=`set${wt(a)}`;e.report({node:s,messageId:"incorrectSetterName",data:{expectedName:wt(a),actualName:i},suggest:[{messageId:"useSuggestedName",data:{expectedSetterName:y},fix:g=>g.replaceText(s,y)}]})}return}let d=ha(l);c!==d&&e.report({node:s,messageId:"incorrectSetterName",data:{expectedName:wt(l),actualName:i},suggest:[{messageId:"useSuggestedName",data:{expectedSetterName:d},fix:y=>y.replaceText(s,d)}]})}}}});var me=require("@typescript-eslint/utils"),Ze=require("zod/v4");var Ea=Ze.z.object({name:Ze.z.string(),defaults:Ze.z.array(Ze.z.unknown())}),ba=Ze.z.object({functions:Ze.z.array(Ea)});function Rt(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,a)=>Rt(s,t[a]));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 a=Object.getOwnPropertyDescriptor(e,s),i=Object.getOwnPropertyDescriptor(t,s);if(!a||!i)return!1;let p=a.value,l=i.value;if(!Rt(p,l))return!1}return!0}function xa(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),a=Object.getOwnPropertyDescriptor(t,n);s&&a&&Rt(s.value,a.value)&&r.add(n)}return r}function ri(e){if(e.type===me.AST_NODE_TYPES.SpreadElement)return Symbol("COMPLEX_EXPRESSION");switch(e.type){case me.AST_NODE_TYPES.Literal:return e.value;case me.AST_NODE_TYPES.ObjectExpression:{let t={};for(let r of e.properties)r.type===me.AST_NODE_TYPES.Property&&r.key.type===me.AST_NODE_TYPES.Identifier&&!r.computed&&(r.value.type===me.AST_NODE_TYPES.Literal?t[r.key.name]=r.value.value:r.value.type===me.AST_NODE_TYPES.ObjectExpression?t[r.key.name]=ri(r.value):t[r.key.name]=Symbol("COMPLEX_EXPRESSION"));return t}case me.AST_NODE_TYPES.ArrayExpression:return e.elements.map(t=>{if(!(!t||t.type===me.AST_NODE_TYPES.SpreadElement))return t.type===me.AST_NODE_TYPES.Literal?t.value:Symbol("COMPLEX_EXPRESSION")});default:return Symbol("COMPLEX_EXPRESSION")}}function Ca(e){return e.type===me.AST_NODE_TYPES.Identifier?e.name:e.type===me.AST_NODE_TYPES.MemberExpression&&e.property.type===me.AST_NODE_TYPES.Identifier&&!e.computed?e.property.name:null}var Mn=B({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:[V(ba)]},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=Ca(n.callee);if(!s)return;let a=r.get(s);if(!a)return;let i=n.arguments;if(i.length===0)return;let p=-1,l=!1,c=new Map,d=new Set,y=new Map,g=[];for(let f=0;f<i.length;f++){if(f>=a.length){p=f;continue}let E=a[f],h=i[f];if(!h||h.type===me.AST_NODE_TYPES.SpreadElement){p=f;continue}let m=ri(h);if(E===void 0){p=f;continue}if(Rt(m,E)){h.type===me.AST_NODE_TYPES.ObjectExpression?(d.add(f),g.push({type:"object",position:f+1})):(y.set(f,m),g.push({type:"simple",position:f+1,value:m}));continue}if(h.type===me.AST_NODE_TYPES.ObjectExpression&&h.properties.length===0&&typeof E=="object"&&E!==null&&Object.keys(E).length>0){d.add(f),g.push({type:"object",position:f+1});continue}let A=xa(m,E);if(A.size>0){let I=typeof E=="object"&&E!==null?Object.keys(E).length:0;if(h.type===me.AST_NODE_TYPES.ObjectExpression&&h.properties.length===A.size&&h.properties.length===I){d.add(f),g.push({type:"object",position:f+1});continue}else l=!0,c.set(f,A),g.push({type:"partialObject",position:f+1,redundantProperties:Array.from(A)}),p=f}else p=f}if(p<i.length-1||l||d.size>0){let f=function(){let h=[];for(let m of g)if(m.type==="simple")h.push(`Param ${m.position} with value ${JSON.stringify(m.value)}`);else if(m.type==="object")h.push(`Param ${m.position} (object)`);else{let A=m.redundantProperties||[],I=a?a[m.position-1]:void 0;if(typeof I=="object"&&I!==null){let o=I;for(let S of A)if(S in o){let u=Object.getOwnPropertyDescriptor(o,S);u&&h.push(`Param ${m.position} property "${S}" with value ${JSON.stringify(u.value)}`)}}}return{messageId:"redundantParams",data:{details:h.join(", ")}}};var b=f;let E=f();e.report({node:n,messageId:E.messageId,data:E.data,fix(h){let m=[];if(l)for(let[I,o]of c){let S=i[I];if(S&&S.type===me.AST_NODE_TYPES.ObjectExpression){let u=[];for(let w of S.properties)w.type===me.AST_NODE_TYPES.Property&&w.key.type===me.AST_NODE_TYPES.Identifier&&!w.computed&&o.has(w.key.name)||u.push(w);let T=u.map(w=>e.sourceCode.getText(w));m.push(h.replaceText(S,`{ ${T.join(", ")} }`))}}let A=-1;for(let I=i.length-1;I>=0;I--)if(!d.has(I)&&I<=p){A=I;break}if(A<i.length-1)if(A===-1){let I=e.sourceCode.getTokenAfter(n.callee),o=e.sourceCode.getLastToken(n);I&&o&&m.push(h.replaceTextRange([I.range[1],o.range[0]],""))}else{let I=i[A],o=e.sourceCode.getLastToken(n);o&&I&&m.push(h.replaceTextRange([I.range[1],o.range[0]],""))}return m.length>0?m:null}})}}}}});var xe=require("@typescript-eslint/utils");function Ia(e){let t=e.parent;for(;t;){if(t.type===xe.AST_NODE_TYPES.AwaitExpression||t.type===xe.AST_NODE_TYPES.MemberExpression&&t.object===e&&t.property.type===xe.AST_NODE_TYPES.Identifier&&t.property.name==="then"||t.type===xe.AST_NODE_TYPES.ArrowFunctionExpression&&t.body===e)return!0;if(t.type===xe.AST_NODE_TYPES.ArrayExpression&&t.parent.type===xe.AST_NODE_TYPES.CallExpression){let r=t.parent;if(r.callee.type===xe.AST_NODE_TYPES.MemberExpression&&r.callee.object.type===xe.AST_NODE_TYPES.Identifier&&r.callee.object.name==="Promise"&&r.callee.property.type===xe.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 Aa(e){let{callee:t}=e;return t.type===xe.AST_NODE_TYPES.Identifier&&t.name==="require"||t.type===xe.AST_NODE_TYPES.MemberExpression&&t.object.type===xe.AST_NODE_TYPES.Identifier&&t.object.name==="require"}var $n=B({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){Ia(t)||e.report({node:t,messageId:"syncDynamicImport"})},TSImportType(t){e.report({node:t,messageId:"syncDynamicImport"})},CallExpression(t){Aa(t)&&e.report({node:t,messageId:"requireNotAllowed"})}}}});var N=require("@typescript-eslint/utils"),Pt=require("zod/v4");var wa=Pt.z.object({mainComponentRegex:Pt.z.string().optional(),mainComponentSelector:Pt.z.string().optional()}),Ra=/^[A-Z][A-Za-z0-9]*$/,_n=B({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:[V(wa)],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,a=new Set,i=new Map,p=[],l=[],c=new Set;function d(x){let C=x.node;if(C.type===N.AST_NODE_TYPES.VariableDeclaration){for(let F of C.declarations)if(F.id.type===N.AST_NODE_TYPES.Identifier&&F.id.name===x.name&&F.init)return F.init}if(C.type===N.AST_NODE_TYPES.ExportNamedDeclaration){let F=C.declaration;if(F&&F.type===N.AST_NODE_TYPES.VariableDeclaration){for(let O of F.declarations)if(O.id.type===N.AST_NODE_TYPES.Identifier&&O.id.name===x.name&&O.init)return O.init}}return null}function y(x){let C=new Set;return Oe(x,F=>(F.type===N.AST_NODE_TYPES.Identifier&&F.name!=="styled"&&F.name!=="css"&&C.add(F.name),!1),r),C}function g(x){return Ra.test(x)}function b(x){if(x.type!==N.AST_NODE_TYPES.CallExpression)return!1;let C=x.callee;return C.type===N.AST_NODE_TYPES.Identifier?C.name==="memo"||C.name==="forwardRef":C.type===N.AST_NODE_TYPES.MemberExpression&&C.property.type===N.AST_NODE_TYPES.Identifier?C.property.name==="memo"||C.property.name==="forwardRef":!1}function f(x){if(x.type===N.AST_NODE_TYPES.JSXElement||x.type===N.AST_NODE_TYPES.JSXFragment)return!0;if(x.type===N.AST_NODE_TYPES.BlockStatement){for(let C of x.body)if(C.type===N.AST_NODE_TYPES.ReturnStatement&&C.argument)return f(C.argument)}if(x.type===N.AST_NODE_TYPES.ArrayExpression){for(let C of x.elements)if(C&&(C.type===N.AST_NODE_TYPES.JSXElement||C.type===N.AST_NODE_TYPES.JSXFragment))return!0}return!1}function E(x){if(x.type!==N.AST_NODE_TYPES.ArrowFunctionExpression)return!1;let C=x.body;if(C.type===N.AST_NODE_TYPES.ArrowFunctionExpression){let F=C.body;if(f(F))return!0}return!1}function h(x){if(x.type===N.AST_NODE_TYPES.TaggedTemplateExpression){let C=x.tag;if(C.type===N.AST_NODE_TYPES.MemberExpression&&C.object.type===N.AST_NODE_TYPES.Identifier&&C.object.name==="styled")return!0;if(C.type===N.AST_NODE_TYPES.CallExpression){let F=C.callee;if(F.type===N.AST_NODE_TYPES.Identifier&&F.name==="styled")return!0}}return!1}function m(x){if(x.type===N.AST_NODE_TYPES.TaggedTemplateExpression){let C=x.tag;if(C.type===N.AST_NODE_TYPES.Identifier&&C.name==="css")return!0}return!1}function A(x,C){if(x.id.type!==N.AST_NODE_TYPES.Identifier)return;let F=x.id.name,O=x.init;if(O){if(h(O)||m(O)){l.push({node:C,name:F});return}if((g(F)||O.type===N.AST_NODE_TYPES.ArrowFunctionExpression)&&(O.type===N.AST_NODE_TYPES.ArrowFunctionExpression||O.type===N.AST_NODE_TYPES.FunctionExpression||b(O))){if(O.type===N.AST_NODE_TYPES.ArrowFunctionExpression||O.type===N.AST_NODE_TYPES.FunctionExpression){if(f(O.body)){a.add(F);return}}else if(b(O)){a.add(F);return}}O.type===N.AST_NODE_TYPES.Identifier&&i.set(F,O.name),g(F)||E(O)&&a.add(F)}}function I(x){return x.type===N.AST_NODE_TYPES.ExportDefaultDeclaration||x.type===N.AST_NODE_TYPES.ExportNamedDeclaration}function o(x){if(x.type===N.AST_NODE_TYPES.FunctionDeclaration)return x.id?x.id.name:null;if(x.type===N.AST_NODE_TYPES.VariableDeclaration){let C=x.declarations[0];if(C&&C.id.type===N.AST_NODE_TYPES.Identifier)return C.id.name}if(x.type===N.AST_NODE_TYPES.ExportDefaultDeclaration){let C=x.declaration;if(C.type===N.AST_NODE_TYPES.FunctionDeclaration)return C.id?C.id.name:"default";if(C.type===N.AST_NODE_TYPES.Identifier)return C.name}if(x.type===N.AST_NODE_TYPES.ExportNamedDeclaration){let C=x.declaration;if(C&&C.type===N.AST_NODE_TYPES.FunctionDeclaration)return C.id?C.id.name:null;if(C&&C.type===N.AST_NODE_TYPES.VariableDeclaration){let F=C.declarations[0];if(F&&F.id.type===N.AST_NODE_TYPES.Identifier)return F.id.name}}return null}function S(x,C){return s?c.has(x):n?n.test(C):I(x)}function u(x){let C=new Set;Oe(x.node,F=>{if(F.type===N.AST_NODE_TYPES.Identifier)for(let O of l)O.name===F.name&&(C.add(O.name),(O.firstUsagePosition===void 0||F.range[0]<O.firstUsagePosition)&&(O.firstUsagePosition=F.range[0]));if(F.type===N.AST_NODE_TYPES.JSXElement){let O=F.openingElement;if(O.name.type===N.AST_NODE_TYPES.JSXIdentifier)for(let Q of l)Q.name===O.name.name&&(C.add(Q.name),(Q.firstUsagePosition===void 0||O.name.range[0]<Q.firstUsagePosition)&&(Q.firstUsagePosition=O.name.range[0]))}return!1},r),x.usedStyles=C}function T(x){if(x.type===N.AST_NODE_TYPES.VariableDeclaration){for(let C of x.declarations)A(C,x);return}if(x.type===N.AST_NODE_TYPES.FunctionDeclaration){g(x.id.name)&&f(x.body)&&a.add(x.id.name);return}if(x.type===N.AST_NODE_TYPES.ExportNamedDeclaration&&x.declaration){let C=x.declaration;if(C.type===N.AST_NODE_TYPES.VariableDeclaration){for(let F of C.declarations)A(F,x);return}if(C.type===N.AST_NODE_TYPES.FunctionDeclaration&&C.id){g(C.id.name)&&f(C.body)&&a.add(C.id.name);return}}if(x.type===N.AST_NODE_TYPES.ExportDefaultDeclaration){let C=x.declaration;C.type===N.AST_NODE_TYPES.Identifier&&a.add(C.name),(C.type===N.AST_NODE_TYPES.FunctionDeclaration||C.type===N.AST_NODE_TYPES.ArrowFunctionExpression||C.type===N.AST_NODE_TYPES.FunctionExpression)&&(C.type===N.AST_NODE_TYPES.FunctionDeclaration?C.id?a.add(C.id.name):a.add("default"):f(C.body)&&a.add("default"))}}function w(x,C=new Set){if(a.has(x))return!0;if(C.has(x))return!1;C.add(x);let F=i.get(x);return F?w(F,C):!1}let R={};return s&&(R[s]=x=>{let C=x;for(;C.parent&&C.parent.type!==N.AST_NODE_TYPES.Program;)C=C.parent;C.parent&&(C.type===N.AST_NODE_TYPES.VariableDeclaration||C.type===N.AST_NODE_TYPES.FunctionDeclaration||C.type===N.AST_NODE_TYPES.ExportNamedDeclaration||C.type===N.AST_NODE_TYPES.ExportDefaultDeclaration)&&c.add(C)}),R["Program:exit"]=x=>{for(let M of x.body)T(M);for(let M of x.body){let W=o(M);if(W&&w(W)){let X=S(M,W);p.push({node:M,name:W,isMainComponent:X,usedStyles:new Set})}}for(let M of p)u(M);let C=new Set;for(let M of l)C.add(M.name);let F=new Map;for(let M=0;M<x.body.length;M+=1){let W=x.body[M];for(let X of l)X.node===W&&F.set(X.name,M)}let O=new Map;for(let M of l){let W=d(M),X=new Set;if(W){let ie=y(W);for(let pe of ie)C.has(pe)&&pe!==M.name&&X.add(pe)}O.set(M.name,X)}let Q=new Map;for(let M of l){let W=O.get(M.name);if(!W)continue;let X=F.get(M.name);if(X!==void 0)for(let ie of W){let pe=Q.get(ie);(pe===void 0||X<pe)&&Q.set(ie,X)}}let U=[];for(let M of l){if(M.firstUsagePosition===void 0)continue;let W=x.body.indexOf(M.node),X=-1;for(let we of p){if(!we.usedStyles.has(M.name))continue;let Re=x.body.indexOf(we.node);(X===-1||Re<X)&&(X=Re)}let ie=Q.get(M.name);if(ie!==void 0&&(X===-1||ie<X)&&(X=ie),X===-1)continue;let pe=-1;for(let we of p){let Re=x.body.indexOf(we.node);Re<X&&Re>pe&&(pe=Re)}let Ce=W<X,Ie=W>pe,Ae=-1,Se=O.get(M.name);if(Se)for(let we of Se){let Re=F.get(we);Re!==void 0&&Re>Ae&&(Ae=Re)}let ut=W>Ae;if(!(Ce&&Ie&&ut)){let we=pe+1;if(Ae+1>we&&(we=Ae+1),we>X)continue;U.push({style:M,targetPosition:we})}}let re=null;if(p.length>1){let M=p.map(X=>({c:X,idx:x.body.indexOf(X.node)})).sort((X,ie)=>X.idx-ie.idx)[0]?.c,W=p.find(X=>X.isMainComponent)||null;M&&W&&M.node!==W.node&&(re={component:W,targetBefore:M.node})}if(U.length>0||re){let M=U[0]?.style.node||re?.component.node||x,W=U.length>0?"stylesShouldBeAboveUsage":"mainComponentShouldBeFirst";e.report({node:M,messageId:W,fix:v(U,re,x.body)})}},R;function v(x,C,F){return function*(O){x.sort((U,re)=>U.targetPosition-re.targetPosition);for(let{style:U}of x){let re=r.getCommentsBefore(U.node),M=U.node.range[0],W=U.node.range[1];re.length>0&&re[0]&&(M=re[0].range[0]),M===U.node.range[0]&&r.text.slice(0,M).trim().length===0&&(M=0),yield O.removeRange([M,W])}let Q=new Map;for(let U of x){let re=Q.get(U.targetPosition)||[];re.push(U),Q.set(U.targetPosition,re)}for(let[U,re]of Q){let M=F[U];if(!M)continue;let W=r.getCommentsBefore(M),X=W.length>0&&W[0]?W[0].range[0]:M.range[0],ie=[];for(let{style:pe}of re){let Ce=r.getCommentsBefore(pe.node),Ie=r.getText(pe.node);Ce.length>0&&(Ie=`${Ce.map(Se=>r.getText(Se)).join(`
|
|
46
|
+
`)}}}return{Program(f){s.push(...f.body)},TSTypeAliasDeclaration(f){if(s.some(h=>h.type===Se.AST_NODE_TYPES.ExportNamedDeclaration&&h.declaration===f?!0:h===f)){let h=a(f);h&&n.set(f.id.name,{node:f,name:f.id.name,statement:h})}},TSInterfaceDeclaration(f){if(s.some(h=>h.type===Se.AST_NODE_TYPES.ExportNamedDeclaration&&h.declaration===f?!0:h===f)){let h=a(f);h&&n.set(f.id.name,{node:f,name:f.id.name,statement:h})}},TSTypeReference(f){if(f.typeName.type===Se.AST_NODE_TYPES.Identifier){if(d(f))return;let E=i(f),h=p(f),m=l(f);y.push({typeName:f.typeName.name,node:f,inFunctionArgs:E,inFCProps:h,inGenericArgAtFunctionCall:m,usagePosition:f.range[0]})}},"Program:exit"(){let f=new Map;function E(m){if(!t.checkOnly||t.checkOnly.length===0)return!0;for(let A of t.checkOnly)if(A==="function-args"&&m.inFunctionArgs||A==="FC"&&m.inFCProps||A==="generic-args-at-fn-calls"&&m.inGenericArgAtFunctionCall)return!0;return!1}for(let m of y){let{typeName:A,node:I}=m;if(!n.has(A)||!E(m))continue;let o=a(I),S=n.get(A);if(!o||!S||o===S.statement)continue;f.has(A)||f.set(A,[]);let u=f.get(A);if(!u)return;u.includes(o)||u.push(o)}let h=[];for(let[m,A]of f)if(A.length>0){if(A.length===0)continue;let I=A[0];if(!I)continue;let o=Number.MAX_SAFE_INTEGER,S=!1;for(let T of A)T.range[0]<I.range[0]&&(I=T);for(let T of y)E(T)&&T.typeName===m&&a(T.node)===I&&T.usagePosition<o&&(o=T.usagePosition,S=T.inFunctionArgs);if(!!(t.checkOnly&&t.checkOnly.length>0)){let T=Number.MAX_SAFE_INTEGER;for(let R of y){if(R.typeName!==m)continue;let v=a(R.node);if(!v)continue;let x=s.indexOf(v);x!==-1&&x<T&&(T=x)}let w=s.indexOf(I);if(T!==Number.MAX_SAFE_INTEGER&&w!==-1&&T<w)continue}else{let T=Number.MAX_SAFE_INTEGER;for(let R of y){if(R.typeName!==m||c(R.node))continue;let v=a(R.node);if(!v)continue;let x=s.indexOf(v);x!==-1&&x<T&&(T=x)}let w=s.indexOf(I);if(T!==Number.MAX_SAFE_INTEGER&&w!==-1&&T<w)continue}h.push({typeName:m,firstUsage:I,firstUsagePosition:o,firstUsageInFunctionArgs:S})}h.length>0&&g(h)}}}});var te=require("@typescript-eslint/utils"),rt=Fe(require("zod/v4"));var da=["tsx"],ya=/^[A-Z][A-Za-z0-9]*$/,ga=rt.object({extensions:rt.array(rt.string()).optional()}),Dn=X({name:"react-single-export",meta:{type:"problem",docs:{description:"Enforces only one export per React component file to support fast refresh"},messages:{multipleExports:"React component files should have only one export to support fast refresh, if you want to export multiple components, use a separate file for each component. Type-only exports are allowed."},schema:[J(ga)]},defaultOptions:[{}],create(e,[t]){let r=e.getFilename(),n=t.extensions??da,s=!1;for(let o of n)if(r.endsWith(o)){s=!0;break}if(!s)return{};let a=e.sourceCode,i=new Set,p=new Map;function l(o){return ya.test(o)}function c(o){if(o.type!==te.AST_NODE_TYPES.CallExpression)return!1;let S=o.callee;return S.type===te.AST_NODE_TYPES.Identifier?S.name==="memo"||S.name==="forwardRef":S.type===te.AST_NODE_TYPES.MemberExpression&&S.property.type===te.AST_NODE_TYPES.Identifier?S.property.name==="memo"||S.property.name==="forwardRef":!1}function d(o){if(o.type===te.AST_NODE_TYPES.JSXElement||o.type===te.AST_NODE_TYPES.JSXFragment)return!0;if(o.type===te.AST_NODE_TYPES.ArrayExpression){for(let S of o.elements)if(S&&(S.type===te.AST_NODE_TYPES.JSXElement||S.type===te.AST_NODE_TYPES.JSXFragment))return!0}return!1}function y(o){if(o.type!==te.AST_NODE_TYPES.ArrowFunctionExpression)return!1;let S=o.body;if(S.type===te.AST_NODE_TYPES.ArrowFunctionExpression){let u=S.body;if(d(u))return!0}return!1}function g(o){if(o.id.type!==te.AST_NODE_TYPES.Identifier)return;let S=o.id.name,u=o.init;if(u){if(l(S)&&(u.type===te.AST_NODE_TYPES.ArrowFunctionExpression||u.type===te.AST_NODE_TYPES.FunctionExpression||c(u))){i.add(S);return}u.type===te.AST_NODE_TYPES.Identifier&&p.set(S,u.name),l(S)||y(u)&&i.add(S)}}function b(o){if(o.type===te.AST_NODE_TYPES.VariableDeclaration){for(let S of o.declarations)g(S);return}if(o.type===te.AST_NODE_TYPES.FunctionDeclaration&&o.id){l(o.id.name)&&i.add(o.id.name);return}if(o.type===te.AST_NODE_TYPES.ExportNamedDeclaration&&o.declaration){let S=o.declaration;if(S.type===te.AST_NODE_TYPES.VariableDeclaration){for(let u of S.declarations)g(u);return}if(S.type===te.AST_NODE_TYPES.FunctionDeclaration&&S.id){l(S.id.name)&&i.add(S.id.name);return}}}for(let o of a.ast.body)b(o);function f(o,S=new Set){if(i.has(o))return!0;if(S.has(o))return!1;S.add(o);let u=p.get(o);return u?f(u,S):!1}let E=[];function h(o,S,u){E.push({node:o,isType:S,isComponent:u})}for(let o of a.ast.body){if(o.type===te.AST_NODE_TYPES.ExportNamedDeclaration){let S=o.exportKind==="type";if(o.declaration){let u=o.declaration;if(u.type===te.AST_NODE_TYPES.TSTypeAliasDeclaration||u.type===te.AST_NODE_TYPES.TSInterfaceDeclaration){h(u,!0,!1);continue}if(u.type===te.AST_NODE_TYPES.VariableDeclaration){for(let T of u.declarations){if(T.id.type!==te.AST_NODE_TYPES.Identifier)continue;let w=T.id.name,R=f(w);h(T,S,R)}continue}if(u.type===te.AST_NODE_TYPES.FunctionDeclaration){let T=u.id?.name,w=T?f(T)||l(T):!1;h(u,S,w);continue}h(u,S,!1);continue}if(o.specifiers.length>0)for(let u of o.specifiers){if(u.local.type!==te.AST_NODE_TYPES.Identifier)continue;let T=u.local.name,w=f(T);h(u,S,w)}continue}if(o.type===te.AST_NODE_TYPES.ExportDefaultDeclaration){let S=o.declaration;if(S.type===te.AST_NODE_TYPES.Identifier){let u=f(S.name)||l(S.name);h(o,!1,u);continue}if(S.type===te.AST_NODE_TYPES.FunctionDeclaration||S.type===te.AST_NODE_TYPES.ArrowFunctionExpression||S.type===te.AST_NODE_TYPES.FunctionExpression||S.type===te.AST_NODE_TYPES.CallExpression){h(o,!1,!0);continue}h(o,!1,!1);continue}}let m=!1;for(let o of E)if(!o.isType&&o.isComponent){m=!0;break}if(!m)return{};let A=[];for(let o of E)o.isType||A.push(o);let I=-1;for(let[o,S]of A.entries())if(S.isComponent){I=o;break}if(I===-1)return{};for(let[o,S]of A.entries())if(o!==I){e.report({node:S.node,messageId:"multipleExports"});break}return{}}});var ze=require("@typescript-eslint/utils"),At=require("zod/v4");function wt(e){return e.charAt(0).toUpperCase()+e.slice(1)}function Sa(e){return e.callee.type===ze.AST_NODE_TYPES.Identifier?e.callee.name==="useState":e.callee.type===ze.AST_NODE_TYPES.MemberExpression&&e.callee.object.type===ze.AST_NODE_TYPES.Identifier&&e.callee.property.type===ze.AST_NODE_TYPES.Identifier?e.callee.object.name==="React"&&e.callee.property.name==="useState":!1}var Ta=At.z.object({ignorePrefixes:At.z.array(At.z.string()).optional()});function ti(e,t){for(let r of t)if(e.startsWith(r))return e.slice(r.length);return e}function ha(e){return`set${wt(e)}`}var jn=X({name:"use-state-setter-naming",meta:{type:"problem",docs:{description:"Enforce consistent naming convention for useState destructuring where setter should be set{Value}"},messages:{incorrectSetterName:'useState setter should follow the pattern "set{{expectedName}}" with a "set" prefix but got "{{actualName}}"',useSuggestedName:'Use "{{expectedSetterName}}" instead'},hasSuggestions:!0,schema:[J(Ta)]},defaultOptions:[{ignorePrefixes:[]}],create(e,[t]){return{VariableDeclarator(r){if(!r.init||r.init.type!==ze.AST_NODE_TYPES.CallExpression||!Sa(r.init)||r.id.type!==ze.AST_NODE_TYPES.ArrayPattern||r.id.elements.length!==2)return;let[n,s]=r.id.elements;if(!n||!s||n.type!==ze.AST_NODE_TYPES.Identifier||s.type!==ze.AST_NODE_TYPES.Identifier)return;let a=n.name,i=s.name,p=t.ignorePrefixes||[],l=ti(a,p),c=ti(i,p);if(l===""){if(!c.startsWith("set")){let y=`set${wt(a)}`;e.report({node:s,messageId:"incorrectSetterName",data:{expectedName:wt(a),actualName:i},suggest:[{messageId:"useSuggestedName",data:{expectedSetterName:y},fix:g=>g.replaceText(s,y)}]})}return}let d=ha(l);c!==d&&e.report({node:s,messageId:"incorrectSetterName",data:{expectedName:wt(l),actualName:i},suggest:[{messageId:"useSuggestedName",data:{expectedSetterName:d},fix:y=>y.replaceText(s,d)}]})}}}});var de=require("@typescript-eslint/utils"),Ze=require("zod/v4");var Ea=Ze.z.object({name:Ze.z.string(),defaults:Ze.z.array(Ze.z.unknown())}),ba=Ze.z.object({functions:Ze.z.array(Ea)});function Rt(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,a)=>Rt(s,t[a]));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 a=Object.getOwnPropertyDescriptor(e,s),i=Object.getOwnPropertyDescriptor(t,s);if(!a||!i)return!1;let p=a.value,l=i.value;if(!Rt(p,l))return!1}return!0}function xa(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),a=Object.getOwnPropertyDescriptor(t,n);s&&a&&Rt(s.value,a.value)&&r.add(n)}return r}function ni(e){if(e.type===de.AST_NODE_TYPES.SpreadElement)return Symbol("COMPLEX_EXPRESSION");switch(e.type){case de.AST_NODE_TYPES.Literal:return e.value;case de.AST_NODE_TYPES.ObjectExpression:{let t={};for(let r of e.properties)r.type===de.AST_NODE_TYPES.Property&&r.key.type===de.AST_NODE_TYPES.Identifier&&!r.computed&&(r.value.type===de.AST_NODE_TYPES.Literal?t[r.key.name]=r.value.value:r.value.type===de.AST_NODE_TYPES.ObjectExpression?t[r.key.name]=ni(r.value):t[r.key.name]=Symbol("COMPLEX_EXPRESSION"));return t}case de.AST_NODE_TYPES.ArrayExpression:return e.elements.map(t=>{if(!(!t||t.type===de.AST_NODE_TYPES.SpreadElement))return t.type===de.AST_NODE_TYPES.Literal?t.value:Symbol("COMPLEX_EXPRESSION")});default:return Symbol("COMPLEX_EXPRESSION")}}function Ca(e){return e.type===de.AST_NODE_TYPES.Identifier?e.name:e.type===de.AST_NODE_TYPES.MemberExpression&&e.property.type===de.AST_NODE_TYPES.Identifier&&!e.computed?e.property.name:null}var Ln=X({name:"no-redundant-function-params",meta:{type:"suggestion",docs:{description:"Disallow calling functions with redundant default parameters"},messages:{redundantParams:"Function call has redundant parameters matching its default values and can be removed: {{details}}"},fixable:"code",schema:[J(ba)]},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=Ca(n.callee);if(!s)return;let a=r.get(s);if(!a)return;let i=n.arguments;if(i.length===0)return;let p=-1,l=!1,c=new Map,d=new Set,y=new Map,g=[];for(let f=0;f<i.length;f++){if(f>=a.length){p=f;continue}let E=a[f],h=i[f];if(!h||h.type===de.AST_NODE_TYPES.SpreadElement){p=f;continue}let m=ni(h);if(E===void 0){p=f;continue}if(Rt(m,E)){h.type===de.AST_NODE_TYPES.ObjectExpression?(d.add(f),g.push({type:"object",position:f+1})):(y.set(f,m),g.push({type:"simple",position:f+1,value:m}));continue}if(h.type===de.AST_NODE_TYPES.ObjectExpression&&h.properties.length===0&&typeof E=="object"&&E!==null&&Object.keys(E).length>0){d.add(f),g.push({type:"object",position:f+1});continue}let A=xa(m,E);if(A.size>0){let I=typeof E=="object"&&E!==null?Object.keys(E).length:0;if(h.type===de.AST_NODE_TYPES.ObjectExpression&&h.properties.length===A.size&&h.properties.length===I){d.add(f),g.push({type:"object",position:f+1});continue}else l=!0,c.set(f,A),g.push({type:"partialObject",position:f+1,redundantProperties:Array.from(A)}),p=f}else p=f}if(p<i.length-1||l||d.size>0){let f=function(){let h=[];for(let m of g)if(m.type==="simple")h.push(`Param ${m.position} with value ${JSON.stringify(m.value)}`);else if(m.type==="object")h.push(`Param ${m.position} (object)`);else{let A=m.redundantProperties||[],I=a?a[m.position-1]:void 0;if(typeof I=="object"&&I!==null){let o=I;for(let S of A)if(S in o){let u=Object.getOwnPropertyDescriptor(o,S);u&&h.push(`Param ${m.position} property "${S}" with value ${JSON.stringify(u.value)}`)}}}return{messageId:"redundantParams",data:{details:h.join(", ")}}};var b=f;let E=f();e.report({node:n,messageId:E.messageId,data:E.data,fix(h){let m=[];if(l)for(let[I,o]of c){let S=i[I];if(S&&S.type===de.AST_NODE_TYPES.ObjectExpression){let u=[];for(let w of S.properties)w.type===de.AST_NODE_TYPES.Property&&w.key.type===de.AST_NODE_TYPES.Identifier&&!w.computed&&o.has(w.key.name)||u.push(w);let T=u.map(w=>e.sourceCode.getText(w));m.push(h.replaceText(S,`{ ${T.join(", ")} }`))}}let A=-1;for(let I=i.length-1;I>=0;I--)if(!d.has(I)&&I<=p){A=I;break}if(A<i.length-1)if(A===-1){let I=e.sourceCode.getTokenAfter(n.callee),o=e.sourceCode.getLastToken(n);I&&o&&m.push(h.replaceTextRange([I.range[1],o.range[0]],""))}else{let I=i[A],o=e.sourceCode.getLastToken(n);o&&I&&m.push(h.replaceTextRange([I.range[1],o.range[0]],""))}return m.length>0?m:null}})}}}}});var Ae=require("@typescript-eslint/utils");function Ia(e){let t=e.parent;for(;t;){if(t.type===Ae.AST_NODE_TYPES.AwaitExpression||t.type===Ae.AST_NODE_TYPES.MemberExpression&&t.object===e&&t.property.type===Ae.AST_NODE_TYPES.Identifier&&t.property.name==="then"||t.type===Ae.AST_NODE_TYPES.ArrowFunctionExpression&&t.body===e)return!0;if(t.type===Ae.AST_NODE_TYPES.ArrayExpression&&t.parent.type===Ae.AST_NODE_TYPES.CallExpression){let r=t.parent;if(r.callee.type===Ae.AST_NODE_TYPES.MemberExpression&&r.callee.object.type===Ae.AST_NODE_TYPES.Identifier&&r.callee.object.name==="Promise"&&r.callee.property.type===Ae.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 Aa(e){let{callee:t}=e;return t.type===Ae.AST_NODE_TYPES.Identifier&&t.name==="require"||t.type===Ae.AST_NODE_TYPES.MemberExpression&&t.object.type===Ae.AST_NODE_TYPES.Identifier&&t.object.name==="require"}var Mn=X({name:"no-sync-dynamic-import",meta:{type:"problem",docs:{description:"Disallow synchronous dynamic imports and require statements, only allow async dynamic imports with await"},messages:{syncDynamicImport:"Synchronous dynamic import() is not allowed. Use regular import statement or await import() for dynamic imports.",requireNotAllowed:"require() statements are not allowed. Use ES6 import statements instead."},schema:[]},defaultOptions:[],create(e){return{ImportExpression(t){Ia(t)||e.report({node:t,messageId:"syncDynamicImport"})},TSImportType(t){e.report({node:t,messageId:"syncDynamicImport"})},CallExpression(t){Aa(t)&&e.report({node:t,messageId:"requireNotAllowed"})}}}});var N=require("@typescript-eslint/utils"),Pt=require("zod/v4");var wa=Pt.z.object({mainComponentRegex:Pt.z.string().optional(),mainComponentSelector:Pt.z.string().optional()}),Ra=/^[A-Z][A-Za-z0-9]*$/,$n=X({name:"sort-react-components-and-styles",meta:{type:"suggestion",docs:{description:"Sort React components and styles with styles placed above their first usage"},fixable:"code",schema:[J(wa)],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,a=new Set,i=new Map,p=[],l=[],c=new Set;function d(x){let C=x.node;if(C.type===N.AST_NODE_TYPES.VariableDeclaration){for(let F of C.declarations)if(F.id.type===N.AST_NODE_TYPES.Identifier&&F.id.name===x.name&&F.init)return F.init}if(C.type===N.AST_NODE_TYPES.ExportNamedDeclaration){let F=C.declaration;if(F&&F.type===N.AST_NODE_TYPES.VariableDeclaration){for(let O of F.declarations)if(O.id.type===N.AST_NODE_TYPES.Identifier&&O.id.name===x.name&&O.init)return O.init}}return null}function y(x){let C=new Set;return ke(x,F=>(F.type===N.AST_NODE_TYPES.Identifier&&F.name!=="styled"&&F.name!=="css"&&C.add(F.name),!1),r),C}function g(x){return Ra.test(x)}function b(x){if(x.type!==N.AST_NODE_TYPES.CallExpression)return!1;let C=x.callee;return C.type===N.AST_NODE_TYPES.Identifier?C.name==="memo"||C.name==="forwardRef":C.type===N.AST_NODE_TYPES.MemberExpression&&C.property.type===N.AST_NODE_TYPES.Identifier?C.property.name==="memo"||C.property.name==="forwardRef":!1}function f(x){if(x.type===N.AST_NODE_TYPES.JSXElement||x.type===N.AST_NODE_TYPES.JSXFragment)return!0;if(x.type===N.AST_NODE_TYPES.BlockStatement){for(let C of x.body)if(C.type===N.AST_NODE_TYPES.ReturnStatement&&C.argument)return f(C.argument)}if(x.type===N.AST_NODE_TYPES.ArrayExpression){for(let C of x.elements)if(C&&(C.type===N.AST_NODE_TYPES.JSXElement||C.type===N.AST_NODE_TYPES.JSXFragment))return!0}return!1}function E(x){if(x.type!==N.AST_NODE_TYPES.ArrowFunctionExpression)return!1;let C=x.body;if(C.type===N.AST_NODE_TYPES.ArrowFunctionExpression){let F=C.body;if(f(F))return!0}return!1}function h(x){if(x.type===N.AST_NODE_TYPES.TaggedTemplateExpression){let C=x.tag;if(C.type===N.AST_NODE_TYPES.MemberExpression&&C.object.type===N.AST_NODE_TYPES.Identifier&&C.object.name==="styled")return!0;if(C.type===N.AST_NODE_TYPES.CallExpression){let F=C.callee;if(F.type===N.AST_NODE_TYPES.Identifier&&F.name==="styled")return!0}}return!1}function m(x){if(x.type===N.AST_NODE_TYPES.TaggedTemplateExpression){let C=x.tag;if(C.type===N.AST_NODE_TYPES.Identifier&&C.name==="css")return!0}return!1}function A(x,C){if(x.id.type!==N.AST_NODE_TYPES.Identifier)return;let F=x.id.name,O=x.init;if(O){if(h(O)||m(O)){l.push({node:C,name:F});return}if((g(F)||O.type===N.AST_NODE_TYPES.ArrowFunctionExpression)&&(O.type===N.AST_NODE_TYPES.ArrowFunctionExpression||O.type===N.AST_NODE_TYPES.FunctionExpression||b(O))){if(O.type===N.AST_NODE_TYPES.ArrowFunctionExpression||O.type===N.AST_NODE_TYPES.FunctionExpression){if(f(O.body)){a.add(F);return}}else if(b(O)){a.add(F);return}}O.type===N.AST_NODE_TYPES.Identifier&&i.set(F,O.name),g(F)||E(O)&&a.add(F)}}function I(x){return x.type===N.AST_NODE_TYPES.ExportDefaultDeclaration||x.type===N.AST_NODE_TYPES.ExportNamedDeclaration}function o(x){if(x.type===N.AST_NODE_TYPES.FunctionDeclaration)return x.id?x.id.name:null;if(x.type===N.AST_NODE_TYPES.VariableDeclaration){let C=x.declarations[0];if(C&&C.id.type===N.AST_NODE_TYPES.Identifier)return C.id.name}if(x.type===N.AST_NODE_TYPES.ExportDefaultDeclaration){let C=x.declaration;if(C.type===N.AST_NODE_TYPES.FunctionDeclaration)return C.id?C.id.name:"default";if(C.type===N.AST_NODE_TYPES.Identifier)return C.name}if(x.type===N.AST_NODE_TYPES.ExportNamedDeclaration){let C=x.declaration;if(C&&C.type===N.AST_NODE_TYPES.FunctionDeclaration)return C.id?C.id.name:null;if(C&&C.type===N.AST_NODE_TYPES.VariableDeclaration){let F=C.declarations[0];if(F&&F.id.type===N.AST_NODE_TYPES.Identifier)return F.id.name}}return null}function S(x,C){return s?c.has(x):n?n.test(C):I(x)}function u(x){let C=new Set;ke(x.node,F=>{if(F.type===N.AST_NODE_TYPES.Identifier)for(let O of l)O.name===F.name&&(C.add(O.name),(O.firstUsagePosition===void 0||F.range[0]<O.firstUsagePosition)&&(O.firstUsagePosition=F.range[0]));if(F.type===N.AST_NODE_TYPES.JSXElement){let O=F.openingElement;if(O.name.type===N.AST_NODE_TYPES.JSXIdentifier)for(let Q of l)Q.name===O.name.name&&(C.add(Q.name),(Q.firstUsagePosition===void 0||O.name.range[0]<Q.firstUsagePosition)&&(Q.firstUsagePosition=O.name.range[0]))}return!1},r),x.usedStyles=C}function T(x){if(x.type===N.AST_NODE_TYPES.VariableDeclaration){for(let C of x.declarations)A(C,x);return}if(x.type===N.AST_NODE_TYPES.FunctionDeclaration){g(x.id.name)&&f(x.body)&&a.add(x.id.name);return}if(x.type===N.AST_NODE_TYPES.ExportNamedDeclaration&&x.declaration){let C=x.declaration;if(C.type===N.AST_NODE_TYPES.VariableDeclaration){for(let F of C.declarations)A(F,x);return}if(C.type===N.AST_NODE_TYPES.FunctionDeclaration&&C.id){g(C.id.name)&&f(C.body)&&a.add(C.id.name);return}}if(x.type===N.AST_NODE_TYPES.ExportDefaultDeclaration){let C=x.declaration;C.type===N.AST_NODE_TYPES.Identifier&&a.add(C.name),(C.type===N.AST_NODE_TYPES.FunctionDeclaration||C.type===N.AST_NODE_TYPES.ArrowFunctionExpression||C.type===N.AST_NODE_TYPES.FunctionExpression)&&(C.type===N.AST_NODE_TYPES.FunctionDeclaration?C.id?a.add(C.id.name):a.add("default"):f(C.body)&&a.add("default"))}}function w(x,C=new Set){if(a.has(x))return!0;if(C.has(x))return!1;C.add(x);let F=i.get(x);return F?w(F,C):!1}let R={};return s&&(R[s]=x=>{let C=x;for(;C.parent&&C.parent.type!==N.AST_NODE_TYPES.Program;)C=C.parent;C.parent&&(C.type===N.AST_NODE_TYPES.VariableDeclaration||C.type===N.AST_NODE_TYPES.FunctionDeclaration||C.type===N.AST_NODE_TYPES.ExportNamedDeclaration||C.type===N.AST_NODE_TYPES.ExportDefaultDeclaration)&&c.add(C)}),R["Program:exit"]=x=>{let C=0;for(let D of x.body){if(D.type===N.AST_NODE_TYPES.ImportDeclaration){C+=1;continue}break}for(let D of x.body)T(D);for(let D of x.body){let q=o(D);if(q&&w(q)){let V=S(D,q);p.push({node:D,name:q,isMainComponent:V,usedStyles:new Set})}}for(let D of p)u(D);let F=new Set;for(let D of l)F.add(D.name);let O=new Map;for(let D=0;D<x.body.length;D+=1){let q=x.body[D];for(let V of l)V.node===q&&O.set(V.name,D)}let Q=new Map;for(let D of l){let q=d(D),V=new Set;if(q){let ce=y(q);for(let ue of ce)F.has(ue)&&ue!==D.name&&V.add(ue)}Q.set(D.name,V)}let z=new Map;for(let D of l){let q=Q.get(D.name);if(!q)continue;let V=O.get(D.name);if(V!==void 0)for(let ce of q){let ue=z.get(ce);(ue===void 0||V<ue)&&z.set(ce,V)}}let re=[];for(let D of l){if(D.firstUsagePosition===void 0)continue;let q=x.body.indexOf(D.node),V=-1;for(let he of p){if(!he.usedStyles.has(D.name))continue;let xe=x.body.indexOf(he.node);(V===-1||xe<V)&&(V=xe)}let ce=z.get(D.name);if(ce!==void 0&&(V===-1||ce<V)&&(V=ce),V===-1)continue;let ue=-1;for(let he of p){let xe=x.body.indexOf(he.node);xe<V&&xe>ue&&(ue=xe)}let we=q<V,We=q>ue,ge=-1,it=Q.get(D.name);if(it)for(let he of it){let xe=O.get(he);xe!==void 0&&xe>ge&&(ge=xe)}let Ge=q>ge;if(!(we&&We&&Ge)){let he=ue+1;if(ge+1>he&&(he=ge+1),he<C&&(he=C),he>V)continue;re.push({style:D,targetPosition:he})}}let ae=null;if(p.length>1){let D=p.map(V=>({c:V,idx:x.body.indexOf(V.node)})).sort((V,ce)=>V.idx-ce.idx)[0]?.c,q=p.find(V=>V.isMainComponent)||null;D&&q&&D.node!==q.node&&(ae={component:q,targetBefore:D.node})}if(re.length>0||ae){let D=re[0]?.style.node||ae?.component.node||x,q=re.length>0?"stylesShouldBeAboveUsage":"mainComponentShouldBeFirst";e.report({node:D,messageId:q,fix:v(re,ae,x.body)})}},R;function v(x,C,F){return function*(O){x.sort((z,re)=>z.targetPosition-re.targetPosition);for(let{style:z}of x){let re=r.getCommentsBefore(z.node),ae=z.node.range[0],D=z.node.range[1];re.length>0&&re[0]&&(ae=re[0].range[0]),ae===z.node.range[0]&&r.text.slice(0,ae).trim().length===0&&(ae=0),yield O.removeRange([ae,D])}let Q=new Map;for(let z of x){let re=Q.get(z.targetPosition)||[];re.push(z),Q.set(z.targetPosition,re)}for(let[z,re]of Q){let ae=F[z];if(!ae)continue;let D=r.getCommentsBefore(ae),q=D.length>0&&D[0]?D[0].range[0]:ae.range[0],V=[];for(let{style:ce}of re){let ue=r.getCommentsBefore(ce.node),we=r.getText(ce.node);ue.length>0&&(we=`${ue.map(ge=>r.getText(ge)).join(`
|
|
47
47
|
`)}
|
|
48
|
-
${
|
|
48
|
+
${we}`),V.push(we)}yield O.insertTextBeforeRange([q,q],`${V.join(`
|
|
49
49
|
|
|
50
50
|
`)}
|
|
51
51
|
|
|
52
|
-
`)}if(C){let{component:
|
|
52
|
+
`)}if(C){let{component:z,targetBefore:re}=C,ae=r.getCommentsBefore(z.node),D=z.node.range[0],q=z.node.range[1];ae.length>0&&ae[0]&&(D=ae[0].range[0]),D===z.node.range[0]&&r.text.slice(0,D).trim().length===0&&(D=0);let V=r.getCommentsBefore(re),ce=V.length>0&&V[0]?V[0].range[0]:re.range[0],ue=(()=>{let we=r.getText(z.node);return ae.length>0&&(we=`${ae.map(ge=>r.getText(ge)).join(`
|
|
53
53
|
`)}
|
|
54
|
-
${
|
|
55
|
-
`)}}}}});var
|
|
54
|
+
${we}`),we})();yield O.removeRange([D,q]),yield O.insertTextBeforeRange([ce,ce],`${ue}
|
|
55
|
+
`)}}}}});var ri={[cn.name]:cn.rule,[Jt.name]:Jt.rule,[Wt.name]:Wt.rule,"rules-of-hooks":Qr,"exhaustive-deps":qn,"require-description":Xr.rule,[Vt.name]:Vt.rule,[Bt.name]:Bt.rule,[fn.name]:fn.rule,[Ft.name]:Ft.rule,[zt.name]:zt.rule,[Yt.name]:Yt.rule,[st.name]:st.rule,[yn.name]:yn.rule,[Ht.name]:Ht.rule,[Xt.name]:Xt.rule,[Zt.name]:Zt.rule,[Ot.name]:Ot.rule,[bn.name]:bn.rule,[En.name]:En.rule,[An.name]:An.rule,[Ut.name]:Ut.rule,[en.name]:en.rule,[tn.name]:tn.rule,[nn.name]:nn.rule,[an.name]:an.rule,[ln.name]:ln.rule,[rn.name]:rn.rule,[sn.name]:sn.rule,[dn.name]:dn.rule,[Kt.name]:Kt.rule,[Gt.name]:Gt.rule,[On.name]:On.rule,[un.name]:un.rule,[wn.name]:wn.rule,[Fn.name]:Fn.rule,[Nn.name]:Nn.rule,[Dn.name]:Dn.rule,[jn.name]:jn.rule,[Ln.name]:Ln.rule,[Mn.name]:Mn.rule,[$n.name]:$n.rule,[st.name]:st.rule};var Pa={rules:ri};0&&(module.exports={extendedLintPlugin});
|