Conversation
| * | ||
| * @param {string} uid The uid of the user to lookup. | ||
| * @return {Promise<Object>} A promise that resolves with the user information. | ||
| * @return {Promise<object>} A promise that resolves with the user information. |
There was a problem hiding this comment.
Does the linter complain about javadoc types too?
There was a problem hiding this comment.
Not really, but I thought it makes sense to keep the jsdoc types in sync with the implementation. WDYT?
There was a problem hiding this comment.
The downside is that it will not align with our externs format. Could this be an issue?
There was a problem hiding this comment.
I think that's fine since the externs are curated by hand anyway. Going forward we can adhere to the distinction:
- Only Typescript in source (everything on Github)
- Only JS in API docs (externs)
src/auth/auth-api-request.ts
Outdated
| error = response; | ||
| } | ||
|
|
||
| const error = (typeof response === 'object' && 'statusCode' in response) |
There was a problem hiding this comment.
Better for readability to have the ? on the previous line:
const error = (typeof response === 'object' && 'statusCode' in response) ?
response.error : response;
Here and elsewhere
src/auth/credential.ts
Outdated
| } | ||
| constructor(serviceAccountPathOrObject: string | object) { | ||
| this.certificate_ = (typeof serviceAccountPathOrObject === 'string') | ||
| ? Certificate.fromPath(serviceAccountPathOrObject) : new Certificate(serviceAccountPathOrObject); |
There was a problem hiding this comment.
Better for readability to have the ? on the previous line
src/auth/credential.ts
Outdated
| } | ||
| constructor(refreshTokenPathOrObject: string | object) { | ||
| this.refreshToken_ = (typeof refreshTokenPathOrObject === 'string') | ||
| ? RefreshToken.fromPath(refreshTokenPathOrObject) : new RefreshToken(refreshTokenPathOrObject); |
There was a problem hiding this comment.
Better for readability to have the ? on the previous line
| } | ||
|
|
||
| const error = (typeof response === 'object' && 'error' in response) | ||
| ? response.error : response; |
There was a problem hiding this comment.
Better for readability to have the ? on the previous line
| } | ||
| const template: string = ERROR_CODES[response.statusCode]; | ||
| const message: string = template | ||
| ? `Instance ID "${apiSettings.getEndpoint()}": ${template}` : JSON.stringify(error); |
There was a problem hiding this comment.
Better for readability to have the ? on the previous line
Upgrading to a more recent version of tslint, which performs a wide range of checks on source. I've updated the source to be compliant.