ESLint required dependencies
Following instructions here: https://github.com/nuxt/eslint-config
I have installed the package with: yarn add -D @nuxtjs/eslint-config-typescript eslint
And then added script: "lint": "eslint ." in package.json
When running "yarn lint" I get this error...
Error: Failed to load plugin '@typescript-eslint' declared in '.eslintrc » @nuxtjs/eslint-config-typescript': Cannot find module 'typescript'
I have installed "yarn add -D typescript" which solved the problem...
But I'm curious... is it okay to have typescript again here as a dependency?
GitHub
GitHub - nuxt/eslint-config: ESlint config used for Nuxt
ESlint config used for Nuxt. Contribute to nuxt/eslint-config development by creating an account on GitHub.
7 Replies
Shouldn't be an issue as this package is only used for linting. Besides that its a development package so it wont be in your final build.
the doc is a bit confusing, I believe you need the
@nuxt/eslint-config
dependency for nuxt v3
which includes a dependency for typescript already@harlan agree, docs could be a lot better...
But it is clear about this:
If you're using TypeScript, follow Usage section by replacing @nuxtjs/eslint-config by @nuxtjs/eslint-config-typescript.
That's why I installed this package and asked this question 🙂
just install typescript as dev-dependency
Its clear but wrong, thats for nuxt 2
Stick with what I said
The package for nuxt 3 is
@nuxt/eslint-config
it's a lot less opinionated at the momentUnknown User•2y ago
Message Not Public
Sign In & Join Server To View