useVueConsistentDefinePropsDeclaration
Summary
Section titled “Summary”- Diagnostic Category:
lint/nursery/useVueConsistentDefinePropsDeclaration - This rule doesn’t have a fix.
- The default severity of this rule is information.
- This rule belongs to the following domains:
- Sources:
- Same as
vue/define-props-declaration
- Same as
How to configure
Section titled “How to configure”{ "linter": { "rules": { "nursery": { "useVueConsistentDefinePropsDeclaration": "error" } } }}Description
Section titled “Description”Enforce consistent defineProps declaration style.
This rule enforces defineProps typing style which you should use type or runtime declaration.
Examples
Section titled “Examples”Invalid
Section titled “Invalid”<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>Related links
Section titled “Related links”Copyright (c) 2023-present Biome Developers and Contributors.