Skip to content

Commit ab81c73

Browse files
authored
chore(packages): reapply eslint rules (#7789)
1 parent adb02cd commit ab81c73

File tree

352 files changed

+744
-581
lines changed

Some content is hidden

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

352 files changed

+744
-581
lines changed

.eslintrc.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ module.exports = {
88
// Uses the recommended rules from the @typescript-eslint/eslint-plugin
99
"plugin:@typescript-eslint/recommended",
1010
],
11-
plugins: ["@typescript-eslint", "simple-import-sort", "eslint-plugin-sort-export-all", "eslint-plugin-tsdoc"],
11+
plugins: ["@typescript-eslint", "simple-import-sort", "eslint-plugin-sort-export-all", "eslint-plugin-tsdoc", "n"],
1212
rules: {
1313
/** Turn off strict enforcement */
1414
"@typescript-eslint/ban-types": "off",
@@ -29,6 +29,7 @@ module.exports = {
2929
"simple-import-sort/imports": "error",
3030
"sort-export-all/sort-export-all": "error",
3131
"@typescript-eslint/consistent-type-imports": "error",
32+
"n/prefer-node-protocol": "error",
3233
},
3334
ignorePatterns: [
3435
"packages/nested-clients/src/submodules/**/protocols/*.ts",
@@ -67,6 +68,7 @@ module.exports = {
6768
files: ["**/*.js"],
6869
rules: {
6970
"tsdoc/syntax": "off",
71+
"n/prefer-node-protocol": "error",
7072
},
7173
},
7274
],

lib/lib-storage/src/Upload.spec.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1+
import type { CompleteMultipartUploadCommandOutput } from "@aws-sdk/client-s3";
12
import {
23
CompleteMultipartUploadCommand,
3-
CompleteMultipartUploadCommandOutput,
44
CreateMultipartUploadCommand,
55
PutObjectCommand,
66
PutObjectTaggingCommand,
@@ -9,10 +9,11 @@ import {
99
UploadPartCommand,
1010
} from "@aws-sdk/client-s3";
1111
import { AbortController } from "@smithy/abort-controller";
12-
import { EventEmitter, Readable } from "stream";
12+
import { EventEmitter, Readable } from "node:stream";
1313
import { afterAll, afterEach, beforeEach, describe, expect, test as it, vi } from "vitest";
1414

15-
import { Progress, Upload } from "./index";
15+
import type { Progress } from "./index";
16+
import { Upload } from "./index";
1617

1718
vi.mock("@aws-sdk/client-s3");
1819

lib/lib-storage/src/Upload.ts

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,37 @@
1-
import {
2-
AbortMultipartUploadCommand,
3-
ChecksumAlgorithm,
1+
import type {
42
CompletedPart,
5-
CompleteMultipartUploadCommand,
63
CompleteMultipartUploadCommandInput,
74
CompleteMultipartUploadCommandOutput,
8-
CreateMultipartUploadCommand,
95
CreateMultipartUploadCommandInput,
106
CreateMultipartUploadCommandOutput,
11-
PutObjectCommand,
127
PutObjectCommandInput,
13-
PutObjectTaggingCommand,
148
S3Client,
159
Tag,
16-
UploadPartCommand,
1710
UploadPartCommandInput,
1811
} from "@aws-sdk/client-s3";
19-
import { AbortController } from "@smithy/abort-controller";
2012
import {
21-
EndpointParameterInstructionsSupplier,
22-
getEndpointFromInstructions,
23-
toEndpointV1,
24-
} from "@smithy/middleware-endpoint";
25-
import { HttpRequest } from "@smithy/protocol-http";
13+
AbortMultipartUploadCommand,
14+
ChecksumAlgorithm,
15+
CompleteMultipartUploadCommand,
16+
CreateMultipartUploadCommand,
17+
PutObjectCommand,
18+
PutObjectTaggingCommand,
19+
UploadPartCommand,
20+
} from "@aws-sdk/client-s3";
21+
import { AbortController } from "@smithy/abort-controller";
22+
import type { EndpointParameterInstructionsSupplier } from "@smithy/middleware-endpoint";
23+
import { getEndpointFromInstructions, toEndpointV1 } from "@smithy/middleware-endpoint";
24+
import type { HttpRequest } from "@smithy/protocol-http";
2625
import { extendedEncodeURIComponent } from "@smithy/smithy-client";
2726
import type { AbortController as IAbortController, AbortSignal as IAbortSignal, Endpoint } from "@smithy/types";
27+
// eslint-disable-next-line n/prefer-node-protocol
2828
import { EventEmitter } from "events";
2929

3030
import { byteLength } from "./byteLength";
31-
import { BYTE_LENGTH_SOURCE, byteLengthSource } from "./byteLengthSource";
31+
import type { BYTE_LENGTH_SOURCE } from "./byteLengthSource";
32+
import { byteLengthSource } from "./byteLengthSource";
3233
import { getChunk } from "./chunker";
33-
import { BodyDataTypes, Options, Progress } from "./types";
34+
import type { BodyDataTypes, Options, Progress } from "./types";
3435

3536
export interface RawDataPart {
3637
partNumber: number;

lib/lib-storage/src/byteLength.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// eslint-disable-next-line n/prefer-node-protocol
12
import { Buffer } from "buffer"; // do not remove this import: Node.js buffer or buffer NPM module for browser.
23

34
import { runtimeConfig } from "./runtimeConfig";

lib/lib-storage/src/chunker.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1+
// eslint-disable-next-line n/prefer-node-protocol
12
import { Buffer } from "buffer"; // do not remove this import: Node.js buffer or buffer NPM module for browser.
3+
// eslint-disable-next-line n/prefer-node-protocol
24
import { Readable } from "stream";
35

46
import { getChunkStream } from "./chunks/getChunkStream";
57
import { getChunkUint8Array } from "./chunks/getChunkUint8Array";
68
import { getDataReadable } from "./chunks/getDataReadable";
79
import { getDataReadableStream } from "./chunks/getDataReadableStream";
8-
import { BodyDataTypes } from "./types";
10+
import type { BodyDataTypes } from "./types";
911
import type { RawDataPart } from "./Upload";
1012

1113
export const getChunk = (data: BodyDataTypes, partSize: number): AsyncGenerator<RawDataPart, void, undefined> => {

lib/lib-storage/src/chunks/getChunkStream.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1+
// eslint-disable-next-line n/prefer-node-protocol
12
import { Buffer } from "buffer"; // do not remove this import: Node.js buffer or buffer NPM module for browser.
23

3-
import { RawDataPart } from "../Upload";
4+
import type { RawDataPart } from "../Upload";
45

56
interface Buffers {
67
chunks: Uint8Array[];

lib/lib-storage/src/chunks/getChunkUint8Array.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { describe, expect, test as it } from "vitest";
22

33
import { byteLength } from "../byteLength";
44
import { BYTE_LENGTH_SOURCE, byteLengthSource } from "../byteLengthSource";
5-
import { RawDataPart } from "../Upload";
5+
import type { RawDataPart } from "../Upload";
66
import { getChunkUint8Array } from "./getChunkUint8Array";
77

88
describe(getChunkUint8Array.name, () => {

lib/lib-storage/src/chunks/getChunkUint8Array.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { RawDataPart } from "../Upload";
1+
import type { RawDataPart } from "../Upload";
22

33
export async function* getChunkUint8Array(
44
data: Uint8Array,

lib/lib-storage/src/chunks/getDataReadable.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
import { Readable } from "stream";
1+
import { Readable } from "node:stream";
22
import { describe, expect, test as it } from "vitest";
33

44
import { byteLength } from "../byteLength";
5-
import { RawDataPart as DataPart } from "../Upload";
5+
import type { RawDataPart as DataPart } from "../Upload";
66
import { getChunkStream as chunkFromReadable } from "./getChunkStream";
77
import { getDataReadable } from "./getDataReadable";
88

9-
const fs = require("fs");
9+
const fs = require("node:fs");
1010

1111
describe(chunkFromReadable.name, () => {
1212
// larger than the 5mb min chunk size.

lib/lib-storage/src/chunks/getDataReadable.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
// eslint-disable-next-line n/prefer-node-protocol
12
import { Buffer } from "buffer"; // do not remove this import: Node.js buffer or buffer NPM module for browser.
2-
import { Readable } from "stream";
3+
// eslint-disable-next-line n/prefer-node-protocol
4+
import type { Readable } from "stream";
35

46
export async function* getDataReadable(data: Readable): AsyncGenerator<Uint8Array> {
57
for await (const chunk of data) {

0 commit comments

Comments
 (0)