Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
8d8a76e
feat(eui): remove all deprecated icon handles
weronikaolejniczak Jul 16, 2026
a91ee83
feat(eui): remove deprecated token alias
weronikaolejniczak Jul 16, 2026
3a2e40f
chore(eui): update icon tests
weronikaolejniczak Jul 16, 2026
f741b03
feat(eui): remove deprecated icon assets
weronikaolejniczak Jul 16, 2026
3406438
feat(eui): replace deprecated handles
weronikaolejniczak Jul 16, 2026
5dcdf3c
chore(eui): add changelog entry
weronikaolejniczak Jul 20, 2026
94d00da
chore(eui): add tokenVectorDense to a11y coverage
weronikaolejniczak Jul 21, 2026
c80010a
feat(eui): add back deprecated handle exceptions
weronikaolejniczak Jul 22, 2026
7ef8390
chore(eui): update VRT baseline screenshots
kibanamachine Jul 22, 2026
a3b15d5
chore(eui): update VRT baseline screenshots
kibanamachine Jul 22, 2026
b011ffb
chore(eui): update deprecated icon snapshots
weronikaolejniczak Jul 22, 2026
da159e3
fix(eui): preserve persisted icon aliases
weronikaolejniczak Jul 23, 2026
3706670
chore(eui): update VRT baseline screenshots
kibanamachine Jul 23, 2026
31987b8
feat(eslint-plugin): add no-deprecated-icon-aliases rule
weronikaolejniczak Jul 23, 2026
5125cc2
chore(eui): update VRT baseline screenshots
kibanamachine Jul 23, 2026
c029d89
feat(eui): deprecate more icons and add aliases
weronikaolejniczak Jul 27, 2026
2b81f7b
feat(eui): replace boxesVertical with ellipsis
weronikaolejniczak Jul 27, 2026
6573612
chore(eui): update VRT baseline screenshots
weronikaolejniczak Jul 27, 2026
cf31175
chore(eui): update snapshots after boxesVertical β†’ ellipsis icon rename
weronikaolejniczak Jul 30, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions packages/eslint-plugin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,16 @@ We don't use `no-restricted-imports` because ESLint doesn't allow multiple error

All deprecations still must follow our [deprecation process](../../wiki/eui-team-processes/deprecations.md).

### `@elastic/eui/no-deprecated-icon-aliases`

Disallows deprecated EUI icon aliases in static JSX props on components imported
from `@elastic/eui`. The rule checks props ending in `IconType`, the `type` prop
on `EuiIcon` and `EuiIconTip`, and component-specific icon props such as
`timelineAvatar`, `icon`, `logo`, `iconLeft`, and `iconRight`. It automatically
replaces deprecated aliases with their supported icon handles.

See the full table of icon replacements here: https://github.com/elastic/eui/issues/9561

### `@elastic/eui/no-css-color`

This rule warns engineers to not use literal css color in the codebase, particularly for CSS properties that apply color to either the html element or text nodes, but rather urge users to defer to using the color tokens provided by EUI.
Expand Down
1 change: 1 addition & 0 deletions packages/eslint-plugin/changelogs/upcoming/9815.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Add `no-deprecated-icon-aliases` rule
3 changes: 3 additions & 0 deletions packages/eslint-plugin/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import { EuiBadgeAccessibilityRules } from './rules/a11y/badge_accessibility_rul
import { EuiIconAccessibilityRules } from './rules/a11y/icon_accessibility_rules';
import { TooltipNoInteractiveContent } from './rules/a11y/tooltip_no_interactive_content';
import { TooltipButtonIconWrap } from './rules/a11y/tooltip_button_icon_wrap';
import { NoDeprecatedIconAliases } from './rules/no_deprecated_icon_aliases';

