Fix no-new-null for native private members - #5947
Merged
Bharat Middha (bmiddha) merged 1 commit intoAug 21, 2026
Merged
Conversation
Treat PrivateIdentifier class keys like TypeScript private members so no-new-null does not report private API types. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 8ebd5bf2-c44b-42d5-be25-e7936d4b0a14
This was referenced Aug 20, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Updates no-new-null to recognize native ECMAScript private class members as non-public.
Changes:
- Detects
PrivateIdentifiermember keys. - Adds regression coverage for private fields, methods, getters, and setters.
- Records a patch release change.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
eslint/eslint-plugin/src/no-new-null.ts |
Excludes native private members from reports. |
eslint/eslint-plugin/src/test/no-new-null.test.ts |
Adds native-private regression cases. |
common/changes/@rushstack/eslint-plugin/native-private-null_2026-08-19-22-58-08.json |
Adds the patch change record. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Sean Larkin (TheLarkInn)
approved these changes
Aug 21, 2026
Bharat Middha (bmiddha)
deleted the
bmiddha/fix-no-new-null-native-private
branch
August 21, 2026 18:50
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.
Summary
PrivateIdentifieras private@rushstack/no-new-nullfrom reportingnulltypes that cannot escape through native private fields, methods, getters, or settersValidation
rush build --to @rushstack/eslint-plugin --verboserush test --only @rushstack/eslint-plugin --verbose(197 tests)Dependents
#5939, #5941, #5942, and #5943 are stacked on this fix because their native-private migrations expose the false positive.