-
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
chore: 🤖 forbid import from ui/** #40537
Changes from all commits
5eb2767
9f9770c
1813c9d
e6cf4a5
f042466
274ce0f
4d2c854
070d836
7726152
54cc767
a767f6f
5ceef7c
781a0dd
c6fbeab
af0d228
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,6 +38,7 @@ import { | |
EuiText, | ||
} from '@elastic/eui'; | ||
|
||
// eslint-disable-next-line @kbn/eslint/no-restricted-paths | ||
import { SavedObjectAttributes } from 'src/core/server/saved_objects'; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think
where not covered previously, now this PR fixes it. Added a test for it, too. |
||
import { EmbeddableFactoryNotFoundError } from '../../../../embeddables/embeddable_factory_not_found_error'; | ||
import { IContainer } from '../../../../containers'; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,7 @@ | |
|
||
import getPort from 'get-port'; | ||
import { resolve } from 'path'; | ||
// eslint-disable-next-line @kbn/eslint/no-restricted-paths | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. and tests may import from anywhere. we also can exclude them from the check |
||
import { Root } from 'src/core/server/root'; | ||
|
||
import { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,7 @@ import * as Rx from 'rxjs'; | |
import { Server } from 'hapi'; | ||
import { Legacy } from 'kibana'; | ||
import { KibanaConfig } from 'src/legacy/server/kbn_server'; | ||
// eslint-disable-next-line @kbn/eslint/no-restricted-paths | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I was under the impression that this was the "correct" way to import mocks. Is there another approach we should take? Are mocks not meant to be used in this way at all? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I guess it is still as "correct" as it was before. The difference is that before this PR Maybe @elastic/kibana-platform could comment what is the "correct" way to import mocks/types? ^^ There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yeah, unfortunately linter rule doesn't work with absolute paths yet. #36096 - '!src/core/server/mocks.ts',
+ '!src/core/server/mocks',
- '!src/core/public/mocks.ts',
+ '!src/core/public/mocks',
right |
||
import { httpServiceMock, elasticsearchServiceMock } from 'src/core/server/mocks'; | ||
import { createOptionalPlugin } from '../../../../../../server/lib/optional_plugin'; | ||
import { SpacesClient } from '../../../lib/spaces_client'; | ||
|
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.
should we allow importing from
ui/new_platform
? if yes you can add!ui/new_platform
in zone declaration inside .eslintrc