I’m having trouble getting ESLint to lint my JavaScript files in my IDE. The setup I have done is to install eslint locally via npm and create an eslint config file that is then stored in a config directory. Running eslint from the command line works fine, but when I create an error in a JavaScript file no red squiggly is showing up.
Here are the versions I am running:
- VSCode 1.86.2
- Node V20.12.2
- NPM 10.5.0
- eslint 9.3.0
- eslint VSCode Extension 2.4.4
Here is my file structure:
/backend
/config
eslint.config.mjs
package.json
/frontend
/config
eslint.config.mjs
package.json
Furthermore, I’ve located the eslint error in the output console within VSCode. It appears that the function locateConfigFileToUse
within eslint.js tries to find my config file and does not succeed. I’ve not had luck finding any answers online and have tried moving the eslint config file to the root, but still was same error. Any help is much appreciated. Thank you.
Here is the error I receive in my VSCode “Output”:
[Error - 9:25:13 AM] Error: Could not find config file.
at locateConfigFileToUse (C:UsersuserDesktopprojectbackendnode_moduleseslintlibeslinteslint.js:349:21)
at async calculateConfigArray (C:UsersuserDesktopprojectbackendnode_moduleseslintlibeslinteslint.js:385:49)
at async ESLint.lintText (C:UsersuserDesktopprojectbackendnode_moduleseslintlibeslinteslint.js:1023:25)
at async c:Usersuser.vscodeextensionsdbaeumer.vscode-eslint-2.4.4serverouteslintServer.js:1:24954
at async E (c:Usersuser.vscodeextensionsdbaeumer.vscode-eslint-2.4.4serverouteslintServer.js:1:19114)
at async c:Usersuser.vscodeextensionsdbaeumer.vscode-eslint-2.4.4serverouteslintServer.js:1:220290