diff --git a/package-lock.json b/package-lock.json index 9280901a4..bd13ae7a1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -19,7 +19,7 @@ }, "devDependencies": { "@octokit/auth": "^3.0.1", - "@octokit/tsconfig": "^1.0.2", + "@octokit/tsconfig": "^2.0.0", "@types/fetch-mock": "^7.3.1", "@types/jest": "^29.0.0", "@types/lolex": "^5.1.0", @@ -2448,9 +2448,9 @@ } }, "node_modules/@octokit/tsconfig": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@octokit/tsconfig/-/tsconfig-1.0.2.tgz", - "integrity": "sha512-I0vDR0rdtP8p2lGMzvsJzbhdOWy405HcGovrspJ8RRibHnyRgggUSNO5AIox5LmqiwmatHKYsvj6VGFHkqS7lA==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@octokit/tsconfig/-/tsconfig-2.0.0.tgz", + "integrity": "sha512-tWnrai3quGt8+gRN2edzo9fmraWekeryXPeXDomMw2oFSpu/lH3VSWGn/q4V+rwjTRMeeXk/ci623/01Zet4VQ==", "dev": true }, "node_modules/@octokit/types": { @@ -15261,9 +15261,9 @@ } }, "@octokit/tsconfig": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@octokit/tsconfig/-/tsconfig-1.0.2.tgz", - "integrity": "sha512-I0vDR0rdtP8p2lGMzvsJzbhdOWy405HcGovrspJ8RRibHnyRgggUSNO5AIox5LmqiwmatHKYsvj6VGFHkqS7lA==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@octokit/tsconfig/-/tsconfig-2.0.0.tgz", + "integrity": "sha512-tWnrai3quGt8+gRN2edzo9fmraWekeryXPeXDomMw2oFSpu/lH3VSWGn/q4V+rwjTRMeeXk/ci623/01Zet4VQ==", "dev": true }, "@octokit/types": { diff --git a/package.json b/package.json index d710309b5..fae09c46f 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,7 @@ }, "devDependencies": { "@octokit/auth": "^3.0.1", - "@octokit/tsconfig": "^1.0.2", + "@octokit/tsconfig": "^2.0.0", "@types/fetch-mock": "^7.3.1", "@types/jest": "^29.0.0", "@types/lolex": "^5.1.0", @@ -53,7 +53,14 @@ "typescript": "^5.0.0" }, "jest": { - "preset": "ts-jest", + "transform": { + "^.+\\.(ts|tsx)$": [ + "ts-jest", + { + "tsconfig": "test/tsconfig.test.json" + } + ] + }, "coverageThreshold": { "global": { "statements": 100, diff --git a/src/index.ts b/src/index.ts index 8ca8b1da1..e1699bbc8 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,10 +1,11 @@ import { getUserAgent } from "universal-user-agent"; -import { Collection, HookCollection } from "before-after-hook"; +import type { HookCollection } from "before-after-hook"; +import { Collection } from "before-after-hook"; import { request } from "@octokit/request"; import { graphql, withCustomRequest } from "@octokit/graphql"; import { createTokenAuth } from "@octokit/auth-token"; -import { +import type { Constructor, Hooks, OctokitOptions, diff --git a/test/auth.test.ts b/test/auth.test.ts index 18a4ad988..0ee12df51 100644 --- a/test/auth.test.ts +++ b/test/auth.test.ts @@ -5,7 +5,7 @@ import { createActionAuth, createOAuthAppAuth, } from "@octokit/auth"; -import lolex, { Clock } from "lolex"; +import lolex, { type Clock } from "lolex"; import { Octokit } from "../src"; diff --git a/test/tsconfig.test.json b/test/tsconfig.test.json new file mode 100644 index 000000000..c41c024df --- /dev/null +++ b/test/tsconfig.test.json @@ -0,0 +1,11 @@ +{ + "extends": "../tsconfig.json", + "compilerOptions": { + "emitDeclarationOnly": false, + "noEmit": true, + "verbatimModuleSyntax": false + }, + "include": [ + "src/**/*" + ] +}