pickier 0.1.51 → 0.1.52
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-3q1mrt7a.js +2 -0
- package/dist/chunk-3wr40yqq.js +2 -0
- package/dist/{chunk-h6ac3d60.js → chunk-43fsk0jg.js} +1 -1
- package/dist/{chunk-r9eg8qnv.js → chunk-4z3xb1dt.js} +1 -1
- package/dist/chunk-55vrfsnk.js +33 -0
- package/dist/{chunk-bf2bz66g.js → chunk-ah6h41gy.js} +2 -2
- package/dist/{chunk-4hd6x4ne.js → chunk-jb2f18gz.js} +151 -151
- package/dist/chunk-tb92tpyp.js +2 -0
- package/dist/{chunk-88xjkex3.js → chunk-v1x7hdmp.js} +1 -1
- package/dist/{chunk-4y1ghfcd.js → chunk-vfezn3em.js} +1 -1
- 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
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{b as a,c as b,d as c,e as d,f as e,g as f}from"./chunk-jb2f18gz.js";import"./chunk-55vrfsnk.js";import"./chunk-ah6h41gy.js";import"./chunk-43fsk0jg.js";export{d as scanContentOptimized,e as scanContent,b as runLintProgrammatic,f as runLint,a as lintText,c as applyPlugins};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import"./chunk-
|
|
2
|
+
import"./chunk-43fsk0jg.js";import{existsSync as EZ}from"fs";import HJ from"fs/promises";import CJ from"os";import KJ from"path";import p from"process";import{EventEmitter as IZ}from"events";import m from"process";import kJ from"process";import MJ from"process";import qJ from"process";import vJ from"process";import o from"process";import SJ from"tty";import zZ,{stdin as j0,stdout as G0}from"process";import*as c from"readline";import{ReadStream as yJ,WriteStream as H0}from"tty";import gJ,{stdin as P0,stdout as N0}from"process";import w0 from"readline";import A0 from"process";import S0 from"process";import{WriteStream as y0}from"tty";import f0 from"process";import xJ from"process";import d0 from"process";import{stripVTControlCharacters as WJ}from"util";import{existsSync as c0,lstatSync as dJ,readdirSync as p0}from"fs";import{dirname as uJ,join as i0}from"path";import n0 from"process";import b from"process";import e from"process";import{stripVTControlCharacters as DJ}from"util";import r0 from"process";import{Buffer as iJ}from"buffer";import y from"fs/promises";import a0 from"os";import XJ from"path";import w from"process";import{Readable as s0,Writable as t0}from"stream";class nJ{configPath;config=null;events=[];retryCount=0;maxRetries=3;retryDelayMs=1000;constructor(){let J=CJ.homedir(),Z=KJ.join(J,".config","clapp");this.configPath=KJ.join(Z,"telemetry.json")}async isEnabled(){if(p.env.DO_NOT_TRACK==="1"||p.env.DO_NOT_TRACK==="true")return!1;if(p.env.NO_TELEMETRY==="1"||p.env.NO_TELEMETRY==="true")return!1;return(await this.loadConfig()).enabled}async enable(){let J=await this.loadConfig();if(J.enabled=!0,!J.userId)J.userId=this.generateUserId();await this.saveConfig(J)}async disable(){let J=await this.loadConfig();J.enabled=!1,await this.saveConfig(J)}async track(J,Z){if(!await this.isEnabled())return;let Q={event:J,...Z,timestamp:Date.now(),platform:CJ.platform(),nodeVersion:p.version};if(this.events.push(Q),this.events.length>=10)await this.send()}async trackCommand(J,Z){await this.track("command",{command:J,duration:Z})}async trackError(J,Z){await this.track("error",{error:J,command:Z})}async send(){if(!await this.isEnabled()||this.events.length===0)return!0;try{this.events=[],this.retryCount=0;let Z=await this.loadConfig();return Z.lastSent=Date.now(),await this.saveConfig(Z),!0}catch{if(this.retryCount<this.maxRetries){this.retryCount++;let Z=this.retryDelayMs*2**(this.retryCount-1);return await this.sleep(Z),this.send()}return this.events=[],this.retryCount=0,!1}}async flush(){if(this.events.length===0)return!0;return this.send()}sleep(J){return new Promise((Z)=>setTimeout(Z,J))}async status(){let J=await this.loadConfig();return{enabled:J.enabled,doNotTrack:p.env.DO_NOT_TRACK==="1"||p.env.DO_NOT_TRACK==="true",eventsQueued:this.events.length,lastSent:J.lastSent}}async loadConfig(){if(this.config)return this.config;try{if(EZ(this.configPath)){let J=await HJ.readFile(this.configPath,"utf-8");return this.config=JSON.parse(J),this.config}}catch{}return this.config={enabled:!1},this.config}async saveConfig(J){this.config=J;try{let Z=KJ.dirname(this.configPath);await HJ.mkdir(Z,{recursive:!0}),await HJ.writeFile(this.configPath,JSON.stringify(J,null,2),"utf-8")}catch{}}generateUserId(){let J=Math.random().toString(36).substring(2,15),Z=Date.now().toString(36);return`${J}-${Z}`}}var Y$=new nJ;function AZ(J,Z={}){let $={_:[]},Q=Z.alias||{},Y=new Set(Z.boolean||[]),q={};for(let F of Object.keys(Q))for(let X of Q[F])q[X]=F;for(let F of Y)if(Q[F])for(let X of Q[F])Y.add(X);function U(F,X){let j=q[F]||F;if($[j]=X,Q[j])for(let G of Q[j])$[G]=X;if(q[F]&&Q[q[F]])for(let G of Q[q[F]])$[G]=X;$[F]=X}for(let F=0;F<J.length;F++){let X=J[F];if(X==="--"){$._.push(...J.slice(F+1));break}if(X.startsWith("--")){let j=X.indexOf("=");if(j!==-1){let G=X.slice(2,j),V=X.slice(j+1);U(G,V)}else{let G=X.slice(2);if(G.startsWith("no-")){let W=G.slice(3);U(W,!1);continue}let V=q[G]||G;if(Y.has(V)||Y.has(G))U(G,!0);else{let W=J[F+1];if(W!==void 0&&!W.startsWith("-"))U(G,W),F++;else U(G,!0)}}}else if(X.startsWith("-")&&X.length>1){let j=X.slice(1);for(let G=0;G<j.length;G++){let V=j[G],W=q[V]||V;if(G===j.length-1&&!Y.has(W)&&!Y.has(V)){let K=J[F+1];if(K!==void 0&&!K.startsWith("-"))U(V,K),F++;else U(V,!0)}else U(V,!0)}}else $._.push(X)}return $}function LJ(J){return J.replace(/[<[].+/,"").trim()}function RZ(J){let Z=/<([^>]+)>/g,$=/\[([^\]]+)\]/g,Q=[],Y=(F)=>{let X=!1,j=F[1];if(j.startsWith("..."))j=j.slice(3),X=!0;return{required:F[0].startsWith("<"),value:j,variadic:X}},q;while(q=Z.exec(J))Q.push(Y(q));let U;while(U=$.exec(J))Q.push(Y(U));return Q}function xZ(J){let Z={alias:{},boolean:[]};for(let[$,Q]of J.entries()){if(Q.names.length>1)Z.alias[Q.names[0]]=Q.names.slice(1);if(Q.isBoolean)if(Q.negated){if(!J.some((q,U)=>{return U!==$&&q.names.some((F)=>Q.names.includes(F))&&typeof q.required==="boolean"}))Z.boolean.push(Q.names[0])}else Z.boolean.push(Q.names[0])}return Z}function hJ(J){return J.reduce((Z,$)=>Z.length>=$.length?Z:$,"")}function VJ(J,Z){return J.length>=Z?J:`${J}${" ".repeat(Z-J.length)}`}function CZ(J){return J.replace(/([a-z])-([a-z])/g,(Z,$,Q)=>{return $+Q.toUpperCase()})}function kZ(J,Z,$){let Q=0,Y=Z.length,q=J,U;for(;Q<Y;++Q)U=q[Z[Q]],q=q[Z[Q]]=Q===Y-1?$:U!=null?U:!!~Z[Q+1].indexOf(".")||!(+Z[Q+1]>-1)?{}:[]}function hZ(J,Z){for(let $ of Object.keys(Z)){let Q=Z[$];if(Q.shouldTransform){if(J[$]=Array.prototype.concat.call([],J[$]),typeof Q.transformFunction==="function")J[$]=J[$].map(Q.transformFunction)}}}function bZ(J){let Z=/([^\\/]+)$/.exec(J);return Z?Z[1]:""}function lJ(J){return J.split(".").map((Z,$)=>{return $===0?CZ(Z):Z}).join(".")}class YJ extends Error{exitCode=2;isUsageError=!0;constructor(J){super(J);if(this.name=this.constructor.name,typeof Error.captureStackTrace==="function")Error.captureStackTrace(this,this.constructor);else this.stack=Error(J).stack}format(J=!1){if(J&&this.stack)return`${this.message}
|
|
3
3
|
|
|
4
4
|
Stack trace:
|
|
5
5
|
${this.stack}`;return this.message}}function vZ(){let{env:J}=kJ,{TERM:Z,TERM_PROGRAM:$}=J;if(kJ.platform!=="win32")return Z!=="linux";return Boolean(J.WT_SESSION)||Boolean(J.TERMINUS_SUBLIME)||J.ConEmuTask==="{cmd::Cmder}"||$==="Terminus-Sublime"||$==="vscode"||Z==="xterm-256color"||Z==="alacritty"||Z==="rxvt-unicode"||Z==="rxvt-unicode-256color"||J.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var UJ="\x1B",T=`${UJ}[`,F$="\x07",C={to(J,Z){if(!Z)return`${T}${J+1}G`;return`${T}${Z+1};${J+1}H`},move(J,Z){let $="";if(J<0)$+=`${T}${-J}D`;else if(J>0)$+=`${T}${J}C`;if(Z<0)$+=`${T}${-Z}A`;else if(Z>0)$+=`${T}${Z}B`;return $},up:(J=1)=>`${T}${J}A`,down:(J=1)=>`${T}${J}B`,forward:(J=1)=>`${T}${J}C`,backward:(J=1)=>`${T}${J}D`,nextLine:(J=1)=>`${T}E`.repeat(J),prevLine:(J=1)=>`${T}F`.repeat(J),left:`${T}G`,hide:`${T}?25l`,show:`${T}?25h`,save:`${UJ}7`,restore:`${UJ}8`},j$={up:(J=1)=>`${T}S`.repeat(J),down:(J=1)=>`${T}T`.repeat(J)},JJ={screen:`${T}2J`,up:(J=1)=>`${T}1J`.repeat(J),down:(J=1)=>`${T}J`.repeat(J),line:`${T}2K`,lineEnd:`${T}K`,lineStart:`${T}1K`,lines(J){let Z="";for(let $=0;$<J;$++)Z+=this.line+($<J-1?C.up():"");if(J)Z+=C.left;return Z}},G$={screen:`${UJ}c`};function SZ(J,Z){let $=[];for(let Q=0;Q<=Z.length;Q++)$[Q]=[Q];for(let Q=0;Q<=J.length;Q++)$[0][Q]=Q;for(let Q=1;Q<=Z.length;Q++)for(let Y=1;Y<=J.length;Y++)if(Z.charAt(Q-1)===J.charAt(Y-1))$[Q][Y]=$[Q-1][Y-1];else $[Q][Y]=Math.min($[Q-1][Y-1]+1,$[Q][Y-1]+1,$[Q-1][Y]+1);return $[Z.length][J.length]}function rJ(J,Z,$=2,Q=3){return Z.map((Y)=>({cmd:Y,distance:SZ(J,Y)})).filter(({distance:Y})=>Y<=$).sort((Y,q)=>Y.distance-q.distance).slice(0,Q).map(({cmd:Y})=>Y)}class aJ{rawName;description;name;names;isBoolean;required;config;negated;constructor(J,Z,$){if(this.rawName=J,this.description=Z,this.config=Object.assign({},$),J=J.replace(/\.\*/g,""),this.negated=!1,this.names=LJ(J).split(",").map((Q)=>{let Y=Q.trim().replace(/^-{1,2}/,"");if(Y.startsWith("no-"))this.negated=!0,Y=Y.replace(/^no-/,"");return lJ(Y)}).sort((Q,Y)=>Q.length>Y.length?1:-1),this.name=this.names[this.names.length-1],this.negated&&this.config.default==null)this.config.default=!0;if(J.includes("<"))this.required=!0;else if(J.includes("["))this.required=!1;else this.isBoolean=!0}}var K$=MJ.argv,yZ=`${MJ.platform}-${MJ.arch} bun-v${typeof Bun<"u"?Bun.version:"unknown"}`,bJ=qJ.argv,gZ=`${qJ.platform}-${qJ.arch} node-${qJ.version}`;class BJ{rawName;description;config;cli;options;aliasNames;name;namespace;args;commandAction;usageText;versionNumber;examples;helpCallback;globalCommand;beforeHooks;afterHooks;middleware;constructor(J,Z,$,Q){this.rawName=J,this.description=Z,this.config=$,this.cli=Q,this.options=[],this.aliasNames=[],this.name=LJ(J);let Y=LJ(J),q=Y.indexOf(":");if(q>0)this.namespace=Y.substring(0,q),this.name=Y.substring(q+1);if(this.args=RZ(J),this.examples=[],this.beforeHooks=[],this.afterHooks=[],this.middleware=[],!$)this.config={}}usage(J){return this.usageText=J,this}allowUnknownOptions(){return this.config.allowUnknownOptions=!0,this}ignoreOptionDefaultValue(){return this.config.ignoreOptionDefaultValue=!0,this}version(J,Z="-v, --version"){return this.versionNumber=J,this.option(Z,"Display version number"),this}example(J){return this.examples.push(J),this}option(J,Z,$){let Q=new aJ(J,Z,$);return this.options.push(Q),this}alias(J){return this.aliasNames.push(J),this}action(J){return this.commandAction=J,this}before(J){return this.beforeHooks.push(J),this}after(J){return this.afterHooks.push(J),this}use(J){return this.middleware.push(J),this}isMatched(J){if(this.aliasNames.includes(J))return!0;if(this.namespace)return`${this.namespace}:${this.name}`===J;return this.name===J}get isDefaultCommand(){return this.name===""||this.aliasNames.includes("!")}get isGlobalCommand(){return this instanceof EJ}get displayName(){return this.namespace?`${this.namespace}:${this.name}`:this.name}hasOption(J){return J=J.split(".")[0],!!this.options.find((Z)=>{return Z.names.includes(J)})}outputHelp(){let{name:J,commands:Z}=this.cli,{versionNumber:$,options:Q,helpCallback:Y}=this.cli.globalCommand,q=[{body:`${J}${$?`/${$}`:""}`}];if(q.push({title:"Usage",body:` $ ${J} ${this.usageText||this.rawName}`}),(this.isGlobalCommand||this.isDefaultCommand)&&Z.length>0){let X=hJ(Z.map((K)=>K.rawName)),j=new Map,G=[];for(let K of Z)if(K.namespace){if(!j.has(K.namespace))j.set(K.namespace,[]);j.get(K.namespace).push(K)}else G.push(K);let V="";if(G.length>0)V+=G.map((K)=>{return` ${VJ(K.rawName,X.length)} ${K.description}`}).join(`
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import"./chunk-
|
|
2
|
+
import"./chunk-43fsk0jg.js";var e="pickier",u="module",t="0.1.52",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-jb2f18gz.js";import{h as x}from"../chunk-4z3xb1dt.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