chore: apply core lint cleanups

This commit is contained in:
Peter Steinberger
2026-04-23 05:28:11 +01:00
parent cc9dcd3d69
commit 596b88986d
41 changed files with 85 additions and 82 deletions

View File

@@ -456,7 +456,8 @@ export function collectForbiddenPackPaths(paths: Iterable<string>): string[] {
return [...paths]
.filter(
(path) =>
forbiddenPrefixes.some((prefix) => path.startsWith(prefix)) || /node_modules\//.test(path),
forbiddenPrefixes.some((prefix) => path.startsWith(prefix)) ||
path.includes("node_modules/"),
)
.toSorted((left, right) => left.localeCompare(right));
}

View File

@@ -13,7 +13,7 @@ import {
const logLevel = process.env.OPENCLAW_BUILD_VERBOSE ? "info" : "warn";
const extraArgs = process.argv.slice(2);
const INEFFECTIVE_DYNAMIC_IMPORT_RE = /\[INEFFECTIVE_DYNAMIC_IMPORT\]/;
const INEFFECTIVE_DYNAMIC_IMPORT_MARKER = "[INEFFECTIVE_DYNAMIC_IMPORT]";
const UNRESOLVED_IMPORT_RE = /\[UNRESOLVED_IMPORT\]/;
const ANSI_ESCAPE_RE = new RegExp(String.raw`\u001B\[[0-9;]*m`, "g");
const HASHED_ROOT_JS_RE = /^(?<base>.+)-[A-Za-z0-9_-]+\.js$/u;
@@ -170,7 +170,7 @@ export function createTsdownOutputScanner(params = {}) {
return {
append(chunk) {
const text = Buffer.isBuffer(chunk) ? chunk.toString("utf8") : String(chunk);
if (INEFFECTIVE_DYNAMIC_IMPORT_RE.test(text)) {
if (text.includes(INEFFECTIVE_DYNAMIC_IMPORT_MARKER)) {
hasIneffectiveDynamicImport = true;
}
scanLines(text);