ember-codemods / ember-modules-codemod

Codemod to upgrade Ember apps to JavaScript (ES6) modules

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add support for "old shims"

Turbo87 opened this issue · comments

https://github.com/ember-cli/ember-rfc176-data has a mapping from old shims to new modules now

Yes, eslint-plugin-ember catches these old shims, but shouldn't ember-modules-codemod be set up to transform these to the new syntax?

AFAIK, eslint-plugin-ember does not fix, unless I missed something...

Happy to accept a PR adding that functionality here also @danwenzel, but the no-old-shims rule in eslint-plugin-ember definitely does have --fix capabilities...

Ah, you're right - I totally missed that wrench icon :)

I think there are opportunities for crossover here. The codemod would be for a sweeping change across a project, and the eslint rules would show and fix any problems along the way (especially helpful when "auto-fix on save" is turned on in your code editor).

As an example of the other way around, it would be awesome if the new-module-imports rule had --fix functionality that did exactly what the codemod does. Then developers wouldn't even need to learn how to use the codemod; just let their editor do the fixing.

I'll try and work on PRs for those if you think that's a good idea.