Skip to content

Commit 716b289

Browse files
committed
fix: manual configuration and code updates for eslint
1 parent 860ac2a commit 716b289

File tree

7 files changed

+24
-23
lines changed

7 files changed

+24
-23
lines changed

.eslintrc.js

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,18 @@ module.exports = {
55
sourceType: "module" // Allows for the use of imports
66
},
77
extends: [
8-
"plugin:@typescript-eslint/recommended" // Uses the recommended rules from the @typescript-eslint/eslint-plugin
8+
// Uses the recommended rules from the @typescript-eslint/eslint-plugin
9+
"plugin:@typescript-eslint/recommended"
910
],
11+
plugins: ["@typescript-eslint", "simple-import-sort"],
1012
rules: {
11-
// Place to specify ESLint rules. Can be used to overwrite rules specified from the extended configs
12-
// e.g. "@typescript-eslint/explicit-function-return-type": "off",
13+
"@typescript-eslint/ban-types": "off",
14+
"@typescript-eslint/ban-ts-comment": "off",
15+
"@typescript-eslint/no-var-requires": "off",
16+
"@typescript-eslint/no-empty-function": "off",
17+
"@typescript-eslint/no-empty-interface": "off",
18+
"@typescript-eslint/no-namespace": "warn",
19+
"prefer-rest-params": "off",
20+
"simple-import-sort/sort": "error"
1321
}
1422
};

.prettierrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,7 @@
22
"$schema": "http://json.schemastore.org/prettierrc",
33
"arrowParens": "avoid",
44
"endOfLine": "auto",
5+
"semi": true,
6+
"printWidth": 120,
57
"trailingComma": "none"
68
}

.prettierrc.js

Lines changed: 0 additions & 7 deletions
This file was deleted.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
"eslint": "^7.4.0",
5353
"eslint-config-prettier": "^6.11.0",
5454
"eslint-plugin-prettier": "^3.1.4",
55+
"eslint-plugin-simple-import-sort": "^5.0.3",
5556
"fs-extra": "^9.0.0",
5657
"generate-changelog": "^1.7.1",
5758
"husky": "^4.2.3",

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

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
import { EventStreamMarshaller as EventMarshaller } from "@aws-sdk/eventstream-marshaller";
2-
import {
3-
Encoder,
4-
Decoder,
5-
Message,
6-
EventStreamMarshaller as IEventStreamMarshaller
7-
} from "@aws-sdk/types";
2+
import { Encoder, Decoder, Message, EventStreamMarshaller as IEventStreamMarshaller } from "@aws-sdk/types";
83
import { getChunkedStream } from "./getChunkedStream";
94
import { getUnmarshalledStream } from "./getUnmarshalledStream";
105

@@ -36,14 +31,10 @@ export class EventStreamMarshaller {
3631
return unmarshalledStream;
3732
}
3833

39-
serialize<T>(
40-
input: AsyncIterable<T>,
41-
serializer: (event: T) => Message
42-
): AsyncIterable<Uint8Array> {
43-
const self = this;
34+
serialize<T>(input: AsyncIterable<T>, serializer: (event: T) => Message): AsyncIterable<Uint8Array> {
4435
const serializedIterator = async function* () {
4536
for await (const chunk of input) {
46-
const payloadBuf = self.eventMarshaller.marshall(serializer(chunk));
37+
const payloadBuf = this.eventMarshaller.marshall(serializer(chunk));
4738
yield payloadBuf;
4839
}
4940
// Ending frame

packages/util-format-url/src/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ import { HttpRequest } from "@aws-sdk/types";
22
import { buildQueryString } from "@aws-sdk/querystring-builder";
33

44
export function formatUrl(request: HttpRequest): string {
5-
let { protocol, path, hostname, port, query } = request;
5+
const { port, query } = request;
6+
let { protocol, path, hostname } = request;
67
if (protocol && protocol.substr(-1) !== ":") {
78
protocol += ":";
89
}

yarn.lock

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4576,6 +4576,11 @@ eslint-plugin-prettier@^3.1.4:
45764576
dependencies:
45774577
prettier-linter-helpers "^1.0.0"
45784578

4579+
eslint-plugin-simple-import-sort@^5.0.3:
4580+
version "5.0.3"
4581+
resolved "https://registry.yarnpkg.com/eslint-plugin-simple-import-sort/-/eslint-plugin-simple-import-sort-5.0.3.tgz#9ae258ddada6efffc55e47a134afbd279eb31fc6"
4582+
integrity sha512-1rf3AWiHeWNCQdAq0iXNnlccnH1UDnelGgrPbjBBHE8d2hXVtOudcmy0vTF4hri3iJ0MKz8jBhmH6lJ0ZWZLHQ==
4583+
45794584
eslint-scope@^4.0.3:
45804585
version "4.0.3"
45814586
resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-4.0.3.tgz#ca03833310f6889a3264781aa82e63eb9cfe7848"

0 commit comments

Comments
 (0)