Require ECMAScript private class members - #5945
Draft
Bharat Middha (bmiddha) wants to merge 4 commits into
Draft
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 8ebd5bf2-c44b-42d5-be25-e7936d4b0a14
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 8ebd5bf2-c44b-42d5-be25-e7936d4b0a14
…/enforce-native-private-fields
Member
Author
|
Scope update: the new ESLint rule now enforces ECMAScript |
…/enforce-native-private-fields
Contributor
There was a problem hiding this comment.
Pull request overview
Adds and enables an ESLint rule requiring native ECMAScript private class members.
Changes:
- Implements and tests the new rule.
- Enables it in legacy and flat profiles.
- Documents behavior and release changes.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
eslint/eslint-plugin/src/prefer-ecmascript-private-members.ts |
Implements the rule. |
eslint/eslint-plugin/src/test/prefer-ecmascript-private-members.test.ts |
Tests supported member forms and exemptions. |
eslint/eslint-plugin/src/index.ts |
Exports the rule. |
eslint/eslint-plugin/README.md |
Documents rationale and usage. |
eslint/eslint-config/profile/_common.js |
Enables the legacy rule. |
eslint/eslint-config/flat/profile/_common.js |
Enables the flat rule. |
common/changes/@rushstack/eslint-plugin/native-private-fields_2026-08-18-12-00-00.json |
Records the plugin change. |
common/changes/@rushstack/eslint-config/native-private-fields_2026-08-18-12-00-00.json |
Records the config change. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| '@rushstack/no-new-null': 'warn', | ||
|
|
||
| // RATIONALE: See the @rushstack/eslint-plugin documentation | ||
| '@rushstack/prefer-ecmascript-private-members': 'warn', |
| '@rushstack/no-new-null': 'warn', | ||
|
|
||
| // RATIONALE: See the @rushstack/eslint-plugin documentation | ||
| '@rushstack/prefer-ecmascript-private-members': 'warn', |
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
@rushstack/prefer-ecmascript-private-members#syntax for private fields, methods, and accessorsDependency
Draft/stacked on the integration branch for #5939, #5940, #5941, #5942, and #5943. Retarget to
mainafter those migrations merge.Validation
rush build --to @rushstack/eslint-config --verboserush test --only @rushstack/eslint-plugin --only @rushstack/eslint-config --verbose