Bug: [consistent-type-imports] Incorrectly suggests import type
on import assertion
#7527
Closed
4 tasks done
Labels
accepting prs
Go ahead, send a pull request that resolves this issue
bug
Something isn't working
good first issue
Good for newcomers
package: eslint-plugin
Issues related to @typescript-eslint/eslint-plugin
Before You File a Bug Report Please Confirm You Have Done The Following...
Playground Link
https://typescript-eslint.io/play/#ts=4.9.3&showAST=es&fileType=.tsx&code=JYWwDg9gTgLgBAKjgQwM4oFKogOzgMyghDgHIA6AemXICtsdSVVUBTWOAbzhgE8xWALjL1cTAL4AoSQGNcqeAHcAFshjDkWXOQCCAbiA&eslintrc=N4KABGBEBOCuA2BTAzpAXGUEKQAIBcBPABxQGNoBLY-AWhXkoDt8B6MgeyeUuX0Ra0ipWpQC2xDtHyoMkRNGhTI4MAF8QaoA&tsconfig=N4KABGBEDGD2C2AHAlgGwKYCcDyiAuysAdgM6QBcYoEEkJemy0eAcgK6qoDCAFutAGsylBm3TgwAXxCSgA&tokens=false
Repro Code
ESLint Config
tsconfig
No response
Expected Result
No error
Actual Result
Error. When fixing it, TypeScript says
Import assertions cannot be used with type-only imports or exports. ts(2822)
.Importantly, the autofix "fixes" it into invalid TypeScript code.
Additional Info
No response
The text was updated successfully, but these errors were encountered: