JoshuaKGoldberg / JoshuaKGoldberg/TypeStat

Consider sanitizing the options object early on before passing it around

Open
#96 0 comments 0 reactions 0 assignees View on GitHub
area: architecture area: options type: cleanup
Dominant language
TypeScript
Stars
2.3k
Forks
47
Avg merge
15h 55m
Merged PRs (30d)
21

Description

Talked a bit about architecture with @ian-craig. Some good feedback:

> Random feedback: It might be worth sanitizing the options object early on before you pass it around. e.g. collectFileMutators is basically a "getValueOrDefault" for the mutators list, but is called quite deep in the program. If the defaults were applied at top level all these lower-level functions wouldn't have to worry about what is and isn't set.

> Same goes for the [invalid --fileNames names] error case you were talking about. Maybe the fileNames from options should be sanitized at the beginning so you can report an error cleanly and other functions don't have to worry

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.