Skip to content

Commit

Permalink
Bump eslint to 8.57.0 (#1266)
Browse files Browse the repository at this point in the history
  • Loading branch information
trivikr authored May 9, 2024
1 parent 74a4554 commit ebf55a3
Show file tree
Hide file tree
Showing 40 changed files with 370 additions and 339 deletions.
2 changes: 2 additions & 0 deletions .changeset/polite-impalas-confess.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
---
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@
"@microsoft/api-extractor": "7.34.4",
"@tsconfig/recommended": "1.0.2",
"@types/jest": "28.1.3",
"@typescript-eslint/eslint-plugin": "4.30.0",
"@typescript-eslint/parser": "4.30.0",
"@typescript-eslint/eslint-plugin": "7.8.0",
"@typescript-eslint/parser": "7.8.0",
"chai": "^4.2.0",
"chai-as-promised": "^7.1.1",
"esbuild": "0.19.11",
"eslint": "7.32.0",
"eslint": "8.57.0",
"eslint-plugin-simple-import-sort": "7.0.0",
"eslint-plugin-tsdoc": "0.2.17",
"husky": "^4.2.3",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/no-unused-vars */
import { normalizeProvider } from "@smithy/util-middleware";

import { resolveEndpointsConfig } from "./resolveEndpointsConfig";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/no-unused-vars */
import { HttpRequest } from "@smithy/protocol-http";
import {
ErrorHandler,
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/pagination/createPaginator.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { createPaginator } from "./createPaginator";
describe(createPaginator.name, () => {
class Client {
private pages = 5;
async send(command: CommandObjectToken | CommandStringToken) {
async send() {
if (--this.pages > 0) {
return {
outToken: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/no-unused-vars */
import { HttpRequest } from "@smithy/protocol-http";
import { HttpRequest as IHttpRequest, HttpSigner, TokenIdentity } from "@smithy/types";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/no-unused-vars */
import { HttpRequest, HttpSigner, Identity } from "@smithy/types";

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/no-unused-vars */
import { loadConfig } from "@smithy/node-config-provider";
import { Endpoint } from "@smithy/types";
import { parseUrl } from "@smithy/url-parser";
Expand Down
1 change: 1 addition & 0 deletions packages/eventstream-codec/src/Int64.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/no-unsafe-declaration-merging */
import { Int64 as IInt64 } from "@smithy/types";
import { toHex } from "@smithy/util-hex-encoding";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/no-unsafe-declaration-merging */
import { EventStreamMarshaller as UniversalEventStreamMarshaller } from "@smithy/eventstream-serde-universal";
import { Decoder, Encoder, EventStreamMarshaller as IEventStreamMarshaller, Message } from "@smithy/types";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/no-unsafe-declaration-merging */
import { EventStreamMarshaller as UniversalEventStreamMarshaller } from "@smithy/eventstream-serde-universal";
import { Decoder, Encoder, EventStreamMarshaller as IEventStreamMarshaller, Message } from "@smithy/types";
import { Readable } from "stream";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/no-unsafe-declaration-merging */
import {
EventStreamCodec,
MessageDecoderStream,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/no-unused-vars */
import { HttpRequest } from "@smithy/protocol-http";
import { HttpRequest as IHttpRequest } from "@smithy/types";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/no-unused-vars */
import { HttpRequest } from "@smithy/protocol-http";
import {
FinalizeHandler,
Expand Down
1 change: 1 addition & 0 deletions packages/experimental-identity-and-auth/src/noAuth.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/no-unused-vars */
import { HttpRequest, Identity } from "@smithy/types";

import { HttpSigner } from "./HttpSigner";
Expand Down
12 changes: 6 additions & 6 deletions packages/hash-stream-node/src/readableStreamHasher.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ describe(readableStreamHasher.name, () => {
});

it("computes hash for a readable stream", async () => {
const readableStream = new Readable({ read: (size) => {} });
const readableStream = new Readable({ read: () => {} });
const hashPromise = readableStreamHasher(mockHashCtor, readableStream);

// @ts-ignore Property '_readableState' does not exist on type 'Readable'.
Expand All @@ -73,7 +73,7 @@ describe(readableStreamHasher.name, () => {
});

it("throws if readable stream has started reading", async () => {
const readableStream = new Readable({ read: (size) => {} });
const readableStream = new Readable({ read: () => {} });
// Simulate readableFlowing to true.
readableStream.resume();

Expand All @@ -88,7 +88,7 @@ describe(readableStreamHasher.name, () => {

it("throws error if readable stream throws error", async () => {
const readableStream = new Readable({
read: (size) => {},
read: () => {},
});
const hashPromise = readableStreamHasher(mockHashCtor, readableStream);

Expand All @@ -112,10 +112,10 @@ describe(readableStreamHasher.name, () => {
mockHashCalculatorWrite,
mockHashCalculatorEnd
);
(HashCalculator as unknown as jest.Mock).mockImplementation((hash) => mockHashCalculator);
(HashCalculator as unknown as jest.Mock).mockImplementation(() => mockHashCalculator);

const readableStream = new Readable({
read: (size) => {},
read: () => {},
});
const hashPromise = readableStreamHasher(mockHashCtor, readableStream);

Expand All @@ -134,7 +134,7 @@ describe(readableStreamHasher.name, () => {

it("throws error if hash.digest() throws error", async () => {
const readableStream = new Readable({
read: (size) => {},
read: () => {},
});
const hashPromise = readableStreamHasher(mockHashCtor, readableStream);

Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
// eslint-disable-next-line @typescript-eslint/no-unused-vars
export const getEndpointFromConfig = async (serviceId: string) => undefined;
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export const omitRetryHeadersMiddlewareOptions: RelativeMiddlewareOptions = {
override: true,
};

// eslint-disable-next-line @typescript-eslint/no-unused-vars
export const getOmitRetryHeadersPlugin = (options: unknown): Pluggable<any, any> => ({
applyToStack: (clientStack) => {
clientStack.addRelativeTo(omitRetryHeadersMiddleware(), omitRetryHeadersMiddlewareOptions);
Expand Down
18 changes: 9 additions & 9 deletions packages/middleware-retry/src/retryMiddleware.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ describe(retryMiddleware.name, () => {

it("calls acquireInitialRetryToken and records success when next succeeds", async () => {
const next = jest.fn().mockResolvedValueOnce(mockSuccess);
const { response, output } = await retryMiddleware({
const { output } = await retryMiddleware({
maxAttempts: () => Promise.resolve(maxAttempts),
retryStrategy: jest.fn().mockResolvedValue({ ...mockRetryStrategy, maxAttempts }),
})(
Expand Down Expand Up @@ -176,7 +176,7 @@ describe(retryMiddleware.name, () => {
error: mockError,
errorType: "THROTTLING",
};
const { response, output } = await retryMiddleware({
const { output } = await retryMiddleware({
maxAttempts: () => Promise.resolve(maxAttempts),
retryStrategy: jest.fn().mockResolvedValue({ ...mockRetryStrategy, maxAttempts }),
})(
Expand All @@ -198,7 +198,7 @@ describe(retryMiddleware.name, () => {
error: mockError,
errorType: "TRANSIENT",
};
const { response, output } = await retryMiddleware({
const { output } = await retryMiddleware({
maxAttempts: () => Promise.resolve(maxAttempts),
retryStrategy: jest.fn().mockResolvedValue({ ...mockRetryStrategy, maxAttempts }),
})(
Expand All @@ -221,7 +221,7 @@ describe(retryMiddleware.name, () => {
error: mockError,
errorType: "SERVER_ERROR",
};
const { response, output } = await retryMiddleware({
const { output } = await retryMiddleware({
maxAttempts: () => Promise.resolve(maxAttempts),
retryStrategy: jest.fn().mockResolvedValue({ ...mockRetryStrategy, maxAttempts }),
})(
Expand All @@ -244,7 +244,7 @@ describe(retryMiddleware.name, () => {
error: mockError,
errorType: "CLIENT_ERROR",
};
const { response, output } = await retryMiddleware({
const { output } = await retryMiddleware({
maxAttempts: () => Promise.resolve(maxAttempts),
retryStrategy: jest.fn().mockResolvedValue({ ...mockRetryStrategy, maxAttempts }),
})(
Expand Down Expand Up @@ -273,7 +273,7 @@ describe(retryMiddleware.name, () => {
error: mockError,
errorType: "CLIENT_ERROR",
};
const { response, output } = await retryMiddleware({
const { output } = await retryMiddleware({
maxAttempts: () => Promise.resolve(maxAttempts),
retryStrategy: jest.fn().mockResolvedValue({ ...mockRetryStrategy, maxAttempts }),
})(
Expand Down Expand Up @@ -302,7 +302,7 @@ describe(retryMiddleware.name, () => {
it("parses retry-after from date string", async () => {
const error = getErrorWithValues(retryAfterDate.toISOString());
const next = jest.fn().mockRejectedValueOnce(error).mockResolvedValueOnce(mockSuccess);
const { response, output } = await retryMiddleware({
const { output } = await retryMiddleware({
maxAttempts: () => Promise.resolve(maxAttempts),
retryStrategy: jest.fn().mockResolvedValue({ ...mockRetryStrategy, maxAttempts }),
})(
Expand All @@ -319,7 +319,7 @@ describe(retryMiddleware.name, () => {
it("parses retry-after from seconds", async () => {
const error = getErrorWithValues(retryAfterDate.getTime() / 1000);
const next = jest.fn().mockRejectedValueOnce(error).mockResolvedValueOnce(mockSuccess);
const { response, output } = await retryMiddleware({
const { output } = await retryMiddleware({
maxAttempts: () => Promise.resolve(maxAttempts),
retryStrategy: jest.fn().mockResolvedValue({ ...mockRetryStrategy, maxAttempts }),
})(
Expand All @@ -336,7 +336,7 @@ describe(retryMiddleware.name, () => {
it("parses retry-after from Retry-After header name", async () => {
const error = getErrorWithValues(retryAfterDate.toISOString(), "Retry-After");
const next = jest.fn().mockRejectedValueOnce(error).mockResolvedValueOnce(mockSuccess);
const { response, output } = await retryMiddleware({
const { output } = await retryMiddleware({
maxAttempts: () => Promise.resolve(maxAttempts),
retryStrategy: jest.fn().mockResolvedValue({ ...mockRetryStrategy, maxAttempts }),
})(
Expand Down
3 changes: 1 addition & 2 deletions packages/middleware-serde/src/deserializerMiddleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import {
DeserializeHandlerArguments,
DeserializeHandlerOutput,
DeserializeMiddleware,
HandlerExecutionContext,
ResponseDeserializer,
SerdeContext,
SerdeFunctions,
Expand All @@ -17,7 +16,7 @@ export const deserializerMiddleware =
options: SerdeFunctions,
deserializer: ResponseDeserializer<any, any, CommandSerdeContext>
): DeserializeMiddleware<Input, Output> =>
(next: DeserializeHandler<Input, Output>, context: HandlerExecutionContext): DeserializeHandler<Input, Output> =>
(next: DeserializeHandler<Input, Output>): DeserializeHandler<Input, Output> =>
async (args: DeserializeHandlerArguments<Input>): Promise<DeserializeHandlerOutput<Output>> => {
const { response } = await next(args);
try {
Expand Down
2 changes: 1 addition & 1 deletion packages/middleware-stack/src/MiddlewareStack.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,7 @@ describe("MiddlewareStack", () => {

delete (oldStack as any).identifyOnResolve;
oldStack.clone = () => oldStack;
oldStack.concat = <S>(stack: S) => oldStack as S;
oldStack.concat = <S>() => oldStack as S;
oldStack.applyToStack = () => void 0;

expect(oldStack.identifyOnResolve).toBeUndefined();
Expand Down
2 changes: 1 addition & 1 deletion packages/node-http-handler/src/node-http2-handler.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ describe(NodeHttp2Handler.name, () => {
it("will close request on session when aborted", async () => {
const abortController = new AbortController();
mockH2Server.removeAllListeners("request");
mockH2Server.on("request", (request: any, response: any) => {
mockH2Server.on("request", () => {
abortController.abort();
return createResponseFunction(mockResponse);
});
Expand Down
9 changes: 4 additions & 5 deletions packages/property-provider/src/memoize.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ describe("memoize", () => {

const memoized = memoize(provider);
expect(provider).toHaveBeenCalledTimes(0);
// eslint-disable-next-line @typescript-eslint/no-unused-vars
for (const _ in [...Array(repeatTimes).keys()]) {
for (let i = 0; i < repeatTimes; i++) {
expect(await memoized()).toStrictEqual(mockReturn);
expect(provider).toHaveBeenCalledTimes(1);
}
Expand Down Expand Up @@ -133,7 +132,7 @@ describe("memoize", () => {
it("should reinvoke the underlying provider even if isExpired returns false", async () => {
const memoized = memoize(provider, isExpired, requiresRefresh);
isExpired.mockReturnValue(false);
for (const _ in [...Array(repeatTimes).keys()]) {
for (let i = 0; i < repeatTimes; i++) {
expect(await memoized({ forceRefresh: true })).toEqual(mockReturn);
}
expect(provider).toHaveBeenCalledTimes(repeatTimes);
Expand All @@ -142,7 +141,7 @@ describe("memoize", () => {
it("should reinvoke the underlying provider even if requiresRefresh returns false", async () => {
const memoized = memoize(provider, isExpired, requiresRefresh);
requiresRefresh.mockReturnValue(false);
for (const _ in [...Array(repeatTimes).keys()]) {
for (let i = 0; i < repeatTimes; i++) {
expect(await memoized({ forceRefresh: true })).toEqual(mockReturn);
}
expect(provider).toHaveBeenCalledTimes(repeatTimes);
Expand Down Expand Up @@ -175,7 +174,7 @@ describe("memoize", () => {

it("should re-evaluate `requiresRefresh` after force refresh", async () => {
const memoized = memoize(provider, isExpired, requiresRefresh);
for (const _ in [...Array(repeatTimes).keys()]) {
for (let i = 0; i < repeatTimes; i++) {
expect(await memoized({ forceRefresh: true })).toStrictEqual(mockReturn);
}
expect(requiresRefresh).toBeCalledTimes(repeatTimes);
Expand Down
1 change: 1 addition & 0 deletions packages/protocol-http/src/httpRequest.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/no-unsafe-declaration-merging */
import { HeaderBag, HttpMessage, HttpRequest as IHttpRequest, QueryParameterBag, URI } from "@smithy/types";

type HttpRequestOptions = Partial<HttpMessage> & Partial<URI> & { method?: string };
Expand Down
1 change: 1 addition & 0 deletions packages/protocol-http/src/httpResponse.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/no-unsafe-declaration-merging */
import { HeaderBag, HttpMessage, HttpResponse as IHttpResponse } from "@smithy/types";

type HttpResponseOptions = Partial<HttpMessage> & {
Expand Down
1 change: 1 addition & 0 deletions packages/smithy-client/src/date-utils.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/no-unused-vars */
import { strictParseByte, strictParseDouble, strictParseFloat32, strictParseShort } from "./parse-utils";

// Build indexes outside so we allocate them once.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/no-unused-vars */
import type { IncomingMessage } from "node:http";

import type { Client } from "../client";
Expand Down
1 change: 1 addition & 0 deletions packages/types/src/transform/no-undefined.spec.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/no-unused-vars */
import type { Client } from "../client";
import type { HttpHandlerOptions } from "../http";
import type { MetadataBearer } from "../response";
Expand Down
1 change: 1 addition & 0 deletions packages/types/src/transform/type-transform.spec.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/no-unused-vars */
import type { Transform as DownlevelTransform } from "../downlevel-ts3.4/transform/type-transform";
import type { Exact } from "./exact";
import type { Transform } from "./type-transform";
Expand Down
1 change: 1 addition & 0 deletions packages/types/src/util.spec.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/no-unused-vars */
import type { Exact, OptionalParameter } from "./util";

type Assignable<LHS, RHS> = [RHS] extends [LHS] ? true : false;
Expand Down
1 change: 1 addition & 0 deletions packages/util-endpoints/src/resolveEndpoint.spec.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/no-unused-vars */
import { resolveEndpoint } from "./resolveEndpoint";
import { EndpointError, EndpointParams, ParameterObject, RuleSetObject } from "./types";
import { evaluateRules } from "./utils";
Expand Down
1 change: 0 additions & 1 deletion packages/util-endpoints/src/types/EndpointRuleObject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import {
EndpointObject as __EndpointObject,
EndpointObjectHeaders as __EndpointObjectHeaders,
EndpointObjectProperties as __EndpointObjectProperties,
EndpointObjectProperty,
EndpointRuleObject as __EndpointRuleObject,
} from "@smithy/types";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ConditionObject, EvaluateOptions, FunctionReturn } from "../types";
import { ConditionObject, EvaluateOptions } from "../types";
import { evaluateCondition } from "./evaluateCondition";
import { evaluateConditions } from "./evaluateConditions";

Expand Down
3 changes: 2 additions & 1 deletion packages/util-retry/src/StandardRetryStrategy.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
/* eslint-disable @typescript-eslint/no-unused-vars */
import { RetryErrorInfo, RetryErrorType } from "@smithy/types";

import { RETRY_MODES } from "./config";
import { DEFAULT_RETRY_DELAY_BASE, INITIAL_RETRY_TOKENS } from "./constants";
import { DEFAULT_RETRY_DELAY_BASE } from "./constants";
import { createDefaultRetryToken } from "./defaultRetryToken";
import { StandardRetryStrategy } from "./StandardRetryStrategy";

Expand Down
1 change: 1 addition & 0 deletions packages/util-retry/src/StandardRetryStrategy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export class StandardRetryStrategy implements RetryStrategyV2 {
this.maxAttemptsProvider = typeof maxAttempts === "function" ? maxAttempts : async () => maxAttempts;
}

// eslint-disable-next-line @typescript-eslint/no-unused-vars
public async acquireInitialRetryToken(retryTokenScope: string): Promise<StandardRetryToken> {
return createDefaultRetryToken({
retryDelay: DEFAULT_RETRY_DELAY_BASE,
Expand Down
4 changes: 1 addition & 3 deletions packages/util-stream/src/util-stream.integ.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@ describe("util-stream", () => {
});

describe("blob helper integration", () => {
const FunctionName = "echo";

const client = new Weather({ endpoint: "https://foo.bar" });

requireRequestsFrom(client).toMatch({
Expand All @@ -68,7 +66,7 @@ describe("util-stream", () => {
}),
};
}
updateHttpClientConfig(key: string, value: any) {}
updateHttpClientConfig() {}
httpHandlerConfigs(): Record<string, any> {
return {};
}
Expand Down
Loading

0 comments on commit ebf55a3

Please sign in to comment.