chore: fix oxlint diagnostics

This commit is contained in:
hazre committed 2026-04-24 18:13:14 +02:00
1 parent 80a942a38e
commit e43ddecafd
53 files changed
+801 -390

No files matched your search

+1 -1
View File
@@ -182,7 +182,7 @@ const logger = new PrefixedLogger('[postinstall:knope]');
const { dim, red, green } = createTextHelpers({ useColor: logger.useColor });
if (process.env.GITHUB_ACTIONS && process.env.CI) {
logger.info(`${dim('Running in CI environment, skipping knope installation')}`);
logger.info(dim('Running in CI environment, skipping knope installation'));
process.exit(0);
}
+6 -3
View File
@@ -233,7 +233,7 @@ function collectReplacements(sourceFile, checker) {
}
visit(sourceFile);
return replacements.sort((left, right) => right.start - left.start);
return replacements.toSorted((left, right) => right.start - left.start);
}
async function main() {
@@ -260,6 +260,7 @@ async function main() {
const { dim, green } = createTextHelpers();
const changes = [];
const writePromises = [];
for (const sourceFile of program.getSourceFiles()) {
const filePath = path.normalize(sourceFile.fileName);
@@ -272,7 +273,7 @@ async function main() {
const updatedCode = applyTextReplacements(originalCode, replacements);
if (write) {
await fs.writeFile(filePath, updatedCode, 'utf8');
writePromises.push(fs.writeFile(filePath, updatedCode, 'utf8'));
}
changes.push({
@@ -281,8 +282,10 @@ async function main() {
});
}
await Promise.all(writePromises);
changes
.sort((left, right) => left.file.localeCompare(right.file))
.toSorted((left, right) => left.file.localeCompare(right.file))
.forEach((change) => {
console.log(
`${dim(change.file)}: ${green(`${change.replacements} matrix import rewrite(s)`)}`
+1 -1
View File
@@ -22,7 +22,7 @@ export const ANSI = {
export function shouldUseColor() {
if (process.env.NO_COLOR !== undefined) return false;
if (process.env.FORCE_COLOR && process.env.FORCE_COLOR !== '0') return true;
return Boolean(process.stdout.isTTY);
return process.stdout.isTTY;
}
/**