Skip to content

Conversation

@bjohansebas
Copy link
Member

@bjohansebas bjohansebas commented Dec 26, 2025

This creates a codemod that calls the rest of the codemods, so it’s easy to run a single command and change everything.

This codemod won’t work until the other codemods are published in the registry

@bjohansebas bjohansebas self-assigned this Dec 26, 2025
@bjohansebas bjohansebas mentioned this pull request Dec 26, 2025
25 tasks
Comment on lines +7 to +12
- **Back Redirect Deprecated**: This transformation updates instances of `res.redirect('back')` and `res.location('back')` to use the recommended alternatives. Registry entry: [https://app.codemod.com/registry/expressjs/back-redirect-deprecated](https://app.codemod.com/registry/expressjs/back-redirect-deprecated).
- **Req Param**: Migrates usage of the legacy API `req.param(name)` to the current recommended alternatives. Registry entry: [https://app.codemod.com/registry/expressjs/req-param](https://app.codemod.com/registry/expressjs/req-param).
- **Pluralize Method Names**: Migrates deprecated singular request methods to their pluralized counterparts where applicable. Registry entry: [https://app.codemod.com/registry/expressjs/pluralize-method-names](https://app.codemod.com/registry/expressjs/pluralize-method-names).
- **Status Send Order**: Migrates usages of `res.send(status)`, `res.send(obj, status)`, `res.json(obj, status)`, and `res.jsonp(obj, status)` to the recommended argument ordering. Registry entry: [https://app.codemod.com/registry/expressjs/status-send-order](https://app.codemod.com/registry/expressjs/status-send-order).
- **Redirect Arg Order**: Converts `res.redirect(url, status)` calls to the recommended `res.redirect(status, url)` ordering. Registry entry: [https://app.codemod.com/registry/expressjs/redirect-arg-order](https://app.codemod.com/registry/expressjs/redirect-arg-order).
- **Camelcase Sendfile**: Replaces legacy `res.sendfile(file)` usages with the camel-cased `res.sendFile(file)` API. Registry entry: [https://app.codemod.com/registry/expressjs/camelcase-sendfile](https://app.codemod.com/registry/expressjs/camelcase-sendfile).
Copy link
Member Author

Choose a reason for hiding this comment

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

The links are still to be confirmed, I’ll fix them once they’re in the registry.

Copy link
Contributor

@mohebifar mohebifar left a comment

Choose a reason for hiding this comment

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

Looks good!

Co-authored-by: Mohamad Mohebifar <[email protected]>
Signed-off-by: Sebastian Beltran <[email protected]>
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