Repository navigation
fix(no-export): handle nested assignment chains - #2009
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the no-export ESLint rule to correctly detect exports when module.exports is accessed through deeper member-expression chains (e.g. module.exports.exports.exports = ...) and adds regression tests to cover the new behavior.
Changes:
- Update the
no-exportrule to walk up nestedMemberExpressionobjects until the root identifier is reached. - Add valid test cases covering computed-access chains (no test-case present, so rule should not report).
- Add invalid test cases ensuring deep
module.exports.*chains are reported once a Jest test/describe is present.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/rules/no-export.ts | Switches from a single-step unwrap to a loop to handle nested module.exports... member chains. |
| src/rules/tests/no-export.test.ts | Adds regression coverage for nested export chains (and additional non-reporting valid cases). |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
github-actions Bot
pushed a commit
that referenced
this pull request
Aug 27, 2026
## [29.16.4](v29.16.3...v29.16.4) (2026-08-27) ### Bug Fixes * **no-export:** handle nested assignment chains ([#2009](#2009)) ([14b559a](14b559a))
|
🎉 This PR is included in version 29.16.4 🎉 The release is available on: Your semantic-release bot 📦🚀 |
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.
I'll add support for literal accessors next