Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Align batch warning for UNUSED_EXTERNAL_IMPORT to individual warning #4194

Merged
merged 7 commits into from Jul 29, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 7 additions & 1 deletion cli/run/batchWarnings.ts
Expand Up @@ -237,7 +237,13 @@ const deferredHandlers: {
UNUSED_EXTERNAL_IMPORT(warnings) {
title('Unused external imports');
for (const warning of warnings) {
stderr(`${warning.names} imported from external module '${warning.source}' but never used`);
stderr(
`${warning.names} imported from external module '${warning.source}' but never used${
warning.sources
benmccann marked this conversation as resolved.
Show resolved Hide resolved
? ' in ' + printQuotedStringList(warning.sources.map(id => relativeId(id)))
: ''
}`
);
}
}
};
Expand Down
2 changes: 1 addition & 1 deletion test/cli/samples/warn-import-export/_config.js
Expand Up @@ -16,7 +16,7 @@ module.exports = {
assertIncludes(
stderr,
'(!) Unused external imports\n' +
"default imported from external module 'external' but never used\n"
`default imported from external module 'external' but never used in "main.js"\n`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While you are at it, maybe we could align on using double quotes " also for the module name. This is also what most other errors use.

);
assertIncludes(
stderr,
Expand Down