Issue:
An error occurred stating that the file '/Users/nish7/Documents/Code/WebDev/HOS/frontend/node_modules/eslint-import-resolver-typescript/lib' could not be found. This error is present in the program because of the specified root file for compilation.
Steps to recreate the problem:
- create-next-app
- npx jsconfig.json -t nextjs
Contents of 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"]
}
}
Content of eslint.rc:
{
"extends": ["next", "next/core-web-vitals"]
}
Specifications:
- Visual Studio Code: Version 1.57.1
- Node.js: 14.17.1 (LTS)
- Next.js: 11.0.1