Skip to content

Commit 5877752

Browse files
committed
ci(lint): enable no-console rule (#16053)
Enable `no-console` rule in our linting setup. Add `oxlint-disable` comments where we do want to log (in scripts).
1 parent f7d7874 commit 5877752

File tree

15 files changed

+32
-3
lines changed

15 files changed

+32
-3
lines changed

.github/scripts/check-conformance-changes.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#!/usr/bin/env node
22

3+
// oxlint-disable no-console
4+
35
/**
46
* Check if conformance tests should run based on changed files.
57
* Uses cargo tree to determine dependencies of oxc_coverage crate.

.github/scripts/generate-benchmark-matrix.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#!/usr/bin/env node
22

3+
// oxlint-disable no-console
4+
35
/**
46
* Generate a dynamic matrix for benchmark jobs based on affected components.
57
* This script determines which benchmark components need to run based on changed files.

.github/scripts/get-changed-files.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#!/usr/bin/env node
22

3+
// oxlint-disable no-console
4+
35
/**
46
* Get changed files from GitHub events (pull request or push).
57
* This module provides a reusable function for detecting changed files.

.github/scripts/utils.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
* Common utilities for GitHub Actions scripts
33
*/
44

5+
// oxlint-disable no-console
6+
57
const { execSync } = require('child_process');
68

79
/**

apps/oxfmt/scripts/build.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// oxlint-disable no-console
2+
13
import { execSync } from 'node:child_process';
24
import { copyFileSync, mkdirSync, readdirSync, readFileSync, writeFileSync } from 'node:fs';
35
import { join } from 'node:path';

apps/oxlint/scripts/build.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// oxlint-disable no-console
2+
13
import { execSync } from 'node:child_process';
24
import { copyFileSync, readdirSync, readFileSync, rmSync, writeFileSync } from 'node:fs';
35
import { join } from 'node:path';

crates/oxc_traverse/scripts/build.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ await Promise.all([
4444
async function writeToFile(filename, code) {
4545
code = `${PREAMBLE}${code}`;
4646
const path = pathJoin(outputDirPath, filename);
47+
// oxlint-disable-next-line no-console
4748
console.log('Writing:', path);
4849
await writeFile(path, code);
4950
await execAsync(`rustfmt ${JSON.stringify(path)}`);

napi/parser/example.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,5 @@ const file = args.positionals[0] ?? 'test.js';
2525

2626
const code = fs.readFileSync(file, 'utf-8');
2727
const result = parseSync(file, code, args.values);
28-
// oxlint-disable-next-line typescript-eslint/no-misused-spread
28+
// oxlint-disable-next-line no-console, typescript-eslint/no-misused-spread
2929
console.dir({ ...result }, { depth: Infinity });
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { visitorKeys } from '@typescript-eslint/visitor-keys';
22

33
const keys = Object.entries(visitorKeys).map(([name, keys]) => ({ name, keys }));
4+
// oxlint-disable-next-line no-console
45
console.log(JSON.stringify(keys));

npm/oxfmt/scripts/generate-packages.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
// Code copied from [Rome](https://github.com/rome/tools/blob/lsp/v0.28.0/npm/rome/scripts/generate-packages.mjs)
22

3+
// oxlint-disable no-console
4+
35
import * as fs from 'node:fs';
46
import { resolve } from 'node:path';
57
import { fileURLToPath } from 'node:url';

0 commit comments

Comments
 (0)