From fb7118ff1c8f0dcd61f15e51b193512283d83fa1 Mon Sep 17 00:00:00 2001
From: Kristóf Marussy <kristof@marussy.com>
Date: Sun, 9 Jan 2022 22:16:29 +0100
Subject: build: Add eslint-plugin-unicorn
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Kristóf Marussy <kristof@marussy.com>
---
 packages/renderer/src/components/StoreProvider.tsx | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

(limited to 'packages/renderer/src/components/StoreProvider.tsx')

diff --git a/packages/renderer/src/components/StoreProvider.tsx b/packages/renderer/src/components/StoreProvider.tsx
index bb8495c..3360a43 100644
--- a/packages/renderer/src/components/StoreProvider.tsx
+++ b/packages/renderer/src/components/StoreProvider.tsx
@@ -22,11 +22,12 @@ import React, { createContext, useContext } from 'react';
 
 import type { RendererStore } from '../stores/RendererStore';
 
-const StoreContext = createContext<RendererStore | null>(null);
+// eslint-disable-next-line unicorn/no-useless-undefined -- `createContext` expects 1 parameter.
+const StoreContext = createContext<RendererStore | undefined>(undefined);
 
 export function useStore(): RendererStore {
   const store = useContext(StoreContext);
-  if (store === null) {
+  if (store === undefined) {
     throw new Error('useStore can only be called inside of StoreProvider');
   }
   return store;
-- 
cgit v1.2.3-70-g09d2

