We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Checklist
Tell us about your environment
Please show your full configuration:
import pluginVue from 'eslint-plugin-vue' import vueTsEslintConfig from '@vue/eslint-config-typescript' import pluginVitest from '@vitest/eslint-plugin' import skipFormatting from '@vue/eslint-config-prettier/skip-formatting' export default [ { name: 'app/files-to-lint', files: ['**/*.{ts,mts,tsx,vue}'], }, { name: 'app/files-to-ignore', ignores: ['**/dist/**', '**/dist-ssr/**', '**/coverage/**'], }, ...pluginVue.configs['flat/essential'], ...vueTsEslintConfig(), { ...pluginVitest.configs.recommended, files: ['src/**/__tests__/*'], }, skipFormatting, { rules: { "vue/custom-event-name-casing": "error" } } ]
What did you do?
<script setup lang="ts"> const emit = defineEmits({ 'foo-bar': () => true }) emit('foo-bar') </script> <template> <button @click="emit('foo-bar')">Foo</button> <button @click="$emit('foo-bar')">Foo</button> </template>
What did you expect to happen? ESLint should flag all three emits because they all use kebab case instead of camelcase.
What actually happened?
It flags the one in script setup and the one using $emit in the template, but not the one using emit.
$emit
emit
➜ vue-project npm run lint > [email protected] lint > eslint . --fix /home/.../dev/vue-project/src/components/HelloWorld.vue 4:6 error Custom event name 'foo-bar' must be camelCase vue/custom-event-name-casing 9:25 error Custom event name 'foo-bar' must be camelCase vue/custom-event-name-casing ✖ 2 problems (2 errors, 0 warnings)
Repository to reproduce this issue
https://github.com/henribru/eslint-plugin-vue-custom-event-name-casing-bug
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
Checklist
Tell us about your environment
Please show your full configuration:
What did you do?
What did you expect to happen?
ESLint should flag all three emits because they all use kebab case instead of camelcase.
What actually happened?
It flags the one in script setup and the one using
$emit
in the template, but not the one usingemit
.Repository to reproduce this issue
https://github.com/henribru/eslint-plugin-vue-custom-event-name-casing-bug
The text was updated successfully, but these errors were encountered: