Skip to content

Commit fc326ce

Browse files
Move rulesDirectory from JSON to tasks (#1225)
This is so TSA scans can use the same tslint JSON file (they download the rule additions to a different directory)
1 parent 85dcd83 commit fc326ce

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

gulpfile.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ require('./tasks/htmltasks')
2525
require('./tasks/packagetasks')
2626

2727
gulp.task('ext:lint', () => {
28+
// !! If updating this make sure to check if you need to update the TSA Scan task in ADO !!
2829
var program = tslint.Linter.createProgram('tsconfig.json');
2930
return gulp.src([
3031
config.paths.project.root + '/src/**/*.ts',
@@ -33,7 +34,8 @@ gulp.task('ext:lint', () => {
3334
])
3435
.pipe((gulpTsLint({
3536
program,
36-
formatter: "verbose"
37+
formatter: "verbose",
38+
rulesDirectory: "node_modules/tslint-microsoft-contrib"
3739
})))
3840
.pipe(gulpTsLint.report());
3941
});

tasks/htmltasks.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,18 @@ var tslint = require('tslint');
1818
var min = (argv.min === undefined) ? false : true;
1919

2020
gulp.task('html:lint', () => {
21+
// !! If updating this make sure to check if you need to update the TSA Scan task in ADO !!
2122
var program = tslint.Linter.createProgram(config.paths.html.root + '/tsconfig.json');
2223
return gulp.src([
2324
config.paths.html.root + '/src/**/*.ts',
2425
config.paths.html.root + '/test/**/*.ts'
2526
])
2627
.pipe((gulpTsLint({
2728
program,
28-
formatter: "verbose"
29+
formatter: "verbose",
30+
rulesDirectory: "node_modules/tslint-microsoft-contrib"
2931
})))
30-
.pipe(gulpTsLint.report());
32+
.pipe(gulpTsLint.report())
3133
});
3234

3335
// Compile TypeScript to JS

tslint.mssdl.required.json

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
{
2-
"rulesDirectory": "node_modules/tslint-microsoft-contrib",
32
"rules": {
43
"no-banned-terms": true,
54
"no-delete-expression": true,

0 commit comments

Comments
 (0)