fix(eslint-plugin): [no-unused-vars] correct detection of unused vars in a declared module with `export =` #2505
Conversation
… in a declared module with `export =` If a `declare module` has an `export =` in its body, then TS will only export that. If it doesn't have an `export =`, then all things are ambiently exported. This adds handling to correctly detect this case.
Thanks for the PR, @bradzacher! typescript-eslint is a 100% community driven project, and we are incredibly grateful that you are contributing to that community. The core maintainers work on this in their personal time, so please understand that it may not be possible for them to review your work immediately. Thanks again! |
Codecov Report
@@ Coverage Diff @@
## master #2505 +/- ##
==========================================
- Coverage 92.80% 92.79% -0.01%
==========================================
Files 290 290
Lines 9436 9451 +15
Branches 2642 2647 +5
==========================================
+ Hits 8757 8770 +13
Misses 323 323
- Partials 356 358 +2
Flags with carried forward coverage won't be shown. Click here to find out more.
|
3d07a99
into
master
… in a declared module with `export =` (typescript-eslint#2505) If a `declare module` has an `export =` in its body, then TS will only export that. If it doesn't have an `export =`, then all things are ambiently exported. This adds handling to correctly detect this case.
If a
declare module
has anexport =
in its body, then TS will only export that.If it doesn't have an
export =
, then all things are implicitly exported.This adds handling to correctly detect this case.