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
Cannot read property 'loc' of undefined when first line in file is blank #3596
Comments
Thanks for the issue! We get a lot of issues, so this message is automatically posted to each one to help you check that you've included all of the information we need to help you. Reporting a bug? Please be sure to include:
Requesting a new rule? Please be sure to include:
Requesting a feature? Please be sure to include:
Including this information in your issue helps us to triage it and get you a response as quickly as possible. Thanks! |
Can't reproduce it with UPDATE: |
If you can't reproduce with Espree, then it's a babel-eslint bug and an issue should be filed there. @davezuko are you aware that you don't need babel-eslint for ES6 syntax? |
I'll file it there then, I should have tested it with stock eslint first. @nzakas no I guess I didn't... interesting, I'll try it out. Looking at the docs though, the
So it looks like I'll have to keep using babel-eslint if I want to run this as as a webpack preloader? Because right now eslint just throws a bunch of "illegal import declaration" errors, and I can't find anything else regarding enabling module support in the docs. |
http://eslint.org/docs/user-guide/configuring#specifying-language-options Also I'm fixing this is babel-eslint now. babel/babel-eslint#180 |
@hzoo no, I must have just skimmed over that option on accident. My mistake, thanks! |
update eslint, acorn-to-esprima - ref eslint/eslint#3596
Should be fixed in |
It appears as though if the beginning of a file begins with a blank line eslint chokes. Package versions in question:
Relevant rule configuration; turning this off resolves the issue.
Example code snippet that produces the issue (key is the leading blank line; this appears to be consistent across all files, in my testing).
If I delete that initial empty line or add anything to it (comment, code, whatever), the issue is resolved. The empty line was totally unintentional, but led me to discover the issue. Here's the stack trace:
Thanks in advance, hopefully that was clear enough!
The text was updated successfully, but these errors were encountered: