Add no-legacy-helper-imports rule for Ember 7.1+ with safe autofix#2820
Open
NullVoxPopuli with Copilot wants to merge 3 commits into
Open
Add no-legacy-helper-imports rule for Ember 7.1+ with safe autofix#2820NullVoxPopuli with Copilot wants to merge 3 commits into
no-legacy-helper-imports rule for Ember 7.1+ with safe autofix#2820NullVoxPopuli with Copilot wants to merge 3 commits into
Conversation
Copilot
AI
changed the title
[WIP] Lint against imports from ember-element-helper and ember-truth-helpers
Add Jul 1, 2026
no-legacy-helper-imports rule for Ember 7.1+ with safe autofix
…itives
The initial implementation reported any import from @ember/helper /
@ember/modifier (including non-superseded exports like `helper` and
`setModifierManager`) and its autofix removed imports whose bindings were
used in plain JavaScript, where the Ember 7.1 built-in template keywords
do not exist — producing broken code.
Now the rule:
- only reports imports that bind a specifier superseded by an Ember 7.1
built-in template keyword (eq, neq, not, and, or, gt, gte, lt, lte,
element, array, hash, fn, on)
- only autofixes when every reference to the binding is inside a
<template> tag (Glimmer scope references from ember-eslint-parser),
renaming usages to the keyword name where it differs (notEq -> neq,
aliased locals, default imports)
- partially fixes mixed imports, keeping non-superseded specifiers
(import { fn, helper } from '@ember/helper' -> import { helper } ...)
- bails on renames whenever the keyword name is shadowed by a binding in
any scope enclosing the usage, not just at module scope
- skips type-only imports and preserves kept specifiers verbatim
Tests now run against ember-eslint-parser with real gjs templates and
cover the < 7.1 version gate.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Contributor
🏎️ Benchmark Comparison
Full mitata output |
NullVoxPopuli
approved these changes
Jul 2, 2026
This was referenced Jul 6, 2026
Draft
Draft
This was referenced Jul 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Ember 7.1+ provides built-in equivalents for helpers/modifiers commonly imported from
ember-truth-helpers,ember-element-helper, and parts of@ember/helper/@ember/modifier. This PR adds a dedicated lint rule to flag those legacy imports and autofix them when alias/name conflicts are not introduced.New rule:
ember/no-legacy-helper-importsember-truth-helpers(and helper subpaths)ember-element-helper(and helper subpath)@ember/helper(array,hash,fn)@ember/modifier(on)ember-source >= 7.1.Autofix behavior
notEq→neq, aliasedelement_→element).Docs and rule surface
README.md.