-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[eslint] add rule to prevent export* in plugin index files #109357
[eslint] add rule to prevent export* in plugin index files #109357
Conversation
👏 👏 👏 👏 👏 👏 👏 👏 - nicely done |
0b3e6f6
to
d796ec2
Compare
175bbf2
to
1d6958e
Compare
…int-rule-no-export-all
Pinging @elastic/kibana-operations (Team:Operations) |
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 Spencer. Looks like there are a couple false positives, though. I only reviewed Stack Management's plugins.
Pinging @elastic/fleet (Team:Fleet) |
@elasticmachine merge upstream |
💚 Build Succeeded
Metrics [docs]
History
To update your PR or re-run it, just comment with: |
…09357) * [eslint] add rule to prevent export* in plugin index files * deduplicate export names for types/instances with the same name * attempt to auto-fix duplicate exports too * capture exported enums too * enforce no_export_all for core too * disable rule by default, allow opting-in for help fixing * update tests * reduce yarn.lock duplication * add rule but no fixes * disable all existing violations * update api docs with new line numbers * revert unnecessary changes to yarn.lock which only had drawbacks * remove unnecessary eslint-disable * rework codegen to split type exports and use babel to generate valid code * check for "export types" deeply * improve test by using fixtures * add comments to some helper functions * disable fix for namespace exports including types * label all eslint-disable comments with related team-specific issue * ensure that child exports of `export type` are always tracked as types Co-authored-by: spalger <[email protected]> Co-authored-by: Kibana Machine <[email protected]>
💚 Backport successful
This backport PR will be merged automatically after passing CI. |
…110928) * [eslint] add rule to prevent export* in plugin index files * deduplicate export names for types/instances with the same name * attempt to auto-fix duplicate exports too * capture exported enums too * enforce no_export_all for core too * disable rule by default, allow opting-in for help fixing * update tests * reduce yarn.lock duplication * add rule but no fixes * disable all existing violations * update api docs with new line numbers * revert unnecessary changes to yarn.lock which only had drawbacks * remove unnecessary eslint-disable * rework codegen to split type exports and use babel to generate valid code * check for "export types" deeply * improve test by using fixtures * add comments to some helper functions * disable fix for namespace exports including types * label all eslint-disable comments with related team-specific issue * ensure that child exports of `export type` are always tracked as types Co-authored-by: spalger <[email protected]> Co-authored-by: Kibana Machine <[email protected]> Co-authored-by: Spencer <[email protected]> Co-authored-by: spalger <[email protected]>
Reviewers!
These changes are just adding
/* eslint-disable */
comments to tons of plugins so don't worry about reviewing. I'll be merging without reviews. Just please check the issues created for your team and in: https://github.com/elastic/kibana/projects/76Implements the ESLint rule requested by #57370
Unfortunately, auto-fixing these violations perfectly isn't easy (we tried, but it created a number of problems) so rather than spend a ton of time trying to get the auto-fix perfect I suggest that we disable all the current violations and create issues for each team to remove the
eslint-disable
comments. Removing the comment will auto-fix, but since it's imperfect folks will need to review the changes.The list of plugins with violations by team:
kibana-app-services
: (10) bfetch, data, embeddable, expressions, fieldFormats, inspector, kibanaReact, kibanaUtils, uiActions, uiActionsEnhancedkibana-app
: (10) charts, kibanaLegacy, urlForwarding, visDefaultEditor, visTypeTable, visTypeVislib, visTypeXy, visualizations, discoverEnhanced, lenskibana-presentation
: (8) expressionError, expressionImage, expressionMetric, expressionRepeatImage, expressionRevealImage, expressionShape, presentationUtil, dashboardEnhancedkibana-alerting-services
: alerting, ruleRegistry, stackAlerts, triggersActionsUikibana-stack-management
: devTools, indexManagement, snapshotRestoreml-ui
: dataVisualizer, fileUpload, mlsecurity-solution
: metricsEntities, securitySolution, timelineskibana-gis
: mapsEms, mapssecurity-threat-hunting
: casesfleet
: fleetkibana-core
: licensingsecurity-detections-response
: listsobservability-ui
: observabilitysecurity-asset-management
: osquerykibana-reporting-services
: reporting