Skip to content

template-no-extra-mut-helper-argument: applies to strict mode, and stop recommending (action) - #2841

Merged
evoactivity merged 2 commits into
masterfrom
nvp/mut-helper-rule-is-not-hbs-only
Aug 17, 2026
Merged

template-no-extra-mut-helper-argument: applies to strict mode, and stop recommending (action)#2841
evoactivity merged 2 commits into
masterfrom
nvp/mut-helper-rule-is-not-hbs-only

Conversation

@NullVoxPopuli

@NullVoxPopuli NullVoxPopuli commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

templateMode: 'loose' is wrong on this rule. mut is an ambient Glimmer keyword, so (mut a b) needs no import and is reachable in a gjs/gts template. The rule has no strict-mode guard and reports there today.

Verified by linting a .gjs file with only this rule on:

const Foo = <template>{{yield (mut @a @b)}}</template>;
ember/template-no-extra-mut-helper-argument

Changes templateMode to both, which drops the "HBS Only" note from the docs, and adds a gjs test case so the behavior is pinned.

Found while implementing RFC #1217 in #2840: the RFC puts this rule in Appendix A (applies to strict mode) while the code claimed hbs-only. The RFC is right.

🤖 Generated with Claude Code

Also: the message pointed at removed API

The report told people to write (action (mut attr) value), and {{action}} is gone from ember-source. It now points at (fn (mut attr) value). The docs examples and test fixtures move to fn and {{on "click" ...}} for the same reason.

`mut` is an ambient strict-mode keyword, so `(mut a b)` is reachable in
gjs/gts and the rule reports there. Adds a gjs test case.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@github-actions

github-actions Bot commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

🏎️ Benchmark Comparison

Benchmark Control (p50) Experiment (p50) Δ
js small 10.57 ms 10.52 ms -0.4%
🟠 js medium 5.14 ms 5.31 ms +3.3%
js large 2.10 ms 2.08 ms -1.2%
gjs small 870.05 µs 869.59 µs -0.1%
gjs medium 433.86 µs 431.61 µs -0.5%
gjs large 171.25 µs 172.39 µs +0.7%
gts small 858.58 µs 857.76 µs -0.1%
gts medium 431.11 µs 432.71 µs +0.4%
gts large 171.28 µs 171.22 µs -0.0%

🟢 faster · 🔴 slower · 🟠 slightly slower · ⚪ within 2%

Full mitata output
clk: ~3.50 GHz
cpu: AMD EPYC 9V74 80-Core Processor
runtime: node 24.19.0 (x64-linux)

benchmark                   avg (min … max) p75 / p99    (min … top 1%)
------------------------------------------- -------------------------------
js small (control)            12.23 ms/iter  13.54 ms ██ ▃                 
                       (8.71 ms … 25.14 ms)  21.91 ms ██▃█ ▃ ▃             
                    (  6.08 mb …  10.79 mb)   7.21 mb ████▁███▆▆▄▁▁▄▁▁▆▁▁▄▆

js small (experiment)         11.12 ms/iter  12.26 ms █                    
                       (9.37 ms … 16.26 ms)  15.83 ms ██▆ █    ▃           
                    (  6.59 mb …   8.04 mb)   6.88 mb █████▇▃▁▃█▁▇▅▃▁▅▁▃▃▁▃

                             ┌                                            ┐
                             ╷┌──────────┬───┐                            ╷
          js small (control) ├┤          │   ├────────────────────────────┤
                             ╵└──────────┴───┘                            ╵
                               ╷┌────┬───┐           ╷
       js small (experiment)   ├┤    │   ├───────────┤
                               ╵└────┴───┘           ╵
                             └                                            ┘
                             8.71 ms           15.31 ms            21.91 ms

summary
  js small (experiment)
   1.1x faster than js small (control)

------------------------------------------- -------------------------------
js medium (control)            5.62 ms/iter   5.72 ms █▇                   
                       (4.84 ms … 11.24 ms)   9.44 ms ██                   
                    (  3.33 mb …   3.99 mb)   3.54 mb ███▇▄▄▄▃▃▂▁▂▁▂▂▂▁▂▁▂▂

