From f0eb75f115209b832d124fe1ec98cddad73272ab Mon Sep 17 00:00:00 2001 From: Vitaly Date: Wed, 27 Sep 2023 22:42:33 +0300 Subject: [PATCH] add comma spacing rule, fix new stat hiding --- .eslintrc.json | 1 + src/rightTopStats.ts | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.eslintrc.json b/.eslintrc.json index 12a50e94..05983c70 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -13,6 +13,7 @@ "error", "always" ], + "comma-spacing": "error", "semi": [ "error", "never" diff --git a/src/rightTopStats.ts b/src/rightTopStats.ts index 6ca5fbaa..6fdd54ce 100644 --- a/src/rightTopStats.ts +++ b/src/rightTopStats.ts @@ -20,13 +20,15 @@ addStat(stats.dom) addStat(stats2.dom) addStat(statsGl.container) -if (localStorage.hideStats || isCypress()) { +const hideStats = localStorage.hideStats || isCypress() +if (hideStats) { stats.dom.style.display = 'none' stats2.dom.style.display = 'none' statsGl.container.style.display = 'none' } export const initWithRenderer = (canvas) => { + if (hideStats) return statsGl.init(canvas) statsGl.container.style.display = 'flex' statsGl.container.style.justifyContent = 'flex-end'