Skip to content

feat(config): expose ember-source 7.1 built-in template keywords as globals#2779

Closed
aklkv wants to merge 1 commit into
ember-cli:masterfrom
aklkv:feat/ember-7.1-builtin-keywords-globals
Closed

feat(config): expose ember-source 7.1 built-in template keywords as globals#2779
aklkv wants to merge 1 commit into
ember-cli:masterfrom
aklkv:feat/ember-7.1-builtin-keywords-globals

Conversation

@aklkv
Copy link
Copy Markdown

@aklkv aklkv commented May 14, 2026

ember-source 7.1.0 makes 14 helpers/modifiers (and, array, element, eq, fn, gt, gte, hash, lt, lte, neq, not, on, or — RFCs 389, 470, 560, 561, 562, 997, 998, 999, 1000) available in strict-mode templates without an explicit import.

ESLint's no-undef rule was therefore flagging them as undefined when consumers turned off no-implicit-this etc. on .gjs/.gts files. Add the keywords to the shared base flat-config block so they are recognised as readonly globals on **/*.{gts,gjs}.

The block is gated on the consumer's installed ember-source version so that pre-7.1 projects keep the existing behaviour. Mirrors Glint's KeywordsForEmber71 gate (typed-ember/glint#1109).

…lobals

ember-source 7.1.0 makes 14 helpers/modifiers (and, array, element, eq,
fn, gt, gte, hash, lt, lte, neq, not, on, or — RFCs 389, 470, 560, 561,
562, 997, 998, 999, 1000) available in strict-mode templates without an
explicit import.

ESLint's no-undef rule was therefore flagging them as undefined when
consumers turned off no-implicit-this etc. on .gjs/.gts files. Add the
keywords to both the modern flat-config exports (lib/recommended.mjs's
`gjs` and `gts` configs, used via `eslint-plugin-ember/recommended`) and
the legacy-style `./configs/base` entry in lib/config/base.js so they
are recognised as readonly globals on .gjs/.gts.

Detection is gated on the consumer's installed ember-source version via
a shared `getEmber71BuiltInKeywords()` helper (lib/utils/ember71-built-
in-keywords.js) so pre-7.1 projects keep their existing behaviour.
Mirrors Glint's KeywordsForEmber71 gate (typed-ember/glint#1109).
@aklkv aklkv force-pushed the feat/ember-7.1-builtin-keywords-globals branch from 2ddf24c to e631e65 Compare May 14, 2026 22:06
@aklkv
Copy link
Copy Markdown
Author

aklkv commented May 15, 2026

maybe this is not the most correct place to define this so I have alternative PR for parser itself: ember-tooling/ember-eslint-parser#211

@aklkv
Copy link
Copy Markdown
Author

aklkv commented May 15, 2026

superseded by ember-tooling/ember-eslint-parser#211

@aklkv aklkv closed this May 15, 2026
@aklkv aklkv deleted the feat/ember-7.1-builtin-keywords-globals branch May 15, 2026 20:55
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.

1 participant