Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork2.8k
Open
Description
Before You File a Bug Report Please Confirm You Have Done The Following...
- I have tried restarting my IDE and the issue persists.
- I have updated to the latest version of the packages.
- I havesearched for related issues and found none that matched my issue.
- I haveread the FAQ and my problem is not listed.
Playground Link
Repro Code
/**@jsx join *//**@jsxFrag join */import{join}from'node:path';exportfunctionPreactComponent():ReturnType<typeofjoin>{return<></>;}
ESLint Config
module.exports={parser:"@typescript-eslint/parser",rules:{"@typescript-eslint/consistent-type-imports":"error"},};
tsconfig
{"compilerOptions": {"jsx":"react" }}Expected Result
I expect there to be no issues with the provided example.
Actual Result
All imports in the declaration are only used as types. Use
import type. 4:1 - 4:34
Additional Info
In this example, the JSX elements are handled by React by default, but specific modules use something else. In the practical repro where we're seeing this, it'spreact, but in this example, I'm using something available from the standardnode types.
Link to the@jsx directive documentation:https://www.typescriptlang.org/tsconfig/#jsxFactory