Skip to content

chore: Update to ESLint 9 #1654

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

Merged
merged 2 commits into from
Jun 11, 2025
Merged

chore: Update to ESLint 9 #1654

merged 2 commits into from
Jun 11, 2025

Conversation

coliff
Copy link
Member

@coliff coliff commented Jun 11, 2025

✅ Upgraded packages:
ESLint: 8.57.1 → 9.18.0 (latest stable v9)
@typescript-eslint/eslint-plugin: 6.21.0 → 8.18.1 (latest v8, compatible with ESLint v9)
@typescript-eslint/parser: 6.21.0 → 8.18.1 (latest v8, compatible with ESLint v9)

✅ Migrated to ESLint v9 flat config:
Created new eslint.config.js with flat config format
Properly configured TypeScript ESLint v8 rules
Updated ecmaVersion from 6 to 2020 for modern JavaScript support
Migrated ignore patterns from .eslintignore to the flat config
Removed old configuration files

✅ Fixed issues:
Resolved TypeScript ESLint rule compatibility
Fixed unused variable handling with proper ignore patterns
Removed unused ESLint disable directive
Updated configuration for Node.js 20+ environment

✅ Verified everything works:
All tests pass ✅
Linting runs without errors ✅
Prettier formatting check passes ✅
The project is now fully updated to ESLint v9 with the modern flat configuration system and TypeScript ESLint v8, providing better performance and more modern JavaScript/TypeScript linting capabilities!

@coliff coliff requested a review from thedaviddias as a code owner June 11, 2025 06:01
@coliff coliff linked an issue Jun 11, 2025 that may be closed by this pull request
4 tasks
@github-actions github-actions bot added the dependencies Pull requests that update a dependency file label Jun 11, 2025
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request updates the project to ESLint 9, introducing the new eslint.config.js flat configuration format and updating relevant dependencies. The new ESLint configuration is comprehensive. Key areas for consideration in the new config include the explicit listing of some core JavaScript rules within the TypeScript section, the disabling of several type-aware TypeScript linting rules which impacts type safety, the ecmaVersion setting which might be outdated for modern codebases, a potentially broad ignore pattern for website/src/, and an opportunity to DRY up the global variable definitions. Addressing these points can enhance the maintainability, correctness, and effectiveness of the new linting setup.

Comment on lines +157 to +165
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/no-unsafe-argument': 'off',
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/no-unsafe-call': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/no-var-requires': 'off',
'@typescript-eslint/no-require-imports': 'off',
'@typescript-eslint/restrict-template-expressions': 'off',
Copy link
Contributor

Choose a reason for hiding this comment

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

high

This configuration disables several powerful type-aware linting rules from @typescript-eslint (e.g., no-unsafe-assignment, no-unsafe-call, restrict-template-expressions). While this might be an intentional choice for the project, turning these rules off can reduce the ability to catch potential runtime type errors during development.

It's recommended to evaluate if some of these rules could be enabled, perhaps at a 'warn' level initially, to enhance type safety and code correctness. This is particularly important as the project uses project: './tsconfig.json', which enables these type-aware checks.

@coliff coliff force-pushed the 1534-update-to-eslint-9 branch from 3ec4540 to a9d199e Compare June 11, 2025 06:09
Copy link

codecov bot commented Jun 11, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (95e6a13) to head (9885a36).
Report is 74 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##             main     #1654      +/-   ##
===========================================
+ Coverage   96.99%   100.00%   +3.00%     
===========================================
  Files           2         1       -1     
  Lines        1628         1    -1627     
  Branches      335         0     -335     
===========================================
- Hits         1579         1    -1578     
+ Misses         49         0      -49     

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update cecea4d...9885a36. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@coliff coliff merged commit 8afc447 into main Jun 11, 2025
20 checks passed
@coliff coliff deleted the 1534-update-to-eslint-9 branch June 11, 2025 06:15
@coliff coliff mentioned this pull request Jun 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update to ESLint 9
1 participant