TypeScript/tests/cases/fourslash/importNameCodeFixNewImportAllowSyntheticDefaultImports1.ts
Aluan Haddad 70cabdda41 fix inconsistencies in import UMD code fixes adapting to module format (#19572)
* improve import code fixes for UMD modules
 - use default import under --allowSyntheticDefaultImports
 - import..require support
 - make make quick fix info match resulting import
 - make diagnostics

* Address PR feedback:
 - extract test for synethetic default imports into getAllowSyntheticDefaultImports in core.ts
 - use getAllowSyntheticDefaultImports in checker.ts and importFixes.ts
 - move compilerOptions to top level destructuring

* add tests

* remove `import =` quick fix and supporting code.

* update feature tests

* remove errant whitespace
2017-11-06 22:55:37 -08:00

18 lines
339 B
TypeScript

/// <reference path="fourslash.ts" />
// @Module: system
// @Filename: a/f1.ts
//// [|export var x = 0;
//// bar/*0*/();|]
// @Filename: a/foo.d.ts
//// declare function bar(): number;
//// export = bar;
//// export as namespace bar;
verify.importFixAtPosition([
`import bar from "./foo";
export var x = 0;
bar();`
]);