js medium (experiment)         5.89 ms/iter   6.04 ms █ ▆                  
                       (4.44 ms … 14.64 ms)  11.61 ms █ █▆                 
                    (  1.41 mb …   5.89 mb)   3.51 mb █▅███▃▇▃▃▅▂▂▁▂▁▁▃▁▂▂▂

                             ┌                                            ┐
                               ╷┌───┬┐                      ╷
         js medium (control)   ├┤   │├──────────────────────┤
                               ╵└───┴┘                      ╵
                             ╷┌───────┬┐                                  ╷
      js medium (experiment) ├┤       │├──────────────────────────────────┤
                             ╵└───────┴┘                                  ╵
                             └                                            ┘
                             4.44 ms            8.03 ms            11.61 ms

summary
  js medium (control)
   1.05x faster than js medium (experiment)

------------------------------------------- -------------------------------
js large (control)             2.33 ms/iter   2.19 ms ▂█                   
                        (1.96 ms … 5.84 ms)   5.09 ms ██                   
                    (128.83 kb …   2.77 mb)   1.43 mb ██▃▃▃▂▂▂▁▂▂▁▁▁▁▁▂▁▁▁▁

js large (experiment)          2.30 ms/iter   2.17 ms  █                   
                        (1.93 ms … 5.31 ms)   5.24 ms ▇█                   
                    (239.03 kb …   2.61 mb)   1.44 mb ██▄▂▂▂▂▁▂▁▁▁▁▁▁▂▁▁▁▁▁

                             ┌                                            ┐
                             ╷┌───┬                                     ╷
          js large (control) ├┤   │─────────────────────────────────────┤
                             ╵└───┴                                     ╵
                             ╷┌───┬                                       ╷
       js large (experiment) ├┤   │───────────────────────────────────────┤
                             ╵└───┴                                       ╵
                             └                                            ┘
                             1.93 ms            3.59 ms             5.24 ms

summary
  js large (experiment)
   1.01x faster than js large (control)

------------------------------------------- -------------------------------
gjs small (control)          978.19 µs/iter 883.14 µs █                    
                      (839.81 µs … 5.49 ms)   5.32 ms █                    
                    (551.12 kb …   2.16 mb)   1.06 mb █▂▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁

gjs small (experiment)       964.73 µs/iter 879.41 µs █                    
                      (844.11 µs … 6.06 ms)   5.55 ms █                    
                    (582.86 kb …   2.24 mb)   1.06 mb █▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁

                             ┌                                            ┐
                             ┌┬                                         ╷
         gjs small (control) ││─────────────────────────────────────────┤
                             └┴                                         ╵
                             ┌┬                                           ╷
      gjs small (experiment) ││───────────────────────────────────────────┤
                             └┴                                           ╵
                             └                                            ┘
                             839.81 µs           3.19 ms            5.55 ms

summary
  gjs small (experiment)
   1.01x faster than gjs small (control)

------------------------------------------- -------------------------------
gjs medium (control)         478.59 µs/iter 439.79 µs █                    
                      (419.96 µs … 5.45 ms)   1.08 ms █▆                   
                    ( 34.29 kb …   1.04 mb) 539.92 kb ██▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁

gjs medium (experiment)      471.19 µs/iter 437.07 µs █                    
                      (418.50 µs … 4.70 ms)   1.04 ms █▇                   
                    ( 34.12 kb …   1.04 mb) 540.14 kb ██▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁

                             ┌                                            ┐
                             ╷┌──┬                                        ╷
        gjs medium (control) ├┤  │────────────────────────────────────────┤
                             ╵└──┴                                        ╵
                             ╷┌──┬                                     ╷
     gjs medium (experiment) ├┤  │─────────────────────────────────────┤
                             ╵└──┴                                     ╵
                             └                                            ┘
                             418.50 µs          750.46 µs           1.08 ms

summary
  gjs medium (experiment)
   1.02x faster than gjs medium (control)

------------------------------------------- -------------------------------
gjs large (control)          190.14 µs/iter 174.24 µs   █                  
                      (166.08 µs … 4.90 ms) 216.60 µs  ██                  
                    (129.04 kb … 769.91 kb) 216.28 kb ▂███▃▅▅▃▂▁▁▁▁▁▁▁▁▁▁▁▁

