-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Closed
Labels
DeclinedThe issue was declined as something which matches the TypeScript visionThe issue was declined as something which matches the TypeScript visionSuggestionAn idea for TypeScriptAn idea for TypeScript
Description
Per direction from @mhegazy I’m opening this ticket as a discussion point for loosening the restriction forbidding relative module IDs in ImportDeclaration
s in AmbientModuleDeclaration
. Loosening the restriction prevents the need to rewrite import declarations when combining multiple external declarations to a single file, and maybe simplifies some internals of the compiler (I haven’t checked, but it should eliminate some code branches).
Relative module IDs should be resolvable by the same way that the rest of the tsc machinery works, by resolving the reference according to the StringLiteral
in a module’s own AmbientExternalModuleDeclaration
. For example:
declare module 'foo/Foo' {
import Bar = require('./Bar'); // resolve to `foo/Bar`
}
Right now you are not allowed to do this and need to write:
declare module 'foo/Foo' {
import Bar = require('foo/Bar');
}
Metadata
Metadata
Assignees
Labels
DeclinedThe issue was declined as something which matches the TypeScript visionThe issue was declined as something which matches the TypeScript visionSuggestionAn idea for TypeScriptAn idea for TypeScript