Skip to content

Commit

Permalink
Align batch warning for UNUSED_EXTERNAL_IMPORT to individual warning (#…
Browse files Browse the repository at this point in the history
…4194)

* Align batch warning for UNUSED_EXTERNAL_IMPORT to individual warning

* assume not undefined

* prettier

* prettier

* prettier

* quotes

* double quotes
  • Loading branch information
benmccann committed Jul 29, 2021
1 parent e88c5c8 commit 586cb38
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
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 in ' +
printQuotedStringList((warning.sources as string[]).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`
);
assertIncludes(
stderr,
Expand Down

0 comments on commit 586cb38

Please sign in to comment.