Open ctjhoa opened 4 years ago
Ya, I was actually just chatting a bit with @mmun on this the other day. Hopefully he has a chance to chime in...
What I was thinking about is a way to collect data across multiple files and do some global linting/reporting based on that. That might be more than what most people are wanting here.
Newly generate codemod doesn't come with logger. I dug into ember-codemods, looking for a standard way to log errors and warnings.
I found several ways to achieve it:
Use pure nodejs https://github.com/ember-codemods/ember-data-codemod/blob/master/transforms/globals-to-ember-data-imports/index.js#L6
Use winston https://github.com/ember-codemods/ember-angle-brackets-codemod/blob/master/lib/logger.js
Use console https://github.com/ember-codemods/ember-component-template-colocation-migrator/blob/master/lib/utils/file.js#L8
Use console with SilentError pattern https://github.com/ember-codemods/tagless-ember-components-codemod/commit/491cfa20d403fea047882989f07d23844b2b231d
What's your recommendation on this? Do you think a default logger should be generate too?