fix(core): find imports in export type statements (#13921)
This commit is contained in:
parent
c783ac5e9a
commit
d5c93bfa39
@ -47,6 +47,7 @@ import('./module.ts')`;
|
||||
} from './a';
|
||||
|
||||
export { B } from './b';
|
||||
export type { B } from './b';
|
||||
|
||||
export { C as D } from './c';
|
||||
|
||||
@ -58,6 +59,7 @@ export {
|
||||
A
|
||||
} from './a'
|
||||
export { B } from './b'
|
||||
export type { B } from './b'
|
||||
export { C as D } from './c'`;
|
||||
|
||||
expect(stripSourceCode(scanner, input)).toEqual(expected);
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import type { Scanner } from 'typescript';
|
||||
|
||||
let SyntaxKind;
|
||||
let SyntaxKind: typeof import('typescript').SyntaxKind;
|
||||
export function stripSourceCode(scanner: Scanner, contents: string): string {
|
||||
if (!SyntaxKind) {
|
||||
SyntaxKind = require('typescript').SyntaxKind;
|
||||
@ -90,7 +90,8 @@ export function stripSourceCode(scanner: Scanner, contents: string): string {
|
||||
}
|
||||
if (
|
||||
token === SyntaxKind.OpenBraceToken ||
|
||||
token === SyntaxKind.AsteriskToken
|
||||
token === SyntaxKind.AsteriskToken ||
|
||||
token === SyntaxKind.TypeKeyword
|
||||
) {
|
||||
start = potentialStart;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user