Skip to content

Commit a33c473

Browse files
authored
chore: refactor duplicate imports (#2690)
1 parent 34468be commit a33c473

File tree

44 files changed

+163
-150
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+163
-150
lines changed

.oxlintrc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343

4444
"import/no-cycle": ["warn"],
4545
"import/no-duplicates": [
46-
"warn",
46+
"error",
4747
{
4848
"preferInline": true
4949
}

packages/cli/src/commands/build-docs/utils.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
import { isAbsoluteUrl, logger } from '@redocly/openapi-core';
2-
import type { Config } from '@redocly/openapi-core';
1+
import { isAbsoluteUrl, logger, type Config } from '@redocly/openapi-core';
32
import { default as handlebars } from 'handlebars';
43
import { existsSync, lstatSync, readFileSync } from 'node:fs';
54
import * as path from 'node:path';

packages/cli/src/commands/join/helpers/collect-paths.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
1-
import { isRef, dequal, logger, keysOf } from '@redocly/openapi-core';
2-
import type { Referenced, Oas3PathItem, Oas3Server, Oas3Parameter } from '@redocly/openapi-core';
1+
import {
2+
isRef,
3+
dequal,
4+
logger,
5+
keysOf,
6+
type Referenced,
7+
type Oas3PathItem,
8+
type Oas3Server,
9+
type Oas3Parameter,
10+
} from '@redocly/openapi-core';
311

412
import { exitWithError } from '../../../utils/error.js';
513
import { type Oas3Method, OPENAPI3_METHOD_NAMES } from '../../split/types.js';

packages/cli/src/commands/join/index.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,11 @@ import {
88
isPlainObject,
99
isEmptyObject,
1010
getTypes,
11+
type Document,
12+
type BundleResult,
13+
type Oas3Server,
14+
type SpecVersion,
1115
} from '@redocly/openapi-core';
12-
import type { Document, BundleResult, Oas3Server, SpecVersion } from '@redocly/openapi-core';
1316
import { blue, yellow } from 'colorette';
1417
import * as path from 'node:path';
1518
import { performance } from 'node:perf_hooks';

packages/cli/src/commands/lint.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,10 @@ import {
66
pluralize,
77
ConfigValidationError,
88
logger,
9+
type Config,
10+
type Exact,
11+
type OutputFormat,
912
} from '@redocly/openapi-core';
10-
import type { Config, Exact, OutputFormat } from '@redocly/openapi-core';
1113
import { blue, gray } from 'colorette';
1214
import { performance } from 'perf_hooks';
1315
import type { Arguments } from 'yargs';

packages/cli/src/commands/respect/json-logs.ts

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1-
import { calculateTotals, conditionallyMaskSecrets } from '@redocly/respect-core';
2-
import type {
3-
TestContext,
4-
JsonLogs,
5-
WorkflowExecutionResult,
6-
WorkflowExecutionResultJson,
7-
Step,
8-
StepExecutionResult,
9-
Check,
1+
import {
2+
calculateTotals,
3+
conditionallyMaskSecrets,
4+
type TestContext,
5+
type JsonLogs,
6+
type WorkflowExecutionResult,
7+
type WorkflowExecutionResultJson,
8+
type Step,
9+
type StepExecutionResult,
10+
type Check,
1011
} from '@redocly/respect-core';
1112

1213
export function composeJsonLogsFiles(

packages/cli/src/commands/scorecard-classic/auth/login-handler.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
import { logger } from '@redocly/openapi-core';
2-
import type { Config } from '@redocly/openapi-core';
1+
import { logger, type Config } from '@redocly/openapi-core';
32

43
import { RedoclyOAuthClient } from '../../../auth/oauth-client.js';
54
import { getReuniteUrl } from '../../../reunite/api/index.js';

packages/cli/src/commands/scorecard-classic/validation/plugin-evaluator.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
import { logger, pluralize } from '@redocly/openapi-core';
2-
import type { Plugin } from '@redocly/openapi-core';
1+
import { logger, pluralize, type Plugin } from '@redocly/openapi-core';
32

43
type PluginFunction = () => Plugin;
54

packages/cli/src/commands/split/index.ts

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,18 @@ import {
77
logger,
88
isEmptyObject,
99
isPlainObject,
10-
} from '@redocly/openapi-core';
11-
import type {
12-
Oas3Definition,
13-
Oas3_1Definition,
14-
Oas3_2Definition,
15-
Oas2Definition,
16-
Oas3Schema,
17-
Oas3_1Schema,
18-
Oas3Components,
19-
Oas3_1Components,
20-
Oas3ComponentName,
21-
Oas3PathItem,
22-
OasRef,
23-
Referenced,
10+
type Oas3Definition,
11+
type Oas3_1Definition,
12+
type Oas3_2Definition,
13+
type Oas2Definition,
14+
type Oas3Schema,
15+
type Oas3_1Schema,
16+
type Oas3Components,
17+
type Oas3_1Components,
18+
type Oas3ComponentName,
19+
type Oas3PathItem,
20+
type OasRef,
21+
type Referenced,
2422
} from '@redocly/openapi-core';
2523
import { red, blue, green } from 'colorette';
2624
import * as fs from 'node:fs';
@@ -39,8 +37,15 @@ import {
3937
getAndValidateFileExtension,
4038
} from '../../utils/miscellaneous.js';
4139
import type { CommandArgs } from '../../wrapper.js';
42-
import { COMPONENTS, OPENAPI3_METHOD_NAMES, OPENAPI3_COMPONENT_NAMES } from './types.js';
43-
import type { ComponentsFiles, Definition, Oas3Component, RefObject } from './types.js';
40+
import {
41+
COMPONENTS,
42+
OPENAPI3_METHOD_NAMES,
43+
OPENAPI3_COMPONENT_NAMES,
44+
type ComponentsFiles,
45+
type Definition,
46+
type Oas3Component,
47+
type RefObject,
48+
} from './types.js';
4449

4550
type AnyOas3Definition = Oas3Definition | Oas3_1Definition | Oas3_2Definition;
4651

packages/cli/src/commands/stats/index.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,10 @@ import {
88
walkDocument,
99
bundle,
1010
logger,
11-
} from '@redocly/openapi-core';
12-
import type {
13-
OASStatsAccumulator,
14-
AsyncAPIStatsAccumulator,
15-
WalkContext,
16-
OutputFormat,
11+
type OASStatsAccumulator,
12+
type AsyncAPIStatsAccumulator,
13+
type WalkContext,
14+
type OutputFormat,
1715
} from '@redocly/openapi-core';
1816
import * as colors from 'colorette';
1917
import { performance } from 'perf_hooks';

0 commit comments

Comments
 (0)