Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restore eslint prefer-const rule #16998

Merged
merged 3 commits into from
Mar 11, 2025

Conversation

allanjoseph98
Copy link
Member

Probably disappeared in the linter switches

Probably disappeared in the linter switches
@ornicar ornicar requested a review from schlawg February 24, 2025 13:05
@icp1994
Copy link

icp1994 commented Mar 7, 2025

Not that it matters but levenAndVal probably typo

@ornicar ornicar requested a review from Copilot March 11, 2025 10:09

Choose a reason for hiding this comment

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

PR Overview

This PR restores the ESLint rule "prefer-const" that was previously removed and adjusts variable declarations to use const where possible.

  • Restores the "prefer-const" rule in the ESLint configuration.
  • Converts several variable declarations from let to const across multiple files.
  • Refactors the console handler to simplify destructuring assignments.

Reviewed Changes

File Description
ui/eslint.config.mjs Adds the "prefer-const" lint rule to enforce immutability.
ui/.build/src/console.ts Refactors destructuring to extract values from parsed JSON more clearly.
ui/recap/src/slides.ts Changes variable declaration from let to const for immutability.
ui/voice/src/move/voice.move.ts Updates variable declaration from let to const in the lookup function.
ui/recap/src/util.ts Updates array initialization from let to const.

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

Comments suppressed due to low confidence (1)

ui/.build/src/console.ts:26

  • [nitpick] Consider using direct destructuring (e.g., 'const [level, val] = Object.entries(JSON.parse(body));') to eliminate the intermediate variable 'levelAndVal' and improve clarity.
const [levelAndVal] = Object.entries<string>(JSON.parse(body));
@ornicar ornicar merged commit 530c728 into lichess-org:master Mar 11, 2025
3 checks passed
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.

4 participants