diff --git a/index.js b/index.js index d2672fc..9991522 100644 --- a/index.js +++ b/index.js @@ -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); diff --git a/test.js b/test.js index 974689b..abb1269 100644 --- a/test.js +++ b/test.js @@ -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(); }); @@ -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) { @@ -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(); });