Skip to content

Commit

Permalink
Merge pull request #809 from rollbar/wj-fix-npm-run-lint
Browse files Browse the repository at this point in the history
Fix npm run lint
  • Loading branch information
waltjones authored Dec 4, 2019
2 parents d8f02c6 + 0b5dc8b commit 80ecab9
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 10 deletions.
5 changes: 5 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
node_modules
vendor
lib
dist
release
test
examples
12 changes: 6 additions & 6 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand All @@ -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']
}
},

Expand All @@ -175,15 +175,15 @@ 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');
}
},
// 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');
Expand All @@ -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);
});
Expand Down
5 changes: 3 additions & 2 deletions browserstack.browsers.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
}


Expand Down Expand Up @@ -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);
});
}

Expand Down
2 changes: 1 addition & 1 deletion karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')
}
},
{
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 80ecab9

Please sign in to comment.