From 6e4cdc52a6323a838c8f7b4e00c9be28354902d2 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Mon, 12 Apr 2021 14:28:09 +1000 Subject: [PATCH] stop Svelte warnings from failing the build + check for them at test time --- ts/graphs/GraphsPage.svelte | 1 - ts/graphs/HistogramGraph.svelte | 1 - ts/svelte/svelte.bzl | 2 ++ ts/svelte/svelte.ts | 1 - 4 files changed, 2 insertions(+), 3 deletions(-) diff --git a/ts/graphs/GraphsPage.svelte b/ts/graphs/GraphsPage.svelte index 51443613e..f83dfdb72 100644 --- a/ts/graphs/GraphsPage.svelte +++ b/ts/graphs/GraphsPage.svelte @@ -8,7 +8,6 @@ import WithGraphData from "./WithGraphData.svelte"; - import * as tr from "anki/i18n"; export let nightMode: boolean; export let graphs: SvelteComponent[]; diff --git a/ts/graphs/HistogramGraph.svelte b/ts/graphs/HistogramGraph.svelte index 1fe957ba0..af115d3da 100644 --- a/ts/graphs/HistogramGraph.svelte +++ b/ts/graphs/HistogramGraph.svelte @@ -9,7 +9,6 @@ import { defaultGraphBounds } from "./graph-helpers"; export let data: HistogramData | null = null; - import * as tr from "anki/i18n"; let bounds = defaultGraphBounds(); let svg = null as HTMLElement | SVGElement | null; diff --git a/ts/svelte/svelte.bzl b/ts/svelte/svelte.bzl index 894a1097d..9744be58e 100644 --- a/ts/svelte/svelte.bzl +++ b/ts/svelte/svelte.bzl @@ -64,6 +64,8 @@ def svelte_check(name = "svelte_check", srcs = []): args = [ "--workspace", native.package_name(), + "--fail-on-warnings", + "--fail-on-hints", ], data = [ "//ts:tsconfig.json", diff --git a/ts/svelte/svelte.ts b/ts/svelte/svelte.ts index b15de386a..a50023ffb 100644 --- a/ts/svelte/svelte.ts +++ b/ts/svelte/svelte.ts @@ -158,7 +158,6 @@ async function writeJs( // warnings are an error if (result.warnings.length > 0) { console.log(`warnings during compile: ${result.warnings}`); - return; } // write out the css file const outputCss = result.css.code ?? "";