chore: migrate ESLint to flat config and fix Express 5 / MongoDB driv…#3117
Merged
PierreBrisorgueil merged 2 commits intomasterfrom Feb 17, 2026
Merged
chore: migrate ESLint to flat config and fix Express 5 / MongoDB driv…#3117PierreBrisorgueil merged 2 commits intomasterfrom
PierreBrisorgueil merged 2 commits intomasterfrom
Conversation
…er 7 breaking changes
- Replace .eslintrc.cjs with eslint.config.js (flat config aligned with Vue)
- Replace .prettierrc.cjs with .prettierrc (JSON, drop invalid extends: airbnb)
- Replace eslint-config-airbnb-base + eslint-plugin-import/prettier with @eslint/js + globals
- Simplify lint scripts (remove ./node_modules/.bin/ prefix)
- Fix Express 5: rename app.get('*') to app.get('/{*path}') for path-to-regexp v8
- Fix MongoDB driver 7: store contentType in GridFS metadata (removed from file doc)
- Fix no-constant-binary-expression in config/index.js
- Clean up unused eslint-disable directives and unused catch params
Pull Request Test Coverage Report for Build 22100068433Details
💛 - Coveralls |
There was a problem hiding this comment.
Pull request overview
This pull request migrates the project to ESLint flat config format and addresses breaking changes from Express 5 and MongoDB driver 7 upgrades. However, the PR contains critical issues with package versions that appear to be nonexistent or from the future, suggesting either a significant error in dependency management or an issue with the package.json updates.
Changes:
- Migrated from .eslintrc.cjs to eslint.config.js (flat config) with @eslint/js and globals packages
- Removed Prettier's invalid 'extends: airbnb' configuration and converted to JSON format
- Updated Express 5 catch-all route pattern from '*' to '{*path}' for path-to-regexp v8 compatibility
- Added contentType to GridFS metadata for MongoDB driver 7 compatibility
- Fixed no-constant-binary-expression issue in config/index.js
- Removed unused eslint-disable directives and renamed unused catch parameters to _err
- Updated numerous package dependencies (with version concerns)
Reviewed changes
Copilot reviewed 15 out of 16 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| eslint.config.js | New flat config file replacing .eslintrc.cjs with @eslint/js recommended rules and custom overrides |
| .eslintrc.cjs | Removed legacy ESLint configuration file |
| .prettierrc | New JSON format Prettier config, removing invalid 'extends' property |
| .prettierrc.cjs | Removed CommonJS Prettier config |
| package.json | Updated lint scripts to remove ./node_modules/.bin/ prefix; major dependency version updates (many appear invalid) |
| lib/services/express.js | Updated catch-all route from app.get('*') to app.get('/{*path}') for Express 5 compatibility; removed eslint-disable directives |
| lib/services/gridfs.js | Added contentType to GridFS metadata for MongoDB driver 7 compatibility |
| modules/uploads/controllers/uploads.controller.js | Added fallback logic to retrieve contentType from metadata or root, handling MongoDB driver 7 changes |
| modules/uploads/repositories/uploads.repository.js | Removed no-restricted-syntax and no-await-in-loop eslint-disable comments |
| config/index.js | Fixed no-constant-binary-expression by properly handling NODE_ENV default value |
| scripts/code/rename.js | Removed no-restricted-syntax eslint-disable comment |
| modules/auth/config/users.config.js | Removed no-await-in-loop and no-restricted-syntax eslint-disable comments |
| modules/auth/config/strategies/local.js | Renamed unused catch parameter to _err |
| modules/auth/controllers/auth.password.controller.js | Renamed unused catch parameter to _err |
| lib/helpers/errors.js | Renamed unused catch parameter to _err |
Comments suppressed due to low confidence (1)
lib/services/gridfs.js:21
- The contentType is being set in both the metadata object (line 16) and the options object (line 21). While this addresses the MongoDB driver 7 breaking change where contentType was removed from the file document, having it in both places may be redundant. Consider whether both are necessary or if only metadata.contentType is needed for MongoDB driver 7.
contentType: file.mimetype,
};
const filename = `${crypto.randomBytes(32).toString('hex')}${path.extname(file.originalname)}`;
const options = {
metadata,
contentType: file.mimetype,
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
… by MongoDB driver 7)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.