Skip to content

Commit fc81918

Browse files
committed
build: add separate typescript config for tests
- add `tsconfig.test.json` extending base configuration - include both source and test files in test config - add `typecheck` script to validate test files without emit
1 parent b546bdc commit fc81918

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@
9898
"build": "npm run build:tsc && npm run build:web:dev && npm run build:web:prod",
9999
"test:vitest": "vitest",
100100
"build:tsc": "tsc",
101+
"typecheck": "tsc --noEmit -p tsconfig.test.json",
101102
"build:web:dev": "webpack --config webpack.config.js --mode development",
102103
"build:web:prod": "webpack --config webpack.config.js --mode production",
103104
"build:tsc:watch": "tsc --watch",

tsconfig.test.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
"include": ["./src/**/*.ts", "./test/**/*.ts"],
4+
"compilerOptions": {
5+
"noEmit": true,
6+
"rootDir": "."
7+
}
8+
}

0 commit comments

Comments
 (0)