From 74286fac74b8a235ce9885a6542878011ea36a2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Ro=C5=BCek?= Date: Fri, 28 Dec 2018 18:27:09 +0100 Subject: [PATCH] fix: TS warnings --- src/ScrollBox.tsx | 6 +++--- src/__stories__/Menus/Menu.tsx | 2 +- src/__stories__/Misc/CodeEditor.tsx | 5 +++-- src/__tests__/ContextMenu.spec.tsx | 2 +- src/__tests__/Table.spec.tsx | 2 +- 5 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/ScrollBox.tsx b/src/ScrollBox.tsx index 5ec948ef..f1f3b82f 100644 --- a/src/ScrollBox.tsx +++ b/src/ScrollBox.tsx @@ -1,6 +1,6 @@ /* @jsx jsx */ import { jsx } from '@emotion/core'; -import { forwardRef, useRef, useState } from 'react'; +import { forwardRef, FunctionComponent, RefObject, useRef, useState } from 'react'; import Scrollbars, { positionValues, ScrollbarProps } from 'react-custom-scrollbars'; import { Box, IBox } from './Box'; @@ -38,7 +38,7 @@ const scrollbarStyles = ({ isScrolling }: IScrollBoxThumbProps) => { }; }; -export const ScrollBox: React.FunctionComponent = (props: IScrollBox) => { +export const ScrollBox: FunctionComponent = (props: IScrollBox) => { // pull out scrollTo so they are not in scrollbarProps (don't want them spread onto component) const { scrollTo, children, onUpdate, autoHeight = true, autoHideTimeout = 500, innerRef, ...scrollbarProps } = props; @@ -112,7 +112,7 @@ export const ScrollBox: React.FunctionComponent = (props: IScrollBox export interface IScrollBox extends IScrollBoxProps, ScrollbarProps {} export interface IScrollBoxProps { - innerRef?: React.RefObject; + innerRef?: RefObject; autoHeight?: boolean; autoHideTimeout?: number; diff --git a/src/__stories__/Menus/Menu.tsx b/src/__stories__/Menus/Menu.tsx index 1f113945..a2781904 100644 --- a/src/__stories__/Menus/Menu.tsx +++ b/src/__stories__/Menus/Menu.tsx @@ -109,4 +109,4 @@ storiesOf('Menus:Menu', module) { title: 'Disabled Item', disabled: true, icon: 'times-circle' }, ]} /> - )) + )); diff --git a/src/__stories__/Misc/CodeEditor.tsx b/src/__stories__/Misc/CodeEditor.tsx index c046acc1..48e79105 100644 --- a/src/__stories__/Misc/CodeEditor.tsx +++ b/src/__stories__/Misc/CodeEditor.tsx @@ -6,8 +6,9 @@ import { StateDecorator, Store } from '@sambego/storybook-state'; import { action } from '@storybook/addon-actions'; import { object, withKnobs } from '@storybook/addon-knobs'; import { text } from '@storybook/addon-knobs/react'; -import { storiesOf, StoryDecorator } from '@storybook/react'; +import { CSSProperties } from 'react'; +import { storiesOf, StoryDecorator } from '@storybook/react'; import { CodeEditor, ICodeEditor } from '../../CodeEditor'; const store = new Store({ @@ -17,7 +18,7 @@ const store = new Store({ export const codeEditorKnobs = (tabName = 'Code Editor'): ICodeEditor => ({ language: text('language', 'javascript', tabName), value: text('value', 'const defaultValue = stoplight.io();', tabName), - style: object('style', { fontSize: '12px' }, tabName), + style: object('style', { fontSize: '12px' }, tabName), }); storiesOf('Miscellaneous:CodeEditor', module) diff --git a/src/__tests__/ContextMenu.spec.tsx b/src/__tests__/ContextMenu.spec.tsx index d2c84e46..bda342bc 100644 --- a/src/__tests__/ContextMenu.spec.tsx +++ b/src/__tests__/ContextMenu.spec.tsx @@ -101,7 +101,7 @@ describe('ContextMenuView component', () => { }); it('should render as ReactContextMenu', () => { - const wrapper = shallow() + const wrapper = shallow(); expect(wrapper).toHaveProp('as', ReactContextMenu); }); diff --git a/src/__tests__/Table.spec.tsx b/src/__tests__/Table.spec.tsx index 81b48fa3..e90eaaf5 100644 --- a/src/__tests__/Table.spec.tsx +++ b/src/__tests__/Table.spec.tsx @@ -121,7 +121,7 @@ describe('TableCell component', () => { it('renders td by default', () => { const wrapper = shallow(); expect(wrapper).toHaveProp('as', 'td'); - }) + }); it('may render th', () => { const wrapper = shallow();