Skip to content

Fix prettier #1279

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion integration/test/ParseQueryTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -1721,7 +1721,7 @@ describe('Parse Query', () => {
});
});

it('supports objects with length', async (done) => {
it('supports objects with length', async done => {
const obj = new TestObject();
obj.set('length', 5);
assert.equal(obj.get('length'), 5);
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
"prepare": "npm run build",
"release_docs": "./release_docs.sh",
"gulp": "gulp",
"prettier": "prettier --write {src,integration}/{**/*,*}.js && npm run lint:fix",
"prettier": "prettier --write '{src,integration}/{**/*,*}.js' && npm run lint:fix",
"cross-env": "cross-env"
},
"husky": {
Expand All @@ -106,7 +106,8 @@
},
"lint-staged": {
"{src,integration}/{**/*,*}.js": [
"prettier",
"prettier --write",
"eslint --fix --cache",
"git add"
]
},
Expand Down
10 changes: 5 additions & 5 deletions src/__tests__/test_helpers/asyncHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@
// We need this until Jest finishes upgrading to Jasmine 2.0
module.exports = function asyncHelper(fn) {
let finished = false;
const done = function() {
const done = function () {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we had that Lint discussion already, but the space between function and brackets is what we want?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, technically you need a space before the name of the function. The name here is empty so the space should remain.

finished = true;
};

return function() {
runs(function() {
return function () {
runs(function () {
fn(done);
});

waitsFor(function() {
waitsFor(function () {
return finished;
});
};
}
};
4 changes: 2 additions & 2 deletions src/__tests__/test_helpers/mockRNStorage.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ const mockRNStorage = {
},

multiGet(keys, cb) {
const objects = keys.map((key) => [key, mockStorage[key]]);
const objects = keys.map(key => [key, mockStorage[key]]);
cb(undefined, objects);
},

multiRemove(keys, cb) {
keys.map((key) => delete mockStorage[key]);
keys.map(key => delete mockStorage[key]);
cb(undefined);
},

Expand Down
6 changes: 3 additions & 3 deletions src/__tests__/test_helpers/mockWeChat.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const mockWeChat = {

request(options) {
return {
onProgressUpdate: (cb) => {
onProgressUpdate: cb => {
progressCallback = cb;
},
abort: () => {
Expand All @@ -43,8 +43,8 @@ const mockWeChat = {
data: {},
});
options.fail();
}
}
},
};
},

connectSocket() {},
Expand Down
12 changes: 6 additions & 6 deletions src/__tests__/test_helpers/mockXHR.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,27 +17,27 @@
* `upload` can be provided to mock the XMLHttpRequest.upload property.
*/
function mockXHR(results, options = {}) {
const XHR = function() { };
const XHR = function () {};
let attempts = 0;
const headers = {};
XHR.prototype = {
open: function() { },
open: function () {},
setRequestHeader: jest.fn((key, value) => {
headers[key] = value;
}),
getRequestHeader: function(key) {
getRequestHeader: function (key) {
return headers[key];
},
upload: function() { },
send: function() {
upload: function () {},
send: function () {
this.status = results[attempts].status;
this.responseText = JSON.stringify(results[attempts].response || {});
this.readyState = 4;
attempts++;
this.onreadystatechange();
this.onprogress(options.progress);
this.upload.onprogress(options.progress);
}
},
};
return XHR;
}
Expand Down