You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 7, 2019. It is now read-only.
I would like to have a eslint rule that checks if the modules are exported in consistent way in all modules.
Now you can export functions in one module like this:
// first you declare and implement all the functions
function findById() { ... do something ...}
function findAll() {}
function incrementViews() {}
module.exports = { // and then all the functions are exported at once
findById,
findAll,
incrementViews
}
and in other module, you can export functions directly when declaring them:
// export the function with the implementation in one line
module.exports.findById = function findById() {
... do something ...
}
module.exports.findAll = function findAll() {
... do something ...
}
module.exports.incrementViews = function incrementViews() {
... do something ...
}
I'm not sure if this kind of rule exists in eslint, but I think it would be nice to have it and this rule would be more important than checking if a comment starts with capital letter 😜