I have a typescript NextJS project with the following .eslintrc.json
:
{
"extends": "next/core-web-vitals"
}
I would like to add some additional typescript rules (like do not allow the type any (no-explicit-any
)).
- I added
npm install --save-dev @typescript-eslint/parser @typescript-eslint/eslint-plugin
- Extend the config by the
no-explicit-any
rule, updated the parser and added the plugin.
{
"extends": "next/core-web-vitals",
"parser": "@typescript-eslint/parser",
"plugins": [
"@typescript-eslint"
],
"rules": {
"@typescript-eslint/no-explicit-any": "warn"
}
}
- Now the
no-explicit-any
works. However all the default rules from thenext/core-web-vitals
are not working anymore.
So I can either have the next or use the typescript-eslint rules. How can I use booth?