From 06e093e07b74bed146f8fecad5a42d8441d33d86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johan=20R=C3=B8ed?= Date: Sun, 12 Apr 2026 22:36:28 +0200 Subject: [PATCH] Fix template-deprecated-inline-view-helper false positive in GJS/GTS The {{view}} and view.* patterns are classic Ember only; in GJS/GTS files, `view` may be a legitimate imported JS binding or local variable. --- lib/rules/template-deprecated-inline-view-helper.js | 5 +++++ .../lib/rules/template-deprecated-inline-view-helper.js | 9 +++++++++ 2 files changed, 14 insertions(+) diff --git a/lib/rules/template-deprecated-inline-view-helper.js b/lib/rules/template-deprecated-inline-view-helper.js index 31ffdf2051..9970b2b254 100644 --- a/lib/rules/template-deprecated-inline-view-helper.js +++ b/lib/rules/template-deprecated-inline-view-helper.js @@ -23,6 +23,11 @@ module.exports = { }, create(context) { + const isStrictMode = context.filename.endsWith('.gjs') || context.filename.endsWith('.gts'); + if (isStrictMode) { + return {}; + } + const sourceCode = context.sourceCode; // Track block param names to avoid false positives on locals like: diff --git a/tests/lib/rules/template-deprecated-inline-view-helper.js b/tests/lib/rules/template-deprecated-inline-view-helper.js index 0e3a0bc646..8d47dad02b 100644 --- a/tests/lib/rules/template-deprecated-inline-view-helper.js +++ b/tests/lib/rules/template-deprecated-inline-view-helper.js @@ -30,6 +30,15 @@ ruleTester.run('template-deprecated-inline-view-helper', rule, { '', // hash pair with key "to" should not be flagged '', + // Rule is HBS-only: `view` in GJS/GTS may be a legitimate imported JS binding + { + filename: 'test.gjs', + code: "", + }, + { + filename: 'test.gts', + code: '', + }, ], invalid: [ {