Skip to content

useVueConsistentDefinePropsDeclaration (JavaScript)

Language JavaScript (and super languages)
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:2:15 lint/nursery/useVueConsistentDefinePropsDeclaration ━━━━━━━━━━━━━━━━━━━━━━━━━━━━

ℹ This defineProps declaration uses runtime declaration.

1 │ <script setup lang="ts">
> 2 │ const props = defineProps({
│ ^^^^^^^^^^^^^
> 3 │ kind: { type: String },
> 4 │ });
│ ^^
5 │ </script>
6 │

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

ℹ This rule belongs to the nursery group, which means it is not yet stable and may change in the future. Visit https://biomejs.dev/linter/#nursery for more information.

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