vue/match-component-file-name
eslint-plugin-vue
Suggestion
eslint.config.js
import vue from "eslint-plugin-vue";
export default [
{
plugins: { vue },
rules: {
"vue/match-component-file-name": "error",
},
},
];<script>
export default {
name: "MyButton"
};
</script><script setup>
defineOptions({
name: "my-component"
});
</script>app.component("MyButton", {
template: "<div />"
});<script>
export default {
name: "MyComponent"
};
</script>Examples from the Biome 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/match-component-file-name
eslint-plugin-vue
import vue from "eslint-plugin-vue";
export default [
{
plugins: { vue },
rules: {
"vue/match-component-file-name": "error",
},
},
];Oxlint does not have this rule.
nursery/useVueMatchingComponentFileName
nursery · since 2.6.0
{
"linter": {
"rules": {
"nursery": {
"useVueMatchingComponentFileName": "error"
}
}
}
}Disallow usage of button without an explicit type attribute
Disallow constant expressions in conditions in <template>