Skip to content

Commit 9b54aca

Browse files
committed
Replace inline eslint-disable comments with file-level disable for no-console rule
- Moved `/* eslint-disable no-console */` to top of files in CLI reporters, run-cli, and task scripts - Removed inline `// eslint-disable-next-line no-console` comments before each console statement - Applied to console.ts, json.ts, run-cli.ts, build-txt.ts, generate-config-schema.ts, and transform-dts.ts - Improves code readability by consolidating ESLint rule overrides at file level
1 parent 959bd1b commit 9b54aca

6 files changed

Lines changed: 6 additions & 8 deletions

File tree

src/cli/reporters/console.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable no-console */
12
import path, { type ParsedPath } from 'node:path';
23

34
import { Chalk, type ChalkInstance, type Options as ChalkOptions } from 'chalk';
@@ -140,7 +141,6 @@ export class LinterConsoleReporter implements LinterCliReporter {
140141
output += DOUBLE_NEWLINE;
141142
output += timeOutput;
142143

143-
// eslint-disable-next-line no-console
144144
console.log(output);
145145
return;
146146
}
@@ -275,7 +275,6 @@ export class LinterConsoleReporter implements LinterCliReporter {
275275
// Linting time
276276
output += timeOutput;
277277

278-
// eslint-disable-next-line no-console
279278
console[anyErrors ? 'error' : 'warn'](output);
280279
};
281280
}

src/cli/reporters/json.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable no-console */
12
import path, { type ParsedPath } from 'node:path';
23

34
import { type AnyLinterResult } from '../../linter/fixer';
@@ -40,7 +41,6 @@ export class LinterJsonReporter implements LinterCliReporter {
4041
}
4142

4243
// Output as JSON
43-
// eslint-disable-next-line no-console
4444
console.log(JSON.stringify(sortedResults, null, 2));
4545
};
4646
}

src/cli/run-cli.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable no-console */
12
/**
23
* Main CLI execution logic.
34
*
@@ -307,7 +308,6 @@ export async function runCli(context?: Partial<CliContext>): Promise<CliResult>
307308
const useColors = options?.color ?? (ctx.stderr.isTTY ?? false);
308309
const errorMessage = prefix + await getFormattedError(error, { colors: useColors });
309310

310-
// eslint-disable-next-line no-console
311311
console.error(errorMessage);
312312

313313
return { exitCode: 2, error: errorMessage };

tasks/build-txt.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable no-console */
12
/**
23
* @file Output the version number to a build.txt file.
34
*/
@@ -37,7 +38,6 @@ const main = (): void => {
3738
const file = path.resolve(distFolderLocation, OUTPUT_FILE_NAME);
3839
fs.writeFileSync(file, content);
3940

40-
// eslint-disable-next-line no-console
4141
console.log(`Wrote ${content} to ${file} was successful`);
4242
};
4343

tasks/generate-config-schema.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable no-console */
12
/**
23
* @file Generate JSON schema for AGLint configuration files.
34
*
@@ -50,10 +51,8 @@ const main = async (): Promise<void> => {
5051
'utf-8',
5152
);
5253

53-
// eslint-disable-next-line no-console
5454
console.log(`✓ Successfully generated JSON schema at ${outputFileLocation}`);
5555
} catch (error) {
56-
// eslint-disable-next-line no-console
5756
console.error('✗ Failed to generate JSON schema:', error);
5857
throw error;
5958
}

tasks/transform-dts.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable no-console */
12
/**
23
* @file Fixes import/export paths in generated `.d.ts` files to conform to NodeNext ESM resolution rules.
34
*
@@ -119,5 +120,4 @@ for (const sf of project.getSourceFiles()) {
119120

120121
await project.save();
121122

122-
// eslint-disable-next-line no-console
123123
console.log(`✔ ${EXT_DTS} imports fixed to NodeNext module resolution`);

0 commit comments

Comments
 (0)