@paretools/lint 0.5.0 → 0.6.0
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/README.md +4 -4
- package/dist/lib/formatters.d.ts +27 -0
- package/dist/lib/formatters.d.ts.map +1 -1
- package/dist/lib/formatters.js +41 -3
- package/dist/lib/formatters.js.map +1 -1
- package/dist/schemas/index.d.ts +4 -4
- package/dist/schemas/index.js +3 -3
- package/dist/schemas/index.js.map +1 -1
- package/dist/tools/biome-check.d.ts.map +1 -1
- package/dist/tools/biome-check.js +19 -6
- package/dist/tools/biome-check.js.map +1 -1
- package/dist/tools/biome-format.d.ts.map +1 -1
- package/dist/tools/biome-format.js +19 -6
- package/dist/tools/biome-format.js.map +1 -1
- package/dist/tools/format-check.d.ts.map +1 -1
- package/dist/tools/format-check.js +19 -6
- package/dist/tools/format-check.js.map +1 -1
- package/dist/tools/lint.d.ts.map +1 -1
- package/dist/tools/lint.js +19 -6
- package/dist/tools/lint.js.map +1 -1
- package/dist/tools/prettier-format.d.ts.map +1 -1
- package/dist/tools/prettier-format.js +19 -6
- package/dist/tools/prettier-format.js.map +1 -1
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
# @paretools/lint
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/@paretools/lint)
|
|
4
|
-
[](https://github.com/Dave-London/
|
|
4
|
+
[](https://github.com/Dave-London/Pare/blob/main/LICENSE)
|
|
5
5
|
|
|
6
6
|
**Structured, token-efficient linter output for AI agents.** Typed diagnostics from ESLint, Prettier, and Biome.
|
|
7
7
|
|
|
8
|
-
Part of the [Pare](https://github.com/Dave-London/
|
|
8
|
+
Part of the [Pare](https://github.com/Dave-London/Pare) suite of MCP servers.
|
|
9
9
|
|
|
10
10
|
## Tools (5)
|
|
11
11
|
|
|
@@ -81,9 +81,9 @@ Works with any MCP-compatible client: [Claude Code](https://docs.anthropic.com/e
|
|
|
81
81
|
|
|
82
82
|
## Links
|
|
83
83
|
|
|
84
|
-
- [Pare monorepo](https://github.com/Dave-London/
|
|
84
|
+
- [Pare monorepo](https://github.com/Dave-London/Pare)
|
|
85
85
|
- [MCP protocol](https://modelcontextprotocol.io)
|
|
86
86
|
|
|
87
87
|
## License
|
|
88
88
|
|
|
89
|
-
[MIT](https://github.com/Dave-London/
|
|
89
|
+
[MIT](https://github.com/Dave-London/Pare/blob/main/LICENSE)
|
package/dist/lib/formatters.d.ts
CHANGED
|
@@ -5,4 +5,31 @@ export declare function formatLint(data: LintResult): string;
|
|
|
5
5
|
export declare function formatFormatCheck(data: FormatCheckResult): string;
|
|
6
6
|
/** Formats structured format-write results into a human-readable summary. */
|
|
7
7
|
export declare function formatFormatWrite(data: FormatWriteResult): string;
|
|
8
|
+
/** Compact lint: counts only, no individual diagnostics. */
|
|
9
|
+
export interface LintResultCompact {
|
|
10
|
+
[key: string]: unknown;
|
|
11
|
+
total: number;
|
|
12
|
+
errors: number;
|
|
13
|
+
warnings: number;
|
|
14
|
+
fixable: number;
|
|
15
|
+
filesChecked: number;
|
|
16
|
+
}
|
|
17
|
+
export declare function compactLintMap(data: LintResult): LintResultCompact;
|
|
18
|
+
export declare function formatLintCompact(data: LintResultCompact): string;
|
|
19
|
+
/** Compact format check: counts only, no individual file paths. */
|
|
20
|
+
export interface FormatCheckResultCompact {
|
|
21
|
+
[key: string]: unknown;
|
|
22
|
+
formatted: boolean;
|
|
23
|
+
total: number;
|
|
24
|
+
}
|
|
25
|
+
export declare function compactFormatCheckMap(data: FormatCheckResult): FormatCheckResultCompact;
|
|
26
|
+
export declare function formatFormatCheckCompact(data: FormatCheckResultCompact): string;
|
|
27
|
+
/** Compact format write: counts only, no individual file paths. */
|
|
28
|
+
export interface FormatWriteResultCompact {
|
|
29
|
+
[key: string]: unknown;
|
|
30
|
+
success: boolean;
|
|
31
|
+
filesChanged: number;
|
|
32
|
+
}
|
|
33
|
+
export declare function compactFormatWriteMap(data: FormatWriteResult): FormatWriteResultCompact;
|
|
34
|
+
export declare function formatFormatWriteCompact(data: FormatWriteResultCompact): string;
|
|
8
35
|
//# sourceMappingURL=formatters.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"formatters.d.ts","sourceRoot":"","sources":["../../src/lib/formatters.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAE5F,sGAAsG;AACtG,wBAAgB,UAAU,CAAC,IAAI,EAAE,UAAU,GAAG,MAAM,CAUnD;AAED,iGAAiG;AACjG,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,iBAAiB,GAAG,MAAM,CAQjE;AAED,6EAA6E;AAC7E,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,iBAAiB,GAAG,MAAM,CASjE"}
|
|
1
|
+
{"version":3,"file":"formatters.d.ts","sourceRoot":"","sources":["../../src/lib/formatters.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAE5F,sGAAsG;AACtG,wBAAgB,UAAU,CAAC,IAAI,EAAE,UAAU,GAAG,MAAM,CAUnD;AAED,iGAAiG;AACjG,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,iBAAiB,GAAG,MAAM,CAQjE;AAED,6EAA6E;AAC7E,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,iBAAiB,GAAG,MAAM,CASjE;AAID,4DAA4D;AAC5D,MAAM,WAAW,iBAAiB;IAChC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,UAAU,GAAG,iBAAiB,CAQlE;AAED,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,iBAAiB,GAAG,MAAM,CAGjE;AAED,mEAAmE;AACnE,MAAM,WAAW,wBAAwB;IACvC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;IACvB,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;CACf;AAED,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,iBAAiB,GAAG,wBAAwB,CAKvF;AAED,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,wBAAwB,GAAG,MAAM,CAG/E;AAED,mEAAmE;AACnE,MAAM,WAAW,wBAAwB;IACvC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;IACvB,OAAO,EAAE,OAAO,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,iBAAiB,GAAG,wBAAwB,CAKvF;AAED,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,wBAAwB,GAAG,MAAM,CAI/E"}
|
package/dist/lib/formatters.js
CHANGED
|
@@ -5,7 +5,7 @@ export function formatLint(data) {
|
|
|
5
5
|
const lines = [
|
|
6
6
|
`Lint: ${data.errors} errors, ${data.warnings} warnings (${data.fixable} fixable)`,
|
|
7
7
|
];
|
|
8
|
-
for (const d of data.diagnostics) {
|
|
8
|
+
for (const d of data.diagnostics ?? []) {
|
|
9
9
|
lines.push(` ${d.file}:${d.line}:${d.column} ${d.severity} ${d.rule}: ${d.message}`);
|
|
10
10
|
}
|
|
11
11
|
return lines.join("\n");
|
|
@@ -15,7 +15,7 @@ export function formatFormatCheck(data) {
|
|
|
15
15
|
if (data.formatted)
|
|
16
16
|
return "All files are formatted.";
|
|
17
17
|
const lines = [`${data.total} files need formatting:`];
|
|
18
|
-
for (const f of data.files) {
|
|
18
|
+
for (const f of data.files ?? []) {
|
|
19
19
|
lines.push(` ${f}`);
|
|
20
20
|
}
|
|
21
21
|
return lines.join("\n");
|
|
@@ -27,9 +27,47 @@ export function formatFormatWrite(data) {
|
|
|
27
27
|
if (data.filesChanged === 0)
|
|
28
28
|
return "All files already formatted.";
|
|
29
29
|
const lines = [`Formatted ${data.filesChanged} files:`];
|
|
30
|
-
for (const f of data.files) {
|
|
30
|
+
for (const f of data.files ?? []) {
|
|
31
31
|
lines.push(` ${f}`);
|
|
32
32
|
}
|
|
33
33
|
return lines.join("\n");
|
|
34
34
|
}
|
|
35
|
+
export function compactLintMap(data) {
|
|
36
|
+
return {
|
|
37
|
+
total: data.total,
|
|
38
|
+
errors: data.errors,
|
|
39
|
+
warnings: data.warnings,
|
|
40
|
+
fixable: data.fixable,
|
|
41
|
+
filesChecked: data.filesChecked,
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
export function formatLintCompact(data) {
|
|
45
|
+
if (data.total === 0)
|
|
46
|
+
return `Lint: no issues found (${data.filesChecked} files checked).`;
|
|
47
|
+
return `Lint: ${data.errors} errors, ${data.warnings} warnings (${data.fixable} fixable) across ${data.filesChecked} files.`;
|
|
48
|
+
}
|
|
49
|
+
export function compactFormatCheckMap(data) {
|
|
50
|
+
return {
|
|
51
|
+
formatted: data.formatted,
|
|
52
|
+
total: data.total,
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
export function formatFormatCheckCompact(data) {
|
|
56
|
+
if (data.formatted)
|
|
57
|
+
return "All files are formatted.";
|
|
58
|
+
return `${data.total} files need formatting.`;
|
|
59
|
+
}
|
|
60
|
+
export function compactFormatWriteMap(data) {
|
|
61
|
+
return {
|
|
62
|
+
success: data.success,
|
|
63
|
+
filesChanged: data.filesChanged,
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
export function formatFormatWriteCompact(data) {
|
|
67
|
+
if (!data.success)
|
|
68
|
+
return "Format failed.";
|
|
69
|
+
if (data.filesChanged === 0)
|
|
70
|
+
return "All files already formatted.";
|
|
71
|
+
return `Formatted ${data.filesChanged} files.`;
|
|
72
|
+
}
|
|
35
73
|
//# sourceMappingURL=formatters.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"formatters.js","sourceRoot":"","sources":["../../src/lib/formatters.ts"],"names":[],"mappings":"AAEA,sGAAsG;AACtG,MAAM,UAAU,UAAU,CAAC,IAAgB;IACzC,IAAI,IAAI,CAAC,KAAK,KAAK,CAAC;QAAE,OAAO,0BAA0B,IAAI,CAAC,YAAY,kBAAkB,CAAC;IAE3F,MAAM,KAAK,GAAG;QACZ,SAAS,IAAI,CAAC,MAAM,YAAY,IAAI,CAAC,QAAQ,cAAc,IAAI,CAAC,OAAO,WAAW;KACnF,CAAC;IACF,KAAK,MAAM,CAAC,IAAI,IAAI,CAAC,WAAW,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"formatters.js","sourceRoot":"","sources":["../../src/lib/formatters.ts"],"names":[],"mappings":"AAEA,sGAAsG;AACtG,MAAM,UAAU,UAAU,CAAC,IAAgB;IACzC,IAAI,IAAI,CAAC,KAAK,KAAK,CAAC;QAAE,OAAO,0BAA0B,IAAI,CAAC,YAAY,kBAAkB,CAAC;IAE3F,MAAM,KAAK,GAAG;QACZ,SAAS,IAAI,CAAC,MAAM,YAAY,IAAI,CAAC,QAAQ,cAAc,IAAI,CAAC,OAAO,WAAW;KACnF,CAAC;IACF,KAAK,MAAM,CAAC,IAAI,IAAI,CAAC,WAAW,IAAI,EAAE,EAAE,CAAC;QACvC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,MAAM,IAAI,CAAC,CAAC,QAAQ,IAAI,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;IACxF,CAAC;IACD,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC;AAED,iGAAiG;AACjG,MAAM,UAAU,iBAAiB,CAAC,IAAuB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AC,MAAM,YAAY,IAAI,CAAC,QAAQ,cAAc,IAAI,CAAC,OAAO,oBAAoB,IAAI,CAAC,YAAY,SAAS,CAAC;AAC/H,CAAC;AASD,MAAM,UAAU,qBAAqB,CAAC,IAAuB;IAC3D,OAAO;QACL,SAAS,EAAE,IAAI,CAAC,SAAS;QACzB,KAAK,EAAE,IAAI,CAAC,KAAK;KAClB,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,wBAAwB,CAAC,IAA8B;IACrE,IAAI,IAAI,CAAC,SAAS;QAAE,OAAO,0BAA0B,CAAC;IACtD,OAAO,GAAG,IAAI,CAAC,KAAK,yBAAyB,CAAC;AAChD,CAAC;AASD,MAAM,UAAU,qBAAqB,CAAC,IAAuB;IAC3D,OAAO;QACL,OAAO,EAAE,IAAI,CAAC,OAAO;QACrB,YAAY,EAAE,IAAI,CAAC,YAAY;KAChC,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,wBAAwB,CAAC,IAA8B;IACrE,IAAI,CAAC,IAAI,CAAC,OAAO;QAAE,OAAO,gBAAgB,CAAC;IAC3C,IAAI,IAAI,CAAC,YAAY,KAAK,CAAC;QAAE,OAAO,8BAA8B,CAAC;IACnE,OAAO,aAAa,IAAI,CAAC,YAAY,SAAS,CAAC;AACjD,CAAC"}
|
package/dist/schemas/index.d.ts
CHANGED
|
@@ -17,7 +17,7 @@ export declare const LintDiagnosticSchema: z.ZodObject<{
|
|
|
17
17
|
}, z.core.$strip>;
|
|
18
18
|
/** Zod schema for structured ESLint output including diagnostics, counts, and files checked. */
|
|
19
19
|
export declare const LintResultSchema: z.ZodObject<{
|
|
20
|
-
diagnostics: z.ZodArray<z.ZodObject<{
|
|
20
|
+
diagnostics: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
21
21
|
file: z.ZodString;
|
|
22
22
|
line: z.ZodNumber;
|
|
23
23
|
column: z.ZodNumber;
|
|
@@ -31,7 +31,7 @@ export declare const LintResultSchema: z.ZodObject<{
|
|
|
31
31
|
rule: z.ZodString;
|
|
32
32
|
message: z.ZodString;
|
|
33
33
|
fixable: z.ZodBoolean;
|
|
34
|
-
}, z.core.$strip
|
|
34
|
+
}, z.core.$strip>>>;
|
|
35
35
|
total: z.ZodNumber;
|
|
36
36
|
errors: z.ZodNumber;
|
|
37
37
|
warnings: z.ZodNumber;
|
|
@@ -43,14 +43,14 @@ export type LintDiagnostic = z.infer<typeof LintDiagnosticSchema>;
|
|
|
43
43
|
/** Zod schema for structured Prettier format check output with formatted status and unformatted file list. */
|
|
44
44
|
export declare const FormatCheckResultSchema: z.ZodObject<{
|
|
45
45
|
formatted: z.ZodBoolean;
|
|
46
|
-
files: z.ZodArray<z.ZodString
|
|
46
|
+
files: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
47
47
|
total: z.ZodNumber;
|
|
48
48
|
}, z.core.$strip>;
|
|
49
49
|
export type FormatCheckResult = z.infer<typeof FormatCheckResultSchema>;
|
|
50
50
|
/** Zod schema for structured format-write output (Prettier --write, Biome format --write). */
|
|
51
51
|
export declare const FormatWriteResultSchema: z.ZodObject<{
|
|
52
52
|
filesChanged: z.ZodNumber;
|
|
53
|
-
files: z.ZodArray<z.ZodString
|
|
53
|
+
files: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
54
54
|
success: z.ZodBoolean;
|
|
55
55
|
}, z.core.$strip>;
|
|
56
56
|
export type FormatWriteResult = z.infer<typeof FormatWriteResultSchema>;
|
package/dist/schemas/index.js
CHANGED
|
@@ -13,7 +13,7 @@ export const LintDiagnosticSchema = z.object({
|
|
|
13
13
|
});
|
|
14
14
|
/** Zod schema for structured ESLint output including diagnostics, counts, and files checked. */
|
|
15
15
|
export const LintResultSchema = z.object({
|
|
16
|
-
diagnostics: z.array(LintDiagnosticSchema),
|
|
16
|
+
diagnostics: z.array(LintDiagnosticSchema).optional(),
|
|
17
17
|
total: z.number(),
|
|
18
18
|
errors: z.number(),
|
|
19
19
|
warnings: z.number(),
|
|
@@ -23,13 +23,13 @@ export const LintResultSchema = z.object({
|
|
|
23
23
|
/** Zod schema for structured Prettier format check output with formatted status and unformatted file list. */
|
|
24
24
|
export const FormatCheckResultSchema = z.object({
|
|
25
25
|
formatted: z.boolean(),
|
|
26
|
-
files: z.array(z.string()),
|
|
26
|
+
files: z.array(z.string()).optional(),
|
|
27
27
|
total: z.number(),
|
|
28
28
|
});
|
|
29
29
|
/** Zod schema for structured format-write output (Prettier --write, Biome format --write). */
|
|
30
30
|
export const FormatWriteResultSchema = z.object({
|
|
31
31
|
filesChanged: z.number(),
|
|
32
|
-
files: z.array(z.string()),
|
|
32
|
+
files: z.array(z.string()).optional(),
|
|
33
33
|
success: z.boolean(),
|
|
34
34
|
});
|
|
35
35
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/schemas/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,yGAAyG;AACzG,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3C,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE;IAClB,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC9B,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAChC,QAAQ,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;IAC9C,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;IACnB,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE;CACrB,CAAC,CAAC;AAEH,gGAAgG;AAChG,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,C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AAS,EAAE,CAAC,CAAC,OAAO,EAAE;IACtB,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;IACrC,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;CAClB,CAAC,CAAC;AAIH,8FAA8F;AAC9F,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC9C,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE;IACxB,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;IACrC,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE;CACrB,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"biome-check.d.ts","sourceRoot":"","sources":["../../src/tools/biome-check.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAOzE,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,SAAS,
|
|
1
|
+
{"version":3,"file":"biome-check.d.ts","sourceRoot":"","sources":["../../src/tools/biome-check.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAOzE,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,SAAS,QAgDvD"}
|
|
@@ -1,28 +1,41 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import {
|
|
2
|
+
import { compactDualOutput, assertNoFlagInjection, INPUT_LIMITS } from "@paretools/shared";
|
|
3
3
|
import { biome } from "../lib/lint-runner.js";
|
|
4
4
|
import { parseBiomeJson } from "../lib/parsers.js";
|
|
5
|
-
import { formatLint } from "../lib/formatters.js";
|
|
5
|
+
import { formatLint, compactLintMap, formatLintCompact } from "../lib/formatters.js";
|
|
6
6
|
import { LintResultSchema } from "../schemas/index.js";
|
|
7
7
|
export function registerBiomeCheckTool(server) {
|
|
8
8
|
server.registerTool("biome-check", {
|
|
9
9
|
title: "Biome Check",
|
|
10
10
|
description: "Runs Biome check (lint + format) and returns structured diagnostics (file, line, rule, severity, message). Use instead of running `biome check` in the terminal.",
|
|
11
11
|
inputSchema: {
|
|
12
|
-
path: z
|
|
12
|
+
path: z
|
|
13
|
+
.string()
|
|
14
|
+
.max(INPUT_LIMITS.PATH_MAX)
|
|
15
|
+
.optional()
|
|
16
|
+
.describe("Project root path (default: cwd)"),
|
|
13
17
|
patterns: z
|
|
14
|
-
.array(z.string())
|
|
18
|
+
.array(z.string().max(INPUT_LIMITS.PATH_MAX))
|
|
19
|
+
.max(INPUT_LIMITS.ARRAY_MAX)
|
|
15
20
|
.optional()
|
|
16
21
|
.default(["."])
|
|
17
22
|
.describe("File patterns to check (default: ['.'])"),
|
|
23
|
+
compact: z
|
|
24
|
+
.boolean()
|
|
25
|
+
.optional()
|
|
26
|
+
.default(true)
|
|
27
|
+
.describe("Auto-compact when structured output exceeds raw CLI tokens. Set false to always get full schema."),
|
|
18
28
|
},
|
|
19
29
|
outputSchema: LintResultSchema,
|
|
20
|
-
}, async ({ path, patterns }) => {
|
|
30
|
+
}, async ({ path, patterns, compact }) => {
|
|
21
31
|
const cwd = path || process.cwd();
|
|
32
|
+
for (const p of patterns ?? []) {
|
|
33
|
+
assertNoFlagInjection(p, "patterns");
|
|
34
|
+
}
|
|
22
35
|
const args = ["check", "--reporter=json", ...(patterns || ["."])];
|
|
23
36
|
const result = await biome(args, cwd);
|
|
24
37
|
const data = parseBiomeJson(result.stdout);
|
|
25
|
-
return
|
|
38
|
+
return compactDualOutput(data, result.stdout, formatLint, compactLintMap, formatLintCompact, compact === false);
|
|
26
39
|
});
|
|
27
40
|
}
|
|
28
41
|
//# sourceMappingURL=biome-check.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"biome-check.js","sourceRoot":"","sources":["../../src/tools/biome-check.ts"],"names":[],"mappings":"AAAA,OAAO,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AAI,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,EAAE;QACpC,MAAM,GAAG,GAAG,IAAI,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;QAClC,KAAK,MAAM,CAAC,IAAI,QAAQ,IAAI,EAAE,EAAE,CAAC;YAC/B,qBAAqB,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC;QACvC,CAAC;QACD,MAAM,IAAI,GAAG,CAAC,OAAO,EAAE,iBAAiB,EAAE,GAAG,CAAC,QAAQ,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QAElE,MAAM,MAAM,GAAG,MAAM,KAAK,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;QACtC,MAAM,IAAI,GAAG,cAAc,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QAC3C,OAAO,iBAAiB,CACtB,IAAI,EACJ,MAAM,CAAC,MAAM,EACb,UAAU,EACV,cAAc,EACd,iBAAiB,EACjB,OAAO,KAAK,KAAK,CAClB,CAAC;IACJ,CAAC,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"biome-format.d.ts","sourceRoot":"","sources":["../../src/tools/biome-format.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;
|
|
1
|
+
{"version":3,"file":"biome-format.d.ts","sourceRoot":"","sources":["../../src/tools/biome-format.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAWzE,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,SAAS,QAgDxD"}
|
|
@@ -1,28 +1,41 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import {
|
|
2
|
+
import { compactDualOutput, assertNoFlagInjection, INPUT_LIMITS } from "@paretools/shared";
|
|
3
3
|
import { biome } from "../lib/lint-runner.js";
|
|
4
4
|
import { parseBiomeFormat } from "../lib/parsers.js";
|
|
5
|
-
import { formatFormatWrite } from "../lib/formatters.js";
|
|
5
|
+
import { formatFormatWrite, compactFormatWriteMap, formatFormatWriteCompact, } from "../lib/formatters.js";
|
|
6
6
|
import { FormatWriteResultSchema } from "../schemas/index.js";
|
|
7
7
|
export function registerBiomeFormatTool(server) {
|
|
8
8
|
server.registerTool("biome-format", {
|
|
9
9
|
title: "Biome Format",
|
|
10
10
|
description: "Formats files with Biome (format --write) and returns a structured list of changed files. Use instead of running `biome format --write` in the terminal.",
|
|
11
11
|
inputSchema: {
|
|
12
|
-
path: z
|
|
12
|
+
path: z
|
|
13
|
+
.string()
|
|
14
|
+
.max(INPUT_LIMITS.PATH_MAX)
|
|
15
|
+
.optional()
|
|
16
|
+
.describe("Project root path (default: cwd)"),
|
|
13
17
|
patterns: z
|
|
14
|
-
.array(z.string())
|
|
18
|
+
.array(z.string().max(INPUT_LIMITS.PATH_MAX))
|
|
19
|
+
.max(INPUT_LIMITS.ARRAY_MAX)
|
|
15
20
|
.optional()
|
|
16
21
|
.default(["."])
|
|
17
22
|
.describe("File patterns to format (default: ['.'])"),
|
|
23
|
+
compact: z
|
|
24
|
+
.boolean()
|
|
25
|
+
.optional()
|
|
26
|
+
.default(true)
|
|
27
|
+
.describe("Auto-compact when structured output exceeds raw CLI tokens. Set false to always get full schema."),
|
|
18
28
|
},
|
|
19
29
|
outputSchema: FormatWriteResultSchema,
|
|
20
|
-
}, async ({ path, patterns }) => {
|
|
30
|
+
}, async ({ path, patterns, compact }) => {
|
|
21
31
|
const cwd = path || process.cwd();
|
|
32
|
+
for (const p of patterns ?? []) {
|
|
33
|
+
assertNoFlagInjection(p, "patterns");
|
|
34
|
+
}
|
|
22
35
|
const args = ["format", "--write", ...(patterns || ["."])];
|
|
23
36
|
const result = await biome(args, cwd);
|
|
24
37
|
const data = parseBiomeFormat(result.stdout, result.stderr, result.exitCode);
|
|
25
|
-
return
|
|
38
|
+
return compactDualOutput(data, result.stdout, formatFormatWrite, compactFormatWriteMap, formatFormatWriteCompact, compact === false);
|
|
26
39
|
});
|
|
27
40
|
}
|
|
28
41
|
//# sourceMappingURL=biome-format.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"biome-format.js","sourceRoot":"","sources":["../../src/tools/biome-format.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"biome-format.js","sourceRoot":"","sources":["../../src/tools/biome-format.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAC3F,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EACL,iBAAiB,EACjB,qBAAqB,EACrB,wBAAwB,GACzB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAE9D,MAAM,UAAU,uBAAuB,CAAC,MAAiB;IACvD,MAAM,CAAC,YAAY,CACjB,cAAc,EACd;QACE,KAAK,EAAE,cAAc;QACrB,WAAW,EACT,0JAA0J;QAC5J,WAAW,EAAE;YACX,IAAI,EAAE,CAAC;iBACJ,MAAM,EAAE;iBACR,GAAG,CAAC,YAAY,CAAC,QAAQ,CAAC;iBAC1B,QAAQ,EAAE;iBACV,QAAQ,CAAC,kCAAkC,CAAC;YAC/C,QAAQ,EAAE,CAAC;iBACR,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;iBAC5C,GAAG,CAAC,YAAY,CAAC,SAAS,CAAC;iBAC3B,QAAQ,EAAE;iBACV,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC;iBACd,QAAQ,CAAC,0CAA0C,CAAC;YACvD,OAAO,EAAE,CAAC;iBACP,OAAO,EAAE;iBACT,QAAQ,EAAE;iBACV,OAAO,CAAC,IAAI,CAAC;iBACb,QAAQ,CACP,kGAAkG,CACnG;SACJ;QACD,YAAY,EAAE,uBAAuB;KACtC,EACD,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,EAAE;QACpC,MAAM,GAAG,GAAG,IAAI,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;QAClC,KAAK,MAAM,CAAC,IAAI,QAAQ,IAAI,EAAE,EAAE,CAAC;YAC/B,qBAAqB,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC;QACvC,CAAC;QACD,MAAM,IAAI,GAAG,CAAC,QAAQ,EAAE,SAAS,EAAE,GAAG,CAAC,QAAQ,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QAE3D,MAAM,MAAM,GAAG,MAAM,KAAK,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;QACtC,MAAM,IAAI,GAAG,gBAAgB,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,QAAQ,CAAC,CAAC;QAC7E,OAAO,iBAAiB,CACtB,IAAI,EACJ,MAAM,CAAC,MAAM,EACb,iBAAiB,EACjB,qBAAqB,EACrB,wBAAwB,EACxB,OAAO,KAAK,KAAK,CAClB,CAAC;IACJ,CAAC,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"format-check.d.ts","sourceRoot":"","sources":["../../src/tools/format-check.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;
|
|
1
|
+
{"version":3,"file":"format-check.d.ts","sourceRoot":"","sources":["../../src/tools/format-check.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAWzE,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,SAAS,QAgDxD"}
|
|
@@ -1,28 +1,41 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import {
|
|
2
|
+
import { compactDualOutput, assertNoFlagInjection, INPUT_LIMITS } from "@paretools/shared";
|
|
3
3
|
import { prettier } from "../lib/lint-runner.js";
|
|
4
4
|
import { parsePrettierCheck } from "../lib/parsers.js";
|
|
5
|
-
import { formatFormatCheck } from "../lib/formatters.js";
|
|
5
|
+
import { formatFormatCheck, compactFormatCheckMap, formatFormatCheckCompact, } from "../lib/formatters.js";
|
|
6
6
|
import { FormatCheckResultSchema } from "../schemas/index.js";
|
|
7
7
|
export function registerFormatCheckTool(server) {
|
|
8
8
|
server.registerTool("format-check", {
|
|
9
9
|
title: "Prettier Check",
|
|
10
10
|
description: "Checks if files are formatted and returns a structured list of files needing formatting. Use instead of running `prettier --check` in the terminal.",
|
|
11
11
|
inputSchema: {
|
|
12
|
-
path: z
|
|
12
|
+
path: z
|
|
13
|
+
.string()
|
|
14
|
+
.max(INPUT_LIMITS.PATH_MAX)
|
|
15
|
+
.optional()
|
|
16
|
+
.describe("Project root path (default: cwd)"),
|
|
13
17
|
patterns: z
|
|
14
|
-
.array(z.string())
|
|
18
|
+
.array(z.string().max(INPUT_LIMITS.PATH_MAX))
|
|
19
|
+
.max(INPUT_LIMITS.ARRAY_MAX)
|
|
15
20
|
.optional()
|
|
16
21
|
.default(["."])
|
|
17
22
|
.describe("File patterns to check (default: ['.'])"),
|
|
23
|
+
compact: z
|
|
24
|
+
.boolean()
|
|
25
|
+
.optional()
|
|
26
|
+
.default(true)
|
|
27
|
+
.describe("Auto-compact when structured output exceeds raw CLI tokens. Set false to always get full schema."),
|
|
18
28
|
},
|
|
19
29
|
outputSchema: FormatCheckResultSchema,
|
|
20
|
-
}, async ({ path, patterns }) => {
|
|
30
|
+
}, async ({ path, patterns, compact }) => {
|
|
21
31
|
const cwd = path || process.cwd();
|
|
32
|
+
for (const p of patterns ?? []) {
|
|
33
|
+
assertNoFlagInjection(p, "patterns");
|
|
34
|
+
}
|
|
22
35
|
const args = ["--check", ...(patterns || ["."])];
|
|
23
36
|
const result = await prettier(args, cwd);
|
|
24
37
|
const data = parsePrettierCheck(result.stdout, result.stderr, result.exitCode);
|
|
25
|
-
return
|
|
38
|
+
return compactDualOutput(data, result.stdout, formatFormatCheck, compactFormatCheckMap, formatFormatCheckCompact, compact === false);
|
|
26
39
|
});
|
|
27
40
|
}
|
|
28
41
|
//# sourceMappingURL=format-check.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"format-check.js","sourceRoot":"","sources":["../../src/tools/format-check.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"format-check.js","sourceRoot":"","sources":["../../src/tools/format-check.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAC3F,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EACL,iBAAiB,EACjB,qBAAqB,EACrB,wBAAwB,GACzB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAE9D,MAAM,UAAU,uBAAuB,CAAC,MAAiB;IACvD,MAAM,CAAC,YAAY,CACjB,cAAc,EACd;QACE,KAAK,EAAE,gBAAgB;QACvB,WAAW,EACT,qJAAqJ;QACvJ,WAAW,EAAE;YACX,IAAI,EAAE,CAAC;iBACJ,MAAM,EAAE;iBACR,GAAG,CAAC,YAAY,CAAC,QAAQ,CAAC;iBAC1B,QAAQ,EAAE;iBACV,QAAQ,CAAC,kC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3,"file":"lint.d.ts","sourceRoot":"","sources":["../../src/tools/lint.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAOzE,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,SAAS,
|
|
1
|
+
{"version":3,"file":"lint.d.ts","sourceRoot":"","sources":["../../src/tools/lint.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAOzE,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,SAAS,QAkDjD"}
|
package/dist/tools/lint.js
CHANGED
|
@@ -1,31 +1,44 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import {
|
|
2
|
+
import { compactDualOutput, assertNoFlagInjection, INPUT_LIMITS } from "@paretools/shared";
|
|
3
3
|
import { eslint } from "../lib/lint-runner.js";
|
|
4
4
|
import { parseEslintJson } from "../lib/parsers.js";
|
|
5
|
-
import { formatLint } from "../lib/formatters.js";
|
|
5
|
+
import { formatLint, compactLintMap, formatLintCompact } from "../lib/formatters.js";
|
|
6
6
|
import { LintResultSchema } from "../schemas/index.js";
|
|
7
7
|
export function registerLintTool(server) {
|
|
8
8
|
server.registerTool("lint", {
|
|
9
9
|
title: "ESLint Check",
|
|
10
10
|
description: "Runs ESLint and returns structured diagnostics (file, line, rule, severity, message). Use instead of running `eslint` in the terminal.",
|
|
11
11
|
inputSchema: {
|
|
12
|
-
path: z
|
|
12
|
+
path: z
|
|
13
|
+
.string()
|
|
14
|
+
.max(INPUT_LIMITS.PATH_MAX)
|
|
15
|
+
.optional()
|
|
16
|
+
.describe("Project root path (default: cwd)"),
|
|
13
17
|
patterns: z
|
|
14
|
-
.array(z.string())
|
|
18
|
+
.array(z.string().max(INPUT_LIMITS.PATH_MAX))
|
|
19
|
+
.max(INPUT_LIMITS.ARRAY_MAX)
|
|
15
20
|
.optional()
|
|
16
21
|
.default(["."])
|
|
17
22
|
.describe("File patterns to lint (default: ['.'])"),
|
|
18
23
|
fix: z.boolean().optional().default(false).describe("Auto-fix problems"),
|
|
24
|
+
compact: z
|
|
25
|
+
.boolean()
|
|
26
|
+
.optional()
|
|
27
|
+
.default(true)
|
|
28
|
+
.describe("Auto-compact when structured output exceeds raw CLI tokens. Set false to always get full schema."),
|
|
19
29
|
},
|
|
20
30
|
outputSchema: LintResultSchema,
|
|
21
|
-
}, async ({ path, patterns, fix }) => {
|
|
31
|
+
}, async ({ path, patterns, fix, compact }) => {
|
|
22
32
|
const cwd = path || process.cwd();
|
|
33
|
+
for (const p of patterns ?? []) {
|
|
34
|
+
assertNoFlagInjection(p, "patterns");
|
|
35
|
+
}
|
|
23
36
|
const args = ["--format", "json", ...(patterns || ["."])];
|
|
24
37
|
if (fix)
|
|
25
38
|
args.push("--fix");
|
|
26
39
|
const result = await eslint(args, cwd);
|
|
27
40
|
const data = parseEslintJson(result.stdout);
|
|
28
|
-
return
|
|
41
|
+
return compactDualOutput(data, result.stdout, formatLint, compactLintMap, formatLintCompact, compact === false);
|
|
29
42
|
});
|
|
30
43
|
}
|
|
31
44
|
//# sourceMappingURL=lint.js.map
|
package/dist/tools/lint.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lint.js","sourceRoot":"","sources":["../../src/tools/lint.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"lint.js","sourceRoot":"","sources":["../../src/tools/lint.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAC3F,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,UAAU,EAA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GAAG,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,CAAC,QAAQ,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QAC1D,IAAI,GAAG;YAAE,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAE5B,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;QACvC,MAAM,IAAI,GAAG,eAAe,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QAC5C,OAAO,iBAAiB,CACtB,IAAI,EACJ,MAAM,CAAC,MAAM,EACb,UAAU,EACV,cAAc,EACd,iBAAiB,EACjB,OAAO,KAAK,KAAK,CAClB,CAAC;IACJ,CAAC,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prettier-format.d.ts","sourceRoot":"","sources":["../../src/tools/prettier-format.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;
|
|
1
|
+
{"version":3,"file":"prettier-format.d.ts","sourceRoot":"","sources":["../../src/tools/prettier-format.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAWzE,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,SAAS,QAgD3D"}
|
|
@@ -1,28 +1,41 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import {
|
|
2
|
+
import { compactDualOutput, assertNoFlagInjection, INPUT_LIMITS } from "@paretools/shared";
|
|
3
3
|
import { prettier } from "../lib/lint-runner.js";
|
|
4
4
|
import { parsePrettierWrite } from "../lib/parsers.js";
|
|
5
|
-
import { formatFormatWrite } from "../lib/formatters.js";
|
|
5
|
+
import { formatFormatWrite, compactFormatWriteMap, formatFormatWriteCompact, } from "../lib/formatters.js";
|
|
6
6
|
import { FormatWriteResultSchema } from "../schemas/index.js";
|
|
7
7
|
export function registerPrettierFormatTool(server) {
|
|
8
8
|
server.registerTool("prettier-format", {
|
|
9
9
|
title: "Prettier Format",
|
|
10
10
|
description: "Formats files with Prettier (--write) and returns a structured list of changed files. Use instead of running `prettier --write` in the terminal.",
|
|
11
11
|
inputSchema: {
|
|
12
|
-
path: z
|
|
12
|
+
path: z
|
|
13
|
+
.string()
|
|
14
|
+
.max(INPUT_LIMITS.PATH_MAX)
|
|
15
|
+
.optional()
|
|
16
|
+
.describe("Project root path (default: cwd)"),
|
|
13
17
|
patterns: z
|
|
14
|
-
.array(z.string())
|
|
18
|
+
.array(z.string().max(INPUT_LIMITS.PATH_MAX))
|
|
19
|
+
.max(INPUT_LIMITS.ARRAY_MAX)
|
|
15
20
|
.optional()
|
|
16
21
|
.default(["."])
|
|
17
22
|
.describe("File patterns to format (default: ['.'])"),
|
|
23
|
+
compact: z
|
|
24
|
+
.boolean()
|
|
25
|
+
.optional()
|
|
26
|
+
.default(true)
|
|
27
|
+
.describe("Auto-compact when structured output exceeds raw CLI tokens. Set false to always get full schema."),
|
|
18
28
|
},
|
|
19
29
|
outputSchema: FormatWriteResultSchema,
|
|
20
|
-
}, async ({ path, patterns }) => {
|
|
30
|
+
}, async ({ path, patterns, compact }) => {
|
|
21
31
|
const cwd = path || process.cwd();
|
|
32
|
+
for (const p of patterns ?? []) {
|
|
33
|
+
assertNoFlagInjection(p, "patterns");
|
|
34
|
+
}
|
|
22
35
|
const args = ["--write", ...(patterns || ["."])];
|
|
23
36
|
const result = await prettier(args, cwd);
|
|
24
37
|
const data = parsePrettierWrite(result.stdout, result.stderr, result.exitCode);
|
|
25
|
-
return
|
|
38
|
+
return compactDualOutput(data, result.stdout, formatFormatWrite, compactFormatWriteMap, formatFormatWriteCompact, compact === false);
|
|
26
39
|
});
|
|
27
40
|
}
|
|
28
41
|
//# sourceMappingURL=prettier-format.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prettier-format.js","sourceRoot":"","sources":["../../src/tools/prettier-format.ts"],"names":[],"m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AuB;KACtC,EACD,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,EAAE;QACpC,MAAM,GAAG,GAAG,IAAI,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;QAClC,KAAK,MAAM,CAAC,IAAI,QAAQ,IAAI,EAAE,EAAE,CAAC;YAC/B,qBAAqB,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC;QACvC,CAAC;QACD,MAAM,IAAI,GAAG,CAAC,SAAS,EAAE,GAAG,CAAC,QAAQ,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QAEjD,MAAM,MAAM,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;QACzC,MAAM,IAAI,GAAG,kBAAkB,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,QAAQ,CAAC,CAAC;QAC/E,OAAO,iBAAiB,CACtB,IAAI,EACJ,MAAM,CAAC,MAAM,EACb,iBAAiB,EACjB,qBAAqB,EACrB,wBAAwB,EACxB,OAAO,KAAK,KAAK,CAClB,CAAC;IACJ,CAAC,CACF,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@paretools/lint",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"mcpName": "io.github.Dave-London/lint",
|
|
5
5
|
"description": "MCP server for linters (ESLint, Prettier, Biome) with structured, token-efficient output",
|
|
6
6
|
"license": "MIT",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"linting",
|
|
24
24
|
"formatter"
|
|
25
25
|
],
|
|
26
|
-
"homepage": "https://github.com/Dave-London/
|
|
26
|
+
"homepage": "https://github.com/Dave-London/Pare/tree/main/packages/server-lint",
|
|
27
27
|
"engines": {
|
|
28
28
|
"node": ">=20"
|
|
29
29
|
},
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
},
|
|
43
43
|
"repository": {
|
|
44
44
|
"type": "git",
|
|
45
|
-
"url": "https://github.com/Dave-London/
|
|
45
|
+
"url": "https://github.com/Dave-London/Pare.git",
|
|
46
46
|
"directory": "packages/server-lint"
|
|
47
47
|
},
|
|
48
48
|
"files": [
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"dependencies": {
|
|
52
52
|
"@modelcontextprotocol/sdk": "^1.26.0",
|
|
53
53
|
"zod": "^4.3.6",
|
|
54
|
-
"@paretools/shared": "0.
|
|
54
|
+
"@paretools/shared": "0.6.0"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
57
|
"@types/node": "^25.2.3",
|