Skip to content
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

build: update linter #1491

Merged
merged 6 commits into from
Aug 16, 2023
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 .github/.OwlBot.lock.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@
# limitations under the License.
docker:
image: gcr.io/cloud-devrel-public-resources/owlbot-nodejs:latest
digest: sha256:ef104a520c849ffde60495342ecf099dfb6256eab0fbd173228f447bc73d1aa9
digest: sha256:e08f9a3757808cdaf7a377e962308c65c4d7eff12db206d4fae702dd50d43430
# created: 2023-07-10T21:36:52.433664553Z
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"@compodoc/compodoc": "1.1.21",
"@types/mocha": "^9.0.0",
"@types/ncp": "^2.0.1",
"@types/node": "^18.0.0",
"@types/node": "^20.5.0",
"@types/node-fetch": "^2.5.4",
"@types/object-hash": "^3.0.0",
"@types/proxyquire": "^1.3.28",
Expand All @@ -38,7 +38,7 @@
"codecov": "^3.1.0",
"execa": "^5.0.0",
"google-proto-files": "^3.0.3",
"gts": "^3.1.0",
"gts": "^5.0.0",
"linkinator": "^4.0.0",
"long": "^4.0.0",
"mkdirp": "^2.0.0",
Expand All @@ -52,7 +52,7 @@
"sinon": "^15.0.0",
"stream-events": "^1.0.4",
"ts-loader": "^8.0.0",
"typescript": "^4.6.4",
"typescript": "^5.1.6",
"uglify-js": "^3.17.0",
"walkdir": "^0.4.0",
"webpack": "^4.0.0",
Expand Down
2 changes: 1 addition & 1 deletion src/apitypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export type RawResponseType = Operation | {} | null;
export type ResultTuple = [
ResponseType | [ResponseType],
NextPageRequestType | undefined,
RawResponseType | undefined
RawResponseType | undefined,
];

