From 7a06d44111891c4def10e8ebcc04f2b1f5639f1c Mon Sep 17 00:00:00 2001 From: NullVoxPopuli <199018+NullVoxPopuli@users.noreply.github.com> Date: Fri, 24 Apr 2026 14:25:48 -0400 Subject: [PATCH 1/3] Upgrade ember-eslint-parser to v0.11 --- package.json | 2 +- pnpm-lock.yaml | 36 ++++++++++++++++++++---------------- 2 files changed, 21 insertions(+), 17 deletions(-) diff --git a/package.json b/package.json index 6f573da64b..e8d5f16bd0 100644 --- a/package.json +++ b/package.json @@ -66,7 +66,7 @@ "aria-query": "^5.3.2", "css-tree": "^3.0.1", "editorconfig": "^3.0.2", - "ember-eslint-parser": "^0.10.0", + "ember-eslint-parser": "^0.11.0", "ember-rfc176-data": "^0.3.18", "eslint-utils": "^3.0.0", "estraverse": "^5.3.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 02f7d84094..29653dea70 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -21,8 +21,8 @@ importers: specifier: ^3.0.2 version: 3.0.2 ember-eslint-parser: - specifier: ^0.10.0 - version: 0.10.0(@typescript-eslint/parser@8.58.2(eslint@8.57.1)(typescript@5.9.3))(typescript@5.9.3) + specifier: ^0.11.0 + version: 0.11.0(@typescript-eslint/parser@8.58.2(eslint@8.57.1)(typescript@5.9.3))(typescript@5.9.3) ember-rfc176-data: specifier: ^0.3.18 version: 0.3.18 @@ -1175,6 +1175,12 @@ packages: peerDependencies: typescript: '>=4.8.4 <6.1.0' + '@typescript-eslint/tsconfig-utils@8.59.0': + resolution: {integrity: sha512-91Sbl3s4Kb3SybliIY6muFBmHVv+pYXfybC4Oolp3dvk8BvIE3wOPc+403CWIT7mJNkfQRGtdqghzs2+Z91Tqg==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + peerDependencies: + typescript: '>=4.8.4 <6.1.0' + '@typescript-eslint/type-utils@8.58.2': resolution: {integrity: sha512-Z7EloNR/B389FvabdGeTo2XMs4W9TjtPiO9DAsmT0yom0bwlPyRjkJ1uCdW1DvrrrYP50AJZ9Xc3sByZA9+dcg==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} @@ -1733,8 +1739,8 @@ packages: electron-to-chromium@1.5.340: resolution: {integrity: sha512-908qahOGocRMinT2nM3ajCEM99H4iPdv84eagPP3FfZy/1ZGeOy2CZYzjhms81ckOPCXPlW7LkY4XpxD8r1DrA==} - ember-eslint-parser@0.10.0: - resolution: {integrity: sha512-oq37TDYDBqR4fTGhJy/Yecw5VHlPJrSCd26KkwCKlhzAHMCzac+/HSln99COihKei2mMaaob17IrV3I9XL83YQ==} + ember-eslint-parser@0.11.0: + resolution: {integrity: sha512-c/Rin7rfkb/auLp8oclVamHbMtGx/uKUfK9Aggpk97u8kaLm/5e4kCDSPaFrn9AQ4P+jnBiTw/Mr0nT9oR72Ug==} engines: {node: '>=16.0.0'} peerDependencies: '@typescript-eslint/parser': '*' @@ -1742,8 +1748,8 @@ packages: '@typescript-eslint/parser': optional: true - ember-estree@0.4.2: - resolution: {integrity: sha512-Runf+IVY+hUhlk0QwwljhPYj0/kjza5CCRp/Hlfdk9MawKSxXQqR0WX4f2rChXAGbDIzK7JVopVaet5oIZr8tg==} + ember-estree@0.6.2: + resolution: {integrity: sha512-CeKa6FZ95jp6de+vjhmv2XmOGBB2V95iiH7RqI2av1nU0m1XhFZEG8npoEciklQqPEzFO5OXS41b0mGvXBsJCA==} ember-rfc176-data@0.3.18: resolution: {integrity: sha512-JtuLoYGSjay1W3MQAxt3eINWXNYYQliK90tLwtb8aeCuQK8zKGCRbBodVIrkcTqshULMnRuTOS6t1P7oQk3g6Q==} @@ -4197,9 +4203,6 @@ packages: resolution: {integrity: sha512-YnOmtSbv4MTf7RGJMK0FvZ+KD8OEe/J5BNnR0GHhD8J/XcG/Qvxgszm0Un6FTHWW4uHlTgP0IztiXQnGyIR45g==} engines: {node: '>=8'} - zimmerframe@1.1.4: - resolution: {integrity: sha512-B58NGBEoc8Y9MWWCQGl/gq9xBCe4IiKM0a2x7GZdQKOW5Exr8S1W24J6OgM1njK8xCRGvAJIL/MxXHf6SkmQKQ==} - snapshots: '@ampproject/remapping@2.3.0': @@ -5068,6 +5071,10 @@ snapshots: dependencies: typescript: 5.9.3 + '@typescript-eslint/tsconfig-utils@8.59.0(typescript@5.9.3)': + dependencies: + typescript: 5.9.3 + '@typescript-eslint/type-utils@8.58.2(eslint@8.57.1)(typescript@5.9.3)': dependencies: '@typescript-eslint/types': 8.58.2 @@ -5662,12 +5669,12 @@ snapshots: electron-to-chromium@1.5.340: {} - ember-eslint-parser@0.10.0(@typescript-eslint/parser@8.58.2(eslint@8.57.1)(typescript@5.9.3))(typescript@5.9.3): + ember-eslint-parser@0.11.0(@typescript-eslint/parser@8.58.2(eslint@8.57.1)(typescript@5.9.3))(typescript@5.9.3): dependencies: '@glimmer/syntax': 0.95.0 - '@typescript-eslint/tsconfig-utils': 8.58.2(typescript@5.9.3) + '@typescript-eslint/tsconfig-utils': 8.59.0(typescript@5.9.3) content-tag: 4.1.1 - ember-estree: 0.4.2 + ember-estree: 0.6.2 eslint-scope: 9.1.2 html-tags: 5.1.0 mathml-tag-names: 4.0.0 @@ -5679,13 +5686,12 @@ snapshots: - '@emnapi/runtime' - typescript - ember-estree@0.4.2: + ember-estree@0.6.2: dependencies: '@glimmer/env': 0.1.7 '@glimmer/syntax': 0.95.0 content-tag: 4.1.1 oxc-parser: 0.119.0 - zimmerframe: 1.1.4 transitivePeerDependencies: - '@emnapi/core' - '@emnapi/runtime' @@ -8549,5 +8555,3 @@ snapshots: yoga-layout-prebuilt@1.10.0: dependencies: '@types/yoga-layout': 1.9.2 - - zimmerframe@1.1.4: {} From 7676bb3565892d631c685fae9c8be7d9641e160d Mon Sep 17 00:00:00 2001 From: NullVoxPopuli <199018+NullVoxPopuli@users.noreply.github.com> Date: Fri, 24 Apr 2026 14:26:45 -0400 Subject: [PATCH 2/3] Revert "Upgrade ember-eslint-parser to v0.11" This reverts commit 7a06d44111891c4def10e8ebcc04f2b1f5639f1c. --- package.json | 2 +- pnpm-lock.yaml | 36 ++++++++++++++++-------------------- 2 files changed, 17 insertions(+), 21 deletions(-) diff --git a/package.json b/package.json index e8d5f16bd0..6f573da64b 100644 --- a/package.json +++ b/package.json @@ -66,7 +66,7 @@ "aria-query": "^5.3.2", "css-tree": "^3.0.1", "editorconfig": "^3.0.2", - "ember-eslint-parser": "^0.11.0", + "ember-eslint-parser": "^0.10.0", "ember-rfc176-data": "^0.3.18", "eslint-utils": "^3.0.0", "estraverse": "^5.3.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 29653dea70..02f7d84094 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -21,8 +21,8 @@ importers: specifier: ^3.0.2 version: 3.0.2 ember-eslint-parser: - specifier: ^0.11.0 - version: 0.11.0(@typescript-eslint/parser@8.58.2(eslint@8.57.1)(typescript@5.9.3))(typescript@5.9.3) + specifier: ^0.10.0 + version: 0.10.0(@typescript-eslint/parser@8.58.2(eslint@8.57.1)(typescript@5.9.3))(typescript@5.9.3) ember-rfc176-data: specifier: ^0.3.18 version: 0.3.18 @@ -1175,12 +1175,6 @@ packages: peerDependencies: typescript: '>=4.8.4 <6.1.0' - '@typescript-eslint/tsconfig-utils@8.59.0': - resolution: {integrity: sha512-91Sbl3s4Kb3SybliIY6muFBmHVv+pYXfybC4Oolp3dvk8BvIE3wOPc+403CWIT7mJNkfQRGtdqghzs2+Z91Tqg==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - peerDependencies: - typescript: '>=4.8.4 <6.1.0' - '@typescript-eslint/type-utils@8.58.2': resolution: {integrity: sha512-Z7EloNR/B389FvabdGeTo2XMs4W9TjtPiO9DAsmT0yom0bwlPyRjkJ1uCdW1DvrrrYP50AJZ9Xc3sByZA9+dcg==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} @@ -1739,8 +1733,8 @@ packages: electron-to-chromium@1.5.340: resolution: {integrity: sha512-908qahOGocRMinT2nM3ajCEM99H4iPdv84eagPP3FfZy/1ZGeOy2CZYzjhms81ckOPCXPlW7LkY4XpxD8r1DrA==} - ember-eslint-parser@0.11.0: - resolution: {integrity: sha512-c/Rin7rfkb/auLp8oclVamHbMtGx/uKUfK9Aggpk97u8kaLm/5e4kCDSPaFrn9AQ4P+jnBiTw/Mr0nT9oR72Ug==} + ember-eslint-parser@0.10.0: + resolution: {integrity: sha512-oq37TDYDBqR4fTGhJy/Yecw5VHlPJrSCd26KkwCKlhzAHMCzac+/HSln99COihKei2mMaaob17IrV3I9XL83YQ==} engines: {node: '>=16.0.0'} peerDependencies: '@typescript-eslint/parser': '*' @@ -1748,8 +1742,8 @@ packages: '@typescript-eslint/parser': optional: true - ember-estree@0.6.2: - resolution: {integrity: sha512-CeKa6FZ95jp6de+vjhmv2XmOGBB2V95iiH7RqI2av1nU0m1XhFZEG8npoEciklQqPEzFO5OXS41b0mGvXBsJCA==} + ember-estree@0.4.2: + resolution: {integrity: sha512-Runf+IVY+hUhlk0QwwljhPYj0/kjza5CCRp/Hlfdk9MawKSxXQqR0WX4f2rChXAGbDIzK7JVopVaet5oIZr8tg==} ember-rfc176-data@0.3.18: resolution: {integrity: sha512-JtuLoYGSjay1W3MQAxt3eINWXNYYQliK90tLwtb8aeCuQK8zKGCRbBodVIrkcTqshULMnRuTOS6t1P7oQk3g6Q==} @@ -4203,6 +4197,9 @@ packages: resolution: {integrity: sha512-YnOmtSbv4MTf7RGJMK0FvZ+KD8OEe/J5BNnR0GHhD8J/XcG/Qvxgszm0Un6FTHWW4uHlTgP0IztiXQnGyIR45g==} engines: {node: '>=8'} + zimmerframe@1.1.4: + resolution: {integrity: sha512-B58NGBEoc8Y9MWWCQGl/gq9xBCe4IiKM0a2x7GZdQKOW5Exr8S1W24J6OgM1njK8xCRGvAJIL/MxXHf6SkmQKQ==} + snapshots: '@ampproject/remapping@2.3.0': @@ -5071,10 +5068,6 @@ snapshots: dependencies: typescript: 5.9.3 - '@typescript-eslint/tsconfig-utils@8.59.0(typescript@5.9.3)': - dependencies: - typescript: 5.9.3 - '@typescript-eslint/type-utils@8.58.2(eslint@8.57.1)(typescript@5.9.3)': dependencies: '@typescript-eslint/types': 8.58.2 @@ -5669,12 +5662,12 @@ snapshots: electron-to-chromium@1.5.340: {} - ember-eslint-parser@0.11.0(@typescript-eslint/parser@8.58.2(eslint@8.57.1)(typescript@5.9.3))(typescript@5.9.3): + ember-eslint-parser@0.10.0(@typescript-eslint/parser@8.58.2(eslint@8.57.1)(typescript@5.9.3))(typescript@5.9.3): dependencies: '@glimmer/syntax': 0.95.0 - '@typescript-eslint/tsconfig-utils': 8.59.0(typescript@5.9.3) + '@typescript-eslint/tsconfig-utils': 8.58.2(typescript@5.9.3) content-tag: 4.1.1 - ember-estree: 0.6.2 + ember-estree: 0.4.2 eslint-scope: 9.1.2 html-tags: 5.1.0 mathml-tag-names: 4.0.0 @@ -5686,12 +5679,13 @@ snapshots: - '@emnapi/runtime' - typescript - ember-estree@0.6.2: + ember-estree@0.4.2: dependencies: '@glimmer/env': 0.1.7 '@glimmer/syntax': 0.95.0 content-tag: 4.1.1 oxc-parser: 0.119.0 + zimmerframe: 1.1.4 transitivePeerDependencies: - '@emnapi/core' - '@emnapi/runtime' @@ -8555,3 +8549,5 @@ snapshots: yoga-layout-prebuilt@1.10.0: dependencies: '@types/yoga-layout': 1.9.2 + + zimmerframe@1.1.4: {} From 703bf15f9d7ee3fee4861da46b1f5ba03b00287e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johan=20R=C3=B8ed?= Date: Fri, 24 Apr 2026 21:11:24 +0200 Subject: [PATCH 3/3] fix: ignore comment + whitespace nodes in template-no-yield-only MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The rule flagged yield-only templates by asserting `templateNodes.length === 1 && isYieldOnly(templateNodes[0])`. That works only while the parser strips template comments out of the body, which ember-estree 0.4.2 happened to do. Upstream ember-estree 0.4.3 (#31) began keeping MustacheCommentStatement nodes in the body, so a template like now yields a body of length 2 and silently stops being flagged — which is also why PR #2735 (upgrade to ember-eslint-parser 0.11) fails this rule's CI. Ignoring comment and whitespace-only text nodes before the length check aligns with: - upstream ember-template-lint's `no-yield-only.js` (unchanged there since comments-in-body is the native Glimmer AST shape anyway) - the sibling rule `template-no-bare-yield.js`, which already uses the same `isEmptyNode` filter The fix is a no-op on the currently-pinned ember-eslint-parser@0.10 and fixes the rule under any parser version that preserves comment nodes in the template body. The rule also now correctly catches yield-only templates that contain HTML comments (`{{yield}}`), which it was silently missing before. --- lib/rules/template-no-yield-only.js | 11 ++++++++++- tests/lib/rules/template-no-yield-only.js | 10 ++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/lib/rules/template-no-yield-only.js b/lib/rules/template-no-yield-only.js index 76d859be8d..b4b423b662 100644 --- a/lib/rules/template-no-yield-only.js +++ b/lib/rules/template-no-yield-only.js @@ -1,3 +1,11 @@ +function isEmptyNode(node) { + return ( + node.type === 'GlimmerMustacheCommentStatement' || + node.type === 'GlimmerCommentStatement' || + (node.type === 'GlimmerTextNode' && !node.chars.trim()) + ); +} + function isYieldOnly(node) { return ( node.type === 'GlimmerMustacheStatement' && @@ -44,7 +52,8 @@ module.exports = { ? node.body[0].children : node.body; - if (templateNodes.length === 1 && isYieldOnly(templateNodes[0])) { + const nonEmptyNodes = templateNodes.filter((n) => !isEmptyNode(n)); + if (nonEmptyNodes.length === 1 && isYieldOnly(nonEmptyNodes[0])) { isOnlyYield = true; } }, diff --git a/tests/lib/rules/template-no-yield-only.js b/tests/lib/rules/template-no-yield-only.js index 9129c00828..cfb3fc9797 100644 --- a/tests/lib/rules/template-no-yield-only.js +++ b/tests/lib/rules/template-no-yield-only.js @@ -30,6 +30,16 @@ const invalidHbs = [ output: null, errors: [{ messageId: 'noYieldOnly' }], }, + { + code: '{{!-- long-form comment --}}{{yield}}', + output: null, + errors: [{ messageId: 'noYieldOnly' }], + }, + { + code: '{{yield}}', + output: null, + errors: [{ messageId: 'noYieldOnly' }], + }, ]; function wrapTemplate(entry) {