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

Unexpected token ILLEGAL when encountering `#!/usr/bin/env node` at top of file #494

Closed
pdehaan opened this Issue Jan 6, 2014 · 5 comments

Comments

Projects
None yet
4 participants
@pdehaan
Contributor

pdehaan commented Jan 6, 2014

Steps to reproduce:

  1. Run ESLint against /bin/eslint.js

Actual results:

$ eslint node_modules/eslint/bin/*.js
node_modules/eslint/bin/eslint.js: line 1, col 1, Error - Unexpected token ILLEGAL

Expected results:
Ignore #!/usr/bin/env node

@michaelficarra

This comment has been minimized.

Show comment
Hide comment
@michaelficarra

michaelficarra Jan 6, 2014

Member

bin/eslint.js is a shell script, not a JavaScript program (even though the extension suggests otherwise). Node.js ignores shebangs to allow for this common UNIX pattern, but that does not make it a JS program.

Member

michaelficarra commented Jan 6, 2014

bin/eslint.js is a shell script, not a JavaScript program (even though the extension suggests otherwise). Node.js ignores shebangs to allow for this common UNIX pattern, but that does not make it a JS program.

@nzakas

This comment has been minimized.

Show comment
Hide comment
@nzakas

nzakas Jan 7, 2014

Member

This is an interesting question...should we ignore shebangs?

Member

nzakas commented Jan 7, 2014

This is an interesting question...should we ignore shebangs?

@pdehaan

This comment has been minimized.

Show comment
Hide comment
@pdehaan

pdehaan Jan 7, 2014

Contributor

Or at the very least maybe add a flag to optionally ignore shebangs.

Not sure if merging this would solve it: #470

Contributor

pdehaan commented Jan 7, 2014

Or at the very least maybe add a flag to optionally ignore shebangs.

Not sure if merging this would solve it: #470

@ilyavolodin

This comment has been minimized.

Show comment
Hide comment
@ilyavolodin

ilyavolodin Jan 8, 2014

Member

I think we should. While it is a shell script, it's written in JavaScript. And at least some of the repos out there use entry shell script to process input parameters and such. It's a minor change for us to remove shebangs, and it would allow people to lint those files as well.

Member

ilyavolodin commented Jan 8, 2014

I think we should. While it is a shell script, it's written in JavaScript. And at least some of the repos out there use entry shell script to process input parameters and such. It's a minor change for us to remove shebangs, and it would allow people to lint those files as well.

@nzakas

This comment has been minimized.

Show comment
Hide comment
@nzakas

nzakas Jan 8, 2014

Member

Yeah, I can buy that line of reasoning. Let's do it.

Member

nzakas commented Jan 8, 2014

Yeah, I can buy that line of reasoning. Let's do it.

michaelficarra added a commit to michaelficarra/eslint that referenced this issue Jan 8, 2014

michaelficarra added a commit to michaelficarra/eslint that referenced this issue Jan 8, 2014

michaelficarra added a commit to michaelficarra/eslint that referenced this issue Jan 9, 2014

michaelficarra added a commit to michaelficarra/eslint that referenced this issue Jan 9, 2014

@nzakas nzakas closed this in #497 Jan 10, 2014

nzakas added a commit that referenced this issue Jan 10, 2014

Merge pull request #497 from michaelficarra/GH-494
fixes #494 and #496: allow shebangs and allow explicit CLI args to override .eslintignore

@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.