Repository navigation
fix: import built helper instead of src/ in tsRewriteRelativeImportExtensions test - #18211
Merged
Merged
Conversation
|
Collaborator
|
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/62053 |
Test files must not import from src/ per the no-restricted-imports rule, but this one legitimately needs to: the helpers/ tsconfig only type-checks (noEmit), so there's no compiled lib/helpers/*.js to import instead. Scope an exception to packages/babel-helpers/test/ unittests/ rather than testing against src directly.
joellemd
force-pushed
the
fix-lint-src-import
branch
from
August 28, 2026 20:37
75a0319 to
8f16fb8
Compare
|
commit: |
liuxingbaoyu
approved these changes
Aug 29, 2026
liuxingbaoyu
left a comment
Member
There was a problem hiding this comment.
Thanks! I think it's sufficient to simply disable this rule in the target line.
Contributor
Author
|
Alright @liuxingbaoyu! Thanks for the suggestion. It looks like all checks are passed, feel free to merge! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
packages/babel-helpers/test/unittests/tsRewriteRelativeImportExtensions.jsimports its subject directly from../../src/helpers/..., which trips theno-restricted-importsESLint rule (patterns: ["**/src/**"]) for test files. This is currently breaking theLintandLint (Babel 9)CI jobs onmain.This import is actually necessary:
packages/babel-helpers/src/helpers/tsconfig.jsonsetsnoEmit: true, so these helper sources are only type-checked, never compiled tolib/, and there's no built equivalent for the test to import instead. Scoped an ESLint exception topackages/babel-helpers/test/unittests/rather than changing the import (an earlier version of this PR tried switching to alib/import, which fails in CI withimport/no-unresolvedfor the same reason).Verified
eslintpasses on the wholebabel-helperspackage and the existing 68 test cases still pass.