N
Nuxt2y ago
Jure

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
ILLuMiNaTe
ILLuMiNaTe2y ago
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.
harlan
harlan2y ago
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
Jure
JureOP2y ago
@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 🙂
MrDeer
MrDeer2y ago
just install typescript as dev-dependency
harlan
harlan2y ago
Its clear but wrong, thats for nuxt 2 Stick with what I said
danielroe
danielroe2y ago
The package for nuxt 3 is @nuxt/eslint-config it's a lot less opinionated at the moment
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Want results from more Discord servers?
Add your server