pickier 0.1.64 → 0.1.66

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.
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{C,x,E,P}from"./chunk-vbmkrdh6.js";export{x as fixText,C as lintText,P as runLint,E as runLintProgrammatic};
@@ -1,7 +1,7 @@
1
1
  export type { RunOptions } from './run';
2
2
  export { config, defaultConfig } from './config';
3
3
  export * from './format';
4
- export { lintText, runLint, runLintProgrammatic } from './linter';
4
+ export { fixText, lintText, runLint, runLintProgrammatic } from './linter';
5
5
  export { runFormat } from './formatter';
6
6
  export { runUnified as run } from './run';
7
7
  export * from './types';
package/dist/src/index.js CHANGED
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{a as i,b as r,c as t,g as o}from"../chunk-dsmbhdmt.js";import{h as s}from"../chunk-djgqvaq1.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-vdbbvx8x.js";import{N as e,P as n}from"../chunk-gy6wyx8t.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};
2
+ import{s,S,f,k,y,p,b,r,D,n,R,o,v,g,a,j,h,T,L,A,O,_,N,e,m,u,d,w,l,c,B,I}from"../chunk-rg0g2fzg.js";import{M,C,x,E,P}from"../chunk-vbmkrdh6.js";export{R as ALWAYS_IGNORES,n as ENV,b as MAX_FIXER_PASSES,o as UNIVERSAL_IGNORES,O as blue,N as bold,h as colorize,e as colors,S as config,c as createIgnoreMatcher,D as createLimiter,s as defaultConfig,k as detectQuoteIssues,d as expandPatterns,x as fixText,f as formatCode,p as formatImports,v as getRuleSetting,r as glob,_ as gray,T as green,y as hasIndentIssue,w as isCodeFile,j as isRuleOff,C as lintText,u as loadConfigFromPath,m as mergeConfig,g as normalizeRuleSeverity,L as red,a as resolveRuleSeverity,I as run,M as runFormat,P as runLint,E as runLintProgrammatic,B as shouldIgnorePath,l as withAlwaysIgnores,A as yellow};
@@ -1,6 +1,15 @@
1
1
  import type { LintIssue, LintOptions, PickierConfig } from './types';
2
2
  // Programmatic single-text lint with optional cancellation
3
3
  export declare function lintText(text: string, cfg: PickierConfig, filePath?: string, signal?: AbortSignal): Promise<LintIssue[]>;
4
+ /**
5
+ * The text `pickier --fix` would write for a file with this content.
6
+ *
7
+ * `runLint` reads and writes files; an editor needs the same fixes applied to
8
+ * an unsaved buffer and handed back as text. This is that, and `runLint`
9
+ * calls it too, so a fix-all in an editor and `pickier --fix` on disk cannot
10
+ * drift apart.
11
+ */
12
+ export declare function fixText(text: string, cfg: PickierConfig, filePath?: string): string;
4
13
  // Programmatic batch lint returning structured result, with optional cancellation
5
14
  export declare function runLintProgrammatic(globs: string[], options: LintOptions, signal?: AbortSignal): Promise<{ errors: number, warnings: number, issues: LintIssue[] }>;
6
15
  export declare function applyPlugins(filePath: string, content: string, cfg: PickierConfig): Promise<Array<any>> /* PluginLintIssue[] */;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pickier",
3
3
  "type": "module",
4
- "version": "0.1.64",
4
+ "version": "0.1.66",
5
5
  "description": "Format, lint and more in a fraction of seconds.",
6
6
  "author": "Chris Breuer <chris@stacksjs.org>",
7
7
  "license": "MIT",
@@ -1,2 +0,0 @@
1
- // @bun
2
- import"./chunk-awmb5sg5.js";var e="pickier",u="module",t="0.1.64",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"},c={url:"https://github.com/pickier/pickier/issues"},m=["pickier","linter","formatter","bun","fast"],o={".":{types:"./dist/src/index.d.ts",import:"./dist/src/index.js"},"./*":{import:"./dist/*"}},a="./dist/src/index.js",x="./dist/src/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:c,keywords:m,exports:o,module:a,types:x,bin:d,files:w,scripts:k,dependencies:I,optionalDependencies:O,devDependencies:_};export{s as author,d as bin,c as bugs,z as default,I as dependencies,r as description,_ as devDependencies,o as exports,w as files,p as homepage,m as keywords,l as license,a as module,e as name,O as optionalDependencies,b as repository,k as scripts,u as type,x as types,t as version};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{h as a}from"./chunk-djgqvaq1.js";import"./chunk-vdbbvx8x.js";import"./chunk-gy6wyx8t.js";import"./chunk-awmb5sg5.js";export{a as runUnified};
@@ -1,3 +0,0 @@
1
- // @bun
2
- var a=import.meta.require;
3
- export{a as Q};
@@ -1,3 +0,0 @@
1
- // @bun
2
- import{H as u,k as m}from"./chunk-vdbbvx8x.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-yx80g50v.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};