Skip to content

Comments

style(editors): prefer const to let#16395

Merged
graphite-app[bot] merged 1 commit intomainfrom
12-02-style_editors_prefer_const_to_let_
Dec 2, 2025
Merged

style(editors): prefer const to let#16395
graphite-app[bot] merged 1 commit intomainfrom
12-02-style_editors_prefer_const_to_let_

Conversation

@overlookmotel
Copy link
Member

@overlookmotel overlookmotel commented Dec 2, 2025

Use const where variables are not reassigned instead of let. Preparation for enabling ESLint's prefer-const rule (running as an Oxlint JS plugin) in our linting setup.

Copy link
Member Author


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • 0-merge - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@github-actions github-actions bot added the A-editor Area - Editor and Language Server label Dec 2, 2025
@overlookmotel overlookmotel marked this pull request as ready for review December 2, 2025 14:18
Copilot AI review requested due to automatic review settings December 2, 2025 14:18
@github-actions github-actions bot added the C-cleanup Category - technical debt or refactoring. Solution not expected to change behavior label Dec 2, 2025
@overlookmotel
Copy link
Member Author

I think this is uncontroversial, but editors is not my area, so I don't want to merge myself.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates variable declarations from let to const for variables that are never reassigned, in preparation for enabling ESLint's prefer-const rule. The changes improve code clarity by explicitly indicating immutability.

Key changes:

  • Updated test files to use const for file path variables that are never reassigned
  • Changed clientOptions declaration in linter tool to use const
  • Updated path resolution variable to use const in ConfigService

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
editors/vscode/tests/code_actions.spec.ts Changed file and expectedFile variables to const in two test cases
editors/vscode/tests/ConfigService.spec.ts Changed workspace_path variable to const in two test cases
editors/vscode/client/tools/linter.ts Changed clientOptions object declaration to const
editors/vscode/client/ConfigService.ts Changed cwd variable to const in path resolution logic

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@camc314 camc314 added the 0-merge Merge with Graphite Merge Queue label Dec 2, 2025
Copy link
Contributor

camc314 commented Dec 2, 2025

Merge activity

Use `const` where variables are not reassigned instead of `let`. Preparation for enabling ESLint's `prefer-const` rule (running as an Oxlint JS plugin) in our linting setup.
@graphite-app graphite-app bot force-pushed the 12-02-style_editors_prefer_const_to_let_ branch from 262a243 to fed6180 Compare December 2, 2025 14:25
@graphite-app graphite-app bot merged commit fed6180 into main Dec 2, 2025
19 checks passed
@graphite-app graphite-app bot deleted the 12-02-style_editors_prefer_const_to_let_ branch December 2, 2025 14:30
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Dec 2, 2025
@connorshea
Copy link
Member

Preparation for enabling ESLint's prefer-const rule (running as an Oxlint JS plugin) in our linting setup.

Alternatively.... #15707

@overlookmotel
Copy link
Member Author

overlookmotel commented Dec 2, 2025

Preparation for enabling ESLint's prefer-const rule (running as an Oxlint JS plugin) in our linting setup.

Alternatively.... #15707

Oh great! I do like this rule!

However, part of the purpose is also to test out JS plugins. Once your Rust implementation is merged, I'll find another ESLint rule to use for this purpose.

taearls pushed a commit to taearls/oxc that referenced this pull request Dec 11, 2025
Use `const` where variables are not reassigned instead of `let`. Preparation for enabling ESLint's `prefer-const` rule (running as an Oxlint JS plugin) in our linting setup.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-editor Area - Editor and Language Server C-cleanup Category - technical debt or refactoring. Solution not expected to change behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants