nuxt / create-nuxt-app

Create Nuxt.js App in seconds.
MIT License
3.48k stars 429 forks source link

feat: ignore eslint conflict with keyword files #922

Closed TerabyteTiger closed 2 years ago

TerabyteTiger commented 2 years ago

Types of changes

Description

By default create-nuxt-app is installing eslint with vue rulesets that throw an error on .vue files that are only a single word. This includes when Nuxt layouts are created as outlined in the Nuxt documentation for custom error pages, and default.vue (Default doesn't throw a console error and prevent the app from loading, but it does show an error in VS Code without these changes).

My change adds a rule to the default eslint files that will prevent these errors from appearing for default.vue and error.vue files. An addition may want to be added to cover blog.vue since that's an example also called out in the docs.

Checklist:

I manually tested to make sure the new eslint files generated would correctly ignore the default.vue and error.vue files, but I don't believe the tests around the cli are otherwise affected since it's just an extension of the currently generated file (If this is incorrect I'd love to update the associated tests as well 😄 )

TerabyteTiger commented 2 years ago

Oh! Good catch 😅