"Import can be shortened" inspection not working for *.tsx files
I don't get the warning message: "Import can be shortened" when I am importing a *.tsx file. *.ts imports are working fine.
I have the following 2 imports:

Button is a *.tsx file, useDateFormat *.ts. First one doesn't have the inspection warning, second one does. They should both get the warning.
In my tsconfig they both have paths so the will resolve as followed:

Tsconfig includes both *.ts and *.tsx files:
{
"compilerOptions": {
"target": "esnext",
"module": "esnext",
"jsx": "preserve",
"lib": [
"dom",
"es2017",
"esnext"
],
"moduleResolution": "node",
"allowJs": false,
"noEmit": true,
"strict": true,
"allowSyntheticDefaultImports": true,
"skipLibCheck": true,
"noUnusedLocals": false,
"noUnusedParameters": false,
"removeComments": true,
"preserveConstEnums": true,
"sourceMap": true,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"resolveJsonModule": true,
"isolatedModules": true,
"incremental": true,
"baseUrl": "./src",
"paths": {
"@c/*": [
"components/*"
],
"@s/*": [
"components/shared/*"
],
"@t": [
"constants/theme"
],
"@h/*": [
"hooks/*"
],
"@u/*": [
"utils/*"
],
"@l/*": [
"locales/*"
]
}
},
"exclude": [
"node_modules"
],
"include": [
"next-env.d.ts",
"src/*.ts",
"src/**/*.ts",
"src/*.tsx",
"src/**/*.tsx"
]
}
Please sign in to leave a comment.
It doesn't currently work for default imports. Please follow https://youtrack.jetbrains.com/issue/WEB-46351 for updates