Open elwayman02 opened 3 years ago
The error comes from hasModifierWithArgs
having the incorrect value: https://github.com/ember-codemods/ember-native-class-codemod/search?q=hasModifierWithArgs
Importing computed
and invoking values like computed.equal
was not part of the module API, and was a quirk of the fact that the module API was polyfilled via the global API. This functionality has been deprecated along with using the Ember
global, and you should take this opportunity to rewrite the class in question to use the proper import path.
I don't think this is necessarily a case the codemod has to handle, given it's unusual and can be fixed before the codemod is run, but will accept a PR to add the functionality.
When encountering code where the computed namespace has been imported rather than the individual methods (e.g.
computed.equal
), the codemod outputs the following error:Presumably, it thinks
computed.equal
is the same thing ascomputed().volatile()
orcomputed().meta()
, and thus is erroring out instead of codemodding the file. Changing uses of thecomputed
namespace to their equivalent imports is an existing workaround, but we should fix the codemod bug instead of requiring people to work around it!