question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Pass filename as an argument to `parse`

See original GitHub issue

I 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:closed
  • Created 8 years ago
  • Comments:24 (24 by maintainers)

github_iconTop GitHub Comments

1reaction
anniecommented, Aug 28, 2016

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

1reaction
hzoocommented, Jun 28, 2016

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)

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found