style(site): use shorthand for boolean JSX props (#25096)

This commit is contained in:
Kayla はな
2026-05-13 10:56:50 -06:00
committed by GitHub
parent 49c6191bbe
commit 660fa9478f
18 changed files with 25 additions and 22 deletions
+3
View File
@@ -101,6 +101,9 @@ Debug logs and pprof dumps use the same job name and commit SHA convention.
- Do not use emdash (U+2014), endash (U+2013), or ` -- ` as punctuation
in code, comments, string literals, or documentation. Use commas,
semicolons, or periods instead. Restructure the sentence if needed.
- For JSX boolean props that are `true`, use the shorthand form
(`<Foo prop />`) instead of `<Foo prop={true} />`. The two are
equivalent; the shorthand is the React convention and reduces noise.
- **Avoid unnecessary indirection.** Inline single-use module-level
constants, single-use aliases, and one-line helpers that just return a
single field at the call site. Do not create wrapper hooks that only
+1 -1
View File
@@ -32,7 +32,7 @@ export const Loader: FC<LoaderProps> = ({
className,
)}
>
<Spinner aria-label={resolvedLabel} size={size} loading={true} />
<Spinner aria-label={resolvedLabel} size={size} loading />
</div>
);
};
@@ -17,7 +17,7 @@ export const PopoverPaywall: FC<PopoverPaywallProps> = ({
message={message}
description={description}
documentationLink={documentationLink}
compact={true}
compact
/>
);
};
@@ -80,7 +80,7 @@ export const SelectMenuSearch: FC<SearchFieldProps> = ({
"w-full border border-solid border-border [&_input]:text-sm",
className,
)}
autoFocus={true}
autoFocus
{...props}
/>
);
@@ -86,7 +86,7 @@ export const MemberAutocomplete: FC<MemberAutocompleteProps> = ({
<InnerAutocomplete<OrganizationMemberWithUserData>
error={membersQuery.error}
isFetching={membersQuery.isFetching}
shouldFilter={true}
shouldFilter
setFilter={setFilter}
users={membersQuery.data?.members}
{...props}
+1 -1
View File
@@ -38,7 +38,7 @@ export const AgentExternal: FC<AgentExternalProps> = ({ agent, workspace }) => {
secret={false}
redactPattern={/CODER_AGENT_TOKEN="([^"]+)"/g}
redactReplacement={`CODER_AGENT_TOKEN="********"`}
showRevealButton={true}
showRevealButton
/>
</section>
);
+1 -1
View File
@@ -523,7 +523,7 @@ export const AgentRow: FC<AgentRowProps> = ({
>
<Spinner
size="lg"
loading={true}
loading
className="text-content-secondary -ml-1"
/>
<span>{runningScriptsCount}</span>
@@ -32,7 +32,7 @@ export const AgentSSHButton: FC<AgentSSHButtonProps> = ({
return (
<Popover>
<PopoverTrigger asChild={true}>
<PopoverTrigger asChild>
<Button size="sm" variant="subtle">
Connect via SSH
<ChevronDownIcon />
@@ -17,7 +17,7 @@ describe("ClassicParameterFlowDeprecationWarning", () => {
<ClassicParameterFlowDeprecationWarning
templateSettingsLink={`/templates/${defaultProps.organizationName}/${defaultProps.templateName}/settings`}
{...defaultProps}
isEnabled={true}
isEnabled
/>,
);
@@ -115,7 +115,7 @@ describe("DynamicParameter", () => {
parameter={mockStringParameter}
value=""
onChange={mockOnChange}
disabled={true}
disabled
/>,
);
@@ -626,7 +626,7 @@ describe("DynamicParameter", () => {
parameter={mockStringParameter}
value="autofilled_value"
onChange={mockOnChange}
autofill={true}
autofill
/>,
);
@@ -651,7 +651,7 @@ describe("DynamicParameter", () => {
parameter={mockStringParameter}
value="preset_value"
onChange={mockOnChange}
isPreset={true}
isPreset
/>,
);
@@ -275,7 +275,7 @@ export const WorkspaceMoreActions: FC<WorkspaceMoreActionsProps> = ({
workspaceOwner={workspace.owner_name}
workspaceName={workspace.name}
templateVersionId={workspace.latest_build.template_version_id}
isDeleting={true}
isDeleting
/>
</>
);
@@ -660,7 +660,7 @@ export const OrgPickerTightSpacing: Story = {
export const OrgChangeConfirmation: Story = {
render: () => (
<ConfirmDialog
open={true}
open
title="Change organization?"
description="Changing organization will remove your current attachments."
type="info"
@@ -321,7 +321,7 @@ export const GroupLimitsSection: FC<GroupLimitsSectionProps> = ({
setPendingDeleteGroupId(null);
}}
isPending={deletePending}
open={true}
open
onOpenChange={(open) => !open && setPendingDeleteGroupId(null)}
/>
)}{" "}
@@ -261,7 +261,7 @@ export const UserOverridesSection: FC<UserOverridesSectionProps> = ({
setPendingDeleteUserId(null);
}}
isPending={deletePending}
open={true}
open
onOpenChange={(open) => !open && setPendingDeleteUserId(null)}
/>
)}{" "}
@@ -334,7 +334,7 @@ describe("AgentsSidebar load-more behavior", () => {
{...defaultProps}
hasNextPage
onLoadMore={onLoadMore}
isFetchingNextPage={true}
isFetchingNextPage
/>
</Wrapper>,
);
@@ -124,7 +124,7 @@ export const AuditLogRow: FC<AuditLogRowProps> = ({
</div>
<div className="flex flex-row items-center gap-4">
<StatusPill isHttpCode={true} code={auditLog.status_code} />
<StatusPill isHttpCode code={auditLog.status_code} />
{/* With multi-org, there is not enough space so show
everything in a tooltip. */}
+1 -1
View File
@@ -747,7 +747,7 @@ const TaskPaused: FC<TaskPausedProps> = ({
open={apiError !== undefined}
error={apiError}
onClose={resumeMutation.reset}
showDetail={true}
showDetail
workspaceOwner={workspace.owner_name}
workspaceName={workspace.name}
templateVersionId={workspace.latest_build.template_version_id}
@@ -94,21 +94,21 @@ export const WorkspaceActions: FC<WorkspaceActionsProps> = ({
<UpdateButton
handleAction={handleUpdate}
isRunning={false}
requireActiveVersion={true}
requireActiveVersion
/>
),
updateAndRestart: (
<UpdateButton
handleAction={handleUpdate}
isRunning={true}
isRunning
requireActiveVersion={false}
/>
),
updateAndRestartRequireActiveVersion: (
<UpdateButton
handleAction={handleUpdate}
isRunning={true}
requireActiveVersion={true}
isRunning
requireActiveVersion
/>
),
updating: <UpdateButton loading handleAction={handleUpdate} />,