Skip to content

Commit dcf5df3

Browse files
committedFeb 11, 2025
Bright & dimmed issue type header colors in symbol reporter (close #934)
1 parent dd0f682 commit dcf5df3

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed
 

‎packages/knip/src/reporters/symbols.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { ROOT_WORKSPACE_NAME } from '../constants.js';
55
import type { Issue, ReporterOptions } from '../types/issues.js';
66
import { relative, toRelative } from '../util/path.js';
77
import { truncate } from '../util/string.js';
8-
import { getTitle, identity, logTitle } from './util.js';
8+
import { getTitle, identity, logTitle, logTitleDimmed } from './util.js';
99

1010
const dim = picocolors.gray;
1111
const bright = picocolors.whiteBright;
@@ -84,7 +84,7 @@ export default ({ report, issues, tagHints, configurationHints, noConfigHints, i
8484

8585
if (!noConfigHints) {
8686
if (configurationHints.size > 0) {
87-
logTitle('Configuration hints', configurationHints.size);
87+
logTitleDimmed('Configuration hints');
8888
for (const hint of configurationHints) {
8989
const { type, workspaceName, identifier } = hint;
9090
const message = `Unused item in ${type}`;

‎packages/knip/src/reporters/util.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ export const getTitle = (reportType: keyof typeof ISSUE_TYPE_TITLE) => {
1010
};
1111

1212
export const logTitle = (title: string, count: number) =>
13-
console.log(`${picocolors.bold(picocolors.yellow(picocolors.underline(title)))} (${count})`);
13+
console.log(`${picocolors.yellowBright(picocolors.underline(title))} (${count})`);
14+
15+
export const logTitleDimmed = (title: string) => console.log(`${picocolors.yellow(picocolors.underline(`${title}`))}`);
1416

1517
type LogIssueLine = {
1618
owner?: string;

‎packages/knip/src/reporters/watch.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export default ({ report, issues, streamer, startTime, size, isDebug }: WatchRep
3232

3333
if (issuesForType.length > 0) {
3434
if (title) {
35-
lines.push(`${picocolors.bold(picocolors.yellow(picocolors.underline(title)))} (${issuesForType.length})`);
35+
lines.push(`${picocolors.yellowBright(picocolors.underline(title))} (${issuesForType.length})`);
3636
}
3737
if (typeof issuesForType[0] === 'string') {
3838
lines.push(...issuesForType.map(filePath => relative(filePath)));

0 commit comments

Comments
 (0)
Please sign in to comment.