ember-template-lint / eslint-plugin-hbs

Plugin for eslint which checks inline hbs templates
ISC License
18 stars 8 forks source link

Not sure how to handle/fix "template must end with newline" #33

Open boris-petrov opened 4 years ago

boris-petrov commented 4 years ago

I use inline templates only in tests and there I have something like:

await render(hbs`{{some-component this.someValue}}`);

And ESLint complains:

13:18  error  1 error(s): template must end with newline  hbs/check-hbs-template-literals

Putting an \n at the end doesn't seem to silence it. Besides, I don't want to do that in all places. Apart from having a different config for ESLint's template linting, can something be done in the plugin?

rwjblue commented 4 years ago

Ya, we should probably disable that rule for inline templates.

jaydgruber commented 3 years ago

So if #35 goes in and the template-linter has access to the filePath for inline templates, we could either:

rwjblue commented 3 years ago

I think the rule should be aware that the file path is not .hbs and allow relaxing the rule. You could probably do that with overrides already.

jaydgruber commented 3 years ago

yeah, overrides would work. although #35 / (fixing #40) still needed, b/c it is hard to do overrides without the filePath right now