refactor: remove redundant = false defaults on boolean props (#9155)

## Summary

Remove redundant `= false` defaults from destructured `defineProps` on
boolean props, since Vue's [Boolean
casting](https://vuejs.org/guide/components/props.html#boolean-casting)
already defaults absent boolean props to `false`.

## Changes

- **What**: Remove 10 unnecessary `= false` default values across 8
components

## Review Focus

Vue compiles `defineProps<{ myBool?: boolean }>()` to `{ myBool: { type:
Boolean, required: false } }`. Boolean casting means absent boolean
props are already `false` — the explicit `= false` in JS destructuring
defaults never triggers.

Follow-up to #9150.

┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-9155-refactor-remove-redundant-false-defaults-on-boolean-props-3116d73d36508196af0bcba53257720a)
by [Unito](https://www.unito.io)
This commit is contained in:
Christian Byrne
2026-03-04 16:59:05 -08:00
committed by GitHub
parent 0f8473db35
commit 80e31a27b1
8 changed files with 10 additions and 10 deletions

View File

@@ -78,7 +78,7 @@ interface Props {
isActive?: boolean
}
const { item, isActive = false } = defineProps<Props>()
const { item, isActive } = defineProps<Props>()
const nodeDefStore = useNodeDefStore()
const hasMissingNodes = computed(() =>

View File

@@ -75,7 +75,7 @@ import { useSidebarTabStore } from '@/stores/workspace/sidebarTabStore'
type OverlayState = 'hidden' | 'active' | 'expanded'
const { expanded, menuHovered = false } = defineProps<{
const { expanded, menuHovered } = defineProps<{
expanded?: boolean
menuHovered?: boolean
}>()

View File

@@ -17,8 +17,8 @@ import TopbarBadge from './TopbarBadge.vue'
const {
displayMode = 'full',
reverseOrder = false,
noPadding = false,
reverseOrder,
noPadding,
backgroundColor = 'var(--comfy-menu-bg)'
} = defineProps<{
displayMode?: 'full' | 'compact' | 'icon-only'

View File

@@ -132,8 +132,8 @@ import { cn } from '@/utils/tailwindUtil'
const {
badge,
displayMode = 'full',
reverseOrder = false,
noPadding = false,
reverseOrder,
noPadding,
backgroundColor = 'var(--comfy-menu-bg)'
} = defineProps<{
badge: TopbarBadge

View File

@@ -19,7 +19,7 @@ import { useTopbarBadgeStore } from '@/stores/topbarBadgeStore'
import TopbarBadge from './TopbarBadge.vue'
const { reverseOrder = false, noPadding = false } = defineProps<{
const { reverseOrder, noPadding } = defineProps<{
reverseOrder?: boolean
noPadding?: boolean
}>()

View File

@@ -305,7 +305,7 @@ interface Props {
loadingTier?: CheckoutTierKey | null
}
const { isLoading = false, loadingTier = null } = defineProps<Props>()
const { isLoading, loadingTier = null } = defineProps<Props>()
const emit = defineEmits<{
subscribe: [payload: { tierKey: CheckoutTierKey; billingCycle: BillingCycle }]

View File

@@ -63,7 +63,7 @@ const {
options,
optionLabel = 'label',
optionValue = 'value',
disabled = false
disabled
} = defineProps<Props>()
const emit = defineEmits<Emits>()

View File

@@ -20,7 +20,7 @@ interface Props {
}
const {
isOpen = false,
isOpen,
placeholder = 'Select...',
items,
displayItems,