claudecode-linter 2.1.70-patch.3 → 2.1.70-patch.5
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 +8 -8
- package/dist/index.js +17 -14
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
[](https://snyk.io/test/github/retif/claudecode-linter)
|
|
7
7
|
[](https://socket.dev/npm/package/claudecode-linter)
|
|
8
8
|
|
|
9
|
-
Standalone linter for [Claude Code](https://docs.anthropic.com/en/docs/claude-code)
|
|
9
|
+
Standalone linter for [Claude Code](https://docs.anthropic.com/en/docs/claude-code) plugins and configuration files.
|
|
10
10
|
|
|
11
|
-
Validates `plugin.json`, `SKILL.md`, agent/command markdown, `hooks.json`, `mcp.json`, `settings.json`, and `CLAUDE.md` files with
|
|
11
|
+
Validates `plugin.json`, `SKILL.md`, agent/command markdown, `hooks.json`, `mcp.json`, `settings.json`, and `CLAUDE.md` files with 90 rules across 8 artifact types.
|
|
12
12
|
|
|
13
13
|

|
|
14
14
|
|
|
@@ -114,12 +114,12 @@ No issues found.
|
|
|
114
114
|
|------|-------|-------|
|
|
115
115
|
| plugin-json | `.claude-plugin/plugin.json` | 12 |
|
|
116
116
|
| skill-md | `skills/*/SKILL.md` | 11 |
|
|
117
|
-
| agent-md | `agents/*.md` |
|
|
118
|
-
| command-md | `commands/*.md` |
|
|
117
|
+
| agent-md | `agents/*.md` | 13 |
|
|
118
|
+
| command-md | `commands/*.md` | 5 |
|
|
119
119
|
| hooks-json | `hooks/hooks.json` | 9 |
|
|
120
|
-
| settings-json | `.claude-plugin/settings.json` |
|
|
121
|
-
| mcp-json | `.claude-plugin/mcp.json` |
|
|
122
|
-
| claude-md | `CLAUDE.md` |
|
|
120
|
+
| settings-json | `.claude-plugin/settings.json` | 14 |
|
|
121
|
+
| mcp-json | `.claude-plugin/mcp.json` | 16 |
|
|
122
|
+
| claude-md | `CLAUDE.md` | 10 |
|
|
123
123
|
|
|
124
124
|
## Configuration
|
|
125
125
|
|
|
@@ -219,7 +219,7 @@ Use `--changelog` to also write a `CHANGELOG_ENTRY.md` file with a markdown drif
|
|
|
219
219
|
npm run extract-contracts -- --changelog
|
|
220
220
|
```
|
|
221
221
|
|
|
222
|
-
This is automated in CI via `.
|
|
222
|
+
This is automated in CI via `.github/workflows/release.yml`.
|
|
223
223
|
|
|
224
224
|
## License
|
|
225
225
|
|
package/dist/index.js
CHANGED
|
@@ -3,6 +3,7 @@ import { readFileSync, writeFileSync, copyFileSync, existsSync } from "node:fs";
|
|
|
3
3
|
import { resolve, relative, dirname, join } from "node:path";
|
|
4
4
|
import { fileURLToPath } from "node:url";
|
|
5
5
|
import { Command } from "commander";
|
|
6
|
+
import pc from "picocolors";
|
|
6
7
|
import { loadConfig, mergeCliRules } from "./config.js";
|
|
7
8
|
import { discoverArtifacts } from "./discovery.js";
|
|
8
9
|
import { formatHuman } from "./formatters/human.js";
|
|
@@ -65,8 +66,8 @@ function simpleDiff(oldContent, newContent, filePath) {
|
|
|
65
66
|
const oldLines = oldContent.split("\n");
|
|
66
67
|
const newLines = newContent.split("\n");
|
|
67
68
|
const lines = [];
|
|
68
|
-
lines.push(`--- ${filePath}`);
|
|
69
|
-
lines.push(`+++ ${filePath} (fixed)`);
|
|
69
|
+
lines.push(pc.bold(`--- ${filePath}`));
|
|
70
|
+
lines.push(pc.bold(`+++ ${filePath} (fixed)`));
|
|
70
71
|
let i = 0;
|
|
71
72
|
let j = 0;
|
|
72
73
|
while (i < oldLines.length || j < newLines.length) {
|
|
@@ -78,17 +79,17 @@ function simpleDiff(oldContent, newContent, filePath) {
|
|
|
78
79
|
j++;
|
|
79
80
|
}
|
|
80
81
|
else if (oldLine !== undefined && newLine !== undefined) {
|
|
81
|
-
lines.push(`-${oldLine}`);
|
|
82
|
-
lines.push(`+${newLine}`);
|
|
82
|
+
lines.push(pc.red(`-${oldLine}`));
|
|
83
|
+
lines.push(pc.green(`+${newLine}`));
|
|
83
84
|
i++;
|
|
84
85
|
j++;
|
|
85
86
|
}
|
|
86
87
|
else if (oldLine !== undefined) {
|
|
87
|
-
lines.push(`-${oldLine}`);
|
|
88
|
+
lines.push(pc.red(`-${oldLine}`));
|
|
88
89
|
i++;
|
|
89
90
|
}
|
|
90
91
|
else {
|
|
91
|
-
lines.push(`+${newLine}`);
|
|
92
|
+
lines.push(pc.green(`+${newLine}`));
|
|
92
93
|
j++;
|
|
93
94
|
}
|
|
94
95
|
}
|
|
@@ -123,16 +124,18 @@ program
|
|
|
123
124
|
const targetDir = typeof opts.init === "string" ? resolve(opts.init) : process.cwd();
|
|
124
125
|
const targetFile = join(targetDir, ".claudecode-lint.yaml");
|
|
125
126
|
if (existsSync(targetFile)) {
|
|
126
|
-
process.stderr.write(`${targetFile} already exists\n`);
|
|
127
|
+
process.stderr.write(pc.red(`${targetFile} already exists\n`));
|
|
127
128
|
process.exit(1);
|
|
128
129
|
}
|
|
129
130
|
copyFileSync(defaultsFile, targetFile);
|
|
130
|
-
process.stdout.write(`Created ${targetFile}\n`);
|
|
131
|
+
process.stdout.write(pc.green(`Created ${targetFile}\n`));
|
|
131
132
|
process.exit(0);
|
|
132
133
|
}
|
|
133
134
|
if (opts.listRules) {
|
|
135
|
+
const sevColor = { error: pc.red, warning: pc.yellow, info: pc.blue };
|
|
134
136
|
for (const rule of ALL_RULES) {
|
|
135
|
-
|
|
137
|
+
const color = sevColor[rule.defaultSeverity];
|
|
138
|
+
process.stdout.write(`${rule.id}\t${color(rule.defaultSeverity)}\n`);
|
|
136
139
|
}
|
|
137
140
|
process.exit(0);
|
|
138
141
|
}
|
|
@@ -164,7 +167,7 @@ program
|
|
|
164
167
|
ignore: ignorePatterns,
|
|
165
168
|
});
|
|
166
169
|
if (artifacts.length === 0) {
|
|
167
|
-
process.stderr.write(`No plugin artifacts found in ${targetPath}\n`);
|
|
170
|
+
process.stderr.write(pc.yellow(`No plugin artifacts found in ${targetPath}\n`));
|
|
168
171
|
continue;
|
|
169
172
|
}
|
|
170
173
|
for (const artifact of artifacts) {
|
|
@@ -218,13 +221,13 @@ program
|
|
|
218
221
|
}
|
|
219
222
|
if (opts.format) {
|
|
220
223
|
if (formatted.length === 0) {
|
|
221
|
-
process.stdout.write("All files already formatted.\n");
|
|
224
|
+
process.stdout.write(pc.green("All files already formatted.\n"));
|
|
222
225
|
}
|
|
223
226
|
else {
|
|
224
227
|
for (const f of formatted) {
|
|
225
|
-
process.stdout.write(
|
|
228
|
+
process.stdout.write(`${pc.green("formatted")} ${f}\n`);
|
|
226
229
|
}
|
|
227
|
-
process.stdout.write(`\n${formatted.length} file${formatted.length === 1 ? "" : "s"} formatted
|
|
230
|
+
process.stdout.write(`\n${pc.green(`${formatted.length} file${formatted.length === 1 ? "" : "s"} formatted.`)}\n`);
|
|
228
231
|
}
|
|
229
232
|
process.exit(0);
|
|
230
233
|
}
|
|
@@ -238,7 +241,7 @@ program
|
|
|
238
241
|
process.exit(hasErrors ? 1 : 0);
|
|
239
242
|
}
|
|
240
243
|
catch (err) {
|
|
241
|
-
process.stderr.write(`Fatal error: ${err.message}\n`);
|
|
244
|
+
process.stderr.write(pc.red(`Fatal error: ${err.message}\n`));
|
|
242
245
|
process.exit(2);
|
|
243
246
|
}
|
|
244
247
|
});
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "claudecode-linter",
|
|
3
|
-
"version": "2.1.70-patch.
|
|
4
|
-
"description": "Standalone linter for Claude Code
|
|
3
|
+
"version": "2.1.70-patch.5",
|
|
4
|
+
"description": "Standalone linter for Claude Code plugins and configuration files",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
7
7
|
"claudecode-linter": "dist/index.js"
|