-
Notifications
You must be signed in to change notification settings - Fork 860
feat(eslint-plugin): update prefer-css-attribute-for-eui-components rule #8722
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(eslint-plugin): update prefer-css-attribute-for-eui-components rule #8722
Conversation
ed01d41 to
dc00cef
Compare
packages/eslint-plugin/src/rules/prefer_css_prop_for_static_styles.ts
Outdated
Show resolved
Hide resolved
acstll
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I ran tests locally and went thru them. Also did manually test the package locally. And found no typos in the warning message. Everything working as expected 🟢
Only one comment regarding the changelog…
acstll
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the quick update! 🌊🚢
…rning-against-best-practice
💚 Build SucceededHistory
|
💚 Build Succeeded
History
|
`@elastic/eslint-plugin-eui`: `0.2.0` ⏩ `1.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: [v1.0.0](https://www.npmjs.com/package/@elastic/eslint-plugin-eui/v/1.0.0). ## Package updates ### `@elastic/eslint-plugin-eui` - Changed the `prefer-css-prop-for-static-styles` rule message (formerly `prefer-css-attribute-for-eui-components`) ([#8722](elastic/eui#8722)) **Breaking changes** - Renamed the rule from `prefer-css-attribute-for-eui-components` to `prefer-css-prop-for-static-styles` to align with Emotion's best practice guidelines ([#8722](elastic/eui#8722)) **Dependency updates** - Updated `typescript` to v5.8.3 ([#8669](elastic/eui#8669)) - Updated `@typescript-eslint/eslint-plugin` to v8.31.1 ([#8669](elastic/eui#8669)) - Updated `@typescript-eslint/parser` to v8.31.1 ([#8669](elastic/eui#8669)) - Updated `@typescript-eslint/rule-tester` to v8.31.1 ([#8669](elastic/eui#8669)) - Updated `@typescript-eslint/typescript-estree` to v8.31.1 ([#8669](elastic/eui#8669)) - Updated `@typescript-eslint/utils` to v8.31.1 ([#8669](elastic/eui#8669))
`@elastic/eslint-plugin-eui`: `0.2.0` ⏩ `1.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: [v1.0.0](https://www.npmjs.com/package/@elastic/eslint-plugin-eui/v/1.0.0). ## Package updates ### `@elastic/eslint-plugin-eui` - Changed the `prefer-css-prop-for-static-styles` rule message (formerly `prefer-css-attribute-for-eui-components`) ([elastic#8722](elastic/eui#8722)) **Breaking changes** - Renamed the rule from `prefer-css-attribute-for-eui-components` to `prefer-css-prop-for-static-styles` to align with Emotion's best practice guidelines ([elastic#8722](elastic/eui#8722)) **Dependency updates** - Updated `typescript` to v5.8.3 ([elastic#8669](elastic/eui#8669)) - Updated `@typescript-eslint/eslint-plugin` to v8.31.1 ([elastic#8669](elastic/eui#8669)) - Updated `@typescript-eslint/parser` to v8.31.1 ([elastic#8669](elastic/eui#8669)) - Updated `@typescript-eslint/rule-tester` to v8.31.1 ([elastic#8669](elastic/eui#8669)) - Updated `@typescript-eslint/typescript-estree` to v8.31.1 ([elastic#8669](elastic/eui#8669)) - Updated `@typescript-eslint/utils` to v8.31.1 ([elastic#8669](elastic/eui#8669))
`@elastic/eslint-plugin-eui`: `0.2.0` ⏩ `1.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: [v1.0.0](https://www.npmjs.com/package/@elastic/eslint-plugin-eui/v/1.0.0). ## Package updates ### `@elastic/eslint-plugin-eui` - Changed the `prefer-css-prop-for-static-styles` rule message (formerly `prefer-css-attribute-for-eui-components`) ([elastic#8722](elastic/eui#8722)) **Breaking changes** - Renamed the rule from `prefer-css-attribute-for-eui-components` to `prefer-css-prop-for-static-styles` to align with Emotion's best practice guidelines ([elastic#8722](elastic/eui#8722)) **Dependency updates** - Updated `typescript` to v5.8.3 ([elastic#8669](elastic/eui#8669)) - Updated `@typescript-eslint/eslint-plugin` to v8.31.1 ([elastic#8669](elastic/eui#8669)) - Updated `@typescript-eslint/parser` to v8.31.1 ([elastic#8669](elastic/eui#8669)) - Updated `@typescript-eslint/rule-tester` to v8.31.1 ([elastic#8669](elastic/eui#8669)) - Updated `@typescript-eslint/typescript-estree` to v8.31.1 ([elastic#8669](elastic/eui#8669)) - Updated `@typescript-eslint/utils` to v8.31.1 ([elastic#8669](elastic/eui#8669))
Summary
Closes #8708
On this PR, I:
prefer-css-attribute-for-eui-componentstoprefer-css-prop-for-static-stylesto highlight the case we're concerned with,eui-componentsis a redundancy when the rule comes from EUI ESLint plugin andcssis technically a "prop" and not an "attribute" (it's not a regular HTML attribute),something!) to actually assert if the range is truthy before passing it tofixer.replaceTextRange,cssprop instead ofstylefor static styles in EUI components to ensure better performance and consistency with EUI’s styling approach.". I'm open to any suggestions that could make it better 🙏🏻I consider this a breaking change because
prefer-css-attribute-for-eui-componentsis technically no longer available.QA
Testing instructions