feat(config): expose ember-source 7.1 built-in template keywords as globals#2779
Closed
aklkv wants to merge 1 commit into
Closed
feat(config): expose ember-source 7.1 built-in template keywords as globals#2779aklkv wants to merge 1 commit into
aklkv wants to merge 1 commit into
Conversation
…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).
2ddf24c to
e631e65
Compare
Author
|
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 |
Author
|
superseded by ember-tooling/ember-eslint-parser#211 |
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-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).