@ls-stack/extended-lint 0.76.0 → 0.76.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  "use strict";var pi=Object.create;var mt=Object.defineProperty;var ci=Object.getOwnPropertyDescriptor;var ui=Object.getOwnPropertyNames;var fi=Object.getPrototypeOf,mi=Object.prototype.hasOwnProperty;var yi=(e,n)=>{for(var r in n)mt(e,r,{get:n[r],enumerable:!0})},Wn=(e,n,r,t)=>{if(n&&typeof n=="object"||typeof n=="function")for(let s of ui(n))!mi.call(e,s)&&s!==r&&mt(e,s,{get:()=>n[s],enumerable:!(t=ci(n,s))||t.enumerable});return e};var ve=(e,n,r)=>(r=e!=null?pi(fi(e)):{},Wn(n||!e||!e.__esModule?mt(r,"default",{value:e,enumerable:!0}):r,e)),di=e=>Wn(mt({},"__esModule",{value:!0}),e);var va={};yi(va,{extendedLintPlugin:()=>Pa});module.exports=di(va);var he=require("@typescript-eslint/utils"),M=require("zod/v4");var Jn=require("@typescript-eslint/utils"),Vn=ve(require("zod/v4"));function q(e){let r=Jn.ESLintUtils.RuleCreator(t=>`https://github.com/lucasols/extended-lint#${t}`)(e);return{name:e.name,rule:r}}function B(e){return Vn.toJSONSchema(e)}var gi=M.z.object({disallow:M.z.array(M.z.object({selector:M.z.string(),message:M.z.string(),replace:M.z.optional(M.z.union([M.z.string(),M.z.object({regex:M.z.string(),with:M.z.string()})])),replaceType:M.z.optional(M.z.enum(["suggestion","autofix"]))})).optional(),disallowFnCalls:M.z.optional(M.z.array(M.z.object({fn:M.z.string(),withArgs:M.z.optional(M.z.array(M.z.object({atIndex:M.z.number(),value:M.z.union([M.z.string(),M.z.number(),M.z.boolean()])}))),message:M.z.string(),replaceWith:M.z.optional(M.z.string()),ignoreRegex:M.z.optional(M.z.string())}))),__dev_simulateFileName:M.z.optional(M.z.string()),mustMatchSyntax:M.z.optional(M.z.array(M.z.object({includeRegex:M.z.string(),mustCallFn:M.z.optional(M.z.array(M.z.object({anyCall:M.z.array(M.z.object({fn:M.z.string(),withArgs:M.z.array(M.z.object({atIndex:M.z.number(),literal:M.z.union([M.z.string(),M.z.number(),M.z.boolean()])}))})),message:M.z.optional(M.z.string())}))),mustMatchSelector:M.z.optional(M.z.array(M.z.object({selector:M.z.string(),message:M.z.string()}))),mustHaveExport:M.z.optional(M.z.array(M.z.object({name:M.z.string(),type:M.z.enum(["function","variable","any"]).default("any"),message:M.z.string()})))})))}),vt=q({name:"advanced-no-restricted-syntax",meta:{type:"suggestion",docs:{description:"Disallow specific syntax patterns"},schema:[B(gi)],messages:{default:"{{message}}"},fixable:"code",hasSuggestions:!0},defaultOptions:[{disallow:[]}],create(e,[n]){let r={},{mustMatchSyntax:t,__dev_simulateFileName:s,disallow:o,disallowFnCalls:i}=n,p=s??e.filename,c=[],a=new Map,u=new Set,m=new Map,y=new Set,C=new Map;function f(b){for(let w of b.specifiers)w.type===he.AST_NODE_TYPES.ImportSpecifier&&w.imported.type===he.AST_NODE_TYPES.Identifier&&w.imported.name!==w.local.name&&C.set(w.local.name,w.imported.name)}function E(b){if(b.declaration){if(b.declaration.type===he.AST_NODE_TYPES.FunctionDeclaration&&b.declaration.id){let w=b.declaration.id.name;for(let P of Array.from(y)){let[N,l]=P.split(":");N===w&&(l==="function"||l==="any")&&y.delete(P)}}else if(b.declaration.type===he.AST_NODE_TYPES.VariableDeclaration){for(let w of b.declaration.declarations)if(w.id.type===he.AST_NODE_TYPES.Identifier){let P=w.id.name;for(let N of Array.from(y)){let[l,R]=N.split(":");l===P&&(R==="variable"||R==="any")&&y.delete(N)}}}}for(let w of b.specifiers)if(w.exported.type===he.AST_NODE_TYPES.Identifier){let P=w.exported.name;for(let N of Array.from(y)){let[l,R]=N.split(":");l===P&&R==="any"&&y.delete(N)}}}function x(b){b.id.type===he.AST_NODE_TYPES.Identifier&&b.init?.type===he.AST_NODE_TYPES.Identifier&&C.set(b.id.name,b.init.name)}function S(b){return C.get(b)??b}function I(b,w){return S(b)===w||b===w}for(let{includeRegex:b,mustCallFn:w,mustMatchSelector:P,mustHaveExport:N}of t??[]){let R=function(d){let g=d;for(let{name:F,value:v}of l??[])g=g.replaceAll(F,v);return g};var h=R;let l=Si(p,new RegExp(b));if(l){for(let{anyCall:d,message:g}of w??[]){let F=`Expected file to call the function: ${d.map(({fn:v})=>v).join(" or ")}`;u.add(F),c.push(v=>{let{callee:j}=v;if(j.type===he.AST_NODE_TYPES.Identifier){for(let{fn:J,withArgs:G}of d)if(j.name===J){u.delete(F);for(let H of G){let D=v.arguments[H.atIndex],Z=typeof H.literal=="string"?R(H.literal):H.literal;if(!D){e.report({node:v,messageId:"default",data:{message:`Missing argument with value "${Z}" at index ${H.atIndex}${g?`: ${R(g)}`:""}`}});continue}if(D.type!==he.AST_NODE_TYPES.Literal){e.report({node:D,messageId:"default",data:{message:`Argument at position ${H.atIndex} should the literal "${Z}"${g?`: ${R(g)}`:""}`}});continue}D.value!==Z&&e.report({node:D,messageId:"default",data:{message:`Argument should have the value "${Z}"${g?`: ${R(g)}`:""}`},fix:Y=>Y.replaceText(D,typeof Z=="string"?`'${Z}'`:String(Z))})}break}}})}for(let{selector:d,message:g}of P??[])m.set(d,R(g)),a.set(R(d),()=>{m.delete(d)});for(let{name:d,type:g,message:F}of N??[]){let v=R(d),j=R(F);y.add(`${v}:${g}:${j}`)}}}for(let{fn:b,withArgs:w,message:P,replaceWith:N,ignoreRegex:l}of i??[])l&&new RegExp(l).test(p)||c.push(R=>{let{callee:d}=R;if(d.type!==he.AST_NODE_TYPES.Identifier||!I(d.name,b))return;if(w)for(let F of w){let v=R.arguments[F.atIndex];if(!v){e.report({node:R,messageId:"default",data:{message:`Missing argument with value "${F.value}" at index ${F.atIndex}: ${P}`}});return}if(v.type!==he.AST_NODE_TYPES.Literal||v.value!==F.value)return}let g=F=>N?F.replaceText(R,N):null;e.report({node:R,messageId:"default",data:{message:P},suggest:N?[{messageId:"default",data:{message:`Replace with "${N}"`},fix:g}]:void 0})});function A(b,w){let P=r[b];P?r[b]=N=>{P(N),w(N)}:r[b]=w}for(let{selector:b,message:w,replace:P,replaceType:N="suggestion"}of o??[]){if(b==="CallExpression"){c.push(l=>{T(P,l,w,N)});continue}r[b]=l=>{T(P,l,w,N)}}if(a.size>0)for(let[b,w]of a)A(b,w);return c.length>0&&(r.CallExpression=b=>{if(b.type===he.AST_NODE_TYPES.CallExpression)for(let w of c)w(b)}),r.ImportDeclaration=b=>{b.type===he.AST_NODE_TYPES.ImportDeclaration&&f(b)},r.ExportNamedDeclaration=b=>{b.type===he.AST_NODE_TYPES.ExportNamedDeclaration&&E(b)},r.VariableDeclarator=b=>{b.type===he.AST_NODE_TYPES.VariableDeclarator&&x(b)},r["Program:exit"]=b=>{for(let w of u)e.report({node:b,messageId:"default",data:{message:w}});for(let[,w]of m)e.report({node:b,messageId:"default",data:{message:w}});for(let w of y){let[P,N,l]=w.split(":");e.report({node:b,messageId:"default",data:{message:`Missing required export "${P}" of type ${N}: ${l}`}})}},r;function T(b,w,P,N){let l=R=>{if(!b)return null;if(typeof b=="string")return R.replaceText(w,b);{let d=new RegExp(b.regex),g=e.sourceCode.getText(w);return R.replaceText(w,g.replace(d,b.with))}};e.report({node:w,messageId:"default",data:{message:P},fix:b&&N==="autofix"?l:void 0,suggest:b&&N==="suggestion"?[{messageId:"default",data:{message:`Replace with "${typeof b=="string"?b:b.with}"`},fix:l}]:void 0})}}});function Si(e,n){let r=[],t=n.exec(e);if(!t)return null;let[s,...o]=t;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<o.length;i++){let p=`$${i+1}`,c=o[i];c!==void 0&&(r.push({name:`${p}_lowercase`,value:c.toLowerCase()}),r.push({name:`${p}_capitalize`,value:Xn(c)}),r.push({name:`${p}_uncapitalize`,value:Bn(c)}),r.push({name:p,value:c}))}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 re=require("@typescript-eslint/utils"),Ve=require("zod/v4");var Ti=re.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),Yn="collapse-simple-objs-in-one-line",hi=Ve.z.object({maxLineLength:Ve.z.number().optional(),maxProperties:Ve.z.number().optional(),nestedObjMaxLineLength:Ve.z.number().optional(),nestedObjMaxProperties:Ve.z.number().optional(),ignoreTypesWithSuffix:Ve.z.array(Ve.z.string()).optional()}),Ei=Ti({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:[B(hi)]},defaultOptions:[{}],create(e,[n]){let r=e.sourceCode,t=n.ignoreTypesWithSuffix??[],s=n.maxProperties??2,o=n.nestedObjMaxLineLength??n.maxLineLength,i=n.nestedObjMaxProperties??3;function p(a){if(a.type===re.AST_NODE_TYPES.ObjectExpression){let u=a.parent.type===re.AST_NODE_TYPES.Property,m=u?i:s,y=a.properties.length;if(y>m)return!1;if(y===1){let f=a.properties[0];return!f||f.type===re.AST_NODE_TYPES.Property&&f.value.type===re.AST_NODE_TYPES.ObjectExpression||f.type===re.AST_NODE_TYPES.Property&&f.value.type===re.AST_NODE_TYPES.ArrayExpression&&!f.value.elements.every(x=>x&&Ot(x))?!1:{text:r.getText(f),isNested:u,propsSize:y}}let C=[];for(let f of a.properties){if(f.type===re.AST_NODE_TYPES.Property&&!Ot(f.value))return!1;C.push(r.getText(f))}return{text:C.join(", "),isNested:u,propsSize:y}}else{let u=a.parent.parent?.type===re.AST_NODE_TYPES.TSPropertySignature,m=u?i:s,y=a.members.length;if(y>m)return!1;if(t.length>0&&a.parent.type===re.AST_NODE_TYPES.TSTypeAliasDeclaration){let f=a.parent.id.name;if(t.some(E=>f.endsWith(E)))return!1}if(y===1){let f=a.members[0];return!f||f.type===re.AST_NODE_TYPES.TSPropertySignature&&f.typeAnnotation?.typeAnnotation.type===re.AST_NODE_TYPES.TSTypeLiteral?!1:{text:r.getText(f),isNested:u,propsSize:1}}if(a.parent.type===re.AST_NODE_TYPES.TSIntersectionType||a.parent.type===re.AST_NODE_TYPES.TSUnionType&&a.parent.types[0]!==a)return!1;let C=[];for(let f of a.members){if(f.type!==re.AST_NODE_TYPES.TSPropertySignature)return!1;let E=f.typeAnnotation?.typeAnnotation;if(!E||E.type===re.AST_NODE_TYPES.TSTypeLiteral||!Hn(E))return!1;if(E.type===re.AST_NODE_TYPES.TSTypeReference&&E.typeArguments){if(E.typeArguments.params.length>1)return!1;let S=E.typeArguments.params[0];if(!S||!Hn(S))return!1}let x=r.getText(f).trim();(x.endsWith(";")||x.endsWith(","))&&(x=x.slice(0,-1)),C.push(x)}return{text:C.join("; "),isNested:u,propsSize:y}}}function c(a){if(a.loc.start.line===a.loc.end.line)return;if(a.parent.type!==re.AST_NODE_TYPES.JSXExpressionContainer){let E=0,x=!1,S=r.getTokenAfter(a,{filter:A=>A.type!==re.AST_TOKEN_TYPES.Punctuator||x?!0:A.value===","?(E++,!1):A.value===";"?(E++,x=!0,!1):A.value===")"||A.value==="}"?(E++,!1):!0});if(E>4)return;let I=S?.type===re.AST_TOKEN_TYPES.Template&&S.value.startsWith(`}
2
2
  `);if(S?.loc.start.line===a.loc.end.line&&!I)return}let u=p(a);if(!u)return;let m=u.text;if(m.includes(`
3
3
  `)||r.getCommentsInside(a).length>0)return;m.endsWith(";")&&(m=m.slice(0,-1));let y=`{ ${m} }`,C=xi(r,a),f=u.isNested&&u.propsSize>2?o:n.maxLineLength;f&&y.length+C.length+bi(a,r)>f||e.report({node:a,messageId:"singleLineProp",fix:E=>E.replaceText(a,y)})}return{TSTypeLiteral:c,ObjectExpression:c}}});function Hn(e){return e.type===re.AST_NODE_TYPES.TSLiteralType||e.type===re.AST_NODE_TYPES.TSTypeReference||e.type===re.AST_NODE_TYPES.TSNumberKeyword||e.type===re.AST_NODE_TYPES.TSStringKeyword||e.type===re.AST_NODE_TYPES.TSBooleanKeyword||e.type===re.AST_NODE_TYPES.TSNullKeyword||e.type===re.AST_NODE_TYPES.TSUndefinedKeyword}function Ot(e,n){return!!(e.type===re.AST_NODE_TYPES.Literal||e.type===re.AST_NODE_TYPES.Identifier||e.type===re.AST_NODE_TYPES.TemplateLiteral||e.type===re.AST_NODE_TYPES.TaggedTemplateExpression||!n&&e.type===re.AST_NODE_TYPES.ArrayExpression&&e.elements.every(r=>r&&Ot(r,!0)))}function bi(e,n){let r=n.getLastToken(e);if(!r)return 0;let t=n.text.indexOf(`
4
- `,r.range[1]);return(t!==-1?t:n.text.length)-r.range[1]}function xi(e,n){return e.text.slice(n.range[0]-n.loc.start.column,n.range[0])}var Nt={name:Yn,rule:Ei};var Ci=/eslint +react-compiler\/react-compiler: +\["error/,Zn={meta:{type:"suggestion",docs:{description:"verifies the list of dependencies for Hooks like useEffect and similar",recommended:!0,url:"https://github.com/facebook/react/issues/14920"},fixable:"code",hasSuggestions:!0,schema:[{type:"object",additionalProperties:!1,ignoreIfReactCompilerIsEnabled:!1,enableDangerousAutofixThisMayCauseInfiniteLoops:!1,properties:{additionalHooks:{type:"string"},ignoreIfReactCompilerIsEnabled:{type:"boolean"},enableDangerousAutofixThisMayCauseInfiniteLoops:{type:"boolean"}}}]},create(e){let n=!1,r=typeof e.getSource=="function"?I=>r(I):I=>e.sourceCode.getText(I),t=typeof e.getScope=="function"?()=>t():I=>e.sourceCode.getScope(I),s=e.options&&e.options[0]&&e.options[0].additionalHooks?new RegExp(e.options[0].additionalHooks):void 0,o=e.options&&e.options[0]&&e.options[0].enableDangerousAutofixThisMayCauseInfiniteLoops||!1,i={additionalHooks:s,enableDangerousAutofixThisMayCauseInfiniteLoops:o};function p(I){o&&Array.isArray(I.suggest)&&I.suggest.length>0&&(I.fix=I.suggest[0].fix),e.report(I)}let c=e.getSourceCode().scopeManager,a=new WeakMap,u=new WeakSet,m=new WeakMap,y=new WeakMap,C=new WeakSet;function f(I,A){return function(T){if(A.has(T))return A.get(T);let h=I(T);return A.set(T,h),h}}function E(I,A,T,h,b){b&&I.async&&p({node:I,message:`Effect callbacks are synchronous to prevent race conditions. Put the async function inside:
4
+ `,r.range[1]);return(t!==-1?t:n.text.length)-r.range[1]}function xi(e,n){return e.text.slice(n.range[0]-n.loc.start.column,n.range[0])}var Nt={name:Yn,rule:Ei};var Ci=/eslint +react-compiler\/react-compiler: +\["error/,Zn={meta:{type:"suggestion",docs:{description:"verifies the list of dependencies for Hooks like useEffect and similar",recommended:!0,url:"https://github.com/facebook/react/issues/14920"},fixable:"code",hasSuggestions:!0,schema:[{type:"object",additionalProperties:!1,ignoreIfReactCompilerIsEnabled:!1,enableDangerousAutofixThisMayCauseInfiniteLoops:!1,properties:{additionalHooks:{type:"string"},ignoreIfReactCompilerIsEnabled:{type:"boolean"},enableDangerousAutofixThisMayCauseInfiniteLoops:{type:"boolean"},reactCompilerIsEnabled:{type:"boolean"}}}]},create(e){let n=!1,r=typeof e.getSource=="function"?I=>r(I):I=>e.sourceCode.getText(I),t=typeof e.getScope=="function"?()=>t():I=>e.sourceCode.getScope(I),s=e.options&&e.options[0]&&e.options[0].additionalHooks?new RegExp(e.options[0].additionalHooks):void 0,o=e.options&&e.options[0]&&e.options[0].enableDangerousAutofixThisMayCauseInfiniteLoops||!1,i={additionalHooks:s,enableDangerousAutofixThisMayCauseInfiniteLoops:o};function p(I){o&&Array.isArray(I.suggest)&&I.suggest.length>0&&(I.fix=I.suggest[0].fix),e.report(I)}let c=e.getSourceCode().scopeManager,a=new WeakMap,u=new WeakSet,m=new WeakMap,y=new WeakMap,C=new WeakSet;function f(I,A){return function(T){if(A.has(T))return A.get(T);let h=I(T);return A.set(T,h),h}}function E(I,A,T,h,b){b&&I.async&&p({node:I,message:`Effect callbacks are synchronous to prevent race conditions. Put the async function inside:
5
5
 
6
6
  useEffect(() => {
7
7
  async function fetchData() {
@@ -32,7 +32,7 @@ const ${e}: FC<${u}> = ({ ${c} }) => {
32
32
 
33
33
  ${y}`)),E.push(m.replaceText(s,C)),E}}]})}function Go(e,n,r){let t=e.arguments[0];if(!t||t.type!==$.AST_NODE_TYPES.JSXElement&&t.type!==$.AST_NODE_TYPES.JSXFragment)return;let s=t,o=Wr(s,n);if(!o.hasUnstable)return;let i=Yo(s),p=Jr(s,[],n),c=s.type===$.AST_NODE_TYPES.JSXElement?Xr(s,n):null,a=o.problematicProps.length===1?`prop "${o.problematicProps[0]}"`:`props "${o.problematicProps.join('", "')}"`;r.report({node:s,messageId:"unstableValueInMap",data:{problematicProps:a},suggest:[{messageId:"extractComponent",data:{componentName:i},fix:u=>{let m=Vr(i,s,[],p,n),y=qo(i,p,c),C=e;for(;C.parent.type!==$.AST_NODE_TYPES.Program&&!(C.type===$.AST_NODE_TYPES.FunctionDeclaration||C.type===$.AST_NODE_TYPES.VariableDeclarator&&C.init&&(C.init.type===$.AST_NODE_TYPES.ArrowFunctionExpression||C.init.type===$.AST_NODE_TYPES.FunctionExpression));)C=C.parent;let f=[];return f.push(u.insertTextAfter(C,`
34
34
 
35
- ${m}`)),f.push(u.replaceText(s,y)),f}}]})}var It=require("@typescript-eslint/utils"),Ko=It.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),Br="require-description",Qo=/^(eslint(?:-env|-enable|-disable(?:(?:-next)?-line)?)?|exported|globals?)(?:\s|$)/u,ea=/^eslint-disable-(next-)?line$/u,ta=Ko({name:Br,meta:{type:"problem",docs:{description:"Require descriptions for eslint directives."},messages:{missingDescription:"Unexpected undescribed directive comment. Include descriptions to explain why the comment is necessary."},schema:[{type:"object",properties:{ignore:{type:"array",items:{type:"string",enum:["eslint","eslint-disable","eslint-disable-line","eslint-disable-next-line","eslint-enable","eslint-env","exported","global","globals"]},additionalItems:!1,uniqueItems:!0}},additionalProperties:!1}]},defaultOptions:[{ignore:[]}],create(e,[n]){let r=e.sourceCode,t=new Set(n.ignore||[]);return{Program(){for(let s of r.getAllComments()){let o=na(s);o!=null&&(t.has(o.kind)||o.description||e.report({loc:sa(s.loc),messageId:"missingDescription"}))}}}}}),Hr={name:Br,rule:ta};function na(e){let{text:n,description:r}=ia(e.value);if(!n)return null;let t=Qo.exec(n);if(!t)return null;let s=t[1];if(!s)return null;let o=ea.test(s);if(e.type===It.TSESTree.AST_TOKEN_TYPES.Line&&!o||o&&e.loc.start.line!==e.loc.end.line)return null;let i=n.slice(t.index+s.length);return{kind:s,value:i.trim(),description:r}}var ra=/\s-{2,}\s/u;function ia(e){let n=e.split(ra);return{text:n[0]?.trim(),description:n.length>1?n[1]?.trim()??null:null}}function sa(e){return{start:{line:e.start.line,column:-1},end:e.end}}var ne=require("@typescript-eslint/utils"),Me=require("zod/v4");var oa=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=q({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:[B(oa)]},defaultOptions:[{varsToCheck:[]}],create(e,[n]){let r=new Map;function t(i,p,c,a){let u=new Set;for(let y of i.properties)y.type===ne.AST_NODE_TYPES.Property&&y.key.type===ne.AST_NODE_TYPES.Identifier&&u.add(y.key.name);let m=p.filter(y=>!u.has(y));if(m.length>0)if(m.length===1)e.report({node:i,messageId:"propNotRead",data:{prop:m[0],fnName:a,customMsg:c||""}});else{let y=m.map(C=>`"${C}"`).join(", ");e.report({node:i,messageId:"propsNotRead",data:{props:y,fnName:a,customMsg:c||""}})}}function s(i){if(i.init?.type===ne.AST_NODE_TYPES.CallExpression){if(i.init.callee.type===ne.AST_NODE_TYPES.Identifier)return i.init.callee.name;if(i.init.callee.type===ne.AST_NODE_TYPES.MemberExpression&&i.init.callee.property.type===ne.AST_NODE_TYPES.Identifier)return i.init.callee.object.type===ne.AST_NODE_TYPES.Identifier?`${i.init.callee.object.name}.${i.init.callee.property.name}`:i.init.callee.property.name}return"unknown function"}let o={};for(let i of n.varsToCheck)i.selector&&(o[i.selector]=p=>{if(p.type===ne.AST_NODE_TYPES.VariableDeclarator&&p.id.type===ne.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===ne.AST_NODE_TYPES.VariableDeclarator&&p.id.type===ne.AST_NODE_TYPES.ObjectPattern){let c=Array.isArray(i.prop)?i.prop:[i.prop];t(p.id,c,i.errorMsg,s(p))}});for(let i of n.varsToCheck)if(i.fromFnCall){let p=i.fromFnCall;if(p.startsWith("*.")){let a=`VariableDeclarator > CallExpression > MemberExpression[property.name="${p.slice(2)}"]`;o[a]=u=>{if(u.type!==ne.AST_NODE_TYPES.MemberExpression||u.parent.type!==ne.AST_NODE_TYPES.CallExpression)return;let m=u.parent;if(m.parent.type!==ne.AST_NODE_TYPES.VariableDeclarator)return;let y=m.parent;if(y.id.type===ne.AST_NODE_TYPES.Identifier)r.set(y.id.name,{props:Array.isArray(i.prop)?i.prop:[i.prop],errorMsg:i.errorMsg,node:y.id,fnName:i.fromFnCall||"unknown function"});else if(y.id.type===ne.AST_NODE_TYPES.ObjectPattern){let C=Array.isArray(i.prop)?i.prop:[i.prop];t(y.id,C,i.errorMsg,i.fromFnCall||"unknown function")}}}else if(p.includes(".")){let[c,a]=p.split("."),u=`VariableDeclarator > CallExpression > MemberExpression[object.name="${c}"][property.name="${a}"]`;o[u]=m=>{if(m.type!==ne.AST_NODE_TYPES.MemberExpression||m.parent.type!==ne.AST_NODE_TYPES.CallExpression)return;let y=m.parent;if(y.parent.type!==ne.AST_NODE_TYPES.VariableDeclarator)return;let C=y.parent;if(C.id.type===ne.AST_NODE_TYPES.Identifier)r.set(C.id.name,{props:Array.isArray(i.prop)?i.prop:[i.prop],errorMsg:i.errorMsg,node:C.id,fnName:i.fromFnCall||"unknown function"});else if(C.id.type===ne.AST_NODE_TYPES.ObjectPattern){let f=Array.isArray(i.prop)?i.prop:[i.prop];t(C.id,f,i.errorMsg,i.fromFnCall||"unknown function")}}}else{let c=`VariableDeclarator > CallExpression > Identifier[name="${p}"]`;o[c]=a=>{if(a.type!==ne.AST_NODE_TYPES.Identifier||a.parent.type!==ne.AST_NODE_TYPES.CallExpression)return;let u=a.parent;if(u.parent.type!==ne.AST_NODE_TYPES.VariableDeclarator)return;let m=u.parent;if(m.id.type===ne.AST_NODE_TYPES.Identifier)r.set(m.id.name,{props:Array.isArray(i.prop)?i.prop:[i.prop],errorMsg:i.errorMsg,node:m.id,fnName:i.fromFnCall||"unknown function"});else if(m.id.type===ne.AST_NODE_TYPES.ObjectPattern){let y=Array.isArray(i.prop)?i.prop:[i.prop];t(m.id,y,i.errorMsg,i.fromFnCall||"unknown function")}}}}return{...o,"Program:exit"(){for(let[i,{props:p,errorMsg:c,node:a,fnName:u}]of r){let y=e.sourceCode.getScope(a).set.get(i);if(y){let C=new Set(p);for(let f of y.references){let E=f.identifier,x=E.parent;if(!(x.type===ne.AST_NODE_TYPES.VariableDeclarator&&x.id===E)){if(x.type===ne.AST_NODE_TYPES.MemberExpression&&x.object===E&&x.property.type===ne.AST_NODE_TYPES.Identifier&&C.has(x.property.name)){if(C.delete(x.property.name),C.size===0)break;continue}if(x.type===ne.AST_NODE_TYPES.VariableDeclarator&&x.init===E&&x.id.type===ne.AST_NODE_TYPES.ObjectPattern){for(let S of x.id.properties)S.type===ne.AST_NODE_TYPES.Property&&S.key.type===ne.AST_NODE_TYPES.Identifier&&C.has(S.key.name)&&C.delete(S.key.name);if(C.size===0)break;continue}if(!(x.type===ne.AST_NODE_TYPES.MemberExpression&&x.object===E&&x.property.type===ne.AST_NODE_TYPES.Identifier&&!p.includes(x.property.name))){C.clear();break}}}if(C.size>0){let f=Array.from(C);if(f.length===1)e.report({node:a,messageId:"propNotRead",data:{prop:f[0],fnName:u,customMsg:c||""}});else{let E=f.map(x=>`"${x}"`).join(", ");e.report({node:a,messageId:"propsNotRead",data:{props:E,fnName:u,customMsg:c||""}})}}}}}}}});function Zr(e){return/^use[A-Z0-9]/.test(e)}function At(e){return e.type==="Identifier"?Zr(e.name):e.type==="MemberExpression"&&!e.computed&&At(e.property)?e.object.type==="Identifier":!1}function Gr(e){return e.type==="Identifier"&&/^[A-Z]/.test(e.name)}function Kr(e,n){return e.name===n||e.type==="MemberExpression"&&e.object.name==="React"&&e.property.name===n}function Qr(e){return!!(e.parent&&e.parent.callee&&Kr(e.parent.callee,"forwardRef"))}function ei(e){return!!(e.parent&&e.parent.callee&&Kr(e.parent.callee,"memo"))}function Fn(e){for(;e;){let n=ni(e);if(n&&(Gr(n)||At(n))||Qr(e)||ei(e))return!0;e=e.parent}return!1}function Yr(e){return!1}function kn(e){return!1}var aa=/eslint +react-compiler\/react-compiler: +\["error/,ti={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){let n=!!e.options[0]?.reactCompilerIsEnabled;if(e.options[0]?.ignoreIfReactCompilerIsEnabled||n){for(let a of e.sourceCode.getAllComments())if(n||aa.test(a.value))return{CallExpression(u){let m=null;u.callee.name==="useMemo"?m="useMemo":u.callee.name==="useCallback"&&(m="useCallback"),m&&e.report({node:u,message:`"${m}" is not necessary when using React Compiler.`})}}}let r=typeof e.getSource=="function"?a=>r(a):a=>e.sourceCode.getText(a),t=typeof e.getScope=="function"?()=>t():a=>e.sourceCode.getScope(a),s=null,o=[],i=[],p=new WeakSet;function c(a){for(let u of a.references){let m=u.identifier.parent;if(m.type==="VariableDeclarator"&&m.init&&m.init.type==="CallExpression"&&m.init.callee&&Yr(m.init.callee))for(let y of u.resolved.references)y!==u&&p.add(y.identifier)}}return{onCodePathSegmentStart:a=>i.push(a),onCodePathSegmentEnd:()=>i.pop(),onCodePathStart:()=>o.push(new Map),onCodePathEnd(a,u){let m=o.pop();if(m.size===0)return;let y=new Set;function C(h,b){let{cache:w}=C,P=w.get(h.id),N=new Set(b);if(N.has(h.id)){let l=[...N],R=l.slice(l.indexOf(h.id)+1);for(let d of R)y.add(d);return BigInt("0")}if(N.add(h.id),P!==void 0)return P;if(a.thrownSegments.includes(h))P=BigInt("0");else if(h.prevSegments.length===0)P=BigInt("1");else{P=BigInt("0");for(let l of h.prevSegments)P+=C(l,N)}return h.reachable&&P===BigInt("0")?w.delete(h.id):w.set(h.id,P),P}function f(h,b){let{cache:w}=f,P=w.get(h.id),N=new Set(b);if(N.has(h.id)){let l=Array.from(N),R=l.slice(l.indexOf(h.id)+1);for(let d of R)y.add(d);return BigInt("0")}if(N.add(h.id),P!==void 0)return P;if(a.thrownSegments.includes(h))P=BigInt("0");else if(h.nextSegments.length===0)P=BigInt("1");else{P=BigInt("0");for(let l of h.nextSegments)P+=f(l,N)}return w.set(h.id,P),P}function E(h){let{cache:b}=E,w=b.get(h.id);if(w===null)return 1/0;if(w!==void 0)return w;if(b.set(h.id,null),h.prevSegments.length===0)w=1;else{w=1/0;for(let P of h.prevSegments){let N=E(P);N<w&&(w=N)}w+=1}return b.set(h.id,w),w}C.cache=new Map,f.cache=new Map,E.cache=new Map;let x=f(a.initialSegment),S=ni(u),I=Fn(u),A=S?Gr(S)||At(S):Qr(u)||ei(u),T=1/0;for(let h of a.finalSegments){if(!h.reachable)continue;let b=E(h);b<T&&(T=b)}for(let[h,b]of m){if(!h.reachable)continue;let w=h.nextSegments.length===0?T<=E(h):T<E(h),P=C(h)*f(h),N=y.has(h.id);for(let l of b)if(N&&!kn(l)&&e.report({node:l,message:`React Hook "${r(l)}" may be executed more than once. Possibly because it is called in a loop. React Hooks must be called in the exact same order in every component render.`}),A){if(u.async&&e.report({node:l,message:`React Hook "${r(l)}" cannot be called in an async function.`}),!N&&P!==x&&!kn(l)){let d=`React Hook "${r(l)}" is called conditionally. React Hooks must be called in the exact same order in every component render.`+(w?" Did you accidentally call a React Hook after an early return?":"");e.report({node:l,message:d})}}else if(u.parent&&(u.parent.type==="MethodDefinition"||u.parent.type==="ClassProperty")&&u.parent.value===u){let R=`React Hook "${r(l)}" 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:l,message:R})}else if(S){let R=`React Hook "${r(l)}" is called in function "${r(S)}" that is neither a React function component nor a custom React Hook function. React component names must start with an uppercase letter. React Hook names must start with the word "use".`;e.report({node:l,message:R})}else if(u.type==="Program"){let R=`React Hook "${r(l)}" 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:l,message:R})}else if(I&&!kn(l)){if(u.parent.type==="CallExpression"&&u.parent.callee.type==="Identifier"&&u.parent.callee.name==="useCallback"){let d=u.parent;if(d.parent.type==="VariableDeclarator"&&Zr(d.parent.id.name))return}let R=`React Hook "${r(l)}" 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:l,message:R})}}},CallExpression(a){if(At(a.callee)){let u=qr(o),m=qr(i),y=u.get(m);y||(y=[],u.set(m,y)),y.push(a.callee)}a.callee.type==="Identifier"&&(a.callee.name==="useEffect"||Yr(a.callee))&&a.arguments.length>0&&(s=a)},Identifier(a){s==null&&p.has(a)&&a.parent.type!=="CallExpression"&&e.report({node:a,message:`\`${r(a)}\` is a function created with React Hook "useEffectEvent", and can only be called from the same component. They cannot be assigned to variables or passed down.`})},"CallExpression:exit"(a){a===s&&(s=null)},FunctionDeclaration(a){Fn(a)&&c(t(a))},ArrowFunctionExpression(a){Fn(a)&&c(t(a))}}}};function ni(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 qr(e){return e[e.length-1]}var ge=require("@typescript-eslint/utils"),xe=ve(require("zod/v4"));var la=/^\s+$/,Pn=/\r?\n/,pa=/^(\s*)/,ca=/^(\s*)\S/,ua=/\r?\n/,fa=xe.object({indent:xe.union([xe.string().regex(la),xe.number().int().min(1)]).optional(),tags:xe.array(xe.string()).optional(),functions:xe.array(xe.string()).optional(),comments:xe.array(xe.string()).optional()}),vn=q({name:"template-indent",meta:{type:"suggestion",docs:{description:"Fix whitespace-insensitive template indentation"},fixable:"code",schema:[B(fa)],messages:{improperlyIndented:"Templates should be properly indented."}},defaultOptions:[{}],create(e){let n=e.sourceCode,{comments:r=["HTML","indent"],functions:t=["dedent","stripIndent"],tags:s=["outdent","dedent","gql","sql","html","styled"],indent:o}=e.options[0],i=r.map(S=>S.toLowerCase());function p(S){let I=S.split(Pn),A=I.filter(h=>h.trim()!=="");if(A.length===0)return S;let T=Number.POSITIVE_INFINITY;for(let h of A){let b=h.match(pa);b&&(T=Math.min(T,b[1]?.length??0))}return!isFinite(T)||T===0?S:I.map(h=>h.slice(T)).join(`
35
+ ${m}`)),f.push(u.replaceText(s,y)),f}}]})}var It=require("@typescript-eslint/utils"),Ko=It.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),Br="require-description",Qo=/^(eslint(?:-env|-enable|-disable(?:(?:-next)?-line)?)?|exported|globals?)(?:\s|$)/u,ea=/^eslint-disable-(next-)?line$/u,ta=Ko({name:Br,meta:{type:"problem",docs:{description:"Require descriptions for eslint directives."},messages:{missingDescription:"Unexpected undescribed directive comment. Include descriptions to explain why the comment is necessary."},schema:[{type:"object",properties:{ignore:{type:"array",items:{type:"string",enum:["eslint","eslint-disable","eslint-disable-line","eslint-disable-next-line","eslint-enable","eslint-env","exported","global","globals"]},additionalItems:!1,uniqueItems:!0}},additionalProperties:!1}]},defaultOptions:[{ignore:[]}],create(e,[n]){let r=e.sourceCode,t=new Set(n.ignore||[]);return{Program(){for(let s of r.getAllComments()){let o=na(s);o!=null&&(t.has(o.kind)||o.description||e.report({loc:sa(s.loc),messageId:"missingDescription"}))}}}}}),Hr={name:Br,rule:ta};function na(e){let{text:n,description:r}=ia(e.value);if(!n)return null;let t=Qo.exec(n);if(!t)return null;let s=t[1];if(!s)return null;let o=ea.test(s);if(e.type===It.TSESTree.AST_TOKEN_TYPES.Line&&!o||o&&e.loc.start.line!==e.loc.end.line)return null;let i=n.slice(t.index+s.length);return{kind:s,value:i.trim(),description:r}}var ra=/\s-{2,}\s/u;function ia(e){let n=e.split(ra);return{text:n[0]?.trim(),description:n.length>1?n[1]?.trim()??null:null}}function sa(e){return{start:{line:e.start.line,column:-1},end:e.end}}var ne=require("@typescript-eslint/utils"),Me=require("zod/v4");var oa=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=q({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:[B(oa)]},defaultOptions:[{varsToCheck:[]}],create(e,[n]){let r=new Map;function t(i,p,c,a){let u=new Set;for(let y of i.properties)y.type===ne.AST_NODE_TYPES.Property&&y.key.type===ne.AST_NODE_TYPES.Identifier&&u.add(y.key.name);let m=p.filter(y=>!u.has(y));if(m.length>0)if(m.length===1)e.report({node:i,messageId:"propNotRead",data:{prop:m[0],fnName:a,customMsg:c||""}});else{let y=m.map(C=>`"${C}"`).join(", ");e.report({node:i,messageId:"propsNotRead",data:{props:y,fnName:a,customMsg:c||""}})}}function s(i){if(i.init?.type===ne.AST_NODE_TYPES.CallExpression){if(i.init.callee.type===ne.AST_NODE_TYPES.Identifier)return i.init.callee.name;if(i.init.callee.type===ne.AST_NODE_TYPES.MemberExpression&&i.init.callee.property.type===ne.AST_NODE_TYPES.Identifier)return i.init.callee.object.type===ne.AST_NODE_TYPES.Identifier?`${i.init.callee.object.name}.${i.init.callee.property.name}`:i.init.callee.property.name}return"unknown function"}let o={};for(let i of n.varsToCheck)i.selector&&(o[i.selector]=p=>{if(p.type===ne.AST_NODE_TYPES.VariableDeclarator&&p.id.type===ne.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===ne.AST_NODE_TYPES.VariableDeclarator&&p.id.type===ne.AST_NODE_TYPES.ObjectPattern){let c=Array.isArray(i.prop)?i.prop:[i.prop];t(p.id,c,i.errorMsg,s(p))}});for(let i of n.varsToCheck)if(i.fromFnCall){let p=i.fromFnCall;if(p.startsWith("*.")){let a=`VariableDeclarator > CallExpression > MemberExpression[property.name="${p.slice(2)}"]`;o[a]=u=>{if(u.type!==ne.AST_NODE_TYPES.MemberExpression||u.parent.type!==ne.AST_NODE_TYPES.CallExpression)return;let m=u.parent;if(m.parent.type!==ne.AST_NODE_TYPES.VariableDeclarator)return;let y=m.parent;if(y.id.type===ne.AST_NODE_TYPES.Identifier)r.set(y.id.name,{props:Array.isArray(i.prop)?i.prop:[i.prop],errorMsg:i.errorMsg,node:y.id,fnName:i.fromFnCall||"unknown function"});else if(y.id.type===ne.AST_NODE_TYPES.ObjectPattern){let C=Array.isArray(i.prop)?i.prop:[i.prop];t(y.id,C,i.errorMsg,i.fromFnCall||"unknown function")}}}else if(p.includes(".")){let[c,a]=p.split("."),u=`VariableDeclarator > CallExpression > MemberExpression[object.name="${c}"][property.name="${a}"]`;o[u]=m=>{if(m.type!==ne.AST_NODE_TYPES.MemberExpression||m.parent.type!==ne.AST_NODE_TYPES.CallExpression)return;let y=m.parent;if(y.parent.type!==ne.AST_NODE_TYPES.VariableDeclarator)return;let C=y.parent;if(C.id.type===ne.AST_NODE_TYPES.Identifier)r.set(C.id.name,{props:Array.isArray(i.prop)?i.prop:[i.prop],errorMsg:i.errorMsg,node:C.id,fnName:i.fromFnCall||"unknown function"});else if(C.id.type===ne.AST_NODE_TYPES.ObjectPattern){let f=Array.isArray(i.prop)?i.prop:[i.prop];t(C.id,f,i.errorMsg,i.fromFnCall||"unknown function")}}}else{let c=`VariableDeclarator > CallExpression > Identifier[name="${p}"]`;o[c]=a=>{if(a.type!==ne.AST_NODE_TYPES.Identifier||a.parent.type!==ne.AST_NODE_TYPES.CallExpression)return;let u=a.parent;if(u.parent.type!==ne.AST_NODE_TYPES.VariableDeclarator)return;let m=u.parent;if(m.id.type===ne.AST_NODE_TYPES.Identifier)r.set(m.id.name,{props:Array.isArray(i.prop)?i.prop:[i.prop],errorMsg:i.errorMsg,node:m.id,fnName:i.fromFnCall||"unknown function"});else if(m.id.type===ne.AST_NODE_TYPES.ObjectPattern){let y=Array.isArray(i.prop)?i.prop:[i.prop];t(m.id,y,i.errorMsg,i.fromFnCall||"unknown function")}}}}return{...o,"Program:exit"(){for(let[i,{props:p,errorMsg:c,node:a,fnName:u}]of r){let y=e.sourceCode.getScope(a).set.get(i);if(y){let C=new Set(p);for(let f of y.references){let E=f.identifier,x=E.parent;if(!(x.type===ne.AST_NODE_TYPES.VariableDeclarator&&x.id===E)){if(x.type===ne.AST_NODE_TYPES.MemberExpression&&x.object===E&&x.property.type===ne.AST_NODE_TYPES.Identifier&&C.has(x.property.name)){if(C.delete(x.property.name),C.size===0)break;continue}if(x.type===ne.AST_NODE_TYPES.VariableDeclarator&&x.init===E&&x.id.type===ne.AST_NODE_TYPES.ObjectPattern){for(let S of x.id.properties)S.type===ne.AST_NODE_TYPES.Property&&S.key.type===ne.AST_NODE_TYPES.Identifier&&C.has(S.key.name)&&C.delete(S.key.name);if(C.size===0)break;continue}if(!(x.type===ne.AST_NODE_TYPES.MemberExpression&&x.object===E&&x.property.type===ne.AST_NODE_TYPES.Identifier&&!p.includes(x.property.name))){C.clear();break}}}if(C.size>0){let f=Array.from(C);if(f.length===1)e.report({node:a,messageId:"propNotRead",data:{prop:f[0],fnName:u,customMsg:c||""}});else{let E=f.map(x=>`"${x}"`).join(", ");e.report({node:a,messageId:"propsNotRead",data:{props:E,fnName:u,customMsg:c||""}})}}}}}}}});function Zr(e){return/^use[A-Z0-9]/.test(e)}function At(e){return e.type==="Identifier"?Zr(e.name):e.type==="MemberExpression"&&!e.computed&&At(e.property)?e.object.type==="Identifier":!1}function Gr(e){return e.type==="Identifier"&&/^[A-Z]/.test(e.name)}function Kr(e,n){return e.name===n||e.type==="MemberExpression"&&e.object.name==="React"&&e.property.name===n}function Qr(e){return!!(e.parent&&e.parent.callee&&Kr(e.parent.callee,"forwardRef"))}function ei(e){return!!(e.parent&&e.parent.callee&&Kr(e.parent.callee,"memo"))}function Fn(e){for(;e;){let n=ni(e);if(n&&(Gr(n)||At(n))||Qr(e)||ei(e))return!0;e=e.parent}return!1}function Yr(e){return!1}function kn(e){return!1}var aa=/eslint +react-compiler\/react-compiler: +\["error/,ti={meta:{type:"problem",docs:{description:"enforces the Rules of Hooks",recommended:!0,url:"https://reactjs.org/docs/hooks-rules.html"},schema:[{type:"object",ignoreIfReactCompilerIsEnabled:!1,properties:{ignoreIfReactCompilerIsEnabled:{type:"boolean"},reactCompilerIsEnabled:{type:"boolean"}}}]},create(e){let n=!!e.options[0]?.reactCompilerIsEnabled;if(e.options[0]?.ignoreIfReactCompilerIsEnabled||n){for(let a of e.sourceCode.getAllComments())if(n||aa.test(a.value))return{CallExpression(u){let m=null;u.callee.name==="useMemo"?m="useMemo":u.callee.name==="useCallback"&&(m="useCallback"),m&&e.report({node:u,message:`"${m}" is not necessary when using React Compiler.`})}}}let r=typeof e.getSource=="function"?a=>r(a):a=>e.sourceCode.getText(a),t=typeof e.getScope=="function"?()=>t():a=>e.sourceCode.getScope(a),s=null,o=[],i=[],p=new WeakSet;function c(a){for(let u of a.references){let m=u.identifier.parent;if(m.type==="VariableDeclarator"&&m.init&&m.init.type==="CallExpression"&&m.init.callee&&Yr(m.init.callee))for(let y of u.resolved.references)y!==u&&p.add(y.identifier)}}return{onCodePathSegmentStart:a=>i.push(a),onCodePathSegmentEnd:()=>i.pop(),onCodePathStart:()=>o.push(new Map),onCodePathEnd(a,u){let m=o.pop();if(m.size===0)return;let y=new Set;function C(h,b){let{cache:w}=C,P=w.get(h.id),N=new Set(b);if(N.has(h.id)){let l=[...N],R=l.slice(l.indexOf(h.id)+1);for(let d of R)y.add(d);return BigInt("0")}if(N.add(h.id),P!==void 0)return P;if(a.thrownSegments.includes(h))P=BigInt("0");else if(h.prevSegments.length===0)P=BigInt("1");else{P=BigInt("0");for(let l of h.prevSegments)P+=C(l,N)}return h.reachable&&P===BigInt("0")?w.delete(h.id):w.set(h.id,P),P}function f(h,b){let{cache:w}=f,P=w.get(h.id),N=new Set(b);if(N.has(h.id)){let l=Array.from(N),R=l.slice(l.indexOf(h.id)+1);for(let d of R)y.add(d);return BigInt("0")}if(N.add(h.id),P!==void 0)return P;if(a.thrownSegments.includes(h))P=BigInt("0");else if(h.nextSegments.length===0)P=BigInt("1");else{P=BigInt("0");for(let l of h.nextSegments)P+=f(l,N)}return w.set(h.id,P),P}function E(h){let{cache:b}=E,w=b.get(h.id);if(w===null)return 1/0;if(w!==void 0)return w;if(b.set(h.id,null),h.prevSegments.length===0)w=1;else{w=1/0;for(let P of h.prevSegments){let N=E(P);N<w&&(w=N)}w+=1}return b.set(h.id,w),w}C.cache=new Map,f.cache=new Map,E.cache=new Map;let x=f(a.initialSegment),S=ni(u),I=Fn(u),A=S?Gr(S)||At(S):Qr(u)||ei(u),T=1/0;for(let h of a.finalSegments){if(!h.reachable)continue;let b=E(h);b<T&&(T=b)}for(let[h,b]of m){if(!h.reachable)continue;let w=h.nextSegments.length===0?T<=E(h):T<E(h),P=C(h)*f(h),N=y.has(h.id);for(let l of b)if(N&&!kn(l)&&e.report({node:l,message:`React Hook "${r(l)}" may be executed more than once. Possibly because it is called in a loop. React Hooks must be called in the exact same order in every component render.`}),A){if(u.async&&e.report({node:l,message:`React Hook "${r(l)}" cannot be called in an async function.`}),!N&&P!==x&&!kn(l)){let d=`React Hook "${r(l)}" is called conditionally. React Hooks must be called in the exact same order in every component render.`+(w?" Did you accidentally call a React Hook after an early return?":"");e.report({node:l,message:d})}}else if(u.parent&&(u.parent.type==="MethodDefinition"||u.parent.type==="ClassProperty")&&u.parent.value===u){let R=`React Hook "${r(l)}" 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:l,message:R})}else if(S){let R=`React Hook "${r(l)}" is called in function "${r(S)}" that is neither a React function component nor a custom React Hook function. React component names must start with an uppercase letter. React Hook names must start with the word "use".`;e.report({node:l,message:R})}else if(u.type==="Program"){let R=`React Hook "${r(l)}" 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:l,message:R})}else if(I&&!kn(l)){if(u.parent.type==="CallExpression"&&u.parent.callee.type==="Identifier"&&u.parent.callee.name==="useCallback"){let d=u.parent;if(d.parent.type==="VariableDeclarator"&&Zr(d.parent.id.name))return}let R=`React Hook "${r(l)}" 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:l,message:R})}}},CallExpression(a){if(At(a.callee)){let u=qr(o),m=qr(i),y=u.get(m);y||(y=[],u.set(m,y)),y.push(a.callee)}a.callee.type==="Identifier"&&(a.callee.name==="useEffect"||Yr(a.callee))&&a.arguments.length>0&&(s=a)},Identifier(a){s==null&&p.has(a)&&a.parent.type!=="CallExpression"&&e.report({node:a,message:`\`${r(a)}\` is a function created with React Hook "useEffectEvent", and can only be called from the same component. They cannot be assigned to variables or passed down.`})},"CallExpression:exit"(a){a===s&&(s=null)},FunctionDeclaration(a){Fn(a)&&c(t(a))},ArrowFunctionExpression(a){Fn(a)&&c(t(a))}}}};function ni(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 qr(e){return e[e.length-1]}var ge=require("@typescript-eslint/utils"),xe=ve(require("zod/v4"));var la=/^\s+$/,Pn=/\r?\n/,pa=/^(\s*)/,ca=/^(\s*)\S/,ua=/\r?\n/,fa=xe.object({indent:xe.union([xe.string().regex(la),xe.number().int().min(1)]).optional(),tags:xe.array(xe.string()).optional(),functions:xe.array(xe.string()).optional(),comments:xe.array(xe.string()).optional()}),vn=q({name:"template-indent",meta:{type:"suggestion",docs:{description:"Fix whitespace-insensitive template indentation"},fixable:"code",schema:[B(fa)],messages:{improperlyIndented:"Templates should be properly indented."}},defaultOptions:[{}],create(e){let n=e.sourceCode,{comments:r=["HTML","indent"],functions:t=["dedent","stripIndent"],tags:s=["outdent","dedent","gql","sql","html","styled"],indent:o}=e.options[0],i=r.map(S=>S.toLowerCase());function p(S){let I=S.split(Pn),A=I.filter(h=>h.trim()!=="");if(A.length===0)return S;let T=Number.POSITIVE_INFINITY;for(let h of A){let b=h.match(pa);b&&(T=Math.min(T,b[1]?.length??0))}return!isFinite(T)||T===0?S:I.map(h=>h.slice(T)).join(`
36
36
  `)}function c(S,I,A){return S.split(Pn).map(h=>h.trim()===""?h:A.repeat(I)+h).join(`
37
37
  `)}function a(S){if(S.type===ge.AST_NODE_TYPES.Identifier)return S.name;if(S.type===ge.AST_NODE_TYPES.MemberExpression){let I=S.object.type===ge.AST_NODE_TYPES.Identifier?S.object.name:null,A=S.property.type===ge.AST_NODE_TYPES.Identifier?S.property.name:null;return I&&A?`${I}.${A}`:A}return null}function u(S,I){if(!S)return!1;for(let A of I)if(A.includes(".")){let T=A.split(".");if(S.type===ge.AST_NODE_TYPES.MemberExpression&&S.object.type===ge.AST_NODE_TYPES.Identifier&&S.property.type===ge.AST_NODE_TYPES.Identifier&&S.object.name===T[0]&&S.property.name===T[1])return!0}else if(S.type===ge.AST_NODE_TYPES.Identifier&&S.name===A)return!0;return!1}function m(S,I){let A=S.parent;if(A.type!==ge.AST_NODE_TYPES.TaggedTemplateExpression)return!1;let T=a(A.tag);return T?I.includes(T):!1}function y(S,I){if(!S||S.type!==ge.AST_NODE_TYPES.CallExpression)return!1;let{method:A,argumentsLength:T,optionalCall:h=!0,optionalMember:b=!0}=I;return T!==void 0&&S.arguments.length!==T||!h&&S.optional||S.callee.type!==ge.AST_NODE_TYPES.MemberExpression||!b&&S.callee.optional||S.callee.property.type!==ge.AST_NODE_TYPES.Identifier?!1:S.callee.property.name===A}function C(S,I){if(!S||S.type!==ge.AST_NODE_TYPES.CallExpression)return!1;let{name:A,argumentsLength:T,optionalCall:h=!0}=I;return T!==void 0&&S.arguments.length!==T||!h&&S.optional||S.callee.type!==ge.AST_NODE_TYPES.Identifier?!1:S.callee.name===A}function f(S){return y(S.parent,{method:"toMatchInlineSnapshot",argumentsLength:1,optionalCall:!1,optionalMember:!1})&&S.parent.type===ge.AST_NODE_TYPES.CallExpression&&S.parent.arguments[0]===S&&C(S.parent.callee.type===ge.AST_NODE_TYPES.MemberExpression?S.parent.callee.object:null,{name:"expect",argumentsLength:1,optionalCall:!1,optionalMember:!1})}function E(S){if(i.length>0){let I=n.getTokenBefore(S,{includeComments:!0});if(I?.type===ge.AST_TOKEN_TYPES.Block&&i.includes(I.value.trim().toLowerCase()))return!0}return!!(f(S)||s.length>0&&m(S,s)||t.length>0&&S.parent.type===ge.AST_NODE_TYPES.CallExpression&&S.parent.arguments.includes(S)&&u(S.parent.callee,t))}function x(S){let I=`__PLACEHOLDER__${Math.random()}`,A=S.quasis.map(j=>n.getText(j).slice(1,j.tail?-1:-2)).join(I),T=A.match(ua);if(!T)return;let h=T[0],b=n.lines[n.getLocFromIndex(S.range[0]).line-1];if(!b)return;let P=b.match(ca)?.[1]??"",N;typeof o=="string"?N=o:typeof o=="number"?N=" ".repeat(o):N=P.startsWith(" ")?" ":" ";let R=p(A).replace(new RegExp(`^${h}|${h}[ ]*$`,"g"),""),d=h+c(R,1,P+N)+h+P,g=A.includes(`\r
38
38
  `)?`\r
@@ -1,7 +1,7 @@
1
1
  import{AST_NODE_TYPES as he}from"@typescript-eslint/utils";import{z as M}from"zod/v4";import{ESLintUtils as ri}from"@typescript-eslint/utils";import*as Pn from"zod/v4";function q(e){let r=ri.RuleCreator(t=>`https://github.com/lucasols/extended-lint#${t}`)(e);return{name:e.name,rule:r}}function B(e){return Pn.toJSONSchema(e)}var ii=M.object({disallow:M.array(M.object({selector:M.string(),message:M.string(),replace:M.optional(M.union([M.string(),M.object({regex:M.string(),with:M.string()})])),replaceType:M.optional(M.enum(["suggestion","autofix"]))})).optional(),disallowFnCalls:M.optional(M.array(M.object({fn:M.string(),withArgs:M.optional(M.array(M.object({atIndex:M.number(),value:M.union([M.string(),M.number(),M.boolean()])}))),message:M.string(),replaceWith:M.optional(M.string()),ignoreRegex:M.optional(M.string())}))),__dev_simulateFileName:M.optional(M.string()),mustMatchSyntax:M.optional(M.array(M.object({includeRegex:M.string(),mustCallFn:M.optional(M.array(M.object({anyCall:M.array(M.object({fn:M.string(),withArgs:M.array(M.object({atIndex:M.number(),literal:M.union([M.string(),M.number(),M.boolean()])}))})),message:M.optional(M.string())}))),mustMatchSelector:M.optional(M.array(M.object({selector:M.string(),message:M.string()}))),mustHaveExport:M.optional(M.array(M.object({name:M.string(),type:M.enum(["function","variable","any"]).default("any"),message:M.string()})))})))}),Et=q({name:"advanced-no-restricted-syntax",meta:{type:"suggestion",docs:{description:"Disallow specific syntax patterns"},schema:[B(ii)],messages:{default:"{{message}}"},fixable:"code",hasSuggestions:!0},defaultOptions:[{disallow:[]}],create(e,[n]){let r={},{mustMatchSyntax:t,__dev_simulateFileName:s,disallow:o,disallowFnCalls:i}=n,p=s??e.filename,c=[],a=new Map,u=new Set,m=new Map,y=new Set,C=new Map;function f(b){for(let w of b.specifiers)w.type===he.ImportSpecifier&&w.imported.type===he.Identifier&&w.imported.name!==w.local.name&&C.set(w.local.name,w.imported.name)}function E(b){if(b.declaration){if(b.declaration.type===he.FunctionDeclaration&&b.declaration.id){let w=b.declaration.id.name;for(let P of Array.from(y)){let[N,l]=P.split(":");N===w&&(l==="function"||l==="any")&&y.delete(P)}}else if(b.declaration.type===he.VariableDeclaration){for(let w of b.declaration.declarations)if(w.id.type===he.Identifier){let P=w.id.name;for(let N of Array.from(y)){let[l,R]=N.split(":");l===P&&(R==="variable"||R==="any")&&y.delete(N)}}}}for(let w of b.specifiers)if(w.exported.type===he.Identifier){let P=w.exported.name;for(let N of Array.from(y)){let[l,R]=N.split(":");l===P&&R==="any"&&y.delete(N)}}}function x(b){b.id.type===he.Identifier&&b.init?.type===he.Identifier&&C.set(b.id.name,b.init.name)}function S(b){return C.get(b)??b}function I(b,w){return S(b)===w||b===w}for(let{includeRegex:b,mustCallFn:w,mustMatchSelector:P,mustHaveExport:N}of t??[]){let R=function(d){let g=d;for(let{name:F,value:v}of l??[])g=g.replaceAll(F,v);return g};var h=R;let l=si(p,new RegExp(b));if(l){for(let{anyCall:d,message:g}of w??[]){let F=`Expected file to call the function: ${d.map(({fn:v})=>v).join(" or ")}`;u.add(F),c.push(v=>{let{callee:j}=v;if(j.type===he.Identifier){for(let{fn:J,withArgs:G}of d)if(j.name===J){u.delete(F);for(let H of G){let D=v.arguments[H.atIndex],Z=typeof H.literal=="string"?R(H.literal):H.literal;if(!D){e.report({node:v,messageId:"default",data:{message:`Missing argument with value "${Z}" at index ${H.atIndex}${g?`: ${R(g)}`:""}`}});continue}if(D.type!==he.Literal){e.report({node:D,messageId:"default",data:{message:`Argument at position ${H.atIndex} should the literal "${Z}"${g?`: ${R(g)}`:""}`}});continue}D.value!==Z&&e.report({node:D,messageId:"default",data:{message:`Argument should have the value "${Z}"${g?`: ${R(g)}`:""}`},fix:Y=>Y.replaceText(D,typeof Z=="string"?`'${Z}'`:String(Z))})}break}}})}for(let{selector:d,message:g}of P??[])m.set(d,R(g)),a.set(R(d),()=>{m.delete(d)});for(let{name:d,type:g,message:F}of N??[]){let v=R(d),j=R(F);y.add(`${v}:${g}:${j}`)}}}for(let{fn:b,withArgs:w,message:P,replaceWith:N,ignoreRegex:l}of i??[])l&&new RegExp(l).test(p)||c.push(R=>{let{callee:d}=R;if(d.type!==he.Identifier||!I(d.name,b))return;if(w)for(let F of w){let v=R.arguments[F.atIndex];if(!v){e.report({node:R,messageId:"default",data:{message:`Missing argument with value "${F.value}" at index ${F.atIndex}: ${P}`}});return}if(v.type!==he.Literal||v.value!==F.value)return}let g=F=>N?F.replaceText(R,N):null;e.report({node:R,messageId:"default",data:{message:P},suggest:N?[{messageId:"default",data:{message:`Replace with "${N}"`},fix:g}]:void 0})});function A(b,w){let P=r[b];P?r[b]=N=>{P(N),w(N)}:r[b]=w}for(let{selector:b,message:w,replace:P,replaceType:N="suggestion"}of o??[]){if(b==="CallExpression"){c.push(l=>{T(P,l,w,N)});continue}r[b]=l=>{T(P,l,w,N)}}if(a.size>0)for(let[b,w]of a)A(b,w);return c.length>0&&(r.CallExpression=b=>{if(b.type===he.CallExpression)for(let w of c)w(b)}),r.ImportDeclaration=b=>{b.type===he.ImportDeclaration&&f(b)},r.ExportNamedDeclaration=b=>{b.type===he.ExportNamedDeclaration&&E(b)},r.VariableDeclarator=b=>{b.type===he.VariableDeclarator&&x(b)},r["Program:exit"]=b=>{for(let w of u)e.report({node:b,messageId:"default",data:{message:w}});for(let[,w]of m)e.report({node:b,messageId:"default",data:{message:w}});for(let w of y){let[P,N,l]=w.split(":");e.report({node:b,messageId:"default",data:{message:`Missing required export "${P}" of type ${N}: ${l}`}})}},r;function T(b,w,P,N){let l=R=>{if(!b)return null;if(typeof b=="string")return R.replaceText(w,b);{let d=new RegExp(b.regex),g=e.sourceCode.getText(w);return R.replaceText(w,g.replace(d,b.with))}};e.report({node:w,messageId:"default",data:{message:P},fix:b&&N==="autofix"?l:void 0,suggest:b&&N==="suggestion"?[{messageId:"default",data:{message:`Replace with "${typeof b=="string"?b:b.with}"`},fix:l}]:void 0})}}});function si(e,n){let r=[],t=n.exec(e);if(!t)return null;let[s,...o]=t;r.push({name:"$0_lowercase",value:s.toLowerCase()}),r.push({name:"$0_capitalize",value:vn(s)}),r.push({name:"$0_uncapitalize",value:On(s)}),r.push({name:"$0",value:s});for(let i=0;i<o.length;i++){let p=`$${i+1}`,c=o[i];c!==void 0&&(r.push({name:`${p}_lowercase`,value:c.toLowerCase()}),r.push({name:`${p}_capitalize`,value:vn(c)}),r.push({name:`${p}_uncapitalize`,value:On(c)}),r.push({name:p,value:c}))}return r}function vn(e){return e.charAt(0).toUpperCase()+e.slice(1)}function On(e){return e.charAt(0).toLowerCase()+e.slice(1)}import{AST_NODE_TYPES as se,AST_TOKEN_TYPES as Nn,ESLintUtils as oi}from"@typescript-eslint/utils";import{z as Je}from"zod/v4";var ai=oi.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),jn="collapse-simple-objs-in-one-line",li=Je.object({maxLineLength:Je.number().optional(),maxProperties:Je.number().optional(),nestedObjMaxLineLength:Je.number().optional(),nestedObjMaxProperties:Je.number().optional(),ignoreTypesWithSuffix:Je.array(Je.string()).optional()}),pi=ai({name:jn,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:[B(li)]},defaultOptions:[{}],create(e,[n]){let r=e.sourceCode,t=n.ignoreTypesWithSuffix??[],s=n.maxProperties??2,o=n.nestedObjMaxLineLength??n.maxLineLength,i=n.nestedObjMaxProperties??3;function p(a){if(a.type===se.ObjectExpression){let u=a.parent.type===se.Property,m=u?i:s,y=a.properties.length;if(y>m)return!1;if(y===1){let f=a.properties[0];return!f||f.type===se.Property&&f.value.type===se.ObjectExpression||f.type===se.Property&&f.value.type===se.ArrayExpression&&!f.value.elements.every(x=>x&&bt(x))?!1:{text:r.getText(f),isNested:u,propsSize:y}}let C=[];for(let f of a.properties){if(f.type===se.Property&&!bt(f.value))return!1;C.push(r.getText(f))}return{text:C.join(", "),isNested:u,propsSize:y}}else{let u=a.parent.parent?.type===se.TSPropertySignature,m=u?i:s,y=a.members.length;if(y>m)return!1;if(t.length>0&&a.parent.type===se.TSTypeAliasDeclaration){let f=a.parent.id.name;if(t.some(E=>f.endsWith(E)))return!1}if(y===1){let f=a.members[0];return!f||f.type===se.TSPropertySignature&&f.typeAnnotation?.typeAnnotation.type===se.TSTypeLiteral?!1:{text:r.getText(f),isNested:u,propsSize:1}}if(a.parent.type===se.TSIntersectionType||a.parent.type===se.TSUnionType&&a.parent.types[0]!==a)return!1;let C=[];for(let f of a.members){if(f.type!==se.TSPropertySignature)return!1;let E=f.typeAnnotation?.typeAnnotation;if(!E||E.type===se.TSTypeLiteral||!Dn(E))return!1;if(E.type===se.TSTypeReference&&E.typeArguments){if(E.typeArguments.params.length>1)return!1;let S=E.typeArguments.params[0];if(!S||!Dn(S))return!1}let x=r.getText(f).trim();(x.endsWith(";")||x.endsWith(","))&&(x=x.slice(0,-1)),C.push(x)}return{text:C.join("; "),isNested:u,propsSize:y}}}function c(a){if(a.loc.start.line===a.loc.end.line)return;if(a.parent.type!==se.JSXExpressionContainer){let E=0,x=!1,S=r.getTokenAfter(a,{filter:A=>A.type!==Nn.Punctuator||x?!0:A.value===","?(E++,!1):A.value===";"?(E++,x=!0,!1):A.value===")"||A.value==="}"?(E++,!1):!0});if(E>4)return;let I=S?.type===Nn.Template&&S.value.startsWith(`}
2
2
  `);if(S?.loc.start.line===a.loc.end.line&&!I)return}let u=p(a);if(!u)return;let m=u.text;if(m.includes(`
3
3
  `)||r.getCommentsInside(a).length>0)return;m.endsWith(";")&&(m=m.slice(0,-1));let y=`{ ${m} }`,C=ui(r,a),f=u.isNested&&u.propsSize>2?o:n.maxLineLength;f&&y.length+C.length+ci(a,r)>f||e.report({node:a,messageId:"singleLineProp",fix:E=>E.replaceText(a,y)})}return{TSTypeLiteral:c,ObjectExpression:c}}});function Dn(e){return e.type===se.TSLiteralType||e.type===se.TSTypeReference||e.type===se.TSNumberKeyword||e.type===se.TSStringKeyword||e.type===se.TSBooleanKeyword||e.type===se.TSNullKeyword||e.type===se.TSUndefinedKeyword}function bt(e,n){return!!(e.type===se.Literal||e.type===se.Identifier||e.type===se.TemplateLiteral||e.type===se.TaggedTemplateExpression||!n&&e.type===se.ArrayExpression&&e.elements.every(r=>r&&bt(r,!0)))}function ci(e,n){let r=n.getLastToken(e);if(!r)return 0;let t=n.text.indexOf(`
4
- `,r.range[1]);return(t!==-1?t:n.text.length)-r.range[1]}function ui(e,n){return e.text.slice(n.range[0]-n.loc.start.column,n.range[0])}var xt={name:jn,rule:pi};var fi=/eslint +react-compiler\/react-compiler: +\["error/,Mn={meta:{type:"suggestion",docs:{description:"verifies the list of dependencies for Hooks like useEffect and similar",recommended:!0,url:"https://github.com/facebook/react/issues/14920"},fixable:"code",hasSuggestions:!0,schema:[{type:"object",additionalProperties:!1,ignoreIfReactCompilerIsEnabled:!1,enableDangerousAutofixThisMayCauseInfiniteLoops:!1,properties:{additionalHooks:{type:"string"},ignoreIfReactCompilerIsEnabled:{type:"boolean"},enableDangerousAutofixThisMayCauseInfiniteLoops:{type:"boolean"}}}]},create(e){let n=!1,r=typeof e.getSource=="function"?I=>r(I):I=>e.sourceCode.getText(I),t=typeof e.getScope=="function"?()=>t():I=>e.sourceCode.getScope(I),s=e.options&&e.options[0]&&e.options[0].additionalHooks?new RegExp(e.options[0].additionalHooks):void 0,o=e.options&&e.options[0]&&e.options[0].enableDangerousAutofixThisMayCauseInfiniteLoops||!1,i={additionalHooks:s,enableDangerousAutofixThisMayCauseInfiniteLoops:o};function p(I){o&&Array.isArray(I.suggest)&&I.suggest.length>0&&(I.fix=I.suggest[0].fix),e.report(I)}let c=e.getSourceCode().scopeManager,a=new WeakMap,u=new WeakSet,m=new WeakMap,y=new WeakMap,C=new WeakSet;function f(I,A){return function(T){if(A.has(T))return A.get(T);let h=I(T);return A.set(T,h),h}}function E(I,A,T,h,b){b&&I.async&&p({node:I,message:`Effect callbacks are synchronous to prevent race conditions. Put the async function inside:
4
+ `,r.range[1]);return(t!==-1?t:n.text.length)-r.range[1]}function ui(e,n){return e.text.slice(n.range[0]-n.loc.start.column,n.range[0])}var xt={name:jn,rule:pi};var fi=/eslint +react-compiler\/react-compiler: +\["error/,Mn={meta:{type:"suggestion",docs:{description:"verifies the list of dependencies for Hooks like useEffect and similar",recommended:!0,url:"https://github.com/facebook/react/issues/14920"},fixable:"code",hasSuggestions:!0,schema:[{type:"object",additionalProperties:!1,ignoreIfReactCompilerIsEnabled:!1,enableDangerousAutofixThisMayCauseInfiniteLoops:!1,properties:{additionalHooks:{type:"string"},ignoreIfReactCompilerIsEnabled:{type:"boolean"},enableDangerousAutofixThisMayCauseInfiniteLoops:{type:"boolean"},reactCompilerIsEnabled:{type:"boolean"}}}]},create(e){let n=!1,r=typeof e.getSource=="function"?I=>r(I):I=>e.sourceCode.getText(I),t=typeof e.getScope=="function"?()=>t():I=>e.sourceCode.getScope(I),s=e.options&&e.options[0]&&e.options[0].additionalHooks?new RegExp(e.options[0].additionalHooks):void 0,o=e.options&&e.options[0]&&e.options[0].enableDangerousAutofixThisMayCauseInfiniteLoops||!1,i={additionalHooks:s,enableDangerousAutofixThisMayCauseInfiniteLoops:o};function p(I){o&&Array.isArray(I.suggest)&&I.suggest.length>0&&(I.fix=I.suggest[0].fix),e.report(I)}let c=e.getSourceCode().scopeManager,a=new WeakMap,u=new WeakSet,m=new WeakMap,y=new WeakMap,C=new WeakSet;function f(I,A){return function(T){if(A.has(T))return A.get(T);let h=I(T);return A.set(T,h),h}}function E(I,A,T,h,b){b&&I.async&&p({node:I,message:`Effect callbacks are synchronous to prevent race conditions. Put the async function inside:
5
5
 
6
6
  useEffect(() => {
7
7
  async function fetchData() {
@@ -32,7 +32,7 @@ const ${e}: FC<${u}> = ({ ${c} }) => {
32
32
 
33
33
  ${y}`)),E.push(m.replaceText(s,C)),E}}]})}function na(e,n,r){let t=e.arguments[0];if(!t||t.type!==_.JSXElement&&t.type!==_.JSXFragment)return;let s=t,o=jr(s,n);if(!o.hasUnstable)return;let i=Qo(s),p=Lr(s,[],n),c=s.type===_.JSXElement?$r(s,n):null,a=o.problematicProps.length===1?`prop "${o.problematicProps[0]}"`:`props "${o.problematicProps.join('", "')}"`;r.report({node:s,messageId:"unstableValueInMap",data:{problematicProps:a},suggest:[{messageId:"extractComponent",data:{componentName:i},fix:u=>{let m=Mr(i,s,[],p,n),y=ea(i,p,c),C=e;for(;C.parent.type!==_.Program&&!(C.type===_.FunctionDeclaration||C.type===_.VariableDeclarator&&C.init&&(C.init.type===_.ArrowFunctionExpression||C.init.type===_.FunctionExpression));)C=C.parent;let f=[];return f.push(u.insertTextAfter(C,`
34
34
 
35
- ${m}`)),f.push(u.replaceText(s,y)),f}}]})}import{ESLintUtils as ra,TSESTree as ia}from"@typescript-eslint/utils";var sa=ra.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),_r="require-description",oa=/^(eslint(?:-env|-enable|-disable(?:(?:-next)?-line)?)?|exported|globals?)(?:\s|$)/u,aa=/^eslint-disable-(next-)?line$/u,la=sa({name:_r,meta:{type:"problem",docs:{description:"Require descriptions for eslint directives."},messages:{missingDescription:"Unexpected undescribed directive comment. Include descriptions to explain why the comment is necessary."},schema:[{type:"object",properties:{ignore:{type:"array",items:{type:"string",enum:["eslint","eslint-disable","eslint-disable-line","eslint-disable-next-line","eslint-enable","eslint-env","exported","global","globals"]},additionalItems:!1,uniqueItems:!0}},additionalProperties:!1}]},defaultOptions:[{ignore:[]}],create(e,[n]){let r=e.sourceCode,t=new Set(n.ignore||[]);return{Program(){for(let s of r.getAllComments()){let o=pa(s);o!=null&&(t.has(o.kind)||o.description||e.report({loc:fa(s.loc),messageId:"missingDescription"}))}}}}}),Ur={name:_r,rule:la};function pa(e){let{text:n,description:r}=ua(e.value);if(!n)return null;let t=oa.exec(n);if(!t)return null;let s=t[1];if(!s)return null;let o=aa.test(s);if(e.type===ia.AST_TOKEN_TYPES.Line&&!o||o&&e.loc.start.line!==e.loc.end.line)return null;let i=n.slice(t.index+s.length);return{kind:s,value:i.trim(),description:r}}var ca=/\s-{2,}\s/u;function ua(e){let n=e.split(ca);return{text:n[0]?.trim(),description:n.length>1?n[1]?.trim()??null:null}}function fa(e){return{start:{line:e.start.line,column:-1},end:e.end}}import{AST_NODE_TYPES as ne}from"@typescript-eslint/utils";import{z as $e}from"zod/v4";var ma=$e.object({varsToCheck:$e.array($e.object({selector:$e.string().optional(),fromFnCall:$e.string().optional(),prop:$e.string().or($e.array($e.string())),errorMsg:$e.string().optional()}))}),yn=q({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:[B(ma)]},defaultOptions:[{varsToCheck:[]}],create(e,[n]){let r=new Map;function t(i,p,c,a){let u=new Set;for(let y of i.properties)y.type===ne.Property&&y.key.type===ne.Identifier&&u.add(y.key.name);let m=p.filter(y=>!u.has(y));if(m.length>0)if(m.length===1)e.report({node:i,messageId:"propNotRead",data:{prop:m[0],fnName:a,customMsg:c||""}});else{let y=m.map(C=>`"${C}"`).join(", ");e.report({node:i,messageId:"propsNotRead",data:{props:y,fnName:a,customMsg:c||""}})}}function s(i){if(i.init?.type===ne.CallExpression){if(i.init.callee.type===ne.Identifier)return i.init.callee.name;if(i.init.callee.type===ne.MemberExpression&&i.init.callee.property.type===ne.Identifier)return i.init.callee.object.type===ne.Identifier?`${i.init.callee.object.name}.${i.init.callee.property.name}`:i.init.callee.property.name}return"unknown function"}let o={};for(let i of n.varsToCheck)i.selector&&(o[i.selector]=p=>{if(p.type===ne.VariableDeclarator&&p.id.type===ne.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===ne.VariableDeclarator&&p.id.type===ne.ObjectPattern){let c=Array.isArray(i.prop)?i.prop:[i.prop];t(p.id,c,i.errorMsg,s(p))}});for(let i of n.varsToCheck)if(i.fromFnCall){let p=i.fromFnCall;if(p.startsWith("*.")){let a=`VariableDeclarator > CallExpression > MemberExpression[property.name="${p.slice(2)}"]`;o[a]=u=>{if(u.type!==ne.MemberExpression||u.parent.type!==ne.CallExpression)return;let m=u.parent;if(m.parent.type!==ne.VariableDeclarator)return;let y=m.parent;if(y.id.type===ne.Identifier)r.set(y.id.name,{props:Array.isArray(i.prop)?i.prop:[i.prop],errorMsg:i.errorMsg,node:y.id,fnName:i.fromFnCall||"unknown function"});else if(y.id.type===ne.ObjectPattern){let C=Array.isArray(i.prop)?i.prop:[i.prop];t(y.id,C,i.errorMsg,i.fromFnCall||"unknown function")}}}else if(p.includes(".")){let[c,a]=p.split("."),u=`VariableDeclarator > CallExpression > MemberExpression[object.name="${c}"][property.name="${a}"]`;o[u]=m=>{if(m.type!==ne.MemberExpression||m.parent.type!==ne.CallExpression)return;let y=m.parent;if(y.parent.type!==ne.VariableDeclarator)return;let C=y.parent;if(C.id.type===ne.Identifier)r.set(C.id.name,{props:Array.isArray(i.prop)?i.prop:[i.prop],errorMsg:i.errorMsg,node:C.id,fnName:i.fromFnCall||"unknown function"});else if(C.id.type===ne.ObjectPattern){let f=Array.isArray(i.prop)?i.prop:[i.prop];t(C.id,f,i.errorMsg,i.fromFnCall||"unknown function")}}}else{let c=`VariableDeclarator > CallExpression > Identifier[name="${p}"]`;o[c]=a=>{if(a.type!==ne.Identifier||a.parent.type!==ne.CallExpression)return;let u=a.parent;if(u.parent.type!==ne.VariableDeclarator)return;let m=u.parent;if(m.id.type===ne.Identifier)r.set(m.id.name,{props:Array.isArray(i.prop)?i.prop:[i.prop],errorMsg:i.errorMsg,node:m.id,fnName:i.fromFnCall||"unknown function"});else if(m.id.type===ne.ObjectPattern){let y=Array.isArray(i.prop)?i.prop:[i.prop];t(m.id,y,i.errorMsg,i.fromFnCall||"unknown function")}}}}return{...o,"Program:exit"(){for(let[i,{props:p,errorMsg:c,node:a,fnName:u}]of r){let y=e.sourceCode.getScope(a).set.get(i);if(y){let C=new Set(p);for(let f of y.references){let E=f.identifier,x=E.parent;if(!(x.type===ne.VariableDeclarator&&x.id===E)){if(x.type===ne.MemberExpression&&x.object===E&&x.property.type===ne.Identifier&&C.has(x.property.name)){if(C.delete(x.property.name),C.size===0)break;continue}if(x.type===ne.VariableDeclarator&&x.init===E&&x.id.type===ne.ObjectPattern){for(let S of x.id.properties)S.type===ne.Property&&S.key.type===ne.Identifier&&C.has(S.key.name)&&C.delete(S.key.name);if(C.size===0)break;continue}if(!(x.type===ne.MemberExpression&&x.object===E&&x.property.type===ne.Identifier&&!p.includes(x.property.name))){C.clear();break}}}if(C.size>0){let f=Array.from(C);if(f.length===1)e.report({node:a,messageId:"propNotRead",data:{prop:f[0],fnName:u,customMsg:c||""}});else{let E=f.map(x=>`"${x}"`).join(", ");e.report({node:a,messageId:"propsNotRead",data:{props:E,fnName:u,customMsg:c||""}})}}}}}}}});function Jr(e){return/^use[A-Z0-9]/.test(e)}function gt(e){return e.type==="Identifier"?Jr(e.name):e.type==="MemberExpression"&&!e.computed&&gt(e.property)?e.object.type==="Identifier":!1}function Vr(e){return e.type==="Identifier"&&/^[A-Z]/.test(e.name)}function Xr(e,n){return e.name===n||e.type==="MemberExpression"&&e.object.name==="React"&&e.property.name===n}function Br(e){return!!(e.parent&&e.parent.callee&&Xr(e.parent.callee,"forwardRef"))}function Hr(e){return!!(e.parent&&e.parent.callee&&Xr(e.parent.callee,"memo"))}function dn(e){for(;e;){let n=qr(e);if(n&&(Vr(n)||gt(n))||Br(e)||Hr(e))return!0;e=e.parent}return!1}function zr(e){return!1}function gn(e){return!1}var ya=/eslint +react-compiler\/react-compiler: +\["error/,Yr={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){let n=!!e.options[0]?.reactCompilerIsEnabled;if(e.options[0]?.ignoreIfReactCompilerIsEnabled||n){for(let a of e.sourceCode.getAllComments())if(n||ya.test(a.value))return{CallExpression(u){let m=null;u.callee.name==="useMemo"?m="useMemo":u.callee.name==="useCallback"&&(m="useCallback"),m&&e.report({node:u,message:`"${m}" is not necessary when using React Compiler.`})}}}let r=typeof e.getSource=="function"?a=>r(a):a=>e.sourceCode.getText(a),t=typeof e.getScope=="function"?()=>t():a=>e.sourceCode.getScope(a),s=null,o=[],i=[],p=new WeakSet;function c(a){for(let u of a.references){let m=u.identifier.parent;if(m.type==="VariableDeclarator"&&m.init&&m.init.type==="CallExpression"&&m.init.callee&&zr(m.init.callee))for(let y of u.resolved.references)y!==u&&p.add(y.identifier)}}return{onCodePathSegmentStart:a=>i.push(a),onCodePathSegmentEnd:()=>i.pop(),onCodePathStart:()=>o.push(new Map),onCodePathEnd(a,u){let m=o.pop();if(m.size===0)return;let y=new Set;function C(h,b){let{cache:w}=C,P=w.get(h.id),N=new Set(b);if(N.has(h.id)){let l=[...N],R=l.slice(l.indexOf(h.id)+1);for(let d of R)y.add(d);return BigInt("0")}if(N.add(h.id),P!==void 0)return P;if(a.thrownSegments.includes(h))P=BigInt("0");else if(h.prevSegments.length===0)P=BigInt("1");else{P=BigInt("0");for(let l of h.prevSegments)P+=C(l,N)}return h.reachable&&P===BigInt("0")?w.delete(h.id):w.set(h.id,P),P}function f(h,b){let{cache:w}=f,P=w.get(h.id),N=new Set(b);if(N.has(h.id)){let l=Array.from(N),R=l.slice(l.indexOf(h.id)+1);for(let d of R)y.add(d);return BigInt("0")}if(N.add(h.id),P!==void 0)return P;if(a.thrownSegments.includes(h))P=BigInt("0");else if(h.nextSegments.length===0)P=BigInt("1");else{P=BigInt("0");for(let l of h.nextSegments)P+=f(l,N)}return w.set(h.id,P),P}function E(h){let{cache:b}=E,w=b.get(h.id);if(w===null)return 1/0;if(w!==void 0)return w;if(b.set(h.id,null),h.prevSegments.length===0)w=1;else{w=1/0;for(let P of h.prevSegments){let N=E(P);N<w&&(w=N)}w+=1}return b.set(h.id,w),w}C.cache=new Map,f.cache=new Map,E.cache=new Map;let x=f(a.initialSegment),S=qr(u),I=dn(u),A=S?Vr(S)||gt(S):Br(u)||Hr(u),T=1/0;for(let h of a.finalSegments){if(!h.reachable)continue;let b=E(h);b<T&&(T=b)}for(let[h,b]of m){if(!h.reachable)continue;let w=h.nextSegments.length===0?T<=E(h):T<E(h),P=C(h)*f(h),N=y.has(h.id);for(let l of b)if(N&&!gn(l)&&e.report({node:l,message:`React Hook "${r(l)}" may be executed more than once. Possibly because it is called in a loop. React Hooks must be called in the exact same order in every component render.`}),A){if(u.async&&e.report({node:l,message:`React Hook "${r(l)}" cannot be called in an async function.`}),!N&&P!==x&&!gn(l)){let d=`React Hook "${r(l)}" is called conditionally. React Hooks must be called in the exact same order in every component render.`+(w?" Did you accidentally call a React Hook after an early return?":"");e.report({node:l,message:d})}}else if(u.parent&&(u.parent.type==="MethodDefinition"||u.parent.type==="ClassProperty")&&u.parent.value===u){let R=`React Hook "${r(l)}" 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:l,message:R})}else if(S){let R=`React Hook "${r(l)}" is called in function "${r(S)}" that is neither a React function component nor a custom React Hook function. React component names must start with an uppercase letter. React Hook names must start with the word "use".`;e.report({node:l,message:R})}else if(u.type==="Program"){let R=`React Hook "${r(l)}" 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:l,message:R})}else if(I&&!gn(l)){if(u.parent.type==="CallExpression"&&u.parent.callee.type==="Identifier"&&u.parent.callee.name==="useCallback"){let d=u.parent;if(d.parent.type==="VariableDeclarator"&&Jr(d.parent.id.name))return}let R=`React Hook "${r(l)}" 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:l,message:R})}}},CallExpression(a){if(gt(a.callee)){let u=Wr(o),m=Wr(i),y=u.get(m);y||(y=[],u.set(m,y)),y.push(a.callee)}a.callee.type==="Identifier"&&(a.callee.name==="useEffect"||zr(a.callee))&&a.arguments.length>0&&(s=a)},Identifier(a){s==null&&p.has(a)&&a.parent.type!=="CallExpression"&&e.report({node:a,message:`\`${r(a)}\` is a function created with React Hook "useEffectEvent", and can only be called from the same component. They cannot be assigned to variables or passed down.`})},"CallExpression:exit"(a){a===s&&(s=null)},FunctionDeclaration(a){dn(a)&&c(t(a))},ArrowFunctionExpression(a){dn(a)&&c(t(a))}}}};function qr(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 Wr(e){return e[e.length-1]}import{AST_NODE_TYPES as Se,AST_TOKEN_TYPES as da}from"@typescript-eslint/utils";import*as be from"zod/v4";var ga=/^\s+$/,Sn=/\r?\n/,Sa=/^(\s*)/,Ta=/^(\s*)\S/,ha=/\r?\n/,Ea=be.object({indent:be.union([be.string().regex(ga),be.number().int().min(1)]).optional(),tags:be.array(be.string()).optional(),functions:be.array(be.string()).optional(),comments:be.array(be.string()).optional()}),Tn=q({name:"template-indent",meta:{type:"suggestion",docs:{description:"Fix whitespace-insensitive template indentation"},fixable:"code",schema:[B(Ea)],messages:{improperlyIndented:"Templates should be properly indented."}},defaultOptions:[{}],create(e){let n=e.sourceCode,{comments:r=["HTML","indent"],functions:t=["dedent","stripIndent"],tags:s=["outdent","dedent","gql","sql","html","styled"],indent:o}=e.options[0],i=r.map(S=>S.toLowerCase());function p(S){let I=S.split(Sn),A=I.filter(h=>h.trim()!=="");if(A.length===0)return S;let T=Number.POSITIVE_INFINITY;for(let h of A){let b=h.match(Sa);b&&(T=Math.min(T,b[1]?.length??0))}return!isFinite(T)||T===0?S:I.map(h=>h.slice(T)).join(`
35
+ ${m}`)),f.push(u.replaceText(s,y)),f}}]})}import{ESLintUtils as ra,TSESTree as ia}from"@typescript-eslint/utils";var sa=ra.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),_r="require-description",oa=/^(eslint(?:-env|-enable|-disable(?:(?:-next)?-line)?)?|exported|globals?)(?:\s|$)/u,aa=/^eslint-disable-(next-)?line$/u,la=sa({name:_r,meta:{type:"problem",docs:{description:"Require descriptions for eslint directives."},messages:{missingDescription:"Unexpected undescribed directive comment. Include descriptions to explain why the comment is necessary."},schema:[{type:"object",properties:{ignore:{type:"array",items:{type:"string",enum:["eslint","eslint-disable","eslint-disable-line","eslint-disable-next-line","eslint-enable","eslint-env","exported","global","globals"]},additionalItems:!1,uniqueItems:!0}},additionalProperties:!1}]},defaultOptions:[{ignore:[]}],create(e,[n]){let r=e.sourceCode,t=new Set(n.ignore||[]);return{Program(){for(let s of r.getAllComments()){let o=pa(s);o!=null&&(t.has(o.kind)||o.description||e.report({loc:fa(s.loc),messageId:"missingDescription"}))}}}}}),Ur={name:_r,rule:la};function pa(e){let{text:n,description:r}=ua(e.value);if(!n)return null;let t=oa.exec(n);if(!t)return null;let s=t[1];if(!s)return null;let o=aa.test(s);if(e.type===ia.AST_TOKEN_TYPES.Line&&!o||o&&e.loc.start.line!==e.loc.end.line)return null;let i=n.slice(t.index+s.length);return{kind:s,value:i.trim(),description:r}}var ca=/\s-{2,}\s/u;function ua(e){let n=e.split(ca);return{text:n[0]?.trim(),description:n.length>1?n[1]?.trim()??null:null}}function fa(e){return{start:{line:e.start.line,column:-1},end:e.end}}import{AST_NODE_TYPES as ne}from"@typescript-eslint/utils";import{z as $e}from"zod/v4";var ma=$e.object({varsToCheck:$e.array($e.object({selector:$e.string().optional(),fromFnCall:$e.string().optional(),prop:$e.string().or($e.array($e.string())),errorMsg:$e.string().optional()}))}),yn=q({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:[B(ma)]},defaultOptions:[{varsToCheck:[]}],create(e,[n]){let r=new Map;function t(i,p,c,a){let u=new Set;for(let y of i.properties)y.type===ne.Property&&y.key.type===ne.Identifier&&u.add(y.key.name);let m=p.filter(y=>!u.has(y));if(m.length>0)if(m.length===1)e.report({node:i,messageId:"propNotRead",data:{prop:m[0],fnName:a,customMsg:c||""}});else{let y=m.map(C=>`"${C}"`).join(", ");e.report({node:i,messageId:"propsNotRead",data:{props:y,fnName:a,customMsg:c||""}})}}function s(i){if(i.init?.type===ne.CallExpression){if(i.init.callee.type===ne.Identifier)return i.init.callee.name;if(i.init.callee.type===ne.MemberExpression&&i.init.callee.property.type===ne.Identifier)return i.init.callee.object.type===ne.Identifier?`${i.init.callee.object.name}.${i.init.callee.property.name}`:i.init.callee.property.name}return"unknown function"}let o={};for(let i of n.varsToCheck)i.selector&&(o[i.selector]=p=>{if(p.type===ne.VariableDeclarator&&p.id.type===ne.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===ne.VariableDeclarator&&p.id.type===ne.ObjectPattern){let c=Array.isArray(i.prop)?i.prop:[i.prop];t(p.id,c,i.errorMsg,s(p))}});for(let i of n.varsToCheck)if(i.fromFnCall){let p=i.fromFnCall;if(p.startsWith("*.")){let a=`VariableDeclarator > CallExpression > MemberExpression[property.name="${p.slice(2)}"]`;o[a]=u=>{if(u.type!==ne.MemberExpression||u.parent.type!==ne.CallExpression)return;let m=u.parent;if(m.parent.type!==ne.VariableDeclarator)return;let y=m.parent;if(y.id.type===ne.Identifier)r.set(y.id.name,{props:Array.isArray(i.prop)?i.prop:[i.prop],errorMsg:i.errorMsg,node:y.id,fnName:i.fromFnCall||"unknown function"});else if(y.id.type===ne.ObjectPattern){let C=Array.isArray(i.prop)?i.prop:[i.prop];t(y.id,C,i.errorMsg,i.fromFnCall||"unknown function")}}}else if(p.includes(".")){let[c,a]=p.split("."),u=`VariableDeclarator > CallExpression > MemberExpression[object.name="${c}"][property.name="${a}"]`;o[u]=m=>{if(m.type!==ne.MemberExpression||m.parent.type!==ne.CallExpression)return;let y=m.parent;if(y.parent.type!==ne.VariableDeclarator)return;let C=y.parent;if(C.id.type===ne.Identifier)r.set(C.id.name,{props:Array.isArray(i.prop)?i.prop:[i.prop],errorMsg:i.errorMsg,node:C.id,fnName:i.fromFnCall||"unknown function"});else if(C.id.type===ne.ObjectPattern){let f=Array.isArray(i.prop)?i.prop:[i.prop];t(C.id,f,i.errorMsg,i.fromFnCall||"unknown function")}}}else{let c=`VariableDeclarator > CallExpression > Identifier[name="${p}"]`;o[c]=a=>{if(a.type!==ne.Identifier||a.parent.type!==ne.CallExpression)return;let u=a.parent;if(u.parent.type!==ne.VariableDeclarator)return;let m=u.parent;if(m.id.type===ne.Identifier)r.set(m.id.name,{props:Array.isArray(i.prop)?i.prop:[i.prop],errorMsg:i.errorMsg,node:m.id,fnName:i.fromFnCall||"unknown function"});else if(m.id.type===ne.ObjectPattern){let y=Array.isArray(i.prop)?i.prop:[i.prop];t(m.id,y,i.errorMsg,i.fromFnCall||"unknown function")}}}}return{...o,"Program:exit"(){for(let[i,{props:p,errorMsg:c,node:a,fnName:u}]of r){let y=e.sourceCode.getScope(a).set.get(i);if(y){let C=new Set(p);for(let f of y.references){let E=f.identifier,x=E.parent;if(!(x.type===ne.VariableDeclarator&&x.id===E)){if(x.type===ne.MemberExpression&&x.object===E&&x.property.type===ne.Identifier&&C.has(x.property.name)){if(C.delete(x.property.name),C.size===0)break;continue}if(x.type===ne.VariableDeclarator&&x.init===E&&x.id.type===ne.ObjectPattern){for(let S of x.id.properties)S.type===ne.Property&&S.key.type===ne.Identifier&&C.has(S.key.name)&&C.delete(S.key.name);if(C.size===0)break;continue}if(!(x.type===ne.MemberExpression&&x.object===E&&x.property.type===ne.Identifier&&!p.includes(x.property.name))){C.clear();break}}}if(C.size>0){let f=Array.from(C);if(f.length===1)e.report({node:a,messageId:"propNotRead",data:{prop:f[0],fnName:u,customMsg:c||""}});else{let E=f.map(x=>`"${x}"`).join(", ");e.report({node:a,messageId:"propsNotRead",data:{props:E,fnName:u,customMsg:c||""}})}}}}}}}});function Jr(e){return/^use[A-Z0-9]/.test(e)}function gt(e){return e.type==="Identifier"?Jr(e.name):e.type==="MemberExpression"&&!e.computed&&gt(e.property)?e.object.type==="Identifier":!1}function Vr(e){return e.type==="Identifier"&&/^[A-Z]/.test(e.name)}function Xr(e,n){return e.name===n||e.type==="MemberExpression"&&e.object.name==="React"&&e.property.name===n}function Br(e){return!!(e.parent&&e.parent.callee&&Xr(e.parent.callee,"forwardRef"))}function Hr(e){return!!(e.parent&&e.parent.callee&&Xr(e.parent.callee,"memo"))}function dn(e){for(;e;){let n=qr(e);if(n&&(Vr(n)||gt(n))||Br(e)||Hr(e))return!0;e=e.parent}return!1}function zr(e){return!1}function gn(e){return!1}var ya=/eslint +react-compiler\/react-compiler: +\["error/,Yr={meta:{type:"problem",docs:{description:"enforces the Rules of Hooks",recommended:!0,url:"https://reactjs.org/docs/hooks-rules.html"},schema:[{type:"object",ignoreIfReactCompilerIsEnabled:!1,properties:{ignoreIfReactCompilerIsEnabled:{type:"boolean"},reactCompilerIsEnabled:{type:"boolean"}}}]},create(e){let n=!!e.options[0]?.reactCompilerIsEnabled;if(e.options[0]?.ignoreIfReactCompilerIsEnabled||n){for(let a of e.sourceCode.getAllComments())if(n||ya.test(a.value))return{CallExpression(u){let m=null;u.callee.name==="useMemo"?m="useMemo":u.callee.name==="useCallback"&&(m="useCallback"),m&&e.report({node:u,message:`"${m}" is not necessary when using React Compiler.`})}}}let r=typeof e.getSource=="function"?a=>r(a):a=>e.sourceCode.getText(a),t=typeof e.getScope=="function"?()=>t():a=>e.sourceCode.getScope(a),s=null,o=[],i=[],p=new WeakSet;function c(a){for(let u of a.references){let m=u.identifier.parent;if(m.type==="VariableDeclarator"&&m.init&&m.init.type==="CallExpression"&&m.init.callee&&zr(m.init.callee))for(let y of u.resolved.references)y!==u&&p.add(y.identifier)}}return{onCodePathSegmentStart:a=>i.push(a),onCodePathSegmentEnd:()=>i.pop(),onCodePathStart:()=>o.push(new Map),onCodePathEnd(a,u){let m=o.pop();if(m.size===0)return;let y=new Set;function C(h,b){let{cache:w}=C,P=w.get(h.id),N=new Set(b);if(N.has(h.id)){let l=[...N],R=l.slice(l.indexOf(h.id)+1);for(let d of R)y.add(d);return BigInt("0")}if(N.add(h.id),P!==void 0)return P;if(a.thrownSegments.includes(h))P=BigInt("0");else if(h.prevSegments.length===0)P=BigInt("1");else{P=BigInt("0");for(let l of h.prevSegments)P+=C(l,N)}return h.reachable&&P===BigInt("0")?w.delete(h.id):w.set(h.id,P),P}function f(h,b){let{cache:w}=f,P=w.get(h.id),N=new Set(b);if(N.has(h.id)){let l=Array.from(N),R=l.slice(l.indexOf(h.id)+1);for(let d of R)y.add(d);return BigInt("0")}if(N.add(h.id),P!==void 0)return P;if(a.thrownSegments.includes(h))P=BigInt("0");else if(h.nextSegments.length===0)P=BigInt("1");else{P=BigInt("0");for(let l of h.nextSegments)P+=f(l,N)}return w.set(h.id,P),P}function E(h){let{cache:b}=E,w=b.get(h.id);if(w===null)return 1/0;if(w!==void 0)return w;if(b.set(h.id,null),h.prevSegments.length===0)w=1;else{w=1/0;for(let P of h.prevSegments){let N=E(P);N<w&&(w=N)}w+=1}return b.set(h.id,w),w}C.cache=new Map,f.cache=new Map,E.cache=new Map;let x=f(a.initialSegment),S=qr(u),I=dn(u),A=S?Vr(S)||gt(S):Br(u)||Hr(u),T=1/0;for(let h of a.finalSegments){if(!h.reachable)continue;let b=E(h);b<T&&(T=b)}for(let[h,b]of m){if(!h.reachable)continue;let w=h.nextSegments.length===0?T<=E(h):T<E(h),P=C(h)*f(h),N=y.has(h.id);for(let l of b)if(N&&!gn(l)&&e.report({node:l,message:`React Hook "${r(l)}" may be executed more than once. Possibly because it is called in a loop. React Hooks must be called in the exact same order in every component render.`}),A){if(u.async&&e.report({node:l,message:`React Hook "${r(l)}" cannot be called in an async function.`}),!N&&P!==x&&!gn(l)){let d=`React Hook "${r(l)}" is called conditionally. React Hooks must be called in the exact same order in every component render.`+(w?" Did you accidentally call a React Hook after an early return?":"");e.report({node:l,message:d})}}else if(u.parent&&(u.parent.type==="MethodDefinition"||u.parent.type==="ClassProperty")&&u.parent.value===u){let R=`React Hook "${r(l)}" 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:l,message:R})}else if(S){let R=`React Hook "${r(l)}" is called in function "${r(S)}" that is neither a React function component nor a custom React Hook function. React component names must start with an uppercase letter. React Hook names must start with the word "use".`;e.report({node:l,message:R})}else if(u.type==="Program"){let R=`React Hook "${r(l)}" 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:l,message:R})}else if(I&&!gn(l)){if(u.parent.type==="CallExpression"&&u.parent.callee.type==="Identifier"&&u.parent.callee.name==="useCallback"){let d=u.parent;if(d.parent.type==="VariableDeclarator"&&Jr(d.parent.id.name))return}let R=`React Hook "${r(l)}" 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:l,message:R})}}},CallExpression(a){if(gt(a.callee)){let u=Wr(o),m=Wr(i),y=u.get(m);y||(y=[],u.set(m,y)),y.push(a.callee)}a.callee.type==="Identifier"&&(a.callee.name==="useEffect"||zr(a.callee))&&a.arguments.length>0&&(s=a)},Identifier(a){s==null&&p.has(a)&&a.parent.type!=="CallExpression"&&e.report({node:a,message:`\`${r(a)}\` is a function created with React Hook "useEffectEvent", and can only be called from the same component. They cannot be assigned to variables or passed down.`})},"CallExpression:exit"(a){a===s&&(s=null)},FunctionDeclaration(a){dn(a)&&c(t(a))},ArrowFunctionExpression(a){dn(a)&&c(t(a))}}}};function qr(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 Wr(e){return e[e.length-1]}import{AST_NODE_TYPES as Se,AST_TOKEN_TYPES as da}from"@typescript-eslint/utils";import*as be from"zod/v4";var ga=/^\s+$/,Sn=/\r?\n/,Sa=/^(\s*)/,Ta=/^(\s*)\S/,ha=/\r?\n/,Ea=be.object({indent:be.union([be.string().regex(ga),be.number().int().min(1)]).optional(),tags:be.array(be.string()).optional(),functions:be.array(be.string()).optional(),comments:be.array(be.string()).optional()}),Tn=q({name:"template-indent",meta:{type:"suggestion",docs:{description:"Fix whitespace-insensitive template indentation"},fixable:"code",schema:[B(Ea)],messages:{improperlyIndented:"Templates should be properly indented."}},defaultOptions:[{}],create(e){let n=e.sourceCode,{comments:r=["HTML","indent"],functions:t=["dedent","stripIndent"],tags:s=["outdent","dedent","gql","sql","html","styled"],indent:o}=e.options[0],i=r.map(S=>S.toLowerCase());function p(S){let I=S.split(Sn),A=I.filter(h=>h.trim()!=="");if(A.length===0)return S;let T=Number.POSITIVE_INFINITY;for(let h of A){let b=h.match(Sa);b&&(T=Math.min(T,b[1]?.length??0))}return!isFinite(T)||T===0?S:I.map(h=>h.slice(T)).join(`
36
36
  `)}function c(S,I,A){return S.split(Sn).map(h=>h.trim()===""?h:A.repeat(I)+h).join(`
37
37
  `)}function a(S){if(S.type===Se.Identifier)return S.name;if(S.type===Se.MemberExpression){let I=S.object.type===Se.Identifier?S.object.name:null,A=S.property.type===Se.Identifier?S.property.name:null;return I&&A?`${I}.${A}`:A}return null}function u(S,I){if(!S)return!1;for(let A of I)if(A.includes(".")){let T=A.split(".");if(S.type===Se.MemberExpression&&S.object.type===Se.Identifier&&S.property.type===Se.Identifier&&S.object.name===T[0]&&S.property.name===T[1])return!0}else if(S.type===Se.Identifier&&S.name===A)return!0;return!1}function m(S,I){let A=S.parent;if(A.type!==Se.TaggedTemplateExpression)return!1;let T=a(A.tag);return T?I.includes(T):!1}function y(S,I){if(!S||S.type!==Se.CallExpression)return!1;let{method:A,argumentsLength:T,optionalCall:h=!0,optionalMember:b=!0}=I;return T!==void 0&&S.arguments.length!==T||!h&&S.optional||S.callee.type!==Se.MemberExpression||!b&&S.callee.optional||S.callee.property.type!==Se.Identifier?!1:S.callee.property.name===A}function C(S,I){if(!S||S.type!==Se.CallExpression)return!1;let{name:A,argumentsLength:T,optionalCall:h=!0}=I;return T!==void 0&&S.arguments.length!==T||!h&&S.optional||S.callee.type!==Se.Identifier?!1:S.callee.name===A}function f(S){return y(S.parent,{method:"toMatchInlineSnapshot",argumentsLength:1,optionalCall:!1,optionalMember:!1})&&S.parent.type===Se.CallExpression&&S.parent.arguments[0]===S&&C(S.parent.callee.type===Se.MemberExpression?S.parent.callee.object:null,{name:"expect",argumentsLength:1,optionalCall:!1,optionalMember:!1})}function E(S){if(i.length>0){let I=n.getTokenBefore(S,{includeComments:!0});if(I?.type===da.Block&&i.includes(I.value.trim().toLowerCase()))return!0}return!!(f(S)||s.length>0&&m(S,s)||t.length>0&&S.parent.type===Se.CallExpression&&S.parent.arguments.includes(S)&&u(S.parent.callee,t))}function x(S){let I=`__PLACEHOLDER__${Math.random()}`,A=S.quasis.map(j=>n.getText(j).slice(1,j.tail?-1:-2)).join(I),T=A.match(ha);if(!T)return;let h=T[0],b=n.lines[n.getLocFromIndex(S.range[0]).line-1];if(!b)return;let P=b.match(Ta)?.[1]??"",N;typeof o=="string"?N=o:typeof o=="number"?N=" ".repeat(o):N=P.startsWith(" ")?" ":" ";let R=p(A).replace(new RegExp(`^${h}|${h}[ ]*$`,"g"),""),d=h+c(R,1,P+N)+h+P,g=A.includes(`\r
38
38
  `)?`\r
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ls-stack/extended-lint",
3
- "version": "0.76.0",
3
+ "version": "0.76.1",
4
4
  "license": "MIT",
5
5
  "files": [
6
6
  "dist"