Skip to content

Commit 2630095

Browse files
committed
refactor: remove unused code
1 parent b3ed1be commit 2630095

File tree

5 files changed

+11
-46
lines changed

5 files changed

+11
-46
lines changed

packages/utilities/jsx/src/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
export * from "./element";
2-
export * from "./misc";
32
export * from "./pragma";
43
export * from "./prop";
54
export * from "./textnode";

packages/utilities/jsx/src/misc.ts

Lines changed: 0 additions & 25 deletions
This file was deleted.

packages/utilities/var/src/find-variable.ts

Lines changed: 0 additions & 15 deletions
This file was deleted.

packages/utilities/var/src/index.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
1-
export * from "./find-variable";
2-
export * from "./get-variable";
1+
export * from "./variable-find";
32
export * from "./variable-init";

packages/utilities/var/src/get-variable.ts renamed to packages/utilities/var/src/variable-find.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
2-
import type { Definition, Variable } from "@typescript-eslint/scope-manager";
3-
import { type Scope, ScopeType } from "@typescript-eslint/scope-manager";
1+
import type { Variable } from "@typescript-eslint/scope-manager";
2+
import { ScopeType, type Scope } from "@typescript-eslint/scope-manager";
3+
import { Function as F, Option as O } from "effect";
44
import { MutableRef as MutRef } from "effect";
55

66
/**
@@ -18,3 +18,10 @@ export function getVariables(initialScope: Scope): Variable[] {
1818

1919
return MutRef.get(variablesRef).reverse();
2020
}
21+
22+
export const findVariable: {
23+
(initialScope: Scope): (name: string) => O.Option<Variable>;
24+
(name: string, initialScope: Scope): O.Option<Variable>;
25+
} = F.dual(2, (name: string, initialScope: Scope) => {
26+
return O.fromNullable(getVariables(initialScope).find((variable) => variable.name === name));
27+
});

0 commit comments

Comments
 (0)