Skip to content

Latest commit

 

History

History
57 lines (40 loc) · 1.34 KB

prefer-type-props-decl.md

File metadata and controls

57 lines (40 loc) · 1.34 KB
pageClass sidebarDepth title description
rule-details
0
vue/prefer-type-props-decl
enforce type-based `defineProps`

vue/prefer-type-props-decl

enforce type-based defineProps

  • This rule has not been released yet.

📖 Rule Details

This rule forces developers to use the type-based declaration of defineProps instead of runtime declaration.

This rule only works in setup script and lang="ts".

<script setup lang="ts">
/* ✓ GOOD */
const props = defineProps<{
  kind: string
}>()
</script>
<script setup lang="ts">
/* ✗ BAD */
const props = defineProps({
  kind: { type: String }
})
</script>

🔧 Options

Nothing.

👫 Related Rules

🔍 Implementation