Repository navigation
Add an emberSourceVersion parser option - #267
Merged
NullVoxPopuli merged 1 commit intoOct 22, 2026
Merged
Conversation
The parser treats the Ember 7.1 built-in template keywords (`eq`, `and`, `on` and the rest) as defined only when it can resolve `ember-source` 7.1 or newer from its own install location. Projects that lint without `ember-source` installed get a `no-undef` error for every bare keyword, and they have no way to tell the parser which Ember they run on. Discourse plugins and themes are an example: they run inside Discourse, but their repos don't install `ember-source`. - `parserOptions.emberSourceVersion` sets the version to use. When it's set, the parser uses it instead of looking for `ember-source`. - New tests cover the option when `ember-source` can't be found, and the option winning over a newer installed version. - The README has a short section on the built-in keywords and the new option.
davidtaylorhq
added a commit
to discourse/lint-configs
that referenced
this pull request
Oct 22, 2026
Ember 7.1 made `and`, `or`, `not`, `eq`, `neq`, `gt`, `gte`, `lt` and `lte` built-in template keywords, so `.gjs` and `.gts` templates no longer need to import them from `discourse/truth-helpers`. This rule reports those imports, and its autofix deletes them. - `notEq` becomes the `neq` keyword, and an aliased import such as `or as either` goes back to its keyword name. The autofix renames the template uses to match. - Truth helpers that have no keyword, such as `has` and `includes`, stay imported. - The old `truth-helpers` import path is handled too. - `fixImport` now removes the whole declaration when no imports are left in it, instead of writing `import from "…"`. - `ember-source` is a temporary dev dependency. `ember-eslint-parser` only treats the keywords as defined when it can find `ember-source` 7.1 or newer, so without it `no-undef` flags the bare `or` that the autofix leaves in the test fixture. Plugin and theme repos that don't install `ember-source` will see the same errors. Both go away once ember-tooling/ember-eslint-parser#267 is released and this config sets its `emberSourceVersion` option. Bumps the package to 3.9.0.
Contributor
🏎️ Benchmark ComparisonParse
Full mitata output
Full mitata output |
NullVoxPopuli
approved these changes
Oct 22, 2026
Merged
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.
The parser treats the Ember 7.1 built-in template keywords (
eq,and,onand the rest) as defined only when it can resolveember-source7.1 or newer from its own install location. Projects that lint withoutember-sourceinstalled get ano-undeferror for every bare keyword, and they have no way to tell the parser which Ember they run on. Discourse plugins and themes are an example: they run inside Discourse, but their repos don't installember-source.parserOptions.emberSourceVersionsets the version to use. When it's set, the parser uses it instead of looking forember-source.ember-sourcecan't be found, and the option winning over a newer installed version.