vuejs / eslint-plugin-vue

Official ESLint plugin for Vue.js
https://eslint.vuejs.org/
MIT License
4.47k stars 665 forks source link

`vue/multi-word-component-names` also applies to pages directory #2434

Closed nopeless closed 7 months ago

nopeless commented 8 months ago

Checklist

Tell us about your environment

Please show your full configuration:

module.exports = {
  // ...
  parser: "vue-eslint-parser",
  parserOptions: {
    parser: "@typescript-eslint/parser",
  },
  extends: [
    // "@nuxt/eslint-config",
    // "plugin:prettier/recommended",
    "plugin:vue/vue3-recommended",
  ],
  // ...
};

What did you do?

// index.vue
<template>
  <h1>hi</h1>
</template>

1:1 error Component name "index" should always be multi-word vue/multi-word-component-names

This should not trigger

Repository to reproduce this issue

https://stackblitz.com/edit/nuxt-starter-fvsxuf?file=.eslintrc.cjs

waynzh commented 7 months ago

You mean in a Nuxt project, the pages directory should not be checked? You might want to refer to the nuxt/eslint config which disabled this rule in certain directories.

Typically, this wouldn't be an issue as you can configure the ignores property to ignore certain component names in general project.

FloEdelmann commented 7 months ago

Note that the Nuxt config only disables the rule in certain directories using overrides, which you can also do manually in your project. So I'll close this as won't fix, because there already exists a method to disable this rule for certain directories.