feat(eslint-rules): add prefer-direct-reexport eslint rule - #36581
Merged
Victor Genaev (mainframev) merged 9 commits intoAug 19, 2026
Conversation
📊 Bundle size report✅ No changes found |
|
Pull request demo site: URL |
Martin Hochel (Hotell)
left a comment
Contributor
There was a problem hiding this comment.
great addition to our harness, left some comments. ty
Victor Genaev (mainframev)
force-pushed
the
mainframev/prefer-direct-reexport-rule
branch
from
August 19, 2026 08:45
574539c to
8fc0b38
Compare
Victor Genaev (mainframev)
force-pushed
the
mainframev/prefer-direct-reexport-rule
branch
from
August 19, 2026 09:58
8fc0b38 to
da68154
Compare
Martin Hochel (Hotell)
approved these changes
Aug 19, 2026
Martin Hochel (Hotell)
left a comment
Contributor
There was a problem hiding this comment.
left some comments, nothing blocking
Victor Genaev (mainframev)
force-pushed
the
mainframev/prefer-direct-reexport-rule
branch
from
August 19, 2026 11:03
da68154 to
8fed98c
Compare
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.
Adds a new workspace ESLint rule
@nx/workspace-prefer-direct-reexport.It flags exported bindings that are just an alias of something imported from another module, and points at the direct
export … fromform instead:What detects
Aliasing an import through a local binding
** Default import re-exported under a name**
Named import re-exported as default
Namespace import re-exported under a name
Alias chains through intermediate bindings
Identity function wrappers
Type-only aliases
What it leaves alone
Anything that changes the public shape, is reassignable, or has no
export … fromequivalent:Perf check
Measured on CI in a fork with two PRs differing only by this rule (baseline vs with rule). Full workspace lint, 247 projects, Nx cache disabled,
ubuntu-latest, 3 runs each.Per-rule cost from ESLint's own profiler (
TIMING=100) onreact-components/react-button/library:@typescript-eslint/no-deprecated@nx/workspace-base-hook-no-forbidden-runtime@nx/workspace-prefer-direct-reexport