`Eslint` complains of missing plugins when enabling `hardcore/ts` for `Vue` project
alexkramer98 opened this issue · comments
Reproduction:
- Create a new
Vue
project (TS). - Add
eslint
andeslint-config-hardcore
. - Add the
.eslintrc.json
config from theTypescript Vue 3
example. - Run
eslint src
.
Oops! Something went wrong! :(
ESLint: 8.36.0
ESLint couldn't find the plugin "eslint-plugin-etc".
(The package "eslint-plugin-etc" was not found when loaded as a Node module from the directory "/path/to/project".)
It's likely that the plugin isn't installed correctly. Try reinstalling by running the following:
npm install eslint-plugin-etc@latest --save-dev
The plugin "eslint-plugin-etc" was referenced from the config file in ".eslintrc.json » eslint-config-hardcore/ts#overrides[0]".
If you still can't figure out the problem, please stop by https://eslint.org/chat/help to chat with the team.
After installing the eslint-plugin-etc
manually, the same error appears for eslint-plugin-total-functions
.
After installing this as well, everything works as expected.
The problem disappears when removing hardcore/ts
from the extends
list in .eslintrc.json
. There is also no issue in Nuxt 3
(both TS and JS).
I will have to debug this further. Meanwhile I am open to suggestions of what the problem may be.
@alexkramer98 Can't reproduce. Could you try the latest version?
I have the same issue on my small local repo. All the hardcore/ts plugins are not installed.
Dropping the version to 34.0.0, all works fine.
My eslint looks like:
"parser": "@typescript-eslint/parser",
"env": {
"node": true,
"es2022": true,
"jest": true
},
"parserOptions": {
"ecmaVersion": 13,
"project": "./tsconfig.json"
},
"plugins": ["@typescript-eslint", "prettier"],
"extends": [
"hardcore",
"hardcore/ts",
"hardcore/node",
"hardcore/jest",
"hardcore/fp",
"hardcore/ts-for-js",
"prettier"
],
"rules": {
"prettier/prettier": "error"
}
}
my packages are:
"@typescript-eslint/eslint-plugin": "^5.5.9",
"@typescript-eslint/parser": "^5.5.9",
"eslint": "^8.38.0",
"eslint-config-hardcore": "34.0.0",
"eslint-config-prettier": "^8.8.0",
"eslint-plugin-etc": "^2.0.2",
"eslint-plugin-prettier": "^4.2.1",
"prettier": "^2.8.7",
"typescript": "^5.0.4"
}
I think it's because of TypeScript v5. eslint-plugin-etc doesn't support TypeScript v5 yet cartant/eslint-plugin-etc#53. I think I'll have to remove it for now.
Can confirm the issue persists using the newest eslint-config-hardcore
.
On a new Vue 3 (ts)
project, eslint
complains of missing:
eslint-plugin-etc
eslint-plugin-total-functions
same here
Fixed and released in eslint-config-hardcore@36.0.0