mirror of
https://github.com/Redocly/redoc.git
synced 2025-02-07 13:30:33 +03:00
chore: prettier all
This commit is contained in:
parent
4ab2d0556d
commit
54eb2a0dce
|
@ -23,6 +23,8 @@ module.exports = {
|
||||||
'@typescript-eslint/no-use-before-define': 'off',
|
'@typescript-eslint/no-use-before-define': 'off',
|
||||||
'@typescript-eslint/interface-name-prefix': 'off',
|
'@typescript-eslint/interface-name-prefix': 'off',
|
||||||
'@typescript-eslint/no-inferrable-types': 'off',
|
'@typescript-eslint/no-inferrable-types': 'off',
|
||||||
|
'@typescript-eslint/no-non-null-assertion': 'off',
|
||||||
|
|
||||||
'react/prop-types': 'off',
|
'react/prop-types': 'off',
|
||||||
|
|
||||||
'import/no-extraneous-dependencies': 'error',
|
'import/no-extraneous-dependencies': 'error',
|
||||||
|
|
|
@ -19,11 +19,13 @@ export const linksCss = css`
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
export const StyledMarkdownBlock = styled(PrismDiv as StyledComponent<
|
export const StyledMarkdownBlock = styled(
|
||||||
'div',
|
PrismDiv as StyledComponent<
|
||||||
ResolvedThemeInterface,
|
'div',
|
||||||
{ compact?: boolean; inline?: boolean }
|
ResolvedThemeInterface,
|
||||||
>)`
|
{ compact?: boolean; inline?: boolean }
|
||||||
|
>,
|
||||||
|
)`
|
||||||
|
|
||||||
font-family: ${props => props.theme.typography.fontFamily};
|
font-family: ${props => props.theme.typography.fontFamily};
|
||||||
font-weight: ${props => props.theme.typography.fontWeightRegular};
|
font-weight: ${props => props.theme.typography.fontWeightRegular};
|
||||||
|
|
|
@ -148,7 +148,7 @@ export class OpenAPIParser {
|
||||||
* @param obj object to dereference
|
* @param obj object to dereference
|
||||||
* @param forceCircular whether to dereference even if it is circular ref
|
* @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)) {
|
if (this.isRef(obj)) {
|
||||||
const resolved = this.byRef<T>(obj.$ref)!;
|
const resolved = this.byRef<T>(obj.$ref)!;
|
||||||
const visited = this._refCounter.visited(obj.$ref);
|
const visited = this._refCounter.visited(obj.$ref);
|
||||||
|
|
|
@ -204,6 +204,7 @@ export class RedocNormalizedOptions {
|
||||||
this.payloadSampleIdx = RedocNormalizedOptions.normalizePayloadSampleIdx(raw.payloadSampleIdx);
|
this.payloadSampleIdx = RedocNormalizedOptions.normalizePayloadSampleIdx(raw.payloadSampleIdx);
|
||||||
this.expandSingleSchemaField = argValueToBoolean(raw.expandSingleSchemaField);
|
this.expandSingleSchemaField = argValueToBoolean(raw.expandSingleSchemaField);
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/camelcase
|
||||||
this.unstable_ignoreMimeParameters = argValueToBoolean(raw.unstable_ignoreMimeParameters);
|
this.unstable_ignoreMimeParameters = argValueToBoolean(raw.unstable_ignoreMimeParameters);
|
||||||
|
|
||||||
this.allowedMdComponents = raw.allowedMdComponents || {};
|
this.allowedMdComponents = raw.allowedMdComponents || {};
|
||||||
|
|
|
@ -9,7 +9,7 @@ const EVENT = 'scroll';
|
||||||
export class ScrollService {
|
export class ScrollService {
|
||||||
private _scrollParent: Window | HTMLElement | undefined;
|
private _scrollParent: Window | HTMLElement | undefined;
|
||||||
private _emiter: EventEmitter;
|
private _emiter: EventEmitter;
|
||||||
private _prevOffsetY: number = 0;
|
private _prevOffsetY = 0;
|
||||||
constructor(private options: RedocNormalizedOptions) {
|
constructor(private options: RedocNormalizedOptions) {
|
||||||
this._scrollParent = IS_BROWSER ? window : undefined;
|
this._scrollParent = IS_BROWSER ? window : undefined;
|
||||||
this._emiter = new EventEmitter();
|
this._emiter = new EventEmitter();
|
||||||
|
|
5
src/types/components.d.ts
vendored
5
src/types/components.d.ts
vendored
|
@ -1,5 +0,0 @@
|
||||||
import { AppStore } from '../services/AppStore';
|
|
||||||
|
|
||||||
export interface BaseContainerProps {
|
|
||||||
store: AppStore;
|
|
||||||
}
|
|
|
@ -8,7 +8,11 @@ describe('Utils', () => {
|
||||||
const fn = (...args) => args;
|
const fn = (...args) => args;
|
||||||
|
|
||||||
const actual = mapWithLast(arr, fn);
|
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);
|
expect(actual).toEqual(expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -16,6 +16,7 @@ function throttle(func, wait) {
|
||||||
const now = new Date().getTime();
|
const now = new Date().getTime();
|
||||||
const remaining = wait - (now - previous);
|
const remaining = wait - (now - previous);
|
||||||
context = this;
|
context = this;
|
||||||
|
// eslint-disable-next-line prefer-rest-params
|
||||||
args = arguments;
|
args = arguments;
|
||||||
if (remaining <= 0 || remaining > wait) {
|
if (remaining <= 0 || remaining > wait) {
|
||||||
if (timeout) {
|
if (timeout) {
|
||||||
|
|
|
@ -189,7 +189,7 @@ export function removeQueryString(serverUrl: string): string {
|
||||||
function parseURL(url: string) {
|
function parseURL(url: string) {
|
||||||
if (typeof URL === 'undefined') {
|
if (typeof URL === 'undefined') {
|
||||||
// node
|
// node
|
||||||
return new (require('url')).URL(url);
|
return new (require('url').URL)(url);
|
||||||
} else {
|
} else {
|
||||||
return new URL(url);
|
return new URL(url);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { dirname } from 'path';
|
import { dirname } from 'path';
|
||||||
const URLtemplate = require('url-template');
|
import * as URLtemplate from 'url-template';
|
||||||
|
|
||||||
import { FieldModel } from '../services/models';
|
import { FieldModel } from '../services/models';
|
||||||
import { OpenAPIParser } from '../services/OpenAPIParser';
|
import { OpenAPIParser } from '../services/OpenAPIParser';
|
||||||
|
|
Loading…
Reference in New Issue
Block a user