gjs large (experiment)       191.29 µs/iter 175.64 µs  █▇                  
                      (166.91 µs … 4.90 ms) 225.69 µs  ██                  
                    (180.16 kb …   1.37 mb) 216.51 kb ▃██▇▅▆▃▂▁▁▁▁▁▁▁▁▁▁▁▁▁

                             ┌                                            ┐
                             ╷  ┌──────────────┬                   ╷
         gjs large (control) ├──┤              │───────────────────┤
                             ╵  └──────────────┴                   ╵
                              ╷ ┌───────────────┬                         ╷
      gjs large (experiment)  ├─┤               │─────────────────────────┤
                              ╵ └───────────────┴                         ╵
                             └                                            ┘
                             166.08 µs         195.88 µs          225.69 µs

summary
  gjs large (control)
   1.01x faster than gjs large (experiment)

------------------------------------------- -------------------------------
gts small (control)          939.60 µs/iter 867.11 µs █                    
                      (836.92 µs … 5.33 ms)   4.99 ms █                    
                    (721.79 kb …   2.24 mb)   1.06 mb █▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁

gts small (experiment)       931.39 µs/iter 866.90 µs █                    
                      (836.97 µs … 5.47 ms)   4.97 ms █                    
                    (  1.02 mb …   2.21 mb)   1.06 mb █▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁

                             ┌                                            ┐
                             ┌┬                                           ╷
         gts small (control) ││───────────────────────────────────────────┤
                             └┴                                           ╵
                             ┌┬                                           ╷
      gts small (experiment) ││───────────────────────────────────────────┤
                             └┴                                           ╵
                             └                                            ┘
                             836.92 µs           2.92 ms            4.99 ms

summary
  gts small (experiment)
   1.01x faster than gts small (control)

------------------------------------------- -------------------------------
gts medium (control)         473.03 µs/iter 436.96 µs ▄█                   
                      (418.82 µs … 5.20 ms) 822.12 µs ██                   
                    (507.66 kb …   1.59 mb) 540.60 kb ██▃▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁

gts medium (experiment)      476.57 µs/iter 439.79 µs █▂                   
                      (418.50 µs … 5.53 ms)   1.04 ms ██                   
                    (104.66 kb …   1.63 mb) 540.46 kb ██▂▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁

                             ┌                                            ┐
                             ╷┌──┬                        ╷
        gts medium (control) ├┤  │────────────────────────┤
                             ╵└──┴                        ╵
                             ╷┌──┬                                        ╷
     gts medium (experiment) ├┤  │────────────────────────────────────────┤
                             ╵└──┴                                        ╵
                             └                                            ┘
                             418.50 µs          728.58 µs           1.04 ms

summary
  gts medium (control)
   1.01x faster than gts medium (experiment)

------------------------------------------- -------------------------------
gts large (control)          190.75 µs/iter 175.02 µs  █▇                  
                      (166.26 µs … 4.97 ms) 216.76 µs  ██▂                 
                    ( 86.81 kb … 808.51 kb) 216.31 kb ▃███▅▆▅▃▂▁▁▁▁▁▁▁▁▁▁▁▁

gts large (experiment)       189.49 µs/iter 174.18 µs  ▅█                  
                      (166.32 µs … 5.14 ms) 213.85 µs  ██▄                 
                    (170.20 kb …   1.37 mb) 216.45 kb ▃███▄▄▆▄▂▁▁▁▁▁▁▁▁▁▁▁▁

                             ┌                                            ┐
                             ╷  ┌──────────────────┬                      ╷
         gts large (control) ├──┤                  │──────────────────────┤
                             ╵  └──────────────────┴                      ╵
                             ╷  ┌─────────────────┬                    ╷
      gts large (experiment) ├──┤                 │────────────────────┤
                             ╵  └─────────────────┴                    ╵
                             └                                            ┘
                             166.26 µs         191.51 µs          216.76 µs

summary
  gts large (experiment)
   1.01x faster than gts large (control)

{{action}} was removed from ember-source, so the fix the message told
people to write no longer exists. Points at (fn (mut attr) value) and
updates the docs and fixtures to match.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@NullVoxPopuli NullVoxPopuli changed the title template-no-extra-mut-helper-argument is not hbs-only template-no-extra-mut-helper-argument: applies to strict mode, and stop recommending (action) Aug 17, 2026
@evoactivity
evoactivity merged commit f236dfe into master Aug 17, 2026
10 checks passed
@evoactivity
evoactivity deleted the nvp/mut-helper-rule-is-not-hbs-only branch August 17, 2026 21:09
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.

2 participants