Skip to content

Commit 6bdf632

Browse files
MQuyjohnnyreilly
authored andcommitted
ignoreLintWarnings shouldn't mark rule as error (#243)
* ignoreLintWarnings shouldn't mark rule as error * Add test, changelog and update version * Bump 1.0.2
1 parent d58dfe0 commit 6bdf632

File tree

4 files changed

+24
-3
lines changed

4 files changed

+24
-3
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## v1.0.2
2+
3+
* [Fix ignoreLintWarning mark warnings as errors](https://github.com/Realytics/fork-ts-checker-webpack-plugin/pull/243)
4+
15
## v1.0.1
26

37
* [Apply rounding to compilation time](https://github.com/Realytics/fork-ts-checker-webpack-plugin/pull/235)

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "fork-ts-checker-webpack-plugin",
3-
"version": "1.0.1",
3+
"version": "1.0.2",
44
"description": "Runs typescript type checker and linter on separate process.",
55
"main": "lib/index.js",
66
"types": "lib/index.d.ts",

src/index.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -800,8 +800,10 @@ class ForkTsCheckerWebpackPlugin {
800800
file: message.file
801801
};
802802

803-
if (message.isWarningSeverity() && !this.ignoreLintWarnings) {
804-
compilation.warnings.push(formatted);
803+
if (message.isWarningSeverity()) {
804+
if (!this.ignoreLintWarnings) {
805+
compilation.warnings.push(formatted);
806+
}
805807
} else {
806808
compilation.errors.push(formatted);
807809
}

test/integration/index.spec.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,21 @@ function makeCommonTests(useTypescriptIncrementalApi) {
9393
);
9494
});
9595

96+
it('should not mark warnings as errors when ignoreLintWarnings passed as option', function(callback) {
97+
const fileName = 'lintingError2';
98+
helpers.testLintAutoFixTest(
99+
callback,
100+
fileName,
101+
{
102+
tslint: true,
103+
ignoreLintWarnings: true
104+
},
105+
(err, stats) => {
106+
expect(stats.compilation.errors.length).to.be.eq(0);
107+
}
108+
);
109+
});
110+
96111
it('should find semantic errors', function(callback) {
97112
var compiler = createCompiler({
98113
tsconfig: 'tsconfig-semantic-error-only.json'

0 commit comments

Comments
 (0)