pickier 0.1.51 → 0.1.53
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-05f5gzwf.js +2 -0
- package/dist/chunk-3wr40yqq.js +2 -0
- package/dist/{chunk-h6ac3d60.js → chunk-43fsk0jg.js} +1 -1
- package/dist/{chunk-4y1ghfcd.js → chunk-49t2br1w.js} +1 -1
- package/dist/chunk-55vrfsnk.js +33 -0
- package/dist/{chunk-r9eg8qnv.js → chunk-78a1vyw0.js} +1 -1
- package/dist/chunk-7dqgks41.js +2 -0
- package/dist/{chunk-bf2bz66g.js → chunk-ah6h41gy.js} +2 -2
- package/dist/{chunk-88xjkex3.js → chunk-v1x7hdmp.js} +1 -1
- package/dist/{chunk-4hd6x4ne.js → chunk-zwqq3b8y.js} +158 -159
- package/dist/src/index.js +1 -1
- package/dist/utils.d.ts +25 -0
- package/package.json +1 -1
- package/dist/chunk-1r3qehn7.js +0 -33
- package/dist/chunk-b0ger4k1.js +0 -2
- package/dist/chunk-vn8ayn2e.js +0 -2
- package/dist/chunk-z91s0hcd.js +0 -2
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-zwqq3b8y.js";import{h as x}from"../chunk-78a1vyw0.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,I as Q,J as S,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-55vrfsnk.js";import{K as r,M as o}from"../chunk-ah6h41gy.js";import"../chunk-43fsk0jg.js";export{D as yellow,N as withAlwaysIgnores,S as shouldIgnorePath,m as runLintProgrammatic,e as runLint,t as runFormat,x as run,B as red,I as mergeConfig,J as loadConfigFromPath,f as lintText,M as isCodeFile,R as hasIndentIssue,A as green,F as gray,a as glob,w as getRuleSetting,T as formatImports,O as formatCode,K as expandPatterns,P as detectQuoteIssues,r as defaultConfig,b as createLimiter,Q as createIgnoreMatcher,o as config,H as colors,z as colorize,G as bold,E as blue,v as UNIVERSAL_IGNORES,U as MAX_FIXER_PASSES,j as ENV,q as ALWAYS_IGNORES};
|
package/dist/utils.d.ts
CHANGED
|
@@ -32,6 +32,12 @@ export declare function mergeConfig(base: PickierConfig, override: PickierOption
|
|
|
32
32
|
export declare function loadConfigFromPath(pathLike: string | undefined): Promise<PickierConfig>;
|
|
33
33
|
export declare function expandPatterns(patterns: string[]): string[];
|
|
34
34
|
export declare function isCodeFile(file: string, allowedExts: Set<string>): boolean;
|
|
35
|
+
/**
|
|
36
|
+
* A project's ignore list, with the never-lintable paths guaranteed to be in
|
|
37
|
+
* it. See {@link ALWAYS_IGNORES}: a project that sets `ignores` replaces the
|
|
38
|
+
* defaults, and the two entries nobody meant to opt out of went with them.
|
|
39
|
+
*/
|
|
40
|
+
export declare function withAlwaysIgnores(ignores: readonly string[]): string[];
|
|
35
41
|
/**
|
|
36
42
|
* Build a reusable matcher for ignore checks.
|
|
37
43
|
*
|
|
@@ -52,6 +58,25 @@ export declare function shouldIgnorePath(absPath: string, ignoreGlobs: string[])
|
|
|
52
58
|
*/
|
|
53
59
|
export declare const MAX_FIXER_PASSES: 5;
|
|
54
60
|
export declare const ENV: EnvConfig;
|
|
61
|
+
/**
|
|
62
|
+
* Paths that are never anybody's source, and are therefore ignored no matter
|
|
63
|
+
* what a project's config says.
|
|
64
|
+
*
|
|
65
|
+
* A project that sets `ignores` REPLACES the defaults — which is what you want
|
|
66
|
+
* for a list of the project's own directories, and a trap for the two entries
|
|
67
|
+
* nobody meant to opt out of. Every stacks app ships a `config/code-style.ts`
|
|
68
|
+
* with an `ignores` array, so every stacks app was linting its dependencies:
|
|
69
|
+
* `node_modules` was in the defaults, the project list did not repeat it, and
|
|
70
|
+
* the defaults were gone. Nothing in the output says "these 40,000 findings are
|
|
71
|
+
* in code you did not write" — it just gets slower and noisier, and a rule that
|
|
72
|
+
* fires inside a published package is one nobody can act on.
|
|
73
|
+
*
|
|
74
|
+
* Deliberately just these. `dist`, `coverage`, `.github` and the rest stay
|
|
75
|
+
* overridable, because linting your own build output or your workflows is a
|
|
76
|
+
* reasonable thing to want. Nothing reasonable wants to lint `node_modules` or
|
|
77
|
+
* the object database in `.git`.
|
|
78
|
+
*/
|
|
79
|
+
export declare const ALWAYS_IGNORES: readonly string[];
|
|
55
80
|
/**
|
|
56
81
|
* Universal ignore patterns that should apply everywhere.
|
|
57
82
|
* These are always excluded regardless of project-specific config.
|
package/package.json
CHANGED
package/dist/chunk-1r3qehn7.js
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{I as P}from"./chunk-bf2bz66g.js";import{L as F0}from"./chunk-h6ac3d60.js";function qZ($){let Y=$.length,V=Array.from({length:Y},(X,J)=>$[J]),Z=0;while(Z<Y){let X=$[Z];if(X==="#"&&(Z===0||/\s/.test($[Z-1]))){while(Z<Y)V[Z]=" ",Z++;break}if(X==="$"&&$[Z+1]==="'"){Z+=2;while(Z<Y){if($[Z]==="\\"&&Z+1<Y){V[Z]=" ",V[Z+1]=" ",Z+=2;continue}if($[Z]==="'"){Z++;break}V[Z]=" ",Z++}continue}if(X==="$"&&$[Z+1]==='"'){Z++,Z=x($,Z,V);continue}if(X==="$"&&$[Z+1]==="{"){Z+=2;let J=1;while(Z<Y&&J>0){let H=$[Z];if(H==="\\"&&Z+1<Y){V[Z]=" ",V[Z+1]=" ",Z+=2;continue}if(H==="'"){Z++;while(Z<Y&&$[Z]!=="'")V[Z]=" ",Z++;if(Z<Y)Z++;continue}if(H==='"'){Z=x($,Z,V);continue}if(H==="{"){J++,Z++;continue}if(H==="}"){J--,Z++;continue}V[Z]=" ",Z++}continue}if(X==="$"&&$[Z+1]==="("&&$[Z+2]==="("){Z+=3;let J=2;while(Z<Y&&J>0){let H=$[Z];if(H==="("){J++,Z++;continue}if(H===")"){J--,Z++;continue}V[Z]=" ",Z++}continue}if(X==="$"&&$[Z+1]==="("){Z+=2;let J=1;while(Z<Y&&J>0){let H=$[Z];if(H==="\\"&&Z+1<Y){V[Z]=" ",V[Z+1]=" ",Z+=2;continue}if(H==="'"){Z++;while(Z<Y&&$[Z]!=="'")V[Z]=" ",Z++;if(Z<Y)Z++;continue}if(H==='"'){Z=x($,Z,V);continue}if(H==="("){J++,Z++;continue}if(H===")"){J--,Z++;continue}V[Z]=" ",Z++}continue}if(X==="'"){Z++;while(Z<Y&&$[Z]!=="'")V[Z]=" ",Z++;if(Z<Y)Z++;continue}if(X==='"'){Z=x($,Z,V);continue}if(X==="`"){Z++;while(Z<Y&&$[Z]!=="`"){if($[Z]==="\\"&&Z+1<Y){V[Z]=" ",V[Z+1]=" ",Z+=2;continue}V[Z]=" ",Z++}if(Z<Y)Z++;continue}Z++}return V.join("")}function x($,Y,V){let Z=$.length,X=Y+1;while(X<Z){let J=$[X];if(J==="\\"&&X+1<Z){V[X]=" ",V[X+1]=" ",X+=2;continue}if(J==='"')return X+1;if(J==="$"&&$[X+1]==="("&&$[X+2]==="("){X+=3;let H=2;while(X<Z&&H>0){let U=$[X];if(U==="("){H++,X++;continue}if(U===")"){H--,X++;continue}V[X]=" ",X++}continue}if(J==="$"&&$[X+1]==="("){X+=2;let H=1;while(X<Z&&H>0){let U=$[X];if(U==="\\"&&X+1<Z){V[X]=" ",V[X+1]=" ",X+=2;continue}if(U==="'"){X++;while(X<Z&&$[X]!=="'")V[X]=" ",X++;if(X<Z)X++;continue}if(U==='"'){X=x($,X,V);continue}if(U==="("){H++,X++;continue}if(U===")"){H--,X++;continue}V[X]=" ",X++}continue}if(J==="$"&&$[X+1]==="{"){X+=2;let H=1;while(X<Z&&H>0){let U=$[X];if(U==="{"){H++,X++;continue}if(U==="}"){H--,X++;continue}V[X]=" ",X++}continue}V[X]=" ",X++}return X}function o($){let V=qZ($).match(/<<-?/);if(!V||V.index===void 0)return null;let X=$.slice(V.index+V[0].length).match(/^\s*(['"]?)(\w+)\1/);if(!X)return null;return X[2]}var QZ=new Set([".ts",".js"]),KZ=new Set([".json",".jsonc"]),FZ=new Set([".yaml",".yml"]),zZ=new Set([".sh",".bash",".zsh",".ksh",".dash"]),BZ=/^#!\s*(?:\/usr\/bin\/env\s+)?(?:ba|z|k|da)?sh\b/;var GZ=/^[}\])]/,DZ=/[{[(]\s*$/,yZ=/\s*\/\/.*$/,MZ=/^(?:if|else\s+if|for|while)\s*\(/,AZ=/^(?:\.[\w$[]|\?[\s.:]|:\s|&&|\|\|)/;function OZ($){let Y=MZ.exec($);if(!Y)return/^(?:else|do)\s*$/.test($);let V=0,Z=null;for(let X=Y[0].length-1;X<$.length;X++){let J=$[X];if(Z){if(J==="\\"){X++;continue}if(J===Z)Z=null;continue}if(J==="'"||J==='"'||J==="`"){Z=J;continue}if(J==="(")V++;else if(J===")"){if(V--,V===0)return $.slice(X+1).trim().length===0}}return!1}var NZ=/^\s*for\s*\(/,jZ=new RegExp("^\\s*;\\s*$"),IZ=new RegExp(";{2,}\\s*$"),RZ=/([\w)])\{/g,wZ=/\{(return|if|for|while|switch|const|let|var|function)\b/g,LZ=/,(\S)/g,vZ=/(?<![=!<>+\-*/%&|^?])=(?![=><])/g,PZ=/(\w)\+(\w)/g,_Z=/(\w)-(\w)/g,TZ=/(\w)\*(\w)/g,CZ=/(\w)\/(\w)/g,EZ=new RegExp("(?<=\\S);([^\\s;])","g"),xZ=/([\w)\]])<(\d)/g,kZ=/([\w)\]])>(\d)/g,a=/\s{2,}/g,l=/^\s*$/,SZ=/^\s*\/\//,r=/^\s*\/\*/,bZ=/^\s*import\b/,s=/\bfrom\s*['"][^'"]+['"]|^\s*import\s+['"][^'"]+['"]/,fZ=/package\.json$/i,hZ=/[jt]sconfig(?:\..+)?\.json$/i,f=/[ \t]+$/,gZ=/^\n+/;function S($){let Y=$.lastIndexOf(".");return Y>=0?$.slice(Y):""}function h($){return QZ.has(S($))}function mZ($){return KZ.has(S($))}function uZ($){return FZ.has(S($))}function cZ($){return zZ.has(S($))}function pZ($,Y){return cZ($)||BZ.test(Y)}function dZ($,Y){let V=$.split(`
|
|
3
|
-
`),Z=V.length,X=Array(Z),J=Y.format.indent,H=Y.format.indentStyle==="tabs",U=0,Q=!1,F="",z=!1,G=0;for(let W=0;W<Z;W++){let D=V[W];if(D.length===0||/^\s*$/.test(D)){X[W]="";continue}if(Q){if(X[W]=D,D.trim()===F)Q=!1,F="";continue}let M=o(D);if(M)Q=!0,F=M;let A=0;while(A<D.length&&(D.charCodeAt(A)===32||D.charCodeAt(A)===9))A++;let B=D.slice(A).trimEnd();if(B.startsWith("#")&&W>0){let E=H?"\t".repeat(U):" ".repeat(U*J);X[W]=E+B;continue}if(/^case\b/.test(B)&&/\bin\s*$/.test(B))G++,z=!0;if(/^esac\b/.test(B)){if(G=Math.max(0,G-1),G===0)z=!1}let j=z&&/\)\s*$/.test(B)&&!/\$\(/.test(B)&&!/^\s*\(/.test(B)&&!B.startsWith("#"),I=/^;[;&]\s*$/.test(B);if(/^(?:fi|done|esac|elif|else)\b/.test(B)||/^\}/.test(B))U=Math.max(0,U-1);if(I)U=Math.max(0,U-1);let C=H?"\t".repeat(U):" ".repeat(U*J);if(X[W]=C+B,/^then\b/.test(B)||/^do\b/.test(B)||/^else\b/.test(B))U++;else if(/^if\b/.test(B)&&/\bthen\s*$/.test(B))U++;else if(/^elif\b/.test(B)&&/\bthen\s*$/.test(B))U++;else if(/^(?:while|for|until)\b/.test(B)&&/\bdo\s*$/.test(B))U++;else if(/^case\b/.test(B)&&/\bin\s*$/.test(B))U++;else if(j)U++;else if(/\{\s*$/.test(B)&&!B.startsWith("#"))U++}return X.join(`
|
|
4
|
-
`)}function oZ($,Y){try{let V=Bun.YAML.parse($),Z=Y.format.indentStyle==="tabs"?"\t":Y.format.indent;return Bun.YAML.stringify(V,null,Z).split(`
|
|
5
|
-
`).map((J)=>J.replace(/[ \t]+$/,"")).join(`
|
|
6
|
-
`)}catch{return $}}function aZ($){return" ".repeat(Math.max(0,$))}function lZ($,Y){if((Y.format.indentStyle||"spaces")==="tabs")return"\t".repeat(Math.max(0,$));return aZ(Math.max(0,$*Y.format.indent))}function rZ($){return`'${$.slice(1,-1).replace(/\\"/g,'"')}'`}function sZ($){return`"${$.slice(1,-1).replace(/\\'/g,"'")}"`}function nZ($,Y){for(let V=0;V<$.length;V++){if($[V]==="\\"){V++;continue}if($[V]===Y)return!0}return!1}function tZ($,Y,V){if(!h(V))return $;let Z=$.split(`
|
|
7
|
-
`);for(let X=0;X<Z.length;X++)Z[X]=e(Z[X],Y);return Z.join(`
|
|
8
|
-
`)}function e($,Y){let V=Y==="single";if(V?!$.includes('"'):!$.includes("'"))return $;let Z=[],X=0,J=0,H=0,U=0;while(X<$.length){let Q=$[X];if(H===0){if(Q==="/"){let F=$[X+1];if(F==="/")break;if(F==="*"){let z=$.indexOf("*/",X+2);X=z===-1?$.length:z+2;continue}if(VZ($,X)){let z=XZ($,X);if(z!==-1){X=z;continue}}X++;continue}if(Q==='"'){H=2,U=X,X++;continue}if(Q==="'"){H=1,U=X,X++;continue}if(Q==="`"){H=3,X++;continue}X++}else if(H===3){if(Q==="\\"){X+=2;continue}if(Q==="`")H=0;X++}else{if(Q==="\\"){X+=2;continue}if(Q===(H===1?"'":'"')){let z=$.slice(U+1,X);if((H===2&&V||H===1&&!V)&&!nZ(z,V?"'":'"')){if(U>J)Z.push($.slice(J,U));if(H===2)Z.push(rZ(`"${z}"`));else Z.push(sZ(`'${z}'`));J=X+1}H=0,X++;continue}X++}}if(Z.length===0)return $;if(J<$.length)Z.push($.slice(J));return Z.join("")}var iZ=new Set(["{",",","=","+","-","*","/",";","<",">"]);function eZ($){if($.length<4)return $;let Y=0;while(Y<$.length&&($[Y]===" "||$[Y]==="\t"))Y++;if(Y<$.length){let H=$[Y];if(H==="/"&&($[Y+1]==="/"||$[Y+1]==="*"))return $;if(H==="*")return $}let V=!1;for(let H=Y;H<$.length;H++)if(iZ.has($[H])){V=!0;break}if(!V)return $;let{text:Z,strings:X}=X0($),J=Z;if(J=J.replace(RZ,"$1 {"),J=J.replace(wZ,"{ $1"),J=J.replace(LZ,", $1"),J=J.replace(vZ," = "),J=J.replace(PZ,"$1 + $2"),J=J.replace(_Z,"$1 - $2"),J=J.replace(TZ,"$1 * $2"),J=J.replace(CZ,"$1 / $2"),J=J.replace(EZ,"; $1"),J=J.replace(xZ,"$1 < $2"),J=J.replace(kZ,"$1 > $2"),Y>0){let H=J.slice(Y);J=J.slice(0,Y)+H.replace(a," ")}else J=J.replace(a," ");return X.length>0?Y0(J,X):J}function b($){let Y=$[$.length-1];return Y!==void 0&&Y.t==="tmpl"}function ZZ($,Y,V){Y++;while(Y<$.length){let Z=$[Y];if(Z==="\\"){Y+=2;continue}if(Z===V)return Y+1;Y++}return Y}function g($,Y){for(let Z of Y)if(Z.t==="tmpl")Z.start=-1;let V=0;while(V<$.length){let Z=Y[Y.length-1],X=$[V];if(Z===void 0||Z.t==="interp"){if(X==="`"){Y.push({t:"tmpl",start:V}),V++;continue}if(X==="'"||X==='"'){V=ZZ($,V,X);continue}if(X==="/"&&$[V+1]==="/")break;if(Z!==void 0){if(X==="{"){Z.braces++,V++;continue}if(X==="}"){if(Z.braces===0)Y.pop();else Z.braces--;V++;continue}}V++}else{if(X==="\\"){V+=2;continue}if(X==="`"){Y.pop(),V++;continue}if(X==="$"&&$[V+1]==="{"){Y.push({t:"interp",braces:0}),V+=2;continue}V++}}if(b(Y)){for(let Z of Y)if(Z.t==="tmpl"&&Z.start>=0)return Z.start}return-1}function n($,Y){let V=Y,Z=null,X=0;while(X<$.length){let J=$[X];if(V){if(J==="*"&&$[X+1]==="/"){V=!1,X+=2;continue}X++;continue}if(Z){if(J==="\\"){X+=2;continue}if(J===Z)Z=null;X++;continue}if(J==="'"||J==='"'||J==="`"){Z=J,X++;continue}if(J==="/"){if($[X+1]==="/")break;if($[X+1]==="*"){V=!0,X+=2;continue}}X++}return V}function Z0($,Y){let V=$.split(`
|
|
9
|
-
`),Z=V.length,X=Array(Z),J=Y.format.quotes,H=Y.format.semi===!0,U=0,Q=0,F=!1,z=[];for(let G=0;G<Z;G++){let W=V[G];if(F){F=n(W,!0),X[G]=W;continue}let D=b(z),M=-1;if(z.length>0||W.indexOf("`")!==-1)M=g(W,z);if(D){X[G]=W;continue}if(M<0&&z.length===0)F=n(W,!1);let A="",B=!1,j="";if(M>=0){A=W.slice(M);let L=W.slice(0,M);if(L.length===0){X[G]=A;continue}if(B=f.test(L),L.trim().length===0)j=L;W=L}if(W.length===0){X[G]="";continue}W=e(W,J);let I=0;while(I<W.length&&(W.charCodeAt(I)===32||W.charCodeAt(I)===9))I++;let R=W.slice(I).trimEnd();if(GZ.test(R))U=Math.max(0,U-1);let C=AZ.test(R)?1:0,E=W.slice(0,I);if(W=Y.format.preserveCodeIndentation?E+R:lZ(U+Q+C,Y)+R,DZ.test(R))U+=1,Q=0;else if(!R.startsWith("//")&&!R.startsWith("*")&&!R.startsWith("/*")){let L=R.replace(yZ,"");Q=OZ(L)?Q+1:0}if(W=eZ(W),H){if(!NZ.test(W))if(jZ.test(W))W="";else W=W.replace(IZ,";")}if(Y.format.trimTrailingWhitespace)W=W.trimEnd();if(M>=0){if(j)W=j;else if(B&&!f.test(W))W+=" ";W+=A}X[G]=W}return X.join(`
|
|
10
|
-
`)}function $0($,Y){let V=[],Z=0,X=[];for(let J of $){let H=b(X);if(X.length>0||J.indexOf("`")!==-1)g(J,X);if(H){V.push(J),Z=0;continue}if(J===""){if(Z++,Z<=Y)V.push("")}else Z=0,V.push(J)}return V}function _0($,Y,V){if($.length===0)return"";let X=($.includes("\r")?$.replace(/\r\n/g,`
|
|
11
|
-
`):$).split(`
|
|
12
|
-
`),J;if(Y.format.trimTrailingWhitespace){J=[];let F=0,z=Math.max(0,Y.format.maxConsecutiveBlankLines),G=[];for(let W of X){let D=b(G),M=!1;if(G.length>0||W.indexOf("`")!==-1)M=g(W,G)>=0;if(D||M){J.push(W),F=0;continue}let A=W[W.length-1],B=A===" "||A==="\t"?W.replace(f,""):W;if(B===""){if(F++,F<=z)J.push("")}else F=0,J.push(B)}}else J=$0(X,Math.max(0,Y.format.maxConsecutiveBlankLines));let H=J.join(`
|
|
13
|
-
`);if(H=H.replace(gZ,""),h(V))H=H0(H);if(uZ(V)){let F=oZ(H,Y);if(F!==H)H=F}if(mZ(V)){let F=q0(H,V);if(F!=null)H=F}if(pZ(V,H))H=dZ(H,Y);else if(h(V))H=Z0(H,Y);else H=tZ(H,Y.format.quotes,V);if(Y.format.finalNewline==="none")return H.replace(/\n+$/g,"");let U=/[^\n]\n$/.test(H)||H===`
|
|
14
|
-
`,Q=/\n\n$/.test(H);if(Y.format.finalNewline==="two"){if(Q)return H;if(U)return`${H}
|
|
15
|
-
`;return`${H}
|
|
16
|
-
|
|
17
|
-
`}if(Q)return H.replace(/\n\n$/,`
|
|
18
|
-
`);if(U)return H;return`${H}
|
|
19
|
-
`}function t($,Y,V,Z){for(let X=Y+1;X<$.length;X++){let J=$[X];if(J==="\\"){X++;continue}if(J===V)return!0;if(J===Z)return!1}return!0}function T0($,Y){if(/^\s*\/\/\/\s*<reference/.test($))return[];let V=[],Z=null,X=!1;for(let J=0;J<$.length;J++){let H=$[J];if(X){X=!1;continue}if(H==="\\"){X=!0;continue}if(!Z){if(H==="/"&&$[J+1]==="/")break;if(H==="'"){if(Y==="double"&&t($,J,"'",'"'))V.push(J);Z="single";continue}else if(H==='"'){if(Y==="single"&&t($,J,'"',"'"))V.push(J);Z="double";continue}else if(H==="`"){Z="template";continue}}else if(Z==="single"&&H==="'"||Z==="double"&&H==='"'||Z==="template"&&H==="`"){Z=null;continue}}return V}function C0($,Y,V="spaces",Z){if(V==="tabs")return/[^\t]/.test($);if(/\t/.test($))return!0;let X=$.length;if(Z&&X%Y===1){let J=Z.trimStart();if(J.startsWith("* ")||J.startsWith("*/")||J==="*")return!1}return X%Y!==0}function $Z($,Y){let V=Y+1;while(V<$.length){let Z=$[V];if(Z==="\\"){V+=2;continue}if(Z==="`")return V+1;if(Z==="$"&&$[V+1]==="{"){V+=2;let X=1;while(V<$.length&&X>0){let J=$[V];if(J==="\\"){V+=2;continue}if(J==="`"){V=$Z($,V);continue}if(J==="'"||J==='"'){V=ZZ($,V,J);continue}if(J==="{")X++;else if(J==="}")X--;V++}continue}V++}return V}var V0=new Set(["return","typeof","instanceof","in","of","new","delete","void","do","else","case","yield","await"]);function VZ($,Y){let V=Y-1;while(V>=0&&($[V]===" "||$[V]==="\t"))V--;if(V<0)return!0;let Z=$[V];if("(,=:[!&|?;{}<>+-*%^~".includes(Z))return!0;if(/[\w$]/.test(Z)){let X=V;while(X>=0&&/[\w$]/.test($[X]))X--;return V0.has($.slice(X+1,V+1))}return!1}function XZ($,Y){let V=Y+1,Z=!1,X=-1;while(V<$.length){let J=$[V];if(J==="\\"){V+=2;continue}if(J==="["&&!Z)Z=!0,X=V;else if(J==="]"&&Z){let H=$[X+1]==="^"?X+2:X+1;if(V!==H)Z=!1}else if(J==="/"&&!Z){V++;while(V<$.length&&/[a-z]/i.test($[V]))V++;return V}V++}return-1}function X0($){if(!$.includes("'")&&!$.includes('"')&&!$.includes("`")&&!$.includes("/"))return{text:$,strings:[]};let Y=[],V=[],Z=0,X=0;while(Z<$.length){let J=$[Z];if(J==="/"){let H=$[Z+1];if(H==="/"){if(Z>X)V.push($.slice(X,Z));Y.push($.slice(Z)),V.push(`@@S${Y.length-1}@@`),X=$.length;break}if(H==="*"){let U=$.indexOf("*/",Z+2),Q=U===-1?$.length:U+2;if(Z>X)V.push($.slice(X,Z));Y.push($.slice(Z,Q)),V.push(`@@S${Y.length-1}@@`),Z=Q,X=Z;continue}if(VZ($,Z)){let U=XZ($,Z);if(U!==-1){if(Z>X)V.push($.slice(X,Z));Y.push($.slice(Z,U)),V.push(`@@S${Y.length-1}@@`),Z=U,X=Z;continue}}Z++;continue}if(J==="'"||J==='"'||J==="`"){if(Z>X)V.push($.slice(X,Z));let H=Z;if(J==="`")Z=$Z($,Z);else{let U=J;Z++;while(Z<$.length){if($[Z]==="\\"){Z+=2;continue}if($[Z]===U){Z++;break}Z++}}Y.push($.slice(H,Z)),V.push(`@@S${Y.length-1}@@`),X=Z;continue}Z++}if(X<$.length)V.push($.slice(X));return{text:V.join(""),strings:Y}}function Y0($,Y){if(Y.length===0)return $;return $.replace(/@@S(\d+)@@/g,(V,Z)=>Y[Number(Z)]??"")}function J0($){let Y=new Set,V=/[$A-Z_][\w$]*/gi,Z=V.exec($);while(Z!==null)Y.add(Z[0]),Z=V.exec($);return Y}function H0($){let Y=$[0];if(Y!=="i"&&Y!==" "&&Y!=="\t"&&Y!=="/"&&Y!==`
|
|
20
|
-
`)return $;let V=$.split(`
|
|
21
|
-
`),Z=[],X=[],J=[],H=0,U=0,Q=-1,F=!1;while(H<V.length){let q=V[H];if(l.test(q)){H++;continue}if(SZ.test(q)||r.test(q)){let y=H;if(r.test(q)){while(H<V.length&&!V[H].includes("*/"))H++;H++}else H++;if(!F){for(let w=y;w<H&&w<V.length;w++)X.push(V[w]);U=H}else if(Q<0)Q=y;continue}if(!bZ.test(q))break;let K=q.trim(),N=H+1;while(!s.test(K)&&N<V.length&&N-H<50)K+=` ${V[N].trim()}`,N++;if(!s.test(K))return $;let O=W0(K);if(!O)return $;if(Q>=0){for(let y=Q;y<H;y++)if(!l.test(V[y]))J.push(V[y]);Q=-1}Z.push(O),H=N,U=H,F=!0}if(Z.length===0)return $;let z=Q>=0?Q:U,G=V.slice(z).join(`
|
|
22
|
-
`),W=J0(G),D=(q)=>W.has(q);for(let q of Z){if(q.kind!=="value")continue;q.named=q.named.filter((K)=>{if(K.alias)return!0;return D(K.name)})}let M=Z.filter((q)=>{if(q.kind==="side-effect")return!0;if(q.kind==="type")return q.namedTypes.length>0;return Boolean(q.defaultName||q.namespaceName||q.named.length>0)}),A=new Map;for(let q of M){let K=A.get(q.source)||{};if(q.kind==="side-effect")K.side=K.side||[],K.side.push(q);else if(q.kind==="type"){if(!K.type)K.type={kind:"type",source:q.source,named:[],namedTypes:[],original:""};K.type.namedTypes=(K.type.namedTypes||[]).concat(q.namedTypes)}else{if(!K.value)K.value={kind:"value",source:q.source,named:[],namedTypes:[],original:""};if(q.defaultName)K.value.defaultName=q.defaultName;if(q.namespaceName)K.value.namespaceName=q.namespaceName;if(K.value.named=(K.value.named||[]).concat(q.named),q.namedTypes.length>0){if(!K.type)K.type={kind:"type",source:q.source,named:[],namedTypes:[],original:""};K.type.namedTypes=K.type.namedTypes.concat(q.namedTypes)}}A.set(q.source,K)}let B=[];for(let[q,K]of A){if(K.side)B.push(...K.side);if(K.value){let N=(O)=>{if(!O.alias)return O;return/^[A-Z]$/i.test(O.name)&&/^[A-Z]$/i.test(O.alias)?{name:O.alias,alias:O.name}:O};K.value.named=K.value.named.map(N),K.value.named.sort((O,y)=>O.name.localeCompare(y.name)),B.push(K.value)}if(K.type&&K.type.namedTypes.length>0){let N=new Set,O=(y)=>{if(!y.alias)return y;return/^[A-Z]$/i.test(y.name)&&/^[A-Z]$/i.test(y.alias)?{name:y.alias,alias:y.name}:y};K.type.namedTypes=K.type.namedTypes.map(O).filter((y)=>{let w=`${y.name}|${y.alias||""}`;if(N.has(w))return!1;return N.add(w),!0}),K.type.namedTypes.sort((y,w)=>y.name.localeCompare(w.name)),B.push(K.type)}}let j=(q)=>q.startsWith(".")?2:q.startsWith("node:")?0:1,I=(q)=>{if(q.kind!=="value")return 99;if(q.defaultName)return 0;if(q.namespaceName)return 1;return 2};B.sort((q,K)=>{if(q.kind!==K.kind){if(q.kind==="type")return-1;if(K.kind==="type")return 1;if(q.kind==="side-effect")return-1;if(K.kind==="side-effect")return 1}if(q.kind==="type"&&K.kind==="type"){let N=j(q.source),O=j(K.source);if(N!==O)return N-O;return q.source.localeCompare(K.source)}if(q.kind==="value"&&K.kind==="value"){let N=j(q.source),O=j(K.source);if(N!==O)return N-O;let y=I(q),w=I(K);if(y!==w)return y-w;return q.source.localeCompare(K.source)}return q.source.localeCompare(K.source)});let R=X.length>0?`${X.join(`
|
|
23
|
-
`)}
|
|
24
|
-
`:"";if(B.length===0){let q=G.replace(/^\n+/,""),K=[...J];if(R||K.length>0)return`${R}${K.length>0?`${K.join(`
|
|
25
|
-
`)}
|
|
26
|
-
`:""}${q}`;return q}let C=B.map(U0).join(`
|
|
27
|
-
`),E=J.length>0?`
|
|
28
|
-
${J.join(`
|
|
29
|
-
`)}`:"",L=G.replace(/^\n+/,""),WZ=L.length>0?`
|
|
30
|
-
|
|
31
|
-
`:`
|
|
32
|
-
`;return`${R}${C}${E}${WZ}${L}`}function U0($){if($.kind==="side-effect")return`import '${$.source}'`;if($.kind==="type")return`import type { ${$.namedTypes.map((X)=>X.alias?`${X.name} as ${X.alias}`:X.name).join(", ")} } from '${$.source}'`;let Y=[];if($.defaultName)Y.push($.defaultName);if($.namespaceName)Y.push(`* as ${$.namespaceName}`);if($.named.length>0){let Z=$.named.map((X)=>X.alias?`${X.name} as ${X.alias}`:X.name).join(", ");Y.push(`{ ${Z} }`)}return`import ${Y.join(", ")} from '${$.source}'`}function W0($){let Y=$.match(/^\s*import\s+['"]([^'"]+)['"]/);if(Y)return{kind:"side-effect",source:Y[1],named:[],namedTypes:[],original:$};if(Y=$.match(/^\s*import\s+type\s+\{([^}]*)\}\s+from\s+['"]([^'"]+)['"]/),Y){let W=Y[1],D=Y[2],M=W.split(",").map((A)=>A.trim()).filter(Boolean).map((A)=>{let B=A.match(/^(\w+)(?:\s+as\s+(\w+))?$/);return{name:B?.[1]||A,alias:B?.[2]}});return{kind:"type",source:D,named:[],namedTypes:M,original:$}}let V=$.match(/^\s*import\s+/),Z=new RegExp(`\\sfrom\\s+['"]([^'"]+)['"]\\s*;?$`),X=$.match(Z);if(!V||!X)return;let J=X[1],H=$.slice(V[0].length,X.index).trim(),U,Q,F=[],z=[],G=H.match(/\{([^}]*)\}/);if(G){let D=G[1].split(",").map((M)=>M.trim()).filter(Boolean);for(let M of D){let A=/^type\s+/.test(M),j=M.replace(/^type\s+/,"").match(/^(\w+)(?:\s+as\s+(\w+))?$/);if(!j)continue;let I={name:j[1],alias:j[2]};if(A)z.push(I);else F.push(I)}H=H.replace(/\{[\s\S]*?\}/,"").trim()}if(H.length>0){let W=H.split(",").map((D)=>D.trim()).filter(Boolean);for(let D of W)if(D.startsWith("* as "))Q=D.slice(5).trim();else if(/^\w+$/.test(D))U=D}return{kind:"value",source:J,defaultName:U,namespaceName:Q,named:F,namedTypes:z,original:$}}function q0($,Y){if(fZ.test(Y))return Q0($);if(hZ.test(Y))return K0($);return null}function YZ($){try{return JSON.parse($)}catch{return null}}function k($,Y,V=[]){let Z={};for(let J of Y)if(Object.prototype.hasOwnProperty.call($,J))Z[J]=$[J];for(let J of V){let H=Object.keys($).filter((U)=>J.test(U)&&!(U in Z)).sort();for(let U of H)Z[U]=$[U]}let X=Object.keys($).filter((J)=>!(J in Z)).sort();for(let J of X)Z[J]=$[J];return Z}function i($){let Y={};for(let V of Object.keys($).sort())Y[V]=$[V];return Y}function Q0($){let Y=YZ($);if(!Y||typeof Y!=="object")return $;let Z=k(Y,["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(Z.files)){if(Z.files.every((H)=>typeof H==="string"))Z.files=[...Z.files].sort()}for(let J of Object.keys(Z))if(/^(?:dev|peer|optional|bundled)?[Dd]ependencies(?:Meta)?$/.test(J)||/^(?:resolutions|overrides|pnpm\.overrides)$/.test(J)){if(Z[J]&&typeof Z[J]==="object")Z[J]=i(Z[J])}if(Z.pnpm&&typeof Z.pnpm==="object"&&Z.pnpm.overrides&&typeof Z.pnpm.overrides==="object")Z.pnpm.overrides=i(Z.pnpm.overrides);if(Z.exports&&typeof Z.exports==="object"){let J=Z.exports,H=["types","import","require","default"];if(!Array.isArray(J)){let U={};for(let Q of Object.keys(J)){let F=J[Q];if(F&&typeof F==="object"&&!Array.isArray(F))U[Q]=k(F,H);else U[Q]=F}Z.exports=U}}let X=["pre-commit","prepare-commit-msg","commit-msg","post-commit","pre-rebase","post-rewrite","post-checkout","post-merge","pre-push","pre-auto-gc"];for(let J of["gitHooks","husky","simple-git-hooks"])if(Z[J]&&typeof Z[J]==="object")Z[J]=k(Z[J],X);return JSON.stringify(Z,null,2)}function K0($){let Y=YZ($);if(!Y||typeof Y!=="object")return $;let Z=k(Y,["extends","compilerOptions","references","files","include","exclude"]);if(Z.compilerOptions&&typeof Z.compilerOptions==="object"){let X=["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"];Z.compilerOptions=k(Z.compilerOptions,X)}return JSON.stringify(Z,null,2)}import{readdirSync as z0,readFileSync as B0,statSync as HZ}from"fs";import{extname as G0,isAbsolute as u,join as c,resolve as D0}from"path";import v from"process";var f0=5;function y0($){let Y="",V=0;while(V<$.length){let Z=$[V];if(Z==="*")if($[V+1]==="*"){if(Y+=".*",V+=2,$[V]==="/")V++}else Y+="[^/]*",V++;else if(Z==="?")Y+="[^/]",V++;else if(Z==="["){let X=$.indexOf("]",V);if(X===-1)Y+="\\[",V++;else Y+=$.slice(V,X+1),V=X+1}else if(".+^${}()|\\".includes(Z))Y+=`\\${Z}`,V++;else Y+=Z,V++}return new RegExp(`^${Y}$`)}function*UZ($,Y,V){let Z;try{Z=z0($)}catch{return}for(let X of Z){if(!V&&X.startsWith("."))continue;let J=c($,X);if(Y(J))continue;let H;try{H=HZ(J)}catch{continue}if(H.isDirectory())yield*UZ(J,Y,V);else yield J}}function*JZ($,Y,V,Z){yield*UZ($,d(Y,Z),V)}async function h0($,Y={}){let V=Y.cwd??v.cwd(),Z=Y.ignore??[],X=Y.dot??!1,J=Y.absolute??!0,H=d(Z,V);if(typeof globalThis.Bun?.Glob<"u"){let Q=globalThis.Bun.Glob,F=[];for(let z of $){let G=new Q(z);for await(let W of G.scan({cwd:V,dot:X,onlyFiles:Y.onlyFiles??!0,followSymlinks:!1})){let D=u(W)?W:c(V,W),M=D.startsWith(`${V}/`)?D.slice(V.length+1):D;if(H(D))continue;F.push(J?D:M)}}return F}let U=[];for(let Q of $){if(!/[*?[{]/.test(Q)){let z=u(Q)?Q:c(V,Q);try{if(!HZ(z).isDirectory()){let W=z.startsWith(`${V}/`)?z.slice(V.length+1):z;if(!H(z))U.push(J?z:W)}else for(let W of JZ(z,Z,X,V))U.push(J?W:W.startsWith(`${V}/`)?W.slice(V.length+1):W)}catch{}continue}let F=y0(Q);for(let z of JZ(V,Z,X,V)){let G=z.startsWith(`${V}/`)?z.slice(V.length+1):z;if(F.test(G)||F.test(G.replace(/\\/g,"/")))U.push(J?z:G)}}return U}function g0($){let Y=0,V=[],Z=()=>{if(V.length>0&&Y<$)Y++,V.shift()()};return(X)=>{return new Promise((J,H)=>{let U=()=>{X().then((Q)=>{Y--,J(Q),Z()},(Q)=>{Y--,H(Q),Z()})};if(Y<$)Y++,U();else V.push(U)})}}var M0={get TRACE(){return v.env.PICKIER_TRACE==="1"},get TIMEOUT_MS(){return Number(v.env.PICKIER_TIMEOUT_MS||"8000")},get RULE_TIMEOUT_MS(){return Number(v.env.PICKIER_RULE_TIMEOUT_MS||"5000")},get CONCURRENCY(){return Number(v.env.PICKIER_CONCURRENCY)||8},get DIAGNOSTICS(){return v.env.PICKIER_DIAGNOSTICS==="1"},get FAIL_ON_WARNINGS(){return v.env.PICKIER_FAIL_ON_WARNINGS==="1"},get NO_AUTO_CONFIG(){return v.env.PICKIER_NO_AUTO_CONFIG==="1"}},A0=["**/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 m0($,Y){let V=$[Y];if(V===void 0){let J=Y.indexOf("/");if(J>0){let H=Y.slice(0,J),U=Y.slice(J+1),Q=H==="general"?"pickier":H==="pickier"?"general":null;if(Q)V=$[`${Q}/${U}`];if(V===void 0)V=$[U]}}let Z,X;if(typeof V==="string"){if(V==="error")Z="error";else if(V==="warn"||V==="warning")Z="warning"}else if(Array.isArray(V)&&typeof V[0]==="string"){let J=V[0];if(J==="error")Z="error";else if(J==="warn"||J==="warning")Z="warning";X=V[1]}return{enabled:!!Z,severity:Z,options:X}}function T($,Y){return`\x1B[${$}m${Y}\x1B[0m`}function O0($){return T("32",$)}function N0($){return T("31",$)}function j0($){return T("33",$)}function I0($){return T("34",$)}function R0($){return T("90",$)}function w0($){return T("1",$)}var u0={green:O0,red:N0,yellow:j0,blue:I0,gray:R0,bold:w0};function _($,Y){let V=Y.ignores?[...new Set([...$.ignores||[],...Y.ignores])]:$.ignores,Z={...$.pluginRules||{},...Y.pluginRules||{}};if((Y.tailwind??$.tailwind)?.enabled&&!Object.prototype.hasOwnProperty.call(Z,"pickier/sort-tailwind-classes"))Z["pickier/sort-tailwind-classes"]="warn";return{...$,...Y,verbose:Y.verbose??$.verbose,ignores:V,lint:{...$.lint,...Y.lint||{}},format:{...$.format,...Y.format||{}},rules:{...$.rules,...Y.rules||{}},pluginRules:Z}}var m=null;async function c0($){if(!$){if(M0.NO_AUTO_CONFIG){if(!m)m=_(P,{});return m}try{let{getConfig:Z}=await import("./chunk-b0ger4k1.js"),X=await Z();return _(P,X)}catch{}return _(P,{})}let Y=u($)?$:D0(v.cwd(),$);if(G0(Y).toLowerCase()===".json")try{let Z=B0(Y,"utf8");return _(P,JSON.parse(Z))}catch{return console.warn(`[pickier:warn] Config file not found: ${Y}. Using default config values.`),_(P,{})}try{let Z=await import(Y);return _(P,Z.default||Z)}catch{return console.warn(`[pickier:warn] Config file not found: ${Y}. Using default config values.`),_(P,{})}}function p0($){return $.map((Y)=>{if(/[*?[\]{}()!]/.test(Y))return Y;if(/\.[A-Z0-9]+$/i.test(Y))return Y;return`${Y.replace(/\/$/,"")}/**/*`})}function d0($,Y){let V=$.lastIndexOf(".");if(V<0)return!1;let Z=$.slice(V);return Y.has(Z)}function p($){return $.replace(/\\/g,"/").replace(/\/+/g,"/")}function L0($){let Y=[];for(let V of $){let Z=p(V.trim());if(!Z)continue;let X=Z.match(/\*\*\/\*\.(.+)$/);if(X){Y.push({raw:Z,kind:"extension",value:X[1]});continue}let J=Z.match(/\*\*\/(.+?)\/\*\*$/);if(J){Y.push({raw:Z,kind:"segment",value:J[1]});continue}let H=Z.match(/\*\*\/(.+)$/);if(H)Y.push({raw:Z,kind:"suffix",value:H[1].replace(/\/$/,"")})}return Y}function d($,Y=v.cwd()){if($.length===0)return()=>!1;let V=L0($);if(V.length===0)return()=>!1;let Z=new Set(A0);return(X)=>{let J=p(X),H=p(Y).replace(/\/$/,""),U=J!==H&&!J.startsWith(`${H}/`),Q=U?J:J.slice(H.length);for(let F of V){if(U&&!Z.has(F.raw))continue;if(F.kind==="extension"){if(Q.endsWith(`.${F.value}`))return!0;continue}if(F.kind==="segment"||F.kind==="suffix"){let z=F.value;if(Q.includes(`/${z}/`)||Q.endsWith(`/${z}`))return!0}}return!1}}function o0($,Y){return d(Y)($)}
|
|
33
|
-
export{qZ as i,o as j,_0 as k,T0 as l,C0 as m,H0 as n,f0 as o,h0 as p,g0 as q,M0 as r,A0 as s,m0 as t,T as u,O0 as v,N0 as w,j0 as x,I0 as y,R0 as z,w0 as A,u0 as B,_ as C,c0 as D,p0 as E,d0 as F,d as G,o0 as H};
|
package/dist/chunk-b0ger4k1.js
DELETED
package/dist/chunk-vn8ayn2e.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{b as a,c as b,d as c,e as d,f as e,g as f}from"./chunk-4hd6x4ne.js";import"./chunk-1r3qehn7.js";import"./chunk-bf2bz66g.js";import"./chunk-h6ac3d60.js";export{d as scanContentOptimized,e as scanContent,b as runLintProgrammatic,f as runLint,a as lintText,c as applyPlugins};
|
package/dist/chunk-z91s0hcd.js
DELETED