TypeStat icon indicating copy to clipboard operation
TypeStat copied to clipboard

Consider sanitizing the options object early on before passing it around

Open JoshuaKGoldberg opened this issue 6 years ago • 0 comments

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

JoshuaKGoldberg avatar Jan 08 '19 15:01 JoshuaKGoldberg