Skip to content

Commit 860ac2a

Browse files
committed
fix: auto lint fixes
1 parent 952c1aa commit 860ac2a

File tree

64 files changed

+119
-112
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+119
-112
lines changed

packages/chunked-stream-reader-node/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { Readable } from "stream";
22
export function streamReader(
33
stream: Readable,
44
onChunk: (chunk: Uint8Array) => void,
5-
chunkSize: number = 1048576 // 1 MiB
5+
chunkSize = 1048576 // 1 MiB
66
): Promise<void> {
77
return new Promise((resolve, reject) => {
88
let temporaryBuffer: Uint8Array | undefined;

packages/chunked-stream-reader-node/src/readable.fixture.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export interface ReadFromBuffersOptions extends ReadableOptions {
77

88
export class ReadFromBuffers extends Readable {
99
private buffersToRead: Buffer[];
10-
private numBuffersRead: number = 0;
10+
private numBuffersRead = 0;
1111

1212
private errorAfter: number;
1313
constructor(options: ReadFromBuffersOptions) {

packages/config-resolver/src/RegionConfig.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export interface RegionResolvedConfig {
1515
export function resolveRegionConfig<T>(
1616
input: T & RegionInputConfig & PreviouslyResolved
1717
): T & RegionResolvedConfig {
18-
let region = input.region || input.regionDefaultProvider(input as any);
18+
const region = input.region || input.regionDefaultProvider(input as any);
1919
return {
2020
...input,
2121
region: normalizeRegion(region)

packages/credential-provider-imds/src/fromContainerMetadata.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ describe("fromContainerMetadata", () => {
9191
});
9292

9393
it("should retry responses that receive invalid response values", async () => {
94-
for (let key of Object.keys(creds)) {
94+
for (const key of Object.keys(creds)) {
9595
const invalidCreds: any = { ...creds };
9696
delete invalidCreds[key];
9797
mockHttpGet.mockReturnValueOnce(

packages/credential-provider-ini/src/index.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jest.mock("fs", () => {
1818
}
1919

2020
const fs: FsModule = <FsModule>jest.genMockFromModule("fs");
21-
let matchers = new Map<string, string>();
21+
const matchers = new Map<string, string>();
2222

2323
function readFile(
2424
path: string,
@@ -721,7 +721,7 @@ source_profile = default
721721
{ creds: FOO_CREDS, arn: roleArnFor("foo") }
722722
];
723723

724-
for (let { creds, arn } of expectedCalls) {
724+
for (const { creds, arn } of expectedCalls) {
725725
const call = <any>roleAssumer.mock.calls.shift();
726726
expect(call[0]).toEqual(creds);
727727
expect(call[1].RoleArn).toEqual(arn);

packages/credential-provider-process/src/index.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jest.mock("fs", () => {
1717
}
1818

1919
const fs: FsModule = <FsModule>jest.genMockFromModule("fs");
20-
let matchers = new Map<string, string>();
20+
const matchers = new Map<string, string>();
2121

2222
function readFile(
2323
path: string,
@@ -72,7 +72,7 @@ jest.mock("child_process", () => {
7272
const child_process = <ChildProcessModule>(
7373
jest.genMockFromModule("child_process")
7474
);
75-
let matchers = new Map<string, string>();
75+
const matchers = new Map<string, string>();
7676

7777
function exec(
7878
command: string,

packages/eventstream-handler-node/src/EventSigningStream.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { toUtf8, fromUtf8 } from "@aws-sdk/util-utf8-node";
44
import { Message, MessageHeaders } from "@aws-sdk/types";
55

66
describe("EventSigningStream", () => {
7-
let originalDate = Date;
7+
const originalDate = Date;
88
afterEach(() => {
99
Date = originalDate;
1010
});

packages/eventstream-handler-node/src/EventSigningStream.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export class EventSigningStream extends Transform {
4444
const dateHeader: MessageHeaders = {
4545
":date": { type: "timestamp", value: now }
4646
};
47-
let signature = await this.eventSigner.sign(
47+
const signature = await this.eventSigner.sign(
4848
{
4949
payload: chunk,
5050
headers: this.eventMarshaller.formatHeaders(dateHeader)

packages/eventstream-marshaller/src/Int64.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { toHex } from "@aws-sdk/util-hex-encoding";
22
import { Int64 as IInt64 } from "@aws-sdk/types";
33

4-
export interface Int64 extends IInt64 {}
4+
export type Int64 = IInt64;
55

66
/**
77
* A lossless representation of a signed, 64-bit integer. Instances of this

packages/eventstream-serde-browser/src/EventStreamMarshaller.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {
88
} from "@aws-sdk/types";
99
import { readableStreamtoIterable, iterableToReadableStream } from "./utils";
1010

11-
export interface EventStreamMarshaller extends IEventStreamMarshaller {}
11+
export type EventStreamMarshaller = IEventStreamMarshaller;
1212

1313
export interface EventStreamMarshallerOptions {
1414
utf8Encoder: Encoder;

packages/eventstream-serde-node/src/EventStreamMarshaller.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import {
99
import { Readable } from "stream";
1010
import { readabletoIterable } from "./utils";
1111

12-
export interface EventStreamMarshaller extends IEventStreamMarshaller {}
12+
export type EventStreamMarshaller = IEventStreamMarshaller;
1313

1414
export interface EventStreamMarshallerOptions {
1515
utf8Encoder: Encoder;

packages/eventstream-serde-universal/src/EventStreamMarshaller.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {
88
import { getChunkedStream } from "./getChunkedStream";
99
import { getUnmarshalledStream } from "./getUnmarshalledStream";
1010

11-
export interface EventStreamMarshaller extends IEventStreamMarshaller {}
11+
export type EventStreamMarshaller = IEventStreamMarshaller;
1212

1313
export interface EventStreamMarshallerOptions {
1414
utf8Encoder: Encoder;

packages/fetch-http-handler/src/fetch-http-handler.browser.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { FetchHttpHandler } from "./fetch-http-handler";
33
describe(FetchHttpHandler.name, () => {
44
it("calls request without mode included in requestOptions", done => {
55
const fetchHttpHandler = new FetchHttpHandler();
6-
let spy = spyOn(window, "Request");
6+
const spy = spyOn(window, "Request");
77
fetchHttpHandler.handle({} as any, {});
88
expect(spy.calls.argsFor(0)[1].mode).toEqual(undefined);
99
done();

packages/fetch-http-handler/src/fetch-http-handler.spec.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,14 @@ describe.skip(FetchHttpHandler.name, () => {
4747
(global as any).fetch = mockFetch;
4848
const fetchHttpHandler = new FetchHttpHandler();
4949

50-
let response = await fetchHttpHandler.handle({} as any, {});
50+
const response = await fetchHttpHandler.handle({} as any, {});
5151

5252
expect(mockFetch.mock.calls.length).toBe(1);
5353
expect(await blobToText(response.response.body)).toBe("FOO");
5454
});
5555

5656
it("properly constructs url", async () => {
57-
let mockResponse = {
57+
const mockResponse = {
5858
headers: {
5959
entries: jest.fn().mockReturnValue([
6060
["foo", "bar"],
@@ -67,7 +67,7 @@ describe.skip(FetchHttpHandler.name, () => {
6767

6868
(global as any).fetch = mockFetch;
6969

70-
let httpRequest = new HttpRequest({
70+
const httpRequest = new HttpRequest({
7171
headers: {},
7272
hostname: "foo.amazonaws.com",
7373
method: "GET",
@@ -77,15 +77,15 @@ describe.skip(FetchHttpHandler.name, () => {
7777
});
7878
const fetchHttpHandler = new FetchHttpHandler();
7979

80-
let response = await fetchHttpHandler.handle(httpRequest, {});
80+
const response = await fetchHttpHandler.handle(httpRequest, {});
8181

8282
expect(mockFetch.mock.calls.length).toBe(1);
83-
let requestCall = mockRequest.mock.calls[0];
83+
const requestCall = mockRequest.mock.calls[0];
8484
expect(requestCall[0]).toBe("https://foo.amazonaws.com:443/test/?bar=baz");
8585
});
8686

8787
it("will not make request if already aborted", async () => {
88-
let mockResponse = {
88+
const mockResponse = {
8989
headers: {
9090
entries: jest.fn().mockReturnValue([
9191
["foo", "bar"],
@@ -111,7 +111,7 @@ describe.skip(FetchHttpHandler.name, () => {
111111
});
112112

113113
it("will pass abortSignal to fetch if supported", async () => {
114-
let mockResponse = {
114+
const mockResponse = {
115115
headers: {
116116
entries: jest.fn().mockReturnValue([
117117
["foo", "bar"],
@@ -125,7 +125,7 @@ describe.skip(FetchHttpHandler.name, () => {
125125
(global as any).AbortController = jest.fn();
126126
const fetchHttpHandler = new FetchHttpHandler();
127127

128-
let response = await fetchHttpHandler.handle({} as any, {
128+
const response = await fetchHttpHandler.handle({} as any, {
129129
abortSignal: {
130130
aborted: false
131131
}
@@ -136,7 +136,7 @@ describe.skip(FetchHttpHandler.name, () => {
136136
});
137137

138138
it("will pass timeout to request timeout", async () => {
139-
let mockResponse = {
139+
const mockResponse = {
140140
headers: {
141141
entries: jest.fn().mockReturnValue([
142142
["foo", "bar"],
@@ -153,7 +153,7 @@ describe.skip(FetchHttpHandler.name, () => {
153153
requestTimeout: 500
154154
});
155155

156-
let response = await fetchHttpHandler.handle({} as any, {});
156+
const response = await fetchHttpHandler.handle({} as any, {});
157157

158158
expect(mockFetch.mock.calls.length).toBe(1);
159159
expect(timeoutSpy.mock.calls[0][0]).toBe(500);

packages/fetch-http-handler/src/fetch-http-handler.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { HttpHandler, HttpRequest, HttpResponse } from "@aws-sdk/protocol-http";
33
import { requestTimeout } from "./request-timeout";
44
import { buildQueryString } from "@aws-sdk/querystring-builder";
55

6-
declare var AbortController: any;
6+
declare let AbortController: any;
77

88
/**
99
* Represents the http options that can be passed to a browser http client.
@@ -67,7 +67,7 @@ export class FetchHttpHandler implements HttpHandler {
6767
const fetchHeaders: any = response.headers;
6868
const transformedHeaders: HeaderBag = {};
6969

70-
for (let pair of <Array<string[]>>fetchHeaders.entries()) {
70+
for (const pair of <Array<string[]>>fetchHeaders.entries()) {
7171
transformedHeaders[pair[0]] = pair[1];
7272
}
7373

packages/fetch-http-handler/src/request-timeout.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export function requestTimeout(timeoutInMs: number = 0): Promise<never> {
1+
export function requestTimeout(timeoutInMs = 0): Promise<never> {
22
return new Promise((resolve, reject) => {
33
if (timeoutInMs) {
44
setTimeout(() => {

packages/is-array-buffer/src/index.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ describe("isArrayBuffer", () => {
1919
});
2020

2121
it("should return false for scalar values", () => {
22-
for (let scalar of ["string", 123.234, true, null, void 0]) {
22+
for (const scalar of ["string", 123.234, true, null, void 0]) {
2323
expect(isArrayBuffer(scalar)).toBe(false);
2424
}
2525
});

packages/md5-js/src/constants.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
/**
22
* @internal
33
*/
4-
export const BLOCK_SIZE: number = 64;
4+
export const BLOCK_SIZE = 64;
55

66
/**
77
* @internal
88
*/
9-
export const DIGEST_LENGTH: number = 16;
9+
export const DIGEST_LENGTH = 16;
1010

1111
/**
1212
* @internal

packages/md5-js/src/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ import { fromUtf8 } from "@aws-sdk/util-utf8-browser";
55
export class Md5 implements Hash {
66
private state = Uint32Array.from(INIT);
77
private buffer: DataView = new DataView(new ArrayBuffer(BLOCK_SIZE));
8-
private bufferLength: number = 0;
9-
private bytesHashed: number = 0;
10-
private finished: boolean = false;
8+
private bufferLength = 0;
9+
private bytesHashed = 0;
10+
private finished = false;
1111

1212
update(sourceData: SourceData): void {
1313
if (isEmptyData(sourceData)) {

packages/middleware-bucket-endpoint/src/bucketEndpointMiddleware.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export function bucketEndpointMiddleware(
2222
): Promise<BuildHandlerOutput<Output>> => {
2323
const { Bucket: bucketName } = args.input;
2424
let replaceBucketInPath = options.bucketEndpoint;
25-
let request = args.request;
25+
const request = args.request;
2626
if (HttpRequest.isInstance(request)) {
2727
if (options.bucketEndpoint) {
2828
request.hostname = bucketName;

packages/middleware-content-length/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export function contentLengthMiddleware(
2020
): BuildHandler<any, Output> => async (
2121
args: BuildHandlerArguments<any>
2222
): Promise<BuildHandlerOutput<Output>> => {
23-
let request = args.request;
23+
const request = args.request;
2424
if (HttpRequest.isInstance(request)) {
2525
const { body, headers } = request;
2626
if (

packages/middleware-expect-continue/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export function addExpectContinueMiddleware(
2121
): BuildHandler<any, Output> => async (
2222
args: BuildHandlerArguments<any>
2323
): Promise<BuildHandlerOutput<Output>> => {
24-
let { request } = args;
24+
const { request } = args;
2525
if (
2626
HttpRequest.isInstance(request) &&
2727
request.body &&

packages/middleware-sdk-api-gateway/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export function acceptHeaderMiddleware(): BuildMiddleware<any, any> {
1515
): BuildHandler<any, Output> => async (
1616
args: BuildHandlerArguments<any>
1717
): Promise<BuildHandlerOutput<Output>> => {
18-
let { request } = args;
18+
const { request } = args;
1919
if (HttpRequest.isInstance(request)) {
2020
request.headers = {
2121
...request.headers,

packages/middleware-sdk-glacier/src/add-checksum-headers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export function addChecksumHeadersMiddleware(
1717
): BuildHandler<any, Output> => async (
1818
args: BuildHandlerArguments<any>
1919
): Promise<BuildHandlerOutput<Output>> => {
20-
let request = args.request;
20+
const request = args.request;
2121
if (HttpRequest.isInstance(request)) {
2222
let headers = request.headers;
2323
const body = request.body;

packages/middleware-sdk-glacier/src/add-glacier-api-version.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export function addGlacierApiVersionMiddleware(
1717
): BuildHandler<any, Output> => async (
1818
args: BuildHandlerArguments<any>
1919
): Promise<BuildHandlerOutput<Output>> => {
20-
let request = args.request;
20+
const request = args.request;
2121
if (HttpRequest.isInstance(request)) {
2222
request.headers["x-amz-glacier-version"] = options.apiVersion;
2323
}

packages/middleware-sdk-s3-control/src/prepend-account-id.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export function prependAccountIdMiddleware(): BuildMiddleware<any, any> {
1616
): BuildHandler<any, Output> => async (
1717
args: BuildHandlerArguments<any>
1818
): Promise<BuildHandlerOutput<Output>> => {
19-
let { request } = args;
19+
const { request } = args;
2020
const { input } = args;
2121
const accountId = input.AccountId;
2222
if (typeof accountId !== "string") {

packages/middleware-sdk-sqs/src/receive-message.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export function receiveMessageMiddleware(
3030
): Promise<InitializeHandlerOutput<Output>> => {
3131
const resp = await next({ ...args });
3232
const output = (resp.output as unknown) as ReceiveMessageResult;
33-
let messageIds = [];
33+
const messageIds = [];
3434
if (output.Messages !== undefined) {
3535
for (const message of output.Messages) {
3636
const md5 = message.MD5OfBody;

packages/middleware-sdk-sqs/src/send-message-batch.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ export function sendMessageBatchMiddleware(
3030
): Promise<InitializeHandlerOutput<Output>> => {
3131
const resp = await next({ ...args });
3232
const output = (resp.output as unknown) as SendMessageBatchResult;
33-
let messageIds = [];
34-
let entries: { [index: string]: SendMessageBatchResultEntry } = {};
33+
const messageIds = [];
34+
const entries: { [index: string]: SendMessageBatchResultEntry } = {};
3535
if (output.Successful !== undefined) {
3636
for (const entry of output.Successful) {
3737
if (entry.Id !== undefined) {

packages/middleware-signing/src/configurations.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ export interface AwsAuthResolvedConfig {
5151
export function resolveAwsAuthConfig<T>(
5252
input: T & AwsAuthInputConfig & PreviouslyResolved
5353
): T & AwsAuthResolvedConfig {
54-
let credentials =
54+
const credentials =
5555
input.credentials || input.credentialDefaultProvider(input as any);
5656
const normalizedCreds = normalizeProvider(credentials);
5757
const {

packages/middleware-stack/src/MiddlewareStack.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ describe("MiddlewareStack", () => {
192192

193193
const secondStack = stack.clone();
194194

195-
let inner = jest.fn(({ input }: DeserializeHandlerArguments<input>) => {
195+
const inner = jest.fn(({ input }: DeserializeHandlerArguments<input>) => {
196196
expect(input).toEqual(["first", "second"]);
197197
return Promise.resolve({ response: {} });
198198
});
@@ -232,7 +232,7 @@ describe("MiddlewareStack", () => {
232232
{ step: "build", relation: "after", toMiddleware: "second" }
233233
);
234234

235-
let inner = jest.fn(({ input }: DeserializeHandlerArguments<input>) => {
235+
const inner = jest.fn(({ input }: DeserializeHandlerArguments<input>) => {
236236
expect(input).toEqual(["first", "second", "third", "fourth"]);
237237
return Promise.resolve({ response: {} });
238238
});

0 commit comments

Comments
 (0)