Skip to content
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

vue/component-name-in-template-casing not working #783

Open
5 tasks done
chenyulun opened this issue Jul 23, 2024 · 1 comment
Open
5 tasks done

vue/component-name-in-template-casing not working #783

chenyulun opened this issue Jul 23, 2024 · 1 comment

Comments

@chenyulun
Copy link

Describe the bug

eslint + "vue/component-name-in-template-casing": ["error", "PascalCase"],

https://eslint.vuejs.org/rules/component-name-in-template-casing.html#vue-component-name-in-template-casing

eslint9.0+

import antfu from '@antfu/eslint-config'

export default antfu({
  vue: {
    vueVersion: 2,
  },
  rules: {
    'no-console': 'warn',
  },
}, {
  ignores: [
    'dist',
    'public',
    'node_modules',
    '*.d.ts',
  ],
})

只有局部注册的组件,能检测并且要求模板必须使用PascalCase

antfu/eslint-config#535

Reproduction

npm install --save-dev eslint eslint-plugin-vue

System Info

System:
    OS: macOS 12.6.1
    CPU: (16) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
    Memory: 26.85 MB / 32.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 18.18.2 - ~/Library/Caches/fnm_multishells/73193_1721734107367/bin/node
    Yarn: 1.22.21 - ~/Library/pnpm/yarn
    npm: 9.8.1 - ~/Library/Caches/fnm_multishells/73193_1721734107367/bin/npm
    pnpm: 9.5.0 - ~/Library/pnpm/pnpm
    bun: 1.0.29 - ~/.bun/bin/bun
    Watchman: 2023.10.09.00 - /usr/local/bin/watchman
  Browsers:
    Chrome: 126.0.6478.183
    Chrome Canary: 128.0.6612.0
    Edge: 126.0.2592.113
    Safari: 16.1

Used Package Manager

pnpm

Validations

  • Follow our Code of Conduct
  • Read the Contributing Guide.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
  • The provided reproduction is a minimal reproducible of the bug.
@chenyulun
Copy link
Author

chenyulun commented Jul 24, 2024

export default antfu({
rules: {
    'vue/component-name-in-template-casing': ['error', 'PascalCase', {
      registeredComponentsOnly: false,
    }]
  }
})

@chenyulun chenyulun reopened this Jul 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant