pickier 0.1.59 → 0.1.61
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 +2 -2
- package/dist/chunk-3j5z4940.js +62 -0
- package/dist/{chunk-43fsk0jg.js → chunk-awmb5sg5.js} +1 -1
- package/dist/{chunk-8dgfp05p.js → chunk-b2q8x0sx.js} +1 -1
- package/dist/chunk-b369mtka.js +33 -0
- package/dist/chunk-hwa8gmzb.js +156 -0
- package/dist/chunk-mat3gcn4.js +2 -0
- package/dist/chunk-n23710ya.js +2 -0
- package/dist/chunk-nh6zvh3d.js +2 -0
- package/dist/chunk-xjc1fk5y.js +224 -0
- package/dist/chunk-z1nez1br.js +3 -0
- package/dist/src/index.js +1 -1
- package/dist/src/utils.d.ts +35 -1
- package/package.json +1 -1
- package/dist/chunk-0wcp6yrf.js +0 -2
- package/dist/chunk-3wr40yqq.js +0 -2
- package/dist/chunk-6cf4pq67.js +0 -224
- package/dist/chunk-ah6h41gy.js +0 -62
- package/dist/chunk-er69kh4d.js +0 -33
- package/dist/chunk-t6trprqw.js +0 -3
- package/dist/chunk-v1x7hdmp.js +0 -156
- package/dist/chunk-ye3wjxzf.js +0 -2
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{H as u,k as m}from"./chunk-b369mtka.js";import{Q as y}from"./chunk-awmb5sg5.js";import{readFileSync as O,statSync as p,writeFileSync as x}from"fs";import{isAbsolute as d,resolve as l}from"path";async function R(r,t){let a=t.mode||"auto";if(a==="format"&&r.length===1&&!/[*?[\]{}()!]/.test(r[0]))try{let n=r[0],i=d(n)?n:l(process.cwd(),n);if(p(i).isFile()){let o=await u(t.config),c=O(i,"utf8"),f=m(c,o,i);if(t.check&&f!==c)return 1;if(t.write&&f!==c)x(i,f,"utf8");return 0}}catch{}let{runLint:e}=await import("./chunk-n23710ya.js");if(a==="lint")return e(r,t);if(a==="format"){let n={...t,fix:!0,dryRun:!!t.check,ext:t.ext,_formatOnly:!0};return e(r,n)}if(!(t.fix===!0||t.write===!0||t.check===!0))return e(r,t);let s={...t,fix:!0,dryRun:!!t.check,ext:t.ext};return e(r,s)}
|
|
3
|
+
export{R as h};
|
package/dist/src/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{a as
|
|
2
|
+
import{a as i,b as r,c as t,g as o}from"../chunk-xjc1fk5y.js";import{h as s}from"../chunk-z1nez1br.js";import{A as F,B as I,C as O,D as A,E,F as W,G as U,H as q,I as z,J as B,K as D,L as G,M as N,k as m,l as b,m as P,n as C,o as R,p as d,q as y,r as k,s as h,t as v,u as w,v as S,w as L,x as M,y as T,z as j}from"../chunk-b369mtka.js";import{N as e,P as n}from"../chunk-3j5z4940.js";import"../chunk-awmb5sg5.js";export{h as ALWAYS_IGNORES,k as ENV,R as MAX_FIXER_PASSES,v as UNIVERSAL_IGNORES,O as blue,E as bold,T as colorize,W as colors,n as config,G as createIgnoreMatcher,y as createLimiter,e as defaultConfig,b as detectQuoteIssues,z as expandPatterns,m as formatCode,C as formatImports,w as getRuleSetting,d as glob,A as gray,j as green,P as hasIndentIssue,B as isCodeFile,M as isRuleOff,r as lintText,q as loadConfigFromPath,U as mergeConfig,S as normalizeRuleSeverity,F as red,L as resolveRuleSeverity,s as run,i as runFormat,o as runLint,t as runLintProgrammatic,N as shouldIgnorePath,D as withAlwaysIgnores,I as yellow};
|
package/dist/src/utils.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { PickierConfig, PickierOptions, RulesConfigMap } from './types';
|
|
1
|
+
import type { PickierConfig, PickierOptions, RuleSeverity, RulesConfigMap } from './types';
|
|
2
2
|
/**
|
|
3
3
|
* Glob files matching the given patterns.
|
|
4
4
|
* Uses Bun.Glob when running under Bun for maximum performance,
|
|
@@ -17,6 +17,40 @@ export declare function createLimiter(concurrency: number): <T>(fn: () => Promis
|
|
|
17
17
|
* Handles both string format ('error', 'warn', 'off') and array format (['error', options]).
|
|
18
18
|
*/
|
|
19
19
|
export declare function getRuleSetting(rulesConfig: RulesConfigMap, ruleId: string): { enabled: boolean, severity?: 'error' | 'warning', options?: any };
|
|
20
|
+
/**
|
|
21
|
+
* Normalize a raw rule config value into a severity.
|
|
22
|
+
*
|
|
23
|
+
* Accepts both the string form (`'error'`) and the array form
|
|
24
|
+
* (`['warn', options]`). Returns `'off'` for an explicit opt-out and
|
|
25
|
+
* `undefined` when the rule is not configured at all — the two are different
|
|
26
|
+
* answers, and only the caller knows what an unconfigured rule should default
|
|
27
|
+
* to (plugin rules default to disabled, built-in rules do not).
|
|
28
|
+
*/
|
|
29
|
+
export declare function normalizeRuleSeverity(raw: unknown): 'off' | 'warning' | 'error' | undefined;
|
|
30
|
+
/**
|
|
31
|
+
* The single severity gate every rule passes through before it runs.
|
|
32
|
+
*
|
|
33
|
+
* A rule is configurable from either config map — `rules` and `pluginRules`
|
|
34
|
+
* are both user-facing and people reasonably reach for whichever they saw
|
|
35
|
+
* first — and under any of its aliases: the id it reports as (`no-console`),
|
|
36
|
+
* the plugin-qualified id (`style/quotes`), or the legacy camelCase key the
|
|
37
|
+
* built-in scan was originally written against (`noConsole`). Pass the
|
|
38
|
+
* reported id first and aliases in descending priority; the first configured
|
|
39
|
+
* one wins, so an explicit `'no-console': 'off'` beats an inherited
|
|
40
|
+
* `noConsole: 'warn'`.
|
|
41
|
+
*
|
|
42
|
+
* Returns the severity issues should be reported at, or `undefined` when the
|
|
43
|
+
* rule is off — callers must not run a rule that resolves to `undefined`.
|
|
44
|
+
*/
|
|
45
|
+
export declare function resolveRuleSeverity(cfg: Pick<PickierConfig, 'rules' | 'pluginRules'>, ruleId: string, aliases?: string[], fallback?: RuleSeverity): 'warning' | 'error' | undefined;
|
|
46
|
+
/**
|
|
47
|
+
* True when a rule is explicitly switched off in either config map.
|
|
48
|
+
*
|
|
49
|
+
* Distinct from `resolveRuleSeverity`: this answers "did the user opt out?"
|
|
50
|
+
* for call sites whose default is enabled, where an unconfigured rule must
|
|
51
|
+
* keep running.
|
|
52
|
+
*/
|
|
53
|
+
export declare function isRuleOff(cfg: Pick<PickierConfig, 'rules' | 'pluginRules'>, ruleId: string): boolean;
|
|
20
54
|
/**
|
|
21
55
|
* Colorize console output (simple ANSI colors)
|
|
22
56
|
*/
|
package/package.json
CHANGED
package/dist/chunk-0wcp6yrf.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-6cf4pq67.js";import"./chunk-er69kh4d.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};
|
package/dist/chunk-3wr40yqq.js
DELETED