Skip to content

Commit 300caf2

Browse files
authored
Fix prettier (#1279)
1 parent 7fb7b2d commit 300caf2

File tree

6 files changed

+20
-19
lines changed

6 files changed

+20
-19
lines changed

integration/test/ParseQueryTest.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1721,7 +1721,7 @@ describe('Parse Query', () => {
17211721
});
17221722
});
17231723

1724-
it('supports objects with length', async (done) => {
1724+
it('supports objects with length', async done => {
17251725
const obj = new TestObject();
17261726
obj.set('length', 5);
17271727
assert.equal(obj.get('length'), 5);

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@
9696
"prepare": "npm run build",
9797
"release_docs": "./release_docs.sh",
9898
"gulp": "gulp",
99-
"prettier": "prettier --write {src,integration}/{**/*,*}.js && npm run lint:fix",
99+
"prettier": "prettier --write '{src,integration}/{**/*,*}.js' && npm run lint:fix",
100100
"cross-env": "cross-env"
101101
},
102102
"husky": {
@@ -106,7 +106,8 @@
106106
},
107107
"lint-staged": {
108108
"{src,integration}/{**/*,*}.js": [
109-
"prettier",
109+
"prettier --write",
110+
"eslint --fix --cache",
110111
"git add"
111112
]
112113
},

src/__tests__/test_helpers/asyncHelper.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,17 @@
1010
// We need this until Jest finishes upgrading to Jasmine 2.0
1111
module.exports = function asyncHelper(fn) {
1212
let finished = false;
13-
const done = function() {
13+
const done = function () {
1414
finished = true;
1515
};
1616

17-
return function() {
18-
runs(function() {
17+
return function () {
18+
runs(function () {
1919
fn(done);
2020
});
2121

22-
waitsFor(function() {
22+
waitsFor(function () {
2323
return finished;
2424
});
2525
};
26-
}
26+
};

src/__tests__/test_helpers/mockRNStorage.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,12 @@ const mockRNStorage = {
2828
},
2929

3030
multiGet(keys, cb) {
31-
const objects = keys.map((key) => [key, mockStorage[key]]);
31+
const objects = keys.map(key => [key, mockStorage[key]]);
3232
cb(undefined, objects);
3333
},
3434

3535
multiRemove(keys, cb) {
36-
keys.map((key) => delete mockStorage[key]);
36+
keys.map(key => delete mockStorage[key]);
3737
cb(undefined);
3838
},
3939

src/__tests__/test_helpers/mockWeChat.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ const mockWeChat = {
3030

3131
request(options) {
3232
return {
33-
onProgressUpdate: (cb) => {
33+
onProgressUpdate: cb => {
3434
progressCallback = cb;
3535
},
3636
abort: () => {
@@ -43,8 +43,8 @@ const mockWeChat = {
4343
data: {},
4444
});
4545
options.fail();
46-
}
47-
}
46+
},
47+
};
4848
},
4949

5050
connectSocket() {},

src/__tests__/test_helpers/mockXHR.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,27 +17,27 @@
1717
* `upload` can be provided to mock the XMLHttpRequest.upload property.
1818
*/
1919
function mockXHR(results, options = {}) {
20-
const XHR = function() { };
20+
const XHR = function () {};
2121
let attempts = 0;
2222
const headers = {};
2323
XHR.prototype = {
24-
open: function() { },
24+
open: function () {},
2525
setRequestHeader: jest.fn((key, value) => {
2626
headers[key] = value;
2727
}),
28-
getRequestHeader: function(key) {
28+
getRequestHeader: function (key) {
2929
return headers[key];
3030
},
31-
upload: function() { },
32-
send: function() {
31+
upload: function () {},
32+
send: function () {
3333
this.status = results[attempts].status;
3434
this.responseText = JSON.stringify(results[attempts].response || {});
3535
this.readyState = 4;
3636
attempts++;
3737
this.onreadystatechange();
3838
this.onprogress(options.progress);
3939
this.upload.onprogress(options.progress);
40-
}
40+
},
4141
};
4242
return XHR;
4343
}

0 commit comments

Comments
 (0)