How to callback return rules
See original GitHub issuehi, is not available to return as a rule in a callback.
how do I do that
export const rules = () => {
return [
check('firstname', i18n.t('characters.2', { field: 'Firstname' })).isLength({ min: 2 }),
check('lastname', i18n.t('characters.2', { field: 'Lastname' })).isLength({ min: 2 })
]
}
...
router.put('/:id', rules, controller.update)
Issue Analytics
- State:
- Created 6 years ago
- Comments:7 (2 by maintainers)
Top Results From Across the Web
array-callback-return - ESLint - Pluggable JavaScript Linter
Rule Details. This rule enforces usage of return statement in callbacks of array's methods. Additionally, it may also enforce the forEach array method...
Read more >How to satisfy the lint rules 'array-callback-return'?
If I use forEach instead of map , it will not cause the array-callback-return lint error. Object.keys(planLimits).
Read more >Rule array-callback-return - ESLint - Pluggable JavaScript linter
This rule enforces usage of return statement in callbacks of array's methods. Rule Details. This rule finds callback functions of the following methods,...
Read more >Callbacks of array methods should have return statements
If there is no return, callback will implicitly return undefined , which will likely fail. This rule applies for the following methods of...
Read more >Everything About Callback Functions in JavaScript
The callback is a function that's accepted as an argument and executed by another function (the higher-order function). There are 2 kinds of ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hello @mattandrews @carvalhoviniciusluiz this is now possible express-validator v5.0.0. Check this section of the docs for more information on how to do it.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.