Open chenyulun opened 4 months ago
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
PascalCase
https://github.com/antfu/eslint-config/issues/535
npm install --save-dev eslint eslint-plugin-vue
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
pnpm
export default antfu({ rules: { 'vue/component-name-in-template-casing': ['error', 'PascalCase', { registeredComponentsOnly: false, }] } })
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+
只有局部注册的组件,能检测并且要求模板必须使用
PascalCase
https://github.com/antfu/eslint-config/issues/535
Reproduction
npm install --save-dev eslint eslint-plugin-vue
System Info
Used Package Manager
pnpm
Validations