TypeScript/tests/cases/fourslash/importNameCodeFixUMDGlobalJavaScript.ts
Andrew Branch 62f65a7884
Make auto-imports more likely to be valid for the file (including JS) & project settings (#32684)
* Add failing tests

* Use default import or namespace import for import fixes when compiler options allow

* Don’t do import * for export=, ever

* Only do import default for export equals if nothing else will work

* Never do import/require in a JavaScript file

* Update tests for changes in master

* Add const/require fix for JS and select based on usage heuristic

* Fix JS UMD import
2019-08-02 15:58:10 -07:00

21 lines
423 B
TypeScript

/// <reference path="fourslash.ts" />
// @AllowSyntheticDefaultImports: false
// @Module: commonjs
// @CheckJs: true
// @AllowJs: true
// @Filename: a/f1.js
//// [|export function test() { };
//// bar1/*0*/.bar;|]
// @Filename: a/foo.d.ts
//// export declare function bar(): number;
//// export as namespace bar1;
verify.importFixAtPosition([
`import * as bar1 from "./foo";
export function test() { };
bar1.bar;`
]);