From 8a99f59ba57301797f896aeeaa2ce57d46fd6dfb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Toni=20Matkovi=C4=87?= Date: Tue, 5 Nov 2019 12:11:16 +0100 Subject: [PATCH] Yarn prettier --- src/components/ContentItems/SingleContentItem.tsx | 15 +++++---------- src/components/Redoc/Redoc.tsx | 13 +++++++------ src/utils/__tests__/openapi.test.ts | 4 +++- 3 files changed, 15 insertions(+), 17 deletions(-) diff --git a/src/components/ContentItems/SingleContentItem.tsx b/src/components/ContentItems/SingleContentItem.tsx index 52a8a78a..603e47bb 100644 --- a/src/components/ContentItems/SingleContentItem.tsx +++ b/src/components/ContentItems/SingleContentItem.tsx @@ -1,22 +1,19 @@ -import {observer} from 'mobx-react'; +import { observer } from 'mobx-react'; import * as React from 'react'; -import {IMenuItem, MenuStore} from '../../services'; -import {ContentItems} from './ContentItems'; +import { IMenuItem, MenuStore } from '../../services'; +import { ContentItems } from './ContentItems'; @observer export class SingleContentItem extends React.Component<{ menu: MenuStore; }> { - extractActive(menu: MenuStore): IMenuItem[] { const active = menu.flatItems[menu.activeItemIdx]; if (!active) { return [menu.flatItems[0]]; } if (active.type !== 'operation') { - return [ - {...active, items: []}, - ]; + return [{ ...active, items: [] }]; } return [active]; } @@ -24,8 +21,6 @@ export class SingleContentItem extends React.Component<{ render() { const { menu } = this.props; const activeItems = this.extractActive(menu); - return ( - - ); + return ; } } diff --git a/src/components/Redoc/Redoc.tsx b/src/components/Redoc/Redoc.tsx index e6e67dd0..e60e6e7c 100644 --- a/src/components/Redoc/Redoc.tsx +++ b/src/components/Redoc/Redoc.tsx @@ -4,7 +4,7 @@ import * as React from 'react'; import { ThemeProvider } from '../../styled-components'; import { OptionsProvider } from '../OptionsProvider'; -import {AppStore} from '../../services'; +import { AppStore } from '../../services'; import { ApiInfo } from '../ApiInfo/'; import { ApiLogo } from '../ApiLogo/ApiLogo'; import { ContentItems } from '../ContentItems/ContentItems'; @@ -12,7 +12,7 @@ import { SideMenu } from '../SideMenu/SideMenu'; import { StickyResponsiveSidebar } from '../StickySidebar/StickyResponsiveSidebar'; import { ApiContentWrap, BackgroundStub, RedocWrap } from './styled.elements'; -import {SingleContentItem} from '../ContentItems/SingleContentItem'; +import { SingleContentItem } from '../ContentItems/SingleContentItem'; import { SearchBox } from '../SearchBox/SearchBox'; import { StoreProvider } from '../StoreBuilder'; @@ -58,10 +58,11 @@ export class Redoc extends React.Component { - {options.disableInfiniteScroll - ? - : - } + {options.disableInfiniteScroll ? ( + + ) : ( + + )} diff --git a/src/utils/__tests__/openapi.test.ts b/src/utils/__tests__/openapi.test.ts index 244ab63c..db0fe388 100644 --- a/src/utils/__tests__/openapi.test.ts +++ b/src/utils/__tests__/openapi.test.ts @@ -387,7 +387,9 @@ describe('Utils', () => { expect(pluralizeType('objects (Pet)')).toEqual('objects (Pet)'); expect(pluralizeType('strings ')).toEqual('strings '); expect(pluralizeType('objects or strings')).toEqual('objects or strings'); - expect(pluralizeType('objects (Pet) or numbers ')).toEqual('objects (Pet) or numbers '); + expect(pluralizeType('objects (Pet) or numbers ')).toEqual( + 'objects (Pet) or numbers ', + ); }); });