Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ran rslint . in my Projects directory, got an internal linter error #139

Open
adiabatic opened this issue Mar 23, 2022 · 7 comments
Open
Labels
ILE (Internal Linter Error) A panic from the linter

Comments

@adiabatic
Copy link

I saw rslint show up as a new formula in Homebrew today and I decided to run it since it seemed like my kind of thing. Since I wasn't quite sure what project to aim it at, I ran it in my Projects directory, which is probably a bit too far removed from actual .js and .ts files, but oh well.

However, this happened:

~/Projects > rslint .
The linter panicked unexpectedly. This is a bug.

We would appreciate a bug report: https://github.com/rslint/rslint/issues/new?labels=ILE%2C+bug&template=internal-linter-error.md

Please include the following info: 

message: internal error: entered unreachable code: Anything not template chunk or dollarcurly should have been eaten by the lexer, but R_CURLY was found
location: crates/rslint_parser/src/syntax/expr.rs:1089:18

Meta

rslint -V: rslint 0.3.1

@adiabatic adiabatic added the ILE (Internal Linter Error) A panic from the linter label Mar 23, 2022
@Stupremee
Copy link
Member

Do you have the code available somewhere? This is a bug in the lexer/parser which I need the failing code for.

@adiabatic
Copy link
Author

I was able to narrow down the source of this error to a ui/ folder in a project I have on my computer, but it's closed-source and for work. If the error message said what file in particular caused the error, I could see about making a minimized test case.

I'm not into the Rust ecosystem, so I'd be happy to wait for Homebrew to provide me with an updated binary that reports the file that triggers these sorts of errors.


Separately, while hunting this particular error down, I found this very similar one triggered by this project's node_modules/ folder:

> rslint .
The linter panicked unexpectedly. This is a bug.

We would appreciate a bug report: https://github.com/rslint/rslint/issues/new?labels=ILE%2C+bug&template=internal-linter-error.md

Please include the following info: 

message: 
location: crates/rslint_parser/src/parser.rs:124:9

Again, closed-source, so I can't just drop the whole list. ls -l | wc -l in node_modules/ gives me 1204, which is too many folders to narrow things down one by one.

@Stupremee
Copy link
Member

You can try running rslint on each file separately using some bash magic using find and xargs. I'm on my phone so I can't send you the whole common, but I can send it later today.

@Stupremee
Copy link
Member

@adiabatic can you run this command:

find -type f -name "*.js" | xargs -I '{}' sh -c "rslint {} >/dev/null 2>&1 || echo {}"

It should print all files that failed to lint, which should help narrow it done to the causing file.

@adiabatic
Copy link
Author

It complained that -t wasn't an option.

I put in the directory to search, and then I was off to the races:

find . -type f -name "*.js" | xargs -I '{}' sh -c "rslint {} >/dev/null 2>&1 || echo {}"

It lists a bunch of my own files. Possibly every single one of them. It also lists a bunch of files in node_modules. Then again, there are a lot of files in node_modules, like any other Node project more complex than hello-world apps.

Skimming the output, it looks like there's more filenames listed than lines containing {}. The entire output is 7,125 lines long. As you might guess, most of the filenames have node_modules somewhere in them.

Is there anything else that I can do to help?

@Stupremee
Copy link
Member

Ah I forgot to only check for panics. I will send you a new command later.

@hackermondev
Copy link

hey @Stupremee, encountering the same issues. here's the code: https://gist.github.com/hackermondev/0f74bc31ed51169f1d9c7be3fda40864

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ILE (Internal Linter Error) A panic from the linter
Projects
None yet
Development

No branches or pull requests

3 participants