vue/require-macro-variable-name
eslint-plugin-vue
Suggestion
eslint.config.js
import vue from "eslint-plugin-vue";
export default [
{
plugins: { vue },
rules: {
"vue/require-macro-variable-name": "error",
},
},
];<script setup>
const propsDefined = defineProps({ msg: String })
const emitsDefined = defineEmits(['update:msg'])
</script><script setup>
const props = defineProps({ msg: String })
const emit = defineEmits(['update:msg'])
</script>Examples from the ESLint documentation.
No tracked preset enables this rule, so it has no reach yet.
None of the tracked presets enable this rule. Turn it on with the config below.
vue/require-macro-variable-name
eslint-plugin-vue
import vue from "eslint-plugin-vue";
export default [
{
plugins: { vue },
rules: {
"vue/require-macro-variable-name": "error",
},
},
];Oxlint does not have this rule.
nursery/useVueMacroVariableName
nursery · since 2.6.5
{
"linter": {
"rules": {
"nursery": {
"useVueMacroVariableName": "error"
}
}
}
}Enforce adding type declarations to object props
Require using useTemplateRef instead of ref/shallowRef for template refs