Skip to content

Commit

Permalink
[Build]: add type-check to npm scripts and ci
Browse files Browse the repository at this point in the history
  • Loading branch information
golopot authored and ljharb committed May 11, 2019
1 parent eb90ce6 commit 14fbe01
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
2 changes: 2 additions & 0 deletions package.json
Expand Up @@ -7,8 +7,10 @@
"scripts": {
"coveralls": "cat ./reports/coverage/lcov.info | coveralls",
"lint": "eslint ./",
"postlint": "npm run type-check",
"pretest": "npm run lint",
"test": "npm run unit-test",
"type-check": "tsc",
"unit-test": "istanbul cover --dir reports/coverage node_modules/mocha/bin/_mocha tests/lib/**/*.js tests/util/**/*.js tests/index.js"
},
"files": [
Expand Down
22 changes: 22 additions & 0 deletions tsconfig.json
@@ -0,0 +1,22 @@
{
"compilerOptions": {
"target": "ES2015", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */
"module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */
// "lib": ["es2015"], /* Specify library files to be included in the compilation. */
"allowJs": true, /* Allow javascript files to be compiled. */
"checkJs": true, /* Report errors in .js files. */
"noEmit": true, /* Do not emit outputs. */
"esModuleInterop": true, /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */

/* Strict Type-Checking Options */
// "strict": true, /* Enable all strict type-checking options. */
"noImplicitAny": false, /* Raise error on expressions and declarations with an implied 'any' type. */
// "strictNullChecks": true, /* Enable strict null checks. */
// "strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */
"strictFunctionTypes": true, /* Enable strict checking of function types. */
"strictBindCallApply": true, /* Enable strict 'bind', 'call', and 'apply' methods on functions. */
"noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */
"alwaysStrict": false, /* Parse in strict mode and emit "use strict" for each source file. */
},
"include": ["lib"],
}

0 comments on commit 14fbe01

Please sign in to comment.