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

Return source for fatal errors #3325

Closed
IanVS opened this Issue Aug 8, 2015 · 7 comments

Comments

Projects
None yet
4 participants
@IanVS
Copy link
Member

IanVS commented Aug 8, 2015

Currently, when a parsing (fatal) error occurs, the source is not included in the message that ESLint returns. It may be worthwhile to investigate whether the source could be returned, which is used in some formatters to show clearly where the problem is.

@IanVS IanVS added the triage label Aug 8, 2015

@gyandeeps

This comment has been minimized.

Copy link
Member

gyandeeps commented Aug 8, 2015

Do we need to do this here or inside espree project?

@ilyavolodin

This comment has been minimized.

Copy link
Member

ilyavolodin commented Aug 10, 2015

This should go to espree I think.

@IanVS

This comment has been minimized.

Copy link
Member Author

IanVS commented Aug 10, 2015

@IanVS IanVS closed this Aug 10, 2015

@nzakas nzakas reopened this Sep 15, 2015

@nzakas

This comment has been minimized.

Copy link
Member

nzakas commented Sep 15, 2015

This is an ESLint issue, not an Espree one. ESLint attaches source code to errors.

@nzakas nzakas added bug core accepted and removed triage labels Sep 15, 2015

@gyandeeps

This comment has been minimized.

Copy link
Member

gyandeeps commented Dec 16, 2015

Currently I see this when I run eslint on a invalid javascript code.

C:\Users\gs025879\Documents\webstrom\eslint\gyandeep.js
  3:20  error  Parsing error: Unexpected token {

✖ 1 problem (1 error, 0 warnings)

Is this what is expected or are we looking for something more than this?

@IanVS

This comment has been minimized.

Copy link
Member Author

IanVS commented Dec 16, 2015

This issue is about returning the source along with the message, so that formatters like eslint-friendly-formatter can show the code where the error occurred.

@nzakas

This comment has been minimized.

Copy link
Member

nzakas commented Dec 16, 2015

@gyandeeps every other error has a source property returned. This issue is to add that for fatal errors.

gyandeeps added a commit that referenced this issue Dec 16, 2015

gyandeeps added a commit that referenced this issue Dec 17, 2015

@gyandeeps gyandeeps closed this in 2d49fc8 Dec 18, 2015

nzakas added a commit that referenced this issue Dec 18, 2015

Merge pull request #4725 from eslint/issue3325
Fix: Add source property for fatal errors (fixes #3325)

@eslint eslint bot locked and limited conversation to collaborators Feb 7, 2018

@eslint eslint bot added the archived due to age label Feb 7, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.