@ls-stack/extended-lint 0.82.5 → 0.82.6

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.
@@ -15,7 +15,7 @@ useEffect(() => {
15
15
  Learn more about data fetching with Hooks: https://reactjs.org/link/hooks-data-fetching`});let w=l.acquire(I),k=new Set,N=null;{let v=w.upper;for(;v&&(k.add(v),v.type!=="function");)v=v.upper;if(!v)return;N=v}let c=Array.isArray;function F(v){if(!c(v.defs))return!1;let O=v.defs[0];if(O==null||O.node.type!=="VariableDeclarator")return!1;let z=O.node.init;if(z==null)return!1;for(;z.type==="TSAsExpression";)z=z.expression;let W=O.node.parent;if(W==null&&(Wt(N.block,O.node.id),W=O.node.parent,W==null))return!1;if(W.kind==="const"&&z.type==="Literal"&&(typeof z.value=="string"||typeof z.value=="number"||z.value===null))return!0;if(z.type!=="CallExpression")return!1;let Y=z.callee;if(Y.type==="MemberExpression"&&Y.object.name==="React"&&Y.property!=null&&!Y.computed&&(Y=Y.property),Y.type!=="Identifier")return!1;let U=O.node.id,{name:K}=Y;if(K==="useRef"&&U.type==="Identifier")return!0;if(Yi(Y)&&U.type==="Identifier"){for(let ee of v.references)ee!==U&&x.add(ee.identifier);return!0}else if(K==="useState"||K==="useReducer"){if(U.type==="ArrayPattern"&&U.elements.length===2&&c(v.identifiers)){if(U.elements[1]===v.identifiers[0]){if(K==="useState"){let ee=v.references,we=0;for(let Ue=0;Ue<ee.length;Ue++){if(ee[Ue].isWrite()&&we++,we>1)return!1;s.set(ee[Ue].identifier,U.elements[0])}}return!0}else if(U.elements[0]===v.identifiers[0]){if(K==="useState"){let ee=v.references;for(let we=0;we<ee.length;we++)u.add(ee[we].identifier)}return!1}}}else if(K==="useTransition"&&U.type==="ArrayPattern"&&U.elements.length===2&&Array.isArray(v.identifiers)&&U.elements[1]===v.identifiers[0])return!0;return!1}function d(v){if(!c(v.defs))return!1;let O=v.defs[0];if(O==null||O.node==null||O.node.id==null)return!1;let z=O.node,W=N.childScopes,Y=null,U;for(U=0;U<W.length;U++){let K=W[U],ee=K.block;if(z.type==="FunctionDeclaration"&&ee===z||z.type==="VariableDeclarator"&&ee.parent===z){Y=K;break}}if(Y==null)return!1;for(U=0;U<Y.through.length;U++){let K=Y.through[U];if(K.resolved!=null&&k.has(K.resolved.scope)&&!g(K.resolved))return!1}return!0}let g=m(F,f),R=m(d,y),P=new Map;function j(v){let O=v.from,z=!1;for(;O.block!==I;)O.type==="function"&&(z=O.block.parent!=null&&O.block.parent.type==="ReturnStatement"),O=O.upper;return z}let V=new Map,G=new Map;H(w);function H(v){for(let O of v.references){if(!O.resolved||!k.has(O.resolved.scope))continue;let z=Wt(I,O.identifier),W=cr(z),Y=ze(W,G);if(b&&W.type==="Identifier"&&(W.parent.type==="MemberExpression"||W.parent.type==="OptionalMemberExpression")&&!W.parent.computed&&W.parent.property.type==="Identifier"&&W.parent.property.name==="current"&&j(O)&&P.set(Y,{reference:O,dependencyNode:W}),W.parent.type==="TSTypeQuery"||W.parent.type==="TSTypeReference")continue;let U=O.resolved.defs[0];if(U!=null&&!(U.node!=null&&U.node.init===I.parent)&&U.type!=="TypeParameter")if(V.has(Y))V.get(Y).references.push(O);else{let K=O.resolved,ee=g(K)||R(K);V.set(Y,{isStable:ee,references:[O]})}}for(let O of v.childScopes)H(O)}P.forEach(({reference:v,dependencyNode:O},z)=>{let W=v.resolved.references,Y=!1;for(let U=0;U<W.length;U++){let{identifier:K}=W[U],{parent:ee}=K;if(ee!=null&&ee.type==="MemberExpression"&&!ee.computed&&ee.property.type==="Identifier"&&ee.property.name==="current"&&ee.parent.type==="AssignmentExpression"&&ee.parent.left===ee){Y=!0;break}}Y||a({node:O.parent.property,message:`The ref value '${z}.current' will likely have changed by the time this effect cleanup function runs. If this ref points to a node rendered by React, copy '${z}.current' to a variable inside the effect, and use that variable in the cleanup function.`})});let D=new Set;function Z(v,O){D.has(O)||(D.add(O),a({node:v,message:`Assignments to the '${O}' variable from inside React Hook ${r(S)} 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(S)}.`}))}let q=new Set;if(V.forEach(({isStable:v,references:O},z)=>{v&&q.add(z),O.forEach(W=>{W.writeExpr&&Z(W.writeExpr,z)})}),D.size>0)return;if(!A){let v=null;if(V.forEach(({isStable:O,references:z},W)=>{v||z.forEach(Y=>{if(v)return;let U=Y.identifier;if(!s.has(U))return;let ee=Y.from;for(;ee.type!=="function";)ee=ee.upper;ee.block===I&&(v=W)})}),v){let{suggestedDependencies:O}=Ut({dependencies:V,declaredDependencies:[],stableDependencies:q,externalDependencies:new Set,isEffect:!0});a({node:S,message:`React Hook ${h} contains a call to '${v}'. Without a list of dependencies, this can lead to an infinite chain of updates. To fix this, pass [`+O.join(", ")+`] as a second argument to the ${h} Hook.`,suggest:[{desc:`Add dependencies array: [${O.join(", ")}]`,fix(z){return z.insertTextAfter(I,`, [${O.join(", ")}]`)}}]})}return}let ue=[],me=new Set;A.type!=="ArrayExpression"?a({node:A,message:`React Hook ${r(S)} was passed a dependency list that is not an array literal. This means we can't statically verify whether you've passed the correct dependencies.`}):A.elements.forEach(v=>{if(v===null)return;if(v.type==="SpreadElement"){a({node:v,message:`React Hook ${r(S)} has a spread element in its dependency array. This means we can't statically verify whether you've passed the correct dependencies.`});return}x.has(v)&&a({node:v,message:`Functions returned from \`useEffectEvent\` must not be included in the dependency array. Remove \`${r(v)}\` from the list.`,suggest:[{desc:`Remove the dependency \`${r(v)}\``,fix(Y){return Y.removeRange(v.range)}}]});let O;try{O=ze(v,G)}catch(Y){if(/Unsupported node type/.test(Y.message)){v.type==="Literal"?V.has(v.value)?a({node:v,message:`The ${v.raw} literal is not a valid dependency because it never changes. Did you mean to include ${v.value} in the array instead?`}):a({node:v,message:`The ${v.raw} literal is not a valid dependency because it never changes. You can safely remove it.`}):a({node:v,message:`React Hook ${r(S)} has a complex expression in the dependency array. Extract it to a separate variable so it can be statically checked.`});return}else throw Y}let z=v;for(;z.type==="MemberExpression"||z.type==="OptionalMemberExpression"||z.type==="ChainExpression";)z=z.object||z.expression.object;let W=!N.through.some(Y=>Y.identifier===z);ue.push({key:O,node:v}),W||me.add(O)});let{suggestedDependencies:ke,unnecessaryDependencies:Xe,missingDependencies:Te,duplicateDependencies:ct}=Ut({dependencies:V,declaredDependencies:ue,stableDependencies:q,externalDependencies:me,isEffect:b}),tt=ke;if(ct.size+Te.size+Xe.size===0){let v=ar(S),O=v&&sr(v);if(t&&!O)return;Vi({declaredDependencies:ue,declaredDependenciesNode:A,componentScope:N,scope:w}).forEach(({construction:W,isUsedOutsideOfHook:Y,depType:U})=>{let K=U==="function"?"useCallback":"useMemo",ee=U==="function"?"definition":"initialization",we=`wrap the ${ee} of '${W.name.name}' in its own ${K}() Hook.`,Ue=Y?`To fix this, ${we}`:`Move it inside the ${h} callback. Alternatively, ${we}`,Ai=U==="conditional"||U==="logical expression"?"could make":"makes",wi=`The '${W.name.name}' ${U} ${Ai} the dependencies of ${h} Hook (at line ${A.loc.start.line}) change on every render. ${Ue}`,Gn;Y&&W.type==="Variable"&&U==="function"&&(Gn=[{desc:`Wrap the ${ee} of '${W.name.name}' in its own ${K}() Hook.`,fix(Kn){let[Fi,Ri]=K==="useMemo"?["useMemo(() => { return ","; })"]:["useCallback(",")"];return[Kn.insertTextBefore(W.node.init,Fi),Kn.insertTextAfter(W.node.init,Ri)]}}]),a({node:W.node,message:wi,suggest:Gn})});return}!b&&Te.size>0&&(tt=Ut({dependencies:V,declaredDependencies:[],stableDependencies:q,externalDependencies:me,isEffect:b}).suggestedDependencies);function be(){if(ue.length===0)return!0;let v=ue.map(z=>z.key),O=v.slice().sort();return v.join(",")===O.join(",")}be()&&tt.sort();function Ie(v){let O=v.split("."),z="";for(let W=0;W<O.length;W++){if(W!==0){let Y=O.slice(0,W+1).join("."),U=G.get(Y)===!0;z+=U?"?.":"."}z+=O[W]}return z}function Lt(v,O,z,W){return v.size===0?null:(v.size>1?"":O+" ")+z+" "+(v.size>1?"dependencies":"dependency")+": "+Bi(Array.from(v).sort().map(Y=>"'"+Ie(Y)+"'"))+`. Either ${W} ${v.size>1?"them":"it"} or remove the dependency array.`}let De="";if(Xe.size>0){let v=null;if(Array.from(Xe.keys()).forEach(O=>{v===null&&O.endsWith(".current")&&(v=O)}),v!==null)De=` Mutable values like '${v}' aren't valid dependencies because mutating them doesn't re-render the component.`;else if(me.size>0){let O=Array.from(me)[0];w.set.has(O)||(De=` Outer scope values like '${O}' aren't valid dependencies because mutating them doesn't re-render the component.`)}}if(!De&&Te.has("props")){let v=V.get("props");if(v==null)return;let O=v.references;if(!Array.isArray(O))return;let z=!0;for(let W=0;W<O.length;W++){let Y=O[W],U=Wt(N.block,Y.identifier);if(!U){z=!1;break}let K=U.parent;if(K==null){z=!1;break}if(K.type!=="MemberExpression"&&K.type!=="OptionalMemberExpression"){z=!1;break}}z&&(De=` However, 'props' will change when *any* prop changes, so the preferred fix is to destructure the 'props' object outside of the ${h} call and refer to those specific props inside ${r(S)}.`)}if(!De&&Te.size>0){let v=null;Te.forEach(O=>{if(v)return;let z=N.set.get(O),W=V.get(O);if(W.references[0].resolved!==z)return;let Y=z.defs[0];if(Y==null||Y.name==null||Y.type!=="Parameter")return;let U=!1,K;for(let ee=0;ee<W.references.length;ee++)if(K=W.references[ee].identifier,K!=null&&K.parent!=null&&(K.parent.type==="CallExpression"||K.parent.type==="OptionalCallExpression")&&K.parent.callee===K){U=!0;break}U&&(v=O)}),v!==null&&(De=` If '${v}' changes too often, find the parent component that defines it and wrap that definition in useCallback.`)}if(!De&&Te.size>0){let v=null;if(Te.forEach(O=>{if(v!==null)return;let W=V.get(O).references,Y,U;for(let K=0;K<W.length;K++){for(Y=W[K].identifier,U=Y.parent;U!=null&&U!==N.block;){if(U.type==="CallExpression"){let ee=s.get(U.callee);if(ee!=null){if(ee.name===O)v={missingDep:O,setter:U.callee.name,form:"updater"};else if(u.has(Y))v={missingDep:O,setter:U.callee.name,form:"reducer"};else{let we=W[K].resolved;if(we!=null){let Ue=we.defs[0];Ue!=null&&Ue.type==="Parameter"&&(v={missingDep:O,setter:U.callee.name,form:"inlineReducer"})}}break}}U=U.parent}if(v!==null)break}}),v!==null)switch(v.form){case"reducer":De=` You can also replace multiple useState variables with useReducer if '${v.setter}' needs the current value of '${v.missingDep}'.`;break;case"inlineReducer":De=` If '${v.setter}' needs the current value of '${v.missingDep}', you can also switch to useReducer instead of useState and read '${v.missingDep}' in the reducer.`;break;case"updater":De=` You can also do a functional update '${v.setter}(${v.missingDep.slice(0,1)} => ...)' if you only need '${v.missingDep}' in the '${v.setter}' call.`;break;default:throw new Error("Unknown case.")}}a({node:A,message:`React Hook ${r(S)} has `+(Lt(Te,"a","missing","include")||Lt(Xe,"an","unnecessary","exclude")||Lt(ct,"a","duplicate","omit"))+De,suggest:[{desc:`Update the dependencies array to be: [${tt.map(Ie).join(", ")}]`,fix(v){return v.replaceText(A,`[${tt.map(Ie).join(", ")}]`)}}]})}function C(I){let A=Xi(I.callee,i);if(A===-1)return;let S=I.arguments[A],h=I.callee,b=ur(h).name,w=I.arguments[A+1],k=/Effect($|[^a-z])/g.test(b);if(!S){a({node:h,message:`React Hook ${b} requires an effect callback. Did you forget to pass a callback to the hook?`});return}if(t&&!k){let N=ar(h);if(!(N&&sr(N)))return}if(!w&&!k){(b==="useMemo"||b==="useCallback")&&a({node:h,message:`React Hook ${b} does nothing when called with only one argument. Did you forget to pass an array of dependencies?`});return}switch(S.type){case"FunctionExpression":case"ArrowFunctionExpression":E(S,w,h,b,k);return;case"Identifier":if(!w||w.elements&&w.elements.some(F=>F&&F.type==="Identifier"&&F.name===S.name))return;let N=n(I).set.get(S.name);if(N==null||N.defs==null)return;let c=N.defs[0];if(!c||!c.node||c.type!=="Variable"&&c.type!=="FunctionName")break;switch(c.node.type){case"FunctionDeclaration":E(c.node,w,h,b,k);return;case"VariableDeclarator":let F=c.node.init;if(!F)break;switch(F.type){case"ArrowFunctionExpression":case"FunctionExpression":E(F,w,h,b,k);return}break}break;default:a({node:h,message:`React Hook ${b} received a function whose dependencies are unknown. Pass an inline function instead.`});return}a({node:h,message:`React Hook ${b} has a missing dependency: '${S.name}'. Either include it or remove the dependency array.`,suggest:[{desc:`Update the dependencies array to be: [${S.name}]`,fix(N){return N.replaceText(w,`[${S.name}]`)}}]})}if(!!e.options[0]?.reactCompilerIsEnabled)return t=!0,{CallExpression:I=>C(I)};if(e.options[0]?.ignoreIfReactCompilerIsEnabled){for(let I of e.sourceCode.getAllComments())if(Ji.test(I.value))return t=!0,{CallExpression:A=>C(A)}}return{CallExpression:I=>C(I)}}};function Ut({dependencies:e,declaredDependencies:t,stableDependencies:r,externalDependencies:n,isEffect:o}){let p=i();function i(){return{isUsed:!1,isSatisfiedRecursively:!1,isSubtreeUsed:!1,children:new Map}}e.forEach((E,C)=>{let T=a(p,C);T.isUsed=!0,l(p,C,I=>{I.isSubtreeUsed=!0})}),t.forEach(({key:E})=>{let C=a(p,E);C.isSatisfiedRecursively=!0}),r.forEach(E=>{let C=a(p,E);C.isSatisfiedRecursively=!0});function a(E,C){let T=C.split("."),I=E;for(let A of T){let S=I.children.get(A);S||(S=i(),I.children.set(A,S)),I=S}return I}function l(E,C,T){let I=C.split("."),A=E;for(let S of I){let h=A.children.get(S);if(!h)return;T(h),A=h}}let s=new Set,u=new Set;f(p,s,u,E=>E);function f(E,C,T,I){E.children.forEach((A,S)=>{let h=I(S);if(A.isSatisfiedRecursively){A.isSubtreeUsed&&T.add(h);return}if(A.isUsed){C.add(h);return}f(A,C,T,b=>h+"."+b)})}let y=[],x=new Set,m=new Set;return t.forEach(({key:E})=>{u.has(E)?y.indexOf(E)===-1?y.push(E):m.add(E):x.add(E)}),s.forEach(E=>{y.push(E)}),{suggestedDependencies:y,unnecessaryDependencies:x,duplicateDependencies:m,missingDependencies:s}}function He(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 He(e.consequent)!=null||He(e.alternate)!=null?"conditional":null;case"LogicalExpression":return He(e.left)!=null||He(e.right)!=null?"logical expression":null;case"JSXFragment":return"JSX fragment";case"JSXElement":return"JSX element";case"AssignmentExpression":return He(e.right)!=null?"assignment expression":null;case"NewExpression":return"object construction";case"Literal":return e.value instanceof RegExp?"regular expression":null;case"TypeCastExpression":return He(e.expression);case"TSAsExpression":return He(e.expression)}return null}function Vi({declaredDependencies:e,declaredDependenciesNode:t,componentScope:r,scope:n}){let o=e.map(({key:i})=>{let a=r.variables.find(s=>s.name===i);if(a==null)return null;let l=a.defs[0];if(l==null)return null;if(l.type==="Variable"&&l.node.type==="VariableDeclarator"&&l.node.id.type==="Identifier"&&l.node.init!=null){let s=He(l.node.init);if(s!=null)return[a,s]}return l.type==="FunctionName"&&l.node.type==="FunctionDeclaration"?[a,"function"]:l.type==="ClassName"&&l.node.type==="ClassDeclaration"?[a,"class"]:null}).filter(Boolean);function p(i){let a=!1;for(let l=0;l<i.references.length;l++){let s=i.references[l];if(s.writeExpr){if(a)return!0;a=!0;continue}let u=s.from;for(;u!==n&&u!=null;)u=u.upper;if(u!==n&&!fr(t,s.identifier))return!0}return!1}return o.map(([i,a])=>({construction:i.defs[0],depType:a,isUsedOutsideOfHook:p(i)}))}function cr(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)?cr(e.parent):e.type==="MemberExpression"&&e.parent&&e.parent.type==="AssignmentExpression"&&e.parent.left===e?e.object:e}function zt(e,t,r){t&&(e.optional?t.has(r)||t.set(r,!0):t.has(r)||t.set(r,!1))}function ze(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=ze(e.object,t),n=ze(e.property,null),o=`${r}.${n}`;return zt(e,t,o),o}else if(e.type==="OptionalMemberExpression"&&!e.computed){let r=ze(e.object,t),n=ze(e.property,null),o=`${r}.${n}`;return zt(e,t,o),o}else if(e.type==="ChainExpression"&&!e.computed){let r=e.expression;if(r.type==="CallExpression")throw new Error(`Unsupported node type: ${r.type}`);let n=ze(r.object,t),o=ze(r.property,null),p=`${n}.${o}`;return zt(r,t,p),p}else throw new Error(`Unsupported node type: ${e.type}`)}function ur(e,t){return e.type==="MemberExpression"&&e.object.type==="Identifier"&&e.object.name==="React"&&e.property.type==="Identifier"&&!e.computed?e.property:e}function Xi(e,t){let r=ur(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=ze(r,null)}catch(o){if(/Unsupported node type/.test(o.message))return 0;throw o}return t.additionalHooks.test(n)?0:-1}else return-1}}function Wt(e,t){let r=[e],n=null;for(;r.length;){if(n=r.shift(),Hi(n,t))return n;if(fr(n,t))for(let[o,p]of Object.entries(n))o!=="parent"&&(lr(p)?(p.parent=n,r.push(p)):Array.isArray(p)&&p.forEach(i=>{lr(i)&&(i.parent=n,r.push(i))}))}return null}function Bi(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 lr(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&typeof e.type=="string"}function Hi(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 fr(e,t){return e.range[0]<=t.range[0]&&e.range[1]>=t.range[1]}function Yi(e){return!1}var ae=require("@typescript-eslint/utils"),B=Pe(require("typescript")),Bt=require("zod/v4");var Jt=require("@typescript-eslint/utils");function nt(e,t,r=1/0){if(r!==0&&e.parent)return e.type===t?e:nt(e.parent,t,r===1/0?r:r-1)}function*Vt(e){yield e,e.parent&&(yield*Vt(e.parent))}function Xt(e,t){for(let r of e){let n=t(r);if(n!=null&&n!==!1)return n}}function yr(e,t,r){let o=r.getDeclaredVariables(e).find(p=>p.name===t||p.identifiers[0]?.parent.type===Jt.AST_NODE_TYPES.Property&&p.identifiers[0].parent.key.type===Jt.AST_NODE_TYPES.Identifier&&p.identifiers[0].parent.key.name===t);return o?o.references.filter(p=>!p.init):[]}function mr(e){return e===null||typeof e!="object"||!("type"in e)?!1:typeof e.type=="string"}function qi(e,t){return e[t]}function je(e,t,r){let n=r.visitorKeys,o=new Set;function p(i){if(o.has(i))return!1;if(o.add(i),t(i)===!0)return!0;let l=n[i.type];if(l)for(let s of l){let u=qi(i,s);if(u){if(Array.isArray(u)){for(let f of u)if(mr(f)&&p(f))return!0}else if(mr(u)&&p(u))return!0}}return!1}p(e)}var Zi=ae.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),dr="improved-no-unnecessary-condition",Gi=Bt.z.object({alternativeForInCondition:Bt.z.string().optional().describe("Alternative to appear in the error for `in` condition")}),gr={object:"Array",property:"isArray"},Ki=["string","number","bigint","boolean","symbol","undefined","object","function","never"],Qi=new Set(Ki),Ht={name:dr,rule:Zi({name:dr,meta:{type:"suggestion",docs:{description:"Extends checks of `no-unnecessary-condition` rule"},messages:{unnecessaryTypeofCondition:'This condition is unnecessary. The type of "{{name}}" is always "{{type}}".',alwaysFalseTypeofCondition:'This condition will always be false. The type of "{{name}}" is "{{actualType}}" so the condition has no overlap with "{{conditionType}}".',unnecessaryStartsWithCondition:"This startsWith check is unnecessary as it always evaluates to true.",alwaysFalseStartsWithCondition:"This startsWith check will always be false.",unnecessaryEndsWithCondition:"This endsWith check is unnecessary as it always evaluates to true.",alwaysFalseEndsWithCondition:"This endsWith check will always be false.",unnecessaryIncludesCondition:"This includes check is unnecessary as it always evaluates to true.",alwaysFalseIncludesCondition:"This includes check will always be false.",unnecessaryArrayIsArrayCondition:"This Array.isArray check is unnecessary as it always evaluates to true.",alwaysFalseArrayIsArrayCondition:"This Array.isArray check will always be false.",unnecessaryLengthCondition:"This length comparison is unnecessary as it always evaluates to true.",alwaysFalseLengthCondition:"This length comparison will always be false.",unnecessaryInCondition:'This in check is unnecessary. Property "{{property}}" always exists on type "{{type}}".{{alternative}}',alwaysFalseInCondition:'This in check will always be false. Property "{{property}}" does not exist on type "{{type}}".{{alternative}}'},schema:[J(Gi)]},defaultOptions:[{}],create(e,[t]){let r=ae.ESLintUtils.getParserServices(e,!0),n=r.program?.getTypeChecker();if(!n||!r.program)throw new Error("TypeScript services or program not available");function o(c){return c.type===ae.AST_NODE_TYPES.UnaryExpression&&c.operator==="typeof"}function p(c){return c.flags&B.default.TypeFlags.Any||c.flags&B.default.TypeFlags.Unknown?null:c.flags&B.default.TypeFlags.StringLike?["string"]:c.flags&B.default.TypeFlags.NumberLike?["number"]:c.flags&B.default.TypeFlags.BigIntLike?["bigint"]:c.flags&B.default.TypeFlags.BooleanLike?["boolean"]:c.flags&B.default.TypeFlags.ESSymbolLike?["symbol"]:c.flags&B.default.TypeFlags.Undefined||c.flags&B.default.TypeFlags.Void?["undefined"]:c.flags&B.default.TypeFlags.Null?["object"]:c.getCallSignatures().length>0?["function"]:c.flags&B.default.TypeFlags.Object?c.getProperties().length===0?["string","number","bigint","boolean","symbol","object","function"]:["object"]:c.flags&B.default.TypeFlags.NonPrimitive?["object"]:c.flags&B.default.TypeFlags.Never?["never"]:null}function i(c){if(!n)return null;let F=r.esTreeNodeToTSNodeMap.get(c),d=n.getTypeAtLocation(F.expression);if(d.flags&B.default.TypeFlags.Any||d.flags&B.default.TypeFlags.Unknown)return null;let g=[];if(d.isUnion()){for(let P of d.types){let j=p(P);if(j)g.push(...j);else return null}return g}let R=p(d);return R?(g.push(...R),g):null}function a(c){if(!(c.operator==="==="||c.operator==="!=="))return;let d=null,g=null;if(o(c.left)?(d=c.left,g=c.right.type===ae.AST_NODE_TYPES.Literal&&typeof c.right.value=="string"?c.right.value:null):o(c.right)&&(d=c.right,g=c.left.type===ae.AST_NODE_TYPES.Literal&&typeof c.left.value=="string"?c.left.value:null),!d||!g||!eo(g,Qi))return;let R=i(d);if(!R)return;let P=c.operator==="!==",j=R.includes(g);R.length===1?j&&!P?e.report({node:c,messageId:"unnecessaryTypeofCondition",data:{name:rt(d,e),type:g}}):!j&&P?e.report({node:c,messageId:"unnecessaryTypeofCondition",data:{name:rt(d,e),type:Array.from(R)[0]}}):!j&&!P?e.report({node:c,messageId:"alwaysFalseTypeofCondition",data:{name:rt(d,e),actualType:ht(R),conditionType:g}}):j&&P&&e.report({node:c,messageId:"alwaysFalseTypeofCondition",data:{name:rt(d,e),actualType:ht(R),conditionType:g}}):!j&&!P?e.report({node:c,messageId:"alwaysFalseTypeofCondition",data:{name:rt(d,e),actualType:ht(R),conditionType:g}}):!j&&P&&e.report({node:c,messageId:"unnecessaryTypeofCondition",data:{name:rt(d,e),type:ht(R)}})}function l(c){if(c.flags&B.default.TypeFlags.Any||c.flags&B.default.TypeFlags.Unknown)return null;if(c.isUnion()){let F=[];for(let d of c.types)if(d.flags&B.default.TypeFlags.StringLiteral){let g=d.value;F.push(g)}else return null;return F}return c.flags&B.default.TypeFlags.StringLiteral?[c.value]:null}function s(c){if(!n)return null;let F=r.esTreeNodeToTSNodeMap.get(c),d=n.getTypeAtLocation(F),g=l(d);if(g)return g;let R=n.getSymbolAtLocation(F);if(R){let P=n.getTypeOfSymbolAtLocation(R,F),j=l(P);if(j)return j}return null}function u(c){let F=e.sourceCode.ast,d=null;return je(F,g=>{if(g.type===ae.AST_NODE_TYPES.VariableDeclarator&&g.id.type===ae.AST_NODE_TYPES.Identifier&&g.id.name===c.name&&g.id.typeAnnotation){let R=g.id.typeAnnotation.typeAnnotation;if(R.type===ae.AST_NODE_TYPES.TSUnionType){let P=[];for(let j of R.types)if(j.type===ae.AST_NODE_TYPES.TSLiteralType&&j.literal.type===ae.AST_NODE_TYPES.Literal&&typeof j.literal.value=="string")P.push(j.literal.value);else return!0;return d=P,!0}if(R.type===ae.AST_NODE_TYPES.TSLiteralType&&R.literal.type===ae.AST_NODE_TYPES.Literal&&typeof R.literal.value=="string")return d=[R.literal.value],!0}return!1},e.sourceCode),d}function f(c){return c==="Array"||c==="ReadonlyArray"?!0:c.endsWith(".Array")||c.endsWith(".ReadonlyArray")}function y(c){if(!n)return!1;if(n.isArrayType(c)||n.isTupleType(c))return!0;let F=n.getApparentType(c);if(F!==c&&(n.isArrayType(F)||n.isTupleType(F)))return!0;if(c.aliasSymbol){let g=n.getFullyQualifiedName(c.aliasSymbol);if(f(g))return!0}let d=c.getSymbol();if(d){let g=n.getFullyQualifiedName(d);if(f(g))return!0}return!1}function x(c){if(!n)return!1;if(c.flags&B.default.TypeFlags.StringLike||c.flags&B.default.TypeFlags.NumberLike||c.flags&B.default.TypeFlags.BigIntLike||c.flags&B.default.TypeFlags.BooleanLike||c.flags&B.default.TypeFlags.ESSymbolLike||c.flags&B.default.TypeFlags.EnumLike||c.flags&B.default.TypeFlags.Null||c.flags&B.default.TypeFlags.Undefined||c.flags&B.default.TypeFlags.Void||c.flags&B.default.TypeFlags.Never)return!0;let F=c.getSymbol();if(F){let d=n.getFullyQualifiedName(F);if(d==="__function"||d==="__object"&&!y(c))return!0}return!1}function m(c){if(c.flags&B.default.TypeFlags.Any||c.flags&B.default.TypeFlags.Unknown)return"unknown";if(c.isUnion()){let F=!0,d=!0;for(let g of c.types){let R=m(g);if(R==="unknown")return"unknown";R!=="alwaysTrue"&&(F=!1),R!=="alwaysFalse"&&(d=!1)}return F?"alwaysTrue":d?"alwaysFalse":"unknown"}return y(c)?"alwaysTrue":x(c)?"alwaysFalse":"unknown"}function E(c){return!c.computed&&c.object.type===ae.AST_NODE_TYPES.Identifier&&c.object.name===gr.object&&c.property.type===ae.AST_NODE_TYPES.Identifier&&c.property.name===gr.property}function C(c){if(!n||c.callee.type!==ae.AST_NODE_TYPES.MemberExpression||!E(c.callee)||c.arguments.length===0)return;let[F]=c.arguments;if(!F||F.type===ae.AST_NODE_TYPES.SpreadElement)return;let d=r.esTreeNodeToTSNodeMap.get(F),g=n.getTypeAtLocation(d),R=m(g);R==="alwaysTrue"?e.report({node:c,messageId:"unnecessaryArrayIsArrayCondition"}):R==="alwaysFalse"&&e.report({node:c,messageId:"alwaysFalseArrayIsArrayCondition"})}function T(c){if(c.callee.type!==ae.AST_NODE_TYPES.MemberExpression||c.callee.property.type!==ae.AST_NODE_TYPES.Identifier||c.callee.computed)return;let F=c.callee.property.name;if(F!=="startsWith"&&F!=="endsWith"&&F!=="includes"||c.arguments.length!==1)return;let[d]=c.arguments;if(!d||d.type!==ae.AST_NODE_TYPES.Literal||typeof d.value!="string")return;let g=c.callee.object,R=s(g);if(!R&&g.type===ae.AST_NODE_TYPES.Identifier&&(R=u(g)),!R||R.length===0)return;let P=d.value;if(F==="includes"&&R.length>1)return;let j=0,V=0;for(let G of R)if((F==="startsWith"?G.startsWith(P):F==="endsWith"?G.endsWith(P):G.includes(P))?j++:V++,j>0&&V>0)return;if(j>0&&V===0){let G=F==="startsWith"?"unnecessaryStartsWithCondition":F==="endsWith"?"unnecessaryEndsWithCondition":"unnecessaryIncludesCondition";e.report({node:c,messageId:G})}else if(V>0&&j===0){let G=F==="startsWith"?"alwaysFalseStartsWithCondition":F==="endsWith"?"alwaysFalseEndsWithCondition":"alwaysFalseIncludesCondition";e.report({node:c,messageId:G})}}function I(c){if(!new Set(["===","!==",">",">=","<","<="]).has(c.operator))return;function d(H){if(H.type!==ae.AST_NODE_TYPES.MemberExpression||H.computed||H.property.type!==ae.AST_NODE_TYPES.Identifier||H.property.name!=="length")return null;let D=H.object,Z=s(D);if(!Z||Z.length===0)return null;let q=[];for(let ue of Z)q.push(ue.length);return{values:q}}let g=d(c.left),R=d(c.right),P=null,j=null;if(g?c.right.type===ae.AST_NODE_TYPES.Literal&&typeof c.right.value=="number"&&(P=g.values,j=c.right.value):R&&c.left.type===ae.AST_NODE_TYPES.Literal&&typeof c.left.value=="number"&&(P=R.values,j=c.left.value),!P||j===null)return;let V=0,G=0;for(let H of P){let D=!1;if(c.operator==="==="?D=H===j:c.operator==="!=="?D=H!==j:c.operator===">"?D=H>j:c.operator===">="?D=H>=j:c.operator==="<"?D=H<j:c.operator==="<="&&(D=H<=j),D?V++:G++,V>0&&G>0)return}V>0&&G===0?e.report({node:c,messageId:"unnecessaryLengthCondition"}):G>0&&V===0&&e.report({node:c,messageId:"alwaysFalseLengthCondition"})}function A(c){if(c.type===ae.AST_NODE_TYPES.Literal&&typeof c.value=="string")return c.value;let F=s(c);if(!F||F.length!==1)return null;let[d]=F;return d??null}function S(c){return(c.flags&B.default.TypeFlags.Intersection)!==0}function h(c){return(c.flags&B.default.TypeFlags.Object)!==0}function b(c){return!n||n.getIndexTypeOfType(c,B.default.IndexKind.String)?!0:!!n.getIndexTypeOfType(c,B.default.IndexKind.Number)}function w(c,F){if(!n||b(c)||c.getProperties().length===0)return"unknown";let d=n.getPropertyOfType(c,F);return d?d.flags&B.default.SymbolFlags.Optional?"optional":"required":"absent"}function k(c,F){if(c.flags&B.default.TypeFlags.Any||c.flags&B.default.TypeFlags.Unknown||c.flags&B.default.TypeFlags.Never||c.flags&B.default.TypeFlags.TypeParameter||c.flags&B.default.TypeFlags.IndexedAccess||c.flags&B.default.TypeFlags.StringLike||c.flags&B.default.TypeFlags.NumberLike||c.flags&B.default.TypeFlags.BigIntLike||c.flags&B.default.TypeFlags.BooleanLike||c.flags&B.default.TypeFlags.EnumLike||c.flags&B.default.TypeFlags.ESSymbolLike||c.flags&B.default.TypeFlags.NonPrimitive||c.flags&B.default.TypeFlags.Null||c.flags&B.default.TypeFlags.Undefined||c.flags&B.default.TypeFlags.Void)return"unknown";if(c.isUnion()){let d=!0,g=!0;for(let R of c.types){let P=k(R,F);if(P==="unknown"||(P!=="required"&&(d=!1),P!=="absent"&&(g=!1),P==="optional"))return"unknown"}return d?"required":g?"absent":"unknown"}if(S(c)){let d=c,g=!1,R=!1;for(let P of d.types){let j=k(P,F);if(j==="unknown")return"unknown";j==="required"?g=!0:j==="optional"&&(R=!0)}return g?"required":R?"optional":"absent"}return h(c)?w(c,F):"unknown"}function N(c){if(c.operator!=="in"||c.left.type===ae.AST_NODE_TYPES.PrivateIdentifier)return;let F=A(c.left);if(!F)return;let d=c.right,g=r.esTreeNodeToTSNodeMap.get(d);if(!n)return;let R=n.getTypeAtLocation(g),P=k(R,F);P==="required"?e.report({node:c,messageId:"unnecessaryInCondition",data:{property:F,type:n.typeToString(R),alternative:t.alternativeForInCondition?`If this a valid condition, you can use as alternative: ${t.alternativeForInCondition}`:""}}):P==="absent"&&e.report({node:c,messageId:"alwaysFalseInCondition",data:{property:F,type:n.typeToString(R),alternative:t.alternativeForInCondition?`If this a valid condition, you can use as alternative: ${t.alternativeForInCondition}`:""}})}return{BinaryExpression(c){a(c),I(c),N(c)},CallExpression(c){T(c),C(c)}}}})};function ht(e){return Array.from(new Set(e)).join(" | ")||"never"}function rt(e,t){let r=e.argument;return r.type===ae.AST_NODE_TYPES.Identifier?r.name:t.sourceCode.getText(r)}function eo(e,t){return t.has(e)}var bt=require("@typescript-eslint/utils"),Et=require("zod/v4");var to=bt.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),Sr="no-call-with-explicit-generics",no=Et.z.object({functions:Et.z.array(Et.z.string())}),ro=to({name:Sr,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(no)]},defaultOptions:[{functions:[]}],create(e,[t]){let r=new Set(t.functions);return{CallExpression(n){let{callee:o}=n;o.type===bt.AST_NODE_TYPES.Identifier&&r.has(o.name)&&n.typeArguments&&e.report({node:n,messageId:"noExplicitGenerics",data:{functionName:o.name}})}}}}),Yt={name:Sr,rule:ro};var Ge=require("@typescript-eslint/utils"),io=Ge.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),Tr="no-call-with-inferred-generics",oo=io({name:Tr,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:o}=n;if(o.type!==Ge.AST_NODE_TYPES.Identifier)return;let p=r.get(o.name);if(!p)return;let{minGenerics:i=1,allowAny:a,disallowTypes:l=t.disallowTypes}=p;(n.typeArguments?.params.length||0)<(i||0)&&e.report({node:n,messageId:"missingGenericDeclaration",data:{functionName:o.name,minGenerics:i||0}}),!(a&&!l)&&n.typeArguments?.params.some(u=>!a&&u.type===Ge.AST_NODE_TYPES.TSAnyKeyword||l&&u.type===Ge.AST_NODE_TYPES.TSTypeReference&&u.typeName.type===Ge.AST_NODE_TYPES.Identifier&&l.includes(u.typeName.name))&&e.report({node:n,messageId:"anyUsedInGenerics",data:{functionName:o.name}})}}}}),qt={name:Tr,rule:oo};var br=require("@typescript-eslint/utils"),so=br.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),xr="no-commented-out-code",ao=["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:"],lo=/^\s*return\s+/,po=/\w=("|'|`)/,co=/\w+:\s*('|"|`)/,uo=/\[['"][^'"]*['"]\]:\s*('|"|`|[^'"`\s])/,fo=/\w+-\w+:/,mo=/\w+_\w+:/,yo=/\?\s+\w/,go=/:\s+\w/,So=/^\s*('|"|`)[^'"]*('|"|`),?\s*$/,To=/^\s*\d+[,}]/,ho=/^\s*\[[^\]]*\][,}]/,Eo=/^\s*\{[^}]*\}[,}]/,bo=/\.\w+\(/,xo=/\[\w+\]/,Co=/^\s*(['"`]).+?\1\s*:/,Io=/^<[A-Z]\w*(\s|>|\/)/,Ao=/^<[a-z]+(\s|>|\/)/,wo=/<[A-Z]\w*(\s.*)?>/,Fo=/<\/[A-Z]\w*>/,Ro=/<[a-z]+(\s.*)?>/,vo=/<\/[a-z]+>/,ko=/^\s*[*\s]*$/,Po=/^[a-zA-Z]/,No=/^[A-Z][A-Za-z]*(?:\s+\d+)?(?:\s+[a-z]+)*:\s+[A-Za-z]/,Oo=/```[\s\S]*?```/g,Do=/`[^`]*`/g,hr=/[a-zA-Z0-9]/,jo=/\.[A-Za-z_][A-Za-z0-9_]*\(/,Lo=/[{}[\]()`=<>]/,Mo=/:\s*(['"`[{(]|\w+\s*=>)/,_o=/\bif\s*\(|\belse\b|=>/,ye={returnStatement:lo,stringAssignment:po,objectPropertyWithQuotes:co,computedPropertyAssignment:uo,kebabCaseProperty:fo,snakeCaseProperty:mo,ternaryOperator:yo,colonWithWord:go,quotedString:So,numberWithComma:To,arrayWithComma:ho,objectWithComma:Eo,methodCall:bo,arrayAccess:xo,quotedPropertyKey:Co,jsxSelfClosing:Io,jsxElement:Ao,jsxOpeningTag:wo,jsxClosingTag:Fo,htmlOpeningTag:Ro,htmlClosingTag:vo,jsdocComment:ko};function $o(e){if(e.includes(":")){let r=e.split(":")[0]?.trim();if(r&&Po.test(r)&&r.includes(" "))return!0}let t=e.trim();return t.length===0||jo.test(t)||Lo.test(t)||Mo.test(t)||_o.test(t)?!1:!!(t.includes(":")&&No.test(t))}var Uo=[") {","return;",ye.returnStatement,"if (","else {","else if (","/>","</","< ","},",": {"," } = ","={",ye.stringAssignment,");",ye.objectPropertyWithQuotes,ye.computedPropertyAssignment,ye.kebabCaseProperty,ye.snakeCaseProperty,"&&","||","()",ye.ternaryOperator,ye.colonWithWord,ye.quotedString,ye.numberWithComma,ye.arrayWithComma,ye.objectWithComma,ye.methodCall,ye.arrayAccess,"?.(","??","=>",ye.quotedPropertyKey],zo=["/>","</",ye.jsxSelfClosing,ye.jsxElement,ye.jsxOpeningTag,ye.jsxClosingTag,ye.htmlOpeningTag,ye.htmlClosingTag],Er=["INFO:","TODO:","DOCS:","FIX:","FIXME:","HACK:","NOTE:","WARNING:","WARN:","BUG:","ISSUE:","TEMP:","TEMPORARY:","XXX:","REVIEW:","eslint"],Wo=so({name:xr,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,o){if(n.startsWith("/"))return!1;let p=n.trimStart();if(n.startsWith("*")||p.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")||ye.jsdocComment.test(n))return!1;for(let i of Er)if(p.startsWith(i))return!1;if(n.includes("https://")||$o(p))return!1;if(o==="Block"){for(let i of zo)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 ao)if(p.startsWith(i))return{wrongPattern:i};for(let i of Uo)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,o){let p=n,i=p.trim();if(i.startsWith("`")&&(i.endsWith("`,")||i.endsWith("`;")||i.endsWith("`")))return p;if(o==="Block"&&p.includes("```")){let s=p.split(Oo);s.some(f=>hr.test(f))&&(p=s.join(""))}if(!p.includes("`"))return p;let a=p.split(Do);return a.some(s=>hr.test(s))?a.join(""):p}return{Program(){let o=e.sourceCode.getAllComments();for(let p of o){let i=r(p.value,p.type),a=t(i,p.type);a&&e.report({node:p,messageId:"commentedOutCode",data:{wrongPattern:a.wrongPattern,allowedPrefixes:Er.join(", ")}})}}}}}),Zt={name:xr,rule:Wo};var xt=require("@typescript-eslint/utils"),Jo=xt.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),Cr="no-default-export",Vo=Jo({name:Cr,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===xt.TSESTree.AST_NODE_TYPES.Identifier&&r.exported.name==="default"&&e.report({node:t,messageId:"noDefaultExport"})}}}}),Gt={name:Cr,rule:Vo};var Ir=require("@typescript-eslint/utils"),Xo=Ir.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),Ar="no-leaked-text-in-jsx",Bo=[",",";","[","]","(",")"],Ho=Xo({name:Ar,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="";Bo.includes(r)?n=r:r.includes("&&")?n="&&":r.includes("||")?n="||":r.endsWith("? (")&&(n="? ("),n&&e.report({node:t,messageId:"leakedTextInJSX",data:{text:n}})}}}}),Kt={name:Ar,rule:Ho};var Ye=require("@typescript-eslint/utils"),Yo=Ye.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),Fr="no-non-camel-case-functions",qo=/^(\$?[a-z][a-zA-Z0-9]*)$/;function wr(e){if(e.typeName.type!==Ye.AST_NODE_TYPES.TSQualifiedName)return!1;let{left:t,right:r}=e.typeName;return t.type===Ye.AST_NODE_TYPES.Identifier&&t.name==="JSX"&&r.name==="Element"}var Zo=Yo({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&&!qo.test(t.id.name)){let r=t.returnType?.typeAnnotation;if(r&&(r.type===Ye.AST_NODE_TYPES.TSTypeReference?wr(r):r.type===Ye.AST_NODE_TYPES.TSUnionType&&r.types.some(o=>o.type===Ye.AST_NODE_TYPES.TSTypeReference&&wr(o))))return;e.report({node:t.id,messageId:"nonCamelCaseFunction",data:{functionName:t.id.name}})}}}}}),Qt={name:Fr,rule:Zo};var se=require("@typescript-eslint/utils");var Go=se.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),Rr="no-optional-root-props",Ko=Go({name:Rr,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 p=e.sourceCode.getDeclaredVariables(n)[0];if(!p||p.references.length!==1)return!1;let i=p.references[0];if(!i)return!1;for(let a of Vt(i.identifier)){if("returnType"in a||a.type===se.TSESTree.AST_NODE_TYPES.ExportNamedDeclaration)return!1;let l=a.parent;if(!l)return!1;if(l.type===se.TSESTree.AST_NODE_TYPES.TSTypeParameterInstantiation&&l.parent.type===se.TSESTree.AST_NODE_TYPES.TSTypeReference&&l.parent.typeName.type===se.TSESTree.AST_NODE_TYPES.Identifier&&l.parent.typeName.name==="FC"){let u=nt(l.parent.parent,se.TSESTree.AST_NODE_TYPES.VariableDeclaration,4);if(!u)return!1;let f=Ct(u,e.sourceCode);return f?!(f.parent.type===se.TSESTree.AST_NODE_TYPES.CallExpression&&f.parent.callee.type===se.TSESTree.AST_NODE_TYPES.Identifier&&f.parent.callee.name==="memo"):!1}if(a.type===se.TSESTree.AST_NODE_TYPES.AssignmentPattern)return!1;if(l.type===se.TSESTree.AST_NODE_TYPES.ArrowFunctionExpression){let s=nt(l,se.TSESTree.AST_NODE_TYPES.VariableDeclaration);return s?!!Ct(s,e.sourceCode):!1}if(l.type===se.TSESTree.AST_NODE_TYPES.FunctionDeclaration)return!!Ct(l,e.sourceCode)}return!1}function r(n){n.key.type!==se.TSESTree.AST_NODE_TYPES.Identifier||!n.optional||e.report({node:n.key,messageId:"optionalNotAllowed",data:{propertyName:n.key.name},suggest:[{messageId:"suggestion",fix:o=>{let p=nt(n,se.TSESTree.AST_NODE_TYPES.TSPropertySignature);if(!p)return null;let i=e.sourceCode.getText(p);return o.replaceText(p,i.replace("?:",": undefined |"))}}]})}return{TSTypeAliasDeclaration(n){if(n.typeAnnotation.type===se.TSESTree.AST_NODE_TYPES.TSTypeLiteral&&!(It(n)||!t(n)))for(let o of n.typeAnnotation.members)o.type===se.TSESTree.AST_NODE_TYPES.TSPropertySignature&&r(o)},TSInterfaceDeclaration(n){if(!(It(n)||!t(n)))for(let o of n.body.body)o.type===se.TSESTree.AST_NODE_TYPES.TSPropertySignature&&r(o)},TSTypeReference(n){if(n.typeName.type!==se.TSESTree.AST_NODE_TYPES.Identifier||n.typeName.name!=="FC"||!n.typeArguments?.params[0])return;let o=n.typeArguments.params[0];if(o.type!==se.TSESTree.AST_NODE_TYPES.TSTypeLiteral)return;let p=nt(n.parent,se.TSESTree.AST_NODE_TYPES.VariableDeclaration,4);if(!p)return;let i=Ct(p,e.sourceCode);if(!(!i||i.parent.type===se.TSESTree.AST_NODE_TYPES.CallExpression&&i.parent.callee.type===se.TSESTree.AST_NODE_TYPES.Identifier&&i.parent.callee.name==="memo"))for(let l of o.members)l.type===se.TSESTree.AST_NODE_TYPES.TSPropertySignature&&r(l)}}}});function It(e){return e?e.parent?.type===se.TSESTree.AST_NODE_TYPES.ExportNamedDeclaration||e.parent?.type===se.TSESTree.AST_NODE_TYPES.ExportDefaultDeclaration:!1}function Ct(e,t){if(It(e))return;let r;if(e.type===se.TSESTree.AST_NODE_TYPES.VariableDeclaration){if(e.declarations.length!==1)return;e.declarations[0].id.type===se.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===se.TSESTree.AST_NODE_TYPES.FunctionDeclaration&&n.upper&&(n=n.upper);let o=n.variables.find(i=>i.identifiers.includes(r));if(!o)return;let p=o.references.filter(i=>i.identifier!==r);if(!(p.length!==1||!p[0])&&!It(p[0].identifier.parent.parent))return p[0].identifier}var en={name:Rr,rule:Ko};var ut=require("@typescript-eslint/utils");var ft=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===ut.AST_NODE_TYPES.Identifier?t.has(n.name):n.type===ut.AST_NODE_TYPES.MemberExpression?r(n.object):!1:!1}return{ImportDeclaration(n){for(let o of n.specifiers)t.add(o.local.name)},ExportNamedDeclaration(n){if(n.source){e.report({node:n,messageId:"noReexport"});return}if(n.declaration?.type===ut.AST_NODE_TYPES.VariableDeclaration)for(let o of n.declaration.declarations)r(o.init)&&e.report({node:n,messageId:"noReexport"});n.specifiers.length>0&&e.report({node:n,messageId:"noReexport"})},ExportDefaultDeclaration(n){n.declaration.type===ut.AST_NODE_TYPES.Identifier&&t.has(n.declaration.name)&&e.report({node:n,messageId:"noReexport"})},ExportAllDeclaration(n){e.report({node:n,messageId:"noReexport"})}}}});var vr=require("@typescript-eslint/utils"),At=Pe(require("path")),We=require("zod/v4");var Qo=vr.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),kr="no-relative-imports",es=We.z.object({find:We.z.string(),replacement:We.z.string()}),ts=We.z.object({aliases:We.z.array(es),rootDir:We.z.string().optional(),allowNotFoundAliases:We.z.boolean().optional(),_dev_simulateFileName:We.z.string().optional()}),ns=Qo({name:kr,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(ts)]},defaultOptions:[{aliases:[],rootDir:void 0}],create(e,[t]){let r=t._dev_simulateFileName??e.filename;function n(i){return i.startsWith(".")||i.startsWith("..")}function o(i,a){let l=At.default.dirname(a);return At.default.resolve(l,i)}function p(i){let a=t.rootDir??process.cwd(),l=At.default.relative(a,i);if(l.startsWith("."))return null;l.startsWith("/")||(l=`/${l}`);for(let{find:s,replacement:u}of t.aliases)if(l.startsWith(u)){let f=l.replace(u,s);return{alias:s,newPath:f}}return null}return{ImportDeclaration(i){let a=i.source.value;if(!n(a))return;let l=o(a,r),s=p(l);!s&&t.allowNotFoundAliases||e.report({node:i,messageId:s?"noRelativeImportsWithAlias":"noRelativeImports",data:{alias:s?.alias},fix:s?u=>u.replaceText(i.source,`'${s.newPath}'`):void 0})}}}}),tn={name:kr,rule:ns};var de=require("@typescript-eslint/utils"),nn=require("zod/v4");var rs=nn.z.object({customMessage:nn.z.string().optional()}),rn=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(rs)],messages:{noStaticStyleProp:"Static style props are not allowed use css instead.{{customMessage}}"}},defaultOptions:[{}],create(e,[t]){function r(n){switch(n.type){case de.AST_NODE_TYPES.Literal:return!0;case de.AST_NODE_TYPES.ObjectExpression:return n.properties.every(o=>o.type===de.AST_NODE_TYPES.Property?o.computed||o.value.type===de.AST_NODE_TYPES.Identifier&&o.key.type===de.AST_NODE_TYPES.Identifier&&o.key.name===o.value.name?!1:r(o.value):!1);case de.AST_NODE_TYPES.ArrayExpression:return n.elements.every(o=>o?o.type===de.AST_NODE_TYPES.SpreadElement?!1:r(o):!0);case de.AST_NODE_TYPES.TemplateLiteral:return n.expressions.length===0;case de.AST_NODE_TYPES.ConditionalExpression:case de.AST_NODE_TYPES.LogicalExpression:case de.AST_NODE_TYPES.BinaryExpression:case de.AST_NODE_TYPES.UnaryExpression:case de.AST_NODE_TYPES.CallExpression:case de.AST_NODE_TYPES.MemberExpression:case de.AST_NODE_TYPES.Identifier:case de.AST_NODE_TYPES.ArrowFunctionExpression:case de.AST_NODE_TYPES.FunctionExpression:return!1;default:return!1}}return{JSXAttribute(n){if(n.name.type===de.AST_NODE_TYPES.JSXIdentifier&&n.name.name==="style"&&n.value){let o=null;n.value.type===de.AST_NODE_TYPES.JSXExpressionContainer?n.value.expression.type!==de.AST_NODE_TYPES.JSXEmptyExpression&&(o=n.value.expression):n.value.type===de.AST_NODE_TYPES.Literal&&(o=n.value),o&&r(o)&&e.report({node:n,messageId:"noStaticStyleProp",data:{customMessage:t.customMessage?` ${t.customMessage}`:""}})}}}}});var mt=require("@typescript-eslint/utils"),Ke=Pe(require("zod/v4"));var is=Ke.object({alternativeMsgs:Ke.object({inArrayFind:Ke.string().optional(),inArrayFilter:Ke.string().optional()}).optional(),__dev_simulateFileName:Ke.string().optional()});function os(e){return e.typeAnnotation.type!==mt.AST_NODE_TYPES.TSTypePredicate?!1:e.typeAnnotation.asserts===!1}var ss=/(typeGuards|type-guards)\.(ts|tsx)$/;function as(e){return ss.test(e)}function ls(e){let t=e.parent;for(;t;){if(t.type===mt.AST_NODE_TYPES.CallExpression&&t.callee.type===mt.AST_NODE_TYPES.MemberExpression&&t.callee.property.type===mt.AST_NODE_TYPES.Identifier){let r=t.callee.property.name;if(r==="filter"||r==="find")return{method:r}}t=t.parent}return null}var on=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(is)],hasSuggestions:!0},defaultOptions:[{}],create(e,[t]){let r=t.__dev_simulateFileName??e.filename;if(as(r))return{};function n(o){if(!os(o))return;let p=ls(o);if(t.alternativeMsgs&&p){let i=p.method==="filter"?t.alternativeMsgs.inArrayFilter:t.alternativeMsgs.inArrayFind;if(i){let a=p.method==="filter"?"useFilterWithTypeCheck":"useFindWithTypeCheck";e.report({node:o,messageId:a,data:{message:i}});return}}e.report({node:o,messageId:"typeGuardNotAllowed"})}return{"FunctionDeclaration > :matches(TSTypeAnnotation)":n,"ArrowFunctionExpression > :matches(TSTypeAnnotation)":n,"MethodDefinition > FunctionExpression > :matches(TSTypeAnnotation)":n}}});var Qe=require("@typescript-eslint/utils");var ps="no-unnecessary-async-on-jsx-props";function cs(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 sn=X({name:ps,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){cs(r)&&e.report({node:r,messageId:"unnecessaryAsyncInJsxProp",fix(n){let o=e.sourceCode,p=[],i=o.getFirstToken(r,l=>l.value==="async");if(i){let l=o.getTokenAfter(i);l?p.push(n.replaceTextRange([i.range[0],l.range[0]],"")):p.push(n.remove(i))}function a(l){if(l.type===Qe.AST_NODE_TYPES.AwaitExpression){let s=o.getFirstToken(l);if(s&&s.value==="await"){let u=o.getTokenAfter(s);u?p.push(n.replaceTextRange([s.range[0],u.range[0]],"")):p.push(n.remove(s))}}if(l.type===Qe.AST_NODE_TYPES.BlockStatement)for(let s of l.body)a(s);else l.type===Qe.AST_NODE_TYPES.ExpressionStatement&&a(l.expression)}return a(r.body),p}})}return{"JSXAttribute ArrowFunctionExpression[async=true]":t,"JSXAttribute FunctionExpression[async=true]":t}}});var Je=require("@typescript-eslint/utils"),an=Pe(require("typescript")),it=Pe(require("zod/v4"));var us=Je.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),Pr="no-unnecessary-casting",fs=it.default.object({additionalCastFunctions:it.default.array(it.default.object({name:it.default.string(),expectedType:it.default.enum(["string","number"])})).optional()}),ln={name:Pr,rule:us({name:Pr,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(fs)],fixable:"code"},defaultOptions:[{}],create(e){let r=e.options[0].additionalCastFunctions||[],n=[{name:"Number",expectedType:"number"},{name:"String",expectedType:"string"},...r],o=Je.ESLintUtils.getParserServices(e,!0),p=o.program?.getTypeChecker();if(!p||!o.program)throw new Error("TypeScript services or program not available");function i(u,f){switch(u.type){case Je.AST_NODE_TYPES.Literal:return f==="number"?typeof u.value=="number":typeof u.value=="string";case Je.AST_NODE_TYPES.TemplateLiteral:return f==="string";case Je.AST_NODE_TYPES.UnaryExpression:return f==="number"?u.operator==="+"||u.operator==="-"||u.operator==="~":!1;default:return!1}}function a(u,f){return f==="number"?!!(u.flags&an.TypeFlags.NumberLike):!!(u.flags&an.TypeFlags.StringLike)}function l(u,f){return y=>y.replaceText(u,e.sourceCode.getText(f))}function s(u){if(!p||u.arguments.length!==1)return;let f=u.arguments[0];if(!f||f.type===Je.AST_NODE_TYPES.SpreadElement)return;let{callee:y}=u;if(y.type!==Je.AST_NODE_TYPES.Identifier)return;let x=y.name,m=n.find(C=>C.name===x);if(!m)return;if(i(f,m.expectedType)||a(p.getTypeAtLocation(o.esTreeNodeToTSNodeMap.get(f)),m.expectedType)){let C,T;x==="Number"?C="unnecessaryNumberCasting":x==="String"?C="unnecessaryStringCasting":(C="unnecessaryCustomCasting",T={name:m.name,type:m.expectedType}),e.report({node:u,messageId:C,...T?{data:T}:{},fix:l(u,f)})}}return{CallExpression:s}}})};var Fe=require("@typescript-eslint/utils"),wt=Pe(require("zod/v4"));var ms=wt.object({ignoreWithDescription:wt.string().optional()}),pn=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(ms)]},defaultOptions:[{}],create(e,[t]){let r=e.getSourceCode(),n=r.ast;function o(l){let s=l.arguments[0];return s&&s.type===Fe.AST_NODE_TYPES.Literal&&typeof s.value=="string"?s.value:null}function p(l){return!l||!t.ignoreWithDescription?!1:new RegExp(t.ignoreWithDescription).test(l)}function i(l){return l.length!==1?!1:n.body.filter(u=>{if(u.type===Fe.AST_NODE_TYPES.ExpressionStatement){let f=u.expression;if(f.type===Fe.AST_NODE_TYPES.CallExpression&&f.callee.type===Fe.AST_NODE_TYPES.Identifier){let y=f.callee.name;return["test","it","beforeEach","afterEach","beforeAll","afterAll"].includes(y)}}return!1}).length===0}function a(l){let s=l.arguments[1];if(s&&(s.type===Fe.AST_NODE_TYPES.FunctionExpression||s.type===Fe.AST_NODE_TYPES.ArrowFunctionExpression)&&s.body.type===Fe.AST_NODE_TYPES.BlockStatement){let u=s.body.body;return u.length===0?"":u.map(y=>r.text.slice(y.range[0],y.range[1])).join(`
16
16
 
17
17
  `)}return""}return{Program(){let l=[];for(let y of n.body)y.type===Fe.AST_NODE_TYPES.ExpressionStatement&&y.expression.type===Fe.AST_NODE_TYPES.CallExpression&&y.expression.callee.type===Fe.AST_NODE_TYPES.Identifier&&y.expression.callee.name==="describe"&&y.expression.arguments.length===2&&l.push(y.expression);if(!i(l))return;let[s]=l;if(!s)return;let u=o(s);if(p(u))return;let f=n.body.find(y=>y.type===Fe.AST_NODE_TYPES.ExpressionStatement&&y.expression===s);!f||f.type!==Fe.AST_NODE_TYPES.ExpressionStatement||e.report({node:s,messageId:"unnecessaryDescribe",suggest:[{messageId:"removeDescribe",fix(y){let x=a(s);return x?y.replaceText(f,x):null}}]})}}}});var yt=require("@typescript-eslint/utils"),Le=Pe(require("zod/v4"));var ys=Le.object({methods:Le.union([Le.array(Le.string()),Le.literal("array")])}),cn=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(ys)]},defaultOptions:[{methods:"array"}],create(e,[t]){let r=t.methods,n=new Set(["find","filter","map","forEach","some","every","reduce","findIndex","sort"]);function o(a){return Array.isArray(r)?r.includes(a):n.has(a)}function p(a){let{callee:l}=a;if(l.type===yt.AST_NODE_TYPES.MemberExpression){let s=l.property;if(s.type===yt.AST_NODE_TYPES.Identifier)return s.name}return null}function i(a,l){if(a.type!==yt.AST_NODE_TYPES.Identifier||!a.typeAnnotation)return;let s=l.parent;if(s.type===yt.AST_NODE_TYPES.CallExpression){let u=p(s);u&&o(u)&&s.arguments.indexOf(l)===0&&e.report({node:a.typeAnnotation,messageId:"unnecessaryTypeAnnotation",fix(y){return a.typeAnnotation?y.remove(a.typeAnnotation):null}})}}return{ArrowFunctionExpression(a){for(let l of a.params)i(l,a)},FunctionExpression(a){for(let l of a.params)i(l,a)}}}});var Ae=require("@typescript-eslint/utils");var un=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===Ae.AST_NODE_TYPES.ObjectPattern||!t.init||t.init.type!==Ae.AST_NODE_TYPES.ObjectExpression||t.id.type===Ae.AST_NODE_TYPES.Identifier&&t.id.typeAnnotation||t.parent.parent.type===Ae.AST_NODE_TYPES.ExportNamedDeclaration)return;let r=new Map;for(let i of t.init.properties)i.type===Ae.AST_NODE_TYPES.Property&&i.key.type===Ae.AST_NODE_TYPES.Identifier&&r.set(i.key.name,i);if(r.size===0||t.id.type!==Ae.AST_NODE_TYPES.Identifier)return;let n=ds(t,e.sourceCode);if(n.length===0)return;let o=t.init.properties.some(i=>i.type!==Ae.AST_NODE_TYPES.Property?!1:i.value.type===Ae.AST_NODE_TYPES.FunctionExpression),p=new Set;for(let i of n){if(i.identifier.parent.type!==Ae.AST_NODE_TYPES.MemberExpression)return;let a=i.identifier.parent;if(a.object!==i.identifier)return;if(a.computed)if(a.property.type===Ae.AST_NODE_TYPES.Literal&&typeof a.property.value=="string")p.add(a.property.value);else return;else{if(a.property.type!==Ae.AST_NODE_TYPES.Identifier)return;p.add(a.property.name)}if(a.parent.type===Ae.AST_NODE_TYPES.CallExpression&&o)return}for(let[i,a]of r)p.has(i)||e.report({node:a,messageId:"unusedObjectProperty",data:{name:i}})}}}});function ds(e,t){let r=t.getDeclaredVariables(e);if(r.length!==1)return[];let n=r[0];return n?n.references.filter(o=>o.identifier!==e.id):[]}var te=require("@typescript-eslint/utils"),fn=require("zod/v4");var gs=fn.z.object({ignoreArgsMatching:fn.z.string().optional()}),mn=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(gs)]},defaultOptions:[{}],create(e,[t]){let r=[];function n(i){return t.ignoreArgsMatching?new RegExp(t.ignoreArgsMatching).test(i):!1}function o(i){return i.type===te.AST_NODE_TYPES.ExportNamedDeclaration||i.type===te.AST_NODE_TYPES.ExportDefaultDeclaration||i.parent?.type===te.AST_NODE_TYPES.ExportNamedDeclaration||i.parent?.type===te.AST_NODE_TYPES.ExportDefaultDeclaration}function p(i){let a=[];for(let l=0;l<i.length;l++){let s=i[l];if(!s||s.type!==te.AST_NODE_TYPES.Identifier)continue;let u=s.name;if(!n(u)){if(s.optional&&s.typeAnnotation&&s.typeAnnotation.typeAnnotation.type===te.AST_NODE_TYPES.TSTypeLiteral){let f=s.typeAnnotation.typeAnnotation,y=[];for(let x of f.members)x.type===te.AST_NODE_TYPES.TSPropertySignature&&x.key.type===te.AST_NODE_TYPES.Identifier&&y.push({name:x.key.name,optional:x.optional===!0});y.some(x=>x.optional)?a.push({param:s,index:l,name:u,isObjectParam:!0,objectProps:y}):a.push({param:s,index:l,name:u,isObjectParam:!1})}else if(s.optional)a.push({param:s,index:l,name:u,isObjectParam:!1});else if(s.typeAnnotation&&s.typeAnnotation.typeAnnotation.type===te.AST_NODE_TYPES.TSTypeLiteral){let f=s.typeAnnotation.typeAnnotation,y=[];for(let x of f.members)x.type===te.AST_NODE_TYPES.TSPropertySignature&&x.key.type===te.AST_NODE_TYPES.Identifier&&y.push({name:x.key.name,optional:x.optional===!0});y.some(x=>x.optional)&&a.push({param:s,index:l,name:u,isObjectParam:!0,objectProps:y})}}}return a}return{FunctionDeclaration(i){if(o(i))return;let a=p(i.params);a.length!==0&&r.push({node:i,declarationNode:i,optionalParams:a})},VariableDeclarator(i){if(i.id.type!==te.AST_NODE_TYPES.Identifier||!i.init||i.init.type!==te.AST_NODE_TYPES.ArrowFunctionExpression&&i.init.type!==te.AST_NODE_TYPES.FunctionExpression||o(i.parent.parent))return;let l=[...p(i.init.params)];if(i.id.typeAnnotation&&i.id.typeAnnotation.typeAnnotation.type===te.AST_NODE_TYPES.TSTypeReference){let s=i.id.typeAnnotation.typeAnnotation;if(s.typeName.type===te.AST_NODE_TYPES.Identifier&&s.typeName.name==="FC"){let u=s.typeArguments;if(u&&u.params.length===1){let f=u.params[0];if(f&&f.type===te.AST_NODE_TYPES.TSTypeLiteral){let y=[];for(let x of f.members)x.type===te.AST_NODE_TYPES.TSPropertySignature&&x.key.type===te.AST_NODE_TYPES.Identifier&&y.push({name:x.key.name,optional:x.optional===!0});y.some(x=>x.optional)&&l.push({param:i.id,index:0,name:"props",isObjectParam:!0,objectProps:y})}}}}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 s=l.references.filter(y=>y.identifier!==l.identifiers[0]);if(s.length===0)continue;let u=!1;for(let y of s){let x=y.identifier.parent;if(x.type===te.AST_NODE_TYPES.CallExpression&&y.identifier.type===te.AST_NODE_TYPES.Identifier&&x.arguments.includes(y.identifier)){u=!0;break}if(x.type===te.AST_NODE_TYPES.ReturnStatement){u=!0;break}if(x.type===te.AST_NODE_TYPES.Property&&x.parent.type===te.AST_NODE_TYPES.ObjectExpression&&x.parent.parent.type===te.AST_NODE_TYPES.ReturnStatement){u=!0;break}if(x.type===te.AST_NODE_TYPES.JSXExpressionContainer){u=!0;break}}if(u)continue;let f=[];for(let y of s){let x=y.identifier.parent;if(x.type===te.AST_NODE_TYPES.CallExpression&&x.callee===y.identifier){let m=x.arguments.length,E=x.arguments.some(T=>T.type===te.AST_NODE_TYPES.SpreadElement);if(E){u=!0;break}let C={argCount:m,hasSpread:E};for(let T of i.optionalParams)if(T.isObjectParam&&T.index<m){let I=x.arguments[T.index];if(I?.type===te.AST_NODE_TYPES.ObjectExpression){let A={};for(let S of I.properties)S.type===te.AST_NODE_TYPES.Property&&S.key.type===te.AST_NODE_TYPES.Identifier&&(A[S.key.name]=!0);C.objectArgs||(C.objectArgs=[]),C.objectArgs[T.index]=A}else if(I){u=!0;break}}f.push(C)}else if(x.type===te.AST_NODE_TYPES.JSXOpeningElement&&x.name===y.identifier){let m=x.attributes.some(C=>C.type===te.AST_NODE_TYPES.JSXSpreadAttribute);if(m){u=!0;break}let E={argCount:1,hasSpread:m};for(let C of i.optionalParams)if(C.isObjectParam&&C.index===0){let T={};for(let I of x.attributes)I.type===te.AST_NODE_TYPES.JSXAttribute&&I.name.type===te.AST_NODE_TYPES.JSXIdentifier&&(T[I.name.name]=!0);E.objectArgs||(E.objectArgs=[]),E.objectArgs[0]=T}f.push(E)}}if(!(u||f.length===0))for(let y of i.optionalParams)if(y.isObjectParam&&y.objectProps)for(let x of y.objectProps){if(!x.optional)continue;let m=!1;for(let E of f)if(E.objectArgs&&E.objectArgs[y.index]){let C=E.objectArgs[y.index];if(C&&C[x.name]){m=!0;break}}m||e.report({node:y.param,messageId:"unusedOptionalProp",data:{name:x.name}})}else{let x=!1;for(let m of f)if(m.argCount>y.index){x=!0;break}x||e.report({node:y.param,messageId:"unusedOptionalArg",data:{name:y.name}})}}}}}});var le=require("@typescript-eslint/utils"),qe=require("zod/v4");var Ss=qe.z.object({selectors:qe.z.array(qe.z.object({name:qe.z.string(),selectorProp:qe.z.string().optional(),selectorArgPos:qe.z.number().optional(),returnProp:qe.z.string().optional()}))}),Ts=le.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),Nr="no-unused-selected-values",yn={name:Nr,rule:Ts({name:Nr,meta:{type:"suggestion",docs:{description:"Disallow unused values in selector objects"},messages:{unusedSelectedValue:'The selected value "{{name}}" is not being used'},schema:[J(Ss)]},defaultOptions:[{selectors:[]}],create(e,[t]){let{selectors:r=[]}=t,n=new Map(r.map(o=>[o.name,o]));return{VariableDeclarator(o){let p=null;if(o.init?.type===le.AST_NODE_TYPES.CallExpression&&(p=o.init),!p)return;let i=Es(p);if(!i)return;let a=n.get(i);if(!a)return;let l=hs(p,a.selectorArgPos??0,a.selectorProp);if(!l)return;let s=bs(l);if(!s)return;let u=Or(s.properties,void 0);if(!u)return;if(o.id.type===le.AST_NODE_TYPES.ObjectPattern){let x=Or(o.id.properties,a.returnProp);if(!x)return;for(let[m,E]of u)x.has(m)||e.report({node:E,messageId:"unusedSelectedValue",data:{name:m}});return}if(o.id.type!==le.AST_NODE_TYPES.Identifier||a.returnProp)return;let f=xs(o,e.sourceCode);if(f.length===0)return;let y=new Set;for(let x of f){if(x.identifier.parent.type!==le.AST_NODE_TYPES.MemberExpression)return;let m=x.identifier.parent.property;if(m.type!==le.AST_NODE_TYPES.Identifier)return;y.add(m.name)}for(let[x,m]of u)y.has(x)||e.report({node:m,messageId:"unusedSelectedValue",data:{name:x}})}}}})};function hs(e,t,r){let n=e.arguments[t];if(!n)return null;if(n.type===le.AST_NODE_TYPES.ArrowFunctionExpression||n.type===le.AST_NODE_TYPES.FunctionExpression)return n;if(r&&n.type===le.AST_NODE_TYPES.ObjectExpression){let o=n.properties.find(i=>i.type===le.AST_NODE_TYPES.Property&&i.key.type===le.AST_NODE_TYPES.Identifier&&i.key.name===r);if(o?.type!==le.AST_NODE_TYPES.Property)return null;let p=o.value;if(p.type===le.AST_NODE_TYPES.ArrowFunctionExpression||p.type===le.AST_NODE_TYPES.FunctionExpression)return p}return null}function Es(e){return e.callee.type===le.AST_NODE_TYPES.Identifier?e.callee.name:e.callee.type===le.AST_NODE_TYPES.MemberExpression&&e.callee.property.type===le.AST_NODE_TYPES.Identifier?e.callee.property.name:null}function bs(e){if(e.body.type===le.AST_NODE_TYPES.ObjectExpression)return e.body;if(e.body.type===le.AST_NODE_TYPES.BlockStatement){let t=e.body.body.filter(r=>r.type===le.AST_NODE_TYPES.ReturnStatement);return t.length!==1||!t[0]||t[0].argument?.type!==le.AST_NODE_TYPES.ObjectExpression?null:t[0].argument}return null}function Or(e,t){let r=e;if(t){let o=e.find(p=>p.type===le.AST_NODE_TYPES.Property&&p.key.type===le.AST_NODE_TYPES.Identifier&&p.key.name===t);if(o?.type!==le.AST_NODE_TYPES.Property||o.value.type!==le.AST_NODE_TYPES.ObjectPattern)return null;r=o.value.properties}let n=new Map;for(let o of r){if(o.type!==le.AST_NODE_TYPES.Property||o.key.type!==le.AST_NODE_TYPES.Identifier)return null;n.set(o.key.name,o)}return n.size>0?n:null}function xs(e,t){let r=t.getDeclaredVariables(e);if(r.length!==1)return[];let n=r[0];return n?n.references.filter(o=>o.identifier!==e.id):[]}var pe=require("@typescript-eslint/utils");var dn=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(p=>p.type===pe.AST_NODE_TYPES.ImportDeclaration&&p.source.value==="t-state-form"))return{};let n=null,o=!1;return{CallExpression(p){if(o)return;if(!n){let a=Cs(p);a&&(n=a);return}let i=Is(p,e.sourceCode);if(i){o=!0;for(let a of i)n.delete(a);if(n.size!==0)for(let[a,l]of n)e.report({node:l,messageId:"unusedField",data:{name:a}})}}}}});function Cs(e){if(!(e.callee.type===pe.AST_NODE_TYPES.Identifier&&e.callee.name==="useForm"))return null;let r=e.arguments[0];if(!r||r.type!==pe.AST_NODE_TYPES.ObjectExpression)return null;let n=Xt(r.properties,p=>p.type!==pe.AST_NODE_TYPES.Property||p.key.type!==pe.AST_NODE_TYPES.Identifier||p.key.name!=="initialConfig"?null:p.value.type===pe.AST_NODE_TYPES.ObjectExpression?p.value:p.value.type===pe.AST_NODE_TYPES.ArrowFunctionExpression||p.value.type===pe.AST_NODE_TYPES.FunctionExpression?As(p.value):null);if(!n)return null;let o=new Map;for(let p of n.properties)p.type===pe.AST_NODE_TYPES.Property&&p.key.type===pe.AST_NODE_TYPES.Identifier&&o.set(p.key.name,p);return o}function Is(e,t){if(!(e.callee.type===pe.AST_NODE_TYPES.Identifier&&e.callee.name==="useFormState")||e.parent.type!==pe.AST_NODE_TYPES.VariableDeclarator||e.parent.id.type!==pe.AST_NODE_TYPES.ObjectPattern||!Xt(e.parent.id.properties,i=>i.type===pe.AST_NODE_TYPES.Property&&i.key.type===pe.AST_NODE_TYPES.Identifier&&i.key.name==="formFields"&&i))return null;let o=yr(e.parent,"formFields",t),p=new Set;for(let{identifier:i}of o){if(i.type!==pe.AST_NODE_TYPES.Identifier||i.parent.type===pe.AST_NODE_TYPES.Property&&i.parent.parent.type===pe.AST_NODE_TYPES.ObjectExpression&&i.parent.parent.parent.type===pe.AST_NODE_TYPES.ReturnStatement||i.parent.type===pe.AST_NODE_TYPES.ReturnStatement)return null;if(i.parent.type===pe.AST_NODE_TYPES.MemberExpression){if(i.parent.object.type!==pe.AST_NODE_TYPES.Identifier||i.parent.property.type!==pe.AST_NODE_TYPES.Identifier)return null;p.add(i.parent.property.name)}}return p}function As(e){if(e.body.type===pe.AST_NODE_TYPES.ObjectExpression)return e.body;if(e.body.type===pe.AST_NODE_TYPES.BlockStatement){let t=e.body.body.filter(r=>r.type===pe.AST_NODE_TYPES.ReturnStatement);return t.length!==1||!t[0]||t[0].argument?.type!==pe.AST_NODE_TYPES.ObjectExpression?null:t[0].argument}return null}var oe=require("@typescript-eslint/utils"),dt=require("zod/v4");var ws=oe.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`);function Dr(e){let t=[];for(let r of e.members)r.type===oe.AST_NODE_TYPES.TSPropertySignature&&r.key.type===oe.AST_NODE_TYPES.Identifier&&t.push([r.key.name,r]);return t}function jr(e,...t){for(let r of t)e.set(...r);return e}var Fs=dt.z.object({forceCheckOnFCPropTypesWithName:dt.z.array(dt.z.string()).optional(),alwaysCheckFunctionOptionTypes:dt.z.boolean().optional()}),Lr="no-unused-type-props-in-args",gn=null,Rs=ws({name:Lr,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(Fs)],fixable:"code"},defaultOptions:[{alwaysCheckFunctionOptionTypes:!0}],create(e,[t]){let{forceCheckOnFCPropTypesWithName:r,alwaysCheckFunctionOptionTypes:n=!0}=t;r&&!gn&&(gn=r.map(l=>new RegExp(l)));function o(l,s,u,f,y=!0,x=!1){let m=u.name,E=e.sourceCode.getScope(s).references.find(S=>S.identifier.name===m)?.resolved,C=l&&gn?.some(S=>S.test(m)),T=x&&n;if(!E||!C&&E.references.filter(S=>S.isTypeReference).length>1||!E.defs[0])return;let I=E.defs[0].node,A=I.parent?.type===oe.AST_NODE_TYPES.ExportNamedDeclaration;if(!(y&&A&&!T)){if(I.type===oe.AST_NODE_TYPES.TSTypeAliasDeclaration){p(l,s,f,I.typeAnnotation,!0,x);return}if(I.type===oe.AST_NODE_TYPES.TSInterfaceDeclaration){p(l,s,f,I.body,!0,x);return}}}function p(l,s,u,f,y,x=!1){if(f.type===oe.AST_NODE_TYPES.TSInterfaceBody){for(let m of f.body)m.type===oe.AST_NODE_TYPES.TSPropertySignature&&m.key.type===oe.AST_NODE_TYPES.Identifier&&u.set(m.key.name,m);return}if(f.type===oe.AST_NODE_TYPES.TSTypeLiteral){jr(u,...Dr(f));return}if(f.type===oe.AST_NODE_TYPES.TSIntersectionType){for(let m of f.types)p(l,s,u,m,!0,x);return}y||f.type===oe.AST_NODE_TYPES.TSTypeReference&&f.typeName.type===oe.AST_NODE_TYPES.Identifier&&o(l,s,f.typeName,u,!0,x)}function i(l,s,u,f=!1){for(let y of u)if(y.type===oe.AST_NODE_TYPES.ObjectPattern&&y.typeAnnotation){let x=new Map;if(p(l,s,x,y.typeAnnotation.typeAnnotation,!1,f),x.size===0)continue;a(y,x)}else y.type===oe.AST_NODE_TYPES.AssignmentPattern&&y.left.type===oe.AST_NODE_TYPES.ObjectPattern&&i(l,s,[y.left],f)}function a(l,s){let u=[];if(l.properties.at(-1)?.type===oe.AST_NODE_TYPES.RestElement)return;for(let m of l.properties)m.type===oe.AST_NODE_TYPES.Property&&m.key.type===oe.AST_NODE_TYPES.Identifier&&u.push(m.key.name);let y=[],x=[];for(let[m,E]of s)u.includes(m)||(x.push(m),y.push({node:E,messageId:"unusedObjectTypeProperty",data:{propertyName:m}}));for(let[m,E]of y.entries())e.report({...E,fix:m===y.length-1?C=>{let T=l.properties.at(-1),I=x.join(", ");return T?T.type===oe.AST_NODE_TYPES.RestElement?null:C.insertTextAfter(T,`, ${I}`):C.insertTextBeforeRange([l.range[0]+1,l.range[1]],I)}:void 0})}return{VariableDeclaration(l){let s=l.declarations[0],u=new Map,f=s.id.type===oe.AST_NODE_TYPES.Identifier&&s.id.typeAnnotation?.typeAnnotation.type===oe.AST_NODE_TYPES.TSTypeReference&&s.id.typeAnnotation.typeAnnotation.typeName.type===oe.AST_NODE_TYPES.Identifier&&s.id.typeAnnotation.typeAnnotation.typeName.name==="FC"&&s.id.typeAnnotation.typeAnnotation.typeArguments?.params[0];if(f){if(f.type===oe.AST_NODE_TYPES.TSTypeReference&&f.typeName.type===oe.AST_NODE_TYPES.Identifier)o(!0,l,f.typeName,u,!1);else if(f.type===oe.AST_NODE_TYPES.TSTypeLiteral)jr(u,...Dr(f));else if(f.type===oe.AST_NODE_TYPES.TSIntersectionType)for(let y of f.types)y.type===oe.AST_NODE_TYPES.TSTypeReference&&y.typeName.type===oe.AST_NODE_TYPES.Identifier?o(!0,l,y.typeName,u,!1):p(!0,l,u,y,!0);if(u.size!==0&&s.init?.type===oe.AST_NODE_TYPES.ArrowFunctionExpression){let y=s.init.params[0];if(!y){e.report({node:s.init,messageId:"missingComponentParam"});return}y.type===oe.AST_NODE_TYPES.ObjectPattern&&a(y,u)}}},FunctionDeclaration(l){i(!1,l,l.params,n)},ArrowFunctionExpression(l){i(!1,l,l.params,n)}}}}),Sn={name:Lr,rule:Rs};var Ne=require("@typescript-eslint/utils");var Tn=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===Ne.AST_NODE_TYPES.Identifier?t.has(n.callee.name):n.callee.type===Ne.AST_NODE_TYPES.MemberExpression&&n.callee.object.type===Ne.AST_NODE_TYPES.Identifier&&n.callee.property.type===Ne.AST_NODE_TYPES.Identifier?n.callee.property.name==="useRef":!1}return{ImportDeclaration(n){if(n.source.value==="react")for(let o of n.specifiers)o.type===Ne.AST_NODE_TYPES.ImportSpecifier&&o.imported.type===Ne.AST_NODE_TYPES.Identifier&&o.imported.name==="useRef"&&t.add(o.local.name)},VariableDeclarator(n){if(n.init&&n.init.type===Ne.AST_NODE_TYPES.CallExpression&&r(n.init)&&n.id.type===Ne.AST_NODE_TYPES.Identifier){let p=e.sourceCode.getScope(n).set.get(n.id.name);if(p){let i=!1;for(let a of p.references){let s=a.identifier.parent;if(s!==n&&!(s.type===Ne.AST_NODE_TYPES.JSXExpressionContainer&&s.parent.type===Ne.AST_NODE_TYPES.JSXAttribute&&s.parent.name.type===Ne.AST_NODE_TYPES.JSXIdentifier&&s.parent.name.name==="ref")){i=!0;break}}i||e.report({node:n.id,messageId:"refNotRead",data:{name:n.id.name}})}}}}}});var ot=require("@typescript-eslint/utils"),vs=ot.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),_r="prefer-named-functions",Mr=new Map,ks=vs({name:_r,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=Mr.get(t.ignoreRegex);n?r=n:(r=new RegExp(t.ignoreRegex),Mr.set(t.ignoreRegex,r))}return{VariableDeclarator(n){if(n.init&&n.init.type===ot.AST_NODE_TYPES.ArrowFunctionExpression&&n.id.type===ot.AST_NODE_TYPES.Identifier){let o=n.id.name;if(n.id.typeAnnotation||r&&r.test(o)||!t.disallowArrowFnWithImplicitReturns&&n.init.body.type!==ot.AST_NODE_TYPES.BlockStatement)return;let p=n.parent,i=n.init.params,a=n.init.body,l=n.init;e.report({node:n.id,messageId:r?"withIgnoreRegex":"default",data:{functionName:o,ignoreRegex:t.ignoreRegex},suggest:[{messageId:"suggestion",fix:s=>s.replaceText(p,`${l.async?"async ":""}function ${o}(${i.map(u=>e.sourceCode.getText(u)).join(", ")||""}) ${e.sourceCode.getText(a)}`)}]})}}}}}),hn={name:_r,rule:ks};var Q=require("@typescript-eslint/utils"),Me=require("zod/v4");var Ps=Me.z.object({disallowedFunctions:Me.z.array(Me.z.object({name:Me.z.string(),allowUsingWithArgs:Me.z.boolean().optional(),hookAlternative:Me.z.string().optional(),message:Me.z.string().optional(),allowUseInside:Me.z.array(Me.z.string()).optional()}))}),Ns=/^use[A-Z]/,Os=/^[A-Z]/;function Ft(e){return Ns.test(e)}function $r(e){return Os.test(e)}function Ds(e){return e.type===Q.AST_NODE_TYPES.Identifier?Ft(e.name):e.type===Q.AST_NODE_TYPES.MemberExpression&&e.property.type===Q.AST_NODE_TYPES.Identifier?Ft(e.property.name):!1}function Ur(e,t){return e.type===Q.AST_NODE_TYPES.Identifier?e.name===t:e.type===Q.AST_NODE_TYPES.MemberExpression&&e.object.type===Q.AST_NODE_TYPES.Identifier&&e.property.type===Q.AST_NODE_TYPES.Identifier?e.object.name==="React"&&e.property.name===t:!1}function zr(e){return!!(e.parent&&e.parent.type===Q.AST_NODE_TYPES.CallExpression&&Ur(e.parent.callee,"forwardRef"))}function Wr(e){return!!(e.parent&&e.parent.type===Q.AST_NODE_TYPES.CallExpression&&Ur(e.parent.callee,"memo"))}function En(e){if(e.type===Q.AST_NODE_TYPES.FunctionDeclaration||e.type===Q.AST_NODE_TYPES.FunctionExpression&&e.id)return e.id||void 0;if(e.type===Q.AST_NODE_TYPES.FunctionExpression||e.type===Q.AST_NODE_TYPES.ArrowFunctionExpression){if(e.parent.type===Q.AST_NODE_TYPES.VariableDeclarator&&e.parent.init===e)return e.parent.id;if(e.parent.type===Q.AST_NODE_TYPES.AssignmentExpression&&e.parent.right===e&&e.parent.operator==="=")return e.parent.left;if(e.parent.type===Q.AST_NODE_TYPES.Property&&e.parent.value===e&&!e.parent.computed)return e.parent.key;if(e.parent.type===Q.AST_NODE_TYPES.AssignmentPattern&&e.parent.right===e)return e.parent.left}}function js(e){let t=e.parent,r=!1;for(;t;){if(t.type===Q.AST_NODE_TYPES.FunctionDeclaration||t.type===Q.AST_NODE_TYPES.FunctionExpression||t.type===Q.AST_NODE_TYPES.ArrowFunctionExpression){let n=En(t);if(n&&n.type===Q.AST_NODE_TYPES.Identifier){if($r(n.name)||Ft(n.name))return!r;r=!0}else{if(zr(t)||Wr(t))return!r;if(t.parent.type===Q.AST_NODE_TYPES.CallExpression){let o=t.parent;Ds(o.callee)||(r=!0)}else t.parent.type===Q.AST_NODE_TYPES.JSXExpressionContainer||(r=!0)}}t=t.parent}return!1}function Jr(e){return e.callee.type===Q.AST_NODE_TYPES.Identifier?e.callee.name:e.callee.type===Q.AST_NODE_TYPES.MemberExpression&&e.callee.property.type===Q.AST_NODE_TYPES.Identifier?e.callee.property.name:null}function Ls(e,t){if(!t.length)return!1;let r=e.parent;for(;r;){if(r.type===Q.AST_NODE_TYPES.FunctionDeclaration||r.type===Q.AST_NODE_TYPES.FunctionExpression||r.type===Q.AST_NODE_TYPES.ArrowFunctionExpression){let n=En(r);if(n&&n.type===Q.AST_NODE_TYPES.Identifier&&t.includes(n.name))return!0}else if(r.type===Q.AST_NODE_TYPES.CallExpression){let n=Jr(r);if(n&&t.includes(n))return!0}r=r.parent}return!1}function Ms(e){return e.arguments.length>0&&!e.arguments.every(t=>t.type===Q.AST_NODE_TYPES.Identifier&&t.name==="undefined")}function _s(e,t){let r=!1,n=e.parent;for(;n;){if(n.type===Q.AST_NODE_TYPES.FunctionDeclaration||n.type===Q.AST_NODE_TYPES.FunctionExpression||n.type===Q.AST_NODE_TYPES.ArrowFunctionExpression){let o=En(n);if(o&&o.type===Q.AST_NODE_TYPES.Identifier){if($r(o.name)||Ft(o.name)){r=!0;break}}else if(zr(n)||Wr(n)){r=!0;break}}n=n.parent}return r?t.length===0?js(e):!Ls(e,t):!1}var bn=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(o=>[o.name,o]));return{CallExpression(o){let p=Jr(o);if(!p)return;let i=n.get(p);if(!i||i.allowUsingWithArgs&&Ms(o))return;let a=i.allowUseInside||[];_s(o,a)&&e.report({node:o,messageId:"preferHookAlternative",data:{message:i.message?` ${i.message}`:` use ${i.hookAlternative} instead`},suggest:i.hookAlternative?[{messageId:"preferHookAlternative",data:{message:`Replace with ${i.hookAlternative}`,hookAlternative:i.hookAlternative},fix:l=>{let s=i.hookAlternative;return s?o.callee.type===Q.AST_NODE_TYPES.Identifier?l.replaceText(o.callee,s):o.callee.type===Q.AST_NODE_TYPES.MemberExpression&&o.callee.property.type===Q.AST_NODE_TYPES.Identifier?l.replaceText(o.callee.property,s):null:null}}]:[]})}}}});var ce=require("@typescript-eslint/utils"),Rt=Pe(require("zod/v4"));var $s=ce.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),Xr="prefer-single-line-if",Us=Rt.default.object({maxLineLength:Rt.default.number().optional(),maxNonSimpleConditionLength:Rt.default.number().optional()}),zs=$s({name:Xr,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(Us)]},defaultOptions:[{}],create(e,[t]){let r=e.sourceCode;return{IfStatement(n){if(n.consequent.type!==ce.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 p=n.consequent.body[0];if(!p)return;if(p.type===ce.AST_NODE_TYPES.ReturnStatement){if(!Hr(p))return}else if(!(p.type===ce.AST_NODE_TYPES.ContinueStatement||p.type===ce.AST_NODE_TYPES.BreakStatement))return;if(n.test.type===ce.AST_NODE_TYPES.LogicalExpression||n.test.type===ce.AST_NODE_TYPES.ConditionalExpression)return;let i;if(t.maxNonSimpleConditionLength){let f=Vr(n.test);if(!f&&n.test.type===ce.AST_NODE_TYPES.UnaryExpression&&n.test.operator==="!"){let y=n.test.argument;Vr(y)&&(f=!0)}if(f&&(i=r.getText(n.test),i.length>t.maxNonSimpleConditionLength))return}i||(i=r.getText(n.test));let a=r.getText(p);if(i.includes(`
18
- `))return;let l=r.getTokenAfter(n);if(l&&l.type===ce.AST_TOKEN_TYPES.Punctuator&&l.value==="}"){let f=r.getTokenAfter(l);if(f&&f.type===ce.AST_TOKEN_TYPES.Keyword&&(f.value==="else"||f.value==="catch"))return}let s=Ws(r,n),u=`if (${i}) ${a}`;t.maxLineLength&&u.length+s.length>t.maxLineLength||e.report({node:n,messageId:"noSingleLineCurly",fix:f=>f.replaceText(n,u)})}}}});function Vr(e){return e.type===ce.AST_NODE_TYPES.CallExpression||e.type===ce.AST_NODE_TYPES.BinaryExpression||e.type===ce.AST_NODE_TYPES.MemberExpression&&Br(e)}function Br(e){return e.object.type===ce.AST_NODE_TYPES.MemberExpression?Br(e.object):e.object.type!==ce.AST_NODE_TYPES.Identifier}function Ws(e,t){return e.text.slice(t.range[0]-t.loc.start.column,t.range[0])}function Hr(e){if(!e.argument)return!0;let t=e.argument;return t.type===ce.AST_NODE_TYPES.ArrayExpression&&t.elements.length===0||t.type===ce.AST_NODE_TYPES.ObjectExpression&&t.properties.length===0||t.type===ce.AST_NODE_TYPES.Literal||t.type===ce.AST_NODE_TYPES.Identifier||t.type===ce.AST_NODE_TYPES.TemplateLiteral||t.type===ce.AST_NODE_TYPES.TaggedTemplateExpression?!0:t.type===ce.AST_NODE_TYPES.CallExpression?t.arguments.length===0:t.type===ce.AST_NODE_TYPES.UnaryExpression?Hr(t):!1}var xn={name:Xr,rule:zs};var L=require("@typescript-eslint/utils"),In=require("zod/v4");var Js=L.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),Gr="react-compiler-extra",Vs=In.z.object({runOnlyWithEnableCompilerDirective:In.z.boolean().optional()}),Xs=/eslint +react-compiler\/react-compiler: +\["error/;function st(e){let t=null;if((e.type===L.AST_NODE_TYPES.FunctionDeclaration||e.type===L.AST_NODE_TYPES.FunctionExpression||e.type===L.AST_NODE_TYPES.ArrowFunctionExpression&&e.body.type===L.AST_NODE_TYPES.BlockStatement)&&(t=e.body),!t||t.body.length===0)return!1;let r=t.body[0];return r?r.type===L.AST_NODE_TYPES.ExpressionStatement&&r.expression.type===L.AST_NODE_TYPES.Literal&&r.expression.value==="use no memo":!1}function Bs(e){let t=e.parent;for(;t;){if(t.type===L.AST_NODE_TYPES.FunctionDeclaration||t.type===L.AST_NODE_TYPES.FunctionExpression||t.type===L.AST_NODE_TYPES.ArrowFunctionExpression)return t;t=t.parent}return null}function Kr(e){return e.type===L.AST_NODE_TYPES.Identifier?e.name.startsWith("use"):!1}function Hs(e){return e.type===L.AST_NODE_TYPES.Identifier?e.name.startsWith("use"):e.type===L.AST_NODE_TYPES.MemberExpression&&e.property.type===L.AST_NODE_TYPES.Identifier?e.property.name.startsWith("use"):!1}function _e(e){if(!e)return!1;switch(e.type){case L.AST_NODE_TYPES.JSXElement:case L.AST_NODE_TYPES.JSXFragment:return!0;case L.AST_NODE_TYPES.ConditionalExpression:return _e(e.consequent)||_e(e.alternate);case L.AST_NODE_TYPES.LogicalExpression:return e.operator==="&&"?_e(e.right):e.operator==="||"?_e(e.left)||_e(e.right):!1;case L.AST_NODE_TYPES.CallExpression:if(e.callee.type===L.AST_NODE_TYPES.MemberExpression&&e.callee.object.type===L.AST_NODE_TYPES.Identifier&&e.callee.object.name==="React"&&e.callee.property.type===L.AST_NODE_TYPES.Identifier&&e.callee.property.name==="createElement")return!0;for(let t of e.arguments)if(t.type!==L.AST_NODE_TYPES.SpreadElement&&_e(t))return!0;return!1;default:return!1}}function Ys(e){let t=e.typeAnnotation;if(t.type===L.AST_NODE_TYPES.TSTypeReference){if(t.typeName.type===L.AST_NODE_TYPES.Identifier)return t.typeName.name==="FC";if(t.typeName.type===L.AST_NODE_TYPES.TSQualifiedName&&t.typeName.left.type===L.AST_NODE_TYPES.Identifier&&t.typeName.right.type===L.AST_NODE_TYPES.Identifier)return t.typeName.left.name==="React"&&t.typeName.right.name==="FC"}return!1}var qs=/^[A-Z][a-zA-Z0-9]*$/;function St(e){return qs.test(e)}function An(e){return e.startsWith("use")&&e.length>3}function wn(e,t,r,n){if(r&&Ys(r))return t?St(t.name):e.type===L.AST_NODE_TYPES.FunctionDeclaration&&e.id?St(e.id.name):!0;if(t&&An(t.name)||e.type===L.AST_NODE_TYPES.FunctionDeclaration&&e.id&&An(e.id.name))return!0;if(n){let o=t?.name||e.type===L.AST_NODE_TYPES.FunctionDeclaration&&e.id?.name;if(o&&St(o)&&Qr(e.body,n).containsJSX)return!0}return!1}function gt(e){if(e.body.type===L.AST_NODE_TYPES.BlockStatement){for(let t of e.body.body)if(t.type===L.AST_NODE_TYPES.ExpressionStatement&&t.expression.type===L.AST_NODE_TYPES.Literal&&typeof t.expression.value=="string"&&t.expression.value==="use memo")return!0}return!1}function Qr(e,t){let r={containsJSX:!1,containsHookCalls:!1};return je(e,n=>{if(r.containsJSX&&r.containsHookCalls)return!0;switch(n.type){case L.AST_NODE_TYPES.JSXElement:case L.AST_NODE_TYPES.JSXFragment:r.containsJSX=!0;break;case L.AST_NODE_TYPES.CallExpression:Kr(n.callee)&&(r.containsHookCalls=!0),_e(n)&&(r.containsJSX=!0);break;case L.AST_NODE_TYPES.ReturnStatement:n.argument&&_e(n.argument)&&(r.containsJSX=!0);break;case L.AST_NODE_TYPES.VariableDeclarator:n.init&&_e(n.init)&&(r.containsJSX=!0);break;case L.AST_NODE_TYPES.AssignmentExpression:_e(n.right)&&(r.containsJSX=!0);break}},t),r}function Yr(e,t){let r=e.body,n=Qr(r,t);return n.containsJSX||n.containsHookCalls}var Zs=/\bthis[.[]/;function qr(e){return Zs.test(e)}function Gs(e,t){let r={containsJSX:!1,containsHookCalls:!1};return je(e,n=>{if(r.containsHookCalls||(n.type===L.AST_NODE_TYPES.FunctionDeclaration||n.type===L.AST_NODE_TYPES.FunctionExpression||n.type===L.AST_NODE_TYPES.ArrowFunctionExpression)&&n!==e)return!0;n.type===L.AST_NODE_TYPES.CallExpression&&Hs(n.callee)&&(r.containsHookCalls=!0)},t),r}function Zr(e){return St(e)||An(e)}function Cn(e,t,r,n){if(!Gs(e.body,t).containsHookCalls)return!1;let p=wn(e,r,n,t);if(!p&&n){let i=r?.name||e.type===L.AST_NODE_TYPES.FunctionDeclaration&&e.id?.name;i&&St(i)&&(p=!0)}return!p}var Ks=Js({name:Gr,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(Vs)]},defaultOptions:[{}],create(e,[t]){let r=!1;if(t.runOnlyWithEnableCompilerDirective){for(let i of e.sourceCode.getAllComments())if(Xs.test(i.value)){r=!0;break}if(!r)return{}}function n(i){for(let a of i.properties)if(a.type===L.AST_NODE_TYPES.Property&&a.method&&a.value.type===L.AST_NODE_TYPES.FunctionExpression){let l=e.sourceCode,s=l.getText(a.key),u=a.value,f=l.getText(u.body);if(qr(f))e.report({node:a,messageId:"thisKeywordInMethod"});else{let y=u.params.map(m=>l.getText(m)).join(", "),x="";u.generator?x=`${s}: function* (${y}) ${f}`:x=`${s}: (${y}) => ${f}`,e.report({node:a,messageId:"objectMethodIsNotSupported",fix:m=>m.replaceText(a,x)})}}}function o(i){for(let a of i.properties)if(a.type===L.AST_NODE_TYPES.Property&&a.value.type===L.AST_NODE_TYPES.ObjectExpression){for(let l of a.value.properties)if(l.type===L.AST_NODE_TYPES.Property&&l.method&&l.value.type===L.AST_NODE_TYPES.FunctionExpression){let u=e.sourceCode.getText(l.value.body);qr(u)&&e.report({node:l,messageId:"thisKeywordInMethod"})}}}function p(i){let a=Bs(i);return a!==null&&st(a)}return{CallExpression(i){if(Kr(i.callee))for(let a of i.arguments){if(a.type===L.AST_NODE_TYPES.ObjectExpression){if(p(i))return;n(a),o(a)}if(a.type===L.AST_NODE_TYPES.ArrowFunctionExpression){if(a.body.type===L.AST_NODE_TYPES.ObjectExpression){if(p(i))return;n(a.body),o(a.body)}if(a.body.type===L.AST_NODE_TYPES.BlockStatement){for(let l of a.body.body)if(l.type===L.AST_NODE_TYPES.ReturnStatement&&l.argument?.type===L.AST_NODE_TYPES.ObjectExpression){if(p(i))return;n(l.argument),o(l.argument)}}}if(a.type===L.AST_NODE_TYPES.FunctionExpression){for(let l of a.body.body)if(l.type===L.AST_NODE_TYPES.ReturnStatement&&l.argument?.type===L.AST_NODE_TYPES.ObjectExpression){if(p(i))return;n(l.argument),o(l.argument)}}}},VariableDeclarator(i){if(i.id.type===L.AST_NODE_TYPES.Identifier&&i.init&&(i.init.type===L.AST_NODE_TYPES.ArrowFunctionExpression||i.init.type===L.AST_NODE_TYPES.FunctionExpression)){let a=i.init,l=i.id,s=i.id.typeAnnotation;if(gt(a)&&!Zr(l.name)){e.report({node:a,messageId:"useMemoDirectiveNaming"});return}if(Cn(a,e.sourceCode,l,s)){if(st(a))return;e.report({node:a,messageId:"functionCallingHooksMustBeComponent"});return}if(wn(a,l,s,e.sourceCode)){let u=Yr(a,e.sourceCode),f=gt(a);if(!u&&!f){if(st(a))return;e.report({node:a,messageId:"fcComponentShouldReturnJsx",suggest:[{messageId:"addUseMemoDirective",fix(y){if(a.body.type===L.AST_NODE_TYPES.BlockStatement){let x=a.body.range[0]+1;return y.insertTextAfterRange([x,x],`
18
+ `))return;let l=r.getTokenAfter(n);if(l&&l.type===ce.AST_TOKEN_TYPES.Punctuator&&l.value==="}"){let f=r.getTokenAfter(l);if(f&&f.type===ce.AST_TOKEN_TYPES.Keyword&&(f.value==="else"||f.value==="catch"))return}let s=Ws(r,n),u=`if (${i}) ${a}`;t.maxLineLength&&u.length+s.length>t.maxLineLength||e.report({node:n,messageId:"noSingleLineCurly",fix:f=>f.replaceText(n,u)})}}}});function Vr(e){return e.type===ce.AST_NODE_TYPES.CallExpression||e.type===ce.AST_NODE_TYPES.BinaryExpression||e.type===ce.AST_NODE_TYPES.MemberExpression&&Br(e)}function Br(e){return e.object.type===ce.AST_NODE_TYPES.MemberExpression?Br(e.object):e.object.type!==ce.AST_NODE_TYPES.Identifier}function Ws(e,t){return e.text.slice(t.range[0]-t.loc.start.column,t.range[0])}function Hr(e){if(!e.argument)return!0;let t=e.argument;return t.type===ce.AST_NODE_TYPES.ArrayExpression&&t.elements.length===0||t.type===ce.AST_NODE_TYPES.ObjectExpression&&t.properties.length===0||t.type===ce.AST_NODE_TYPES.Literal||t.type===ce.AST_NODE_TYPES.Identifier||t.type===ce.AST_NODE_TYPES.TemplateLiteral||t.type===ce.AST_NODE_TYPES.TaggedTemplateExpression?!0:t.type===ce.AST_NODE_TYPES.CallExpression?t.arguments.length===0:t.type===ce.AST_NODE_TYPES.UnaryExpression?Hr(t):!1}var xn={name:Xr,rule:zs};var L=require("@typescript-eslint/utils"),In=require("zod/v4");var Js=L.ESLintUtils.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),Gr="react-compiler-extra",Vs=In.z.object({runOnlyWithEnableCompilerDirective:In.z.boolean().optional()}),Xs=/eslint +react-compiler\/react-compiler: +\["error/;function st(e){let t=null;if((e.type===L.AST_NODE_TYPES.FunctionDeclaration||e.type===L.AST_NODE_TYPES.FunctionExpression||e.type===L.AST_NODE_TYPES.ArrowFunctionExpression&&e.body.type===L.AST_NODE_TYPES.BlockStatement)&&(t=e.body),!t||t.body.length===0)return!1;let r=t.body[0];return r?r.type===L.AST_NODE_TYPES.ExpressionStatement&&r.expression.type===L.AST_NODE_TYPES.Literal&&r.expression.value==="use no memo":!1}function Bs(e){let t=e.parent;for(;t;){if(t.type===L.AST_NODE_TYPES.FunctionDeclaration||t.type===L.AST_NODE_TYPES.FunctionExpression||t.type===L.AST_NODE_TYPES.ArrowFunctionExpression)return t;t=t.parent}return null}function Hs(e){return e.type===L.AST_NODE_TYPES.Identifier?e.name.startsWith("use"):!1}function Kr(e){return e.type===L.AST_NODE_TYPES.Identifier?e.name.startsWith("use"):e.type===L.AST_NODE_TYPES.MemberExpression&&e.property.type===L.AST_NODE_TYPES.Identifier?e.property.name.startsWith("use"):!1}function _e(e){if(!e)return!1;switch(e.type){case L.AST_NODE_TYPES.JSXElement:case L.AST_NODE_TYPES.JSXFragment:return!0;case L.AST_NODE_TYPES.ConditionalExpression:return _e(e.consequent)||_e(e.alternate);case L.AST_NODE_TYPES.LogicalExpression:return e.operator==="&&"?_e(e.right):e.operator==="||"?_e(e.left)||_e(e.right):!1;case L.AST_NODE_TYPES.CallExpression:if(e.callee.type===L.AST_NODE_TYPES.MemberExpression&&e.callee.object.type===L.AST_NODE_TYPES.Identifier&&e.callee.object.name==="React"&&e.callee.property.type===L.AST_NODE_TYPES.Identifier&&e.callee.property.name==="createElement")return!0;for(let t of e.arguments)if(t.type!==L.AST_NODE_TYPES.SpreadElement&&_e(t))return!0;return!1;default:return!1}}function Ys(e){let t=e.typeAnnotation;if(t.type===L.AST_NODE_TYPES.TSTypeReference){if(t.typeName.type===L.AST_NODE_TYPES.Identifier)return t.typeName.name==="FC";if(t.typeName.type===L.AST_NODE_TYPES.TSQualifiedName&&t.typeName.left.type===L.AST_NODE_TYPES.Identifier&&t.typeName.right.type===L.AST_NODE_TYPES.Identifier)return t.typeName.left.name==="React"&&t.typeName.right.name==="FC"}return!1}var qs=/^[A-Z][a-zA-Z0-9]*$/;function St(e){return qs.test(e)}function An(e){return e.startsWith("use")&&e.length>3}function wn(e,t,r,n){if(r&&Ys(r))return t?St(t.name):e.type===L.AST_NODE_TYPES.FunctionDeclaration&&e.id?St(e.id.name):!0;if(t&&An(t.name)||e.type===L.AST_NODE_TYPES.FunctionDeclaration&&e.id&&An(e.id.name))return!0;if(n){let o=t?.name||e.type===L.AST_NODE_TYPES.FunctionDeclaration&&e.id?.name;if(o&&St(o)&&Qr(e.body,n).containsJSX)return!0}return!1}function gt(e){if(e.body.type===L.AST_NODE_TYPES.BlockStatement){for(let t of e.body.body)if(t.type===L.AST_NODE_TYPES.ExpressionStatement&&t.expression.type===L.AST_NODE_TYPES.Literal&&typeof t.expression.value=="string"&&t.expression.value==="use memo")return!0}return!1}function Qr(e,t){let r={containsJSX:!1,containsHookCalls:!1};return je(e,n=>{if(r.containsJSX&&r.containsHookCalls)return!0;switch(n.type){case L.AST_NODE_TYPES.JSXElement:case L.AST_NODE_TYPES.JSXFragment:r.containsJSX=!0;break;case L.AST_NODE_TYPES.CallExpression:Hs(n.callee)&&(r.containsHookCalls=!0),_e(n)&&(r.containsJSX=!0);break;case L.AST_NODE_TYPES.ReturnStatement:n.argument&&_e(n.argument)&&(r.containsJSX=!0);break;case L.AST_NODE_TYPES.VariableDeclarator:n.init&&_e(n.init)&&(r.containsJSX=!0);break;case L.AST_NODE_TYPES.AssignmentExpression:_e(n.right)&&(r.containsJSX=!0);break}},t),r}function Yr(e,t){let r=e.body,n=Qr(r,t);return n.containsJSX||n.containsHookCalls}var Zs=/\bthis[.[]/;function qr(e){return Zs.test(e)}function Gs(e,t){let r={containsJSX:!1,containsHookCalls:!1};return je(e,n=>{if(r.containsHookCalls||(n.type===L.AST_NODE_TYPES.FunctionDeclaration||n.type===L.AST_NODE_TYPES.FunctionExpression||n.type===L.AST_NODE_TYPES.ArrowFunctionExpression)&&n!==e)return!0;n.type===L.AST_NODE_TYPES.CallExpression&&Kr(n.callee)&&(r.containsHookCalls=!0)},t),r}function Zr(e){return St(e)||An(e)}function Cn(e,t,r,n){if(!Gs(e.body,t).containsHookCalls)return!1;let p=wn(e,r,n,t);if(!p&&n){let i=r?.name||e.type===L.AST_NODE_TYPES.FunctionDeclaration&&e.id?.name;i&&St(i)&&(p=!0)}return!p}var Ks=Js({name:Gr,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(Vs)]},defaultOptions:[{}],create(e,[t]){let r=!1;if(t.runOnlyWithEnableCompilerDirective){for(let i of e.sourceCode.getAllComments())if(Xs.test(i.value)){r=!0;break}if(!r)return{}}function n(i){for(let a of i.properties)if(a.type===L.AST_NODE_TYPES.Property&&a.method&&a.value.type===L.AST_NODE_TYPES.FunctionExpression){let l=e.sourceCode,s=l.getText(a.key),u=a.value,f=l.getText(u.body);if(qr(f))e.report({node:a,messageId:"thisKeywordInMethod"});else{let y=u.params.map(m=>l.getText(m)).join(", "),x="";u.generator?x=`${s}: function* (${y}) ${f}`:x=`${s}: (${y}) => ${f}`,e.report({node:a,messageId:"objectMethodIsNotSupported",fix:m=>m.replaceText(a,x)})}}}function o(i){for(let a of i.properties)if(a.type===L.AST_NODE_TYPES.Property&&a.value.type===L.AST_NODE_TYPES.ObjectExpression){for(let l of a.value.properties)if(l.type===L.AST_NODE_TYPES.Property&&l.method&&l.value.type===L.AST_NODE_TYPES.FunctionExpression){let u=e.sourceCode.getText(l.value.body);qr(u)&&e.report({node:l,messageId:"thisKeywordInMethod"})}}}function p(i){let a=Bs(i);return a!==null&&st(a)}return{CallExpression(i){if(Kr(i.callee))for(let a of i.arguments){if(a.type===L.AST_NODE_TYPES.ObjectExpression){if(p(i))return;n(a),o(a)}if(a.type===L.AST_NODE_TYPES.ArrowFunctionExpression){if(a.body.type===L.AST_NODE_TYPES.ObjectExpression){if(p(i))return;n(a.body),o(a.body)}if(a.body.type===L.AST_NODE_TYPES.BlockStatement){for(let l of a.body.body)if(l.type===L.AST_NODE_TYPES.ReturnStatement&&l.argument?.type===L.AST_NODE_TYPES.ObjectExpression){if(p(i))return;n(l.argument),o(l.argument)}}}if(a.type===L.AST_NODE_TYPES.FunctionExpression){for(let l of a.body.body)if(l.type===L.AST_NODE_TYPES.ReturnStatement&&l.argument?.type===L.AST_NODE_TYPES.ObjectExpression){if(p(i))return;n(l.argument),o(l.argument)}}}},VariableDeclarator(i){if(i.id.type===L.AST_NODE_TYPES.Identifier&&i.init&&(i.init.type===L.AST_NODE_TYPES.ArrowFunctionExpression||i.init.type===L.AST_NODE_TYPES.FunctionExpression)){let a=i.init,l=i.id,s=i.id.typeAnnotation;if(gt(a)&&!Zr(l.name)){e.report({node:a,messageId:"useMemoDirectiveNaming"});return}if(Cn(a,e.sourceCode,l,s)){if(st(a))return;e.report({node:a,messageId:"functionCallingHooksMustBeComponent"});return}if(wn(a,l,s,e.sourceCode)){let u=Yr(a,e.sourceCode),f=gt(a);if(!u&&!f){if(st(a))return;e.report({node:a,messageId:"fcComponentShouldReturnJsx",suggest:[{messageId:"addUseMemoDirective",fix(y){if(a.body.type===L.AST_NODE_TYPES.BlockStatement){let x=a.body.range[0]+1;return y.insertTextAfterRange([x,x],`
19
19
  "use memo"
20
20
  `)}return null}}]})}}}},FunctionDeclaration(i){if(i.id&&gt(i)&&!Zr(i.id.name)){e.report({node:i,messageId:"useMemoDirectiveNaming"});return}if(Cn(i,e.sourceCode)){if(st(i))return;e.report({node:i,messageId:"functionCallingHooksMustBeComponent"});return}if(wn(i,void 0,void 0,e.sourceCode)){let a=Yr(i,e.sourceCode),l=gt(i);if(!a&&!l){if(st(i))return;e.report({node:i,messageId:"fcComponentShouldReturnJsx",suggest:[{messageId:"addUseMemoDirective",fix(s){let u=i.body.range[0]+1;return s.insertTextAfterRange([u,u],`
21
21
  "use memo"
@@ -15,7 +15,7 @@ useEffect(() => {
15
15
  Learn more about data fetching with Hooks: https://reactjs.org/link/hooks-data-fetching`});let w=l.acquire(I),k=new Set,N=null;{let v=w.upper;for(;v&&(k.add(v),v.type!=="function");)v=v.upper;if(!v)return;N=v}let c=Array.isArray;function F(v){if(!c(v.defs))return!1;let O=v.defs[0];if(O==null||O.node.type!=="VariableDeclarator")return!1;let z=O.node.init;if(z==null)return!1;for(;z.type==="TSAsExpression";)z=z.expression;let W=O.node.parent;if(W==null&&(kt(N.block,O.node.id),W=O.node.parent,W==null))return!1;if(W.kind==="const"&&z.type==="Literal"&&(typeof z.value=="string"||typeof z.value=="number"||z.value===null))return!0;if(z.type!=="CallExpression")return!1;let Y=z.callee;if(Y.type==="MemberExpression"&&Y.object.name==="React"&&Y.property!=null&&!Y.computed&&(Y=Y.property),Y.type!=="Identifier")return!1;let U=O.node.id,{name:K}=Y;if(K==="useRef"&&U.type==="Identifier")return!0;if(ji(Y)&&U.type==="Identifier"){for(let ee of v.references)ee!==U&&x.add(ee.identifier);return!0}else if(K==="useState"||K==="useReducer"){if(U.type==="ArrayPattern"&&U.elements.length===2&&c(v.identifiers)){if(U.elements[1]===v.identifiers[0]){if(K==="useState"){let ee=v.references,Ae=0;for(let Me=0;Me<ee.length;Me++){if(ee[Me].isWrite()&&Ae++,Ae>1)return!1;s.set(ee[Me].identifier,U.elements[0])}}return!0}else if(U.elements[0]===v.identifiers[0]){if(K==="useState"){let ee=v.references;for(let Ae=0;Ae<ee.length;Ae++)u.add(ee[Ae].identifier)}return!1}}}else if(K==="useTransition"&&U.type==="ArrayPattern"&&U.elements.length===2&&Array.isArray(v.identifiers)&&U.elements[1]===v.identifiers[0])return!0;return!1}function d(v){if(!c(v.defs))return!1;let O=v.defs[0];if(O==null||O.node==null||O.node.id==null)return!1;let z=O.node,W=N.childScopes,Y=null,U;for(U=0;U<W.length;U++){let K=W[U],ee=K.block;if(z.type==="FunctionDeclaration"&&ee===z||z.type==="VariableDeclarator"&&ee.parent===z){Y=K;break}}if(Y==null)return!1;for(U=0;U<Y.through.length;U++){let K=Y.through[U];if(K.resolved!=null&&k.has(K.resolved.scope)&&!g(K.resolved))return!1}return!0}let g=m(F,f),R=m(d,y),P=new Map;function j(v){let O=v.from,z=!1;for(;O.block!==I;)O.type==="function"&&(z=O.block.parent!=null&&O.block.parent.type==="ReturnStatement"),O=O.upper;return z}let V=new Map,G=new Map;H(w);function H(v){for(let O of v.references){if(!O.resolved||!k.has(O.resolved.scope))continue;let z=kt(I,O.identifier),W=qn(z),Y=_e(W,G);if(b&&W.type==="Identifier"&&(W.parent.type==="MemberExpression"||W.parent.type==="OptionalMemberExpression")&&!W.parent.computed&&W.parent.property.type==="Identifier"&&W.parent.property.name==="current"&&j(O)&&P.set(Y,{reference:O,dependencyNode:W}),W.parent.type==="TSTypeQuery"||W.parent.type==="TSTypeReference")continue;let U=O.resolved.defs[0];if(U!=null&&!(U.node!=null&&U.node.init===I.parent)&&U.type!=="TypeParameter")if(V.has(Y))V.get(Y).references.push(O);else{let K=O.resolved,ee=g(K)||R(K);V.set(Y,{isStable:ee,references:[O]})}}for(let O of v.childScopes)H(O)}P.forEach(({reference:v,dependencyNode:O},z)=>{let W=v.resolved.references,Y=!1;for(let U=0;U<W.length;U++){let{identifier:K}=W[U],{parent:ee}=K;if(ee!=null&&ee.type==="MemberExpression"&&!ee.computed&&ee.property.type==="Identifier"&&ee.property.name==="current"&&ee.parent.type==="AssignmentExpression"&&ee.parent.left===ee){Y=!0;break}}Y||a({node:O.parent.property,message:`The ref value '${z}.current' will likely have changed by the time this effect cleanup function runs. If this ref points to a node rendered by React, copy '${z}.current' to a variable inside the effect, and use that variable in the cleanup function.`})});let D=new Set;function Z(v,O){D.has(O)||(D.add(O),a({node:v,message:`Assignments to the '${O}' variable from inside React Hook ${r(S)} 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(S)}.`}))}let q=new Set;if(V.forEach(({isStable:v,references:O},z)=>{v&&q.add(z),O.forEach(W=>{W.writeExpr&&Z(W.writeExpr,z)})}),D.size>0)return;if(!A){let v=null;if(V.forEach(({isStable:O,references:z},W)=>{v||z.forEach(Y=>{if(v)return;let U=Y.identifier;if(!s.has(U))return;let ee=Y.from;for(;ee.type!=="function";)ee=ee.upper;ee.block===I&&(v=W)})}),v){let{suggestedDependencies:O}=Rt({dependencies:V,declaredDependencies:[],stableDependencies:q,externalDependencies:new Set,isEffect:!0});a({node:S,message:`React Hook ${h} contains a call to '${v}'. Without a list of dependencies, this can lead to an infinite chain of updates. To fix this, pass [`+O.join(", ")+`] as a second argument to the ${h} Hook.`,suggest:[{desc:`Add dependencies array: [${O.join(", ")}]`,fix(z){return z.insertTextAfter(I,`, [${O.join(", ")}]`)}}]})}return}let ce=[],ue=new Set;A.type!=="ArrayExpression"?a({node:A,message:`React Hook ${r(S)} was passed a dependency list that is not an array literal. This means we can't statically verify whether you've passed the correct dependencies.`}):A.elements.forEach(v=>{if(v===null)return;if(v.type==="SpreadElement"){a({node:v,message:`React Hook ${r(S)} has a spread element in its dependency array. This means we can't statically verify whether you've passed the correct dependencies.`});return}x.has(v)&&a({node:v,message:`Functions returned from \`useEffectEvent\` must not be included in the dependency array. Remove \`${r(v)}\` from the list.`,suggest:[{desc:`Remove the dependency \`${r(v)}\``,fix(Y){return Y.removeRange(v.range)}}]});let O;try{O=_e(v,G)}catch(Y){if(/Unsupported node type/.test(Y.message)){v.type==="Literal"?V.has(v.value)?a({node:v,message:`The ${v.raw} literal is not a valid dependency because it never changes. Did you mean to include ${v.value} in the array instead?`}):a({node:v,message:`The ${v.raw} literal is not a valid dependency because it never changes. You can safely remove it.`}):a({node:v,message:`React Hook ${r(S)} has a complex expression in the dependency array. Extract it to a separate variable so it can be statically checked.`});return}else throw Y}let z=v;for(;z.type==="MemberExpression"||z.type==="OptionalMemberExpression"||z.type==="ChainExpression";)z=z.object||z.expression.object;let W=!N.through.some(Y=>Y.identifier===z);ce.push({key:O,node:v}),W||ue.add(O)});let{suggestedDependencies:Fe,unnecessaryDependencies:ze,missingDependencies:Se,duplicateDependencies:nt}=Rt({dependencies:V,declaredDependencies:ce,stableDependencies:q,externalDependencies:ue,isEffect:b}),qe=Fe;if(nt.size+Se.size+ze.size===0){let v=Bn(S),O=v&&Xn(v);if(t&&!O)return;Pi({declaredDependencies:ce,declaredDependenciesNode:A,componentScope:N,scope:w}).forEach(({construction:W,isUsedOutsideOfHook:Y,depType:U})=>{let K=U==="function"?"useCallback":"useMemo",ee=U==="function"?"definition":"initialization",Ae=`wrap the ${ee} of '${W.name.name}' in its own ${K}() Hook.`,Me=Y?`To fix this, ${Ae}`:`Move it inside the ${h} callback. Alternatively, ${Ae}`,Si=U==="conditional"||U==="logical expression"?"could make":"makes",Ti=`The '${W.name.name}' ${U} ${Si} the dependencies of ${h} Hook (at line ${A.loc.start.line}) change on every render. ${Me}`,Mn;Y&&W.type==="Variable"&&U==="function"&&(Mn=[{desc:`Wrap the ${ee} of '${W.name.name}' in its own ${K}() Hook.`,fix(_n){let[hi,Ei]=K==="useMemo"?["useMemo(() => { return ","; })"]:["useCallback(",")"];return[_n.insertTextBefore(W.node.init,hi),_n.insertTextAfter(W.node.init,Ei)]}}]),a({node:W.node,message:Ti,suggest:Mn})});return}!b&&Se.size>0&&(qe=Rt({dependencies:V,declaredDependencies:[],stableDependencies:q,externalDependencies:ue,isEffect:b}).suggestedDependencies);function be(){if(ce.length===0)return!0;let v=ce.map(z=>z.key),O=v.slice().sort();return v.join(",")===O.join(",")}be()&&qe.sort();function Ce(v){let O=v.split("."),z="";for(let W=0;W<O.length;W++){if(W!==0){let Y=O.slice(0,W+1).join("."),U=G.get(Y)===!0;z+=U?"?.":"."}z+=O[W]}return z}function It(v,O,z,W){return v.size===0?null:(v.size>1?"":O+" ")+z+" "+(v.size>1?"dependencies":"dependency")+": "+Oi(Array.from(v).sort().map(Y=>"'"+Ce(Y)+"'"))+`. Either ${W} ${v.size>1?"them":"it"} or remove the dependency array.`}let Pe="";if(ze.size>0){let v=null;if(Array.from(ze.keys()).forEach(O=>{v===null&&O.endsWith(".current")&&(v=O)}),v!==null)Pe=` Mutable values like '${v}' aren't valid dependencies because mutating them doesn't re-render the component.`;else if(ue.size>0){let O=Array.from(ue)[0];w.set.has(O)||(Pe=` Outer scope values like '${O}' aren't valid dependencies because mutating them doesn't re-render the component.`)}}if(!Pe&&Se.has("props")){let v=V.get("props");if(v==null)return;let O=v.references;if(!Array.isArray(O))return;let z=!0;for(let W=0;W<O.length;W++){let Y=O[W],U=kt(N.block,Y.identifier);if(!U){z=!1;break}let K=U.parent;if(K==null){z=!1;break}if(K.type!=="MemberExpression"&&K.type!=="OptionalMemberExpression"){z=!1;break}}z&&(Pe=` However, 'props' will change when *any* prop changes, so the preferred fix is to destructure the 'props' object outside of the ${h} call and refer to those specific props inside ${r(S)}.`)}if(!Pe&&Se.size>0){let v=null;Se.forEach(O=>{if(v)return;let z=N.set.get(O),W=V.get(O);if(W.references[0].resolved!==z)return;let Y=z.defs[0];if(Y==null||Y.name==null||Y.type!=="Parameter")return;let U=!1,K;for(let ee=0;ee<W.references.length;ee++)if(K=W.references[ee].identifier,K!=null&&K.parent!=null&&(K.parent.type==="CallExpression"||K.parent.type==="OptionalCallExpression")&&K.parent.callee===K){U=!0;break}U&&(v=O)}),v!==null&&(Pe=` If '${v}' changes too often, find the parent component that defines it and wrap that definition in useCallback.`)}if(!Pe&&Se.size>0){let v=null;if(Se.forEach(O=>{if(v!==null)return;let W=V.get(O).references,Y,U;for(let K=0;K<W.length;K++){for(Y=W[K].identifier,U=Y.parent;U!=null&&U!==N.block;){if(U.type==="CallExpression"){let ee=s.get(U.callee);if(ee!=null){if(ee.name===O)v={missingDep:O,setter:U.callee.name,form:"updater"};else if(u.has(Y))v={missingDep:O,setter:U.callee.name,form:"reducer"};else{let Ae=W[K].resolved;if(Ae!=null){let Me=Ae.defs[0];Me!=null&&Me.type==="Parameter"&&(v={missingDep:O,setter:U.callee.name,form:"inlineReducer"})}}break}}U=U.parent}if(v!==null)break}}),v!==null)switch(v.form){case"reducer":Pe=` You can also replace multiple useState variables with useReducer if '${v.setter}' needs the current value of '${v.missingDep}'.`;break;case"inlineReducer":Pe=` If '${v.setter}' needs the current value of '${v.missingDep}', you can also switch to useReducer instead of useState and read '${v.missingDep}' in the reducer.`;break;case"updater":Pe=` You can also do a functional update '${v.setter}(${v.missingDep.slice(0,1)} => ...)' if you only need '${v.missingDep}' in the '${v.setter}' call.`;break;default:throw new Error("Unknown case.")}}a({node:A,message:`React Hook ${r(S)} has `+(It(Se,"a","missing","include")||It(ze,"an","unnecessary","exclude")||It(nt,"a","duplicate","omit"))+Pe,suggest:[{desc:`Update the dependencies array to be: [${qe.map(Ce).join(", ")}]`,fix(v){return v.replaceText(A,`[${qe.map(Ce).join(", ")}]`)}}]})}function C(I){let A=Ni(I.callee,i);if(A===-1)return;let S=I.arguments[A],h=I.callee,b=Zn(h).name,w=I.arguments[A+1],k=/Effect($|[^a-z])/g.test(b);if(!S){a({node:h,message:`React Hook ${b} requires an effect callback. Did you forget to pass a callback to the hook?`});return}if(t&&!k){let N=Bn(h);if(!(N&&Xn(N)))return}if(!w&&!k){(b==="useMemo"||b==="useCallback")&&a({node:h,message:`React Hook ${b} does nothing when called with only one argument. Did you forget to pass an array of dependencies?`});return}switch(S.type){case"FunctionExpression":case"ArrowFunctionExpression":E(S,w,h,b,k);return;case"Identifier":if(!w||w.elements&&w.elements.some(F=>F&&F.type==="Identifier"&&F.name===S.name))return;let N=n(I).set.get(S.name);if(N==null||N.defs==null)return;let c=N.defs[0];if(!c||!c.node||c.type!=="Variable"&&c.type!=="FunctionName")break;switch(c.node.type){case"FunctionDeclaration":E(c.node,w,h,b,k);return;case"VariableDeclarator":let F=c.node.init;if(!F)break;switch(F.type){case"ArrowFunctionExpression":case"FunctionExpression":E(F,w,h,b,k);return}break}break;default:a({node:h,message:`React Hook ${b} received a function whose dependencies are unknown. Pass an inline function instead.`});return}a({node:h,message:`React Hook ${b} has a missing dependency: '${S.name}'. Either include it or remove the dependency array.`,suggest:[{desc:`Update the dependencies array to be: [${S.name}]`,fix(N){return N.replaceText(w,`[${S.name}]`)}}]})}if(!!e.options[0]?.reactCompilerIsEnabled)return t=!0,{CallExpression:I=>C(I)};if(e.options[0]?.ignoreIfReactCompilerIsEnabled){for(let I of e.sourceCode.getAllComments())if(ki.test(I.value))return t=!0,{CallExpression:A=>C(A)}}return{CallExpression:I=>C(I)}}};function Rt({dependencies:e,declaredDependencies:t,stableDependencies:r,externalDependencies:n,isEffect:o}){let p=i();function i(){return{isUsed:!1,isSatisfiedRecursively:!1,isSubtreeUsed:!1,children:new Map}}e.forEach((E,C)=>{let T=a(p,C);T.isUsed=!0,l(p,C,I=>{I.isSubtreeUsed=!0})}),t.forEach(({key:E})=>{let C=a(p,E);C.isSatisfiedRecursively=!0}),r.forEach(E=>{let C=a(p,E);C.isSatisfiedRecursively=!0});function a(E,C){let T=C.split("."),I=E;for(let A of T){let S=I.children.get(A);S||(S=i(),I.children.set(A,S)),I=S}return I}function l(E,C,T){let I=C.split("."),A=E;for(let S of I){let h=A.children.get(S);if(!h)return;T(h),A=h}}let s=new Set,u=new Set;f(p,s,u,E=>E);function f(E,C,T,I){E.children.forEach((A,S)=>{let h=I(S);if(A.isSatisfiedRecursively){A.isSubtreeUsed&&T.add(h);return}if(A.isUsed){C.add(h);return}f(A,C,T,b=>h+"."+b)})}let y=[],x=new Set,m=new Set;return t.forEach(({key:E})=>{u.has(E)?y.indexOf(E)===-1?y.push(E):m.add(E):x.add(E)}),s.forEach(E=>{y.push(E)}),{suggestedDependencies:y,unnecessaryDependencies:x,duplicateDependencies:m,missingDependencies:s}}function We(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 We(e.consequent)!=null||We(e.alternate)!=null?"conditional":null;case"LogicalExpression":return We(e.left)!=null||We(e.right)!=null?"logical expression":null;case"JSXFragment":return"JSX fragment";case"JSXElement":return"JSX element";case"AssignmentExpression":return We(e.right)!=null?"assignment expression":null;case"NewExpression":return"object construction";case"Literal":return e.value instanceof RegExp?"regular expression":null;case"TypeCastExpression":return We(e.expression);case"TSAsExpression":return We(e.expression)}return null}function Pi({declaredDependencies:e,declaredDependenciesNode:t,componentScope:r,scope:n}){let o=e.map(({key:i})=>{let a=r.variables.find(s=>s.name===i);if(a==null)return null;let l=a.defs[0];if(l==null)return null;if(l.type==="Variable"&&l.node.type==="VariableDeclarator"&&l.node.id.type==="Identifier"&&l.node.init!=null){let s=We(l.node.init);if(s!=null)return[a,s]}return l.type==="FunctionName"&&l.node.type==="FunctionDeclaration"?[a,"function"]:l.type==="ClassName"&&l.node.type==="ClassDeclaration"?[a,"class"]:null}).filter(Boolean);function p(i){let a=!1;for(let l=0;l<i.references.length;l++){let s=i.references[l];if(s.writeExpr){if(a)return!0;a=!0;continue}let u=s.from;for(;u!==n&&u!=null;)u=u.upper;if(u!==n&&!Gn(t,s.identifier))return!0}return!1}return o.map(([i,a])=>({construction:i.defs[0],depType:a,isUsedOutsideOfHook:p(i)}))}function qn(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)?qn(e.parent):e.type==="MemberExpression"&&e.parent&&e.parent.type==="AssignmentExpression"&&e.parent.left===e?e.object:e}function vt(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),o=`${r}.${n}`;return vt(e,t,o),o}else if(e.type==="OptionalMemberExpression"&&!e.computed){let r=_e(e.object,t),n=_e(e.property,null),o=`${r}.${n}`;return vt(e,t,o),o}else if(e.type==="ChainExpression"&&!e.computed){let r=e.expression;if(r.type==="CallExpression")throw new Error(`Unsupported node type: ${r.type}`);let n=_e(r.object,t),o=_e(r.property,null),p=`${n}.${o}`;return vt(r,t,p),p}else throw new Error(`Unsupported node type: ${e.type}`)}function Zn(e,t){return e.type==="MemberExpression"&&e.object.type==="Identifier"&&e.object.name==="React"&&e.property.type==="Identifier"&&!e.computed?e.property:e}function Ni(e,t){let r=Zn(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(o){if(/Unsupported node type/.test(o.message))return 0;throw o}return t.additionalHooks.test(n)?0:-1}else return-1}}function kt(e,t){let r=[e],n=null;for(;r.length;){if(n=r.shift(),Di(n,t))return n;if(Gn(n,t))for(let[o,p]of Object.entries(n))o!=="parent"&&(Hn(p)?(p.parent=n,r.push(p)):Array.isArray(p)&&p.forEach(i=>{Hn(i)&&(i.parent=n,r.push(i))}))}return null}function Oi(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 Hn(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&typeof e.type=="string"}function Di(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 Gn(e,t){return e.range[0]<=t.range[0]&&e.range[1]>=t.range[1]}function ji(e){return!1}import{AST_NODE_TYPES as pe,ESLintUtils as ir}from"@typescript-eslint/utils";import B from"typescript";import{z as tr}from"zod/v4";import{AST_NODE_TYPES as Kn}from"@typescript-eslint/utils";function Ze(e,t,r=1/0){if(r!==0&&e.parent)return e.type===t?e:Ze(e.parent,t,r===1/0?r:r-1)}function*Pt(e){yield e,e.parent&&(yield*Pt(e.parent))}function Nt(e,t){for(let r of e){let n=t(r);if(n!=null&&n!==!1)return n}}function er(e,t,r){let o=r.getDeclaredVariables(e).find(p=>p.name===t||p.identifiers[0]?.parent.type===Kn.Property&&p.identifiers[0].parent.key.type===Kn.Identifier&&p.identifiers[0].parent.key.name===t);return o?o.references.filter(p=>!p.init):[]}function Qn(e){return e===null||typeof e!="object"||!("type"in e)?!1:typeof e.type=="string"}function Li(e,t){return e[t]}function Ne(e,t,r){let n=r.visitorKeys,o=new Set;function p(i){if(o.has(i))return!1;if(o.add(i),t(i)===!0)return!0;let l=n[i.type];if(l)for(let s of l){let u=Li(i,s);if(u){if(Array.isArray(u)){for(let f of u)if(Qn(f)&&p(f))return!0}else if(Qn(u)&&p(u))return!0}}return!1}p(e)}var Mi=ir.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),nr="improved-no-unnecessary-condition",_i=tr.object({alternativeForInCondition:tr.string().optional().describe("Alternative to appear in the error for `in` condition")}),rr={object:"Array",property:"isArray"},$i=["string","number","bigint","boolean","symbol","undefined","object","function","never"],Ui=new Set($i),Ot={name:nr,rule:Mi({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.",unnecessaryArrayIsArrayCondition:"This Array.isArray check is unnecessary as it always evaluates to true.",alwaysFalseArrayIsArrayCondition:"This Array.isArray check will always be false.",unnecessaryLengthCondition:"This length comparison is unnecessary as it always evaluates to true.",alwaysFalseLengthCondition:"This length comparison will always be false.",unnecessaryInCondition:'This in check is unnecessary. Property "{{property}}" always exists on type "{{type}}".{{alternative}}',alwaysFalseInCondition:'This in check will always be false. Property "{{property}}" does not exist on type "{{type}}".{{alternative}}'},schema:[J(_i)]},defaultOptions:[{}],create(e,[t]){let r=ir.getParserServices(e,!0),n=r.program?.getTypeChecker();if(!n||!r.program)throw new Error("TypeScript services or program not available");function o(c){return c.type===pe.UnaryExpression&&c.operator==="typeof"}function p(c){return c.flags&B.TypeFlags.Any||c.flags&B.TypeFlags.Unknown?null:c.flags&B.TypeFlags.StringLike?["string"]:c.flags&B.TypeFlags.NumberLike?["number"]:c.flags&B.TypeFlags.BigIntLike?["bigint"]:c.flags&B.TypeFlags.BooleanLike?["boolean"]:c.flags&B.TypeFlags.ESSymbolLike?["symbol"]:c.flags&B.TypeFlags.Undefined||c.flags&B.TypeFlags.Void?["undefined"]:c.flags&B.TypeFlags.Null?["object"]:c.getCallSignatures().length>0?["function"]:c.flags&B.TypeFlags.Object?c.getProperties().length===0?["string","number","bigint","boolean","symbol","object","function"]:["object"]:c.flags&B.TypeFlags.NonPrimitive?["object"]:c.flags&B.TypeFlags.Never?["never"]:null}function i(c){if(!n)return null;let F=r.esTreeNodeToTSNodeMap.get(c),d=n.getTypeAtLocation(F.expression);if(d.flags&B.TypeFlags.Any||d.flags&B.TypeFlags.Unknown)return null;let g=[];if(d.isUnion()){for(let P of d.types){let j=p(P);if(j)g.push(...j);else return null}return g}let R=p(d);return R?(g.push(...R),g):null}function a(c){if(!(c.operator==="==="||c.operator==="!=="))return;let d=null,g=null;if(o(c.left)?(d=c.left,g=c.right.type===pe.Literal&&typeof c.right.value=="string"?c.right.value:null):o(c.right)&&(d=c.right,g=c.left.type===pe.Literal&&typeof c.left.value=="string"?c.left.value:null),!d||!g||!zi(g,Ui))return;let R=i(d);if(!R)return;let P=c.operator==="!==",j=R.includes(g);R.length===1?j&&!P?e.report({node:c,messageId:"unnecessaryTypeofCondition",data:{name:Ge(d,e),type:g}}):!j&&P?e.report({node:c,messageId:"unnecessaryTypeofCondition",data:{name:Ge(d,e),type:Array.from(R)[0]}}):!j&&!P?e.report({node:c,messageId:"alwaysFalseTypeofCondition",data:{name:Ge(d,e),actualType:ut(R),conditionType:g}}):j&&P&&e.report({node:c,messageId:"alwaysFalseTypeofCondition",data:{name:Ge(d,e),actualType:ut(R),conditionType:g}}):!j&&!P?e.report({node:c,messageId:"alwaysFalseTypeofCondition",data:{name:Ge(d,e),actualType:ut(R),conditionType:g}}):!j&&P&&e.report({node:c,messageId:"unnecessaryTypeofCondition",data:{name:Ge(d,e),type:ut(R)}})}function l(c){if(c.flags&B.TypeFlags.Any||c.flags&B.TypeFlags.Unknown)return null;if(c.isUnion()){let F=[];for(let d of c.types)if(d.flags&B.TypeFlags.StringLiteral){let g=d.value;F.push(g)}else return null;return F}return c.flags&B.TypeFlags.StringLiteral?[c.value]:null}function s(c){if(!n)return null;let F=r.esTreeNodeToTSNodeMap.get(c),d=n.getTypeAtLocation(F),g=l(d);if(g)return g;let R=n.getSymbolAtLocation(F);if(R){let P=n.getTypeOfSymbolAtLocation(R,F),j=l(P);if(j)return j}return null}function u(c){let F=e.sourceCode.ast,d=null;return Ne(F,g=>{if(g.type===pe.VariableDeclarator&&g.id.type===pe.Identifier&&g.id.name===c.name&&g.id.typeAnnotation){let R=g.id.typeAnnotation.typeAnnotation;if(R.type===pe.TSUnionType){let P=[];for(let j of R.types)if(j.type===pe.TSLiteralType&&j.literal.type===pe.Literal&&typeof j.literal.value=="string")P.push(j.literal.value);else return!0;return d=P,!0}if(R.type===pe.TSLiteralType&&R.literal.type===pe.Literal&&typeof R.literal.value=="string")return d=[R.literal.value],!0}return!1},e.sourceCode),d}function f(c){return c==="Array"||c==="ReadonlyArray"?!0:c.endsWith(".Array")||c.endsWith(".ReadonlyArray")}function y(c){if(!n)return!1;if(n.isArrayType(c)||n.isTupleType(c))return!0;let F=n.getApparentType(c);if(F!==c&&(n.isArrayType(F)||n.isTupleType(F)))return!0;if(c.aliasSymbol){let g=n.getFullyQualifiedName(c.aliasSymbol);if(f(g))return!0}let d=c.getSymbol();if(d){let g=n.getFullyQualifiedName(d);if(f(g))return!0}return!1}function x(c){if(!n)return!1;if(c.flags&B.TypeFlags.StringLike||c.flags&B.TypeFlags.NumberLike||c.flags&B.TypeFlags.BigIntLike||c.flags&B.TypeFlags.BooleanLike||c.flags&B.TypeFlags.ESSymbolLike||c.flags&B.TypeFlags.EnumLike||c.flags&B.TypeFlags.Null||c.flags&B.TypeFlags.Undefined||c.flags&B.TypeFlags.Void||c.flags&B.TypeFlags.Never)return!0;let F=c.getSymbol();if(F){let d=n.getFullyQualifiedName(F);if(d==="__function"||d==="__object"&&!y(c))return!0}return!1}function m(c){if(c.flags&B.TypeFlags.Any||c.flags&B.TypeFlags.Unknown)return"unknown";if(c.isUnion()){let F=!0,d=!0;for(let g of c.types){let R=m(g);if(R==="unknown")return"unknown";R!=="alwaysTrue"&&(F=!1),R!=="alwaysFalse"&&(d=!1)}return F?"alwaysTrue":d?"alwaysFalse":"unknown"}return y(c)?"alwaysTrue":x(c)?"alwaysFalse":"unknown"}function E(c){return!c.computed&&c.object.type===pe.Identifier&&c.object.name===rr.object&&c.property.type===pe.Identifier&&c.property.name===rr.property}function C(c){if(!n||c.callee.type!==pe.MemberExpression||!E(c.callee)||c.arguments.length===0)return;let[F]=c.arguments;if(!F||F.type===pe.SpreadElement)return;let d=r.esTreeNodeToTSNodeMap.get(F),g=n.getTypeAtLocation(d),R=m(g);R==="alwaysTrue"?e.report({node:c,messageId:"unnecessaryArrayIsArrayCondition"}):R==="alwaysFalse"&&e.report({node:c,messageId:"alwaysFalseArrayIsArrayCondition"})}function T(c){if(c.callee.type!==pe.MemberExpression||c.callee.property.type!==pe.Identifier||c.callee.computed)return;let F=c.callee.property.name;if(F!=="startsWith"&&F!=="endsWith"&&F!=="includes"||c.arguments.length!==1)return;let[d]=c.arguments;if(!d||d.type!==pe.Literal||typeof d.value!="string")return;let g=c.callee.object,R=s(g);if(!R&&g.type===pe.Identifier&&(R=u(g)),!R||R.length===0)return;let P=d.value;if(F==="includes"&&R.length>1)return;let j=0,V=0;for(let G of R)if((F==="startsWith"?G.startsWith(P):F==="endsWith"?G.endsWith(P):G.includes(P))?j++:V++,j>0&&V>0)return;if(j>0&&V===0){let G=F==="startsWith"?"unnecessaryStartsWithCondition":F==="endsWith"?"unnecessaryEndsWithCondition":"unnecessaryIncludesCondition";e.report({node:c,messageId:G})}else if(V>0&&j===0){let G=F==="startsWith"?"alwaysFalseStartsWithCondition":F==="endsWith"?"alwaysFalseEndsWithCondition":"alwaysFalseIncludesCondition";e.report({node:c,messageId:G})}}function I(c){if(!new Set(["===","!==",">",">=","<","<="]).has(c.operator))return;function d(H){if(H.type!==pe.MemberExpression||H.computed||H.property.type!==pe.Identifier||H.property.name!=="length")return null;let D=H.object,Z=s(D);if(!Z||Z.length===0)return null;let q=[];for(let ce of Z)q.push(ce.length);return{values:q}}let g=d(c.left),R=d(c.right),P=null,j=null;if(g?c.right.type===pe.Literal&&typeof c.right.value=="number"&&(P=g.values,j=c.right.value):R&&c.left.type===pe.Literal&&typeof c.left.value=="number"&&(P=R.values,j=c.left.value),!P||j===null)return;let V=0,G=0;for(let H of P){let D=!1;if(c.operator==="==="?D=H===j:c.operator==="!=="?D=H!==j:c.operator===">"?D=H>j:c.operator===">="?D=H>=j:c.operator==="<"?D=H<j:c.operator==="<="&&(D=H<=j),D?V++:G++,V>0&&G>0)return}V>0&&G===0?e.report({node:c,messageId:"unnecessaryLengthCondition"}):G>0&&V===0&&e.report({node:c,messageId:"alwaysFalseLengthCondition"})}function A(c){if(c.type===pe.Literal&&typeof c.value=="string")return c.value;let F=s(c);if(!F||F.length!==1)return null;let[d]=F;return d??null}function S(c){return(c.flags&B.TypeFlags.Intersection)!==0}function h(c){return(c.flags&B.TypeFlags.Object)!==0}function b(c){return!n||n.getIndexTypeOfType(c,B.IndexKind.String)?!0:!!n.getIndexTypeOfType(c,B.IndexKind.Number)}function w(c,F){if(!n||b(c)||c.getProperties().length===0)return"unknown";let d=n.getPropertyOfType(c,F);return d?d.flags&B.SymbolFlags.Optional?"optional":"required":"absent"}function k(c,F){if(c.flags&B.TypeFlags.Any||c.flags&B.TypeFlags.Unknown||c.flags&B.TypeFlags.Never||c.flags&B.TypeFlags.TypeParameter||c.flags&B.TypeFlags.IndexedAccess||c.flags&B.TypeFlags.StringLike||c.flags&B.TypeFlags.NumberLike||c.flags&B.TypeFlags.BigIntLike||c.flags&B.TypeFlags.BooleanLike||c.flags&B.TypeFlags.EnumLike||c.flags&B.TypeFlags.ESSymbolLike||c.flags&B.TypeFlags.NonPrimitive||c.flags&B.TypeFlags.Null||c.flags&B.TypeFlags.Undefined||c.flags&B.TypeFlags.Void)return"unknown";if(c.isUnion()){let d=!0,g=!0;for(let R of c.types){let P=k(R,F);if(P==="unknown"||(P!=="required"&&(d=!1),P!=="absent"&&(g=!1),P==="optional"))return"unknown"}return d?"required":g?"absent":"unknown"}if(S(c)){let d=c,g=!1,R=!1;for(let P of d.types){let j=k(P,F);if(j==="unknown")return"unknown";j==="required"?g=!0:j==="optional"&&(R=!0)}return g?"required":R?"optional":"absent"}return h(c)?w(c,F):"unknown"}function N(c){if(c.operator!=="in"||c.left.type===pe.PrivateIdentifier)return;let F=A(c.left);if(!F)return;let d=c.right,g=r.esTreeNodeToTSNodeMap.get(d);if(!n)return;let R=n.getTypeAtLocation(g),P=k(R,F);P==="required"?e.report({node:c,messageId:"unnecessaryInCondition",data:{property:F,type:n.typeToString(R),alternative:t.alternativeForInCondition?`If this a valid condition, you can use as alternative: ${t.alternativeForInCondition}`:""}}):P==="absent"&&e.report({node:c,messageId:"alwaysFalseInCondition",data:{property:F,type:n.typeToString(R),alternative:t.alternativeForInCondition?`If this a valid condition, you can use as alternative: ${t.alternativeForInCondition}`:""}})}return{BinaryExpression(c){a(c),I(c),N(c)},CallExpression(c){T(c),C(c)}}}})};function ut(e){return Array.from(new Set(e)).join(" | ")||"never"}function Ge(e,t){let r=e.argument;return r.type===pe.Identifier?r.name:t.sourceCode.getText(r)}function zi(e,t){return t.has(e)}import{AST_NODE_TYPES as Wi,ESLintUtils as Ji}from"@typescript-eslint/utils";import{z as Dt}from"zod/v4";var Vi=Ji.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),or="no-call-with-explicit-generics",Xi=Dt.object({functions:Dt.array(Dt.string())}),Bi=Vi({name:or,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(Xi)]},defaultOptions:[{functions:[]}],create(e,[t]){let r=new Set(t.functions);return{CallExpression(n){let{callee:o}=n;o.type===Wi.Identifier&&r.has(o.name)&&n.typeArguments&&e.report({node:n,messageId:"noExplicitGenerics",data:{functionName:o.name}})}}}}),jt={name:or,rule:Bi};import{AST_NODE_TYPES as ft,ESLintUtils as Hi}from"@typescript-eslint/utils";var Yi=Hi.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),sr="no-call-with-inferred-generics",qi=Yi({name:sr,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:o}=n;if(o.type!==ft.Identifier)return;let p=r.get(o.name);if(!p)return;let{minGenerics:i=1,allowAny:a,disallowTypes:l=t.disallowTypes}=p;(n.typeArguments?.params.length||0)<(i||0)&&e.report({node:n,messageId:"missingGenericDeclaration",data:{functionName:o.name,minGenerics:i||0}}),!(a&&!l)&&n.typeArguments?.params.some(u=>!a&&u.type===ft.TSAnyKeyword||l&&u.type===ft.TSTypeReference&&u.typeName.type===ft.Identifier&&l.includes(u.typeName.name))&&e.report({node:n,messageId:"anyUsedInGenerics",data:{functionName:o.name}})}}}}),Lt={name:sr,rule:qi};import{ESLintUtils as Zi}from"@typescript-eslint/utils";var Gi=Zi.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),pr="no-commented-out-code",Ki=["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:"],Qi=/^\s*return\s+/,eo=/\w=("|'|`)/,to=/\w+:\s*('|"|`)/,no=/\[['"][^'"]*['"]\]:\s*('|"|`|[^'"`\s])/,ro=/\w+-\w+:/,io=/\w+_\w+:/,oo=/\?\s+\w/,so=/:\s+\w/,ao=/^\s*('|"|`)[^'"]*('|"|`),?\s*$/,lo=/^\s*\d+[,}]/,po=/^\s*\[[^\]]*\][,}]/,co=/^\s*\{[^}]*\}[,}]/,uo=/\.\w+\(/,fo=/\[\w+\]/,mo=/^\s*(['"`]).+?\1\s*:/,yo=/^<[A-Z]\w*(\s|>|\/)/,go=/^<[a-z]+(\s|>|\/)/,So=/<[A-Z]\w*(\s.*)?>/,To=/<\/[A-Z]\w*>/,ho=/<[a-z]+(\s.*)?>/,Eo=/<\/[a-z]+>/,bo=/^\s*[*\s]*$/,xo=/^[a-zA-Z]/,Co=/^[A-Z][A-Za-z]*(?:\s+\d+)?(?:\s+[a-z]+)*:\s+[A-Za-z]/,Io=/```[\s\S]*?```/g,Ao=/`[^`]*`/g,ar=/[a-zA-Z0-9]/,wo=/\.[A-Za-z_][A-Za-z0-9_]*\(/,Fo=/[{}[\]()`=<>]/,Ro=/:\s*(['"`[{(]|\w+\s*=>)/,vo=/\bif\s*\(|\belse\b|=>/,fe={returnStatement:Qi,stringAssignment:eo,objectPropertyWithQuotes:to,computedPropertyAssignment:no,kebabCaseProperty:ro,snakeCaseProperty:io,ternaryOperator:oo,colonWithWord:so,quotedString:ao,numberWithComma:lo,arrayWithComma:po,objectWithComma:co,methodCall:uo,arrayAccess:fo,quotedPropertyKey:mo,jsxSelfClosing:yo,jsxElement:go,jsxOpeningTag:So,jsxClosingTag:To,htmlOpeningTag:ho,htmlClosingTag:Eo,jsdocComment:bo};function ko(e){if(e.includes(":")){let r=e.split(":")[0]?.trim();if(r&&xo.test(r)&&r.includes(" "))return!0}let t=e.trim();return t.length===0||wo.test(t)||Fo.test(t)||Ro.test(t)||vo.test(t)?!1:!!(t.includes(":")&&Co.test(t))}var Po=[") {","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],No=["/>","</",fe.jsxSelfClosing,fe.jsxElement,fe.jsxOpeningTag,fe.jsxClosingTag,fe.htmlOpeningTag,fe.htmlClosingTag],lr=["INFO:","TODO:","DOCS:","FIX:","FIXME:","HACK:","NOTE:","WARNING:","WARN:","BUG:","ISSUE:","TEMP:","TEMPORARY:","XXX:","REVIEW:","eslint"],Oo=Gi({name:pr,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,o){if(n.startsWith("/"))return!1;let p=n.trimStart();if(n.startsWith("*")||p.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 lr)if(p.startsWith(i))return!1;if(n.includes("https://")||ko(p))return!1;if(o==="Block"){for(let i of No)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 Ki)if(p.startsWith(i))return{wrongPattern:i};for(let i of Po)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,o){let p=n,i=p.trim();if(i.startsWith("`")&&(i.endsWith("`,")||i.endsWith("`;")||i.endsWith("`")))return p;if(o==="Block"&&p.includes("```")){let s=p.split(Io);s.some(f=>ar.test(f))&&(p=s.join(""))}if(!p.includes("`"))return p;let a=p.split(Ao);return a.some(s=>ar.test(s))?a.join(""):p}return{Program(){let o=e.sourceCode.getAllComments();for(let p of o){let i=r(p.value,p.type),a=t(i,p.type);a&&e.report({node:p,messageId:"commentedOutCode",data:{wrongPattern:a.wrongPattern,allowedPrefixes:lr.join(", ")}})}}}}}),Mt={name:pr,rule:Oo};import{ESLintUtils as Do,TSESTree as jo}from"@typescript-eslint/utils";var Lo=Do.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),cr="no-default-export",Mo=Lo({name:cr,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===jo.AST_NODE_TYPES.Identifier&&r.exported.name==="default"&&e.report({node:t,messageId:"noDefaultExport"})}}}}),_t={name:cr,rule:Mo};import{ESLintUtils as _o}from"@typescript-eslint/utils";var $o=_o.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),ur="no-leaked-text-in-jsx",Uo=[",",";","[","]","(",")"],zo=$o({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="";Uo.includes(r)?n=r:r.includes("&&")?n="&&":r.includes("||")?n="||":r.endsWith("? (")&&(n="? ("),n&&e.report({node:t,messageId:"leakedTextInJSX",data:{text:n}})}}}}),$t={name:ur,rule:zo};import{AST_NODE_TYPES as rt,ESLintUtils as Wo}from"@typescript-eslint/utils";var Jo=Wo.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),mr="no-non-camel-case-functions",Vo=/^(\$?[a-z][a-zA-Z0-9]*)$/;function fr(e){if(e.typeName.type!==rt.TSQualifiedName)return!1;let{left:t,right:r}=e.typeName;return t.type===rt.Identifier&&t.name==="JSX"&&r.name==="Element"}var Xo=Jo({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&&!Vo.test(t.id.name)){let r=t.returnType?.typeAnnotation;if(r&&(r.type===rt.TSTypeReference?fr(r):r.type===rt.TSUnionType&&r.types.some(o=>o.type===rt.TSTypeReference&&fr(o))))return;e.report({node:t.id,messageId:"nonCamelCaseFunction",data:{functionName:t.id.name}})}}}}}),Ut={name:mr,rule:Xo};import{ESLintUtils as Bo,TSESTree as se}from"@typescript-eslint/utils";var Ho=Bo.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),yr="no-optional-root-props",Yo=Ho({name:yr,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 p=e.sourceCode.getDeclaredVariables(n)[0];if(!p||p.references.length!==1)return!1;let i=p.references[0];if(!i)return!1;for(let a of Pt(i.identifier)){if("returnType"in a||a.type===se.AST_NODE_TYPES.ExportNamedDeclaration)return!1;let l=a.parent;if(!l)return!1;if(l.type===se.AST_NODE_TYPES.TSTypeParameterInstantiation&&l.parent.type===se.AST_NODE_TYPES.TSTypeReference&&l.parent.typeName.type===se.AST_NODE_TYPES.Identifier&&l.parent.typeName.name==="FC"){let u=Ze(l.parent.parent,se.AST_NODE_TYPES.VariableDeclaration,4);if(!u)return!1;let f=mt(u,e.sourceCode);return f?!(f.parent.type===se.AST_NODE_TYPES.CallExpression&&f.parent.callee.type===se.AST_NODE_TYPES.Identifier&&f.parent.callee.name==="memo"):!1}if(a.type===se.AST_NODE_TYPES.AssignmentPattern)return!1;if(l.type===se.AST_NODE_TYPES.ArrowFunctionExpression){let s=Ze(l,se.AST_NODE_TYPES.VariableDeclaration);return s?!!mt(s,e.sourceCode):!1}if(l.type===se.AST_NODE_TYPES.FunctionDeclaration)return!!mt(l,e.sourceCode)}return!1}function r(n){n.key.type!==se.AST_NODE_TYPES.Identifier||!n.optional||e.report({node:n.key,messageId:"optionalNotAllowed",data:{propertyName:n.key.name},suggest:[{messageId:"suggestion",fix:o=>{let p=Ze(n,se.AST_NODE_TYPES.TSPropertySignature);if(!p)return null;let i=e.sourceCode.getText(p);return o.replaceText(p,i.replace("?:",": undefined |"))}}]})}return{TSTypeAliasDeclaration(n){if(n.typeAnnotation.type===se.AST_NODE_TYPES.TSTypeLiteral&&!(yt(n)||!t(n)))for(let o of n.typeAnnotation.members)o.type===se.AST_NODE_TYPES.TSPropertySignature&&r(o)},TSInterfaceDeclaration(n){if(!(yt(n)||!t(n)))for(let o of n.body.body)o.type===se.AST_NODE_TYPES.TSPropertySignature&&r(o)},TSTypeReference(n){if(n.typeName.type!==se.AST_NODE_TYPES.Identifier||n.typeName.name!=="FC"||!n.typeArguments?.params[0])return;let o=n.typeArguments.params[0];if(o.type!==se.AST_NODE_TYPES.TSTypeLiteral)return;let p=Ze(n.parent,se.AST_NODE_TYPES.VariableDeclaration,4);if(!p)return;let i=mt(p,e.sourceCode);if(!(!i||i.parent.type===se.AST_NODE_TYPES.CallExpression&&i.parent.callee.type===se.AST_NODE_TYPES.Identifier&&i.parent.callee.name==="memo"))for(let l of o.members)l.type===se.AST_NODE_TYPES.TSPropertySignature&&r(l)}}}});function yt(e){return e?e.parent?.type===se.AST_NODE_TYPES.ExportNamedDeclaration||e.parent?.type===se.AST_NODE_TYPES.ExportDefaultDeclaration:!1}function mt(e,t){if(yt(e))return;let r;if(e.type===se.AST_NODE_TYPES.VariableDeclaration){if(e.declarations.length!==1)return;e.declarations[0].id.type===se.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===se.AST_NODE_TYPES.FunctionDeclaration&&n.upper&&(n=n.upper);let o=n.variables.find(i=>i.identifiers.includes(r));if(!o)return;let p=o.references.filter(i=>i.identifier!==r);if(!(p.length!==1||!p[0])&&!yt(p[0].identifier.parent.parent))return p[0].identifier}var zt={name:yr,rule:Yo};import{AST_NODE_TYPES as dt}from"@typescript-eslint/utils";var it=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===dt.Identifier?t.has(n.name):n.type===dt.MemberExpression?r(n.object):!1:!1}return{ImportDeclaration(n){for(let o of n.specifiers)t.add(o.local.name)},ExportNamedDeclaration(n){if(n.source){e.report({node:n,messageId:"noReexport"});return}if(n.declaration?.type===dt.VariableDeclaration)for(let o of n.declaration.declarations)r(o.init)&&e.report({node:n,messageId:"noReexport"});n.specifiers.length>0&&e.report({node:n,messageId:"noReexport"})},ExportDefaultDeclaration(n){n.declaration.type===dt.Identifier&&t.has(n.declaration.name)&&e.report({node:n,messageId:"noReexport"})},ExportAllDeclaration(n){e.report({node:n,messageId:"noReexport"})}}}});import{ESLintUtils as qo}from"@typescript-eslint/utils";import Wt from"path";import{z as Je}from"zod/v4";var Zo=qo.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),dr="no-relative-imports",Go=Je.object({find:Je.string(),replacement:Je.string()}),Ko=Je.object({aliases:Je.array(Go),rootDir:Je.string().optional(),allowNotFoundAliases:Je.boolean().optional(),_dev_simulateFileName:Je.string().optional()}),Qo=Zo({name:dr,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(Ko)]},defaultOptions:[{aliases:[],rootDir:void 0}],create(e,[t]){let r=t._dev_simulateFileName??e.filename;function n(i){return i.startsWith(".")||i.startsWith("..")}function o(i,a){let l=Wt.dirname(a);return Wt.resolve(l,i)}function p(i){let a=t.rootDir??process.cwd(),l=Wt.relative(a,i);if(l.startsWith("."))return null;l.startsWith("/")||(l=`/${l}`);for(let{find:s,replacement:u}of t.aliases)if(l.startsWith(u)){let f=l.replace(u,s);return{alias:s,newPath:f}}return null}return{ImportDeclaration(i){let a=i.source.value;if(!n(a))return;let l=o(a,r),s=p(l);!s&&t.allowNotFoundAliases||e.report({node:i,messageId:s?"noRelativeImportsWithAlias":"noRelativeImports",data:{alias:s?.alias},fix:s?u=>u.replaceText(i.source,`'${s.newPath}'`):void 0})}}}}),Jt={name:dr,rule:Qo};import{AST_NODE_TYPES as me}from"@typescript-eslint/utils";import{z as gr}from"zod/v4";var es=gr.object({customMessage:gr.string().optional()}),Vt=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(es)],messages:{noStaticStyleProp:"Static style props are not allowed use css instead.{{customMessage}}"}},defaultOptions:[{}],create(e,[t]){function r(n){switch(n.type){case me.Literal:return!0;case me.ObjectExpression:return n.properties.every(o=>o.type===me.Property?o.computed||o.value.type===me.Identifier&&o.key.type===me.Identifier&&o.key.name===o.value.name?!1:r(o.value):!1);case me.ArrayExpression:return n.elements.every(o=>o?o.type===me.SpreadElement?!1:r(o):!0);case me.TemplateLiteral:return n.expressions.length===0;case me.ConditionalExpression:case me.LogicalExpression:case me.BinaryExpression:case me.UnaryExpression:case me.CallExpression:case me.MemberExpression:case me.Identifier:case me.ArrowFunctionExpression:case me.FunctionExpression:return!1;default:return!1}}return{JSXAttribute(n){if(n.name.type===me.JSXIdentifier&&n.name.name==="style"&&n.value){let o=null;n.value.type===me.JSXExpressionContainer?n.value.expression.type!==me.JSXEmptyExpression&&(o=n.value.expression):n.value.type===me.Literal&&(o=n.value),o&&r(o)&&e.report({node:n,messageId:"noStaticStyleProp",data:{customMessage:t.customMessage?` ${t.customMessage}`:""}})}}}}});import{AST_NODE_TYPES as gt}from"@typescript-eslint/utils";import*as Be from"zod/v4";var ts=Be.object({alternativeMsgs:Be.object({inArrayFind:Be.string().optional(),inArrayFilter:Be.string().optional()}).optional(),__dev_simulateFileName:Be.string().optional()});function ns(e){return e.typeAnnotation.type!==gt.TSTypePredicate?!1:e.typeAnnotation.asserts===!1}var rs=/(typeGuards|type-guards)\.(ts|tsx)$/;function is(e){return rs.test(e)}function os(e){let t=e.parent;for(;t;){if(t.type===gt.CallExpression&&t.callee.type===gt.MemberExpression&&t.callee.property.type===gt.Identifier){let r=t.callee.property.name;if(r==="filter"||r==="find")return{method:r}}t=t.parent}return null}var Xt=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(ts)],hasSuggestions:!0},defaultOptions:[{}],create(e,[t]){let r=t.__dev_simulateFileName??e.filename;if(is(r))return{};function n(o){if(!ns(o))return;let p=os(o);if(t.alternativeMsgs&&p){let i=p.method==="filter"?t.alternativeMsgs.inArrayFilter:t.alternativeMsgs.inArrayFind;if(i){let a=p.method==="filter"?"useFilterWithTypeCheck":"useFindWithTypeCheck";e.report({node:o,messageId:a,data:{message:i}});return}}e.report({node:o,messageId:"typeGuardNotAllowed"})}return{"FunctionDeclaration > :matches(TSTypeAnnotation)":n,"ArrowFunctionExpression > :matches(TSTypeAnnotation)":n,"MethodDefinition > FunctionExpression > :matches(TSTypeAnnotation)":n}}});import{AST_NODE_TYPES as Ke}from"@typescript-eslint/utils";var ss="no-unnecessary-async-on-jsx-props";function as(e){if(e.body.type!==Ke.BlockStatement)return!1;let t=e.body.body;if(t.length!==1)return!1;let r=t[0];return!r||r.type!==Ke.ExpressionStatement?!1:r.expression.type===Ke.AwaitExpression}var Bt=X({name:ss,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){as(r)&&e.report({node:r,messageId:"unnecessaryAsyncInJsxProp",fix(n){let o=e.sourceCode,p=[],i=o.getFirstToken(r,l=>l.value==="async");if(i){let l=o.getTokenAfter(i);l?p.push(n.replaceTextRange([i.range[0],l.range[0]],"")):p.push(n.remove(i))}function a(l){if(l.type===Ke.AwaitExpression){let s=o.getFirstToken(l);if(s&&s.value==="await"){let u=o.getTokenAfter(s);u?p.push(n.replaceTextRange([s.range[0],u.range[0]],"")):p.push(n.remove(s))}}if(l.type===Ke.BlockStatement)for(let s of l.body)a(s);else l.type===Ke.ExpressionStatement&&a(l.expression)}return a(r.body),p}})}return{"JSXAttribute ArrowFunctionExpression[async=true]":t,"JSXAttribute FunctionExpression[async=true]":t}}});import{AST_NODE_TYPES as ot,ESLintUtils as Tr}from"@typescript-eslint/utils";import*as Ht from"typescript";import st from"zod/v4";var ls=Tr.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),Sr="no-unnecessary-casting",ps=st.object({additionalCastFunctions:st.array(st.object({name:st.string(),expectedType:st.enum(["string","number"])})).optional()}),Yt={name:Sr,rule:ls({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:[J(ps)],fixable:"code"},defaultOptions:[{}],create(e){let r=e.options[0].additionalCastFunctions||[],n=[{name:"Number",expectedType:"number"},{name:"String",expectedType:"string"},...r],o=Tr.getParserServices(e,!0),p=o.program?.getTypeChecker();if(!p||!o.program)throw new Error("TypeScript services or program not available");function i(u,f){switch(u.type){case ot.Literal:return f==="number"?typeof u.value=="number":typeof u.value=="string";case ot.TemplateLiteral:return f==="string";case ot.UnaryExpression:return f==="number"?u.operator==="+"||u.operator==="-"||u.operator==="~":!1;default:return!1}}function a(u,f){return f==="number"?!!(u.flags&Ht.TypeFlags.NumberLike):!!(u.flags&Ht.TypeFlags.StringLike)}function l(u,f){return y=>y.replaceText(u,e.sourceCode.getText(f))}function s(u){if(!p||u.arguments.length!==1)return;let f=u.arguments[0];if(!f||f.type===ot.SpreadElement)return;let{callee:y}=u;if(y.type!==ot.Identifier)return;let x=y.name,m=n.find(C=>C.name===x);if(!m)return;if(i(f,m.expectedType)||a(p.getTypeAtLocation(o.esTreeNodeToTSNodeMap.get(f)),m.expectedType)){let C,T;x==="Number"?C="unnecessaryNumberCasting":x==="String"?C="unnecessaryStringCasting":(C="unnecessaryCustomCasting",T={name:m.name,type:m.expectedType}),e.report({node:u,messageId:C,...T?{data:T}:{},fix:l(u,f)})}}return{CallExpression:s}}})};import{AST_NODE_TYPES as Re}from"@typescript-eslint/utils";import*as St from"zod/v4";var cs=St.object({ignoreWithDescription:St.string().optional()}),qt=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(cs)]},defaultOptions:[{}],create(e,[t]){let r=e.getSourceCode(),n=r.ast;function o(l){let s=l.arguments[0];return s&&s.type===Re.Literal&&typeof s.value=="string"?s.value:null}function p(l){return!l||!t.ignoreWithDescription?!1:new RegExp(t.ignoreWithDescription).test(l)}function i(l){return l.length!==1?!1:n.body.filter(u=>{if(u.type===Re.ExpressionStatement){let f=u.expression;if(f.type===Re.CallExpression&&f.callee.type===Re.Identifier){let y=f.callee.name;return["test","it","beforeEach","afterEach","beforeAll","afterAll"].includes(y)}}return!1}).length===0}function a(l){let s=l.arguments[1];if(s&&(s.type===Re.FunctionExpression||s.type===Re.ArrowFunctionExpression)&&s.body.type===Re.BlockStatement){let u=s.body.body;return u.length===0?"":u.map(y=>r.text.slice(y.range[0],y.range[1])).join(`
16
16
 
17
17
  `)}return""}return{Program(){let l=[];for(let y of n.body)y.type===Re.ExpressionStatement&&y.expression.type===Re.CallExpression&&y.expression.callee.type===Re.Identifier&&y.expression.callee.name==="describe"&&y.expression.arguments.length===2&&l.push(y.expression);if(!i(l))return;let[s]=l;if(!s)return;let u=o(s);if(p(u))return;let f=n.body.find(y=>y.type===Re.ExpressionStatement&&y.expression===s);!f||f.type!==Re.ExpressionStatement||e.report({node:s,messageId:"unnecessaryDescribe",suggest:[{messageId:"removeDescribe",fix(y){let x=a(s);return x?y.replaceText(f,x):null}}]})}}}});import{AST_NODE_TYPES as Tt}from"@typescript-eslint/utils";import*as je from"zod/v4";var us=je.object({methods:je.union([je.array(je.string()),je.literal("array")])}),Zt=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(us)]},defaultOptions:[{methods:"array"}],create(e,[t]){let r=t.methods,n=new Set(["find","filter","map","forEach","some","every","reduce","findIndex","sort"]);function o(a){return Array.isArray(r)?r.includes(a):n.has(a)}function p(a){let{callee:l}=a;if(l.type===Tt.MemberExpression){let s=l.property;if(s.type===Tt.Identifier)return s.name}return null}function i(a,l){if(a.type!==Tt.Identifier||!a.typeAnnotation)return;let s=l.parent;if(s.type===Tt.CallExpression){let u=p(s);u&&o(u)&&s.arguments.indexOf(l)===0&&e.report({node:a.typeAnnotation,messageId:"unnecessaryTypeAnnotation",fix(y){return a.typeAnnotation?y.remove(a.typeAnnotation):null}})}}return{ArrowFunctionExpression(a){for(let l of a.params)i(l,a)},FunctionExpression(a){for(let l of a.params)i(l,a)}}}});import{AST_NODE_TYPES as we}from"@typescript-eslint/utils";var Gt=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===we.ObjectPattern||!t.init||t.init.type!==we.ObjectExpression||t.id.type===we.Identifier&&t.id.typeAnnotation||t.parent.parent.type===we.ExportNamedDeclaration)return;let r=new Map;for(let i of t.init.properties)i.type===we.Property&&i.key.type===we.Identifier&&r.set(i.key.name,i);if(r.size===0||t.id.type!==we.Identifier)return;let n=fs(t,e.sourceCode);if(n.length===0)return;let o=t.init.properties.some(i=>i.type!==we.Property?!1:i.value.type===we.FunctionExpression),p=new Set;for(let i of n){if(i.identifier.parent.type!==we.MemberExpression)return;let a=i.identifier.parent;if(a.object!==i.identifier)return;if(a.computed)if(a.property.type===we.Literal&&typeof a.property.value=="string")p.add(a.property.value);else return;else{if(a.property.type!==we.Identifier)return;p.add(a.property.name)}if(a.parent.type===we.CallExpression&&o)return}for(let[i,a]of r)p.has(i)||e.report({node:a,messageId:"unusedObjectProperty",data:{name:i}})}}}});function fs(e,t){let r=t.getDeclaredVariables(e);if(r.length!==1)return[];let n=r[0];return n?n.references.filter(o=>o.identifier!==e.id):[]}import{AST_NODE_TYPES as te}from"@typescript-eslint/utils";import{z as hr}from"zod/v4";var ms=hr.object({ignoreArgsMatching:hr.string().optional()}),Kt=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(ms)]},defaultOptions:[{}],create(e,[t]){let r=[];function n(i){return t.ignoreArgsMatching?new RegExp(t.ignoreArgsMatching).test(i):!1}function o(i){return i.type===te.ExportNamedDeclaration||i.type===te.ExportDefaultDeclaration||i.parent?.type===te.ExportNamedDeclaration||i.parent?.type===te.ExportDefaultDeclaration}function p(i){let a=[];for(let l=0;l<i.length;l++){let s=i[l];if(!s||s.type!==te.Identifier)continue;let u=s.name;if(!n(u)){if(s.optional&&s.typeAnnotation&&s.typeAnnotation.typeAnnotation.type===te.TSTypeLiteral){let f=s.typeAnnotation.typeAnnotation,y=[];for(let x of f.members)x.type===te.TSPropertySignature&&x.key.type===te.Identifier&&y.push({name:x.key.name,optional:x.optional===!0});y.some(x=>x.optional)?a.push({param:s,index:l,name:u,isObjectParam:!0,objectProps:y}):a.push({param:s,index:l,name:u,isObjectParam:!1})}else if(s.optional)a.push({param:s,index:l,name:u,isObjectParam:!1});else if(s.typeAnnotation&&s.typeAnnotation.typeAnnotation.type===te.TSTypeLiteral){let f=s.typeAnnotation.typeAnnotation,y=[];for(let x of f.members)x.type===te.TSPropertySignature&&x.key.type===te.Identifier&&y.push({name:x.key.name,optional:x.optional===!0});y.some(x=>x.optional)&&a.push({param:s,index:l,name:u,isObjectParam:!0,objectProps:y})}}}return a}return{FunctionDeclaration(i){if(o(i))return;let a=p(i.params);a.length!==0&&r.push({node:i,declarationNode:i,optionalParams:a})},VariableDeclarator(i){if(i.id.type!==te.Identifier||!i.init||i.init.type!==te.ArrowFunctionExpression&&i.init.type!==te.FunctionExpression||o(i.parent.parent))return;let l=[...p(i.init.params)];if(i.id.typeAnnotation&&i.id.typeAnnotation.typeAnnotation.type===te.TSTypeReference){let s=i.id.typeAnnotation.typeAnnotation;if(s.typeName.type===te.Identifier&&s.typeName.name==="FC"){let u=s.typeArguments;if(u&&u.params.length===1){let f=u.params[0];if(f&&f.type===te.TSTypeLiteral){let y=[];for(let x of f.members)x.type===te.TSPropertySignature&&x.key.type===te.Identifier&&y.push({name:x.key.name,optional:x.optional===!0});y.some(x=>x.optional)&&l.push({param:i.id,index:0,name:"props",isObjectParam:!0,objectProps:y})}}}}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 s=l.references.filter(y=>y.identifier!==l.identifiers[0]);if(s.length===0)continue;let u=!1;for(let y of s){let x=y.identifier.parent;if(x.type===te.CallExpression&&y.identifier.type===te.Identifier&&x.arguments.includes(y.identifier)){u=!0;break}if(x.type===te.ReturnStatement){u=!0;break}if(x.type===te.Property&&x.parent.type===te.ObjectExpression&&x.parent.parent.type===te.ReturnStatement){u=!0;break}if(x.type===te.JSXExpressionContainer){u=!0;break}}if(u)continue;let f=[];for(let y of s){let x=y.identifier.parent;if(x.type===te.CallExpression&&x.callee===y.identifier){let m=x.arguments.length,E=x.arguments.some(T=>T.type===te.SpreadElement);if(E){u=!0;break}let C={argCount:m,hasSpread:E};for(let T of i.optionalParams)if(T.isObjectParam&&T.index<m){let I=x.arguments[T.index];if(I?.type===te.ObjectExpression){let A={};for(let S of I.properties)S.type===te.Property&&S.key.type===te.Identifier&&(A[S.key.name]=!0);C.objectArgs||(C.objectArgs=[]),C.objectArgs[T.index]=A}else if(I){u=!0;break}}f.push(C)}else if(x.type===te.JSXOpeningElement&&x.name===y.identifier){let m=x.attributes.some(C=>C.type===te.JSXSpreadAttribute);if(m){u=!0;break}let E={argCount:1,hasSpread:m};for(let C of i.optionalParams)if(C.isObjectParam&&C.index===0){let T={};for(let I of x.attributes)I.type===te.JSXAttribute&&I.name.type===te.JSXIdentifier&&(T[I.name.name]=!0);E.objectArgs||(E.objectArgs=[]),E.objectArgs[0]=T}f.push(E)}}if(!(u||f.length===0))for(let y of i.optionalParams)if(y.isObjectParam&&y.objectProps)for(let x of y.objectProps){if(!x.optional)continue;let m=!1;for(let E of f)if(E.objectArgs&&E.objectArgs[y.index]){let C=E.objectArgs[y.index];if(C&&C[x.name]){m=!0;break}}m||e.report({node:y.param,messageId:"unusedOptionalProp",data:{name:x.name}})}else{let x=!1;for(let m of f)if(m.argCount>y.index){x=!0;break}x||e.report({node:y.param,messageId:"unusedOptionalArg",data:{name:y.name}})}}}}}});import{AST_NODE_TYPES as le,ESLintUtils as ys}from"@typescript-eslint/utils";import{z as He}from"zod/v4";var ds=He.object({selectors:He.array(He.object({name:He.string(),selectorProp:He.string().optional(),selectorArgPos:He.number().optional(),returnProp:He.string().optional()}))}),gs=ys.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),Er="no-unused-selected-values",Qt={name:Er,rule:gs({name:Er,meta:{type:"suggestion",docs:{description:"Disallow unused values in selector objects"},messages:{unusedSelectedValue:'The selected value "{{name}}" is not being used'},schema:[J(ds)]},defaultOptions:[{selectors:[]}],create(e,[t]){let{selectors:r=[]}=t,n=new Map(r.map(o=>[o.name,o]));return{VariableDeclarator(o){let p=null;if(o.init?.type===le.CallExpression&&(p=o.init),!p)return;let i=Ts(p);if(!i)return;let a=n.get(i);if(!a)return;let l=Ss(p,a.selectorArgPos??0,a.selectorProp);if(!l)return;let s=hs(l);if(!s)return;let u=br(s.properties,void 0);if(!u)return;if(o.id.type===le.ObjectPattern){let x=br(o.id.properties,a.returnProp);if(!x)return;for(let[m,E]of u)x.has(m)||e.report({node:E,messageId:"unusedSelectedValue",data:{name:m}});return}if(o.id.type!==le.Identifier||a.returnProp)return;let f=Es(o,e.sourceCode);if(f.length===0)return;let y=new Set;for(let x of f){if(x.identifier.parent.type!==le.MemberExpression)return;let m=x.identifier.parent.property;if(m.type!==le.Identifier)return;y.add(m.name)}for(let[x,m]of u)y.has(x)||e.report({node:m,messageId:"unusedSelectedValue",data:{name:x}})}}}})};function Ss(e,t,r){let n=e.arguments[t];if(!n)return null;if(n.type===le.ArrowFunctionExpression||n.type===le.FunctionExpression)return n;if(r&&n.type===le.ObjectExpression){let o=n.properties.find(i=>i.type===le.Property&&i.key.type===le.Identifier&&i.key.name===r);if(o?.type!==le.Property)return null;let p=o.value;if(p.type===le.ArrowFunctionExpression||p.type===le.FunctionExpression)return p}return null}function Ts(e){return e.callee.type===le.Identifier?e.callee.name:e.callee.type===le.MemberExpression&&e.callee.property.type===le.Identifier?e.callee.property.name:null}function hs(e){if(e.body.type===le.ObjectExpression)return e.body;if(e.body.type===le.BlockStatement){let t=e.body.body.filter(r=>r.type===le.ReturnStatement);return t.length!==1||!t[0]||t[0].argument?.type!==le.ObjectExpression?null:t[0].argument}return null}function br(e,t){let r=e;if(t){let o=e.find(p=>p.type===le.Property&&p.key.type===le.Identifier&&p.key.name===t);if(o?.type!==le.Property||o.value.type!==le.ObjectPattern)return null;r=o.value.properties}let n=new Map;for(let o of r){if(o.type!==le.Property||o.key.type!==le.Identifier)return null;n.set(o.key.name,o)}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(o=>o.identifier!==e.id):[]}import{AST_NODE_TYPES as ae}from"@typescript-eslint/utils";var en=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(p=>p.type===ae.ImportDeclaration&&p.source.value==="t-state-form"))return{};let n=null,o=!1;return{CallExpression(p){if(o)return;if(!n){let a=bs(p);a&&(n=a);return}let i=xs(p,e.sourceCode);if(i){o=!0;for(let a of i)n.delete(a);if(n.size!==0)for(let[a,l]of n)e.report({node:l,messageId:"unusedField",data:{name:a}})}}}}});function bs(e){if(!(e.callee.type===ae.Identifier&&e.callee.name==="useForm"))return null;let r=e.arguments[0];if(!r||r.type!==ae.ObjectExpression)return null;let n=Nt(r.properties,p=>p.type!==ae.Property||p.key.type!==ae.Identifier||p.key.name!=="initialConfig"?null:p.value.type===ae.ObjectExpression?p.value:p.value.type===ae.ArrowFunctionExpression||p.value.type===ae.FunctionExpression?Cs(p.value):null);if(!n)return null;let o=new Map;for(let p of n.properties)p.type===ae.Property&&p.key.type===ae.Identifier&&o.set(p.key.name,p);return o}function xs(e,t){if(!(e.callee.type===ae.Identifier&&e.callee.name==="useFormState")||e.parent.type!==ae.VariableDeclarator||e.parent.id.type!==ae.ObjectPattern||!Nt(e.parent.id.properties,i=>i.type===ae.Property&&i.key.type===ae.Identifier&&i.key.name==="formFields"&&i))return null;let o=er(e.parent,"formFields",t),p=new Set;for(let{identifier:i}of o){if(i.type!==ae.Identifier||i.parent.type===ae.Property&&i.parent.parent.type===ae.ObjectExpression&&i.parent.parent.parent.type===ae.ReturnStatement||i.parent.type===ae.ReturnStatement)return null;if(i.parent.type===ae.MemberExpression){if(i.parent.object.type!==ae.Identifier||i.parent.property.type!==ae.Identifier)return null;p.add(i.parent.property.name)}}return p}function Cs(e){if(e.body.type===ae.ObjectExpression)return e.body;if(e.body.type===ae.BlockStatement){let t=e.body.body.filter(r=>r.type===ae.ReturnStatement);return t.length!==1||!t[0]||t[0].argument?.type!==ae.ObjectExpression?null:t[0].argument}return null}import{AST_NODE_TYPES as ie,ESLintUtils as Is}from"@typescript-eslint/utils";import{z as ht}from"zod/v4";var As=Is.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`);function xr(e){let t=[];for(let r of e.members)r.type===ie.TSPropertySignature&&r.key.type===ie.Identifier&&t.push([r.key.name,r]);return t}function Cr(e,...t){for(let r of t)e.set(...r);return e}var ws=ht.object({forceCheckOnFCPropTypesWithName:ht.array(ht.string()).optional(),alwaysCheckFunctionOptionTypes:ht.boolean().optional()}),Ir="no-unused-type-props-in-args",tn=null,Fs=As({name:Ir,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(ws)],fixable:"code"},defaultOptions:[{alwaysCheckFunctionOptionTypes:!0}],create(e,[t]){let{forceCheckOnFCPropTypesWithName:r,alwaysCheckFunctionOptionTypes:n=!0}=t;r&&!tn&&(tn=r.map(l=>new RegExp(l)));function o(l,s,u,f,y=!0,x=!1){let m=u.name,E=e.sourceCode.getScope(s).references.find(S=>S.identifier.name===m)?.resolved,C=l&&tn?.some(S=>S.test(m)),T=x&&n;if(!E||!C&&E.references.filter(S=>S.isTypeReference).length>1||!E.defs[0])return;let I=E.defs[0].node,A=I.parent?.type===ie.ExportNamedDeclaration;if(!(y&&A&&!T)){if(I.type===ie.TSTypeAliasDeclaration){p(l,s,f,I.typeAnnotation,!0,x);return}if(I.type===ie.TSInterfaceDeclaration){p(l,s,f,I.body,!0,x);return}}}function p(l,s,u,f,y,x=!1){if(f.type===ie.TSInterfaceBody){for(let m of f.body)m.type===ie.TSPropertySignature&&m.key.type===ie.Identifier&&u.set(m.key.name,m);return}if(f.type===ie.TSTypeLiteral){Cr(u,...xr(f));return}if(f.type===ie.TSIntersectionType){for(let m of f.types)p(l,s,u,m,!0,x);return}y||f.type===ie.TSTypeReference&&f.typeName.type===ie.Identifier&&o(l,s,f.typeName,u,!0,x)}function i(l,s,u,f=!1){for(let y of u)if(y.type===ie.ObjectPattern&&y.typeAnnotation){let x=new Map;if(p(l,s,x,y.typeAnnotation.typeAnnotation,!1,f),x.size===0)continue;a(y,x)}else y.type===ie.AssignmentPattern&&y.left.type===ie.ObjectPattern&&i(l,s,[y.left],f)}function a(l,s){let u=[];if(l.properties.at(-1)?.type===ie.RestElement)return;for(let m of l.properties)m.type===ie.Property&&m.key.type===ie.Identifier&&u.push(m.key.name);let y=[],x=[];for(let[m,E]of s)u.includes(m)||(x.push(m),y.push({node:E,messageId:"unusedObjectTypeProperty",data:{propertyName:m}}));for(let[m,E]of y.entries())e.report({...E,fix:m===y.length-1?C=>{let T=l.properties.at(-1),I=x.join(", ");return T?T.type===ie.RestElement?null:C.insertTextAfter(T,`, ${I}`):C.insertTextBeforeRange([l.range[0]+1,l.range[1]],I)}:void 0})}return{VariableDeclaration(l){let s=l.declarations[0],u=new Map,f=s.id.type===ie.Identifier&&s.id.typeAnnotation?.typeAnnotation.type===ie.TSTypeReference&&s.id.typeAnnotation.typeAnnotation.typeName.type===ie.Identifier&&s.id.typeAnnotation.typeAnnotation.typeName.name==="FC"&&s.id.typeAnnotation.typeAnnotation.typeArguments?.params[0];if(f){if(f.type===ie.TSTypeReference&&f.typeName.type===ie.Identifier)o(!0,l,f.typeName,u,!1);else if(f.type===ie.TSTypeLiteral)Cr(u,...xr(f));else if(f.type===ie.TSIntersectionType)for(let y of f.types)y.type===ie.TSTypeReference&&y.typeName.type===ie.Identifier?o(!0,l,y.typeName,u,!1):p(!0,l,u,y,!0);if(u.size!==0&&s.init?.type===ie.ArrowFunctionExpression){let y=s.init.params[0];if(!y){e.report({node:s.init,messageId:"missingComponentParam"});return}y.type===ie.ObjectPattern&&a(y,u)}}},FunctionDeclaration(l){i(!1,l,l.params,n)},ArrowFunctionExpression(l){i(!1,l,l.params,n)}}}}),nn={name:Ir,rule:Fs};import{AST_NODE_TYPES as Oe}from"@typescript-eslint/utils";var rn=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===Oe.Identifier?t.has(n.callee.name):n.callee.type===Oe.MemberExpression&&n.callee.object.type===Oe.Identifier&&n.callee.property.type===Oe.Identifier?n.callee.property.name==="useRef":!1}return{ImportDeclaration(n){if(n.source.value==="react")for(let o of n.specifiers)o.type===Oe.ImportSpecifier&&o.imported.type===Oe.Identifier&&o.imported.name==="useRef"&&t.add(o.local.name)},VariableDeclarator(n){if(n.init&&n.init.type===Oe.CallExpression&&r(n.init)&&n.id.type===Oe.Identifier){let p=e.sourceCode.getScope(n).set.get(n.id.name);if(p){let i=!1;for(let a of p.references){let s=a.identifier.parent;if(s!==n&&!(s.type===Oe.JSXExpressionContainer&&s.parent.type===Oe.JSXAttribute&&s.parent.name.type===Oe.JSXIdentifier&&s.parent.name.name==="ref")){i=!0;break}}i||e.report({node:n.id,messageId:"refNotRead",data:{name:n.id.name}})}}}}}});import{AST_NODE_TYPES as on,ESLintUtils as Rs}from"@typescript-eslint/utils";var vs=Rs.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),wr="prefer-named-functions",Ar=new Map,ks=vs({name:wr,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=Ar.get(t.ignoreRegex);n?r=n:(r=new RegExp(t.ignoreRegex),Ar.set(t.ignoreRegex,r))}return{VariableDeclarator(n){if(n.init&&n.init.type===on.ArrowFunctionExpression&&n.id.type===on.Identifier){let o=n.id.name;if(n.id.typeAnnotation||r&&r.test(o)||!t.disallowArrowFnWithImplicitReturns&&n.init.body.type!==on.BlockStatement)return;let p=n.parent,i=n.init.params,a=n.init.body,l=n.init;e.report({node:n.id,messageId:r?"withIgnoreRegex":"default",data:{functionName:o,ignoreRegex:t.ignoreRegex},suggest:[{messageId:"suggestion",fix:s=>s.replaceText(p,`${l.async?"async ":""}function ${o}(${i.map(u=>e.sourceCode.getText(u)).join(", ")||""}) ${e.sourceCode.getText(a)}`)}]})}}}}}),sn={name:wr,rule:ks};import{AST_NODE_TYPES as Q}from"@typescript-eslint/utils";import{z as $e}from"zod/v4";var Ps=$e.object({disallowedFunctions:$e.array($e.object({name:$e.string(),allowUsingWithArgs:$e.boolean().optional(),hookAlternative:$e.string().optional(),message:$e.string().optional(),allowUseInside:$e.array($e.string()).optional()}))}),Ns=/^use[A-Z]/,Os=/^[A-Z]/;function Et(e){return Ns.test(e)}function Fr(e){return Os.test(e)}function Ds(e){return e.type===Q.Identifier?Et(e.name):e.type===Q.MemberExpression&&e.property.type===Q.Identifier?Et(e.property.name):!1}function Rr(e,t){return e.type===Q.Identifier?e.name===t:e.type===Q.MemberExpression&&e.object.type===Q.Identifier&&e.property.type===Q.Identifier?e.object.name==="React"&&e.property.name===t:!1}function vr(e){return!!(e.parent&&e.parent.type===Q.CallExpression&&Rr(e.parent.callee,"forwardRef"))}function kr(e){return!!(e.parent&&e.parent.type===Q.CallExpression&&Rr(e.parent.callee,"memo"))}function an(e){if(e.type===Q.FunctionDeclaration||e.type===Q.FunctionExpression&&e.id)return e.id||void 0;if(e.type===Q.FunctionExpression||e.type===Q.ArrowFunctionExpression){if(e.parent.type===Q.VariableDeclarator&&e.parent.init===e)return e.parent.id;if(e.parent.type===Q.AssignmentExpression&&e.parent.right===e&&e.parent.operator==="=")return e.parent.left;if(e.parent.type===Q.Property&&e.parent.value===e&&!e.parent.computed)return e.parent.key;if(e.parent.type===Q.AssignmentPattern&&e.parent.right===e)return e.parent.left}}function js(e){let t=e.parent,r=!1;for(;t;){if(t.type===Q.FunctionDeclaration||t.type===Q.FunctionExpression||t.type===Q.ArrowFunctionExpression){let n=an(t);if(n&&n.type===Q.Identifier){if(Fr(n.name)||Et(n.name))return!r;r=!0}else{if(vr(t)||kr(t))return!r;if(t.parent.type===Q.CallExpression){let o=t.parent;Ds(o.callee)||(r=!0)}else t.parent.type===Q.JSXExpressionContainer||(r=!0)}}t=t.parent}return!1}function Pr(e){return e.callee.type===Q.Identifier?e.callee.name:e.callee.type===Q.MemberExpression&&e.callee.property.type===Q.Identifier?e.callee.property.name:null}function Ls(e,t){if(!t.length)return!1;let r=e.parent;for(;r;){if(r.type===Q.FunctionDeclaration||r.type===Q.FunctionExpression||r.type===Q.ArrowFunctionExpression){let n=an(r);if(n&&n.type===Q.Identifier&&t.includes(n.name))return!0}else if(r.type===Q.CallExpression){let n=Pr(r);if(n&&t.includes(n))return!0}r=r.parent}return!1}function Ms(e){return e.arguments.length>0&&!e.arguments.every(t=>t.type===Q.Identifier&&t.name==="undefined")}function _s(e,t){let r=!1,n=e.parent;for(;n;){if(n.type===Q.FunctionDeclaration||n.type===Q.FunctionExpression||n.type===Q.ArrowFunctionExpression){let o=an(n);if(o&&o.type===Q.Identifier){if(Fr(o.name)||Et(o.name)){r=!0;break}}else if(vr(n)||kr(n)){r=!0;break}}n=n.parent}return r?t.length===0?js(e):!Ls(e,t):!1}var ln=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(o=>[o.name,o]));return{CallExpression(o){let p=Pr(o);if(!p)return;let i=n.get(p);if(!i||i.allowUsingWithArgs&&Ms(o))return;let a=i.allowUseInside||[];_s(o,a)&&e.report({node:o,messageId:"preferHookAlternative",data:{message:i.message?` ${i.message}`:` use ${i.hookAlternative} instead`},suggest:i.hookAlternative?[{messageId:"preferHookAlternative",data:{message:`Replace with ${i.hookAlternative}`,hookAlternative:i.hookAlternative},fix:l=>{let s=i.hookAlternative;return s?o.callee.type===Q.Identifier?l.replaceText(o.callee,s):o.callee.type===Q.MemberExpression&&o.callee.property.type===Q.Identifier?l.replaceText(o.callee.property,s):null:null}}]:[]})}}}});import{AST_NODE_TYPES as de,AST_TOKEN_TYPES as Nr,ESLintUtils as $s}from"@typescript-eslint/utils";import pn from"zod/v4";var Us=$s.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),Dr="prefer-single-line-if",zs=pn.object({maxLineLength:pn.number().optional(),maxNonSimpleConditionLength:pn.number().optional()}),Ws=Us({name:Dr,meta:{type:"suggestion",fixable:"code",docs:{description:"Enforce single-line if in simple if statements"},messages:{noSingleLineCurly:"If return statement with single statement body should be written in a single line"},schema:[J(zs)]},defaultOptions:[{}],create(e,[t]){let r=e.sourceCode;return{IfStatement(n){if(n.consequent.type!==de.BlockStatement||n.loc.start.line===n.loc.end.line||r.getCommentsInside(n.consequent).length>0||n.alternate||n.consequent.body.length!==1)return;let p=n.consequent.body[0];if(!p)return;if(p.type===de.ReturnStatement){if(!Lr(p))return}else if(!(p.type===de.ContinueStatement||p.type===de.BreakStatement))return;if(n.test.type===de.LogicalExpression||n.test.type===de.ConditionalExpression)return;let i;if(t.maxNonSimpleConditionLength){let f=Or(n.test);if(!f&&n.test.type===de.UnaryExpression&&n.test.operator==="!"){let y=n.test.argument;Or(y)&&(f=!0)}if(f&&(i=r.getText(n.test),i.length>t.maxNonSimpleConditionLength))return}i||(i=r.getText(n.test));let a=r.getText(p);if(i.includes(`
18
- `))return;let l=r.getTokenAfter(n);if(l&&l.type===Nr.Punctuator&&l.value==="}"){let f=r.getTokenAfter(l);if(f&&f.type===Nr.Keyword&&(f.value==="else"||f.value==="catch"))return}let s=Js(r,n),u=`if (${i}) ${a}`;t.maxLineLength&&u.length+s.length>t.maxLineLength||e.report({node:n,messageId:"noSingleLineCurly",fix:f=>f.replaceText(n,u)})}}}});function Or(e){return e.type===de.CallExpression||e.type===de.BinaryExpression||e.type===de.MemberExpression&&jr(e)}function jr(e){return e.object.type===de.MemberExpression?jr(e.object):e.object.type!==de.Identifier}function Js(e,t){return e.text.slice(t.range[0]-t.loc.start.column,t.range[0])}function Lr(e){if(!e.argument)return!0;let t=e.argument;return t.type===de.ArrayExpression&&t.elements.length===0||t.type===de.ObjectExpression&&t.properties.length===0||t.type===de.Literal||t.type===de.Identifier||t.type===de.TemplateLiteral||t.type===de.TaggedTemplateExpression?!0:t.type===de.CallExpression?t.arguments.length===0:t.type===de.UnaryExpression?Lr(t):!1}var cn={name:Dr,rule:Ws};import{AST_NODE_TYPES as M,ESLintUtils as Vs}from"@typescript-eslint/utils";import{z as Mr}from"zod/v4";var Xs=Vs.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),zr="react-compiler-extra",Bs=Mr.object({runOnlyWithEnableCompilerDirective:Mr.boolean().optional()}),Hs=/eslint +react-compiler\/react-compiler: +\["error/;function Qe(e){let t=null;if((e.type===M.FunctionDeclaration||e.type===M.FunctionExpression||e.type===M.ArrowFunctionExpression&&e.body.type===M.BlockStatement)&&(t=e.body),!t||t.body.length===0)return!1;let r=t.body[0];return r?r.type===M.ExpressionStatement&&r.expression.type===M.Literal&&r.expression.value==="use no memo":!1}function Ys(e){let t=e.parent;for(;t;){if(t.type===M.FunctionDeclaration||t.type===M.FunctionExpression||t.type===M.ArrowFunctionExpression)return t;t=t.parent}return null}function Wr(e){return e.type===M.Identifier?e.name.startsWith("use"):!1}function qs(e){return e.type===M.Identifier?e.name.startsWith("use"):e.type===M.MemberExpression&&e.property.type===M.Identifier?e.property.name.startsWith("use"):!1}function Le(e){if(!e)return!1;switch(e.type){case M.JSXElement:case M.JSXFragment:return!0;case M.ConditionalExpression:return Le(e.consequent)||Le(e.alternate);case M.LogicalExpression:return e.operator==="&&"?Le(e.right):e.operator==="||"?Le(e.left)||Le(e.right):!1;case M.CallExpression:if(e.callee.type===M.MemberExpression&&e.callee.object.type===M.Identifier&&e.callee.object.name==="React"&&e.callee.property.type===M.Identifier&&e.callee.property.name==="createElement")return!0;for(let t of e.arguments)if(t.type!==M.SpreadElement&&Le(t))return!0;return!1;default:return!1}}function Zs(e){let t=e.typeAnnotation;if(t.type===M.TSTypeReference){if(t.typeName.type===M.Identifier)return t.typeName.name==="FC";if(t.typeName.type===M.TSQualifiedName&&t.typeName.left.type===M.Identifier&&t.typeName.right.type===M.Identifier)return t.typeName.left.name==="React"&&t.typeName.right.name==="FC"}return!1}var Gs=/^[A-Z][a-zA-Z0-9]*$/;function lt(e){return Gs.test(e)}function fn(e){return e.startsWith("use")&&e.length>3}function mn(e,t,r,n){if(r&&Zs(r))return t?lt(t.name):e.type===M.FunctionDeclaration&&e.id?lt(e.id.name):!0;if(t&&fn(t.name)||e.type===M.FunctionDeclaration&&e.id&&fn(e.id.name))return!0;if(n){let o=t?.name||e.type===M.FunctionDeclaration&&e.id?.name;if(o&&lt(o)&&Jr(e.body,n).containsJSX)return!0}return!1}function at(e){if(e.body.type===M.BlockStatement){for(let t of e.body.body)if(t.type===M.ExpressionStatement&&t.expression.type===M.Literal&&typeof t.expression.value=="string"&&t.expression.value==="use memo")return!0}return!1}function Jr(e,t){let r={containsJSX:!1,containsHookCalls:!1};return Ne(e,n=>{if(r.containsJSX&&r.containsHookCalls)return!0;switch(n.type){case M.JSXElement:case M.JSXFragment:r.containsJSX=!0;break;case M.CallExpression:Wr(n.callee)&&(r.containsHookCalls=!0),Le(n)&&(r.containsJSX=!0);break;case M.ReturnStatement:n.argument&&Le(n.argument)&&(r.containsJSX=!0);break;case M.VariableDeclarator:n.init&&Le(n.init)&&(r.containsJSX=!0);break;case M.AssignmentExpression:Le(n.right)&&(r.containsJSX=!0);break}},t),r}function _r(e,t){let r=e.body,n=Jr(r,t);return n.containsJSX||n.containsHookCalls}var Ks=/\bthis[.[]/;function $r(e){return Ks.test(e)}function Qs(e,t){let r={containsJSX:!1,containsHookCalls:!1};return Ne(e,n=>{if(r.containsHookCalls||(n.type===M.FunctionDeclaration||n.type===M.FunctionExpression||n.type===M.ArrowFunctionExpression)&&n!==e)return!0;n.type===M.CallExpression&&qs(n.callee)&&(r.containsHookCalls=!0)},t),r}function Ur(e){return lt(e)||fn(e)}function un(e,t,r,n){if(!Qs(e.body,t).containsHookCalls)return!1;let p=mn(e,r,n,t);if(!p&&n){let i=r?.name||e.type===M.FunctionDeclaration&&e.id?.name;i&&lt(i)&&(p=!0)}return!p}var ea=Xs({name:zr,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(Bs)]},defaultOptions:[{}],create(e,[t]){let r=!1;if(t.runOnlyWithEnableCompilerDirective){for(let i of e.sourceCode.getAllComments())if(Hs.test(i.value)){r=!0;break}if(!r)return{}}function n(i){for(let a of i.properties)if(a.type===M.Property&&a.method&&a.value.type===M.FunctionExpression){let l=e.sourceCode,s=l.getText(a.key),u=a.value,f=l.getText(u.body);if($r(f))e.report({node:a,messageId:"thisKeywordInMethod"});else{let y=u.params.map(m=>l.getText(m)).join(", "),x="";u.generator?x=`${s}: function* (${y}) ${f}`:x=`${s}: (${y}) => ${f}`,e.report({node:a,messageId:"objectMethodIsNotSupported",fix:m=>m.replaceText(a,x)})}}}function o(i){for(let a of i.properties)if(a.type===M.Property&&a.value.type===M.ObjectExpression){for(let l of a.value.properties)if(l.type===M.Property&&l.method&&l.value.type===M.FunctionExpression){let u=e.sourceCode.getText(l.value.body);$r(u)&&e.report({node:l,messageId:"thisKeywordInMethod"})}}}function p(i){let a=Ys(i);return a!==null&&Qe(a)}return{CallExpression(i){if(Wr(i.callee))for(let a of i.arguments){if(a.type===M.ObjectExpression){if(p(i))return;n(a),o(a)}if(a.type===M.ArrowFunctionExpression){if(a.body.type===M.ObjectExpression){if(p(i))return;n(a.body),o(a.body)}if(a.body.type===M.BlockStatement){for(let l of a.body.body)if(l.type===M.ReturnStatement&&l.argument?.type===M.ObjectExpression){if(p(i))return;n(l.argument),o(l.argument)}}}if(a.type===M.FunctionExpression){for(let l of a.body.body)if(l.type===M.ReturnStatement&&l.argument?.type===M.ObjectExpression){if(p(i))return;n(l.argument),o(l.argument)}}}},VariableDeclarator(i){if(i.id.type===M.Identifier&&i.init&&(i.init.type===M.ArrowFunctionExpression||i.init.type===M.FunctionExpression)){let a=i.init,l=i.id,s=i.id.typeAnnotation;if(at(a)&&!Ur(l.name)){e.report({node:a,messageId:"useMemoDirectiveNaming"});return}if(un(a,e.sourceCode,l,s)){if(Qe(a))return;e.report({node:a,messageId:"functionCallingHooksMustBeComponent"});return}if(mn(a,l,s,e.sourceCode)){let u=_r(a,e.sourceCode),f=at(a);if(!u&&!f){if(Qe(a))return;e.report({node:a,messageId:"fcComponentShouldReturnJsx",suggest:[{messageId:"addUseMemoDirective",fix(y){if(a.body.type===M.BlockStatement){let x=a.body.range[0]+1;return y.insertTextAfterRange([x,x],`
18
+ `))return;let l=r.getTokenAfter(n);if(l&&l.type===Nr.Punctuator&&l.value==="}"){let f=r.getTokenAfter(l);if(f&&f.type===Nr.Keyword&&(f.value==="else"||f.value==="catch"))return}let s=Js(r,n),u=`if (${i}) ${a}`;t.maxLineLength&&u.length+s.length>t.maxLineLength||e.report({node:n,messageId:"noSingleLineCurly",fix:f=>f.replaceText(n,u)})}}}});function Or(e){return e.type===de.CallExpression||e.type===de.BinaryExpression||e.type===de.MemberExpression&&jr(e)}function jr(e){return e.object.type===de.MemberExpression?jr(e.object):e.object.type!==de.Identifier}function Js(e,t){return e.text.slice(t.range[0]-t.loc.start.column,t.range[0])}function Lr(e){if(!e.argument)return!0;let t=e.argument;return t.type===de.ArrayExpression&&t.elements.length===0||t.type===de.ObjectExpression&&t.properties.length===0||t.type===de.Literal||t.type===de.Identifier||t.type===de.TemplateLiteral||t.type===de.TaggedTemplateExpression?!0:t.type===de.CallExpression?t.arguments.length===0:t.type===de.UnaryExpression?Lr(t):!1}var cn={name:Dr,rule:Ws};import{AST_NODE_TYPES as M,ESLintUtils as Vs}from"@typescript-eslint/utils";import{z as Mr}from"zod/v4";var Xs=Vs.RuleCreator(e=>`https://github.com/lucasols/extended-lint#${e}`),zr="react-compiler-extra",Bs=Mr.object({runOnlyWithEnableCompilerDirective:Mr.boolean().optional()}),Hs=/eslint +react-compiler\/react-compiler: +\["error/;function Qe(e){let t=null;if((e.type===M.FunctionDeclaration||e.type===M.FunctionExpression||e.type===M.ArrowFunctionExpression&&e.body.type===M.BlockStatement)&&(t=e.body),!t||t.body.length===0)return!1;let r=t.body[0];return r?r.type===M.ExpressionStatement&&r.expression.type===M.Literal&&r.expression.value==="use no memo":!1}function Ys(e){let t=e.parent;for(;t;){if(t.type===M.FunctionDeclaration||t.type===M.FunctionExpression||t.type===M.ArrowFunctionExpression)return t;t=t.parent}return null}function qs(e){return e.type===M.Identifier?e.name.startsWith("use"):!1}function Wr(e){return e.type===M.Identifier?e.name.startsWith("use"):e.type===M.MemberExpression&&e.property.type===M.Identifier?e.property.name.startsWith("use"):!1}function Le(e){if(!e)return!1;switch(e.type){case M.JSXElement:case M.JSXFragment:return!0;case M.ConditionalExpression:return Le(e.consequent)||Le(e.alternate);case M.LogicalExpression:return e.operator==="&&"?Le(e.right):e.operator==="||"?Le(e.left)||Le(e.right):!1;case M.CallExpression:if(e.callee.type===M.MemberExpression&&e.callee.object.type===M.Identifier&&e.callee.object.name==="React"&&e.callee.property.type===M.Identifier&&e.callee.property.name==="createElement")return!0;for(let t of e.arguments)if(t.type!==M.SpreadElement&&Le(t))return!0;return!1;default:return!1}}function Zs(e){let t=e.typeAnnotation;if(t.type===M.TSTypeReference){if(t.typeName.type===M.Identifier)return t.typeName.name==="FC";if(t.typeName.type===M.TSQualifiedName&&t.typeName.left.type===M.Identifier&&t.typeName.right.type===M.Identifier)return t.typeName.left.name==="React"&&t.typeName.right.name==="FC"}return!1}var Gs=/^[A-Z][a-zA-Z0-9]*$/;function lt(e){return Gs.test(e)}function fn(e){return e.startsWith("use")&&e.length>3}function mn(e,t,r,n){if(r&&Zs(r))return t?lt(t.name):e.type===M.FunctionDeclaration&&e.id?lt(e.id.name):!0;if(t&&fn(t.name)||e.type===M.FunctionDeclaration&&e.id&&fn(e.id.name))return!0;if(n){let o=t?.name||e.type===M.FunctionDeclaration&&e.id?.name;if(o&&lt(o)&&Jr(e.body,n).containsJSX)return!0}return!1}function at(e){if(e.body.type===M.BlockStatement){for(let t of e.body.body)if(t.type===M.ExpressionStatement&&t.expression.type===M.Literal&&typeof t.expression.value=="string"&&t.expression.value==="use memo")return!0}return!1}function Jr(e,t){let r={containsJSX:!1,containsHookCalls:!1};return Ne(e,n=>{if(r.containsJSX&&r.containsHookCalls)return!0;switch(n.type){case M.JSXElement:case M.JSXFragment:r.containsJSX=!0;break;case M.CallExpression:qs(n.callee)&&(r.containsHookCalls=!0),Le(n)&&(r.containsJSX=!0);break;case M.ReturnStatement:n.argument&&Le(n.argument)&&(r.containsJSX=!0);break;case M.VariableDeclarator:n.init&&Le(n.init)&&(r.containsJSX=!0);break;case M.AssignmentExpression:Le(n.right)&&(r.containsJSX=!0);break}},t),r}function _r(e,t){let r=e.body,n=Jr(r,t);return n.containsJSX||n.containsHookCalls}var Ks=/\bthis[.[]/;function $r(e){return Ks.test(e)}function Qs(e,t){let r={containsJSX:!1,containsHookCalls:!1};return Ne(e,n=>{if(r.containsHookCalls||(n.type===M.FunctionDeclaration||n.type===M.FunctionExpression||n.type===M.ArrowFunctionExpression)&&n!==e)return!0;n.type===M.CallExpression&&Wr(n.callee)&&(r.containsHookCalls=!0)},t),r}function Ur(e){return lt(e)||fn(e)}function un(e,t,r,n){if(!Qs(e.body,t).containsHookCalls)return!1;let p=mn(e,r,n,t);if(!p&&n){let i=r?.name||e.type===M.FunctionDeclaration&&e.id?.name;i&&lt(i)&&(p=!0)}return!p}var ea=Xs({name:zr,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(Bs)]},defaultOptions:[{}],create(e,[t]){let r=!1;if(t.runOnlyWithEnableCompilerDirective){for(let i of e.sourceCode.getAllComments())if(Hs.test(i.value)){r=!0;break}if(!r)return{}}function n(i){for(let a of i.properties)if(a.type===M.Property&&a.method&&a.value.type===M.FunctionExpression){let l=e.sourceCode,s=l.getText(a.key),u=a.value,f=l.getText(u.body);if($r(f))e.report({node:a,messageId:"thisKeywordInMethod"});else{let y=u.params.map(m=>l.getText(m)).join(", "),x="";u.generator?x=`${s}: function* (${y}) ${f}`:x=`${s}: (${y}) => ${f}`,e.report({node:a,messageId:"objectMethodIsNotSupported",fix:m=>m.replaceText(a,x)})}}}function o(i){for(let a of i.properties)if(a.type===M.Property&&a.value.type===M.ObjectExpression){for(let l of a.value.properties)if(l.type===M.Property&&l.method&&l.value.type===M.FunctionExpression){let u=e.sourceCode.getText(l.value.body);$r(u)&&e.report({node:l,messageId:"thisKeywordInMethod"})}}}function p(i){let a=Ys(i);return a!==null&&Qe(a)}return{CallExpression(i){if(Wr(i.callee))for(let a of i.arguments){if(a.type===M.ObjectExpression){if(p(i))return;n(a),o(a)}if(a.type===M.ArrowFunctionExpression){if(a.body.type===M.ObjectExpression){if(p(i))return;n(a.body),o(a.body)}if(a.body.type===M.BlockStatement){for(let l of a.body.body)if(l.type===M.ReturnStatement&&l.argument?.type===M.ObjectExpression){if(p(i))return;n(l.argument),o(l.argument)}}}if(a.type===M.FunctionExpression){for(let l of a.body.body)if(l.type===M.ReturnStatement&&l.argument?.type===M.ObjectExpression){if(p(i))return;n(l.argument),o(l.argument)}}}},VariableDeclarator(i){if(i.id.type===M.Identifier&&i.init&&(i.init.type===M.ArrowFunctionExpression||i.init.type===M.FunctionExpression)){let a=i.init,l=i.id,s=i.id.typeAnnotation;if(at(a)&&!Ur(l.name)){e.report({node:a,messageId:"useMemoDirectiveNaming"});return}if(un(a,e.sourceCode,l,s)){if(Qe(a))return;e.report({node:a,messageId:"functionCallingHooksMustBeComponent"});return}if(mn(a,l,s,e.sourceCode)){let u=_r(a,e.sourceCode),f=at(a);if(!u&&!f){if(Qe(a))return;e.report({node:a,messageId:"fcComponentShouldReturnJsx",suggest:[{messageId:"addUseMemoDirective",fix(y){if(a.body.type===M.BlockStatement){let x=a.body.range[0]+1;return y.insertTextAfterRange([x,x],`
19
19
  "use memo"
20
20
  `)}return null}}]})}}}},FunctionDeclaration(i){if(i.id&&at(i)&&!Ur(i.id.name)){e.report({node:i,messageId:"useMemoDirectiveNaming"});return}if(un(i,e.sourceCode)){if(Qe(i))return;e.report({node:i,messageId:"functionCallingHooksMustBeComponent"});return}if(mn(i,void 0,void 0,e.sourceCode)){let a=_r(i,e.sourceCode),l=at(i);if(!a&&!l){if(Qe(i))return;e.report({node:i,messageId:"fcComponentShouldReturnJsx",suggest:[{messageId:"addUseMemoDirective",fix(s){let u=i.body.range[0]+1;return s.insertTextAfterRange([u,u],`
21
21
  "use memo"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ls-stack/extended-lint",
3
- "version": "0.82.5",
3
+ "version": "0.82.6",
4
4
  "license": "MIT",
5
5
  "files": [
6
6
  "dist"