Skip to content

Parser crashes on TypeScript inline type imports #96

Closed
@Xunnamius

Description

@Xunnamius

I'm pretty sure this is the right place to create this issue, but if not let me know.

I'm trying to use vscode to debug some of my unit tests. One of my test files uses the relatively new inline type imports feature to condense imports:

import fs from 'node:fs';
import path from 'node:path';
import assert from 'node:assert';
import { EOL } from 'node:os';
import { isNativeError } from 'node:util/types';
import { declare } from '@babel/helper-plugin-utils';
import { asMockedFunction, type AnyFunction } from '@xunnamius/jest-types';
import babel from '@babel/core';

However, the Jest plugin for vscode crashes, giving me the following error as all IDE UI decorations disappear:

/repos/babel-plugin-tester/test/plugin-tester.test.ts: failed to parse test results: SyntaxError: Unexpected token, expected "," (7:32)

Removing the inline type annotation fixes it. Is this expected behavior (that is: am I missing a babel plugin or something)?

Thanks for reading!

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions