vue/component-api-style
eslint-plugin-vue
No autofix
eslint.config.js
import vue from "eslint-plugin-vue";
export default [
{
plugins: { vue },
rules: {
"vue/component-api-style": "error",
},
},
];<script setup>
import { ref } from 'vue'
const msg = ref('Hello World!')
</script><script setup>
import { ref } from 'vue'
const msg = ref('Hello World!')
</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/component-api-style
eslint-plugin-vue
import vue from "eslint-plugin-vue";
export default [
{
plugins: { vue },
rules: {
"vue/component-api-style": "error",
},
},
];Oxlint does not have this rule.
style/noVueOptionsApi
style · since 2.3.12
{
"linter": {
"rules": {
"style": {
"noVueOptionsApi": "error"
}
}
}
}Disallow usage of button without an explicit type attribute
Require component name property to match its file name
Disallow constant expressions in conditions in <template>