Pass filename as an argument to `parse`
See original GitHub issueI have been experimenting with type-aware lint rules. The prototype I have combines Flow with babel-eslint
to annotate the AST with type information.
However, for Flow to be able to provide complete type information it needs the path to the current file so that it can properly resolve imports/requires. To that end I would like to pass the file name as an argument to parse
.
I understand that this is a radical departure from the current idea of what a frontend for ESLint is, but the change required to support this idea is very small and will not interfere with existing code. I’m happy to put up a pull request if it is likely to be accepted.
Issue Analytics
- State:
- Created 8 years ago
- Comments:24 (24 by maintainers)
Top Results From Across the Web
How to open file using argparse?
parser = argparse.ArgumentParser() parser.add_argument('filename') args = parser.parse_args() with open(args.filename) as file: # do stuff here.
Read more >How to Argparse File in Python - Codeigo
To open a file using argparse, first, you have to create code that will handle parameters you can enter from the command line....
Read more >argparse — Parser for command-line options, arguments ...
The ArgumentParser object will hold all the information necessary to parse the command line into Python data types. Adding arguments¶. Filling an ArgumentParser...
Read more >Get a list of filenames using argparse (updated to ...
Get a list of filenames using argparse (updated to use default formatter) ... parser.add_argument('path', nargs='+', help='Path of a file or a folder of ......
Read more >How To Pass and Parse Linux Bash Script Arguments ...
You can pass parameters or arguments to the file. Just the command for running the script normally by adding the value of the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
i can take this on if @hzoo isn’t working on it!
how do i go about writing tests? i haven’t made a core contribution yet so i’m not sure how to get started
I can finish this up using that commit if @nmote doesn’t (actually seems to be helpful for babel-eslint errors in general when figuring out how to run eslint tests)