Skip to content

chore: migrate ESLint to flat config and fix Express 5 / MongoDB driv…#3117

Merged
PierreBrisorgueil merged 2 commits intomasterfrom
upgradedeps
Feb 17, 2026
Merged

chore: migrate ESLint to flat config and fix Express 5 / MongoDB driv…#3117
PierreBrisorgueil merged 2 commits intomasterfrom
upgradedeps

Conversation

@PierreBrisorgueil
Copy link
Contributor

@PierreBrisorgueil PierreBrisorgueil commented Feb 17, 2026

  • 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

…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
Copilot AI review requested due to automatic review settings February 17, 2026 13:02
@coveralls
Copy link

coveralls commented Feb 17, 2026

Pull Request Test Coverage Report for Build 22100068433

Details

  • 7 of 7 (100.0%) changed or added relevant lines in 3 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.1%) to 73.729%

Totals Coverage Status
Change from base Build 22097769125: 0.1%
Covered Lines: 894
Relevant Lines: 1126

💛 - Coveralls

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.

@PierreBrisorgueil PierreBrisorgueil merged commit a1296b6 into master Feb 17, 2026
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.

2 participants

Comments