Skip to content

Commit d344dca

Browse files
committed
[Build]: add type-check to npm scripts and ci
1 parent fce69eb commit d344dca

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@
77
"scripts": {
88
"coveralls": "cat ./reports/coverage/lcov.info | coveralls",
99
"lint": "eslint ./",
10-
"pretest": "npm run lint",
10+
"pretest": "npm run lint && npm run type-check",
1111
"test": "npm run unit-test",
12+
"type-check": "tsc",
1213
"unit-test": "istanbul cover --dir reports/coverage node_modules/mocha/bin/_mocha tests/lib/**/*.js tests/util/**/*.js tests/index.js"
1314
},
1415
"files": [

tsconfig.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"compilerOptions": {
3+
"target": "ES2015", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */
4+
"module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */
5+
"lib": ["es2016"], /* Specify library files to be included in the compilation. */
6+
"allowJs": true, /* Allow javascript files to be compiled. */
7+
"checkJs": true, /* Report errors in .js files. */
8+
"noEmit": true, /* Do not emit outputs. */
9+
10+
/* Strict Type-Checking Options */
11+
// "strict": true, /* Enable all strict type-checking options. */
12+
// "noImplicitAny": false, /* Raise error on expressions and declarations with an implied 'any' type. */
13+
// "strictNullChecks": true, /* Enable strict null checks. */
14+
// "strictFunctionTypes": true, /* Enable strict checking of function types. */
15+
// "strictBindCallApply": true, /* Enable strict 'bind', 'call', and 'apply' methods on functions. */
16+
// "strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */
17+
// "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */
18+
// "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */
19+
},
20+
"include": ["lib"],
21+
}

0 commit comments

Comments
 (0)