create-nuxt-app
create-nuxt-app copied to clipboard
Missing config line in new TS + lint apps
When creating a new TS + lint app (via npx), runtime linting on save stops working after the initial build. It builds without errors even if the errors are still present (goes for all files).
I just created 5 different builds from scratch and the only difference I found is when building without TS, nuxt.config.js's buildModules include '@nuxtjs/eslint-module',, and when creating it with TS it's not there.
Adding '@nuxtjs/eslint-module', seems to fix the issue completely, for me at least.
Edit: forgot to mention for all these cases runtime linting was enabled as per documentation with
typescript: {
typeCheck: {
eslint: {
files: './**/*.{ts,js,vue}'
}
}
}
Edit 2: also .ts is still missing from the lint script in package.json, even when created with ts+lint.
Edit 3: also contrary to what the documentation suggests when using @nuxtjs/eslint-config-typescript:
TIP
If you're already using @nuxtjs/eslint-config, remove it from your dependencies, the Nuxt TypeScript ESLint config includes it.
Apps built this way include both, although I'm not sure if it has any effect and is worth a sepparate issue 🤷♂️
P.S. I took a stab at opening a PR for this but I'm not even able to run the tests because of Error: Cannot find module 'sao'. Never done this before, sorry.