Adds liniting into the workflow (#3082)

* initial linting of src

* fix indent to 2 spaces

* Removes unnecessary rules

* ignore spec folder for now

* Spec linting

* Fix spec indent

* nits

* nits

* no no-empty rule
This commit is contained in:
Florent Vilmart
2016-11-24 15:47:41 -05:00
committed by GitHub
parent 6e2fba4ae4
commit 8c2c76dd26
149 changed files with 3478 additions and 3507 deletions

View File

@@ -51,8 +51,7 @@ export class HooksController {
return this._removeHooks({ className: className, triggerName: triggerName });
}
_getHooks(query = {}, limit) {
let options = limit ? { limit: limit } : undefined;
_getHooks(query = {}) {
return this.database.find(DefaultHooksCollectionName, query).then((results) => {
return results.map((result) => {
delete result.objectId;
@@ -113,7 +112,7 @@ export class HooksController {
}
return this.addHook(hook);
};
}
createHook(aHook) {
if (aHook.functionName) {
@@ -134,7 +133,7 @@ export class HooksController {
}
throw new Parse.Error(143, "invalid hook declaration");
};
}
updateHook(aHook) {
if (aHook.functionName) {
@@ -153,7 +152,7 @@ export class HooksController {
});
}
throw new Parse.Error(143, "invalid hook declaration");
};
}
}
function wrapToHTTPRequest(hook, key) {
@@ -170,7 +169,7 @@ function wrapToHTTPRequest(hook, key) {
jsonBody.original = req.original.toJSON();
jsonBody.original.className = req.original.className;
}
let jsonRequest = {
let jsonRequest: any = {
headers: {
'Content-Type': 'application/json'
},