Skip to content

TypeScript 4.5 type modifiers on imported names are not supported. #902

@danielweck

Description

@danielweck

Describe the bug

TypeScript 4.5 type modifiers on imported names are not supported.

https://devblogs.microsoft.com/typescript/announcing-typescript-4-5-beta/#type-on-import-names

To Reproduce

For example, this works:

import type { Options, VNode } from 'preact';
import { options } from 'preact'; // eslint-disable-line no-duplicate-imports

...but this breaks:

import { type Options, type VNode, options } from 'preact';
SyntaxError: Error transforming /PATH/TO/code.ts: Unexpected token, expected ","

Expected behavior

Preact WMR should support all the tasty goodness of TypeScript syntactic sugar :)

Bug occurs with:

  • wmr or wmr start (development)
  • wmr build (production)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingupstreamRelated to or blocked on an upstream project

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions