Add lint rule space-infix-ops (#3237)

Disallows: 1+1.  Must be 1 + 1.
This commit is contained in:
Arthur Cinader
2017-01-11 12:31:40 -08:00
committed by GitHub
parent 56bb505df2
commit 4cb6e7d209
45 changed files with 145 additions and 144 deletions

View File

@@ -110,7 +110,7 @@ function RestQuery(config, auth, className, restWhere = {}, restOptions = {}, cl
// reduce to create all paths
// ([a,b,c] -> {a: true, 'a.b': true, 'a.b.c': true})
return path.split('.').reduce((memo, path, index, parts) => {
memo[parts.slice(0, index+1).join('.')] = true;
memo[parts.slice(0, index + 1).join('.')] = true;
return memo;
}, memo);
}, {});
@@ -552,8 +552,8 @@ function includePath(config, auth, response, path, restOptions = {}) {
const keys = new Set(restOptions.keys.split(','));
const keySet = Array.from(keys).reduce((set, key) => {
const keyPath = key.split('.');
let i=0;
for (i; i<path.length; i++) {
let i = 0;
for (i; i < path.length; i++) {
if (path[i] != keyPath[i]) {
return set;
}