-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Closed
Closed
Copy link
Labels
CommittedThe team has roadmapped this issueThe team has roadmapped this issueFixedA PR has been merged for this issueA PR has been merged for this issueSuggestionAn idea for TypeScriptAn idea for TypeScript
Milestone
Description
follow up on #6614
Related issues: #247 (comment), #5787, #2709, #6371 (comment)
Problems:
- Can not easily specify a loader extension for json or css (e.g. `json!a.json); currently every resources needs to have its own declaration
- Problem with migrating to .ts, with modules that do not have typings, and users just want to get by
Proposal:
-
Allow for short hand module declarations:
declare module "foo";
to be equivalent to:
declare module "foo" { var _temp: any; export = _temp; }
-
Allow module names to have a wildcard character and match that in lookup
declare module "json!*" { let json: any; export default json; } import d from "json!a/b/bar.json"; // lookup: // json!a/b/bar.json // json!*
-
Additional the module "*" would allow for matching all unknown modules in the system, which can be used as a way to suppress all missing module errors
declare module "*"; import d from "some\unknown\module"; // no error, d is any
-
Report no-implicit-any errors for modules declared using the shorthand notion
Open issue: is this reported on declaration or use sites
geirsagberg, h-nazzal, chrisbeech, KyleNeedham, vadim-shb and 58 morepelotom, cogspace, ryankaplan, whiteinge, durasj and 6 more
Metadata
Metadata
Assignees
Labels
CommittedThe team has roadmapped this issueThe team has roadmapped this issueFixedA PR has been merged for this issueA PR has been merged for this issueSuggestionAn idea for TypeScriptAn idea for TypeScript