-
-
Notifications
You must be signed in to change notification settings - Fork 402
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
Conversation
There was a problem hiding this 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.
'@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', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
3ec4540
to
a9d199e
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ 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.
🚀 New features to boost your workflow:
|
✅ 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!