Skip to content

Commit 9217498

Browse files
committed
Add two logging commands to the lint command
1 parent 197ba12 commit 9217498

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

lib/buildtools/src/commands/prebuild.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { outDir } from '@sourceacademy/modules-repotools/getGitRoot';
44
import { resolveEitherBundleOrTab } from '@sourceacademy/modules-repotools/manifest';
55
import { divideAndRound } from '@sourceacademy/modules-repotools/utils';
66
import chalk from 'chalk';
7-
import type { ESLint } from 'eslint';
7+
import { ESLint } from 'eslint';
88
import { runPrebuild } from '../prebuild/index.js';
99
import { formatLintResult, lintGlobal, runEslint } from '../prebuild/lint.js';
1010
import { formatTscResult, runTsc } from '../prebuild/tsc.js';
@@ -53,7 +53,13 @@ export const getLintCommand = () => new Command('lint')
5353
logCommandErrorAndExit(resolveResult);
5454
}
5555

56-
const result = await runEslint(resolveResult.asset, opts);
56+
const prefix = chalk.blueBright('[lintglobal]');
57+
console.log(`${prefix} ${chalk.cyanBright(`Running ESLint v${ESLint.version}`)}`);
58+
const { asset } = resolveResult;
59+
60+
console.log(`${prefix} ${chalk.cyanBright(`Linting ${asset.name} ${asset.type}`)}`);
61+
62+
const result = await runEslint(asset, opts);
5763
console.log(formatLintResult(result));
5864

5965
switch (result.severity) {
@@ -75,6 +81,7 @@ export const getLintGlobalCommand = () => new Command('lintglobal')
7581
.action(async ({ ci, ...opts }) => {
7682
const prefix = chalk.blueBright('[lintglobal]');
7783

84+
console.log(`${prefix} ${chalk.cyanBright(`Running ESLint v${ESLint.version}`)}`);
7885
console.log(`${prefix} ${chalk.cyanBright('Beginning linting with the following options:')}`);
7986
Object.entries(opts).forEach(([key, value], i) => {
8087
console.log(` ${i+1}. ${chalk.greenBright(key)}: ${chalk.cyanBright(value)}`);

0 commit comments

Comments
 (0)