i had the same issue.
In your root workspace you have a .vscode folder with a settings.json.
Add the following:
{
"eslint.workingDirectories": [
"./{PATH_TO_CLIENT}" // replace {PATH_TO_CLIENT} with your own path
]
}
related issue: create-react-app subfolder projects do not lint
Answer from Julez on Stack OverflowSetting up eslint-plugin-jsdoc
Failed to load plugin 'js' declared in 'CLIOptions': Cannot find module 'eslint-plugin-js'
Unable to publish the errors on ESLint checks for Missing JSDoc Comments
visual studio code - VSCode failed to load plugin cannot find module 'eslint-plugin-prettier' - Stack Overflow
» npm install eslint-plugin-jsdoc
I'm trying to set up eslint-plugin-jsdoc to enforce JSDoc in my TS project, but for some reason the linter is not complaining at all when I don't add JSDoc above a function. My config file is as follows:
{
"extends": ["eslint:recommended", "plugin:jsdoc/recommended"],
"env": {
"node": true,
"es6": true
},
"parserOptions": {
"ecmaVersion": 2021
},
"plugins": ["jsdoc"],
"rules": {
...
}
}To my (limited) knowledge, as long as I have the recommended rules, the linter should enforce JSDocs for every function. Could someone please help me understand why this isn't working? I do have both ESLint and eslint-plugin-jsdoc installed:
"devDependencies": {
"@eslint/js": "^9.12.0",
"@types/eslint__js": "^8.42.3",
"@types/node": "^22.7.4",
"eslint": "^9.12.0",
"eslint-plugin-jsdoc": "^50.3.2",
"globals": "^15.11.0",
"tsx": "^4.19.1",
"typescript": "^5.6.3",
"typescript-eslint": "^8.8.1"
}i had the same issue.
In your root workspace you have a .vscode folder with a settings.json.
Add the following:
{
"eslint.workingDirectories": [
"./{PATH_TO_CLIENT}" // replace {PATH_TO_CLIENT} with your own path
]
}
related issue: create-react-app subfolder projects do not lint
VSCode/eslint will not pick newly installed npm packages in the node_modules directory. After running npm i eslint-plugin-prettier restart the VSCode workspace. Happens to me consistently, every time I setup a new Javascript/Node/React project and add eslint & prettier, using this guide in the order it suggests.