Commit 7eca2d37 authored by Robert Knight's avatar Robert Knight

Add lint checks for curly braces and return values in Array callbacks

Checking for return values in Array callbacks found several incorrect
uses of Array.map() where Array.forEach() should have been used.
parent 67676f2d
......@@ -11,7 +11,9 @@
"Promise": false,
},
"rules": {
"array-callback-return": "error",
"block-scoped-var": "error",
"curly": "error",
"eqeqeq": "error",
"no-console": [
"error",
......
......@@ -121,7 +121,7 @@ gulp.task('build-app-js', ['build-vendor-js'], function () {
});
gulp.task('watch-app-js', ['build-vendor-js'], function () {
appBundleConfigs.map(function (config) {
appBundleConfigs.forEach(function (config) {
createBundle(config, {watch: true});
});
});
......
......@@ -121,7 +121,7 @@ function threadAnnotations(annotations) {
// Collect the set of threads which have no parent as
// children of the thread root
var roots = [];
Object.keys(threads).map(function (id) {
Object.keys(threads).forEach(function (id) {
if (!threads[id].parent) {
// Top-level threads are collapsed by default
threads[id].collapsed = true;
......
'use strict';
/* eslint curly: "off" */
/** This software is released under the MIT license:
Permission is hereby granted, free of charge, to any person obtaining a copy
......
......@@ -81,10 +81,9 @@ function stripUnnecessaryReturns(js) {
for (var i=0; i < stripReturnPatterns.length; i++) {
if (remainder.match(stripReturnPatterns[i])) {
return remainder;
} else {
return remainder;
}
}
return line;
} else {
return line;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment