Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

ignore shebang in js files #470

Closed
wants to merge 3 commits into from

2 participants

@rlidwka

Currently eshint is unable to parse that.

@nzakas
Owner

As with the other pull request, please file an issue explaining your concern before sending a pull request. Issues are where we discuss whether or not we want to pursue a change.

@rlidwka

As with the other pull request, please file an issue explaining your concern before sending a pull request

On GitHub issues have roughly the same functionality as pull requests. So, it doesn't make any sense to do that, since anyone can discuss it right here.

@rlidwka rlidwka referenced this pull request in joyent/node
Closed

domains mishandle thrown nulls #6757

@nzakas
Owner
@nzakas nzakas closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 18 additions and 0 deletions.
  1. +4 −0 lib/cli.js
  2. +4 −0 tests/fixtures/shebang.js
  3. +10 −0 tests/lib/cli.js
View
4 lib/cli.js
@@ -114,6 +114,10 @@ function processFile(filename, configHelper) {
if (existsSync(filePath)) {
config = configHelper.getConfig(filePath);
text = fs.readFileSync(path.resolve(filename), "utf8");
+
+ // remove shebang
+ text = text.replace(/^\#\!.*/, "");
+
messages = eslint.verify(text, config);
} else {
messages = [{
View
4 tests/fixtures/shebang.js
@@ -0,0 +1,4 @@
+#!/usr/bin/env node
+
+var foo = "bar";
+
View
10 tests/lib/cli.js
@@ -185,4 +185,14 @@ describe("cli", function() {
assert.equal(console.log.callCount, 1);
});
});
+
+ describe("when given a cli script with shebang", function() {
+ var code = "tests/fixtures/shebang.js";
+
+ it("should execute without any errors", function() {
+ var exit = cli.execute([code]);
+
+ assert.equal(exit, 0);
+ });
+ });
});
Something went wrong with that request. Please try again.