mirror of
https://github.com/Redocly/redoc.git
synced 2024-11-10 19:06:34 +03:00
chore: fix lint issues
This commit is contained in:
parent
54eb2a0dce
commit
7ba3de2e28
|
@ -7,6 +7,7 @@ module.exports = {
|
|||
parserOptions: {
|
||||
project: 'tsconfig.json',
|
||||
sourceType: 'module',
|
||||
createDefaultProgram: true,
|
||||
ecmaFeatures: {
|
||||
jsx: true,
|
||||
},
|
||||
|
@ -37,6 +38,9 @@ module.exports = {
|
|||
'react-dom/*',
|
||||
'core-js/**',
|
||||
'memoize-one/**',
|
||||
'unfetch/**',
|
||||
'raf/polyfill',
|
||||
'**/fixtures/**', // for tests
|
||||
],
|
||||
},
|
||||
],
|
||||
|
|
|
@ -42,7 +42,7 @@
|
|||
"stats": "webpack --env.standalone --json --profile --mode=production > stats.json",
|
||||
"prettier": "prettier --write \"cli/index.ts\" \"src/**/*.{ts,tsx}\"",
|
||||
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 1",
|
||||
"lint": "eslint src/**/*.{js,ts,tsx}",
|
||||
"lint": "eslint 'src/**/*.{js,ts,tsx}'",
|
||||
"benchmark": "node ./benchmark/benchmark.js",
|
||||
"start:demo": "webpack-dev-server --hot --config demo/webpack.config.ts --mode=development",
|
||||
"compile:cli": "tsc custom.d.ts cli/index.ts --target es6 --module commonjs --types yargs",
|
||||
|
|
|
@ -29,7 +29,12 @@ export function ExternalExample({ example, mimeType }: ExampleProps) {
|
|||
return (
|
||||
<StyledPre>
|
||||
Error loading external example: <br />
|
||||
<a className={'token string'} href={example.externalValueUrl} target="_blank">
|
||||
<a
|
||||
className={'token string'}
|
||||
href={example.externalValueUrl}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
>
|
||||
{example.externalValueUrl}
|
||||
</a>
|
||||
</StyledPre>
|
||||
|
|
|
@ -1,6 +1,3 @@
|
|||
// @ts-ignore
|
||||
import Dropdown from 'react-dropdown';
|
||||
|
||||
import { transparentize } from 'polished';
|
||||
import styled from '../../styled-components';
|
||||
|
||||
|
|
|
@ -97,7 +97,7 @@ export class SecurityDefs extends React.PureComponent<SecurityDefsProps> {
|
|||
scheme.http.scheme === 'bearer' && scheme.http.bearerFormat && (
|
||||
<tr key="bearer">
|
||||
<th> Bearer format </th>
|
||||
<td> "{scheme.http.bearerFormat}" </td>
|
||||
<td> "{scheme.http.bearerFormat}" </td>
|
||||
</tr>
|
||||
),
|
||||
]
|
||||
|
@ -105,7 +105,11 @@ export class SecurityDefs extends React.PureComponent<SecurityDefsProps> {
|
|||
<tr>
|
||||
<th> Connect URL </th>
|
||||
<td>
|
||||
<a target="_blank" href={scheme.openId.connectUrl}>
|
||||
<a
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
href={scheme.openId.connectUrl}
|
||||
>
|
||||
{scheme.openId.connectUrl}
|
||||
</a>
|
||||
</td>
|
||||
|
|
|
@ -25,7 +25,7 @@ export class SideMenu extends React.Component<{ menu: MenuStore; className?: str
|
|||
>
|
||||
<MenuItems items={store.items} onActivate={this.activate} root={true} />
|
||||
<RedocAttribution>
|
||||
<a target="_blank" href="https://github.com/Redocly/redoc">
|
||||
<a target="_blank" rel="noopener noreferrer" href="https://github.com/Redocly/redoc">
|
||||
Documentation Powered by ReDoc
|
||||
</a>
|
||||
</RedocAttribution>
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/* eslint-disable import/no-internal-modules */
|
||||
/* tslint:disable:no-implicit-dependencies */
|
||||
|
||||
import { shallow } from 'enzyme';
|
||||
|
|
|
@ -8,6 +8,7 @@ describe('Models', () => {
|
|||
let parser;
|
||||
|
||||
test('should hoist oneOfs when mergin allOf', () => {
|
||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
||||
const spec = require('./fixtures/oneOfHoist.json');
|
||||
parser = new OpenAPIParser(spec, undefined, opts);
|
||||
expect(parser.mergeAllOf(spec.components.schemas.test)).toMatchSnapshot();
|
||||
|
|
|
@ -6,9 +6,9 @@ const opts = new RedocNormalizedOptions({});
|
|||
|
||||
describe('Models', () => {
|
||||
describe('FieldModel', () => {
|
||||
let parser;
|
||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
||||
const spec = require('../fixtures/fields.json');
|
||||
parser = new OpenAPIParser(spec, undefined, opts);
|
||||
const parser = new OpenAPIParser(spec, undefined, opts);
|
||||
|
||||
test('basic field details', () => {
|
||||
const field = new FieldModel(
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/* eslint-disable @typescript-eslint/no-var-requires */
|
||||
import { SchemaModel } from '../../models/Schema';
|
||||
import { OpenAPIParser } from '../../OpenAPIParser';
|
||||
import { RedocNormalizedOptions } from '../../RedocNormalizedOptions';
|
||||
|
|
|
@ -640,7 +640,7 @@ describe('Utils', () => {
|
|||
|
||||
describe('OpenAPI sortByRequired', () => {
|
||||
it('should equal to the old data when all items have no required props', () => {
|
||||
let fields = [
|
||||
const fields = [
|
||||
{
|
||||
name: 'loginName',
|
||||
required: false,
|
||||
|
@ -694,7 +694,7 @@ describe('Utils', () => {
|
|||
});
|
||||
|
||||
it('other item should be the same order when some of items are required', () => {
|
||||
let fields = [
|
||||
const fields = [
|
||||
{
|
||||
name: 'loginName',
|
||||
required: true,
|
||||
|
@ -744,7 +744,7 @@ describe('Utils', () => {
|
|||
required: false,
|
||||
},
|
||||
];
|
||||
let sortedFields = [
|
||||
const sortedFields = [
|
||||
{
|
||||
name: 'loginName',
|
||||
required: true,
|
||||
|
@ -798,7 +798,7 @@ describe('Utils', () => {
|
|||
});
|
||||
|
||||
it('should the order of required items is as same as the order parameter ', () => {
|
||||
let fields = [
|
||||
const fields = [
|
||||
{
|
||||
name: 'loginName',
|
||||
required: true,
|
||||
|
|
Loading…
Reference in New Issue
Block a user