e160bc8c0d
* Parse type-only import specifiers * Add type-only export specifiers * Update transform and emit * Update checking * Fix elision when combined with importsNotUsedAsValues=preserve * Accept baselines * Add test * WIP auto imports updates * First auto-imports test working * More auto-import tests * Fix auto imports of type-only exports * Add test for promoting type-only import * Sort import/export specifiers by type-onlyness * Update completions for `import { type |` * Update other completions tests * Respect organize imports sorting when promoting type-only to regular while adding a specifier * Fix comment mistakes * Update src/services/codefixes/importFixes.ts Co-authored-by: Daniel Rosenwasser <DanielRosenwasser@users.noreply.github.com> * Rearrange some order of assignments in parser * Split huge if statement * Remove redundant check * Update new transformer * Fix import statement completions * Fix type keyword completions good grief * Fix last tests Co-authored-by: Daniel Rosenwasser <DanielRosenwasser@users.noreply.github.com>
58 lines
833 B
Plaintext
58 lines
833 B
Plaintext
=== /imports.ts ===
|
|
import { type, as, something, foo, bar } from "./exports.js";
|
|
>type : 0
|
|
>as : 0
|
|
>something : 0
|
|
>foo : 0
|
|
>bar : 0
|
|
|
|
type;
|
|
>type : 0
|
|
|
|
as; // Error (used in emitting position)
|
|
>as : 0
|
|
|
|
something; // Error (used in emitting position)
|
|
>something : 0
|
|
|
|
foo; // Error (used in emitting position)
|
|
>foo : 0
|
|
|
|
bar; // Error (used in emitting position)
|
|
>bar : 0
|
|
|
|
=== /exports.ts ===
|
|
const type = 0;
|
|
>type : 0
|
|
>0 : 0
|
|
|
|
const as = 0;
|
|
>as : 0
|
|
>0 : 0
|
|
|
|
const something = 0;
|
|
>something : 0
|
|
>0 : 0
|
|
|
|
export { type };
|
|
>type : 0
|
|
|
|
export { type as };
|
|
>as : 0
|
|
|
|
export { type something };
|
|
>something : 0
|
|
|
|
export { type type as foo };
|
|
>type : 0
|
|
>foo : 0
|
|
|
|
export { type as as bar };
|
|
>as : 0
|
|
>bar : 0
|
|
|
|
export type { type something as whatever }; // Error
|
|
>something : 0
|
|
>whatever : any
|
|
|