Skip to content

Require ECMAScript private class members - #5945

Open
Bharat Middha (bmiddha) wants to merge 3 commits into
bharatmiddha-microsoft-migrate-ecmascript-private-membersfrom
bmiddha/enforce-native-private-fields
Open

Require ECMAScript private class members#5945
Bharat Middha (bmiddha) wants to merge 3 commits into
bharatmiddha-microsoft-migrate-ecmascript-private-membersfrom
bmiddha/enforce-native-private-fields

Conversation

@bmiddha

@bmiddha Bharat Middha (bmiddha) commented Aug 19, 2026

Copy link
Copy Markdown
Member

Summary

  • add @rushstack/prefer-ecmascript-private-members
  • require native # syntax for private fields, methods, and accessors
  • leave private constructors and constructor parameter properties unchanged
  • enable the rule in legacy and flat shared ESLint profiles
  • document runtime-privacy rationale and unsafe-autofix boundary

Dependency

Draft/stacked on the integration branch for #5939, #5940, #5941, #5942, and #5943. Retarget to main after those migrations merge.

Validation

  • rush build --to @rushstack/eslint-config --verbose
  • rush test --only @rushstack/eslint-plugin --only @rushstack/eslint-config --verbose
  • 208 ESLint plugin tests passed

@github-project-automation github-project-automation Bot moved this to Needs triage in Bug Triage Aug 19, 2026
@bmiddha Bharat Middha (bmiddha) changed the title Require ECMAScript private class fields Require ECMAScript private class members Aug 19, 2026
@mojaza
Mo Jazayeri (mojaza) requested a balanced review from Copilot August 21, 2026 18:43

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread eslint/eslint-config/flat/profile/_common.js
Comment thread eslint/eslint-config/flat/profile/_common.js
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 8ebd5bf2-c44b-42d5-be25-e7936d4b0a14
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 8ebd5bf2-c44b-42d5-be25-e7936d4b0a14
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@bmiddha
Bharat Middha (bmiddha) force-pushed the bmiddha/enforce-native-private-fields branch from a05f000 to a3050a6 Compare September 10, 2026 21:19
@bmiddha
Bharat Middha (bmiddha) changed the base branch from main to bharatmiddha-microsoft-migrate-ecmascript-private-members September 10, 2026 21:19
@bmiddha
Bharat Middha (bmiddha) added this pull request to stack #6025 September 10, 2026 21:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Needs triage

Development

Successfully merging this pull request may close these issues.

2 participants