From 8b5cbbdb5a2202ec7370804fa30fbc7d72f11f16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20Maisse?= Date: Tue, 17 Dec 2019 20:30:04 +0100 Subject: [PATCH 01/11] refactor: remove no more used Status component It looks like this component and related color map are not used anymore since bdbd1534e9bd9c3b55a3a71ff57f03b43a2d7e3b --- addons/a11y/src/components/Report/Rules.tsx | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/addons/a11y/src/components/Report/Rules.tsx b/addons/a11y/src/components/Report/Rules.tsx index 48fe2dd924aa..b8f1e55dd2ab 100644 --- a/addons/a11y/src/components/Report/Rules.tsx +++ b/addons/a11y/src/components/Report/Rules.tsx @@ -5,14 +5,6 @@ import { CheckResult } from 'axe-core'; import { SizeMe } from 'react-sizeme'; import { RuleType } from '../A11YPanel'; -const impactColors = { - minor: '#f1c40f', - moderate: '#e67e22', - serious: '#e74c3c', - critical: '#c0392b', - success: '#2ecc71', -}; - const List = styled.div({ display: 'flex', flexDirection: 'column', @@ -45,17 +37,6 @@ const Message = styled.div({ paddingRight: 23, }); -const Status = styled.div(({ passes, impact }: { passes: boolean; impact: string }) => ({ - display: 'inline-flex', - justifyContent: 'center', - alignItems: 'center', - color: passes ? impactColors.success : (impactColors as any)[impact], - '& > svg': { - height: 16, - width: 16, - }, -})); - export enum ImpactValue { MINOR = 'minor', MODERATE = 'moderate', From 5250285dd86c000af2b98258086e960cac88e46d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20Maisse?= Date: Tue, 17 Dec 2019 20:38:36 +0100 Subject: [PATCH 02/11] refactor(a11y): activate noUnusedLocals TS compiler option Activate noUnusedLocals and remove all unneeded imports --- addons/a11y/src/components/Report/Rules.tsx | 3 +-- addons/a11y/src/components/Tabs.tsx | 2 +- addons/a11y/tsconfig.json | 3 ++- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/addons/a11y/src/components/Report/Rules.tsx b/addons/a11y/src/components/Report/Rules.tsx index b8f1e55dd2ab..de4edb845f4e 100644 --- a/addons/a11y/src/components/Report/Rules.tsx +++ b/addons/a11y/src/components/Report/Rules.tsx @@ -1,9 +1,8 @@ import React, { FunctionComponent } from 'react'; import { styled } from '@storybook/theming'; -import { Badge, Icons } from '@storybook/components'; +import { Badge } from '@storybook/components'; import { CheckResult } from 'axe-core'; import { SizeMe } from 'react-sizeme'; -import { RuleType } from '../A11YPanel'; const List = styled.div({ display: 'flex', diff --git a/addons/a11y/src/components/Tabs.tsx b/addons/a11y/src/components/Tabs.tsx index 26b6febaa040..ed524cac96bd 100644 --- a/addons/a11y/src/components/Tabs.tsx +++ b/addons/a11y/src/components/Tabs.tsx @@ -1,6 +1,6 @@ import React, { Component, SyntheticEvent } from 'react'; -import { styled, themes } from '@storybook/theming'; +import { styled } from '@storybook/theming'; import { NodeResult, Result } from 'axe-core'; import { SizeMe } from 'react-sizeme'; import store, { clearElements } from '../redux-config'; diff --git a/addons/a11y/tsconfig.json b/addons/a11y/tsconfig.json index 8876bb6737a1..ded5ed004136 100644 --- a/addons/a11y/tsconfig.json +++ b/addons/a11y/tsconfig.json @@ -2,7 +2,8 @@ "extends": "../../tsconfig.json", "compilerOptions": { "rootDir": "./src", - "types": ["webpack-env"] + "types": ["webpack-env"], + "noUnusedLocals": true }, "include": [ "src/**/*" From e923b134352989ce28f5b2503ab4495902c27898 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20Maisse?= Date: Tue, 17 Dec 2019 20:42:58 +0100 Subject: [PATCH 03/11] refactor(a11y): activate forceConsistentCasingInFileNames TS compiler option --- addons/a11y/tsconfig.json | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/a11y/tsconfig.json b/addons/a11y/tsconfig.json index ded5ed004136..44df0a409c59 100644 --- a/addons/a11y/tsconfig.json +++ b/addons/a11y/tsconfig.json @@ -3,6 +3,7 @@ "compilerOptions": { "rootDir": "./src", "types": ["webpack-env"], + "forceConsistentCasingInFileNames": true, "noUnusedLocals": true }, "include": [ From 09f0b7450ca27360f5ba855f202332a83b936baa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20Maisse?= Date: Tue, 17 Dec 2019 20:44:37 +0100 Subject: [PATCH 04/11] refactor(a11y): activate noImplicitReturns TS compiler option --- addons/a11y/tsconfig.json | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/a11y/tsconfig.json b/addons/a11y/tsconfig.json index 44df0a409c59..3b1fac072341 100644 --- a/addons/a11y/tsconfig.json +++ b/addons/a11y/tsconfig.json @@ -4,6 +4,7 @@ "rootDir": "./src", "types": ["webpack-env"], "forceConsistentCasingInFileNames": true, + "noImplicitReturns": true, "noUnusedLocals": true }, "include": [ From 73ca763bfae383d2e000db09021cd0e1822e5869 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20Maisse?= Date: Tue, 17 Dec 2019 21:24:25 +0100 Subject: [PATCH 05/11] refactor(a11y): activate strictFunctionTypes TS compiler option Activate strictFunctionTypes and fix TS errors related to it --- addons/a11y/src/components/A11YPanel.tsx | 8 +++++--- addons/a11y/src/components/ColorBlindness.tsx | 4 ++-- addons/a11y/src/components/Report/Rules.tsx | 2 +- addons/a11y/src/components/Tabs.tsx | 6 +++--- addons/a11y/tsconfig.json | 3 ++- 5 files changed, 13 insertions(+), 10 deletions(-) diff --git a/addons/a11y/src/components/A11YPanel.tsx b/addons/a11y/src/components/A11YPanel.tsx index a2d7a7fc73d8..d3b69244915e 100644 --- a/addons/a11y/src/components/A11YPanel.tsx +++ b/addons/a11y/src/components/A11YPanel.tsx @@ -1,4 +1,4 @@ -import React, { Component, Fragment } from 'react'; +import React, { Component, Fragment, ComponentProps } from 'react'; import { styled } from '@storybook/theming'; @@ -20,13 +20,15 @@ export enum RuleType { INCOMPLETION, } -const Icon = styled(Icons)( +type IconProps = ComponentProps & { status?: string; inline?: boolean }; + +const Icon = styled(Icons)( { height: 12, width: 12, marginRight: 4, }, - ({ status, theme }: any) => + ({ status, theme }) => status === 'running' ? { animation: `${theme.animation.rotate360} 1s linear infinite;`, diff --git a/addons/a11y/src/components/ColorBlindness.tsx b/addons/a11y/src/components/ColorBlindness.tsx index 35edc2bd15c4..21b142543996 100644 --- a/addons/a11y/src/components/ColorBlindness.tsx +++ b/addons/a11y/src/components/ColorBlindness.tsx @@ -18,7 +18,7 @@ const getFilter = (filter: string | null) => { return `url('#${filter}')`; }; -const ColorIcon = styled.span( +const ColorIcon = styled.span<{ filter: string | null }>( { background: 'linear-gradient(to right, #F44336, #FF9800, #FFEB3B, #8BC34A, #2196F3, #9C27B0)', borderRadius: '1rem', @@ -26,7 +26,7 @@ const ColorIcon = styled.span( height: '1rem', width: '1rem', }, - ({ filter }: { filter: string | null }) => ({ + ({ filter }) => ({ filter: getFilter(filter), }), ({ theme }) => ({ diff --git a/addons/a11y/src/components/Report/Rules.tsx b/addons/a11y/src/components/Report/Rules.tsx index de4edb845f4e..dad6872d1099 100644 --- a/addons/a11y/src/components/Report/Rules.tsx +++ b/addons/a11y/src/components/Report/Rules.tsx @@ -13,7 +13,7 @@ const List = styled.div({ fontWeight: '400', } as any); -const Item = styled.div(({ elementWidth }: { elementWidth: number }) => { +const Item = styled.div<{ elementWidth: number }>(({ elementWidth }) => { const maxWidthBeforeBreak = 407; return { flexDirection: elementWidth > maxWidthBeforeBreak ? 'row' : 'inherit', diff --git a/addons/a11y/src/components/Tabs.tsx b/addons/a11y/src/components/Tabs.tsx index ed524cac96bd..049286514b15 100644 --- a/addons/a11y/src/components/Tabs.tsx +++ b/addons/a11y/src/components/Tabs.tsx @@ -23,7 +23,7 @@ const HighlightToggleLabel = styled.label<{}>(({ theme }) => ({ color: theme.color.dark, })); -const GlobalToggle = styled.div(({ elementWidth }: { elementWidth: number }) => { +const GlobalToggle = styled.div<{ elementWidth: number }>(({ elementWidth }) => { const maxWidthBeforeBreak = 450; return { cursor: 'pointer', @@ -47,7 +47,7 @@ const GlobalToggle = styled.div(({ elementWidth }: { elementWidth: number }) => }; }); -const Item = styled.button( +const Item = styled.button<{ active?: boolean }>( ({ theme }) => ({ textDecoration: 'none', padding: '10px 15px', @@ -66,7 +66,7 @@ const Item = styled.button( borderBottom: `3px solid ${theme.color.secondary}`, }, }), - ({ active, theme }: any) => + ({ active, theme }) => active ? { opacity: 1, diff --git a/addons/a11y/tsconfig.json b/addons/a11y/tsconfig.json index 3b1fac072341..7a8c0f8f732b 100644 --- a/addons/a11y/tsconfig.json +++ b/addons/a11y/tsconfig.json @@ -5,7 +5,8 @@ "types": ["webpack-env"], "forceConsistentCasingInFileNames": true, "noImplicitReturns": true, - "noUnusedLocals": true + "noUnusedLocals": true, + "strictFunctionTypes": true }, "include": [ "src/**/*" From cf84eb70bf9fbf0151738b84779d710a4d932577 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20Maisse?= Date: Tue, 17 Dec 2019 22:00:25 +0100 Subject: [PATCH 06/11] refactor(a11y): activate strictNullChecks TS compiler option Activate strictNullChecks and fix TS errors related to it --- addons/a11y/src/components/A11YPanel.tsx | 2 +- addons/a11y/src/components/ColorBlindness.tsx | 2 +- .../src/components/Report/HighlightToggle.tsx | 20 ++++++++++--------- addons/a11y/src/components/Tabs.tsx | 4 ++-- addons/a11y/src/index.ts | 6 ++++-- addons/a11y/tsconfig.json | 3 ++- 6 files changed, 21 insertions(+), 16 deletions(-) diff --git a/addons/a11y/src/components/A11YPanel.tsx b/addons/a11y/src/components/A11YPanel.tsx index d3b69244915e..706fa810c036 100644 --- a/addons/a11y/src/components/A11YPanel.tsx +++ b/addons/a11y/src/components/A11YPanel.tsx @@ -179,7 +179,7 @@ export class A11YPanel extends Component { const { passes, violations, incomplete, status } = this.state; - let actionTitle; + let actionTitle: string | JSX.Element = 'Rerun tests'; if (status === 'ready') { actionTitle = 'Rerun tests'; } else if (status === 'running') { diff --git a/addons/a11y/src/components/ColorBlindness.tsx b/addons/a11y/src/components/ColorBlindness.tsx index 21b142543996..87e98989513d 100644 --- a/addons/a11y/src/components/ColorBlindness.tsx +++ b/addons/a11y/src/components/ColorBlindness.tsx @@ -80,7 +80,7 @@ const getColorList = (active: string | null, set: (i: string | null) => void): L ]; export const ColorBlindness: FunctionComponent = () => { - const [active, setActiveState] = useState(null); + const [active, setActiveState] = useState(null); const setActive = (activeState: string | null): void => { const iframe = getIframe(); diff --git a/addons/a11y/src/components/Report/HighlightToggle.tsx b/addons/a11y/src/components/Report/HighlightToggle.tsx index 2aa554641e39..ccca09f3bf40 100644 --- a/addons/a11y/src/components/Report/HighlightToggle.tsx +++ b/addons/a11y/src/components/Report/HighlightToggle.tsx @@ -5,6 +5,7 @@ import { styled, themes, convert } from '@storybook/theming'; import memoize from 'memoizerific'; import { NodeResult } from 'axe-core'; +import { Dispatch } from 'redux'; import { RuleType } from '../A11YPanel'; import { addElement } from '../../redux-config'; import { IFRAME } from '../../constants'; @@ -18,11 +19,11 @@ export class HighlightedElementData { interface ToggleProps { elementsToHighlight: NodeResult[]; type: RuleType; - addElement?: (data: any) => void; - highlightedElementsMap?: Map; + addElement: (data: any) => void; + highlightedElementsMap: Map; isToggledOn?: boolean; toggleId?: string; - indeterminate?: boolean; + indeterminate: boolean; } enum CheckBoxStates { @@ -48,7 +49,7 @@ function getElementBySelectorPath(elementPath: string): HTMLElement { if (iframe && iframe.contentDocument && elementPath) { return iframe.contentDocument.querySelector(elementPath); } - return null; + return (null as unknown) as HTMLElement; } function setElementOutlineStyle(targetElement: HTMLElement, outlineStyle: string): void { @@ -64,7 +65,7 @@ function areAllRequiredElementsHighlighted( const targetElement = getElementBySelectorPath(item.target[0]); return ( highlightedElementsMap.has(targetElement) && - highlightedElementsMap.get(targetElement).isHighlighted + (highlightedElementsMap.get(targetElement) as HighlightedElementData).isHighlighted ); }).length; @@ -76,7 +77,7 @@ function areAllRequiredElementsHighlighted( : CheckBoxStates.INDETERMINATE; } -function mapDispatchToProps(dispatch: any) { +function mapDispatchToProps(dispatch: Dispatch) { return { addElement: (data: { element: HTMLElement; data: HighlightedElementData }) => dispatch(addElement(data)), @@ -126,8 +127,9 @@ class HighlightToggle extends Component { if (!highlightedElementsMap.has(targetElement)) { return; } - const { originalOutline } = highlightedElementsMap.get(targetElement); - const { isHighlighted } = highlightedElementsMap.get(targetElement); + const { originalOutline, isHighlighted } = highlightedElementsMap.get( + targetElement + ) as HighlightedElementData; const { isToggledOn } = this.props; if ((isToggledOn && isHighlighted) || (!isToggledOn && !isHighlighted)) { const addHighlight = !isToggledOn && !isHighlighted; @@ -151,7 +153,7 @@ class HighlightToggle extends Component { if (highlightedElementsMap.has(targetElement)) { setElementOutlineStyle( targetElement, - highlightedElementsMap.get(targetElement).originalOutline + highlightedElementsMap.get(targetElement)!.originalOutline ); } } diff --git a/addons/a11y/src/components/Tabs.tsx b/addons/a11y/src/components/Tabs.tsx index 049286514b15..b16bd1745991 100644 --- a/addons/a11y/src/components/Tabs.tsx +++ b/addons/a11y/src/components/Tabs.tsx @@ -99,7 +99,7 @@ interface TabsState { } function retrieveAllNodesFromResults(items: Result[]): NodeResult[] { - return items.reduce((acc, item) => acc.concat(item.nodes), []); + return items.reduce((acc, item) => acc.concat(item.nodes), [] as NodeResult[]); } export class Tabs extends Component { @@ -109,7 +109,7 @@ export class Tabs extends Component { onToggle = (event: SyntheticEvent) => { this.setState({ - active: parseInt(event.currentTarget.getAttribute('data-index'), 10), + active: parseInt(event.currentTarget.getAttribute('data-index') || '', 10), }); // removes all elements from the redux map in store from the previous panel store.dispatch(clearElements()); diff --git a/addons/a11y/src/index.ts b/addons/a11y/src/index.ts index a7f53ec29a73..fd793f73308d 100644 --- a/addons/a11y/src/index.ts +++ b/addons/a11y/src/index.ts @@ -12,7 +12,7 @@ interface Setup { config: Spec; options: RunOptions; } -let setup: Setup = { element: null, config: {}, options: {} }; +let setup: Setup = { element: undefined, config: {}, options: {} }; const getElement = () => { const storyRoot = document.getElementById('story-root'); @@ -63,7 +63,9 @@ export const withA11y = makeDecorator({ Object.assign(setup, storedDefaultSetup); storedDefaultSetup = null; } - addons.getChannel().on(EVENTS.REQUEST, () => run(setup.element, setup.config, setup.options)); + addons + .getChannel() + .on(EVENTS.REQUEST, () => run(setup.element as ElementContext, setup.config, setup.options)); return getStory(context); }, diff --git a/addons/a11y/tsconfig.json b/addons/a11y/tsconfig.json index 7a8c0f8f732b..56df08b87503 100644 --- a/addons/a11y/tsconfig.json +++ b/addons/a11y/tsconfig.json @@ -6,7 +6,8 @@ "forceConsistentCasingInFileNames": true, "noImplicitReturns": true, "noUnusedLocals": true, - "strictFunctionTypes": true + "strictFunctionTypes": true, + "strictNullChecks": true }, "include": [ "src/**/*" From 5bd05dcca6e7af8463ea635e86495093049b16d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20Maisse?= Date: Tue, 17 Dec 2019 22:04:29 +0100 Subject: [PATCH 07/11] refactor(a11y): convert HighlightedElementData to interface --- addons/a11y/src/components/Report/HighlightToggle.tsx | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/addons/a11y/src/components/Report/HighlightToggle.tsx b/addons/a11y/src/components/Report/HighlightToggle.tsx index ccca09f3bf40..57971bff9428 100644 --- a/addons/a11y/src/components/Report/HighlightToggle.tsx +++ b/addons/a11y/src/components/Report/HighlightToggle.tsx @@ -10,9 +10,8 @@ import { RuleType } from '../A11YPanel'; import { addElement } from '../../redux-config'; import { IFRAME } from '../../constants'; -export class HighlightedElementData { +export interface HighlightedElementData { originalOutline: string; - isHighlighted: boolean; } @@ -164,9 +163,7 @@ class HighlightToggle extends Component { originalOutline: string ): void { const { addElement: localAddElement } = this.props; - const data: HighlightedElementData = new HighlightedElementData(); - data.isHighlighted = isHighlighted; - data.originalOutline = originalOutline; + const data: HighlightedElementData = { isHighlighted, originalOutline }; const payload = { element: targetElement, highlightedElementData: data }; localAddElement(payload); } From 651b3544f01cb7004e08568ad966ca7cfd423319 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20Maisse?= Date: Tue, 17 Dec 2019 22:05:51 +0100 Subject: [PATCH 08/11] refactor(a11y): activate strict mode in TS compiler --- addons/a11y/tsconfig.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/addons/a11y/tsconfig.json b/addons/a11y/tsconfig.json index 56df08b87503..808e2c570e5d 100644 --- a/addons/a11y/tsconfig.json +++ b/addons/a11y/tsconfig.json @@ -6,8 +6,7 @@ "forceConsistentCasingInFileNames": true, "noImplicitReturns": true, "noUnusedLocals": true, - "strictFunctionTypes": true, - "strictNullChecks": true + "strict": true }, "include": [ "src/**/*" From 65e94205fcbf63846dcca27888fc694f48259627 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20Maisse?= Date: Wed, 18 Dec 2019 21:29:07 +0100 Subject: [PATCH 09/11] refactor(a11y): activate noUnusedParameters TS compiler option Activate noUnusedParameters and fix TS errors related to it --- addons/a11y/src/components/Report/HighlightToggle.tsx | 2 +- addons/a11y/src/components/Report/Rules.tsx | 4 ++-- addons/a11y/tsconfig.json | 1 + 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/addons/a11y/src/components/Report/HighlightToggle.tsx b/addons/a11y/src/components/Report/HighlightToggle.tsx index 57971bff9428..64c4d0cb7123 100644 --- a/addons/a11y/src/components/Report/HighlightToggle.tsx +++ b/addons/a11y/src/components/Report/HighlightToggle.tsx @@ -112,7 +112,7 @@ class HighlightToggle extends Component { }); } - componentDidUpdate(prevProps: Readonly): void { + componentDidUpdate(): void { const { indeterminate } = this.props; if (this.checkBoxRef.current) { this.checkBoxRef.current.indeterminate = indeterminate; diff --git a/addons/a11y/src/components/Report/Rules.tsx b/addons/a11y/src/components/Report/Rules.tsx index dad6872d1099..0d7a75437a65 100644 --- a/addons/a11y/src/components/Report/Rules.tsx +++ b/addons/a11y/src/components/Report/Rules.tsx @@ -22,14 +22,14 @@ const Item = styled.div<{ elementWidth: number }>(({ elementWidth }) => { }; }); -const StyledBadge = styled(Badge)(({ status }: { status: string }) => ({ +const StyledBadge = styled(Badge)({ padding: '2px 8px', marginBottom: 3, minWidth: 65, maxWidth: 'fit-content', width: '100%', textAlign: 'center', -})); +}); const Message = styled.div({ paddingLeft: 6, diff --git a/addons/a11y/tsconfig.json b/addons/a11y/tsconfig.json index 808e2c570e5d..d51d544463b2 100644 --- a/addons/a11y/tsconfig.json +++ b/addons/a11y/tsconfig.json @@ -6,6 +6,7 @@ "forceConsistentCasingInFileNames": true, "noImplicitReturns": true, "noUnusedLocals": true, + "noUnusedParameters": true, "strict": true }, "include": [ From ceb7da68b617da0bda7be654970ae2f3c8605063 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20Maisse?= Date: Wed, 18 Dec 2019 21:32:33 +0100 Subject: [PATCH 10/11] refactor(a11y): improve typing of object linked to `react-sizeme` --- addons/a11y/src/components/Report/Rules.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/a11y/src/components/Report/Rules.tsx b/addons/a11y/src/components/Report/Rules.tsx index 0d7a75437a65..b1485ef4fa60 100644 --- a/addons/a11y/src/components/Report/Rules.tsx +++ b/addons/a11y/src/components/Report/Rules.tsx @@ -74,7 +74,7 @@ const Rule: FunctionComponent = ({ rule }) => { } return ( - {({ size }: { size: any }) => ( + {({ size }: { size: { width: number; height: number } }) => ( {formatSeverityText(rule.impact)} {rule.message} From daec5a29e71410815c1a28111863f76a88b8460a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20Maisse?= Date: Wed, 18 Dec 2019 21:34:55 +0100 Subject: [PATCH 11/11] refactor(a11y): activate noFallthroughCasesInSwitch TS compiler option --- addons/a11y/tsconfig.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/addons/a11y/tsconfig.json b/addons/a11y/tsconfig.json index d51d544463b2..99a91ffc487b 100644 --- a/addons/a11y/tsconfig.json +++ b/addons/a11y/tsconfig.json @@ -4,10 +4,11 @@ "rootDir": "./src", "types": ["webpack-env"], "forceConsistentCasingInFileNames": true, - "noImplicitReturns": true, + "strict": true, "noUnusedLocals": true, "noUnusedParameters": true, - "strict": true + "noImplicitReturns": true, + "noFallthroughCasesInSwitch": true }, "include": [ "src/**/*"