From 6406ed13d7a16761ebf22404aac75aac249545d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johan=20R=C3=B8ed?= Date: Mon, 13 Apr 2026 14:43:38 +0200 Subject: [PATCH 1/3] Fix template-quotes: accept boolean root config Upstream accepts [rule, false] to disable the rule; port's schema rejected it. Allow boolean root (false = disabled) in the schema and short-circuit create() when disabled. --- lib/rules/template-quotes.js | 7 ++++++- tests/lib/rules/template-quotes.js | 9 +++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/lib/rules/template-quotes.js b/lib/rules/template-quotes.js index 87b24d6ec2..a662b8592c 100644 --- a/lib/rules/template-quotes.js +++ b/lib/rules/template-quotes.js @@ -23,6 +23,10 @@ module.exports = { { oneOf: [ { enum: ['double', 'single'] }, + // `false` as the root config disables the rule, matching upstream + // ember-template-lint which accepts `[rule, false]` as a valid + // disabled state without schema errors. + { type: 'boolean', enum: [false] }, { type: 'object', required: ['curlies', 'html'], @@ -49,7 +53,8 @@ module.exports = { create(context) { const rawOption = context.options[0]; - if (rawOption === undefined) { + // Disabled when options omitted or explicitly set to `false`. + if (rawOption === undefined || rawOption === false) { return {}; } diff --git a/tests/lib/rules/template-quotes.js b/tests/lib/rules/template-quotes.js index 69b02909f6..100048db07 100644 --- a/tests/lib/rules/template-quotes.js +++ b/tests/lib/rules/template-quotes.js @@ -28,6 +28,15 @@ const validHbs = [ code: ' {{hello "test" x="test"}}', options: [{ curlies: 'double', html: 'single' }], }, + // `false` as the root config disables the rule (matches upstream). + { + code: "{{component \"test\"}} {{hello x='test'}} ", + options: [false], + }, + { + code: "{{component 'test'}} ", + options: [false], + }, ]; const invalidHbs = [ From 7e801818b4849872460d0a89d9185a86b5902d32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johan=20R=C3=B8ed?= Date: Mon, 13 Apr 2026 19:05:40 +0200 Subject: [PATCH 2/3] Fix lint: simplify disabled check to !rawOption (reduces complexity) --- lib/rules/template-quotes.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/rules/template-quotes.js b/lib/rules/template-quotes.js index a662b8592c..1a917e5f1c 100644 --- a/lib/rules/template-quotes.js +++ b/lib/rules/template-quotes.js @@ -54,7 +54,7 @@ module.exports = { const rawOption = context.options[0]; // Disabled when options omitted or explicitly set to `false`. - if (rawOption === undefined || rawOption === false) { + if (!rawOption) { return {}; } From 2f0dce968f48a5f59142b80bfb4027a371960de3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johan=20R=C3=B8ed?= Date: Mon, 13 Apr 2026 19:14:48 +0200 Subject: [PATCH 3/3] Fix lint: apply Prettier formatting to test file --- tests/lib/rules/template-quotes.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/lib/rules/template-quotes.js b/tests/lib/rules/template-quotes.js index 100048db07..9fba08c912 100644 --- a/tests/lib/rules/template-quotes.js +++ b/tests/lib/rules/template-quotes.js @@ -34,7 +34,7 @@ const validHbs = [ options: [false], }, { - code: "{{component 'test'}} ", + code: '{{component \'test\'}} ', options: [false], }, ];