vue/prefer-prop-type-boolean-first
eslint-plugin-vue
Suggestion
eslint.config.js
import vue from "eslint-plugin-vue";
export default [
{
plugins: { vue },
rules: {
"vue/prefer-prop-type-boolean-first": "error",
},
},
]; e: [String, Boolean],
f: {
type: [String, Boolean]
}
}
}
</script>a: Boolean,
b: String,
c: [Boolean, String],
d: {
type: [Boolean, String]
},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/prefer-prop-type-boolean-first
eslint-plugin-vue
import vue from "eslint-plugin-vue";
export default [
{
plugins: { vue },
rules: {
"vue/prefer-prop-type-boolean-first": "error",
},
},
];Oxlint does not have this rule.
nursery/useVueBooleanPropTypeFirst
nursery · since 2.6.5
{
"linter": {
"rules": {
"nursery": {
"useVueBooleanPropTypeFirst": "error"
}
}
}
}Enforce passing a single argument to custom event emissions
Disallow unnecessary concatenation of literals or template literals in <template>
Require shorthand form attribute when v-bind value is true
Disallow using v-else-if/v-else on the same element as v-for
Require using useTemplateRef instead of ref/shallowRef for template refs