Skip to content

Commit

Permalink
chore: enable import esModuleInterop
Browse files Browse the repository at this point in the history
  • Loading branch information
RomanHotsiy committed Jun 25, 2020
1 parent 8180bff commit 91a5a7a
Show file tree
Hide file tree
Showing 17 changed files with 28 additions and 31 deletions.
6 changes: 3 additions & 3 deletions demo/webpack.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as CopyWebpackPlugin from 'copy-webpack-plugin';
import * as ForkTsCheckerWebpackPlugin from 'fork-ts-checker-webpack-plugin';
import * as HtmlWebpackPlugin from 'html-webpack-plugin';
import CopyWebpackPlugin from 'copy-webpack-plugin';
import ForkTsCheckerWebpackPlugin from 'fork-ts-checker-webpack-plugin';
import HtmlWebpackPlugin from 'html-webpack-plugin';
import { compact } from 'lodash';
import { resolve } from 'path';
import * as webpack from 'webpack';
Expand Down
13 changes: 3 additions & 10 deletions src/common-elements/PrismDiv.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
import styled, { extensionsHook } from '../styled-components';

/**
* Based on prism-dark.css
*/
export const PrismDiv = styled.div`
/**
* Based on prism-dark.css
*/
code[class*='language-'],
pre[class*='language-'] {
/* color: white;
background: none; */
text-shadow: 0 -0.1em 0.2em black;
text-align: left;
white-space: pre;
Expand Down Expand Up @@ -82,10 +79,6 @@ export const PrismDiv = styled.div`
}
}
/* .property.token.string {
color: white;
} */
.token.operator,
.token.entity,
.token.url,
Expand Down
2 changes: 1 addition & 1 deletion src/components/Endpoint/Endpoint.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export class Endpoint extends React.Component<EndpointProps, EndpointState> {
style={{ marginRight: '-25px' }}
/>
</EndpointInfo>
<ServersOverlay expanded={expanded}>
<ServersOverlay expanded={expanded} aria-hidden={!expanded}>
{operation.servers.map(server => {
const normalizedUrl = options.expandDefaultServerVariables
? expandDefaultServerVariables(server.url, server.variables)
Expand Down
4 changes: 3 additions & 1 deletion src/components/Endpoint/styled.elements.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@ export const ServersOverlay = styled.div<{ expanded: boolean }>`
border-bottom-left-radius: 4px;
border-bottom-right-radius: 4px;
transition: all 0.25s ease;
${props => (props.expanded ? '' : 'transform: translateY(-50%) scaleY(0);')}
visibility: hidden;
${props => (props.expanded ? 'visibility: visible;' : 'transform: translateY(-50%) scaleY(0);')}
`;

export const ServerItem = styled.div`
Expand Down
4 changes: 2 additions & 2 deletions src/components/ErrorBoundary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ export class ErrorBoundary extends React.Component<{}, { error?: Error }> {
<pre>{this.state.error.stack}</pre>
</details>
</p>
<small> ReDoc Version: {__REDOC_VERSION__}</small> <br />
<small> Commit: {__REDOC_REVISION__}</small>
{/* <small> ReDoc Version: {__REDOC_VERSION__}</small> <br />
<small> Commit: {__REDOC_REVISION__}</small> */}
</ErrorWrapper>
);
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/SideMenu/styled.elements.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as classnames from 'classnames';
import classnames from 'classnames';
import { darken } from 'polished';

import { deprecatedCss, ShelfIcon } from '../../common-elements';
Expand Down
2 changes: 1 addition & 1 deletion src/components/StickySidebar/StickyResponsiveSidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const StyledStickySidebar = styled.div<{ open?: boolean }>`
flex-direction: column;
backface-visibility: hidden;
/* contain: strict; TODO: breaks layout since Chrome 80*/
/* contain: strict; TODO: breaks layout since Chrome 80 */
height: 100vh;
position: sticky;
Expand Down
2 changes: 1 addition & 1 deletion src/components/StoreBuilder.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as memoize from 'memoize-one/dist/memoize-one.cjs'; // fixme: https://github.com/alexreardon/memoize-one/issues/37
import memoize from 'memoize-one/dist/memoize-one.cjs'; // fixme: https://github.com/alexreardon/memoize-one/issues/37
import { Component, createContext } from 'react';

import { AppStore } from '../services/';
Expand Down
6 changes: 3 additions & 3 deletions src/components/__tests__/JsonViewer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,19 @@ describe('Components', () => {

test('should collapse/uncollapse', () => {
expect(component.html()).not.toContain('class="hoverable"'); // all are collapsed by default
const expandAll = component.find('div > span[children=" Expand all "]');
const expandAll = component.find('div > button[children=" Expand all "]');
expandAll.simulate('click');
expect(component.html()).toContain('class="hoverable"'); // all are collapsed

const collapseAll = component.find('div > span[children=" Collapse all "]');
const collapseAll = component.find('div > button[children=" Collapse all "]');
collapseAll.simulate('click');
expect(component.html()).not.toContain('class="hoverable"'); // all are collapsed
});

test('should collapse/uncollapse', () => {
ClipboardService.copySelected = jest.fn();

const copy = component.find('span[onClick]').first();
const copy = component.find('button[onClick]').first();
copy.simulate('click');

expect(ClipboardService.copySelected as jest.Mock).toHaveBeenCalled();
Expand Down
2 changes: 1 addition & 1 deletion src/services/MarkdownRenderer.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as marked from 'marked';
import marked from 'marked';

import { highlight, safeSlugify, unescapeHTMLChars } from '../utils';
import { AppStore } from './AppStore';
Expand Down
2 changes: 1 addition & 1 deletion src/services/MarkerService.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as Mark from 'mark.js';
import Mark from 'mark.js';

export class MarkerService {
map: Map<Element, Mark> = new Map();
Expand Down
2 changes: 1 addition & 1 deletion src/services/ScrollService.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { bind } from 'decko';
import * as EventEmitter from 'eventemitter3';
import EventEmitter from 'eventemitter3';

import { IS_BROWSER, querySelector, Throttle } from '../utils';
import { RedocNormalizedOptions } from './RedocNormalizedOptions';
Expand Down
4 changes: 2 additions & 2 deletions src/setupTests.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as Enzyme from 'enzyme';
import * as Adapter from 'enzyme-adapter-react-16';
import Enzyme from 'enzyme';
import Adapter from 'enzyme-adapter-react-16';
import 'raf/polyfill';

Enzyme.configure({ adapter: new Adapter() });
2 changes: 1 addition & 1 deletion src/utils/JsonPointer.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'use strict';
import * as JsonPointerLib from 'json-pointer';
import JsonPointerLib from 'json-pointer';

const origParse = JsonPointerLib.parse;
/**
Expand Down
2 changes: 1 addition & 1 deletion src/utils/loadAndBundleSpec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as JsonSchemaRefParser from 'json-schema-ref-parser';
import JsonSchemaRefParser from 'json-schema-ref-parser';
/* tslint:disable-next-line:no-implicit-dependencies */
import { convertObj } from 'swagger2openapi';
import { OpenAPISpec } from '../types';
Expand Down
2 changes: 1 addition & 1 deletion src/utils/openapi.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { dirname } from 'path';
import * as URLtemplate from 'url-template';
import URLtemplate from 'url-template';

import { FieldModel } from '../services/models';
import { OpenAPIParser } from '../services/OpenAPIParser';
Expand Down
2 changes: 2 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
"target": "es5",
"noImplicitAny": false,
"noUnusedParameters": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"noUnusedLocals": true,
"strictNullChecks": true,
"sourceMap": true,
Expand Down

0 comments on commit 91a5a7a

Please sign in to comment.