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

Disable embedded templates handling for eol-last rule #2846

Merged

Conversation

robinborst95
Copy link
Contributor

In our test suite this is the last remaining (enabled) rule that provides incorrect results in embedded templates. Enforcing a newline at the end of an embedded template doesn't make much sense to me, so disabling the rule seems the easiest solution. You could argue to set the config to "never" instead of disabling completely, but that requires more changes and in the end it's not what this rule is meant for (which is having a newline or not at the end of a file, rather than at the end of a template).

@robinborst95 robinborst95 changed the title Skip embedded templates handling in eol-last rule Disable embedded templates handling for eol-last rule Mar 15, 2023
@@ -5,6 +5,10 @@ import Rule from './_base.js';

export default class EolLast extends Rule {
parseConfig(config) {
if (!this.isStrictMode) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's also add a note to the rule doc that this rule doesn't apply to embedded templates?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've adapted the rule doc as well! I figured the rule doc doesn't need an explanation, as it already said files specifically, which I made even more explicit by saying template files instead.

Copy link
Member

@bmish bmish left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@bmish bmish changed the title Disable embedded templates handling for eol-last rule Disable embedded templates handling for eol-last rule (#2846 Mar 15, 2023
@bmish bmish merged commit 24a5425 into ember-template-lint:master Mar 15, 2023
@robinborst95 robinborst95 deleted the fix/skip-eol-last-embedded branch March 15, 2023 22:45
@bmish bmish changed the title Disable embedded templates handling for eol-last rule (#2846 Disable embedded templates handling for eol-last rule Mar 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants