# Prettier 报错，@discourseComputed 不能用于装饰字面量属性

**URL:** <https://meta.discourse.org/t/prettier-complains-that-discoursecomputed-cannot-be-used-to-decorate-literal-properties/271141>\
**Category:** Development\
**Created:** [2023年七月10日 17:35 UTC](https://meta.discourse.org/t/prettier-complains-that-discoursecomputed-cannot-be-used-to-decorate-literal-properties/271141 "2023-07-10T17:35:46Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![Arkshine](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/arkshine/32/298682_2.png) [@Arkshine](https://meta.discourse.org/u/Arkshine)\
**Post date:** [2025年四月13日 18:32 UTC](https://meta.discourse.org/t/prettier-complains-that-discoursecomputed-cannot-be-used-to-decorate-literal-properties/271141/3 "2025-04-13T18:32:34Z")

</div>

该插件是否仍在使用旧的 `.extend({})` 语法？

> [@Moving to JS native class syntax in themes and plugins](https://meta.discourse.org/t/moving-to-js-native-class-syntax-in-themes-and-plugins/356588):
>
> Over the last few years, we’ve been moving away from Ember’s legacy .extend({ ... }) syntax and towards native-class syntax like class extends Foo {...}. While the legacy syntax is technically still supported, modern JS tooling including IDEs, and Prettier 3.0, do not support decorators in the legacy object-literal-based syntaxes. In the latest version of our recommended linting config, you’ll see these errors when using legacy syntax: ESLint: error Native JS classes should be used instead of…

---

_[View the full topic](https://meta.discourse.org/t/prettier-complains-that-discoursecomputed-cannot-be-used-to-decorate-literal-properties/271141)._
