style(editors): prefer const to let#16395
Conversation
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
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. |
|
I think this is uncontroversial, but |
There was a problem hiding this comment.
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
constfor file path variables that are never reassigned - Changed
clientOptionsdeclaration in linter tool to useconst - Updated path resolution variable to use
constin 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.
Merge activity
|
262a243 to
fed6180
Compare
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. |
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.

Use
constwhere variables are not reassigned instead oflet. Preparation for enabling ESLint'sprefer-construle (running as an Oxlint JS plugin) in our linting setup.