Skip to content

Commit ee8c529

Browse files
committed
Adds linting to sources
1 parent 13072a8 commit ee8c529

37 files changed

+1507
-411
lines changed

.eslintrc.json

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"root": true,
3+
"extends": "eslint:recommended",
4+
"env": {
5+
"node": true,
6+
"es6": true
7+
},
8+
"parser": "babel-eslint",
9+
"plugins": [
10+
"flowtype"
11+
],
12+
"parserOptions": {
13+
"ecmaVersion": 6,
14+
"sourceType": "module"
15+
},
16+
"rules": {
17+
"indent": ["error", 2],
18+
"linebreak-style": ["error", "unix"],
19+
"no-trailing-spaces": 2,
20+
"eol-last": 2,
21+
"space-in-parens": ["error", "never"],
22+
"no-multiple-empty-lines": 1,
23+
"prefer-const": "error",
24+
"space-infix-ops": "error",
25+
"no-useless-escape": "off"
26+
}
27+
}

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,5 @@ integration/test_logs
1212
test_logs
1313
out/
1414
docs/
15+
.eslintcache
16+

2.0.0.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,19 @@ With native promises, `.done` and `.fail` don't exist and are replaces by `.then
1414
// before
1515
const query = new Parse.Query();
1616
query.find()
17-
.done((results) => {
17+
.done((results) => {
1818

1919
})
20-
.fail((error) => {
20+
.fail((error) => {
2121

2222
});
2323

2424
// after
2525
query.find()
26-
.then((results) => {
26+
.then((results) => {
2727

2828
})
29-
.catch((error) => {
29+
.catch((error) => {
3030

3131
});
3232
```
@@ -37,13 +37,13 @@ query.find()
3737
// before
3838
const query = new Parse.Query();
3939
query.find()
40-
.always((result) => {
40+
.always((result) => {
4141

4242
});
4343

4444
// after
4545
query.find()
46-
.finally((result) => {
46+
.finally((result) => {
4747

4848
});
4949
```
@@ -55,15 +55,15 @@ With native promises, the constructor is different, you will need to update to t
5555
```js
5656
// before
5757
const promise = new Promise();
58-
doSomethingAsync((error, success) => {
58+
doSomethingAsync((error, success) => {
5959
if (error) { promise.reject(error); }
6060
else { promise.resolve(success); }
6161
});
6262
return promise;
6363

6464
// after
65-
return new Promise((resolve, reject) => {
66-
doSomethingAsync((error, success) => {
65+
return new Promise((resolve, reject) => {
66+
doSomethingAsync((error, success) => {
6767
if (error) { reject(error); }
6868
else { resolve(success); }
6969
});

0 commit comments

Comments
 (0)