diff --git a/app/routes/analytics.tsx b/app/routes/analytics.tsx index 8a1d322..fa07dbd 100644 --- a/app/routes/analytics.tsx +++ b/app/routes/analytics.tsx @@ -18,17 +18,22 @@ export async function action({ request }: ActionFunctionArgs) { const data = (await request.json()) as AnalyticsData - const entry: DatabaseAnalyticsData = { ...data, id: data.metric.id, createdAt: new Date().toISOString() } + const entry: DatabaseAnalyticsData = { + ...data, + id: data.metric.id, + createdAt: new Date().toISOString() + } try { - // eslint-disable-next-line new-cap await aws.DynamoDB.PutItem({ TableName: Resource.WebVitals.name, Item: entry }) } catch (error) { - return new Response(`Error saving data: ${error as string}`, { status: 500 }) + return new Response(`Error saving data: ${error as string}`, { + status: 500 + }) } return new Response("", { status: 204 }) diff --git a/aws-lite.d.ts b/aws-lite.d.ts index 5d3b113..ef83356 100644 --- a/aws-lite.d.ts +++ b/aws-lite.d.ts @@ -1 +1 @@ -declare module '@aws-lite/dynamodb'; \ No newline at end of file +declare module "@aws-lite/dynamodb" diff --git a/tsconfig.json b/tsconfig.json index ae0fb47..788281d 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -8,16 +8,8 @@ "**/.client/**/*.tsx" ], "compilerOptions": { - "lib": [ - "DOM", - "DOM.Iterable", - "ES2022" - ], - "types": [ - "@remix-run/node", - "vite/client", - "@aws-lite/dynamodb-types" - ], + "lib": ["DOM", "DOM.Iterable", "ES2022"], + "types": ["@remix-run/node", "vite/client", "@aws-lite/dynamodb-types"], "isolatedModules": true, "esModuleInterop": true, "jsx": "react-jsx", @@ -31,11 +23,9 @@ "forceConsistentCasingInFileNames": true, "baseUrl": ".", "paths": { - "~/*": [ - "./app/*" - ] + "~/*": ["./app/*"] }, // Vite takes care of building everything, not tsc. "noEmit": true } -} \ No newline at end of file +}