# Автоматическое обновление тем и плагинов в формат файлов .gjs

**URL:** https://meta.discourse.org/t/automatically-updating-themes-and-plugins-to-gjs-file-format/368051
**Category:** Development
**Tags:** dev-news
**Created:** [29.Май.2025 10:56:25 UTC](https://meta.discourse.org/t/automatically-updating-themes-and-plugins-to-gjs-file-format/368051 "2025-05-29T10:56:25Z")
**Posts on this page:** 1
**Showing post:** 1

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [29.Май.2025 10:56:25 UTC](https://meta.discourse.org/t/automatically-updating-themes-and-plugins-to-gjs-file-format/368051/1 "2025-05-29T10:56:25Z")

</div>

В последней версии стандартной конфигурации линтинга Discourse мы включили правило `require-strict-mode` для ember-template-lint. Это приведёт к возникновению ошибки линтинга для любых файлов с расширением `.hbs`.

Чтобы устранить предупреждения, необходимо преобразовать все шаблоны компонентов, маршрутов и коннекторов в файлы с расширением `.gjs`. Чтобы упростить этот процесс, мы создали утилиту [`discourse-gjs-codemod`](https://github.com/discourse/discourse-gjs-codemod), которая базируется на [`@embroider/template-tag-codemod`](https://github.com/embroider-build/embroider/tree/main/packages/template-tag-codemod) от Ember.

Для использования кодомода сначала убедитесь, что зависимости линтинга обновлены, скопировав актуальный файл `package.json` из [шаблона плагина](https://github.com/discourse/discourse-plugin-skeleton/blob/main/package.json) или [шаблона темы](https://github.com/discourse/discourse-theme-skeleton/blob/main/package.json). Затем запустите eslint и prettier:

```plaintext
pnpm i
pnpm eslint --fix .
pnpm prettier --write "**/*.{gjs,js,hbs,scss}"

```

Если какие-либо проблемы не были исправлены автоматически, устраните их вручную. Пока не запускайте ember-template-lint — это ожидаемо приведёт к ошибке.

Теперь запустите кодомод с помощью следующей команды:

```plaintext
pnpm dlx https://github.com/discourse/discourse-gjs-codemod

```

Если возникнут проблемы, которые не могут быть решены автоматически, информация о них будет выведена в терминал. После устранения проблемы запустите кодомод снова.

Для получения дополнительной информации о формате файлов `.gjs` ознакомьтесь с официальным руководством:

> **[Template Tag Format - Components - Ember Guides](https://guides.emberjs.com/release/components/template-tag-format/)**
>
> The template tag format is a powerful, new way to write components in Ember. It's a single-file format that combines the component's JavaScript and Glimmer template code. The tag is used to keep a clear separation between the template language...

---

_[View the full topic](https://meta.discourse.org/t/automatically-updating-themes-and-plugins-to-gjs-file-format/368051)._
