Skip to content
This repository has been archived by the owner on Feb 9, 2023. It is now read-only.

Commit

Permalink
Brunch actually passes the linter two params
Browse files Browse the repository at this point in the history
  • Loading branch information
goshacmd committed Jan 28, 2016
1 parent b6e4ede commit 24920de
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
4 changes: 1 addition & 3 deletions index.js
Expand Up @@ -29,9 +29,7 @@ class CoffeeLinter {
}
}

lint(params) {
const data = params.data;

lint(data, _) { //eslint-disable-line no-unused-vars
try {
const error = linter.lint(data, this.options).filter(err => err != null).map(formatError).join('\n');
if (error) return Promise.reject(error);
Expand Down
8 changes: 4 additions & 4 deletions test.js
Expand Up @@ -25,13 +25,13 @@ describe('Plugin', function() {
it('should lint correctly', function(done) {
var content = 'a = 228\nb = () ->\n console.log a'

plugin.lint({data: content, path: 'file.coffee'}).then(() => done(), error => expect(error).not.to.be.ok);
plugin.lint(content, 'file.coffee').then(() => done(), error => expect(error).not.to.be.ok);
});

it('should give correct errors', function(done) {
var content = 'b = () ->\n\t\t a=10'

plugin.lint({data: content, path: 'file.coffee'}).then(null, error => {
plugin.lint(content, 'file.coffee').then(null, error => {
expect(error).to.contain('error: indentation at line 2. Expected 2 got 5\nerror: no_tabs at line 2.');
done();
});
Expand All @@ -40,7 +40,7 @@ describe('Plugin', function() {
it('should read configs global options list', function(done) {
var content = 'alert("end of line");'

plugin.lint({data: content, path: 'file.coffee'}).then(() => done(), error => expect(error).not.to.be.ok);
plugin.lint(content, 'file.coffee').then(() => done(), error => expect(error).not.to.be.ok);
});

it('should read coffeelint.json', function(done) {
Expand All @@ -54,7 +54,7 @@ describe('Plugin', function() {
}
});

plugin.lint({data: content, path: 'file.coffee'}).then(null, error => {
plugin.lint(content, 'file.coffee').then(null, error => {
expect(error).to.contain('error: no_plusplus at line 1. found \'++\'');
done();
});
Expand Down

0 comments on commit 24920de

Please sign in to comment.