mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
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.
This commit is contained in:
@@ -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"`.
|
||||
|
||||
Reference in New Issue
Block a user