Use ?. where it represents the intended semantics (#11512)
This commit is contained in:
@@ -71,8 +71,9 @@ export function* findRelativeConfig(
|
||||
loc,
|
||||
envName,
|
||||
caller,
|
||||
packageData.pkg && packageData.pkg.dirname === loc
|
||||
? packageToBabelConfig(packageData.pkg)
|
||||
packageData.pkg?.dirname === loc
|
||||
? // $FlowIgnore - packageData.pkg is not null
|
||||
packageToBabelConfig((packageData.pkg: ConfigFile))
|
||||
: null,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -17,7 +17,8 @@ export type { PartialConfig } from "./partial";
|
||||
|
||||
const loadOptionsRunner = gensync<[mixed], Object | null>(function*(opts) {
|
||||
const config = yield* loadFullConfig(opts);
|
||||
return config ? config.options : null;
|
||||
// NOTE: We want to return "null" explicitly, while ?. alone returns undefined
|
||||
return config?.options ?? null;
|
||||
});
|
||||
|
||||
const maybeErrback = runner => (opts: mixed, callback: Function) => {
|
||||
|
||||
Reference in New Issue
Block a user