Is er een manier om handlebars te linten?

No magic required :slightly_smiling_face: but make sure you run the command in the root directory of Discourse. This got me a couple times already.

Compare:

# in [discourse]/app/assets/javascripts
$ yarn ember-template-lint .
✨  Done in 2.57s.
# in [discourse]
$ yarn ember-template-lint app/assets/javascripts
app/assets/javascripts/discourse/app/templates/tags.hbs
  4:0  error  Unexpected {{debugger}} usage.  no-debugger
  4:0  error  Usage of triple curly brackets is unsafe  no-triple-curlies
  3:15  error  Incorrect indentation for `d-section` beginning at L1:C0. Expected `{{/d-section}}` ending at L3:C15 to be at an indentation of 0 but was found at 1.  block-indentation
  2:4  error  Incorrect indentation for `{{outlet}}` beginning at L2:C4. Expected `{{outlet}}` to be at an indentation of 2 but was found at 4.  block-indentation
  1:23  error  you must use double quotes in templates  quotes

✖ 5 problems (5 errors, 0 warnings)
error Command failed with exit code 1.

Also, keep in mind it will use our config (.template-lintrc.js) so it might not report all expected issues as some rules are currently disabled.


@justin I just realized that our plugin GitHub Actions workflows currently don’t share this config. We should change that at some point. :smiley: