pickier 0.1.75 → 0.1.76

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/bin/cli.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env bun
2
2
  // @bun
3
- async function P(){let i=process.argv.slice(2),a=i[0]??"",x=a==="run",C=x||a==="lint"||a==="format"?1:0,c=x?"auto":a==="format"?"format":"lint",f=!1,m=!1,w=!1,k=!1,b,y,u=!1,d,h,l=[],v=!i.some((e)=>e==="version"||e==="help"||e==="--version"||e==="-v"||e==="--help"||e==="-h");for(let e=C;e<i.length;e++){let t=i[e];if(t==="--mode")c=i[++e]||"auto";else if(t==="--format")w=!0,c="format";else if(t==="--check")f=!0;else if(t==="--write")m=!0;else if(t==="--config")b=i[++e];else if(t==="--verbose")k=!0;else if(t==="--ext")y=i[++e];else if(t==="--ignore-path")e++;else if(t==="--cache")u=!0;else if(t==="--cache-location")d=i[++e];else if(t==="--reporter"){let o=i[++e];h=o==="json"||o==="compact"?o:"stylish"}else if(t==="--fix"||t==="--dry-run"||t==="--max-warnings"){v=!1,l.length=0;break}else if(t.startsWith("--"));else l.push(t)}if(w&&!f)m=!0;if(v&&(c==="format"||c==="auto"||c==="lint")&&l.length>0){let{runUnified:e}=await import("../chunk-9k028jfq.js"),t=await e(l,{mode:c,check:f,write:m,verbose:k,config:b,ext:y,...u&&{cache:u},...d&&{cacheLocation:d},...h&&{reporter:h}});process.exit(t)}let{CLI:U}=await import("../chunk-p0j2ra3t.js"),{version:I}=await import("../chunk-q50pq5mc.js"),r=new U("pickier"),p=(e)=>{let[t,o]=e;return[Array.isArray(t)?t.filter((g)=>typeof g==="string"):[],o&&typeof o==="object"?o:{}]};r.command("[...globs]","Lint files (default)").option("--fix","Auto-fix lint problems").option("--format","Format files instead of linting").option("--dry-run","Simulate fixes without writing").option("--check","Check formatting without writing (CI-friendly)").option("--max-warnings <n>","Max warnings before non-zero exit",{default:-1}).option("--reporter <name>","stylish|json|compact",{default:"stylish"}).option("--config <path>","Path to pickier config").option("--ignore-path <file>","Ignore file (like .gitignore)").option("--ext <exts>","Comma-separated extensions").option("--cache","Enable cache").option("--cache-location <path>","Where the cache lives (default .pickiercache)").option("--verbose","Verbose output").example("pickier .").example("pickier . --fix").example("pickier . --format").example("pickier src --fix --verbose").action(async(...e)=>{let[t,o]=p(e);if(t.length===0){r.outputHelp();return}let{runUnified:s}=await import("../chunk-9k028jfq.js"),n;if(o.format){if(n="format",!o.check)o.write=!0}else n="lint";let g=await s(t,{...o,mode:n});process.exit(g)}),r.command("lint [...globs]","[DEPRECATION] Use `pickier [...globs]` instead. Lint files").option("--fix","Auto-fix problems").option("--dry-run","Simulate fixes without writing").option("--max-warnings <n>","Max warnings before non-zero exit",{default:-1}).option("--reporter <name>","stylish|json|compact",{default:"stylish"}).option("--config <path>","Path to pickier config").option("--ignore-path <file>","Ignore file (like .gitignore)").option("--ext <exts>","Comma-separated extensions").option("--cache","Enable cache").option("--cache-location <path>","Where the cache lives (default .pickiercache)").option("--verbose","Verbose output").example("pickier lint .").example("pickier lint src --fix").example('pickier lint "src/**/*.{ts,tsx}" --reporter json').action(async(...e)=>{let[t,o]=p(e),{runUnified:s}=await import("../chunk-9k028jfq.js"),n=await s(t,{...o,mode:"lint"});process.exit(n)}),r.command("format [...globs]","[DEPRECATION] Use `pickier [...globs] --format` instead. Format files").option("--write","Write changes to files").option("--check","Check without writing (CI-friendly)").option("--config <path>","Path to pickier config").option("--ignore-path <file>","Ignore file").option("--ext <exts>","Comma-separated extensions").option("--verbose","Verbose output").example("pickier format . --write").example("pickier format . --check").action(async(...e)=>{let[t,o]=p(e),{runUnified:s}=await import("../chunk-9k028jfq.js"),n=await s(t,{...o,mode:"format"});process.exit(n)}),r.command("run [...globs]","Unified mode (auto, lint, or format)").option("--mode <mode>","auto|lint|format",{default:"auto"}).option("--fix","Auto-fix problems (lint mode)").option("--dry-run","Simulate fixes without writing (lint mode)").option("--max-warnings <n>","Max warnings before non-zero exit (lint mode)",{default:-1}).option("--reporter <name>","stylish|json|compact (lint mode)",{default:"stylish"}).option("--write","Write changes to files (format mode)").option("--check","Check without writing (format mode)").option("--config <path>","Path to pickier config").option("--ignore-path <file>","Ignore file (like .gitignore)").option("--ext <exts>","Comma-separated extensions").option("--cache","Enable cache (lint mode)").option("--cache-location <path>","Where the cache lives (default .pickiercache)").option("--verbose","Verbose output").example("pickier run . --mode lint --fix").example("pickier run . --mode format --write").action(async(...e)=>{let[t,o]=p(e),{runUnified:s}=await import("../chunk-9k028jfq.js"),n=await s(t,o);process.exit(n)}),r.command("version","Show the version of the CLI").action(async()=>{let{version:e}=await import("../chunk-q50pq5mc.js");process.stdout.write(`${e}
3
+ async function P(){let i=process.argv.slice(2),a=i[0]??"",x=a==="run",C=x||a==="lint"||a==="format"?1:0,c=x?"auto":a==="format"?"format":"lint",f=!1,m=!1,w=!1,k=!1,b,y,u=!1,d,h,l=[],v=!i.some((e)=>e==="version"||e==="help"||e==="--version"||e==="-v"||e==="--help"||e==="-h");for(let e=C;e<i.length;e++){let t=i[e];if(t==="--mode")c=i[++e]||"auto";else if(t==="--format")w=!0,c="format";else if(t==="--check")f=!0;else if(t==="--write")m=!0;else if(t==="--config")b=i[++e];else if(t==="--verbose")k=!0;else if(t==="--ext")y=i[++e];else if(t==="--ignore-path")e++;else if(t==="--cache")u=!0;else if(t==="--cache-location")d=i[++e];else if(t==="--reporter"){let o=i[++e];h=o==="json"||o==="compact"?o:"stylish"}else if(t==="--fix"||t==="--dry-run"||t==="--max-warnings"){v=!1,l.length=0;break}else if(t.startsWith("--"));else l.push(t)}if(w&&!f)m=!0;if(v&&(c==="format"||c==="auto"||c==="lint")&&l.length>0){let{runUnified:e}=await import("../chunk-3ezjct24.js"),t=await e(l,{mode:c,check:f,write:m,verbose:k,config:b,ext:y,...u&&{cache:u},...d&&{cacheLocation:d},...h&&{reporter:h}});process.exit(t)}let{CLI:U}=await import("../chunk-p0j2ra3t.js"),{version:I}=await import("../chunk-jdd9zkjc.js"),r=new U("pickier"),p=(e)=>{let[t,o]=e;return[Array.isArray(t)?t.filter((g)=>typeof g==="string"):[],o&&typeof o==="object"?o:{}]};r.command("[...globs]","Lint files (default)").option("--fix","Auto-fix lint problems").option("--format","Format files instead of linting").option("--dry-run","Simulate fixes without writing").option("--check","Check formatting without writing (CI-friendly)").option("--max-warnings <n>","Max warnings before non-zero exit",{default:-1}).option("--reporter <name>","stylish|json|compact",{default:"stylish"}).option("--config <path>","Path to pickier config").option("--ignore-path <file>","Ignore file (like .gitignore)").option("--ext <exts>","Comma-separated extensions").option("--cache","Enable cache").option("--cache-location <path>","Where the cache lives (default .pickiercache)").option("--verbose","Verbose output").example("pickier .").example("pickier . --fix").example("pickier . --format").example("pickier src --fix --verbose").action(async(...e)=>{let[t,o]=p(e);if(t.length===0){r.outputHelp();return}let{runUnified:s}=await import("../chunk-3ezjct24.js"),n;if(o.format){if(n="format",!o.check)o.write=!0}else n="lint";let g=await s(t,{...o,mode:n});process.exit(g)}),r.command("lint [...globs]","[DEPRECATION] Use `pickier [...globs]` instead. Lint files").option("--fix","Auto-fix problems").option("--dry-run","Simulate fixes without writing").option("--max-warnings <n>","Max warnings before non-zero exit",{default:-1}).option("--reporter <name>","stylish|json|compact",{default:"stylish"}).option("--config <path>","Path to pickier config").option("--ignore-path <file>","Ignore file (like .gitignore)").option("--ext <exts>","Comma-separated extensions").option("--cache","Enable cache").option("--cache-location <path>","Where the cache lives (default .pickiercache)").option("--verbose","Verbose output").example("pickier lint .").example("pickier lint src --fix").example('pickier lint "src/**/*.{ts,tsx}" --reporter json').action(async(...e)=>{let[t,o]=p(e),{runUnified:s}=await import("../chunk-3ezjct24.js"),n=await s(t,{...o,mode:"lint"});process.exit(n)}),r.command("format [...globs]","[DEPRECATION] Use `pickier [...globs] --format` instead. Format files").option("--write","Write changes to files").option("--check","Check without writing (CI-friendly)").option("--config <path>","Path to pickier config").option("--ignore-path <file>","Ignore file").option("--ext <exts>","Comma-separated extensions").option("--verbose","Verbose output").example("pickier format . --write").example("pickier format . --check").action(async(...e)=>{let[t,o]=p(e),{runUnified:s}=await import("../chunk-3ezjct24.js"),n=await s(t,{...o,mode:"format"});process.exit(n)}),r.command("run [...globs]","Unified mode (auto, lint, or format)").option("--mode <mode>","auto|lint|format",{default:"auto"}).option("--fix","Auto-fix problems (lint mode)").option("--dry-run","Simulate fixes without writing (lint mode)").option("--max-warnings <n>","Max warnings before non-zero exit (lint mode)",{default:-1}).option("--reporter <name>","stylish|json|compact (lint mode)",{default:"stylish"}).option("--write","Write changes to files (format mode)").option("--check","Check without writing (format mode)").option("--config <path>","Path to pickier config").option("--ignore-path <file>","Ignore file (like .gitignore)").option("--ext <exts>","Comma-separated extensions").option("--cache","Enable cache (lint mode)").option("--cache-location <path>","Where the cache lives (default .pickiercache)").option("--verbose","Verbose output").example("pickier run . --mode lint --fix").example("pickier run . --mode format --write").action(async(...e)=>{let[t,o]=p(e),{runUnified:s}=await import("../chunk-3ezjct24.js"),n=await s(t,o);process.exit(n)}),r.command("version","Show the version of the CLI").action(async()=>{let{version:e}=await import("../chunk-jdd9zkjc.js");process.stdout.write(`${e}
4
4
  `)}),r.version(I),r.help(),r.parse()}P().catch((i)=>{let a=i instanceof Error?i.message:String(i);process.stderr.write(`pickier: ${a}
5
5
  `),process.exit(1)});
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- var oe="pickier",ae="module",F="0.1.75",le="Format, lint and more in a fraction of seconds.",ce="Chris Breuer <chris@stacksjs.org>",ue="MIT",fe="https://github.com/pickier/pickier#readme",me={type:"git",url:"git+https://github.com/pickier/pickier.git"},he={url:"https://github.com/pickier/pickier/issues"},de=["pickier","linter","formatter","bun","fast"],pe={".":{types:"./dist/src/index.d.ts",import:"./dist/src/index.js"},"./*":{import:"./dist/*"}},ge="./dist/src/index.js",ye="./dist/src/index.d.ts",be={pickier:"./dist/bin/cli.js"},we=["README.md","dist"],xe={build:"bun --bun build.ts","build:bin":"bun --bun build.ts && bun run compile","build:native":"bun scripts/build-native.ts",compile:"bun build ./bin/cli.ts --compile --minify --outfile bin/pickier","compile:all":"bun run compile:linux-x64 && bun run compile:linux-arm64 && bun run compile:linux-x64-musl && bun run compile:linux-arm64-musl && bun run compile:windows-x64 && bun run compile:windows-arm64 && bun run compile:darwin-x64 && bun run compile:darwin-arm64","compile:linux-x64":"bun build ./bin/cli.ts --compile --minify --target=bun-linux-x64 --outfile bin/pickier-linux-x64","compile:linux-arm64":"bun build ./bin/cli.ts --compile --minify --target=bun-linux-arm64 --outfile bin/pickier-linux-arm64","compile:linux-x64-musl":"bun build ./bin/cli.ts --compile --minify --target=bun-linux-x64-musl --outfile bin/pickier-linux-x64-musl","compile:linux-arm64-musl":"bun build ./bin/cli.ts --compile --minify --target=bun-linux-arm64-musl --outfile bin/pickier-linux-arm64-musl","compile:windows-x64":"bun build ./bin/cli.ts --compile --minify --target=bun-windows-x64 --outfile bin/pickier-windows-x64.exe","compile:windows-arm64":"bun build ./bin/cli.ts --compile --minify --target=bun-windows-arm64 --outfile bin/pickier-windows-arm64.exe","compile:darwin-x64":"bun build ./bin/cli.ts --compile --minify --target=bun-darwin-x64 --outfile bin/pickier-darwin-x64","compile:darwin-arm64":"bun build ./bin/cli.ts --compile --minify --target=bun-darwin-arm64 --outfile bin/pickier-darwin-arm64",zip:"bun run zip:all","zip:all":"bun run zip:linux-x64 && bun run zip:linux-arm64 && bun run zip:linux-x64-musl && bun run zip:linux-arm64-musl && bun run zip:windows-x64 && bun run zip:windows-arm64 && bun run zip:darwin-x64 && bun run zip:darwin-arm64","zip:linux-x64":"zip -j bin/pickier-linux-x64.zip bin/pickier-linux-x64","zip:linux-arm64":"zip -j bin/pickier-linux-arm64.zip bin/pickier-linux-arm64","zip:linux-x64-musl":"zip -j bin/pickier-linux-x64-musl.zip bin/pickier-linux-x64-musl","zip:linux-arm64-musl":"zip -j bin/pickier-linux-arm64-musl.zip bin/pickier-linux-arm64-musl","zip:windows-x64":"zip -j bin/pickier-windows-x64.zip bin/pickier-windows-x64.exe","zip:windows-arm64":"zip -j bin/pickier-windows-arm64.zip bin/pickier-windows-arm64.exe","zip:darwin-x64":"zip -j bin/pickier-darwin-x64.zip bin/pickier-darwin-x64","zip:darwin-arm64":"zip -j bin/pickier-darwin-arm64.zip bin/pickier-darwin-arm64",prepublishOnly:"bun --bun run build && bun scripts/build-native.ts --required && bun run compile:all && bun run zip",test:"PICKIER_NO_AUTO_CONFIG=1 bun test --coverage","test:core":"PICKIER_NO_AUTO_CONFIG=1 bun test test/core","test:format":"PICKIER_NO_AUTO_CONFIG=1 bun test test/format","test:lint":"PICKIER_NO_AUTO_CONFIG=1 bun test test/lint","test:rules":"PICKIER_NO_AUTO_CONFIG=1 bun test test/rules","test:rules:sort":"PICKIER_NO_AUTO_CONFIG=1 bun test test/rules/sort","test:rules:style":"PICKIER_NO_AUTO_CONFIG=1 bun test test/rules/style","test:rules:quality":"PICKIER_NO_AUTO_CONFIG=1 bun test test/rules/quality","test:rules:imports":"PICKIER_NO_AUTO_CONFIG=1 bun test test/rules/imports","test:rules:typescript":"PICKIER_NO_AUTO_CONFIG=1 bun test test/rules/typescript","test:rules:regexp":"PICKIER_NO_AUTO_CONFIG=1 bun test test/rules/regexp","test:plugin":"PICKIER_NO_AUTO_CONFIG=1 bun test test/plugin","test:watch":"PICKIER_NO_AUTO_CONFIG=1 bun test --watch"},ke={"@stacksjs/clarity":"^0.3.24","@stacksjs/clapp":"^0.2.3"},Re={"@stacksjs/ts-spell-check":"^0.1.0"},$e={bunfig:"^0.15.13"},ve={name:oe,type:ae,version:F,description:le,author:ce,license:ue,homepage:fe,repository:me,bugs:he,keywords:de,exports:pe,module:ge,types:ye,bin:be,files:we,scripts:xe,dependencies:ke,optionalDependencies:Re,devDependencies:$e};
2
+ var oe="pickier",ae="module",F="0.1.76",le="Format, lint and more in a fraction of seconds.",ce="Chris Breuer <chris@stacksjs.org>",ue="MIT",fe="https://github.com/pickier/pickier#readme",me={type:"git",url:"git+https://github.com/pickier/pickier.git"},he={url:"https://github.com/pickier/pickier/issues"},de=["pickier","linter","formatter","bun","fast"],pe={".":{types:"./dist/src/index.d.ts",import:"./dist/src/index.js"},"./*":{import:"./dist/*"}},ge="./dist/src/index.js",ye="./dist/src/index.d.ts",be={pickier:"./dist/bin/cli.js"},we=["README.md","dist"],xe={build:"bun --bun build.ts","build:bin":"bun --bun build.ts && bun run compile","build:native":"bun scripts/build-native.ts",compile:"bun build ./bin/cli.ts --compile --minify --outfile bin/pickier","compile:all":"bun run compile:linux-x64 && bun run compile:linux-arm64 && bun run compile:linux-x64-musl && bun run compile:linux-arm64-musl && bun run compile:windows-x64 && bun run compile:windows-arm64 && bun run compile:darwin-x64 && bun run compile:darwin-arm64","compile:linux-x64":"bun build ./bin/cli.ts --compile --minify --target=bun-linux-x64 --outfile bin/pickier-linux-x64","compile:linux-arm64":"bun build ./bin/cli.ts --compile --minify --target=bun-linux-arm64 --outfile bin/pickier-linux-arm64","compile:linux-x64-musl":"bun build ./bin/cli.ts --compile --minify --target=bun-linux-x64-musl --outfile bin/pickier-linux-x64-musl","compile:linux-arm64-musl":"bun build ./bin/cli.ts --compile --minify --target=bun-linux-arm64-musl --outfile bin/pickier-linux-arm64-musl","compile:windows-x64":"bun build ./bin/cli.ts --compile --minify --target=bun-windows-x64 --outfile bin/pickier-windows-x64.exe","compile:windows-arm64":"bun build ./bin/cli.ts --compile --minify --target=bun-windows-arm64 --outfile bin/pickier-windows-arm64.exe","compile:darwin-x64":"bun build ./bin/cli.ts --compile --minify --target=bun-darwin-x64 --outfile bin/pickier-darwin-x64","compile:darwin-arm64":"bun build ./bin/cli.ts --compile --minify --target=bun-darwin-arm64 --outfile bin/pickier-darwin-arm64",zip:"bun run zip:all","zip:all":"bun run zip:linux-x64 && bun run zip:linux-arm64 && bun run zip:linux-x64-musl && bun run zip:linux-arm64-musl && bun run zip:windows-x64 && bun run zip:windows-arm64 && bun run zip:darwin-x64 && bun run zip:darwin-arm64","zip:linux-x64":"zip -j bin/pickier-linux-x64.zip bin/pickier-linux-x64","zip:linux-arm64":"zip -j bin/pickier-linux-arm64.zip bin/pickier-linux-arm64","zip:linux-x64-musl":"zip -j bin/pickier-linux-x64-musl.zip bin/pickier-linux-x64-musl","zip:linux-arm64-musl":"zip -j bin/pickier-linux-arm64-musl.zip bin/pickier-linux-arm64-musl","zip:windows-x64":"zip -j bin/pickier-windows-x64.zip bin/pickier-windows-x64.exe","zip:windows-arm64":"zip -j bin/pickier-windows-arm64.zip bin/pickier-windows-arm64.exe","zip:darwin-x64":"zip -j bin/pickier-darwin-x64.zip bin/pickier-darwin-x64","zip:darwin-arm64":"zip -j bin/pickier-darwin-arm64.zip bin/pickier-darwin-arm64",prepublishOnly:"bun --bun run build && bun scripts/build-native.ts --required && bun run compile:all && bun run zip",test:"PICKIER_NO_AUTO_CONFIG=1 bun test --coverage","test:core":"PICKIER_NO_AUTO_CONFIG=1 bun test test/core","test:format":"PICKIER_NO_AUTO_CONFIG=1 bun test test/format","test:lint":"PICKIER_NO_AUTO_CONFIG=1 bun test test/lint","test:rules":"PICKIER_NO_AUTO_CONFIG=1 bun test test/rules","test:rules:sort":"PICKIER_NO_AUTO_CONFIG=1 bun test test/rules/sort","test:rules:style":"PICKIER_NO_AUTO_CONFIG=1 bun test test/rules/style","test:rules:quality":"PICKIER_NO_AUTO_CONFIG=1 bun test test/rules/quality","test:rules:imports":"PICKIER_NO_AUTO_CONFIG=1 bun test test/rules/imports","test:rules:typescript":"PICKIER_NO_AUTO_CONFIG=1 bun test test/rules/typescript","test:rules:regexp":"PICKIER_NO_AUTO_CONFIG=1 bun test test/rules/regexp","test:plugin":"PICKIER_NO_AUTO_CONFIG=1 bun test test/plugin","test:watch":"PICKIER_NO_AUTO_CONFIG=1 bun test --watch"},ke={"@stacksjs/clarity":"^0.3.24","@stacksjs/clapp":"^0.2.3"},Re={"@stacksjs/ts-spell-check":"^0.1.0"},$e={bunfig:"^0.15.13"},ve={name:oe,type:ae,version:F,description:le,author:ce,license:ue,homepage:fe,repository:me,bugs:he,keywords:de,exports:pe,module:ge,types:ye,bin:be,files:we,scripts:xe,dependencies:ke,optionalDependencies:Re,devDependencies:$e};
3
3
  export{oe,ae,F,le,ce,ue,fe,me,he,de,pe,ge,ye,be,we,xe,ke,Re,$e,ve};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{B}from"./chunk-t5wtga4g.js";import"./chunk-mq0hh9yt.js";export{B as runUnified};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{oe,ae,F,le,ce,ue,fe,me,he,de,pe,ge,ye,be,we,xe,ke,Re,$e,ve}from"./chunk-hm7sfaz3.js";export{ce as author,be as bin,he as bugs,ve as default,ke as dependencies,le as description,$e as devDependencies,pe as exports,we as files,fe as homepage,de as keywords,ue as license,ge as module,oe as name,Re as optionalDependencies,me as repository,xe as scripts,ae as type,ye as types,F as version};
2
+ import{oe,ae,F,le,ce,ue,fe,me,he,de,pe,ge,ye,be,we,xe,ke,Re,$e,ve}from"./chunk-10et4075.js";export{ce as author,be as bin,he as bugs,ve as default,ke as dependencies,le as description,$e as devDependencies,pe as exports,we as files,fe as homepage,de as keywords,ue as license,ge as module,oe as name,Re as optionalDependencies,me as repository,xe as scripts,ae as type,ye as types,F as version};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{p,u}from"./chunk-mq0hh9yt.js";import{readFileSync as O,statSync as y,writeFileSync as x}from"fs";import{isAbsolute as d,resolve as l}from"path";function o(r){return r.write===!0||r.fix===!0}async function B(r,t){let a=t.mode||"auto";if(a==="format"&&r.length===1&&!/[*?[\]{}()!]/.test(r[0]))try{let n=r[0],i=d(n)?n:l(process.cwd(),n);if(y(i).isFile()){let m=await u(t.config),f=O(i,"utf8"),c=p(f,m,i);if(c===f)return 0;if(o(t))return x(i,c,"utf8"),0}}catch{}let{runLint:e}=await import("./chunk-n224szdq.js");if(a==="lint")return e(r,t);if(a==="format"){let n={...t,fix:!0,dryRun:!o(t),ext:t.ext,_formatOnly:!0};return e(r,n)}if(!(t.fix===!0||t.write===!0||t.check===!0))return e(r,t);let s={...t,fix:!0,dryRun:!!t.check,ext:t.ext};return e(r,s)}
2
+ import{p,u}from"./chunk-mq0hh9yt.js";import{readFileSync as O,statSync as y,writeFileSync as x}from"fs";import{isAbsolute as d,resolve as l}from"path";function o(r){return r.write===!0||r.fix===!0}async function B(r,t){let a=t.mode||"auto";if(a==="format"&&r.length===1&&!/[*?[\]{}()!]/.test(r[0]))try{let n=r[0],i=d(n)?n:l(process.cwd(),n);if(y(i).isFile()){let m=await u(t.config),f=O(i,"utf8"),c=p(f,m,i);if(c===f)return 0;if(o(t))return x(i,c,"utf8"),0}}catch{}let{runLint:e}=await import("./chunk-w8g51z9j.js");if(a==="lint")return e(r,t);if(a==="format"){let n={...t,fix:!0,dryRun:!o(t),ext:t.ext,_formatOnly:!0};return e(r,n)}if(!(t.fix===!0||t.write===!0||t.check===!0))return e(r,t);let s={...t,fix:!0,dryRun:!!t.check,ext:t.ext};return e(r,s)}
3
3
  export{B};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{W,A,U,V,v,K}from"./chunk-w9jfz4rm.js";import"./chunk-mq0hh9yt.js";import"./chunk-10et4075.js";export{A as fixText,v as lintFileForRun,W as lintText,V as plannedCheckRules,K as runLint,U as runLintProgrammatic};
@@ -1,5 +1,5 @@
1
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(`
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-10et4075.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 te=J===w?X:l[J];for(let Q=0;Q<te.length;Q++){let ee=te[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(te.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 te=0;te<J.length;te++){let Q=J[te];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
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
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
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(`
@@ -7,35 +7,35 @@ 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";imp
7
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
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
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(`
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]:" ",te=X+6<z.length?z[X+6]:" ";if(/\w/.test(J)||/\w/.test(te))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=(me,oe)=>{let de=new RegExp(`\\b${me}\\b`,"g");if(me.includes("$"))return de.test(`${_.slice(0,oe).join(`
11
11
  `)}
12
- ${_.slice(re+1).join(`
12
+ ${_.slice(oe+1).join(`
13
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}
14
+ `),z=Array.from({length:_.length});let pe=0;for(let xe=0;xe<_.length;xe++)z[xe]=pe,pe+=_[xe].length+1}let ae=z[oe],ge=ae+_[oe].length;for(let pe=de.exec(Z);pe!==null;pe=de.exec(Z)){if(pe.index<ae||pe.index>=ge)return!0;if(pe[0].length===0)de.lastIndex++}return!1},X=new RegExp("^\\s*(?:const|let|var)\\s+(.+?);?\\s*$");for(let me=0;me<_.length;me++){if(B[me])continue;let oe=_[me],de=oe.match(X);if(!de)continue;let ae=de[1],ge=[],pe="",xe=0,he=0,we=null,se=!1;for(let ue=0;ue<ae.length;ue++){let fe=ae[ue];if(se){se=!1,pe+=fe;continue}if(fe==="\\"&&we){se=!0,pe+=fe;continue}if(!we){if(fe==="/"&&ae[ue+1]==="/")break;if(fe==="/"&&ae[ue+1]==="*"){ue+=2;while(ue<ae.length&&!(ae[ue]==="*"&&ae[ue+1]==="/"))ue++;ue++;continue}if(fe==="'")we="single";else if(fe==='"')we="double";else if(fe==="`")we="template";else if(fe==="<")he++;else if(fe===">")he--;else if(fe==="("||fe==="["||fe==="{")xe++;else if(fe===")"||fe==="]"||fe==="}")xe--;else if(fe===","&&xe===0&&he===0){ge.push(pe),pe="";continue}}else if(we==="single"&&fe==="'"||we==="double"&&fe==='"'||we==="template"&&fe==="`")we=null;pe+=fe}if(pe)ge.push(pe);for(let ue of ge){let fe=ue.trim();if(!fe)continue;let Ce=fe.match(/^([$A-Z_][\w$]*)/i),ne=[];if(Ce)ne.push(Ce[1]);else if(fe.startsWith("{")||fe.startsWith("[")){let le=fe[0],ce=le==="{"?"}":"]",Pe=0,Le=-1,Me=null,Te=!1;for(let Oe=0;Oe<fe.length;Oe++){let ve=fe[Oe];if(Te){Te=!1;continue}if(ve==="\\"&&Me){Te=!0;continue}if(!Me){if(ve==="'"||ve==='"'||ve==="`")Me=ve==="'"?"single":ve==='"'?"double":"template";else if(ve===le)Pe++;else if(ve===ce){if(Pe--,Pe===0){Le=Oe;break}}}else if(Me==="single"&&ve==="'"||Me==="double"&&ve==='"'||Me==="template"&&ve==="`")Me=null}if(Le>0){let Oe=fe.slice(1,Le),ve=[],_e="",Ee=0,Ae=null,ke=!1;for(let Ie=0;Ie<Oe.length;Ie++){let be=Oe[Ie];if(ke){ke=!1,_e+=be;continue}if(be==="\\"&&Ae){ke=!0,_e+=be;continue}if(!Ae){if(be==="'"||be==='"'||be==="`"){Ae=be==="'"?"single":be==='"'?"double":"template",_e+=be;continue}if(be==="("||be==="{"||be==="[")Ee++;if(be===")"||be==="}"||be==="]")Ee--;if(be===","&&Ee===0){ve.push(_e.trim()),_e="";continue}}else if(Ae==="single"&&be==="'"||Ae==="double"&&be==='"'||Ae==="template"&&be==="`")Ae=null;_e+=be}if(_e.trim())ve.push(_e.trim());for(let Ie of ve){if(Ie.startsWith("...")){let $e=Ie.slice(3).match(/^([$A-Z_][\w$]*)/i);if($e)ne.push($e[1]);continue}let be=Ie.indexOf(":");if(be!==-1){let $e=Ie.slice(be+1).trim(),Ue=0;for(let Fe=0;Fe<$e.length;Fe++){let Ne=$e[Fe];if(Ne==="("||Ne==="{"||Ne==="[")Ue++;else if(Ne===")"||Ne==="}"||Ne==="]")Ue--;else if(Ne==="="&&Ue===0){$e=$e.slice(0,Fe).trim();break}}let De=$e.match(/^([$A-Z_][\w$]*)/i);if(De)ne.push(De[1])}else{let $e=Ie,Ue=0;for(let Fe=0;Fe<$e.length;Fe++){let Ne=$e[Fe];if(Ne==="("||Ne==="{"||Ne==="[")Ue++;else if(Ne===")"||Ne==="}"||Ne==="]")Ue--;else if(Ne==="="&&Ue===0){$e=$e.slice(0,Fe).trim();break}}let De=$e.match(/^([$A-Z_][\w$]*)/i);if(De)ne.push(De[1])}}}}for(let le of ne){if(w.test(le))continue;let ce=j[me],Pe=new RegExp(`(?<![\\w$])${le.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}(?![\\w$])`,"g"),Le=!1,Me=oe.indexOf(le,oe.indexOf(ue));for(let Te of ce.matchAll(Pe)){let Oe=ce.slice(0,Te.index).trimEnd(),ve=ce.slice(Te.index+le.length).trimStart();if(Te.index===Me||Oe.endsWith(".")||ve.startsWith(":"))continue;Le=!0;break}if(!Le&&!Y(le,me))s.push({filePath:y.filePath,line:me+1,column:Math.max(1,oe.indexOf(le)+1),ruleId:"pickier/no-unused-vars",message:`'${le}' 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 (_${le}) to mark it as intentionally unused`})}}}let J=(me)=>{let de=((pe)=>{let xe="",he=null,we=!1,se=0;for(let ue=0;ue<pe.length;ue++){let fe=pe[ue];if(we){we=!1;continue}if(fe==="\\"&&he){we=!0;continue}if(!he){if(fe==="'")he="single";else if(fe==='"')he="double";else if(fe==="`")he="template";else if(fe==="("||fe==="{"||fe==="[")se++;else if(fe===")"||fe==="}"||fe==="]")se--;else if(fe==="="&&se===0)return xe}else if(he==="single"&&fe==="'"||he==="double"&&fe==='"'||he==="template"&&fe==="`")he=null;xe+=fe}return xe})(me);return((pe)=>{let xe="",he=0;while(he<pe.length){let we=pe[he];if(we===":"){he++;while(he<pe.length&&/\s/.test(pe[he]))he++;let se=0,ue=0,fe=null,Ce=!1;while(he<pe.length){let ne=pe[he];if(Ce){Ce=!1,he++;continue}if(ne==="\\"&&fe){Ce=!0,he++;continue}if(!fe){if(ne==="'")fe="single";else if(ne==='"')fe="double";else if(ne==="`")fe="template";else if(ne==="<")ue++;else if(ne===">")ue--;else if(ne==="("||ne==="{"||ne==="[")se++;else if(ne===")"||ne==="}"||ne==="]")if(se>0)se--;else break;else if(ne===","&&se===0&&ue===0)break}else if(fe==="single"&&ne==="'"||fe==="double"&&ne==='"'||fe==="template"&&ne==="`")fe=null;he++}continue}xe+=we,he++}return xe})(de).split(/[^$\w]+/).filter((pe)=>pe&&pe!=="undefined")},te=(me,oe)=>{let de=/^\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 ae=me;ae<_.length;ae++){let pe=(ae===me?_[ae].slice(oe+1):_[ae]).replace(/\/\/.*$/,"");if(ae!==me&&de.test(pe))return!0;if(pe.includes("{"))return!1;if(pe.includes(";"))return!0}return!0},Q=(me,oe)=>{let de=0,ae=!1,ge=0,pe=0,xe=!1,he=0,we=null,se=!1,ue=!0,fe="",Ce=!1,ne=!1,le=[],ce=!1;for(let Pe=me;Pe<_.length;Pe++){let Le=_[Pe],Me=Le,Te=le.length>0&&le[le.length-1]===-1,Oe=-1,ve=null,_e=!1;if(!Te)for(let ke=0;ke<Le.length-1;ke++){let Ie=Le[ke],be=Le[ke+1];if(_e){_e=!1;continue}if(Ie==="\\"&&ve){_e=!0;continue}if(!ve){if(Ie==="'")ve="single";else if(Ie==='"')ve="double";else if(Ie==="`")ve="template";else if(Ie==="/"&&be==="/"){Oe=ke;break}}else if(ve==="single"&&Ie==="'"||ve==="double"&&Ie==='"'||ve==="template"&&Ie==="`")ve=null}if(Oe>=0)Me=Le.slice(0,Oe);let Ee=(ke)=>{let Ie="",be=0,$e=null,Ue=!1;while(be<ke.length){let De=ke[be];if(Ue){Ue=!1,Ie+=De,be++;continue}if(De==="\\"&&$e){Ue=!0,Ie+=De,be++;continue}if(!$e){if(De==="'")$e="single";else if(De==='"')$e="double";else if(De==="`")$e="template";else if(De==="/"){if(bn(ke,be)){let Fe=be,Ne=!1;be++;while(be<ke.length){if(ke[be]==="\\"){be+=2;continue}if(ke[be]==="[")Ne=!0;else if(ke[be]==="]")Ne=!1;if(ke[be]==="/"&&!Ne){be++;while(be<ke.length&&/[gimsuvy]/.test(ke[be]))be++;break}be++}Ie+=" ".repeat(Math.min(be,ke.length)-Fe);continue}}}else if($e==="single"&&De==="'"||$e==="double"&&De==='"'||$e==="template"&&De==="`")$e=null;Ie+=De,be++}return Ie};if(!Te)Me=Ee(Me);let Ae=0;if(!ae){let ke=-1,Ie=ue?typeof oe==="number"?oe:0:0;if(ue=!1,Ie>=Me.length){let be=Me.indexOf("=>");Ie=be>=0?be+2:0}for(let be=Ie;be<Me.length;be++){let $e=Me[be];if(se){se=!1;continue}if($e==="\\"&&we){se=!0;continue}if(!we){if($e!==" "&&$e!=="\t"&&$e!==`
15
+ `&&$e!=="\r"&&$e!=="{"&&$e!=="}"&&pe===0)fe=$e;if($e==="'")we="single";else if($e==='"')we="double";else if($e==="`")we="template";else if($e==="<")he++;else if($e===">")he=Math.max(0,he-1);else if($e==="{"){if(pe===0){if(xe&&he===0&&!os.has(fe)){ke=be;break}}pe++}else if($e==="}"){if(pe>0){if(pe--,pe===0)xe=!0,fe="}"}}}else if(we==="single"&&$e==="'"||we==="double"&&$e==='"'||we==="template"&&$e==="`")we=null}if(ke===-1){if(he>0)continue;if(pe>0&&os.has(fe))continue;for(let be=Ie;be<Me.length;be++)if(Me[be]==="{"&&!we){ke=be;break}}if(ke===-1)continue;ae=!0,ge=1,Ae=ke+1,de=ke,me=Pe}for(let ke=Ae;ke<Me.length;ke++){let Ie=Me[ke];if(ce){ce=!1;continue}let be=le.length>0&&le[le.length-1]===-1,$e=le.length>0&&le[le.length-1]>=0;if(Ie==="\\"&&(Ce||ne||be)){ce=!0;continue}if(Ce){if(Ie==="'")Ce=!1;continue}if(ne){if(Ie==='"')ne=!1;continue}if(be){if(Ie==="`")le.pop();else if(Ie==="$"&&ke+1<Me.length&&Me[ke+1]==="{")le[le.length-1]=0,ke++;continue}if($e){if(Ie==="/"){if(bn(Me,ke)){ke++;while(ke<Me.length){if(Me[ke]==="\\"){ke+=2;continue}if(Me[ke]==="/"){while(ke+1<Me.length&&/[gimsuvy]/.test(Me[ke+1]))ke++;break}ke++}continue}}if(Ie==="`"){le.push(-1);continue}if(Ie==="'"){Ce=!0;continue}if(Ie==='"'){ne=!0;continue}if(Ie==="{"){le[le.length-1]++;continue}if(Ie==="}")if(le[le.length-1]>0)le[le.length-1]--;else le[le.length-1]=-1;continue}if(Ie==="'")Ce=!0;else if(Ie==='"')ne=!0;else if(Ie==="`")le.push(-1);else if(Ie==="{")ge++;else if(Ie==="}"){if(ge--,ge===0)return{from:me,to:Pe,openCol:de}}}}return null},ee=(me,oe)=>{let de={parenDepth:0,braceDepth:0,bracketDepth:0,inTemplate:!1},ae=(ue)=>{for(let fe=0;fe<ue.length;fe++){let Ce=ue[fe];if(Ce==="`")de.inTemplate=!de.inTemplate;else if(Ce==="(")de.parenDepth++;else if(Ce===")")de.parenDepth--;else if(Ce==="{")de.braceDepth++;else if(Ce==="}")de.braceDepth--;else if(Ce==="[")de.bracketDepth++;else if(Ce==="]")de.bracketDepth--}},ge=()=>de.parenDepth>0||de.braceDepth>0||de.bracketDepth>0||de.inTemplate,pe=(ue)=>/(?:\?|:|\.|,|&&|\|\||\?\?|\+|-|\*|\/|%|\*\*)$/.test(ue.trimEnd()),xe=(ue)=>/^(?:\?|:|\.|,|&&|\|\||\?\?|\+|-|\*|\/|%|\*\*)/.test(ue.trimStart()),he=_[me].slice(oe+2);ae(he);let we=he.trim()!=="",se=me+1;while(se<_.length){let ue=se===me+1?he:_[se-1];if(!(!we||ge()||pe(ue)||xe(_[se])))break;he+=`
16
+ ${_[se]}`,we||=_[se].trim()!=="",ae(_[se]),se++}return he},re=[],ye=!1,Re=!1,ie=!1;for(let me=0;me<_.length;me++){let oe=_[me];if(/^\s*\/\//.test(oe))continue;if(B[me])continue;let de=oe,ae=null,ge=!1,pe=!1;for(let ne=0;ne<oe.length-1;ne++){let le=oe[ne],ce=oe[ne+1];if(pe){pe=!1;continue}if(le==="\\"&&(ae||ge)){pe=!0;continue}if(!ae&&!ge){if(le==="'")ae="single";else if(le==='"')ae="double";else if(le==="`")ae="template";else if(le==="/"){if(bn(oe,ne))ge=!0;else if(ce==="/"){de=oe.slice(0,ne);break}}}else if(ae){if(ae==="single"&&le==="'"||ae==="double"&&le==='"'||ae==="template"&&le==="`")ae=null}else if(ge&&le==="/")ge=!1}let he=((ne)=>{let le="",ce=0;while(ce<ne.length){if(ne[ce]==="/"){if(bn(ne,ce)){let Pe=ce;ce++;while(ce<ne.length){if(ne[ce]==="\\"){ce+=2;continue}if(ne[ce]==="/"){ce++;while(ce<ne.length&&/[gimsuvy]/.test(ne[ce]))ce++;break}ce++}le+=" ".repeat(Math.min(ce,ne.length)-Pe);continue}}le+=ne[ce],ce++}return le})(de),we=(ne)=>`${ne[0]}${" ".repeat(ne.length-2)}${ne[ne.length-1]}`,se=he.replace(/'(?:[^'\\]|\\.)*'/g,we).replace(/"(?:[^"\\]|\\.)*"/g,we);if(!(!ie&&!ye&&!Re&&re.length===0&&!se.includes("`")&&!se.includes("'")&&!se.includes('"'))){let ne="";for(let le=0;le<se.length;le++){let ce=se[le];if(ie){ie=!1;let Me=re.length>0&&re[re.length-1]===-1;ne+=Me?" ":ce;continue}let Pe=re.length>0&&re[re.length-1]===-1,Le=re.length>0&&re[re.length-1]>=0;if(ce==="\\"&&(ye||Re||Pe)){ie=!0,ne+=Pe?" ":ce;continue}if(ye){if(ce==="'")ye=!1;ne+=ce;continue}if(Re){if(ce==='"')Re=!1;ne+=ce;continue}if(Pe){if(ce==="`")re.pop();else if(ce==="$"&&le+1<se.length&&se[le+1]==="{")re[re.length-1]=0,ne+=" ",le++;else ne+=" ";continue}if(Le){if(ce==="`")re.push(-1),ne+=" ";else if(ce==="'")ye=!0,ne+=ce;else if(ce==='"')Re=!0,ne+=ce;else if(ce==="{")re[re.length-1]++,ne+=ce;else if(ce==="}")if(re[re.length-1]>0)re[re.length-1]--,ne+=ce;else re[re.length-1]=-1,ne+=" ";else ne+=ce;continue}if(ce==="`")re.push(-1),ne+=" ";else if(ce==="'")ye=!0,ne+=ce;else if(ce==='"')Re=!0,ne+=ce;else ne+=ce}se=ne}let fe=se.match(/\bfunction\b/);if(fe){if(oe.includes("function scanContent")||oe.includes("function findMatching"))continue;if(se.slice(fe.index+8).trimStart().startsWith(":"))continue;let le=se.slice(0,fe.index).trimEnd();if(le.endsWith(".")||le.endsWith("?."))continue;let ce=fe.index,Pe=oe.indexOf("(",ce);if(Pe===-1)continue;let Le=0,Me=-1,Te=me,Oe="";for(let Ae=me;Ae<_.length;Ae++){let ke=Ae===me?_[Ae]:_[Ae],Ie=Ae===me?Pe:0;for(let be=Ie;be<ke.length;be++)if(ke[be]==="(")Le++;else if(ke[be]===")"){if(Le--,Le===0){if(Me=be,Te=Ae,me===Ae)Oe=oe.slice(Pe+1,Me);else{Oe=oe.slice(Pe+1);for(let $e=me+1;$e<Ae;$e++)Oe+=` ${_[$e]}`;Oe+=` ${ke.slice(0,Me)}`}break}}if(Me!==-1)break}if(Me===-1)continue;if(te(Te,Me))continue;let ve=J(Oe),_e=Q(Te,Me),Ee="";if(_e)if(_e.from===Te){let Ae=_[_e.from],ke=_e.openCol,Ie=ke>=0?Ae.slice(ke+1):"";if(_e.to>_e.from)Ee=`${Ie}
17
+ ${_.slice(_e.from+1,_e.to+1).join(`
18
+ `)}`;else Ee=Ie}else Ee=_.slice(_e.from,_e.to+1).join(`
19
+ `);for(let Ae of ve){if(!Ae||a.test(Ae)||Ae==="undefined")continue;if(!new RegExp(`\\b${Ae}\\b`,"g").test(Ee))s.push({filePath:y.filePath,line:me+1,column:Math.max(1,oe.indexOf(Ae)+1),ruleId:"pickier/no-unused-vars",message:`'${Ae}' is defined but never used (function parameter). Allowed unused args must match pattern: ${i}`,severity:"error"})}continue}let Ce=oe.indexOf("=>");if(Ce!==-1&&se.includes("=>")){let ne=-1;for(let le=Ce-1;le>=0;le--){let ce=oe[le];if(ce===")"){ne=le;break}if(ce!==" "&&ce!=="\t"&&ce!==`
20
+ `&&ce!==":"&&ce!==">"&&!/\w/.test(ce))break}if(ne!==-1){let le=-1,ce=1;for(let Pe=ne-1;Pe>=0;Pe--){let Le=oe[Pe];if(Le===")")ce++;else if(Le==="("){if(ce--,ce===0){le=Pe;break}}}if(le!==-1){let Pe=!1,Le=0,Me=0;for(let Oe=le-1;Oe>=0;Oe--){let ve=oe[Oe];if(ve===">"){Le++;continue}if(ve==="<"){if(Le>0){Le--;continue}if(Me<=0){Pe=!0;break}continue}if(ve===":"&&Le===0&&Me<=0){Pe=!0;break}if(Le>0)continue;if(ve===",")continue;if(ve===")"){Me++;continue}if(ve==="("){Me--;continue}if(ve==="|"||ve==="&"){Pe=!0;break}if(ve==="="||ve==="{"||ve==="["){if(Me>=0)break;continue}if(ve!==" "&&ve!=="\t"&&!/[\w.]/.test(ve)){if(Me>=0)break}}if(!Pe){let Oe=oe.slice(0,le);if(/^\s*(?:export\s+)?(?:declare\s+)?type\s+\w[\w$]*\s*(?:<[^>]*>)?\s*=\s*$/.test(Oe))Pe=!0;else if(/\bas\s+$/.test(Oe))Pe=!0}if(Pe)continue;let Te=oe.slice(le+1,ne);if(!(Te.trim()===""&&oe.slice(Math.max(0,le-10),le).includes("async"))){let Oe=J(Te);if(Oe.length>0){let ve="";if(oe.slice(Ce+2).trimStart().startsWith("{")){let Ee=Q(me,Ce);if(Ee)if(Ee.from===me){let Ae=_[Ee.from],ke=Ae.indexOf("{",Ce),Ie=ke>=0?Ae.slice(ke+1):"";if(Ee.to>Ee.from)ve=`${Ie}
17
21
  ${_.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(`
22
+ `)}`;else ve=Ie}else ve=_.slice(Ee.from,Ee.to+1).join(`
23
+ `)}else ve=ee(me,Ce);for(let Ee of Oe){if(!Ee||a.test(Ee)||Ee==="undefined")continue;if(!new RegExp(`\\b${Ee}\\b`,"g").test(ve))s.push({filePath:y.filePath,line:me+1,column:Math.max(1,oe.indexOf(Ee)+1),ruleId:"pickier/no-unused-vars",message:`'${Ee}' is defined but never used (function parameter). Allowed unused args must match pattern: ${i}`,severity:"error"})}continue}}}}}{let ne=/(?:^|[=,:({\s])\s*([$A-Z_][\w$]*)\s*=>/gi,le;while((le=ne.exec(se))!==null){let ce=le[1];if(!ce||a.test(ce)||ce==="undefined")continue;let Pe=se.slice(0,le.index+le[0].indexOf(ce)).trimEnd();if(/\)\s*:$/.test(Pe)||/\)\s*:\s*$/.test(Pe))continue;if(/\)\s*:\s*[$A-Z_][\w$]*\s+is$/i.test(Pe))continue;if(/^(?:string|number|boolean|void|never|any|unknown|object|bigint|symbol|undefined|null)$/.test(ce))continue;let Le=new RegExp(`\\b${ce}\\s*=>`),Me=oe.match(Le);if(!Me)continue;let Te=oe.indexOf(Me[0])+Me[0].lastIndexOf("=>"),Oe="";if(oe.slice(Te+2).trimStart().startsWith("{")){let Ee=Q(me,Te);if(Ee)if(Ee.from===me){let Ae=_[Ee.from],ke=Ae.indexOf("{",Te),Ie=ke>=0?Ae.slice(ke+1):"";if(Ee.to>Ee.from)Oe=`${Ie}
24
+ ${_.slice(Ee.from+1,Ee.to+1).join(`
25
+ `)}`;else Oe=Ie}else Oe=_.slice(Ee.from,Ee.to+1).join(`
26
+ `)}else Oe=ee(me,Te);if(!new RegExp(`\\b${ce}\\b`,"g").test(Oe))s.push({filePath:y.filePath,line:me+1,column:Math.max(1,oe.indexOf(ce)+1),ruleId:"pickier/no-unused-vars",message:`'${ce}' 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,"\\$&"),re=new RegExp(`(?<=[(,]\\s*)\\b${ee}\\b(?=\\s*[,):=])`,"g"),ye;while((ye=re.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 te=Y;for(let Q of J)te=`${te.slice(0,Q.start)}_${Q.name}${te.slice(Q.end)}`;if(te!==Y)I[z]=te,j=!0}return j?I.join(`
28
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(`
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):"",te=new RegExp(Y).test(J);if(!te){let Q=`${y.slice(0,Math.max(0,Z))}
30
+ ${y.slice(Z+b.length)}`;te=new RegExp(Y).test(Q)||new RegExp(`(?:^|[^$w])(?:\\+\\+|--)\\s*${j}\\b|\\b${j}\\s*(?:\\+\\+|--)`).test(Q)||rl(Q,j)}a.push({name:j,fixable:!te})}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,te=0,Q=0,ee=null,re=!1;for(let Re=1;Re<Y.length;Re++){let ie=Y[Re];if(re){re=!1;continue}if(ie==="\\"&&ee){re=!0;continue}if(!ee){if(ie==="'")ee="single";else if(ie==='"')ee="double";else if(ie==="`")ee="template";else if(ie==="(")J++;else if(ie===")"){if(J--,J===0)break}else if(ie==="{")te++;else if(ie==="}")te--;else if(ie==="[")Q++;else if(ie==="]")Q--;else if(ie===","&&J===1&&te===0&&Q===0){X=Re;break}}else if(ee==="single"&&ie==="'"||ee==="double"&&ie==='"'||ee==="template"&&ie==="`")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
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
33
  `),a=s.slice(l).join(`
34
34
  `),I=`${w}
35
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
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
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(`
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((Re)=>new RegExp(Re));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,re]of Object.entries(Z))if(re.some((ye)=>ye.test(Q)))return ee;return"unknown"},X=(Q)=>{let ee=[],re=0,ye="";for(let Re=0;Re<Q.length;Re++){let ie=Q[Re];if(ie==="<")re++;else if(ie===">")re=Math.max(0,re-1);if(ie===","&&re===0){ee.push(ye.trim()),ye="";continue}ye+=ie}if(ye.trim())ee.push(ye.trim());return ee},J=(Q)=>{let ee=Q.trim(),re=ee.match(/^([A-Z_$][\w$.]*)/i);return re?re[1]:ee},te=(Q,ee)=>{let re=X(ee);if(re.length<=1)return;let ye=re.map(J),Re=ye.map(Y),ie=ye.map((oe,de)=>({n:oe,g:Re[de],i:de})).sort((oe,de)=>{let ae=z.indexOf(oe.g),ge=z.indexOf(de.g);if(ae!==ge)return ae-ge;return B(oe.n,de.n)}).map((oe)=>oe.n);if(!ye.every((oe,de)=>oe===ie[de]))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],re=ee.match(/^\s*interface\s+[A-Za-z_$][^{]*\bextends\s+(.+?)\s*\{/);if(re)te(Q+1,re[1]);let ye=ee.match(/^\s*class\s+[A-Za-z_$][^{]*\bimplements\s+(.+?)\s*\{/);if(ye)te(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 te=J.replace(/^type\s+/,""),Q=te.match(/^([\w$]+)\s+as\s+([\w$]+)$/);if(Q)return w?Q[2]:Q[1];let ee=te.match(/^([\w$]+)$/);return ee?ee[1]:te}),Y=[...z].sort(P);if(!z.every((J,te)=>J===Y[te]))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=[],te={startLine:z+2,props:[]},Q=()=>{if(te.props.length)J.push(te);te={startLine:0,props:[]}};for(let ee=0;ee<X.length;ee++){let re=X[ee];if(w&&/^\s*$/.test(re)){Q();continue}if(/^\s*\.\.\./.test(re))continue;if(/\{|\}/.test(re))continue;let ye=re.match(/^\s*['"]?([\w$-]+)['"]?\s*:/);if(ye){if(te.startLine===0)te.startLine=z+2+ee;te.props.push({key:ye[1],line:z+2+ee})}}Q();for(let ee of J){let re=ee.props.map((ie)=>ie.key),ye=[...re].sort(P);if(!(re.length<=1||re.every((ie,me)=>ie===ye[me]))&&ee.props.length>0){let ie=ee.props[0];I.push({filePath:y.filePath,line:ie.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
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
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
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(`
@@ -53,13 +53,13 @@ ${l[_]}`;if(!/\bfrom\s*['"][^'"]*['"]/.test(P)&&!/^\s*import\s*['"]/.test(P))con
53
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
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
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]===`
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/),te=J.length,Q=(J[J.length-1]||"").length;s.push({filePath:y.filePath,line:te+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
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
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
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===`
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,te=Z!==void 0&&Z.end===X.start;if(J==="("||J==="["||J==="{")D++;else if((J===")"||J==="]"||J==="}")&&D>0)D--;else if(J==="<"&&te&&Z.type==="Word")j++;else if(J===">"&&j>0&&!(te&&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
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(`
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 te=J.match(/^else\s+if\s*\(([^)]*)\)/);if(te){let Q=X.indexOf(te[0])+te[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,te=X!==J,Q=!1;for(let ee=n+1;ee<l.length;ee++){let re=l[ee].trim();if(re===""||re==="}"||/^\/\//.test(re))continue;if(!/^else\b/.test(re))break;let ye=l[ee].indexOf("else")+4,Re=re.match(/^else\s+if\s*\([^)]*\)/);if(Re)ye=l[ee].indexOf(Re[0])+Re[0].length;let ie=ee,me=l[ee].indexOf("{",ye);if(me<0){let ae=function(pe){for(let xe=pe;xe<l.length;xe++)if(l[xe].trim()!=="")return xe;return-1}(ee+1);if(ae<0)break;if(me=l[ae].indexOf("{"),me<0)continue;ie=ae}let oe=0,de=-1;for(let ae=ie;ae<l.length;ae++){let ge=l[ae],pe=ae===ie?Math.max(0,me):0;for(let xe=pe;xe<ge.length;xe++){let he=ge[xe];if(he==="{")oe++;else if(he==="}"){if(oe--,oe===0){de=ae;break}}}if(de>=0)break}if(de>=0){let ae=0;for(let ge=ie+1;ge<de;ge++){let pe=l[ge].trim();if(pe===""||/^\/\//.test(pe))continue;if(ae++,ae>1){Q=!0;break}}}if(Q)break}if(!Q&&a==="if"){let ee=function(ye){for(let Re=ye;Re<l.length;Re++){let ie=l[Re].trim();if(ie!==""&&ie!=="}"&&!/^\/\//.test(ie))return Re}return-1}(j+1);if(ee>=0&&/^else\b/.test(l[ee].trim())){let re=l[ee].indexOf("else")+4,ye=l[ee].trim().match(/^else\s+if\s*\([^)]*\)/);if(ye)re=l[ee].indexOf(ye[0])+ye[0].length;let Re=ee,ie=l[ee].indexOf("{",re);if(ie<0){let me=function(de){for(let ae=de;ae<l.length;ae++)if(l[ae].trim()!=="")return ae;return-1}(ee+1);if(me>=0)ie=l[me].indexOf("{"),Re=ie>=0?me:Re}if(ie>=0){let me=0,oe=-1;for(let de=Re;de<l.length;de++){let ae=l[de],ge=de===Re?Math.max(0,ie):0;for(let pe=ge;pe<ae.length;pe++){let xe=ae[pe];if(xe==="{")me++;else if(xe==="}"){if(me--,me===0){oe=de;break}}}if(oe>=0)break}if(oe>=0){let de=0;for(let ae=Re+1;ae<oe;ae++){let ge=l[ae].trim();if(ge===""||/^\/\//.test(ge))continue;if(++de>1){Q=!0;break}}}}}}if(!z&&!Y&&!te&&!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
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
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
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]!==`
@@ -67,7 +67,7 @@ ${l[_]}`;if(!/\bfrom\s*['"][^'"]*['"]/.test(P)&&!/^\s*import\s*['"]/.test(P))con
67
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
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
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(`
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 re=I[ee];if(Z){Z=!1;continue}if(re==="\\"){Z=!0;continue}if(j){if(B){if(re==="]")B=!1;continue}if(re==="["){B=!0;continue}if(re==="/"){j=!1;while(ee+1<I.length&&/[a-z]/i.test(I[ee+1]))ee++;X="/"}continue}if(!D&&re==="'"){_=!_,J(_?"'":"x");continue}if(!_&&re==='"'){D=!D,J(D?'"':"x");continue}if(_||D)continue;if(re==="/"&&Ti(X,I,ee)){j=!0;continue}if(!z){if(re==="f"&&I.slice(ee,ee+4).match(/^for\b/)){let ye=I.slice(ee+3).trimStart(),Re=I.length-ye.length;if(I[Re]==="("){z=!0,Y=1,ee=Re,X="(";continue}}}else if(re==="(")Y++;else if(re===")"){if(Y--,Y<=0)z=!1}else if(re===";"){J(re);continue}if(re===";")P++;J(re)}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
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
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
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===`
@@ -90,10 +90,10 @@ ${l[_]}`;if(!/\bfrom\s*['"][^'"]*['"]/.test(P)&&!/^\s*import\s*['"]/.test(P))con
90
90
  `).length,w=b.lastIndexOf(`
91
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
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(`
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 te=a.indexOf("any",Math.max(0,B-5));s.push({filePath:y.filePath,line:i+1,column:te>=0?te+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 te=Y.slice(J).trim();if(/^\.(?:then|catch|finally)\s*\(/.test(te))continue;if(te===""||te.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])),te=_.slice(_.indexOf("if (")+4);if(!/\bawait\s/.test(te)){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),te=_.slice(Y+X.length,Math.min(_.length,Y+X.length+10));if(/(?:&&|\|\|)\s*$/.test(J)||/^\s*(?:&&|\|\|)/.test(te)){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],te=j.index,Q=_.slice(te+j[0].length).trim(),ee=_.slice(0,te).trim();if(/=\s*$/.test(ee)&&!/==|===|!=|!==/.test(ee)){let re=a.indexOf(j[0]);s.push({filePath:y.filePath,line:i+1,column:re>=0?re+1:te+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 te=new RegExp(`\\b${J.replace(".","\\.")}\\s*\\(`,"g");te.lastIndex=0;while((j=te.exec(_))!==null){let Q=j.index,ee=_.slice(0,Q).trim(),re=ee.match(/(?:const|let|var)\s+([\w$]+)\s*=\s*$/);if(re){let ie=re[1];if(!new RegExp(`\\b${ie}\\s*:\\s*\\w+`).test(_)){let oe=a.indexOf(j[0]);s.push({filePath:y.filePath,line:i+1,column:oe>=0?oe+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 ${ie} or use a type assertion with a specific type`})}}let ye=ee.match(/([\w$.]+)\s*=\s*$/),Re=/(?:const|let|var)\s+/.test(ee);if(ye&&!re&&!Re){let ie=a.indexOf(j[0]);s.push({filePath:y.filePath,line:i+1,column:ie>=0?ie+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],te=a.indexOf(z[0]);s.push({filePath:y.filePath,line:i+1,column:te>=0?te+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 ie=D[z];if(ie===")")Y++;else if(ie==="("){if(Y===0){z++;break}Y--}else if(ie==="}")X++;else if(ie==="{"){if(X===0){z++;break}X--}else if(ie==="]")J++;else if(ie==="["){if(J===0){z++;break}J--}else if(Y===0&&X===0&&J===0){if(new RegExp("[;,=:?]").test(ie)){z++;break}if(ie==="&"||ie==="|"){z++;break}}z--}if(z<0)z=0;let te=D.slice(z,Z).trim();if(/[<>!=]/.test(te))continue;if(/\b(?:true|false)\b/.test(te))continue;let Q=Z+2,ee=Q;Y=0,X=0,J=0;while(ee<D.length){let ie=D[ee];if(ie==="(")Y++;else if(ie===")"){if(Y===0)break;Y--}else if(ie==="{")X++;else if(ie==="}"){if(X===0)break;X--}else if(ie==="[")J++;else if(ie==="]"){if(J===0)break;J--}else if(Y===0&&X===0&&J===0){if(new RegExp("[;,?:]").test(ie))break;if(ie==="&"||ie==="|"&&D[ee+1]==="|")break}ee++}let re=D.slice(Q,ee).trim(),ye=/^["'`\d]/.test(re)||/^\{/.test(re)||/^[\w$]+\(/.test(re)||/^[\w$.[\]]+$/.test(re),Re=/^[\w$]+$/.test(te)||/^[\w$.?[\]()]+$/.test(te);if(ye&&Re)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 te=a.indexOf(Y);s.push({filePath:y.filePath,line:i+1,column:te>=0?te+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
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
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
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(`
@@ -112,7 +112,7 @@ ${t.bold(`\x1B[4m${l}\x1B[24m`)}
112
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
113
  ${t.bold(`\x1B[4m${w}\x1B[24m`)}
114
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(`
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:te}=await import("path"),Q=[Y];while(Q.length){let ee=Q.pop(),re=X(ee);for(let ye of re){let Re=te(ee,ye),ie=J(Re);if(P(Re))continue;if(ie.isDirectory())Q.push(Re);else _.push(Re)}}}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),te=J!==X;if(y.write){if(te)mc(Y,J,"utf8")}if(te)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()},te=()=>{if(Y=a(),Y.length===0)J(!0);else z.postMessage({type:"lint",batch:Y})};z.onmessage=(ee)=>{let re=ee.data;if(re.type==="done"){for(let[ye,Re]of re.results)i[ye]=Re;te()}else if(re.type==="error")j??=Error(re.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}te()};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((oe)=>{let de=oe.trim();return de.startsWith(".")?de:`.${de}`})),I=r.TIMEOUT_MS,_=i.some((oe)=>{let de=oe.replace(/\/?\*\*\/*\*\*$/,""),ae=Xe(de)?de:Je(process.cwd(),de),ge=process.cwd();return ae!==ge&&!ae.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 oe=i[0].replace(/\/?\*\*\/*\*\*$/,""),de=Xe(oe)?oe:Je(process.cwd(),oe);try{let ae=[de];while(ae.length){if(s?.aborted)throw Error("AbortError");let ge=ae.pop(),pe=Vo(ge);for(let xe of pe){let he=Ko(ge,xe),we=Cn(he);if(D(he))continue;if(we.isDirectory())ae.push(he);else j.push(he)}}}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,te=0,Q=[];for(let oe of j){if(z++,oe.replace(/\\/g,"/").includes("/node_modules/")){X++;continue}if(D(oe)){J++;continue}if(!T(oe,a)){te++;continue}Q.push(oe),Y++}We("filter:programmatic",{total:z,included:Y,node_modules:X,ignored:J,wrongExt:te});let ee=r.CONCURRENCY,Re=(await Yo(Q,ee,async(oe)=>{if(s?.aborted)throw Error("AbortError");On();let de=Yn(oe,"utf8"),ae=ze(de),ge=Ze(de),pe=lt(oe,de,l,ae,ge);try{let xe=await An(oe,de,l);for(let he of xe){if(s?.aborted)throw Error("AbortError");if(je(he.ruleId,he.line,ae))continue;if(ge.has(he.line)&&Sn(he.ruleId))continue;pe.push({filePath:he.filePath,line:he.line,column:he.column,ruleId:he.ruleId,message:he.message,severity:he.severity,...he.help&&{help:he.help}})}}catch{}{let xe=new Set;pe=pe.filter((he)=>{let we=`${he.line}:${he.column}:${he.ruleId}`;if(xe.has(we))return!1;return xe.add(we),!0})}if(y.fix){let xe=Qo(oe,de,l,ae,ge);if(xe=Jo(oe,xe,l),xe!==de){let he=ze(xe),we=Ze(xe);if(pe=lt(oe,xe,l,he,we),!y.dryRun)Hn(oe,xe,"utf8")}}return pe})).flat(),ie=Re.filter((oe)=>oe.severity==="error").length,me=Re.filter((oe)=>oe.severity==="warning").length;return{errors:ie,warnings:me,issues:Re}}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((te)=>te.trim()).filter(Boolean):["*"];if(J.length>0){let te=D+1,Q=y.get(te)||new Set;for(let ee of J)Q.add(ee);y.set(te,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),te=l.get(D)||new Set;for(let Q of J)te.add(Q),w.add(Q);l.set(D,te)}if(P===0)if(!X||X==="")s.add("*");else{let J=X.split(",").map((te)=>te.trim()).filter(Boolean);for(let te of J)s.add(te)}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),te=n.get(D)||new Set;for(let Q of J)te.add(Q),w.delete(Q);n.set(D,te)}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),te=l.get(D)||new Set;for(let Q of J)te.add(Q),w.add(Q);l.set(D,te)}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),te=n.get(D)||new Set;for(let Q of J)te.add(Q),w.delete(Q);n.set(D,te)}}}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
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
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
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===`
@@ -120,5 +120,5 @@ ${t.bold(`\x1B[4m${w}\x1B[24m`)}
120
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
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
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}}
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"]),te=o(s,"no-cond-assign",["noCondAssign"]),Q=/\bconsole\.log\s*\(/,ee=/^\s*debugger\b/,re=new Set;if(I==="md"){let Re=!1;for(let ie=0;ie<w.length;ie++){if(/^(?:`{3,}|~{3,})/.test(w[ie].trim())){Re=!Re;continue}if(Re)re.add(ie+1)}}let ye=Xn(y);for(let Re=0;Re<w.length;Re++){let ie=w[Re],me=Re+1;if(n.has(me))continue;if(!j&&!ye.has(me)){let ae=Go(Zo(ie)),ge=O(ae,a);if(ge.length>0&&!z){if(!je("quotes",me,l))i.push({filePath:b,line:me,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 oe=0;while(oe<ie.length&&(ie.charCodeAt(oe)===32||ie.charCodeAt(oe)===9))oe++;let de=oe>0?ie.slice(0,oe):"";if(Z&&de.length>0&&!re.has(me)&&!ye.has(me)&&M(de,s.format.indent,s.format.indentStyle,ie)){if(!je("indent",me,l))i.push({filePath:b,line:me,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(me)&&ee.test(ie)){if(!je("no-debugger",me,l))i.push({filePath:b,line:me,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(me)&&Q.test(ie)){let ae=ie.indexOf("//"),ge=ie.indexOf("console.");if(ae!==-1&&ge>ae);else{let pe=null;for(let xe=0;xe<ie.length;xe++){let he=ie[xe];if(!pe){if(he==='"')pe="double";else if(he==="'")pe="single";else if(he==="`")pe="template";else if(ie.slice(xe).startsWith("console.")){let we=xe+1;if(!je("no-console",me,l))i.push({filePath:b,line:me,column:we,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(pe==="double"&&he==='"'||pe==="single"&&he==="'"||pe==="template"&&he==="`"){let we=0;for(let se=xe-1;se>=0&&ie[se]==="\\";se--)we++;if(we%2===0)pe=null}}}}if(J&&!ye.has(me)){let ae=ie,ge=null,pe=!1,xe=!1,he="",we="";for(let se=0;se<ae.length;se++){let ue=ae[se];if(pe){if(we==="\\"){we=ue;continue}if(xe){if(ue==="]")xe=!1}else if(ue==="[")xe=!0;else if(ue==="/"){pe=!1;while(se+1<ae.length&&/[a-z]/i.test(ae[se+1]))se++;he="/"}we=ue;continue}if(!ge){if(ue==='"'){ge="double",we=ue;continue}if(ue==="'"){ge="single",we=ue;continue}if(ue==="`"){ge="template",we=ue;continue}if(ue==="/"&&ae[se+1]!=="/"&&ae[se+1]!=="*"&&Jn(he,ae,se)){pe=!0,xe=!1,we=ue;continue}if(ue!==" "&&ue!=="\t")he=ue}else if(ge==="double"&&ue==='"'||ge==="single"&&ue==="'"||ge==="template"&&ue==="`"){if(we!=="\\")ge=null}else if(ue==="$"&&ae[se+1]==="{"&&we!=="\\"&&ge!=="template"){if(!je("no-template-curly-in-string",me,l))i.push({filePath:b,line:me,column:se+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}we=ue}}if(!B&&te&&!ye.has(me)){let ge=Go(Zo(ie)).replace(/'[^']*'|"[^"]*"/g,'""'),pe=(se)=>/[^=!<>]=(?![=>])/.test(se),xe=(se)=>{let ue=ie.match(se);if(ue&&ue.index!==void 0)return ue.index+ue[0].length;return Math.max(1,ie.indexOf("(")+1)},he=qo(ge,/\b(?:if|while)\s*\(/);if(he){let se=zo(he);if(pe(se)){if(!je("no-cond-assign",me,l))i.push({filePath:b,line:me,column:xe(/\b(?:if|while)\s*\(/),ruleId:"no-cond-assign",message:"Unexpected assignment within a conditional expression",severity:te,help:"Use === or == for comparison instead of = (assignment). Wrap intentional assignments in extra parentheses."})}}let we=qo(ge,/\bfor\s*\(/);if(we){let se=we.split(";");if(se.length>=2){let ue=zo(se[1]);if(pe(ue)){if(!je("no-cond-assign",me,l))i.push({filePath:b,line:me,column:xe(/\bfor\s*\(/),ruleId:"no-cond-assign",message:"Unexpected assignment within a conditional expression",severity:te,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((se)=>{let ue=se.trim();return ue.startsWith(".")?ue:`.${ue}`}));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((se)=>{let ue=se.replace(/\/?\*\*\/*\*\*$/,""),fe=Xe(ue)?ue:Je(process.cwd(),ue),Ce=process.cwd();return fe!==Ce&&!fe.startsWith(Ce+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 se=i[0].replace(/\/?\*\*\/*\*\*$/,"");if(s)Se().info(`[pickier:diagnostics] Using fast directory scan for: ${se}`);try{let fe=[Xe(se)?se:Je(process.cwd(),se)],Ce=0;while(fe.length){let ne=fe.pop();if(Ce++,s&&Ce%100===0)Se().info(`[pickier:diagnostics] Scanned ${Ce} directories, ${j.length} files found so far...`);let le=Vo(ne);for(let ce of le){let Pe=Ko(ne,ce),Le=Cn(Pe);if(D(Pe))continue;if(Le.isDirectory())fe.push(Pe);else j.push(Pe)}}if(s)Se().info(`[pickier:diagnostics] Fast scan complete: ${Ce} directories, ${j.length} total files`)}catch(ue){if(s)Se().info(`[pickier:diagnostics] Fast scan failed: ${ue?.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,te=0,Q=[];for(let se of j){if(z++,s&&z%1000===0)Se().info(`[pickier:diagnostics] Filtering progress: ${z}/${j.length} files checked, ${Y} included...`);if(se.replace(/\\/g,"/").includes("/node_modules/")){X++;continue}if(D(se)){J++;continue}if(!T(se,a)){te++;continue}Q.push(se),Y++}if(We("filter:cli",{total:z,included:Y,node_modules:X,ignored:J,wrongExt:te}),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): ${te}`);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 re=0,ye=async(se)=>{if(s){if(re++,re===1||re%10===0||re===Q.length)Se().info(`[pickier:diagnostics] Processing file ${re}/${Q.length}: ${Ln(process.cwd(),se)}`)}return v(se,l,y)},Re=async(se,ue=y)=>{if(se.length===0)return[];let fe=ue===y?ye:(ne)=>v(ne,l,ue),Ce=s||r.TRACE?0:Wo(se.length);return Ce>1?No(se,ue,Ce,fe):Yo(se,ee,fe)},ie=s||r.TRACE?null:Co(l,y),me=async(se)=>{let ue=Array(se.length);if(ie){let ne=se.flatMap((ce,Pe)=>$o(ce)?[Pe]:[]),le=ne.map((ce)=>se[ce]);if(le.length>0&&ie.hybrid){let[ce,Pe]=await Promise.all([So(le,ie.request,ie.binary,ie.positions),Re(le,{...y,_nativeRules:ie.nativeRules})]);if(ce)ne.forEach((Le,Me)=>{if(ce[Me])ue[Le]=_o(ce[Me],Pe[Me])});We("native",{files:le.length,linted:ce?ce.filter(Boolean).length:0,hybrid:!0})}else if(le.length>0){let ce=Lo(le,ie.request,ie.binary);if(ce)ne.forEach((Pe,Le)=>{if(ce[Le])ue[Pe]=ce[Le]});We("native",{files:le.length,linted:ce?ce.filter(Boolean).length:0})}}let fe=se.flatMap((ne,le)=>ue[le]===void 0?[le]:[]),Ce=await Re(fe.map((ne)=>se[ne]));return fe.forEach((ne,le)=>{ue[ne]=Ce[le]}),ue},oe;if(wo(l,y)){let se=ko(l,y),ue=Q.map((ne)=>{try{return Yn(ne,"utf8")}catch{return null}});oe=Array(Q.length);let fe=[];for(let ne=0;ne<Q.length;ne++){let le=ue[ne]===null?void 0:se.get(Q[ne],ue[ne]);if(le)oe[ne]=le;else fe.push(ne)}let Ce=await me(fe.map((ne)=>Q[ne]));fe.forEach((ne,le)=>{if(oe[ne]=Ce[le],ue[ne]!==null)se.set(Q[ne],ue[ne],Ce[le])}),se.save(),We("cache",{hits:Q.length-fe.length,misses:fe.length})}else oe=await me(Q);let de=oe.flat();if(s)Se().info(`[pickier:diagnostics] Processing complete! Found ${de.length} issues total`);let ae=0,ge=0;for(let se of de)if(se.severity==="error")ae++;else if(se.severity==="warning")ge++;if(We("issues:summary",{errors:ae,warnings:ge}),s)Se().info(`[pickier:diagnostics] Errors: ${ae}, Warnings: ${ge}`);let pe=y.reporter||l.lint.reporter,xe=y.verbose!==void 0?y.verbose:l.verbose;if(pe==="json")console.log(JSON.stringify({errors:ae,warnings:ge,issues:de},null,2));else if(pe==="compact")for(let se of de)console.log(`${Ln(process.cwd(),se.filePath)}:${se.line}:${se.column} ${se.severity} ${se.ruleId} ${se.message}`);else if(de.length>0)console.log(xe?go(de):bo(de));if(de.length>0&&pe!=="json"){let se=ae+ge,ue=se===1?"problem":"problems",fe=ae===1?"error":"errors",Ce=ge===1?"warning":"warnings",ne=En(l),le=0,ce=0;for(let Pe of de){let Le=Pe.ruleId;if(ne.fixableRuleIds.has(Le)||ne.fixableBareRuleNames.has(Le)){if(Pe.severity==="error")le++;else if(Pe.severity==="warning")ce++}}if(console.log(),console.log(t.red(`\u2716 ${se} ${ue} (${ae} ${fe}, ${ge} ${Ce})`)),le>0||ce>0){let Pe=le===1?"error":"errors",Le=ce===1?"warning":"warnings";console.log(t.gray(` ${le} ${Pe} and ${ce} ${Le} potentially fixable with the \`--fix\` option.`))}}if(xe&&pe!=="json")console.log(t.gray(`Scanned ${Q.length} files, found ${ae} errors and ${ge} warnings.`));let he=y.maxWarnings??l.lint.maxWarnings,we=r.FAIL_ON_WARNINGS;if(ae>0)return We("runLint:end",1),1;if(we&&ge>0)return We("runLint:end",1),1;if(he>=0&&ge>he)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
124
  export{R,H,W,A,U,V,v,K};
package/dist/src/index.js CHANGED
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{l,z,p,O,M,E,L,f,se,r,_,m,N,P,o,re,w,J,Y,Z,X,Q,ee,t,y,u,x,T,h,d,ie}from"../chunk-mq0hh9yt.js";import{H,W,A,U,K}from"../chunk-shq21jvq.js";import"../chunk-hm7sfaz3.js";import{B}from"../chunk-xgqhgjnn.js";export{_ as ALWAYS_IGNORES,r as ENV,L as MAX_FIXER_PASSES,m as UNIVERSAL_IGNORES,X as blue,ee as bold,w as colorize,t as colors,z as config,d as createIgnoreMatcher,se as createLimiter,l as defaultConfig,O as detectQuoteIssues,x as expandPatterns,A as fixText,p as formatCode,E as formatImports,N as getRuleSetting,f as glob,Q as gray,J as green,M as hasIndentIssue,T as isCodeFile,re as isRuleOff,W as lintText,u as loadConfigFromPath,y as mergeConfig,P as normalizeRuleSeverity,Y as red,o as resolveRuleSeverity,B as run,H as runFormat,K as runLint,U as runLintProgrammatic,ie as shouldIgnorePath,h as withAlwaysIgnores,Z as yellow};
2
+ import{l,z,p,O,M,E,L,f,se,r,_,m,N,P,o,re,w,J,Y,Z,X,Q,ee,t,y,u,x,T,h,d,ie}from"../chunk-mq0hh9yt.js";import{H,W,A,U,K}from"../chunk-w9jfz4rm.js";import"../chunk-10et4075.js";import{B}from"../chunk-t5wtga4g.js";export{_ as ALWAYS_IGNORES,r as ENV,L as MAX_FIXER_PASSES,m as UNIVERSAL_IGNORES,X as blue,ee as bold,w as colorize,t as colors,z as config,d as createIgnoreMatcher,se as createLimiter,l as defaultConfig,O as detectQuoteIssues,x as expandPatterns,A as fixText,p as formatCode,E as formatImports,N as getRuleSetting,f as glob,Q as gray,J as green,M as hasIndentIssue,T as isCodeFile,re as isRuleOff,W as lintText,u as loadConfigFromPath,y as mergeConfig,P as normalizeRuleSeverity,Y as red,o as resolveRuleSeverity,B as run,H as runFormat,K as runLint,U as runLintProgrammatic,ie as shouldIgnorePath,h as withAlwaysIgnores,Z as yellow};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{u}from"../chunk-mq0hh9yt.js";import{R,v}from"../chunk-shq21jvq.js";import"../chunk-hm7sfaz3.js";var s,i=null;self.onmessage=async(n)=>{let t=n.data;if(t.type==="init"){s=t.options,i=u(s.config);return}try{let e=await i,o=[];for(let[r,a]of t.batch)o.push([r,await v(a,e,s)]);await R(),postMessage({type:"done",results:o})}catch(e){await R(),postMessage({type:"error",message:e?.message||String(e)})}};
2
+ import{u}from"../chunk-mq0hh9yt.js";import{R,v}from"../chunk-w9jfz4rm.js";import"../chunk-10et4075.js";var s,i=null;self.onmessage=async(n)=>{let t=n.data;if(t.type==="init"){s=t.options,i=u(s.config);return}try{let e=await i,o=[];for(let[r,a]of t.batch)o.push([r,await v(a,e,s)]);await R(),postMessage({type:"done",results:o})}catch(e){await R(),postMessage({type:"error",message:e?.message||String(e)})}};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pickier",
3
3
  "type": "module",
4
- "version": "0.1.75",
4
+ "version": "0.1.76",
5
5
  "description": "Format, lint and more in a fraction of seconds.",
6
6
  "author": "Chris Breuer <chris@stacksjs.org>",
7
7
  "license": "MIT",
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{B}from"./chunk-xgqhgjnn.js";import"./chunk-mq0hh9yt.js";export{B as runUnified};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{W,A,U,V,v,K}from"./chunk-shq21jvq.js";import"./chunk-mq0hh9yt.js";import"./chunk-hm7sfaz3.js";export{A as fixText,v as lintFileForRun,W as lintText,V as plannedCheckRules,K as runLint,U as runLintProgrammatic};