From 462472a5931d032f531244135369be6ecf57cc16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A1n=20Mugnolo?= Date: Wed, 8 Jul 2026 11:08:56 -0300 Subject: [PATCH] Linter: Allow `application/ld+json` for `html-allowed-script-type` rule --- .../docs/rules/html-allowed-script-type.md | 21 ++++++++++++++++++- .../src/rules/html-allowed-script-type.ts | 2 +- .../rules/html-allowed-script-type.test.ts | 6 +++++- 3 files changed, 26 insertions(+), 3 deletions(-) diff --git a/javascript/packages/linter/docs/rules/html-allowed-script-type.md b/javascript/packages/linter/docs/rules/html-allowed-script-type.md index 13e79991e..3e3f56e9d 100644 --- a/javascript/packages/linter/docs/rules/html-allowed-script-type.md +++ b/javascript/packages/linter/docs/rules/html-allowed-script-type.md @@ -4,7 +4,7 @@ ## Description -Restricts which `type` attribute values are permitted on ` ``` +```erb + +``` + ### 🚫 Bad ```erb @@ -42,6 +54,12 @@ By restricting the allowed `type` values and requiring the `type` attribute to b ``` +```erb + +``` + ```erb ') }) + test("passes when type is application/ld+json", () => { + expectNoOffenses('') + }) + test("passes for script tag with ERB in type attribute", () => { expectNoOffenses('') }) test("fails when type is not allowed", () => { - expectError('Avoid using `text/yavascript` as the `type` attribute for the `') })