Skip to content

Commit

Permalink
dont remove shebangs
Browse files Browse the repository at this point in the history
  • Loading branch information
brentlintner committed Mar 27, 2011
1 parent 232d74b commit 8ac3f36
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 16 deletions.
2 changes: 1 addition & 1 deletion lib/hint.js
Expand Up @@ -14,7 +14,7 @@ function _lint(file, results) {
_sys.puts(e + '\n');
}

if (!_jshint.JSHINT(buffer.replace(/^\#\!.*\n/, '\n'), _config)) {
if (!_jshint.JSHINT(buffer, _config)) {
_jshint.JSHINT.errors.forEach(function (error) {
if (error) {
results.push({file: file, error: error});
Expand Down
15 changes: 0 additions & 15 deletions test/hint.js
Expand Up @@ -73,21 +73,6 @@ describe("hint", function () {
expect(jshint.JSHINT).toHaveBeenCalledWith("data", config);
});

it("removes shebangs", function () {
var targets = ["file1.js"];

spyOn(jshint, "JSHINT").andReturn(true);
spyOn(fs, "readFileSync").andReturn("#! /usr/bin/env node\nvar a;");

spyOn(fs, "statSync").andReturn({
isDirectory: jasmine.createSpy().andReturn(false)
});

hint.hint(targets);

expect(jshint.JSHINT).toHaveBeenCalledWith("\nvar a;", null);
});

it("uses custom reporter", function () {
var targets = ["file1.js"],
config = null,
Expand Down

0 comments on commit 8ac3f36

Please sign in to comment.