From 7a8d191252d0cc7dd815523243e2d5f9fc8ae695 Mon Sep 17 00:00:00 2001 From: Matt Pocock Date: Tue, 14 May 2024 07:34:59 +0100 Subject: [PATCH 1/3] Moved to @total-typescript/tsconfig --- .github/workflows/renovate-checks.yml | 1 + package-lock.json | 13 +++++++++++++ package.json | 1 + src/10-set.problem.ts | 2 +- src/10-set.solution.ts | 2 +- src/14-extends.problem.ts | 2 +- src/14-extends.solution.ts | 2 +- src/16-omit-and-pick.problem.ts | 2 +- src/16-omit-and-pick.solution.1.ts | 2 +- src/16-omit-and-pick.solution.2.ts | 2 +- src/17-function-types.problem.ts | 2 +- src/17-function-types.solution.1.ts | 2 +- src/17-function-types.solution.2.ts | 2 +- tsconfig.json | 15 +-------------- 14 files changed, 26 insertions(+), 24 deletions(-) diff --git a/.github/workflows/renovate-checks.yml b/.github/workflows/renovate-checks.yml index fa3c6425..6676e46c 100644 --- a/.github/workflows/renovate-checks.yml +++ b/.github/workflows/renovate-checks.yml @@ -3,6 +3,7 @@ on: push: branches: - "renovate/**" + - "ci-check/**" jobs: build: diff --git a/package-lock.json b/package-lock.json index bd46c532..aaace67d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15,6 +15,7 @@ }, "devDependencies": { "@total-typescript/exercise-cli": "^0.6.0", + "@total-typescript/tsconfig": "^1.0.3", "@types/node": "^18.6.5", "cross-fetch": "^3.1.5", "jsdom": "^21.1.1", @@ -620,6 +621,12 @@ "vitest": "*" } }, + "node_modules/@total-typescript/tsconfig": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@total-typescript/tsconfig/-/tsconfig-1.0.3.tgz", + "integrity": "sha512-AIb/Vyg2ti88L1eASMUcg7H3B6eJDT9SmUgR+qADli0aeEaU+qRIcv/Mtr07hJ03CPaRl6TmlMzCgO6sXjPTRQ==", + "dev": true + }, "node_modules/@types/body-parser": { "version": "1.19.2", "resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.19.2.tgz", @@ -3631,6 +3638,12 @@ "prompts": "^2.4.2" } }, + "@total-typescript/tsconfig": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@total-typescript/tsconfig/-/tsconfig-1.0.3.tgz", + "integrity": "sha512-AIb/Vyg2ti88L1eASMUcg7H3B6eJDT9SmUgR+qADli0aeEaU+qRIcv/Mtr07hJ03CPaRl6TmlMzCgO6sXjPTRQ==", + "dev": true + }, "@types/body-parser": { "version": "1.19.2", "resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.19.2.tgz", diff --git a/package.json b/package.json index 51ef7983..aaaaea52 100644 --- a/package.json +++ b/package.json @@ -7,6 +7,7 @@ "license": "GPL-3.0", "devDependencies": { "@total-typescript/exercise-cli": "^0.6.0", + "@total-typescript/tsconfig": "^1.0.3", "@types/node": "^18.6.5", "cross-fetch": "^3.1.5", "jsdom": "^21.1.1", diff --git a/src/10-set.problem.ts b/src/10-set.problem.ts index 0f318a4c..0afd7336 100644 --- a/src/10-set.problem.ts +++ b/src/10-set.problem.ts @@ -1,5 +1,5 @@ import { expect, it } from "vitest"; -import { Equal, Expect } from "./helpers/type-utils"; +import type { Equal, Expect } from "./helpers/type-utils"; const guitarists = new Set(); diff --git a/src/10-set.solution.ts b/src/10-set.solution.ts index 0bd251cc..ec8d8167 100644 --- a/src/10-set.solution.ts +++ b/src/10-set.solution.ts @@ -1,5 +1,5 @@ import { expect, it } from "vitest"; -import { Equal, Expect } from "./helpers/type-utils"; +import type { Equal, Expect } from "./helpers/type-utils"; const guitarists = new Set(); diff --git a/src/14-extends.problem.ts b/src/14-extends.problem.ts index e4689052..54dc1a6e 100644 --- a/src/14-extends.problem.ts +++ b/src/14-extends.problem.ts @@ -1,4 +1,4 @@ -import { Equal, Expect } from "./helpers/type-utils"; +import type { Equal, Expect } from "./helpers/type-utils"; /** * Here, the id property is shared between all three diff --git a/src/14-extends.solution.ts b/src/14-extends.solution.ts index 8d393baa..e3f77f74 100644 --- a/src/14-extends.solution.ts +++ b/src/14-extends.solution.ts @@ -1,4 +1,4 @@ -import { Equal, Expect } from "./helpers/type-utils"; +import type { Equal, Expect } from "./helpers/type-utils"; /** * Here, the id property is shared between all three diff --git a/src/16-omit-and-pick.problem.ts b/src/16-omit-and-pick.problem.ts index 8d75c8b9..e209db3a 100644 --- a/src/16-omit-and-pick.problem.ts +++ b/src/16-omit-and-pick.problem.ts @@ -1,4 +1,4 @@ -import { Equal, Expect } from "./helpers/type-utils"; +import type { Equal, Expect } from "./helpers/type-utils"; interface User { id: string; diff --git a/src/16-omit-and-pick.solution.1.ts b/src/16-omit-and-pick.solution.1.ts index 087fadda..a84c29c6 100644 --- a/src/16-omit-and-pick.solution.1.ts +++ b/src/16-omit-and-pick.solution.1.ts @@ -1,4 +1,4 @@ -import { Equal, Expect } from "./helpers/type-utils"; +import type { Equal, Expect } from "./helpers/type-utils"; interface User { id: string; diff --git a/src/16-omit-and-pick.solution.2.ts b/src/16-omit-and-pick.solution.2.ts index 99e18ffe..9d3e68c8 100644 --- a/src/16-omit-and-pick.solution.2.ts +++ b/src/16-omit-and-pick.solution.2.ts @@ -1,4 +1,4 @@ -import { Equal, Expect } from "./helpers/type-utils"; +import type { Equal, Expect } from "./helpers/type-utils"; interface User { id: string; diff --git a/src/17-function-types.problem.ts b/src/17-function-types.problem.ts index a228d9e7..4e71481a 100644 --- a/src/17-function-types.problem.ts +++ b/src/17-function-types.problem.ts @@ -1,4 +1,4 @@ -import { Equal, Expect } from "./helpers/type-utils"; +import type { Equal, Expect } from "./helpers/type-utils"; /** * How do we type onFocusChange? diff --git a/src/17-function-types.solution.1.ts b/src/17-function-types.solution.1.ts index 12e6a417..7de36fbb 100644 --- a/src/17-function-types.solution.1.ts +++ b/src/17-function-types.solution.1.ts @@ -1,4 +1,4 @@ -import { Equal, Expect } from "./helpers/type-utils"; +import type { Equal, Expect } from "./helpers/type-utils"; /** * How do we type onFocusChange? diff --git a/src/17-function-types.solution.2.ts b/src/17-function-types.solution.2.ts index 01325591..c80f4b51 100644 --- a/src/17-function-types.solution.2.ts +++ b/src/17-function-types.solution.2.ts @@ -1,4 +1,4 @@ -import { Equal, Expect } from "./helpers/type-utils"; +import type { Equal, Expect } from "./helpers/type-utils"; /** * How do we type onFocusChange? diff --git a/tsconfig.json b/tsconfig.json index bedcd452..6d4c4e32 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,18 +1,5 @@ { - "compilerOptions": { - "types": [ - "vitest/importMeta" - ], - "target": "es2020", - "module": "ES2022", - "moduleResolution": "Bundler", - "noEmit": true, - "isolatedModules": true, - "esModuleInterop": true, - "forceConsistentCasingInFileNames": true, - "strict": true, - "skipLibCheck": true - }, + "extends": "@total-typescript/tsconfig/bundler", "include": [ "src" ] From 7ddb723126601560eca11264e9abafbac631186e Mon Sep 17 00:00:00 2001 From: Matt Pocock Date: Tue, 14 May 2024 07:36:47 +0100 Subject: [PATCH 2/3] Updated tsconfig.json to match exercises --- tsconfig.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tsconfig.json b/tsconfig.json index 6d4c4e32..0b7bd181 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,5 +1,8 @@ { "extends": "@total-typescript/tsconfig/bundler", + "compilerOptions": { + "noUncheckedIndexedAccess": false + }, "include": [ "src" ] From efe5237491b8c81f2a2c1c7a63e655d458b989cb Mon Sep 17 00:00:00 2001 From: Matt Pocock Date: Tue, 14 May 2024 07:38:22 +0100 Subject: [PATCH 3/3] Removed import type --- src/10-set.problem.ts | 2 +- src/10-set.solution.ts | 2 +- src/14-extends.problem.ts | 2 +- src/14-extends.solution.ts | 2 +- src/16-omit-and-pick.problem.ts | 2 +- src/16-omit-and-pick.solution.1.ts | 2 +- src/16-omit-and-pick.solution.2.ts | 2 +- src/17-function-types.problem.ts | 2 +- src/17-function-types.solution.1.ts | 2 +- src/17-function-types.solution.2.ts | 2 +- tsconfig.json | 3 ++- 11 files changed, 12 insertions(+), 11 deletions(-) diff --git a/src/10-set.problem.ts b/src/10-set.problem.ts index 0afd7336..0f318a4c 100644 --- a/src/10-set.problem.ts +++ b/src/10-set.problem.ts @@ -1,5 +1,5 @@ import { expect, it } from "vitest"; -import type { Equal, Expect } from "./helpers/type-utils"; +import { Equal, Expect } from "./helpers/type-utils"; const guitarists = new Set(); diff --git a/src/10-set.solution.ts b/src/10-set.solution.ts index ec8d8167..0bd251cc 100644 --- a/src/10-set.solution.ts +++ b/src/10-set.solution.ts @@ -1,5 +1,5 @@ import { expect, it } from "vitest"; -import type { Equal, Expect } from "./helpers/type-utils"; +import { Equal, Expect } from "./helpers/type-utils"; const guitarists = new Set(); diff --git a/src/14-extends.problem.ts b/src/14-extends.problem.ts index 54dc1a6e..e4689052 100644 --- a/src/14-extends.problem.ts +++ b/src/14-extends.problem.ts @@ -1,4 +1,4 @@ -import type { Equal, Expect } from "./helpers/type-utils"; +import { Equal, Expect } from "./helpers/type-utils"; /** * Here, the id property is shared between all three diff --git a/src/14-extends.solution.ts b/src/14-extends.solution.ts index e3f77f74..8d393baa 100644 --- a/src/14-extends.solution.ts +++ b/src/14-extends.solution.ts @@ -1,4 +1,4 @@ -import type { Equal, Expect } from "./helpers/type-utils"; +import { Equal, Expect } from "./helpers/type-utils"; /** * Here, the id property is shared between all three diff --git a/src/16-omit-and-pick.problem.ts b/src/16-omit-and-pick.problem.ts index e209db3a..8d75c8b9 100644 --- a/src/16-omit-and-pick.problem.ts +++ b/src/16-omit-and-pick.problem.ts @@ -1,4 +1,4 @@ -import type { Equal, Expect } from "./helpers/type-utils"; +import { Equal, Expect } from "./helpers/type-utils"; interface User { id: string; diff --git a/src/16-omit-and-pick.solution.1.ts b/src/16-omit-and-pick.solution.1.ts index a84c29c6..087fadda 100644 --- a/src/16-omit-and-pick.solution.1.ts +++ b/src/16-omit-and-pick.solution.1.ts @@ -1,4 +1,4 @@ -import type { Equal, Expect } from "./helpers/type-utils"; +import { Equal, Expect } from "./helpers/type-utils"; interface User { id: string; diff --git a/src/16-omit-and-pick.solution.2.ts b/src/16-omit-and-pick.solution.2.ts index 9d3e68c8..99e18ffe 100644 --- a/src/16-omit-and-pick.solution.2.ts +++ b/src/16-omit-and-pick.solution.2.ts @@ -1,4 +1,4 @@ -import type { Equal, Expect } from "./helpers/type-utils"; +import { Equal, Expect } from "./helpers/type-utils"; interface User { id: string; diff --git a/src/17-function-types.problem.ts b/src/17-function-types.problem.ts index 4e71481a..a228d9e7 100644 --- a/src/17-function-types.problem.ts +++ b/src/17-function-types.problem.ts @@ -1,4 +1,4 @@ -import type { Equal, Expect } from "./helpers/type-utils"; +import { Equal, Expect } from "./helpers/type-utils"; /** * How do we type onFocusChange? diff --git a/src/17-function-types.solution.1.ts b/src/17-function-types.solution.1.ts index 7de36fbb..12e6a417 100644 --- a/src/17-function-types.solution.1.ts +++ b/src/17-function-types.solution.1.ts @@ -1,4 +1,4 @@ -import type { Equal, Expect } from "./helpers/type-utils"; +import { Equal, Expect } from "./helpers/type-utils"; /** * How do we type onFocusChange? diff --git a/src/17-function-types.solution.2.ts b/src/17-function-types.solution.2.ts index c80f4b51..01325591 100644 --- a/src/17-function-types.solution.2.ts +++ b/src/17-function-types.solution.2.ts @@ -1,4 +1,4 @@ -import type { Equal, Expect } from "./helpers/type-utils"; +import { Equal, Expect } from "./helpers/type-utils"; /** * How do we type onFocusChange? diff --git a/tsconfig.json b/tsconfig.json index 0b7bd181..2ca5a708 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,7 +1,8 @@ { "extends": "@total-typescript/tsconfig/bundler", "compilerOptions": { - "noUncheckedIndexedAccess": false + "noUncheckedIndexedAccess": false, + "verbatimModuleSyntax": false }, "include": [ "src"