Skip to content
This repository was archived by the owner on Dec 1, 2019. It is now read-only.

Commit bc9b544

Browse files
committed
feat: add errorsAsWarnings option
1 parent 2975dec commit bc9b544

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

README.md

+4
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,10 @@ Specifies the path to a TS config file. This is useful when you have multiple co
143143

144144
Use this setting to disable type checking.
145145

146+
### errorsAsWarnings *(boolean)*
147+
148+
Emit all typescript errors as warnings.
149+
146150
### forceIsolatedModules *(boolean)*
147151

148152
Use this setting to disable dependent module recompilation.

src/instance.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,11 @@ function setupAfterCompile(compiler, instanceName, forkChecker = false) {
449449
if (asyncErrors) {
450450
console.log(msg, '\n');
451451
} else {
452-
compilation.errors.push(new Error(msg));
452+
if (!instance.loaderConfig.errorsAsWarnings) {
453+
compilation.errors.push(new Error(msg));
454+
} else {
455+
compilation.warnings.push(new Error(msg));
456+
}
453457
}
454458
};
455459

src/interfaces.ts

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ export interface LoaderConfig {
1212
configFileName?: string;
1313
configFileContent?: string;
1414
forceIsolatedModules?: boolean;
15+
errorsAsWarnings?: boolean
1516
transpileOnly?: boolean;
1617
ignoreDiagnostics?: number[];
1718
compilerOptions?: ts.CompilerOptions;

0 commit comments

Comments
 (0)