I'm using typescript and setup absolute path usage through tsconfig.json and babel.config.js.It totally worked fine but suddenly vscode emits some error.Strangely, importing components works perfectly fine. I guess it's a problem from vscode but I don't know how to solve the problem.
Here is my tsconfig.json
{"extends": "@tsconfig/react-native/tsconfig.json","compilerOptions": {"allowSyntheticDefaultImports": true, // turn on allowSyntheticDefaultImports"baseUrl": ".","paths": {"@/*": ["./src/*"] } },"exclude": ["node_modules", "babel.config.js", "metro.config.js", "jest.config.js"]}
And this is my babel.config.js
module.exports = { presets: ['module:metro-react-native-babel-preset'], plugins: [ ['module-resolver', { root: ['./src'], extensions: ['.ios.ts', '.android.ts', '.ts', '.ios.tsx', '.android.tsx', '.tsx', '.jsx', '.js'], alias: {'@': './src', }, }, ],'react-native-reanimated/plugin', ],};
And these are one of the importing codes and an error.
import {ScaledSDText as Text} from '@/components/common/ScaledText';
Cannot find module '@/components/common/ScaledText' or its corresponding type declarations.
And auto complete for importing is not working anymore. What is the problem? :(please help me..
I don't know but maybe problem came from vscode settings.