export interface SimpleCallbackFunction {
Expand Down
6 changes: 3 additions & 3 deletions src/clientInterface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export interface Descriptors {
export interface Callback<
ResponseObject,
NextRequestObject,
RawResponseObject
RawResponseObject,
> {
(
err: Error | null | undefined,
Expand All @@ -69,7 +69,7 @@ export interface LROperation<ResultType, MetadataType>
export interface PaginationCallback<
RequestObject,
ResponseObject,
ResponseType
ResponseType,
> {
(
err: Error | null,
Expand All @@ -82,7 +82,7 @@ export interface PaginationCallback<
export interface PaginationResponse<
RequestObject,
ResponseObject,
ResponseType
ResponseType,
> {
values?: ResponseType[];
nextPageRequest?: RequestObject;
Expand Down
4 changes: 2 additions & 2 deletions src/locationService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ export class LocationsClient {
[
protos.google.cloud.location.ILocation[],
protos.google.cloud.location.IListLocationsRequest | null,
protos.google.cloud.location.IListLocationsResponse
protos.google.cloud.location.IListLocationsResponse,
]
>;
listLocations(
Expand Down Expand Up @@ -438,7 +438,7 @@ export class LocationsClient {
[
protos.google.cloud.location.ILocation[],
protos.google.cloud.location.IListLocationsRequest | null,
protos.google.cloud.location.IListLocationsResponse
protos.google.cloud.location.IListLocationsResponse,
]
> | void {
request = request || {};
Expand Down
16 changes: 8 additions & 8 deletions test/showcase-echo-client/src/v1beta1/echo_client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@ export class EchoClient {
[
protos.google.showcase.v1beta1.IEchoResponse,
protos.google.showcase.v1beta1.IEchoRequest | undefined,
{} | undefined
{} | undefined,
]
>;
echo(
Expand Down Expand Up @@ -548,7 +548,7 @@ export class EchoClient {
[
protos.google.showcase.v1beta1.IEchoResponse,
protos.google.showcase.v1beta1.IEchoRequest | undefined,
{} | undefined
{} | undefined,
]
> | void {
request = request || {};
Expand Down Expand Up @@ -596,7 +596,7 @@ export class EchoClient {
[
protos.google.showcase.v1beta1.IBlockResponse,
protos.google.showcase.v1beta1.IBlockRequest | undefined,
{} | undefined
{} | undefined,
]
>;
block(
Expand Down Expand Up @@ -634,7 +634,7 @@ export class EchoClient {
[
protos.google.showcase.v1beta1.IBlockResponse,
protos.google.showcase.v1beta1.IBlockRequest | undefined,
{} | undefined
{} | undefined,
]
> | void {
request = request || {};
Expand Down Expand Up @@ -796,7 +796,7 @@ export class EchoClient {
protos.google.showcase.v1beta1.IWaitMetadata
>,
protos.google.longrunning.IOperation | undefined,
{} | undefined
{} | undefined,
]
>;
wait(
Expand Down Expand Up @@ -849,7 +849,7 @@ export class EchoClient {
protos.google.showcase.v1beta1.IWaitMetadata
>,
protos.google.longrunning.IOperation | undefined,
{} | undefined
{} | undefined,
]
> | void {
request = request || {};
Expand Down Expand Up @@ -932,7 +932,7 @@ export class EchoClient {
[
protos.google.showcase.v1beta1.IEchoResponse[],
protos.google.showcase.v1beta1.IPagedExpandRequest | null,
protos.google.showcase.v1beta1.IPagedExpandResponse
protos.google.showcase.v1beta1.IPagedExpandResponse,
]
>;
pagedExpand(
Expand Down Expand Up @@ -972,7 +972,7 @@ export class EchoClient {
[
protos.google.showcase.v1beta1.IEchoResponse[],
protos.google.showcase.v1beta1.IPagedExpandRequest | null,
protos.google.showcase.v1beta1.IPagedExpandResponse
protos.google.showcase.v1beta1.IPagedExpandResponse,
]
> | void {
request = request || {};
Expand Down
4 changes: 2 additions & 2 deletions test/unit/apiCallable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@
const now = new Date();
const originalDeadline = now.getTime() + 100;
const expectedDeadline = now.getTime() + 200;
assert(resp! > originalDeadline);
assert(resp! <= expectedDeadline);
assert((resp as any)! > originalDeadline);

Check warning on line 69 in test/unit/apiCallable.ts

View workflow job for this annotation

GitHub Actions / lint-gax

Unexpected any. Specify a different type
assert((resp as any)! <= expectedDeadline);

Check warning on line 70 in test/unit/apiCallable.ts

View workflow job for this annotation

GitHub Actions / lint-gax

Unexpected any. Specify a different type
done();
});
});
Expand Down
4 changes: 2 additions & 2 deletions test/unit/longrunning.ts
Original file line number Diff line number Diff line change
Expand Up @@ -435,11 +435,11 @@ describe('longrunning', () => {
const client = mockOperationsClient({expectedCalls: 0});
const apiCall = createApiCall(func, client);
const [operation] = (await apiCall({})) as unknown as [
longrunning.Operation
longrunning.Operation,
];
assert.notStrictEqual(operation, null);
const [finalResult] = (await operation!.promise()) as unknown as [
string
string,
];
assert.strictEqual(finalResult, RESPONSE_VAL);
});
Expand Down
4 changes: 2 additions & 2 deletions tools/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@
"@types/ncp": "^2.0.1",
"@types/uglify-js": "^3.17.0",
"c8": "^8.0.0",
"gts": "^3.1.1",
"gts": "^5.0.0",
"mocha": "^9.0.0",
"ncp": "^2.0.0",
"protobufjs": "7.2.4",
"typescript": "^4.6.4"
"typescript": "^5.1.6"
},
"engines": {
"node": ">=14"
Expand Down
19 changes: 9 additions & 10 deletions tools/test/fixtures/echo.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,12 @@

// Lots of comments we can delete in uglify
async function main() {
// Showcases auto-pagination functionality.

// Let's say we have an API call that returns results grouped into pages.
// It accepts 4 parameters (just like gRPC stub calls do):
return 'SUCCESS';
}

main().catch(console.error);
// More comments

// Showcases auto-pagination functionality.

// Let's say we have an API call that returns results grouped into pages.
// It accepts 4 parameters (just like gRPC stub calls do):
return 'SUCCESS';
}

main().catch(console.error);
// More comments
Loading