I currently have some react typescript projects, each project uses path alias, but I'm facing a annoying issue that, when import with path alias, the autocomplete for files like .png
, .jpg
, .scss
and many other isn't found on path autocomplete. (it works fine when imported, the problem is just the annoying not working autocomplete that forces me to check the folder to get the file name)
When I use use the relative path such as import File from '../../../styles/...';
the autocomplete works fine. I'm not sure for exactly what I need to search with this error, I've tried, but with no success.
I'm using vscode with Path Intellisense extension, but since the issue happens on typescript path alias I don't believe it can mean anything.
Working:
Not working:
Don't show anything, if I hit ctrl+enter
it show several useless autocompletes, but not the file inside the folder
tsconfig
{
"compilerOptions": {
"target": "es2020",
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"allowJs": false,
"skipLibCheck": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"downlevelIteration": true,
"noEmit": true,
"jsx": "react",
"baseUrl": "./src",
"types": ["cypress"]
},
"include": [
"src"
]
}