Skip to content

Commit 6bb8618

Browse files
committedMay 28, 2022
build: improve how the tsconfig is handled for builds to better handle test ts checking.
1 parent 2b35684 commit 6bb8618

File tree

6 files changed

+15
-12
lines changed

6 files changed

+15
-12
lines changed
 

‎.eslintrc.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"plugins": ["import", "prettier"],
33
"extends": ["airbnb-typescript/base", "prettier"],
44
"parserOptions": {
5-
"project": "./tsconfig.test.json"
5+
"project": "./tsconfig.json"
66
},
77
"ignorePatterns": [
88
"lib/__fixtures__/**/*.ts",

‎jest.config.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const config: Config.InitialOptions = {
66
],
77
globals: {
88
"ts-jest": {
9-
tsconfig: "tsconfig.test.json",
9+
tsconfig: "tsconfig.json",
1010
},
1111
},
1212
moduleFileExtensions: ["ts", "js"],

‎package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
1818
"url": "https://github.com/Codex-/cosmiconfig-typescript-loader/issues"
1919
},
2020
"scripts": {
21-
"build": "tsc",
21+
"build": "tsc -p tsconfig.build.json",
22+
"build:types": "tsc",
2223
"format:check": "prettier --check \"{**/*,*}.{js,ts}\"",
2324
"format:write": "npm run format:check -- --write",
2425
"lint": "eslint --ext \".js,.ts\" .",

‎tsconfig.build.json

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
"compilerOptions": {
4+
"noEmit": false,
5+
"sourceMap": false
6+
},
7+
"exclude": ["**/__fixtures__/**/*", "**/*.spec.*"]
8+
}

‎tsconfig.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22
"compilerOptions": {
33
"target": "es2016",
44
"module": "commonjs",
5+
"noEmit": true,
56
"pretty": true,
6-
"sourceMap": false,
7+
"sourceMap": true,
78
"declaration": true,
89

910
"outDir": "dist",
@@ -15,5 +16,5 @@
1516
"strict": true
1617
},
1718
"include": ["lib"],
18-
"exclude": ["**/__fixtures__/**/*", "**/*.spec.*"]
19+
"exclude": ["**/__fixtures__/**/*"]
1920
}

‎tsconfig.test.json

-7
This file was deleted.

0 commit comments

Comments
 (0)
Please sign in to comment.