Skip to content

Commit 4a687bd

Browse files
authored
chore: lint fixes (orval-labs#2671)
1 parent adde443 commit 4a687bd

20 files changed

+38
-48
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
/* eslint-disable unicorn/consistent-function-scoping, unicorn/no-anonymous-default-export, @typescript-eslint/no-empty-function */
1+
/* eslint-disable unicorn/no-anonymous-default-export, @typescript-eslint/no-empty-function */
22
export default () => () => {};
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
/* eslint-disable unicorn/consistent-function-scoping, unicorn/no-anonymous-default-export, @typescript-eslint/no-empty-function, @typescript-eslint/no-unused-vars */
1+
/* eslint-disable unicorn/no-anonymous-default-export, @typescript-eslint/no-empty-function, @typescript-eslint/no-unused-vars */
22
export default () => (param1?: number) => {};
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
/* eslint-disable unicorn/consistent-function-scoping, unicorn/no-anonymous-default-export, @typescript-eslint/no-empty-function, @typescript-eslint/no-unused-vars */
1+
/* eslint-disable unicorn/no-anonymous-default-export, @typescript-eslint/no-empty-function, @typescript-eslint/no-unused-vars */
22
export default () => (param1?: number, param2?: number) => {};
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
/* eslint-disable unicorn/consistent-function-scoping, unicorn/no-anonymous-default-export, @typescript-eslint/no-empty-function, @typescript-eslint/no-unused-vars */
1+
/* eslint-disable unicorn/no-anonymous-default-export, @typescript-eslint/no-empty-function, @typescript-eslint/no-unused-vars */
22
export default () => (param1?: number, param2?: number, param3?: number) => {};

packages/core/src/generators/__tests__/mutator-test-files/named-export-tests.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* eslint-disable unicorn/consistent-function-scoping, @typescript-eslint/no-empty-function, @typescript-eslint/no-unused-vars */
1+
/* eslint-disable @typescript-eslint/no-empty-function, @typescript-eslint/no-unused-vars */
22

33
export function fn0Param() {}
44
export function fn1Param(param1?: number) {}

packages/core/src/generators/imports.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ interface GenerateImportsOptions {
1616
}
1717

1818
export function generateImports({
19-
imports = [],
19+
imports,
2020
namingConvention = NamingConvention.CAMEL_CASE,
2121
}: GenerateImportsOptions) {
2222
if (imports.length === 0) {
@@ -187,7 +187,7 @@ export function addDependency({
187187
}: AddDependencyOptions) {
188188
const toAdds = exports.filter((e) => {
189189
const searchWords = [e.alias, e.name].filter((p) => p?.length).join('|');
190-
const pattern = new RegExp(`\\b(${searchWords})\\b`, 'g');
190+
const pattern = new RegExp(String.raw`\b(${searchWords})\b`, 'g');
191191

192192
return implementation.match(pattern);
193193
});

packages/core/src/generators/schema-definition.ts

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,11 @@ import type {
1515
OpenApiSchemaObject,
1616
OpenApiSchemasObject,
1717
} from '../types';
18-
import {
19-
conventionName,
20-
isString,
21-
jsDoc,
22-
pascal,
23-
sanitize,
24-
upath,
25-
} from '../utils';
18+
import { conventionName, isString, jsDoc, pascal, sanitize } from '../utils';
2619
import { generateInterface } from './interface';
2720

2821
/**
2922
* Extract all types from #/components/schemas
30-
*
31-
* @param schemas
3223
*/
3324
export function generateSchemasDefinition(
3425
schemas: OpenApiSchemasObject = {},

packages/core/src/getters/combine.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ export function combineSchemas({
145145
(acc, subSchema) => {
146146
// aliasCombinedTypes (v7 compat): create intermediate types like ResponseAnyOf
147147
// v8 default: propName stays undefined so combined types are inlined directly
148-
let propName: string | undefined = undefined;
148+
let propName: string | undefined;
149149
if (context.output.override.aliasCombinedTypes) {
150150
propName = name ? name + pascal(separator) : undefined;
151151
if (propName && acc.schemas.length > 0) {

packages/core/src/getters/parameters.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ interface GetParametersOptions {
1313
}
1414

1515
export function getParameters({
16-
parameters = [],
16+
parameters,
1717
context,
1818
}: GetParametersOptions): GetterParameters {
1919
return parameters.reduce<GetterParameters>(

packages/core/src/getters/query-params.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ interface GetQueryParamsOptions {
119119
}
120120

121121
export function getQueryParams({
122-
queryParams = [],
122+
queryParams,
123123
operationName,
124124
context,
125125
suffix = 'params',

0 commit comments

Comments
 (0)