fix(eslint-plugin-template): [attributes-order] treat inputs without square brackets as attributes #2316
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #1914
Given an element with two attributes, where one sets a static valid and the other uses interpolation, Angular classifies the first attribute as an "attribute" and the second attribute as an "input".
See here for an example of the AST (the template parser it uses is quite a few versions behind, but the same behavior exists with v19):
https://astexplorer.net/#/gist/cd84edb20d811a8896c9f28f6f5031d9/1567654ea0ba120f0c3844e9786387bb3c921d17
This pull request changes the
attributes-order
rule such that an input will only be classified as an input if it's surrounded with square brackets.Note
This PR is piggy-backing off #2307 since that PR made large changes to theattributes-order
rule. Once/if that is merged, then I'll rebase this PR to remove the extra commits.The specific commit that is relevant to this PR is 6fc0cd5.