pickier 0.0.0 → 0.1.7
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/format.d.ts +29 -0
- package/dist/formatter.d.ts +6 -0
- package/dist/index.d.ts +8 -6
- package/dist/index.js +4987 -6485
- package/dist/linter.d.ts +4 -0
- package/dist/plugins/index.d.ts +3 -0
- package/dist/plugins/pickier.d.ts +3 -0
- package/dist/plugins/regexp.d.ts +3 -0
- package/dist/plugins/style.d.ts +3 -0
- package/dist/plugins/ts.d.ts +3 -0
- package/dist/rules/pickier/no-unused-vars.d.ts +3 -0
- package/dist/rules/pickier/prefer-const.d.ts +3 -0
- package/dist/rules/pickier/sort-heritage-clauses.d.ts +3 -0
- package/dist/rules/pickier/sort-imports.d.ts +3 -0
- package/dist/rules/pickier/sort-keys.d.ts +3 -0
- package/dist/rules/pickier/sort-named-imports.d.ts +3 -0
- package/dist/rules/pickier/sort-objects.d.ts +3 -0
- package/dist/rules/regexp/no-super-linear-backtracking.d.ts +3 -0
- package/dist/rules/style/curly.d.ts +3 -0
- package/dist/rules/style/max-statements-per-line.d.ts +3 -0
- package/dist/rules/ts/no-require-imports.d.ts +3 -0
- package/dist/run.d.ts +30 -0
- package/dist/types.d.ts +66 -1
- package/dist/utils.d.ts +7 -1
- package/package.json +3 -18
- package/dist/cli/run-format.d.ts +0 -11
- package/dist/cli/run-lint.d.ts +0 -27
package/dist/format.d.ts
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { PickierConfig } from './types';
|
|
2
|
+
|
|
3
|
+
declare const CODE_EXTS: unknown;
|
|
4
|
+
declare function getFileExt(filePath: string): string;
|
|
5
|
+
declare function isCodeFileExt(filePath: string): boolean;
|
|
6
|
+
declare function isJsonFileExt(filePath: string): boolean;
|
|
7
|
+
declare function toSpaces(count: number): string;
|
|
8
|
+
declare function makeIndent(visualLevels: number, cfg: PickierConfig): string;
|
|
9
|
+
declare function convertDoubleToSingle(str: string): string;
|
|
10
|
+
declare function convertSingleToDouble(str: string): string;
|
|
11
|
+
declare function fixQuotes(content: string, preferred: 'single' | 'double', filePath: string): string;
|
|
12
|
+
declare function fixIndentation(content: string, indentSize: number, cfg: PickierConfig): string;
|
|
13
|
+
declare function collapseBlankLines(lines: string[], maxConsecutive: number): string[];
|
|
14
|
+
export declare function formatCode(src: string, cfg: PickierConfig, filePath: string): string;
|
|
15
|
+
export declare function detectQuoteIssues(line: string, preferred: 'single' | 'double'): number[];
|
|
16
|
+
export declare function hasIndentIssue(leading: string, indentSize: number, indentStyle?: 'spaces' | 'tabs'): boolean;
|
|
17
|
+
declare function maskStrings(input: string): void;
|
|
18
|
+
declare function unmaskStrings(text: string, strings: string[]): string;
|
|
19
|
+
declare function normalizeCodeSpacing(input: string): string;
|
|
20
|
+
declare function removeStylisticSemicolons(input: string): string;
|
|
21
|
+
export declare function formatImports(source: string): string;
|
|
22
|
+
declare function renderImport(imp: ParsedImport): string;
|
|
23
|
+
declare function parseImportStatement(stmt: string): ParsedImport | undefined;
|
|
24
|
+
declare function trySortKnownJson(input: string, filePath: string): string | null;
|
|
25
|
+
declare function parseJsonSafe(text: string): any | null;
|
|
26
|
+
declare function sortObjectKeys(obj: Record<string, any>, order: string[], extraAscPatterns?: RegExp[]): Record<string, any>;
|
|
27
|
+
declare function sortDepsAsc(obj: Record<string, any>): Record<string, any>;
|
|
28
|
+
declare function sortPackageJsonContent(text: string): string;
|
|
29
|
+
declare function sortTsconfigContent(text: string): string;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { FormatOptions, LintIssue, PickierConfig } from './types';
|
|
2
|
+
|
|
3
|
+
export declare function applyPluginFixes(filePath: string, content: string, cfg: PickierConfig): string;
|
|
4
|
+
export declare function applyFixes(filePath: string, content: string, cfg: PickierConfig): string;
|
|
5
|
+
export declare function formatStylish(issues: LintIssue[]): string;
|
|
6
|
+
export declare function runFormat(globs: string[], options: FormatOptions): Promise<number>;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
export type {
|
|
2
|
-
export type { LintOptions } from './cli/run-lint'
|
|
1
|
+
export type { RunOptions } from './run'
|
|
3
2
|
|
|
4
|
-
export {
|
|
5
|
-
export {
|
|
3
|
+
export { config, defaultConfig } from './config'
|
|
4
|
+
export { runFormat } from './formatter'
|
|
5
|
+
export { runLint } from './linter'
|
|
6
|
+
export { run } from './run'
|
|
6
7
|
|
|
7
|
-
export * from './
|
|
8
|
-
export * from './types'
|
|
8
|
+
export * from './format'
|
|
9
|
+
export * from './types'
|
|
10
|
+
export * from './utils'
|