Skip to content

Commit d7d7446

Browse files
golopotljharb
authored andcommitted
[Build]: add type-check to npm scripts and ci
1 parent eb90ce6 commit d7d7446

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,10 @@
77
"scripts": {
88
"coveralls": "cat ./reports/coverage/lcov.info | coveralls",
99
"lint": "eslint ./",
10+
"postlint": "npm run type-check",
1011
"pretest": "npm run lint",
1112
"test": "npm run unit-test",
13+
"type-check": "tsc",
1214
"unit-test": "istanbul cover --dir reports/coverage node_modules/mocha/bin/_mocha tests/lib/**/*.js tests/util/**/*.js tests/index.js"
1315
},
1416
"files": [

tsconfig.json

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
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": ["es2015"], /* 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+
"esModuleInterop": true, /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
10+
11+
/* Strict Type-Checking Options */
12+
// "strict": true, /* Enable all strict type-checking options. */
13+
"noImplicitAny": false, /* Raise error on expressions and declarations with an implied 'any' type. */
14+
// "strictNullChecks": true, /* Enable strict null checks. */
15+
// "strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */
16+
"strictFunctionTypes": true, /* Enable strict checking of function types. */
17+
"strictBindCallApply": true, /* Enable strict 'bind', 'call', and 'apply' methods on functions. */
18+
"noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */
19+
"alwaysStrict": false, /* Parse in strict mode and emit "use strict" for each source file. */
20+
},
21+
"include": ["lib"],
22+
}

0 commit comments

Comments
 (0)