This repository has been archived by the owner on Mar 25, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 888
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
no-duplicate-imports: Allow duplicate imports from separate ambient m…
…odule declarations (#3398)
- Loading branch information
Showing
3 changed files
with
38 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
declare module 'a' { | ||
import foo from 'foo'; | ||
} | ||
|
||
declare module 'b' { | ||
// No error -- this is a separate ambient module declaration. | ||
import foo from 'foo'; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
export {}; | ||
|
||
declare module 'a' { | ||
import foo from 'foo'; | ||
} | ||
|
||
declare module 'b' { | ||
// Error because these imports could be combined in an outer scope. | ||
import foo from 'foo'; | ||
~~~~~~~~~~~~~~~~~~~~~~ [Multiple imports from 'foo' can be combined into one.] | ||
} |