File tree Expand file tree Collapse file tree 1 file changed +0
-12
lines changed
npm-packages/@convex-dev/eslint-plugin/src/lib Expand file tree Collapse file tree 1 file changed +0
-12
lines changed Original file line number Diff line number Diff 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.
You can’t perform that action at this time.
0 commit comments