Compile TS of the whole project to detect type errors

- was not covered by TS lint
- TS errors are only noticed in broken builds
- added grunt task to run `tsc --noEmit`
This commit is contained in:
David Kaltschmidt
2018-09-27 15:15:41 +02:00
parent 31b8bf2d47
commit 88f36cbd22
2 changed files with 7 additions and 5 deletions
+5 -4
View File
@@ -1,5 +1,5 @@
// Lint and build CSS
module.exports = function(grunt) {
module.exports = function (grunt) {
'use strict';
grunt.registerTask('default', [
@@ -18,15 +18,16 @@ module.exports = function(grunt) {
grunt.registerTask('precommit', [
'sasslint',
'exec:tslint',
'exec:tsc',
'no-only-tests'
]);
grunt.registerTask('no-only-tests', function() {
grunt.registerTask('no-only-tests', function () {
var files = grunt.file.expand('public/**/*_specs\.ts', 'public/**/*_specs\.js');
files.forEach(function(spec) {
files.forEach(function (spec) {
var rows = grunt.file.read(spec).split('\n');
rows.forEach(function(row) {
rows.forEach(function (row) {
if (row.indexOf('.only(') > 0) {
grunt.log.errorlns(row);
grunt.fail.warn('found only statement in test: ' + spec)