mirror of
https://github.com/morluto/rea.git
synced 2026-10-12 02:19:24 +00:00
style(reference-source): format loader binding changes
This commit is contained in:
@@ -53,7 +53,8 @@ export const unshadowedReferenceSourceRequireCalls = (
|
||||
if (start === undefined) return;
|
||||
if (
|
||||
readAncestors().some(
|
||||
(ancestor) => t.isWithStatement(ancestor) && contains(ancestor.body, node),
|
||||
(ancestor) =>
|
||||
t.isWithStatement(ancestor) && contains(ancestor.body, node),
|
||||
)
|
||||
)
|
||||
return;
|
||||
@@ -91,9 +92,7 @@ const isExplicitModuleSource = (path: string): boolean => {
|
||||
return false;
|
||||
};
|
||||
|
||||
const hasUninitializedTopLevelVarRequire = (
|
||||
program: t.Program,
|
||||
): boolean => {
|
||||
const hasUninitializedTopLevelVarRequire = (program: t.Program): boolean => {
|
||||
let found = false;
|
||||
let initialized = false;
|
||||
traverseJavaScriptAst(program, {
|
||||
|
||||
@@ -112,9 +112,7 @@ it("resolves require calls by lexical binding and source mode", async () => {
|
||||
result.value.relationships
|
||||
.filter(({ kind }) => kind === "requires")
|
||||
.map(({ from_path, to }) => [from_path, to])
|
||||
.sort((left, right) =>
|
||||
(left[0] ?? "").localeCompare(right[0] ?? ""),
|
||||
),
|
||||
.sort((left, right) => (left[0] ?? "").localeCompare(right[0] ?? "")),
|
||||
).toEqual([
|
||||
["create-require-esm.mjs", "loaded.cjs"],
|
||||
["nested.cjs", "loaded.cjs"],
|
||||
|
||||
Reference in New Issue
Block a user