Skip to content

Commit 4999acb

Browse files
cpyle0819ford-at-aws
authored andcommitted
JavaScript (v3): Lint - Add noUndeclaredVariables rule to Biome config.
1 parent 2b9da46 commit 4999acb

File tree

12 files changed

+26
-11
lines changed

12 files changed

+26
-11
lines changed

javascriptv3/biome.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
"./example_code/medical-imaging/scenarios/health-image-sets/pixel-data-verification",
1313
"./example_code/kinesis/kinesis-cdk",
1414
"./example_code/medical-imaging/scenarios/health-image-sets/pixel-data-verification/openjphjs/openjphjs.js",
15+
"./example_code/cross-services/textract-react",
1516
"**/dist"
1617
]
1718
},
@@ -25,7 +26,12 @@
2526
"linter": {
2627
"enabled": true,
2728
"rules": {
28-
"recommended": true
29+
"recommended": true,
30+
"correctness": {
31+
"noUndeclaredVariables": {
32+
"level": "error"
33+
}
34+
}
2935
}
3036
},
3137
"javascript": {

javascriptv3/example_code/cross-services/aurora-serverless-app/src/handlers/get-items-handler.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// SPDX-License-Identifier: Apache-2.0
33

44
import type { Handler } from "src/types/handler.js";
5+
import type { DBRecords } from "src/types/db-record.js";
56
import { command as getAllItemsCommand } from "../statement-commands/get-all-items.js";
67
import { command as getArchivedItemsCommand } from "../statement-commands/get-archived-items.js";
78
import { command as getActiveItemsCommand } from "../statement-commands/get-active-items.js";

javascriptv3/example_code/cross-services/aurora-serverless-app/src/handlers/parse-item.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
22
// SPDX-License-Identifier: Apache-2.0
33
import type { Item } from "../types/item.js";
4+
import type { DBRecord } from "../types/db-record.js";
45

56
const parseItem = (record: DBRecord): Item => {
67
return {

javascriptv3/example_code/cross-services/aurora-serverless-app/src/handlers/post-items-report-handler.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { SendRawEmailCommand } from "@aws-sdk/client-ses";
55
import { createMimeMessage, type TextFormat } from "mimetext";
66
import { format } from "prettier";
77
import type { Handler } from "src/types/handler.js";
8+
import type { DBRecords } from "src/types/db-record.js";
89
import { command as getActiveItemsCommand } from "../statement-commands/get-active-items.js";
910

1011
const makeCsv = (records: DBRecords) => {

javascriptv3/example_code/cross-services/aurora-serverless-app/src/middleware/validate-db.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import type { RequestHandler } from "express";
55
import { command as createTableCommand } from "../statement-commands/create-table.js";
66
import { command as getAllItemsCommand } from "../statement-commands/get-all-items.js";
77
import type { Handler } from "src/types/handler.js";
8+
import type { Sendable } from "src/types/sendable.js";
89

910
const errorCodes = {
1011
TABLE_NOT_FOUND: "Error code: 1146",

javascriptv3/example_code/cross-services/aurora-serverless-app/src/types/db-record.d.ts

Lines changed: 0 additions & 5 deletions
This file was deleted.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
// SPDX-License-Identifier: Apache-2.0
3+
4+
export type DBRecordValue = Record<string, string | number>;
5+
export type DBRecord = DBRecordValue[];
6+
export type DBRecords = DBRecord[];

javascriptv3/example_code/cross-services/aurora-serverless-app/src/types/handler.d.ts renamed to javascriptv3/example_code/cross-services/aurora-serverless-app/src/types/handler.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
22
// SPDX-License-Identifier: Apache-2.0
3+
34
import type { RequestHandler } from "express";
5+
import type { Sendable } from "./sendable.js";
46

5-
declare type Handler = {
7+
export type Handler = {
68
withClient: ({
79
rdsDataClient,
810
sesClient,

javascriptv3/example_code/cross-services/aurora-serverless-app/src/types/item.d.ts renamed to javascriptv3/example_code/cross-services/aurora-serverless-app/src/types/item.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
22
// SPDX-License-Identifier: Apache-2.0
3-
declare type Item = {
3+
4+
export type Item = {
45
/**
56
* A UUID that is generated by the middleware.
67
*/
@@ -31,5 +32,3 @@ declare type Item = {
3132
*/
3233
archived: boolean;
3334
};
34-
35-
export type { Item };

javascriptv3/example_code/cross-services/aurora-serverless-app/src/types/sendable.d.ts renamed to javascriptv3/example_code/cross-services/aurora-serverless-app/src/types/sendable.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
22
// SPDX-License-Identifier: Apache-2.0
33

4-
declare interface Sendable {
4+
export interface Sendable {
55
send: <R>(command: unknown) => Promise<R>;
66
}

0 commit comments

Comments
 (0)