Skip to content

Commit ffc5ce7

Browse files
committed
Set up tsconfigs
This commit sets up tsconfigs to avoid type check errors and conflicts between @typed/test and microbundle. It does so by extending a base configuration in for both production and testing environments. The latter prepares the setup for @typed/test v10.0, where a tsconfig can be specified. Signed-off-by: Frederik Krautwald <[email protected]>
1 parent aa81b45 commit ffc5ce7

File tree

5 files changed

+35
-29
lines changed

5 files changed

+35
-29
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
"dist"
1010
],
1111
"scripts": {
12-
"prepublishOnly": "npm run build",
12+
"prepare": "npm run build",
1313
"build": "microbundle -i src/index.ts -f es,cjs",
14-
"test": "typed-test --typeCheck 'src/**/*.test.ts'"
14+
"test": "typed-test --typeCheck 'src/**/*.__test__.ts'"
1515
},
1616
"keywords": [
1717
"most",
File renamed without changes.

tsconfig.base.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"compilerOptions": {
3+
"target": "es5",
4+
"module": "es2015",
5+
"moduleResolution": "node",
6+
"lib": ["es2015", "es2016", "es2017"],
7+
"declaration": true,
8+
"sourceMap": true,
9+
"strict": true,
10+
"noUnusedLocals": true,
11+
"noUnusedParameters": true,
12+
"noImplicitAny": true,
13+
"noImplicitReturns": true,
14+
"noFallthroughCasesInSwitch": true,
15+
"strictNullChecks": true,
16+
"strictFunctionTypes": true,
17+
"allowSyntheticDefaultImports": true,
18+
"esModuleInterop": true
19+
},
20+
"exclude": ["node_modules", "src/**/*.__test__.ts"]
21+
}

tsconfig.json

Lines changed: 3 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,7 @@
11
{
2+
"extends": "./tsconfig.base.json",
23
"compilerOptions": {
3-
"moduleResolution": "node",
4-
"target": "es5",
5-
"module": "commonjs",
6-
"lib": [
7-
"es5",
8-
"es2015",
9-
"es2016",
10-
"es2017"
11-
],
12-
"incremental": true,
13-
"strict": true,
14-
"sourceMap": true,
15-
"declaration": true,
16-
"declarationDir": "dist",
17-
"outDir": "dist",
18-
"typeRoots": [
19-
"node_modules/@types"
20-
]
4+
"outDir": "dist"
215
},
22-
"exclude": [
23-
"experiments/**/*.ts",
24-
"examples/**/*.ts",
25-
"node_modules",
26-
"src/**/*.test.ts"
27-
],
28-
"include": [
29-
"src"
30-
]
6+
"include": ["src/**/*.ts"]
317
}

tsconfig.test.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"extends": "./tsconfig.base.json",
3+
"compilerOptions": {
4+
"lib": ["dom", "es2015", "es2016", "es2017"],
5+
"outDir": "__test__"
6+
},
7+
"include": ["src/**/*.__test__.ts"],
8+
"exclude": ["node_modules"]
9+
}

0 commit comments

Comments
 (0)