In the latest version of Discourse’s standard linting config, we’ve enabled the require-strict-mode ember-template-lint rule. This will raise a linting error for any .hbs files.
To resolve the warnings, you should convert all your component, route, and connector templates to .gjs files. To make this easy, we’ve built the discourse-gjs-codemod, which builds on top of Ember’s @embroider/template-tag-codemod.
To use the codemod, first ensure that your linting dependencies are up-to-date by copying the latest package.json from the plugin skeleton or the theme skeleton. Then, run eslint and prettier:
pnpm i
pnpm eslint --fix .
pnpm prettier --write "**/*.{gjs,js,hbs,scss}"
If any issues could not be autofixed, resolve them manually now. Don’t run ember-template-lint yet - that’s expected to fail.
Now run the codemod using this command:
pnpm dlx https://github.com/discourse/discourse-gjs-codemod
If there are any issues which cannot be automatically resolved, information will be printed to the terminal. Once you’ve resolved the problem, run the codemod again.
For more information about the .gjs file format, check out the official guide: