Skip to content

[7.x] [eslint] no_restricted_paths config cleanup (#63741)#64431

Merged
tylersmalley merged 1 commit intoelastic:7.xfrom
tylersmalley:backport/7.x/pr-63741
Apr 24, 2020
Merged

[7.x] [eslint] no_restricted_paths config cleanup (#63741)#64431
tylersmalley merged 1 commit intoelastic:7.xfrom
tylersmalley:backport/7.x/pr-63741

Conversation

@tylersmalley
Copy link
Copy Markdown
Member

Backports the following commits to 7.x:

Major cleanup of the no_restricted_paths rule for imports of core.

For relative imports, we use eslint-module-utils/resolve which resolves
to the full filesystem path. So, to support relative and absolute
imports from the src alias we need to define both the directory and the
index including file extension.

This rule was handling both core imports, as well as imports from other
plugins. Imports from other plugins are being used much more liberally
allowed through the exceptions in tests. I choose to break these up,
removing this exception for tests for core imports.

Fixes:
Absolute imports of src/core/server/mocks were not allowed in src. This
was not an issue in x-pack due to the target excluding
!x-pack/**/*.test.* and !x-pack/test/**/*.

Non-top-level public and server imports were allowed from X-Pack tests
to the previously mentioned exclusion.

Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
@tylersmalley tylersmalley added the backport This PR is a backport of another PR label Apr 24, 2020
@kibanamachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@tylersmalley tylersmalley merged commit a8edee1 into elastic:7.x Apr 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport This PR is a backport of another PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants