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

Change "parsing error" to "reserved word not allowed" when naming a function "delete" #835

Closed
rbecheras opened this issue Apr 4, 2017 · 1 comment

Comments

@rbecheras
Copy link

commented Apr 4, 2017

When we name a function delete, standard find a parsing error.

Here an example in atom editor with the plugin linter-js-standard:

capture d ecran de 2017-04-04 14-17-42

I would suggest using a more semantic error name/type/description. Something like

Function naming error: 'delete' is a native reserved word

@feross

This comment has been minimized.

Copy link
Member

commented Apr 4, 2017

Thanks for the suggestion. I wish that we could show a friendlier error, but in this case the usage of the token delete is literally crashing the JS parser, since it's not expecting a reserved word to be used in that location.

I don't think there's an easy solution that standard can apply here, since this error originates in ESLint. If you feel strongly that this should be improved, consider opening an issue on the ESLint issue tracker. https://github.com/eslint/eslint

@feross feross added the question label Apr 4, 2017

@feross feross closed this Apr 4, 2017

@lock lock bot locked as resolved and limited conversation to collaborators May 10, 2018

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