-
Notifications
You must be signed in to change notification settings - Fork 843
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
[#187] [On Week] Improve and enrich EUI ESLint plugin #8304
Open
weronikaolejniczak
wants to merge
25
commits into
elastic:main
Choose a base branch
from
weronikaolejniczak:chore/187-eslint-plugin-eui
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
[#187] [On Week] Improve and enrich EUI ESLint plugin #8304
weronikaolejniczak
wants to merge
25
commits into
elastic:main
from
weronikaolejniczak:chore/187-eslint-plugin-eui
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
d69e9c5
to
7fc8386
Compare
5248aa8
to
93831a6
Compare
tkajtoch
reviewed
Feb 26, 2025
b8f4827
to
7a40fae
Compare
Preview staging links for this PR:
|
💚 Build Succeeded
History
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Closes #187
This PR is part of an On Week initiative to improve the sate of the EUI ESLint plugin and enrich with useful rules.
The changes done:
no-restricted-eui-imports
rule to display a warning on JSON token importsno-css-color
andprefer-css-attribute-for-eui-components
fromkbn-eslint-plugin-css
no-css-color
rule: highlights hard-coded colorsprefer-css-attribute-for-eui-components
rule: recommendscss
use overstyle
(inline styles)Potential future changes:
no-restricted-eui-imports
I added a new rule to our ESLint plugin,
no-restricted-eui-imports
, that won't conflict with the inbuiltno-restricted-imports
rule and will allow us to define several error levels at once. I.e. we want some imports to be marked as warning and not an error, as it's done in Kibana.Context:
The JSON token imports in
@kbn/eslint/module_migration
need to be removed as well:https://github.com/elastic/kibana/blob/212b1926743ca5821992c2877d9c68f621e1875e/packages/kbn-eslint-config/.eslintrc.js#L131-L140
no-css-color
andprefer-css-attribute-for-eui-components
fromkbn-eslint-plugin-css
Written by @eokoneyo. We agreed to move the rules to EUI repo, as the rules concern EUI components and may benefit other EUI consumers like Cloud UI.
Example files in Kibana:
src/platform/plugins/shared/kibana_react/public/page_template/no_data_page/no_data_card/elastic_agent_card.tsx
x-pack/examples/alerting_example/public/alert_types/always_firing.tsx
With additional configuration:
src/platform/plugins/private/vis_types/vega/public/data_model/utils.ts
Useful resources
typescript-eslint
typescript-eslint
typescript-eslint
package.json
QA
yarn workspace @elastic/eslint-plugin-eui test
.