const config = {
rules: {
Expand All @@ -36,6 +37,7 @@ const config = {
'consistent-is-invalid-props': ConsistentIsInvalidProps,
'href-or-on-click': HrefOnClick,
'no-css-color': NoCssColor,
'no-deprecated-icon-aliases': NoDeprecatedIconAliases,
'no-restricted-eui-imports': NoRestrictedEuiImports,
'no-static-z-index': NoStaticZIndex,
'no-unnamed-interactive-element': NoUnnamedInteractiveElement,
Expand Down Expand Up @@ -63,6 +65,7 @@ const config = {
'@elastic/eui/consistent-is-invalid-props': 'warn',
'@elastic/eui/href-or-on-click': 'warn',
'@elastic/eui/no-css-color': 'warn',
'@elastic/eui/no-deprecated-icon-aliases': 'warn',
'@elastic/eui/no-restricted-eui-imports': 'warn',
'@elastic/eui/no-static-z-index': 'warn',
'@elastic/eui/no-unnamed-interactive-element': 'warn',
Expand Down
153 changes: 153 additions & 0 deletions packages/eslint-plugin/src/rules/no_deprecated_icon_aliases.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/

import { RuleTester } from '@typescript-eslint/rule-tester';
import {
DEPRECATED_ICON_ALIASES,
DEPRECATED_ICONS_WITHOUT_REPLACEMENT,
NoDeprecatedIconAliases,
} from './no_deprecated_icon_aliases';

const languageOptions = {
sourceType: 'module' as const,
parserOptions: {
ecmaFeatures: {
jsx: true,
},
},
};

const ruleTester = new RuleTester();

ruleTester.run('no-deprecated-icon-aliases', NoDeprecatedIconAliases, {
valid: [
{
code: 'import { EuiIcon } from "@elastic/eui";\n<EuiIcon type="warning" />',
languageOptions,
},
{
code: 'import { EuiButtonIcon } from "@elastic/eui";\n<EuiButtonIcon iconType={iconType} />',
languageOptions,
},
{
code: '<Component type="alert" />',
languageOptions,
},
{
code: '<Component status="alert" />',
languageOptions,
},
{
code: '<CustomComponent leadingIcon="mapMarker" />',
languageOptions,
},
{
code: 'import { EuiEmptyPrompt } from "@elastic/eui";\n<EuiEmptyPrompt icon="alert" />',
languageOptions,
},
{
code: '<EuiIcon type="alert" />',
languageOptions,
},
],
invalid: [
...Object.entries(DEPRECATED_ICON_ALIASES).map(([alias, replacement]) => ({
code: `import { EuiIcon } from "@elastic/eui";\n<EuiIcon type="${alias}" />`,
output: `import { EuiIcon } from "@elastic/eui";\n<EuiIcon type="${replacement}" />`,
languageOptions,
errors: [
{
messageId: 'deprecatedIconAlias' as const,
data: { alias, replacement },
},
],
})),
...Array.from(DEPRECATED_ICONS_WITHOUT_REPLACEMENT).map((iconType) => ({
code: `import { EuiIcon } from "@elastic/eui";\n<EuiIcon type="${iconType}" />`,
languageOptions,
errors: [
{
messageId: 'deprecatedIcon' as const,
data: { iconType },
},
],
})),
{
code: "import { EuiButtonIcon } from '@elastic/eui';\n<EuiButtonIcon iconType={'editorComment'} />",
output:
"import { EuiButtonIcon } from '@elastic/eui';\n<EuiButtonIcon iconType={'comment'} />",
languageOptions,
errors: [
{
messageId: 'deprecatedIconAlias',
data: { alias: 'editorComment', replacement: 'comment' },
},
],
},
{
code: 'import { EuiCommentTimeline } from "@elastic/eui";\n<EuiCommentTimeline timelineAvatar="compute" />',
output:
'import { EuiCommentTimeline } from "@elastic/eui";\n<EuiCommentTimeline timelineAvatar="processor" />',
languageOptions,
errors: [
{
messageId: 'deprecatedIconAlias',
data: { alias: 'compute', replacement: 'processor' },
},
],
},
{
code: 'import { EuiTimelineItem } from "@elastic/eui";\n<EuiTimelineItem icon="temperature" />',
output:
'import { EuiTimelineItem } from "@elastic/eui";\n<EuiTimelineItem icon="thermometer" />',
languageOptions,
errors: [
{
messageId: 'deprecatedIconAlias',
data: { alias: 'temperature', replacement: 'thermometer' },
},
],
},
{
code: 'import { EuiLoadingLogo } from "@elastic/eui";\n<EuiLoadingLogo logo="visArea" />',
output:
'import { EuiLoadingLogo } from "@elastic/eui";\n<EuiLoadingLogo logo="chartArea" />',
languageOptions,
errors: [
{
messageId: 'deprecatedIconAlias',
data: { alias: 'visArea', replacement: 'chartArea' },
},
],
},
{
code: 'import { EuiFormPrepend } from "@elastic/eui";\n<EuiFormPrepend iconLeft="search" />',
output:
'import { EuiFormPrepend } from "@elastic/eui";\n<EuiFormPrepend iconLeft="magnify" />',
languageOptions,
errors: [
{
messageId: 'deprecatedIconAlias',
data: { alias: 'search', replacement: 'magnify' },
},
],
},
{
code: 'import { EuiIcon as Icon } from "@elastic/eui";\n<Icon type="mapMarker" />',
output:
'import { EuiIcon as Icon } from "@elastic/eui";\n<Icon type="waypoint" />',
languageOptions,
errors: [
{
messageId: 'deprecatedIconAlias',
data: { alias: 'mapMarker', replacement: 'waypoint' },
},
],
},
],
});
Loading