Skip to content

Commit 59f47ff

Browse files
committed
build: add tslint formatting task
Adds a Gulp task that fixes TSLint errors automatically when possible. This should make it easier to add/remove linting rules.
1 parent 21f8899 commit 59f47ff

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

tools/gulp/tasks/lint.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,10 @@ gulp.task('stylelint', execNodeTask(
1212
'stylelint', ['src/**/*.scss', '--config', 'stylelint-config.json', '--syntax', 'scss']
1313
));
1414

15+
const tsLintBaseFlags = ['-c', 'tslint.json', '+(src|e2e|tools)/**/*.ts'];
16+
1517
/** Task to run TSLint against the e2e/ and src/ directories. */
16-
gulp.task('tslint', execNodeTask('tslint', ['-c', 'tslint.json', '+(src|e2e|tools)/**/*.ts']));
18+
gulp.task('tslint', execNodeTask('tslint', tsLintBaseFlags));
19+
20+
/** Task that automatically fixes TSLint warnings. */
21+
gulp.task('tslint:fix', execNodeTask('tslint', [...tsLintBaseFlags, '--fix']));

0 commit comments

Comments
 (0)