Closed
Description
TypeScript Version: 3.4.1
Search Terms: import suggestion fix module esnext es modules target assignment
Code
// ./typings.d.ts
declare module 'foo' {
const _default: number;
export = _default;
}
// main.ts
foo;
When I activate the import suggestion/fix for foo
:
Expected behavior:
import * as foo from "foo";
foo
Actual behavior:
// Error:
// Import assignment cannot be used when targeting ECMAScript modules. Consider using 'import * as ns from "mod"', 'import {a} from "mod"', 'import d from "mod"', or another module format instead.
import foo = require("foo");
foo