Skip to content

Require ECMAScript private class members - #5945

Draft
Bharat Middha (bmiddha) wants to merge 4 commits into
bmiddha/native-private-fields-integrationfrom
bmiddha/enforce-native-private-fields
Draft

Require ECMAScript private class members#5945
Bharat Middha (bmiddha) wants to merge 4 commits into
bmiddha/native-private-fields-integrationfrom
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

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
@bmiddha Bharat Middha (bmiddha) changed the title Require ECMAScript private class fields Require ECMAScript private class members Aug 19, 2026
@bmiddha

Copy link
Copy Markdown
Member Author

Scope update: the new ESLint rule now enforces ECMAScript #private syntax for private fields, methods, getters, and setters. Private constructors and constructor parameter properties remain excluded because they have no direct native-private equivalent. The refreshed stack passes all 208 ESLint plugin tests.

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.

1 participant