Skip to content

useVueConsistentDefinePropsDeclaration

biome.json
{
"linter": {
"rules": {
"nursery": {
"useVueConsistentDefinePropsDeclaration": "error"
}
}
}
}

Enforce consistent defineProps declaration style.

This rule enforces defineProps typing style which you should use type or runtime declaration.

<script setup lang="ts">
const props = defineProps({
kind: { type: String },
});
</script>
code-block.vue:1:15 lint/nursery/useVueConsistentDefinePropsDeclaration ━━━━━━━━━━━━━━━━━━━━━━━━━━━━

This defineProps declaration uses runtime declaration.

> 1 │ const props = defineProps({
^^^^^^^^^^^^^
> 2 │ kind: { type: String },
> 3 │ });
^^
4 │

It should be defined using type declaration like defineProps<…>().

<script setup lang="ts">
const props = defineProps<{
kind: string;
}>();
</script>