Skip to content

Extract rule: template-no-extra-mut-helpers#2432

Draft
NullVoxPopuli wants to merge 1 commit intoember-cli:masterfrom
NullVoxPopuli:nvp/template-lint-extract-rule-template-no-extra-mut-helpers
Draft

Extract rule: template-no-extra-mut-helpers#2432
NullVoxPopuli wants to merge 1 commit intoember-cli:masterfrom
NullVoxPopuli:nvp/template-lint-extract-rule-template-no-extra-mut-helpers

Conversation

@NullVoxPopuli
Copy link
Contributor

Split from #2371.

@NullVoxPopuli NullVoxPopuli force-pushed the nvp/template-lint-extract-rule-template-no-extra-mut-helpers branch from e3c2847 to fb14ff6 Compare February 23, 2026 19:55
@@ -0,0 +1,43 @@
# ember/template-no-extra-mut-helpers
Copy link
Member

Choose a reason for hiding this comment

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

@wagenet
Copy link
Contributor

wagenet commented Feb 27, 2026

This looked ok to me, but if Katie thinks there's something wrong, go with what she says :)

@kategengler
Copy link
Member

This looked ok to me, but if Katie thinks there's something wrong, go with what she says :)

I just cannot find the rule it ported from -- I think it mutated two rules together in a weird way

@wagenet
Copy link
Contributor

wagenet commented Feb 27, 2026

Claude analysis says:

ETL's no-extra-mut-helper-argument — these are ETL's valid cases:
{{my-component click=(action (mut isClicked))}}
{{my-component isClickedMutable=(mut isClicked)}}
<button {{action (mut isClicked)}}>
ETL's invalid cases are all (mut x y) — two args passed directly to mut.

PR #2432's rule flags (mut this.value) — exactly the single-arg form ETL considers valid.

So three concrete issues:

  1. The docs reference is wrong. The PR links to no-extra-mut-helper-argument as its source, but implements a different rule that directly contradicts it. Using both rules together would create a contradiction: ETL
    says (mut isClicked) is fine; this PR says it isn't.

  2. The rule is overly broad. (mut x) is still legitimate in (action (mut x)) patterns — creating a mutable reference for classic action-based two-way binding. The PR has no exception for this, so (action (mut
    isClicked)) would be flagged despite being the explicitly-correct ETL pattern.

  3. No existing rule conflict — there's no template-no-extra-mut-helper-argument in this plugin yet, so there's no naming collision. But the rule as written implements "never use (mut x) at all on a path
    expression" which is a stronger, distinct claim than what the ETL ecosystem does.

Bottom line: The rule logic is internally consistent for its stated intent ("unnecessary mut helpers"). But that intent is not sourced from ETL, the docs reference is wrong, and the rule will flag patterns ETL
explicitly endorses. It needs a clearer identity — either properly port the ETL rule (flag (mut x y)) or document this as an original, more opinionated rule with explicit rationale for why (mut x) in modern
Glimmer is always unnecessary.

Copy link
Contributor

@wagenet wagenet left a comment

Choose a reason for hiding this comment

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

See comment.

@NullVoxPopuli NullVoxPopuli marked this pull request as draft February 27, 2026 22:40
@NullVoxPopuli
Copy link
Contributor Author

marking draft, because I need to re-sync the template-lint stuff

@NullVoxPopuli NullVoxPopuli force-pushed the nvp/template-lint-extract-rule-template-no-extra-mut-helpers branch from fb14ff6 to 6e0f604 Compare February 28, 2026 23:43
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

Successfully merging this pull request may close these issues.

3 participants