Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
boris-petrov opened this issue Jan 26, 2020 · 4 comments
Open

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

boris-petrov opened this issue Jan 26, 2020 · 4 comments

Comments

@boris-petrov
Copy link

boris-petrov commented Jan 26, 2020

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?

Copy link
Member

rwjblue commented Feb 21, 2020

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

@jaydgruber
Copy link

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

  • update the blueprint to set insert_final_newline = false for some pattern **/tests/**/*.js or something (since editorconfig is the default config for the rule now)
  • update the eol-last rule directly to use the filePath and ignore any .js
    • I'm not sure what other use cases besides tests folks have for inline templates. Should this still be configurable?

@rwjblue
Copy link
Member

rwjblue commented Mar 16, 2021

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
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants