TypeScript/tests/cases/fourslash/importNameCodeFix_jsCJSvsESM3.ts
Andrew Branch 736363b427
Use other files when necessary to determine import style in JS (#40879)
* Use other files when necessary to determine import style in JS

* Fix existing tests
2020-10-05 11:39:20 -07:00

24 lines
508 B
TypeScript

/// <reference path="fourslash.ts" />
// @allowJs: true
// @checkJs: true
// @Filename: types/dep.d.ts
//// export declare class Dep {}
// @Filename: index.js
//// import fs from 'fs';
//// const path = require('path');
////
//// Dep/**/
// @Filename: util2.js
//// export {};
// When current file has both imports and requires, get import style from other files
goTo.marker("");
verify.importFixAtPosition([`import fs from 'fs';
import { Dep } from './types/dep';
const path = require('path');
Dep`]);