Skip to content

import { type X } not flagged in JavaScriptΒ #48445

Closed
@Josh-Cena

Description

@Josh-Cena

Bug Report

πŸ”Ž Search Terms

import type javascript error

πŸ•— Version & Regression Information

  • This is the behavior in every version I tried

⏯ Playground Link

Playground link with relevant code

πŸ’» Code

// Not flagged
import { type ComponentType } from 'react';
// Flagged
import type { ReactNode } from 'react';

πŸ™ Actual behavior

import { type X } is not flagged as "can only be used in TypeScript files" but crashes at runtime

πŸ™‚ Expected behavior

It should be an error

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptDomain: JavaScriptThe issue relates to JavaScript specificallyHelp WantedYou can do this

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions