Description
TypeScript Version: 2.4.0 / nightly (2.5.0-dev.20170816)
To Reproduce:
C:\Source\import-quick-fix-issue> npm install -D typescript@next
C:\Source\import-quick-fix-issue> tsc --init
C:\Source\import-quick-fix-issue> npm install --save lodash @types/lodash
C:\Source\import-quick-fix-issue> 'export const chain = _.chain;'> index.ts
C:\Source\import-quick-fix-issue> code-insiders .
Open in Visual Studio Code, move cursor to _
, click the 💡, and observe that the following quick fix info is displayed
Expected behavior:
If --allowSyntheticDefaultImports
is true
the quick fix info remains the same and the result is
import _ from "lodash";
export const chain = _.chain;
If --allowSyntheticDefaultImports
is false
the quick fix info changes to
and the result is
import * as _ from "lodash";
export const chain = _.chain;
Actual behavior:
Regardless of the values specified for --module
and --allowSyntheticDefaultImports
, the quick fix info is always
and the result is always
import * as _ from "lodash";
export const chain = _.chain;
Ideal behavior: 😃
If --allowSyntheticDefaultImports
is true
the quick fix info remains the same and the result is
import _ from "lodash";
export const chain = _.chain;
If --allowSyntheticDefaultImports
is false
and --module
is either commonjs
, amd
, or umd
the quick fix info is changed to
and the result is
import _ = require("lodash");
export const chain = _.chain;