From c8c0121d769cb5de2d3f5f3e0821e78f97668fcc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Connor=20B=C3=A4r?= Date: Thu, 17 Oct 2024 16:28:59 +0200 Subject: [PATCH] Add missing rule for BodyLarge deprecation --- packages/circuit-ui/components/BodyLarge/BodyLarge.tsx | 2 +- packages/circuit-ui/components/SubHeadline/SubHeadline.tsx | 2 +- .../no-deprecated-components/index.ts | 6 +++++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/packages/circuit-ui/components/BodyLarge/BodyLarge.tsx b/packages/circuit-ui/components/BodyLarge/BodyLarge.tsx index ec6dc6fb0a..2b5b32342d 100644 --- a/packages/circuit-ui/components/BodyLarge/BodyLarge.tsx +++ b/packages/circuit-ui/components/BodyLarge/BodyLarge.tsx @@ -20,7 +20,7 @@ import { Body, type BodyProps } from '../Body/Body.js'; export type BodyLargeProps = Omit; /** - * @deprecated Use the Body component in size `l` instead. + * @deprecated Use the Body component with `size="l"` instead. */ export const BodyLarge = forwardRef( (props, ref) => { diff --git a/packages/circuit-ui/components/SubHeadline/SubHeadline.tsx b/packages/circuit-ui/components/SubHeadline/SubHeadline.tsx index fc5ebeeef8..5f520c1f0e 100644 --- a/packages/circuit-ui/components/SubHeadline/SubHeadline.tsx +++ b/packages/circuit-ui/components/SubHeadline/SubHeadline.tsx @@ -28,7 +28,7 @@ export interface SubHeadlineProps extends HTMLAttributes { } /** - * @deprecated Use the Headline component in size `s` instead. + * @deprecated Use the Headline component with `size="s"` instead. */ export const SubHeadline = forwardRef( (props, ref) => { diff --git a/packages/eslint-plugin-circuit-ui/no-deprecated-components/index.ts b/packages/eslint-plugin-circuit-ui/no-deprecated-components/index.ts index d49163e463..d305e0ee63 100644 --- a/packages/eslint-plugin-circuit-ui/no-deprecated-components/index.ts +++ b/packages/eslint-plugin-circuit-ui/no-deprecated-components/index.ts @@ -33,12 +33,16 @@ const components = [ }, { name: 'SubHeadline', - alternative: 'Use the Headline component in size `s` instead.', + alternative: 'Use the Headline component with `size="s"` instead.', }, { name: 'Title', alternative: 'Use the new Display component instead.', }, + { + name: 'BodyLarge', + alternative: 'Use the Body component with `size="l"` instead.', + }, ]; export const noDeprecatedComponents = createRule({