From e0a33400394443ddb657efb7e0f0c3b07049ac97 Mon Sep 17 00:00:00 2001 From: Ragini Pandey Date: Mon, 9 Feb 2026 19:22:27 +0530 Subject: [PATCH 1/6] [ESLint] Add @elastic/eui plugin to ESLint config --- packages/eui/.eslintrc.js | 4 +++- packages/eui/package.json | 1 + yarn.lock | 3 ++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/eui/.eslintrc.js b/packages/eui/.eslintrc.js index 130d9b577358..3f761f7b57fe 100644 --- a/packages/eui/.eslintrc.js +++ b/packages/eui/.eslintrc.js @@ -37,6 +37,7 @@ module.exports = { 'plugin:@typescript-eslint/recommended', 'plugin:deprecation/recommended', 'plugin:storybook/recommended', + 'plugin:@elastic/eui/recommended', // Prettier options need to come last, in order to override other style rules 'plugin:prettier/recommended', ], @@ -48,7 +49,8 @@ module.exports = { 'react', 'react-hooks', '@emotion', - 'deprecation' + 'deprecation', + '@elastic/eui' ], rules: { 'deprecation/deprecation': 'warn', diff --git a/packages/eui/package.json b/packages/eui/package.json index b858e0700b2d..3c1b1350bf2c 100644 --- a/packages/eui/package.json +++ b/packages/eui/package.json @@ -107,6 +107,7 @@ "@cypress/webpack-dev-server": "^1.7.0", "@elastic/charts": "^64.1.0", "@elastic/datemath": "^5.0.3", + "@elastic/eslint-plugin-eui": "workspace:*", "@elastic/eui-theme-borealis": "workspace:*", "@emotion/babel-preset-css-prop": "^11.11.0", "@emotion/cache": "^11.11.0", diff --git a/yarn.lock b/yarn.lock index 5ff9bb5eccd9..0e5a17190328 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7062,7 +7062,7 @@ __metadata: languageName: node linkType: hard -"@elastic/eslint-plugin-eui@workspace:packages/eslint-plugin": +"@elastic/eslint-plugin-eui@workspace:*, @elastic/eslint-plugin-eui@workspace:packages/eslint-plugin": version: 0.0.0-use.local resolution: "@elastic/eslint-plugin-eui@workspace:packages/eslint-plugin" dependencies: @@ -7345,6 +7345,7 @@ __metadata: "@cypress/webpack-dev-server": "npm:^1.7.0" "@elastic/charts": "npm:^64.1.0" "@elastic/datemath": "npm:^5.0.3" + "@elastic/eslint-plugin-eui": "workspace:*" "@elastic/eui-theme-borealis": "workspace:*" "@elastic/eui-theme-common": "workspace:*" "@elastic/prismjs-esql": "npm:^1.1.2" From cf0289beebfb5a56c237b646d19b1eabbc8ee3e0 Mon Sep 17 00:00:00 2001 From: Ragini Pandey Date: Mon, 9 Feb 2026 19:25:25 +0530 Subject: [PATCH 2/6] Fix no-css-color rule crash when return argument is undefined --- packages/eslint-plugin/src/rules/no_css_color.ts | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/packages/eslint-plugin/src/rules/no_css_color.ts b/packages/eslint-plugin/src/rules/no_css_color.ts index 6be2f515381c..e47343734d6d 100644 --- a/packages/eslint-plugin/src/rules/no_css_color.ts +++ b/packages/eslint-plugin/src/rules/no_css_color.ts @@ -478,10 +478,20 @@ export const NoCssColor = ESLintUtils.RuleCreator.withoutDocs({ return; } + const returnArgument = ( + functionReturnStatementNode as TSESTree.ReturnStatement + ).argument; + + if ( + !returnArgument || + returnArgument.type !== 'ObjectExpression' + ) { + return; + } + declarationPropertiesNode = ( - (functionReturnStatementNode as TSESTree.ReturnStatement) - .argument as TSESTree.ObjectExpression - )?.properties.filter( + returnArgument as TSESTree.ObjectExpression + ).properties.filter( (property): property is TSESTree.Property => property.type === 'Property' ); From baf15fa4ea20970f376a0c7d222c88afb57e5040 Mon Sep 17 00:00:00 2001 From: Ragini Pandey Date: Mon, 9 Feb 2026 19:31:38 +0530 Subject: [PATCH 3/6] Add changelog entry for dogfooding the `@elastic/eslint-plugin-eui` in the `packages/eui` package --- packages/eui/changelogs/upcoming/9368.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 packages/eui/changelogs/upcoming/9368.md diff --git a/packages/eui/changelogs/upcoming/9368.md b/packages/eui/changelogs/upcoming/9368.md new file mode 100644 index 000000000000..35ade34270d8 --- /dev/null +++ b/packages/eui/changelogs/upcoming/9368.md @@ -0,0 +1 @@ +- Added dogfooding the `@elastic/eslint-plugin-eui` in the `packages/eui` package \ No newline at end of file From 0adf6fc26c0bb3484822fd11721d65ebd89c2361 Mon Sep 17 00:00:00 2001 From: Ragini Pandey Date: Mon, 9 Feb 2026 20:05:53 +0530 Subject: [PATCH 4/6] Add changelog entry for dogfooding the `@elastic/eslint-plugin-eui` --- packages/{eui => eslint-plugin}/changelogs/upcoming/9368.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) rename packages/{eui => eslint-plugin}/changelogs/upcoming/9368.md (65%) diff --git a/packages/eui/changelogs/upcoming/9368.md b/packages/eslint-plugin/changelogs/upcoming/9368.md similarity index 65% rename from packages/eui/changelogs/upcoming/9368.md rename to packages/eslint-plugin/changelogs/upcoming/9368.md index 35ade34270d8..72b549d3bae1 100644 --- a/packages/eui/changelogs/upcoming/9368.md +++ b/packages/eslint-plugin/changelogs/upcoming/9368.md @@ -1 +1,3 @@ -- Added dogfooding the `@elastic/eslint-plugin-eui` in the `packages/eui` package \ No newline at end of file +**Bug fixes** + +- Added dogfooding the `@elastic/eslint-plugin-eui` in the `packages/eui` package From 809ad054bb4eff5e9162390c2f37d333466b8100 Mon Sep 17 00:00:00 2001 From: Ragini Pandey Date: Tue, 10 Feb 2026 22:06:46 +0530 Subject: [PATCH 5/6] Fix dogfooding enforcement for `@elastic/eslint-plugin-eui` in the `packages/eui` package --- packages/eslint-plugin/changelogs/upcoming/9368.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/eslint-plugin/changelogs/upcoming/9368.md b/packages/eslint-plugin/changelogs/upcoming/9368.md index 72b549d3bae1..86301fd6ecd7 100644 --- a/packages/eslint-plugin/changelogs/upcoming/9368.md +++ b/packages/eslint-plugin/changelogs/upcoming/9368.md @@ -1,3 +1,3 @@ **Bug fixes** -- Added dogfooding the `@elastic/eslint-plugin-eui` in the `packages/eui` package +- Fixed `@elastic/eslint-plugin-eui` to properly enforce rules within the `packages/eui` package itself From ea21ca77ca075a64f066e3abfcfb943c14e9394d Mon Sep 17 00:00:00 2001 From: Ragini Pandey Date: Tue, 10 Feb 2026 22:59:54 +0530 Subject: [PATCH 6/6] Fix no-css-color rule crash when analyzing functions returning undefined or non-object values --- packages/eslint-plugin/changelogs/upcoming/9368.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/eslint-plugin/changelogs/upcoming/9368.md b/packages/eslint-plugin/changelogs/upcoming/9368.md index 86301fd6ecd7..aa3dd7dee6a7 100644 --- a/packages/eslint-plugin/changelogs/upcoming/9368.md +++ b/packages/eslint-plugin/changelogs/upcoming/9368.md @@ -1,3 +1,3 @@ **Bug fixes** -- Fixed `@elastic/eslint-plugin-eui` to properly enforce rules within the `packages/eui` package itself +- Fixed `no-css-color` ESLint rule crash when analyzing functions that return `undefined` or non-object values