pickier 0.1.70 → 0.1.72

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.
Files changed (36) hide show
  1. package/dist/bin/cli.js +2 -2
  2. package/dist/{chunk-c82emw32.js → chunk-0rxvmb2a.js} +2 -2
  3. package/dist/chunk-1vnz0vyr.js +2 -0
  4. package/dist/chunk-50z6kpcq.js +2 -0
  5. package/dist/{chunk-wx92kdf9.js → chunk-513cs23x.js} +5 -5
  6. package/dist/chunk-96vhwdwy.js +3 -0
  7. package/dist/{chunk-pvptb0h1.js → chunk-bf41tx1b.js} +2 -2
  8. package/dist/chunk-cscys77z.js +2 -0
  9. package/dist/chunk-hx0z7dzw.js +29 -0
  10. package/dist/{chunk-5c026tb4.js → chunk-kn5s3eh8.js} +1 -1
  11. package/dist/chunk-m9saxre0.js +2 -0
  12. package/dist/chunk-mfns8s7h.js +124 -0
  13. package/dist/chunk-mgry8xhx.js +3 -0
  14. package/dist/{chunk-8m82hwdv.js → chunk-qq03kpe0.js} +2 -2
  15. package/dist/{chunk-qjzzx1m2.js → chunk-t0w79bj5.js} +25 -25
  16. package/dist/chunk-wz6hqyhd.js +2 -0
  17. package/dist/native/darwin-arm64/pickier-native +0 -0
  18. package/dist/native/darwin-x64/pickier-native +0 -0
  19. package/dist/native/linux-arm64/pickier-native +0 -0
  20. package/dist/native/linux-x64/pickier-native +0 -0
  21. package/dist/native/win32-arm64/pickier-native.exe +0 -0
  22. package/dist/native/win32-x64/pickier-native.exe +0 -0
  23. package/dist/src/index.js +1 -1
  24. package/dist/src/lint-worker.js +1 -1
  25. package/dist/src/parallel.d.ts +4 -0
  26. package/dist/src/rules/general/prefer-template.d.ts +12 -0
  27. package/package.json +1 -1
  28. package/dist/chunk-0b2yx624.js +0 -3
  29. package/dist/chunk-1jtr81zg.js +0 -25
  30. package/dist/chunk-5tx5kfq7.js +0 -2
  31. package/dist/chunk-gpfjzx90.js +0 -2
  32. package/dist/chunk-m9ym248d.js +0 -2
  33. package/dist/chunk-mqjmcycy.js +0 -128
  34. package/dist/chunk-ng3egs14.js +0 -2
  35. package/dist/chunk-t776wefr.js +0 -2
  36. package/dist/chunk-xjt8q744.js +0 -3
package/dist/bin/cli.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env bun
2
2
  // @bun
