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

Running --fix when enabling attribute-order rule hangs process #3053

Open
IgnaceMaes opened this issue Apr 10, 2024 · 1 comment
Open

Running --fix when enabling attribute-order rule hangs process #3053

IgnaceMaes opened this issue Apr 10, 2024 · 1 comment

Comments

@IgnaceMaes
Copy link

When enabling the attribute-order rule like so:

{
    // ...
	rules: {
	  'attribute-order': true,
      // ...
    },
}

Running pnpm ember-template-lint "**/*.hbs" succeeds (as in, completes):

✖ 1105 problems (1105 errors, 0 warnings)
  1090 errors and 0 warnings potentially fixable with the `--fix` option.
 ELIFECYCLE  Command failed with exit code 1.

Running pnpm ember-template-lint "**/*.hbs" --fix results in a Node process running at 100% CPU which hangs.

I've yet to pinpoint the exact issue by running on a subset of files. But opening the issue already regardless.

Versions

Using Node v20.11.0 gives the same result.

@IgnaceMaes
Copy link
Author

I was able to create the following minimal reproduction.

Running autofix hangs on the following:

<Foo::Bar
  @ca={{this.justARandomName}}
  @cb={{this.anotherRandomName}}
  @t={{this.another.random.prop}}
>
  <div>
    <div>
      <div>
        <LinkTo
          @route="some.route"
          @model={{this.someLongerGetterName}}
          @query={{hash
            l=this.someProp.anotherthing
            mP=this.anotherProp.anotherthing
            p=this.foobar
          }}
          target="_blank"
        >
          test
        </LinkTo>
      </div>
    </div>
  </div>
</Foo::Bar>

Running autofix works when either of the following actions is done:

  • Removing one level of div nesting
  • Removing the ca argument in the Foo::Bar component
  • Replacing someLongerGetterName with x

This all seems random. But as making the line length shorter generally seems to solve this, it might indicate a conflict with a line length rule?

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

1 participant