99x / 99x/react-scaffolder

Arguments as an object

Open
#63 1 comment 0 reactions 0 assignees View on GitHub
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

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.