From 3bce58dd474f53d44c7a2c79d2aa779d481c266f Mon Sep 17 00:00:00 2001 From: Luke Bennett Date: Sat, 11 Jul 2026 09:28:48 +1000 Subject: [PATCH] Remove implicit return for multi-line arrow functions --- .../playground/icon-toggle-button-group.tsx | 8 ++++---- apps/docs/src/lib/remark-validate-examples.ts | 5 +++-- .../rainbow-sprinkles/src/define-properties.ts | 6 +++--- .../react/src/button/button.visual.test.tsx | 8 ++++---- .../loading-spinner/loading-spinner.stories.tsx | 9 +++------ packages/@luke-ui/react/src/recipes/text.css.ts | 7 ++++--- packages/@luke-ui/react/src/text/text.stories.tsx | 6 +++--- .../use-synchronize-animations.browser.test.tsx | 13 ++++++------- .../src/component-creation-plan.test.ts | 14 +++++++------- 9 files changed, 37 insertions(+), 39 deletions(-) diff --git a/apps/docs/src/components/playground/icon-toggle-button-group.tsx b/apps/docs/src/components/playground/icon-toggle-button-group.tsx index e8908bba..c974d461 100644 --- a/apps/docs/src/components/playground/icon-toggle-button-group.tsx +++ b/apps/docs/src/components/playground/icon-toggle-button-group.tsx @@ -51,12 +51,12 @@ export function IconToggleButtonGroup({ {options.map(({ Icon, label: optionLabel, value: optionValue }) => ( - cx( + className={({ isSelected }) => { + return cx( 'flex size-8 cursor-pointer items-center justify-center rounded-full text-fd-muted-foreground transition-colors data-hovered:bg-fd-accent data-hovered:text-fd-accent-foreground data-pressed:bg-fd-accent', isSelected && 'bg-fd-background text-fd-foreground shadow-sm', - ) - } + ); + }} id={optionValue} key={optionValue} > diff --git a/apps/docs/src/lib/remark-validate-examples.ts b/apps/docs/src/lib/remark-validate-examples.ts index 3f511499..dc086141 100644 --- a/apps/docs/src/lib/remark-validate-examples.ts +++ b/apps/docs/src/lib/remark-validate-examples.ts @@ -27,8 +27,9 @@ export function remarkValidateExamples() { if (node.name !== 'ExampleBlock') return; const srcAttr = node.attributes.find( - (attr: MdxJsxAttribute | { type: 'mdxJsxExpressionAttribute'; value: string }) => - attr.type === 'mdxJsxAttribute' && attr.name === 'src', + (attr: MdxJsxAttribute | { type: 'mdxJsxExpressionAttribute'; value: string }) => { + return attr.type === 'mdxJsxAttribute' && attr.name === 'src'; + }, ) as MdxJsxAttribute | undefined; if (!srcAttr || typeof srcAttr.value !== 'string') { diff --git a/packages/@luke-ui/rainbow-sprinkles/src/define-properties.ts b/packages/@luke-ui/rainbow-sprinkles/src/define-properties.ts index ad37d179..c2615b95 100644 --- a/packages/@luke-ui/rainbow-sprinkles/src/define-properties.ts +++ b/packages/@luke-ui/rainbow-sprinkles/src/define-properties.ts @@ -78,9 +78,9 @@ function createStyles( vars: { default: cssVar }, }; } - const vars = mapValues(conditions, (_, conditionName) => - createVar(`${property}-${conditionName}`), - ); + const vars = mapValues(conditions, (_, conditionName) => { + return createVar(`${property}-${conditionName}`); + }); const classes = mapValues(conditions, (conditionValue, conditionName) => { const styleValue = wrapConditionStyle({ [property]: vars[conditionName] }, conditionValue); return style( diff --git a/packages/@luke-ui/react/src/button/button.visual.test.tsx b/packages/@luke-ui/react/src/button/button.visual.test.tsx index 791bbbbf..7b4d9d59 100644 --- a/packages/@luke-ui/react/src/button/button.visual.test.tsx +++ b/packages/@luke-ui/react/src/button/button.visual.test.tsx @@ -20,13 +20,13 @@ const sizes = variantValuesFor()(['small', 'medium']); test('tones across sizes', async () => { const locator = renderVisual( - {sizes.flatMap((size) => - tones.map((tone) => ( + {sizes.flatMap((size) => { + return tones.map((tone) => ( - )), - )} + )); + })} , ); diff --git a/packages/@luke-ui/react/src/loading-spinner/loading-spinner.stories.tsx b/packages/@luke-ui/react/src/loading-spinner/loading-spinner.stories.tsx index 0b453ccd..38cfa16a 100644 --- a/packages/@luke-ui/react/src/loading-spinner/loading-spinner.stories.tsx +++ b/packages/@luke-ui/react/src/loading-spinner/loading-spinner.stories.tsx @@ -116,10 +116,7 @@ function StaggeredSpinners(props: LoadingSpinnerProps) { } function findSpinAnimations(root: Element): Array { - return root - .getAnimations({ subtree: true }) - .filter( - (animation): animation is CSSAnimation => - animation instanceof CSSAnimation && animation.animationName === spinAnimationName, - ); + return root.getAnimations({ subtree: true }).filter((animation): animation is CSSAnimation => { + return animation instanceof CSSAnimation && animation.animationName === spinAnimationName; + }); } diff --git a/packages/@luke-ui/react/src/recipes/text.css.ts b/packages/@luke-ui/react/src/recipes/text.css.ts index 14c9023e..3f4ed6d7 100644 --- a/packages/@luke-ui/react/src/recipes/text.css.ts +++ b/packages/@luke-ui/react/src/recipes/text.css.ts @@ -104,15 +104,16 @@ const lineClampSingleLine = { textOverflow: 'ellipsis', whiteSpace: 'nowrap', } satisfies ComplexStyleRule; -const lineClampMultiLine = (lines: number) => - ({ +const lineClampMultiLine = (lines: number) => { + return { WebkitBoxOrient: 'vertical', WebkitLineClamp: lines, display: '-webkit-box', lineClamp: lines, minInlineSize: 0, overflow: 'hidden', - }) satisfies ComplexStyleRule; + } satisfies ComplexStyleRule; +}; const lineClampVariants = { false: lineClampNone, diff --git a/packages/@luke-ui/react/src/text/text.stories.tsx b/packages/@luke-ui/react/src/text/text.stories.tsx index fbf896b9..0d60ba99 100644 --- a/packages/@luke-ui/react/src/text/text.stories.tsx +++ b/packages/@luke-ui/react/src/text/text.stories.tsx @@ -93,9 +93,9 @@ const fontFamilies = tokenKeys(tokens.fontFamily) satisfies Array; -const headingFontSizes = fontSizes.filter((fontSize) => - ['h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'large', 'xlarge', 'xxlarge'].includes(fontSize), -); +const headingFontSizes = fontSizes.filter((fontSize) => { + return ['h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'large', 'xlarge', 'xxlarge'].includes(fontSize); +}); const fontWeights = [...tokenKeys(tokens.fontWeight), 'inherit'] satisfies Array< TextProps['fontWeight'] diff --git a/packages/@luke-ui/react/src/use-synchronize-animations/use-synchronize-animations.browser.test.tsx b/packages/@luke-ui/react/src/use-synchronize-animations/use-synchronize-animations.browser.test.tsx index 4922c094..12a49d50 100644 --- a/packages/@luke-ui/react/src/use-synchronize-animations/use-synchronize-animations.browser.test.tsx +++ b/packages/@luke-ui/react/src/use-synchronize-animations/use-synchronize-animations.browser.test.tsx @@ -19,9 +19,9 @@ let frameCallbacks: Array = []; let roots: Array = []; let containers: Array = []; -const requestFrame = vi.fn<(callback: FrameRequestCallback) => number>((callback) => - frameCallbacks.push(callback), -); +const requestFrame = vi.fn<(callback: FrameRequestCallback) => number>((callback) => { + return frameCallbacks.push(callback); +}); function flushFrames() { while (frameCallbacks.length > 0) { @@ -62,10 +62,9 @@ function PulsingBox({ name }: { name: string | null }) { function cssAnimationsNamed(name: string): Array { return document.body .getAnimations({ subtree: true }) - .filter( - (animation): animation is CSSAnimation => - animation instanceof CSSAnimation && animation.animationName === name, - ); + .filter((animation): animation is CSSAnimation => { + return animation instanceof CSSAnimation && animation.animationName === name; + }); } beforeEach(() => { diff --git a/packages/turbo-generators/src/component-creation-plan.test.ts b/packages/turbo-generators/src/component-creation-plan.test.ts index 86b2c7f7..5e088e6a 100644 --- a/packages/turbo-generators/src/component-creation-plan.test.ts +++ b/packages/turbo-generators/src/component-creation-plan.test.ts @@ -65,14 +65,14 @@ describe('createComponentPlan', () => { }); it('rejects invalid component names before file writes', () => { - expect(() => - createComponentPlan({ + expect(() => { + return createComponentPlan({ docsGroup: 'forms', name: '../Bad', styling: 'none', tier: 'atom', - }), - ).toThrow('Use letters/numbers/hyphens. Start with a letter.'); + }); + }).toThrow('Use letters/numbers/hyphens. Start with a letter.'); }); it('keeps editorial docs surfaces out of the plan', () => { @@ -101,9 +101,9 @@ describe('createComponentPlan', () => { tier: 'atom', }); - const source = plan.files.find((file) => - file.path.endsWith('/plain-badge/index.tsx'), - )?.contents; + const source = plan.files.find((file) => { + return file.path.endsWith('/plain-badge/index.tsx'); + })?.contents; expect(source).not.toContain("import { cx } from '../utils/index.js';"); expect(source).not.toContain('cx('); -- 2.51.2