From 2a9fed64e92ba990a99d4b159ed0447f97a83e1a Mon Sep 17 00:00:00 2001 From: Alice Date: Wed, 4 Jan 2023 12:05:32 -0500 Subject: [PATCH] chore(item): modify slot deprecation notice to avoid JSDoc formatting issue (#26564) This changes the deprecation notice for a few `@slot` tags on the `ion-item` component. Previously the lines in question looked something like this: ```ts /** * @slot a slot that does something @deprecated this is going away! */ export class Item { ... ``` The intention behind formatting the JSDoc this way was to mark the `@slot` itself as deprecated, to advice users that it will be removed in the future. Unfortunately, JSDoc tooling doesn't interpret the `@deprecated` tag as referring to the `@slot` tag here, but instead as one of the tags applied to the `Item` class. If we wanted to use `@deprecated` to mark only a slot as deprecated then we'd need a way to write a JSDoc just for that slot itself. Since we don't want to mark the whole class as deprecated, as a workaround, we can change to using `**DEPRECATED**` instead, which will appear prominently in generated documentation but will not confuse tools which are JSDoc-aware. --- core/src/components/item/item.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/components/item/item.tsx b/core/src/components/item/item.tsx index f72ebfe3ea..b2f8cc325d 100644 --- a/core/src/components/item/item.tsx +++ b/core/src/components/item/item.tsx @@ -19,8 +19,8 @@ import type { CounterFormatter } from './item-interface'; * @slot - Content is placed between the named slots if provided without a slot. * @slot start - Content is placed to the left of the item text in LTR, and to the right in RTL. * @slot end - Content is placed to the right of the item text in LTR, and to the left in RTL. - * @slot helper - Content is placed under the item and displayed when no error is detected. @deprecated Use the "helperText" property on ion-input or ion-textarea instead. - * @slot error - Content is placed under the item and displayed when an error is detected. @deprecated Use the "errorText" property on ion-input or ion-textarea instead. + * @slot helper - Content is placed under the item and displayed when no error is detected. **DEPRECATED** Use the "helperText" property on ion-input or ion-textarea instead. + * @slot error - Content is placed under the item and displayed when an error is detected. **DEPRECATED** Use the "errorText" property on ion-input or ion-textarea instead. * * @part native - The native HTML button, anchor or div element that wraps all child elements. * @part detail-icon - The chevron icon for the item. Only applies when `detail="true"`.