ESLint plugin
The essential plugin for use with the Atlassian Design System.lozenge-badge-tag-labelling-system-migration
Migrate legacy Lozenge and Badge appearance values and legacy SimpleTag/RemovableTag usage. The rule is opt-in and retains warnings when a safe automatic migration cannot be inferred.
Appearance values
Apply the autofix for these static values. The diagnostic names the old and replacement values.
| Component | Legacy → semantic |
|---|---|
| Lozenge | default → neutral; inprogress → information; moved → warning; removed → danger; new → discovery |
| Badge | default → neutral; primary → information; primaryInverted → inverse; added → success; removed/important → danger |
For dynamic Badge appearance, inspect each possible value and update the value producer. A dynamic
expression still requires manual review after its values are mapped; the rule cannot prove its type.
Lozenge isBold cleanup is outside this rule. Check the installed Lozenge API separately; this rule
leaving a prop untouched does not establish that the prop is supported.
Plain Tag
The root default @atlaskit/tag export is the legacy RemovableTag. The supported new plain Tag is
the default export from @atlaskit/tag/tag-new, with required text: string | string[]. It does
not display children. For SimpleTag, preserve non-removability with isRemovable={false}.
// Before
import { SimpleTag } from '@atlaskit/tag';
<SimpleTag text="Design" color="blueLight" />;
// After
import Tag from '@atlaskit/tag/tag-new';
<Tag text="Design" color="blue" isRemovable={false} />;The autofix handles an isolated import with one JSX use, a static text prop or one plain text
child, and supported props. It maps legacy Light colors and grey/greyLight, preserves a static
non-Avatar elemBefore, and sets isRemovable={false} for SimpleTag. If Tag is already bound, it
chooses an unused MigratedTag name.
For mixed imports, multiple references, existing new Tag imports, spreads, callbacks, dynamic or unsupported props, or children that are not one plain text node, follow the diagnostic and migrate manually. Preserve every remaining import and migrate all uses of a binding together. Review the current TagNewProps, (opens new window) before transferring props. Existing root default imports named Tag/AvatarTag retain the rule's previous detection scope; a missing diagnostic is not evidence that they already use the new API.
AvatarTag
When the old elemBefore contains an imported Atlaskit Avatar, migrate manually to the default
@atlaskit/tag/avatar-tag export. Supply text: string, an explicit entity type (user,
other, or agent), and an avatar renderer that forwards its provided props. The rule cannot infer
entity type from JSX. Preserve isRemovable={false} when migrating a SimpleTag.
import Avatar from '@atlaskit/avatar';
import AvatarTag from '@atlaskit/tag/avatar-tag';
<AvatarTag text="Alex" type="user" avatar={(props) => <Avatar {...props} />} isRemovable={false} />;Check AvatarTagProps, (opens new window) for entity-specific props and removal callbacks. Keep the diagnostic visible until the migration is complete; do not substitute a root Tag import or invent a named root Tag export.