Error File '/Users/nish7/Documents/Code/WebDev/HOS/frontend/node_modules/eslint-import-resolver-typescript/lib' not found. The file is in the program because: Root file specified for compilation
jsconfig.json
"compilerOptions": {
"checkJs": false,
"resolveJsonModule": true,
"moduleResolution": "node",
"target": "es2020",
"module": "es2015",
"baseUrl": ".",
"paths": {
"@/components/*": ["components/*"],
"@/styles/*": ["styles/*"],
"@/pages/*": ["pages/*"],
"@/utils/*": ["utils/*"],
"@/theme/*": ["theme/*"]
}
},
"exclude": [
"dist",
"node_modules",
"build",
".vscode",
".next",
"coverage",
".npm",
".yarn"
],
"typeAcquisition": {
"enable": true,
"include": ["react", "react-dom"]
}
}
{
"extends": ["next", "next/core-web-vitals"]
}
If you are using vscode, try to disable TypeScript › Validate
in settings. This solved it for me!
Edit:
Found a more sensible approach than totally disabling validation; setting the TypeScript SDK in the Vscode setting
"typescript.tsdk": "./node_modules/typescript/lib"
Just restart your all vscode windows, that worked in my case.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With