Skip to content
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

Add eslint rule to forbid importing server code from public code #49053

Closed
pgayvallet opened this issue Oct 23, 2019 · 1 comment · Fixed by #52447
Closed

Add eslint rule to forbid importing server code from public code #49053

pgayvallet opened this issue Oct 23, 2019 · 1 comment · Fixed by #52447
Labels
Feature:New Platform Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc

Comments

@pgayvallet
Copy link
Contributor

Importing server bits from client code can be very dangerous and heavy in term of side effects, unexpected behaviour and bundle size. This is something that should be explicitly forbidden and needs an eslint check.

Exemple: in src/plugins/kibana_react/public/saved_objects/saved_object_finder.tsx:
import { SavedObjectAttributes } from '../../../../core/server';

We should probably be able to re-use @kbn/eslint/no-restricted-paths for this

@pgayvallet pgayvallet added Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc Feature:New Platform labels Oct 23, 2019
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-platform (Team:Platform)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:New Platform Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants