Skip to content

Commit 4490904

Browse files
authored
build: add type checking (#155)
1 parent d28d85a commit 4490904

File tree

21 files changed

+49
-18
lines changed

21 files changed

+49
-18
lines changed

.github/workflows/checks.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,3 +122,28 @@ jobs:
122122

123123
- name: Check Format
124124
run: pnpm exec prettier --check .
125+
126+
type-check:
127+
name: Type Check
128+
runs-on: ubuntu-latest
129+
steps:
130+
- name: Checkout Repository (deep)
131+
uses: actions/checkout@v4
132+
with:
133+
fetch-depth: 0
134+
135+
- uses: pnpm/action-setup@v3
136+
with:
137+
version: 9
138+
139+
- name: Setup Node.js 20.x
140+
uses: actions/setup-node@v3
141+
with:
142+
node-version: 20.x
143+
cache: pnpm
144+
145+
- name: Install
146+
run: pnpm install --frozen-lockfile
147+
148+
- name: Type Check
149+
run: pnpm run type-check

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
},
2424
"devDependencies": {
2525
"@eslint/js": "^9.0.0",
26+
"@jest/globals": "^29.7.0",
2627
"@microsoft/api-extractor": "^7.43.1",
2728
"@nx/eslint": "19.2.2",
2829
"@nx/jest": "19.2.2",
@@ -41,7 +42,6 @@
4142
"@tools/tsconfig": "workspace:*",
4243
"@trivago/prettier-plugin-sort-imports": "^4.3.0",
4344
"@types/bun": "1.1.0",
44-
"@types/jest": "^29.4.0",
4545
"@types/node": "20.12.7",
4646
"@vitest/ui": "^1.3.1",
4747
"conventional-versioning": "0.2.0-rc.8",

packages/analyzer/tsconfig.json

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

packages/cli/src/logger.spec.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { LogFormatter, LogLevel, LogUncolorize, Logger } from "./logger.js";
2+
import { it, describe, expect } from "@jest/globals";
23
import chalk from "chalk";
34
import assert from "node:assert/strict";
45

packages/fabricator/src/chunk.spec.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { Chunk } from "./chunk.js";
2+
import { it, describe, expect } from "@jest/globals";
23
import { Range } from "@knuckles/location";
34

45
describe("Chunk", () => {

packages/fabricator/src/location.spec.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { DynamicPosition, DynamicRange } from "./location.js";
2+
import { it, describe, expect } from "@jest/globals";
23

34
describe("DynamicPosition", () => {
45
it("translates position", () => {

packages/fabricator/src/mapping.spec.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { Chunk } from "./chunk.js";
2+
import { it, describe, expect } from "@jest/globals";
23
import { Range } from "@knuckles/location";
34
import assert from "node:assert/strict";
45

packages/fabricator/src/marker.spec.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { Chunk } from "./chunk.js";
2+
import { it, describe, expect } from "@jest/globals";
23

34
describe("Marker", () => {
45
it("remembers marker position", () => {

packages/fabricator/src/snapshot.spec.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { Chunk } from "./chunk.js";
22
import { type Snapshot } from "./snapshot.js";
3+
import { it, describe, expect, beforeAll } from "@jest/globals";
34
import { Position, Range } from "@knuckles/location";
45

56
describe("Snapshot", () => {

packages/fabricator/src/tracker.spec.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { Chunk } from "./chunk.js";
2+
import { it, describe, expect } from "@jest/globals";
23

34
describe("Tracker", () => {
45
it("tracks changes", () => {

packages/location/src/position.spec.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import Position from "./position.js";
2+
import { it, describe, expect } from "@jest/globals";
23

34
describe("Position", () => {
45
it("Converts offset to position using LF", () => {

packages/parser/src/parser.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { parse } from "./parse.js";
2+
import { test, describe, expect } from "@jest/globals";
23

34
describe("parser", () => {
45
test("Deep virtual elements", () => {

packages/ssr/test/binding-context.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { html, render } from "./common.js";
2+
import { test, describe } from "@jest/globals";
23
import assert from "node:assert/strict";
34

45
describe("binding context", () => {

packages/ssr/test/eval.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { transform } from "../src/evaluate.js";
2+
import { test, describe } from "@jest/globals";
23
import assert from "node:assert/strict";
34

45
describe("evaluation", () => {

packages/ssr/test/non-strict.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { html, render } from "./common.js";
2+
import { test, describe } from "@jest/globals";
23
import assert from "node:assert/strict";
34

45
describe("non-strict", () => {

packages/ssr/test/rollup.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import knockoutSSR from "../src/rollup/plugin.js";
2+
import { test, describe } from "@jest/globals";
23
import assert from "node:assert/strict";
34
import { rollup } from "rollup";
45

packages/ssr/test/ssr.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import * as ssr from "../src/node/index.js";
22
import { html, render } from "./common.js";
3+
import { test, describe } from "@jest/globals";
34
import assert from "node:assert/strict";
45

56
describe("server-side rendering", () => {

packages/ssr/test/webpack.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { test, describe } from "@jest/globals";
12
import { createFsFromVolume, Volume } from "memfs";
23
import assert from "node:assert/strict";
34
import webpack from "webpack";
@@ -33,7 +34,7 @@ describe("webpack (build-tool)", () => {
3334
return done(err);
3435
}
3536

36-
const close = (err?: unknown) => {
37+
const close = (err?: any) => {
3738
compiler.close((closeErr) => {
3839
if (err) {
3940
return done(err);

packages/typescript/tsconfig.json

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

pnpm-lock.yaml

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

tools/tsconfig/jest.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{
22
"extends": "./node.json",
33
"compilerOptions": {
4-
"types": ["jest", "node"],
54
"verbatimModuleSyntax": false,
65
"moduleDetection": "force",
76
"moduleResolution": "Bundler",

0 commit comments

Comments
 (0)