diff --git a/.eslintignore b/.eslintignore index f05b1f265..e87ac86fd 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,2 +1,7 @@ node_modules +vendor +lib +dist +release test +examples diff --git a/Gruntfile.js b/Gruntfile.js index 0bdb97861..c88d95bc5 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -148,7 +148,7 @@ module.exports = function(grunt) { grunt.loadNpmTasks('grunt-karma'); grunt.loadNpmTasks('grunt-webpack'); grunt.loadNpmTasks('grunt-text-replace'); - grunt.loadNpmTasks("grunt-vows"); + grunt.loadNpmTasks('grunt-vows'); var rollbarJsSnippet = fs.readFileSync('dist/rollbar.snippet.js'); @@ -160,9 +160,9 @@ module.exports = function(grunt) { vows: { all: { options: { - reporter: "spec" + reporter: 'spec' }, - src: ["test/server.*.test.js"] + src: ['test/server.*.test.js'] } }, @@ -175,7 +175,7 @@ module.exports = function(grunt) { replacements: [ // Main rollbar snippet { - from: new RegExp('^(.*// Rollbar Snippet)[\n\r]+(.*[\n\r])*(.*// End Rollbar Snippet)', 'm'), + from: new RegExp('^(.*// Rollbar Snippet)[\n\r]+(.*[\n\r])*(.*// End Rollbar Snippet)', 'm'), // eslint-disable-line no-control-regex to: function(match, index, fullText, captures) { captures[1] = rollbarJsSnippet; return captures.join('\n'); @@ -183,7 +183,7 @@ module.exports = function(grunt) { }, // jQuery rollbar plugin snippet { - from: new RegExp('^(.*// Rollbar jQuery Snippet)[\n\r]+(.*[\n\r])*(.*// End Rollbar jQuery Snippet)', 'm'), + from: new RegExp('^(.*// Rollbar jQuery Snippet)[\n\r]+(.*[\n\r])*(.*// End Rollbar jQuery Snippet)', 'm'), // eslint-disable-line no-control-regex to: function(match, index, fullText, captures) { captures[1] = rollbarjQuerySnippet; return captures.join('\n'); @@ -207,7 +207,7 @@ module.exports = function(grunt) { grunt.registerTask('test', ['test-server', 'test-browser']); grunt.registerTask('release', ['build', 'copyrelease']); - grunt.registerTask('test-server', function(target) { + grunt.registerTask('test-server', function(_target) { var tasks = ['vows']; grunt.task.run.apply(grunt.task, tasks); }); diff --git a/browserstack.browsers.js b/browserstack.browsers.js index 11833c73c..6d50c84ea 100644 --- a/browserstack.browsers.js +++ b/browserstack.browsers.js @@ -39,7 +39,7 @@ var sortedByBrowser = {}; try { loadBrowsers(require('./browserstack.browsers.json')); } catch (e) { - console.error('Could not read ./browserstack.browsers.json. Ignoring.', e); + console.error('Could not read ./browserstack.browsers.json. Ignoring.', e); // eslint-disable-line no-console } @@ -109,7 +109,8 @@ function download(username, accessKey, callback) { // Save the downloaded browsers in memory loadBrowsers(body); - fs.writeFile('./browserstack.browsers.json', JSON.stringify(body, null, ' '), callback); + // TODO: Fix? fs is not defined here. + // fs.writeFile('./browserstack.browsers.json', JSON.stringify(body, null, ' '), callback); }); } diff --git a/karma.conf.js b/karma.conf.js index 42fe992e1..754ffc669 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -79,7 +79,7 @@ module.exports = function (config) { loader: 'eslint-loader', exclude: [/node_modules/, /vendor/, /lib/, /dist/], options: { - configFile: path.resolve(__dirname, ".eslintrc") + configFile: path.resolve(__dirname, '.eslintrc') } }, { diff --git a/package.json b/package.json index 11c10228c..57e440cd3 100644 --- a/package.json +++ b/package.json @@ -102,7 +102,7 @@ "test-browser": "./node_modules/.bin/grunt test-browser", "test-server": "./node_modules/.bin/grunt test-server", "test_ci": "./node_modules/.bin/grunt test", - "lint": "./node_modules/.bin/eslint" + "lint": "./node_modules/.bin/eslint . --ext .js" }, "cdn": { "host": "cdnjs.cloudflare.com"