Skip to content

Commit 9516f77

Browse files
committed
test: run type-checking in the lint
1 parent 14e9c5e commit 9516f77

File tree

4 files changed

+29
-9
lines changed

4 files changed

+29
-9
lines changed

.vscode/settings.json

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,21 @@
11
{
2+
"[typescript]": {
3+
"editor.defaultFormatter": "esbenp.prettier-vscode"
4+
},
5+
"[javascript]": {
6+
"editor.defaultFormatter": "esbenp.prettier-vscode"
7+
},
8+
"[json]": {
9+
"editor.defaultFormatter": "esbenp.prettier-vscode"
10+
},
11+
"[jsonc]": {
12+
"editor.defaultFormatter": "esbenp.prettier-vscode"
13+
},
214
"mochaExplorer.parallel": true,
315
"mochaExplorer.globImplementation": "vscode",
4-
"mochaExplorer.nodeArgv": ["--expose-gc"],
16+
"mochaExplorer.nodeArgv": [
17+
"--expose-gc"
18+
],
519
"mochaExplorer.debuggerConfig": "JS-Attach",
620
"files.exclude": {
721
"**/.DS_Store": true,

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,13 +102,15 @@
102102
"test.skip_gc_tests": "run-s clean.temp build.debug && cross-env SKIP_GC_TESTS=true mocha",
103103
"test.electron.main": "run-s clean.temp build && electron-mocha",
104104
"format": "run-s format.prettier format.clang-format",
105-
"format.prettier": "prettier --write .",
105+
"format.prettier": "prettier -l --cache --cache-location ./.cache/prettier --write .",
106106
"format.clang-format": "clang-format -i -style=file ./src/*.cc ./src/*.h ./src/util/*.h",
107107
"test.electron.renderer": "run-s build && electron-mocha --renderer",
108108
"lint-test.eslint": "eslint ./**/*.{ts,tsx,js,jsx,cjs,mjs,json,yaml} --no-error-on-unmatched-pattern --cache --cache-location ./.cache/eslint/",
109109
"lint.eslint": "pnpm run lint-test.eslint --fix",
110+
"lint.tsc": "tsc --noEmit -p ./src/tsconfig.json",
111+
"lint.tsc-test": "tsc --noEmit -p ./test/tsconfig.json",
110112
"lint.clang-tidy": "git ls-files --exclude-standard | grep -E '\\.(cpp|hpp|c|cc|cxx|hxx|h|ixx)$' | xargs -n 1 -P $(nproc) clang-tidy",
111-
"lint": "run-p format lint.eslint format",
113+
"lint": "run-p lint.tsc-test lint.tsc lint.eslint format",
112114
"lint-test": "run-s lint-test.eslint",
113115
"bench": "node --expose-gc test/bench",
114116
"prepare": "pnpm run build.js",

test/tsconfig.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
11
{
22
"extends": "../tsconfig.json",
3-
"include": ["**/*.ts"]
3+
"include": ["**/*.ts"],
4+
"compilerOptions": {
5+
"skipLibCheck": true,
6+
"lib": [
7+
"ES2020",
8+
// only used in tests
9+
"ES2021.WeakRef"
10+
]
11+
}
412
}

tsconfig.json

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,6 @@
1919
"incremental": true,
2020
"sourceMap": true,
2121
"esModuleInterop": true,
22-
"lib": [
23-
"ES2020",
24-
// only used in tests
25-
"ES2021.WeakRef"
26-
]
22+
"lib": ["ES2020"]
2723
}
2824
}

0 commit comments

Comments
 (0)