Lint the scripts directory
`scripts` sat in oxlint's ignorePatterns since c94c30e, grouped with
dist, coverage and .pnpm-store. Those are build artifacts; scripts holds
the quality gates themselves, which went unlinted as a result.
Removing it raises coverage from 265 to 273 files and surfaced four
findings:
prefer-regexp-exec in three files — swapped String#match for RegExp#exec.
All three patterns are non-global, where the two methods return the same
result, so behaviour is unchanged.
require-array-sort-compare in generate-bestiary-index.mjs — the rule
skips string arrays, and fired only because `new Set()` infers Set<any>.
Typed it Set<string>, which it already is, rather than adding a
comparator the bare sort does not need.
Also anchors the lint-gate probe's no-console canary to CLI scripts that
exist to write to the console, rather than to app error paths that could
reasonably be removed.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
+1
-2
@@ -22,7 +22,6 @@
|
||||
".claude",
|
||||
".specify",
|
||||
"specs",
|
||||
".pnpm-store",
|
||||
"scripts"
|
||||
".pnpm-store"
|
||||
]
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@ function checkFile(file, forbidden) {
|
||||
const lines = content.split("\n");
|
||||
|
||||
for (let i = 0; i < lines.length; i++) {
|
||||
const match = lines[i].match(IMPORT_RE);
|
||||
const match = IMPORT_RE.exec(lines[i]);
|
||||
if (!match) continue;
|
||||
|
||||
const importPath = match[1] || match[2];
|
||||
|
||||
@@ -23,7 +23,7 @@ for (const file of findFiles()) {
|
||||
const lines = readFileSync(file, "utf-8").split("\n");
|
||||
|
||||
for (let i = 0; i < lines.length; i++) {
|
||||
const match = lines[i].match(IGNORE_PATTERN);
|
||||
const match = IGNORE_PATTERN.exec(lines[i]);
|
||||
if (!match) continue;
|
||||
|
||||
count++;
|
||||
|
||||
@@ -108,6 +108,7 @@ const files = readdirSync(BESTIARY_DIR).filter(
|
||||
);
|
||||
|
||||
const creatures = [];
|
||||
/** @type {Set<string>} */
|
||||
const unmappedSources = new Set();
|
||||
|
||||
for (const file of files.sort()) {
|
||||
|
||||
Reference in New Issue
Block a user