From 519a05719ca5c4baf11153f8a8f70fb8a7a85482 Mon Sep 17 00:00:00 2001 From: Saihajpreet Singh Date: Sat, 26 Dec 2020 21:18:42 -0600 Subject: [PATCH] build: disable TS no shadow rule Suggested in PR review https://github.com/shabados/mobile/pull/96#discussion_r549047233 Co-Authored-By: Harjot Singh --- .eslintrc | 4 +++- src/hooks/use-toggle.ts | 1 - 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.eslintrc b/.eslintrc index 3b868ffb..3914cc92 100644 --- a/.eslintrc +++ b/.eslintrc @@ -154,6 +154,8 @@ { "newlines-between": "always" } - ] + ], + // For readability purposes it can be useful if not abused + "@typescript-eslint/no-shadow": "off" } } diff --git a/src/hooks/use-toggle.ts b/src/hooks/use-toggle.ts index 5b6d8b9a..023dddde 100644 --- a/src/hooks/use-toggle.ts +++ b/src/hooks/use-toggle.ts @@ -2,7 +2,6 @@ import { useCallback, useState } from 'react' const useToggle = ( initialState = false ) => { const [ state, setState ] = useState( initialState ) - // eslint-disable-next-line @typescript-eslint/no-shadow const toggle = useCallback( () => setState( ( state ) => !state ), [] ) return { state, toggle } }