mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-22 16:52:14 -06:00
Don't implicit-any diagnostic for json module
This commit is contained in:
parent
98ec1e8730
commit
96f9e076f8
@ -2241,7 +2241,7 @@ namespace ts {
|
||||
const sourceFile = resolvedModule && !resolutionDiagnostic && host.getSourceFile(resolvedModule.resolvedFileName);
|
||||
if (sourceFile) {
|
||||
if (sourceFile.symbol) {
|
||||
if (resolvedModule.isExternalLibraryImport && !extensionIsTS(resolvedModule.extension)) {
|
||||
if (resolvedModule.isExternalLibraryImport && !resolutionExtensionIsTSOrJson(resolvedModule.extension)) {
|
||||
errorOnImplicitAnyModule(/*isError*/ false, errorNode, resolvedModule, moduleReference);
|
||||
}
|
||||
// merged symbol is module declaration symbol combined with all augmentations
|
||||
|
||||
@ -0,0 +1,16 @@
|
||||
/// <reference path='fourslash.ts' />
|
||||
|
||||
// @moduleResolution: node
|
||||
// @resolveJsonModule: true
|
||||
// @strict: true
|
||||
|
||||
// @Filename: /node_modules/foo/bar.json
|
||||
////export const x = 0;
|
||||
|
||||
// @Filename: /a.ts
|
||||
////import abs = require([|"foo/bar.json"|]);
|
||||
////abs;
|
||||
|
||||
verify.noErrors();
|
||||
goTo.file("/a.ts");
|
||||
verify.getSuggestionDiagnostics([]);
|
||||
Loading…
x
Reference in New Issue
Block a user