Skip to content

Conversation

@weronikaolejniczak
Copy link
Contributor

@weronikaolejniczak weronikaolejniczak commented Jun 6, 2025

Summary

Important

This is a breaking change.

Closes #8708

Removes prefer-css-prop-for-static-styles rule. Read comments on the issue to understand the context.

tl;dr; Using a static code analysis tool like ESLint is unfit for the job. The rule as of now produces too many warnings. We want to explore runtime solutions that can flag dynamic styles.

Kibana impact

There is only 1 mention:

Update commit

Cloud UI impact

No disable comments / rule overrides (search)

@weronikaolejniczak weronikaolejniczak self-assigned this Jun 6, 2025
@weronikaolejniczak weronikaolejniczak requested a review from a team as a code owner June 6, 2025 15:35
@weronikaolejniczak weronikaolejniczak added the breaking change PRs with breaking changes. (Don't delete - used for automation) label Jun 6, 2025
@github-actions
Copy link

github-actions bot commented Jun 6, 2025

This PR contains breaking changes. The opener of this pull request is asked to perform the following due diligence steps below, to assist EUI in our next Kibana upgrade:

  • If this PR contains prop/API changes:
    • Search through Kibana for <EuiComponent usages (example search)
    • In the PR description or in a PR comment, include a count or list with the number of component usages in Kibana that will need to be updated (if that amount is "none", include that information as well)
  • If this PR contains CSS changes:
    • Search through Kibana for the changed EUI selectors, e.g. .euiComponent (example search)
    • In the PR description or in a PR comment, include a count or list with the number of custom CSS overrides in Kibana that will need to be updated (if that amount is "none", include that information as well)
  • 🔍 Tip: When searching through Kibana, consider excluding **/target, **/*.snap, **/*.storyshot files to reduce noise and only look at source code usages
  • ⚠️ For extremely risky changes, the EUI team should potentially consider the following precautions:
    • Using a pre-release release candidate to test Kibana CI ahead of time
    • Using kibana-a-la-carte for manual QA, and to give other Kibana teams a staging server to quickly test against

@weronikaolejniczak weronikaolejniczak marked this pull request as draft June 6, 2025 15:37
@weronikaolejniczak weronikaolejniczak marked this pull request as ready for review June 6, 2025 15:52
@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

History

cc @weronikaolejniczak

@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

cc @weronikaolejniczak

@acstll acstll self-requested a review June 11, 2025 07:15
Copy link
Contributor

@acstll acstll left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I ran test and build locally. Everything seems to be correct. Thanks for tackling this one (again!).

@@ -0,0 +1,3 @@
**Breaking changes**

- Remove `prefer-css-prop-for-static-styles` rule because it produces too many warnings. Static code analysis cannot flag dynamic styles with confidence because it doesn't run the code to asses runtime values. We will explore runtime solutions.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[no action required] I first thought this was too long, but after reading it several times I think it's good to have all this information here (you can understand right away the reason why the rule is being removed, and if you need more context, there will be the link to the PR, etc.)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exactly, following what @JasonStoltz proposed to make the breaking changes more clear.

@weronikaolejniczak weronikaolejniczak merged commit 2cfd347 into elastic:main Jun 11, 2025
6 checks passed
weronikaolejniczak added a commit to elastic/kibana that referenced this pull request Jun 13, 2025
`@elastic/eslint-plugin-eui`: `1.0.0` ⏩ `2.0.0`

[Questions? Please see our Kibana upgrade
FAQ.](https://github.com/elastic/eui/blob/main/wiki/eui-team-processes/upgrading-kibana.md#faq-for-kibana-teams)

## Changes

This PR updates the `@elastic/eslint-plugin-eui` version to latest:
[v2.0.0](https://www.npmjs.com/package/@elastic/eslint-plugin-eui/v/2.0.0).

## Package updates



### `@elastic/eslint-plugin-eui`

**Breaking changes**

- Remove `prefer-css-prop-for-static-styles` rule because it produces
too many warnings. Static code analysis cannot flag dynamic styles with
confidence because it doesn't run the code to asses runtime values. We
will explore runtime solutions.
([#8760](elastic/eui#8760))
iblancof pushed a commit to iblancof/kibana that referenced this pull request Jun 16, 2025
`@elastic/eslint-plugin-eui`: `1.0.0` ⏩ `2.0.0`

[Questions? Please see our Kibana upgrade
FAQ.](https://github.com/elastic/eui/blob/main/wiki/eui-team-processes/upgrading-kibana.md#faq-for-kibana-teams)

## Changes

This PR updates the `@elastic/eslint-plugin-eui` version to latest:
[v2.0.0](https://www.npmjs.com/package/@elastic/eslint-plugin-eui/v/2.0.0).

## Package updates



### `@elastic/eslint-plugin-eui`

**Breaking changes**

- Remove `prefer-css-prop-for-static-styles` rule because it produces
too many warnings. Static code analysis cannot flag dynamic styles with
confidence because it doesn't run the code to asses runtime values. We
will explore runtime solutions.
([elastic#8760](elastic/eui#8760))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking change PRs with breaking changes. (Don't delete - used for automation)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ESLint] "Prefer CSS attributes" rule is warning against best practice

3 participants