Typescript auto-import style

I noticed that auto-import (by Alt+Enter) on typescript is using two different style.

1. import module = require("module")

2. import { module } from "module"

I'm get used to the first style, but recently I created a new project, second style sometimes appears (not always, oddly)

Is there any settings to control which one to use?

0

Import syntax depends on the way module is exported; when using export = syntax, module has to be imported with import module = require("module") (see  https://www.typescriptlang.org/docs/handbook/modules.html); for named exports (export class module{}),

import { module } from "module";

syntax is used

0

请先登录再写评论。