Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
2 tasks done
719media opened this issue Oct 29, 2021 · 1 comment · Fixed by #1689
Closed
2 tasks done

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

719media opened this issue Oct 29, 2021 · 1 comment · Fixed by #1689
Labels

Comments

@719media
Copy link
Contributor

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

@smolinari
Copy link

smolinari commented Nov 3, 2021

@ota-meshi - We have the issue that the component name error404 is also being caught by this same linting error, when I don't believe it shouldn't. Should I start a new issue?

Scott

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants