|
1 | 1 | /// <reference path="fourslash.ts" />
|
2 | 2 |
|
3 |
| -// @importsNotUsedAsValues: error |
| 3 | +// @module: esnext |
| 4 | +// @verbatimModuleSyntax: true |
4 | 5 |
|
5 | 6 | // @Filename: exports1.ts
|
6 | 7 | ////export default class A {}
|
|
24 | 25 | ////console.log(a, b, c, d, o);
|
25 | 26 |
|
26 | 27 | goTo.file("imports.ts");
|
27 |
| -verify.codeFixAll({ |
28 |
| - fixId: "convertToTypeOnlyImport", |
29 |
| - fixAllDescription: ts.Diagnostics.Fix_all_with_type_only_imports.message, |
30 |
| - newFileContent: `import type A from './exports1'; |
31 |
| -import type { B, C } from './exports1'; |
32 |
| -import type D from "./exports2"; |
33 |
| -import type * as others from "./exports2"; |
34 |
| -
|
35 |
| -declare const a: A; |
36 |
| -declare const b: B; |
37 |
| -declare const c: C; |
38 |
| -declare const d: D; |
39 |
| -declare const o: typeof others; |
40 |
| -console.log(a, b, c, d, o);` |
41 |
| -}); |
| 28 | +// This test previously showed that a codefix could be applied to turn |
| 29 | +// these imports, only used in type positions, into type-only imports. |
| 30 | +// The code fix was triggered by the error issued by |
| 31 | +// `--importsNotUsedAsValues error`, for which there is no analog in |
| 32 | +// the compiler after its removal. `verbatimModuleSyntax` does not |
| 33 | +// error here since the imported names are values, and so will not |
| 34 | +// crash at runtime. Users have replaced this error and codefix with |
| 35 | +// an eslint rule. We could consider bringing it back as a suggestion |
| 36 | +// diagnostic, a refactor, or an organizeImports feature. |
| 37 | +verify.not.codeFixAvailable(); |
0 commit comments