I think without using something like Flow or TypeScript, it’s impossible to 
determine type of the value for an AST node. Sorry, I’m not aware of anything 
that would allow you to do it, and I’m not really sure it’s possible to do in 
the first place.

 

Thanks,

 

                                Ilya Volodin

 

From: [email protected] [mailto:[email protected]] On Behalf Of 
Nicolas FROIDURE
Sent: Thursday, August 27, 2015 9:28 AM
To: ESLint <[email protected]>
Subject: [ESLint] Good AST node assertion library?

 

Hi all,

 

I'm currently creating an eslint plugin for MongoDB queries/updates linting and 
for this work i need to guess the resulting type of a particular AST node at 
execution.

 

By example, knowing if a particular AST node will always return a number, a 
date object or a string or if it is impossible to know it for that particular 
node.

 

I started factorizing the code here 
https://github.com/nfroidure/eslint-plugin-mongodb/blob/master/src/lib/utils.js#L101
 but i'm sure i'm missing some great library that could do it for me.

 

Despite my various search i couldn't find it, does some of you know an existing 
library allowing to do that kind of things?

 

Thanks in advance.

-- 
You received this message because you are subscribed to the Google Groups 
"ESLint" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected] 
<mailto:[email protected]> .
For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"ESLint" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to