Skip to content

Commit 4d298b5

Browse files
committed
[patch] no-unused-modules: add console message to help debug #2866
1 parent 1dc7fc6 commit 4d298b5

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ This change log adheres to standards from [Keep a CHANGELOG](https://keepachange
1111

1212
### Changed
1313
- [Docs] `no-extraneous-dependencies`: Make glob pattern description more explicit ([#2944], thanks [@mulztob])
14+
- [`no-unused-modules`]: add console message to help debug [#2866]
1415

1516
## [2.29.1] - 2023-12-14
1617

@@ -1111,6 +1112,7 @@ for info on changes for earlier releases.
11111112
[#2942]: https://github.com/import-js/eslint-plugin-import/pull/2942
11121113
[#2919]: https://github.com/import-js/eslint-plugin-import/pull/2919
11131114
[#2884]: https://github.com/import-js/eslint-plugin-import/pull/2884
1115+
[#2866]: https://github.com/import-js/eslint-plugin-import/pull/2866
11141116
[#2854]: https://github.com/import-js/eslint-plugin-import/pull/2854
11151117
[#2851]: https://github.com/import-js/eslint-plugin-import/pull/2851
11161118
[#2850]: https://github.com/import-js/eslint-plugin-import/pull/2850

src/rules/no-unused-modules.js

+4
Original file line numberDiff line numberDiff line change
@@ -529,6 +529,10 @@ module.exports = {
529529

530530
exports = exportList.get(file);
531531

532+
if (!exports) {
533+
console.error(`file \`${file}\` has no exports. Please update to the latest, and if it still happens, report this on https://github.com/import-js/eslint-plugin-import/issues/2866!`);
534+
}
535+
532536
// special case: export * from
533537
const exportAll = exports.get(EXPORT_ALL_DECLARATION);
534538
if (typeof exportAll !== 'undefined' && exportedValue !== IMPORT_DEFAULT_SPECIFIER) {

0 commit comments

Comments
 (0)