Skip to content

vue/multi-word-component-names rule #1688

Closed
@719media

Description

@719media

Checklist

  • I have tried restarting my IDE and the issue persists.
  • I have read the FAQ and my problem is not listed.

Tell us about your environment

  • ESLint version: 7.32
  • eslint-plugin-vue version: 8.0.1
  • Node version: v16.12.0
  • Operating System: amazon linux 2

Please show your full configuration:

module.exports = {
  root: true,
  env: {
    node: true,
  },
  extends: [
    'plugin:vue/vue3-recommended',
    '@vue/airbnb',
  ],
  parserOptions: {
    parser: '@babel/eslint-parser',
  },
  rules: {
    'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
    'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
    'max-len': 'off',
    'import/no-extraneous-dependencies': [
      'error',
      {
        devDependencies: ['deploy.js', 'deploy-cleanup.js'],
      },
    ],
  },
};

What did you do?

When running npm run lint, I get an error with the `vue/multi-word-component-names` rule:
error: Component name "/var/www/sites/testya/src/app" should always be multi-word (vue/multi-word-component-names) at src/app.vue:1:1:


I've noticed that if I copy the repository to another directory that has a hyphen, the rule doesn't error:
e.g. running

#mv testya another-hyphen-folder
then running eslint again results in no error.

Seems like the rule is triggering on the filepath of the component, and not just the filename.

What did you expect to happen?
Not error. Or at a minimum, not have the error based on just if an upstream folder has a hyphen

What actually happened?

error: Component name "/var/www/testya/src/app" should always be multi-word (vue/multi-word-component-names) at src/app.vue:1:1:
> 1 | <script>
    | ^
  2 | import '@/assets/scss/bootstrap.scss';
  3 | import updateSw from './mixins/update-sw';
  4 | 

Repository to reproduce this issue
Not sure how to make a repository with this as a build step, but I can try later when I have more time if needed

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions