Skip to content

Commit 2211049

Browse files
author
nickpape-msft
committed
Also treat tslint as warnings
1 parent 7c70c0b commit 2211049

3 files changed

Lines changed: 26 additions & 2 deletions

File tree

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"changes": [
3+
{
4+
"packageName": "@microsoft/web-library-build",
5+
"comment": "Treat warnings as errors in production. Treat tslint errors as warnings.",
6+
"type": "minor"
7+
},
8+
{
9+
"packageName": "@microsoft/node-library-build",
10+
"comment": "Treat warnings as errors in production. Treat tsli nt errors as warnings.",
11+
"type": "minor"
12+
}
13+
],
14+
"email": "nickpape@users.noreply.github.com"
15+
}

node-library-build/src/index.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,18 @@ export * from '@microsoft/gulp-core-build-typescript';
77
export * from '@microsoft/gulp-core-build-mocha';
88

99
// Define default task groups.
10-
const buildSubtask: IExecutable = serial(parallel(tslint, typescript), apiExtractor);
1110

1211
const PRODUCTION = process.argv.indexOf('--production') !== -1 || process.argv.indexOf('--ship') !== -1;
1312
setConfig({
13+
production: PRODUCTION,
1414
shouldWarningsFailBuild: PRODUCTION
1515
});
1616

17+
tslint.mergeConfig({
18+
displayAsWarning: true
19+
});
20+
21+
const buildSubtask: IExecutable = serial(parallel(tslint, typescript), apiExtractor);
1722
export const buildTasks: IExecutable = task('build', buildSubtask);
1823
export const testTasks: IExecutable = task('test', serial(buildSubtask, mocha));
1924
export const defaultTasks: IExecutable = task('default', serial(buildSubtask, instrument, mocha));

web-library-build/src/index.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,16 @@ const sourceMatch: string[] = [
3636
'!src/**/*.scss.ts'
3737
];
3838

39-
4039
const PRODUCTION = process.argv.indexOf('--production') !== -1 || process.argv.indexOf('--ship') !== -1;
4140
setConfig({
41+
production: PRODUCTION,
4242
shouldWarningsFailBuild: PRODUCTION
4343
});
4444

45+
tslint.mergeConfig({
46+
displayAsWarning: true
47+
});
48+
4549
// Define default task groups.
4650
export const compileTsTasks: IExecutable = parallel(typescript, text, apiExtractor);
4751
export const buildTasks: IExecutable = task('build', serial(preCopy, sass, compileTsTasks, postCopy));

0 commit comments

Comments
 (0)