Arguments as an object
- Dominant language
- JavaScript
- Stars
- 44
- Forks
- 15
- PR merge metrics
- No merged PRs in 30d
Description
I think that it would be better to use object as argument.
instead of
```
generate.prototype.createComponent = function(
module,
componentName,
answers,
answersInner,
onlyFile,
cb
) {}
```
better is
```
generate.prototype.createComponent = function({
module,
componentName,
answers,
answersInner = null,
onlyFile = false,
cb
}) {}
```
And later use that:
```
generate.createComponent({
module: modulename,
componentName: name,
cb: function(status) {}
});
```
Contributor guide
Research direction
Start by locating generate.prototype.createComponent and every call site in the repository. Review how its current positional arguments are supplied, then update the interface and callers to use the proposed object form, including the shown defaults; confirm all references are consistent.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, nodejs
- Domain
- cli, tooling
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100