Skip to content

Commit

Permalink
Sort unused file paths in symbols reporter (resolves #817)
Browse files Browse the repository at this point in the history
  • Loading branch information
webpro committed Oct 29, 2024
1 parent fb9596a commit b933cd2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/knip/src/reporters/symbols.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ export default ({ report, issues, tagHints, configurationHints, noConfigHints, i
const issuesForType = Array.from(issues._files);
if (issuesForType.length > 0) {
title && logTitle(title, issuesForType.length);
for (const issue of issuesForType) {
const sortedIssues = issuesForType.sort((a, b) => a.filePath.localeCompare(b.filePath));
for (const issue of sortedIssues) {
const relPath = toRelative(issue.filePath);
if (issue.isFixed) console.log(dim(`${relPath} (removed)`));
else if (issue.severity === 'warn') console.log(dim(relPath));
Expand Down

0 comments on commit b933cd2

Please sign in to comment.