3
- async function U(){let i=process.argv.slice(2),c=i[0]==="run",y=c?1:0,a=c?"auto":"lint",d=!1,g=!1,h=!1,x=!1,w,k,f=!1,m,p=[],b=!0;for(let t=y;t<i.length;t++){let e=i[t];if(e==="--mode")a=i[++t]||"auto";else if(e==="--format")h=!0,a="format";else if(e==="--check")d=!0;else if(e==="--write")g=!0;else if(e==="--config")w=i[++t];else if(e==="--verbose")x=!0;else if(e==="--ext")k=i[++t];else if(e==="--ignore-path")t++;else if(e==="--cache")f=!0;else if(e==="--reporter"){let o=i[++t];m=o==="json"||o==="compact"?o:"stylish"}else if(e==="--fix"||e==="--dry-run"||e==="--max-warnings"){b=!1,p.length=0;break}else if(e.startsWith("--"));else p.push(e)}if(b&&(a==="format"||a==="auto"||a==="lint")&&p.length>0){let{runUnified:t}=await import("../chunk-ng3egs14.js"),e=await t(p,{mode:a,check:d,write:g,verbose:x,config:w,ext:k,...f&&{cache:f},...m&&{reporter:m}});process.exit(e)}let{CLI:v}=await import("../chunk-p0j2ra3t.js"),{version:C}=await import("../chunk-5tx5kfq7.js"),r=new v("pickier"),l=(t)=>{let[e,o]=t;return[Array.isArray(e)?e.filter((u)=>typeof u==="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("--verbose","Verbose output").example("pickier .").example("pickier . --fix").example("pickier . --format").example("pickier src --fix --verbose").action(async(...t)=>{let[e,o]=l(t);if(e.length===0){r.outputHelp();return}let{runUnified:s}=await import("../chunk-ng3egs14.js"),n;if(o.format){if(n="format",!o.check)o.write=!0}else n="lint";let u=await s(e,{...o,mode:n});process.exit(u)}),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("--verbose","Verbose output").example("pickier lint .").example("pickier lint src --fix").example('pickier lint "src/**/*.{ts,tsx}" --reporter json').action(async(...t)=>{let[e,o]=l(t),{runUnified:s}=await import("../chunk-ng3egs14.js"),n=await s(e,{...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(...t)=>{let[e,o]=l(t),{runUnified:s}=await import("../chunk-ng3egs14.js"),n=await s(e,{...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("--verbose","Verbose output").example("pickier run . --mode lint --fix").example("pickier run . --mode format --write").action(async(...t)=>{let[e,o]=l(t),{runUnified:s}=await import("../chunk-ng3egs14.js"),n=await s(e,o);process.exit(n)}),r.command("version","Show the version of the CLI").action(async()=>{let{version:t}=await import("../chunk-5tx5kfq7.js");process.stdout.write(`${t}
4
- `)}),r.version(C),r.help(),r.parse()}U().catch((i)=>{let c=i instanceof Error?i.message:String(i);process.stderr.write(`pickier: ${c}
3
+ async function I(){let i=process.argv.slice(2),a=i[0]??"",h=a==="run",v=h||a==="lint"||a==="format"?1:0,c=h?"auto":a==="format"?"format":"lint",f=!1,m=!1,x=!1,w=!1,k,b,u=!1,d,p=[],y=!i.some((e)=>e==="version"||e==="help"||e==="--version"||e==="-v"||e==="--help"||e==="-h");for(let e=v;e<i.length;e++){let t=i[e];if(t==="--mode")c=i[++e]||"auto";else if(t==="--format")x=!0,c="format";else if(t==="--check")f=!0;else if(t==="--write")m=!0;else if(t==="--config")k=i[++e];else if(t==="--verbose")w=!0;else if(t==="--ext")b=i[++e];else if(t==="--ignore-path")e++;else if(t==="--cache")u=!0;else if(t==="--reporter"){let o=i[++e];d=o==="json"||o==="compact"?o:"stylish"}else if(t==="--fix"||t==="--dry-run"||t==="--max-warnings"){y=!1,p.length=0;break}else if(t.startsWith("--"));else p.push(t)}if(x&&!f)m=!0;if(y&&(c==="format"||c==="auto"||c==="lint")&&p.length>0){let{runUnified:e}=await import("../chunk-cscys77z.js"),t=await e(p,{mode:c,check:f,write:m,verbose:w,config:k,ext:b,...u&&{cache:u},...d&&{reporter:d}});process.exit(t)}let{CLI:C}=await import("../chunk-p0j2ra3t.js"),{version:U}=await import("../chunk-m9saxre0.js"),r=new C("pickier"),l=(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("--verbose","Verbose output").example("pickier .").example("pickier . --fix").example("pickier . --format").example("pickier src --fix --verbose").action(async(...e)=>{let[t,o]=l(e);if(t.length===0){r.outputHelp();return}let{runUnified:s}=await import("../chunk-cscys77z.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("--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]=l(e),{runUnified:s}=await import("../chunk-cscys77z.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]=l(e),{runUnified:s}=await import("../chunk-cscys77z.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("--verbose","Verbose output").example("pickier run . --mode lint --fix").example("pickier run . --mode format --write").action(async(...e)=>{let[t,o]=l(e),{runUnified:s}=await import("../chunk-cscys77z.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-m9saxre0.js");process.stdout.write(`${e}
4
+ `)}),r.version(U),r.help(),r.parse()}I().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
- function a(o){let c=o.length,e=Array.from({length:c},(n,s)=>o[s]),t=0;while(t<c){let n=o[t];if(n==="#"&&(t===0||/\s/.test(o[t-1]))){while(t<c)e[t]=" ",t++;break}if(n==="$"&&o[t+1]==="'"){t+=2;while(t<c){if(o[t]==="\\"&&t+1<c){e[t]=" ",e[t+1]=" ",t+=2;continue}if(o[t]==="'"){t++;break}e[t]=" ",t++}continue}if(n==="$"&&o[t+1]==='"'){t++,t=r(o,t,e);continue}if(n==="$"&&o[t+1]==="{"){t+=2;let s=1;while(t<c&&s>0){let f=o[t];if(f==="\\"&&t+1<c){e[t]=" ",e[t+1]=" ",t+=2;continue}if(f==="'"){t++;while(t<c&&o[t]!=="'")e[t]=" ",t++;if(t<c)t++;continue}if(f==='"'){t=r(o,t,e);continue}if(f==="{"){s++,t++;continue}if(f==="}"){s--,t++;continue}e[t]=" ",t++}continue}if(n==="$"&&o[t+1]==="("&&o[t+2]==="("){t+=3;let s=2;while(t<c&&s>0){let f=o[t];if(f==="("){s++,t++;continue}if(f===")"){s--,t++;continue}e[t]=" ",t++}continue}if(n==="$"&&o[t+1]==="("){t+=2;let s=1;while(t<c&&s>0){let f=o[t];if(f==="\\"&&t+1<c){e[t]=" ",e[t+1]=" ",t+=2;continue}if(f==="'"){t++;while(t<c&&o[t]!=="'")e[t]=" ",t++;if(t<c)t++;continue}if(f==='"'){t=r(o,t,e);continue}if(f==="("){s++,t++;continue}if(f===")"){s--,t++;continue}e[t]=" ",t++}continue}if(n==="'"){t++;while(t<c&&o[t]!=="'")e[t]=" ",t++;if(t<c)t++;continue}if(n==='"'){t=r(o,t,e);continue}if(n==="`"){t++;while(t<c&&o[t]!=="`"){if(o[t]==="\\"&&t+1<c){e[t]=" ",e[t+1]=" ",t+=2;continue}e[t]=" ",t++}if(t<c)t++;continue}t++}return e.join("")}function r(o,c,e){let t=o.length,n=c+1;while(n<t){let s=o[n];if(s==="\\"&&n+1<t){e[n]=" ",e[n+1]=" ",n+=2;continue}if(s==='"')return n+1;if(s==="$"&&o[n+1]==="("&&o[n+2]==="("){n+=3;let f=2;while(n<t&&f>0){let u=o[n];if(u==="("){f++,n++;continue}if(u===")"){f--,n++;continue}e[n]=" ",n++}continue}if(s==="$"&&o[n+1]==="("){n+=2;let f=1;while(n<t&&f>0){let u=o[n];if(u==="\\"&&n+1<t){e[n]=" ",e[n+1]=" ",n+=2;continue}if(u==="'"){n++;while(n<t&&o[n]!=="'")e[n]=" ",n++;if(n<t)n++;continue}if(u==='"'){n=r(o,n,e);continue}if(u==="("){f++,n++;continue}if(u===")"){f--,n++;continue}e[n]=" ",n++}continue}if(s==="$"&&o[n+1]==="{"){n+=2;let f=1;while(n<t&&f>0){let u=o[n];if(u==="{"){f++,n++;continue}if(u==="}"){f--,n++;continue}e[n]=" ",n++}continue}e[n]=" ",n++}return n}function i(o){let e=a(o).match(/<<-?/);if(!e||e.index===void 0)return null;let n=o.slice(e.index+e[0].length).match(/^\s*(['"]?)(\w+)\1/);if(!n)return null;return n[2]}class g{continued=!1;header;read(o){let c=a(o).trim(),e=this.continued;if(!e)this.header=/^(?:if|elif)\b/.test(c)?"then":/^(?:while|for|until)\b/.test(c)?"do":void 0;let t=e&&this.header!==void 0&&new RegExp(`\\b${this.header}\\s*$`).test(c),n=c.match(/\\+$/)?.[0].length??0;if(this.continued=n%2===1,!this.continued)this.header=void 0;return{continuation:e,closesHeader:t}}}
3
- export{a,i,g};
2
+ function a(o){let c=o.length,e=Array.from({length:c},(n,s)=>o[s]),t=0;while(t<c){let n=o[t];if(n==="#"&&(t===0||/\s/.test(o[t-1]))){while(t<c)e[t]=" ",t++;break}if(n==="$"&&o[t+1]==="'"){t+=2;while(t<c){if(o[t]==="\\"&&t+1<c){e[t]=" ",e[t+1]=" ",t+=2;continue}if(o[t]==="'"){t++;break}e[t]=" ",t++}continue}if(n==="$"&&o[t+1]==='"'){t++,t=r(o,t,e);continue}if(n==="$"&&o[t+1]==="{"){t+=2;let s=1;while(t<c&&s>0){let f=o[t];if(f==="\\"&&t+1<c){e[t]=" ",e[t+1]=" ",t+=2;continue}if(f==="'"){t++;while(t<c&&o[t]!=="'")e[t]=" ",t++;if(t<c)t++;continue}if(f==='"'){t=r(o,t,e);continue}if(f==="{"){s++,t++;continue}if(f==="}"){s--,t++;continue}e[t]=" ",t++}continue}if(n==="$"&&o[t+1]==="("&&o[t+2]==="("){t+=3;let s=2;while(t<c&&s>0){let f=o[t];if(f==="("){s++,t++;continue}if(f===")"){s--,t++;continue}e[t]=" ",t++}continue}if(n==="$"&&o[t+1]==="("){t+=2;let s=1;while(t<c&&s>0){let f=o[t];if(f==="\\"&&t+1<c){e[t]=" ",e[t+1]=" ",t+=2;continue}if(f==="'"){t++;while(t<c&&o[t]!=="'")e[t]=" ",t++;if(t<c)t++;continue}if(f==='"'){t=r(o,t,e);continue}if(f==="("){s++,t++;continue}if(f===")"){s--,t++;continue}e[t]=" ",t++}continue}if(n==="'"){t++;while(t<c&&o[t]!=="'")e[t]=" ",t++;if(t<c)t++;continue}if(n==='"'){t=r(o,t,e);continue}if(n==="`"){t++;while(t<c&&o[t]!=="`"){if(o[t]==="\\"&&t+1<c){e[t]=" ",e[t+1]=" ",t+=2;continue}e[t]=" ",t++}if(t<c)t++;continue}t++}return e.join("")}function r(o,c,e){let t=o.length,n=c+1;while(n<t){let s=o[n];if(s==="\\"&&n+1<t){e[n]=" ",e[n+1]=" ",n+=2;continue}if(s==='"')return n+1;if(s==="$"&&o[n+1]==="("&&o[n+2]==="("){n+=3;let f=2;while(n<t&&f>0){let u=o[n];if(u==="("){f++,n++;continue}if(u===")"){f--,n++;continue}e[n]=" ",n++}continue}if(s==="$"&&o[n+1]==="("){n+=2;let f=1;while(n<t&&f>0){let u=o[n];if(u==="\\"&&n+1<t){e[n]=" ",e[n+1]=" ",n+=2;continue}if(u==="'"){n++;while(n<t&&o[n]!=="'")e[n]=" ",n++;if(n<t)n++;continue}if(u==='"'){n=r(o,n,e);continue}if(u==="("){f++,n++;continue}if(u===")"){f--,n++;continue}e[n]=" ",n++}continue}if(s==="$"&&o[n+1]==="{"){n+=2;let f=1;while(n<t&&f>0){let u=o[n];if(u==="{"){f++,n++;continue}if(u==="}"){f--,n++;continue}e[n]=" ",n++}continue}e[n]=" ",n++}return n}function i(o){let e=a(o).match(/<<-?/);if(!e||e.index===void 0)return null;let n=o.slice(e.index+e[0].length).match(/^\s*(['"]?)(\w+)\1/);if(!n)return null;return n[2]}class b{continued=!1;header;read(o){let c=a(o).trim(),e=this.continued;if(!e)this.header=/^(?:if|elif)\b/.test(c)?"then":/^(?:while|for|until)\b/.test(c)?"do":void 0;let t=e&&this.header!==void 0&&new RegExp(`\\b${this.header}\\s*$`).test(c),n=c.match(/\\+$/)?.[0].length??0;if(this.continued=n%2===1,!this.continued)this.header=void 0;return{continuation:e,closesHeader:t}}}
3
+ export{a,i,b};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{l,ne,z}from"./chunk-hx0z7dzw.js";export{z as config,l as defaultConfig,ne as getConfig};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{W,A,U,V,v,K}from"./chunk-mfns8s7h.js";import"./chunk-hx0z7dzw.js";import"./chunk-bf41tx1b.js";export{A as fixText,v as lintFileForRun,W as lintText,V as plannedCheckRules,K as runLint,U as runLintProgrammatic};
@@ -1,9 +1,9 @@
1
1
  // @bun
2
- import{n}from"./chunk-8m82hwdv.js";import{a,i,g}from"./chunk-c82emw32.js";var v={meta:{docs:"Use $() instead of backticks for command substitution",recommended:!0},check(u,f){let o=[],c=u.split(/\r?\n/),s=!1,r="",e=!1;for(let t=0;t<c.length;t++){let d=c[t];if(s){if(d.trim()===r)s=!1;continue}let m=d.match(/<<-?\s*['"]?(\w+)['"]?/);if(m)s=!0,r=m[1];if(d.replace(/^\s+/,"").startsWith("#"))continue;e=!1;for(let l=0;l<d.length;l++){let p=d[l];if(p==="#"&&!e)break;if(p==="\\"){l++;continue}if(p==="'"){e=!e;continue}if(e)continue;if(p==="`"){o.push({filePath:f.filePath,line:t+1,column:l+1,ruleId:"shell/command-substitution",message:"Use $(...) instead of backticks for command substitution",severity:"error",help:"Replace `cmd` with $(cmd) for better readability and nesting support"});for(l++;l<d.length&&d[l]!=="`";l++)if(d[l]==="\\")l++}}}return o},fix(u,f){let o=u.split(/\r?\n/),c=[],s=!1,r="";for(let e of o){if(s){if(c.push(e),e.trim()===r)s=!1;continue}let t=e.match(/<<-?\s*['"]?(\w+)['"]?/);if(t)s=!0,r=t[1];let d="",m=!1,h=0;while(h<e.length){let l=e[h];if(l==="#"&&!m){d+=e.slice(h);break}if(l==="\\"){d+=e.slice(h,h+2),h+=2;continue}if(l==="'"){m=!m,d+=l,h++;continue}if(m){d+=l,h++;continue}if(l==="`"){let p="";h++;while(h<e.length&&e[h]!=="`")if(e[h]==="\\")p+=e[h+1]||"",h+=2;else p+=e[h],h++;h++,d+=`$(${p})`}else d+=l,h++}c.push(d)}return c.join(`
3
- `)}};var P={meta:{docs:"Require error handling after cd commands",recommended:!0},check(u,f){let o=[],c=u.split(/\r?\n/),s=!1,r="";for(let e=0;e<c.length;e++){let t=c[e];if(s){if(t.trim()===r)s=!1;continue}let d=t.match(/<<-?\s*['"]?(\w+)['"]?/);if(d)s=!0,r=d[1];let m=t.replace(/^\s+/,"");if(m.startsWith("#"))continue;let h=m.match(/^cd\s+/);if(!h)continue;let l=/\|\||&&/.test(t),p=/^\s*(?:if|elif|while|until)\s/.test(m)||/\bif\s+cd\b/.test(t),b=/\(.*\bcd\b.*\)/.test(t);if(!l&&!p&&!b)o.push({filePath:f.filePath,line:e+1,column:h.index+1,ruleId:"shell/no-cd-without-check",message:"cd without error handling \u2014 if it fails, subsequent commands run in the wrong directory",severity:"warning",help:"Use: cd dir || exit 1 (or || return 1 inside functions)"})}return o}};var S={meta:{docs:"Disallow use of eval in shell scripts",recommended:!0},check(u,f){let o=[],c=u.split(/\r?\n/),s=!1,r="";for(let e=0;e<c.length;e++){let t=c[e];if(s){if(t.trim()===r)s=!1;continue}let d=t.match(/<<-?\s*['"]?(\w+)['"]?/);if(d)s=!0,r=d[1];if(t.replace(/^\s+/,"").startsWith("#"))continue;if(t.match(/(?:^|[;&|]\s*|^\s+)eval\s/)){let l=t.indexOf("eval");o.push({filePath:f.filePath,line:e+1,column:l+1,ruleId:"shell/no-eval",message:"Avoid using eval \u2014 it re-parses arguments and can lead to code injection",severity:"error",help:"Refactor to avoid eval. Consider using arrays for dynamic commands or indirect variable references with ${!var}"})}}return o}};var D={meta:{docs:"Flag exit inside subshells where it only exits the subshell",recommended:!0},check(u,f){let o=[],c=u.split(/\r?\n/),s=!1,r="",e=0;for(let t=0;t<c.length;t++){let d=c[t];if(s){if(d.trim()===r)s=!1;continue}let m=d.match(/<<-?\s*['"]?(\w+)['"]?/);if(m)s=!0,r=m[1];if(d.replace(/^\s+/,"").startsWith("#"))continue;let l=!1,p=!1;for(let b=0;b<d.length;b++){let R=d[b];if(R==="#"&&!l&&!p)break;if(R==="\\"&&!l){b++;continue}if(R==="'"&&!p){l=!l;continue}if(R==='"'&&!l){p=!p;continue}if(!l&&!p){if(R==="("&&b>0&&d[b-1]!=="$"&&d[b+1]!=="(")e++;else if(R==="("&&b===0&&d[b+1]!=="(")e++;else if(R===")"&&e>0&&(b+1>=d.length||d[b+1]!==")"))e--}}if(e>0){let b=d.match(/\bexit\b/);if(b)o.push({filePath:f.filePath,line:t+1,column:b.index+1,ruleId:"shell/no-exit-in-subshell",message:"exit inside a subshell only exits the subshell, not the script",severity:"warning",help:"Restructure to avoid subshells, or use return if inside a function"})}if(e===0){let b=d.match(/(?<!\$)\((?!\()([^)]*\bexit\b[^)]*)\)(?!\))/);if(b){let R=d.indexOf("exit",b.index);o.push({filePath:f.filePath,line:t+1,column:R+1,ruleId:"shell/no-exit-in-subshell",message:"exit inside a subshell only exits the subshell, not the script",severity:"warning",help:"Restructure to avoid subshells, or use return if inside a function"})}}}return o}};var I={meta:{docs:"Disallow parsing ls output \u2014 use globs or find instead",recommended:!0},check(u,f){let o=[],c=u.split(/\r?\n/),s=!1,r="";for(let e=0;e<c.length;e++){let t=c[e];if(s){if(t.trim()===r)s=!1;continue}let d=t.match(/<<-?\s*['"]?(\w+)['"]?/);if(d)s=!0,r=d[1];if(t.replace(/^\s+/,"").startsWith("#"))continue;if(t.match(/\bls\b[^|]*\|/)){let b=t.indexOf("ls");o.push({filePath:f.filePath,line:e+1,column:b+1,ruleId:"shell/no-ls-parsing",message:"Don't parse ls output \u2014 filenames can contain special characters",severity:"warning",help:'Use globs (for f in *.txt), find (find . -name "*.txt"), or stat instead'});continue}let l=t.match(/\$\(\s*ls\b/);if(l){let b=l.index+1;o.push({filePath:f.filePath,line:e+1,column:b,ruleId:"shell/no-ls-parsing",message:"Don't use ls in command substitution \u2014 use globs instead",severity:"warning",help:"Replace $(ls *.txt) with glob patterns: for f in *.txt; do ...; done"});continue}let p=t.match(/`\s*ls\b/);if(p){let b=p.index+1;o.push({filePath:f.filePath,line:e+1,column:b,ruleId:"shell/no-ls-parsing",message:"Don't use ls in command substitution \u2014 use globs instead",severity:"warning",help:"Replace `ls` with glob patterns"})}}return o}};var T={meta:{docs:"Detect useless use of cat (UUOC)",recommended:!0},check(u,f){let o=[],c=u.split(/\r?\n/),s=!1,r="";for(let e=0;e<c.length;e++){let t=c[e];if(s){if(t.trim()===r)s=!1;continue}let d=t.match(/<<-?\s*['"]?(\w+)['"]?/);if(d)s=!0,r=d[1];if(t.replace(/^\s+/,"").startsWith("#"))continue;let h=t.match(/\bcat\s+(["']?[\w.\/~${}*?-]+["']?)\s*\|/);if(h){let l=t.indexOf("cat");o.push({filePath:f.filePath,line:e+1,column:l+1,ruleId:"shell/no-useless-cat",message:`Useless use of cat \u2014 pipe the file directly instead of \`cat ${h[1]} | ...\``,severity:"warning",help:`Use \`cmd < ${h[1]}\` or pass the file as an argument to the command`})}}return o}};var W={meta:{docs:"Flag variables inside single quotes where they won't expand",recommended:!0},check(u,f){let o=[],c=u.split(/\r?\n/),s=!1,r="";for(let e=0;e<c.length;e++){let t=c[e];if(s){if(t.trim()===r)s=!1;continue}let d=t.match(/<<-?\s*['"]?(\w+)['"]?/);if(d)s=!0,r=d[1];if(t.replace(/^\s+/,"").startsWith("#"))continue;let h=!1,l=!1,p=-1;for(let b=0;b<t.length;b++){let R=t[b];if(R==="#"&&!h&&!l)break;if(R==="\\"&&!h){b++;continue}if(R==='"'&&!h){l=!l;continue}if(R==="'"&&!l)if(!h)h=!0,p=b;else{let M=t.slice(p+1,b).match(/\$(?:[A-Za-z_]\w*|\{[^}]+\}|\([^)]*\))/),w=/(?:^|[;&|])\s*(?:(?:then|do)\s+)?(?:(?:builtin|command)\s+)?trap\s+(?:--\s+)?$/.test(t.slice(0,p));if(M&&!w)o.push({filePath:f.filePath,line:e+1,column:p+1+M.index+1,ruleId:"shell/no-variable-in-single-quotes",message:`Variable ${M[0]} is inside single quotes and won't be expanded`,severity:"warning",help:`Use double quotes if you want variable expansion: "..." instead of '...'`});h=!1}}}return o}};var G=[/^\s*(?:local|export|declare|typeset|readonly)\s+/,/\[\[.*\]\]/,/\(\(.*\)\)/],k=/^\$(?:\{[A-Za-z_]\w*(?:[:#%\/][^}]*)?\}|[A-Za-z_]\w*)/,H={meta:{docs:"Quote variable expansions to prevent word splitting and globbing",recommended:!0},check(u,f){let o=[],c=u.split(/\r?\n/),s=!1,r="";for(let e=0;e<c.length;e++){let t=c[e];if(s){if(t.trim()===r)s=!1;continue}let d=i(t);if(d){if(s=!0,r=d,new RegExp(`<<-?\\s*['"]${d}['"]`).test(t))continue}if(t.replace(/^\s+/,"").startsWith("#"))continue;if(G.some((p)=>p.test(t)))continue;let h=[],l=0;while(l<t.length){let p=h[h.length-1];if(p==="squote"){if(t[l]==="'")h.pop();l++;continue}if(t[l]==="\\"&&l+1<t.length){l+=2;continue}if(p==="dquote"){let R=t[l];if(R==='"'){h.pop(),l++;continue}if(R==="$"&&t[l+1]==="("&&t[l+2]==="("){h.push("arith"),l+=3;continue}if(R==="$"&&t[l+1]==="("){h.push("subshell"),l+=2;continue}if(R==="$"){let y=t.slice(l).match(k);if(y){l+=y[0].length;continue}}l++;continue}if(p==="arith"){let R=t[l];if(R===")"&&t[l+1]===")"){h.pop(),l+=2;continue}if(R==="$"){let y=t.slice(l).match(k);if(y){l+=y[0].length;continue}}l++;continue}let b=t[l];if(b==="#"&&(l===0||/\s/.test(t[l-1])))break;if(b==="'"){h.push("squote"),l++;continue}if(b==='"'){h.push("dquote"),l++;continue}if(b==="$"&&t[l+1]==="("&&t[l+2]==="("){h.push("arith"),l+=3;continue}if(b==="$"&&t[l+1]==="("){h.push("subshell"),l+=2;continue}if(b===")"&&p==="subshell"){h.pop(),l++;continue}if(b==="$"){let R=t.slice(l).match(k);if(R){let y=R[0];if(!/^\$[?!#@*0-9-]/.test(y))o.push({filePath:f.filePath,line:e+1,column:l+1,ruleId:"shell/quote-variables",message:`Unquoted variable ${y} \u2014 use "${y}" to prevent word splitting`,severity:"warning",help:`Wrap in double quotes: "${y}"`});l+=y.length;continue}}l++}}return o}};var C={meta:{docs:"Enforce consistent function declaration style",recommended:!0},check(u,f){let o=[],c=u.split(/\r?\n/),s=!1,r="";for(let e=0;e<c.length;e++){let t=c[e];if(s){if(t.trim()===r)s=!1;continue}let d=t.match(/<<-?\s*['"]?(\w+)['"]?/);if(d)s=!0,r=d[1];let m=t.replace(/^\s+/,"");if(m.startsWith("#"))continue;let h=m.match(/^function\s+(\w+)\s*(?:\(\s*\))?\s*\{?\s*$/);if(h){let l=h[1],p=t.indexOf("function");o.push({filePath:f.filePath,line:e+1,column:p+1,ruleId:"shell/function-style",message:`Use \`${l}() {\` instead of \`function ${l}\` \u2014 POSIX-compatible style`,severity:"warning",help:`Replace with: ${l}() {`})}}return o},fix(u){let f=u.split(/\r?\n/),o=[];for(let c of f){let s=c.match(/^(\s*)function\s+(\w+)\s*(?:\(\s*\))?\s*(\{?\s*)$/);if(s){let[,r,e,t]=s;o.push(`${r}${e}() ${t||"{"}`)}else o.push(c)}return o.join(`
4
- `)}};function E(u,f){if(/^then\b/.test(u)||/^do\b/.test(u)||/^else\b/.test(u))return!0;if(/^if\b/.test(u)&&/\bthen\s*$/.test(u))return!0;if(/^elif\b/.test(u)&&/\bthen\s*$/.test(u))return!0;if(/^(?:while|for|until)\b/.test(u)&&/\bdo\s*$/.test(u))return!0;if(/^case\b/.test(u)&&/\bin\s*$/.test(u))return!0;if(f&&/\)\s*$/.test(u)&&!/\$\(/.test(u)&&!/^\s*\(/.test(u)&&!u.startsWith("#"))return!0;if(/\{\s*$/.test(u)&&!u.startsWith("#"))return!0;return!1}function q(u){return/^(?:fi|done|esac|elif|else)\b/.test(u)||/^\}/.test(u)||/^;[;&]\s*$/.test(u)}var O={meta:{docs:"Enforce consistent indentation in shell scripts",recommended:!0},check(u,f){let o=[],c=u.split(/\r?\n/),s=f.config.format.indent||2,r=0,e=new g,t=!1,d="",m=!1,h=0;for(let l=0;l<c.length;l++){let p=c[l];if(/^\s*$/.test(p))continue;if(t){if(p.trim()===d)t=!1;continue}let b=p.match(/<<-?\s*['"]?(\w+)['"]?/);if(b)t=!0,d=b[1];let R=p.replace(/^\s+/,""),y=e.read(R);if(l===0&&R.startsWith("#!"))continue;if(/^case\b/.test(R)&&/\bin\s*$/.test(R))h++,m=!0;if(/^esac\b/.test(R)){if(h=Math.max(0,h-1),h===0)m=!1}if(!y.continuation&&q(R))r=Math.max(0,r-1);let M=0;for(let x=0;x<p.length;x++)if(p[x]===" ")M++;else if(p[x]==="\t")M+=s;else break;let w=(r+Number(y.continuation))*s;if(M!==w&&!R.startsWith("#"))o.push({filePath:f.filePath,line:l+1,column:1,ruleId:"shell/indent",message:`Expected ${w} spaces of indentation, found ${M}`,severity:"warning"});if(y.closesHeader||!y.continuation&&E(R,m))r++}return o},fix(u,f){let o=u.split(/\r?\n/),c=f.config.format.indent||2,s=f.config.format.indentStyle==="tabs",r=[],e=0,t=new g,d=!1,m="",h=!1,l=0;for(let p=0;p<o.length;p++){let b=o[p];if(/^\s*$/.test(b)){r.push("");continue}if(d){if(r.push(b),b.trim()===m)d=!1;continue}let R=b.match(/<<-?\s*['"]?(\w+)['"]?/);if(R)d=!0,m=R[1];let y=b.replace(/^\s+/,"").trimEnd(),M=t.read(y);if(p===0&&y.startsWith("#!")){r.push(y);continue}if(/^case\b/.test(y)&&/\bin\s*$/.test(y))l++,h=!0;if(/^esac\b/.test(y)){if(l=Math.max(0,l-1),l===0)h=!1}if(!M.continuation&&q(y))e=Math.max(0,e-1);let w=e+Number(M.continuation),x=s?"\t".repeat(w):" ".repeat(w*c);if(r.push(x+y),M.closesHeader||!M.continuation&&E(y,h))e++}return r.join(`
5
- `)}};var A={meta:{docs:"Enforce spacing around shell keywords (if, then, do, else, fi, etc.)",recommended:!0},check(u,f){let o=[],c=u.split(/\r?\n/),s=!1,r="";for(let e=0;e<c.length;e++){let t=c[e];if(s){if(t.trim()===r)s=!1;continue}let d=i(t);if(d)s=!0,r=d;if(t.replace(/^\s+/,"").startsWith("#"))continue;let h=a(t),l=h.match(/;(?![;\s$])\S/);if(l)o.push({filePath:f.filePath,line:e+1,column:(l.index||0)+1,ruleId:"shell/keyword-spacing",message:"Missing space after semicolon",severity:"warning"});let p=h.match(/\w(then|do|else|elif|fi|done|esac)\b/);if(p&&!/[a-z]/.test(h[p.index])){let b=p[1],R=h[p.index];if(R!==" "&&R!=="\t"&&R!==";")o.push({filePath:f.filePath,line:e+1,column:(p.index||0)+2,ruleId:"shell/keyword-spacing",message:`Missing space before keyword '${b}'`,severity:"warning"})}}return o}};var U={meta:{docs:"Disallow unnecessary trailing semicolons",recommended:!0},check(u,f){let o=[],c=u.split(/\r?\n/),s=!1,r="";for(let e=0;e<c.length;e++){let t=c[e];if(s){if(t.trim()===r)s=!1;continue}let d=t.match(/<<-?\s*['"]?(\w+)['"]?/);if(d)s=!0,r=d[1];let m=t.replace(/^\s+/,"").trimEnd();if(m.startsWith("#"))continue;if(/;;\s*$/.test(m))continue;if(/\bfor\b/.test(m)||/\bwhile\b/.test(m)||/\buntil\b/.test(m))continue;if(/;\s*(?:then|do|else|elif|fi|done|esac)\s*$/.test(m))continue;if(/;\s*$/.test(m)){let h=t.lastIndexOf(";");o.push({filePath:f.filePath,line:e+1,column:h+1,ruleId:"shell/no-trailing-semicolons",message:"Unnecessary trailing semicolon",severity:"warning"})}}return o},fix(u){let f=u.split(/\r?\n/),o=[],c=!1,s="";for(let r of f){if(c){if(o.push(r),r.trim()===s)c=!1;continue}let e=r.match(/<<-?\s*['"]?(\w+)['"]?/);if(e)c=!0,s=e[1];let t=r.replace(/^\s+/,"").trimEnd();if(t.startsWith("#")||/;;\s*$/.test(t)||/\bfor\b/.test(t)||/\bwhile\b/.test(t)||/\buntil\b/.test(t)||/;\s*(?:then|do|else|elif|fi|done|esac)\s*$/.test(t)){o.push(r);continue}o.push(r.replace(/;\s*$/,""))}return o.join(`
2
+ import{n}from"./chunk-qq03kpe0.js";import{a,i,b}from"./chunk-0rxvmb2a.js";var v={meta:{docs:"Use $() instead of backticks for command substitution",recommended:!0},check(u,f){let o=[],c=u.split(/\r?\n/),s=!1,r="",e=!1;for(let t=0;t<c.length;t++){let d=c[t];if(s){if(d.trim()===r)s=!1;continue}let m=d.match(/<<-?\s*['"]?(\w+)['"]?/);if(m)s=!0,r=m[1];if(d.replace(/^\s+/,"").startsWith("#"))continue;e=!1;for(let l=0;l<d.length;l++){let p=d[l];if(p==="#"&&!e)break;if(p==="\\"){l++;continue}if(p==="'"){e=!e;continue}if(e)continue;if(p==="`"){o.push({filePath:f.filePath,line:t+1,column:l+1,ruleId:"shell/command-substitution",message:"Use $(...) instead of backticks for command substitution",severity:"error",help:"Replace `cmd` with $(cmd) for better readability and nesting support"});for(l++;l<d.length&&d[l]!=="`";l++)if(d[l]==="\\")l++}}}return o},fix(u,f){let o=u.split(/\r?\n/),c=[],s=!1,r="";for(let e of o){if(s){if(c.push(e),e.trim()===r)s=!1;continue}let t=e.match(/<<-?\s*['"]?(\w+)['"]?/);if(t)s=!0,r=t[1];let d="",m=!1,h=0;while(h<e.length){let l=e[h];if(l==="#"&&!m){d+=e.slice(h);break}if(l==="\\"){d+=e.slice(h,h+2),h+=2;continue}if(l==="'"){m=!m,d+=l,h++;continue}if(m){d+=l,h++;continue}if(l==="`"){let p="";h++;while(h<e.length&&e[h]!=="`")if(e[h]==="\\")p+=e[h+1]||"",h+=2;else p+=e[h],h++;h++,d+=`$(${p})`}else d+=l,h++}c.push(d)}return c.join(`
3
+ `)}};var P={meta:{docs:"Require error handling after cd commands",recommended:!0},check(u,f){let o=[],c=u.split(/\r?\n/),s=!1,r="";for(let e=0;e<c.length;e++){let t=c[e];if(s){if(t.trim()===r)s=!1;continue}let d=t.match(/<<-?\s*['"]?(\w+)['"]?/);if(d)s=!0,r=d[1];let m=t.replace(/^\s+/,"");if(m.startsWith("#"))continue;let h=m.match(/^cd\s+/);if(!h)continue;let l=/\|\||&&/.test(t),p=/^\s*(?:if|elif|while|until)\s/.test(m)||/\bif\s+cd\b/.test(t),g=/\(.*\bcd\b.*\)/.test(t);if(!l&&!p&&!g)o.push({filePath:f.filePath,line:e+1,column:h.index+1,ruleId:"shell/no-cd-without-check",message:"cd without error handling \u2014 if it fails, subsequent commands run in the wrong directory",severity:"warning",help:"Use: cd dir || exit 1 (or || return 1 inside functions)"})}return o}};var S={meta:{docs:"Disallow use of eval in shell scripts",recommended:!0},check(u,f){let o=[],c=u.split(/\r?\n/),s=!1,r="";for(let e=0;e<c.length;e++){let t=c[e];if(s){if(t.trim()===r)s=!1;continue}let d=t.match(/<<-?\s*['"]?(\w+)['"]?/);if(d)s=!0,r=d[1];if(t.replace(/^\s+/,"").startsWith("#"))continue;if(t.match(/(?:^|[;&|]\s*|^\s+)eval\s/)){let l=t.indexOf("eval");o.push({filePath:f.filePath,line:e+1,column:l+1,ruleId:"shell/no-eval",message:"Avoid using eval \u2014 it re-parses arguments and can lead to code injection",severity:"error",help:"Refactor to avoid eval. Consider using arrays for dynamic commands or indirect variable references with ${!var}"})}}return o}};var D={meta:{docs:"Flag exit inside subshells where it only exits the subshell",recommended:!0},check(u,f){let o=[],c=u.split(/\r?\n/),s=!1,r="",e=0;for(let t=0;t<c.length;t++){let d=c[t];if(s){if(d.trim()===r)s=!1;continue}let m=d.match(/<<-?\s*['"]?(\w+)['"]?/);if(m)s=!0,r=m[1];if(d.replace(/^\s+/,"").startsWith("#"))continue;let l=!1,p=!1;for(let g=0;g<d.length;g++){let R=d[g];if(R==="#"&&!l&&!p)break;if(R==="\\"&&!l){g++;continue}if(R==="'"&&!p){l=!l;continue}if(R==='"'&&!l){p=!p;continue}if(!l&&!p){if(R==="("&&g>0&&d[g-1]!=="$"&&d[g+1]!=="(")e++;else if(R==="("&&g===0&&d[g+1]!=="(")e++;else if(R===")"&&e>0&&(g+1>=d.length||d[g+1]!==")"))e--}}if(e>0){let g=d.match(/\bexit\b/);if(g)o.push({filePath:f.filePath,line:t+1,column:g.index+1,ruleId:"shell/no-exit-in-subshell",message:"exit inside a subshell only exits the subshell, not the script",severity:"warning",help:"Restructure to avoid subshells, or use return if inside a function"})}if(e===0){let g=d.match(/(?<!\$)\((?!\()([^)]*\bexit\b[^)]*)\)(?!\))/);if(g){let R=d.indexOf("exit",g.index);o.push({filePath:f.filePath,line:t+1,column:R+1,ruleId:"shell/no-exit-in-subshell",message:"exit inside a subshell only exits the subshell, not the script",severity:"warning",help:"Restructure to avoid subshells, or use return if inside a function"})}}}return o}};var I={meta:{docs:"Disallow parsing ls output \u2014 use globs or find instead",recommended:!0},check(u,f){let o=[],c=u.split(/\r?\n/),s=!1,r="";for(let e=0;e<c.length;e++){let t=c[e];if(s){if(t.trim()===r)s=!1;continue}let d=t.match(/<<-?\s*['"]?(\w+)['"]?/);if(d)s=!0,r=d[1];if(t.replace(/^\s+/,"").startsWith("#"))continue;if(t.match(/\bls\b[^|]*\|/)){let g=t.indexOf("ls");o.push({filePath:f.filePath,line:e+1,column:g+1,ruleId:"shell/no-ls-parsing",message:"Don't parse ls output \u2014 filenames can contain special characters",severity:"warning",help:'Use globs (for f in *.txt), find (find . -name "*.txt"), or stat instead'});continue}let l=t.match(/\$\(\s*ls\b/);if(l){let g=l.index+1;o.push({filePath:f.filePath,line:e+1,column:g,ruleId:"shell/no-ls-parsing",message:"Don't use ls in command substitution \u2014 use globs instead",severity:"warning",help:"Replace $(ls *.txt) with glob patterns: for f in *.txt; do ...; done"});continue}let p=t.match(/`\s*ls\b/);if(p){let g=p.index+1;o.push({filePath:f.filePath,line:e+1,column:g,ruleId:"shell/no-ls-parsing",message:"Don't use ls in command substitution \u2014 use globs instead",severity:"warning",help:"Replace `ls` with glob patterns"})}}return o}};var T={meta:{docs:"Detect useless use of cat (UUOC)",recommended:!0},check(u,f){let o=[],c=u.split(/\r?\n/),s=!1,r="";for(let e=0;e<c.length;e++){let t=c[e];if(s){if(t.trim()===r)s=!1;continue}let d=t.match(/<<-?\s*['"]?(\w+)['"]?/);if(d)s=!0,r=d[1];if(t.replace(/^\s+/,"").startsWith("#"))continue;let h=t.match(/\bcat\s+(["']?[\w.\/~${}*?-]+["']?)\s*\|/);if(h){let l=t.indexOf("cat");o.push({filePath:f.filePath,line:e+1,column:l+1,ruleId:"shell/no-useless-cat",message:`Useless use of cat \u2014 pipe the file directly instead of \`cat ${h[1]} | ...\``,severity:"warning",help:`Use \`cmd < ${h[1]}\` or pass the file as an argument to the command`})}}return o}};var W={meta:{docs:"Flag variables inside single quotes where they won't expand",recommended:!0},check(u,f){let o=[],c=u.split(/\r?\n/),s=!1,r="";for(let e=0;e<c.length;e++){let t=c[e];if(s){if(t.trim()===r)s=!1;continue}let d=t.match(/<<-?\s*['"]?(\w+)['"]?/);if(d)s=!0,r=d[1];if(t.replace(/^\s+/,"").startsWith("#"))continue;let h=!1,l=!1,p=-1;for(let g=0;g<t.length;g++){let R=t[g];if(R==="#"&&!h&&!l)break;if(R==="\\"&&!h){g++;continue}if(R==='"'&&!h){l=!l;continue}if(R==="'"&&!l)if(!h)h=!0,p=g;else{let M=t.slice(p+1,g).match(/\$(?:[A-Za-z_]\w*|\{[^}]+\}|\([^)]*\))/),w=/(?:^|[;&|])\s*(?:(?:then|do)\s+)?(?:(?:builtin|command)\s+)?trap\s+(?:--\s+)?$/.test(t.slice(0,p));if(M&&!w)o.push({filePath:f.filePath,line:e+1,column:p+1+M.index+1,ruleId:"shell/no-variable-in-single-quotes",message:`Variable ${M[0]} is inside single quotes and won't be expanded`,severity:"warning",help:`Use double quotes if you want variable expansion: "..." instead of '...'`});h=!1}}}return o}};var G=[/^\s*(?:local|export|declare|typeset|readonly)\s+/,/\[\[.*\]\]/,/\(\(.*\)\)/],k=/^\$(?:\{[A-Za-z_]\w*(?:[:#%\/][^}]*)?\}|[A-Za-z_]\w*)/,H={meta:{docs:"Quote variable expansions to prevent word splitting and globbing",recommended:!0},check(u,f){let o=[],c=u.split(/\r?\n/),s=!1,r="";for(let e=0;e<c.length;e++){let t=c[e];if(s){if(t.trim()===r)s=!1;continue}let d=i(t);if(d){if(s=!0,r=d,new RegExp(`<<-?\\s*['"]${d}['"]`).test(t))continue}if(t.replace(/^\s+/,"").startsWith("#"))continue;if(G.some((p)=>p.test(t)))continue;let h=[],l=0;while(l<t.length){let p=h[h.length-1];if(p==="squote"){if(t[l]==="'")h.pop();l++;continue}if(t[l]==="\\"&&l+1<t.length){l+=2;continue}if(p==="dquote"){let R=t[l];if(R==='"'){h.pop(),l++;continue}if(R==="$"&&t[l+1]==="("&&t[l+2]==="("){h.push("arith"),l+=3;continue}if(R==="$"&&t[l+1]==="("){h.push("subshell"),l+=2;continue}if(R==="$"){let y=t.slice(l).match(k);if(y){l+=y[0].length;continue}}l++;continue}if(p==="arith"){let R=t[l];if(R===")"&&t[l+1]===")"){h.pop(),l+=2;continue}if(R==="$"){let y=t.slice(l).match(k);if(y){l+=y[0].length;continue}}l++;continue}let g=t[l];if(g==="#"&&(l===0||/\s/.test(t[l-1])))break;if(g==="'"){h.push("squote"),l++;continue}if(g==='"'){h.push("dquote"),l++;continue}if(g==="$"&&t[l+1]==="("&&t[l+2]==="("){h.push("arith"),l+=3;continue}if(g==="$"&&t[l+1]==="("){h.push("subshell"),l+=2;continue}if(g===")"&&p==="subshell"){h.pop(),l++;continue}if(g==="$"){let R=t.slice(l).match(k);if(R){let y=R[0];if(!/^\$[?!#@*0-9-]/.test(y))o.push({filePath:f.filePath,line:e+1,column:l+1,ruleId:"shell/quote-variables",message:`Unquoted variable ${y} \u2014 use "${y}" to prevent word splitting`,severity:"warning",help:`Wrap in double quotes: "${y}"`});l+=y.length;continue}}l++}}return o}};var C={meta:{docs:"Enforce consistent function declaration style",recommended:!0},check(u,f){let o=[],c=u.split(/\r?\n/),s=!1,r="";for(let e=0;e<c.length;e++){let t=c[e];if(s){if(t.trim()===r)s=!1;continue}let d=t.match(/<<-?\s*['"]?(\w+)['"]?/);if(d)s=!0,r=d[1];let m=t.replace(/^\s+/,"");if(m.startsWith("#"))continue;let h=m.match(/^function\s+(\w+)\s*(?:\(\s*\))?\s*\{?\s*$/);if(h){let l=h[1],p=t.indexOf("function");o.push({filePath:f.filePath,line:e+1,column:p+1,ruleId:"shell/function-style",message:`Use \`${l}() {\` instead of \`function ${l}\` \u2014 POSIX-compatible style`,severity:"warning",help:`Replace with: ${l}() {`})}}return o},fix(u){let f=u.split(/\r?\n/),o=[];for(let c of f){let s=c.match(/^(\s*)function\s+(\w+)\s*(?:\(\s*\))?\s*(\{?\s*)$/);if(s){let[,r,e,t]=s;o.push(`${r}${e}() ${t||"{"}`)}else o.push(c)}return o.join(`
4
+ `)}};function E(u,f){if(/^then\b/.test(u)||/^do\b/.test(u)||/^else\b/.test(u))return!0;if(/^if\b/.test(u)&&/\bthen\s*$/.test(u))return!0;if(/^elif\b/.test(u)&&/\bthen\s*$/.test(u))return!0;if(/^(?:while|for|until)\b/.test(u)&&/\bdo\s*$/.test(u))return!0;if(/^case\b/.test(u)&&/\bin\s*$/.test(u))return!0;if(f&&/\)\s*$/.test(u)&&!/\$\(/.test(u)&&!/^\s*\(/.test(u)&&!u.startsWith("#"))return!0;if(/\{\s*$/.test(u)&&!u.startsWith("#"))return!0;return!1}function q(u){return/^(?:fi|done|esac|elif|else)\b/.test(u)||/^\}/.test(u)||/^;[;&]\s*$/.test(u)}var O={meta:{docs:"Enforce consistent indentation in shell scripts",recommended:!0},check(u,f){let o=[],c=u.split(/\r?\n/),s=f.config.format.indent||2,r=0,e=new b,t=!1,d="",m=!1,h=0;for(let l=0;l<c.length;l++){let p=c[l];if(/^\s*$/.test(p))continue;if(t){if(p.trim()===d)t=!1;continue}let g=p.match(/<<-?\s*['"]?(\w+)['"]?/);if(g)t=!0,d=g[1];let R=p.replace(/^\s+/,""),y=e.read(R);if(l===0&&R.startsWith("#!"))continue;if(/^case\b/.test(R)&&/\bin\s*$/.test(R))h++,m=!0;if(/^esac\b/.test(R)){if(h=Math.max(0,h-1),h===0)m=!1}if(!y.continuation&&q(R))r=Math.max(0,r-1);let M=0;for(let x=0;x<p.length;x++)if(p[x]===" ")M++;else if(p[x]==="\t")M+=s;else break;let w=(r+Number(y.continuation))*s;if(M!==w&&!R.startsWith("#"))o.push({filePath:f.filePath,line:l+1,column:1,ruleId:"shell/indent",message:`Expected ${w} spaces of indentation, found ${M}`,severity:"warning"});if(y.closesHeader||!y.continuation&&E(R,m))r++}return o},fix(u,f){let o=u.split(/\r?\n/),c=f.config.format.indent||2,s=f.config.format.indentStyle==="tabs",r=[],e=0,t=new b,d=!1,m="",h=!1,l=0;for(let p=0;p<o.length;p++){let g=o[p];if(/^\s*$/.test(g)){r.push("");continue}if(d){if(r.push(g),g.trim()===m)d=!1;continue}let R=g.match(/<<-?\s*['"]?(\w+)['"]?/);if(R)d=!0,m=R[1];let y=g.replace(/^\s+/,"").trimEnd(),M=t.read(y);if(p===0&&y.startsWith("#!")){r.push(y);continue}if(/^case\b/.test(y)&&/\bin\s*$/.test(y))l++,h=!0;if(/^esac\b/.test(y)){if(l=Math.max(0,l-1),l===0)h=!1}if(!M.continuation&&q(y))e=Math.max(0,e-1);let w=e+Number(M.continuation),x=s?"\t".repeat(w):" ".repeat(w*c);if(r.push(x+y),M.closesHeader||!M.continuation&&E(y,h))e++}return r.join(`
5
+ `)}};var A={meta:{docs:"Enforce spacing around shell keywords (if, then, do, else, fi, etc.)",recommended:!0},check(u,f){let o=[],c=u.split(/\r?\n/),s=!1,r="";for(let e=0;e<c.length;e++){let t=c[e];if(s){if(t.trim()===r)s=!1;continue}let d=i(t);if(d)s=!0,r=d;if(t.replace(/^\s+/,"").startsWith("#"))continue;let h=a(t),l=h.match(/;(?![;\s$])\S/);if(l)o.push({filePath:f.filePath,line:e+1,column:(l.index||0)+1,ruleId:"shell/keyword-spacing",message:"Missing space after semicolon",severity:"warning"});let p=h.match(/\w(then|do|else|elif|fi|done|esac)\b/);if(p&&!/[a-z]/.test(h[p.index])){let g=p[1],R=h[p.index];if(R!==" "&&R!=="\t"&&R!==";")o.push({filePath:f.filePath,line:e+1,column:(p.index||0)+2,ruleId:"shell/keyword-spacing",message:`Missing space before keyword '${g}'`,severity:"warning"})}}return o}};var U={meta:{docs:"Disallow unnecessary trailing semicolons",recommended:!0},check(u,f){let o=[],c=u.split(/\r?\n/),s=!1,r="";for(let e=0;e<c.length;e++){let t=c[e];if(s){if(t.trim()===r)s=!1;continue}let d=t.match(/<<-?\s*['"]?(\w+)['"]?/);if(d)s=!0,r=d[1];let m=t.replace(/^\s+/,"").trimEnd();if(m.startsWith("#"))continue;if(/;;\s*$/.test(m))continue;if(/\bfor\b/.test(m)||/\bwhile\b/.test(m)||/\buntil\b/.test(m))continue;if(/;\s*(?:then|do|else|elif|fi|done|esac)\s*$/.test(m))continue;if(/;\s*$/.test(m)){let h=t.lastIndexOf(";");o.push({filePath:f.filePath,line:e+1,column:h+1,ruleId:"shell/no-trailing-semicolons",message:"Unnecessary trailing semicolon",severity:"warning"})}}return o},fix(u){let f=u.split(/\r?\n/),o=[],c=!1,s="";for(let r of f){if(c){if(o.push(r),r.trim()===s)c=!1;continue}let e=r.match(/<<-?\s*['"]?(\w+)['"]?/);if(e)c=!0,s=e[1];let t=r.replace(/^\s+/,"").trimEnd();if(t.startsWith("#")||/;;\s*$/.test(t)||/\bfor\b/.test(t)||/\bwhile\b/.test(t)||/\buntil\b/.test(t)||/;\s*(?:then|do|else|elif|fi|done|esac)\s*$/.test(t)){o.push(r);continue}o.push(r.replace(/;\s*$/,""))}return o.join(`
6
6
  `)}};var j={meta:{docs:"Disallow trailing whitespace",recommended:!0},check(u,f){let o=[],c=u.split(/\r?\n/),s=!1,r="";for(let e=0;e<c.length;e++){let t=c[e];if(s){if(t.trim()===r)s=!1;continue}let d=i(t);if(d)s=!0,r=d;if(/[ \t]+$/.test(t)){let m=t.match(/[ \t]+$/);o.push({filePath:f.filePath,line:e+1,column:m.index+1,ruleId:"shell/no-trailing-whitespace",message:"Trailing whitespace",severity:"error"})}}return o},fix(u){let f=u.split(/\r?\n/),o=!1,c="";return f.map((r)=>{if(o){if(r.trim()===c)o=!1;return r}let e=i(r);if(e)o=!0,c=e;return r.replace(/[ \t]+$/,"")}).join(`
7
7
  `)}};var B={meta:{docs:"Enforce spaces inside [ ] and [[ ]] test expressions",recommended:!0},check(u,f){let o=[],c=u.split(/\r?\n/),s=!1,r="";for(let e=0;e<c.length;e++){let t=c[e];if(s){if(t.trim()===r)s=!1;continue}let d=i(t);if(d)s=!0,r=d;if(t.replace(/^\s+/,"").startsWith("#"))continue;let h=a(t);for(let l of K(h,e+1,f.filePath))o.push(l)}return o},fix(u){let f=u.split(/\r?\n/),o=[],c=!1,s="";for(let r of f){if(c){if(r.trim()===s)c=!1;o.push(r);continue}let e=i(r);if(e){c=!0,s=e,o.push(r);continue}if(r.replace(/^\s+/,"").startsWith("#")){o.push(r);continue}o.push(J(r))}return o.join(`
8
- `)}};function K(u,f,o){let c=[],s=/\[\[(?!\s|\]|$)/g;for(let e of u.matchAll(s))c.push({filePath:o,line:f,column:(e.index??0)+1,ruleId:"shell/operator-spacing",message:"Missing space after [[",severity:"warning"});let r=/(?<!\s|\[)\]\]/g;for(let e of u.matchAll(r))c.push({filePath:o,line:f,column:(e.index??0)+1,ruleId:"shell/operator-spacing",message:"Missing space before ]]",severity:"warning"});for(let e=0;e<u.length;e++){if(u[e]!=="[")continue;if(u[e+1]==="[")continue;if(e>0&&u[e-1]==="[")continue;if(!z(u,e))continue;let t=u[e+1];if(t!==void 0&&t!==" "&&t!=="\t")c.push({filePath:o,line:f,column:e+1,ruleId:"shell/operator-spacing",message:"Missing space after [",severity:"warning"})}for(let e=0;e<u.length;e++){if(u[e]!=="]")continue;if(u[e+1]==="]")continue;if(e>0&&u[e-1]==="]")continue;if(!L(u,e))continue;let t=u[e-1];if(t!==void 0&&t!==" "&&t!=="\t")c.push({filePath:o,line:f,column:e+1,ruleId:"shell/operator-spacing",message:"Missing space before ]",severity:"warning"})}return c}function J(u){let f=a(u),o=[];for(let s of f.matchAll(/\[\[(?!\s|\]|$)/g)){let r=(s.index??0)+2;o.push({pos:r,text:" "})}for(let s of f.matchAll(/(?<!\s|\[)\]\]/g)){let r=s.index??0;o.push({pos:r,text:" "})}for(let s=0;s<f.length;s++){if(f[s]!=="[")continue;if(f[s+1]==="[")continue;if(s>0&&f[s-1]==="[")continue;if(!z(f,s))continue;let r=f[s+1];if(r!==void 0&&r!==" "&&r!=="\t")o.push({pos:s+1,text:" "})}for(let s=0;s<f.length;s++){if(f[s]!=="]")continue;if(f[s+1]==="]")continue;if(s>0&&f[s-1]==="]")continue;if(!L(f,s))continue;let r=f[s-1];if(r!==void 0&&r!==" "&&r!=="\t")o.push({pos:s,text:" "})}if(o.length===0)return u;o.sort((s,r)=>r.pos-s.pos);let c=u;for(let{pos:s,text:r}of o)c=`${c.slice(0,s)}${r}${c.slice(s)}`;return c}function z(u,f){let o=f-1;while(o>=0&&(u[o]===" "||u[o]==="\t"))o--;if(o<0)return!0;let c=u[o];if(c===";"||c==="|"||c==="&"||c==="!"||c==="(")return!0;let s=u.slice(0,o+1);if(/(?:^|\s)(?:if|while|until|elif|then|else|do)\s*$/.test(s))return!0;return!1}function L(u,f){let o=u[f+1];if(o===void 0)return!0;return o===" "||o==="\t"||o===";"||o==="|"||o==="&"||o===")"}var Y=/^#!\s*(?:\/usr\/bin\/env\s+(?:ba|z|k|da)?sh|\/bin\/(?:ba|z|k|da)?sh|\/usr\/bin\/(?:ba|z|k|da)?sh)\b/,Q={meta:{docs:"Ensure shell scripts have a proper shebang line",recommended:!0},check(u,f){let o=[],c=u.split(/\r?\n/);if(c.length===0)return o;let s=c[0];if(c.every((r)=>r.trim()===""))return o;if(!s.startsWith("#!"))return o.push({filePath:f.filePath,line:1,column:1,ruleId:"shell/shebang",message:"Missing shebang line \u2014 shell scripts should start with #!/usr/bin/env bash (or similar)",severity:"warning",help:"Add #!/usr/bin/env bash as the first line"}),o;if(!Y.test(s))o.push({filePath:f.filePath,line:1,column:1,ruleId:"shell/shebang",message:`Invalid shebang: ${s} \u2014 use #!/usr/bin/env bash or #!/bin/sh`,severity:"warning",help:"Use #!/usr/bin/env bash for portability or #!/bin/sh for POSIX scripts"});return o}};var V={meta:{docs:"Enforce consistent case statement terminator placement",recommended:!0},check(u,f){let o=[],c=u.split(/\r?\n/),s=!1,r="",e=[];for(let t of c){if(s){if(t.trim()===r)s=!1;e.push("");continue}let d=i(t);if(d)s=!0,r=d;if(t.replace(/^\s+/,"").startsWith("#")){e.push("");continue}e.push(a(t))}for(let t=0;t<e.length;t++){if(!/\bcase\b[\s\S]*\bin\s*$/.test(e[t].trimEnd()))continue;let d=1,m=-1;for(let b=t+1;b<e.length;b++){let R=e[b].trimEnd();if(/^\s*esac\b/.test(R)){if(d--,d===0){m=b;break}continue}if(/\bcase\b[\s\S]*\bin\s*$/.test(R))d++}if(m===-1)continue;let h=0,l=!1,p=!1;for(let b=t+1;b<m;b++){let R=e[b],y=R.trim();if(y==="")continue;if(h===0){let M=ee(R);if(M!==-1){if(l&&p)o.push({filePath:f.filePath,line:b+1,column:1,ruleId:"shell/consistent-case-terminators",message:"Missing ;; terminator for previous case branch",severity:"warning",help:"Add ;; at the end of the case branch before the next pattern"});l=!0,p=!0;let w=R.slice(M+1).trimEnd();if(/;;\s*$/.test(w))l=!1;continue}}if(h+=te(R),h<0)h=0;if(l&&h===0&&/;;\s*$/.test(y))l=!1}}return o}};function ee(u){let f=u.replace(/^\s+/,"");if(f==="")return-1;if(/^(?:for|while|until|if|case|do|then|else|elif|fi|done|esac)\b/.test(f))return-1;let o=u.length-f.length,c=0;if(f[c]==="(")c++;let s=0;while(c<f.length){let r=f[c];if(r==="(")s++;else if(r===")"){if(s===0)return o+c;s--}else if(r===";"||r==="&"||r==="<"||r===">"||r==="=")return-1;c++}return-1}function te(u){let f=u.trim();if(f==="")return 0;let o=f.split(/[\s;]+/),c=0;for(let s of o)if(s==="if"||s==="for"||s==="while"||s==="until")c++;else if(s==="fi"||s==="done")c--;return c}var _={meta:{docs:"Recommend <<- for heredocs inside indented blocks"},check(u,f){let o=[],c=u.split(/\r?\n/);for(let s=0;s<c.length;s++){let r=c[s];if(r.replace(/^\s+/,"").startsWith("#"))continue;if(!r.match(/^\s+/))continue;let m=a(r).match(/(?<!<)<<(?![<-])/);if(!m||m.index===void 0)continue;let l=r.slice(m.index+2).match(/^\s*(['"]?)(\w+)\1\s*$/);if(l){let p=l[2];o.push({filePath:f.filePath,line:s+1,column:m.index+1,ruleId:"shell/heredoc-indent",message:`Use <<- instead of << for indented heredoc (delimiter '${p}' must be at column 0 otherwise)`,severity:"warning",help:"Use <<- to strip leading tabs from heredoc content, allowing proper indentation"})}}return o}};var Z={meta:{docs:"Detect incorrect redirect ordering (2>&1 before > file)",recommended:!0},check(u,f){let o=[],c=u.split(/\r?\n/),s=!1,r="";for(let e=0;e<c.length;e++){let t=c[e];if(s){if(t.trim()===r)s=!1;continue}let d=i(t);if(d)s=!0,r=d;if(t.replace(/^\s+/,"").startsWith("#"))continue;let h=a(t);if(h.match(/2>&1\s+>(?!&)\s*\S/)){let p=h.indexOf("2>&1");o.push({filePath:f.filePath,line:e+1,column:p+1,ruleId:"shell/no-broken-redirect",message:"Broken redirect: 2>&1 before > file \u2014 stderr goes to terminal, not the file",severity:"error",help:"Swap the order: cmd > file 2>&1 (or use &> file in bash)"})}}return o}};var F={meta:{docs:"Prefer [[ ]] over [ ] for test expressions in bash/zsh",recommended:!0},check(u,f){let o=[],c=u.split(/\r?\n/)[0]||"",s=/bash|zsh/.test(c);if(/^#!.*\bsh\b/.test(c)&&!s||!s)return o;let e=u.split(/\r?\n/),t=!1,d="";for(let m=0;m<e.length;m++){let h=e[m];if(t){if(h.trim()===d)t=!1;continue}let l=h.match(/<<-?\s*['"]?(\w+)['"]?/);if(l)t=!0,d=l[1];if(h.replace(/^\s+/,"").startsWith("#"))continue;if(h.match(/(?:^|\s|;)\[\s(?!\[)/)){if(/(?<!\])\](?!\])/.test(h)){let R=h.indexOf("[");o.push({filePath:f.filePath,line:m+1,column:R+1,ruleId:"shell/prefer-double-brackets",message:"Use [[ ]] instead of [ ] for test expressions in bash/zsh",severity:"warning",help:"[[ ]] prevents word splitting and supports && || regex; [ ] is only needed for POSIX sh"})}}}return o},fix(u){let f=u.split(/\r?\n/)[0]||"";if(!/bash|zsh/.test(f))return u;let c=u.split(/\r?\n/),s=[];for(let r of c){let e=r;e=e.replace(/(?:^|(?<=\s|;))\[(\s(?!\[).*?(?<!\]))\](?!\])/g,"[[$1]]"),s.push(e)}return s.join(`
8
+ `)}};function K(u,f,o){let c=[],s=/\[\[(?!\s|\]|$)/g;for(let e of u.matchAll(s))c.push({filePath:o,line:f,column:(e.index??0)+1,ruleId:"shell/operator-spacing",message:"Missing space after [[",severity:"warning"});let r=/(?<!\s|\[)\]\]/g;for(let e of u.matchAll(r))c.push({filePath:o,line:f,column:(e.index??0)+1,ruleId:"shell/operator-spacing",message:"Missing space before ]]",severity:"warning"});for(let e=0;e<u.length;e++){if(u[e]!=="[")continue;if(u[e+1]==="[")continue;if(e>0&&u[e-1]==="[")continue;if(!z(u,e))continue;let t=u[e+1];if(t!==void 0&&t!==" "&&t!=="\t")c.push({filePath:o,line:f,column:e+1,ruleId:"shell/operator-spacing",message:"Missing space after [",severity:"warning"})}for(let e=0;e<u.length;e++){if(u[e]!=="]")continue;if(u[e+1]==="]")continue;if(e>0&&u[e-1]==="]")continue;if(!L(u,e))continue;let t=u[e-1];if(t!==void 0&&t!==" "&&t!=="\t")c.push({filePath:o,line:f,column:e+1,ruleId:"shell/operator-spacing",message:"Missing space before ]",severity:"warning"})}return c}function J(u){let f=a(u),o=[];for(let s of f.matchAll(/\[\[(?!\s|\]|$)/g)){let r=(s.index??0)+2;o.push({pos:r,text:" "})}for(let s of f.matchAll(/(?<!\s|\[)\]\]/g)){let r=s.index??0;o.push({pos:r,text:" "})}for(let s=0;s<f.length;s++){if(f[s]!=="[")continue;if(f[s+1]==="[")continue;if(s>0&&f[s-1]==="[")continue;if(!z(f,s))continue;let r=f[s+1];if(r!==void 0&&r!==" "&&r!=="\t")o.push({pos:s+1,text:" "})}for(let s=0;s<f.length;s++){if(f[s]!=="]")continue;if(f[s+1]==="]")continue;if(s>0&&f[s-1]==="]")continue;if(!L(f,s))continue;let r=f[s-1];if(r!==void 0&&r!==" "&&r!=="\t")o.push({pos:s,text:" "})}if(o.length===0)return u;o.sort((s,r)=>r.pos-s.pos);let c=u;for(let{pos:s,text:r}of o)c=`${c.slice(0,s)}${r}${c.slice(s)}`;return c}function z(u,f){let o=f-1;while(o>=0&&(u[o]===" "||u[o]==="\t"))o--;if(o<0)return!0;let c=u[o];if(c===";"||c==="|"||c==="&"||c==="!"||c==="(")return!0;let s=u.slice(0,o+1);if(/(?:^|\s)(?:if|while|until|elif|then|else|do)\s*$/.test(s))return!0;return!1}function L(u,f){let o=u[f+1];if(o===void 0)return!0;return o===" "||o==="\t"||o===";"||o==="|"||o==="&"||o===")"}var Y=/^#!\s*(?:\/usr\/bin\/env\s+(?:ba|z|k|da)?sh|\/bin\/(?:ba|z|k|da)?sh|\/usr\/bin\/(?:ba|z|k|da)?sh)\b/,Q={meta:{docs:"Ensure shell scripts have a proper shebang line",recommended:!0},check(u,f){let o=[],c=u.split(/\r?\n/);if(c.length===0)return o;let s=c[0];if(c.every((r)=>r.trim()===""))return o;if(!s.startsWith("#!"))return o.push({filePath:f.filePath,line:1,column:1,ruleId:"shell/shebang",message:"Missing shebang line \u2014 shell scripts should start with #!/usr/bin/env bash (or similar)",severity:"warning",help:"Add #!/usr/bin/env bash as the first line"}),o;if(!Y.test(s))o.push({filePath:f.filePath,line:1,column:1,ruleId:"shell/shebang",message:`Invalid shebang: ${s} \u2014 use #!/usr/bin/env bash or #!/bin/sh`,severity:"warning",help:"Use #!/usr/bin/env bash for portability or #!/bin/sh for POSIX scripts"});return o}};var V={meta:{docs:"Enforce consistent case statement terminator placement",recommended:!0},check(u,f){let o=[],c=u.split(/\r?\n/),s=!1,r="",e=[];for(let t of c){if(s){if(t.trim()===r)s=!1;e.push("");continue}let d=i(t);if(d)s=!0,r=d;if(t.replace(/^\s+/,"").startsWith("#")){e.push("");continue}e.push(a(t))}for(let t=0;t<e.length;t++){if(!/\bcase\b[\s\S]*\bin\s*$/.test(e[t].trimEnd()))continue;let d=1,m=-1;for(let g=t+1;g<e.length;g++){let R=e[g].trimEnd();if(/^\s*esac\b/.test(R)){if(d--,d===0){m=g;break}continue}if(/\bcase\b[\s\S]*\bin\s*$/.test(R))d++}if(m===-1)continue;let h=0,l=!1,p=!1;for(let g=t+1;g<m;g++){let R=e[g],y=R.trim();if(y==="")continue;if(h===0){let M=ee(R);if(M!==-1){if(l&&p)o.push({filePath:f.filePath,line:g+1,column:1,ruleId:"shell/consistent-case-terminators",message:"Missing ;; terminator for previous case branch",severity:"warning",help:"Add ;; at the end of the case branch before the next pattern"});l=!0,p=!0;let w=R.slice(M+1).trimEnd();if(/;;\s*$/.test(w))l=!1;continue}}if(h+=te(R),h<0)h=0;if(l&&h===0&&/;;\s*$/.test(y))l=!1}}return o}};function ee(u){let f=u.replace(/^\s+/,"");if(f==="")return-1;if(/^(?:for|while|until|if|case|do|then|else|elif|fi|done|esac)\b/.test(f))return-1;let o=u.length-f.length,c=0;if(f[c]==="(")c++;let s=0;while(c<f.length){let r=f[c];if(r==="(")s++;else if(r===")"){if(s===0)return o+c;s--}else if(r===";"||r==="&"||r==="<"||r===">"||r==="=")return-1;c++}return-1}function te(u){let f=u.trim();if(f==="")return 0;let o=f.split(/[\s;]+/),c=0;for(let s of o)if(s==="if"||s==="for"||s==="while"||s==="until")c++;else if(s==="fi"||s==="done")c--;return c}var _={meta:{docs:"Recommend <<- for heredocs inside indented blocks"},check(u,f){let o=[],c=u.split(/\r?\n/);for(let s=0;s<c.length;s++){let r=c[s];if(r.replace(/^\s+/,"").startsWith("#"))continue;if(!r.match(/^\s+/))continue;let m=a(r).match(/(?<!<)<<(?![<-])/);if(!m||m.index===void 0)continue;let l=r.slice(m.index+2).match(/^\s*(['"]?)(\w+)\1\s*$/);if(l){let p=l[2];o.push({filePath:f.filePath,line:s+1,column:m.index+1,ruleId:"shell/heredoc-indent",message:`Use <<- instead of << for indented heredoc (delimiter '${p}' must be at column 0 otherwise)`,severity:"warning",help:"Use <<- to strip leading tabs from heredoc content, allowing proper indentation"})}}return o}};var Z={meta:{docs:"Detect incorrect redirect ordering (2>&1 before > file)",recommended:!0},check(u,f){let o=[],c=u.split(/\r?\n/),s=!1,r="";for(let e=0;e<c.length;e++){let t=c[e];if(s){if(t.trim()===r)s=!1;continue}let d=i(t);if(d)s=!0,r=d;if(t.replace(/^\s+/,"").startsWith("#"))continue;let h=a(t);if(h.match(/2>&1\s+>(?!&)\s*\S/)){let p=h.indexOf("2>&1");o.push({filePath:f.filePath,line:e+1,column:p+1,ruleId:"shell/no-broken-redirect",message:"Broken redirect: 2>&1 before > file \u2014 stderr goes to terminal, not the file",severity:"error",help:"Swap the order: cmd > file 2>&1 (or use &> file in bash)"})}}return o}};var F={meta:{docs:"Prefer [[ ]] over [ ] for test expressions in bash/zsh",recommended:!0},check(u,f){let o=[],c=u.split(/\r?\n/)[0]||"",s=/bash|zsh/.test(c);if(/^#!.*\bsh\b/.test(c)&&!s||!s)return o;let e=u.split(/\r?\n/),t=!1,d="";for(let m=0;m<e.length;m++){let h=e[m];if(t){if(h.trim()===d)t=!1;continue}let l=h.match(/<<-?\s*['"]?(\w+)['"]?/);if(l)t=!0,d=l[1];if(h.replace(/^\s+/,"").startsWith("#"))continue;if(h.match(/(?:^|\s|;)\[\s(?!\[)/)){if(/(?<!\])\](?!\])/.test(h)){let R=h.indexOf("[");o.push({filePath:f.filePath,line:m+1,column:R+1,ruleId:"shell/prefer-double-brackets",message:"Use [[ ]] instead of [ ] for test expressions in bash/zsh",severity:"warning",help:"[[ ]] prevents word splitting and supports && || regex; [ ] is only needed for POSIX sh"})}}}return o},fix(u){let f=u.split(/\r?\n/)[0]||"";if(!/bash|zsh/.test(f))return u;let c=u.split(/\r?\n/),s=[];for(let r of c){let e=r;e=e.replace(/(?:^|(?<=\s|;))\[(\s(?!\[).*?(?<!\]))\](?!\])/g,"[[$1]]"),s.push(e)}return s.join(`
9
9
  `)}};var X={meta:{docs:"Prefer printf over echo -e and echo -n",recommended:!0},check(u,f){let o=[],c=u.split(/\r?\n/),s=!1,r="";for(let e=0;e<c.length;e++){let t=c[e];if(s){if(t.trim()===r)s=!1;continue}let d=t.match(/<<-?\s*['"]?(\w+)['"]?/);if(d)s=!0,r=d[1];if(t.replace(/^\s+/,"").startsWith("#"))continue;let h=t.match(/\becho\s+-[en]+\b/);if(h){let l=t.indexOf("echo"),p=h[0].replace("echo ","");o.push({filePath:f.filePath,line:e+1,column:l+1,ruleId:"shell/prefer-printf",message:`Use printf instead of echo ${p} \u2014 echo behavior varies across platforms`,severity:"warning",help:'printf is portable: printf "format\\n" args... (use \\n for newline)'})}}return o}};var N={meta:{docs:"Recommend set -euo pipefail for safer script execution"},check(u,f){let o=[],c=u.split(/\r?\n/),s=!1,r=!1,e=!1,t=-1,d=!1;for(let h=0;h<c.length;h++){let l=c[h].replace(/^\s+/,"");if(h===0&&l.startsWith("#!")){t=h;continue}if(l.startsWith("#"))continue;if(l==="")continue;if(d=!0,/\bset\s+-\w*e/.test(l))s=!0;if(/\bset\s+-\w*u/.test(l))r=!0;if(/\bset\s+.*-o\s+pipefail/.test(l))e=!0;if(/\bset\s+-euo\s+pipefail/.test(l))s=!0,r=!0,e=!0}if(!d)return o;let m=[];if(!s)m.push("-e");if(!r)m.push("-u");if(!e)m.push("-o pipefail");if(m.length>0)o.push({filePath:f.filePath,line:t>=0?t+2:1,column:1,ruleId:"shell/set-options",message:`Missing shell safety options: set ${m.join(" ")}`,severity:"warning",help:"Add `set -euo pipefail` near the top of the script for safer execution"});return o}};var Ye={name:"shell",rules:{"command-substitution":n(v),"quote-variables":n(H),"no-cd-without-check":n(P),"no-eval":n(S),"no-useless-cat":n(T),"no-ls-parsing":n(I),"no-variable-in-single-quotes":n(W),"no-exit-in-subshell":n(D),shebang:n(Q),indent:n(O),"function-style":n(C),"operator-spacing":n(B),"keyword-spacing":n(A),"no-trailing-semicolons":n(U),"no-trailing-whitespace":n(j),"prefer-double-brackets":n(F),"set-options":n(N),"prefer-printf":n(X),"consistent-case-terminators":n(V),"no-broken-redirect":n(Z),"heredoc-indent":n(_)}};export{Ye as shellPlugin};
@@ -0,0 +1,3 @@
1
+ // @bun
2
+ var{defineProperty:e,getOwnPropertyNames:g,getOwnPropertyDescriptor:h}=Object,i=Object.prototype.hasOwnProperty;function k(a){return this[a]}var P=(a)=>{var b=(f??=new WeakMap).get(a),c;if(b)return b;if(b=e({},"__esModule",{value:!0}),a&&typeof a==="object"||typeof a==="function"){for(var d of g(a))if(!i.call(b,d))e(b,d,{get:k.bind(a,d),enumerable:!(c=h(a,d))||c.enumerable})}return f.set(a,b),b},f;var l=(a)=>a;function m(a,b){this[a]=l.bind(null,b)}var D=(a,b)=>{for(var c in b)e(a,c,{get:b[c],enumerable:!0,configurable:!0,set:m.bind(b,c)})};var j=(a,b,c)=>()=>{if(a)try{b=a(a=0)}catch(d){c=[d]}if(c)throw c[0];return b};var te=import.meta.require;
3
+ export{P,D,j,te};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- var ee="pickier",te="module",A="0.1.70",ne="Format, lint and more in a fraction of seconds.",se="Chris Breuer <chris@stacksjs.org>",re="MIT",ie="https://github.com/pickier/pickier#readme",oe={type:"git",url:"git+https://github.com/pickier/pickier.git"},ae={url:"https://github.com/pickier/pickier/issues"},le=["pickier","linter","formatter","bun","fast"],ce={".":{types:"./dist/src/index.d.ts",import:"./dist/src/index.js"},"./*":{import:"./dist/*"}},ue="./dist/src/index.js",fe="./dist/src/index.d.ts",me={pickier:"./dist/bin/cli.js"},he=["README.md","dist"],de={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"},pe={"@stacksjs/clarity":"^0.3.24","@stacksjs/clapp":"^0.2.3"},ge={"@stacksjs/ts-spell-check":"^0.1.0"},ye={bunfig:"^0.15.13"},be={name:ee,type:te,version:A,description:ne,author:se,license:re,homepage:ie,repository:oe,bugs:ae,keywords:le,exports:ce,module:ue,types:fe,bin:me,files:he,scripts:de,dependencies:pe,optionalDependencies:ge,devDependencies:ye};
3
- export{ee,te,A,ne,se,re,ie,oe,ae,le,ce,ue,fe,me,he,de,pe,ge,ye,be};
2
+ var oe="pickier",ae="module",F="0.1.72",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
+ 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-mgry8xhx.js";import"./chunk-hx0z7dzw.js";export{B as runUnified};
@@ -0,0 +1,29 @@
1
+ // @bun
2
+ import{i,b}from"./chunk-0rxvmb2a.js";import{readdirSync as fn,readFileSync as un}from"fs";import{homedir as dn}from"os";import{join as we}from"path";var je=["code-style","lint"],l={ignores:["**/node_modules/**","**/.pnpm/**","**/.yarn/**","**/dist/**","**/build/**","**/out/**","**/.output/**","**/.next/**","**/.nuxt/**","**/.vite/**","**/.turbo/**","**/.cache/**","**/coverage/**","**/vendor/**","**/pantry/**","**/tmp/**","**/.git/**","**/.idea/**","**/.vscode/**","**/.zed/**","**/.cursor/**","**/.claude/**","**/.github/**","**/*.test.ts","**/*.spec.ts","**/.bunpress/**","**/.vitepress/cache/**","**/storage/framework/stx/**","**/storage/framework/runtime/**","**/storage/cloud/**","**/*.lock","**/package-lock.json","**/pnpm-lock.yaml"],lint:{extensions:["ts","js","html","css","json","jsonc","md","yaml","yml","stx","sh","bash","zsh"],reporter:"stylish",cache:!1,maxWarnings:-1},format:{extensions:["ts","js","html","css","json","jsonc","md","yaml","yml","stx","sh","bash","zsh"],trimTrailingWhitespace:!0,maxConsecutiveBlankLines:1,finalNewline:"one",indent:2,indentStyle:"spaces",preserveCodeIndentation:!1,quotes:"single",semi:!1},rules:{noDebugger:"error",noConsole:"warn"},pluginRules:{"style/brace-style":"warn","style/curly":"off","style/if-newline":"off","style/max-statements-per-line":"warn","pickier/import-dedupe":"warn","pickier/no-import-node-modules-by-path":"error","pickier/no-import-dist":"error","pickier/prefer-const":"error","pickier/prefer-template":"warn","pickier/no-unused-vars":"error","pickier/no-unused-imports":"error","pickier/sort-tailwind-classes":"warn","regexp/no-unused-capturing-group":"error","regexp/no-super-linear-backtracking":"error","regexp/no-useless-lazy":"error","ts/no-top-level-await":"error","ts/member-delimiter-style":"off","ts/type-annotation-spacing":"off","style/comma-dangle":"off","style/keyword-spacing":"off","style/arrow-spacing":"off","style/space-infix-ops":"off","style/object-curly-spacing":"off","style/spaced-comment":"off","style/block-spacing":"off","style/space-before-blocks":"off","style/comma-spacing":"off","style/semi-spacing":"off","style/rest-spread-spacing":"off","style/key-spacing":"off","style/computed-property-spacing":"off","style/array-bracket-spacing":"off","style/space-in-parens":"off","style/template-curly-spacing":"off","style/space-unary-ops":"off","style/switch-colon-spacing":"off","style/arrow-parens":"off","style/space-before-function-paren":"off","style/quote-props":"off","style/no-floating-decimal":"off","style/new-parens":"off","style/no-extra-parens":"off","style/wrap-iife":"off","style/comma-style":"off","style/dot-location":"off","style/operator-linebreak":"off","style/multiline-ternary":"off","style/padded-blocks":"off","style/lines-between-class-members":"off","style/no-tabs":"off","style/no-mixed-spaces-and-tabs":"off","style/generator-star-spacing":"off","style/yield-star-spacing":"off","style/function-call-spacing":"off","style/template-tag-spacing":"off","style/no-whitespace-before-property":"off","style/no-mixed-operators":"off","style/indent-binary-ops":"off","ts/type-generic-spacing":"off","ts/type-named-tuple-spacing":"off","markdown/heading-increment":"warn","markdown/heading-style":"warn","markdown/no-missing-space-atx":"error","markdown/no-multiple-space-atx":"error","markdown/no-missing-space-closed-atx":"error","markdown/no-multiple-space-closed-atx":"error","markdown/blanks-around-headings":"warn","markdown/heading-start-left":"warn","markdown/no-duplicate-heading":"warn","markdown/single-title":"warn","markdown/no-trailing-punctuation":"warn","markdown/ul-style":"warn","markdown/list-indent":"error","markdown/ul-indent":"warn","markdown/ol-prefix":"warn","markdown/list-marker-space":"error","markdown/blanks-around-lists":"warn","markdown/no-trailing-spaces":"error","markdown/no-hard-tabs":"error","markdown/no-multiple-blanks":"warn","markdown/no-multiple-space-blockquote":"error","markdown/no-blanks-blockquote":"warn","markdown/blanks-around-fences":"warn","markdown/single-trailing-newline":"error","markdown/blanks-around-tables":"warn","markdown/no-reversed-links":"error","markdown/no-bare-urls":"warn","markdown/no-space-in-links":"error","markdown/no-empty-links":"error","markdown/link-fragments":"warn","markdown/reference-links-images":"warn","markdown/link-image-reference-definitions":"warn","markdown/link-image-style":"warn","markdown/descriptive-link-text":"warn","markdown/line-length":"off","markdown/commands-show-output":"warn","markdown/fenced-code-language":"warn","markdown/code-block-style":"off","markdown/code-fence-style":"warn","markdown/no-emphasis-as-heading":"warn","markdown/no-space-in-emphasis":"warn","markdown/no-space-in-code":"warn","markdown/emphasis-style":"warn","markdown/strong-style":"warn","markdown/no-inline-html":"off","markdown/hr-style":"warn","markdown/first-line-heading":"off","markdown/required-headings":"off","markdown/proper-names":"off","markdown/no-alt-text":"warn","markdown/table-pipe-style":"warn","markdown/table-column-count":"warn","markdown/table-column-style":"warn","lockfile/validate-host":["warn",{allowedHosts:["npm","yarn"]}],"lockfile/validate-https":"error","lockfile/validate-integrity":["warn",{requiredAlgorithm:"sha512"}],"lockfile/validate-package-names":"error","lockfile/validate-scheme":["error",{allowedSchemes:["https:","git+https:","git+ssh:"]}],"publint/exports-types-should-be-first":"error","publint/exports-default-should-be-last":"error","publint/exports-module-should-precede-require":"error","publint/exports-value-invalid":"error","publint/imports-key-invalid":"error","publint/imports-value-invalid":"error","publint/imports-default-should-be-last":"error","publint/imports-module-should-precede-require":"error","publint/use-type":"warn","publint/deprecated-field-jsnext":"warn","publint/field-invalid-value-type":"error","publint/local-dependency":"error","publint/has-module-but-no-exports":"warn","publint/exports-missing-root-entrypoint":"warn","publint/exports-fallback-array-use":"warn","publint/file-does-not-exist":"warn","publint/file-invalid-format":"warn","publint/module-should-be-esm":"error","publint/bin-file-not-executable":"error","publint/exports-module-should-be-esm":"error","shell/command-substitution":"error","shell/quote-variables":"warn","shell/no-cd-without-check":"warn","shell/no-eval":"error","shell/no-useless-cat":"warn","shell/shebang":"warn","shell/indent":"warn","shell/function-style":"warn","shell/operator-spacing":"warn","shell/keyword-spacing":"warn","shell/no-trailing-semicolons":"warn","shell/no-trailing-whitespace":"error","shell/prefer-double-brackets":"warn","shell/set-options":"off","shell/prefer-printf":"warn","shell/consistent-case-terminators":"warn","shell/no-broken-redirect":"error","shell/heredoc-indent":"warn","shell/no-ls-parsing":"warn","shell/no-variable-in-single-quotes":"warn","shell/no-exit-in-subshell":"warn","spell/check":"off","spell/check-comments":"off","spell/check-markdown":"off"},verbose:!0},pn=new Set(["PICKIER_CONCURRENCY","PICKIER_DIAGNOSTICS","PICKIER_FAIL_ON_WARNINGS","PICKIER_NO_AUTO_CONFIG","PICKIER_RULE_TIMEOUT_MS","PICKIER_TIMEOUT_MS","PICKIER_TRACE","PICKIER_WORKERS"]),mn=/^\.?(?:pickier|code-style|lint|config)(?:\.(?:pickier|code-style|lint|config))*\.(?:ts|js|mjs|cjs|mts|cts|json|jsonc)$/i,gn=new Set(["pickier",...je]);function hn(e){for(let k of Object.keys(process.env))if(k.startsWith("PICKIER_")&&!pn.has(k))return!0;let a=dn(),n=[e,we(e,"config"),we(e,".config"),we(a,".config","pickier"),we(a,".config"),a];for(let k of n){let R;try{R=fn(k,{withFileTypes:!0})}catch{continue}for(let v of R){if(v.isDirectory())continue;if(mn.test(v.name))return!0}}let s;try{s=un(we(e,"package.json"),"utf8")}catch{return!1}try{let k=JSON.parse(s);return k!==null&&typeof k==="object"&&Object.keys(k).some((R)=>gn.has(R))}catch{return!0}}var Ee=null;async function ne(){if(!Ee)if(!hn(process.cwd()))Ee=l;else{let{loadConfig:e}=await import("./chunk-t0w79bj5.js");Ee=await e({name:"pickier",alias:[...je],defaultConfig:l})}return Ee}var z=l;var yn=new Set(["return","typeof","instanceof","in","of","new","delete","void","case","do","else","yield","await","throw"]);function Oe(e){return e>=97&&e<=122||e>=65&&e<=90||e>=48&&e<=57||e===95||e===36||e>=160}function ke(e){return e===`
3
+ `||e==="\r"||e==="\u2028"||e==="\u2029"}function wn(e,a){let n=a+1,s=!1;while(n<e.length){let k=e[n];if(ke(k))return-1;if(k==="\\"){if(ke(e[n+1]))return-1;n+=2;continue}if(s){if(k==="]")s=!1}else if(k==="[")s=!0;else if(k==="/"){n+=1;while(n<e.length&&Oe(e.charCodeAt(n)))n+=1;return n}n+=1}return-1}var be=null;function g(e){if(be!==null&&be.text===e)return be.result;let a=bn(e);return be={text:e,result:a},a}function bn(e){let a=[],n=[],s=e.length,k=[],R=-1,v="operator",A=0;if(e.startsWith("#!")){let P=2;while(P<s&&!ke(e[P]))P+=1;a.push({kind:"comment",start:2,end:P}),A=P}let U=(P)=>{if(k.length===0)R=P;k.push(-1)},K=()=>{let P=A;while(A<s){let H=e[A];if(H==="\\"){A+=2;continue}if(H==="`"){if(a.push({kind:"template",start:P,end:A}),k.pop(),k.length===0)n.push([R,A]);A+=1,v="value";return}if(H==="$"&&e[A+1]==="{"){a.push({kind:"template",start:P,end:A}),k.push(0),A+=2,v="operator";return}A+=1}A=Math.min(A,s),a.push({kind:"template",start:P,end:A}),k.length=0,n.push([R,s])};while(A<s){if(k.length>0&&k[k.length-1]===-1){K();continue}let P=e[A],H=e[A+1];if(P==="/"&&H==="/"){let W=A+2;while(W<s&&!ke(e[W]))W+=1;a.push({kind:"comment",start:A+2,end:W}),A=W;continue}if(P==="/"&&H==="*"){let W=e.indexOf("*/",A+2),j=W<0?s:W;a.push({kind:"comment",start:A+2,end:j}),A=W<0?s:W+2;continue}if(P==="'"||P==='"'){let W=A+1,j=W;while(j<s){let B=e[j];if(B==="\\"){j+=e[j+1]==="\r"&&e[j+2]===`
4
+ `?3:2;continue}if(B===P||ke(B))break;j+=1}j=Math.min(j,s),a.push({kind:"string",start:W,end:j}),A=e[j]===P?j+1:j,v="value";continue}if(P==="`"){U(A),A+=1;continue}if(P==="/"){let W=v==="operator"?wn(e,A):-1;if(W>0){let j=W;while(j>A&&e[j-1]!=="/")j-=1;a.push({kind:"regex",start:A+1,end:j-1}),A=W,v="value";continue}A+=1,v="operator";continue}if(k.length>0){if(P==="{"){k[k.length-1]+=1,A+=1,v="operator";continue}if(P==="}"){let W=k[k.length-1];if(W>0)k[k.length-1]=W-1,v="operator";else k.pop();A+=1;continue}}if(Oe(e.charCodeAt(A))){let W=A+1;while(W<s&&Oe(e.charCodeAt(W)))W+=1;let j=e.slice(A,W);v=yn.has(j)?"operator":"value",A=W;continue}if(P===")"||P==="]")v="value";else if(!(P===" "||P>="\t"&&P<="\r"))v="operator";A+=1}return{regions:a,templates:n}}function I(e,a={comments:!0},n=g(e)){let s=new Set;if(a.comments)s.add("comment");if(a.strings)s.add("string");if(a.templates)s.add("template");if(a.regex)s.add("regex");if(s.size===0)return e;let k=(a.comments?1:0)|(a.strings?2:0)|(a.templates?4:0)|(a.regex?8:0),R=ve.get(k);if(R!==void 0&&R.text===e)return R.masked;let v=kn(e,s,n);return ve.set(k,{text:e,masked:v}),v}var ve=new Map;function q(){be=null,ve.clear()}function kn(e,a,n){let s="",k=0;for(let R of n.regions){if(!a.has(R.kind))continue;let v=Math.max(R.start,k),A=Math.min(R.end,e.length);if(v>=A)continue;s+=e.slice(k,v)+xn(e.slice(v,A)),k=A}return k===0?e:s+e.slice(k)}var Cn=/[^\n\r\u2028\u2029]/g;function xn(e){return e.replace(Cn," ")}function G(e){return I(e,{comments:!0})}function c(e){return I(e,{comments:!0,strings:!0,templates:!0,regex:!0})}function S(e,a=g(e)){let n=[0];for(let v=e.indexOf(`
5
+ `);v!==-1;v=e.indexOf(`
6
+ `,v+1))n.push(v+1);let s=Array.from({length:n.length}).fill(!1),k=a.regions.filter((v)=>v.kind==="template"),R=0;for(let v=0;v<n.length;v+=1){let A=n[v];while(R<k.length&&k[R].end<A)R+=1;let U=k[R];s[v]=U!==void 0&&U.start<=A&&A<=U.end&&A>0}return s}var En=new Set([".ts",".js"]),Sn=new Set([".json",".jsonc"]),Rn=new Set([".yaml",".yml"]),_n=new Set([".sh",".bash",".zsh",".ksh",".dash"]),In=new Set([".md",".mdx",".markdown"]),On=/^#!\s*(?:\/usr\/bin\/env\s+)?(?:ba|z|k|da)?sh\b/;var vn=/^[}\])]/,An=/\s*\/\/.*$/,Tn=/^(?:if|else\s+if|for|while)\s*\(/,Nn=/^(?:if|else|for|while|do)\b/,Pn=/^(?:\.[\w$[]|\?[\s.:]|:\s|&&|\|\|)/;function $n(e){let a=e.charCodeAt(0);if(a!==105&&a!==101&&a!==102&&a!==119&&a!==100)return!1;let n=Tn.exec(e);if(!n)return/^(?:else|do)\s*$/.test(e);let s=0,k=null;for(let R=n[0].length-1;R<e.length;R++){let v=e[R];if(k){if(v==="\\"){R++;continue}if(v===k)k=null;continue}if(v==="'"||v==='"'||v==="`"){k=v;continue}if(v==="(")s++;else if(v===")"){if(s--,s===0)return e.slice(R+1).trim().length===0}}return!1}var Mn=/^\s*for\s*\(/,Ln=new RegExp("^\\s*;\\s*$"),jn=new RegExp(";{2,}\\s*$"),Fn=/([\w)])\{/g,Dn=/\{(return|if|for|while|switch|const|let|var|function)\b/g,Wn=/,(\S)/g,Un=/(?<![=!<>+\-*/%&|^?])=(?![=><])/g,Gn=/(\w)\+(\w)/g,Kn=/(\w)-(\w)/g,Bn=/(\w)\*(\w)/g,zn=/(\w)\/(\w)/g,Hn=new RegExp("(?<=\\S);([^\\s;])","g"),Jn=/([\w)\]])<(\d)/g,qn=/([\w)\]])>(\d)/g,Fe=/\s{2,}/g,De=/^\s*$/,Yn=/^\s*\/\//,We=/^\s*\/\*/,Xn=/^\s*import\b/,Ue=/\bfrom\s*['"][^'"]+['"]|^\s*import\s+['"][^'"]+['"]/,Qn=/package\.json$/i,Vn=/[jt]sconfig(?:\..+)?\.json$/i,ye=/[ \t]+$/,Zn=/^\n+/;function xe(e){let a=e.lastIndexOf(".");return a>=0?e.slice(a):""}function Se(e){return En.has(xe(e))}function et(e){return Sn.has(xe(e))}function nt(e){return Rn.has(xe(e))}function tt(e){return In.has(xe(e))}function rt(e){return _n.has(xe(e))}function st(e,a){return rt(e)||On.test(a)}function ot(e,a){let n=e.split(`
7
+ `),s=n.length,k=Array(s),R=a.format.indent,v=a.format.indentStyle==="tabs",A=0,U=new b,K=!1,P="",H=!1,W=0;for(let j=0;j<s;j++){let B=n[j];if(B.length===0||/^\s*$/.test(B)){k[j]="";continue}if(K){if(k[j]=B,B.trim()===P)K=!1,P="";continue}let ae=i(B);if(ae)K=!0,P=ae;let ue=0;while(ue<B.length&&(B.charCodeAt(ue)===32||B.charCodeAt(ue)===9))ue++;let V=B.slice(ue).trimEnd();if(V.startsWith("#")&&j>0){let D=v?"\t".repeat(A):" ".repeat(A*R);k[j]=D+V;continue}let ce=U.read(V);if(/^case\b/.test(V)&&/\bin\s*$/.test(V))W++,H=!0;if(/^esac\b/.test(V)){if(W=Math.max(0,W-1),W===0)H=!1}let me=H&&/\)\s*$/.test(V)&&!/\$\(/.test(V)&&!/^\s*\(/.test(V)&&!V.startsWith("#"),le=/^;[;&]\s*$/.test(V),ge=/^(?:fi|done|esac|elif|else)\b/.test(V)||/^\}/.test(V);if(!ce.continuation&&ge)A=Math.max(0,A-1);if(!ce.continuation&&le)A=Math.max(0,A-1);let he=A+Number(ce.continuation),de=v?"\t".repeat(he):" ".repeat(he*R);if(k[j]=de+V,ce.continuation){if(ce.closesHeader)A++;continue}if(/^then\b/.test(V)||/^do\b/.test(V)||/^else\b/.test(V))A++;else if(/^if\b/.test(V)&&/\bthen\s*$/.test(V))A++;else if(/^elif\b/.test(V)&&/\bthen\s*$/.test(V))A++;else if(/^(?:while|for|until)\b/.test(V)&&/\bdo\s*$/.test(V))A++;else if(/^case\b/.test(V)&&/\bin\s*$/.test(V))A++;else if(me)A++;else if(/\{\s*$/.test(V)&&!V.startsWith("#"))A++}return k.join(`
8
+ `)}var it=/(?:^|\s)#/;function lt(e,a){if(it.test(e))return e;try{let n=Bun.YAML.parse(e),s=a.format.indentStyle==="tabs"?"\t":a.format.indent;return Bun.YAML.stringify(n,null,s).split(`
9
+ `).map((R)=>R.replace(/[ \t]+$/,"")).join(`
10
+ `)}catch{return e}}var Ge=Array.from({length:129},(e,a)=>" ".repeat(a));function at(e){if(e<=0)return"";return e<Ge.length?Ge[e]:" ".repeat(e)}function ct(e,a){if((a.format.indentStyle||"spaces")==="tabs")return"\t".repeat(Math.max(0,e));return at(Math.max(0,e*a.format.indent))}function ft(e){return`'${e.slice(1,-1).replace(/\\"/g,'"')}'`}function ut(e){return`"${e.slice(1,-1).replace(/\\'/g,"'")}"`}function dt(e,a){for(let n=0;n<e.length;n++){if(e[n]==="\\"){n++;continue}if(e[n]===a)return!0}return!1}function pt(e,a,n){if(!Se(n))return e;let s=e.split(`
11
+ `);for(let k=0;k<s.length;k++)s[k]=Xe(s[k],a);return s.join(`
12
+ `)}function Xe(e,a){let n=a==="single";if(n?!e.includes('"'):!e.includes("'"))return e;let s=[],k=0,R=0,v=0,A=0;while(k<e.length){let U=e[k];if(v===0){if(U==="/"){let K=e[k+1];if(K==="/")break;if(K==="*"){let P=e.indexOf("*/",k+2);k=P===-1?e.length:P+2;continue}if(Ne(e,k)){let P=Pe(e,k);if(P!==-1){k=P;continue}}k++;continue}if(U==='"'){v=2,A=k,k++;continue}if(U==="'"){v=1,A=k,k++;continue}if(U==="`"){v=3,k++;continue}k++}else if(v===3){if(U==="\\"){k+=2;continue}if(U==="`")v=0;k++}else{if(U==="\\"){k+=2;continue}if(U===(v===1?"'":'"')){let P=e.slice(A+1,k);if((v===2&&n||v===1&&!n)&&!dt(P,n?"'":'"')){if(A>R)s.push(e.slice(R,A));if(v===2)s.push(ft(`"${P}"`));else s.push(ut(`'${P}'`));R=k+1}v=0,k++;continue}k++}}if(s.length===0)return e;if(R<e.length)s.push(e.slice(R));return s.join("")}function mt(e){return e===123||e===44||e===61||e===43||e===45||e===42||e===47||e===59||e===60||e===62}var gt=/\s/;function ht(e,a){let n=!1;for(let s=a;s<e.length;s++){let k=e.charCodeAt(s),R=k===32||k>=9&&k<=13||k>=128&&gt.test(e[s]);if(R&&n)return!0;n=R}return!1}var Qe=1,Ve=2,Ze=4,en=8,nn=16,tn=32;function Ae(e){return e>=97&&e<=122||e>=65&&e<=90||e>=48&&e<=57||e===95}function yt(e){let a=0;for(let n=1;n<e.length-1;n++){let s=e.charCodeAt(n);if(s===43||s===45||s===42||s===47){if(Ae(e.charCodeAt(n-1))&&Ae(e.charCodeAt(n+1)))a|=s===43?Qe:s===45?Ve:s===42?Ze:en}else if(s===60||s===62){let k=e.charCodeAt(n+1),R=e.charCodeAt(n-1);if(k>=48&&k<=57&&(Ae(R)||R===41||R===93))a|=s===60?nn:tn}}return a}function wt(e,a){if(a+e.length<4)return e;let n=0;while(n<e.length&&(e[n]===" "||e[n]==="\t"))n++;if(n<e.length){let U=e[n];if(U==="/"&&(e[n+1]==="/"||e[n+1]==="*"))return e;if(U==="*")return e}let s=!1;for(let U=n;U<e.length;U++)if(mt(e.charCodeAt(U))){s=!0;break}if(!s)return e;let{text:k,strings:R}=Et(e),v=k;if(v.includes("{"))v=v.replace(Fn,"$1 {"),v=v.replace(Dn,"{ $1");if(v.includes(","))v=v.replace(Wn,", $1");if(v.includes("="))v=v.replace(Un," = ");let A=yt(v);if(A&Qe)v=v.replace(Gn,"$1 + $2");if(A&Ve)v=v.replace(Kn,"$1 - $2");if(A&Ze)v=v.replace(Bn,"$1 * $2");if(A&en)v=v.replace(zn,"$1 / $2");if(v.includes(";"))v=v.replace(Hn,"; $1");if(A&nn)v=v.replace(Jn,"$1 < $2");if(A&tn)v=v.replace(qn,"$1 > $2");if(ht(v,n))if(n>0){let U=v.slice(n);v=v.slice(0,n)+U.replace(Fe," ")}else v=v.replace(Fe," ");return R.length>0?St(v,R):v}function Re(e){let a=e[e.length-1];return a!==void 0&&a.t==="tmpl"}function rn(e,a,n){a++;while(a<e.length){let s=e[a];if(s==="\\"){a+=2;continue}if(s===n)return a+1;a++}return a}function Te(e,a){for(let s of a)if(s.t==="tmpl")s.start=-1;let n=0;while(n<e.length){let s=a[a.length-1],k=e[n];if(s===void 0||s.t==="interp"){if(k==="`"){a.push({t:"tmpl",start:n}),n++;continue}if(k==="'"||k==='"'){n=rn(e,n,k);continue}if(k==="/"){if(e[n+1]==="/")break;if(e[n+1]==="*"){let R=e.indexOf("*/",n+2);if(R===-1)break;n=R+2;continue}if(Ne(e,n)){let R=Pe(e,n);if(R!==-1){n=R;continue}}n++;continue}if(s!==void 0){if(k==="{"){s.braces++,n++;continue}if(k==="}"){if(s.braces===0)a.pop();else s.braces--;n++;continue}}n++}else{if(k==="\\"){n+=2;continue}if(k==="`"){a.pop(),n++;continue}if(k==="$"&&e[n+1]==="{"){a.push({t:"interp",braces:0}),n+=2;continue}n++}}if(Re(a)){for(let s of a)if(s.t==="tmpl"&&s.start>=0)return s.start}return-1}function Ke(e,a){let n=a,s=null,k=0;while(k<e.length){let R=e[k];if(n){if(R==="*"&&e[k+1]==="/"){n=!1,k+=2;continue}k++;continue}if(s){if(R==="\\"){k+=2;continue}if(R===s)s=null;k++;continue}if(R==="'"||R==='"'||R==="`"){s=R,k++;continue}if(R==="/"){if(e[k+1]==="/")break;if(e[k+1]==="*"){n=!0,k+=2;continue}}k++}return n}function Be(e,a){let n=e.length,s=Array(n),k=a.format.quotes,R=a.format.semi===!0,v=0,A=0,U=!1,K=[],P=0,H=[];for(let W=0;W<n;W++){let j=e[W];if(U){U=Ke(j,!0),s[W]=j;continue}let B=Re(H),ae=-1;if(H.length>0||j.indexOf("`")!==-1)ae=Te(j,H);if(B){s[W]=j;continue}if(ae<0&&H.length===0)U=j.includes("/*")&&Ke(j,!1);let ue="",V=!1,ce="";if(ae>=0){ue=j.slice(ae);let te=j.slice(0,ae);if(te.length===0){s[W]=ue;continue}if(V=ye.test(te),te.trim().length===0)ce=te;j=te}if(j.length===0){s[W]="";continue}j=Xe(j,k);let me=0;while(me<j.length&&(j.charCodeAt(me)===32||j.charCodeAt(me)===9))me++;let le=j.slice(me).trimEnd(),ge=0;if(vn.test(le))v=Math.max(0,v-1),ge=K.pop()??0;let he=Pn.test(le)?1:0,de=a.format.preserveCodeIndentation?j.slice(0,me):ct(v+P+A+he,a);P-=ge;let D=le.charCodeAt(le.length-1);if(D===123||D===91||D===40){v+=1;let te=he===1&&le.charCodeAt(0)===46?1:0;K.push(te),P+=te,A=0}else if(!le.startsWith("//")&&!le.startsWith("*")&&!le.startsWith("/*"))if(!Nn.test(le))A=0;else{let te=c(le),fe=te.includes("//")?te.replace(An,""):te;A=$n(fe)?A+1:0}let F=wt(le,de.length),oe=!1;if(R){if(!Mn.test(F))if(Ln.test(F))oe=!0;else F=F.replace(jn,";")}if(oe)j="";else if(a.format.trimTrailingWhitespace)F=F.trimEnd(),j=F.length===0?"":de+F;else j=de+F;if(ae>=0){if(ce)j=ce;else if(V&&!ye.test(j))j+=" ";j+=ue}s[W]=j}return s}var ze=/^[ \t]*(`{3,}|~{3,})(.*)$/,bt=/^ {0,3}#{1,6}(?:[ \t]|$)/;function kt(e,a){let n=a.format.trimTrailingWhitespace,s=Math.max(0,a.format.maxConsecutiveBlankLines),k=[],R=0,v="",A=0;for(let U=0;U<e.length;U++){let K=e[U];if(v!==""){let B=K.indexOf(v)!==-1?ze.exec(K):null;if(B&&B[1][0]===v&&B[1].length>=A&&B[2].trim()==="")v="",k.push(n?K.replace(ye,""):K);else k.push(K);continue}if(K.length===0||K.trim()===""){if(R++,R<=s)k.push("");continue}if(R=0,K.indexOf("```")!==-1||K.indexOf("~~~")!==-1){let B=ze.exec(K);if(B&&!(B[1][0]==="`"&&B[2].includes("`"))){v=B[1][0],A=B[1].length,k.push(n?K.replace(ye,""):K);continue}}let P=K.charCodeAt(K.length-1);if(!n||P!==32&&P!==9){k.push(K);continue}let H=K.replace(ye,""),W=e[U+1],j=K.endsWith(" ")&&W!==void 0&&W.trim()!==""&&!bt.test(K);k.push(j?`${H} `:H)}return k}function Ct(e,a){let n=[],s=0,k=[];for(let R of e){let v=Re(k);if(k.length>0||R.indexOf("`")!==-1)Te(R,k);if(v){n.push(R),s=0;continue}if(R===""){if(s++,s<=a)n.push("")}else s=0,n.push(R)}return n}function p(e,a,n){if(e.length===0)return"";let k=(e.includes("\r")?e.replace(/\r\n/g,`
13
+ `):e).split(`
14
+ `),R;if(tt(n))R=kt(k,a);else if(a.format.trimTrailingWhitespace){R=[];let A=0,U=Math.max(0,a.format.maxConsecutiveBlankLines),K=[];for(let P of k){let H=Re(K),W=!1;if(K.length>0||P.indexOf("`")!==-1)W=Te(P,K)>=0;if(H||W){R.push(P),A=0;continue}let j=P[P.length-1],B=j===" "||j==="\t"?P.replace(ye,""):P;if(B===""){if(A++,A<=U)R.push("")}else A=0,R.push(B)}}else R=Ct(k,Math.max(0,a.format.maxConsecutiveBlankLines));let v;if(Se(n)&&!(R.length>0&&R[0].startsWith("#!"))){let A=0;while(A<R.length&&R[A]==="")A++;if(A>0)R=R.slice(A);return R=on(R)??R,v=Be(R,a).join(`
15
+ `),He(v,a)}if(v=R.join(`
16
+ `),v=v.replace(Zn,""),Se(n))v=C(v);if(nt(n)){let A=lt(v,a);if(A!==v)v=A}if(et(n)){let A=Ot(v,n);if(A!=null)v=A}if(st(n,v))v=ot(v,a);else if(Se(n))v=Be(v.split(`
17
+ `),a).join(`
18
+ `);else v=pt(v,a.format.quotes,n);return He(v,a)}function He(e,a){let n=e.length;while(n>0&&e.charCodeAt(n-1)===10)n--;if(a.format.finalNewline==="none")return n===e.length?e:e.slice(0,n);let s=a.format.finalNewline==="two"?`
19
+
20
+ `:`
21
+ `;if(e.length-n===s.length)return e;return e.slice(0,n)+s}function Je(e,a,n,s){for(let k=a+1;k<e.length;k++){let R=e[k];if(R==="\\"){k++;continue}if(R===n)return!0;if(R===s)return!1}return!0}function O(e,a){if(/^\s*\/\/\/\s*<reference/.test(e))return[];let n=[],s=null,k=!1;for(let R=0;R<e.length;R++){let v=e[R];if(k){k=!1;continue}if(v==="\\"){k=!0;continue}if(!s){if(v==="/"&&e[R+1]==="/")break;if(v==="'"){if(a==="double"&&Je(e,R,"'",'"'))n.push(R);s="single";continue}else if(v==='"'){if(a==="single"&&Je(e,R,'"',"'"))n.push(R);s="double";continue}else if(v==="`"){s="template";continue}}else if(s==="single"&&v==="'"||s==="double"&&v==='"'||s==="template"&&v==="`"){s=null;continue}}return n}function M(e,a,n="spaces",s){if(n==="tabs")return/[^\t]/.test(e);if(/\t/.test(e))return!0;let k=e.length;if(s&&k%a===1){let R=s.trimStart();if(R.startsWith("* ")||R.startsWith("*/")||R==="*")return!1}return k%a!==0}function sn(e,a){let n=a+1;while(n<e.length){let s=e[n];if(s==="\\"){n+=2;continue}if(s==="`")return n+1;if(s==="$"&&e[n+1]==="{"){n+=2;let k=1;while(n<e.length&&k>0){let R=e[n];if(R==="\\"){n+=2;continue}if(R==="`"){n=sn(e,n);continue}if(R==="'"||R==='"'){n=rn(e,n,R);continue}if(R==="{")k++;else if(R==="}")k--;n++}continue}n++}return n}var xt=new Set(["return","typeof","instanceof","in","of","new","delete","void","do","else","case","yield","await"]);function Ne(e,a){let n=a-1;while(n>=0&&(e[n]===" "||e[n]==="\t"))n--;if(n<0)return!0;let s=e[n];if("(,=:[!&|?;{}<>+-*%^~".includes(s))return!0;if(/[\w$]/.test(s)){let k=n;while(k>=0&&/[\w$]/.test(e[k]))k--;return xt.has(e.slice(k+1,n+1))}return!1}function Pe(e,a){let n=a+1,s=!1,k=-1;while(n<e.length){let R=e[n];if(R==="\\"){n+=2;continue}if(R==="["&&!s)s=!0,k=n;else if(R==="]"&&s){let v=e[k+1]==="^"?k+2:k+1;if(n!==v)s=!1}else if(R==="/"&&!s){n++;while(n<e.length&&/[a-z]/i.test(e[n]))n++;return n}n++}return-1}function Et(e){if(!e.includes("'")&&!e.includes('"')&&!e.includes("`")&&!e.includes("/"))return{text:e,strings:[]};let a=[],n=[],s=0,k=0;while(s<e.length){let R=e[s];if(R==="/"){let v=e[s+1];if(v==="/"){if(s>k)n.push(e.slice(k,s));a.push(e.slice(s)),n.push(`@@S${a.length-1}@@`),k=e.length;break}if(v==="*"){let A=e.indexOf("*/",s+2),U=A===-1?e.length:A+2;if(s>k)n.push(e.slice(k,s));a.push(e.slice(s,U)),n.push(`@@S${a.length-1}@@`),s=U,k=s;continue}if(Ne(e,s)){let A=Pe(e,s);if(A!==-1){if(s>k)n.push(e.slice(k,s));a.push(e.slice(s,A)),n.push(`@@S${a.length-1}@@`),s=A,k=s;continue}}s++;continue}if(R==="'"||R==='"'||R==="`"){if(s>k)n.push(e.slice(k,s));let v=s;if(R==="`")s=sn(e,s);else{let A=R;s++;while(s<e.length){if(e[s]==="\\"){s+=2;continue}if(e[s]===A){s++;break}s++}}a.push(e.slice(v,s)),n.push(`@@S${a.length-1}@@`),k=s;continue}s++}if(k<e.length)n.push(e.slice(k));return{text:n.join(""),strings:a}}function St(e,a){if(a.length===0)return e;let n="",s=0,k=e.indexOf("@@S");while(k!==-1){let R=k+3;while(R<e.length&&e.charCodeAt(R)>=48&&e.charCodeAt(R)<=57)R++;if(R>k+3&&e.charCodeAt(R)===64&&e.charCodeAt(R+1)===64)n+=e.slice(s,k)+(a[Number(e.slice(k+3,R))]??""),s=R+2,k=e.indexOf("@@S",s);else k=e.indexOf("@@S",k+1)}return s===0?e:n+e.slice(s)}function qe(e){return e>=97&&e<=122||e>=65&&e<=90||e>=48&&e<=57||e===95||e===36}function Rt(e,a){let n=0;while(!0){let s=e.indexOf(a,n);if(s===-1)return!1;if(n=s+1,qe(e.charCodeAt(s+a.length)))continue;let k=s-1,R=!0;while(k>=0){let v=e.charCodeAt(k);if(!qe(v))break;if(v<48||v>57){R=!1;break}k--}if(R)return!0}}function C(e){let a=e[0];if(a!=="i"&&a!==" "&&a!=="\t"&&a!=="/"&&a!==`
22
+ `)return e;let n=on(e.split(`
23
+ `));return n===null?e:n.join(`
24
+ `)}function on(e){let a=e.length===0?void 0:e[0].length>0?e[0][0]:e.length>1?`
25
+ `:void 0;if(a!=="i"&&a!==" "&&a!=="\t"&&a!=="/"&&a!==`
26
+ `)return null;let n=[],s=[],k=[],R=0,v=0,A=-1,U=!1;while(R<e.length){let D=e[R];if(De.test(D)){R++;continue}if(Yn.test(D)||We.test(D)){let fe=R;if(We.test(D)){while(R<e.length&&!e[R].includes("*/"))R++;R++}else R++;if(!U){for(let pe=fe;pe<R&&pe<e.length;pe++)s.push(e[pe]);v=R}else if(A<0)A=fe;continue}if(!Xn.test(D))break;let F=D.trim(),oe=R+1;while(!Ue.test(F)&&oe<e.length&&oe-R<50)F+=` ${e[oe].trim()}`,oe++;if(!Ue.test(F))return null;let te=It(F);if(!te)return null;if(A>=0){let fe=[];for(let pe=A;pe<R;pe++)if(!De.test(e[pe]))fe.push(e[pe]);if(fe.length>0)te.comments=fe;A=-1}n.push(te),R=oe,v=R,U=!0}if(n.length===0)return null;let K=A>=0?A:v,P=e.slice(K),H=0;while(H<P.length&&P[H]==="")H++;let W=H===0?P:P.slice(H),j=new Map,B=(D)=>{let F=j.get(D);if(F===void 0){F=!1;for(let oe of P)if(Rt(oe,D)){F=!0;break}j.set(D,F)}return F};for(let D of n){if(D.kind!=="value")continue;D.named=D.named.filter((F)=>{if(F.alias)return!0;return B(F.name)})}let ae=n.filter((D)=>{if(D.kind==="side-effect")return!0;if(D.kind==="type")return D.namedTypes.length>0;return Boolean(D.defaultName||D.namespaceName||D.named.length>0)}),ue=new Set(ae),V=[];for(let D of n){let F=V.length>0?[...V,...D.comments??[]]:D.comments;if(!ue.has(D)){V=F??[];continue}if(F&&F.length>0)D.comments=F;V=[]}if(V.length>0)k.push(...V);let ce=new Map,me=(D,F)=>{if(!F.comments)return;D.comments=D.comments?[...D.comments,...F.comments]:[...F.comments]};for(let D of ae){let F=ce.get(D.source)||{};if(D.kind==="side-effect")F.side=F.side||[],F.side.push(D);else if(D.kind==="type"){if(!F.type)F.type={kind:"type",source:D.source,named:[],namedTypes:[],original:""};me(F.type,D),F.type.namedTypes=(F.type.namedTypes||[]).concat(D.namedTypes)}else{if(!F.value)F.value={kind:"value",source:D.source,named:[],namedTypes:[],original:""};if(me(F.value,D),D.defaultName)F.value.defaultName=D.defaultName;if(D.namespaceName)F.value.namespaceName=D.namespaceName;if(F.value.named=(F.value.named||[]).concat(D.named),D.namedTypes.length>0){if(!F.type)F.type={kind:"type",source:D.source,named:[],namedTypes:[],original:""};F.type.namedTypes=F.type.namedTypes.concat(D.namedTypes)}}ce.set(D.source,F)}let le=[];for(let[D,F]of ce){if(F.side)le.push(...F.side);if(F.value)F.value.named.sort((oe,te)=>oe.name.localeCompare(te.name)),le.push(F.value);if(F.type&&F.type.namedTypes.length>0){let oe=new Set;F.type.namedTypes=F.type.namedTypes.filter((te)=>{let fe=`${te.name}|${te.alias||""}`;if(oe.has(fe))return!1;return oe.add(fe),!0}),F.type.namedTypes.sort((te,fe)=>te.name.localeCompare(fe.name)),le.push(F.type)}}let ge=(D)=>D.startsWith(".")?2:D.startsWith("node:")?0:1,he=(D)=>{if(D.kind!=="value")return 99;if(D.defaultName)return 0;if(D.namespaceName)return 1;return 2};if(le.sort((D,F)=>{if(D.kind!==F.kind){if(D.kind==="type")return-1;if(F.kind==="type")return 1;if(D.kind==="side-effect")return-1;if(F.kind==="side-effect")return 1}if(D.kind==="type"&&F.kind==="type"){let oe=ge(D.source),te=ge(F.source);if(oe!==te)return oe-te;return D.source.localeCompare(F.source)}if(D.kind==="value"&&F.kind==="value"){let oe=ge(D.source),te=ge(F.source);if(oe!==te)return oe-te;let fe=he(D),pe=he(F);if(fe!==pe)return fe-pe;return D.source.localeCompare(F.source)}return D.source.localeCompare(F.source)}),le.length===0){if(s.length>0||k.length>0)return[...s,...k,...W.length>0?W:[""]];return W}let de=[...s];for(let D of le){if(D.comments)de.push(...D.comments);let F=_t(D);if(F.includes(`
27
+ `))de.push(...F.split(`
28
+ `));else de.push(F)}if(k.length>0)de.push(""),de.push(...k);return de.push(""),de.push(...W),de}function _t(e){if(e.kind==="side-effect")return`import '${e.source}'`;if(e.kind==="type")return`import type { ${e.namedTypes.map((k)=>k.alias?`${k.name} as ${k.alias}`:k.name).join(", ")} } from '${e.source}'`;let a=[];if(e.defaultName)a.push(e.defaultName);if(e.namespaceName)a.push(`* as ${e.namespaceName}`);if(e.named.length>0){let s=e.named.map((k)=>k.alias?`${k.name} as ${k.alias}`:k.name).join(", ");a.push(`{ ${s} }`)}return`import ${a.join(", ")} from '${e.source}'`}function It(e){let a=e.match(/^\s*import\s+['"]([^'"]+)['"]/);if(a)return{kind:"side-effect",source:a[1],named:[],namedTypes:[],original:e};if(a=e.match(/^\s*import\s+type\s+\{([^}]*)\}\s+from\s+['"]([^'"]+)['"]/),a){let W=a[1],j=a[2],B=W.split(",").map((ae)=>ae.trim()).filter(Boolean).map((ae)=>{let ue=ae.match(/^(\w+)(?:\s+as\s+(\w+))?$/);return{name:ue?.[1]||ae,alias:ue?.[2]}});return{kind:"type",source:j,named:[],namedTypes:B,original:e}}let n=e.match(/^\s*import\s+/),s=new RegExp(`\\sfrom\\s+['"]([^'"]+)['"]\\s*;?$`),k=e.match(s);if(!n||!k)return;let R=k[1],v=e.slice(n[0].length,k.index).trim(),A,U,K=[],P=[],H=v.match(/\{([^}]*)\}/);if(H){let j=H[1].split(",").map((B)=>B.trim()).filter(Boolean);for(let B of j){let ae=/^type\s+/.test(B),V=B.replace(/^type\s+/,"").match(/^(\w+)(?:\s+as\s+(\w+))?$/);if(!V)continue;let ce={name:V[1],alias:V[2]};if(ae)P.push(ce);else K.push(ce)}v=v.replace(/\{[\s\S]*?\}/,"").trim()}if(v.length>0){let W=v.split(",").map((j)=>j.trim()).filter(Boolean);for(let j of W)if(j.startsWith("* as "))U=j.slice(5).trim();else if(/^\w+$/.test(j))A=j}return{kind:"value",source:R,defaultName:A,namespaceName:U,named:K,namedTypes:P,original:e}}function Ot(e,a){if(Qn.test(a))return vt(e);if(Vn.test(a))return At(e);return null}function ln(e){try{return JSON.parse(e)}catch{return null}}function Ce(e,a,n=[]){let s={};for(let R of a)if(Object.prototype.hasOwnProperty.call(e,R))s[R]=e[R];for(let R of n){let v=Object.keys(e).filter((A)=>R.test(A)&&!(A in s)).sort();for(let A of v)s[A]=e[A]}let k=Object.keys(e).filter((R)=>!(R in s)).sort();for(let R of k)s[R]=e[R];return s}function Ye(e){let a={};for(let n of Object.keys(e).sort())a[n]=e[n];return a}function vt(e){let a=ln(e);if(!a||typeof a!=="object")return e;let s=Ce(a,["publisher","name","displayName","type","version","private","packageManager","description","author","contributors","license","funding","homepage","repository","bugs","keywords","categories","sideEffects","imports","exports","main","module","unpkg","jsdelivr","types","typesVersions","bin","icon","files","engines","activationEvents","contributes","scripts","peerDependencies","peerDependenciesMeta","dependencies","optionalDependencies","devDependencies","pnpm","overrides","resolutions","husky","simple-git-hooks","lint-staged","eslintConfig"]);if(Array.isArray(s.files)){if(s.files.every((v)=>typeof v==="string"))s.files=[...s.files].sort()}for(let R of Object.keys(s))if(/^(?:dev|peer|optional|bundled)?[Dd]ependencies(?:Meta)?$/.test(R)||/^(?:resolutions|overrides|pnpm\.overrides)$/.test(R)){if(s[R]&&typeof s[R]==="object")s[R]=Ye(s[R])}if(s.pnpm&&typeof s.pnpm==="object"&&s.pnpm.overrides&&typeof s.pnpm.overrides==="object")s.pnpm.overrides=Ye(s.pnpm.overrides);if(s.exports&&typeof s.exports==="object"){let R=s.exports,v=["types","import","require","default"];if(!Array.isArray(R)){let A={};for(let U of Object.keys(R)){let K=R[U];if(K&&typeof K==="object"&&!Array.isArray(K))A[U]=Ce(K,v);else A[U]=K}s.exports=A}}let k=["pre-commit","prepare-commit-msg","commit-msg","post-commit","pre-rebase","post-rewrite","post-checkout","post-merge","pre-push","pre-auto-gc"];for(let R of["gitHooks","husky","simple-git-hooks"])if(s[R]&&typeof s[R]==="object")s[R]=Ce(s[R],k);return JSON.stringify(s,null,2)}function At(e){let a=ln(e);if(!a||typeof a!=="object")return e;let s=Ce(a,["extends","compilerOptions","references","files","include","exclude"]);if(s.compilerOptions&&typeof s.compilerOptions==="object"){let k=["incremental","composite","tsBuildInfoFile","disableSourceOfProjectReferenceRedirect","disableSolutionSearching","disableReferencedProjectLoad","target","jsx","jsxFactory","jsxFragmentFactory","jsxImportSource","lib","moduleDetection","noLib","reactNamespace","useDefineForClassFields","emitDecoratorMetadata","experimentalDecorators","libReplacement","baseUrl","rootDir","rootDirs","customConditions","module","moduleResolution","moduleSuffixes","noResolve","paths","resolveJsonModule","resolvePackageJsonExports","resolvePackageJsonImports","typeRoots","types","allowArbitraryExtensions","allowImportingTsExtensions","allowUmdGlobalAccess","allowJs","checkJs","maxNodeModuleJsDepth","strict","strictBindCallApply","strictFunctionTypes","strictNullChecks","strictPropertyInitialization","allowUnreachableCode","allowUnusedLabels","alwaysStrict","exactOptionalPropertyTypes","noFallthroughCasesInSwitch","noImplicitAny","noImplicitOverride","noImplicitReturns","noImplicitThis","noPropertyAccessFromIndexSignature","noUncheckedIndexedAccess","noUnusedLocals","noUnusedParameters","useUnknownInCatchVariables","declaration","declarationDir","declarationMap","downlevelIteration","emitBOM","emitDeclarationOnly","importHelpers","importsNotUsedAsValues","inlineSourceMap","inlineSources","mapRoot","newLine","noEmit","noEmitHelpers","noEmitOnError","outDir","outFile","preserveConstEnums","preserveValueImports","removeComments","sourceMap","sourceRoot","stripInternal","allowSyntheticDefaultImports","esModuleInterop","forceConsistentCasingInFileNames","isolatedDeclarations","isolatedModules","preserveSymlinks","verbatimModuleSyntax","erasableSyntaxOnly","skipDefaultLibCheck","skipLibCheck"];s.compilerOptions=Ce(s.compilerOptions,k)}return JSON.stringify(s,null,2)}import{readdirSync as Tt,readFileSync as Nt,statSync as Me}from"fs";import{extname as Pt,isAbsolute as _e,join as Ie,resolve as $t}from"path";var L=5;function Mt(e){let a="",n=0;while(n<e.length){let s=e[n];if(s==="*")if(e[n+1]==="*"){if(a+=".*",n+=2,e[n]==="/")n++}else a+="[^/]*",n++;else if(s==="?")a+="[^/]",n++;else if(s==="["){let k=e.indexOf("]",n);if(k===-1)a+="\\[",n++;else a+=e.slice(n,k+1),n=k+1}else if(".+^${}()|\\".includes(s))a+=`\\${s}`,n++;else a+=s,n++}return new RegExp(`^${a}$`)}function*cn(e,a,n){let s;try{s=Tt(e)}catch{return}for(let k of s){if(!n&&k.startsWith("."))continue;let R=Ie(e,k);if(a(R))continue;let v;try{v=Me(R)}catch{continue}if(v.isDirectory())yield*cn(R,a,n);else yield R}}function*an(e,a,n,s){yield*cn(e,d(a,s),n)}async function f(e,a={}){let n=a.cwd??process.cwd(),s=a.ignore??[],k=a.dot??!1,R=a.absolute??!0,v=d(s,n);if(typeof globalThis.Bun?.Glob<"u"){let U=globalThis.Bun.Glob,K=[];for(let P of e){if(!/[*?[{]/.test(P)){let W=_e(P)?P:Ie(n,P);if(Me(W,{throwIfNoEntry:!1})?.isFile()){if(!v(W))K.push(R?W:W.startsWith(`${n}/`)?W.slice(n.length+1):W);continue}}let H=new U(P);for await(let W of H.scan({cwd:n,dot:k,onlyFiles:a.onlyFiles??!0,followSymlinks:!1})){let j=_e(W)?W:Ie(n,W),B=j.startsWith(`${n}/`)?j.slice(n.length+1):j;if(v(j))continue;K.push(R?j:B)}}return K}let A=[];for(let U of e){if(!/[*?[{]/.test(U)){let P=_e(U)?U:Ie(n,U);try{if(!Me(P).isDirectory()){let W=P.startsWith(`${n}/`)?P.slice(n.length+1):P;if(!v(P))A.push(R?P:W)}else for(let W of an(P,s,k,n))A.push(R?W:W.startsWith(`${n}/`)?W.slice(n.length+1):W)}catch{}continue}let K=Mt(U);for(let P of an(n,s,k,n)){let H=P.startsWith(`${n}/`)?P.slice(n.length+1):P;if(K.test(H)||K.test(H.replace(/\\/g,"/")))A.push(R?P:H)}}return A}function se(e){let a=0,n=[],s=()=>{if(n.length>0&&a<e)a++,n.shift()()};return(k)=>new Promise((R,v)=>{let A=()=>{k().then((U)=>{a--,R(U),s()},(U)=>{a--,v(U),s()})};if(a<e)a++,A();else n.push(A)})}var r={get TRACE(){return process.env.PICKIER_TRACE==="1"},get TIMEOUT_MS(){return Number(process.env.PICKIER_TIMEOUT_MS||"8000")},get RULE_TIMEOUT_MS(){return Number(process.env.PICKIER_RULE_TIMEOUT_MS||"5000")},get CONCURRENCY(){return Number(process.env.PICKIER_CONCURRENCY)||8},get DIAGNOSTICS(){return process.env.PICKIER_DIAGNOSTICS==="1"},get FAIL_ON_WARNINGS(){return process.env.PICKIER_FAIL_ON_WARNINGS==="1"},get NO_AUTO_CONFIG(){return process.env.PICKIER_NO_AUTO_CONFIG==="1"},get WORKERS(){let e=process.env.PICKIER_WORKERS;if(e===void 0||e==="")return null;let a=Number(e);return Number.isFinite(a)?Math.max(0,Math.floor(a)):null}},_=["**/node_modules/**","**/.git/**"],m=["**/node_modules/**","**/dist/**","**/build/**","**/.git/**","**/.next/**","**/.nuxt/**","**/.output/**","**/.vercel/**","**/.netlify/**","**/.cache/**","**/.turbo/**","**/.vscode/**","**/.idea/**","**/.zed/**","**/.cursor/**","**/.claude/**","**/.github/**","**/coverage/**","**/.nyc_output/**","**/.tmp/**","**/.temp/**","**/vendor/**","**/pantry/**","**/target/**","**/zig-cache/**","**/zig-out/**","**/.zig-cache/**","**/__pycache__/**","**/.pytest_cache/**","**/venv/**","**/.venv/**","**/out/**","**/.DS_Store","**/Thumbs.db"];function N(e,a){let n=e[a];if(n===void 0){let R=a.indexOf("/");if(R>0){let v=a.slice(0,R),A=a.slice(R+1),U=v==="general"?"pickier":v==="pickier"?"general":null;if(U)n=e[`${U}/${A}`];if(n===void 0)n=e[A]}}let s,k;if(typeof n==="string"){if(n==="error")s="error";else if(n==="warn"||n==="warning")s="warning"}else if(Array.isArray(n)&&typeof n[0]==="string"){let R=n[0];if(R==="error")s="error";else if(R==="warn"||R==="warning")s="warning";k=n[1]}return{enabled:!!s,severity:s,options:k}}function E(e){let a=Array.isArray(e)?e[0]:e;if(typeof a!=="string")return;if(a==="off")return"off";if(a==="error")return"error";if(a==="warn"||a==="warning")return"warning";return}function o(e,a,n=[],s){for(let R of[a,...n]){let v=E(e.rules?.[R])??E(e.pluginRules?.[R]);if(v)return v==="off"?void 0:v}let k=E(s);return k==="off"?void 0:k}function re(e,a){return E(e.rules?.[a])==="off"||E(e.pluginRules?.[a])==="off"}function w(e,a){return`\x1B[${e}m${a}\x1B[0m`}function J(e){return w("32",e)}function Y(e){return w("31",e)}function Z(e){return w("33",e)}function X(e){return w("34",e)}function Q(e){return w("90",e)}function ee(e){return w("1",e)}var t={green:J,red:Y,yellow:Z,blue:X,gray:Q,bold:ee};function y(e,a){let n=a.ignores?[...new Set([...e.ignores||[],...a.ignores])]:e.ignores,s={...e.pluginRules||{},...a.pluginRules||{}};if((a.tailwind??e.tailwind)?.enabled&&!Object.prototype.hasOwnProperty.call(s,"pickier/sort-tailwind-classes"))s["pickier/sort-tailwind-classes"]="warn";return{...e,...a,verbose:a.verbose??e.verbose,ignores:n,lint:{...e.lint,...a.lint||{}},format:{...e.format,...a.format||{}},rules:{...e.rules,...a.rules||{}},pluginRules:s}}var $e=null;async function u(e){if(!e){if(r.NO_AUTO_CONFIG){if(!$e)$e=y(l,{});return $e}try{let{getConfig:s}=await import("./chunk-1vnz0vyr.js"),k=await s();return y(l,k)}catch{}return y(l,{})}let a=_e(e)?e:$t(process.cwd(),e);if(Pt(a).toLowerCase()===".json")try{let s=Nt(a,"utf8");return y(l,JSON.parse(s))}catch{return console.warn(`[pickier:warn] Config file not found: ${a}. Using default config values.`),y(l,{})}try{let s=await import(a);return y(l,s.default||s)}catch{return console.warn(`[pickier:warn] Config file not found: ${a}. Using default config values.`),y(l,{})}}function x(e){return e.map((a)=>{if(/[*?[\]{}()!]/.test(a))return a;if(/\.[A-Z0-9]+$/i.test(a))return a;return`${a.replace(/\/$/,"")}/**/*`})}function T(e,a){let n=e.lastIndexOf(".");if(n<0)return!1;let s=e.slice(n);return a.has(s)}function Le(e){if(!e.includes("\\")&&!e.includes("//"))return e;return e.replace(/\\/g,"/").replace(/\/+/g,"/")}function Lt(e){let a=[];for(let n of e){let s=Le(n.trim());if(!s)continue;let k=s.match(/\*\*\/\*\.(.+)$/);if(k){a.push({raw:s,kind:"extension",value:k[1]});continue}let R=s.match(/\*\*\/(.+?)\/\*\*$/);if(R){a.push({raw:s,kind:"segment",value:R[1]});continue}let v=s.match(/\*\*\/(.+)$/);if(v)a.push({raw:s,kind:"suffix",value:v[1].replace(/\/$/,"")})}return a}function h(e){return[...new Set([..._,...e])]}function d(e,a=process.cwd()){let n=Lt([..._,...e]);if(n.length===0)return()=>!1;let s=new Set([...m,..._]),k=Le(a).replace(/\/$/,""),R=`${k}/`,v=n.map((A)=>({pattern:A,universal:s.has(A.raw),suffix:A.kind==="extension"?`.${A.value}`:`/${A.value}`,inner:`/${A.value}/`}));return(A)=>{let U=Le(A),K=U!==k&&!U.startsWith(R),P=K?U:U.slice(k.length);for(let{pattern:H,universal:W,suffix:j,inner:B}of v){if(K&&!W)continue;if(H.kind==="extension"){if(P.endsWith(j))return!0;continue}if(H.kind==="segment"||H.kind==="suffix"){if(P.includes(B)||P.endsWith(j))return!0}}return!1}}function ie(e,a){return d(a)(e)}
29
+ export{l,ne,z,g,I,q,G,c,S,p,O,M,C,L,f,se,r,_,m,N,E,o,re,w,J,Y,Z,X,Q,ee,t,y,u,x,T,h,d,ie};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{s}from"./chunk-8m82hwdv.js";import{dirname as ne,resolve as ue}from"path";function c(e){try{let r=JSON.parse(e);if(typeof r!=="object"||r===null||Array.isArray(r))return null;return r}catch{return null}}function le(e,r){let t=e.split(`
2
+ import{s}from"./chunk-qq03kpe0.js";import{dirname as ne,resolve as ue}from"path";function c(e){try{let r=JSON.parse(e);if(typeof r!=="object"||r===null||Array.isArray(r))return null;return r}catch{return null}}function le(e,r){let t=e.split(`
3
3
  `),o=1,n=0;for(let u of r){let i=new RegExp(`"${ce(u)}"\\s*:`);for(let l=n;l<t.length;l++)if(i.test(t[l])){o=l+1,n=l+1;break}}return o}function k(e){return ne(e)}function b(e,r){return ue(e,r)}function f(e){let r="pkg";for(let t of e)if(/^\d+$/.test(t))r+=`[${t}]`;else if(!/^[a-z_$][a-z0-9_$]*$/i.test(t))r+=`["${t}"]`;else r+=`.${t}`;return r}function d(e,r){if(e.publishConfig?.[r]!==void 0)return[e.publishConfig[r],["publishConfig",r]];return[e[r],[r]]}var ae=new RegExp(`(?:[\\s;]|^)(?:import[\\w,{}\\s*]*from|import\\s*['"*{]|export\\b\\s*(?:[*{]|default|type|function|const|var|let|async function)|import\\.meta\\b)`,"m"),pe=new RegExp("(?:[\\s;]|^)(?:module.exports\\b|exports\\.\\w|require\\s*\\(|global\\.\\w|Object\\.(?:defineProperty|defineProperties|assign)\\s*\\(\\s*exports\\b)","m");function I(e){let r=de(e),t=ae.test(r),o=pe.test(r);if(t&&o)return"mixed";if(t)return"ESM";if(o)return"CJS";return"unknown"}function H(e,r){if(e.endsWith(".mjs"))return"ESM";if(e.endsWith(".cjs"))return"CJS";return r==="module"?"ESM":"CJS"}function X(e){if(e==="ESM")return".mjs";if(e==="CJS")return".cjs";return".js"}function Y(e){return e===".mjs"||e===".cjs"}function P(e){return e.endsWith(".js")||e.endsWith(".mjs")||e.endsWith(".cjs")}function G(e){return/^#!\s*\//.test(e)}function de(e){return e.replace(/\/\*[\s\S]*?\*\//g,"").replace(/\/\/.*/g,"")}function x(e,r,t,o){E(e,r,t,o)}function E(e,r,t,o){if(typeof e==="string"){o(e,{path:r,isImports:t});return}if(Array.isArray(e)){o(e,{path:r,isImports:t});for(let n=0;n<e.length;n++)E(e[n],r.concat(String(n)),t,o);return}if(e!==null&&typeof e==="object"){let n=Object.keys(e);o(e,{path:r,isImports:t},n);for(let u of n)E(e[u],r.concat(u),t,o)}}function p(e,r,t,o,n,u,i){return{filePath:e,line:le(r,t),column:1,ruleId:o,message:n,severity:u,...i&&{help:i}}}function ce(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var L={meta:{docs:"Disallow deprecated jsnext:main and jsnext fields",recommended:!0},check(e,r){let t=c(e);if(!t)return[];let o=[];if(t["jsnext:main"]!=null)o.push(p(r.filePath,e,["jsnext:main"],"publint/deprecated-field-jsnext",'pkg["jsnext:main"] is deprecated. pkg.module should be used instead.',"warning",'The jsnext:main field is no longer recognized by modern bundlers. Use "module" instead.'));if(t.jsnext!=null)o.push(p(r.filePath,e,["jsnext"],"publint/deprecated-field-jsnext","pkg.jsnext is deprecated. pkg.module should be used instead.","warning",'The jsnext field is no longer recognized by modern bundlers. Use "module" instead.'));return o}};var M={meta:{docs:'Ensure "default" condition is last in exports objects',recommended:!0},check(e,r){let t=c(e);if(!t)return[];let o=[],[n,u]=d(t,"exports");if(n==null)return[];return x(n,u,!1,(i,l,a)=>{if(!a||typeof i!=="object"||Array.isArray(i))return;if(!("default"in i))return;if(a[a.length-1]!=="default")o.push(p(r.filePath,e,l.path.concat("default"),"publint/exports-default-should-be-last",`${f(l.path.concat("default"))} should be the last condition in the object so it doesn't take precedence over the keys following it.`,"error",'Conditions are resolved in order. "default" acts as a fallback and should come last.'))}),o}};var S={meta:{docs:"Warn against using fallback arrays in exports",recommended:!0},check(e,r){let t=c(e);if(!t)return[];let o=[],[n,u]=d(t,"exports");if(n==null)return[];return x(n,u,!1,(i,l)=>{if(!Array.isArray(i))return;o.push(p(r.filePath,e,l.path,"publint/exports-fallback-array-use",`${f(l.path)} uses fallback arrays which is not recommended. It works differently in some tools and may face inconsistent behaviors.`,"warning","Fallback arrays pick the first parseable value and have no practical use case in Node.js currently."))}),o}};var F={meta:{docs:"Ensure exports has a root entrypoint when main/module exist",recommended:!0},check(e,r){let t=c(e);if(!t)return[];let[o]=d(t,"main"),[n]=d(t,"module"),[u,i]=d(t,"exports");if(o==null&&n==null||u==null)return[];if(typeof u!=="object"||Array.isArray(u))return[];let l=Object.keys(u);if(l.length===0)return[];if(!l[0]?.startsWith("."))return[];if(l.includes("."))return[];let m=[];if(o)m.push("main");if(n)m.push("module");return[p(r.filePath,e,i,"publint/exports-missing-root-entrypoint",`${f(i)} is missing the root entrypoint export, which is defined in pkg.${m[0]}. Environments that support "exports" will ignore pkg.${m[0]} as "exports" takes the highest priority.`,"warning",`Add ${f(i.concat("."))} to ensure the root entrypoint is accessible.`)]}};var w={meta:{docs:'Ensure "module" condition precedes "require" in exports',recommended:!0},check(e,r){let t=c(e);if(!t)return[];let o=[],[n,u]=d(t,"exports");if(n==null)return[];return x(n,u,!1,(i,l,a)=>{if(!a||typeof i!=="object"||Array.isArray(i))return;if(!("module"in i)||!("require"in i))return;if(a.indexOf("module")>a.indexOf("require"))o.push(p(r.filePath,e,l.path.concat("module"),"publint/exports-module-should-precede-require",`${f(l.path.concat("module"))} should come before the "require" condition so it can take precedence when used by a bundler.`,"error",'Bundlers prioritize conditions by order. "module" should precede "require" to ensure ESM is preferred.'))}),o}};var j={meta:{docs:'Ensure "types" condition is first in exports objects',recommended:!0},check(e,r){let t=c(e);if(!t)return[];let o=[],[n,u]=d(t,"exports");if(n==null)return[];return x(n,u,!1,(i,l,a)=>{if(!a||typeof i!=="object"||Array.isArray(i))return;if(!("types"in i))return;let m=a.indexOf("types");if(m===0)return;if(a.slice(0,m).filter((g)=>{if(g.startsWith("types"))return!1;if(typeof i[g]==="object"&&i[g]!==null&&Q(i[g],"types"))return!1;return!0}).length>0)o.push(p(r.filePath,e,l.path.concat("types"),"publint/exports-types-should-be-first",`${f(l.path.concat("types"))} should be the first condition in the object so it can be resolved by TypeScript.`,"error",'TypeScript resolves conditions in order. The "types" condition must come first to ensure correct type resolution.'))}),o}};function Q(e,r){for(let t in e){if(t===r)return!0;if(typeof e[t]==="object"&&e[t]!==null&&Q(e[t],r))return!0}return!1}var T={meta:{docs:'Ensure exports values start with "./"',recommended:!0},check(e,r){let t=c(e);if(!t)return[];let o=[],[n,u]=d(t,"exports");if(n==null)return[];return x(n,u,!1,(i,l)=>{if(typeof i!=="string")return;if(i.startsWith("./"))return;let a=`./${i.replace(/^[/]+/,"")}`;o.push(p(r.filePath,e,l.path,"publint/exports-value-invalid",`${f(l.path)} is "${i}" which is invalid as it does not start with "./". Use "${a}" instead.`,"error",'All exports values must be relative paths starting with "./".'))}),o}};var fe=[{field:"main",expectTypes:["string"]},{field:"module",expectTypes:["string"]},{field:"types",expectTypes:["string"]},{field:"typings",expectTypes:["string"]},{field:"browser",expectTypes:["string","object"]},{field:"bin",expectTypes:["string","object"]},{field:"exports",expectTypes:["string","object"]},{field:"imports",expectTypes:["object"]},{field:"name",expectTypes:["string"]},{field:"version",expectTypes:["string"]},{field:"description",expectTypes:["string"]},{field:"license",expectTypes:["string"]}],J={meta:{docs:"Ensure package.json fields have correct value types",recommended:!0},check(e,r){let t=c(e);if(!t)return[];let o=[];for(let{field:n,expectTypes:u}of fe){let[i,l]=d(t,n);if(i==null)continue;let a=typeof i;if(!u.includes(a)){let m=u.length===1?u[0]:`${u.slice(0,-1).join(", ")} or ${u[u.length-1]}`;o.push(p(r.filePath,e,l,"publint/field-invalid-value-type",`${f(l)} has an invalid ${a} type. Expected a ${m} type instead.`,"error",`The "${n}" field must be of type ${m}.`))}}return o}};var V={meta:{docs:"Suggest adding exports when module field is present",recommended:!0},check(e,r){let t=c(e);if(!t)return[];let[o,n]=d(t,"module"),[u]=d(t,"exports");if(o!=null&&u==null)return[p(r.filePath,e,n,"publint/has-module-but-no-exports","pkg.module is used to output ESM, but pkg.exports is not defined. As Node.js doesn't read pkg.module, the ESM output may be skipped. Consider adding pkg.exports to export the ESM output.","warning",'Node.js only reads "exports" for module resolution. Without it, the ESM entry point in "module" is ignored by Node.js.')];return[]}};var A={meta:{docs:'Ensure "default" condition is last in imports objects',recommended:!0},check(e,r){let t=c(e);if(!t)return[];let o=[],[n,u]=d(t,"imports");if(n==null||typeof n!=="object")return[];return x(n,u,!0,(i,l,a)=>{if(!a||typeof i!=="object"||Array.isArray(i))return;if(!("default"in i))return;if(a[a.length-1]!=="default")o.push(p(r.filePath,e,l.path.concat("default"),"publint/imports-default-should-be-last",`${f(l.path.concat("default"))} should be the last condition in the object so it doesn't take precedence over the keys following it.`,"error",'Conditions are resolved in order. "default" acts as a fallback and should come last.'))}),o}};var D={meta:{docs:'Ensure imports keys start with "#"',recommended:!0},check(e,r){let t=c(e);if(!t)return[];let o=[],[n,u]=d(t,"imports");if(n==null||typeof n!=="object"||Array.isArray(n))return[];for(let i of Object.keys(n))if(!i.startsWith("#")){let l=`#${i.replace(/^[/]+/,"")}`,a=u.concat(i);o.push(p(r.filePath,e,a,"publint/imports-key-invalid",`${f(a)} is invalid as the imports key does not start with "#". Use "${l}" instead.`,"error",'All imports keys must start with "#" to distinguish them from package specifiers.'))}return o}};var O={meta:{docs:'Ensure "module" condition precedes "require" in imports',recommended:!0},check(e,r){let t=c(e);if(!t)return[];let o=[],[n,u]=d(t,"imports");if(n==null||typeof n!=="object")return[];return x(n,u,!0,(i,l,a)=>{if(!a||typeof i!=="object"||Array.isArray(i))return;if(!("module"in i)||!("require"in i))return;if(a.indexOf("module")>a.indexOf("require"))o.push(p(r.filePath,e,l.path.concat("module"),"publint/imports-module-should-precede-require",`${f(l.path.concat("module"))} should come before the "require" condition so it can take precedence when used by a bundler.`,"error",'Bundlers prioritize conditions by order. "module" should precede "require" to ensure ESM is preferred.'))}),o}};var W={meta:{docs:'Ensure imports values start with "./"',recommended:!0},check(e,r){let t=c(e);if(!t)return[];let o=[],[n,u]=d(t,"imports");if(n==null||typeof n!=="object")return[];return x(n,u,!0,(i,l)=>{if(typeof i!=="string")return;if(!i.startsWith("."))return;if(i.startsWith("./"))return;let a=`./${i.replace(/^[/]+/,"")}`;o.push(p(r.filePath,e,l.path,"publint/imports-value-invalid",`${f(l.path)} is "${i}" which is invalid as it does not start with "./". Use "${a}" instead.`,"error",'Relative imports values must start with "./".'))}),o}};var v={meta:{docs:"Disallow local file references in dependencies",recommended:!0},check(e,r){let t=c(e);if(!t)return[];let o=[],n=["dependencies","optionalDependencies","peerDependencies"];for(let u of n){let i=t[u];if(!i||typeof i!=="object")continue;for(let l of Object.keys(i)){let a=i[l];if(typeof a==="string"&&(a.startsWith("file:")||a.startsWith("link:")))o.push(p(r.filePath,e,[u,l],"publint/local-dependency",`The "${l}" dependency references "${a}" that will likely not work when installed by end-users.`,"error","Local file references (file: or link:) are not portable and will fail for consumers of the package."))}}return o}};var N={meta:{docs:'Suggest specifying the "type" field in package.json',recommended:!0},check(e,r){let t=c(e);if(!t)return[];if(t.type==null)return[p(r.filePath,e,["name"],"publint/use-type",'The package does not specify the "type" field. Node.js may attempt to detect the package type causing a small performance hit. Consider adding "type": "commonjs" or "type": "module".',"warning",'Adding "type" helps Node.js resolve module format without detection overhead.')];return[]}};import{existsSync as me,readFileSync as he}from"fs";var B={meta:{docs:"Ensure bin files have a shebang for executability",recommended:!0},check(e,r){let t=c(e);if(!t)return[];let o=[],n=k(r.filePath),[u,i]=d(t,"bin");if(u==null)return[];if(typeof u==="string")Z(u,i,n,o,r.filePath,e);else if(typeof u==="object"){for(let l of Object.keys(u))if(typeof u[l]==="string")Z(u[l],i.concat(l),n,o,r.filePath,e)}return o}};function Z(e,r,t,o,n,u){let i=b(t,e);if(!me(i))return;if(!P(e))return;let l;try{l=he(i,"utf8")}catch{return}if(!G(l))o.push(p(n,u,r,"publint/bin-file-not-executable",`${f(r)} is "${e}" but the file is not executable. It should start with a shebang, e.g. #!/usr/bin/env node.`,"error","Bin files must start with a shebang (e.g. #!/usr/bin/env node) to be executable."))}import{existsSync as ee,readFileSync as te}from"fs";var q={meta:{docs:'Ensure files under "module" condition in exports are ESM',recommended:!0},check(e,r){let t=c(e);if(!t)return[];let o=[],n=k(r.filePath),[u,i]=d(t,"exports");if(u==null)return[];x(u,i,!1,(m,h)=>{if(typeof m!=="string")return;if(!h.path.includes("module"))return;if(!m.startsWith("./")&&!m.startsWith("../"))return;if(m.includes("*"))return;let g=b(n,m);if(!ee(g))return;if(!P(m))return;let y;try{y=te(g,"utf8")}catch{return}if(I(y)==="CJS")o.push(p(r.filePath,e,h.path,"publint/exports-module-should-be-esm",`${f(h.path)} should be ESM, but the code is written in CJS.`,"error",'The "module" condition is only used by bundlers and must contain ESM code.'))});let[l,a]=d(t,"imports");if(l!=null&&typeof l==="object")x(l,a,!0,(m,h)=>{if(typeof m!=="string")return;if(!h.path.includes("module"))return;if(!m.startsWith("./"))return;if(m.includes("*"))return;let g=b(n,m);if(!ee(g))return;if(!P(m))return;let y;try{y=te(g,"utf8")}catch{return}if(I(y)==="CJS")o.push(p(r.filePath,e,h.path,"publint/exports-module-should-be-esm",`${f(h.path)} should be ESM, but the code is written in CJS.`,"error",'The "module" condition is only used by bundlers and must contain ESM code.'))});return o}};import{existsSync as R}from"fs";import{dirname as ge,isAbsolute as xe,resolve as ye}from"path";function _(e,r){let t=r;while(t.startsWith("./"))t=t.slice(2);let o=t.split("/")[0];if(!o||o===".."||o.startsWith("."))return!1;let n=xe(r)?ge(r).split("/")[0]||"/":ye(e,o);return!R(n)}var U={meta:{docs:"Ensure files referenced in package.json exist",recommended:!0},check(e,r){let t=c(e);if(!t)return[];let o=[],n=k(r.filePath),u=["main","module","types","typings","unpkg","jsdelivr"];for(let h of u){let[g,y]=d(t,h);if(g==null||typeof g!=="string")continue;if(_(n,g))continue;let C=b(n,g);if(!se(C))o.push(p(r.filePath,e,y,"publint/file-does-not-exist",`${f(y)} is "${g}" but the file does not exist.`,"error","The referenced file path cannot be found. Check the path for typos."))}let[i,l]=d(t,"bin");if(i!=null){if(typeof i==="string")re(i,l,o,r.filePath,e,n);else if(typeof i==="object"){for(let h of Object.keys(i))if(typeof i[h]==="string")re(i[h],l.concat(h),o,r.filePath,e,n)}}let[a,m]=d(t,"exports");if(a!=null)x(a,m,!1,(h,g)=>{if(typeof h!=="string")return;if(!h.startsWith("./")&&!h.startsWith("../"))return;if(h.includes("*"))return;if(_(n,h))return;let y=b(n,h);if(!R(y))o.push(p(r.filePath,e,g.path,"publint/file-does-not-exist",`${f(g.path)} is "${h}" but the file does not exist.`,"error","The referenced file path cannot be found. Check the path for typos."))});return o}};function re(e,r,t,o,n,u){if(_(u,e))return;let i=b(u,e);if(!se(i))t.push(p(o,n,r,"publint/file-does-not-exist",`${f(r)} is "${e}" but the file does not exist.`,"error","The referenced file path cannot be found. Check the path for typos."))}function se(e){if(R(e))return!0;if(R(`${e}.js`))return!0;if(R(`${e}/index.js`))return!0;return!1}import{existsSync as be,readFileSync as ke}from"fs";import{extname as Pe}from"path";var z={meta:{docs:"Ensure file code format matches its extension and package type",recommended:!0},check(e,r){let t=c(e);if(!t)return[];let o=[],n=k(r.filePath),u=t.type,[i,l]=d(t,"main");if(i!=null&&typeof i==="string")oe(i,l,n,u,o,r.filePath,e);let[a,m]=d(t,"exports");if(a!=null)x(a,m,!1,(h,g)=>{if(typeof h!=="string")return;if(!h.startsWith("./")&&!h.startsWith("../"))return;if(h.includes("*"))return;if(g.path.includes("browser"))return;oe(h,g.path,n,u,o,r.filePath,e)});return o}};function oe(e,r,t,o,n,u,i){let l=b(t,e);if(!be(l))return;if(!P(e))return;let a;try{a=ke(l,"utf8")}catch{return}let m=I(a);if(m==="unknown"||m==="mixed")return;let h=H(l,o);if(m===h)return;let g=Pe(l),y=X(m),ie=(Y(g)?"FILE_INVALID_EXPLICIT_FORMAT":"FILE_INVALID_FORMAT")==="FILE_INVALID_EXPLICIT_FORMAT"?`${f(r)} is "${e}" and ends with the ${g} extension, but the code is written in ${m}. Consider using the ${y} extension.`:`${f(r)} is "${e}" and is written in ${m}, but is interpreted as ${h}. Consider using the ${y} extension.`;n.push(p(u,i,r,"publint/file-invalid-format",ie,"warning",`The file's code format (${m}) doesn't match the expected format (${h}) based on its extension and package type.`))}import{existsSync as Ie,readFileSync as Re}from"fs";var K={meta:{docs:'Ensure the "module" field points to an ESM file',recommended:!0},check(e,r){let t=c(e);if(!t)return[];let[o,n]=d(t,"module");if(o==null||typeof o!=="string")return[];let u=k(r.filePath),i=b(u,o);if(!Ie(i))return[];if(!P(o))return[];let l;try{l=Re(i,"utf8")}catch{return[]}if(I(l)==="CJS")return[p(r.filePath,e,n,"publint/module-should-be-esm",`${f(n)} should be ESM, but the code is written in CJS.`,"error",'The "module" field is intended for ESM output used by bundlers. It should point to an ESM file.')];return[]}};var Bt={name:"publint",rules:{"use-type":s(N),"local-dependency":s(v),"deprecated-field-jsnext":s(L),"has-module-but-no-exports":s(V),"field-invalid-value-type":s(J),"exports-types-should-be-first":s(j),"exports-default-should-be-last":s(M),"exports-module-should-precede-require":s(w),"exports-value-invalid":s(T),"exports-missing-root-entrypoint":s(F),"exports-fallback-array-use":s(S),"imports-key-invalid":s(D),"imports-value-invalid":s(W),"imports-default-should-be-last":s(A),"imports-module-should-precede-require":s(O),"file-does-not-exist":s(U),"file-invalid-format":s(z),"module-should-be-esm":s(K),"bin-file-not-executable":s(B),"exports-module-should-be-esm":s(q)}};export{Bt as publintPlugin};
@@ -0,0 +1,2 @@
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-bf41tx1b.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};