Skip to content

Commit 6daf0c0

Browse files
authored
(#8672) - eslint: introduce rule: no-trailing-spaces
Co-authored-by: alxndrsn <alxndrsn>
1 parent 2876834 commit 6daf0c0

File tree

25 files changed

+90
-89
lines changed

25 files changed

+90
-89
lines changed

.eslintrc.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
"eol-last": "error",
3737
"no-empty": "off",
3838
"no-console": "off",
39+
"no-trailing-spaces": "error",
3940
"semi": ["error", "always"],
4041
"curly": ["error", "all"],
4142
"space-unary-ops": ["error", {"words": true}],

bin/test-browser.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ class RemoteRunner {
125125

126126
on(name, handler) {
127127
var handlers = this.handlers;
128-
128+
129129
if (!handlers[name]) {
130130
handlers[name] = [];
131131
}
@@ -134,21 +134,21 @@ class RemoteRunner {
134134

135135
handleEvents(events) {
136136
var handlers = this.handlers;
137-
137+
138138
events.forEach((event) => {
139139
this.completed = this.completed || event.name === 'end';
140140
this.failed = this.failed || event.name === 'fail';
141-
141+
142142
var additionalProps = ['pass', 'fail', 'pending'].indexOf(event.name) === -1 ? {} : {
143143
slow: event.obj.slow ? function () { return event.obj.slow; } : function () { return 60; },
144144
fullTitle: event.obj.fullTitle ? function () { return event.obj.fullTitle; } : undefined
145145
};
146146
var obj = Object.assign({}, event.obj, additionalProps);
147-
147+
148148
handlers[event.name].forEach(function (handler) {
149149
handler(obj, event.err);
150150
});
151-
151+
152152
if (event.logs && event.logs.length > 0) {
153153
event.logs.forEach(function (line) {
154154
if (line.type === 'log') {
@@ -163,14 +163,14 @@ class RemoteRunner {
163163
}
164164
});
165165
}
166-
166+
167167
bail() {
168168
var handlers = this.handlers;
169-
169+
170170
handlers['end'].forEach(function (handler) {
171171
handler();
172172
});
173-
173+
174174
this.completed = true;
175175
}
176176
}

packages/node_modules/pouchdb-abstract-mapreduce/src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -708,7 +708,7 @@ function createAbstractMapReduce(localDocName, mapper, reducer, ddocValidator) {
708708
view.seq = currentSeq;
709709
view.sourceDB.activeTasks.remove(taskId);
710710
} catch (error) {
711-
view.sourceDB.activeTasks.remove(taskId, error);
711+
view.sourceDB.activeTasks.remove(taskId, error);
712712
}
713713
}
714714

packages/node_modules/pouchdb-adapter-idb/src/allDocs.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import runBatchedCursor from './runBatchedCursor';
1818
import getAll from './getAll';
1919

2020
function allDocsKeys(keys, docStore, onBatch) {
21-
// It's not guaranted to be returned in right order
21+
// It's not guaranted to be returned in right order
2222
var valuesBatch = new Array(keys.length);
2323
var count = 0;
2424
keys.forEach(function (key, index) {
@@ -69,17 +69,17 @@ function idbAllDocs(opts, idb, callback) {
6969
var start = 'startkey' in opts ? opts.startkey : false;
7070
var end = 'endkey' in opts ? opts.endkey : false;
7171
var key = 'key' in opts ? opts.key : false;
72-
var keys = 'keys' in opts ? opts.keys : false;
72+
var keys = 'keys' in opts ? opts.keys : false;
7373
var skip = opts.skip || 0;
7474
var limit = typeof opts.limit === 'number' ? opts.limit : -1;
7575
var inclusiveEnd = opts.inclusive_end !== false;
7676

77-
var keyRange ;
77+
var keyRange ;
7878
var keyRangeError;
7979
if (!keys) {
8080
keyRange = createKeyRange(start, end, inclusiveEnd, key, opts.descending);
8181
keyRangeError = keyRange && keyRange.error;
82-
if (keyRangeError &&
82+
if (keyRangeError &&
8383
!(keyRangeError.name === "DataError" && keyRangeError.code === 0)) {
8484
// DataError with error code 0 indicates start is less than end, so
8585
// can just do an empty query. Else need to throw
@@ -114,7 +114,7 @@ function idbAllDocs(opts, idb, callback) {
114114

115115
/* istanbul ignore if */
116116
if (opts.update_seq) {
117-
getMaxUpdateSeq(seqStore, function (e) {
117+
getMaxUpdateSeq(seqStore, function (e) {
118118
if (e.target.result && e.target.result.length > 0) {
119119
updateSeq = e.target.result[0];
120120
}
@@ -127,7 +127,7 @@ function idbAllDocs(opts, idb, callback) {
127127
var maxKey = undefined;
128128
if (cursor && cursor.key) {
129129
maxKey = cursor.key;
130-
}
130+
}
131131
return onSuccess({
132132
target: {
133133
result: [maxKey]
@@ -218,7 +218,7 @@ function idbAllDocs(opts, idb, callback) {
218218
offset: opts.skip,
219219
rows: results
220220
};
221-
221+
222222
/* istanbul ignore if */
223223
if (opts.update_seq && updateSeq !== undefined) {
224224
returnVal.update_seq = updateSeq;

packages/node_modules/pouchdb-adapter-indexeddb/src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ function IdbPouch(dbOpts, callback) {
3131
if (dbOpts.view_adapter) {
3232
console.log('Please note that the indexeddb adapter manages _find indexes itself, therefore it is not using your specified view_adapter');
3333
}
34-
34+
3535
var api = this;
3636
var metadata = {};
3737

packages/node_modules/pouchdb-checkpointer/src/index.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ class CheckpointerInternal {
116116

117117
getCheckpoint() {
118118
var self = this;
119-
119+
120120
if (self.opts && self.opts.writeSourceCheckpoint && !self.opts.writeTargetCheckpoint) {
121121
return self.src.get(self.id).then(function (sourceDoc) {
122122
return sourceDoc.last_seq || LOWEST_SEQ;
@@ -128,27 +128,27 @@ class CheckpointerInternal {
128128
return LOWEST_SEQ;
129129
});
130130
}
131-
131+
132132
return self.target.get(self.id).then(function (targetDoc) {
133133
if (self.opts && self.opts.writeTargetCheckpoint && !self.opts.writeSourceCheckpoint) {
134134
return targetDoc.last_seq || LOWEST_SEQ;
135135
}
136-
136+
137137
return self.src.get(self.id).then(function (sourceDoc) {
138138
// Since we can't migrate an old version doc to a new one
139139
// (no session id), we just go with the lowest seq in this case
140140
/* istanbul ignore if */
141141
if (targetDoc.version !== sourceDoc.version) {
142142
return LOWEST_SEQ;
143143
}
144-
144+
145145
var version;
146146
if (targetDoc.version) {
147147
version = targetDoc.version.toString();
148148
} else {
149149
version = "undefined";
150150
}
151-
151+
152152
if (version in comparisons) {
153153
return comparisons[version](targetDoc, sourceDoc);
154154
}

packages/node_modules/pouchdb-core/src/changes.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -73,15 +73,15 @@ class Changes extends EE {
7373
this.cancel();
7474
};
7575
db.once('destroyed', onDestroy);
76-
76+
7777
opts.onChange = (change, pending, lastSeq) => {
7878
/* istanbul ignore if */
7979
if (this.isCancelled) {
8080
return;
8181
}
8282
tryCatchInChangeListener(this, change, pending, lastSeq);
8383
};
84-
84+
8585
var promise = new Promise(function (fulfill, reject) {
8686
opts.complete = function (err, res) {
8787
if (err) {
@@ -100,9 +100,9 @@ class Changes extends EE {
100100
this.then(function (result) {
101101
complete(null, result);
102102
}, complete);
103-
104-
105-
103+
104+
105+
106106
if (!db.taskqueue.isReady) {
107107
db.taskqueue.addTask((failed) => {
108108
if (failed) {
@@ -127,7 +127,7 @@ class Changes extends EE {
127127

128128
validateChanges(opts) {
129129
var callback = opts.complete;
130-
130+
131131
/* istanbul ignore else */
132132
if (PouchDB._changesFilterPlugin) {
133133
PouchDB._changesFilterPlugin.validate(opts, (err) => {
@@ -143,13 +143,13 @@ class Changes extends EE {
143143

144144
doChanges(opts) {
145145
var callback = opts.complete;
146-
146+
147147
opts = clone(opts);
148148
if ('live' in opts && !('continuous' in opts)) {
149149
opts.continuous = opts.live;
150150
}
151151
opts.processChange = processChange;
152-
152+
153153
if (opts.since === 'latest') {
154154
opts.since = 'now';
155155
}
@@ -168,7 +168,7 @@ class Changes extends EE {
168168
}, callback);
169169
return;
170170
}
171-
171+
172172
/* istanbul ignore else */
173173
if (PouchDB._changesFilterPlugin) {
174174
PouchDB._changesFilterPlugin.normalize(opts);
@@ -186,11 +186,11 @@ class Changes extends EE {
186186
}
187187
});
188188
}
189-
189+
190190
if (!('descending' in opts)) {
191191
opts.descending = false;
192192
}
193-
193+
194194
// 0 and 1 should return 1 document
195195
opts.limit = opts.limit === 0 ? 1 : opts.limit;
196196
opts.complete = callback;

packages/node_modules/pouchdb-find/src/adapters/local/find/query-planner.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -432,15 +432,15 @@ function getMultiFieldQueryOpts(selector, index) {
432432

433433
function shouldShortCircuit(selector) {
434434
// We have a field to select from, but not a valid value
435-
// this should result in a short circuited query
435+
// this should result in a short circuited query
436436
// just like the http adapter (couchdb) and mongodb
437437
// see tests for issue #7810
438-
438+
439439
// @todo Use 'Object.values' when Node.js v6 support is dropped.
440440
const values = Object.keys(selector).map(function (key) {
441441
return selector[key];
442442
});
443-
return values.some(function (val) {
443+
return values.some(function (val) {
444444
return typeof val === 'object' && Object.keys(val).length === 0;
445445
});
446446
}

packages/node_modules/pouchdb-replication/src/replication.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class Replication extends EE {
3333
return;
3434
}
3535
this._readyCalled = true;
36-
36+
3737
const onDestroy = () => {
3838
this.cancel();
3939
};

packages/node_modules/pouchdb-utils/src/changesHandler.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ import nextTick from './nextTick';
66
export default class Changes extends EventEmitter {
77
constructor() {
88
super();
9-
9+
1010
this._listeners = {};
11-
11+
1212
if (hasLocalStorage()) {
1313
addEventListener("storage", (e) => {
1414
this.emit(e.key);
@@ -35,11 +35,11 @@ export default class Changes extends EventEmitter {
3535
'style', 'include_docs', 'attachments', 'conflicts', 'filter',
3636
'doc_ids', 'view', 'since', 'query_params', 'binary', 'return_docs'
3737
]);
38-
38+
3939
function onError() {
4040
inprogress = false;
4141
}
42-
42+
4343
db.changes(changesOpts).on('change', function (c) {
4444
if (c.seq > opts.since && !opts.cancelled) {
4545
opts.since = c.seq;
@@ -55,23 +55,23 @@ export default class Changes extends EventEmitter {
5555
this._listeners[id] = eventFunction;
5656
this.on(dbName, eventFunction);
5757
}
58-
58+
5959
removeListener(dbName, id) {
6060
if (!(id in this._listeners)) {
6161
return;
6262
}
6363
super.removeListener(dbName, this._listeners[id]);
6464
delete this._listeners[id];
6565
}
66-
66+
6767
notifyLocalWindows(dbName) {
6868
//do a useless change on a storage thing
6969
//in order to get other windows's listeners to activate
7070
if (hasLocalStorage()) {
7171
localStorage[dbName] = (localStorage[dbName] === "a") ? "b" : "a";
7272
}
7373
}
74-
74+
7575
notify(dbName) {
7676
this.emit(dbName);
7777
this.notifyLocalWindows(dbName);

0 commit comments

Comments
 (0)