Skip to content

Commit 8ae9bf1

Browse files
authored
Run linter on scripts folder (#912)
1 parent e441944 commit 8ae9bf1

Some content is hidden

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

43 files changed

+95
-90
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
- name: install
2424
run: yarn
2525
- name: lint+format
26-
run: biome ci src
26+
run: biome ci
2727
- name: build
2828
run: yarn build
2929
- name: test

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
"scripts": {
3636
"build": "tsc",
3737
"format": "biome format --write .",
38-
"lint": "biome lint --write src",
38+
"lint": "biome lint --write .",
3939
"release": "yarn build && changeset publish",
4040
"test": "vitest"
4141
},

scripts/generateClientTypesMap/getClientReqRespTypesMap.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import jscodeshift, {
2-
Identifier,
3-
TSFunctionType,
4-
TSQualifiedName,
5-
TSTypeReference,
2+
type Identifier,
3+
type TSFunctionType,
4+
type TSQualifiedName,
5+
type TSTypeReference,
66
} from "jscodeshift";
77

88
import { getTypesSource } from "./getTypesSource";
@@ -35,7 +35,7 @@ export const getClientReqRespTypesMap = async (
3535
if (!params.typeAnnotation) return;
3636
if (!params.typeAnnotation.typeAnnotation) return;
3737
if (params.typeAnnotation.typeAnnotation.type !== "TSTypeReference") return;
38-
const paramsTypeRef = params.typeAnnotation!.typeAnnotation! as TSTypeReference;
38+
const paramsTypeRef = params.typeAnnotation.typeAnnotation as TSTypeReference;
3939

4040
if (!paramsTypeRef.typeName) return;
4141
if (paramsTypeRef.typeName.type !== "TSQualifiedName") return;
@@ -55,7 +55,7 @@ export const getClientReqRespTypesMap = async (
5555
if (!callback.typeAnnotation) return;
5656
if (!callback.typeAnnotation.typeAnnotation) return;
5757
if (callback.typeAnnotation.typeAnnotation.type !== "TSFunctionType") return;
58-
const callbackTypeRef = callback.typeAnnotation!.typeAnnotation! as TSFunctionType;
58+
const callbackTypeRef = callback.typeAnnotation.typeAnnotation as TSFunctionType;
5959

6060
if (!callbackTypeRef.parameters) return;
6161
if (callbackTypeRef.parameters.length !== 2) return;
@@ -66,7 +66,7 @@ export const getClientReqRespTypesMap = async (
6666
if (responseType.typeAnnotation.type !== "TSTypeAnnotation") return;
6767
if (!responseType.typeAnnotation.typeAnnotation) return;
6868
if (responseType.typeAnnotation.typeAnnotation.type !== "TSTypeReference") return;
69-
const responseTypeRef = responseType.typeAnnotation!.typeAnnotation! as TSTypeReference;
69+
const responseTypeRef = responseType.typeAnnotation.typeAnnotation as TSTypeReference;
7070

7171
if (!responseTypeRef.typeName) return;
7272
if (responseTypeRef.typeName.type !== "TSQualifiedName") return;

scripts/generateClientTypesMap/getClientTypesMap.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
import jscodeshift, { Identifier, TSArrayType, TSTypeLiteral, TSTypeReference } from "jscodeshift";
1+
import jscodeshift, {
2+
type Identifier,
3+
type TSArrayType,
4+
type TSTypeLiteral,
5+
type TSTypeReference,
6+
} from "jscodeshift";
27

38
import { CLIENT_NAMES_MAP, DOCUMENT_CLIENT } from "../../src/transforms/v2-to-v3/config";
49
import { getClientTypesMapWithKeysRemovedFromValues } from "./getClientTypesMapWithKeysRemovedFromValues";

scripts/generateClientTypesMap/getTypesSource.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
import { readFileSync } from "fs";
2-
import { join } from "path";
3-
import { JSCodeshift } from "jscodeshift";
1+
import { readFileSync } from "node:fs";
2+
import { join } from "node:path";
3+
import type { JSCodeshift } from "jscodeshift";
44
import { DOCUMENT_CLIENT } from "../../src/transforms/v2-to-v3/config";
55

66
export const getTypesSource = (j: JSCodeshift, clientName: string) => {
77
const typesPath =
88
clientName === DOCUMENT_CLIENT
9-
? join("node_modules", "aws-sdk", "lib", "dynamodb", `document_client.d.ts`)
9+
? join("node_modules", "aws-sdk", "lib", "dynamodb", "document_client.d.ts")
1010
: join("node_modules", "aws-sdk", "clients", `${clientName.toLowerCase()}.d.ts`);
1111
const relativeTypesPath = join(__dirname, "..", "..", typesPath);
1212

scripts/generateClientTypesMap/index.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { writeFile } from "fs/promises";
2-
import { join } from "path";
1+
import { writeFile } from "node:fs/promises";
2+
import { join } from "node:path";
33
import { format } from "prettier";
44

55
import {
@@ -24,8 +24,8 @@ const codegenComment = `// This file is generated by scripts/generateClientTypes
2424

2525
let fileContent = codegenComment;
2626

27-
fileContent += `\n\n/* eslint-disable @typescript-eslint/naming-convention */`;
28-
fileContent += `\nexport const ${mapName}: Record<string, Record<string, string>> = `;
27+
fileContent += "\n\n\n";
28+
fileContent += `export const ${mapName}: Record<string, Record<string, string>> = `;
2929

3030
const clientTypesMap = {};
3131

@@ -37,7 +37,7 @@ const codegenComment = `// This file is generated by scripts/generateClientTypes
3737
}
3838

3939
fileContent += JSON.stringify(clientTypesMap);
40-
fileContent += `;\n`;
40+
fileContent += ";\n";
4141

4242
await writeFile(
4343
relativeFilePath,

scripts/generateNewClientTests/getGlobalImportEqualsInput.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ import { CLIENTS_TO_TEST } from "./config";
22
import { getV2ClientsNewExpressionCode } from "./getV2ClientsNewExpressionCode";
33

44
export const getGlobalImportEqualsInput = () => {
5-
let content = ``;
5+
let content = "";
66

77
content += `import AWS = require("aws-sdk");\n\n`;
8-
content += getV2ClientsNewExpressionCode(CLIENTS_TO_TEST, `AWS.`);
8+
content += getV2ClientsNewExpressionCode(CLIENTS_TO_TEST, "AWS.");
99

1010
return content;
1111
};

scripts/generateNewClientTests/getGlobalImportEqualsOutput.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { getV3ClientsNewExpressionCode } from "./getV3ClientsNewExpressionCode";
44
import { getV3PackageImportEqualsCode } from "./getV3PackageImportEqualsCode";
55

66
export const getGlobalImportEqualsOutput = () => {
7-
let content = ``;
7+
let content = "";
88

99
content += getV3PackageImportEqualsCode(getClientNamesSortedByPackageName(CLIENTS_TO_TEST));
1010
content += "\n";

scripts/generateNewClientTests/getGlobalImportInput.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ import { CLIENT_NAMES } from "../../src/transforms/v2-to-v3/config";
22
import { getV2ClientsNewExpressionCode } from "./getV2ClientsNewExpressionCode";
33

44
export const getGlobalImportInput = () => {
5-
let content = ``;
5+
let content = "";
66

77
content += `import AWS from "aws-sdk";\n\n`;
8-
content += getV2ClientsNewExpressionCode(CLIENT_NAMES, `AWS.`);
8+
content += getV2ClientsNewExpressionCode(CLIENT_NAMES, "AWS.");
99

1010
return content;
1111
};

scripts/generateNewClientTests/getGlobalImportOutput.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ import { getV3ClientsNewExpressionCode } from "./getV3ClientsNewExpressionCode";
44
import { getV3PackageImportsCode } from "./getV3PackageImportsCode";
55

66
export const getGlobalImportOutput = () => {
7-
let content = ``;
7+
let content = "";
88

99
content += getV3PackageImportsCode(getClientNamesSortedByPackageName(CLIENT_NAMES));
10-
content += `\n`;
10+
content += "\n";
1111
content += getV3ClientsNewExpressionCode(CLIENT_NAMES);
1212

1313
return content;

0 commit comments

Comments
 (0)