Open gaearon opened 8 years ago
That sounds very good to me. jscodeshift already provides some way to get this information, via the stats
function.
I.e. you can call stats('does not import a mixin')
in your transformer and you will see counters for each value when you dry
run.
But I like the idea of merging this into skip information.
Ah, I missed stats
in README.
I still think it's valuable to have both.
Could the --verbose
mode also display a reason in addition to the file being skipped?
I’m writing my first codemod and I noticed it’s very hard to determine whether certain edge cases are worth handling. Currently I see an output like this:
However “61720 skipped” is not very informative. I have 15 different places where I return early based on some condition. Handling these cases could introduce more complexity to the codemod but I want to know when it would be worth it. For example, an output like this would be way more helpful:
This would give me a much better understanding of where to spend the effort making the codemod smarter. In terms of API, it could look like:
Would you be interested in considering this feature request?