Skip to content

eslint: fix bracket notation in workbench services - #334774

Open
Dmitriy Vasyura (dmitrivMS) wants to merge 8 commits into
mainfrom
agents/fix-bracket-notation-workbench-services
Open

eslint: fix bracket notation in workbench services#334774
Dmitriy Vasyura (dmitrivMS) wants to merge 8 commits into
mainfrom
agents/fix-bracket-notation-workbench-services

Conversation

@dmitrivMS

Copy link
Copy Markdown
Collaborator

Summary

  • replace identifier-safe bracket notation across the 23 allowlisted Workbench UI and remaining service files
  • remove the cleaned group from .eslint-allowed-bracket-notation-files
  • replace private-member bracket access in default-account tests with a typed test subclass and protected production seams

Stacked on #334756.

Validation

  • targeted ESLint: 24 changed source files
  • targeted hygiene: 24 changed source files
  • exact-scope audit: 23 removed allowlist entries plus one typed test-support file
  • npm run typecheck-client
  • npm run transpile-client
  • node --check src\vs\workbench\contrib\webview\browser\pre\service-worker.js
  • policy export integration: 2 passing
  • encoding integration: 3 passing
  • default account unit tests: 49 passing
  • editor utilities/options unit tests: 15 passing
  • update info parser unit tests: 21 passing
  • workspace tags unit tests: 3 passing
  • extension recommendations unit tests: 143 passing

Known baseline drift

The Color Registry release test reports 1 passing and 2 failing checks because the generated known-variable list and theme-color.md are out of sync with currently registered colors and sizes. This PR does not include those unrelated generated/documentation updates.

Enable code-no-bracket-notation-for-identifiers for JavaScript and TypeScript files while grandfathering the 509 files with existing violations in a CODEOWNERS-gated allowlist.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Organize the existing baseline by feature area so cleanup can be tracked and assigned without changing the excluded file set.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add RuleTester coverage for valid accesses, diagnostics, and autofix edge cases. Preserve escaped string-literal property names by checking their raw source before reporting.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Replace identifier-safe bracket access in workbench UI and service files, remove the cleaned group from the rule allowlist, and expose protected seams for strongly typed default-account tests.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Base automatically changed from agents/enable-bracket-notation-rule to main September 6, 2026 15:02
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@vs-code-engineering

Copy link
Copy Markdown
Contributor

📬 CODENOTIFY

The following users are being notified based on files changed in this PR:

Benjamin Christopher Simmonds (@benibenj)

Matched files:

  • src/vs/workbench/browser/parts/editor/editor.ts
  • src/vs/workbench/browser/parts/editor/editorGroupView.ts

TylerLeonhardt

Matched files:

  • src/vs/workbench/contrib/localization/electron-browser/localization.contribution.ts

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.

Copilot review overview

🟡 Changes recommended

The color description access is incorrect, and the stated default-account allowlist cleanup remains incomplete.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review tier: Balanced
Findings: 1 Medium severity · 1 Low severity

New issues introduced by this change (2)
Severity Finding
Medium severity src/​vs/​workbench/​contrib/​themes/​test/​node/​colorRegistry.releaseTest.ts — This reads description from colorId, which is the string from color.id, so every missing…
Low severity .eslint-allowed-bracket-notation-files — The stated default-account cleanup is not present: this file remains allowlisted, the test still…
What changed in this PR

Modernizes identifier-safe property access across Workbench UI, services, and tests for ESLint compliance.

Changes:

  • Replaces static bracket notation with dot notation.
  • Updates related configuration, parsing, telemetry, and test code.
  • Shrinks the ESLint allowlist, though the stated default-account cleanup is incomplete.
File Summary
src/​vs/​workbench/​services/​themes/​common/​colorThemeData.ts Updates theme metadata access.
src/​vs/​workbench/​services/​textfile/​test/​node/​encoding/​encoding.integrationTest.ts Updates encoding environment access.
src/​vs/​workbench/​services/​extensionRecommendations/​common/​workspaceExtensionsConfig.ts Updates parsed configuration access.
src/​vs/​workbench/​services/​actions/​common/​menusExtensionPoint.ts Updates command-palette access.
src/​vs/​workbench/​contrib/​welcomeWalkthrough/​browser/​walkThroughInput.ts Updates telemetry target access.
src/​vs/​workbench/​contrib/​webview/​browser/​pre/​service-worker.js Updates ETag header access.
src/​vs/​workbench/​contrib/​update/​common/​updateInfoParser.ts Updates named regex-group access.
src/​vs/​workbench/​contrib/​typeHierarchy/​browser/​typeHierarchyPeek.ts Updates hierarchy state access.
src/​vs/​workbench/​contrib/​themes/​test/​node/​colorRegistry.releaseTest.ts Updates color metadata access, but incorrectly reads descriptions from the color ID string.
src/​vs/​workbench/​contrib/​themes/​browser/​themes.contribution.ts Updates quick-pick type access.
src/​vs/​workbench/​contrib/​tags/​electron-browser/​workspaceTagsService.ts Updates package metadata and tag access.
src/​vs/​workbench/​contrib/​tags/​electron-browser/​workspaceTags.ts Updates workspace tag assignments.
src/​vs/​workbench/​contrib/​search/​browser/​replaceService.ts Updates parsed URI access.
src/​vs/​workbench/​contrib/​policyExport/​test/​node/​policyExport.integrationTest.ts Updates CI environment access.
src/​vs/​workbench/​contrib/​policyExport/​electron-browser/​policyExport.contribution.ts Updates product and environment access.
src/​vs/​workbench/​contrib/​localization/​electron-browser/​localization.contribution.ts Updates translation access.
src/​vs/​workbench/​contrib/​issue/​electron-browser/​nativeGitHubUploadService.ts Updates authorization header access.
src/​vs/​workbench/​contrib/​callHierarchy/​browser/​callHierarchyPeek.ts Updates hierarchy state access.
src/​vs/​workbench/​contrib/​bulkEdit/​browser/​preview/​bulkEditPane.ts Updates dataset state access.
src/​vs/​workbench/​contrib/​accessibility/​browser/​accessibilityConfiguration.ts Updates migrated delay access.
src/​vs/​workbench/​browser/​parts/​editor/​editorGroupView.ts Updates telemetry descriptor access.
src/​vs/​workbench/​browser/​parts/​editor/​editor.ts Updates editor option access.
.eslint-allowed-bracket-notation-files Removes migrated entries, but retains the claimed default-account entry.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/vs/workbench/contrib/themes/test/node/colorRegistry.releaseTest.ts Outdated
Comment thread .eslint-allowed-bracket-notation-files
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants