Skip to content

Commit 1d8e76a

Browse files
authored
Fix missing type defs, add lint rules to catch it (#1072)
1 parent c36838d commit 1d8e76a

30 files changed

+161
-154
lines changed

package.json

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,11 @@
3939
"dev": "tsc -p tsconfig.build.json --watch",
4040
"download:schemas": "vite-node ./scripts/download-schemas.ts",
4141
"format": "npm run prettier -w .",
42-
"lint": "eslint .",
42+
"lint": "eslint \"src/**/*.{js,ts}\"",
4343
"prepare": "npm run build",
44-
"test": "vitest run",
45-
"test:coverage": "vitest run --coverage",
44+
"test": "npm run test:ts && vitest run",
45+
"test:ts": "tsc --noEmit",
46+
"test:coverage": "npm run test:ts && vitest run --coverage",
4647
"update:examples": "vite-node ./scripts/update-examples.ts",
4748
"version": "npm run build"
4849
},
@@ -58,8 +59,8 @@
5859
"@types/degit": "^2.8.3",
5960
"@types/js-yaml": "^4.0.5",
6061
"@types/node": "^18.15.11",
61-
"@typescript-eslint/eslint-plugin": "^5.57.0",
62-
"@typescript-eslint/parser": "^5.57.0",
62+
"@typescript-eslint/eslint-plugin": "^5.57.1",
63+
"@typescript-eslint/parser": "^5.57.1",
6364
"@vitest/coverage-c8": "^0.29.8",
6465
"degit": "^2.8.4",
6566
"del-cli": "^5.0.0",
@@ -69,7 +70,7 @@
6970
"execa": "^6.1.0",
7071
"prettier": "^2.8.7",
7172
"typescript": "^5.0.3",
72-
"vite": "^4.1.4",
73+
"vite": "^4.2.1",
7374
"vite-node": "^0.29.8",
7475
"vitest": "^0.29.8"
7576
}

pnpm-lock.yaml

Lines changed: 116 additions & 116 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { GlobalContext, OpenAPI3, OpenAPITSOptions, Subschema } from "./types";
1+
import type { GlobalContext, OpenAPI3, OpenAPITSOptions, Subschema } from "./types.js";
22
import type { Readable } from "node:stream";
33
import { URL } from "node:url";
44
import load, { resolveSchema, VIRTUAL_JSON_URL } from "./load.js";

src/load.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import type {
1111
ResponseObject,
1212
SchemaObject,
1313
Subschema,
14-
} from "./types";
14+
} from "./types.js";
1515
import fs from "node:fs";
1616
import path from "node:path";
1717
import { Readable } from "node:stream";

src/transform/components-object.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { ComponentsObject, GlobalContext } from "../types";
1+
import type { ComponentsObject, GlobalContext } from "../types.js";
22
import { escObjKey, getEntries, getSchemaObjectComment, indent, tsOptionalProperty, tsReadonly } from "../utils.js";
33
import transformHeaderObject from "./header-object.js";
44
import transformParameterObject from "./parameter-object.js";

src/transform/header-object.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { GlobalContext, HeaderObject } from "../types";
1+
import type { GlobalContext, HeaderObject } from "../types.js";
22
import { escStr, getEntries, getSchemaObjectComment, indent, tsReadonly } from "../utils.js";
33
import transformMediaTypeObject from "./media-type-object.js";
44
import transformSchemaObject from "./schema-object.js";

src/transform/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { GlobalContext, OpenAPI3 } from "../types";
1+
import type { GlobalContext, OpenAPI3 } from "../types.js";
22
import transformComponentsObject from "./components-object.js";
33
import transformPathsObject from "./paths-object.js";
44
import transformWebhooksObject from "./webhooks-object.js";

src/transform/media-type-object.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { GlobalContext, MediaTypeObject } from "../types";
1+
import type { GlobalContext, MediaTypeObject } from "../types.js";
22
import transformSchemaObject from "./schema-object.js";
33

44
export interface TransformMediaTypeObjectOptions {

src/transform/operation-object.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { GlobalContext, OperationObject, ParameterObject } from "../types";
1+
import type { GlobalContext, OperationObject, ParameterObject } from "../types.js";
22
import { escObjKey, getEntries, getSchemaObjectComment, indent, tsOptionalProperty, tsReadonly } from "../utils.js";
33
import transformParameterObject from "./parameter-object.js";
44
import transformRequestBodyObject from "./request-body-object.js";

src/transform/parameter-object-array.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { GlobalContext, ParameterObject, ReferenceObject } from "types";
1+
import type { GlobalContext, ParameterObject, ReferenceObject } from "../types.js";
22
import { escObjKey, indent, tsOptionalProperty, tsReadonly } from "../utils.js";
33
import transformParameterObject from "./parameter-object.js";
44

0 commit comments

Comments
 (0)