Skip to content

Commit c41e670

Browse files
NicolappsConvex, Inc.
authored andcommitted
eslint: Remove unused code for use node detection (#41751)
GitOrigin-RevId: 34fbf2ca5dad2bffc2f15850ee35c39404743a44
1 parent b4fc4d1 commit c41e670

File tree

1 file changed

+0
-12
lines changed

1 file changed

+0
-12
lines changed

npm-packages/@convex-dev/eslint-plugin/src/lib/noImportUseNode.ts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,7 @@ export const noImportUseNode = createRule({
2424
if (!entry) return {};
2525

2626
const currentDir = path.dirname(filename);
27-
let isNodeJs: null | boolean = null;
2827
return {
29-
Program(node) {
30-
isNodeJs = isUseNode(node);
31-
},
3228
ImportDeclaration(node) {
3329
if (typeof node.source.value !== "string") return {};
3430
const relative = node.source.value;
@@ -56,14 +52,6 @@ export const noImportUseNode = createRule({
5652
},
5753
});
5854

59-
function isUseNode(node: TSESTree.Program) {
60-
const first = node.body[0];
61-
if (!first) return false;
62-
if (first.type !== AST_NODE_TYPES.ExpressionStatement) return false;
63-
if (first.expression.type !== AST_NODE_TYPES.Literal) return false;
64-
return first.expression.value === "use node";
65-
}
66-
6755
// Implement basic module resolution for relative paths only.
6856
// This doesn't work with path aliases and so many other cases;
6957
// it's a proof of concept that might be helpful to folks debugging.

0 commit comments

Comments
 (0)