Skip to content

Commit b6c3f1f

Browse files
committed
Fixed linting again! #150
1 parent ec4e705 commit b6c3f1f

7 files changed

Lines changed: 47 additions & 43 deletions

File tree

src/api/ApiManager.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export default class ApiManager {
3030
baseUrl,
3131
appToken,
3232
ApiManager.authToken,
33-
function() {
33+
function () {
3434
return self.getAuthToken(ApiManager.lastKnownPassword)
3535
}
3636
)
@@ -72,13 +72,13 @@ export default class ApiManager {
7272
otpToken: process.env.CAPROVER_OTP_TOKEN
7373
})
7474
)
75-
.then(function(data) {
75+
.then(function (data) {
7676
authTokenFetched = data.token
7777
self.setAuthToken(authTokenFetched)
7878
return authTokenFetched
7979
})
8080
.then(self.authTokenSaver)
81-
.then(function() {
81+
.then(function () {
8282
return authTokenFetched
8383
})
8484
}

src/api/CliApiManager.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export default class CliApiManager {
2828
CliApiManager.instances[hashKey] = new ApiManager(
2929
capMachine.baseUrl + Constants.BASE_API_PATH,
3030
capMachine.appToken,
31-
function(token) {
31+
function (token) {
3232
capMachine.authToken = token
3333
if (capMachine.name) {
3434
StorageHelper.get().saveMachine(capMachine)

src/api/HttpClient.ts

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -52,37 +52,37 @@ export default class HttpClient {
5252
variables: any
5353
) {
5454
const self = this
55-
return function(): Promise<any> {
55+
return function (): Promise<any> {
5656
return Promise.resolve() //
57-
.then(function() {
57+
.then(function () {
5858
if (!process.env.REACT_APP_IS_DEBUG) {
5959
return Promise.resolve()
6060
}
61-
return new Promise<void>(function(res) {
61+
return new Promise<void>(function (res) {
6262
setTimeout(res, 500)
6363
})
6464
})
65-
.then(function() {
65+
.then(function () {
6666
return self.fetchInternal(method, endpoint, variables) //
6767
})
68-
.then(function(data) {
68+
.then(function (data) {
6969
if (
7070
data.status === ErrorFactory.STATUS_AUTH_TOKEN_INVALID
7171
) {
7272
return self
7373
.onAuthFailure() //
74-
.then(function() {
74+
.then(function () {
7575
return self
7676
.fetchInternal(method, endpoint, variables)
77-
.then(function(newRequestResponse) {
77+
.then(function (newRequestResponse) {
7878
return newRequestResponse
7979
})
8080
})
8181
} else {
8282
return data
8383
}
8484
})
85-
.then(function(data) {
85+
.then(function (data) {
8686
if (
8787
data.status !== ErrorFactory.OKAY &&
8888
data.status !== ErrorFactory.OKAY_BUILD_STARTED
@@ -94,25 +94,25 @@ export default class HttpClient {
9494
}
9595
return data
9696
})
97-
.then(function(data) {
97+
.then(function (data) {
9898
// tslint:disable-next-line: max-line-length
9999
// These two blocks are clearly memory leaks! But I don't have time to fix them now... I need to CANCEL the promise, but since I don't
100100
// have CANCEL method on the native Promise, I return a promise that will never RETURN if the HttpClient is destroyed.
101101
// tslint:disable-next-line: max-line-length
102102
// Will fix them later... but it shouldn't be a big deal anyways as it's only a problem when user navigates away from a page before the
103103
// network request returns back.
104-
return new Promise(function(resolve, reject) {
104+
return new Promise(function (resolve, reject) {
105105
// data.data here is the "data" field inside the API response! {status: 100, description: "Login succeeded", data: {…}}
106106
if (!self.isDestroyed) {
107107
return resolve(data.data)
108108
}
109109
Logger.dev('Destroyed then not called')
110110
})
111111
})
112-
.catch(function(error) {
112+
.catch(function (error) {
113113
// Logger.log('');
114114
// Logger.error(error.message || error);
115-
return new Promise(function(resolve, reject) {
115+
return new Promise(function (resolve, reject) {
116116
if (!self.isDestroyed) {
117117
return reject(error)
118118
}
@@ -145,7 +145,7 @@ export default class HttpClient {
145145
headers: self.createHeaders(),
146146
qs: variables,
147147
json: true
148-
}).then(function(data) {
148+
}).then(function (data) {
149149
return data
150150
})
151151
}
@@ -162,7 +162,7 @@ export default class HttpClient {
162162
headers: self.createHeaders(),
163163
formData: variables,
164164
json: true
165-
}).then(function(data) {
165+
}).then(function (data) {
166166
return data
167167
})
168168
}
@@ -171,7 +171,7 @@ export default class HttpClient {
171171
headers: self.createHeaders(),
172172
body: variables,
173173
json: true
174-
}).then(function(data) {
174+
}).then(function (data) {
175175
return data
176176
})
177177
}

src/utils/DeployHelper.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ export default class DeployHelper {
103103
}
104104

105105
private gitArchiveFile(zipFileFullPath: string, branchToPush: string) {
106-
return new Promise<string>(function(resolve, reject) {
106+
return new Promise<string>(function (resolve, reject) {
107107
if (fs.pathExistsSync(zipFileFullPath)) {
108108
fs.removeSync(zipFileFullPath)
109109
} // Removes the temporary file created

src/utils/ErrorFactory.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class ErrorFactory {
3030
}
3131

3232
eatUpPromiseRejection() {
33-
return function(error: any) {
33+
return function (error: any) {
3434
// nom nom
3535
}
3636
}

src/utils/Utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const util = {
1717
generateUuidV4() {
1818
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(
1919
/[xy]/g,
20-
function(c) {
20+
function (c) {
2121
const r = (Math.random() * 16) | 0
2222
const v = c === 'x' ? r : (r & 0x3) | 0x8
2323
return v.toString(16)

tslint.json

Lines changed: 25 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,32 @@
22
"defaultSeverity": "error",
33
"extends": ["tslint:recommended"],
44
"jsRules": {
5-
"no-unused-expression": true
5+
"no-unused-expression": true
66
},
77
"rules": {
8-
"quotemark": [false],
9-
"member-access": [true, "no-public"],
10-
"ordered-imports": [false],
11-
"member-ordering": [false],
12-
"interface-name": [false],
13-
"arrow-parens": false,
14-
"object-literal-sort-keys": false,
15-
"only-arrow-functions": false,
16-
"semicolon":false,
17-
"trailing-comma": [true, {"multiline": "never", "singleline": "never"}],
18-
"no-bitwise": false,
19-
"no-console": [true, "error"],
20-
"max-line-length": [
21-
true,
22-
{
23-
"limit": 170,
24-
"ignore-pattern": "^// {(.*?)}"
25-
}
26-
]
8+
"quotemark": [false],
9+
"member-access": [true, "no-public"],
10+
"ordered-imports": [false],
11+
"member-ordering": [false],
12+
"interface-name": [false],
13+
"arrow-parens": false,
14+
"object-literal-sort-keys": false,
15+
"only-arrow-functions": false,
16+
"space-before-function-paren": [false],
17+
"semicolon": false,
18+
"trailing-comma": [
19+
true,
20+
{ "multiline": "never", "singleline": "never" }
21+
],
22+
"no-bitwise": false,
23+
"no-console": [true, "error"],
24+
"max-line-length": [
25+
true,
26+
{
27+
"limit": 170,
28+
"ignore-pattern": "^// {(.*?)}"
29+
}
30+
]
2731
},
2832
"rulesDirectory": []
29-
}
33+
}

0 commit comments

Comments
 (0)