pickier 0.1.39 → 0.1.40
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin/cli.js +1 -1
- package/dist/{chunk-wdphw37x.js → chunk-34yzzbec.js} +1 -1
- package/dist/{chunk-ayzr3qv1.js → chunk-db1t9ezz.js} +1 -1
- package/dist/{chunk-96ebhnpj.js → chunk-j2yn05ka.js} +1 -1
- package/dist/{chunk-5zxqxpyk.js → chunk-p4y6z6j6.js} +1 -1
- package/dist/{chunk-kbvc5qze.js → chunk-vq1weh7a.js} +1 -1
- package/dist/src/index.js +1 -1
- package/package.json +1 -1
package/dist/bin/cli.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
2
|
// @bun
|
|
3
|
-
import{L as N}from"../chunk-h6ac3d60.js";import J from"process";async function I(){let E=J.argv.slice(2),Q=E[0]==="run",C=Q?1:0,O=Q?"auto":"lint",X=!1,Y=!1,Z=!1,_=!1,$,T=[],x=!0;for(let y=C;y<E.length;y++){let q=E[y];if(q==="--mode")O=E[++y]||"auto";else if(q==="--format")Z=!0,O="format";else if(q==="--check")X=!0;else if(q==="--write")Y=!0;else if(q==="--config")$=E[++y];else if(q==="--verbose")_=!0;else if(q==="--ext"||q==="--ignore-path")y++;else if(q==="--fix"||q==="--dry-run"||q==="--reporter"||q==="--max-warnings"||q==="--cache"){x=!1,T.length=0;break}else if(q.startsWith("--"));else T.push(q)}if(x&&(O==="format"||O==="auto"||O==="lint")&&T.length>0){let{runUnified:y}=await import("../chunk-
|
|
3
|
+
import{L as N}from"../chunk-h6ac3d60.js";import J from"process";async function I(){let E=J.argv.slice(2),Q=E[0]==="run",C=Q?1:0,O=Q?"auto":"lint",X=!1,Y=!1,Z=!1,_=!1,$,T=[],x=!0;for(let y=C;y<E.length;y++){let q=E[y];if(q==="--mode")O=E[++y]||"auto";else if(q==="--format")Z=!0,O="format";else if(q==="--check")X=!0;else if(q==="--write")Y=!0;else if(q==="--config")$=E[++y];else if(q==="--verbose")_=!0;else if(q==="--ext"||q==="--ignore-path")y++;else if(q==="--fix"||q==="--dry-run"||q==="--reporter"||q==="--max-warnings"||q==="--cache"){x=!1,T.length=0;break}else if(q.startsWith("--"));else T.push(q)}if(x&&(O==="format"||O==="auto"||O==="lint")&&T.length>0){let{runUnified:y}=await import("../chunk-p4y6z6j6.js"),q=await y(T,{mode:O,check:X,write:Y,verbose:_,config:$});J.exit(q)}let{CLI:L}=await import("../chunk-88xjkex3.js"),{version:F}=await import("../chunk-vq1weh7a.js"),H=new L("pickier"),V=(y)=>{let[q,B]=y;return[Array.isArray(q)?q.filter((W)=>typeof W==="string"):[],B&&typeof B==="object"?B:{}]};H.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(...y)=>{let[q,B]=V(y);if(q.length===0){H.outputHelp();return}let{runUnified:K}=await import("../chunk-p4y6z6j6.js"),D;if(B.format){if(D="format",!B.check)B.write=!0}else D="lint";let W=await K(q,{...B,mode:D});J.exit(W)}),H.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(...y)=>{let[q,B]=V(y),{runUnified:K}=await import("../chunk-p4y6z6j6.js"),D=await K(q,{...B,mode:"lint"});J.exit(D)}),H.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(...y)=>{let[q,B]=V(y),{runUnified:K}=await import("../chunk-p4y6z6j6.js"),D=await K(q,{...B,mode:"format"});J.exit(D)}),H.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(...y)=>{let[q,B]=V(y),{runUnified:K}=await import("../chunk-p4y6z6j6.js"),D=await K(q,B);J.exit(D)}),H.command("version","Show the version of the CLI").action(async()=>{let{version:y}=await import("../chunk-vq1weh7a.js");J.stdout.write(`${y}
|
|
4
4
|
`)}),H.version(F),H.help(),H.parse()}I().catch((E)=>{let Q=E instanceof Error?E.message:String(E);J.stderr.write(`pickier: ${Q}
|
|
5
5
|
`),J.exit(1)});
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{D as H,k as G}from"./chunk-cbqydxbp.js";import{L as K}from"./chunk-h6ac3d60.js";import{readFileSync as M,statSync as N,writeFileSync as Q}from"fs";import{isAbsolute as R,resolve as T}from"path";import U from"process";async function w(k,j){let B=j.mode||"auto";if(B==="format"&&k.length===1&&!/[*?[\]{}()!]/.test(k[0]))try{let q=k[0],z=R(q)?q:T(U.cwd(),q);if(N(z).isFile()){let J=await H(j.config),D=M(z,"utf8"),E=G(D,J,z);if(j.check&&E!==D)return 1;if(j.write&&E!==D)Q(z,E,"utf8");return 0}}catch{}let{runLint:x}=await import("./chunk-
|
|
2
|
+
import{D as H,k as G}from"./chunk-cbqydxbp.js";import{L as K}from"./chunk-h6ac3d60.js";import{readFileSync as M,statSync as N,writeFileSync as Q}from"fs";import{isAbsolute as R,resolve as T}from"path";import U from"process";async function w(k,j){let B=j.mode||"auto";if(B==="format"&&k.length===1&&!/[*?[\]{}()!]/.test(k[0]))try{let q=k[0],z=R(q)?q:T(U.cwd(),q);if(N(z).isFile()){let J=await H(j.config),D=M(z,"utf8"),E=G(D,J,z);if(j.check&&E!==D)return 1;if(j.write&&E!==D)Q(z,E,"utf8");return 0}}catch{}let{runLint:x}=await import("./chunk-j2yn05ka.js");if(B==="lint")return x(k,j);if(B==="format"){let q={...j,fix:!0,dryRun:!!j.check,ext:j.ext,_formatOnly:!0};return x(k,q)}if(!(j.fix===!0||j.write===!0||j.check===!0))return x(k,j);let I={...j,fix:!0,dryRun:!!j.check,ext:j.ext};return x(k,I)}
|
|
3
3
|
export{w as h};
|
|
@@ -120,7 +120,7 @@ ${z}`}:void 0}}var sJ={name:"markdown",rules:{"heading-increment":l(QJ),"heading
|
|
|
120
120
|
`),q=`${Q}
|
|
121
121
|
${G}`;if(L7(q)!==q)return[{filePath:J.filePath,line:Y+1,column:1,ruleId:"sort-imports",message:"Imports are not sorted/grouped consistently",severity:"warning"}];return[]},fix:($)=>L7($)};var eJ={name:"perfectionist",rules:{"sort-imports":w(P8)}};import{dirname as KG,resolve as HG}from"path";function t($){try{let J=JSON.parse($);if(typeof J!=="object"||J===null||Array.isArray(J))return null;return J}catch{return null}}function VG($,J){let Z=$.split(`
|
|
122
122
|
`),X=1,Y=0;for(let z of J){let Q=new RegExp(`"${BG(z)}"\\s*:`);for(let G=Y;G<Z.length;G++)if(Q.test(Z[G])){X=G+1,Y=G+1;break}}return X}function h0($){return KG($)}function I0($,J){return HG($,J)}function $0($){let J="pkg";for(let Z of $)if(/^\d+$/.test(Z))J+=`[${Z}]`;else if(!/^[a-z_$][a-z0-9_$]*$/i.test(Z))J+=`["${Z}"]`;else J+=`.${Z}`;return J}function i($,J){if($.publishConfig?.[J]!==void 0)return[$.publishConfig[J],["publishConfig",J]];return[$[J],[J]]}var AG=new RegExp(`(?:[\\s;]|^)(?:import[\\w,{}\\s*]*from|import\\s*['"*{]|export\\b\\s*(?:[*{]|default|type|function|const|var|let|async function)|import\\.meta\\b)`,"m"),_G=new RegExp("(?:[\\s;]|^)(?:module.exports\\b|exports\\.\\w|require\\s*\\(|global\\.\\w|Object\\.(?:defineProperty|defineProperties|assign)\\s*\\(\\s*exports\\b)","m");function J1($){let J=FG($),Z=AG.test(J),X=_G.test(J);if(Z&&X)return"mixed";if(Z)return"ESM";if(X)return"CJS";return"unknown"}function $X($,J){if($.endsWith(".mjs"))return"ESM";if($.endsWith(".cjs"))return"CJS";return J==="module"?"ESM":"CJS"}function ZX($){if($==="ESM")return".mjs";if($==="CJS")return".cjs";return".js"}function JX($){return $===".mjs"||$===".cjs"}function a0($){return $.endsWith(".js")||$.endsWith(".mjs")||$.endsWith(".cjs")}function XX($){return/^#!\s*\//.test($)}function FG($){return $.replace(/\/\*[\s\S]*?\*\//g,"").replace(/\/\/.*/g,"")}function U0($,J,Z,X){P7($,J,Z,X)}function P7($,J,Z,X){if(typeof $==="string"){X($,{path:J,isImports:Z});return}if(Array.isArray($)){X($,{path:J,isImports:Z});for(let Y=0;Y<$.length;Y++)P7($[Y],J.concat(String(Y)),Z,X);return}if($!==null&&typeof $==="object"){let Y=Object.keys($);X($,{path:J,isImports:Z},Y);for(let z of Y)P7($[z],J.concat(z),Z,X)}}function n($,J,Z,X,Y,z,Q){return{filePath:$,line:VG(J,Z),column:1,ruleId:X,message:Y,severity:z,...Q&&{help:Q}}}function BG($){return $.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var C7={meta:{docs:"Disallow deprecated jsnext:main and jsnext fields",recommended:!0},check($,J){let Z=t($);if(!Z)return[];let X=[];if(Z["jsnext:main"]!=null)X.push(n(J.filePath,$,["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(Z.jsnext!=null)X.push(n(J.filePath,$,["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 X}};var I7={meta:{docs:'Ensure "default" condition is last in exports objects',recommended:!0},check($,J){let Z=t($);if(!Z)return[];let X=[],[Y,z]=i(Z,"exports");if(Y==null)return[];return U0(Y,z,!1,(Q,G,q)=>{if(!q||typeof Q!=="object"||Array.isArray(Q))return;if(!("default"in Q))return;if(q[q.length-1]!=="default")X.push(n(J.filePath,$,G.path.concat("default"),"publint/exports-default-should-be-last",`${$0(G.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.'))}),X}};var S7={meta:{docs:"Warn against using fallback arrays in exports",recommended:!0},check($,J){let Z=t($);if(!Z)return[];let X=[],[Y,z]=i(Z,"exports");if(Y==null)return[];return U0(Y,z,!1,(Q,G)=>{if(!Array.isArray(Q))return;X.push(n(J.filePath,$,G.path,"publint/exports-fallback-array-use",`${$0(G.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."))}),X}};var v7={meta:{docs:"Ensure exports has a root entrypoint when main/module exist",recommended:!0},check($,J){let Z=t($);if(!Z)return[];let[X]=i(Z,"main"),[Y]=i(Z,"module"),[z,Q]=i(Z,"exports");if(X==null&&Y==null||z==null)return[];if(typeof z!=="object"||Array.isArray(z))return[];let G=Object.keys(z);if(G.length===0)return[];if(!G[0]?.startsWith("."))return[];if(G.includes("."))return[];let U=[];if(X)U.push("main");if(Y)U.push("module");return[n(J.filePath,$,Q,"publint/exports-missing-root-entrypoint",`${$0(Q)} is missing the root entrypoint export, which is defined in pkg.${U[0]}. Environments that support "exports" will ignore pkg.${U[0]} as "exports" takes the highest priority.`,"warning",`Add ${$0(Q.concat("."))} to ensure the root entrypoint is accessible.`)]}};var y7={meta:{docs:'Ensure "module" condition precedes "require" in exports',recommended:!0},check($,J){let Z=t($);if(!Z)return[];let X=[],[Y,z]=i(Z,"exports");if(Y==null)return[];return U0(Y,z,!1,(Q,G,q)=>{if(!q||typeof Q!=="object"||Array.isArray(Q))return;if(!("module"in Q)||!("require"in Q))return;if(q.indexOf("module")>q.indexOf("require"))X.push(n(J.filePath,$,G.path.concat("module"),"publint/exports-module-should-precede-require",`${$0(G.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.'))}),X}};var b7={meta:{docs:'Ensure "types" condition is first in exports objects',recommended:!0},check($,J){let Z=t($);if(!Z)return[];let X=[],[Y,z]=i(Z,"exports");if(Y==null)return[];return U0(Y,z,!1,(Q,G,q)=>{if(!q||typeof Q!=="object"||Array.isArray(Q))return;if(!("types"in Q))return;let U=q.indexOf("types");if(U===0)return;if(q.slice(0,U).filter((K)=>{if(K.startsWith("types"))return!1;if(typeof Q[K]==="object"&&Q[K]!==null&&YX(Q[K],"types"))return!1;return!0}).length>0)X.push(n(J.filePath,$,G.path.concat("types"),"publint/exports-types-should-be-first",`${$0(G.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.'))}),X}};function YX($,J){for(let Z in $){if(Z===J)return!0;if(typeof $[Z]==="object"&&$[Z]!==null&&YX($[Z],J))return!0}return!1}var k7={meta:{docs:'Ensure exports values start with "./"',recommended:!0},check($,J){let Z=t($);if(!Z)return[];let X=[],[Y,z]=i(Z,"exports");if(Y==null)return[];return U0(Y,z,!1,(Q,G)=>{if(typeof Q!=="string")return;if(Q.startsWith("./"))return;let q=`./${Q.replace(/^[/]+/,"")}`;X.push(n(J.filePath,$,G.path,"publint/exports-value-invalid",`${$0(G.path)} is "${Q}" which is invalid as it does not start with "./". Use "${q}" instead.`,"error",'All exports values must be relative paths starting with "./".'))}),X}};var wG=[{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"]}],f7={meta:{docs:"Ensure package.json fields have correct value types",recommended:!0},check($,J){let Z=t($);if(!Z)return[];let X=[];for(let{field:Y,expectTypes:z}of wG){let[Q,G]=i(Z,Y);if(Q==null)continue;let q=typeof Q;if(!z.includes(q)){let U=z.length===1?z[0]:`${z.slice(0,-1).join(", ")} or ${z[z.length-1]}`;X.push(n(J.filePath,$,G,"publint/field-invalid-value-type",`${$0(G)} has an invalid ${q} type. Expected a ${U} type instead.`,"error",`The "${Y}" field must be of type ${U}.`))}}return X}};var g7={meta:{docs:"Suggest adding exports when module field is present",recommended:!0},check($,J){let Z=t($);if(!Z)return[];let[X,Y]=i(Z,"module"),[z]=i(Z,"exports");if(X!=null&&z==null)return[n(J.filePath,$,Y,"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 x7={meta:{docs:'Ensure "default" condition is last in imports objects',recommended:!0},check($,J){let Z=t($);if(!Z)return[];let X=[],[Y,z]=i(Z,"imports");if(Y==null||typeof Y!=="object")return[];return U0(Y,z,!0,(Q,G,q)=>{if(!q||typeof Q!=="object"||Array.isArray(Q))return;if(!("default"in Q))return;if(q[q.length-1]!=="default")X.push(n(J.filePath,$,G.path.concat("default"),"publint/imports-default-should-be-last",`${$0(G.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.'))}),X}};var p7={meta:{docs:'Ensure imports keys start with "#"',recommended:!0},check($,J){let Z=t($);if(!Z)return[];let X=[],[Y,z]=i(Z,"imports");if(Y==null||typeof Y!=="object"||Array.isArray(Y))return[];for(let Q of Object.keys(Y))if(!Q.startsWith("#")){let G=`#${Q.replace(/^[/]+/,"")}`,q=z.concat(Q);X.push(n(J.filePath,$,q,"publint/imports-key-invalid",`${$0(q)} is invalid as the imports key does not start with "#". Use "${G}" instead.`,"error",'All imports keys must start with "#" to distinguish them from package specifiers.'))}return X}};var h7={meta:{docs:'Ensure "module" condition precedes "require" in imports',recommended:!0},check($,J){let Z=t($);if(!Z)return[];let X=[],[Y,z]=i(Z,"imports");if(Y==null||typeof Y!=="object")return[];return U0(Y,z,!0,(Q,G,q)=>{if(!q||typeof Q!=="object"||Array.isArray(Q))return;if(!("module"in Q)||!("require"in Q))return;if(q.indexOf("module")>q.indexOf("require"))X.push(n(J.filePath,$,G.path.concat("module"),"publint/imports-module-should-precede-require",`${$0(G.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.'))}),X}};var u7={meta:{docs:'Ensure imports values start with "./"',recommended:!0},check($,J){let Z=t($);if(!Z)return[];let X=[],[Y,z]=i(Z,"imports");if(Y==null||typeof Y!=="object")return[];return U0(Y,z,!0,(Q,G)=>{if(typeof Q!=="string")return;if(!Q.startsWith("."))return;if(Q.startsWith("./"))return;let q=`./${Q.replace(/^[/]+/,"")}`;X.push(n(J.filePath,$,G.path,"publint/imports-value-invalid",`${$0(G.path)} is "${Q}" which is invalid as it does not start with "./". Use "${q}" instead.`,"error",'Relative imports values must start with "./".'))}),X}};var m7={meta:{docs:"Disallow local file references in dependencies",recommended:!0},check($,J){let Z=t($);if(!Z)return[];let X=[],Y=["dependencies","optionalDependencies","peerDependencies"];for(let z of Y){let Q=Z[z];if(!Q||typeof Q!=="object")continue;for(let G of Object.keys(Q)){let q=Q[G];if(typeof q==="string"&&(q.startsWith("file:")||q.startsWith("link:")))X.push(n(J.filePath,$,[z,G],"publint/local-dependency",`The "${G}" dependency references "${q}" 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 X}};var d7={meta:{docs:'Suggest specifying the "type" field in package.json',recommended:!0},check($,J){let Z=t($);if(!Z)return[];if(Z.type==null)return[n(J.filePath,$,["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 MG,readFileSync as jG}from"fs";var o7={meta:{docs:"Ensure bin files have a shebang for executability",recommended:!0},check($,J){let Z=t($);if(!Z)return[];let X=[],Y=h0(J.filePath),[z,Q]=i(Z,"bin");if(z==null)return[];if(typeof z==="string")zX(z,Q,Y,X,J.filePath,$);else if(typeof z==="object"){for(let G of Object.keys(z))if(typeof z[G]==="string")zX(z[G],Q.concat(G),Y,X,J.filePath,$)}return X}};function zX($,J,Z,X,Y,z){let Q=I0(Z,$);if(!MG(Q))return;if(!a0($))return;let G;try{G=jG(Q,"utf8")}catch{return}if(!XX(G))X.push(n(Y,z,J,"publint/bin-file-not-executable",`${$0(J)} is "${$}" 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 QX,readFileSync as GX}from"fs";var c7={meta:{docs:'Ensure files under "module" condition in exports are ESM',recommended:!0},check($,J){let Z=t($);if(!Z)return[];let X=[],Y=h0(J.filePath),[z,Q]=i(Z,"exports");if(z==null)return[];U0(z,Q,!1,(U,W)=>{if(typeof U!=="string")return;if(!W.path.includes("module"))return;if(!U.startsWith("./")&&!U.startsWith("../"))return;if(U.includes("*"))return;let K=I0(Y,U);if(!QX(K))return;if(!a0(U))return;let H;try{H=GX(K,"utf8")}catch{return}if(J1(H)==="CJS")X.push(n(J.filePath,$,W.path,"publint/exports-module-should-be-esm",`${$0(W.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[G,q]=i(Z,"imports");if(G!=null&&typeof G==="object")U0(G,q,!0,(U,W)=>{if(typeof U!=="string")return;if(!W.path.includes("module"))return;if(!U.startsWith("./"))return;if(U.includes("*"))return;let K=I0(Y,U);if(!QX(K))return;if(!a0(U))return;let H;try{H=GX(K,"utf8")}catch{return}if(J1(H)==="CJS")X.push(n(J.filePath,$,W.path,"publint/exports-module-should-be-esm",`${$0(W.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 X}};import{existsSync as f1}from"fs";import{dirname as NG,isAbsolute as TG,resolve as EG}from"path";function r7($,J){let Z=J;while(Z.startsWith("./"))Z=Z.slice(2);let X=Z.split("/")[0];if(!X||X===".."||X.startsWith("."))return!1;let Y=TG(J)?NG(J).split("/")[0]||"/":EG($,X);return!f1(Y)}var l7={meta:{docs:"Ensure files referenced in package.json exist",recommended:!0},check($,J){let Z=t($);if(!Z)return[];let X=[],Y=h0(J.filePath),z=["main","module","types","typings","unpkg","jsdelivr"];for(let W of z){let[K,H]=i(Z,W);if(K==null||typeof K!=="string")continue;if(r7(Y,K))continue;let V=I0(Y,K);if(!UX(V))X.push(n(J.filePath,$,H,"publint/file-does-not-exist",`${$0(H)} is "${K}" but the file does not exist.`,"error","The referenced file path cannot be found. Check the path for typos."))}let[Q,G]=i(Z,"bin");if(Q!=null){if(typeof Q==="string")qX(Q,G,X,J.filePath,$,Y);else if(typeof Q==="object"){for(let W of Object.keys(Q))if(typeof Q[W]==="string")qX(Q[W],G.concat(W),X,J.filePath,$,Y)}}let[q,U]=i(Z,"exports");if(q!=null)U0(q,U,!1,(W,K)=>{if(typeof W!=="string")return;if(!W.startsWith("./")&&!W.startsWith("../"))return;if(W.includes("*"))return;if(r7(Y,W))return;let H=I0(Y,W);if(!f1(H))X.push(n(J.filePath,$,K.path,"publint/file-does-not-exist",`${$0(K.path)} is "${W}" but the file does not exist.`,"error","The referenced file path cannot be found. Check the path for typos."))});return X}};function qX($,J,Z,X,Y,z){if(r7(z,$))return;let Q=I0(z,$);if(!UX(Q))Z.push(n(X,Y,J,"publint/file-does-not-exist",`${$0(J)} is "${$}" but the file does not exist.`,"error","The referenced file path cannot be found. Check the path for typos."))}function UX($){if(f1($))return!0;if(f1(`${$}.js`))return!0;if(f1(`${$}/index.js`))return!0;return!1}import{existsSync as DG,readFileSync as RG}from"fs";import{extname as OG}from"path";var a7={meta:{docs:"Ensure file code format matches its extension and package type",recommended:!0},check($,J){let Z=t($);if(!Z)return[];let X=[],Y=h0(J.filePath),z=Z.type,[Q,G]=i(Z,"main");if(Q!=null&&typeof Q==="string")WX(Q,G,Y,z,X,J.filePath,$);let[q,U]=i(Z,"exports");if(q!=null)U0(q,U,!1,(W,K)=>{if(typeof W!=="string")return;if(!W.startsWith("./")&&!W.startsWith("../"))return;if(W.includes("*"))return;if(K.path.includes("browser"))return;WX(W,K.path,Y,z,X,J.filePath,$)});return X}};function WX($,J,Z,X,Y,z,Q){let G=I0(Z,$);if(!DG(G))return;if(!a0($))return;let q;try{q=RG(G,"utf8")}catch{return}let U=J1(q);if(U==="unknown"||U==="mixed")return;let W=$X(G,X);if(U===W)return;let K=OG(G),H=ZX(U),A=(JX(K)?"FILE_INVALID_EXPLICIT_FORMAT":"FILE_INVALID_FORMAT")==="FILE_INVALID_EXPLICIT_FORMAT"?`${$0(J)} is "${$}" and ends with the ${K} extension, but the code is written in ${U}. Consider using the ${H} extension.`:`${$0(J)} is "${$}" and is written in ${U}, but is interpreted as ${W}. Consider using the ${H} extension.`;Y.push(n(z,Q,J,"publint/file-invalid-format",A,"warning",`The file's code format (${U}) doesn't match the expected format (${W}) based on its extension and package type.`))}import{existsSync as LG,readFileSync as PG}from"fs";var s7={meta:{docs:'Ensure the "module" field points to an ESM file',recommended:!0},check($,J){let Z=t($);if(!Z)return[];let[X,Y]=i(Z,"module");if(X==null||typeof X!=="string")return[];let z=h0(J.filePath),Q=I0(z,X);if(!LG(Q))return[];if(!a0(X))return[];let G;try{G=PG(Q,"utf8")}catch{return[]}if(J1(G)==="CJS")return[n(J.filePath,$,Y,"publint/module-should-be-esm",`${$0(Y)} 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 KX={name:"publint",rules:{"use-type":A0(d7),"local-dependency":A0(m7),"deprecated-field-jsnext":A0(C7),"has-module-but-no-exports":A0(g7),"field-invalid-value-type":A0(f7),"exports-types-should-be-first":A0(b7),"exports-default-should-be-last":A0(I7),"exports-module-should-precede-require":A0(y7),"exports-value-invalid":A0(k7),"exports-missing-root-entrypoint":A0(v7),"exports-fallback-array-use":A0(S7),"imports-key-invalid":A0(p7),"imports-value-invalid":A0(u7),"imports-default-should-be-last":A0(x7),"imports-module-should-precede-require":A0(h7),"file-does-not-exist":A0(l7),"file-invalid-format":A0(a7),"module-should-be-esm":A0(s7),"bin-file-not-executable":A0(o7),"exports-module-should-be-esm":A0(c7)}};var HX={meta:{docs:"Ensure all imports appear before other statements",recommended:!1},check:($,J)=>{let Z=[],X=$.split(/\r?\n/),Y=!1,z=0;for(let Q=0;Q<X.length;Q++){let G=X[Q].trim();if(!G||G.startsWith("//")||G.startsWith("/*")||G.startsWith("*"))continue;let q=G.match(/^\s*import\s+/);if(!q&&G.length>0){if(Y=!0,z===0)z=Q+1}if(Y&&q)Z.push({filePath:J.filePath,line:Q+1,column:1,ruleId:"import/first",message:"Import statement must appear before other statements",severity:"error"})}return Z}};var VX={meta:{docs:"Disallow duplicate specifier names in a single import declaration"},check:($,J)=>{let Z=[],X=$.split(/\r?\n/);for(let Y=0;Y<X.length;Y++){let z=X[Y],Q=z.match(/^\s*import\s*\{([^}]*)\}\s*from\s*['"][^'"]+['"]/);if(!Q)continue;let q=Q[1].split(",").map((W)=>W.trim()).filter(Boolean).map((W)=>W.split(/\s+as\s+/i)[0].trim()),U=new Set;for(let W of q){if(U.has(W)){Z.push({filePath:J.filePath,line:Y+1,column:Math.max(1,z.indexOf(W)+1),ruleId:"pickier/import-dedupe",message:"Expect no duplication in imports",severity:"warning"});break}U.add(W)}}return Z}};import{existsSync as CG,readFileSync as IG}from"fs";import{dirname as SG,resolve as vG}from"path";var AX={meta:{docs:"Ensure named imports correspond to a named export in the remote file",recommended:!0},check:($,J)=>{let Z=[],X=$.split(/\r?\n/),Y=SG(J.filePath);for(let z=0;z<X.length;z++){let G=X[z].match(/\bimport\s+\{([^}]+)\}\s+from\s+['"]([^'"]+)['"]/);if(G){let q=G[1].split(",").map((H)=>H.trim().split(/\s+as\s+/)[0].trim()),U=G[2];if(!U.startsWith(".")&&!U.startsWith("/"))continue;let W=[".ts",".tsx",".js",".jsx",""],K="";for(let H of W){let V=vG(Y,U+H);if(CG(V)){K=IG(V,"utf8");break}}if(K)for(let H of q){let V=new RegExp(`\\bexport\\s+(?:const|let|var|function|class)\\s+${H}\\b`),A=new RegExp(`\\bexport\\s+\\{[^}]*\\b${H}\\b[^}]*\\}`);if(![V,A].some((B)=>B.test(K)))Z.push({filePath:J.filePath,line:z+1,column:1,ruleId:"import/named",message:`'${H}' not found in '${U}'`,severity:"error"})}}}return Z}};import{existsSync as _X,readFileSync as yG}from"fs";import{dirname as FX,resolve as BX}from"path";var wX={meta:{docs:"Ensure imports don't create circular dependencies",recommended:!0},check:($,J)=>{let Z=[],X=$.split(/\r?\n/),Y=J.filePath,z=new Set,Q=new Set;function G(U,W){if(Q.has(U))return!0;if(z.has(U))return!1;z.add(U),Q.add(U);try{let K=yG(U,"utf8"),H=q(K,FX(U));for(let V of H)if(G(V,[...W,V]))return!0}catch{}return Q.delete(U),!1}function q(U,W){let K=[],H=/\bimport(?:\s{2,}|\s+\S.*?(?:[\n\r\u2028\u2029]\s*|[\t\v\f \xA0\u1680\u2000-\u200A\u202F\u205F\u3000\uFEFF]))from\s+['"]([^'"]+)['"]/g,V;for(V=H.exec(U);V!==null;V=H.exec(U)){let A=V[1];if(A.startsWith(".")||A.startsWith("/")){let _=[".ts",".tsx",".js",".jsx",""];for(let F of _){let B=BX(W,A+F);if(_X(B)){K.push(B);break}}}}return K}for(let U=0;U<X.length;U++){let K=X[U].match(/\bimport(?:\s{2,}|\s+\S.*?(?:[\n\r\u2028\u2029]\s*|[\t\v\f \xA0\u1680\u2000-\u200A\u202F\u205F\u3000\uFEFF]))from\s+['"]([^'"]+)['"]/);if(K){let H=K[1];if(H.startsWith(".")||H.startsWith("/")){let V=[".ts",".tsx",".js",".jsx",""],A="";for(let _ of V){let F=BX(FX(Y),H+_);if(_X(F)){A=F;break}}if(A){if(z.clear(),Q.clear(),Q.add(Y),G(A,[Y,A]))Z.push({filePath:J.filePath,line:U+1,column:1,ruleId:"import/no-cycle",message:"Dependency cycle detected",severity:"error"})}}}}return Z}};var MX={meta:{docs:"Disallow duplicate module imports - all imports from the same module should be combined"},check:($,J)=>{let Z=[],X=$.split(/\r?\n/),Y=new Map,z=!1;for(let Q=0;Q<X.length;Q++){let G=X[Q];if(z){let V=G.indexOf("*/");if(V>=0)G=G.slice(V+2),z=!1;else continue}let q=G.indexOf("/*"),U=G.indexOf("//");if(q>=0&&(U===-1||q<U)){let V=G.indexOf("*/",q+2);if(V>=0)G=G.slice(0,q)+G.slice(V+2);else z=!0,G=G.slice(0,q)}if(U>=0)G=G.slice(0,U);let W=G.trim();if(!W)continue;let K=W.match(/^import\s+(?:type\s+)?(?:\{[^}]*\}|[\w$]+(?:\s*,\s*\{[^}]*\})?|\*\s+as\s+[\w$]+)\s+from\s+(['"`])(.+?)\1/);if(K){let V=K[2];if(Y.has(V)){let A=Y.get(V);Z.push({filePath:J.filePath,line:Q+1,column:1,ruleId:"no-duplicate-imports",message:`'${V}' imported multiple times (also imported on line${A.length>1?"s":""} ${A.join(", ")})`,severity:"error",help:`Combine all imports from '${V}' into a single import statement`}),A.push(Q+1)}else Y.set(V,[Q+1])}let H=W.match(/^export\s+(?:type\s+)?(?:\{[^}]*\}|\*(?:\s+as\s+[\w$]+)?)\s+from\s+(['"`])(.+?)\1/);if(H){let V=H[2],A=`export:${V}`;if(Y.has(A)){let _=Y.get(A);Z.push({filePath:J.filePath,line:Q+1,column:1,ruleId:"no-duplicate-imports",message:`'${V}' re-exported multiple times (also exported on line${_.length>1?"s":""} ${_.join(", ")})`,severity:"error",help:`Combine all re-exports from '${V}' into a single export statement`}),_.push(Q+1)}else Y.set(A,[Q+1])}}return Z}};var jX={meta:{docs:"Disallow importing from dist directories"},check:($,J)=>{let Z=[],X=new RegExp(`^\\s*import\\s[^;]*?from\\s*['"]([^'"]+)['"]`,"m"),Y=$.split(/\r?\n/);for(let z=0;z<Y.length;z++){let Q=Y[z],G=Q.match(X);if(!G)continue;let q=G[1];if(q==="dist"||(q.startsWith(".")||q.startsWith("/"))&&/(?:^|\/)dist(?:\/.|$)/.test(q))Z.push({filePath:J.filePath,line:z+1,column:Math.max(1,Q.indexOf(q)+1),ruleId:"pickier/no-import-dist",message:`Do not import modules in \`dist\` folder, got ${q}`,severity:"error"})}return Z}};var NX={meta:{docs:"Disallow importing from node_modules by explicit path"},check:($,J)=>{let Z=[],X=new RegExp(`^\\s*import\\s[^;]*?from\\s*['"]([^'"]+)['"]`,"m"),Y=/require\(\s*['"]([^'"]+)['"]\s*\)/,z=$.split(/\r?\n/);for(let Q=0;Q<z.length;Q++){let G=z[Q],q=G.match(X),U=G.match(Y),W=q?.[1]||U?.[1];if(!W)continue;if(W.includes("/node_modules/")){let K=Math.max(1,G.indexOf(W)+1);Z.push({filePath:J.filePath,line:Q+1,column:K,ruleId:"pickier/no-import-node-modules-by-path",message:"Do not import modules in `node_modules` folder by path",severity:"error"})}}return Z}};import{existsSync as bG}from"fs";import{dirname as kG,join as fG,resolve as gG}from"path";var TX={meta:{docs:"Ensure imports point to a file/module that can be resolved",recommended:!0},check:($,J)=>{let Z=[],X=$.split(/\r?\n/),Y=kG(J.filePath);for(let z=0;z<X.length;z++){let Q=X[z],G=[...Q.matchAll(/\bimport(?:\s{2,}|\s+\S.*?(?:[\n\r\u2028\u2029]\s*|[\t\v\f \xA0\u1680\u2000-\u200A\u202F\u205F\u3000\uFEFF]))from\s+['"]([^'"]+)['"]/g),...Q.matchAll(/\bimport\s*\(\s*['"]([^'"]+)['"]\s*\)/g),...Q.matchAll(/\brequire\s*\(\s*['"]([^'"]+)['"]\s*\)/g)];for(let q of G){let U=q[1];if(!U.startsWith(".")&&!U.startsWith("/"))continue;let W=[],K=[".ts",".tsx",".js",".jsx",".mjs",".cjs",""];for(let V of K){let A=gG(Y,U+V);W.push(A),W.push(fG(A,`index${V}`))}if(!W.some((V)=>bG(V)))Z.push({filePath:J.filePath,line:z+1,column:1,ruleId:"import/no-unresolved",message:`Unable to resolve path to module '${U}'`,severity:"error"})}}return Z}};function EX($,J,Z){let X=Z.order==="desc"?-1:1,Y=Z.type||"alphabetical",z=Z.ignoreCase?$.toLowerCase():$,Q=Z.ignoreCase?J.toLowerCase():J;if(Y==="line-length")return(z.length-Q.length)*X;if(Y==="natural")return z.localeCompare(Q,void 0,{numeric:!0,sensitivity:"base"})*X;if(Y==="unsorted")return 0;return z.localeCompare(Q)*X}var xG=new RegExp(`^export\\s+\\{[^}]*\\}\\s+from\\s+['"][^'"]+['"];?\\s*$`);function C8($){return xG.test($)}var DX={meta:{docs:"Ensure contiguous export statements are sorted consistently."},check:($,J)=>{let Z=[],X=J.config.pluginRules?.["pickier/sort-exports"]?.[1]||{},Y=$.split(/\r?\n/),z=0;while(z<Y.length){while(z<Y.length&&!C8(Y[z]))z++;if(z>=Y.length)break;let Q=[],G=z;while(G<Y.length){let q=Y[G];if(C8(q)){Q.push({idx:G,line:q}),G++;continue}if(X.partitionByNewLine&&q.trim()==="")break;else break}if(Q.length>1){let q=Q.map((K)=>K.line),U=[...q].sort((K,H)=>EX(K,H,X));if(!q.every((K,H)=>K===U[H])){let K=q.findIndex((V,A)=>V!==U[A]),H=Q[K]?.idx??Q[0].idx;Z.push({filePath:J.filePath,line:H+1,column:1,ruleId:"pickier/sort-exports",message:"Export statements are not sorted.",severity:"warning"})}}z=G+1}return Z},fix:($,J)=>{let Z=J.config.pluginRules?.["pickier/sort-exports"]?.[1]||{},Y=[...$.split(/\r?\n/)],z=0;while(z<Y.length){while(z<Y.length&&!C8(Y[z]))z++;if(z>=Y.length)break;let Q=[],G=z;while(G<Y.length){let q=Y[G];if(C8(q)){Q.push(G),G++;continue}if(Z.partitionByNewLine&&q.trim()==="")break;else break}if(Q.length>1){let q=Q.map((K)=>Y[K]),U=[...q].sort((K,H)=>EX(K,H,Z));if(!q.every((K,H)=>K===U[H]))Q.forEach((K,H)=>{Y[K]=U[H]})}z=G+1}return Y.join(`
|
|
123
|
-
`)}};var RX={meta:{docs:"Enforce sorted TypeScript heritage clauses (extends/implements lists)"},check:($,J)=>{let Z=J.options||{},X=Z.type||"alphabetical",Y=Z.order||"asc",z=Z.ignoreCase!==!1,Q=Array.isArray(Z.groups)?Z.groups:[],G=Z.customGroups||{},q=$.split(/\r?\n/),U=[],W=(M)=>Y==="asc"?M:-M,K=(M,E)=>(z?M.toLowerCase():M).localeCompare(z?E.toLowerCase():E),H=(M,E)=>(z?M.toLowerCase():M).localeCompare(z?E.toLowerCase():E,void 0,{numeric:!0}),V=(M,E)=>{if(X==="line-length")return W(M.length-E.length);if(X==="natural")return W(H(M,E));if(X==="unsorted")return 0;return W(K(M,E))},A=Object.fromEntries(Object.entries(G).map(([M,E])=>{let S=(Array.isArray(E)?E:[E]).map((f)=>new RegExp(f));return[M,S]})),_=[];for(let M of Q)if(Array.isArray(M))_.push(...M);else _.push(M);if(!_.includes("unknown"))_.push("unknown");let F=(M)=>{for(let[E,R]of Object.entries(A))if(R.some((S)=>S.test(M)))return E;return"unknown"},B=(M)=>{let E=[],R=0,S="";for(let f=0;f<M.length;f++){let O=M[f];if(O==="<")R++;else if(O===">")R=Math.max(0,R-1);if(O===","&&R===0){E.push(S.trim()),S="";continue}S+=O}if(S.trim())E.push(S.trim());return E},j=(M)=>{let E=M.trim(),R=E.match(/^([A-Z_$][\w$.]*)/i);return R?R[1]:E},D=(M,E)=>{let R=B(E);if(R.length<=1)return;let S=R.map(j),f=S.map(F),O=S.map((P,C)=>({n:P,g:f[C],i:C})).sort((P,C)=>{let I=_.indexOf(P.g),L=_.indexOf(C.g);if(I!==L)return I-L;return V(P.n,C.n)}).map((P)=>P.n);if(!S.every((P,C)=>P===O[C]))U.push({filePath:J.filePath,line:M,column:1,ruleId:"sort-heritage-clauses",message:"Heritage clauses are not sorted",severity:"warning"})};for(let M=0;M<q.length;M++){let E=q[M],R=E.match(/^\s*interface\s+[A-Za-z_$][^{]*\bextends\s+(.+?)\s*\{/);if(R)D(M+1,R[1]);let S=E.match(/^\s*class\s+[A-Za-z_$][^{]*\bimplements\s+(.+?)\s*\{/);if(S)D(M+1,S[1])}return U}};var OX={meta:{docs:"Require object keys to be sorted (ESLint-compatible core rule subset)"},check:()=>{return[]}};var LX={meta:{docs:"Enforce sorted named imports within each import statement"},check:($,J)=>{let Z=J.options||{},X=Z.type||"alphabetical",Y=Z.order||"asc",z=Z.ignoreCase!==!1,Q=Boolean(Z.ignoreAlias),G=$.split(/\r?\n/),q=[],U=(W,K)=>{let H=0;if(X==="line-length")H=W.length-K.length;else{let V=z?W.toLowerCase():W,A=z?K.toLowerCase():K;H=V.localeCompare(A)}return Y==="asc"?H:-H};for(let W=0;W<G.length;W++){let H=G[W].match(/^\s*import\s+\{([^}]*)\}\s+from\s+['"][^'"]+['"]/);if(!H)continue;let A=H[1].split(",").map((j)=>j.trim()).filter(Boolean);if(A.length<=1)continue;let _=A.map((j)=>{let D=j.replace(/^type\s+/,""),M=D.match(/^([\w$]+)\s+as\s+([\w$]+)$/);if(M)return Q?M[2]:M[1];let E=D.match(/^([\w$]+)$/);return E?E[1]:D}),F=[..._].sort(U);if(!_.every((j,D)=>j===F[D]))q.push({filePath:J.filePath,line:W+1,column:1,ruleId:"sort-named-imports",message:"Named imports are not sorted",severity:"warning"})}return q}};var PX={meta:{docs:"Enforce sorted object keys"},check:($,J)=>{let Z=J.options||{},X=Z.type||"alphabetical",Y=Z.order||"asc",z=Z.ignoreCase!==!1,Q=Boolean(Z.partitionByNewLine),G=$.split(/\r?\n/),q=[],U=(K,H)=>{let V=0;if(X==="line-length")V=K.length-H.length;else{let A=z?K.toLowerCase():K,_=z?H.toLowerCase():H;V=A.localeCompare(_)}return Y==="asc"?V:-V},W=0;while(W<G.length){let K=G[W],H=K.indexOf("{");if(H!==-1){let V=K.slice(0,H);if(/=\s*$|\(\s*$|\breturn\s*$/.test(V)){let A=0,_=W,F=W;for(;F<G.length;F++){for(let B of G[F])if(B==="{")A++;else if(B==="}")A--;if(A===0)break}if(F>_){let B=G.slice(_+1,F),j=[],D={startLine:_+2,props:[]},M=()=>{if(D.props.length)j.push(D);D={startLine:0,props:[]}};for(let E=0;E<B.length;E++){let R=B[E];if(Q&&/^\s*$/.test(R)){M();continue}if(/^\s*\.\.\./.test(R))continue;if(/\{|\}/.test(R))continue;let S=R.match(/^\s*['"]?([\w$-]+)['"]?\s*:/);if(S){if(D.startLine===0)D.startLine=_+2+E;D.props.push({key:S[1],line:_+2+E})}}M();for(let E of j){let R=E.props.map((O)=>O.key),S=[...R].sort(U);if(!(R.length<=1||R.every((O,h)=>O===S[h]))&&E.props.length>0){let O=E.props[0];q.push({filePath:J.filePath,line:O.line,column:1,ruleId:"sort-objects",message:"Object keys are not sorted",severity:"warning"})}}W=F+1;continue}}}W++}return q}};var CX={meta:{docs:"Enforce top-level functions to use function declarations"},check:($,J)=>{let Z=[],X=$.split(/\r?\n/);for(let Y=0;Y<X.length;Y++){let z=X[Y];if(/^\s+/.test(z))continue;if(/^\s*(?:\/\/|\/\*)/.test(z))continue;let Q=z.match(/^const\s+([A-Za-z_$][\w$]*)\s*=(.*)$/);if(!Q)continue;let G=Q[2].trim();if(/^\(?[A-Z_$,]*(?:\)\s*)?=>/i.test(G)||/^function\b/.test(G)){let q=z.indexOf("const")+1;Z.push({filePath:J.filePath,line:Y+1,column:q,ruleId:"pickier/top-level-function",message:"Top-level functions should be declared with function keyword",severity:"warning"});continue}if(G.trim().length===0||/[,({]$/.test(G.trim())){let q=X[Y+1]||"";if(/^\s*(?:\(?[A-Za-z_$,]*(?:\)\s*)?=>|function\b)/.test(q)){let U=z.indexOf("const")+1;Z.push({filePath:J.filePath,line:Y+1,column:U,ruleId:"pickier/top-level-function",message:"Top-level functions should be declared with function keyword",severity:"warning"})}}}return Z}};var pG=[[/^(block|inline|inline-block|flex|inline-flex|grid|inline-grid|flow-root|contents|hidden|table|table-caption|table-cell|table-column|table-column-group|table-footer-group|table-header-group|table-row-group|table-row|list-item|subgrid)$/,0],[/^(container|columns|break-after|break-before|break-inside|box-decoration|box-border|box-content|float|clear|isolation|object|overflow|overscroll|position|inset|top|right|bottom|left|start|end|z-|aspect|order)/,1],[/^(static|fixed|absolute|relative|sticky)$/,1],[/^(visible|invisible|collapse)$/,1],[/^(basis|flex-|grow|shrink|order|grid-|col-|row-|auto-cols|auto-rows|gap|justify|items|content|self|place)/,2],[/^(p|px|py|ps|pe|pt|pr|pb|pl|m|mx|my|ms|me|mt|mr|mb|ml|space|indent)-/,3],[/^(-?(p|px|py|ps|pe|pt|pr|pb|pl|m|mx|my|ms|me|mt|mr|mb|ml|space|indent)-)/,3],[/^(w-|h-|min-w|max-w|min-h|max-h|size-)/,4],[/^(font|text|tracking|leading|list|placeholder|vertical|whitespace|break|hyphens|content|truncate|overflow-ellipsis|overflow-clip|line-clamp|underline|overline|line-through|no-underline|uppercase|lowercase|capitalize|normal-case|italic|not-italic|ordinal|slashed-zero|lining-nums|oldstyle-nums|proportional-nums|tabular-nums|diagonal-fractions|stacked-fractions|normal-nums|antialiased|subpixel-antialiased)/,5],[/^(bg-|from-|via-|to-|gradient-)/,6],[/^(border|rounded|outline|ring|divide|accent)/,7],[/^(shadow|opacity|mix-blend|bg-blend)/,8],[/^(blur|brightness|contrast|drop-shadow|grayscale|hue-rotate|invert|saturate|sepia|backdrop)/,9],[/^(border-collapse|border-separate|border-spacing|table-auto|table-fixed|caption)/,10],[/^(transition|duration|ease|delay|animate)/,11],[/^(scale|rotate|translate|skew|origin|transform|perspective)/,12],[/^(appearance|cursor|caret|pointer-events|resize|scroll|snap|touch|select|will-change)/,13],[/^(fill|stroke)/,14],[/^(sr-only|not-sr-only)$/,15]],hG=/^([a-z0-9][-a-z0-9]{0,50}:)+(?!\[)/;function uG($){let J=0;while(J<$.length){if($[J]==="[")break;let Z=$.indexOf(":",J);if(Z===-1)break;if($[Z+1]==="[")break;J=Z+1}return $.slice(J)}function mG($){let J=uG($);if(J.startsWith("!"))J=J.slice(1);for(let[Z,X]of pG)if(Z.test(J))return X;return 99}function dG($){let J=$.match(hG);if(!J)return 0;let Z=J[0].slice(0,-1).split(":"),X={sm:1,md:2,lg:3,xl:4,"2xl":5},Y=10;for(let z of Z)if(X[z]!==void 0)Y+=X[z];else Y+=20;return Y}var IX=new Map;function SX($){let J=IX.get($);if(J)return J;let Z={group:mG($),variant:dG($)};return IX.set($,Z),Z}function n7($){return[...$].sort((J,Z)=>{let X=SX(J),Y=SX(Z),z=X.group,Q=Y.group;if(z!==Q)return z-Q;let G=X.variant,q=Y.variant;if(G!==q)return G-q;return J.localeCompare(Z)})}var oG=/\b(?:class|className|:class)\s*=\s*(?:"([^"]*?)"|'([^']*?)')/g,cG=/\b(?:class|className|:class)\s*=\s*\{`([^`]*?)`\}/g,rG=/\b(?:clsx|cn|tw|cva|tv)\s*\(\s*(?:"([^"]*?)"|'([^']*?)')/g;function lG($){let
|
|
123
|
+
`)}};var RX={meta:{docs:"Enforce sorted TypeScript heritage clauses (extends/implements lists)"},check:($,J)=>{let Z=J.options||{},X=Z.type||"alphabetical",Y=Z.order||"asc",z=Z.ignoreCase!==!1,Q=Array.isArray(Z.groups)?Z.groups:[],G=Z.customGroups||{},q=$.split(/\r?\n/),U=[],W=(M)=>Y==="asc"?M:-M,K=(M,E)=>(z?M.toLowerCase():M).localeCompare(z?E.toLowerCase():E),H=(M,E)=>(z?M.toLowerCase():M).localeCompare(z?E.toLowerCase():E,void 0,{numeric:!0}),V=(M,E)=>{if(X==="line-length")return W(M.length-E.length);if(X==="natural")return W(H(M,E));if(X==="unsorted")return 0;return W(K(M,E))},A=Object.fromEntries(Object.entries(G).map(([M,E])=>{let S=(Array.isArray(E)?E:[E]).map((f)=>new RegExp(f));return[M,S]})),_=[];for(let M of Q)if(Array.isArray(M))_.push(...M);else _.push(M);if(!_.includes("unknown"))_.push("unknown");let F=(M)=>{for(let[E,R]of Object.entries(A))if(R.some((S)=>S.test(M)))return E;return"unknown"},B=(M)=>{let E=[],R=0,S="";for(let f=0;f<M.length;f++){let O=M[f];if(O==="<")R++;else if(O===">")R=Math.max(0,R-1);if(O===","&&R===0){E.push(S.trim()),S="";continue}S+=O}if(S.trim())E.push(S.trim());return E},j=(M)=>{let E=M.trim(),R=E.match(/^([A-Z_$][\w$.]*)/i);return R?R[1]:E},D=(M,E)=>{let R=B(E);if(R.length<=1)return;let S=R.map(j),f=S.map(F),O=S.map((P,C)=>({n:P,g:f[C],i:C})).sort((P,C)=>{let I=_.indexOf(P.g),L=_.indexOf(C.g);if(I!==L)return I-L;return V(P.n,C.n)}).map((P)=>P.n);if(!S.every((P,C)=>P===O[C]))U.push({filePath:J.filePath,line:M,column:1,ruleId:"sort-heritage-clauses",message:"Heritage clauses are not sorted",severity:"warning"})};for(let M=0;M<q.length;M++){let E=q[M],R=E.match(/^\s*interface\s+[A-Za-z_$][^{]*\bextends\s+(.+?)\s*\{/);if(R)D(M+1,R[1]);let S=E.match(/^\s*class\s+[A-Za-z_$][^{]*\bimplements\s+(.+?)\s*\{/);if(S)D(M+1,S[1])}return U}};var OX={meta:{docs:"Require object keys to be sorted (ESLint-compatible core rule subset)"},check:()=>{return[]}};var LX={meta:{docs:"Enforce sorted named imports within each import statement"},check:($,J)=>{let Z=J.options||{},X=Z.type||"alphabetical",Y=Z.order||"asc",z=Z.ignoreCase!==!1,Q=Boolean(Z.ignoreAlias),G=$.split(/\r?\n/),q=[],U=(W,K)=>{let H=0;if(X==="line-length")H=W.length-K.length;else{let V=z?W.toLowerCase():W,A=z?K.toLowerCase():K;H=V.localeCompare(A)}return Y==="asc"?H:-H};for(let W=0;W<G.length;W++){let H=G[W].match(/^\s*import\s+\{([^}]*)\}\s+from\s+['"][^'"]+['"]/);if(!H)continue;let A=H[1].split(",").map((j)=>j.trim()).filter(Boolean);if(A.length<=1)continue;let _=A.map((j)=>{let D=j.replace(/^type\s+/,""),M=D.match(/^([\w$]+)\s+as\s+([\w$]+)$/);if(M)return Q?M[2]:M[1];let E=D.match(/^([\w$]+)$/);return E?E[1]:D}),F=[..._].sort(U);if(!_.every((j,D)=>j===F[D]))q.push({filePath:J.filePath,line:W+1,column:1,ruleId:"sort-named-imports",message:"Named imports are not sorted",severity:"warning"})}return q}};var PX={meta:{docs:"Enforce sorted object keys"},check:($,J)=>{let Z=J.options||{},X=Z.type||"alphabetical",Y=Z.order||"asc",z=Z.ignoreCase!==!1,Q=Boolean(Z.partitionByNewLine),G=$.split(/\r?\n/),q=[],U=(K,H)=>{let V=0;if(X==="line-length")V=K.length-H.length;else{let A=z?K.toLowerCase():K,_=z?H.toLowerCase():H;V=A.localeCompare(_)}return Y==="asc"?V:-V},W=0;while(W<G.length){let K=G[W],H=K.indexOf("{");if(H!==-1){let V=K.slice(0,H);if(/=\s*$|\(\s*$|\breturn\s*$/.test(V)){let A=0,_=W,F=W;for(;F<G.length;F++){for(let B of G[F])if(B==="{")A++;else if(B==="}")A--;if(A===0)break}if(F>_){let B=G.slice(_+1,F),j=[],D={startLine:_+2,props:[]},M=()=>{if(D.props.length)j.push(D);D={startLine:0,props:[]}};for(let E=0;E<B.length;E++){let R=B[E];if(Q&&/^\s*$/.test(R)){M();continue}if(/^\s*\.\.\./.test(R))continue;if(/\{|\}/.test(R))continue;let S=R.match(/^\s*['"]?([\w$-]+)['"]?\s*:/);if(S){if(D.startLine===0)D.startLine=_+2+E;D.props.push({key:S[1],line:_+2+E})}}M();for(let E of j){let R=E.props.map((O)=>O.key),S=[...R].sort(U);if(!(R.length<=1||R.every((O,h)=>O===S[h]))&&E.props.length>0){let O=E.props[0];q.push({filePath:J.filePath,line:O.line,column:1,ruleId:"sort-objects",message:"Object keys are not sorted",severity:"warning"})}}W=F+1;continue}}}W++}return q}};var CX={meta:{docs:"Enforce top-level functions to use function declarations"},check:($,J)=>{let Z=[],X=$.split(/\r?\n/);for(let Y=0;Y<X.length;Y++){let z=X[Y];if(/^\s+/.test(z))continue;if(/^\s*(?:\/\/|\/\*)/.test(z))continue;let Q=z.match(/^const\s+([A-Za-z_$][\w$]*)\s*=(.*)$/);if(!Q)continue;let G=Q[2].trim();if(/^\(?[A-Z_$,]*(?:\)\s*)?=>/i.test(G)||/^function\b/.test(G)){let q=z.indexOf("const")+1;Z.push({filePath:J.filePath,line:Y+1,column:q,ruleId:"pickier/top-level-function",message:"Top-level functions should be declared with function keyword",severity:"warning"});continue}if(G.trim().length===0||/[,({]$/.test(G.trim())){let q=X[Y+1]||"";if(/^\s*(?:\(?[A-Za-z_$,]*(?:\)\s*)?=>|function\b)/.test(q)){let U=z.indexOf("const")+1;Z.push({filePath:J.filePath,line:Y+1,column:U,ruleId:"pickier/top-level-function",message:"Top-level functions should be declared with function keyword",severity:"warning"})}}}return Z}};var pG=[[/^(block|inline|inline-block|flex|inline-flex|grid|inline-grid|flow-root|contents|hidden|table|table-caption|table-cell|table-column|table-column-group|table-footer-group|table-header-group|table-row-group|table-row|list-item|subgrid)$/,0],[/^(container|columns|break-after|break-before|break-inside|box-decoration|box-border|box-content|float|clear|isolation|object|overflow|overscroll|position|inset|top|right|bottom|left|start|end|z-|aspect|order)/,1],[/^(static|fixed|absolute|relative|sticky)$/,1],[/^(visible|invisible|collapse)$/,1],[/^(basis|flex-|grow|shrink|order|grid-|col-|row-|auto-cols|auto-rows|gap|justify|items|content|self|place)/,2],[/^(p|px|py|ps|pe|pt|pr|pb|pl|m|mx|my|ms|me|mt|mr|mb|ml|space|indent)-/,3],[/^(-?(p|px|py|ps|pe|pt|pr|pb|pl|m|mx|my|ms|me|mt|mr|mb|ml|space|indent)-)/,3],[/^(w-|h-|min-w|max-w|min-h|max-h|size-)/,4],[/^(font|text|tracking|leading|list|placeholder|vertical|whitespace|break|hyphens|content|truncate|overflow-ellipsis|overflow-clip|line-clamp|underline|overline|line-through|no-underline|uppercase|lowercase|capitalize|normal-case|italic|not-italic|ordinal|slashed-zero|lining-nums|oldstyle-nums|proportional-nums|tabular-nums|diagonal-fractions|stacked-fractions|normal-nums|antialiased|subpixel-antialiased)/,5],[/^(bg-|from-|via-|to-|gradient-)/,6],[/^(border|rounded|outline|ring|divide|accent)/,7],[/^(shadow|opacity|mix-blend|bg-blend)/,8],[/^(blur|brightness|contrast|drop-shadow|grayscale|hue-rotate|invert|saturate|sepia|backdrop)/,9],[/^(border-collapse|border-separate|border-spacing|table-auto|table-fixed|caption)/,10],[/^(transition|duration|ease|delay|animate)/,11],[/^(scale|rotate|translate|skew|origin|transform|perspective)/,12],[/^(appearance|cursor|caret|pointer-events|resize|scroll|snap|touch|select|will-change)/,13],[/^(fill|stroke)/,14],[/^(sr-only|not-sr-only)$/,15]],hG=/^([a-z0-9][-a-z0-9]{0,50}:)+(?!\[)/;function uG($){let J=0;while(J<$.length){if($[J]==="[")break;let Z=$.indexOf(":",J);if(Z===-1)break;if($[Z+1]==="[")break;J=Z+1}return $.slice(J)}function mG($){let J=uG($);if(J.startsWith("!"))J=J.slice(1);for(let[Z,X]of pG)if(Z.test(J))return X;return 99}function dG($){let J=$.match(hG);if(!J)return 0;let Z=J[0].slice(0,-1).split(":"),X={sm:1,md:2,lg:3,xl:4,"2xl":5},Y=10;for(let z of Z)if(X[z]!==void 0)Y+=X[z];else Y+=20;return Y}var IX=new Map;function SX($){let J=IX.get($);if(J)return J;let Z={group:mG($),variant:dG($)};return IX.set($,Z),Z}function n7($){return[...$].sort((J,Z)=>{let X=SX(J),Y=SX(Z),z=X.group,Q=Y.group;if(z!==Q)return z-Q;let G=X.variant,q=Y.variant;if(G!==q)return G-q;return J.localeCompare(Z)})}var oG=/\b(?:class|className|:class)\s*=\s*(?:"([^"]*?)"|'([^']*?)')/g,cG=/\b(?:class|className|:class)\s*=\s*\{`([^`]*?)`\}/g,rG=/\b(?:clsx|cn|tw|cva|tv)\s*\(\s*(?:"([^"]*?)"|'([^']*?)')/g;function lG($){let J=$.replace(/\[[^\]]*\]/g,"");if(/['"`]/.test(J))return!0;if(/[{}()=]/.test(J))return!0;if(/ \? | && | \|\| /.test(J))return!0;if(/\b(?:true|false|null|undefined|function|return|typeof|instanceof)\b/.test(J))return!0;return!1}function vX($){let J=[];if(!$.includes("class")&&!$.includes("clsx")&&!$.includes("cn(")&&!$.includes("tw(")&&!$.includes("cva(")&&!$.includes("tv("))return J;for(let Z of[oG,cG,rG]){Z.lastIndex=0;let X;while((X=Z.exec($))!==null){let Y=X[1]??X[2]??"";if(!Y.trim())continue;if(lG(Y))continue;let z=$.indexOf(Y,X.index);if(z===-1)continue;J.push({value:Y,start:z,end:z+Y.length})}}return J.sort((Z,X)=>Z.start-X.start),J}function yX($){let J=[],Z="",X=0;for(let Y of $)if(Y==="[")X++,Z+=Y;else if(Y==="]")X=Math.max(0,X-1),Z+=Y;else if(/\s/.test(Y)&&X===0){if(Z)J.push(Z),Z=""}else Z+=Y;if(Z)J.push(Z);return J}function bX($){let J=n7($);return $.every((Z,X)=>Z===J[X])}var kX={meta:{docs:"Enforce consistent Tailwind CSS class ordering (layout \u2192 spacing \u2192 typography \u2192 etc.).",recommended:!0},check:($,J)=>{let Z=[],X=vX($);for(let{value:Y,start:z}of X){let Q=yX(Y);if(Q.length<2)continue;if(!bX(Q)){let G=$.slice(0,z),q=(G.match(/\n/g)??[]).length+1,U=G.lastIndexOf(`
|
|
124
124
|
`),W=U===-1?z+1:z-U;Z.push({filePath:J.filePath,line:q,column:W,ruleId:"pickier/sort-tailwind-classes",message:`Tailwind classes are not in the recommended order. Expected: "${n7(Q).join(" ")}"`,severity:"warning",help:"Run with --fix to automatically sort Tailwind classes, or reorder them manually."})}}return Z},fix:($)=>{let J=vX($);if(J.length===0)return $;let Z=[...J].reverse(),X=$;for(let{value:Y,start:z,end:Q}of Z){let G=yX(Y);if(G.length<2||bX(G))continue;let q=n7(G).join(" ");X=X.slice(0,z)+q+X.slice(Q)}return X}};var fX={name:"pickier",rules:{"sort-exports":w(DX),"sort-objects":w(PX),"sort-imports":w(P8),"sort-named-imports":w(LX),"sort-heritage-clauses":w(RX),"sort-keys":w(OX),"import-dedupe":w(VX),"import-first":w(HX),"import-named":w(AX),"import-no-cycle":w(wX),"import-no-unresolved":w(TX),"no-import-dist":w(jX),"no-import-node-modules-by-path":w(NX),"no-duplicate-imports":w(MX),"top-level-function":w(CX),"sort-tailwind-classes":kX,"prefer-const":w(D8),"prefer-template":w(R8),"no-unused-vars":w(i0)}};var gX={name:"quality",rules:{"default-case":w(m$),eqeqeq:w(d$),"no-alert":w(r$),"no-await-in-loop":w(l$),"no-caller":w(a$),"no-case-declarations":w(s$),"no-else-return":w(n$),"no-empty":w(i$),"no-empty-function":w(t$),"no-eval":w(e$),"no-extend-native":w($8),"no-global-assign":w(J8),"no-implied-eval":w(X8),"no-iterator":w(Y8),"no-new":w(z8),"no-new-func":w(Q8),"no-new-wrappers":w(G8),"no-octal":w(q8),"no-param-reassign":w(U8),"no-proto":w(W8),"no-return-assign":w(K8),"no-shadow":w(V8),"no-throw-literal":w(A8),"no-use-before-define":w(_8),"no-useless-call":w(F8),"no-with":w(N8),"require-await":w(E8),complexity:w(u$),"max-depth":w(o$),"max-lines-per-function":w(c$),"no-extra-boolean-cast":w(Z8),"no-lonely-if":w(v1),"no-sequences":w(H8),"no-useless-concat":w(B8),"no-useless-escape":w(w8),"no-useless-rename":w(M8),"no-useless-return":w(y1),"no-var":w(j8),"prefer-arrow-callback":w(T8)}};var xX={meta:{docs:"Detects potentially super-linear backtracking patterns in regex literals (heuristic)"},check:($,J)=>{let Z=[],X=/\/[^/\\\n]*(?:\\.[^/\\\n]*)*\//g,Y=(K,H,V)=>{let A=$.slice(0,K),_=(A.match(/\n/g)||[]).length+1,F=K-A.lastIndexOf(`
|
|
125
125
|
`);Z.push({filePath:J.filePath,line:_,column:F,ruleId:"no-super-linear-backtracking",message:V,severity:"error"})},z=[],Q=/\/\*[\s\S]*?\*\//g,G;while(G=Q.exec($))z.push({start:G.index,end:G.index+G[0].length});let q=/\/\/[^\n]*/g,U;while(U=q.exec($))z.push({start:U.index,end:U.index+U[0].length});let W;while(W=X.exec($)){let K=W[0],H=W.index;if(z.some((B)=>H>=B.start&&H<B.end))continue;if(H>0){let B=$[H-1];if(B===")"||B==="]"||B==="."||/[\w$]/.test(B))continue;let j=K.slice(1,K.lastIndexOf("/"));if(/^\s+\w/.test(j)&&/\w\s*\)/.test(j))continue}let A=K.slice(1,K.lastIndexOf("/")).replace(/\[.*?\]/g,"");if(A.includes(".+?\\s*")||A.includes("\\s*.+?")||A.includes(".*\\s*")||A.includes("\\s*.*")){Y(H,K.length,"The combination of ' .*' or ' .+?' with '\\s*' can cause super-linear backtracking due to exchangeable characters");continue}let F=A.replace(/\s+/g,"");if(/(?:\.\*\??){2,}/.test(F)||/(?:\.\+\??){2,}/.test(F)||/\.\*\??\.\+\?|\.\+\??\.\*\?/.test(F)){Y(H,K.length,"Multiple adjacent unlimited wildcard quantifiers can cause super-linear backtracking");continue}if(/\((?:\?:)?[^)]*?[+*][^)]*\)\s*[+*]/.test(A.replace(/\\[()]/g,"_"))){Y(H,K.length,"Nested unlimited quantifiers detected (e.g., (.+)+) which can cause catastrophic backtracking");continue}}return Z}};function aG($,J){let Z=J-1;while(Z>=0&&($[Z]===" "||$[Z]==="\t"))Z--;let X=Z>=0?$[Z]:"",Y="=(<>!&|?:;,{[+(~^%*/";if(!(Z<0||Y.includes(X)||/\b(?:return|typeof|void|delete|throw|new|in|of|case)\s*$/.test($.slice(Math.max(0,Z-5),Z+1))))return null;let Q=J+1,G=!1,q=!1,U=-1;while(Q<$.length){let _=$[Q];if(q)q=!1;else if(_==="\\")q=!0;else if(_==="["){if(!G)G=!0}else if(_==="]"){if(G)G=!1}else if(_==="/"&&!G){U=Q;break}else if(_===`
|
|
126
126
|
`)break;Q++}if(U<=J)return null;let W=$.slice(J+1,U),K=U+1;while(K<$.length&&/[gimsuvy]/.test($[K]))K++;if(/\\[1-9]/.test(W))return null;let H=0,V=-1,A=!1;for(let _=0;_<W.length;_++){if(W[_]==="\\"){_++;continue}if(W[_]==="["&&!A){A=!0;continue}if(W[_]==="]"&&A){A=!1;continue}if(A)continue;if(W[_]==="("&&W.slice(_+1,_+3)!=="?:"&&W.slice(_+1,_+3)!=="?="&&W.slice(_+1,_+3)!=="?!"&&W.slice(_+1,_+4)!=="?<="&&W.slice(_+1,_+4)!=="?<!"){if(V<0)V=_;H++}}if(H===0)return null;return{patternStart:J,patternEnd:K,pattern:W,capCount:H,firstCapOffset:V}}function sG($,J,Z){let X=Z;while(X<$.length&&($[X]===" "||$[X]==="\t"))X++;if($[X]==="."){let q=$.slice(X+1,X+20);if(/^test\s*\(/.test(q))return!1;if(/^exec\s*\(/.test(q))return!0}let Y=J-1;while(Y>=0&&($[Y]===" "||$[Y]==="\t"))Y--;if($[Y]==="("){let U=Y-1;while(U>=0&&($[U]===" "||$[U]==="\t"))U--;let W=$.slice(Math.max(0,U-20),U+1);if(/\.match\s*$/.test(W))return!0;if(/\.matchAll\s*$/.test(W))return!0;if(/\.exec\s*$/.test(W))return!0;if(/\.replace\s*$/.test(W))return!0;if(/\.replaceAll\s*$/.test(W))return!0;if(/\.split\s*$/.test(W))return!0;if(/\.search\s*$/.test(W))return!1;if(/\.test\s*$/.test(W))return!1}let z=$.lastIndexOf(`
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{b as a,c as b,d as c,e as d,f as e,g as f}from"./chunk-
|
|
2
|
+
import{b as a,c as b,d as c,e as d,f as e,g as f}from"./chunk-db1t9ezz.js";import"./chunk-cbqydxbp.js";import"./chunk-5wzkpgv6.js";import"./chunk-h6ac3d60.js";export{d as scanContentOptimized,e as scanContent,b as runLintProgrammatic,f as runLint,a as lintText,c as applyPlugins};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{h as a}from"./chunk-
|
|
2
|
+
import{h as a}from"./chunk-34yzzbec.js";import"./chunk-cbqydxbp.js";import"./chunk-5wzkpgv6.js";import"./chunk-h6ac3d60.js";export{a as runUnified};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import"./chunk-h6ac3d60.js";var e="pickier",u="module",t="0.1.
|
|
2
|
+
import"./chunk-h6ac3d60.js";var e="pickier",u="module",t="0.1.40",r="Format, lint and more in a fraction of seconds.",s="Chris Breuer <chris@stacksjs.org>",l="MIT",p="https://github.com/pickier/pickier#readme",b={type:"git",url:"git+https://github.com/pickier/pickier.git"},m={url:"https://github.com/pickier/pickier/issues"},c=["pickier","linter","formatter","bun","fast"],o={".":{types:"./dist/index.d.ts",import:"./dist/src/index.js"},"./*":{import:"./dist/*"}},a="./dist/src/index.js",x="./dist/index.d.ts",d={pickier:"./dist/bin/cli.js"},w=["README.md","dist"],k={build:"bun --bun build.ts","build:bin":"bun --bun build.ts && bun run compile",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 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"},I={"@stacksjs/clarity":"^0.3.24","@stacksjs/clapp":"^0.2.3"},O={"@stacksjs/ts-spell-check":"^0.1.0"},_={bunfig:"^0.15.13"},z={name:e,type:u,version:t,description:r,author:s,license:l,homepage:p,repository:b,bugs:m,keywords:c,exports:o,module:a,types:x,bin:d,files:w,scripts:k,dependencies:I,optionalDependencies:O,devDependencies:_};export{t as version,x as types,u as type,k as scripts,b as repository,O as optionalDependencies,e as name,a as module,l as license,c as keywords,p as homepage,w as files,o as exports,_ as devDependencies,r as description,I as dependencies,z as default,m as bugs,d as bin,s as author};
|
package/dist/src/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{a as t,b as f,c as m,g as e}from"../chunk-
|
|
2
|
+
import{a as t,b as f,c as m,g as e}from"../chunk-db1t9ezz.js";import{h as x}from"../chunk-34yzzbec.js";import{A as F,B as G,C as H,D as I,E as J,F as K,G as M,H as N,k as O,l as P,m as R,n as T,o as U,p as a,q as b,r as j,s as q,t as v,u as w,v as z,w as A,x as B,y as D,z as E}from"../chunk-cbqydxbp.js";import{I as r,K as o}from"../chunk-5wzkpgv6.js";import"../chunk-h6ac3d60.js";export{B as yellow,N as shouldIgnorePath,m as runLintProgrammatic,e as runLint,t as runFormat,x as run,A as red,H as mergeConfig,I as loadConfigFromPath,f as lintText,K as isCodeFile,R as hasIndentIssue,z as green,E as gray,a as glob,v as getRuleSetting,T as formatImports,O as formatCode,J as expandPatterns,P as detectQuoteIssues,r as defaultConfig,b as createLimiter,M as createIgnoreMatcher,o as config,G as colors,w as colorize,F as bold,D as blue,q as UNIVERSAL_IGNORES,U as MAX_FIXER_PASSES,j as ENV};
|