pickier 0.1.74 → 0.1.75

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.
@@ -0,0 +1,124 @@
1
+ // @bun
2
+ import{g,C,q,G,c,S,p,O,M,E,L,f,r,m,N,o,t,u,x,T,h,d}from"./chunk-mq0hh9yt.js";import{F}from"./chunk-hm7sfaz3.js";import{e,k}from"./chunk-qq03kpe0.js";import{readdirSync as Vo,readFileSync as Yn,statSync as Cn,writeFileSync as Hn}from"fs";import{isAbsolute as Xe,join as Ko,relative as Ln,resolve as Je,sep as Ho}from"path";import{readFileSync as po,writeFileSync as mc}from"fs";import{isAbsolute as pc,relative as fo,resolve as dc}from"path";var _n=Promise.resolve();function ct(b){let y=null,s=null,l=()=>(s??=import("./chunk-dxrcbgyc.js").then((i)=>(y=new i.Logger(b,{showTags:!1}),y)),s),n=(i,w)=>{if(y){y[i](...w);return}_n=_n.then(l).then((a)=>{a[i](...w)}).catch(()=>{})};return{debug:(...i)=>n("debug",i),info:(...i)=>n("info",i),warn:(...i)=>n("warn",i),error:(...i)=>n("error",i),ready:async()=>{await l()}}}function R(){return _n}var at={meta:{docs:"Enforce return statements in callbacks of array methods",recommended:!0},check:(b,y)=>{let s=[],l=b.split(/\r?\n/),i=new RegExp(`\\.(${["map","filter","find","findIndex","findLast","findLastIndex","every","some","reduce","reduceRight","sort","flatMap"].join("|")})\\s*\\(`,"g");for(let w=0;w<l.length;w++){let a=l[w],I;for(I=i.exec(a);I!==null;I=i.exec(a)){let P=I[1],_=I.index+I[0].length,D=a.slice(_),j=D.match(/^\s*(?:\(([^)]*)\)|([a-z_$][\w$]*))\s*=>/i),B=D.match(/^\s*function\s*(?:[a-zA-Z_$][\w$]*\s*)?\(/);if(j){let Z=D.slice(j[0].length).trim();if(Z.startsWith("{")){let z=!1,Y=0,X=Z,J=w;while(J<l.length){let ne=J===w?X:l[J];for(let Q=0;Q<ne.length;Q++){let ee=ne[Q];if(ee==="{")Y++;if(ee==="}"){if(Y--,Y===0){if(!z)s.push({filePath:y.filePath,line:w+1,column:I.index+1,ruleId:"eslint/array-callback-return",message:`Array method '${P}' callback should return a value`,severity:"error"});break}}}if(ne.match(new RegExp("\\breturn\\s+[^;]")))z=!0;if(Y===0)break;J++,X=l[J]||""}}}else if(B){let Z=!1,z=0,Y=w,X=!1;while(Y<l.length){let J=l[Y];for(let ne=0;ne<J.length;ne++){let Q=J[ne];if(Q==="{")z++,X=!0;else if(Q==="}"){if(z--,z===0&&X){if(!Z)s.push({filePath:y.filePath,line:w+1,column:I.index+1,ruleId:"eslint/array-callback-return",message:`Array method '${P}' callback should return a value`,severity:"error"});break}}}if(X&&J.match(new RegExp("\\breturn\\s+[^;]")))Z=!0;if(z===0&&X)break;Y++}}}}return s}};var ut={meta:{docs:"Require super() calls in constructors of derived classes",recommended:!0},check:(b,y)=>{let s=[],l=b.split(/\r?\n/),n=!1,i=!1,w=0,a=0,I=!1;for(let P=0;P<l.length;P++){let _=l[P];if(_.match(/\bclass\s+\w+\s+extends\s+\w+/))n=!0;if(n&&_.match(/\bconstructor\s*\(/))i=!0,w=P+1,a=0,I=!1;if(i){for(let D of _){if(D==="{")a++;if(D==="}")a--}if(_.match(/\bsuper\s*\(/))I=!0;if(a===0&&_.includes("}")){if(!I)s.push({filePath:y.filePath,line:w,column:1,ruleId:"eslint/constructor-super",message:"Constructors of derived classes must call super()",severity:"error"});i=!1,n=!1}}}return s}};var ft={meta:{docs:'Enforce "for" loop update clause moving counter in the right direction',recommended:!0},check:(b,y)=>{let s=[],l=b.split(/\r?\n/);for(let n=0;n<l.length;n++){let i=l[n],w=new RegExp("\\bfor\\s*\\(\\s*(?:(?:let|var|const)\\s*)?(\\w+)\\s*=[^;]+;\\s*(\\w+)\\s*([<>]=?)[^;]+;\\s*(\\w+)(\\+\\+|--|[\\s+-]=)"),a=i.match(w);if(a){let I=a[1],P=a[2],_=a[3],D=a[4],j=a[5];if(I===P&&P===D){let B=j.includes("+"),Z=_.includes("<");if(Z&&!B||!Z&&B)s.push({filePath:y.filePath,line:n+1,column:1,ruleId:"eslint/for-direction",message:"The update clause in this loop moves the variable in the wrong direction",severity:"error"})}}}return s}};var mt={meta:{docs:"Enforce return statements in getters",recommended:!0},check:(b,y)=>{let s=[],l=b.split(/\r?\n/);for(let n=0;n<l.length;n++){let w=l[n].match(/\bget\s+(\w+)\s*\(/);if(w){let a=w[1],I=!1,P=0,_=n;while(_<l.length){let D=l[_];for(let B of D){if(B==="{")P++;if(B==="}"){if(P--,P===0){if(!I)s.push({filePath:y.filePath,line:n+1,column:1,ruleId:"eslint/getter-return",message:`Getter '${a}' must return a value`,severity:"error"});break}}}let j=new RegExp("\\breturn\\s+[^;]");if(D.match(j))I=!0;if(P===0)break;_++}}}return s}};var pt={meta:{docs:"Disallow async functions as Promise executor",recommended:!0},check:(b,y)=>{let s=[],l=b.split(/\r?\n/);for(let n=0;n<l.length;n++){let i=l[n],w=/new\s+Promise\s*\(\s*async\s*(?:\(|function)/g,a;for(a=w.exec(i);a!==null;a=w.exec(i))s.push({filePath:y.filePath,line:n+1,column:a.index+1,ruleId:"eslint/no-async-promise-executor",message:"Promise executor functions should not be async",severity:"error"})}return s}};var dt={meta:{docs:"Disallow comparing against -0",recommended:!0},check:(b,y)=>{let s=[],l=b.split(/\r?\n/);for(let n=0;n<l.length;n++){let i=l[n],w=/([!=]==?)\s*-0\b|\b-0\s*([!=]==?)/g,a;for(a=w.exec(i);a!==null;a=w.exec(i))s.push({filePath:y.filePath,line:n+1,column:a.index+1,ruleId:"eslint/no-compare-neg-zero",message:"Do not use the '-0' literal in comparisons",severity:"error"})}return s}};var ht={meta:{docs:"Disallow assignment operators in conditional expressions",recommended:!0},check:(b,y)=>{let s=[],l=b.split(/\r?\n/);for(let n=0;n<l.length;n++){let i=l[n],w=/\b(if|while)\s*\([^)]*\b(\w+)\s*=\s*(?!=)[^)]*\)/g,a;for(a=w.exec(i);a!==null;a=w.exec(i)){let I=a[0];if(/===|==/.test(I))continue;if(i.substring(0,a.index).includes("//"))continue;s.push({filePath:y.filePath,line:n+1,column:Math.max(1,a.index+1),ruleId:"eslint/no-cond-assign",message:"Expected a conditional expression and instead saw an assignment",severity:"error"})}}return s}};var gt={meta:{docs:"Disallow reassigning const variables",recommended:!0},check:(b,y)=>{let s=[],l=b.split(/\r?\n/),n=new Map;for(let i=0;i<l.length;i++){let w=l[i],a=w.match(/\bconst\s+(\w+)/);if(a)n.set(a[1],i);let I=/\b(\w+)\s*=(?!=)/g,P;for(P=I.exec(w);P!==null;P=I.exec(w)){let _=P[1],D=w.substring(0,P.index);if(!/\b(?:const|let|var)\s*$/.test(D)&&n.has(_))s.push({filePath:y.filePath,line:i+1,column:Math.max(1,P.index+1),ruleId:"eslint/no-const-assign",message:`'${_}' is constant`,severity:"error"})}}return s}};var bt={meta:{docs:"Disallow constant expressions in conditions",recommended:!0},check:(b,y)=>{let s=[],l=b.split(/\r?\n/);for(let n=0;n<l.length;n++){let i=l[n],w=[{pattern:/\b(if|while)\s*\(\s*(true|false)\s*\)/g,type:"boolean"},{pattern:/\b(if|while)\s*\(\s*(\d+)\s*\)/g,type:"number"},{pattern:/\b(if|while)\s*\(\s*(['"`][^'"`]*['"`])\s*\)/g,type:"string"}];for(let{pattern:a,type:I}of w){let P;while((P=a.exec(i))!==null){let _=P[1];if(i.substring(0,P.index).includes("//"))continue;s.push({filePath:y.filePath,line:n+1,column:Math.max(1,P.index+_.length+2),ruleId:"eslint/no-constant-condition",message:"Unexpected constant condition",severity:"error"})}}}return s}};var yt={meta:{docs:"Disallow duplicate class members",recommended:!0},check:(b,y)=>{let s=[],l=b.split(/\r?\n/),n=!1,i=new Set,w=0;for(let a=0;a<l.length;a++){let I=l[a];if(I.match(/\bclass\s+\w+/))n=!0,i=new Set,w=0;if(n){for(let _ of I){if(_==="{")w++;if(_==="}"){if(w--,w===0)n=!1}}let P=[...I.matchAll(/^\s*(?:(?:public|private|protected|static|readonly|async)\s*)?(?:get|set)?\s*(\w+)\s*\(/g),...I.matchAll(/^\s*(?:(?:public|private|protected|static|readonly)\s*)?(\w+)\s*[:=]/g)];for(let _ of P){let D=_[1];if(i.has(D))s.push({filePath:y.filePath,line:a+1,column:1,ruleId:"eslint/no-dupe-class-members",message:`Duplicate class member '${D}'`,severity:"error"});else i.add(D)}}}return s}};var Qe={meta:{docs:"Disallow duplicate keys in object literals",recommended:!0},check:(b,y)=>{let s=[],l=b.split(/\r?\n/),n=/\{\s*$/,i=/^\s*(?:(['"`])(.+?)\1|(\w+))\s*:/;for(let w=0;w<l.length;w++){let a=l[w];if(!n.test(a)&&!a.includes("{"))continue;let I=new Map,P=(a.match(/\{/g)||[]).length-(a.match(/\}/g)||[]).length,_=w;for(let D=w+1;D<l.length&&P>0;D++){let j=l[D];P+=(j.match(/\{/g)||[]).length,P-=(j.match(/\}/g)||[]).length;let B=j.match(i);if(B){let Z=B[2]||B[3];if(Z)if(I.get(Z)!==void 0)s.push({filePath:y.filePath,line:D+1,column:Math.max(1,j.search(/\S/)+1),ruleId:"eslint/no-dupe-keys",message:`Duplicate key '${Z}'`,severity:"error"});else I.set(Z,D)}if(P===0)break}}return s},fix:(b,y)=>{let s=Qe.check(b,y);if(s.length===0)return b;let l=b.split(/\r?\n/),n=new Set(s.map((w)=>w.line-1));return l.filter((w,a)=>!n.has(a)).join(`
3
+ `)}};var xt={meta:{docs:"Disallow duplicate case labels in switch statements",recommended:!0},check:(b,y)=>{let s=[],l=b.split(/\r?\n/),n=!1,i=new Set,w=-1;for(let a=0;a<l.length;a++){let I=l[a],P=I.trim();if(/\bswitch\s*\(/.test(P)){n=!0,i=new Set,w=a;continue}if(n&&P==="}"&&a>w){let _=l[w].match(/^\s*/)?.[0].length||0;if((I.match(/^\s*/)?.[0].length||0)<=_+2)n=!1,i=new Set}if(n){let _=P.match(/^case\s+(.+?)\s*:/);if(_){let D=_[1].trim();if(i.has(D))s.push({filePath:y.filePath,line:a+1,column:Math.max(1,I.indexOf("case")+1),ruleId:"eslint/no-duplicate-case",message:`Duplicate case label '${D}'`,severity:"error"});else i.add(D)}}}return s}};var Rt={meta:{docs:"Disallow empty destructuring patterns",recommended:!0},check:(b,y)=>{let s=[],l=b.split(/\r?\n/);for(let n=0;n<l.length;n++){let i=l[n],w=/\{\s*\}\s*=/g,a=/\[\s*\]\s*=/g,I;for(I=w.exec(i);I!==null;I=w.exec(i)){if(i.substring(0,I.index).includes("//"))continue;s.push({filePath:y.filePath,line:n+1,column:Math.max(1,I.index+1),ruleId:"eslint/no-empty-pattern",message:"Unexpected empty object pattern",severity:"error"})}for(I=a.exec(i);I!==null;I=a.exec(i)){if(i.substring(0,I.index).includes("//"))continue;s.push({filePath:y.filePath,line:n+1,column:Math.max(1,I.index+1),ruleId:"eslint/no-empty-pattern",message:"Unexpected empty array pattern",severity:"error"})}}return s}};var wt={meta:{docs:"Disallow fallthrough of case statements",recommended:!0},check:(b,y)=>{let s=[],l=b.split(/\r?\n/),n=!1,i=-1,w=!1;for(let a=0;a<l.length;a++){let P=l[a].trim();if(/\bswitch\s*\(/.test(P)){n=!0;continue}if(n){if(/^case\s+/.test(P)||/^default\s*:/.test(P)){if(i>=0&&w){if(!(/\/\/.*falls?\s*through|\/\*.*falls?\s*through/i.test(l[i])||a>0&&/\/\/.*falls?\s*through|\/\*.*falls?\s*through/i.test(l[a-1])))s.push({filePath:y.filePath,line:i+1,column:Math.max(1,l[i].indexOf("case")+1),ruleId:"eslint/no-fallthrough",message:"Expected a 'break' statement before 'case'",severity:"error"})}i=a,w=!0}if(/\b(?:break|return|throw|continue)\b/.test(P))w=!1;if(P==="}")n=!1,i=-1,w=!1}}return s}};var kt={meta:{docs:"Disallow number literals that lose precision",recommended:!0},check:(b,y)=>{let s=[],l=b.split(/\r?\n/);for(let n=0;n<l.length;n++){let i=l[n],w=/\b(\d{17,}(?:\.\d+)?|\d+\.\d{17,})\b/g,a;for(a=w.exec(i);a!==null;a=w.exec(i)){let I=a[1];if(Number(I).toString()!==I)s.push({filePath:y.filePath,line:n+1,column:a.index+1,ruleId:"eslint/no-loss-of-precision",message:"This number literal will lose precision at runtime",severity:"error"})}}return s}};var It={meta:{docs:"Disallow returning values from Promise executor functions",recommended:!0},check:(b,y)=>{let s=[],l=b.split(/\r?\n/);for(let n=0;n<l.length;n++)if(l[n].match(/new\s+Promise\s*\(/)){let a=0,I=!1,P=n;while(P<l.length){let _=l[P];for(let j of _){if(j==="{")a++,I=!0;if(j==="}"){if(a--,a===0&&I)break}}let D=new RegExp("\\breturn\\s+[^;]");if(I&&_.match(D))s.push({filePath:y.filePath,line:P+1,column:1,ruleId:"eslint/no-promise-executor-return",message:"Return values from promise executor functions cannot be read",severity:"error"});if(a===0&&I)break;P++}}return s}};var Pt={meta:{docs:"Disallow variable redeclaration",recommended:!0},check:(b,y)=>{let s=[],l=b.split(/\r?\n/),n=new Map;for(let i=0;i<l.length;i++){let w=l[i],a=/\b(var|let|const)\s+(\w+)/g,I;for(I=a.exec(w);I!==null;I=a.exec(w)){let _=I[2];if(n.get(_)!==void 0)s.push({filePath:y.filePath,line:i+1,column:Math.max(1,I.index+1),ruleId:"eslint/no-redeclare",message:`'${_}' is already defined`,severity:"error"});else n.set(_,i)}let P=/\bfunction\s+(\w+)/g;for(I=P.exec(w);I!==null;I=P.exec(w)){let _=I[1];if(n.get(_)!==void 0)s.push({filePath:y.filePath,line:i+1,column:Math.max(1,I.index+1),ruleId:"eslint/no-redeclare",message:`'${_}' is already defined`,severity:"error"});else n.set(_,i)}}return s}};var et={meta:{docs:"Disallow assignments where both sides are identical",recommended:!0},check:(b,y)=>{let s=[],l=b.split(/\r?\n/);for(let n=0;n<l.length;n++){let i=l[n],w=new RegExp("\\b(\\w+)\\s*=\\s*(\\w+)\\s*(?:;\\s*)?(?:\\/\\/.*)?$"),a=i.match(w);if(a&&a[1]===a[2]){s.push({filePath:y.filePath,line:n+1,column:Math.max(1,i.indexOf(a[1])+1),ruleId:"eslint/no-self-assign",message:`'${a[1]}' is assigned to itself`,severity:"error"});continue}let I=i.match(/([\w.]+)\s*=\s*([\w.]+)/);if(I&&I[1]===I[2]){s.push({filePath:y.filePath,line:n+1,column:Math.max(1,i.indexOf(I[1])+1),ruleId:"eslint/no-self-assign",message:`'${I[1]}' is assigned to itself`,severity:"error"});continue}let P=i.match(/(\w+\[[^\]]+\])\s*=\s*(\w+\[[^\]]+\])/);if(P){let _=P[1].replace(/\s/g,""),D=P[2].replace(/\s/g,"");if(_===D)s.push({filePath:y.filePath,line:n+1,column:Math.max(1,i.indexOf(P[1])+1),ruleId:"eslint/no-self-assign",message:`'${P[1]}' is assigned to itself`,severity:"error"})}}return s},fix:(b,y)=>{let s=et.check(b,y);if(s.length===0)return b;let l=b.split(/\r?\n/),n=new Set(s.map((w)=>w.line-1));return l.map((w,a)=>{if(n.has(a)){let I=w.trim();if(new RegExp("^\\w+(?:\\.\\w+|\\[[^\\]]+\\])?\\s*=\\s*\\w+(?:\\.\\w+|\\[[^\\]]+\\])?;?\\s*$").test(I))return""}return w}).filter((w,a,I)=>{if(w===""&&n.has(a)){let P=a>0&&I[a-1].trim()!=="",_=a<I.length-1&&I[a+1]&&I[a+1].trim()!=="";if(!P||!_)return!1}return!0}).join(`
4
+ `)}};var Mt={meta:{docs:"Disallow comparisons where both sides are identical",recommended:!0},check:(b,y)=>{let s=[],l=b.split(/\r?\n/);for(let n=0;n<l.length;n++){let i=l[n],w=/([\w.\[\]]+)\s*(===|!==|==|!=|<|>|<=|>=)\s*([\w.\[\]]+)/g,a;for(a=w.exec(i);a!==null;a=w.exec(i)){let I=a[1].replace(/\s/g,""),P=a[2],_=a[3].replace(/\s/g,"");if(I===_)s.push({filePath:y.filePath,line:n+1,column:Math.max(1,a.index+1),ruleId:"eslint/no-self-compare",message:`Comparing '${a[1]}' to itself is potentially pointless`,severity:"error"})}}return s}};var vt={meta:{docs:"Disallow sparse arrays (arrays with empty slots)",recommended:!0},check:(b,y)=>{let s=[],l=b.split(/\r?\n/);for(let n=0;n<l.length;n++){let i=l[n],w=/\[([^\]]*)\]/g,a;for(a=w.exec(i);a!==null;a=w.exec(i)){let I=a[1];if(/,\s*,/.test(I))s.push({filePath:y.filePath,line:n+1,column:Math.max(1,a.index+1),ruleId:"eslint/no-sparse-arrays",message:"Unexpected sparse array",severity:"error"})}}return s},fix:(b,y)=>{let s=b.split(/\r?\n/),l=!1,n=s.map((i)=>{let w=i;return w=w.replace(/\[([^\]]*)\]/g,(a,I)=>{if(/,\s*,/.test(I))return l=!0,`[${I.replace(/,(\s*),/g,", undefined,")}]`;return a}),w});return l?n.join(`
5
+ `):b}};var $t={meta:{docs:"Disallow undeclared variables",recommended:!0,wip:!0},check:(b,y)=>[]};var Ct={meta:{docs:"Disallow unreachable code after return, throw, continue, or break",recommended:!0},check:(b,y)=>{let s=[],l=b.split(/\r?\n/);for(let n=0;n<l.length;n++){let i=l[n],w=i.trim();if(/^\s*(?:return|throw|break|continue)\b/.test(i))for(let a=n+1;a<l.length;a++){let I=l[a],P=I.trim();if(P===""||P.startsWith("//")||P.startsWith("/*"))continue;if(P==="}"||P.startsWith("}"))break;if(/^(?:case\b|default\s*:)/.test(P))break;s.push({filePath:y.filePath,line:a+1,column:Math.max(1,I.search(/\S/)+1),ruleId:"eslint/no-unreachable",message:"Unreachable code",severity:"error"});break}}return s}};var Lt={meta:{docs:"Disallow negation of the left operand of relational operators",recommended:!0},check:(b,y)=>{let s=[],l=b.split(/\r?\n/);for(let n=0;n<l.length;n++){let i=l[n],w=/!\s*\w+\s+in\s+/g,a=/!\s*\w+\s+instanceof\s+/g,I;for(I=w.exec(i);I!==null;I=w.exec(i))s.push({filePath:y.filePath,line:n+1,column:I.index+1,ruleId:"eslint/no-unsafe-negation",message:"Unexpected negation of 'in' operand",severity:"error"});for(I=a.exec(i);I!==null;I=a.exec(i))s.push({filePath:y.filePath,line:n+1,column:I.index+1,ruleId:"eslint/no-unsafe-negation",message:"Unexpected negation of 'instanceof' operand",severity:"error"})}return s},fix:(b)=>{let y=b;return y=y.replace(/!\s*(\w+)\s+in\s+/g,"!($1 in "),y=y.replace(/!\s*(\w+)\s+instanceof\s+/g,"!($1 instanceof "),y}};var St={meta:{docs:"Disallow unnecessary catch clauses",recommended:!0},check:(b,y)=>{let s=[],l=b.split(/\r?\n/);for(let n=0;n<l.length;n++){let i=l[n],w=i.match(/catch\s*\(\s*(\w+)\s*\)/);if(!w)continue;let a=w[1];for(let I=n+1;I<Math.min(n+5,l.length);I++){let P=l[I].trim();if(P===`throw ${a}`||P===`throw ${a};`){let _=!1;for(let D=n+1;D<I;D++){let j=l[D].trim();if(j!==""&&j!=="{"&&!j.startsWith("//")){_=!0;break}}if(!_)s.push({filePath:y.filePath,line:n+1,column:Math.max(1,i.indexOf("catch")+1),ruleId:"eslint/no-useless-catch",message:"Unnecessary catch clause",severity:"error"});break}if(P==="}")break}}return s}};var Et={meta:{docs:"Require isNaN() when checking for NaN",recommended:!0},check:(b,y)=>{let s=[],l=b.split(/\r?\n/);for(let n=0;n<l.length;n++){let i=l[n],w=/\b([\w.\[\]]+)\s*(===|!==|==|!=)\s*NaN\b|\bNaN\s*(===|!==|==|!=)\s*([\w.\[\]]+)/g,a;for(a=w.exec(i);a!==null;a=w.exec(i)){let I=a[1]||a[4];s.push({filePath:y.filePath,line:n+1,column:Math.max(1,a.index+1),ruleId:"eslint/use-isnan",message:"Use isNaN() to compare with NaN",severity:"error"})}}return s},fix:(b,y)=>{let s=b.split(/\r?\n/),l=!1,n=s.map((i)=>{let w=i;return w=w.replace(/\b([\w.\[\]]+)\s*===\s*NaN\b/g,(a,I)=>(l=!0,`isNaN(${I})`)),w=w.replace(/\bNaN\s*===\s*([\w.\[\]]+)\b/g,(a,I)=>(l=!0,`isNaN(${I})`)),w=w.replace(/\b([\w.\[\]]+)\s*!==\s*NaN\b/g,(a,I)=>(l=!0,`!isNaN(${I})`)),w=w.replace(/\bNaN\s*!==\s*([\w.\[\]]+)\b/g,(a,I)=>(l=!0,`!isNaN(${I})`)),w=w.replace(/\b([\w.\[\]]+)\s*==\s*NaN\b/g,(a,I)=>(l=!0,`isNaN(${I})`)),w=w.replace(/\bNaN\s*==\s*([\w.\[\]]+)\b/g,(a,I)=>(l=!0,`isNaN(${I})`)),w=w.replace(/\b([\w.\[\]]+)\s*!=\s*NaN\b/g,(a,I)=>(l=!0,`!isNaN(${I})`)),w=w.replace(/\bNaN\s*!=\s*([\w.\[\]]+)\b/g,(a,I)=>(l=!0,`!isNaN(${I})`)),w});return l?n.join(`
6
+ `):b}};var Qn=["undefined","object","boolean","number","string","function","symbol","bigint"],At={meta:{docs:"Enforce comparing typeof expressions against valid strings",recommended:!0},check:(b,y)=>{let s=[],l=b.split(/\r?\n/);for(let n=0;n<l.length;n++){let i=l[n],w=/typeof\s+\w+\s*(?:===|!==|==|!=)\s*(['"`])(\w+)\1/g,a;for(a=w.exec(i);a!==null;a=w.exec(i)){let P=a[2];if(!Qn.includes(P))s.push({filePath:y.filePath,line:n+1,column:Math.max(1,a.index+1),ruleId:"eslint/valid-typeof",message:`Invalid typeof comparison value '${P}'`,severity:"error"})}let I=/(['"`])(\w+)\1\s*(?:===|!==|==|!=)\s*typeof\s+\w+/g;for(a=I.exec(i);a!==null;a=I.exec(i)){let P=a[2];if(!Qn.includes(P))s.push({filePath:y.filePath,line:n+1,column:Math.max(1,a.index+1),ruleId:"eslint/valid-typeof",message:`Invalid typeof comparison value '${P}'`,severity:"error"})}}return s}};var Ot={meta:{docs:"Enforce a maximum cyclomatic complexity allowed in a program",recommended:!1},check:(b,y)=>{let s=[],l=b.split(/\r?\n/),n=10,i=!1,w=0,a="",I=0,P=0;for(let _=0;_<l.length;_++){let D=l[_],j=D.match(/\bfunction\s+(\w+)\s*\(|(\w+)\s*=\s*(?:\([^)]*\)|(\w+))\s*=>/);if(j)i=!0,w=_+1,a=j[1]||j[2]||j[3]||"anonymous",I=1,P=0;if(i){for(let Z of D){if(Z==="{")P++;if(Z==="}"){if(P--,P===0){if(I>10)s.push({filePath:y.filePath,line:w,column:1,ruleId:"eslint/complexity",message:`Function '${a}' has complexity ${I}, exceeds maximum of 10`,severity:"error"});i=!1}}}let B=[/\bif\s*\(/,/\belse\s+if\s*\(/,/\bfor\s*\(/,/\bwhile\s*\(/,/\bcase\s+/,/\bcatch\s*\(/,/\b&&\b/,/\b\|\|\b/,/\?\s*(?:\S.*(?:[\n\r\u2028\u2029]\s*)?)?:/];for(let Z of B){let z=D.match(new RegExp(Z,"g"));if(z)I+=z.length}}}return s}};var _t={meta:{docs:"Require default case in switch statements",recommended:!1},check:(b,y)=>{let s=[],l=b.split(/\r?\n/),n=!1,i=0,w=!1,a=0;for(let I=0;I<l.length;I++){let P=l[I];if(P.match(/\bswitch\s*\(/))n=!0,i=I+1,w=!1,a=0;if(n){for(let _ of P){if(_==="{")a++;if(_==="}"){if(a--,a===0){if(!w)s.push({filePath:y.filePath,line:i,column:1,ruleId:"eslint/default-case",message:"Expected a default case",severity:"error"});n=!1}}}if(P.match(/\bdefault\s*:/))w=!0}}return s}};var Tt={meta:{docs:"Require === and !== instead of == and !=",recommended:!0},check:(b,y)=>{let s=[],l=b.split(/\r?\n/);for(let n=0;n<l.length;n++){let i=l[n],w=/([^=!])(\s*)(==)(\s*)([^=])/g,a=/([^!])(\s*)(!=)(\s*)([^=])/g,I;for(I=w.exec(i);I!==null;I=w.exec(i))s.push({filePath:y.filePath,line:n+1,column:Math.max(1,I.index+2),ruleId:"eslint/eqeqeq",message:"Expected '===' and instead saw '=='",severity:"error"});for(I=a.exec(i);I!==null;I=a.exec(i))s.push({filePath:y.filePath,line:n+1,column:Math.max(1,I.index+2),ruleId:"eslint/eqeqeq",message:"Expected '!==' and instead saw '!='",severity:"error"})}return s},fix:(b)=>{let y=b;return y=y.replace(/([^!])(\s*)(!=)(\s*)([^=])/g,"$1$2!==$4$5"),y=y.replace(/([^=!])(\s*)(==)(\s*)([^=])/g,"$1$2===$4$5"),y}};var Wt={meta:{docs:"Enforce a maximum depth that blocks can be nested",recommended:!1},check:(b,y)=>{let s=[],l=b.split(/\r?\n/),n=4,i=0,w=0,a=0;for(let I=0;I<l.length;I++){let P=l[I];if(P.match(/\b(if|for|while|switch|try|catch|else)\b.*\{/)){if(i++,i>w)w=i,a=I+1}else if(P.match(/\{/)&&!P.match(/^.*\}/)){if(l[I-1]?.match(/\b(if|for|while|switch|try|catch|else)\b/)){if(i++,i>w)w=i,a=I+1}}if(P.match(/^\s*\}/))i--;if(i>4)s.push({filePath:y.filePath,line:I+1,column:1,ruleId:"eslint/max-depth",message:`Blocks are nested too deeply (${i}), maximum allowed is 4`,severity:"error"})}return s}};var Nt={meta:{docs:"Enforce a maximum number of lines of code in a function",recommended:!1},check:(b,y)=>{let s=[],l=b.split(/\r?\n/),n=50,i=!1,w=0,a="",I=0;for(let P=0;P<l.length;P++){let _=l[P],D=_.match(/\bfunction\s+(\w+)\s*\(|(\w+)\s*=\s*(?:\([^)]*\)|(\w+))\s*=>/);if(D)i=!0,w=P+1,a=D[1]||D[2]||D[3]||"anonymous",I=0;if(i)for(let j of _){if(j==="{")I++;if(j==="}"){if(I--,I===0){let B=P+1-w+1;if(B>50)s.push({filePath:y.filePath,line:w,column:1,ruleId:"eslint/max-lines-per-function",message:`Function '${a}' has ${B} lines, exceeds maximum of 50`,severity:"error"});i=!1}}}}return s}};var Dt={meta:{docs:"Disallow alert, confirm, and prompt",recommended:!1},check:(b,y)=>{let s=[],l=b.split(/\r?\n/);for(let n=0;n<l.length;n++){let i=l[n],w=/\b(alert|confirm|prompt)\s*\(/g,a;for(a=w.exec(i);a!==null;a=w.exec(i)){if(i.substring(0,a.index).includes("//"))continue;s.push({filePath:y.filePath,line:n+1,column:Math.max(1,a.index+1),ruleId:"eslint/no-alert",message:`Unexpected ${a[1]}`,severity:"warning"})}}return s}};var jt={meta:{docs:"Disallow await inside of loops",recommended:!0},check:(b,y)=>{let s=[],l=b.split(/\r?\n/),n=!1,i=0,w=0;for(let a=0;a<l.length;a++){let I=l[a];if(I.match(/\b(for|while|do)\s*\(/))n=!0,i=0,w=a;if(n){for(let P of I){if(P==="{")i++;if(P==="}"){if(i--,i===0)n=!1}}if(I.match(/\bawait\s+/))s.push({filePath:y.filePath,line:a+1,column:1,ruleId:"eslint/no-await-in-loop",message:"Unexpected await inside a loop. Consider using Promise.all() instead",severity:"error"})}}return s}};var Ut={meta:{docs:"Disallow use of arguments.caller or arguments.callee",recommended:!0},check:(b,y)=>{let s=[],l=b.split(/\r?\n/);for(let n=0;n<l.length;n++){let i=l[n],w=/\barguments\s*\.\s*(caller|callee)\b/g,a;for(a=w.exec(i);a!==null;a=w.exec(i))s.push({filePath:y.filePath,line:n+1,column:a.index+1,ruleId:"eslint/no-caller",message:`Avoid arguments.${a[1]}`,severity:"error"})}return s}};var Ft={meta:{docs:"Disallow lexical declarations in case clauses",recommended:!0},check:(b,y)=>{let s=[],l=b.split(/\r?\n/),n=!1,i=!1;for(let w=0;w<l.length;w++){let a=l[w];if(a.match(/\bcase\s+(?:\S.*)?:|default\s*:/))n=!0,i=!0;else i=!1;if(n&&!i&&(a.match(/\bbreak\b/)||a.match(/\bcase\s+(?:\S.*)?:/)))n=!1;if(n&&!i){if(a.match(/\b(let|const|function|class)\s+/))s.push({filePath:y.filePath,line:w+1,column:1,ruleId:"eslint/no-case-declarations",message:"Unexpected lexical declaration in case block",severity:"error"})}}return s}};var Bt={meta:{docs:"Disallow else blocks after return statements in if statements",recommended:!1},check:(b,y)=>{let s=[],l=b.split(/\r?\n/);for(let n=0;n<l.length;n++){let i=l[n];if(!/^\s*else\b/.test(i))continue;let w=!1;for(let a=n-1;a>=0&&a>=n-10;a--){let I=l[a].trim();if(I.startsWith("return"))w=!0;if(I==="}"&&w)break;if(I.includes("{"))break}if(w)s.push({filePath:y.filePath,line:n+1,column:Math.max(1,i.indexOf("else")+1),ruleId:"eslint/no-else-return",message:"Unnecessary else after return",severity:"warning"})}return s}};var qt={meta:{docs:"Disallow empty block statements",recommended:!0},check:(b,y)=>{let s=[],l=b.split(/\r?\n/);for(let n=0;n<l.length;n++){let i=l[n],w=/\{\s*\}/g,a;for(a=w.exec(i);a!==null;a=w.exec(i)){let I=i.substring(0,a.index).trim(),P=/(?:if|else|for|while|do|try|catch|finally|function|\})\s*$/.test(I),_=/[=:]$/.test(I)||/return\s*$/.test(I);if(P&&!_)s.push({filePath:y.filePath,line:n+1,column:Math.max(1,a.index+1),ruleId:"eslint/no-empty",message:"Empty block statement",severity:"error"})}}for(let n=0;n<l.length-1;n++){let i=l[n],w=l[n+1];if(/\{\s*$/.test(i.trim()))for(let a=n+1;a<l.length;a++){let I=l[a].trim();if(I==="")continue;if(I==="}"||I.startsWith("}")){let P=i.substring(0,i.lastIndexOf("{")).trim(),_=/(?:if|else|for|while|do|try|catch|finally|function|\})\s*$/.test(P),D=/[=:]$/.test(P)||/return\s*$/.test(P);if(_&&!D)s.push({filePath:y.filePath,line:n+1,column:Math.max(1,i.lastIndexOf("{")+1),ruleId:"eslint/no-empty",message:"Empty block statement",severity:"error"})}break}}return s}};var zt={meta:{docs:"Disallow empty functions",recommended:!1},check:(b,y)=>{let s=[],l=b.split(/\r?\n/);for(let n=0;n<l.length;n++){let i=l[n],w=[/function\s+\w+\s*\([^)]*\)\s*\{\s*\}/g,/function\s*\([^)]*\)\s*\{\s*\}/g,/\([^)]*\)\s*=>\s*\{\s*\}/g,/\w+\s*\([^)]*\)\s*\{\s*\}/g];for(let a of w){let I;for(I=a.exec(i);I!==null;I=a.exec(i)){if(i.substring(0,I.index).includes("//"))continue;s.push({filePath:y.filePath,line:n+1,column:Math.max(1,I.index+1),ruleId:"eslint/no-empty-function",message:"Unexpected empty function",severity:"warning"})}}}return s}};var Zt={meta:{docs:"Disallow use of eval()",recommended:!0},check:(b,y)=>{let s=[],l=b.split(/\r?\n/);for(let n=0;n<l.length;n++){let i=l[n],w=/\beval\s*\(/g,a;for(a=w.exec(i);a!==null;a=w.exec(i)){if(i.substring(0,a.index).includes("//"))continue;s.push({filePath:y.filePath,line:n+1,column:Math.max(1,a.index+1),ruleId:"eslint/no-eval",message:"eval can be harmful",severity:"error"})}}return s}};var tl=["Object","Array","String","Number","Boolean","Date","RegExp","Function","Math","JSON","Promise","Map","Set","WeakMap","WeakSet","Symbol","Proxy","Reflect","Error","TypeError","RangeError"],Gt={meta:{docs:"Disallow extending native types",recommended:!0},check:(b,y)=>{let s=[],l=b.split(/\r?\n/);for(let n=0;n<l.length;n++){let i=l[n];for(let w of tl){let a=new RegExp(`\\b${w}\\.prototype\\.\\w+\\s*=`,"g"),I;for(I=a.exec(i);I!==null;I=a.exec(i)){if(i.substring(0,I.index).includes("//"))continue;s.push({filePath:y.filePath,line:n+1,column:Math.max(1,I.index+1),ruleId:"eslint/no-extend-native",message:`${w} prototype is read only, properties should not be added`,severity:"error"})}}}return s}};var Vt={meta:{docs:"Disallow unnecessary boolean casts",recommended:!0},check:(b,y)=>{let s=[],l=b.split(/\r?\n/);for(let n=0;n<l.length;n++){let i=l[n],w=[/\bif\s*\(\s*Boolean\s*\(/g,/\bwhile\s*\(\s*Boolean\s*\(/g,/!\s*Boolean\s*\(/g,/\?\s*Boolean\s*\(/g,/&&\s*Boolean\s*\(/g,/\|\|\s*Boolean\s*\(/g,/!!\s*\w+/g];for(let a of w){let I;for(I=a.exec(i);I!==null;I=a.exec(i)){if(i.substring(0,I.index).includes("//"))continue;s.push({filePath:y.filePath,line:n+1,column:Math.max(1,I.index+1),ruleId:"eslint/no-extra-boolean-cast",message:"Redundant Boolean call or double negation",severity:"error"})}}}return s},fix:(b)=>{let y=b;return y=y.replace(/\b(if|while)\s*\(\s*Boolean\s*\(([^)]+)\)\s*\)/g,"$1 ($2)"),y=y.replace(/!\s*Boolean\s*\(([^)]+)\)/g,"!$1"),y=y.replace(/!!\s*(\w+)/g,"$1"),y}};var nl=["Array","Boolean","Date","Error","Function","JSON","Math","Number","Object","RegExp","String","Symbol","undefined","NaN","Infinity","isNaN","isFinite","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","eval","Promise","Proxy","Reflect","Set","Map","WeakSet","WeakMap","ArrayBuffer","DataView","console","window","document","globalThis","global","process"],Kt={meta:{docs:"Disallow assignment to native objects or read-only global variables",recommended:!0},check:(b,y)=>{let s=[],l=b.split(/\r?\n/);for(let n=0;n<l.length;n++){let i=l[n];for(let w of nl){let a=new RegExp(`\\b${w}\\s*=\\s*[^=]`,"g"),I;for(I=a.exec(i);I!==null;I=a.exec(i))if(!i.slice(I.index).match(new RegExp(`^${w}\\s*===?`)))s.push({filePath:y.filePath,line:n+1,column:I.index+1,ruleId:"eslint/no-global-assign",message:`Read-only global '${w}' should not be modified`,severity:"error"})}}return s}};var Ht={meta:{docs:"Disallow implied eval() via setTimeout/setInterval with strings",recommended:!0},check:(b,y)=>{let s=[],l=b.split(/\r?\n/);for(let n=0;n<l.length;n++){let i=l[n],w=/\b(setTimeout|setInterval)\s*\(\s*(['"`])/g,a;while((a=w.exec(i))!==null){if(i.substring(0,a.index).includes("//"))continue;s.push({filePath:y.filePath,line:n+1,column:Math.max(1,a.index+1),ruleId:"eslint/no-implied-eval",message:"Implied eval. Consider passing a function instead of a string",severity:"error"})}}return s}};var Yt={meta:{docs:"Disallow the use of the __iterator__ property",recommended:!0},check:(b,y)=>{let s=[],l=b.split(/\r?\n/);for(let n=0;n<l.length;n++){let i=l[n],w=/__iterator__/g,a;for(a=w.exec(i);a!==null;a=w.exec(i)){if(i.substring(0,a.index).includes("//"))continue;s.push({filePath:y.filePath,line:n+1,column:Math.max(1,a.index+1),ruleId:"eslint/no-iterator",message:"Reserved name '__iterator__'",severity:"error"})}}return s}};var tt={meta:{docs:"Disallow if statements as the only statement in else blocks",recommended:!1},check:(b,y)=>{let s=[],l=b.split(/\r?\n/);for(let n=0;n<l.length;n++){let i=l[n],w=i.trim();if(/^\s*else\s*(?:\{\s*)?$/.test(i)){let a=n,I=i.includes("{");if(!I){if(n+1<l.length&&l[n+1].trim()==="{")a=n+1,I=!0}if(I)for(let P=a+1;P<l.length;P++){let _=l[P].trim();if(_===""||_.startsWith("//")||_.startsWith("/*"))continue;if(_==="}")break;if(_.startsWith("if ")||_.startsWith("if(")){let D=!0,j=0,B=!1;for(let Z=P;Z<l.length;Z++){let z=l[Z];if(j+=(z.match(/\{/g)||[]).length,j-=(z.match(/\}/g)||[]).length,Z===P){B=!0;continue}if(j===0){for(let Y=Z+1;Y<l.length;Y++){let X=l[Y].trim();if(X===""||X.startsWith("//"))continue;if(X==="}"||X.startsWith("}"))break;else D=!1;break}break}}if(B&&D)s.push({filePath:y.filePath,line:P+1,column:Math.max(1,l[P].indexOf("if")+1),ruleId:"eslint/no-lonely-if",message:"Unexpected if as the only statement in an else block",severity:"warning"})}break}}}return s},fix:(b,y)=>{if(tt.check(b,y).length===0)return b;return b}};var Xt={meta:{docs:"Disallow new operators outside of assignments or comparisons",recommended:!1},check:(b,y)=>{let s=[],l=b.split(/\r?\n/);for(let n=0;n<l.length;n++){let i=l[n];if(/^\s*new\s+\w+\s*\(/.test(i)){if(!/[=:]/.test(i.substring(0,i.indexOf("new"))))s.push({filePath:y.filePath,line:n+1,column:Math.max(1,i.indexOf("new")+1),ruleId:"eslint/no-new",message:"Do not use 'new' for side effects",severity:"warning"})}}return s}};var Jt={meta:{docs:"Disallow new Function() declarations",recommended:!0},check:(b,y)=>{let s=[],l=b.split(/\r?\n/);for(let n=0;n<l.length;n++){let i=l[n],w=/\bnew\s+Function\s*\(/g,a;for(a=w.exec(i);a!==null;a=w.exec(i)){if(i.substring(0,a.index).includes("//"))continue;s.push({filePath:y.filePath,line:n+1,column:Math.max(1,a.index+1),ruleId:"eslint/no-new-func",message:"The Function constructor is eval",severity:"error"})}}return s}};var Qt={meta:{docs:"Disallow new operators with String, Number, and Boolean",recommended:!0},check:(b,y)=>{let s=[],l=b.split(/\r?\n/);for(let n=0;n<l.length;n++){let i=l[n],w=/\bnew\s+(String|Number|Boolean)\s*\(/g,a;for(a=w.exec(i);a!==null;a=w.exec(i)){if(i.substring(0,a.index).includes("//"))continue;s.push({filePath:y.filePath,line:n+1,column:Math.max(1,a.index+1),ruleId:"eslint/no-new-wrappers",message:`Do not use ${a[1]} as a constructor`,severity:"error"})}}return s},fix:(b)=>{let y=b.split(/\r?\n/),s=!1,l=y.map((n)=>{if(n.trim().startsWith("//")||n.trim().startsWith("/*"))return n;return n.replace(/\bnew\s+(String|Number|Boolean)\s*\(/g,(w,a)=>(s=!0,`${a}(`))});return s?l.join(`
7
+ `):b}};var en={meta:{docs:"Disallow octal literals",recommended:!0},check:(b,y)=>{let s=[],l=b.split(/\r?\n/);for(let n=0;n<l.length;n++){let i=l[n],w=/\b0[0-7]+\b/g,a;for(a=w.exec(i);a!==null;a=w.exec(i))s.push({filePath:y.filePath,line:n+1,column:a.index+1,ruleId:"eslint/no-octal",message:"Octal literals should not be used",severity:"error"})}return s}};var tn={meta:{docs:"Disallow reassignment of function parameters",recommended:!1},check:(b,y)=>{let s=[],l=b.split(/\r?\n/),n=new Map;for(let i=0;i<l.length;i++){let w=l[i],a=[...w.matchAll(/function\s+(?:(\w+)\s*)?\(([^)]*)\)/g),...w.matchAll(/(?:const|let|var)?\s*(\w+)\s*=\s*\(([^)]*)\)\s*=>/g),...w.matchAll(/(?:const|let|var)?\s*(\w+)\s*=\s*(\w+)\s*=>/g)];for(let I of a){let P=I[2]?I[2].split(",").map((D)=>D.trim().split(/[=:]/)[0].trim()):[],_=`line-${i}`;if(P.length>0)n.set(_,new Set(P.filter((D)=>D&&/^\w+$/.test(D))))}for(let[I,P]of n.entries())for(let _ of P){let D=new RegExp(`\\b${_}\\s*=\\s*[^=]`,"g"),j;for(j=D.exec(w);j!==null;j=D.exec(w))if(!w.slice(j.index).match(/^\w+\s*===?/))s.push({filePath:y.filePath,line:i+1,column:j.index+1,ruleId:"eslint/no-param-reassign",message:`Assignment to function parameter '${_}'`,severity:"error"})}}return s}};var nn={meta:{docs:"Disallow use of __proto__",recommended:!0},check:(b,y)=>{let s=[],l=b.split(/\r?\n/);for(let n=0;n<l.length;n++){let i=l[n],w=/__proto__/g,a;for(a=w.exec(i);a!==null;a=w.exec(i)){if(i.substring(0,a.index).includes("//"))continue;s.push({filePath:y.filePath,line:n+1,column:Math.max(1,a.index+1),ruleId:"eslint/no-proto",message:"The '__proto__' property is deprecated",severity:"error"})}}return s},fix:(b)=>{let y=b.split(/\r?\n/),s=!1,l=y.map((n)=>{if(n.trim().startsWith("//")||n.trim().startsWith("/*"))return n;return n.replace(/(\w+)\.__proto__/g,(w,a)=>(s=!0,`Object.getPrototypeOf(${a})`))});return s?l.join(`
8
+ `):b}};var sn={meta:{docs:"Disallow assignment operators in return statements",recommended:!1},check:(b,y)=>{let s=[],l=b.split(/\r?\n/);for(let n=0;n<l.length;n++){let i=l[n],w=/\breturn\s[^;]*\b\w+\s*=\s*(?!=)/g,a;for(a=w.exec(i);a!==null;a=w.exec(i)){let I=a[0];if(/===|==/.test(I))continue;if(i.substring(0,a.index).includes("//"))continue;s.push({filePath:y.filePath,line:n+1,column:Math.max(1,a.index+1),ruleId:"eslint/no-return-assign",message:"Return statement should not contain assignment",severity:"error"})}}return s}};var rn={meta:{docs:"Disallow comma operators",recommended:!1},check:(b,y)=>{let s=[],l=b.split(/\r?\n/);for(let n=0;n<l.length;n++){let i=l[n],w=/\)\s*,\s*\w+\s*\(/g,a;for(a=w.exec(i);a!==null;a=w.exec(i)){if(i.substring(0,a.index).includes("//"))continue;s.push({filePath:y.filePath,line:n+1,column:Math.max(1,a.index+a[0].indexOf(",")+1),ruleId:"eslint/no-sequences",message:"Unexpected use of comma operator",severity:"warning"})}}return s}};var on={meta:{docs:"Disallow variable declarations from shadowing variables declared in the outer scope",recommended:!1},check:(b,y)=>{let s=[],l=b.split(/\r?\n/),i=[new Set];for(let w=0;w<l.length;w++){let a=l[w];if(a.match(/\bfunction\s+\w+\s*\(|=>\s*\{|\{\s*$/))i.push(new Set);let I=[...a.matchAll(/\b(const|let|var)\s+(\w+)/g),...a.matchAll(/function\s+(\w+)\s*\(/g)];for(let P of I){let _=P[2]||P[1];for(let D=0;D<i.length-1;D++)if(i[D].has(_)){s.push({filePath:y.filePath,line:w+1,column:1,ruleId:"eslint/no-shadow",message:`'${_}' is already declared in the upper scope`,severity:"error"});break}i[i.length-1].add(_)}if(a.match(/^\s*\}\s*$/)){if(i.length>1)i.pop()}}return s}};var ln={meta:{docs:"Disallow throwing literals as exceptions",recommended:!0},check:(b,y)=>{let s=[],l=b.split(/\r?\n/);for(let n=0;n<l.length;n++){let i=l[n],w=[{pattern:/\bthrow\s+(['"`][^'"`]*['"`])/g,type:"string"},{pattern:/\bthrow\s+(\d+)/g,type:"number"},{pattern:/\bthrow\s+(true|false|null|undefined)/g,type:"literal"}];for(let{pattern:a,type:I}of w){let P;while((P=a.exec(i))!==null){if(i.substring(0,P.index).includes("//"))continue;s.push({filePath:y.filePath,line:n+1,column:Math.max(1,P.index+1),ruleId:"eslint/no-throw-literal",message:`Expected an error object to be thrown, got ${I} literal`,severity:"error"})}}}return s}};var cn={meta:{docs:"Disallow the use of variables before they are defined",recommended:!1},check:(b,y)=>{let s=[],l=c(b).split(/\r?\n/),n=new Map;for(let i=0;i<l.length;i++){let w=l[i],a=[...w.matchAll(/\b(const|let|var)\s+(\w+)/g),...w.matchAll(/\bfunction\s+(\w+)\s*\(/g),...w.matchAll(/\bclass\s+(\w+)/g)];for(let I of a){let P=I[2]||I[1];if(!n.has(P))n.set(P,i+1)}}for(let i=0;i<l.length;i++){let w=l[i];if(w.match(/\b(const|let|var|function|class)\s+\w+/))continue;let a=w.matchAll(/\b(\w+)\b/g);for(let I of a){let P=I[1],_=n.get(P);if(_&&_>i+1)s.push({filePath:y.filePath,line:i+1,column:I.index+1,ruleId:"eslint/no-use-before-define",message:`'${P}' was used before it was defined`,severity:"error"})}}return s}};var an={meta:{docs:"Disallow unnecessary .call() and .apply()",recommended:!1},check:(b,y)=>{let s=[],l=b.split(/\r?\n/);for(let n=0;n<l.length;n++){let i=l[n],w=/\.\s*call\s*\(\s*(undefined|null)\s*,/g,a=/\.\s*apply\s*\(\s*(undefined|null)\s*,/g,I;for(I=w.exec(i);I!==null;I=w.exec(i))s.push({filePath:y.filePath,line:n+1,column:I.index+1,ruleId:"eslint/no-useless-call",message:"Unnecessary '.call()'",severity:"error"});for(I=a.exec(i);I!==null;I=a.exec(i))s.push({filePath:y.filePath,line:n+1,column:I.index+1,ruleId:"eslint/no-useless-call",message:"Unnecessary '.apply()'",severity:"error"})}return s}};var un={meta:{docs:"Disallow unnecessary concatenation of literals or template literals",recommended:!1},check:(b,y)=>{let s=[],l=b.split(/\r?\n/);for(let n=0;n<l.length;n++){let i=l[n],w=[/(['"`])([^'"`]*)\1\s*\+\s*\1([^'"`]*)\1/g];for(let a of w){let I;while((I=a.exec(i))!==null){if(i.substring(0,I.index).includes("//"))continue;s.push({filePath:y.filePath,line:n+1,column:Math.max(1,I.index+1),ruleId:"eslint/no-useless-concat",message:"Unexpected string concatenation of literals",severity:"warning"})}}}return s},fix:(b)=>{let y=b;return y=y.replace(/(['"`])([^'"`]*)\1\s*\+\s*\1([^'"`]*)\1/g,"$1$2$3$1"),y}};var es=["/","(",")","[","]","{","}","<",">",":","@","#","$","%","&","=","+","-","*","?","!",";",",","|","~","`","^"],fn={meta:{docs:"Disallow unnecessary escape characters",recommended:!0},check:(b,y)=>{let s=[],l=b.split(/\r?\n/);for(let n=0;n<l.length;n++){let i=l[n];for(let w of es){let a=`\\${w}`,I=new RegExp(`(['"\`])[^'"\`]*${a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}`,"g"),P;while((P=I.exec(i))!==null){let _=P.index,D=i.indexOf(a,_);if(D>_)s.push({filePath:y.filePath,line:n+1,column:Math.max(1,D+1),ruleId:"eslint/no-useless-escape",message:`Unnecessary escape character: \\${w}`,severity:"warning"})}}}return s},fix:(b)=>{let y=b;for(let s of es){let l=`\\${s}`;y=y.replace(new RegExp(l.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"g"),s)}return y}};var mn={meta:{docs:"Disallow renaming import, export, and destructured assignments to the same name",recommended:!0},check:(b,y)=>{let s=[],l=b.split(/\r?\n/);for(let n=0;n<l.length;n++){let i=l[n],w=/import\s*\{[^}]*\b(\w+)\s+as\s+\1\b[^}]*\}/g,a;for(a=w.exec(i);a!==null;a=w.exec(i))s.push({filePath:y.filePath,line:n+1,column:Math.max(1,a.index+1),ruleId:"eslint/no-useless-rename",message:`Renaming import '${a[1]}' to '${a[1]}' is redundant`,severity:"error"});let I=/export\s*\{[^}]*\b(\w+)\s+as\s+\1\b[^}]*\}/g;for(a=I.exec(i);a!==null;a=I.exec(i))s.push({filePath:y.filePath,line:n+1,column:Math.max(1,a.index+1),ruleId:"eslint/no-useless-rename",message:`Renaming export '${a[1]}' to '${a[1]}' is redundant`,severity:"error"});let P=/\{[^}]*\b(\w+)\s*:\s*\1\b[^}]*\}\s*=/g;for(a=P.exec(i);a!==null;a=P.exec(i))s.push({filePath:y.filePath,line:n+1,column:Math.max(1,a.index+1),ruleId:"eslint/no-useless-rename",message:`Renaming destructured property '${a[1]}' to '${a[1]}' is redundant`,severity:"error"})}return s},fix:(b)=>{let y=b;return y=y.replace(/\b(\w+)\s+as\s+\1\b/g,"$1"),y=y.replace(/\{([^}]*)\b(\w+)\s*:\s*\2\b([^}]*)\}/g,"{$1$2$3}"),y}};var nt={meta:{docs:"Disallow redundant return statements",recommended:!1},check:(b,y)=>{let s=[],l=b.split(/\r?\n/);for(let n=0;n<l.length;n++){let i=l[n],w=i.trim();if(w==="return"||w==="return;"){let a=!1;for(let I=n+1;I<l.length;I++){let P=l[I].trim();if(P===""||P.startsWith("//")||P.startsWith("/*"))continue;if(P==="}"||P.startsWith("}"))a=!0;break}if(a)s.push({filePath:y.filePath,line:n+1,column:Math.max(1,i.indexOf("return")+1),ruleId:"eslint/no-useless-return",message:"Unnecessary return statement",severity:"warning"})}}return s},fix:(b,y)=>{let s=nt.check(b,y);if(s.length===0)return b;let l=b.split(/\r?\n/),n=new Set(s.map((w)=>w.line-1));return l.filter((w,a)=>!n.has(a)).join(`
9
+ `)}};var pn={meta:{docs:"Require let or const instead of var",recommended:!0},check:(b,y)=>{let s=[],l=b.split(/\r?\n/);for(let n=0;n<l.length;n++){let i=l[n],w=/\bvar\s+/g,a;for(a=w.exec(i);a!==null;a=w.exec(i)){if(i.substring(0,a.index).includes("//"))continue;s.push({filePath:y.filePath,line:n+1,column:Math.max(1,a.index+1),ruleId:"eslint/no-var",message:"Unexpected var, use let or const instead",severity:"error"})}}return s},fix:(b,y)=>b.split(/\r?\n/).map((n)=>{if(n.trim().startsWith("//")||n.trim().startsWith("/*"))return n;return n.replace(/\bvar\s+/g,"let ")}).join(`
10
+ `)};var dn={meta:{docs:"Disallow with statements",recommended:!0},check:(b,y)=>{let s=[],l=b.split(/\r?\n/);for(let n=0;n<l.length;n++){let i=l[n],w=/\bwith\s*\(/g,a;for(a=w.exec(i);a!==null;a=w.exec(i)){if(i.substring(0,a.index).includes("//"))continue;s.push({filePath:y.filePath,line:n+1,column:Math.max(1,a.index+1),ruleId:"eslint/no-with",message:"Unexpected use of 'with' statement",severity:"error"})}}return s}};var hn={meta:{docs:"Require using arrow functions for callbacks",recommended:!1},check:(b,y)=>{let s=[],l=b.split(/\r?\n/);for(let n=0;n<l.length;n++){let i=l[n],w=/\.(map|filter|reduce|forEach|some|every|find|findIndex)\s*\(\s*function\s*\(/g,a;for(a=w.exec(i);a!==null;a=w.exec(i)){if(i.substring(0,a.index).includes("//"))continue;s.push({filePath:y.filePath,line:n+1,column:Math.max(1,a.index+1),ruleId:"eslint/prefer-arrow-callback",message:"Unexpected function expression, use arrow function instead",severity:"warning"})}}return s}};var gn={meta:{docs:"Disallow async functions which have no await expression",recommended:!0},check:(b,y)=>{let s=[],l=b.split(/\r?\n/);for(let n=0;n<l.length;n++)if(l[n].match(/\basync\s+(?:function\s+\w+|(?:\(|\w+)\s*(?:\(|=>))/)){let a=!1,I=0,P=!1,_=n;while(_<l.length){let D=l[_];for(let j of D){if(j==="{")I++,P=!0;if(j==="}"){if(I--,I===0&&P)break}}if(D.match(/\bawait\s+/))a=!0;if(I===0&&P){if(!a)s.push({filePath:y.filePath,line:n+1,column:1,ruleId:"eslint/require-await",message:"Async function has no await expression",severity:"error"});break}_++}}return s}};var ts={name:"eslint",rules:{"array-callback-return":e(at),"constructor-super":e(ut),"for-direction":e(ft),"getter-return":e(mt),"no-async-promise-executor":e(pt),"no-compare-neg-zero":e(dt),"no-cond-assign":e(ht),"no-constant-condition":e(bt),"no-const-assign":e(gt),"no-dupe-class-members":e(yt),"no-dupe-keys":e(Qe),"no-duplicate-case":e(xt),"no-empty-pattern":e(Rt),"no-fallthrough":e(wt),"no-loss-of-precision":e(kt),"no-promise-executor-return":e(It),"no-redeclare":e(Pt),"no-self-assign":e(et),"no-self-compare":e(Mt),"no-sparse-arrays":e(vt),"no-undef":e($t),"no-unsafe-negation":e(Lt),"no-unreachable":e(Ct),"no-useless-catch":e(St),"use-isnan":e(Et),"valid-typeof":e(At),"default-case":e(_t),eqeqeq:e(Tt),"no-alert":e(Dt),"no-await-in-loop":e(jt),"no-caller":e(Ut),"no-case-declarations":e(Ft),"no-else-return":e(Bt),"no-empty":e(qt),"no-empty-function":e(zt),"no-eval":e(Zt),"no-extend-native":e(Gt),"no-global-assign":e(Kt),"no-implied-eval":e(Ht),"no-iterator":e(Yt),"no-new":e(Xt),"no-new-func":e(Jt),"no-new-wrappers":e(Qt),"no-octal":e(en),"no-param-reassign":e(tn),"no-proto":e(nn),"no-return-assign":e(sn),"no-shadow":e(on),"no-throw-literal":e(ln),"no-use-before-define":e(cn),"no-useless-call":e(an),"no-with":e(dn),"require-await":e(gn),complexity:e(Ot),"max-depth":e(Wt),"max-lines-per-function":e(Nt),"no-extra-boolean-cast":e(Vt),"no-lonely-if":e(tt),"no-sequences":e(rn),"no-useless-concat":e(un),"no-useless-escape":e(fn),"no-useless-rename":e(mn),"no-useless-return":e(nt),"no-var":e(pn),"prefer-arrow-callback":e(hn)}};var ns={meta:{docs:"Disallow return statements in constructors - constructors automatically return the instance"},check:(b,y)=>{let s=[],l=b.split(/\r?\n/);for(let n=0;n<l.length;n++){let i=l[n],w=i.indexOf("//");if(!(w>=0?i.slice(0,w):i).match(/\bconstructor\s*\(/))continue;let P=0,_=!1,D=-1;for(let j=n;j<l.length;j++){let B=l[j],Z=null,z=!1;for(let Y=0;Y<B.length;Y++){let X=B[Y];if(z){z=!1;continue}if(X==="\\"&&Z){z=!0;continue}if(!Z){if(X==="'")Z="single";else if(X==='"')Z="double";else if(X==="`")Z="template";else if(X==="{")P++,_=!0;else if(X==="}"){if(P--,_&&P===0){D=j;break}}}else if(Z==="single"&&X==="'"||Z==="double"&&X==='"'||Z==="template"&&X==="`")Z=null}if(D!==-1)break}if(D===-1)continue;for(let j=n;j<=D;j++){let B=l[j];if(j===n)continue;if(/^\s*\/\//.test(B))continue;let Z=B.indexOf("//"),z=Z>=0?B.slice(0,Z):B;if(z=z.replace(/(['"`])(?:(?!\1)[^\\]|\\.)*?\1/g,'""'),z.match(/\breturn\b/)){let X=z.indexOf("return"),J=X>0?z[X-1]:" ",ne=X+6<z.length?z[X+6]:" ";if(/\w/.test(J)||/\w/.test(ne))continue;let Q=z.slice(X+6).trim();if(Q.startsWith("this;")||Q==="this")continue;if(Q===";"||Q==="")continue;let ee=B.indexOf("return");s.push({filePath:y.filePath,line:j+1,column:ee+1||1,ruleId:"no-constructor-return",message:"Unexpected return statement in constructor. Constructors should not return values.",severity:"error",help:"Remove the return statement or move the logic outside of the constructor"})}}}return s}};var ss={meta:{docs:"Disallow irregular whitespace characters that may cause issues in code"},check:(b,y)=>{let s=[],l=/[\u00A0\u1680\u180E\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]/g,n=b.split(/\r?\n/);for(let i=0;i<n.length;i++){let w=n[i],a;l.lastIndex=0;while((a=l.exec(w))!==null){let P=a[0].charCodeAt(0),_="irregular whitespace",D={160:"NO-BREAK SPACE",5760:"OGHAM SPACE MARK",6158:"MONGOLIAN VOWEL SEPARATOR",8192:"EN QUAD",8193:"EM QUAD",8194:"EN SPACE",8195:"EM SPACE",8196:"THREE-PER-EM SPACE",8197:"FOUR-PER-EM SPACE",8198:"SIX-PER-EM SPACE",8199:"FIGURE SPACE",8200:"PUNCTUATION SPACE",8201:"THIN SPACE",8202:"HAIR SPACE",8232:"LINE SEPARATOR",8233:"PARAGRAPH SEPARATOR",8239:"NARROW NO-BREAK SPACE",8287:"MEDIUM MATHEMATICAL SPACE",12288:"IDEOGRAPHIC SPACE",65279:"ZERO WIDTH NO-BREAK SPACE"};if(D[P])_=D[P];s.push({filePath:y.filePath,line:i+1,column:a.index+1,ruleId:"no-irregular-whitespace",message:`Irregular whitespace detected: ${_} (U+${P.toString(16).toUpperCase().padStart(4,"0")})`,severity:"error",help:"Replace irregular whitespace with regular spaces or tabs"})}}return s},fix:(b)=>b.replace(/[\u00A0\u1680\u180E\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]/g," ")};var is={meta:{docs:"Disallow new operators outside of assignments or comparisons",recommended:!0},check(b,y){let s=[],l=b.split(/\r?\n/);for(let n=0;n<l.length;n++){let i=l[n],w=i.trim();if(w.startsWith("//")||w.startsWith("/*")||w.startsWith("*"))continue;if(/^\s*new\s+\w+/.test(i)){let I=/^\s*(?:const|let|var|this\.\w+)\s*=\s*new\s+/,P=/^\s*return\s+new\s+/,_=new RegExp("^\\s*new\\s+\\w[^;]*,"),D=/[=:,(]\s*new\s+/;if(!I.test(i)&&!P.test(i)&&!_.test(i)&&!D.test(w)){let j=i.search(/new\s+/)+1;s.push({filePath:y.filePath,line:n+1,column:j,ruleId:"no-new",message:"Do not use 'new' for side effects",severity:"error",help:"Either assign the result to a variable or remove the 'new' operator if the side effect is intentional."})}}}return s}};var rs={meta:{docs:"Disallow multiple spaces in regular expressions",recommended:!0},check(b,y){let s=[],l=b.split(/\r?\n/);for(let n=0;n<l.length;n++){let i=l[n];if(/^\s*\/\//.test(i))continue;let w=/\/(?![*/])((?:\\.|[^/\\])+)\/[gimsuvy]*/g,a;for(a=w.exec(i);a!==null;a=w.exec(i)){let P=a[1];if(/ {2,}/.test(P)){let _=a.index+1;s.push({filePath:y.filePath,line:n+1,column:_,ruleId:"no-regex-spaces",message:"Multiple spaces in regular expression",severity:"error",help:"Use quantifiers like {2} instead of multiple spaces for clarity."})}}let I=/new\s+RegExp\s*\(\s*['"`]([^'"`]+)['"`]/g;for(a=I.exec(i);a!==null;a=I.exec(i)){let P=a[1];if(/ {2,}/.test(P)){let _=a.index+1;s.push({filePath:y.filePath,line:n+1,column:_,ruleId:"no-regex-spaces",message:"Multiple spaces in regular expression",severity:"error",help:"Use quantifiers like {2} instead of multiple spaces for clarity."})}}}return s}};var os=new Set(["|","&",":",",","<"]);function ls(b){return G(b)}function bn(b,y){if(b[y+1]==="/"||b[y+1]==="*")return!1;let s=b.slice(0,y).trimEnd();return!s||/[=([{,:;!&|?]$/.test(s)||s.endsWith("=>")||s.endsWith("return")}var Be={meta:{docs:"Report variables and parameters that are declared/assigned but never used"},check:(b,y)=>{if(y.filePath.endsWith("/no-unused-vars.ts"))return[];if(y.filePath.endsWith(".d.ts"))return[];let s=[],l=y.options||{},n=typeof l.varsIgnorePattern==="string"?l.varsIgnorePattern:"^_",i=typeof l.argsIgnorePattern==="string"?l.argsIgnorePattern:"^_",w=new RegExp(n,"u"),a=new RegExp(i,"u"),I=g(b),P=C(b,{comments:!0},I),_=P.split(/\r?\n/),D=P,j=C(b,{comments:!0,strings:!0,templates:!0,regex:!0},I).split(/\r?\n/),B=S(b,I),Z=null,z=[],Y=(fe,re)=>{let pe=new RegExp(`\\b${fe}\\b`,"g");if(fe.includes("$"))return pe.test(`${_.slice(0,re).join(`
11
+ `)}
12
+ ${_.slice(re+1).join(`
13
+ `)}`);if(Z===null){Z=_.join(`
14
+ `),z=Array.from({length:_.length});let me=0;for(let xe=0;xe<_.length;xe++)z[xe]=me,me+=_[xe].length+1}let le=z[re],ge=le+_[re].length;for(let me=pe.exec(Z);me!==null;me=pe.exec(Z)){if(me.index<le||me.index>=ge)return!0;if(me[0].length===0)pe.lastIndex++}return!1},X=new RegExp("^\\s*(?:const|let|var)\\s+(.+?);?\\s*$");for(let fe=0;fe<_.length;fe++){if(B[fe])continue;let re=_[fe],pe=re.match(X);if(!pe)continue;let le=pe[1],ge=[],me="",xe=0,de=0,be=null,ae=!1;for(let ce=0;ce<le.length;ce++){let ue=le[ce];if(ae){ae=!1,me+=ue;continue}if(ue==="\\"&&be){ae=!0,me+=ue;continue}if(!be){if(ue==="/"&&le[ce+1]==="/")break;if(ue==="/"&&le[ce+1]==="*"){ce+=2;while(ce<le.length&&!(le[ce]==="*"&&le[ce+1]==="/"))ce++;ce++;continue}if(ue==="'")be="single";else if(ue==='"')be="double";else if(ue==="`")be="template";else if(ue==="<")de++;else if(ue===">")de--;else if(ue==="("||ue==="["||ue==="{")xe++;else if(ue===")"||ue==="]"||ue==="}")xe--;else if(ue===","&&xe===0&&de===0){ge.push(me),me="";continue}}else if(be==="single"&&ue==="'"||be==="double"&&ue==='"'||be==="template"&&ue==="`")be=null;me+=ue}if(me)ge.push(me);for(let ce of ge){let ue=ce.trim();if(!ue)continue;let he=ue.match(/^([$A-Z_][\w$]*)/i),oe=[];if(he)oe.push(he[1]);else if(ue.startsWith("{")||ue.startsWith("[")){let te=ue[0],ke=te==="{"?"}":"]",$e=0,Ce=-1,Me=null,Oe=!1;for(let Ae=0;Ae<ue.length;Ae++){let Ee=ue[Ae];if(Oe){Oe=!1;continue}if(Ee==="\\"&&Me){Oe=!0;continue}if(!Me){if(Ee==="'"||Ee==='"'||Ee==="`")Me=Ee==="'"?"single":Ee==='"'?"double":"template";else if(Ee===te)$e++;else if(Ee===ke){if($e--,$e===0){Ce=Ae;break}}}else if(Me==="single"&&Ee==="'"||Me==="double"&&Ee==='"'||Me==="template"&&Ee==="`")Me=null}if(Ce>0){let Ae=ue.slice(1,Ce),Ee=[],Le="",_e=0,Te=null,Ie=!1;for(let Pe=0;Pe<Ae.length;Pe++){let Re=Ae[Pe];if(Ie){Ie=!1,Le+=Re;continue}if(Re==="\\"&&Te){Ie=!0,Le+=Re;continue}if(!Te){if(Re==="'"||Re==='"'||Re==="`"){Te=Re==="'"?"single":Re==='"'?"double":"template",Le+=Re;continue}if(Re==="("||Re==="{"||Re==="[")_e++;if(Re===")"||Re==="}"||Re==="]")_e--;if(Re===","&&_e===0){Ee.push(Le.trim()),Le="";continue}}else if(Te==="single"&&Re==="'"||Te==="double"&&Re==='"'||Te==="template"&&Re==="`")Te=null;Le+=Re}if(Le.trim())Ee.push(Le.trim());for(let Pe of Ee){if(Pe.startsWith("...")){let ve=Pe.slice(3).match(/^([$A-Z_][\w$]*)/i);if(ve)oe.push(ve[1]);continue}let Re=Pe.indexOf(":");if(Re!==-1){let ve=Pe.slice(Re+1).trim(),Ue=0;for(let Fe=0;Fe<ve.length;Fe++){let Ne=ve[Fe];if(Ne==="("||Ne==="{"||Ne==="[")Ue++;else if(Ne===")"||Ne==="}"||Ne==="]")Ue--;else if(Ne==="="&&Ue===0){ve=ve.slice(0,Fe).trim();break}}let De=ve.match(/^([$A-Z_][\w$]*)/i);if(De)oe.push(De[1])}else{let ve=Pe,Ue=0;for(let Fe=0;Fe<ve.length;Fe++){let Ne=ve[Fe];if(Ne==="("||Ne==="{"||Ne==="[")Ue++;else if(Ne===")"||Ne==="}"||Ne==="]")Ue--;else if(Ne==="="&&Ue===0){ve=ve.slice(0,Fe).trim();break}}let De=ve.match(/^([$A-Z_][\w$]*)/i);if(De)oe.push(De[1])}}}}for(let te of oe){if(w.test(te))continue;let ke=j[fe],$e=new RegExp(`(?<![\\w$])${te.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}(?![\\w$])`,"g"),Ce=!1,Me=re.indexOf(te,re.indexOf(ce));for(let Oe of ke.matchAll($e)){let Ae=ke.slice(0,Oe.index).trimEnd(),Ee=ke.slice(Oe.index+te.length).trimStart();if(Oe.index===Me||Ae.endsWith(".")||Ee.startsWith(":"))continue;Ce=!0;break}if(!Ce&&!Y(te,fe))s.push({filePath:y.filePath,line:fe+1,column:Math.max(1,re.indexOf(te)+1),ruleId:"pickier/no-unused-vars",message:`'${te}' is assigned a value but never used. Allowed unused vars must match pattern: ${n}`,severity:"error",help:`Either use this variable in your code, remove it, or prefix it with an underscore (_${te}) to mark it as intentionally unused`})}}}let J=(fe)=>{let pe=((me)=>{let xe="",de=null,be=!1,ae=0;for(let ce=0;ce<me.length;ce++){let ue=me[ce];if(be){be=!1;continue}if(ue==="\\"&&de){be=!0;continue}if(!de){if(ue==="'")de="single";else if(ue==='"')de="double";else if(ue==="`")de="template";else if(ue==="("||ue==="{"||ue==="[")ae++;else if(ue===")"||ue==="}"||ue==="]")ae--;else if(ue==="="&&ae===0)return xe}else if(de==="single"&&ue==="'"||de==="double"&&ue==='"'||de==="template"&&ue==="`")de=null;xe+=ue}return xe})(fe);return((me)=>{let xe="",de=0;while(de<me.length){let be=me[de];if(be===":"){de++;while(de<me.length&&/\s/.test(me[de]))de++;let ae=0,ce=0,ue=null,he=!1;while(de<me.length){let oe=me[de];if(he){he=!1,de++;continue}if(oe==="\\"&&ue){he=!0,de++;continue}if(!ue){if(oe==="'")ue="single";else if(oe==='"')ue="double";else if(oe==="`")ue="template";else if(oe==="<")ce++;else if(oe===">")ce--;else if(oe==="("||oe==="{"||oe==="[")ae++;else if(oe===")"||oe==="}"||oe==="]")if(ae>0)ae--;else break;else if(oe===","&&ae===0&&ce===0)break}else if(ue==="single"&&oe==="'"||ue==="double"&&oe==='"'||ue==="template"&&oe==="`")ue=null;de++}continue}xe+=be,de++}return xe})(pe).split(/[^$\w]+/).filter((me)=>me&&me!=="undefined")},ne=(fe,re)=>{let pe=/^\s*(?:export\s+)?(?:default\s+)?(?:declare\s+)?(?:abstract\s+)?(?:async\s+)?(?:function\b|class\b|const\b|let\b|var\b|interface\b|type\b)/;for(let le=fe;le<_.length;le++){let me=(le===fe?_[le].slice(re+1):_[le]).replace(/\/\/.*$/,"");if(le!==fe&&pe.test(me))return!0;if(me.includes("{"))return!1;if(me.includes(";"))return!0}return!0},Q=(fe,re)=>{let pe=0,le=!1,ge=0,me=0,xe=!1,de=0,be=null,ae=!1,ce=!0,ue="",he=!1,oe=!1,te=[],ke=!1;for(let $e=fe;$e<_.length;$e++){let Ce=_[$e],Me=Ce,Oe=te.length>0&&te[te.length-1]===-1,Ae=-1,Ee=null,Le=!1;if(!Oe)for(let Ie=0;Ie<Ce.length-1;Ie++){let Pe=Ce[Ie],Re=Ce[Ie+1];if(Le){Le=!1;continue}if(Pe==="\\"&&Ee){Le=!0;continue}if(!Ee){if(Pe==="'")Ee="single";else if(Pe==='"')Ee="double";else if(Pe==="`")Ee="template";else if(Pe==="/"&&Re==="/"){Ae=Ie;break}}else if(Ee==="single"&&Pe==="'"||Ee==="double"&&Pe==='"'||Ee==="template"&&Pe==="`")Ee=null}if(Ae>=0)Me=Ce.slice(0,Ae);let _e=(Ie)=>{let Pe="",Re=0,ve=null,Ue=!1;while(Re<Ie.length){let De=Ie[Re];if(Ue){Ue=!1,Pe+=De,Re++;continue}if(De==="\\"&&ve){Ue=!0,Pe+=De,Re++;continue}if(!ve){if(De==="'")ve="single";else if(De==='"')ve="double";else if(De==="`")ve="template";else if(De==="/"){if(bn(Ie,Re)){let Fe=Re,Ne=!1;Re++;while(Re<Ie.length){if(Ie[Re]==="\\"){Re+=2;continue}if(Ie[Re]==="[")Ne=!0;else if(Ie[Re]==="]")Ne=!1;if(Ie[Re]==="/"&&!Ne){Re++;while(Re<Ie.length&&/[gimsuvy]/.test(Ie[Re]))Re++;break}Re++}Pe+=" ".repeat(Math.min(Re,Ie.length)-Fe);continue}}}else if(ve==="single"&&De==="'"||ve==="double"&&De==='"'||ve==="template"&&De==="`")ve=null;Pe+=De,Re++}return Pe};if(!Oe)Me=_e(Me);let Te=0;if(!le){let Ie=-1,Pe=ce?typeof re==="number"?re:0:0;if(ce=!1,Pe>=Me.length){let Re=Me.indexOf("=>");Pe=Re>=0?Re+2:0}for(let Re=Pe;Re<Me.length;Re++){let ve=Me[Re];if(ae){ae=!1;continue}if(ve==="\\"&&be){ae=!0;continue}if(!be){if(ve!==" "&&ve!=="\t"&&ve!==`
15
+ `&&ve!=="\r"&&ve!=="{"&&ve!=="}"&&me===0)ue=ve;if(ve==="'")be="single";else if(ve==='"')be="double";else if(ve==="`")be="template";else if(ve==="<")de++;else if(ve===">")de=Math.max(0,de-1);else if(ve==="{"){if(me===0){if(xe&&de===0&&!os.has(ue)){Ie=Re;break}}me++}else if(ve==="}"){if(me>0){if(me--,me===0)xe=!0,ue="}"}}}else if(be==="single"&&ve==="'"||be==="double"&&ve==='"'||be==="template"&&ve==="`")be=null}if(Ie===-1){if(de>0)continue;if(me>0&&os.has(ue))continue;for(let Re=Pe;Re<Me.length;Re++)if(Me[Re]==="{"&&!be){Ie=Re;break}}if(Ie===-1)continue;le=!0,ge=1,Te=Ie+1,pe=Ie,fe=$e}for(let Ie=Te;Ie<Me.length;Ie++){let Pe=Me[Ie];if(ke){ke=!1;continue}let Re=te.length>0&&te[te.length-1]===-1,ve=te.length>0&&te[te.length-1]>=0;if(Pe==="\\"&&(he||oe||Re)){ke=!0;continue}if(he){if(Pe==="'")he=!1;continue}if(oe){if(Pe==='"')oe=!1;continue}if(Re){if(Pe==="`")te.pop();else if(Pe==="$"&&Ie+1<Me.length&&Me[Ie+1]==="{")te[te.length-1]=0,Ie++;continue}if(ve){if(Pe==="/"){if(bn(Me,Ie)){Ie++;while(Ie<Me.length){if(Me[Ie]==="\\"){Ie+=2;continue}if(Me[Ie]==="/"){while(Ie+1<Me.length&&/[gimsuvy]/.test(Me[Ie+1]))Ie++;break}Ie++}continue}}if(Pe==="`"){te.push(-1);continue}if(Pe==="'"){he=!0;continue}if(Pe==='"'){oe=!0;continue}if(Pe==="{"){te[te.length-1]++;continue}if(Pe==="}")if(te[te.length-1]>0)te[te.length-1]--;else te[te.length-1]=-1;continue}if(Pe==="'")he=!0;else if(Pe==='"')oe=!0;else if(Pe==="`")te.push(-1);else if(Pe==="{")ge++;else if(Pe==="}"){if(ge--,ge===0)return{from:fe,to:$e,openCol:pe}}}}return null},ee=(fe,re)=>{let pe={parenDepth:0,braceDepth:0,bracketDepth:0,inTemplate:!1},le=(ce)=>{for(let ue=0;ue<ce.length;ue++){let he=ce[ue];if(he==="`")pe.inTemplate=!pe.inTemplate;else if(he==="(")pe.parenDepth++;else if(he===")")pe.parenDepth--;else if(he==="{")pe.braceDepth++;else if(he==="}")pe.braceDepth--;else if(he==="[")pe.bracketDepth++;else if(he==="]")pe.bracketDepth--}},ge=()=>pe.parenDepth>0||pe.braceDepth>0||pe.bracketDepth>0||pe.inTemplate,me=(ce)=>/(?:\?|:|\.|,|&&|\|\||\?\?|\+|-|\*|\/|%|\*\*)$/.test(ce.trimEnd()),xe=(ce)=>/^(?:\?|:|\.|,|&&|\|\||\?\?|\+|-|\*|\/|%|\*\*)/.test(ce.trimStart()),de=_[fe].slice(re+2);le(de);let be=de.trim()!=="",ae=fe+1;while(ae<_.length){let ce=ae===fe+1?de:_[ae-1];if(!(!be||ge()||me(ce)||xe(_[ae])))break;de+=`
16
+ ${_[ae]}`,be||=_[ae].trim()!=="",le(_[ae]),ae++}return de},ie=[],ye=!1,we=!1,se=!1;for(let fe=0;fe<_.length;fe++){let re=_[fe];if(/^\s*\/\//.test(re))continue;if(B[fe])continue;let pe=re,le=null,ge=!1,me=!1;for(let he=0;he<re.length-1;he++){let oe=re[he],te=re[he+1];if(me){me=!1;continue}if(oe==="\\"&&(le||ge)){me=!0;continue}if(!le&&!ge){if(oe==="'")le="single";else if(oe==='"')le="double";else if(oe==="`")le="template";else if(oe==="/"){if(bn(re,he))ge=!0;else if(te==="/"){pe=re.slice(0,he);break}}}else if(le){if(le==="single"&&oe==="'"||le==="double"&&oe==='"'||le==="template"&&oe==="`")le=null}else if(ge&&oe==="/")ge=!1}let be=((he)=>{let oe="",te=0;while(te<he.length){if(he[te]==="/"){if(bn(he,te)){te++;while(te<he.length){if(he[te]==="\\"){te+=2;continue}if(he[te]==="/"){te++;while(te<he.length&&/[gimsuvy]/.test(he[te]))te++;break}te++}continue}}oe+=he[te],te++}return oe})(pe).replace(/'(?:[^'\\]|\\.)*'/g,"''").replace(/"(?:[^"\\]|\\.)*"/g,'""');if(!(!se&&!ye&&!we&&ie.length===0&&!be.includes("`")&&!be.includes("'")&&!be.includes('"'))){let he="";for(let oe=0;oe<be.length;oe++){let te=be[oe];if(se){se=!1;let Ce=ie.length>0&&ie[ie.length-1]===-1;he+=Ce?" ":te;continue}let ke=ie.length>0&&ie[ie.length-1]===-1,$e=ie.length>0&&ie[ie.length-1]>=0;if(te==="\\"&&(ye||we||ke)){se=!0,he+=ke?" ":te;continue}if(ye){if(te==="'")ye=!1;he+=te;continue}if(we){if(te==='"')we=!1;he+=te;continue}if(ke){if(te==="`")ie.pop();else if(te==="$"&&oe+1<be.length&&be[oe+1]==="{")ie[ie.length-1]=0,he+=" ",oe++;else he+=" ";continue}if($e){if(te==="`")ie.push(-1),he+=" ";else if(te==="'")ye=!0,he+=te;else if(te==='"')we=!0,he+=te;else if(te==="{")ie[ie.length-1]++,he+=te;else if(te==="}")if(ie[ie.length-1]>0)ie[ie.length-1]--,he+=te;else ie[ie.length-1]=-1,he+=" ";else he+=te;continue}if(te==="`")ie.push(-1),he+=" ";else if(te==="'")ye=!0,he+=te;else if(te==='"')we=!0,he+=te;else he+=te}be=he}let ce=be.match(/\bfunction\b/);if(ce){if(re.includes("function scanContent")||re.includes("function findMatching"))continue;if(be.slice(ce.index+8).trimStart().startsWith(":"))continue;let oe=be.slice(0,ce.index).trimEnd();if(oe.endsWith(".")||oe.endsWith("?."))continue;let te=ce.index,ke=re.indexOf("(",te);if(ke===-1)continue;let $e=0,Ce=-1,Me=fe,Oe="";for(let _e=fe;_e<_.length;_e++){let Te=_e===fe?_[_e]:_[_e],Ie=_e===fe?ke:0;for(let Pe=Ie;Pe<Te.length;Pe++)if(Te[Pe]==="(")$e++;else if(Te[Pe]===")"){if($e--,$e===0){if(Ce=Pe,Me=_e,fe===_e)Oe=re.slice(ke+1,Ce);else{Oe=re.slice(ke+1);for(let Re=fe+1;Re<_e;Re++)Oe+=` ${_[Re]}`;Oe+=` ${Te.slice(0,Ce)}`}break}}if(Ce!==-1)break}if(Ce===-1)continue;if(ne(Me,Ce))continue;let Ae=J(Oe),Ee=Q(Me,Ce),Le="";if(Ee)if(Ee.from===Me){let _e=_[Ee.from],Te=Ee.openCol,Ie=Te>=0?_e.slice(Te+1):"";if(Ee.to>Ee.from)Le=`${Ie}
17
+ ${_.slice(Ee.from+1,Ee.to+1).join(`
18
+ `)}`;else Le=Ie}else Le=_.slice(Ee.from,Ee.to+1).join(`
19
+ `);for(let _e of Ae){if(!_e||a.test(_e)||_e==="undefined")continue;if(!new RegExp(`\\b${_e}\\b`,"g").test(Le))s.push({filePath:y.filePath,line:fe+1,column:Math.max(1,re.indexOf(_e)+1),ruleId:"pickier/no-unused-vars",message:`'${_e}' is defined but never used (function parameter). Allowed unused args must match pattern: ${i}`,severity:"error"})}continue}let ue=re.indexOf("=>");if(ue!==-1&&be.includes("=>")){let he=-1;for(let oe=ue-1;oe>=0;oe--){let te=re[oe];if(te===")"){he=oe;break}if(te!==" "&&te!=="\t"&&te!==`
20
+ `&&te!==":"&&te!==">"&&!/\w/.test(te))break}if(he!==-1){let oe=-1,te=1;for(let ke=he-1;ke>=0;ke--){let $e=re[ke];if($e===")")te++;else if($e==="("){if(te--,te===0){oe=ke;break}}}if(oe!==-1){let ke=!1,$e=0,Ce=0;for(let Oe=oe-1;Oe>=0;Oe--){let Ae=re[Oe];if(Ae===">"){$e++;continue}if(Ae==="<"){if($e>0){$e--;continue}if(Ce<=0){ke=!0;break}continue}if(Ae===":"&&$e===0&&Ce<=0){ke=!0;break}if($e>0)continue;if(Ae===",")continue;if(Ae===")"){Ce++;continue}if(Ae==="("){Ce--;continue}if(Ae==="|"||Ae==="&"){ke=!0;break}if(Ae==="="||Ae==="{"||Ae==="["){if(Ce>=0)break;continue}if(Ae!==" "&&Ae!=="\t"&&!/[\w.]/.test(Ae)){if(Ce>=0)break}}if(!ke){let Oe=re.slice(0,oe);if(/^\s*(?:export\s+)?(?:declare\s+)?type\s+\w[\w$]*\s*(?:<[^>]*>)?\s*=\s*$/.test(Oe))ke=!0;else if(/\bas\s+$/.test(Oe))ke=!0}if(ke)continue;let Me=re.slice(oe+1,he);if(!(Me.trim()===""&&re.slice(Math.max(0,oe-10),oe).includes("async"))){let Oe=J(Me);if(Oe.length>0){let Ae="";if(re.slice(ue+2).trimStart().startsWith("{")){let Le=Q(fe,ue);if(Le)if(Le.from===fe){let _e=_[Le.from],Te=_e.indexOf("{",ue),Ie=Te>=0?_e.slice(Te+1):"";if(Le.to>Le.from)Ae=`${Ie}
21
+ ${_.slice(Le.from+1,Le.to+1).join(`
22
+ `)}`;else Ae=Ie}else Ae=_.slice(Le.from,Le.to+1).join(`
23
+ `)}else Ae=ee(fe,ue);for(let Le of Oe){if(!Le||a.test(Le)||Le==="undefined")continue;if(!new RegExp(`\\b${Le}\\b`,"g").test(Ae))s.push({filePath:y.filePath,line:fe+1,column:Math.max(1,re.indexOf(Le)+1),ruleId:"pickier/no-unused-vars",message:`'${Le}' is defined but never used (function parameter). Allowed unused args must match pattern: ${i}`,severity:"error"})}continue}}}}}{let he=/(?:^|[=,:({\s])\s*([$A-Z_][\w$]*)\s*=>/gi,oe;while((oe=he.exec(be))!==null){let te=oe[1];if(!te||a.test(te)||te==="undefined")continue;let ke=be.slice(0,oe.index+oe[0].indexOf(te)).trimEnd();if(/\)\s*:$/.test(ke)||/\)\s*:\s*$/.test(ke))continue;if(/\)\s*:\s*[$A-Z_][\w$]*\s+is$/i.test(ke))continue;if(/^(?:string|number|boolean|void|never|any|unknown|object|bigint|symbol|undefined|null)$/.test(te))continue;let $e=new RegExp(`\\b${te}\\s*=>`),Ce=re.match($e);if(!Ce)continue;let Me=re.indexOf(Ce[0])+Ce[0].lastIndexOf("=>"),Oe="";if(re.slice(Me+2).trimStart().startsWith("{")){let Le=Q(fe,Me);if(Le)if(Le.from===fe){let _e=_[Le.from],Te=_e.indexOf("{",Me),Ie=Te>=0?_e.slice(Te+1):"";if(Le.to>Le.from)Oe=`${Ie}
24
+ ${_.slice(Le.from+1,Le.to+1).join(`
25
+ `)}`;else Oe=Ie}else Oe=_.slice(Le.from,Le.to+1).join(`
26
+ `)}else Oe=ee(fe,Me);if(!new RegExp(`\\b${te}\\b`,"g").test(Oe))s.push({filePath:y.filePath,line:fe+1,column:Math.max(1,re.indexOf(te)+1),ruleId:"pickier/no-unused-vars",message:`'${te}' is defined but never used (function parameter). Allowed unused args must match pattern: ${i}`,severity:"error"})}}}return s},fix:(b,y)=>{let s=Be.check(b,y);if(s.length===0)return b;let l=s.filter((B)=>B.message.includes("(function parameter)"));if(l.length===0)return b;let n=b.split(/\r?\n/),i=new Set,w=/(?:eslint|pickier)-disable-next-line\b([^*\n]*)/;for(let B=0;B<n.length;B++){let Z=n[B].match(w);if(!Z)continue;let z=Z[1].trim();if(z===""||/\bno-unused-vars\b/.test(z)||/\bpickier\/no-unused-vars\b/.test(z))i.add(B+2)}let a=new Map;for(let B of l){if(i.has(B.line))continue;let Z=B.message.match(/^'([^']+)'/);if(!Z)continue;let z=Z[1];if(z.startsWith("_"))continue;let Y=a.get(B.line);if(!Y)Y=new Set,a.set(B.line,Y);Y.add(z)}if(a.size===0)return b;let I=b.split(/\r?\n/),P=g(b),_=[0];for(let B=0;B<b.length;B++)if(b[B]===`
27
+ `)_.push(B+1);let D=(B)=>P.templates.some(([Z,z])=>B>Z&&B<z)||P.regions.some((Z)=>Z.kind!=="template"&&B>=Z.start&&B<Z.end),j=!1;for(let[B,Z]of a){let z=B-1,Y=I[z];if(Y===void 0)continue;let X=_[z]??0,J=[];for(let Q of Z){let ee=Q.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),ie=new RegExp(`(?<=[(,]\\s*)\\b${ee}\\b(?=\\s*[,):=])`,"g"),ye;while((ye=ie.exec(Y))!==null){if(D(X+ye.index))continue;J.push({start:ye.index,end:ye.index+Q.length,name:Q})}}if(J.length===0)continue;J.sort((Q,ee)=>ee.start-Q.start);let ne=Y;for(let Q of J)ne=`${ne.slice(0,Q.start)}_${Q.name}${ne.slice(Q.end)}`;if(ne!==Y)I[z]=ne,j=!0}return j?I.join(`
28
+ `):b}};function qe(b){return S(b)}function sl(b,y){let s=[],l=0,n=0,i=null,w=!1;for(let a=0;a<b.length;a++){let I=b[a];if(w){w=!1;continue}if(I==="\\"&&i){w=!0;continue}if(!i){if(I==="'")i="single";else if(I==='"')i="double";else if(I==="`")i="template";else if(I==="("||I==="{"||I==="[")l++;else if(I===")"||I==="}"||I==="]")l--;else if(I===y&&l===0)s.push(b.slice(n,a)),n=a+1}else if(i==="single"&&I==="'"||i==="double"&&I==='"'||i==="template"&&I==="`")i=null}return s.push(b.slice(n)),s}function il(b){let y=0;for(let s=0;s<b.length;s++){let l=b[s];if(l==="{"||l==="("||l==="["||l==="<")y++;else if(l==="}"||l===")"||l==="]"||l===">")y--;else if(l==="="&&y===0&&b[s+1]!=="="&&b[s-1]!=="!"&&b[s-1]!=="<"&&b[s-1]!==">")return s}return-1}function rl(b,y){let s=new RegExp(`\\b${y}\\b`),l=0,n=null,i=!1;while(l<b.length){let w=b[l];if(i){i=!1,l++;continue}if(w==="\\"&&n){i=!0,l++;continue}if(n){if(n==="single"&&w==="'"||n==="double"&&w==='"'||n==="template"&&w==="`")n=null;l++;continue}if(w==="'"){n="single",l++;continue}if(w==='"'){n="double",l++;continue}if(w==="`"){n="template",l++;continue}if(w==="["||w==="{"){let a=w,I=w==="["?"]":"}",P=1,_=l+1;while(_<b.length&&P>0){let D=b[_];if(D==="\\"){_+=2;continue}if(D===a)P++;else if(D===I)P--;if(P===0)break;_++}if(P===0&&_<b.length){let D=_+1;while(D<b.length&&(b[D]===" "||b[D]==="\t"||b[D]==="\r"||b[D]===`
29
+ `))D++;if(b[D]==="="&&b[D+1]!=="="&&b[D+1]!==">"){let j=b.slice(l+1,_);if(s.test(j)){let B=new RegExp(`\\b${y}\\b\\s*:`),Z=new RegExp(`:\\s*\\b${y}\\b`);if(a==="{"){if(!(B.test(j)&&!Z.test(j)&&!new RegExp(`(?:^|[\\s,{])\\s*${y}\\s*(?:,|\\s*=|\\s*})`).test(j)))return!0}else return!0}}}l=_+1;continue}l++}return!1}function cs(b,y){let s=new RegExp("^\\s*(?:let|var)\\s+(.+?);?\\s*$"),l=b.match(s);if(!l)return null;let n=l[1],i=il(n);if(i>=0){let I=n.indexOf(":");if(I>=0&&I<i)n=n.slice(0,I)+n.slice(i)}let w=sl(n,","),a=[];for(let I of w){let P=I.trim();if(!P)continue;if(P.match(/^[{[]/))return null;let D=P.match(/^([$A-Z_][\w$]*)/i);if(!D)return null;let j=D[1];if(!/=/.test(P))return null;let Z=y.indexOf(b),Y=`\\b${j}\\s*(?:${[">>>=","**=","<<=",">>=","??=","||=","&&=","+=","-=","*=","/=","%=","&=","^=","|=","="].map((Q)=>Q.replace(/[|\\^$*+?.(){}[\]]/g,(ee)=>`\\${ee}`)).join("|")})`,X=P.indexOf("="),J=X>=0?P.slice(X+1):"",ne=new RegExp(Y).test(J);if(!ne){let Q=`${y.slice(0,Math.max(0,Z))}
30
+ ${y.slice(Z+b.length)}`;ne=new RegExp(Y).test(Q)||new RegExp(`(?:^|[^$w])(?:\\+\\+|--)\\s*${j}\\b|\\b${j}\\s*(?:\\+\\+|--)`).test(Q)||rl(Q,j)}a.push({name:j,fixable:!ne})}return a}var yn={meta:{docs:"Suggest 'const' for variables that are never reassigned (heuristic)"},check:(b,y)=>{let s=[],l=b.split(/\r?\n/),n=qe(b);for(let i=0;i<l.length;i++){if(n[i])continue;let w=l[i],a=cs(w,b);if(!a)continue;for(let{name:I,fixable:P}of a){if(!P)continue;let _=w.search(new RegExp(`\\b${I.replace(/\$/g,"\\$")}\\b`)),D=_!==-1?_:w.indexOf(I);s.push({filePath:y.filePath,line:i+1,column:Math.max(1,D+1),ruleId:"prefer-const",message:`'${I}' is never reassigned. Use 'const' instead`,severity:"error",help:`Change 'let ${I}' to 'const ${I}' since the variable is never reassigned. This makes your code more predictable and prevents accidental mutations`})}}return s},fix:(b)=>{let y=b.split(/\r?\n/),s=qe(b),l=new Set,n=/(?:eslint|pickier)-disable-next-line\b([^*\n]*)/;for(let w=0;w<y.length;w++){let a=y[w].match(n);if(!a)continue;let I=a[1].trim();if(I===""||/\bprefer-const\b/.test(I))l.add(w+2)}let i=!1;for(let w=0;w<y.length;w++){if(l.has(w+1))continue;if(s[w])continue;let a=y[w];if(!/^\s*let\b/.test(a))continue;let I=cs(a,b);if(!I||I.length===0)continue;if(!I.every((_)=>_.fixable))continue;let P=a.replace(/^(\s*)let(\s+)/,"$1const$2");if(P!==a)y[w]=P,i=!0}return i?y.join(`
31
+ `):b}};var as={meta:{docs:"Prefer object spread ({...obj}) over Object.assign() for object composition"},check:(b,y)=>{let s=[],l=b.split(/\r?\n/);for(let n=0;n<l.length;n++){let i=l[n];if(/^\s*\/\//.test(i))continue;let w=i.indexOf("//"),a=w>=0?i.slice(0,w):i,I=a.matchAll(/\bObject\.assign\s*\(/g);for(let P of I){let _=P.index,D=a.slice(0,_),j=(D.match(/'/g)||[]).length,B=(D.match(/"/g)||[]).length,Z=(D.match(/`/g)||[]).length;if(j%2!==0||B%2!==0||Z%2!==0)continue;let z=_+13,Y=a.slice(z),X=-1,J=1,ne=0,Q=0,ee=null,ie=!1;for(let we=1;we<Y.length;we++){let se=Y[we];if(ie){ie=!1;continue}if(se==="\\"&&ee){ie=!0;continue}if(!ee){if(se==="'")ee="single";else if(se==='"')ee="double";else if(se==="`")ee="template";else if(se==="(")J++;else if(se===")"){if(J--,J===0)break}else if(se==="{")ne++;else if(se==="}")ne--;else if(se==="[")Q++;else if(se==="]")Q--;else if(se===","&&J===1&&ne===0&&Q===0){X=we;break}}else if(ee==="single"&&se==="'"||ee==="double"&&se==='"'||ee==="template"&&se==="`")ee=null}if(X===-1)continue;let ye=Y.slice(1,X).trim();if(ye==="{}")s.push({filePath:y.filePath,line:n+1,column:_+1,ruleId:"prefer-object-spread",message:"Prefer object spread over Object.assign",severity:"error",help:"Use object spread syntax: {...obj} instead of Object.assign({}, obj)"});else if(ye==="{}"||/^\{.*\}$/.test(ye))s.push({filePath:y.filePath,line:n+1,column:_+1,ruleId:"prefer-object-spread",message:"Prefer object spread over Object.assign for object literals",severity:"error",help:"Use object spread syntax: {...obj1, ...obj2}"})}}return s},fix:(b)=>{let y=b.split(/\r?\n/),s=[];for(let l=0;l<y.length;l++){let n=y[l];n=n.replace(/\bObject\.assign\s*\(\s*\{\}\s*,\s*([^)]+)\)/g,(i,w)=>`{${w.split(",").map((I)=>I.trim()).map((I)=>`...${I}`).join(", ")}}`),s.push(n)}return s.join(`
32
+ `)}};var xn={meta:{docs:"Prefer template literals over string concatenation",recommended:!0},check(b,y){let s=[],l=c(b).split(/\r?\n/);for(let n=0;n<l.length;n++){let i=l[n],w=i.trim();if(w.startsWith("//")||w.startsWith("/*")||w.startsWith("*")||w.startsWith("import"))continue;let a=/(['"`][^'"`]*['"`])\s*\+\s*([a-z_$][\w$]*)/i,I=/([a-z_$][\w$]*)\s*\+\s*(['"`][^'"`]*['"`])/i,P=w.match(a)||w.match(I);if(P){let _=i.indexOf(P[0]),D=!!w.match(I),j=!!w.match(a);if(D&&!j){if(w.slice(w.indexOf(P[0])+P[0].length).startsWith("."))continue}s.push({filePath:y.filePath,line:n+1,column:_+1,ruleId:"general/prefer-template",message:"Unexpected string concatenation. Use template literals instead",severity:"warning",help:"Use template literals (backticks) instead of string concatenation. Example: `hello ${name}!` instead of 'hello ' + name + '!'"})}}return s}};var us={name:"general",rules:{"array-callback-return":e(at),"constructor-super":e(ut),"for-direction":e(ft),"getter-return":e(mt),"no-async-promise-executor":e(pt),"no-compare-neg-zero":e(dt),"no-cond-assign":e(ht),"no-const-assign":e(gt),"no-constant-condition":e(bt),"no-constructor-return":e(ns),"no-dupe-class-members":e(yt),"no-dupe-keys":e(Qe),"no-duplicate-case":e(xt),"no-empty-pattern":e(Rt),"no-fallthrough":e(wt),"no-irregular-whitespace":e(ss),"no-loss-of-precision":e(kt),"no-new":e(is),"no-regex-spaces":e(rs),"no-promise-executor-return":e(It),"no-redeclare":e(Pt),"no-self-assign":e(et),"no-self-compare":e(Mt),"no-sparse-arrays":e(vt),"no-undef":e($t),"no-unsafe-negation":e(Lt),"no-unreachable":e(Ct),"no-unused-vars":e(Be),"no-useless-catch":e(St),"prefer-const":e(yn),"prefer-object-spread":e(as),"prefer-template":e(xn),"use-isnan":e(Et),"valid-typeof":e(At)}};var fs={markdown:{"heading-increment":!0,"heading-style":!0,"no-missing-space-atx":!0,"no-multiple-space-atx":!0,"no-missing-space-closed-atx":!1,"no-multiple-space-closed-atx":!1,"blanks-around-headings":!0,"heading-start-left":!0,"no-duplicate-heading":!1,"single-title":!0,"no-trailing-punctuation":!0,"ul-style":!0,"list-indent":!1,"ul-indent":!1,"ol-prefix":!0,"list-marker-space":!0,"blanks-around-lists":!0,"no-trailing-spaces":!0,"no-hard-tabs":!0,"no-multiple-blanks":!0,"no-multiple-space-blockquote":!0,"no-blanks-blockquote":!0,"blanks-around-fences":!0,"single-trailing-newline":!0,"blanks-around-tables":!0,"no-reversed-links":!1,"no-bare-urls":!0,"no-space-in-links":!1,"no-empty-links":!1,"link-fragments":!1,"reference-links-images":!1,"link-image-reference-definitions":!0,"link-image-style":!0,"descriptive-link-text":!1,"line-length":!1,"commands-show-output":!1,"fenced-code-language":!1,"code-block-style":!1,"code-fence-style":!0,"no-emphasis-as-heading":!0,"no-space-in-emphasis":!0,"no-space-in-code":!0,"emphasis-style":!0,"strong-style":!0,"no-inline-html":!1,"hr-style":!1,"first-line-heading":!1,"required-headings":!1,"proper-names":!1,"no-alt-text":!1,"table-pipe-style":!1,"table-column-count":!1,"table-column-style":!1},shell:{"command-substitution":!0,"quote-variables":!1,"no-cd-without-check":!1,"no-eval":!1,"no-useless-cat":!1,"no-ls-parsing":!1,"no-variable-in-single-quotes":!1,"no-exit-in-subshell":!1,shebang:!1,indent:!0,"function-style":!0,"operator-spacing":!0,"keyword-spacing":!1,"no-trailing-semicolons":!0,"no-trailing-whitespace":!0,"prefer-double-brackets":!0,"set-options":!1,"prefer-printf":!1,"consistent-case-terminators":!1,"no-broken-redirect":!1,"heredoc-indent":!1},spell:{check:!1,"check-comments":!1,"check-markdown":!1},lockfile:{"validate-host":!1,"validate-https":!1,"validate-integrity":!1,"validate-package-names":!1,"validate-scheme":!1},publint:{"use-type":!1,"local-dependency":!1,"deprecated-field-jsnext":!1,"has-module-but-no-exports":!1,"field-invalid-value-type":!1,"exports-types-should-be-first":!1,"exports-default-should-be-last":!1,"exports-module-should-precede-require":!1,"exports-value-invalid":!1,"exports-missing-root-entrypoint":!1,"exports-fallback-array-use":!1,"imports-key-invalid":!1,"imports-value-invalid":!1,"imports-default-should-be-last":!1,"imports-module-should-precede-require":!1,"file-does-not-exist":!1,"file-invalid-format":!1,"module-should-be-esm":!1,"bin-file-not-executable":!1,"exports-module-should-be-esm":!1}};var ms={meta:{docs:"Prefer using global Buffer instead of requiring it",recommended:!0},check(b,y){let s=[],l=b.split(/\r?\n/),n=/(?:import\b[^;\n]*\bfrom\s*|require\s*\(\s*)['"](?:node:)?buffer['"]/;for(let i=0;i<l.length;i++){let w=l[i],a=w.trim();if(a.startsWith("//")||a.startsWith("/*")||a.startsWith("*"))continue;let I=w.match(n);if(!I||I.index===void 0)continue;if(!/\bBuffer\b/.test(w))continue;s.push({filePath:y.filePath,line:i+1,column:I.index+1,ruleId:"node/prefer-global/buffer",message:"Unexpected import of 'Buffer'. Use the global 'Buffer' instead",severity:"error",help:"`Buffer` is a global in Node.js \u2014 remove the import and use it directly."})}return s}};var ps={meta:{docs:"Prefer using global process instead of requiring it",recommended:!0},check(b,y){let s=[],l=b.split(/\r?\n/),n=/(?:import\b[^;\n]*\bfrom\s*|require\s*\(\s*)['"](?:node:)?process['"]/;for(let i=0;i<l.length;i++){let w=l[i],a=w.trim();if(a.startsWith("//")||a.startsWith("/*")||a.startsWith("*"))continue;let I=w.match(n);if(!I||I.index===void 0)continue;s.push({filePath:y.filePath,line:i+1,column:I.index+1,ruleId:"node/prefer-global/process",message:"Unexpected import of 'process'. Use the global 'process' instead",severity:"error",help:"`process` is a global in Node.js \u2014 remove the import and use it directly."})}return s}};var ds={name:"node",rules:{"prefer-global/buffer":e(ms),"prefer-global/process":e(ps)}};var Rn={meta:{docs:"Enforce sorted imports (delegates to formatter check only)"},check:(b,y)=>{let s=b.split(/\r?\n/),l=0;while(l<s.length&&(/^\s*$/.test(s[l])||/^\s*\/.\/.*/.test(s[l])||/^\s*\/.\*/.test(s[l])))l++;let n=l,i=[];while(l<s.length&&/^\s*import\b/.test(s[l]))i.push(s[l].trim()),l++;if(i.length===0)return[];let w=i.join(`
33
+ `),a=s.slice(l).join(`
34
+ `),I=`${w}
35
+ ${a}`;if(E(I)!==I)return[{filePath:y.filePath,line:n+1,column:1,ruleId:"sort-imports",message:"Imports are not sorted/grouped consistently",severity:"warning"}];return[]},fix:(b)=>E(b)};var hs={name:"perfectionist",rules:{"sort-imports":e(Rn)}};var gs={meta:{docs:"Ensure all imports appear before other statements",recommended:!1},check:(b,y)=>{let s=[],l=b.split(/\r?\n/),n=!1,i=0;for(let w=0;w<l.length;w++){let a=l[w].trim();if(!a||a.startsWith("//")||a.startsWith("/*")||a.startsWith("*"))continue;let I=a.match(/^\s*import\s+/);if(!I&&a.length>0){if(n=!0,i===0)i=w+1}if(n&&I)s.push({filePath:y.filePath,line:w+1,column:1,ruleId:"import/first",message:"Import statement must appear before other statements",severity:"error"})}return s}};var bs={meta:{docs:"Disallow duplicate specifier names in a single import declaration"},check:(b,y)=>{let s=[],l=b.split(/\r?\n/);for(let n=0;n<l.length;n++){let i=l[n];if(!i.includes("import"))continue;let w=i.match(/^\s*import\s*\{([^}]*)\}\s*from\s*['"][^'"]+['"]/);if(!w)continue;let I=w[1].split(",").map((_)=>_.trim()).filter(Boolean).map((_)=>_.split(/\s+as\s+/i)[0].trim()),P=new Set;for(let _ of I){if(P.has(_)){s.push({filePath:y.filePath,line:n+1,column:Math.max(1,i.indexOf(_)+1),ruleId:"pickier/import-dedupe",message:"Expect no duplication in imports",severity:"warning"});break}P.add(_)}}return s}};function ys(b){let y=b.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return new RegExp(`(?<![\\w$])${y}(?![\\w$])`)}function ol(b,y,s){let l=[],n=/^\s*import\s+type\b/.test(b),i=b.replace(/^\s*import\s+/,"").replace(/\s+from\s+['"][^'"]+['"].*$/s,"");if(/^['"]/.test(i))return l;let w=(P,_)=>{let D=P.trim();if(!D||D==="type")return;if(!/^[A-Z_$][\w$]*$/i.test(D))return;for(let j=y;j<s.length;j++){let B=s[j].search(ys(D));if(B!==-1){l.push({name:D,line:j+1,column:B,typeOnly:_});return}if(/\bfrom\b/.test(s[j]))break}l.push({name:D,line:y+1,column:0,typeOnly:_})},a=i.match(/\{([\s\S]*)\}/);if(a)for(let P of a[1].split(",")){let _=P.trim();if(!_)continue;let D=/^type\s+/.test(_),B=_.replace(/^type\s+/,"").split(/\s+as\s+/);w(B[B.length-1],n||D)}let I=a?i.slice(0,i.indexOf("{")):i;for(let P of I.split(",")){let _=P.trim().replace(/^type\s+/,"");if(!_)continue;let D=_.match(/^\*\s+as\s+(\w+)$/);w(D?D[1]:_,n)}return l}var xs={meta:{docs:"Disallow imports that nothing in the file uses"},check:(b,y)=>{let s=[],l=b.split(/\r?\n/),n=[],i=new Set;for(let I=0;I<l.length;I++){if(!/^\s*import(?![\w$])\s*(?![(.])/.test(l[I]))continue;let P=l[I],_=I,D=Math.min(l.length-1,I+40);while(_<D&&!/\bfrom\s*['"][^'"]*['"]/.test(P)&&!/^\s*import\s*['"]/.test(P))_++,P+=`
36
+ ${l[_]}`;if(!/\bfrom\s*['"][^'"]*['"]/.test(P)&&!/^\s*import\s*['"]/.test(P))continue;for(let j=I;j<=_;j++)i.add(j);n.push(...ol(P,I,l)),I=_}if(n.length===0)return s;let w=l.map((I,P)=>i.has(P)?"":I).join(`
37
+ `),a=ls(w);for(let I of n){if(ys(I.name).test(a))continue;s.push({filePath:y.filePath,line:I.line,column:I.column+1,ruleId:"pickier/no-unused-imports",message:I.typeOnly?`'${I.name}' is imported as a type but never used`:`'${I.name}' is imported but never used`,severity:"error"})}return s}};import{readFileSync as ll,statSync as cl}from"fs";import{dirname as al,join as ul,resolve as fl}from"path";var Rs=[".ts",".tsx",".js",".jsx"];function ws(b){return cl(b,{throwIfNoEntry:!1})?.isFile()??!1}function ml(b,y){let s=fl(b,y);for(let l of[...Rs,""])if(ws(s+l))return s+l;for(let l of Rs){let n=ul(s,`index${l}`);if(ws(n))return n}return null}var ks={meta:{docs:"Ensure named imports correspond to a named export in the remote file",recommended:!0},check:(b,y)=>{let s=[],l=b.split(/\r?\n/),n=al(y.filePath);for(let i=0;i<l.length;i++){let a=l[i].match(/\bimport\s+\{([^}]+)\}\s+from\s+['"]([^'"]+)['"]/);if(a){let I=a[1].split(",").map((j)=>j.trim().split(/\s+as\s+/)[0].trim()),P=a[2];if(!P.startsWith(".")&&!P.startsWith("/"))continue;let _=ml(n,P),D="";if(_)try{D=ll(_,"utf8")}catch{}if(D)for(let j of I){let B=new RegExp(`\\bexport\\s+(?:const|let|var|function|class)\\s+${j}\\b`),Z=new RegExp(`\\bexport\\s+\\{[^}]*\\b${j}\\b[^}]*\\}`);if(![B,Z].some((X)=>X.test(D)))s.push({filePath:y.filePath,line:i+1,column:1,ruleId:"import/named",message:`'${j}' not found in '${P}'`,severity:"error"})}}}return s}};import{existsSync as Is,readFileSync as pl}from"fs";import{dirname as Ps,resolve as Ms}from"path";var vs={meta:{docs:"Ensure imports don't create circular dependencies",recommended:!0},check:(b,y)=>{let s=[],l=b.split(/\r?\n/),n=y.filePath,i=new Set,w=new Set;function a(P,_){if(w.has(P))return!0;if(i.has(P))return!1;i.add(P),w.add(P);try{let D=pl(P,"utf8"),j=I(D,Ps(P));for(let B of j)if(a(B,[..._,B]))return!0}catch{}return w.delete(P),!1}function I(P,_){let D=[],j=/\bimport(?:\s{2,}|\s+\S.*?(?:[\n\r\u2028\u2029]\s*|[\t\v\f \xA0\u1680\u2000-\u200A\u202F\u205F\u3000\uFEFF]))from\s+['"]([^'"]+)['"]/g,B;for(B=j.exec(P);B!==null;B=j.exec(P)){let Z=B[1];if(Z.startsWith(".")||Z.startsWith("/")){let z=[".ts",".tsx",".js",".jsx",""];for(let Y of z){let X=Ms(_,Z+Y);if(Is(X)){D.push(X);break}}}}return D}for(let P=0;P<l.length;P++){let D=l[P].match(/\bimport(?:\s{2,}|\s+\S.*?(?:[\n\r\u2028\u2029]\s*|[\t\v\f \xA0\u1680\u2000-\u200A\u202F\u205F\u3000\uFEFF]))from\s+['"]([^'"]+)['"]/);if(D){let j=D[1];if(j.startsWith(".")||j.startsWith("/")){let B=[".ts",".tsx",".js",".jsx",""],Z="";for(let z of B){let Y=Ms(Ps(n),j+z);if(Is(Y)){Z=Y;break}}if(Z){if(i.clear(),w.clear(),w.add(n),a(Z,[n,Z]))s.push({filePath:y.filePath,line:P+1,column:1,ruleId:"import/no-cycle",message:"Dependency cycle detected",severity:"error"})}}}}return s}};var $s={meta:{docs:"Disallow duplicate module imports - all imports from the same module should be combined"},check:(b,y)=>{let s=[],l=b.split(/\r?\n/),n=new Map,i=!1;for(let w=0;w<l.length;w++){let a=l[w];if(i){let B=a.indexOf("*/");if(B>=0)a=a.slice(B+2),i=!1;else continue}let I=a.indexOf("/*"),P=a.indexOf("//");if(I>=0&&(P===-1||I<P)){let B=a.indexOf("*/",I+2);if(B>=0)a=a.slice(0,I)+a.slice(B+2);else i=!0,a=a.slice(0,I)}if(P>=0)a=a.slice(0,P);let _=a.trim();if(!_)continue;let D=_.match(/^import\s+(?:type\s+)?(?:\{[^}]*\}|[\w$]+(?:\s*,\s*\{[^}]*\})?|\*\s+as\s+[\w$]+)\s+from\s+(['"`])(.+?)\1/);if(D){let B=D[2];if(n.has(B)){let Z=n.get(B);s.push({filePath:y.filePath,line:w+1,column:1,ruleId:"no-duplicate-imports",message:`'${B}' imported multiple times (also imported on line${Z.length>1?"s":""} ${Z.join(", ")})`,severity:"error",help:`Combine all imports from '${B}' into a single import statement`}),Z.push(w+1)}else n.set(B,[w+1])}let j=_.match(/^export\s+(?:type\s+)?(?:\{[^}]*\}|\*(?:\s+as\s+[\w$]+)?)\s+from\s+(['"`])(.+?)\1/);if(j){let B=j[2],Z=`export:${B}`;if(n.has(Z)){let z=n.get(Z);s.push({filePath:y.filePath,line:w+1,column:1,ruleId:"no-duplicate-imports",message:`'${B}' re-exported multiple times (also exported on line${z.length>1?"s":""} ${z.join(", ")})`,severity:"error",help:`Combine all re-exports from '${B}' into a single export statement`}),z.push(w+1)}else n.set(Z,[w+1])}}return s}};var Cs={meta:{docs:"Disallow importing from dist directories"},check:(b,y)=>{let s=[],l=new RegExp(`^\\s*import\\s[^;]*?from\\s*['"]([^'"]+)['"]`,"m"),n=b.split(/\r?\n/);for(let i=0;i<n.length;i++){let w=n[i],a=w.match(l);if(!a)continue;let I=a[1];if(I==="dist"||(I.startsWith(".")||I.startsWith("/"))&&/(?:^|\/)dist(?:\/.|$)/.test(I))s.push({filePath:y.filePath,line:i+1,column:Math.max(1,w.indexOf(I)+1),ruleId:"pickier/no-import-dist",message:`Do not import modules in \`dist\` folder, got ${I}`,severity:"error"})}return s}};var Ls={meta:{docs:"Disallow importing from node_modules by explicit path"},check:(b,y)=>{let s=[],l=new RegExp(`^\\s*import\\s[^;]*?from\\s*['"]([^'"]+)['"]`,"m"),n=/require\(\s*['"]([^'"]+)['"]\s*\)/,i=b.split(/\r?\n/);for(let w=0;w<i.length;w++){let a=i[w],I=a.match(l),P=a.match(n),_=I?.[1]||P?.[1];if(!_)continue;if(_.includes("/node_modules/")){let D=Math.max(1,a.indexOf(_)+1);s.push({filePath:y.filePath,line:w+1,column:D,ruleId:"pickier/no-import-node-modules-by-path",message:"Do not import modules in `node_modules` folder by path",severity:"error"})}}return s}};import{existsSync as dl}from"fs";import{dirname as hl,join as gl,resolve as bl}from"path";var Ss={meta:{docs:"Ensure imports point to a file/module that can be resolved",recommended:!0},check:(b,y)=>{let s=[],l=b.split(/\r?\n/),n=hl(y.filePath);for(let i=0;i<l.length;i++){let w=l[i],a=[...w.matchAll(/\bimport(?:\s{2,}|\s+\S.*?(?:[\n\r\u2028\u2029]\s*|[\t\v\f \xA0\u1680\u2000-\u200A\u202F\u205F\u3000\uFEFF]))from\s+['"]([^'"]+)['"]/g),...w.matchAll(/\bimport\s*\(\s*['"]([^'"]+)['"]\s*\)/g),...w.matchAll(/\brequire\s*\(\s*['"]([^'"]+)['"]\s*\)/g)];for(let I of a){let P=I[1];if(!P.startsWith(".")&&!P.startsWith("/"))continue;let _=[],D=[".ts",".tsx",".js",".jsx",".mjs",".cjs",""];for(let B of D){let Z=bl(n,P+B);_.push(Z),_.push(gl(Z,`index${B}`))}if(!_.some((B)=>dl(B)))s.push({filePath:y.filePath,line:i+1,column:1,ruleId:"import/no-unresolved",message:`Unable to resolve path to module '${P}'`,severity:"error"})}}return s}};function Es(b,y,s){let l=s.order==="desc"?-1:1,n=s.type||"alphabetical",i=s.ignoreCase?b.toLowerCase():b,w=s.ignoreCase?y.toLowerCase():y;if(n==="line-length")return(i.length-w.length)*l;if(n==="natural")return i.localeCompare(w,void 0,{numeric:!0,sensitivity:"base"})*l;if(n==="unsorted")return 0;return i.localeCompare(w)*l}var yl=new RegExp(`^export\\s+\\{[^}]*\\}\\s+from\\s+['"][^'"]+['"];?\\s*$`);function wn(b){return yl.test(b)}var As={meta:{docs:"Ensure contiguous export statements are sorted consistently."},check:(b,y)=>{let s=[],l=y.config.pluginRules?.["pickier/sort-exports"]?.[1]||{},n=b.split(/\r?\n/),i=0;while(i<n.length){while(i<n.length&&!wn(n[i]))i++;if(i>=n.length)break;let w=[],a=i;while(a<n.length){let I=n[a];if(wn(I)){w.push({idx:a,line:I}),a++;continue}if(l.partitionByNewLine&&I.trim()==="")break;else break}if(w.length>1){let I=w.map((D)=>D.line),P=[...I].sort((D,j)=>Es(D,j,l));if(!I.every((D,j)=>D===P[j])){let D=I.findIndex((B,Z)=>B!==P[Z]),j=w[D]?.idx??w[0].idx;s.push({filePath:y.filePath,line:j+1,column:1,ruleId:"pickier/sort-exports",message:"Export statements are not sorted.",severity:"warning"})}}i=a+1}return s},fix:(b,y)=>{let s=y.config.pluginRules?.["pickier/sort-exports"]?.[1]||{},n=[...b.split(/\r?\n/)],i=0;while(i<n.length){while(i<n.length&&!wn(n[i]))i++;if(i>=n.length)break;let w=[],a=i;while(a<n.length){let I=n[a];if(wn(I)){w.push(a),a++;continue}if(s.partitionByNewLine&&I.trim()==="")break;else break}if(w.length>1){let I=w.map((D)=>n[D]),P=[...I].sort((D,j)=>Es(D,j,s));if(!I.every((D,j)=>D===P[j]))w.forEach((D,j)=>{n[D]=P[j]})}i=a+1}return n.join(`
38
+ `)}};var Os={meta:{docs:"Enforce sorted TypeScript heritage clauses (extends/implements lists)"},check:(b,y)=>{let s=y.options||{},l=s.type||"alphabetical",n=s.order||"asc",i=s.ignoreCase!==!1,w=Array.isArray(s.groups)?s.groups:[],a=s.customGroups||{},I=b.split(/\r?\n/),P=[],_=(Q)=>n==="asc"?Q:-Q,D=(Q,ee)=>(i?Q.toLowerCase():Q).localeCompare(i?ee.toLowerCase():ee),j=(Q,ee)=>(i?Q.toLowerCase():Q).localeCompare(i?ee.toLowerCase():ee,void 0,{numeric:!0}),B=(Q,ee)=>{if(l==="line-length")return _(Q.length-ee.length);if(l==="natural")return _(j(Q,ee));if(l==="unsorted")return 0;return _(D(Q,ee))},Z=Object.fromEntries(Object.entries(a).map(([Q,ee])=>{let ye=(Array.isArray(ee)?ee:[ee]).map((we)=>new RegExp(we));return[Q,ye]})),z=[];for(let Q of w)if(Array.isArray(Q))z.push(...Q);else z.push(Q);if(!z.includes("unknown"))z.push("unknown");let Y=(Q)=>{for(let[ee,ie]of Object.entries(Z))if(ie.some((ye)=>ye.test(Q)))return ee;return"unknown"},X=(Q)=>{let ee=[],ie=0,ye="";for(let we=0;we<Q.length;we++){let se=Q[we];if(se==="<")ie++;else if(se===">")ie=Math.max(0,ie-1);if(se===","&&ie===0){ee.push(ye.trim()),ye="";continue}ye+=se}if(ye.trim())ee.push(ye.trim());return ee},J=(Q)=>{let ee=Q.trim(),ie=ee.match(/^([A-Z_$][\w$.]*)/i);return ie?ie[1]:ee},ne=(Q,ee)=>{let ie=X(ee);if(ie.length<=1)return;let ye=ie.map(J),we=ye.map(Y),se=ye.map((re,pe)=>({n:re,g:we[pe],i:pe})).sort((re,pe)=>{let le=z.indexOf(re.g),ge=z.indexOf(pe.g);if(le!==ge)return le-ge;return B(re.n,pe.n)}).map((re)=>re.n);if(!ye.every((re,pe)=>re===se[pe]))P.push({filePath:y.filePath,line:Q,column:1,ruleId:"sort-heritage-clauses",message:"Heritage clauses are not sorted",severity:"warning"})};for(let Q=0;Q<I.length;Q++){let ee=I[Q],ie=ee.match(/^\s*interface\s+[A-Za-z_$][^{]*\bextends\s+(.+?)\s*\{/);if(ie)ne(Q+1,ie[1]);let ye=ee.match(/^\s*class\s+[A-Za-z_$][^{]*\bimplements\s+(.+?)\s*\{/);if(ye)ne(Q+1,ye[1])}return P}};var _s={meta:{docs:"Require object keys to be sorted (ESLint-compatible core rule subset)"},check:()=>[]};var Ts={meta:{docs:"Enforce sorted named imports within each import statement"},check:(b,y)=>{let s=y.options||{},l=s.type||"alphabetical",n=s.order||"asc",i=s.ignoreCase!==!1,w=Boolean(s.ignoreAlias),a=b.split(/\r?\n/),I=[],P=(_,D)=>{let j=0;if(l==="line-length")j=_.length-D.length;else{let B=i?_.toLowerCase():_,Z=i?D.toLowerCase():D;j=B.localeCompare(Z)}return n==="asc"?j:-j};for(let _=0;_<a.length;_++){let j=a[_].match(/^\s*import\s+\{([^}]*)\}\s+from\s+['"][^'"]+['"]/);if(!j)continue;let Z=j[1].split(",").map((J)=>J.trim()).filter(Boolean);if(Z.length<=1)continue;let z=Z.map((J)=>{let ne=J.replace(/^type\s+/,""),Q=ne.match(/^([\w$]+)\s+as\s+([\w$]+)$/);if(Q)return w?Q[2]:Q[1];let ee=ne.match(/^([\w$]+)$/);return ee?ee[1]:ne}),Y=[...z].sort(P);if(!z.every((J,ne)=>J===Y[ne]))I.push({filePath:y.filePath,line:_+1,column:1,ruleId:"sort-named-imports",message:"Named imports are not sorted",severity:"warning"})}return I}};var Ws={meta:{docs:"Enforce sorted object keys"},check:(b,y)=>{let s=y.options||{},l=s.type||"alphabetical",n=s.order||"asc",i=s.ignoreCase!==!1,w=Boolean(s.partitionByNewLine),a=b.split(/\r?\n/),I=[],P=(D,j)=>{let B=0;if(l==="line-length")B=D.length-j.length;else{let Z=i?D.toLowerCase():D,z=i?j.toLowerCase():j;B=Z.localeCompare(z)}return n==="asc"?B:-B},_=0;while(_<a.length){let D=a[_],j=D.indexOf("{");if(j!==-1){let B=D.slice(0,j);if(/=\s*$|\(\s*$|\breturn\s*$/.test(B)){let Z=0,z=_,Y=_;for(;Y<a.length;Y++){for(let X of a[Y])if(X==="{")Z++;else if(X==="}")Z--;if(Z===0)break}if(Y>z){let X=a.slice(z+1,Y),J=[],ne={startLine:z+2,props:[]},Q=()=>{if(ne.props.length)J.push(ne);ne={startLine:0,props:[]}};for(let ee=0;ee<X.length;ee++){let ie=X[ee];if(w&&/^\s*$/.test(ie)){Q();continue}if(/^\s*\.\.\./.test(ie))continue;if(/\{|\}/.test(ie))continue;let ye=ie.match(/^\s*['"]?([\w$-]+)['"]?\s*:/);if(ye){if(ne.startLine===0)ne.startLine=z+2+ee;ne.props.push({key:ye[1],line:z+2+ee})}}Q();for(let ee of J){let ie=ee.props.map((se)=>se.key),ye=[...ie].sort(P);if(!(ie.length<=1||ie.every((se,fe)=>se===ye[fe]))&&ee.props.length>0){let se=ee.props[0];I.push({filePath:y.filePath,line:se.line,column:1,ruleId:"sort-objects",message:"Object keys are not sorted",severity:"warning"})}}_=Y+1;continue}}}_++}return I}};var Ns={meta:{docs:"Enforce top-level functions to use function declarations"},check:(b,y)=>{let s=[],l=b.split(/\r?\n/);for(let n=0;n<l.length;n++){let i=l[n];if(/^\s+/.test(i))continue;if(/^\s*(?:\/\/|\/\*)/.test(i))continue;let w=i.match(/^const\s+([A-Za-z_$][\w$]*)\s*=(.*)$/);if(!w)continue;let a=w[2].trim();if(/^\(?[A-Z_$,]*(?:\)\s*)?=>/i.test(a)||/^function\b/.test(a)){let I=i.indexOf("const")+1;s.push({filePath:y.filePath,line:n+1,column:I,ruleId:"pickier/top-level-function",message:"Top-level functions should be declared with function keyword",severity:"warning"});continue}if(a.trim().length===0||/[,({]$/.test(a.trim())){let I=l[n+1]||"";if(/^\s*(?:\(?[A-Za-z_$,]*(?:\)\s*)?=>|function\b)/.test(I)){let P=i.indexOf("const")+1;s.push({filePath:y.filePath,line:n+1,column:P,ruleId:"pickier/top-level-function",message:"Top-level functions should be declared with function keyword",severity:"warning"})}}}return s}};var xl=[[/^(block|inline|inline-block|flex|inline-flex|grid|inline-grid|flow-root|contents|hidden|table|table-caption|table-cell|table-column|table-column-group|table-footer-group|table-header-group|table-row-group|table-row|list-item|subgrid)$/,0],[/^(container|columns|break-after|break-before|break-inside|box-decoration|box-border|box-content|float|clear|isolation|object|overflow|overscroll|position|inset|top|right|bottom|left|start|end|z-|aspect|order)/,1],[/^(static|fixed|absolute|relative|sticky)$/,1],[/^(visible|invisible|collapse)$/,1],[/^(basis|flex-|grow|shrink|order|grid-|col-|row-|auto-cols|auto-rows|gap|justify|items|content|self|place)/,2],[/^(p|px|py|ps|pe|pt|pr|pb|pl|m|mx|my|ms|me|mt|mr|mb|ml|space|indent)-/,3],[/^(-?(p|px|py|ps|pe|pt|pr|pb|pl|m|mx|my|ms|me|mt|mr|mb|ml|space|indent)-)/,3],[/^(w-|h-|min-w|max-w|min-h|max-h|size-)/,4],[/^(font|text|tracking|leading|list|placeholder|vertical|whitespace|break|hyphens|content|truncate|overflow-ellipsis|overflow-clip|line-clamp|underline|overline|line-through|no-underline|uppercase|lowercase|capitalize|normal-case|italic|not-italic|ordinal|slashed-zero|lining-nums|oldstyle-nums|proportional-nums|tabular-nums|diagonal-fractions|stacked-fractions|normal-nums|antialiased|subpixel-antialiased)/,5],[/^(bg-|from-|via-|to-|gradient-)/,6],[/^(border|rounded|outline|ring|divide|accent)/,7],[/^(shadow|opacity|mix-blend|bg-blend)/,8],[/^(blur|brightness|contrast|drop-shadow|grayscale|hue-rotate|invert|saturate|sepia|backdrop)/,9],[/^(border-collapse|border-separate|border-spacing|table-auto|table-fixed|caption)/,10],[/^(transition|duration|ease|delay|animate)/,11],[/^(scale|rotate|translate|skew|origin|transform|perspective)/,12],[/^(appearance|cursor|caret|pointer-events|resize|scroll|snap|touch|select|will-change)/,13],[/^(fill|stroke)/,14],[/^(sr-only|not-sr-only)$/,15]],Rl=/^([a-z0-9][-a-z0-9]{0,50}:)+(?!\[)/;function wl(b){let y=0;while(y<b.length){if(b[y]==="[")break;let s=b.indexOf(":",y);if(s===-1)break;if(b[s+1]==="[")break;y=s+1}return b.slice(y)}function kl(b){let y=wl(b);if(y.startsWith("!"))y=y.slice(1);for(let[s,l]of xl)if(s.test(y))return l;return 99}function Il(b){let y=b.match(Rl);if(!y)return 0;let s=y[0].slice(0,-1).split(":"),l={sm:1,md:2,lg:3,xl:4,"2xl":5},n=10;for(let i of s)if(l[i]!==void 0)n+=l[i];else n+=20;return n}var Ds=new Map;function js(b){let y=Ds.get(b);if(y)return y;let s={group:kl(b),variant:Il(b)};return Ds.set(b,s),s}function Tn(b){return[...b].sort((y,s)=>{let l=js(y),n=js(s),i=l.group,w=n.group;if(i!==w)return i-w;let a=l.variant,I=n.variant;if(a!==I)return a-I;return y.localeCompare(s)})}var Pl=/\b(?:class|className|:class)\s*=\s*(?:"([^"]*?)"|'([^']*?)')/g,Ml=/\b(?:class|className|:class)\s*=\s*\{`([^`]*?)`\}/g,vl=/\b(?:clsx|cn|tw|cva|tv)\s*\(\s*(?:"([^"]*?)"|'([^']*?)')/g;function $l(b){let y=b.replace(/\[[^\]]*\]/g,"");if(/['"`]/.test(y))return!0;if(/[{}()=]/.test(y))return!0;if(/ \? | && | \|\| /.test(y))return!0;if(/\b(?:true|false|null|undefined|function|return|typeof|instanceof)\b/.test(y))return!0;return!1}function Us(b){let y=[];if(!b.includes("class")&&!b.includes("clsx")&&!b.includes("cn(")&&!b.includes("tw(")&&!b.includes("cva(")&&!b.includes("tv("))return y;for(let s of[Pl,Ml,vl]){s.lastIndex=0;let l;while((l=s.exec(b))!==null){let n=l[1]??l[2]??"";if(!n.trim())continue;if($l(n))continue;let i=b.indexOf(n,l.index);if(i===-1)continue;y.push({value:n,start:i,end:i+n.length})}}return y.sort((s,l)=>s.start-l.start),y}function Fs(b){let y=[],s="",l=0;for(let n of b)if(n==="[")l++,s+=n;else if(n==="]")l=Math.max(0,l-1),s+=n;else if(/\s/.test(n)&&l===0){if(s)y.push(s),s=""}else s+=n;if(s)y.push(s);return y}function Bs(b){let y=Tn(b);return b.every((s,l)=>s===y[l])}var qs={meta:{docs:"Enforce consistent Tailwind CSS class ordering (layout \u2192 spacing \u2192 typography \u2192 etc.).",recommended:!0,editsStringContent:!0},check:(b,y)=>{let s=[],l=Us(b);for(let{value:n,start:i}of l){let w=Fs(n);if(w.length<2)continue;if(!Bs(w)){let a=b.slice(0,i),I=(a.match(/\n/g)??[]).length+1,P=a.lastIndexOf(`
39
+ `),_=P===-1?i+1:i-P;s.push({filePath:y.filePath,line:I,column:_,ruleId:"pickier/sort-tailwind-classes",message:`Tailwind classes are not in the recommended order. Expected: "${Tn(w).join(" ")}"`,severity:"warning",help:"Run with --fix to automatically sort Tailwind classes, or reorder them manually."})}}return s},fix:(b)=>{let y=Us(b);if(y.length===0)return b;let s=[...y].reverse(),l=b;for(let{value:n,start:i,end:w}of s){let a=Fs(n);if(a.length<2||Bs(a))continue;let I=Tn(a).join(" ");l=l.slice(0,i)+I+l.slice(w)}return l}};var zs={name:"pickier",rules:{"sort-exports":e(As),"sort-objects":e(Ws),"sort-imports":e(Rn),"sort-named-imports":e(Ts),"sort-heritage-clauses":e(Os),"sort-keys":e(_s),"import-dedupe":e(bs),"no-unused-imports":e(xs),"import-first":e(gs),"import-named":e(ks),"import-no-cycle":e(vs),"import-no-unresolved":e(Ss),"no-import-dist":e(Cs),"no-import-node-modules-by-path":e(Ls),"no-duplicate-imports":e($s),"top-level-function":e(Ns),"sort-tailwind-classes":k(qs),"prefer-const":e(yn),"prefer-template":e(xn),"no-unused-vars":e(Be)}};var Zs={name:"quality",rules:{"default-case":e(_t),eqeqeq:e(Tt),"no-alert":e(Dt),"no-await-in-loop":e(jt),"no-caller":e(Ut),"no-case-declarations":e(Ft),"no-else-return":e(Bt),"no-empty":e(qt),"no-empty-function":e(zt),"no-eval":e(Zt),"no-extend-native":e(Gt),"no-global-assign":e(Kt),"no-implied-eval":e(Ht),"no-iterator":e(Yt),"no-new":e(Xt),"no-new-func":e(Jt),"no-new-wrappers":e(Qt),"no-octal":e(en),"no-param-reassign":e(tn),"no-proto":e(nn),"no-return-assign":e(sn),"no-shadow":e(on),"no-throw-literal":e(ln),"no-use-before-define":e(cn),"no-useless-call":e(an),"no-with":e(dn),"require-await":e(gn),complexity:e(Ot),"max-depth":e(Wt),"max-lines-per-function":e(Nt),"no-extra-boolean-cast":e(Vt),"no-lonely-if":e(tt),"no-sequences":e(rn),"no-useless-concat":e(un),"no-useless-escape":e(fn),"no-useless-rename":e(mn),"no-useless-return":e(nt),"no-var":e(pn),"prefer-arrow-callback":e(hn)}};var Gs={meta:{docs:"Detects potentially super-linear backtracking patterns in regex literals (heuristic)"},check:(b,y)=>{let s=[],l=(n,i,w)=>{let a=b.slice(0,n),I=(a.match(/\n/g)||[]).length+1,P=n-a.lastIndexOf(`
40
+ `);s.push({filePath:y.filePath,line:I,column:P,ruleId:"no-super-linear-backtracking",message:w,severity:"error"})};for(let n of g(b).regions){if(n.kind!=="regex")continue;let i=n.start-1,w=b.slice(i,n.end+1),a=w.slice(1,w.lastIndexOf("/")),I=a.replace(/\[.*?\]/g,"");if(I.includes(".+?\\s*")||I.includes("\\s*.+?")||I.includes(".*\\s*")||I.includes("\\s*.*")){l(i,w.length,"The combination of ' .*' or ' .+?' with '\\s*' can cause super-linear backtracking due to exchangeable characters");continue}let _=I.replace(/\s+/g,"");if(/(?:\.\*\??){2,}/.test(_)||/(?:\.\+\??){2,}/.test(_)||/\.\*\??\.\+\?|\.\+\??\.\*\?/.test(_)){l(i,w.length,"Multiple adjacent unlimited wildcard quantifiers can cause super-linear backtracking");continue}let D=a.replace(/\\./g,"_").replace(/\[[^\]]*\]/g,"_");if(/\((?:\?:)?[^)]*?[+*][^)]*\)\s*[+*]/.test(D)){l(i,w.length,"Nested unlimited quantifiers detected (e.g., (.+)+) which can cause catastrophic backtracking");continue}}return s}};function Cl(b,y){let s=y-1;while(s>=0&&(b[s]===" "||b[s]==="\t"))s--;let l=s>=0?b[s]:"",n="=(<>!&|?:;,{[+(~^%*/";if(!(s<0||n.includes(l)||/\b(?:return|typeof|void|delete|throw|new|in|of|case)\s*$/.test(b.slice(Math.max(0,s-5),s+1))))return null;let w=y+1,a=!1,I=!1,P=-1;while(w<b.length){let z=b[w];if(I)I=!1;else if(z==="\\")I=!0;else if(z==="["){if(!a)a=!0}else if(z==="]"){if(a)a=!1}else if(z==="/"&&!a){P=w;break}else if(z===`
41
+ `)break;w++}if(P<=y)return null;let _=b.slice(y+1,P),D=P+1;while(D<b.length&&/[gimsuvy]/.test(b[D]))D++;if(/\\[1-9]/.test(_))return null;let j=0,B=-1,Z=!1;for(let z=0;z<_.length;z++){if(_[z]==="\\"){z++;continue}if(_[z]==="["&&!Z){Z=!0;continue}if(_[z]==="]"&&Z){Z=!1;continue}if(Z)continue;if(_[z]==="("&&_.slice(z+1,z+3)!=="?:"&&_.slice(z+1,z+3)!=="?="&&_.slice(z+1,z+3)!=="?!"&&_.slice(z+1,z+4)!=="?<="&&_.slice(z+1,z+4)!=="?<!"){if(B<0)B=z;j++}}if(j===0)return null;return{patternStart:y,patternEnd:D,pattern:_,capCount:j,firstCapOffset:B}}function Ll(b,y,s){let l=s;while(l<b.length&&(b[l]===" "||b[l]==="\t"))l++;if(b[l]==="."){let I=b.slice(l+1,l+20);if(/^test\s*\(/.test(I))return!1;if(/^exec\s*\(/.test(I))return!0}let n=y-1;while(n>=0&&(b[n]===" "||b[n]==="\t"))n--;if(b[n]==="("){let P=n-1;while(P>=0&&(b[P]===" "||b[P]==="\t"))P--;let _=b.slice(Math.max(0,P-20),P+1);if(/\.match\s*$/.test(_))return!0;if(/\.matchAll\s*$/.test(_))return!0;if(/\.exec\s*$/.test(_))return!0;if(/\.replace\s*$/.test(_))return!0;if(/\.replaceAll\s*$/.test(_))return!0;if(/\.split\s*$/.test(_))return!0;if(/\.search\s*$/.test(_))return!1;if(/\.test\s*$/.test(_))return!1}let i=b.lastIndexOf(`
42
+ `,y)+1,a=b.slice(i,y).trim().match(/(?:const|let|var)\s+(\w+)\s*=\s*$/);if(a){let I=a[1],P=b.slice(s),_=new RegExp(`\\b${I}\\.exec\\s*\\(`),D=new RegExp(`\\b${I}\\.test\\s*\\(`),j=new RegExp(`\\.match(?:All)?\\s*\\(\\s*${I}\\s*\\)`),B=new RegExp(`\\.replace(?:All)?\\s*\\(\\s*${I}`),Z=_.test(P),z=j.test(P),Y=B.test(P),X=D.test(P);if(Z||z||Y)return!0;if(X)return!1;return!0}return!0}function Sl(b,y){let s=y-1;while(s>=0&&(b[s]===" "||b[s]==="\t"))s--;let l=s>=0?b[s]:"",n="=(<>!&|?:;,{[+(~^%*/";if(!(s<0||n.includes(l)||/\b(?:return|typeof|void|delete|throw|new|in|of|case)\s*$/.test(b.slice(Math.max(0,s-5),s+1))))return y+1;let w=y+1,a=!1,I=!1;while(w<b.length){let P=b[w];if(I)I=!1;else if(P==="\\")I=!0;else if(P==="["){if(!a)a=!0}else if(P==="]"){if(a)a=!1}else if(P==="/"&&!a){w++;while(w<b.length&&/[gimsuvy]/.test(b[w]))w++;return w}else if(P===`
43
+ `)break;w++}return y+1}function El(b,y){let s=[],l=y.filePath,n=0;while(n<b.length){let i=b[n];if(i==="/"&&b[n+1]==="/"){while(n<b.length&&b[n]!==`
44
+ `)n++;continue}if(i==="/"&&b[n+1]==="*"){n+=2;while(n<b.length-1&&!(b[n]==="*"&&b[n+1]==="/"))n++;n+=2;continue}if(i==="'"||i==='"'||i==="`"){let w=i;n++;while(n<b.length){if(b[n]==="\\"){n+=2;continue}if(b[n]===w){n++;break}n++}continue}if(i==="/"){let w=Cl(b,n);if(!w){let a=Sl(b,n);if(a>n+1)n=a;else n++;continue}if(!Ll(b,w.patternStart,w.patternEnd)){let a=w.patternStart+1+(w.firstCapOffset>=0?w.firstCapOffset:0),I=b.slice(0,a),P=(I.match(/\r?\n/g)||[]).length+1,_=a-(I.lastIndexOf(`
45
+ `)+1)+1;s.push({filePath:l,line:P,column:_,ruleId:"regexp/no-unused-capturing-group",message:"Unused capturing group in regular expression; use non-capturing group (?:...) instead",severity:"error"})}n=w.patternEnd;continue}n++}return s}var Vs={meta:{docs:"Flags regex literals with unused capturing groups (context-aware)",recommended:!1},check(b,y){return El(b,y)}};var Ks={meta:{docs:"Disallow lazy quantifiers that don't affect the matching behavior",recommended:!0},check(b,y){let s=[],l=b.split(/\r?\n/);for(let n=0;n<l.length;n++){let i=l[n];if(i.trim().startsWith("//")||i.trim().startsWith("/*")||i.trim().startsWith("*"))continue;let w=/\/(?![/*])([^/\n\r\\]|\\.)+\/[gimsuvy]*/g,a;for(a=w.exec(i);a!==null;a=w.exec(i)){let I=a[0],P=I.slice(1,I.lastIndexOf("/"));if(/[+*?]\?\$$/.test(P))s.push({filePath:y.filePath,line:n+1,column:a.index+P.search(/[+*?]\?\$$/)+2,ruleId:"regexp/no-useless-lazy",message:"Lazy quantifier is useless before end-of-string anchor",severity:"error"});if(/[+*?]\?$/.test(P))s.push({filePath:y.filePath,line:n+1,column:a.index+P.length-1,ruleId:"regexp/no-useless-lazy",message:"Lazy quantifier is useless at the end of the pattern",severity:"error"})}}return s}};var Hs={name:"regexp",rules:{"no-super-linear-backtracking":e(Gs),"no-unused-capturing-group":e(Vs),"no-useless-lazy":e(Ks)}};function Ys(b,y){let s=b.slice(0,y);if(s.includes("//"))return!0;let l=(s.match(/'/g)||[]).length,n=(s.match(/"/g)||[]).length,i=(s.match(/`/g)||[]).length;return l%2===1||n%2===1||i%2===1}var Xs={meta:{docs:"Disallow spaces inside array brackets",recommended:!0},check(b,y){let s=[],l=b.split(/\r?\n/);for(let n=0;n<l.length;n++){let i=l[n],w=i.trim();if(!w||w.startsWith("//")||w.startsWith("*")||w.startsWith("/*"))continue;for(let a=0;a<i.length;a++){if(i[a]==="["&&!Ys(i,a)){let I=i[a+1];if(I==="]"||I===void 0||I===`
46
+ `)continue;if(I===" "||I==="\t"){if(i.indexOf("]",a+1)!==-1)s.push({filePath:y.filePath,line:n+1,column:a+2,ruleId:"style/array-bracket-spacing",message:"Unexpected space after '['",severity:"warning"})}}if(i[a]==="]"&&!Ys(i,a)){let I=a>0?i[a-1]:void 0;if(I==="["||I===void 0)continue;if(I===" "||I==="\t"){if(i.lastIndexOf("[",a-1)!==-1)s.push({filePath:y.filePath,line:n+1,column:a,ruleId:"style/array-bracket-spacing",message:"Unexpected space before ']'",severity:"warning"})}}}}return s},fix(b){let y=b.split(/\r?\n/),s=[];for(let l of y){let n=l;n=n.replace(/\[\s+(\S)/g,(i,w)=>{if(w==="]")return i;return`[${w}`}),n=n.replace(/(\S)\s+\]/g,"$1]"),s.push(n)}return s.join(`
47
+ `)}};var Js=/(?<![(\[{,=:?&|+\-*/])\b([a-zA-Z_$][a-zA-Z0-9_$]*)\s*=>/g;function Al(b,y){let s=b.slice(0,y);if(s.includes("//"))return!0;let l=(s.match(/'/g)||[]).length,n=(s.match(/"/g)||[]).length,i=(s.match(/`/g)||[]).length;return l%2===1||n%2===1||i%2===1}var Qs={meta:{docs:"Require parentheses around arrow function parameters",recommended:!0},check(b,y){let s=[],l=b.split(/\r?\n/);for(let n=0;n<l.length;n++){let i=l[n],w=i.trim();if(!w||w.startsWith("//")||w.startsWith("*")||w.startsWith("/*"))continue;let a;Js.lastIndex=0;while((a=Js.exec(i))!==null){let I=a.index;if(Al(i,I))continue;let P=a[1];if(i.slice(0,I).trimEnd().endsWith("("))continue;if(P==="async")continue;s.push({filePath:y.filePath,line:n+1,column:I+1,ruleId:"style/arrow-parens",message:`Arrow function parameter '${P}' should be wrapped in parentheses`,severity:"warning"})}}return s},fix(b){return b.replace(/(?<![(\[{,=:?&|+\-*/])\b([a-zA-Z_$][a-zA-Z0-9_$]*)\s*=>/g,(y,s)=>{if(s==="async")return y;return y.replace(s,`(${s})`)})}};var kn=/=>/g;function ei(b,y){let s=b.slice(0,y);if(s.includes("//"))return!0;let l=(s.match(/'/g)||[]).length,n=(s.match(/"/g)||[]).length,i=(s.match(/`/g)||[]).length;return l%2===1||n%2===1||i%2===1}var ti={meta:{docs:"Require space before and after => in arrow functions",recommended:!0},check(b,y){let s=[],l=b.split(/\r?\n/);for(let n=0;n<l.length;n++){let i=l[n],w=i.trim();if(!w||w.startsWith("//")||w.startsWith("*")||w.startsWith("/*"))continue;let a;kn.lastIndex=0;while((a=kn.exec(i))!==null){let I=a.index;if(ei(i,I))continue;if(I>0&&i[I-1]!==" "&&i[I-1]!=="\t")s.push({filePath:y.filePath,line:n+1,column:I+1,ruleId:"style/arrow-spacing",message:"Missing space before =>",severity:"warning"});let P=I+2;if(P<i.length&&i[P]!==" "&&i[P]!=="\t"&&i[P]!==`
48
+ `)s.push({filePath:y.filePath,line:n+1,column:P+1,ruleId:"style/arrow-spacing",message:"Missing space after =>",severity:"warning"})}}return s},fix(b){let y=b.split(`
49
+ `);for(let s=0;s<y.length;s++){let l=y[s],n=l.trim();if(!n||n.startsWith("//")||n.startsWith("*")||n.startsWith("/*"))continue;let i="",w=0;kn.lastIndex=0;let a;while((a=kn.exec(l))!==null){let I=a.index;if(ei(l,I))continue;let P=l[I-1],_=l[I+2],D=I>0&&P!==" "&&P!=="\t",j=_!==void 0&&_!==" "&&_!=="\t";if(!D&&!j)continue;i+=l.slice(w,I),i+=`${D?" ":""}=>${j?" ":""}`,w=I+2}if(w>0)y[s]=i+l.slice(w)}return y.join(`
50
+ `)}};function Wn(b,y){let s=b.slice(0,y);if(s.includes("//"))return!0;let l=(s.match(/'/g)||[]).length,n=(s.match(/"/g)||[]).length,i=(s.match(/`/g)||[]).length;return l%2===1||n%2===1||i%2===1}var ni={meta:{docs:"Require spaces inside single-line blocks",recommended:!0},check(b,y){let s=[],l=b.split(/\r?\n/);for(let n=0;n<l.length;n++){let i=l[n],w=i.trim();if(!w||w.startsWith("//")||w.startsWith("*")||w.startsWith("/*"))continue;for(let a=0;a<i.length;a++){if(i[a]!=="{")continue;if(Wn(i,a))continue;if(a>0&&i[a-1]==="$")continue;let I=1,P=-1;for(let D=a+1;D<i.length;D++){if(i[D]==="{"&&!Wn(i,D))I++;if(i[D]==="}"&&!Wn(i,D)){if(I--,I===0){P=D;break}}}if(P===-1)continue;let _=i.slice(a+1,P);if(!_.trim())continue;if(_[0]!==" "&&_[0]!=="\t")s.push({filePath:y.filePath,line:n+1,column:a+2,ruleId:"style/block-spacing",message:"Missing space after '{'",severity:"warning"});if(_[_.length-1]!==" "&&_[_.length-1]!=="\t")s.push({filePath:y.filePath,line:n+1,column:P+1,ruleId:"style/block-spacing",message:"Missing space before '}'",severity:"warning"});break}}return s},fix(b){let y=b.split(/\r?\n/),s=[];for(let l of y){let n=l.replace(/(?<!\$)\{(\S)([^}]*?)(\S)\}/g,(i,w,a,I)=>`{ ${w}${a}${I} }`);n=n.replace(/(?<!\$)\{(\S)([^}]*?)\s\}/g,(i,w,a)=>`{ ${w}${a} }`),n=n.replace(/(?<!\$)\{\s([^}]*?)(\S)\}/g,(i,w,a)=>`{ ${w}${a} }`),s.push(n)}return s.join(`
51
+ `)}};var si={meta:{docs:"Enforce consistent brace style for blocks",recommended:!0},check(b,y){let s=[],l=b.split(/\r?\n/);for(let n=0;n<l.length;n++){let w=l[n].trim();if(w.startsWith("//")||w.startsWith("/*"))continue;if(/\}\s+(?:else|catch|finally)\b/.test(w))s.push({filePath:y.filePath,line:n+1,column:w.indexOf("}")+1,ruleId:"style/brace-style",message:"Closing curly brace appears on the same line as the subsequent block",severity:"error"});if(w==="{"&&n>0){let I=l[n-1].trim();if(!I||I.startsWith("//")||I.startsWith("/*")||I.endsWith("*/"))continue;if(I&&!I.endsWith("{")&&!I.endsWith(",")&&!I.endsWith("(")){if(!I.match(/[=:]\s*$/)&&!I.endsWith("["))s.push({filePath:y.filePath,line:n+1,column:1,ruleId:"style/brace-style",message:"Opening curly brace should be on the same line",severity:"error"})}}}return s}};var ii=/,\s*$/,ri=new RegExp("^\\s*[}\\])](?:\\s*;?\\s*)?$"),oi={meta:{docs:"Require trailing commas in multiline constructs",recommended:!0},check(b,y){let s=[],l=b.split(/\r?\n/);for(let n=1;n<l.length;n++){let w=l[n].trim();if(!ri.test(w))continue;let a=l[n-1],I=a.trim();if(!I||I==="{"||I==="["||I==="(")continue;if(I.startsWith("//")||I.startsWith("*")||I.startsWith("/*"))continue;if(ii.test(I))continue;if(I.endsWith("{")||I.endsWith("[")||I.endsWith("("))continue;if(I.endsWith("=>"))continue;s.push({filePath:y.filePath,line:n,column:a.length+1,ruleId:"style/comma-dangle",message:"Missing trailing comma",severity:"warning",help:"Add a trailing comma after the last element in multiline constructs."})}return s},fix(b){let y=b.split(/\r?\n/),s=[];for(let l=0;l<y.length;l++){let n=y[l];if(l+1<y.length){let i=y[l+1].trim(),w=n.trim();if(ri.test(i)&&w&&w!=="{"&&w!=="["&&w!=="("&&!w.startsWith("//")&&!w.startsWith("*")&&!w.startsWith("/*")&&!ii.test(w)&&!w.endsWith("{")&&!w.endsWith("[")&&!w.endsWith("(")&&!w.endsWith("=>")){s.push(n.replace(/(\s*)$/,",$1"));continue}}s.push(n)}return s.join(`
52
+ `)}};function Ol(b,y){let s=b.slice(0,y);if(s.includes("//"))return!0;let l=(s.match(/'/g)||[]).length,n=(s.match(/"/g)||[]).length,i=(s.match(/`/g)||[]).length;return l%2===1||n%2===1||i%2===1}var li={meta:{docs:"Require space after commas, disallow space before commas",recommended:!0},check(b,y){let s=[],l=b.split(/\r?\n/);for(let n=0;n<l.length;n++){let i=l[n],w=i.trim();if(!w||w.startsWith("//")||w.startsWith("*")||w.startsWith("/*"))continue;for(let a=0;a<i.length;a++){if(i[a]!==",")continue;if(Ol(i,a))continue;if(a>0&&i[a-1]===" "){if(i.slice(0,a).trim().length>0)s.push({filePath:y.filePath,line:n+1,column:a+1,ruleId:"style/comma-spacing",message:"Unexpected space before comma",severity:"warning"})}if(a+1<i.length&&i[a+1]!==" "&&i[a+1]!=="\t"&&i[a+1]!==`
53
+ `&&i[a+1]!=="\r")s.push({filePath:y.filePath,line:n+1,column:a+2,ruleId:"style/comma-spacing",message:"Missing space after comma",severity:"warning"})}}return s},fix(b){let y=b.split(/\r?\n/),s=[];for(let l of y){let n=l;n=n.replace(/ ,/g,","),n=n.replace(/,(\S)/g,", $1"),s.push(n)}return s.join(`
54
+ `)}};var ci={meta:{docs:"Enforce comma-last style (commas at the end of lines, not the beginning)",recommended:!0},check(b,y){let s=[],l=b.split(/\r?\n/);for(let n=0;n<l.length;n++){let i=l[n],w=i.trim();if(!w||w.startsWith("//")||w.startsWith("*")||w.startsWith("/*"))continue;if(w.startsWith(","))s.push({filePath:y.filePath,line:n+1,column:i.indexOf(",")+1,ruleId:"style/comma-style",message:"Comma should be placed at the end of the previous line",severity:"warning"})}return s},fix(b){let y=b.split(/\r?\n/),s=[];for(let l=0;l<y.length;l++){let n=y[l],i=n.trim();if(i.startsWith(",")&&s.length>0){let w=s.length-1;s[w]=s[w].replace(/\s*$/,",");let a=n.match(/^(\s*)/)?.[1]||"";s.push(a+i.slice(1).trim())}else s.push(n)}return s.join(`
55
+ `)}};function _l(b,y){let s=b.slice(0,y);if(s.includes("//"))return!0;let l=(s.match(/'/g)||[]).length,n=(s.match(/"/g)||[]).length,i=(s.match(/`/g)||[]).length;return l%2===1||n%2===1||i%2===1}var ai={meta:{docs:"Disallow spaces inside computed property brackets [expr]",recommended:!0},check(b,y){let s=[],l=b.split(/\r?\n/);for(let n=0;n<l.length;n++){let i=l[n],w=i.trim();if(!w||w.startsWith("//")||w.startsWith("*")||w.startsWith("/*"))continue;for(let a=0;a<i.length;a++){if(i[a]!=="[")continue;if(_l(i,a))continue;if(a===0)continue;let I=i[a-1];if(!/[a-zA-Z0-9_$)\]]/.test(I))continue;if(a+1<i.length&&(i[a+1]===" "||i[a+1]==="\t"))s.push({filePath:y.filePath,line:n+1,column:a+2,ruleId:"style/computed-property-spacing",message:"Unexpected space after '['",severity:"warning"});let P=1,_=a+1;while(_<i.length&&P>0){if(i[_]==="[")P++;if(i[_]==="]")P--;if(P>0)_++}if(P===0&&_>0){if(i[_-1]===" "||i[_-1]==="\t")s.push({filePath:y.filePath,line:n+1,column:_,ruleId:"style/computed-property-spacing",message:"Unexpected space before ']'",severity:"warning"})}}}return s},fix(b){return b.replace(/([a-zA-Z0-9_$)\]])\[\s+([\s\S]*?)\s+\]/g,"$1[$2]")}};function Tl(b){let y=[],s=b.split(/\r?\n/),l=0;for(let n=0;n<s.length;n++){let i=s[n],w=/\b[\w$)\]]+\s*\./.test(i),a=n+1<s.length&&/^\s*\./.test(s[n+1]);if(w||a){let I=n,P=n;while(I+1<s.length&&/^\s*\./.test(s[I+1]))I++,P=I;if(P>n){let _=l,D=l+s[n].length+1+s.slice(n+1,P+1).join(`
56
+ `).length;y.push({start:_,end:D}),n=P}}l+=i.length+1}return y}var ui={meta:{docs:"Enforce consistent line breaks in member-access/call chains"},check:(b,y)=>{let s=[],l=b.split(/\r?\n/),n=Tl(b);for(let{start:i,end:w}of n){let I=b.slice(i,w).split(/\r?\n/),P=[];for(let B=0;B<I.length;B++){let Z=I[B],z=[...Z.matchAll(/\./g)].map((Y)=>Y.index||0);for(let Y of z){if(Y>0&&Z[Y-1]==="?")continue;if(/^\s*\./.test(Z)&&Y===Z.indexOf(".")&&Z.slice(0,Y).trim()==="")P.push("newline");else P.push("inline")}}if(P.length<=1)continue;let _=P[0];if(P.every((B)=>B===_))continue;let D=P.findIndex((B)=>B!==_),j=0;for(let B=0;B<I.length;B++){let Z=I[B],z=[...Z.matchAll(/\./g)].map((Y)=>Y.index||0);for(let Y of z){if(Y>0&&Z[Y-1]==="?")continue;if(j===D){let J=b.slice(0,i).split(/\r?\n/),ne=J.length,Q=(J[J.length-1]||"").length;s.push({filePath:y.filePath,line:ne+B,column:(B===0?Q:0)+Y+1,ruleId:"style/consistent-chaining",message:`Inconsistent chaining style: mix of ${_} and ${_==="inline"?"newline":"inline"}.`,severity:"warning"}),B=I.length;break}j++}}}return s}};function fi(b){let y=[0];for(let l=0;l<b.length;l++)if(b[l]===`
57
+ `)y.push(l+1);function s(l){let n=0,i=y.length-1;while(n<=i){let a=n+i>>1,I=y[a],P=a+1<y.length?y[a+1]:1/0;if(l<I)i=a-1;else if(l>=P)n=a+1;else return{line:a+1,column:l-I+1}}let w=y[y.length-1];return{line:y.length,column:Math.max(1,l-w+1)}}return{lineStarts:y,indexToLoc:s}}function mi(b){let y=[],s=(i,w,a)=>y.push({type:i,value:b.slice(w,a),start:w,end:a}),l=0,n=b.length;while(l<n){let i=b[l];if(i<=" "){l++;continue}if(i==="/"&&b[l+1]==="/"){let I=l;l+=2;while(l<n&&b[l]!==`
58
+ `)l++;s("LineComment",I,l);continue}if(i==="/"&&b[l+1]==="*"){let I=l;l+=2;while(l<n&&!(b[l]==="*"&&b[l+1]==="/"))l++;l=Math.min(n,l+2),s("BlockComment",I,l);continue}if(i==='"'||i==="'"){let I=i,P=l;l++;while(l<n){let _=b[l];if(_==="\\"){l+=2;continue}if(_===I){l++;break}l++}s("String",P,l);continue}if(i==="`"){let I=l;l++;let P=0;while(l<n){let _=b[l];if(_==="\\"){l+=2;continue}if(_==="`"&&P===0){l++;break}if(_==="$"&&b[l+1]==="{"){P++,l+=2;continue}if(_==="}"&&P>0){P--,l++;continue}l++}s("Template",I,l);continue}if(i==="/"){if(b[l+1]==="/"){let I=l;l+=2;while(l<n&&b[l]!==`
59
+ `)l++;s("LineComment",I,l);continue}if(b[l+1]==="*"){let I=l;l+=2;while(l<n&&!(b[l]==="*"&&b[l+1]==="/"))l++;l=Math.min(n,l+2),s("BlockComment",I,l);continue}if(Wl(y)){let I=l;l++;while(l<n){let P=b[l];if(P==="\\"){l+=2;continue}if(P==="/"){l++;break}l++}while(l<n&&/[a-z]/i.test(b[l]))l++;s("Regex",I,l);continue}s("Punct",l,l+1),l++;continue}if("(){}[];:,.<>+-*%&|^!?=~".includes(i)){s("Punct",l,l+1),l++;continue}let w=l,a=new RegExp("[^\\s(){}[\\];:,.<>+\\-*%&|^!?=~'\"`/]");while(l<n&&a.test(b[l]))l++;if(l>w)s("Word",w,l);else s("Word",l,l+1),l++}return y}function Wl(b){if(b.length===0)return!0;let y=b[b.length-1],s=new RegExp("[(!,{;:?=]");return y.type==="Punct"&&s.test(y.value)||y.type==="Word"&&/^(?:return|throw|case|of|in|instanceof|typeof|void|new)$/.test(y.value)}function pi(b,y,s,l){let n=0,i=(D)=>D<=" ",w=(D)=>{while(D<b.length&&b[D]!==`
60
+ `)D++;return D},a=(D)=>{D+=2;while(D<b.length&&!(b[D]==="*"&&b[D+1]==="/"))D++;return Math.min(b.length,D+2)},I=(D,j)=>{let B=b.length;if(j==="`"){D++;let Z=0;while(D<B){let z=b[D];if(z==="\\"){D+=2;continue}if(z==="`"&&Z===0){D++;break}if(z==="$"&&b[D+1]==="{"){Z++,D+=2;continue}if(z==="}"&&Z>0){Z--,D++;continue}if(z==='"'||z==="'"){D=I(D,z);continue}if(z==="/"&&b[D+1]==="/"){D=w(D+2);continue}if(z==="/"&&b[D+1]==="*"){D=a(D);continue}D++}return D}D++;while(D<B){let Z=b[D];if(Z==="\\"){D+=2;continue}if(Z===j){D++;break}D++}return D},P=(D)=>{let j=D-1;while(j>=0&&i(b[j]))j--;let B=j>=0?b[j]:"";if(new RegExp("[(:[{;?,=!&|^~+\\-*%<>]").test(B))return!0;if(B==="")return!0;return!1},_=(D)=>{D++;let j=b.length;while(D<j){let B=b[D];if(B==="\\"){D+=2;continue}if(B==="/"){D++;break}D++}while(D<j&&/[a-z]/i.test(b[D]))D++;return D};for(let D=y;D<b.length;D++){let j=b[D];if(j===s){n++;continue}if(j===l){if(n--,n===0)return D;continue}if(j==='"'||j==="'"||j==="`"){D=I(D,j)-1;continue}if(j==="/"&&b[D+1]==="/"){D=w(D+2)-1;continue}if(j==="/"&&b[D+1]==="*"){D=a(D)-1;continue}if(j==="/"&&P(D)){D=_(D)-1;continue}}return-1}var Nl=new Set(["const","let","var","return","if","for","while","do","switch","throw","try","break","continue","function","class","debugger"]);function Dl(b){let y=0;for(let n of b){if(n.type!=="Punct")continue;if(n.value==="("||n.value==="["||n.value==="{")y++;else if((n.value===")"||n.value==="]"||n.value==="}")&&y>0)y--;else if(n.value===";"&&y===0)return!0}let[s,l]=b;return s?.type==="Word"&&Nl.has(s.value)&&!(l?.type==="Punct"&&[":",",","(","}","?"].includes(l.value))}function jl(b,y,s,l,n,i,w,a){let I=pi(b,l,n,i);if(I<=l)return;let P=mi(b.slice(l+1,I));if(n==="{"&&Dl(P))return;let _=[],D=0,j=0,B=l+1,Z;for(let X of P){if(X.type==="Punct"){let J=X.value,ne=Z!==void 0&&Z.end===X.start;if(J==="("||J==="["||J==="{")D++;else if((J===")"||J==="]"||J==="}")&&D>0)D--;else if(J==="<"&&ne&&Z.type==="Word")j++;else if(J===">"&&j>0&&!(ne&&Z.value==="="))j--;else if(J===","&&D===0&&j===0)_.push({start:B,end:l+1+X.start}),B=l+1+X.end}Z=X}_.push({start:B,end:I});let z=_.map((X)=>({p:X,gap:Ul(b,X.start,X.end)})).filter((X)=>X.gap.at<X.p.end);if(z.length<2)return;let Y=z[0].gap.newline;for(let X=1;X<z.length;X++)if(z[X].gap.newline!==Y){let J=a().indexToLoc(z[X].gap.at);s.push({filePath:y,line:J.line,column:J.column,ruleId:w,message:Y?"Should have line breaks between items":"Should not have line breaks between items",severity:"warning"});return}}function Ul(b,y,s){let l=y,n=!1;while(l<s){let i=b[l];if(i===`
61
+ `)n=!0,l++;else if(i===" "||i==="\t"||i==="\r")l++;else if(i==="/"&&b[l+1]==="/")while(l<s&&b[l]!==`
62
+ `)l++;else if(i==="/"&&b[l+1]==="*"){let w=b.indexOf("*/",l+2);l=w===-1||w+2>s?s:w+2}else break}return{at:l,newline:n}}var di={meta:{docs:"Enforce consistent newlines for list-like constructs (objects, arrays, named imports/exports)"},check:(b,y)=>{let s=c(b),l=[],n="style/consistent-list-newline",i,w=()=>i??=fi(s),a=new Set,I=(P,_,D)=>{if(a.has(P))return;a.add(P),jl(s,y.filePath,l,P,_,D,"style/consistent-list-newline",w)};for(let P=0;P<s.length;P++){let _=s[P];if(_==="{"){let D=P-1;while(D>=0&&/[ \t]/.test(s[D]))D--;if(D>=0&&s[D]===")")continue;if(D>=1&&s[D]===">"&&s[D-1]==="=")continue;let j=s.slice(Math.max(0,P-60),P);if(/\b(?:function|class|interface|type|enum|try|catch|finally|if|else|for|while|switch)\b[\s\S]*$/.test(j))continue;I(P,"{","}")}else if(_==="[")I(P,"[","]");else if(_==="i"&&s.startsWith("import",P)){let D=s.indexOf("{",P);if(D>-1)I(D,"{","}")}else if(_==="e"&&s.startsWith("export",P)){let D=s.indexOf("{",P);if(D>-1)I(D,"{","}")}}return l}};function Fl(b){let y=b.trim();return y===""||y.startsWith("//")||y.startsWith("/*")}function Nn(b,y){for(let s=y;s<b.length;s++)if(!Fl(b[s]))return s;return-1}function Ve(b,y,s){if(b[y].slice(s).includes("{"))return!0;let n=Nn(b,y+1);if(n>=0){if(b[n].trim().startsWith("{"))return!0}return!1}function In(b,y,s){let l=b[y].slice(s);if(/\bif\b|\bfor\b|\bwhile\b|\bdo\b/.test(l))return!0;return!1}var hi={meta:{docs:"Enforce curly brackets similar to src-2: require braces when any branch/body requires them"},check:(b,y)=>{let s=[],l=b.split(/\r?\n/);for(let i=0;i<l.length;i++){let w=l[i],a=w.match(/^(\s*)if\s*\(([^)]*)\)/);if(a){let P=a[0].length,_=Ve(l,i,P),D=In(l,i,P),j=i,B=_,Z=D;while(!0){let z=Nn(l,j+1);if(z<0)break;let Y=l[z].trim();if(!Y.startsWith("else"))break;let X=Y.match(/^else\s+if\s*\(([^)]*)\)/);if(X){let J=l[z].indexOf(X[0])+X[0].length;B=B||Ve(l,z,J),Z=Z||In(l,z,J),j=z;continue}else{let J=l[z].indexOf("else")+4;B=B||Ve(l,z,J),Z=Z||In(l,z,J),j=z;break}}if(B||Z){if(!_)s.push({filePath:y.filePath,line:i+1,column:Math.max(1,w.indexOf("if")+1),ruleId:"style/curly",message:"Expect curly brackets",severity:"warning"});let z=i;while(!0){let Y=Nn(l,z+1);if(Y<0)break;let X=l[Y],J=X.trim();if(!J.startsWith("else"))break;let ne=J.match(/^else\s+if\s*\(([^)]*)\)/);if(ne){let Q=X.indexOf(ne[0])+ne[0].length;if(!Ve(l,Y,Q))s.push({filePath:y.filePath,line:Y+1,column:Math.max(1,X.indexOf("else")+1),ruleId:"style/curly",message:"Expect curly brackets",severity:"warning"});z=Y;continue}else{let Q=X.indexOf("else")+4;if(!Ve(l,Y,Q))s.push({filePath:y.filePath,line:Y+1,column:Math.max(1,X.indexOf("else")+1),ruleId:"style/curly",message:"Expect curly brackets",severity:"warning"});break}}}}let I=w.match(/^(\s*)(while|do|for|for\s+await)\b/);if(I){let P=I[0].length,_=Ve(l,i,P),D=In(l,i,P);if((_||D)&&!_)s.push({filePath:y.filePath,line:i+1,column:Math.max(1,w.indexOf(I[2])+1),ruleId:"style/curly",message:"Expect curly brackets",severity:"warning"})}}let n=Bl(b,y.filePath);for(let i of n)s.push({filePath:y.filePath,line:i.line,column:i.column,ruleId:"style/curly",message:i.message,severity:"warning"});return s}};function Bl(b,y){let s=[],l=b.split(/\r?\n/);for(let n=0;n<l.length;n++){let i=l[n],w=i.trim(),a=/^if\s*\(/.test(w)?"if":/^else\s+if\s*\(/.test(w)?"else-if":/^else\b/.test(w)?"else":null;if(!a)continue;let I=0;if(a==="if"){let Z=i.match(/if\s*\([^)]*\)/);I=Z?i.indexOf(Z[0])+Z[0].length:i.indexOf("if")+2}else if(a==="else-if"){let Z=i.match(/else\s+if\s*\([^)]*\)/);I=Z?i.indexOf(Z[0])+Z[0].length:i.indexOf("else")+4}else I=i.indexOf("else")+4;let P=n,_=i.indexOf("{",I);if(_<0){let Z=function(Y){for(let X=Y;X<l.length;X++)if(l[X].trim()!=="")return X;return-1}(n+1);if(Z<0)continue;if(_=l[Z].indexOf("{"),_<0)continue;P=Z}let D=0,j=-1;for(let Z=P;Z<l.length;Z++){let z=l[Z],Y=Z===P?Math.max(0,_):0;for(let X=Y;X<z.length;X++){let J=z[X];if(J==="{")D++;else if(J==="}"){if(D--,D===0){j=Z;break}}}if(j>=0)break}if(j<0)continue;let B=[];for(let Z=P+1;Z<j;Z++){let z=l[Z].trim();if(z===""||/^\/\//.test(z))continue;if(B.push(z),B.length>1)break}if(B.length===1&&j===P+2){let Z=B[0],z=/^(?:if|for|while|do|switch|try|catch|else)\b/.test(Z),Y=/[{}]/.test(Z),X=(Z.match(/\(/g)||[]).length,J=(Z.match(/\)/g)||[]).length,ne=X!==J,Q=!1;for(let ee=n+1;ee<l.length;ee++){let ie=l[ee].trim();if(ie===""||ie==="}"||/^\/\//.test(ie))continue;if(!/^else\b/.test(ie))break;let ye=l[ee].indexOf("else")+4,we=ie.match(/^else\s+if\s*\([^)]*\)/);if(we)ye=l[ee].indexOf(we[0])+we[0].length;let se=ee,fe=l[ee].indexOf("{",ye);if(fe<0){let le=function(me){for(let xe=me;xe<l.length;xe++)if(l[xe].trim()!=="")return xe;return-1}(ee+1);if(le<0)break;if(fe=l[le].indexOf("{"),fe<0)continue;se=le}let re=0,pe=-1;for(let le=se;le<l.length;le++){let ge=l[le],me=le===se?Math.max(0,fe):0;for(let xe=me;xe<ge.length;xe++){let de=ge[xe];if(de==="{")re++;else if(de==="}"){if(re--,re===0){pe=le;break}}}if(pe>=0)break}if(pe>=0){let le=0;for(let ge=se+1;ge<pe;ge++){let me=l[ge].trim();if(me===""||/^\/\//.test(me))continue;if(le++,le>1){Q=!0;break}}}if(Q)break}if(!Q&&a==="if"){let ee=function(ye){for(let we=ye;we<l.length;we++){let se=l[we].trim();if(se!==""&&se!=="}"&&!/^\/\//.test(se))return we}return-1}(j+1);if(ee>=0&&/^else\b/.test(l[ee].trim())){let ie=l[ee].indexOf("else")+4,ye=l[ee].trim().match(/^else\s+if\s*\([^)]*\)/);if(ye)ie=l[ee].indexOf(ye[0])+ye[0].length;let we=ee,se=l[ee].indexOf("{",ie);if(se<0){let fe=function(pe){for(let le=pe;le<l.length;le++)if(l[le].trim()!=="")return le;return-1}(ee+1);if(fe>=0)se=l[fe].indexOf("{"),we=se>=0?fe:we}if(se>=0){let fe=0,re=-1;for(let pe=we;pe<l.length;pe++){let le=l[pe],ge=pe===we?Math.max(0,se):0;for(let me=ge;me<le.length;me++){let xe=le[me];if(xe==="{")fe++;else if(xe==="}"){if(fe--,fe===0){re=pe;break}}}if(re>=0)break}if(re>=0){let pe=0;for(let le=we+1;le<re;le++){let ge=l[le].trim();if(ge===""||/^\/\//.test(ge))continue;if(++pe>1){Q=!0;break}}}}}}if(!z&&!Y&&!ne&&!Q)s.push({line:P+1,column:Math.max(1,l[P].indexOf("{")+1),message:"Unnecessary curly braces around single statement"})}}return s}var gi={meta:{docs:"Enforce dot on the property line in chained method calls",recommended:!0},check(b,y){let s=[],l=b.split(/\r?\n/),n=qe(b);for(let i=0;i<l.length;i++){let w=l[i],a=w.trim();if(!a||a.startsWith("//")||a.startsWith("*")||a.startsWith("/*"))continue;if(n[i+1])continue;if(a.endsWith(".")&&i+1<l.length){let I=l[i+1].trim();if(I&&/^[a-zA-Z_$]/.test(I))s.push({filePath:y.filePath,line:i+1,column:w.length,ruleId:"style/dot-location",message:"Dot should be on the same line as the property",severity:"warning"})}}return s},fix(b){let y=b.split(/\r?\n/),s=[],l=qe(b);for(let n=0;n<y.length;n++){let i=y[n];if(i.trim().endsWith(".")&&!l[n+1]&&n+1<y.length){let a=y[n+1],I=a.trim();if(I&&/^[a-zA-Z_$]/.test(I)){s.push(i.replace(/\.\s*$/,""));let P=a.match(/^(\s*)/)?.[1]||"";y[n+1]=`${P}.${I}`;continue}}s.push(i)}return s.join(`
63
+ `)}};function bi(b,y){let s=b.slice(0,y);if(s.includes("//"))return!0;let l=(s.match(/'/g)||[]).length,n=(s.match(/"/g)||[]).length,i=(s.match(/`/g)||[]).length;return l%2===1||n%2===1||i%2===1}var yi=["===","!==",">>>","==","!=",">=","<=","&&","||","??","**","<<",">>","+","-","*","/","%","|","&","^",">","<","instanceof","in"],Nd=new RegExp(`^(${yi.map((b)=>b.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|")})\\s`),ql=new Set(["in","instanceof"]),zl=/^(?:instanceof|in)\s/;function Pn(b){if(zl.test(b))return!0;for(let y of yi){if(ql.has(y))continue;if(b.startsWith(y)){let s=b[y.length];if(s===void 0||s===" "||s==="\t")return!0}}return!1}function Dn(b){let y=b.match(/^(\s*)/);return y?y[1].length:0}var xi={meta:{docs:"Enforce consistent indentation of continuation lines in multiline binary expressions",recommended:!0},check(b,y){let s=[],l=b.split(/\r?\n/);for(let n=0;n<l.length;n++){let i=l[n],w=i.trim();if(!w||w.startsWith("//")||w.startsWith("*")||w.startsWith("/*"))continue;if(!Pn(w))continue;if(bi(i,0))continue;let a=n-1;while(a>=0){let _=l[a].trim();if(!_||_.startsWith("//")||_.startsWith("*")||_.startsWith("/*")){a--;continue}if(Pn(_)){a--;continue}break}if(a<0)continue;let I=Dn(l[a])+2,P=Dn(i);if(P!==I)s.push({filePath:y.filePath,line:n+1,column:P+1,ruleId:"style/indent-binary-ops",message:`Expected indentation of ${I} spaces for binary operator continuation, but found ${P}`,severity:"warning"})}return s},fix(b,y){let s=b.split(/\r?\n/),l=[];for(let n=0;n<s.length;n++){let i=s[n],w=i.trim();if(!w||w.startsWith("//")||w.startsWith("*")||w.startsWith("/*")){l.push(i);continue}if(!Pn(w)||bi(i,0)){l.push(i);continue}let a=-1;for(let _=l.length-1;_>=0;_--){let D=l[_].trim();if(!D||D.startsWith("//")||D.startsWith("*")||D.startsWith("/*"))continue;if(Pn(D))continue;a=_;break}if(a<0){l.push(i);continue}let I=Dn(l[a])+2,P=" ".repeat(I)+w;l.push(P);continue}return l.join(`
64
+ `)}};var Ri=new Set(["if","for","while","switch","catch","function","return","typeof","void","delete","throw","new","await","class","import","export","from","of","in","case","default","yield","else","do","try","finally","with","async","super","this","extends","implements","instanceof"]),Mn=/([a-zA-Z_$][a-zA-Z0-9_$]*)\s+\(/g;function wi(b,y){let s=b.slice(0,y);if(s.includes("//"))return!0;let l=(s.match(/'/g)||[]).length,n=(s.match(/"/g)||[]).length,i=(s.match(/`/g)||[]).length;return l%2===1||n%2===1||i%2===1}var ki={meta:{docs:"Disallow spaces between function name and opening parenthesis in calls",recommended:!0},check(b,y){let s=[],l=b.split(/\r?\n/);for(let n=0;n<l.length;n++){let i=l[n],w=i.trim();if(!w||w.startsWith("//")||w.startsWith("*")||w.startsWith("/*"))continue;let a;Mn.lastIndex=0;while((a=Mn.exec(i))!==null){let I=a[1],P=a.index;if(wi(i,P))continue;if(Ri.has(I))continue;let _=i.slice(0,P).trimEnd();if(_.endsWith("function")||_.endsWith("function*"))continue;if(/\b(?:get|set)\s*$/.test(_))continue;let D=P+I.length;s.push({filePath:y.filePath,line:n+1,column:D+1,ruleId:"style/function-call-spacing",message:"Unexpected space between function name and parenthesis",severity:"warning"})}}return s},fix(b,y){let s=b.split(/\r?\n/),l=[];for(let n=0;n<s.length;n++){let i=s[n],w=i.trim();if(!w||w.startsWith("//")||w.startsWith("*")||w.startsWith("/*")){l.push(i);continue}let a=i,I=[],P;Mn.lastIndex=0;while((P=Mn.exec(i))!==null){let _=P[1],D=P.index;if(wi(i,D))continue;if(Ri.has(_))continue;let j=i.slice(0,D).trimEnd();if(j.endsWith("function")||j.endsWith("function*"))continue;if(/\b(?:get|set)\s*$/.test(j))continue;I.push({index:D,fullMatch:P[0],identifier:_})}for(let _=I.length-1;_>=0;_--){let D=I[_],j=D.index,B=j+D.fullMatch.length;a=`${a.slice(0,j)}${D.identifier}(${a.slice(B)}`}l.push(a)}return l.join(`
65
+ `)}};var Ii=/\bfunction\s*\*/g;function Pi(b,y){let s=b.slice(0,y);if(s.includes("//"))return!0;let l=(s.match(/'/g)||[]).length,n=(s.match(/"/g)||[]).length,i=(s.match(/`/g)||[]).length;return l%2===1||n%2===1||i%2===1}var Mi={meta:{docs:"Enforce spacing around * in generator functions (space after, no space before)",recommended:!0},check(b,y){let s=[],l=b.split(/\r?\n/);for(let n=0;n<l.length;n++){let i=l[n],w=i.trim();if(!w||w.startsWith("//")||w.startsWith("*")||w.startsWith("/*"))continue;let a;Ii.lastIndex=0;while((a=Ii.exec(i))!==null){let P=a.index;if(Pi(i,P))continue;let _=a[0],D=P+_.indexOf("*"),j=D+1;if(_!=="function*")s.push({filePath:y.filePath,line:n+1,column:D+1,ruleId:"style/generator-star-spacing",message:"Unexpected space before * in generator function",severity:"warning"});if(j<i.length&&i[j]!==" "&&i[j]!=="\t"&&i[j]!==`
66
+ `&&i[j]!=="(")s.push({filePath:y.filePath,line:n+1,column:j+1,ruleId:"style/generator-star-spacing",message:"Missing space after * in generator function",severity:"warning"})}if(w.match(/^(?:async\s+)?\*\s*([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/)){let P=i.indexOf("*",i.indexOf(w.charAt(0)));if(!Pi(i,P)){let _=P+1;if(_<i.length&&i[_]!==" "&&i[_]!=="\t")s.push({filePath:y.filePath,line:n+1,column:_+1,ruleId:"style/generator-star-spacing",message:"Missing space after * in generator method",severity:"warning"})}}}return s},fix(b,y){let s=b;return s=s.replace(/\bfunction\s+\*/g,"function*"),s=s.replace(/\bfunction\*([a-zA-Z_$])/g,"function* $1"),s=s.replace(/(^\s*(?:async\s+)?)\*([a-zA-Z_$])/gm,"$1* $2"),s}};var vi={meta:{docs:"Enforce newline after if when without braces"},check:(b,y)=>{let s=[],l=b.split(/\r?\n/);for(let n=0;n<l.length;n++){let i=l[n];if(!i.match(/^\s*if\s*\([^)]*\)\s*([^\s{/].*)$/))continue;s.push({filePath:y.filePath,line:n+1,column:Math.max(1,i.indexOf("if")+1),ruleId:"style/if-newline",message:"Expect newline after if",severity:"warning"})}return s}};var Zl=["$","unindent","unIndent"],$i={meta:{docs:"Enforce consistent indentation inside unindent-style tagged templates"},check:(b,y)=>{let s=[],l=b.split(/\r?\n/);for(let n=0;n<l.length;n++){let i=l[n],w=i.match(/^\s*/)?.[0]??"",a=/([$A-Z_][\w$]*)\s*`/gi,I;while(I=a.exec(i)){let P=I[1];if(!Zl.includes(P))continue;if(i.slice(I.index+I[0].length).includes("`"))continue;let D=-1;for(let B=n+1;B<l.length;B++)if(l[B].includes("`")){D=B;break}if(D<0)continue;let j=`${w} `;for(let B=n+1;B<D;B++){let Z=l[B];if(Z.trim()==="")continue;let z=Z.match(/^\s*/)?.[0]??"";if(!z.startsWith(j)){s.push({filePath:y.filePath,line:B+1,column:(z.length||0)+1,ruleId:"style/indent-unindent",message:"Consistent indentation in unindent tag",severity:"warning"});break}}}}return s}};var Gl=/^(\s*)(["']?[a-zA-Z_$][a-zA-Z0-9_$]*["']?\s*(?:\?)?):(\S)/;function Ci(b,y){let s=b.slice(0,y);if(s.includes("//"))return!0;let l=(s.match(/'/g)||[]).length,n=(s.match(/"/g)||[]).length,i=(s.match(/`/g)||[]).length;return l%2===1||n%2===1||i%2===1}var Li={meta:{docs:"Require space after colon in object properties",recommended:!0},check(b,y){let s=[],l=b.split(/\r?\n/);for(let n=0;n<l.length;n++){let i=l[n],w=i.trim();if(!w||w.startsWith("//")||w.startsWith("*")||w.startsWith("/*"))continue;let a=i.match(Gl);if(a){let P=i.indexOf(":",a[1].length);if(P!==-1&&!Ci(i,P)){let _=i[P+1];if(_&&_!==" "&&_!=="\t"&&_!==`
67
+ `)s.push({filePath:y.filePath,line:n+1,column:P+2,ruleId:"style/key-spacing",message:"Missing space after colon in property",severity:"warning"})}}let I=w.match(/^(["']?[a-zA-Z_$][a-zA-Z0-9_$]*["']?)\s+:/);if(I&&!w.match(/^\s*(case|default)\b/)){let P=i.indexOf(":",i.indexOf(I[1])+I[1].length);if(P!==-1&&!Ci(i,P))s.push({filePath:y.filePath,line:n+1,column:P+1,ruleId:"style/key-spacing",message:"Unexpected space before colon in property",severity:"warning"})}}return s},fix(b){let y=b.split(/\r?\n/),s=[];for(let l of y){let n=l;n=n.replace(/^(\s*)(["']?[a-zA-Z_$][a-zA-Z0-9_$]*["']?\s*(?:\?)?):(\S)/,"$1$2: $3"),s.push(n)}return s.join(`
68
+ `)}};var Vl=["if","else","for","while","do","switch","case","return","throw","try","catch","finally","const","let","var","typeof","instanceof","in","of","new","delete","void","yield","await","async","from","import","export","default","class","extends","as","break","continue"],Si=new RegExp(`(?:^|[^\\w$.])(${Vl.join("|")})(?=[^\\w$]|$)`,"g");function Kl(b,y){let s=b.slice(0,y);if(s.includes("//"))return!0;let l=(s.match(/'/g)||[]).length,n=(s.match(/"/g)||[]).length,i=(s.match(/`/g)||[]).length;return l%2===1||n%2===1||i%2===1}var Ei={meta:{docs:"Require space before and after keywords",recommended:!0},check(b,y){let s=[],l=b.split(/\r?\n/);for(let n=0;n<l.length;n++){let i=l[n],w=i.trim();if(!w||w.startsWith("//")||w.startsWith("*")||w.startsWith("/*"))continue;let a;Si.lastIndex=0;while((a=Si.exec(i))!==null){let I=a[0].charAt(0)===a[1].charAt(0)?"":a[0].charAt(0),P=a.index+I.length,_=P+a[1].length;if(Kl(i,P))continue;if(P>0){let D=i[P-1];if(D===")"||D==="}")s.push({filePath:y.filePath,line:n+1,column:P+1,ruleId:"style/keyword-spacing",message:`Missing space before keyword '${a[1]}'`,severity:"warning"})}if(_<i.length){let D=i[_];if(D!==" "&&D!=="\t"&&D!==";"&&D!==","&&D!==":"&&D!=="."){if(D==="("&&(a[1]==="if"||a[1]==="for"||a[1]==="while"||a[1]==="switch"||a[1]==="catch"))s.push({filePath:y.filePath,line:n+1,column:_+1,ruleId:"style/keyword-spacing",message:`Missing space after keyword '${a[1]}'`,severity:"warning"})}}}}return s},fix(b){let y=b.split(/\r?\n/),s=[];for(let l of y){let n=l;for(let i of["if","for","while","switch","catch"]){let w=new RegExp(`(\\b${i})\\(`,"g");n=n.replace(w,"$1 (")}for(let i of["else","catch","finally"])n=n.replace(new RegExp(`\\)${i}\\b`,"g"),`) ${i}`),n=n.replace(new RegExp(`\\}${i}\\b`,"g"),`} ${i}`);s.push(n)}return s.join(`
69
+ `)}};var Ai=/^\s*(?:public|private|protected|static|readonly|abstract|override|async|get|set|\*|#|[a-zA-Z_$])/,Oi={meta:{docs:"Require blank line between class members",recommended:!0},check(b,y){let s=[],l=b.split(/\r?\n/),n=!1,i=0,w=0,a=-1;for(let I=0;I<l.length;I++){let _=l[I].trim();if(_.match(/\bclass\b/)&&(_.includes("{")||I+1<l.length&&l[I+1].trim()==="{"))n=!0,w=i+1;let D=i;for(let j of _){if(j==="{")i++;if(j==="}")i--}if(n&&i<w){n=!1,a=-1;continue}if(!n)continue;if(D>w&&i===w&&_.endsWith("}")){a=I;continue}if(D===w){if(!_||_.startsWith("//")||_.startsWith("*")||_.startsWith("/*")||_==="}")continue;if(Ai.test(_)){if(a!==-1&&I===a+1)s.push({filePath:y.filePath,line:I+1,column:1,ruleId:"style/lines-between-class-members",message:"Missing blank line between class members",severity:"warning"});if(!_.endsWith("{"))a=I}}}return s},fix(b,y){let s=b.split(/\r?\n/),l=[],n=!1,i=0,w=0,a=-1;for(let I=0;I<s.length;I++){let P=s[I],_=P.trim();if(_.match(/\bclass\b/)&&(_.includes("{")||I+1<s.length&&s[I+1].trim()==="{"))n=!0,w=i+1;let D=i;for(let j of _){if(j==="{")i++;if(j==="}")i--}if(n&&i<w){n=!1,a=-1,l.push(P);continue}if(n&&D>w&&i===w&&_.endsWith("}")){a=I,l.push(P);continue}if(n&&D===w&&_&&!_.startsWith("//")&&!_.startsWith("*")&&!_.startsWith("/*")&&_!=="}"&&Ai.test(_)){if(a!==-1&&I===a+1)l.push("");if(!_.endsWith("{"))a=I}l.push(P)}return l.join(`
70
+ `)}};var _i={meta:{docs:"Limit the number of statements allowed on a single line"},check:(b,y)=>{let s=y.options&&typeof y.options.max==="number"?y.options.max:1,l=[],n=c(b).split(/\r?\n/),i=(w)=>{let a=Hl(w),I=(a>=0?w.slice(0,a):w).replace(/^\s*;+/,""),P=0,_=!1,D=!1,j=!1,B=!1,Z=!1,z=!1,Y=0,X="",J=(ee)=>{if(ee===" "||ee==="\t")return;X=ee};for(let ee=0;ee<I.length;ee++){let ie=I[ee];if(Z){Z=!1;continue}if(ie==="\\"){Z=!0;continue}if(j){if(B){if(ie==="]")B=!1;continue}if(ie==="["){B=!0;continue}if(ie==="/"){j=!1;while(ee+1<I.length&&/[a-z]/i.test(I[ee+1]))ee++;X="/"}continue}if(!D&&ie==="'"){_=!_,J(_?"'":"x");continue}if(!_&&ie==='"'){D=!D,J(D?'"':"x");continue}if(_||D)continue;if(ie==="/"&&Ti(X,I,ee)){j=!0;continue}if(!z){if(ie==="f"&&I.slice(ee,ee+4).match(/^for\b/)){let ye=I.slice(ee+3).trimStart(),we=I.length-ye.length;if(I[we]==="("){z=!0,Y=1,ee=we,X="(";continue}}}else if(ie==="(")Y++;else if(ie===")"){if(Y--,Y<=0)z=!1}else if(ie===";"){J(ie);continue}if(ie===";")P++;J(ie)}if(P===0)return 1;return I.trimEnd().endsWith(";")?P:P+1};for(let w=0;w<n.length;w++){let a=n[w];if(/^\s*$/.test(a))continue;let I=a.includes(";")?i(a):1;if(I>s)l.push({filePath:y.filePath,line:w+1,column:1,ruleId:"max-statements-per-line",message:`This line has ${I} statements. Maximum allowed is ${s}`,severity:"warning"})}return l}};function Hl(b){let y=!1,s=!1,l=!1,n=!1,i=!1,w=!1,a="";for(let I=0;I<b.length;I++){let P=b[I];if(w){w=!1;continue}if(P==="\\"){w=!0;continue}if(n){if(i){if(P==="]")i=!1;continue}if(P==="["){i=!0;continue}if(P==="/"){n=!1;while(I+1<b.length&&/[a-z]/i.test(b[I+1]))I++;a="/"}continue}if(!s&&!l&&P==="'"){y=!y,a=P;continue}if(!y&&!l&&P==='"'){s=!s,a=P;continue}if(!y&&!s&&P==="`"){l=!l,a=P;continue}if(y||s||l)continue;if(P==="/"&&b[I+1]==="/")return I;if(P==="/"&&Ti(a,b,I)){n=!0;continue}if(P!==" "&&P!=="\t")a=P}return-1}function Ti(b,y,s){if(b==="")return!0;if("([{,:;!?&|=<>~^+*%-".includes(b))return!0;if(/[A-Za-z_$]/.test(b)){if(y.slice(0,s).trimEnd().match(/(?:^|[^A-Za-z0-9_$])(return|typeof|instanceof|new|delete|void|in|of|yield|await|throw|case)$/))return!0}return!1}function Wi(b,y){let s=b.slice(0,y);if(s.includes("//"))return!0;let l=(s.match(/'/g)||[]).length,n=(s.match(/"/g)||[]).length,i=(s.match(/`/g)||[]).length;return l%2===1||n%2===1||i%2===1}var Ni={meta:{docs:"Enforce consistent multiline ternary expressions",recommended:!0},check(b,y){let s=[],l=b.split(/\r?\n/);for(let n=0;n<l.length;n++){let i=l[n],w=i.trim();if(!w||w.startsWith("//")||w.startsWith("*")||w.startsWith("/*"))continue;let a=i.indexOf("?");if(a===-1)continue;if(i[a+1]==="."||i[a+1]==="?")continue;if(Wi(i,a))continue;if(i.indexOf(":",a+1)!==-1)continue;for(let P=n+1;P<Math.min(n+10,l.length);P++){let _=l[P].trim();if(_.startsWith(":"))break;let D=_.indexOf(":");if(D>0&&!Wi(l[P],D)){if(_.match(/^\w+\s*:/)||_.match(/^case\b/))continue;s.push({filePath:y.filePath,line:P+1,column:l[P].indexOf(":")+1,ruleId:"style/multiline-ternary",message:"In multiline ternary, ':' should be at the start of the line",severity:"warning"});break}}}return s}};var Di=new RegExp("\\bnew\\s+([A-Z][a-zA-Z0-9_$.]+)(?![a-zA-Z0-9_$])(?:\\s*<[^>]*>)?\\s*(?=[^(;\\n]|$)","g");function Yl(b,y){let s=b.slice(0,y);if(s.includes("//"))return!0;let l=(s.match(/'/g)||[]).length,n=(s.match(/"/g)||[]).length,i=(s.match(/`/g)||[]).length;return l%2===1||n%2===1||i%2===1}var ji={meta:{docs:"Require parentheses when invoking a constructor with no arguments",recommended:!0},check(b,y){let s=[],l=b.split(/\r?\n/);for(let n=0;n<l.length;n++){let i=l[n],w=i.trim();if(!w||w.startsWith("//")||w.startsWith("*")||w.startsWith("/*"))continue;let a;Di.lastIndex=0;while((a=Di.exec(i))!==null){if(Yl(i,a.index))continue;if(i.slice(a.index+a[0].length).startsWith("("))continue;if(a[0].includes("new."))continue;s.push({filePath:y.filePath,line:n+1,column:a.index+1,ruleId:"style/new-parens",message:`Missing parentheses invoking constructor '${a[1]}'`,severity:"warning",help:"Add () after the constructor name."})}}return s},fix(b){return b.replace(/\bnew\s+([A-Z][a-zA-Z0-9_$.]+)(?![a-zA-Z0-9_$])(\s*<[^>]*>)?\s*(?=[^(]|$)/g,(y,s,l)=>{if(y.slice(y.indexOf(s)+s.length+(l?.length||0)).trim().startsWith("("))return y;return`new ${s}${l||""}()`})}};var Yd=new RegExp("\\breturn\\s+\\(([^()]*)\\)\\s*[;\\n]","g"),Ui=/^[a-zA-Z_$][a-zA-Z0-9_$.[\]'"`]*$/;var Fi={meta:{docs:"Remove redundant parentheses in return statements",recommended:!0},check(b,y){let s=[],l=b.split(/\r?\n/);for(let n=0;n<l.length;n++){let i=l[n],w=i.trim();if(!w||w.startsWith("//")||w.startsWith("*")||w.startsWith("/*"))continue;let a=new RegExp("^return\\s+\\(([^()]*)\\)\\s*;?\\s*$"),I=w.match(a);if(I){let P=I[1].trim();if(Ui.test(P)||/^['"`]/.test(P)||/^\d/.test(P)||P==="true"||P==="false"||P==="null"||P==="undefined")s.push({filePath:y.filePath,line:n+1,column:i.indexOf("(")+1,ruleId:"style/no-extra-parens",message:"Unnecessary parentheses around return value",severity:"warning",help:"Remove the outer parentheses."})}}return s},fix(b){let y=b.split(/\r?\n/),s=[];for(let l of y){let n=l.trim(),i=new RegExp("^return\\s+\\(([^()]*)\\)\\s*(;?)\\s*$"),w=n.match(i);if(w){let a=w[1].trim(),I=w[2];if(Ui.test(a)||/^['"`]/.test(a)||/^\d/.test(a)||a==="true"||a==="false"||a==="null"||a==="undefined"){let P=l.match(/^(\s*)/)?.[1]||"";s.push(`${P}return ${a}${I}`);continue}}s.push(l)}return s.join(`
71
+ `)}};var Bi=/(\S)\s+(\.)[a-zA-Z_$]/g,qi=/(\S)\s+(\?\.)[a-zA-Z_$]/g;function vn(b,y){let s=b.slice(0,y);if(s.includes("//"))return!0;let l=(s.match(/'/g)||[]).length,n=(s.match(/"/g)||[]).length,i=(s.match(/`/g)||[]).length;return l%2===1||n%2===1||i%2===1}var zi={meta:{docs:"Disallow whitespace before . or ?. in property access",recommended:!0},check(b,y){let s=[],l=b.split(/\r?\n/);for(let n=0;n<l.length;n++){let i=l[n],w=i.trim();if(!w||w.startsWith("//")||w.startsWith("*")||w.startsWith("/*"))continue;let a;Bi.lastIndex=0;while((a=Bi.exec(i))!==null){let I=a.index+a[0].indexOf(".");if(vn(i,a.index))continue;if(I+1<i.length&&i[I+1]===".")continue;if(I>0&&i[I-1]===".")continue;s.push({filePath:y.filePath,line:n+1,column:I+1,ruleId:"style/no-whitespace-before-property",message:"Unexpected whitespace before property access dot",severity:"warning"})}qi.lastIndex=0;while((a=qi.exec(i))!==null){let I=a.index+a[0].indexOf("?.");if(vn(i,a.index))continue;s.push({filePath:y.filePath,line:n+1,column:I+1,ruleId:"style/no-whitespace-before-property",message:"Unexpected whitespace before optional chaining operator",severity:"warning"})}}return s},fix(b,y){let s=b.split(/\r?\n/),l=[];for(let n=0;n<s.length;n++){let i=s[n],w=i.trim();if(!w||w.startsWith("//")||w.startsWith("*")||w.startsWith("/*")){l.push(i);continue}let a=i;a=a.replace(/(\S)\s+(\?\.[a-zA-Z_$])/g,(I,P,_,D)=>{if(vn(i,D))return I;return P+_}),a=a.replace(/(\S)\s+(\.[a-zA-Z_$])/g,(I,P,_,D)=>{if(vn(i,D))return I;let j=D+I.indexOf(".");if(j+1<a.length&&a[j+1]===".")return I;return P+_}),l.push(a)}return l.join(`
72
+ `)}};function Ke(b,y){let s=b.slice(0,y);if(s.includes("//"))return!0;let l=(s.match(/'/g)||[]).length,n=(s.match(/"/g)||[]).length,i=(s.match(/`/g)||[]).length;return l%2===1||n%2===1||i%2===1}var Zi=/&&/g,Gi=/\|\|/g,Vi=/\?\?/g,Ki=/(?<![&])&(?![&=])/g,Hi=/(?<![|])\|(?![|=])/g,Yi=/\^(?!=)/g;function Xl(b){let y=[];Zi.lastIndex=0;let s;while((s=Zi.exec(b))!==null)if(!Ke(b,s.index))y.push({op:"&&",group:0,index:s.index});Gi.lastIndex=0;while((s=Gi.exec(b))!==null)if(!Ke(b,s.index))y.push({op:"||",group:1,index:s.index});Vi.lastIndex=0;while((s=Vi.exec(b))!==null)if(!Ke(b,s.index))y.push({op:"??",group:2,index:s.index});Ki.lastIndex=0;while((s=Ki.exec(b))!==null)if(!Ke(b,s.index))y.push({op:"&",group:3,index:s.index});Hi.lastIndex=0;while((s=Hi.exec(b))!==null)if(!Ke(b,s.index))y.push({op:"|",group:4,index:s.index});Yi.lastIndex=0;while((s=Yi.exec(b))!==null)if(!Ke(b,s.index))y.push({op:"^",group:5,index:s.index});return y.sort((l,n)=>l.index-n.index)}function Jl(b,y){if(y.length<2)return!0;let s=[];for(let i of y){let w=0;for(let a=0;a<i.index;a++)if(b[a]==="(")w++;else if(b[a]===")")w--;s.push(w)}let l=new Map;for(let i=0;i<y.length;i++){let w=y[i].group;if(!l.has(w))l.set(w,[]);l.get(w).push(s[i])}let n=[...l.entries()];if(n.length===2){let[,i]=n[0],[,w]=n[1],a=Math.min(...i),I=Math.max(...i),P=Math.min(...w),_=Math.max(...w);if(a>_||P>I)return!0}return!1}var Ql=[{groups:[0,1],label:"&& and ||"},{groups:[0,2],label:"&& and ??"},{groups:[1,2],label:"|| and ??"},{groups:[3,4],label:"& and |"},{groups:[3,5],label:"& and ^"},{groups:[4,5],label:"| and ^"}],Xi={meta:{docs:"Disallow mixed logical/bitwise operators without parentheses",recommended:!0},check(b,y){let s=[],l=b.split(/\r?\n/);for(let n=0;n<l.length;n++){let i=l[n],w=i.trim();if(!w||w.startsWith("//")||w.startsWith("*")||w.startsWith("/*"))continue;let a=Xl(i);if(a.length<2)continue;let I=new Set(a.map((P)=>P.group));for(let P of Ql)if(I.has(P.groups[0])&&I.has(P.groups[1])){let _=a.filter((D)=>D.group===P.groups[0]||D.group===P.groups[1]);if(!Jl(i,_)){let D=_.find((j)=>j.group===P.groups[1]);if(D)s.push({filePath:y.filePath,line:n+1,column:D.index+1,ruleId:"style/no-mixed-operators",message:`Unexpected mix of ${P.label} without parentheses`,severity:"warning"})}}}return s}};var Ji=/(?<![0-9.])\.\d/g,Qi=/\d\.(?!\d|\.|\w)/g;function er(b,y){let s=b.slice(0,y);if(s.includes("//"))return!0;let l=(s.match(/'/g)||[]).length,n=(s.match(/"/g)||[]).length,i=(s.match(/`/g)||[]).length;return l%2===1||n%2===1||i%2===1}var tr={meta:{docs:"Disallow floating decimals like .5 or 2.",recommended:!0},check(b,y){let s=[],l=b.split(/\r?\n/);for(let n=0;n<l.length;n++){let i=l[n],w=i.trim();if(!w||w.startsWith("//")||w.startsWith("*")||w.startsWith("/*"))continue;let a;Ji.lastIndex=0;while((a=Ji.exec(i))!==null){if(er(i,a.index))continue;if(a.index>0){let I=i[a.index-1];if(/[a-zA-Z_$)\]]/.test(I))continue}s.push({filePath:y.filePath,line:n+1,column:a.index+1,ruleId:"style/no-floating-decimal",message:"Unexpected leading decimal point",severity:"warning",help:"Add a leading 0 before the decimal point: 0.5 instead of .5"})}Qi.lastIndex=0;while((a=Qi.exec(i))!==null){if(er(i,a.index))continue;s.push({filePath:y.filePath,line:n+1,column:a.index+1,ruleId:"style/no-floating-decimal",message:"Unexpected trailing decimal point",severity:"warning",help:"Add a trailing 0 after the decimal point: 2.0 instead of 2."})}}return s},fix(b){let y=b;return y=y.replace(/(?<![a-zA-Z_$0-9.)\]])\.\d/g,(s)=>`0${s}`),y=y.replace(/(\d)\.(?!\d|\.|\w)/g,(s,l)=>`${l}.0`),y}};var nr={meta:{docs:"Disallow mixed spaces and tabs for indentation",recommended:!0},check(b,y){let s=[],l=b.split(/\r?\n/);for(let n=0;n<l.length;n++){let w=l[n].match(/^(\s*)/)?.[1]||"";if(!w)continue;let a=w.includes("\t"),I=w.includes(" ");if(a&&I)s.push({filePath:y.filePath,line:n+1,column:1,ruleId:"style/no-mixed-spaces-and-tabs",message:"Mixed spaces and tabs in indentation",severity:"warning",help:"Use either spaces or tabs for indentation, not both."})}return s}};var sr={meta:{docs:"Disallow multiple consecutive spaces",recommended:!0},check(b,y){let s=[],l=b.split(/\r?\n/);for(let n=0;n<l.length;n++){let i=l[n];if(!i.trim())continue;let w=i.match(/^(\s*)/)?.[1]||"",a=i.slice(w.length),I=/ {2,}/g,P;for(P=I.exec(a);P!==null;P=I.exec(a)){let _=w.length+P.index+1,D=a.slice(0,P.index),j=(D.match(/'/g)||[]).length,B=(D.match(/"/g)||[]).length,Z=(D.match(/`/g)||[]).length;if(j%2===1||B%2===1||Z%2===1)continue;if(D.includes("//"))continue;if(i.trim().startsWith("*")||i.trim().startsWith("/*"))continue;s.push({filePath:y.filePath,line:n+1,column:_,ruleId:"style/no-multi-spaces",message:"Multiple spaces found",severity:"warning",help:"Remove extra spaces. Use single spaces between tokens."})}}return s}};var ir={meta:{docs:"Disallow multiple consecutive blank lines",recommended:!0},check(b,y){let s=[],l=b.split(/\r?\n/),n=0,i=-1;for(let w=0;w<l.length;w++)if(l[w].trim()===""){if(n++,i===-1)i=w;if(n>1&&w===i+n-1)s.push({filePath:y.filePath,line:w+1,column:1,ruleId:"style/no-multiple-empty-lines",message:"More than 1 blank line not allowed",severity:"error",help:"Remove extra blank lines. Maximum 1 consecutive blank line allowed."})}else n=0,i=-1;return s}};var rr={meta:{docs:"Disallow tab characters (when using spaces for indentation)",recommended:!1},check(b,y){let s=[];if(y.config.format?.indentStyle==="tabs")return s;let l=b.split(/\r?\n/);for(let n=0;n<l.length;n++){let w=l[n].indexOf("\t");if(w!==-1)s.push({filePath:y.filePath,line:n+1,column:w+1,ruleId:"style/no-tabs",message:"Unexpected tab character",severity:"warning",help:"Use spaces for indentation instead of tabs."})}return s},fix(b,y){let s=y.config.format?.indent??2;return b.replace(/\t/g," ".repeat(s))}};var or={meta:{docs:"Disallow trailing whitespace at the end of lines",recommended:!0},check(b,y){let s=[],l=b.split(/\r?\n/);for(let n=0;n<l.length;n++){let i=l[n],w=i.match(/(\s+)$/);if(w){let a=i.length-w[1].length+1;s.push({filePath:y.filePath,line:n+1,column:a,ruleId:"style/no-trailing-spaces",message:"Trailing spaces not allowed",severity:"error",help:"Remove trailing whitespace from the end of this line."})}}return s}};function lr(b,y){let s=b.slice(0,y);if(s.includes("//"))return!0;let l=(s.match(/'/g)||[]).length,n=(s.match(/"/g)||[]).length,i=(s.match(/`/g)||[]).length;return l%2===1||n%2===1||i%2===1}var cr={meta:{docs:"Require spaces inside curly braces in objects and destructuring",recommended:!0},check(b,y){let s=[],l=b.split(/\r?\n/);for(let n=0;n<l.length;n++){let i=l[n],w=i.trim();if(!w||w.startsWith("//")||w.startsWith("*")||w.startsWith("/*"))continue;for(let a=0;a<i.length;a++){if(i[a]==="{"&&!lr(i,a)){let I=i[a+1];if(I==="}"||I===void 0||I===`
73
+ `)continue;if(a>0&&i[a-1]==="$")continue;if(I!==" "&&I!=="\t")s.push({filePath:y.filePath,line:n+1,column:a+2,ruleId:"style/object-curly-spacing",message:"Missing space after '{'",severity:"warning"})}if(i[a]==="}"&&!lr(i,a)){let I=a>0?i[a-1]:void 0;if(I==="{"||I===void 0||I===`
74
+ `)continue;if(a+1<i.length&&i.slice(a+1).match(/^[^}]*\$\{/))continue;if(I!==" "&&I!=="\t")s.push({filePath:y.filePath,line:n+1,column:a+1,ruleId:"style/object-curly-spacing",message:"Missing space before '}'",severity:"warning"})}}}return s},fix(b){let y=b.split(/\r?\n/),s=[];for(let l of y){let n=l;n=n.replace(/(?<!\$)\{(\S)/g,(i,w)=>{if(w==="}")return i;return`{ ${w}`}),n=n.replace(/(\S)\}/g,(i,w)=>{if(w==="{"||w==="$")return i;return`${w} }`}),s.push(n)}return s.join(`
75
+ `)}};var ar=/(\&\&|\|\||\?\?|\?|\+|(?<!=)-(?!=)|\*|\/|%|\*\*|\|(?!\|)|&(?!&)|\^|<<|>>>?)\s*$/;function ur(b,y){let s=b.slice(0,y);if(s.includes("//"))return!0;let l=(s.match(/'/g)||[]).length,n=(s.match(/"/g)||[]).length,i=(s.match(/`/g)||[]).length;return l%2===1||n%2===1||i%2===1}var fr={meta:{docs:"Enforce operators at the beginning of continued lines",recommended:!0},check(b,y){let s=[],l=b.split(/\r?\n/);for(let n=0;n<l.length;n++){let i=l[n],w=i.trim();if(!w||w.startsWith("//")||w.startsWith("*")||w.startsWith("/*"))continue;let a=w.match(ar);if(a&&n+1<l.length){let I=l[n+1].trim();if(I&&!I.startsWith("//")&&!I.startsWith("*")){let P=i.lastIndexOf(a[1]);if(!ur(i,P)){if(a[1]==="?"||a[1]===":")continue;s.push({filePath:y.filePath,line:n+1,column:P+1,ruleId:"style/operator-linebreak",message:`Operator '${a[1]}' should be at the beginning of the next line`,severity:"warning"})}}}}return s},fix(b){let y=b.split(/\r?\n/),s=[];for(let l=0;l<y.length;l++){let n=y[l],i=n.trim();if(!i||i.startsWith("//")||i.startsWith("*")||i.startsWith("/*")||i.endsWith("*/")){s.push(n);continue}let w=i.match(ar);if(w&&l+1<y.length&&w[1]!=="?"&&w[1]!==":"){let a=y[l+1],I=a.trim();if(I&&!I.startsWith("//")&&!I.startsWith("*")){let P=w[1],_=n.lastIndexOf(w[1]);if(ur(n,_)){s.push(n);continue}s.push(n.replace(new RegExp(`\\s*${P.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\s*$`),""));let D=a.match(/^(\s*)/)?.[1]||"";y[l+1]=`${D}${P} ${I}`;continue}}s.push(n)}return s.join(`
76
+ `)}};var mr={meta:{docs:"Disallow empty lines at the beginning and end of blocks",recommended:!0},check(b,y){let s=[],l=b.split(/\r?\n/);for(let n=0;n<l.length;n++){let w=l[n].trim();if(w.endsWith("{")&&n+1<l.length){if(l[n+1].trim()==="")s.push({filePath:y.filePath,line:n+2,column:1,ruleId:"style/padded-blocks",message:"Unexpected empty line after opening brace",severity:"warning"})}if(w==="}"&&n>0){if(l[n-1].trim()==="")s.push({filePath:y.filePath,line:n,column:1,ruleId:"style/padded-blocks",message:"Unexpected empty line before closing brace",severity:"warning"})}}return s},fix(b){let y=b.split(/\r?\n/),s=new Set;for(let l=0;l<y.length;l++){let n=y[l].trim();if(n.endsWith("{")&&l+1<y.length&&y[l+1].trim()==="")s.add(l+1);if(n==="}"&&l>0&&y[l-1].trim()==="")s.add(l-1)}return y.filter((l,n)=>!s.has(n)).join(`
77
+ `)}};var jn=/^(\s*)(["'])([a-zA-Z_$][a-zA-Z0-9_$]*)\2\s*:/;var pr={meta:{docs:"Remove unnecessary quotes from object property keys",recommended:!0},check(b,y){let s=[],l=b.split(/\r?\n/);for(let n=0;n<l.length;n++){let i=l[n],w=i.trim();if(!w||w.startsWith("//")||w.startsWith("*")||w.startsWith("/*"))continue;let a=i.match(jn);if(a){let I=a[3];if(["class","return","function","var","let","const","delete","typeof","void","in","instanceof","new","this","throw","try","catch","finally","switch","case","default","break","continue","do","while","for","if","else","with","import","export","extends","super","yield","await","enum","implements","interface","package","private","protected","public","static"].includes(I))continue;s.push({filePath:y.filePath,line:n+1,column:i.indexOf(a[2])+1,ruleId:"style/quote-props",message:`Unnecessarily quoted property '${I}'`,severity:"warning",help:"Remove quotes from this property key."})}}return s},fix(b){let y=b.split(/\r?\n/),s=[],l=new Set(["class","return","function","var","let","const","delete","typeof","void","in","instanceof","new","this","throw","try","catch","finally","switch","case","default","break","continue","do","while","for","if","else","with","import","export","extends","super","yield","await","enum","implements","interface","package","private","protected","public","static"]);for(let n of y){let i=n,w=n.match(jn);if(w&&!l.has(w[3]))i=n.replace(jn,"$1$3:");s.push(i)}return s.join(`
78
+ `)}};function ec(b,y){let s=b.slice(0,y);if(s.includes("//"))return!0;let l=(s.match(/'/g)||[]).length,n=(s.match(/"/g)||[]).length,i=(s.match(/`/g)||[]).length;return l%2===1||n%2===1||i%2===1}var dr=/\.\.\.\s+([a-zA-Z_$])/g,hr={meta:{docs:"Disallow space after spread/rest operator (...)",recommended:!0},check(b,y){let s=[],l=b.split(/\r?\n/);for(let n=0;n<l.length;n++){let i=l[n],w=i.trim();if(!w||w.startsWith("//")||w.startsWith("*")||w.startsWith("/*"))continue;let a;dr.lastIndex=0;while((a=dr.exec(i))!==null){if(ec(i,a.index))continue;s.push({filePath:y.filePath,line:n+1,column:a.index+4,ruleId:"style/rest-spread-spacing",message:"Unexpected space after spread operator",severity:"warning"})}}return s},fix(b){return b.replace(/\.\.\.\s+([a-zA-Z_$\[{])/g,"...$1")}};function tc(b,y){let s=b.slice(0,y);if(s.includes("//"))return!0;let l=(s.match(/'/g)||[]).length,n=(s.match(/"/g)||[]).length,i=(s.match(/`/g)||[]).length;return l%2===1||n%2===1||i%2===1}var gr={meta:{docs:"Disallow space before semicolons, require space after",recommended:!0},check(b,y){let s=[],l=b.split(/\r?\n/);for(let n=0;n<l.length;n++){let i=l[n],w=i.trim();if(!w||w.startsWith("//")||w.startsWith("*")||w.startsWith("/*"))continue;for(let a=0;a<i.length;a++){if(i[a]!==";")continue;if(tc(i,a))continue;if(a>0&&i[a-1]===" "){if(i.slice(0,a).trim().length>0)s.push({filePath:y.filePath,line:n+1,column:a+1,ruleId:"style/semi-spacing",message:"Unexpected space before semicolon",severity:"warning"})}if(a+1<i.length&&i[a+1]!==" "&&i[a+1]!=="\t"&&i[a+1]!==`
79
+ `&&i[a+1]!=="\r"&&i[a+1]!==")"){let I=i.slice(a+1);if(i.slice(0,a).includes(";")||I.includes(";"))s.push({filePath:y.filePath,line:n+1,column:a+2,ruleId:"style/semi-spacing",message:"Missing space after semicolon",severity:"warning"})}}}return s},fix(b){let y=b.split(/\r?\n/),s=[];for(let l of y){let n=l,i=new RegExp(" ;","g");n=n.replace(i,String.fromCharCode(59));let w=new RegExp(";(\\S)","g");n=n.replace(w,(a,I)=>{if(I===";"||I===")")return a;return`; ${I}`}),s.push(n)}return s.join(`
80
+ `)}};var br=/(\S)\{/g;function nc(b,y){let s=b.slice(0,y);if(s.includes("//"))return!0;let l=(s.match(/'/g)||[]).length,n=(s.match(/"/g)||[]).length,i=(s.match(/`/g)||[]).length;return l%2===1||n%2===1||i%2===1}var yr={meta:{docs:"Require space before opening brace of blocks",recommended:!0},check(b,y){let s=[],l=b.split(/\r?\n/);for(let n=0;n<l.length;n++){let i=l[n],w=i.trim();if(!w||w.startsWith("//")||w.startsWith("*")||w.startsWith("/*"))continue;let a;br.lastIndex=0;while((a=br.exec(i))!==null){let I=a.index,P=a[1];if(nc(i,I))continue;if(P==="$")continue;if(P==="="||P===":"||P==="("||P===","||P==="[")continue;if(P==="{")continue;if(P===")"||/[a-zA-Z0-9_]/.test(P))s.push({filePath:y.filePath,line:n+1,column:a.index+2,ruleId:"style/space-before-blocks",message:"Missing space before '{'",severity:"warning"})}}return s},fix(b){let y=b.split(/\r?\n/),s=[];for(let l of y){let n=l.replace(/([)a-zA-Z0-9_])\{/g,"$1 {");s.push(n)}return s.join(`
81
+ `)}};var xr=/\bfunction\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s+\(/g,Rr=/\bfunction\(/g;function wr(b,y){let s=b.slice(0,y);if(s.includes("//"))return!0;let l=(s.match(/'/g)||[]).length,n=(s.match(/"/g)||[]).length,i=(s.match(/`/g)||[]).length;return l%2===1||n%2===1||i%2===1}var kr={meta:{docs:"Control spacing before ( in function declarations",recommended:!0},check(b,y){let s=[],l=b.split(/\r?\n/);for(let n=0;n<l.length;n++){let i=l[n],w=i.trim();if(!w||w.startsWith("//")||w.startsWith("*")||w.startsWith("/*"))continue;let a;xr.lastIndex=0;while((a=xr.exec(i))!==null){if(wr(i,a.index))continue;s.push({filePath:y.filePath,line:n+1,column:a.index+a[0].length,ruleId:"style/space-before-function-paren",message:"Unexpected space before function parentheses",severity:"warning"})}Rr.lastIndex=0;while((a=Rr.exec(i))!==null){if(wr(i,a.index))continue;if(i.slice(0,a.index+8).match(/function\s+[a-zA-Z_$]/))continue;s.push({filePath:y.filePath,line:n+1,column:a.index+9,ruleId:"style/space-before-function-paren",message:"Missing space before function parentheses",severity:"warning"})}}return s},fix(b){let y=b;return y=y.replace(/\bfunction\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s+\(/g,"function $1("),y=y.replace(/\bfunction\(/g,"function ("),y}};function Ir(b,y){let s=b.slice(0,y);if(s.includes("//"))return!0;let l=(s.match(/'/g)||[]).length,n=(s.match(/"/g)||[]).length,i=(s.match(/`/g)||[]).length;return l%2===1||n%2===1||i%2===1}var Pr={meta:{docs:"Disallow spaces inside parentheses",recommended:!0},check(b,y){let s=[],l=b.split(/\r?\n/);for(let n=0;n<l.length;n++){let i=l[n],w=i.trim();if(!w||w.startsWith("//")||w.startsWith("*")||w.startsWith("/*"))continue;for(let a=0;a<i.length;a++){if(i[a]==="("&&!Ir(i,a)){let I=i[a+1];if(I===")"||I===void 0||I===`
82
+ `)continue;if(I===" ")s.push({filePath:y.filePath,line:n+1,column:a+2,ruleId:"style/space-in-parens",message:"Unexpected space after '('",severity:"warning"})}if(i[a]===")"&&!Ir(i,a)){if(a===0)continue;let I=i[a-1];if(I==="(")continue;if(I===" "){if(i.slice(0,a).includes("("))s.push({filePath:y.filePath,line:n+1,column:a,ruleId:"style/space-in-parens",message:"Unexpected space before ')'",severity:"warning"})}}}}return s},fix(b){let y=b.split(/\r?\n/),s=[];for(let l of y){let n=l;n=n.replace(/\(\s+(\S)/g,"($1"),n=n.replace(/(\S)\s+\)/g,"$1)"),s.push(n)}return s.join(`
83
+ `)}};var Mr=["&&","||","??","+=","-=","*=","/=","%=","**=","<<=",">>=",">>>=","&=","|=","^=","??=","||=","&&="];function sc(b,y){let s=b.slice(0,y);if(s.includes("//"))return!0;let l=(s.match(/'/g)||[]).length,n=(s.match(/"/g)||[]).length,i=(s.match(/`/g)||[]).length;return l%2===1||n%2===1||i%2===1}var vr={meta:{docs:"Require spacing around infix operators (&&, ||, ??, assignment operators)",recommended:!0},check(b,y){let s=[],l=b.split(/\r?\n/);for(let n=0;n<l.length;n++){let i=l[n],w=i.trim();if(!w||w.startsWith("//")||w.startsWith("*")||w.startsWith("/*"))continue;for(let a of Mr){let I=0,P;while((P=i.indexOf(a,I))!==-1){if(I=P+a.length,sc(i,P))continue;if(a==="&&"&&i[P+2]==="=")continue;if(a==="||"&&i[P+2]==="=")continue;if(a==="??"&&i[P+2]==="=")continue;let _=P>0?i[P-1]:" ",D=P+a.length<i.length?i[P+a.length]:" ";if(_!==" "&&_!=="\t")s.push({filePath:y.filePath,line:n+1,column:P+1,ruleId:"style/space-infix-ops",message:`Missing space before '${a}'`,severity:"warning"});if(D!==" "&&D!=="\t"&&D!==`
84
+ `&&D!=="\r")s.push({filePath:y.filePath,line:n+1,column:P+a.length+1,ruleId:"style/space-infix-ops",message:`Missing space after '${a}'`,severity:"warning"})}}}return s},fix(b){let y=b,s=[...Mr].sort((l,n)=>n.length-l.length);for(let l of s){let n=l.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");y=y.replace(new RegExp(`(\\S)${n}`,"g"),`$1 ${l}`),y=y.replace(new RegExp(`${n}(\\S)`,"g"),`${l} $1`)}return y}};var $r=["typeof","void","delete","new","throw","yield","await"];function Un(b,y){let s=b.slice(0,y);if(s.includes("//"))return!0;let l=(s.match(/'/g)||[]).length,n=(s.match(/"/g)||[]).length,i=(s.match(/`/g)||[]).length;return l%2===1||n%2===1||i%2===1}var Cr={meta:{docs:"Require space after word unary operators, disallow space after symbol unary operators",recommended:!0},check(b,y){let s=[],l=b.split(/\r?\n/);for(let n=0;n<l.length;n++){let i=l[n],w=i.trim();if(!w||w.startsWith("//")||w.startsWith("*")||w.startsWith("/*"))continue;for(let _ of $r){let D=new RegExp(`\\b${_}([^\\s;,)])`,"g"),j;while((j=D.exec(i))!==null){if(Un(i,j.index))continue;s.push({filePath:y.filePath,line:n+1,column:j.index+_.length+1,ruleId:"style/space-unary-ops",message:`Missing space after '${_}'`,severity:"warning"})}}let a=/!\s+([a-zA-Z_$({[])/g,I;while((I=a.exec(i))!==null){if(Un(i,I.index))continue;let _=i.slice(0,I.index),D=_.trimEnd().slice(-1),j=new RegExp("[=(<[{,;|&?:+\\-*/!~^%]");if(!D||j.test(D)||_.trimEnd().endsWith("return")||_.trimEnd().endsWith("case"))s.push({filePath:y.filePath,line:n+1,column:I.index+2,ruleId:"style/space-unary-ops",message:"Unexpected space after '!'",severity:"warning"})}let P=/~\s+([a-zA-Z_$({[])/g;while((I=P.exec(i))!==null){if(Un(i,I.index))continue;s.push({filePath:y.filePath,line:n+1,column:I.index+2,ruleId:"style/space-unary-ops",message:"Unexpected space after '~'",severity:"warning"})}}return s},fix(b){let y=b;for(let s of $r)y=y.replace(new RegExp(`\\b${s}([^\\s;,)])`,"g"),`${s} $1`);return y=y.replace(/!\s+([a-zA-Z_$({[])/g,"!$1"),y=y.replace(/~\s+([a-zA-Z_$({[])/g,"~$1"),y}};var Lr={meta:{docs:"Require space after // and /* in comments",recommended:!0},check(b,y){let s=[],l=b.split(/\r?\n/);for(let n=0;n<l.length;n++){let i=l[n],w=i.trim(),a=i.indexOf("//");if(a!==-1){let P=i.slice(0,a),_=(P.match(/'/g)||[]).length,D=(P.match(/"/g)||[]).length,j=(P.match(/`/g)||[]).length;if(_%2===0&&D%2===0&&j%2===0){if(!P.match(/https?:$/)){let B=i.slice(a+2);if(B.length>0&&B[0]!==" "&&B[0]!=="\t"&&B[0]!=="/"&&B[0]!=="!")s.push({filePath:y.filePath,line:n+1,column:a+3,ruleId:"style/spaced-comment",message:"Missing space after '//'",severity:"warning",help:"Add a space after // in comments."})}}}let I=i.indexOf("/*");if(I!==-1&&i[I+2]!=="*"&&i[I+2]!=="!"){let P=i.slice(0,I),_=(P.match(/'/g)||[]).length,D=(P.match(/"/g)||[]).length,j=(P.match(/`/g)||[]).length;if(_%2===0&&D%2===0&&j%2===0){let B=i.slice(I+2);if(B.length>0&&B[0]!==" "&&B[0]!=="\t"&&B[0]!==`
85
+ `)s.push({filePath:y.filePath,line:n+1,column:I+3,ruleId:"style/spaced-comment",message:"Missing space after '/*'",severity:"warning",help:"Add a space after /* in comments."})}}}return s},fix(b){let y=b.split(/\r?\n/),s=[];for(let l of y){let n=l;n=n.replace(/(\/\/)([^\s/!])/,"$1 $2"),n=n.replace(/(\/\*)([^\s*!])/,"$1 $2"),s.push(n)}return s.join(`
86
+ `)}};var Sr=/^\s*(case\b.+?|default)\s*:/,Er={meta:{docs:"Enforce spacing around colon in switch case/default clauses",recommended:!0},check(b,y){let s=[],l=b.split(/\r?\n/);for(let n=0;n<l.length;n++){let i=l[n],w=i.trim();if(!w)continue;let a=w.match(Sr);if(!a)continue;let I=a[1],P=i.indexOf(":",i.indexOf(I)+I.length);if(P===-1)continue;if(P>0&&i[P-1]===" ")s.push({filePath:y.filePath,line:n+1,column:P+1,ruleId:"style/switch-colon-spacing",message:"Unexpected space before colon in switch case",severity:"warning"});if(P+1<i.length&&i[P+1]!==" "&&i[P+1]!=="\t"&&i[P+1]!==`
87
+ `)s.push({filePath:y.filePath,line:n+1,column:P+2,ruleId:"style/switch-colon-spacing",message:"Missing space after colon in switch case",severity:"warning"})}return s},fix(b){let y=b.split(/\r?\n/),s=[];for(let l of y){let n=l,i=l.trim();if(Sr.test(i))n=n.replace(/(case\b.+?|default)\s+:/,"$1:"),n=n.replace(/(case\b.+?:|default:)(\S)/,"$1 $2");s.push(n)}return s.join(`
88
+ `)}};var Ar="${",Or={meta:{docs:"Disallow spaces inside template literal interpolation curly braces",recommended:!0},check(b,y){let s=[],l=b.split(/\r?\n/);for(let n=0;n<l.length;n++){let i=l[n];for(let w=i.indexOf(Ar,0);w!==-1;w=i.indexOf(Ar,w)){let a=w+2;if(a<i.length&&(i[a]===" "||i[a]==="\t")){if((i.slice(0,w).match(/`/g)||[]).length%2===1)s.push({filePath:y.filePath,line:n+1,column:a+1,ruleId:"style/template-curly-spacing",message:"Unexpected space after '${'",severity:"warning"})}let I=1,P=a;while(P<i.length&&I>0){if(i[P]==="{")I++;if(i[P]==="}")I--;if(I>0)P++}if(I===0&&P>0){let _=i[P-1];if(_===" "||_==="\t"){if((i.slice(0,w).match(/`/g)||[]).length%2===1)s.push({filePath:y.filePath,line:n+1,column:P,ruleId:"style/template-curly-spacing",message:"Unexpected space before '}'",severity:"warning"})}}w=a}}return s},fix(b){return b.replace(/\$\{\s+([^}]*?)\s+\}/g,"${$1}")}};var He=/([a-zA-Z_$][a-zA-Z0-9_$]*)\s+`/g;function _r(b,y){let s=b.slice(0,y);if(s.includes("//"))return!0;let l=(s.match(/'/g)||[]).length,n=(s.match(/"/g)||[]).length,i=(s.match(/`/g)||[]).length;return l%2===1||n%2===1||i%2===1}var Tr=new Set(["return","case","typeof","void","delete","throw","new","in","of","await","yield","export","default","extends","else","instanceof"]),Wr={meta:{docs:"Disallow space between tag function and template literal",recommended:!0},check(b,y){let s=[],l=b.split(/\r?\n/);for(let n=0;n<l.length;n++){let i=l[n],w=i.trim();if(!w||w.startsWith("//")||w.startsWith("*")||w.startsWith("/*"))continue;let a;He.lastIndex=0;for(a=He.exec(i);a!==null;a=He.exec(i)){let I=a[1],P=a.index;if(_r(i,P))continue;if(Tr.has(I))continue;let _=P+I.length;s.push({filePath:y.filePath,line:n+1,column:_+1,ruleId:"style/template-tag-spacing",message:"Unexpected space between tag function and template literal",severity:"warning"})}}return s},fix(b,y){let s=b.split(/\r?\n/),l=[];for(let n=0;n<s.length;n++){let i=s[n],w=i.trim();if(!w||w.startsWith("//")||w.startsWith("*")||w.startsWith("/*")){l.push(i);continue}let a=i,I=[],P;He.lastIndex=0;for(P=He.exec(i);P!==null;P=He.exec(i)){let _=P[1],D=P.index;if(_r(i,D))continue;if(Tr.has(_))continue;I.push({index:D,fullMatch:P[0],identifier:_})}for(let _=I.length-1;_>=0;_--){let D=I[_],j=D.index,B=j+D.fullMatch.length;a=`${a.slice(0,j)}${D.identifier}\`${a.slice(B)}`}l.push(a)}return l.join(`
89
+ `)}};var Nr={meta:{docs:"Require parentheses around immediately invoked function expressions (IIFEs)",recommended:!0},check(b,y){let s=[],l=/[^a-zA-Z_$](function\s*\([^)]*\)\s*\{[^}]*\})\s*\(/g,n;for(n=l.exec(b);n!==null;n=l.exec(b)){if(n.index>0&&b[n.index]==="(")continue;let i=b.slice(0,n.index).split(`
90
+ `).length,w=b.lastIndexOf(`
91
+ `,n.index),a=n.index-w;s.push({filePath:y.filePath,line:i,column:a,ruleId:"style/wrap-iife",message:"Wrap immediately invoked function expressions in parentheses",severity:"warning"})}return s},fix(b){return b.replace(/([^a-zA-Z_$(\n])(function\s*\([^)]*\)\s*\{[^}]*\})\s*\(/g,"$1($2)(")}};var Dr=/\byield\s*\*/g;function ic(b,y){let s=b.slice(0,y);if(s.includes("//"))return!0;let l=(s.match(/'/g)||[]).length,n=(s.match(/"/g)||[]).length,i=(s.match(/`/g)||[]).length;return l%2===1||n%2===1||i%2===1}var jr={meta:{docs:"Enforce spacing around * in yield* expressions (no space before *, space after)",recommended:!0},check(b,y){let s=[],l=b.split(/\r?\n/);for(let n=0;n<l.length;n++){let i=l[n],w=i.trim();if(!w||w.startsWith("//")||w.startsWith("*")||w.startsWith("/*"))continue;let a;Dr.lastIndex=0;while((a=Dr.exec(i))!==null){let I=a.index;if(ic(i,I))continue;let P=a[0],_=I+P.length-1,D=_+1;if(P!=="yield*")s.push({filePath:y.filePath,line:n+1,column:_+1,ruleId:"style/yield-star-spacing",message:"Unexpected space before * in yield expression",severity:"warning"});if(D<i.length&&i[D]!==" "&&i[D]!=="\t"&&i[D]!==`
92
+ `)s.push({filePath:y.filePath,line:n+1,column:D+1,ruleId:"style/yield-star-spacing",message:"Missing space after * in yield expression",severity:"warning"})}}return s},fix(b,y){let s=b;return s=s.replace(/\byield\s+\*/g,"yield*"),s=s.replace(/\byield\*(\S)/g,"yield* $1"),s}};var Ur={name:"style",rules:{"brace-style":e(si),curly:e(hi),"max-statements-per-line":e(_i),"if-newline":e(vi),"consistent-chaining":e(ui),"consistent-list-newline":e(di),"indent-unindent":e($i),"no-multi-spaces":k(sr),"no-multiple-empty-lines":k(ir),"no-trailing-spaces":k(or),"keyword-spacing":e(Ei),"arrow-spacing":e(ti),"space-infix-ops":e(vr),"object-curly-spacing":e(cr),"spaced-comment":e(Lr),"block-spacing":e(ni),"space-before-blocks":e(yr),"comma-spacing":e(li),"semi-spacing":e(gr),"rest-spread-spacing":e(hr),"generator-star-spacing":e(Mi),"yield-star-spacing":e(jr),"function-call-spacing":e(ki),"template-tag-spacing":e(Wr),"no-whitespace-before-property":e(zi),"key-spacing":e(Li),"computed-property-spacing":e(ai),"array-bracket-spacing":e(Xs),"space-in-parens":e(Pr),"template-curly-spacing":e(Or),"space-unary-ops":e(Cr),"switch-colon-spacing":e(Er),"comma-dangle":e(oi),"arrow-parens":e(Qs),"space-before-function-paren":e(kr),"quote-props":e(pr),"no-floating-decimal":e(tr),"new-parens":e(ji),"no-extra-parens":e(Fi),"wrap-iife":e(Nr),"comma-style":e(ci),"dot-location":e(gi),"operator-linebreak":e(fr),"multiline-ternary":e(Ni),"padded-blocks":e(mr),"lines-between-class-members":e(Oi),"no-mixed-operators":e(Xi),"indent-binary-ops":e(xi),"no-tabs":e(rr),"no-mixed-spaces-and-tabs":e(nr)}};var Fr={meta:{docs:"Enforce consistent member delimiter style in interfaces and type literals",recommended:!0},check(b,y){let s=[],l=b.split(/\r?\n/),n=!1,i=0,w=0;for(let a=0;a<l.length;a++){let I=l[a],P=I.trim();if(!P||P.startsWith("//")||P.startsWith("*")||P.startsWith("/*"))continue;if(P.match(/\b(interface|type)\b.*\{/))n=!0,w=i+1;for(let _ of P){if(_==="{")i++;if(_==="}")i--}if(n&&i<w){n=!1;continue}if(!n||i!==w)continue;if(P==="}"||P==="};"||P==="},")continue;if(P.endsWith(",")){if(P.startsWith("|")||P.startsWith("&"))continue;s.push({filePath:y.filePath,line:a+1,column:I.length,ruleId:"ts/member-delimiter-style",message:"Expected semicolon delimiter in interface, found comma",severity:"warning"})}if(!P.endsWith(";")&&!P.endsWith(",")&&!P.endsWith("{")&&!P.endsWith("(")){if(P.match(/^\w+[\s?]*:/)||P.match(/^\[/)||P.match(/^readonly\b/))s.push({filePath:y.filePath,line:a+1,column:I.length+1,ruleId:"ts/member-delimiter-style",message:"Missing semicolon delimiter in interface member",severity:"warning"})}}return s},fix(b){let y=b.split(/\r?\n/),s=[],l=!1,n=0,i=0;for(let w=0;w<y.length;w++){let a=y[w],I=a.trim();if(I.match(/\b(interface|type)\b.*\{/))l=!0,i=n+1;let P=n;for(let _ of I){if(_==="{")n++;if(_==="}")n--}if(l&&n<i){l=!1,s.push(a);continue}if(l&&P===i&&I!=="}"&&I!=="};"&&I!=="},"){let _=a;if(I.endsWith(","))_=a.replace(/,\s*$/,";");s.push(_);continue}s.push(a)}return s.join(`
93
+ `)}};var Br={meta:{docs:"Disallow the use of the `any` type - it defeats the purpose of TypeScript type safety"},check:(b,y)=>{let s=[];if(!/\.tsx?$/.test(y.filePath))return s;let l=b.split(/\r?\n/),n=!1;for(let i=0;i<l.length;i++){let w=l[i],a=w;if(n){let B=w.indexOf("*/");if(B>=0)w=w.slice(B+2),n=!1;else continue}let I=w.indexOf("/*"),P=w.indexOf("//");if(I>=0&&(P===-1||I<P)){let B=w.indexOf("*/",I+2);if(B>=0)w=w.slice(0,I)+w.slice(B+2);else n=!0,w=w.slice(0,I)}if(P>=0)w=w.slice(0,P);let _=w.replace(/(['"`])(?:(?!\1)[^\\]|\\.)*?\1/g,'""'),D=/\b(any)\b/g,j;while((j=D.exec(_))!==null){let B=j.index,Z=_[B-1]||" ",z=_[B+3]||" ",Y=_.slice(Math.max(0,B-10),B),X=_.slice(B+3,Math.min(_.length,B+10));if(/\w/.test(Z)||/\w/.test(z))continue;if(/:/.test(Y)||/</.test(Y)||/\bas\s*$/.test(Y)||/,/.test(Y)||/\|/.test(Y)||/&/.test(Y)||/\[/.test(X)||/>/.test(X)||/,/.test(X)||/\|/.test(X)||/extends\s+$/.test(Y)||/=\s*$/.test(Y)){let ne=a.indexOf("any",Math.max(0,B-5));s.push({filePath:y.filePath,line:i+1,column:ne>=0?ne+1:B+1,ruleId:"ts/no-explicit-any",message:"Unexpected `any` type. Specify a more precise type or use `unknown` if the type is truly unknown.",severity:"error",help:"Replace `any` with a specific type, `unknown`, or a generic type parameter"})}}}return s},fix:(b)=>{let y=b.split(/\r?\n/),s=[];for(let l of y){let n=l;n=n.replace(/:\s*any\b(?!\s*\))/g,(i)=>i.replace("any","unknown")),s.push(n)}return s.join(`
94
+ `)}};var qr={meta:{docs:"Require promises to be handled - must be awaited, returned, or have .catch() called"},check:(b,y)=>{let s=[];if(!/\.tsx?$/.test(y.filePath))return s;let l=b.split(/\r?\n/),n=!1;for(let i=0;i<l.length;i++){let w=l[i],a=w;if(n){let j=w.indexOf("*/");if(j>=0)w=w.slice(j+2),n=!1;else continue}let I=w.indexOf("/*"),P=w.indexOf("//");if(I>=0&&(P===-1||I<P)){let j=w.indexOf("*/",I+2);if(j>=0)w=w.slice(0,I)+w.slice(j+2);else n=!0,w=w.slice(0,I)}if(P>=0)w=w.slice(0,P);let _=w.replace(/(['"`])(?:(?!\1)[^\\]|\\.)*?\1/g,'""');if(/\b(?:await|return|void)\s/.test(_))continue;if(/\.(?:then|catch|finally)\s*\(/.test(_))continue;let D=[/\b(fetch|axios|request)\s*\(/,/\b[\w$]*(?:async|Async|load|Load|get|Get|post|Post|put|Put|delete|Delete|save|Save|update|Update|fetch|Fetch)[\w$]*\s*\(/,/\bnew\s+Promise\s*\(/,/\bPromise\s*\.\s*(?:resolve|reject|all|allSettled|race|any)\s*\(/];for(let j of D){let B=_.match(j);if(!B)continue;let Z=_.indexOf(B[0]),z=_.slice(0,Z).trim();if(/\b(?:const|let|var)\s+[\w$]+\s*=\s*$/.test(z))continue;if(/[\w$]+\s*=\s*$/.test(z))continue;if(/\breturn\s+$/.test(z))continue;if(/\(\s*$/.test(z)||/,\s*$/.test(z))continue;let Y=_.slice(Z+B[0].length),X=1,J=B[0].length;while(J<Y.length&&X>0){if(Y[J]==="(")X++;else if(Y[J]===")")X--;J++}let ne=Y.slice(J).trim();if(/^\.(?:then|catch|finally)\s*\(/.test(ne))continue;if(ne===""||ne.startsWith(";")){let Q=a.indexOf(B[0]);s.push({filePath:y.filePath,line:i+1,column:Q>=0?Q+1:Z+1,ruleId:"ts/no-floating-promises",message:"Promise returned by this call is not handled. Add await, return, .catch(), or void.",severity:"error",help:"Either await the promise, return it, add .catch() to handle errors, or use void to explicitly mark as fire-and-forget"});break}}}return s}};var zr={meta:{docs:"Disallow promises in places not designed to handle them (conditionals, logical expressions)"},check:(b,y)=>{let s=[];if(!/\.tsx?$/.test(y.filePath))return s;let l=b.split(/\r?\n/),n=!1;for(let i=0;i<l.length;i++){let w=l[i],a=w;if(n){let Y=w.indexOf("*/");if(Y>=0)w=w.slice(Y+2),n=!1;else continue}let I=w.indexOf("/*"),P=w.indexOf("//");if(I>=0&&(P===-1||I<P)){let Y=w.indexOf("*/",I+2);if(Y>=0)w=w.slice(0,I)+w.slice(Y+2);else n=!0,w=w.slice(0,I)}if(P>=0)w=w.slice(0,P);let _=w.replace(/(['"`])(?:(?!\1)[^\\]|\\.)*?\1/g,'""'),D=_.match(/\bif\s*\(\s*(!?)\s*([\w$]+\s*\([^)]*\))/);if(D){let Y=D[1],X=D[2];if(/async|Async|fetch|Fetch|load|Load|get|Get|save|Save/.test(X)){let J=_.slice(0,_.indexOf(D[0])),ne=_.slice(_.indexOf("if (")+4);if(!/\bawait\s/.test(ne)){let Q=a.indexOf(X);s.push({filePath:y.filePath,line:i+1,column:Q>=0?Q+1:1,ruleId:"ts/no-misused-promises",message:"Promise used in conditional expression without await. Promises are always truthy.",severity:"error",help:"Add await before the async call in the condition"})}}}let j=/(?:async|Async|fetch|Fetch|load|Load|get|Get|save|Save|Promise\.)[\w$]*\s*\([^)]*\)/g,B;while((B=j.exec(_))!==null){let Y=B.index,X=B[0],J=_.slice(Math.max(0,Y-10),Y),ne=_.slice(Y+X.length,Math.min(_.length,Y+X.length+10));if(/(?:&&|\|\|)\s*$/.test(J)||/^\s*(?:&&|\|\|)/.test(ne)){if(!/\bawait\s*$/.test(J)){let ee=a.indexOf(X,Math.max(0,Y-5));s.push({filePath:y.filePath,line:i+1,column:ee>=0?ee+1:Y+1,ruleId:"ts/no-misused-promises",message:"Promise used in logical expression without await. This will not work as expected.",severity:"error",help:"Add await before the async call or restructure the logic"})}}let Q=_.slice(Math.max(0,Y-20),Y);if(/\?\s*$/.test(J)||/\?[^:]*$/.test(Q)){if(!/\bawait\s*$/.test(J)){let ee=a.indexOf(X,Math.max(0,Y-5));s.push({filePath:y.filePath,line:i+1,column:ee>=0?ee+1:Y+1,ruleId:"ts/no-misused-promises",message:"Promise used in ternary expression without await.",severity:"error",help:"Add await before the async call"})}}}let Z=_.match(/\b(?:while|for)\s*\([^)]*(?:async|Async|fetch|Fetch|load|Load|get|Get)[\w$]*\s*\([^)]*\)/);if(Z){if(!/\bawait\s/.test(Z[0])){let Y=a.indexOf(Z[0]);s.push({filePath:y.filePath,line:i+1,column:Y>=0?Y+1:1,ruleId:"ts/no-misused-promises",message:"Promise used in loop condition without await. This will cause unexpected behavior.",severity:"error",help:"Add await before the async call in the loop condition"})}}let z=_.match(/\.(forEach|map|filter|reduce|every|some|find|findIndex)\s*\(\s*async\s*(?:\(|[\w$]+\s*=>)/);if(z){if(z[1]==="forEach"){let X=a.indexOf(z[0]);s.push({filePath:y.filePath,line:i+1,column:X>=0?X+1:1,ruleId:"ts/no-misused-promises",message:"async callback in forEach - forEach does not wait for promises to resolve.",severity:"error",help:"Use for...of loop with await, or Promise.all() with map()"})}}}return s}};var Zr={meta:{docs:"Disallow require() in TypeScript files; prefer ESM imports"},check:(b,y)=>{let s=[];if(!/\.ts$/.test(y.filePath))return s;let l=b.split(/\r?\n/),n=!1;for(let i=0;i<l.length;i++){let w=l[i],a=w;if(n){let j=a.indexOf("*/");if(j>=0)a=a.slice(j+2),n=!1;else continue}let I=a.indexOf("/*"),P=a.indexOf("//");if(I>=0&&(P===-1||I<P)){let j=a.indexOf("*/",I+2);if(j>=0)a=a.slice(0,I)+a.slice(j+2);else n=!0,a=a.slice(0,I)}if(P>=0)a=a.slice(0,P);let _=a.trim();if(!_)continue;if(/\bimport\s*\(/.test(_))continue;let D=_.indexOf("require(");if(D>=0){s.push({filePath:y.filePath,line:i+1,column:w.indexOf("require(")+1||D+1,ruleId:"ts/no-require-imports",message:"Do not use require() in TypeScript files. Use ESM import syntax instead.",severity:"error"});continue}if(/^import\s+(?:\S.*|[\t\v\f \xA0\u1680\u2000-\u200A\u202F\u205F\u3000\uFEFF])=\s*require\s*\(/.test(_)){let j=w.indexOf("require(");s.push({filePath:y.filePath,line:i+1,column:j>-1?j+1:1,ruleId:"ts/no-require-imports",message:"Do not use require() in TypeScript files. Use ESM import syntax instead.",severity:"error"})}}return s}};var Gr={meta:{docs:"Disallow top-level await in TypeScript/JavaScript files"},check:(b,y)=>{let s=[],l=y.filePath.split(".").pop()||"";if(!["ts","tsx","mts","cts","js","mjs","cjs"].includes(l))return s;let n=c(b),i=0,w=0,a=1;for(let I=0;I<n.length;I++){let P=n[I];if(w++,P===`
95
+ `){a++,w=0;continue}if(P==="{"){i++;continue}if(P==="}"){if(i>0)i--;continue}if(P==="a"&&n.slice(I,I+5)==="await"){let _=n.slice(Math.max(0,I-6),I),D=/for\s+$/.test(_),j=I===0||/[^$\w]/.test(n[I-1]),B=/[^$\w]/.test(n[I+5]||" ");if(!D&&j&&B&&i===0)s.push({filePath:y.filePath,line:a,column:w,ruleId:"ts/no-top-level-await",message:"Do not use top-level await",severity:"error"});I+=4,w+=4}}return s}};var Vr={meta:{docs:"Disallow `exports =` in TypeScript; prefer ESM export default"},check:(b,y)=>{let s=[],l=y.filePath.split(".").pop()||"";if(!["ts","tsx","mts","cts","d.ts"].includes(l))return s;let n=b.split(/\r?\n/);for(let i=0;i<n.length;i++){let I=n[i].replace(/\/\*.*?\*\//g,"").replace(/\/\/.*$/,"").match(/\bexports\s*=\s*/);if(I)s.push({filePath:y.filePath,line:i+1,column:(I.index||0)+1,ruleId:"ts/no-ts-export-equal",message:"Use ESM `export default` instead of `exports =`",severity:"error"})}return s}};var Kr={meta:{docs:"Disallow assignment of `any` typed values to variables - unsafe assignments bypass type checking"},check:(b,y)=>{let s=[];if(!/\.tsx?$/.test(y.filePath))return s;let l=b.split(/\r?\n/),n=!1;for(let i=0;i<l.length;i++){let w=l[i],a=w;if(n){let J=w.indexOf("*/");if(J>=0)w=w.slice(J+2),n=!1;else continue}let I=w.indexOf("/*"),P=w.indexOf("//");if(I>=0&&(P===-1||I<P)){let J=w.indexOf("*/",I+2);if(J>=0)w=w.slice(0,I)+w.slice(J+2);else n=!0,w=w.slice(0,I)}if(P>=0)w=w.slice(0,P);let _=w.replace(/(['"`])(?:(?!\1)[^\\]|\\.)*?\1/g,'""'),D=/(\w+)\s+as\s+any/g,j;while((j=D.exec(_))!==null){let J=j[1],ne=j.index,Q=_.slice(ne+j[0].length).trim(),ee=_.slice(0,ne).trim();if(/=\s*$/.test(ee)&&!/==|===|!=|!==/.test(ee)){let ie=a.indexOf(j[0]);s.push({filePath:y.filePath,line:i+1,column:ie>=0?ie+1:ne+1,ruleId:"ts/no-unsafe-assignment",message:"Unsafe assignment: value cast to `any` is being assigned. This bypasses type checking.",severity:"error",help:"Avoid casting to `any` or use a more specific type"})}}let B=["JSON.parse","eval","Function","require"];for(let J of B){let ne=new RegExp(`\\b${J.replace(".","\\.")}\\s*\\(`,"g");ne.lastIndex=0;while((j=ne.exec(_))!==null){let Q=j.index,ee=_.slice(0,Q).trim(),ie=ee.match(/(?:const|let|var)\s+([\w$]+)\s*=\s*$/);if(ie){let se=ie[1];if(!new RegExp(`\\b${se}\\s*:\\s*\\w+`).test(_)){let re=a.indexOf(j[0]);s.push({filePath:y.filePath,line:i+1,column:re>=0?re+1:Q+1,ruleId:"ts/no-unsafe-assignment",message:`Unsafe assignment from ${J}() without type annotation. This function returns 'any'.`,severity:"error",help:`Add a type annotation to ${se} or use a type assertion with a specific type`})}}let ye=ee.match(/([\w$.]+)\s*=\s*$/),we=/(?:const|let|var)\s+/.test(ee);if(ye&&!ie&&!we){let se=a.indexOf(j[0]);s.push({filePath:y.filePath,line:i+1,column:se>=0?se+1:Q+1,ruleId:"ts/no-unsafe-assignment",message:`Unsafe assignment from ${J}() which returns 'any'.`,severity:"error",help:"Consider adding a type assertion with a specific type"})}}}let Z=/(?:const|let|var)\s+([\w$]+)\s*:\s*any\s*=/,z=_.match(Z);if(z){let J=z[1],ne=a.indexOf(z[0]);s.push({filePath:y.filePath,line:i+1,column:ne>=0?ne+1:1,ruleId:"ts/no-unsafe-assignment",message:`Variable '${J}' is explicitly typed as 'any'. This defeats TypeScript's type safety.`,severity:"error",help:"Use a more specific type or `unknown` instead of `any`"})}let Y=/(?:const|let|var)\s+(?:\{[^}]+\}|\[[^\]]+\])\s*=\s*([\w$]+)/,X=_.match(Y);if(X){let J=X[1];if(/^(?:params|query|body|req|res|response|data|result)$/.test(J));}}return s}};var Hr={meta:{docs:"Prefer nullish coalescing operator (??) over logical OR (||) when checking for null/undefined"},check:(b,y)=>{let s=[];if(!/\.tsx?$/.test(y.filePath))return s;let l=b.split(/\r?\n/),n=!1;for(let i=0;i<l.length;i++){let w=l[i],a=w.split(""),I=a.length,P=0;if(n){let Z=w.indexOf("*/");if(Z<0)continue;for(let z=0;z<=Z+1;z++)a[z]=" ";n=!1,P=Z+2}let _=null;for(;P<I;P++){let Z=a[P];if(_){if(Z==="\\"){if(a[P]=" ",P+1<I)a[P+1]=" ",P++;continue}if(Z===_){_=null;continue}a[P]=" ";continue}if(Z==="/"&&a[P+1]==="/"){for(let z=P;z<I;z++)a[z]=" ";break}if(Z==="/"&&a[P+1]==="*"){let z=w.indexOf("*/",P+2);if(z<0){for(let Y=P;Y<I;Y++)a[Y]=" ";n=!0;break}for(let Y=P;Y<=z+1;Y++)a[Y]=" ";P=z+1;continue}if(Z==='"'||Z==="'"||Z==="`")_=Z}let D=a.join(""),j=/\|\|/g,B;while((B=j.exec(D))!==null){let Z=B.index,z=Z-1,Y=0,X=0,J=0;while(z>=0){let se=D[z];if(se===")")Y++;else if(se==="("){if(Y===0){z++;break}Y--}else if(se==="}")X++;else if(se==="{"){if(X===0){z++;break}X--}else if(se==="]")J++;else if(se==="["){if(J===0){z++;break}J--}else if(Y===0&&X===0&&J===0){if(new RegExp("[;,=:?]").test(se)){z++;break}if(se==="&"||se==="|"){z++;break}}z--}if(z<0)z=0;let ne=D.slice(z,Z).trim();if(/[<>!=]/.test(ne))continue;if(/\b(?:true|false)\b/.test(ne))continue;let Q=Z+2,ee=Q;Y=0,X=0,J=0;while(ee<D.length){let se=D[ee];if(se==="(")Y++;else if(se===")"){if(Y===0)break;Y--}else if(se==="{")X++;else if(se==="}"){if(X===0)break;X--}else if(se==="[")J++;else if(se==="]"){if(J===0)break;J--}else if(Y===0&&X===0&&J===0){if(new RegExp("[;,?:]").test(se))break;if(se==="&"||se==="|"&&D[ee+1]==="|")break}ee++}let ie=D.slice(Q,ee).trim(),ye=/^["'`\d]/.test(ie)||/^\{/.test(ie)||/^[\w$]+\(/.test(ie)||/^[\w$.[\]]+$/.test(ie),we=/^[\w$]+$/.test(ne)||/^[\w$.?[\]()]+$/.test(ne);if(ye&&we)s.push({filePath:y.filePath,line:i+1,column:Z+1,ruleId:"ts/prefer-nullish-coalescing",message:"Prefer nullish coalescing operator (??) over logical OR (||)",severity:"error",help:'Use `??` instead of `||` to only handle null/undefined, not falsy values like 0, "", or false'})}}return s},fix:(b)=>{let y=b.split(/\r?\n/),s=[];for(let l of y){let n=l,i=new RegExp("(\\b[\\w$.]+)\\s*\\|\\|\\s*([^|&]+?)(?=\\s*[;,)\\]}]|$)","g");n=n.replace(i,(w,a,I)=>{if(/\b(?:true|false)\b/.test(I.trim()))return w;return`${a} ?? ${I}`}),s.push(n)}return s.join(`
96
+ `)}};var Yr={meta:{docs:"Prefer optional chaining (?.) over chained logical AND (&&) for property access"},check:(b,y)=>{let s=[];if(!/\.tsx?$/.test(y.filePath))return s;let l=b.split(/\r?\n/),n=!1;for(let i=0;i<l.length;i++){let w=l[i],a=w;if(n){let z=w.indexOf("*/");if(z>=0)w=w.slice(z+2),n=!1;else continue}let I=w.indexOf("/*"),P=w.indexOf("//");if(I>=0&&(P===-1||I<P)){let z=w.indexOf("*/",I+2);if(z>=0)w=w.slice(0,I)+w.slice(z+2);else n=!0,w=w.slice(0,I)}if(P>=0)w=w.slice(0,P);let _=w.replace(/(['"`])(?:(?!\1)[^\\]|\\.)*?\1/g,'""'),D=/(\b[\w$]+)\s*&&\s*\1\.([\w$]+)/g,j;while((j=D.exec(_))!==null){let z=j[1],Y=j[2],X=j.index,J=a.indexOf(j[0],Math.max(0,X-5));s.push({filePath:y.filePath,line:i+1,column:J>=0?J+1:X+1,ruleId:"ts/prefer-optional-chain",message:`Prefer optional chaining over && for property access: ${z}?.${Y}`,severity:"error",help:`Use \`${z}?.${Y}\` instead of \`${z} && ${z}.${Y}\``})}let B=/([\w$]+\.[\w$.]+)\s*&&\s*\1\.([\w$]+)/g;B.lastIndex=0;while((j=B.exec(_))!==null){let z=j[1],Y=j[2],X=j.index,J=a.indexOf(j[0],Math.max(0,X-5));s.push({filePath:y.filePath,line:i+1,column:J>=0?J+1:X+1,ruleId:"ts/prefer-optional-chain",message:`Prefer optional chaining over && for nested property access: ${z}?.${Y}`,severity:"error",help:`Use \`${z}?.${Y}\` instead of \`${z} && ${z}.${Y}\``})}let Z=_.split(/\s*&&\s*/);if(Z.length>=3)for(let z=0;z<Z.length-2;z++){let Y=Z[z].trim(),X=Z[z+1].trim(),J=Z[z+2].trim();if(X.startsWith(`${Y}.`)&&J.startsWith(`${X}.`)){let ne=a.indexOf(Y);s.push({filePath:y.filePath,line:i+1,column:ne>=0?ne+1:1,ruleId:"ts/prefer-optional-chain",message:"Prefer optional chaining over multiple && checks for nested properties",severity:"error",help:`Use optional chaining like \`${Y}?.${X.slice(Y.length+1)}?.${J.slice(X.length+1)}\``});break}}}return s},fix:(b)=>{let y=b.split(/\r?\n/),s=[];for(let l of y){let n=l;n=n.replace(/(\b[\w$]+)\s*&&\s*\1\.([\w$]+)/g,"$1?.$2"),n=n.replace(/([\w$]+\.[\w$.]+)\s*&&\s*\1\.([\w$]+)/g,"$1?.$2"),s.push(n)}return s.join(`
97
+ `)}};function rc(b,y){let s=b.slice(0,y);if(s.includes("//"))return!0;let l=(s.match(/'/g)||[]).length,n=(s.match(/"/g)||[]).length,i=(s.match(/`/g)||[]).length;return l%2===1||n%2===1||i%2===1}var Xr=/([a-zA-Z_$][a-zA-Z0-9_$]*\??)\s*:\s*([A-Z][a-zA-Z0-9_$<>[\]|&]*|string|number|boolean|null|undefined|void|never|any|unknown|object|symbol|bigint)/g,Jr={meta:{docs:"Require consistent spacing around type annotation colons",recommended:!0},check(b,y){let s=[],l=b.split(/\r?\n/);for(let n=0;n<l.length;n++){let i=l[n],w=i.trim();if(!w||w.startsWith("//")||w.startsWith("*")||w.startsWith("/*"))continue;let a;Xr.lastIndex=0;while((a=Xr.exec(i))!==null){if(rc(i,a.index))continue;let I=a[0],P=I.indexOf(":"),_=a.index+P;if(P>0&&I[P-1]===" "&&!I.startsWith("?")){if(!a[1].endsWith("?")||I[P-1]===" "){if(i[_-1]===" "&&!/\?\s*$/.test(a[1]))s.push({filePath:y.filePath,line:n+1,column:_+1,ruleId:"ts/type-annotation-spacing",message:"Unexpected space before colon in type annotation",severity:"warning"})}}if(_+1<i.length&&i[_+1]!==" "&&i[_+1]!=="\t")s.push({filePath:y.filePath,line:n+1,column:_+2,ruleId:"ts/type-annotation-spacing",message:"Missing space after colon in type annotation",severity:"warning"})}}return s},fix(b){let y=b.split(/\r?\n/),s=[];for(let l of y){let n=l;n=n.replace(/([a-zA-Z_$][a-zA-Z0-9_$]*\??)\s*:\s*([A-Z][a-zA-Z0-9_$<>[\]|&]*|string|number|boolean|null|undefined|void|never|any|unknown|object|symbol|bigint)/g,"$1: $2"),s.push(n)}return s.join(`
98
+ `)}};function Qr(b,y){let s=b.slice(0,y);if(s.includes("//"))return!0;let l=(s.match(/'/g)||[]).length,n=(s.match(/"/g)||[]).length,i=(s.match(/`/g)||[]).length;return l%2===1||n%2===1||i%2===1}var eo=/([A-Za-z_$][A-Za-z0-9_$]*)\s*<(\s+)/g,to=/(\s+)>(?!=)/g,oc=/([A-Za-z_$][A-Za-z0-9_$]*)\s*<\s+/g,lc=/\s+>(?!=)/g,no={meta:{docs:"Disallow spaces inside TypeScript generic angle brackets",recommended:!0},check(b,y){let s=[],l=b.split(/\r?\n/);for(let n=0;n<l.length;n++){let i=l[n],w=i.trim();if(!w||w.startsWith("//")||w.startsWith("*")||w.startsWith("/*"))continue;eo.lastIndex=0;let a;while((a=eo.exec(i))!==null){let I=a.index+a[1].length,P=i.indexOf("<",I);if(P===-1)continue;if(Qr(i,P))continue;s.push({filePath:y.filePath,line:n+1,column:P+2,ruleId:"ts/type-generic-spacing",message:"Unexpected space after '<' in generic type",severity:"warning"})}to.lastIndex=0;while((a=to.exec(i))!==null){let I=a.index+a[1].length;if(Qr(i,I))continue;let P=i.slice(0,I);if(!/[A-Za-z_$][A-Za-z0-9_$]*\s*</.test(P))continue;s.push({filePath:y.filePath,line:n+1,column:I+1,ruleId:"ts/type-generic-spacing",message:"Unexpected space before '>' in generic type",severity:"warning"})}}return s},fix(b,y){let s=b.split(/\r?\n/),l=[];for(let n of s){let i=n.trim();if(!i||i.startsWith("//")||i.startsWith("*")||i.startsWith("/*")){l.push(n);continue}let w=n;if(w=w.replace(oc,(a,I)=>`${I}<`),/[A-Za-z_$][A-Za-z0-9_$]*\s*</.test(w))w=w.replace(lc,">");l.push(w)}return l.join(`
99
+ `)}};function cc(b,y){let s=b.slice(0,y);if(s.includes("//"))return!0;let l=(s.match(/'/g)||[]).length,n=(s.match(/"/g)||[]).length,i=(s.match(/`/g)||[]).length;return l%2===1||n%2===1||i%2===1}var so=/([a-zA-Z_$][a-zA-Z0-9_$?]*):(\S)/g,oo={meta:{docs:"Require space after colon in named tuple members",recommended:!0},check(b,y){let s=[],l=b.split(/\r?\n/);for(let n=0;n<l.length;n++){let i=l[n],w=i.trim();if(!w||w.startsWith("//")||w.startsWith("*")||w.startsWith("/*"))continue;let a=io(i);for(let I of a){so.lastIndex=0;let P;while((P=so.exec(I.text))!==null){let D=I.start+P.index+P[1].length;if(cc(i,D))continue;if(!ro(i))continue;s.push({filePath:y.filePath,line:n+1,column:D+2,ruleId:"ts/type-named-tuple-spacing",message:"Missing space after colon in named tuple member",severity:"warning"})}}}return s},fix(b,y){let s=b.split(/\r?\n/),l=[];for(let n of s){let i=n.trim();if(!i||i.startsWith("//")||i.startsWith("*")||i.startsWith("/*")){l.push(n);continue}if(!ro(n)){l.push(n);continue}let w=n,a=io(n);for(let I=a.length-1;I>=0;I--){let P=a[I],_=P.text.replace(/([a-zA-Z_$][a-zA-Z0-9_$?]*):(\S)/g,"$1: $2");if(_!==P.text)w=w.slice(0,P.start)+_+w.slice(P.start+P.text.length)}l.push(w)}return l.join(`
100
+ `)}};function io(b){let y=[],s=0,l=-1;for(let n=0;n<b.length;n++)if(b[n]==="["){if(s===0)l=n;s++}else if(b[n]==="]"){if(s--,s===0&&l>=0)y.push({start:l,text:b.slice(l,n+1)}),l=-1}return y}function ro(b){let y=b.trim();return/\btype\s/.test(y)||/:\s*\[/.test(y)||/=\s*\[/.test(y)||/\bas\s/.test(y)||/<[^>]*\[/.test(y)||/\bextends\s/.test(y)||/\bimplements\s/.test(y)}var lo={name:"ts",rules:{"no-require-imports":e(Zr),"no-top-level-await":e(Gr),"no-ts-export-equal":e(Vr),"no-explicit-any":e(Br),"prefer-nullish-coalescing":e(Hr),"prefer-optional-chain":e(Yr),"no-floating-promises":e(qr),"no-misused-promises":e(zr),"no-unsafe-assignment":e(Kr),"member-delimiter-style":e(Fr),"type-annotation-spacing":e(Jr),"type-generic-spacing":e(no),"type-named-tuple-spacing":e(oo)}};var co={name:"unused-imports",rules:{"no-unused-vars":e(Be),"no-unused-imports":e(Be)}};var ac={markdown:()=>import.meta.require("./chunk-t4eg5fx5.js").markdownPlugin,shell:()=>import.meta.require("./chunk-513cs23x.js").shellPlugin,spell:()=>import.meta.require("./chunk-q5t3ta01.js").spellPlugin,lockfile:()=>import.meta.require("./chunk-he3fbz3w.js").lockfilePlugin,publint:()=>import.meta.require("./chunk-kn5s3eh8.js").publintPlugin},ao=new Map;function uc(b){let y=ao.get(b);if(!y)y=ac[b](),ao.set(b,y);return y}function fc(b,y,s){let l=()=>uc(b).rules[y],n={get meta(){return l().meta},check:(i,w)=>l().check(i,w)};if(s)n.fix=(i,w)=>l().fix(i,w);return n}function st(b){let y={};for(let[s,l]of Object.entries(fs[b]))y[s]=fc(b,s,l);return{name:b,rules:y}}var uo=null;function Fn(){return uo??=[ts,us,Zs,zs,Ur,Hs,lo,st("markdown"),st("shell"),st("spell"),ds,st("lockfile"),st("publint"),co,hs],[...uo]}var hc=ct("pickier");function ho(){return hc}function Ye(...b){if(r.TRACE)ho().debug("[pickier:trace]",b)}async function mo(b,y,s){let l,n=new Promise((i,w)=>{l=setTimeout(()=>w(Error(`Timeout after ${y}ms at ${s}`)),y)});try{let i=await Promise.race([b,n]);return clearTimeout(l),i}catch(i){throw ho().error(`[pickier:error] ${s} failed:`,i?.message||i),Ye("withTimeout error:",s,i),i}}function go(b){if(b.length===0)return"";let y=new Map;for(let l of b){let n=y.get(l.filePath)||[];n.push(l),y.set(l.filePath,n)}let s="";for(let[l,n]of y){s+=`
101
+ ${t.bold(`\x1B[4m${l}\x1B[24m`)}
102
+ `;let i;try{i=po(l,"utf8")}catch{for(let a of n){let I=a.severity==="error"?t.red("error"):t.yellow("warn ");s+=` ${a.line}:${a.column} ${I} ${a.message} ${t.blue(a.ruleId)}
103
+ `}continue}let w=i.split(/\r?\n/);for(let a of n){let I=a.severity==="error"?t.red("!"):t.yellow("!"),P=t.blue(a.ruleId);s+=`
104
+ ${I} ${P}: ${a.message}
105
+ `;let _=2,D=2,j=Math.max(1,a.line-_),B=Math.min(w.length,a.line+D),z=String(B).length;s+=` ${t.gray(" ,-")}${t.gray(`[:${a.line}:${a.column}]`)}
106
+ `;for(let Y=j;Y<=B;Y++){let X=String(Y).padStart(z),J=w[Y-1]||"";if(Y===a.line)s+=` ${t.gray(X)} ${t.gray("|")} ${t.red(",-> ")}${J}
107
+ `;else if(Y===a.line+1&&D>0)s+=` ${t.gray(X)} ${t.gray("|")} ${t.red("| ")}${J}
108
+ `;else if(Y===a.line+D&&D>1)s+=` ${t.gray(X)} ${t.gray("|")} ${t.red("`-> ")}${J}
109
+ `;else s+=` ${t.gray(X)} ${t.gray("| ")}${J}
110
+ `}if(s+=` ${t.gray(" `----")}
111
+ `,a.help)s+=` ${t.blue("help")}: ${a.help}
112
+ `}}return s}function bo(b){if(b.length===0)return"";let y=new Map;for(let w of b){let a=y.get(w.filePath)||[];a.push(w),y.set(w.filePath,a)}let s=t.red("error"),l=t.yellow("warn "),n=new Map,i="";for(let[w,a]of y){i+=`
113
+ ${t.bold(`\x1B[4m${w}\x1B[24m`)}
114
+ `;for(let I of a){let P=I.severity==="error"?s:l,_=n.get(I.ruleId);if(_===void 0)_=t.blue(I.ruleId),n.set(I.ruleId,_);let j=`${I.line}:${I.column}`.padStart(6),B=60,Z=I.message.padEnd(B);i+=`${j} ${P} ${Z} ${_}
115
+ `}}return i}async function H(b,y){Ye("runFormat:start",{globs:b,options:y});let s=await u(y.config),l=b.length?b:["."],n=x(l);Ye("patterns",n);let i=new Set((y.ext||s.format.extensions.join(",")).split(",").map((Y)=>{let X=Y.trim();return X.startsWith(".")?X:`.${X}`})),w=r.TIMEOUT_MS,I=n.some((Y)=>{let X=Y.replace(/\/?\*\*(?:\/\*+)?$/,"");return!(pc(X)?X:dc(process.cwd(),X)).startsWith(process.cwd())})?h(m):h(s.ignores),P=d(I),_=[];if(n.length===1&&/\*\*\/\*$/.test(n[0])){let Y=n[0].replace(/\/?\*\*\/\*$/,"");try{let{readdirSync:X,statSync:J}=await import("fs"),{join:ne}=await import("path"),Q=[Y];while(Q.length){let ee=Q.pop(),ie=X(ee);for(let ye of ie){let we=ne(ee,ye),se=J(we);if(P(we))continue;if(se.isDirectory())Q.push(we);else _.push(we)}}}catch{_=await mo(f(n,{dot:!1,ignore:I,onlyFiles:!0,absolute:!0}),w,"glob")}}else _=await mo(f(n,{dot:!1,ignore:I,onlyFiles:!0,absolute:!0}),w,"glob");Ye("globbed entries",_.length);let j=_.filter((Y)=>{if(P(Y))return!1;let X=Y.lastIndexOf(".");if(X<0)return!0;let J=Y.slice(X);return i.has(J)});Ye("filtered files",j.length);let B=0,Z=[];for(let Y of j){Ye("format start",fo(process.cwd(),Y));let X=po(Y,"utf8"),J=p(X,s,Y),ne=J!==X;if(y.write){if(ne)mc(Y,J,"utf8")}if(ne)Z.push(fo(process.cwd(),Y));B++}let z=Z.length;if(z>0){for(let Y of Z)console.log(t.gray(` ${Y}`));console.log(y.write?t.gray(`Formatted ${z} of ${B} file(s).`):t.yellow(`${z} of ${B} file(s) need formatting. Run with --write to fix.`))}else if(y.verbose!==void 0?y.verbose:s.verbose)console.log(t.gray(`Checked ${B} files, all formatted.`));return y.check&&z>0?1:0}import{mkdirSync as gc,readFileSync as bc,writeFileSync as yc}from"fs";import{dirname as xc,relative as Rc,resolve as Ro}from"path";var wc=".pickiercache";function yo(b){return Rc(process.cwd(),Ro(process.cwd(),b))}var xo="";function Bn(b){return Bun.hash(b).toString(36)}function kc(b,y){let s=JSON.stringify({cfg:b,options:{formatOnly:!!y._formatOnly,fix:!!y.fix,dryRun:!!y.dryRun,ext:y.ext}},(l,n)=>typeof n==="function"?`fn:${n.toString()}`:n instanceof RegExp?`re:${n}`:n);return`${F}:${Bn(s)}`}function wo(b,y){let s=y.cache??b.lint?.cache??!1,l=(y.fix||y._formatOnly)&&!y.dryRun;return!!s&&!l}function ko(b,y,s=y.cacheLocation??b.lint?.cacheLocation??wc){let l=Ro(process.cwd(),s),n=kc(b,y),i={};try{let a=JSON.parse(bc(l,"utf8"));if(a.key===n&&a.files&&typeof a.files==="object")i=a.files}catch{}let w={};return{get(a,I){let P=yo(a),_=i[P];if(_&&_.hash===Bn(I))return w[P]=_,_.issues.map((D)=>D.filePath===xo?{...D,filePath:a}:D);return},set(a,I,P){w[yo(a)]={hash:Bn(I),issues:P.map((_)=>_.filePath===a?{..._,filePath:xo}:_)}},save(){try{gc(xc(l),{recursive:!0}),yc(l,JSON.stringify({key:n,files:w}))}catch{}}}}import{chmodSync as Ic,existsSync as Io}from"fs";import{resolve as qn}from"path";var __dirname="/home/runner/work/pickier/pickier/packages/pickier/src",Pc=new Set(["quotes","indent","no-debugger","no-console","no-template-curly-in-string","no-cond-assign","pickier/import-dedupe","pickier/no-import-dist","pickier/no-import-node-modules-by-path","pickier/sort-tailwind-classes","style/brace-style","style/max-statements-per-line","regexp/no-super-linear-backtracking","regexp/no-unused-capturing-group","regexp/no-useless-lazy","general/prefer-const","general/prefer-template","general/no-unused-vars","pickier/no-unused-imports","ts/no-top-level-await","style/no-multi-spaces","style/no-multiple-empty-lines","style/no-trailing-spaces","eslint/no-new","quality/no-new","general/no-new","general/no-regex-spaces","node/prefer-global/buffer","node/prefer-global/process","pickier/sort-exports"]),Po=new Set(["eslint","general","quality","pickier","style","regexp","ts","node","unused-imports","perfectionist"]),Mo=new Set(["markdown","publint","lockfile","shell"]),vo={"pickier/sort-exports":(b)=>b.pluginRules?.["pickier/sort-exports"]?.[1]||{}};function Mc(b,y){let s=vo[y.id]?vo[y.id](b):y.options;return{id:y.id,severity:y.severity??null,options:s??null}}function vc(b){return{quotes:o(b,"quotes",["style/quotes"],"warn")??null,indent:o(b,"indent",["style/indent"],"warn")??null,"no-debugger":o(b,"no-debugger",["noDebugger"])??null,"no-console":o(b,"no-console",["noConsole"])??null,"no-template-curly-in-string":o(b,"no-template-curly-in-string",["noTemplateCurlyInString"])??null,"no-cond-assign":o(b,"no-cond-assign",["noCondAssign"])??null}}function $c(b){return{quotes:b.format.quotes,indent:b.format.indent,indentStyle:b.format.indentStyle??"spaces"}}function $o(b){return/\.(?:ts|js|tsx|jsx|mts|mjs|cts|cjs)$/.test(b)}function Co(b,y){if(process.env.PICKIER_NATIVE==="0"||y.fix||y._formatOnly)return null;if((b.plugins??[]).some((a)=>typeof a==="string"||Po.has(a.name)||Mo.has(a.name)))return null;let s=Cc();if(!s)return null;let l=vc(b),n=[],i=[],w=!1;if(V(b).forEach((a,I)=>{if(Po.has(a.plugin)&&Pc.has(a.id))n.push(Mc(b,a)),i.push(I);else if(!Mo.has(a.plugin))w=!0}),n.length===0&&Object.values(l).every((a)=>a===null))return null;return{request:{format:$c(b),builtins:l,rules:n},binary:s,positions:i,nativeRules:n.map((a)=>a.id),hybrid:w}}function Cc(){if(process.env.PICKIER_NATIVE_BINARY)return Io(process.env.PICKIER_NATIVE_BINARY)?process.env.PICKIER_NATIVE_BINARY:null;let b=`${process.platform}-${process.arch}`,y=process.platform==="win32"?"pickier-native.exe":"pickier-native";return[qn(__dirname,"native",b,y),qn(__dirname,"../dist/native",b,y),qn(__dirname,"../../zig/zig-out/bin/pickier-zig")].find((l)=>Io(l))??null}function Lo(b,y,s,l,n){let i=Buffer.from(Ao(b,y,l)),w=Eo(s,()=>Bun.spawnSync([s,"lint-batch"],{stdin:i,stdout:"pipe",stderr:"pipe"}));if(!w||w.exitCode!==0)return null;return Oo(w.stdout.toString(),b,n)}async function So(b,y,s,l){let n=Buffer.from(Ao(b,y)),i=Eo(s,()=>Bun.spawn([s,"lint-batch"],{stdin:n,stdout:"pipe",stderr:"ignore"}));if(!i)return null;let[w,a]=await Promise.all([new Response(i.stdout).text(),i.exited]);if(a!==0)return null;return Oo(w,b,l)}function Eo(b,y){try{return y()}catch(s){if(s?.code!=="EACCES")return null;try{return Ic(b,493),y()}catch{return null}}}function Ao(b,y,s){return JSON.stringify({...y,...s&&{threads:s},files:b})}var Lc=2;function Oo(b,y,s){let l;try{let n=JSON.parse(b);if(n?.v!==Lc)return null;l=n.f}catch{return null}if(!Array.isArray(l)||l.length!==y.length)return null;return l.map((n,i)=>{if(n===null)return null;let{s:w,i:a}=n,I=y[i],P=[];for(let _=0;_<a.length;_+=7){let D={filePath:I,line:a[_],column:a[_+1],ruleId:w[a[_+2]],message:w[a[_+3]],severity:a[_+4]===0?"error":"warning"};if(a[_+5]>=0)D.help=w[a[_+5]];if(s)D.pos=a[_+6]<0?-1:s[a[_+6]];P.push(D)}return P})}function _o(b,y){let s=b,l=y,n=[],i=new Set,w=(P)=>{let _=`${P.line}:${P.column}:${P.ruleId}`;if(i.has(_))return;i.add(_);let D={filePath:P.filePath,line:P.line,column:P.column,ruleId:P.ruleId,message:P.message,severity:P.severity};if(P.help!==void 0)D.help=P.help;n.push(D)},a=0,I=0;while(a<s.length||I<l.length)if(I>=l.length||a<s.length&&s[a].pos<=l[I].pos)w(s[a++]);else w(l[I++]);return n}import{existsSync as Sc}from"fs";import{availableParallelism as To}from"os";var Ec=32,Ac=8,Oc=4;function Wo(b){let y=r.WORKERS;if(y!==null)return Math.min(y,b);if(b<Ec)return 0;return Math.min(Math.max(1,To()-1),Math.ceil(b/Ac))}var $n=new Map,_c=Math.max(1,To()-1);function Tc(b){let s=$n.get(b)?.pop();if(s)return s.ref(),s;let l=new Worker(b);return l.addEventListener("close",()=>{let n=$n.get(b),i=n?.indexOf(l)??-1;if(i>=0)n.splice(i,1)}),l}function Wc(b,y){y.unref();let s=$n.get(b);if(!s)$n.set(b,[y]);else if(s.length<_c)s.push(y)}function Nc(){for(let b of["./lint-worker.ts","./lint-worker.js","./src/lint-worker.js"]){let y=new URL(b,import.meta.url);try{if(y.protocol==="file:"&&Sc(Bun.fileURLToPath(y)))return y.href}catch{}}return null}async function No(b,y,s,l,n=Nc()){let i=Array(b.length);if(n!==null){let w=0,a=()=>{let P=[];while(P.length<Oc&&w<b.length)P.push([w,b[w]]),w++;return P},I=[];try{await new Promise((P,_)=>{let D=0,j=null,B=()=>{if(j)_(j);else P()},Z=()=>{let z;try{z=Tc(n)}catch{return}I.push(z),D++;let Y=[],X=!1,J=(ee)=>{if(X)return;if(X=!0,z.onmessage=null,z.onerror=null,z.removeEventListener("close",Q),ee)Wc(n,z);if(D--,D===0)B()},ne=()=>{if(Y=a(),Y.length===0)J(!0);else z.postMessage({type:"lint",batch:Y})};z.onmessage=(ee)=>{let ie=ee.data;if(ie.type==="done"){for(let[ye,we]of ie.results)i[ye]=we;ne()}else if(ie.type==="error")j??=Error(ie.message),w=b.length,Y=[],J(!1)};let Q=()=>{Y=[],J(!1)};z.onerror=Q,z.addEventListener("close",Q);try{z.postMessage({type:"init",options:y})}catch{J(!1);return}ne()};for(let z=0;z<s;z++)Z();if(D===0)B()})}finally{for(let P of I)P.unref()}}for(let w=0;w<b.length;w++)if(i[w]===void 0)i[w]=await l(b[w]);return i}var Dc=ct("pickier:lint");function Se(){return Dc}function We(...b){if(r.TRACE)Se().error("[pickier:trace]",b)}async function W(b,y,s="untitled",l){if(l?.aborted)throw Error("AbortError");On();let n=ze(b),i=Ze(b),w=lt(s,b,y,n,i);if(l?.aborted)throw Error("AbortError");try{let a=await An(s,b,y);for(let I of a){if(l?.aborted)throw Error("AbortError");if(je(I.ruleId,I.line,n))continue;if(i.has(I.line)&&Sn(I.ruleId))continue;w.push({filePath:I.filePath,line:I.line,column:I.column,ruleId:I.ruleId,message:I.message,severity:I.severity,...I.help&&{help:I.help}})}}catch{}return w}function A(b,y,s="untitled"){On();let l=Qo(s,b,y,ze(b),Ze(b));if(l=Jo(s,l,y),el(s,l,y))l=Hc(l,y,ze(l),Ze(l));return l}async function U(b,y,s){We("runLintProgrammatic:start",{globs:b,options:y});let l=await u(y.config);if(s?.aborted)throw Error("AbortError");let n=b.length?b:["."],i=x(n),w=y.ext||l.lint.extensions.join(","),a=new Set(w.split(",").map((re)=>{let pe=re.trim();return pe.startsWith(".")?pe:`.${pe}`})),I=r.TIMEOUT_MS,_=i.some((re)=>{let pe=re.replace(/\/?\*\*\/*\*\*$/,""),le=Xe(pe)?pe:Je(process.cwd(),pe),ge=process.cwd();return le!==ge&&!le.startsWith(ge+Ho)})?h(m):h(l.ignores),D=d(_),j=[];if(i.length===1&&!/[*?[\]{}()!]/.test(i[0]))try{if(Cn(i[0]).isFile())j=[Xe(i[0])?i[0]:Je(process.cwd(),i[0])]}catch{}let Z=i.length===1&&/\*\*\/*\*$/.test(i[0]);if(!j.length&&Z){let re=i[0].replace(/\/?\*\*\/*\*\*$/,""),pe=Xe(re)?re:Je(process.cwd(),re);try{let le=[pe];while(le.length){if(s?.aborted)throw Error("AbortError");let ge=le.pop(),me=Vo(ge);for(let xe of me){let de=Ko(ge,xe),be=Cn(de);if(D(de))continue;if(be.isDirectory())le.push(de);else j.push(de)}}}catch{j=await ot(f(i,{dot:!1,ignore:_,onlyFiles:!0,absolute:!0}),I,"glob")}}else if(!j.length)j=await ot(f(i,{dot:!1,ignore:_,onlyFiles:!0,absolute:!0}),I,"glob");if(s?.aborted)throw Error("AbortError");let z=0,Y=0,X=0,J=0,ne=0,Q=[];for(let re of j){if(z++,re.replace(/\\/g,"/").includes("/node_modules/")){X++;continue}if(D(re)){J++;continue}if(!T(re,a)){ne++;continue}Q.push(re),Y++}We("filter:programmatic",{total:z,included:Y,node_modules:X,ignored:J,wrongExt:ne});let ee=r.CONCURRENCY,we=(await Yo(Q,ee,async(re)=>{if(s?.aborted)throw Error("AbortError");On();let pe=Yn(re,"utf8"),le=ze(pe),ge=Ze(pe),me=lt(re,pe,l,le,ge);try{let xe=await An(re,pe,l);for(let de of xe){if(s?.aborted)throw Error("AbortError");if(je(de.ruleId,de.line,le))continue;if(ge.has(de.line)&&Sn(de.ruleId))continue;me.push({filePath:de.filePath,line:de.line,column:de.column,ruleId:de.ruleId,message:de.message,severity:de.severity,...de.help&&{help:de.help}})}}catch{}{let xe=new Set;me=me.filter((de)=>{let be=`${de.line}:${de.column}:${de.ruleId}`;if(xe.has(be))return!1;return xe.add(be),!0})}if(y.fix){let xe=Qo(re,pe,l,le,ge);if(xe=Jo(re,xe,l),xe!==pe){let de=ze(xe),be=Ze(xe);if(me=lt(re,xe,l,de,be),!y.dryRun)Hn(re,xe,"utf8")}}return me})).flat(),se=we.filter((re)=>re.severity==="error").length,fe=we.filter((re)=>re.severity==="warning").length;return{errors:se,warnings:fe,issues:we}}function jc(b){return b.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function Uc(b){return b.replace(/-([a-z])/g,(y,s)=>s.toUpperCase())}function ze(b){let y=new Map,s=new Set,l=new Map,n=new Map,i=b.split(/\r?\n/),w=new Set;for(let P=0;P<i.length;P++){let _=i[P].trim(),D=P+1,j=_.match(/^\/\/\s*(?:eslint|pickier)-disable-next-line(?:\s+(\S.*))?$/);if(j){let X=j[1]?.replace(/\s+--\s.*$/,""),J=X?X.split(",").map((ne)=>ne.trim()).filter(Boolean):["*"];if(J.length>0){let ne=D+1,Q=y.get(ne)||new Set;for(let ee of J)Q.add(ee);y.set(ne,Q)}continue}let B=_.match(/^\/\*\s*(?:eslint|pickier)-disable(?:\s+([^*]+))?\s*\*\//);if(B){let X=B[1]?.trim().replace(/\s+--\s.*$/,"");if(!X||X==="")l.set(D,new Set(["*"])),w.add("*");else{let J=X.split(",").map((Q)=>Q.trim()).filter(Boolean),ne=l.get(D)||new Set;for(let Q of J)ne.add(Q),w.add(Q);l.set(D,ne)}if(P===0)if(!X||X==="")s.add("*");else{let J=X.split(",").map((ne)=>ne.trim()).filter(Boolean);for(let ne of J)s.add(ne)}continue}let Z=_.match(/^\/\*\s*(?:eslint|pickier)-enable(?:\s+([^*]+))?\s*\*\//);if(Z){let X=Z[1]?.trim();if(!X||X==="")n.set(D,new Set(["*"])),w.clear();else{let J=X.split(",").map((Q)=>Q.trim()).filter(Boolean),ne=n.get(D)||new Set;for(let Q of J)ne.add(Q),w.delete(Q);n.set(D,ne)}continue}let z=_.match(/^\/\/\s*(?:eslint|pickier)-disable(?:\s+(\S.*))?$/);if(z){let X=z[1]?.trim().replace(/\s+--\s.*$/,"");if(!X||X==="")l.set(D,new Set(["*"])),w.add("*");else{let J=X.split(",").map((Q)=>Q.trim()).filter(Boolean),ne=l.get(D)||new Set;for(let Q of J)ne.add(Q),w.add(Q);l.set(D,ne)}continue}let Y=_.match(/^\/\/\s*(?:eslint|pickier)-enable(?:\s+(\S.*))?$/);if(Y){let X=Y[1]?.trim();if(!X||X==="")n.set(D,new Set(["*"])),w.clear();else{let J=X.split(",").map((Q)=>Q.trim()).filter(Boolean),ne=n.get(D)||new Set;for(let Q of J)ne.add(Q),w.delete(Q);n.set(D,ne)}}}let a=Array.from(l.keys()).sort((P,_)=>P-_),I=Array.from(n.keys()).sort((P,_)=>P-_);return{nextLine:y,fileLevel:s,rangeDisable:l,rangeEnable:n,sortedDisableLines:a,sortedEnableLines:I}}function je(b,y,s){if(s instanceof Map){let a=s.get(y);if(!a||a.size===0)return!1;return it(b,a)}if(s.fileLevel.size>0){if(it(b,s.fileLevel))return!0}let l=s.nextLine.get(y);if(l&&it(b,l))return!0;let n=!1,i=0,w=0;while(!0){let a=i<s.sortedDisableLines.length?s.sortedDisableLines[i]:Number.POSITIVE_INFINITY,I=w<s.sortedEnableLines.length?s.sortedEnableLines[w]:Number.POSITIVE_INFINITY,P=Math.min(a,I);if(P>=y)break;if(a===P){let D=s.rangeDisable.get(a);if(it(b,D))n=!0;i++;continue}let _=s.rangeEnable.get(I);if(_.has("*")||it(b,_))n=!1;w++}return n}function it(b,y){if(y.size===0)return!1;if(y.has("*"))return!0;if(y.has(b))return!0;let s=jc(b);if(y.has(s)||y.has(Uc(b)))return!0;for(let l of y)if(!l.includes("/")){if(b.endsWith(`/${l}`))return!0}if(!b.includes("/")){for(let l of y)if(l.endsWith(`/${b}`))return!0}return!1}function Sn(b){return b!=="spaced-comment"&&!b.endsWith("/spaced-comment")}function Fc(b,y){if(b.help)return b;let s=y.includes("/")?y.split("/")[1]:y,l;if(s.startsWith("no-"))l=`Remove or refactor this ${s.replace("no-","").replace(/-/g," ")}. Check the rule documentation for more details or disable with: // eslint-disable-next-line ${y}`;else if(s.startsWith("prefer-"))l=`Consider using ${s.replace("prefer-","").replace(/-/g," ")} instead. This is a best practice recommendation. Disable with: // eslint-disable-next-line ${y} if needed`;else if(s.includes("sort")||s.includes("order"))l=`Reorder these items according to the rule requirements, or use --fix to auto-sort. Disable with: // eslint-disable-next-line ${y}`;else if(s.includes("indent")||s.includes("spacing")||s.includes("newline"))l=`Fix the formatting issue. Run with --fix to automatically format. Disable with: // eslint-disable-next-line ${y}`;else l=`Fix this issue or disable the rule with: // eslint-disable-next-line ${y}. Check the rule documentation for more details`;return{...b,help:l}}async function ot(b,y,s){let l,n=new Promise((i,w)=>{l=setTimeout(()=>w(Error(`Timeout after ${y}ms at ${s}`)),y)});try{let i=await Promise.race([b,n]);return clearTimeout(l),i}catch(i){throw Se().error(`[pickier:error] ${s} failed:`,i?.message||i),We("withTimeout error:",s,i),i}}async function Yo(b,y,s){let l=Array(b.length);if(b.length===0)return l;let n=0,i=Math.max(1,Math.min(Math.max(1,y),b.length));async function w(){while(n<b.length){let a=n++;l[a]=await s(b[a],a)}}return await Promise.all(Array.from({length:i},w)),l}var Do=new WeakMap;function Bc(b){let y=Fn();if(b.plugins&&b.plugins.length>0){let s=new Set(["pickier","style","regexp","ts"]),l=b.plugins.filter((i)=>typeof i!=="string");y=l.some((i)=>s.has(i.name))?y:[];for(let i of l)y.push(i)}return y}function qc(b,y){let s={...b.pluginRules||{},...b.rules||{}};if(b.rules?.noUnusedCapturingGroup)s["regexp/no-unused-capturing-group"]=b.rules.noUnusedCapturingGroup;let l={"antfu/curly":"style/curly","antfu/if-newline":"style/if-newline","antfu/no-top-level-await":"ts/no-top-level-await"};for(let[n,i]of Object.entries(l))if(s[n])s[i]=s[n];for(let n of[b.pluginRules,b.rules])for(let i of Object.keys(n||{})){if(i.includes("/"))continue;for(let w of y)if(w.rules&&Object.prototype.hasOwnProperty.call(w.rules,i))s[`${w.name}/${i}`]=n[i]}return s}function En(b){let y=Do.get(b);if(y)return y;let s=Bc(b),l=qc(b,s),n=[],i=[],w=new Set(["no-debugger"]),a=new Set(["no-debugger"]),I=new Set;for(let _ of s)for(let D in _.rules){let j=`${_.name}/${D}`,B=N(l,j);if(!B.enabled)continue;if(I.has(D))continue;I.add(D);let Z=_.rules[D],z={pluginName:_.name,ruleName:D,fullRuleId:j,rule:Z,severity:B.severity,options:B.options};if(typeof Z?.check==="function")n.push(z);else if(B.severity==="error")n.push(z);if(typeof Z?.fix==="function")i.push(z),w.add(j),a.add(D)}let P={checkRules:n,fixRules:i,fixableRuleIds:w,fixableBareRuleNames:a};return Do.set(b,P),P}function V(b){return En(b).checkRules.map((y)=>({id:y.fullRuleId,plugin:y.pluginName,severity:y.severity,options:y.options}))}function zc(b,y){return/\.(?:sh|bash|zsh|ksh|dash)$/.test(b)||/^#!\s*(?:\/usr\/bin\/env\s+)?(?:ba|z|k|da)?sh\b/.test(y)}function Zc(b){return/(?:^|[/\\])(?:bun\.lock|bun\.lockb|package-lock\.json|pnpm-lock\.yaml|yarn\.lock|npm-shrinkwrap\.json)$/.test(b)}function Xo(b,y,s){switch(b.pluginName){case"markdown":return y.endsWith(".md");case"shell":return zc(y,s);case"publint":return/(?:^|[/\\])package\.json$/.test(y);case"lockfile":return Zc(y);case"node":case"ts":case"general":case"quality":case"eslint":case"regexp":case"unused-imports":case"perfectionist":return/\.(?:ts|js|tsx|jsx|mts|mjs|cts|cjs)$/.test(y);default:return!0}}async function An(b,y,s,l){let n=[],i=En(s),w={filePath:b,config:s};for(let a=0;a<i.checkRules.length;a++){let I=i.checkRules[a];if(l?.has(I.fullRuleId)||!Xo(I,b,y))continue;let P=n.length;if(await Gc(I,b,y,w,n),l)for(let _=P;_<n.length;_++)n[_].pos=a}return n}async function Gc(b,y,s,l,n){let{fullRuleId:i,rule:w,severity:a}=b;if(!w||typeof w.check!=="function"){if(a==="error")n.push({filePath:y,line:1,column:1,ruleId:`${i}-internal`,message:"Rule missing implementation (check function is undefined)",severity:"error"});return}try{We("rule:start",i);let I=r.RULE_TIMEOUT_MS,P={...l,options:b.options},_=performance.now(),D=await ot(Promise.resolve().then(()=>w.check(s,P)),I,`rule:${i}`),j=performance.now()-_;if(j>I)n.push({filePath:y,line:1,column:1,ruleId:`${i}-internal`,message:`Rule exceeded timeout budget: ${Math.round(j)}ms > ${I}ms`,severity:"error"});We("rule:end",i,Array.isArray(D)?D.length:0);for(let B of D){let Z=Fc(B,i);if(a)n.push({...Z,severity:a});else n.push(Z)}}catch(I){n.push({filePath:y,line:1,column:1,ruleId:`${i}-internal`,message:`Rule threw: ${I?.message||I}`,severity:"error"})}}var Vc=/\.(?:[cm]?[jt]sx?|vue|svelte|stx)$/i;function Kc(b,y,s){if(!Vc.test(s)||!b.includes("`"))return y;let l=b.split(/\r?\n/),n=y.split(/\r?\n/);if(l.length!==n.length)return y;let i=qe(b),w=0;for(let a=0;a<n.length;a++)if(i[a]&&n[a]!==l[a])n[a]=l[a],w++;return w>0?n.join(`
116
+ `):y}function Jo(b,y,s){let l=En(s),n={filePath:b,config:s},i=y,w=!0,a=0;while(w&&a++<L){w=!1;for(let I of l.fixRules){if(!Xo(I,b,i))continue;let P={...n,options:I.options},_=I.rule.fix(i,P),D=I.rule.meta?.editsStringContent?_:Kc(i,_,b);if(D!==i)i=D,w=!0}}return i}function Qo(b,y,s,l,n){if(!o(s,"no-debugger",["noDebugger"])||!y.includes("debugger"))return y;let w=b.split(".").pop()?.toLowerCase()??"",a=w==="sh"||w==="bash"||w==="zsh"||w==="ksh"||w==="dash"||/^#!\s*(?:\/usr\/bin\/env\s+)?(?:ba|z|k|da)?sh\b/.test(y);if(w==="md"||w==="yaml"||w==="yml"||w==="json"||w==="jsonc"||a)return y;let I=/^\s*debugger\b/,P=Xn(y),_=y.split(/\r?\n/),D=[],j=!1;for(let B=0;B<_.length;B++){let Z=_[B],z=B+1;if(I.test(Z)&&!n.has(z)&&!P.has(z)&&!je("no-debugger",z,l)){j=!0;continue}D.push(Z)}return j?D.join(`
117
+ `):y}function el(b,y,s){let l=o(s,"indent",["style/indent"],"warn");if(!l)return;let n=b.split(".").pop()?.toLowerCase()??"";if(n==="md")return;if(n==="stx"||n==="html"||n==="htm"||n==="vue")return;if(n==="yaml"||n==="yml")return;if(n==="sh"||n==="bash"||n==="zsh"||n==="ksh"||n==="dash"||/^#!\s*(?:\/usr\/bin\/env\s+)?(?:ba|z|k|da)?sh\b/.test(y))return;return l}function Hc(b,y,s,l){let n=y.format.indent,i=y.format.indentStyle,w=Xn(b),a=b.split(/\r?\n/),I=!1;for(let P=0;P<a.length;P++){let _=a[P],D=P+1;if(l.has(D)||w.has(D)||je("indent",D,s))continue;let j=0;while(j<_.length&&(_.charCodeAt(j)===32||_.charCodeAt(j)===9))j++;if(j===0)continue;let B=_.slice(0,j);if(!M(B,n,i,_))continue;let Z;if(i==="tabs"){let z=0,Y=0;for(let J=0;J<B.length;J++)if(B.charCodeAt(J)===9)Y++;else z++;let X=Math.floor(z/n);Z="\t".repeat(Y+X)}else{let z=0;for(let X=0;X<B.length;X++)if(B.charCodeAt(X)===9)z+=n;else z++;let Y=Math.floor(z/n)*n;Z=" ".repeat(Y)}if(Z!==B)a[P]=Z+_.slice(j),I=!0}return I?a.join(`
118
+ `):b}var rt=null;function On(){rt=null,q()}function Xn(b){if(rt!==null&&rt.content===b)return rt.lines;let y=Yc(b);return rt={content:b,lines:y},y}var Ge=0,zn=1,Zn=2,jo=3,Uo=4,Gn=5,Fo=6,Vn=1,Bo=2;function Yc(b){let y=new Set;if(!b.includes("`"))return y;let s=[],l=!1,n=Ge,i=1,w=0,a=-1,I=0,P=b.length,_=0,D=()=>{if(_++,b.charCodeAt(_)===10)i++,I=_+1,a=-1};for(;_<P;_++){let j=b.charCodeAt(_);if(j===10){if(n===jo)n=Ge;i++,I=_+1,a=-1;continue}if(n===Ge&&l&&w!==i)y.add(i),w=i;if(n!==Ge){switch(n){case zn:case Zn:if(j===92)D();else if(n===zn&&j===39||n===Zn&&j===34)n=Ge;break;case Uo:if(j===42&&b.charCodeAt(_+1)===47)_++,n=Ge;break;case Gn:if(j===92)D();else if(j===91)n=Fo;else if(j===47)n=Ge;break;case Fo:if(j===92)D();else if(j===93)n=Gn;break}continue}if(l){if(j===92){D();continue}if(j===96){s.pop(),l=s.length>0&&s[s.length-1]===Vn;continue}if(j===36&&b.charCodeAt(_+1)===123){s.push(Bo),l=!1,_++;continue}continue}if(j===96){if(s.push(Vn),l=!0,w!==i)y.add(i),w=i;continue}if(j===39){n=zn;continue}if(j===34){n=Zn;continue}if(j===47){let B=b.charCodeAt(_+1);if(B===47){n=jo,_++;continue}if(B===42){n=Uo,_++;continue}if(Jn(a<0?"":b[a],b.slice(I,_+1),_-I)){n=Gn;continue}}if(j===125&&s.length>0&&s[s.length-1]===Bo){s.pop(),l=s.length>0&&s[s.length-1]===Vn;continue}if(!(j===32||j>=9&&j<=13||j>=128&&/\s/.test(b[_])))a=_}return y}function qo(b,y){let s=b.match(y);if(!s||s.index===void 0)return null;let l=s.index+s[0].length-1,n=0;for(let i=l;i<b.length;i++)if(b[i]==="(")n++;else if(b[i]===")"){if(n--,n===0)return b.slice(l+1,i)}return null}function zo(b){let y="",s=0;for(let l of b){if(l==="("){s++;continue}if(l===")"){s=Math.max(0,s-1);continue}if(s===0)y+=l}return y}function Zo(b){if(!b.includes("/"))return b;let y="",s=0;while(s<b.length){if(b[s]==="/"){if(b[s+1]==="/"||b[s+1]==="*")return y+b.slice(s);let l=b.slice(0,s).trimEnd();if(Jn(l[l.length-1]??"",b,s)){s++;let n=!1;while(s<b.length){if(b[s]==="\\"){s+=2;continue}if(b[s]==="[")n=!0;else if(b[s]==="]")n=!1;else if(b[s]==="/"&&!n){s++;while(s<b.length&&/[gimsuvy]/.test(b[s]))s++;break}s++}continue}}y+=b[s],s++}return y}function Jn(b,y,s){if(b==="")return!0;if("([{,:;!?&|=<>~^+*%-".includes(b))return!0;if(/[A-Za-z_$]/.test(b)){let n=y.slice(0,s).trimEnd();if(/(?:^|[^A-Za-z0-9_$])(?:return|typeof|instanceof|new|delete|void|in|of|yield|await|throw|case)$/.test(n))return!0}return!1}function Go(b){if(!b.includes("/"))return b;let y="",s=0,l=null,n=!1;while(s<b.length){let i=b[s],w=b[s+1];if(n){y+=i,n=!1,s++;continue}if(i==="\\"&&l){n=!0,y+=i,s++;continue}if(!l){if(i==='"'){l="double",y+=i,s++;continue}if(i==="'"){l="single",y+=i,s++;continue}if(i==="`"){l="template",y+=i,s++;continue}if(i==="/"&&w==="/")break;if(i==="/"&&w==="*"){s+=2;while(s<b.length){if(b[s]==="*"&&b[s+1]==="/"){s+=2;break}s++}y+=" ";continue}y+=i,s++}else{if(l==="double"&&i==='"'||l==="single"&&i==="'"||l==="template"&&i==="`")l=null;y+=i,s++}}return y}function Ze(b){let y=new Set,s="code",l=1,n=!1,i=!1,w=!1,a=[];for(let I=0;I<b.length;I++){let P=b[I],_=b[I+1],D=I>0?b[I-1]:"";if(P===`
119
+ `){if(w&&s==="block-comment")y.add(l);else if(!n&&i&&s!=="block-comment")y.add(l);else if(!n&&s==="block-comment")y.add(l);if(l++,n=!1,i=!1,w=s==="block-comment",s==="line-comment")s="code";continue}switch(s){case"code":if(P==="/"&&_==="/")s="line-comment",i=!0,I++;else if(P==="/"&&_==="*"){let j=!1;if(I>0){let B=I-1;while(B>0&&(b[B]===" "||b[B]==="\t"))B--;let Z=b[B];if("=([{,;!&|?:~^%+-".includes(Z)&&Z!==`
120
+ `)j=!0;else if(/[a-z]/.test(Z)){let z=b.slice(Math.max(0,B-6),B+1);if(/\b(?:return|case|typeof|void|in|of|new|throw|delete)$/.test(z))j=!0}}if(j){n=!0,I++;while(I<b.length){if(b[I]==="\\"){I+=2;continue}if(b[I]==="/"){I++;break}if(b[I]===`
121
+ `)break;I++}while(I<b.length&&/[gimsuy]/.test(b[I]))I++;I--}else i=!0,s="block-comment",I++}else if(P==="/"&&_!==void 0){let j=!1;if(I>0){let B=I-1;while(B>0&&(b[B]===" "||b[B]==="\t"))B--;let Z=b[B];if("=([{,;!&|?:~^%+-".includes(Z)||Z===`
122
+ `)j=!0;else if(/[a-z]/.test(Z)){let z=b.slice(Math.max(0,B-6),B+1);if(/\b(?:return|case|typeof|void|in|of|new|throw|delete)$/.test(z))j=!0}}if(j){n=!0,I++;while(I<b.length){if(b[I]==="\\"){I+=2;continue}if(b[I]==="/"){I++;break}if(b[I]===`
123
+ `)break;I++}while(I<b.length&&/[gimsuy]/.test(b[I]))I++;I--}else n=!0}else if(P==="'")s="string-single",n=!0;else if(P==='"')s="string-double",n=!0;else if(P==="`")s="string-template",n=!0;else if(P==="{"){if(a.length)a[a.length-1]++;n=!0}else if(P==="}"){if(a.length)if(a[a.length-1]===0)a.pop(),s="string-template";else a[a.length-1]--;n=!0}else if(P!==" "&&(P<"\t"||P>"\r")&&(P<"\x80"||!/\s/.test(P)))n=!0;break;case"string-single":if(P==="\\"){I++;break}if(P==="'")s="code";break;case"string-double":if(P==="\\"){I++;break}if(P==='"')s="code";break;case"string-template":if(P==="\\"){I++;break}if(P==="$"&&_==="{"){a.push(0),s="code",I++;break}if(P==="`")s="code";break;case"line-comment":break;case"block-comment":if(P==="*"&&_==="/")s="code",I++;break}}if(w&&s==="block-comment")y.add(l);else if(!n&&i&&s!=="block-comment")y.add(l);else if(!n&&s==="block-comment")y.add(l);return y}function lt(b,y,s,l,n){let i=[],w=y.split(/\r?\n/),a=s.format.quotes,I=b.split(".").pop()?.toLowerCase()??"",P=I==="md",_=I==="sh"||I==="bash"||I==="zsh"||I==="ksh"||I==="dash"||/^#!\s*(?:\/usr\/bin\/env\s+)?(?:ba|z|k|da)?sh\b/.test(y),D=o(s,"quotes",["style/quotes"],"warn"),j=!D||I==="json"||I==="jsonc"||I==="lock"||P||I==="yaml"||I==="yml"||I==="stx"||I==="html"||I==="htm"||I==="vue"||_||b.endsWith("bun.lock"),B=P||I==="yaml"||I==="yml"||I==="json"||I==="jsonc"||_,Z=el(b,y,s),z=!1,Y=o(s,"no-debugger",["noDebugger"]),X=o(s,"no-console",["noConsole"]),J=o(s,"no-template-curly-in-string",["noTemplateCurlyInString"]),ne=o(s,"no-cond-assign",["noCondAssign"]),Q=/\bconsole\.log\s*\(/,ee=/^\s*debugger\b/,ie=new Set;if(I==="md"){let we=!1;for(let se=0;se<w.length;se++){if(/^(?:`{3,}|~{3,})/.test(w[se].trim())){we=!we;continue}if(we)ie.add(se+1)}}let ye=Xn(y);for(let we=0;we<w.length;we++){let se=w[we],fe=we+1;if(n.has(fe))continue;if(!j&&!ye.has(fe)){let le=Go(Zo(se)),ge=O(le,a);if(ge.length>0&&!z){if(!je("quotes",fe,l))i.push({filePath:b,line:fe,column:(ge[0]||0)+1,ruleId:"quotes",message:"Inconsistent quote style",severity:D,help:`Use ${a} quotes consistently throughout your code. You can change the preferred quote style in your config with format.quotes: '${a==="single"?"double":"single"}'`});z=!0}}let re=0;while(re<se.length&&(se.charCodeAt(re)===32||se.charCodeAt(re)===9))re++;let pe=re>0?se.slice(0,re):"";if(Z&&pe.length>0&&!ie.has(fe)&&!ye.has(fe)&&M(pe,s.format.indent,s.format.indentStyle,se)){if(!je("indent",fe,l))i.push({filePath:b,line:fe,column:1,ruleId:"indent",message:"Incorrect indentation detected",severity:Z,help:`Use ${s.format.indentStyle==="spaces"?`${s.format.indent} spaces`:"tabs"} for indentation. Configure with format.indent and format.indentStyle in your config`})}if(!B&&Y&&!ye.has(fe)&&ee.test(se)){if(!je("no-debugger",fe,l))i.push({filePath:b,line:fe,column:1,ruleId:"no-debugger",message:"Unexpected debugger statement",severity:Y,help:"Remove debugger statements before committing code. Use breakpoints in your IDE instead, or run with --fix to auto-remove"})}if(!B&&X&&!ye.has(fe)&&Q.test(se)){let le=se.indexOf("//"),ge=se.indexOf("console.");if(le!==-1&&ge>le);else{let me=null;for(let xe=0;xe<se.length;xe++){let de=se[xe];if(!me){if(de==='"')me="double";else if(de==="'")me="single";else if(de==="`")me="template";else if(se.slice(xe).startsWith("console.")){let be=xe+1;if(!je("no-console",fe,l))i.push({filePath:b,line:fe,column:be,ruleId:"no-console",message:"Unexpected console call",severity:X,help:"Remove console statements before committing. Use a proper logging library or disable this rule if console output is intentional"});break}}else if(me==="double"&&de==='"'||me==="single"&&de==="'"||me==="template"&&de==="`"){let be=0;for(let ae=xe-1;ae>=0&&se[ae]==="\\";ae--)be++;if(be%2===0)me=null}}}}if(J&&!ye.has(fe)){let le=se,ge=null,me=!1,xe=!1,de="",be="";for(let ae=0;ae<le.length;ae++){let ce=le[ae];if(me){if(be==="\\"){be=ce;continue}if(xe){if(ce==="]")xe=!1}else if(ce==="[")xe=!0;else if(ce==="/"){me=!1;while(ae+1<le.length&&/[a-z]/i.test(le[ae+1]))ae++;de="/"}be=ce;continue}if(!ge){if(ce==='"'){ge="double",be=ce;continue}if(ce==="'"){ge="single",be=ce;continue}if(ce==="`"){ge="template",be=ce;continue}if(ce==="/"&&le[ae+1]!=="/"&&le[ae+1]!=="*"&&Jn(de,le,ae)){me=!0,xe=!1,be=ce;continue}if(ce!==" "&&ce!=="\t")de=ce}else if(ge==="double"&&ce==='"'||ge==="single"&&ce==="'"||ge==="template"&&ce==="`"){if(be!=="\\")ge=null}else if(ce==="$"&&le[ae+1]==="{"&&be!=="\\"&&ge!=="template"){if(!je("no-template-curly-in-string",fe,l))i.push({filePath:b,line:fe,column:ae+1,ruleId:"no-template-curly-in-string",message:"Unexpected template string expression in normal string",severity:J,help:"Change the string quotes from ' or \" to backticks (`) to use template literal interpolation, or escape the $ if you meant to use it literally"});break}be=ce}}if(!B&&ne&&!ye.has(fe)){let ge=Go(Zo(se)).replace(/'[^']*'|"[^"]*"/g,'""'),me=(ae)=>/[^=!<>]=(?![=>])/.test(ae),xe=(ae)=>{let ce=se.match(ae);if(ce&&ce.index!==void 0)return ce.index+ce[0].length;return Math.max(1,se.indexOf("(")+1)},de=qo(ge,/\b(?:if|while)\s*\(/);if(de){let ae=zo(de);if(me(ae)){if(!je("no-cond-assign",fe,l))i.push({filePath:b,line:fe,column:xe(/\b(?:if|while)\s*\(/),ruleId:"no-cond-assign",message:"Unexpected assignment within a conditional expression",severity:ne,help:"Use === or == for comparison instead of = (assignment). Wrap intentional assignments in extra parentheses."})}}let be=qo(ge,/\bfor\s*\(/);if(be){let ae=be.split(";");if(ae.length>=2){let ce=zo(ae[1]);if(me(ce)){if(!je("no-cond-assign",fe,l))i.push({filePath:b,line:fe,column:xe(/\bfor\s*\(/),ruleId:"no-cond-assign",message:"Unexpected assignment within a conditional expression",severity:ne,help:"Use === or == for comparison instead of = (assignment). Wrap intentional assignments in extra parentheses."})}}}}}return i}async function v(b,y,s){On();let l=Yn(b,"utf8");if(s._formatOnly){let I=p(l,y,b);if(I!==l)if(!s.dryRun)Hn(b,I,"utf8");else return[{filePath:b,line:1,column:1,ruleId:"format",message:"File is not formatted",severity:"error",help:"Run pickier format with --write to apply formatting."}];return[]}if(s._nativeRules)return Xc(b,l,y,s._nativeRules);let n=ze(l),w=/\.(?:ts|js|tsx|jsx|mts|mjs|cts|cjs)$/.test(b)?Ze(l):new Set,a=lt(b,l,y,n,w);try{let I=await An(b,l,y);for(let P of I){if(je(P.ruleId,P.line,n))continue;if(w.has(P.line)&&Sn(P.ruleId))continue;a.push({filePath:P.filePath,line:P.line,column:P.column,ruleId:P.ruleId,message:P.message,severity:P.severity,...P.help&&{help:P.help}})}}catch{}{let I=new Set;a=a.filter((P)=>{let _=`${P.line}:${P.column}:${P.ruleId}`;if(I.has(_))return!1;return I.add(_),!0})}if(s.fix){let I=A(l,y,b);if(I!==l){let P=ze(I),_=Ze(I);if(a=lt(b,I,y,P,_),!s.dryRun)Hn(b,I,"utf8");if(s.dryRun&&(s.verbose!==void 0?s.verbose:y.verbose))Se().debug(t.gray(`dry-run: would apply fixes in ${Ln(process.cwd(),b)}`))}}return We("scan done",Ln(process.cwd(),b),a.length),a}var Kn=null;async function Xc(b,y,s,l){if(Kn?.ids!==l)Kn={ids:l,set:new Set(l)};let n=await An(b,y,s,Kn.set);if(n.length===0)return n;let i=ze(y),w=Ze(y),a=[];for(let I of n){if(je(I.ruleId,I.line,i))continue;if(w.has(I.line)&&Sn(I.ruleId))continue;a.push({filePath:I.filePath,line:I.line,column:I.column,ruleId:I.ruleId,message:I.message,severity:I.severity,...I.help&&{help:I.help},pos:I.pos})}return a}async function K(b,y){if(r.DIAGNOSTICS||r.TRACE)await Se().ready();try{return await Jc(b,y)}finally{await R()}}async function Jc(b,y){We("runLint:start",{globs:b,options:y});let s=r.DIAGNOSTICS;if(s)Se().info("[pickier:diagnostics] Starting lint process...");try{if(s)Se().info("[pickier:diagnostics] Loading config...");let l=await u(y.config);We("config:loaded",{reporter:l.lint.reporter,ext:l.lint.extensions.join(",")});let n=b.length?b:["."],i=x(n);if(We("patterns",i),s)Se().info(`[pickier:diagnostics] Patterns to search: ${i.join(", ")}`);let w=y.ext||l.lint.extensions.join(","),a=new Set(w.split(",").map((ae)=>{let ce=ae.trim();return ce.startsWith(".")?ce:`.${ce}`}));if(s)Se().info(`[pickier:diagnostics] File extensions: ${Array.from(a).join(", ")}`);let I=r.TIMEOUT_MS;if(s)Se().info(`[pickier:diagnostics] Glob timeout: ${I}ms`);let P=i.some((ae)=>{let ce=ae.replace(/\/?\*\*\/*\*\*$/,""),ue=Xe(ce)?ce:Je(process.cwd(),ce),he=process.cwd();return ue!==he&&!ue.startsWith(he+Ho)}),_=P?h(m):h(l.ignores),D=d(_);if(s){if(Se().info(`[pickier:diagnostics] Globbing outside project: ${P}, ignore patterns: ${_.length}`),P)Se().info(`[pickier:diagnostics] Using universal ignores: ${m.slice(0,5).join(", ")}... (${m.length} total)`)}let j=[],B=i.length===1&&!/[*?[\]{}()!]/.test(i[0]);if(s)Se().info(`[pickier:diagnostics] Starting file discovery... (nonGlobSingle: ${B})`);if(B)try{if(Cn(i[0]).isFile())j=[Xe(i[0])?i[0]:Je(process.cwd(),i[0])]}catch{}let Z=i.length===1&&/\*\*\/*\*$/.test(i[0]);if(!j.length&&Z){let ae=i[0].replace(/\/?\*\*\/*\*\*$/,"");if(s)Se().info(`[pickier:diagnostics] Using fast directory scan for: ${ae}`);try{let ue=[Xe(ae)?ae:Je(process.cwd(),ae)],he=0;while(ue.length){let oe=ue.pop();if(he++,s&&he%100===0)Se().info(`[pickier:diagnostics] Scanned ${he} directories, ${j.length} files found so far...`);let te=Vo(oe);for(let ke of te){let $e=Ko(oe,ke),Ce=Cn($e);if(D($e))continue;if(Ce.isDirectory())ue.push($e);else j.push($e)}}if(s)Se().info(`[pickier:diagnostics] Fast scan complete: ${he} directories, ${j.length} total files`)}catch(ce){if(s)Se().info(`[pickier:diagnostics] Fast scan failed: ${ce?.message}, falling back to glob`);j=await ot(f(i,{dot:!1,ignore:_,onlyFiles:!0,absolute:!0}),I,"glob")}}else if(!j.length){if(s)Se().info(`[pickier:diagnostics] Using glob with timeout ${I}ms...`);if(j=await ot(f(i,{dot:!1,ignore:_,onlyFiles:!0,absolute:!0}),I,"glob"),s)Se().info(`[pickier:diagnostics] glob found ${j.length} files`)}if(We("globbed entries",j.length),s)Se().info(`[pickier:diagnostics] File discovery complete: ${j.length} files found`);if(j.length>1e4){if(Se().warn(`[pickier:warn] Found ${j.length} files. This seems unusually high and may cause memory issues.`),Se().warn("[pickier:warn] Consider checking your ignore patterns or being more specific with your glob pattern."),Se().warn("[pickier:warn] Common culprits: node_modules, build directories, cache folders, or vendor dependencies."),j.length>1e5)return Se().error(`[pickier:error] File count exceeds 100,000 (${j.length}). This will likely cause out-of-memory errors.`),Se().error("[pickier:error] Aborting to prevent crash. Please refine your glob pattern or ignore patterns."),1}if(s)Se().info(`[pickier:diagnostics] Filtering ${j.length} files by extension and ignore patterns...`);let z=0,Y=0,X=0,J=0,ne=0,Q=[];for(let ae of j){if(z++,s&&z%1000===0)Se().info(`[pickier:diagnostics] Filtering progress: ${z}/${j.length} files checked, ${Y} included...`);if(ae.replace(/\\/g,"/").includes("/node_modules/")){X++;continue}if(D(ae)){J++;continue}if(!T(ae,a)){ne++;continue}Q.push(ae),Y++}if(We("filter:cli",{total:z,included:Y,node_modules:X,ignored:J,wrongExt:ne}),We("filtered files",Q.length),s)Se().info("[pickier:diagnostics] Filtering complete:"),Se().info(`[pickier:diagnostics] Total files found: ${z}`),Se().info(`[pickier:diagnostics] Files to lint: ${Y}`),Se().info(`[pickier:diagnostics] Excluded (node_modules): ${X}`),Se().info(`[pickier:diagnostics] Excluded (ignored): ${J}`),Se().info(`[pickier:diagnostics] Excluded (wrong extension): ${ne}`);if(Q.length>5000){if(Se().warn(`[pickier:warn] After filtering, ${Q.length} files will be linted. This may take a while and use significant memory.`),Q.length>50000)return Se().error(`[pickier:error] ${Q.length} files to lint exceeds safe limit (50,000). This will likely cause out-of-memory errors.`),Se().error("[pickier:error] Aborting to prevent crash. Please be more specific with your glob pattern."),Se().error("[pickier:error] Example: Instead of '../stx', try '../stx/src' or '../stx/packages/core'"),1}let ee=r.CONCURRENCY;if(s)Se().info(`[pickier:diagnostics] Starting to process ${Q.length} files with concurrency ${ee}...`);let ie=0,ye=async(ae)=>{if(s){if(ie++,ie===1||ie%10===0||ie===Q.length)Se().info(`[pickier:diagnostics] Processing file ${ie}/${Q.length}: ${Ln(process.cwd(),ae)}`)}return v(ae,l,y)},we=async(ae,ce=y)=>{if(ae.length===0)return[];let ue=ce===y?ye:(oe)=>v(oe,l,ce),he=s||r.TRACE?0:Wo(ae.length);return he>1?No(ae,ce,he,ue):Yo(ae,ee,ue)},se=s||r.TRACE?null:Co(l,y),fe=async(ae)=>{let ce=Array(ae.length);if(se){let oe=ae.flatMap((ke,$e)=>$o(ke)?[$e]:[]),te=oe.map((ke)=>ae[ke]);if(te.length>0&&se.hybrid){let[ke,$e]=await Promise.all([So(te,se.request,se.binary,se.positions),we(te,{...y,_nativeRules:se.nativeRules})]);if(ke)oe.forEach((Ce,Me)=>{if(ke[Me])ce[Ce]=_o(ke[Me],$e[Me])});We("native",{files:te.length,linted:ke?ke.filter(Boolean).length:0,hybrid:!0})}else if(te.length>0){let ke=Lo(te,se.request,se.binary);if(ke)oe.forEach(($e,Ce)=>{if(ke[Ce])ce[$e]=ke[Ce]});We("native",{files:te.length,linted:ke?ke.filter(Boolean).length:0})}}let ue=ae.flatMap((oe,te)=>ce[te]===void 0?[te]:[]),he=await we(ue.map((oe)=>ae[oe]));return ue.forEach((oe,te)=>{ce[oe]=he[te]}),ce},re;if(wo(l,y)){let ae=ko(l,y),ce=Q.map((oe)=>{try{return Yn(oe,"utf8")}catch{return null}});re=Array(Q.length);let ue=[];for(let oe=0;oe<Q.length;oe++){let te=ce[oe]===null?void 0:ae.get(Q[oe],ce[oe]);if(te)re[oe]=te;else ue.push(oe)}let he=await fe(ue.map((oe)=>Q[oe]));ue.forEach((oe,te)=>{if(re[oe]=he[te],ce[oe]!==null)ae.set(Q[oe],ce[oe],he[te])}),ae.save(),We("cache",{hits:Q.length-ue.length,misses:ue.length})}else re=await fe(Q);let pe=re.flat();if(s)Se().info(`[pickier:diagnostics] Processing complete! Found ${pe.length} issues total`);let le=0,ge=0;for(let ae of pe)if(ae.severity==="error")le++;else if(ae.severity==="warning")ge++;if(We("issues:summary",{errors:le,warnings:ge}),s)Se().info(`[pickier:diagnostics] Errors: ${le}, Warnings: ${ge}`);let me=y.reporter||l.lint.reporter,xe=y.verbose!==void 0?y.verbose:l.verbose;if(me==="json")console.log(JSON.stringify({errors:le,warnings:ge,issues:pe},null,2));else if(me==="compact")for(let ae of pe)console.log(`${Ln(process.cwd(),ae.filePath)}:${ae.line}:${ae.column} ${ae.severity} ${ae.ruleId} ${ae.message}`);else if(pe.length>0)console.log(xe?go(pe):bo(pe));if(pe.length>0&&me!=="json"){let ae=le+ge,ce=ae===1?"problem":"problems",ue=le===1?"error":"errors",he=ge===1?"warning":"warnings",oe=En(l),te=0,ke=0;for(let $e of pe){let Ce=$e.ruleId;if(oe.fixableRuleIds.has(Ce)||oe.fixableBareRuleNames.has(Ce)){if($e.severity==="error")te++;else if($e.severity==="warning")ke++}}if(console.log(),console.log(t.red(`\u2716 ${ae} ${ce} (${le} ${ue}, ${ge} ${he})`)),te>0||ke>0){let $e=te===1?"error":"errors",Ce=ke===1?"warning":"warnings";console.log(t.gray(` ${te} ${$e} and ${ke} ${Ce} potentially fixable with the \`--fix\` option.`))}}if(xe&&me!=="json")console.log(t.gray(`Scanned ${Q.length} files, found ${le} errors and ${ge} warnings.`));let de=y.maxWarnings??l.lint.maxWarnings,be=r.FAIL_ON_WARNINGS;if(le>0)return We("runLint:end",1),1;if(be&&ge>0)return We("runLint:end",1),1;if(de>=0&&ge>de)return We("runLint:end",1),1;return We("runLint:end",0),0}catch(l){return Se().error("[pickier:error] runLint failed:",l?.message||l),We("runLint:exception",l),1}}
124
+ export{R,H,W,A,U,V,v,K};