[eslint/imports/no-boundary-crossing] don't allow package tests to import outside of packages #142166
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.
In #140985 new tests were written in a package that depend on plugin code. This shouldn't have been allowed by our
no_boundary_crossing
eslint rule, but it was because the rule previously allowed test code to import anything.This PR splits the
tests or mocks
source class intopackage tests or mocks
andnon-package tests or mocks
.non-package tests or mocks
can still import any file.package tests or mocks
can only import other packages orpackage tests or mocks
code.@WafaaNasr for now I've copied the mocks used into the package. If you'd like to move those mocks to a separate package so they could be used by both the plugin and other packages I'md ask that you do that as a follow up PR.