Prettier complains that @discourseComputed cannot be used to decorate literal properties

AI-generated summary

The discussion revolves around an issue with Prettier complaining that @discourseComputed cannot be used to decorate literal properties. pfaffman initially encountered the error and was unsure why it occurred, despite having similar constructions elsewhere in their code. After pfaffman experienced the error again, Arkshine suggested that the issue might be related to the legacy .extend({}) syntax, pointing to a meta discussion on moving to JS native class syntax. pfaffman confirmed this was the cause and is now in the process of updating their code, considering the use of ember-native-class-codemod to facilitate the transition.

I don’t understand why prettier is unhappy with the following code. Error is SyntaxError: Decorators cannot be used to decorate object literal properties. (9:3)

I have the same construction in other places that look, to me, to be exactly the same. :crying_cat_face:

EDIT: this seems to have started working for reasons completely unclear. I’ll delete this next. Except I can’t.

I’m getting this same error again on a different plugin on @action, @on, and @discourseComputed. I thought maybe it was something with the prettier config, but I just copied it from discourse-plugin-skeleton.

Does the plugin still use the legacy .extend({}) syntax?

YESSSSS!

Thanks! I just figured it out and now am trying to get all of the stuff switched over . . . oh, wait. . .

No. Way.

I’ve been trying to get mass-pr to help, but it’s not been very . . .helpful. I guess I’ll need to try that some more.

Thanks very much!!

I thought I’d been paying attention to those topics, but I guess I missed or didn’t understand that one.