vue/no-restricted-component-options
eslint-plugin-vue
No autofix
eslint.config.js
import vue from "eslint-plugin-vue";
export default [
{
plugins: { vue },
rules: {
"vue/no-restricted-component-options": "error",
},
},
];<script>
export default {
init() {},
};
</script><script>
export default {
props: {
name: { type: String, twoWay: true },
},
};
</script><script setup>
defineOptions({
init() {},
});
</script><script>
export default {
beforeCreate() {},
props: {
name: { type: String, required: true },
},
};
</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/no-restricted-component-options
eslint-plugin-vue
import vue from "eslint-plugin-vue";
export default [
{
plugins: { vue },
rules: {
"vue/no-restricted-component-options": "error",
},
},
];Oxlint does not have this rule.
nursery/noVueRestrictedComponentOptions
nursery · since 2.6.10
{
"linter": {
"rules": {
"nursery": {
"noVueRestrictedComponentOptions": "error"
}
}
}
}Disallow asynchronously called restricted methods
Disallow usages of ref objects that can lead to loss of reactivity
Disallow usages that lose the reactivity of props passed to setup