Skip to content

Commit b5261fb

Browse files
authored
fix: add input validation for CheckSyntaxRspackPlugin (#26)
1 parent 9c6dffe commit b5261fb

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/checkSyntax.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,13 @@ export class CheckSyntax {
3737
rootPath: string;
3838
},
3939
) {
40+
if (!options) {
41+
throw new Error('[CheckSyntaxRspackPlugin] `options` is required.');
42+
}
43+
if (!options.targets) {
44+
throw new Error('[CheckSyntaxRspackPlugin] `targets` option is required');
45+
}
46+
4047
this.targets = options.targets;
4148
this.exclude = options.exclude;
4249
this.excludeOutput = options.excludeOutput;

0 commit comments

Comments
 (0)