Skip to content

Commit e0723b9

Browse files
committed
feat!: Use camelCase for Typescript file names
1 parent bfb7e09 commit e0723b9

16 files changed

+156
-96
lines changed

src/typescript/eslint.config.mjs

Lines changed: 37 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,42 @@
11
// @ts-check
22

3-
import eslint from '@eslint/js';
4-
import tseslint from 'typescript-eslint';
3+
import eslint from "@eslint/js";
4+
import tseslint from "typescript-eslint";
5+
import checkFile from "eslint-plugin-check-file";
56

67
export default tseslint.config(
7-
eslint.configs.recommended,
8-
...tseslint.configs.recommended,
9-
{
10-
linterOptions: {
11-
reportUnusedDisableDirectives: false,
8+
eslint.configs.recommended,
9+
...tseslint.configs.recommended,
10+
{
11+
plugins: {
12+
"check-file": checkFile,
13+
},
14+
linterOptions: {
15+
reportUnusedDisableDirectives: false,
16+
},
17+
rules: {
18+
"@typescript-eslint/no-unused-vars": [
19+
"error",
20+
{ argsIgnorePattern: "^_" },
21+
],
22+
"@typescript-eslint/naming-convention": [
23+
"error",
24+
{
25+
selector: "property",
26+
format: null,
1227
},
13-
rules: {
14-
"@typescript-eslint/no-unused-vars": ["error",
15-
{ "argsIgnorePattern": "^_" }
16-
]
17-
}
18-
}
19-
);
28+
],
29+
"check-file/filename-naming-convention": [
30+
"error",
31+
{ "src/**/*.ts": "CAMEL_CASE" },
32+
{
33+
ignoreMiddleExtensions: true,
34+
},
35+
],
36+
"check-file/folder-naming-convention": [
37+
"error",
38+
{ "src/**/": "KEBAB_CASE" },
39+
],
40+
},
41+
}
42+
);

src/typescript/package-lock.json

Lines changed: 31 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/typescript/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
"aws-sdk-client-mock": "^4.1.0",
4747
"aws-sdk-client-mock-jest": "^4.1.0",
4848
"eslint": "^9.30.1",
49+
"eslint-plugin-check-file": "^3.3.0",
4950
"jest": "^30.0.4",
5051
"ts-jest": "^29.4.0",
5152
"tsx": "^4.20.3",

src/typescript/src/handlers/api_gateway_proxy_event_handler.ts renamed to src/typescript/src/handlers/apiGatewayProxyEventHandler.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import {
33
StreamableHttpHandler,
44
ParsedHttpRequest,
55
HttpResponse,
6-
} from "./streamable_http_handler.js";
7-
import { RequestHandler } from "./request_handler.js";
6+
} from "./streamableHttpHandler.js";
7+
import { RequestHandler } from "./requestHandler.js";
88

99
/**
1010
* Handler for API Gateway V1 events (REST APIs)

src/typescript/src/handlers/api_gateway_proxy_event_v2_handler.ts renamed to src/typescript/src/handlers/apiGatewayProxyEventV2Handler.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import {
33
StreamableHttpHandler,
44
ParsedHttpRequest,
55
HttpResponse,
6-
} from "./streamable_http_handler.js";
7-
import { RequestHandler } from "./request_handler.js";
6+
} from "./streamableHttpHandler.js";
7+
import { RequestHandler } from "./requestHandler.js";
88

99
/**
1010
* Handler for API Gateway V2 events (HTTP APIs)

src/typescript/src/handlers/handlers.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import {
1616
APIGatewayProxyEventV2Handler,
1717
LambdaFunctionURLEventHandler,
1818
} from "./index.js";
19-
import { RequestHandler } from "./request_handler.js";
19+
import { RequestHandler } from "./requestHandler.js";
2020

2121
// Mock RequestHandler implementation for testing
2222
class MockRequestHandler implements RequestHandler {

src/typescript/src/handlers/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export { RequestHandler } from "./request_handler.js";
2-
export { APIGatewayProxyEventHandler } from "./api_gateway_proxy_event_handler.js";
3-
export { APIGatewayProxyEventV2Handler } from "./api_gateway_proxy_event_v2_handler.js";
4-
export { LambdaFunctionURLEventHandler } from "./lambda_function_url_event_handler.js";
1+
export { RequestHandler } from "./requestHandler.js";
2+
export { APIGatewayProxyEventHandler } from "./apiGatewayProxyEventHandler.js";
3+
export { APIGatewayProxyEventV2Handler } from "./apiGatewayProxyEventV2Handler.js";
4+
export { LambdaFunctionURLEventHandler } from "./lambdaFunctionUrlEventHandler.js";

src/typescript/src/handlers/lambda_function_url_event_handler.ts renamed to src/typescript/src/handlers/lambdaFunctionUrlEventHandler.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import {
33
StreamableHttpHandler,
44
ParsedHttpRequest,
55
HttpResponse,
6-
} from "./streamable_http_handler.js";
7-
import { RequestHandler } from "./request_handler.js";
6+
} from "./streamableHttpHandler.js";
7+
import { RequestHandler } from "./requestHandler.js";
88

99
/**
1010
* Handler for Lambda Function URL requests

src/typescript/src/handlers/streamable_http_handler.ts renamed to src/typescript/src/handlers/streamableHttpHandler.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {
1111
ErrorCode,
1212
} from "@modelcontextprotocol/sdk/types.js";
1313
import { createLogger, format, transports } from 'winston';
14-
import { RequestHandler } from "./request_handler.js";
14+
import { RequestHandler } from "./requestHandler.js";
1515

1616
const logger = createLogger({
1717
level: process.env.LOG_LEVEL?.toLowerCase() || 'info',
@@ -65,10 +65,10 @@ export abstract class StreamableHttpHandler<TEvent, TResult> {
6565

6666
// Parse the event into a common HTTP request format
6767
const httpRequest = this.parseEvent(event);
68-
68+
6969
// Process the HTTP request using shared logic
7070
const httpResponse = await this.processHttpRequest(httpRequest, context);
71-
71+
7272
// Format the response for the specific event type
7373
return this.formatResponse(httpResponse);
7474
} catch (error) {

0 commit comments

Comments
 (0)