-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: Quick FixesEditor-provided fixes, often called code actions.Editor-provided fixes, often called code actions.Effort: ModerateRequires experience with the TypeScript codebase, but feasible. Harder than "Effort: Casual".Requires experience with the TypeScript codebase, but feasible. Harder than "Effort: Casual".Fix AvailableA PR has been opened for this issueA PR has been opened for this issue
Milestone
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
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: Quick FixesEditor-provided fixes, often called code actions.Editor-provided fixes, often called code actions.Effort: ModerateRequires experience with the TypeScript codebase, but feasible. Harder than "Effort: Casual".Requires experience with the TypeScript codebase, but feasible. Harder than "Effort: Casual".Fix AvailableA PR has been opened for this issueA PR has been opened for this issue