Skip to content

Commit 67d4093

Browse files
committed
chore: Fix lint
1 parent 536e45a commit 67d4093

20 files changed

+67
-56
lines changed

.eslintignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
.history
44
.env
55
.DS_Store
6+
.eslintrc.js
67
node_modules
78
/lib
89
/dist
@@ -12,5 +13,6 @@ node_modules
1213

1314
/src/__tests__
1415
/jest.snapshots.js
16+
/jest.config.js
1517

16-
/external
18+
/external

src/includer/constants.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {OpenJSONSchema} from './models';
1+
import type {OpenJSONSchema} from './models';
22

33
export enum LeadingPageMode {
44
Section = 'section',

src/includer/parsers.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
/* eslint-disable no-shadow */
2-
import slugify from 'slugify';
3-
import {getStatusText} from 'http-status-codes';
4-
5-
import {TAG_NAMES_FIELD} from './constants';
6-
import {
2+
import type {
73
Method,
84
OpenAPIOperation,
95
OpenAPISpec,
@@ -17,6 +13,11 @@ import {
1713
V3Tag,
1814
} from './models';
1915

16+
import slugify from 'slugify';
17+
import {getStatusText} from 'http-status-codes';
18+
19+
import {TAG_NAMES_FIELD} from './constants';
20+
2021
function info(spec: OpenAPISpec): V3Info {
2122
const {
2223
info: {title, description, version, termsOfService, license, contact},

src/includer/services/refs.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1+
import type {OpenJSONSchema, OpenJSONSchemaDefinition, Refs} from '../models';
2+
13
import {extractOneOfElements} from '../traverse/types';
2-
import {OpenJSONSchema, OpenJSONSchemaDefinition, Refs} from '../models';
34
import {concatNewLine} from '../utils';
45
import {anchor} from '../ui';
56

src/includer/traverse/description.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {OpenJSONSchema} from '../models';
1+
import type {OpenJSONSchema} from '../models';
22

33
type Field = {
44
key: keyof OpenJSONSchema;

src/includer/traverse/tables.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import type {Context} from '../index';
2+
import type {OpenJSONSchema, OpenJSONSchemaDefinition} from '../models';
23

34
import stringify from 'json-stringify-safe';
45

56
import {anchor, block, bold, table, tableParameterName} from '../ui';
67
import {concatNewLine} from '../utils';
7-
import {OpenJSONSchema, OpenJSONSchemaDefinition} from '../models';
88
import {getOrderedPropList} from '../ui/presentationUtils/orderedProps/getOrderedPropList';
99

1010
import {collectRefs, extractOneOfElements, inferType, typeToText} from './types';

src/includer/traverse/types.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
import type {Context} from '../index';
2-
3-
import stringify from 'json-stringify-safe';
4-
5-
import {SUPPORTED_ENUM_TYPES} from '../constants';
6-
import {
2+
import type {
73
JSONSchemaType,
84
JSONSchemaUnionType,
95
JsType,
106
OpenJSONSchema,
117
SupportedEnumType,
128
} from '../models';
9+
10+
import stringify from 'json-stringify-safe';
11+
12+
import {SUPPORTED_ENUM_TYPES} from '../constants';
1313
import {anchor} from '../ui';
1414

1515
function inferType(value: OpenJSONSchema, ctx: Context): JSONSchemaType {

src/includer/ui/common.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import type {TitleDepth, V3Server} from '../models';
2+
13
import slugify from 'slugify';
24
import bem from 'bem-cn-lite';
35

@@ -8,7 +10,6 @@ import {
810
HTML_COMMENTS_CLOSE_DIRECTIVE,
911
HTML_COMMENTS_OPEN_DIRECTIVE,
1012
} from '../constants';
11-
import {TitleDepth, V3Server} from '../models';
1213

1314
import {popups} from './popups';
1415

src/includer/ui/endpoint.ts

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,16 @@
11
import type {Context} from '../index';
2+
import type {TableRef} from '../traverse/tables';
3+
import type {
4+
In,
5+
OpenJSONSchema,
6+
V3Endpoint,
7+
V3Parameter,
8+
V3Parameters,
9+
V3Response,
10+
V3Responses,
11+
V3Schema,
12+
V3Security,
13+
} from '../models';
214

315
import stringify from 'json-stringify-safe';
416
import {dump} from 'js-yaml';
@@ -15,23 +27,7 @@ import {
1527
RESPONSES_SECTION_NAME,
1628
SANDBOX_TAB_NAME,
1729
} from '../constants';
18-
import {
19-
TableRef,
20-
prepareSampleObject,
21-
prepareTableRowData,
22-
tableFromSchema,
23-
} from '../traverse/tables';
24-
import {
25-
In,
26-
OpenJSONSchema,
27-
V3Endpoint,
28-
V3Parameter,
29-
V3Parameters,
30-
V3Response,
31-
V3Responses,
32-
V3Schema,
33-
V3Security,
34-
} from '../models';
30+
import {prepareSampleObject, prepareTableRowData, tableFromSchema} from '../traverse/tables';
3531
import {concatNewLine} from '../utils';
3632

3733
import {

src/includer/ui/main.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
11
import type {Context} from '../index';
2+
import type {
3+
ContactSource,
4+
LeadingPageSpecRenderMode,
5+
Specification,
6+
V3Contact,
7+
V3Info,
8+
V3Tag,
9+
} from '../models';
210

311
import stringify from 'json-stringify-safe';
412
import {join} from 'path';
@@ -11,14 +19,6 @@ import {
1119
SPEC_SECTION_TYPE,
1220
TAGS_SECTION_NAME,
1321
} from '../constants';
14-
import {
15-
ContactSource,
16-
LeadingPageSpecRenderMode,
17-
Specification,
18-
V3Contact,
19-
V3Info,
20-
V3Tag,
21-
} from '../models';
2222
import {mdPath, sectionName} from '../index';
2323

2424
import {block, body, code, cut, link, list, mono, page, title} from '.';

0 commit comments

Comments
 (0)