Use optional chaining where possible (#13773)

This commit is contained in:
fisker Cheung authored and GitHub committed 2022-11-03 14:23:07 +08:00
1 parent 6c688b7e28
commit 59eda43d71
46 files changed
+126 -233

No files matched your search

+1 -1
View File
@@ -66,7 +66,7 @@ const appendPlugins = (plugins, options = parseOptions) => ({
// https://github.com/babel/babel/pull/7934/files#diff-a739835084910b0ee3ea649df5a4d223R67
const FLOW_PRAGMA_REGEX = /@(?:no)?flow\b/;
function isFlowFile(text, options) {
if (options.filepath && options.filepath.endsWith(".js.flow")) {
if (options.filepath?.endsWith(".js.flow")) {
return true;
}