From 4f80ab6da6a0bfe64c4a0d125ba0619461809ac6 Mon Sep 17 00:00:00 2001 From: Simon H <5968653+dummdidumm@users.noreply.github.com> Date: Thu, 31 Oct 2024 14:47:53 +0100 Subject: [PATCH] fix: allow `warningFilter` option for `compileModule` (#14066) fixes #14012 --- .changeset/curvy-melons-knock.md | 5 +++++ packages/svelte/src/compiler/validate-options.js | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) create mode 100644 .changeset/curvy-melons-knock.md diff --git a/.changeset/curvy-melons-knock.md b/.changeset/curvy-melons-knock.md new file mode 100644 index 000000000000..dcf158b4ee85 --- /dev/null +++ b/.changeset/curvy-melons-knock.md @@ -0,0 +1,5 @@ +--- +'svelte': patch +--- + +fix: allow `warningFilter` option for `compileModule` diff --git a/packages/svelte/src/compiler/validate-options.js b/packages/svelte/src/compiler/validate-options.js index c84fdac8a791..9465cba77a06 100644 --- a/packages/svelte/src/compiler/validate-options.js +++ b/packages/svelte/src/compiler/validate-options.js @@ -31,7 +31,9 @@ const common = { } return input; - }) + }), + + warningFilter: fun(() => true) }; export const validate_module_options = @@ -106,8 +108,6 @@ export const validate_component_options = hmr: boolean(false), - warningFilter: fun(() => true), - sourcemap: validator(undefined, (input) => { // Source maps can take on a variety of values, including string, JSON, map objects from magic-string and source-map, // so there's no good way to check type validity here