@spardutti/claude-skills 2.53.0 → 2.53.1
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 +1 -1
- package/hooks/lint-ratchet.mjs +5 -1
- package/lib/setup-hook.mjs +1 -2
- package/package.json +1 -1
package/README.md
CHANGED
package/hooks/lint-ratchet.mjs
CHANGED
|
@@ -42,7 +42,7 @@ function eslint(rules, target) {
|
|
|
42
42
|
const results = eslintOnce(rules, target);
|
|
43
43
|
const core = rules.filter((r) => !r.id.includes("/"));
|
|
44
44
|
if (results || core.length === rules.length) return { results, ran: rules };
|
|
45
|
-
return { results: eslintOnce(core, target), ran: core };
|
|
45
|
+
return { results: core.length ? eslintOnce(core, target) : [], ran: core };
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
function eslintOnce(rules, target) {
|
|
@@ -84,11 +84,15 @@ function baseline(only, newOnly) {
|
|
|
84
84
|
const lint = existsSync(ESLINT) ? LINT.filter(pick) : [];
|
|
85
85
|
const text = TEXT.filter(pick);
|
|
86
86
|
if (newOnly && was.exists && lint.length + text.length === 0) return 0;
|
|
87
|
+
if (newOnly) console.log(` Recording old code as baseline debt for: ${[...lint, ...text].map((r) => r.id).join(" ")}`);
|
|
87
88
|
const { results, ran } = lint.length ? eslint(lint, ".") : { results: [], ran: [] };
|
|
88
89
|
if (!results) {
|
|
89
90
|
console.error("lint-ratchet: eslint gave no JSON; baseline not written.");
|
|
90
91
|
return 1;
|
|
91
92
|
}
|
|
93
|
+
const cannot = lint.filter((r) => !ran.includes(r)).map((r) => r.id);
|
|
94
|
+
if (cannot.length) console.log(`lint-ratchet: ESLint could not run ${cannot.join(" ")}; its plugin is not in the ESLint config.`);
|
|
95
|
+
if (newOnly && was.exists && ran.length + text.length === 0) return 0;
|
|
92
96
|
const found = [...eslintFindings(results), ...projectFiles(ROOT).flatMap((rel) => textFindings(text, ROOT, rel))];
|
|
93
97
|
const judged = new Set([...ran, ...text].map((r) => r.id));
|
|
94
98
|
const n = writeBaseline(BASELINE, mergeBaseline(was, countBy(found), judged), new Set([...was.rules, ...judged]));
|
package/lib/setup-hook.mjs
CHANGED
|
@@ -121,9 +121,8 @@ function writeBaselines(dir, hooksDir) {
|
|
|
121
121
|
spawnSync("bash", [join(hooksDir, LINE_LIMIT_FILENAME), "--baseline"],
|
|
122
122
|
{ cwd: root, env: { ...process.env, LINE_LIMIT_ROOT: root }, stdio: "ignore" });
|
|
123
123
|
}
|
|
124
|
-
console.log(" Recording old code as baseline debt (runs ESLint once per new rule)...");
|
|
125
124
|
spawnSync(process.execPath, [join(hooksDir, LINT_RATCHET_FILENAME), "--baseline-new"],
|
|
126
|
-
{ cwd: dir, stdio: "ignore", timeout: 600_000 });
|
|
125
|
+
{ cwd: dir, stdio: ["ignore", "inherit", "ignore"], timeout: 600_000 });
|
|
127
126
|
}
|
|
128
127
|
|
|
129
128
|
export async function setupHook(targetDir = process.cwd()) {
|