Skip to content

Commit 5ba3df3

Browse files
committed
MC-3095: Display TypeScript errors within local build process
- Use TSC directly to remove node output - Fix error message formatting
1 parent 90f77ce commit 5ba3df3

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

gulpfile.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ gulp.task('default', ['build', 'watch']);
3838
/**
3939
* Check for any new errors introduced since last build
4040
*/
41-
gulp.task('errors', shell.task("npm run-script ts:errors"));
41+
gulp.task('errors', shell.task("node_modules/typescript/bin/tsc --noEmit | node ts-error-stopgap.js"));
4242

4343
/**
4444
* Build the TypeScript files into production JS

ts-error-stopgap.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@ process.stdin.on('end', () => {
7878
}
7979

8080
console.log(
81-
chalk.red(`${newErrors.length} new TypeScript errors were introduced to the code base with your changes. \n`) +
82-
chalk.white.bgRed('You' , chalk.white.bgRed('must') , 'resolve all new TypeScript errors before merging a PR.')
81+
chalk.red(`${newErrors.length} new TypeScript error(s) were introduced to the code base with your changes. \n`) +
82+
chalk.white.bgRed('You must resolve all new TypeScript errors before merging a PR.')
8383
);
8484

8585
newErrors.forEach(err => {
@@ -91,7 +91,7 @@ process.stdin.on('end', () => {
9191

9292
console.log(
9393
"\n" +
94-
chalk.red(`${newErrors.length} new TypeScript errors were introduced to the code base with your changes. \n`) +
95-
chalk.white.bgRed('You' , chalk.white.bgRed('must') , 'resolve all new TypeScript errors before merging a PR.')
94+
chalk.red(`${newErrors.length} new TypeScript error(s) were introduced to the code base with your changes. \n`) +
95+
chalk.white.bgRed('You must resolve all new TypeScript errors before merging a PR.')
9696
);
9797
});

0 commit comments

Comments
 (0)