chore: prettier all

This commit is contained in:
Roman Hotsiy 2020-03-17 12:01:32 +02:00
parent 4ab2d0556d
commit 54eb2a0dce
No known key found for this signature in database
GPG Key ID: 5CB7B3ACABA57CB0
10 changed files with 20 additions and 15 deletions

View File

@ -23,6 +23,8 @@ module.exports = {
'@typescript-eslint/no-use-before-define': 'off',
'@typescript-eslint/interface-name-prefix': 'off',
'@typescript-eslint/no-inferrable-types': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'react/prop-types': 'off',
'import/no-extraneous-dependencies': 'error',

View File

@ -19,11 +19,13 @@ export const linksCss = css`
}
`;
export const StyledMarkdownBlock = styled(PrismDiv as StyledComponent<
'div',
ResolvedThemeInterface,
{ compact?: boolean; inline?: boolean }
>)`
export const StyledMarkdownBlock = styled(
PrismDiv as StyledComponent<
'div',
ResolvedThemeInterface,
{ compact?: boolean; inline?: boolean }
>,
)`
font-family: ${props => props.theme.typography.fontFamily};
font-weight: ${props => props.theme.typography.fontWeightRegular};

View File

@ -148,7 +148,7 @@ export class OpenAPIParser {
* @param obj object to dereference
* @param forceCircular whether to dereference even if it is circular ref
*/
deref<T extends object>(obj: OpenAPIRef | T, forceCircular: boolean = false): T {
deref<T extends object>(obj: OpenAPIRef | T, forceCircular = false): T {
if (this.isRef(obj)) {
const resolved = this.byRef<T>(obj.$ref)!;
const visited = this._refCounter.visited(obj.$ref);

View File

@ -204,6 +204,7 @@ export class RedocNormalizedOptions {
this.payloadSampleIdx = RedocNormalizedOptions.normalizePayloadSampleIdx(raw.payloadSampleIdx);
this.expandSingleSchemaField = argValueToBoolean(raw.expandSingleSchemaField);
// eslint-disable-next-line @typescript-eslint/camelcase
this.unstable_ignoreMimeParameters = argValueToBoolean(raw.unstable_ignoreMimeParameters);
this.allowedMdComponents = raw.allowedMdComponents || {};

View File

@ -9,7 +9,7 @@ const EVENT = 'scroll';
export class ScrollService {
private _scrollParent: Window | HTMLElement | undefined;
private _emiter: EventEmitter;
private _prevOffsetY: number = 0;
private _prevOffsetY = 0;
constructor(private options: RedocNormalizedOptions) {
this._scrollParent = IS_BROWSER ? window : undefined;
this._emiter = new EventEmitter();

View File

@ -1,5 +0,0 @@
import { AppStore } from '../services/AppStore';
export interface BaseContainerProps {
store: AppStore;
}

View File

@ -8,7 +8,11 @@ describe('Utils', () => {
const fn = (...args) => args;
const actual = mapWithLast(arr, fn);
const expected = [[1, false], [2, false], [3, true]];
const expected = [
[1, false],
[2, false],
[3, true],
];
expect(actual).toEqual(expected);
});

View File

@ -16,6 +16,7 @@ function throttle(func, wait) {
const now = new Date().getTime();
const remaining = wait - (now - previous);
context = this;
// eslint-disable-next-line prefer-rest-params
args = arguments;
if (remaining <= 0 || remaining > wait) {
if (timeout) {

View File

@ -189,7 +189,7 @@ export function removeQueryString(serverUrl: string): string {
function parseURL(url: string) {
if (typeof URL === 'undefined') {
// node
return new (require('url')).URL(url);
return new (require('url').URL)(url);
} else {
return new URL(url);
}

View File

@ -1,5 +1,5 @@
import { dirname } from 'path';
const URLtemplate = require('url-template');
import * as URLtemplate from 'url-template';
import { FieldModel } from '../services/models';
import { OpenAPIParser } from '../services/OpenAPIParser';