Skip to content

Commit 02a8bbb

Browse files
Validate plugin options before processing imports
1 parent 942340d commit 02a8bbb

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

Diff for: index.cjs

+3-4
Original file line numberDiff line numberDiff line change
@@ -268,9 +268,7 @@ module.exports = ({ types }) => {
268268
if (logIgnoredBinding !== undefined) optionLogIgnoredBinding = Boolean(logIgnoredBinding);
269269
if (logIgnoredClassComponentExtends !== undefined) optionLogIgnoredClassComponentExtends = Boolean(logIgnoredClassComponentExtends);
270270

271-
if (Object.keys(unknownOptions).length > 0) {
272-
warnOptions(unknownOptions);
273-
}
271+
if (Object.keys(unknownOptions).length > 0) warnOptions(unknownOptions);
274272
};
275273

276274
// plugin api
@@ -285,8 +283,9 @@ module.exports = ({ types }) => {
285283
enter(path, { file, opts }) {
286284
fileName = file.opts.filename.slice(file.opts.cwd.length + 1);
287285

288-
getImportIdentifier(path);
289286
parseOptions(opts);
287+
288+
getImportIdentifier(path);
290289
},
291290

292291
exit: updateImports,

0 commit comments

Comments
 (0)