Skip to content

Commit 30c7159

Browse files
committed
Fix linting
1 parent 4007da7 commit 30c7159

File tree

2 files changed

+24
-27
lines changed

2 files changed

+24
-27
lines changed

.vscode/settings.json

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22
"files.exclude": {
33
"**/.turbo": true
44
},
5-
"tailwindCSS.classAttributes": [
6-
"class",
7-
"className",
8-
"tw"
9-
],
10-
}
5+
"tailwindCSS.classAttributes": ["class", "className", "tw"],
6+
"prettier.trailingComma": "all"
7+
}

packages/open-next/src/adapters/cache.ts

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ export default class S3Cache {
140140
const { Body, LastModified } = await this.getS3Object(key, "fetch", keys);
141141
const lastModified = await this.getHasRevalidatedTags(
142142
key,
143-
LastModified?.getTime()
143+
LastModified?.getTime(),
144144
);
145145
if (lastModified === -1) {
146146
// If some tags are stale we need to force revalidation
@@ -161,7 +161,7 @@ export default class S3Cache {
161161

162162
async getIncrementalCache(
163163
key: string,
164-
keys: string[]
164+
keys: string[],
165165
): Promise<CacheHandlerValue | null> {
166166
if (keys.includes(this.buildS3Key(key, "body"))) {
167167
debug("get body cache ", { key });
@@ -203,7 +203,7 @@ export default class S3Cache {
203203
]);
204204
const lastModified = await this.getHasRevalidatedTags(
205205
key,
206-
LastModified?.getTime()
206+
LastModified?.getTime(),
207207
);
208208
if (lastModified === -1) {
209209
// If some tags are stale we need to force revalidation
@@ -236,7 +236,7 @@ export default class S3Cache {
236236
const { Body, LastModified } = await this.getS3Object(
237237
key,
238238
"redirect",
239-
keys
239+
keys,
240240
);
241241
return {
242242
lastModified: LastModified?.getTime(),
@@ -270,15 +270,15 @@ export default class S3Cache {
270270
metaPromise = this.putS3Object(
271271
key,
272272
"meta",
273-
JSON.stringify({ status: data.status, headers: data.headers })
273+
JSON.stringify({ status: data.status, headers: data.headers }),
274274
);
275275
}
276276
await Promise.all([
277277
this.putS3Object(key, "html", html),
278278
this.putS3Object(
279279
key,
280280
isAppPath ? "rsc" : "json",
281-
isAppPath ? pageData : JSON.stringify(pageData)
281+
isAppPath ? pageData : JSON.stringify(pageData),
282282
),
283283
metaPromise,
284284
]);
@@ -309,7 +309,7 @@ export default class S3Cache {
309309
tagsToWrite.map((tag) => ({
310310
path: key,
311311
tag: tag,
312-
}))
312+
})),
313313
);
314314
}
315315
}
@@ -327,7 +327,7 @@ export default class S3Cache {
327327
paths?.map((path) => ({
328328
path: path,
329329
tag: tag,
330-
})) ?? []
330+
})) ?? [],
331331
);
332332
}
333333

@@ -347,7 +347,7 @@ export default class S3Cache {
347347
ExpressionAttributeValues: {
348348
":key": { S: this.buildDynamoKey(path) },
349349
},
350-
})
350+
}),
351351
);
352352
const tags = result.Items?.map((item) => item.tag.S ?? "") ?? [];
353353
debug("tags for path", path, tags);
@@ -376,7 +376,7 @@ export default class S3Cache {
376376
":key": { S: this.buildDynamoKey(key) },
377377
":lastModified": { N: String(lastModified ?? 0) },
378378
},
379-
})
379+
}),
380380
);
381381
const revalidatedTags = result.Items ?? [];
382382
debug("revalidatedTags", revalidatedTags);
@@ -401,12 +401,12 @@ export default class S3Cache {
401401
ExpressionAttributeValues: {
402402
":tag": { S: this.buildDynamoKey(tag) },
403403
},
404-
})
404+
}),
405405
);
406406
return (
407407
// We need to remove the buildId from the path
408408
Items?.map(
409-
({ path: { S: key } }) => key?.replace(`${this.buildId}/`, "") ?? ""
409+
({ path: { S: key } }) => key?.replace(`${this.buildId}/`, "") ?? "",
410410
) ?? []
411411
);
412412
} catch (e) {
@@ -431,9 +431,9 @@ export default class S3Cache {
431431
},
432432
})),
433433
},
434-
})
434+
}),
435435
);
436-
})
436+
}),
437437
);
438438
} catch (e) {
439439
error("Failed to batch write dynamo item", e);
@@ -469,7 +469,7 @@ export default class S3Cache {
469469
CACHE_BUCKET_KEY_PREFIX ?? "",
470470
extension === "fetch" ? "__fetch" : "",
471471
this.buildId,
472-
extension === "fetch" ? key : `${key}.${extension}`
472+
extension === "fetch" ? key : `${key}.${extension}`,
473473
);
474474
}
475475

@@ -484,7 +484,7 @@ export default class S3Cache {
484484
// add a point to the key so that it only matches the key and
485485
// not other keys starting with the same string
486486
Prefix: `${this.buildS3KeyPrefix(key)}.`,
487-
})
487+
}),
488488
);
489489
return (Contents ?? []).map(({ Key }) => Key) as string[];
490490
}
@@ -497,7 +497,7 @@ export default class S3Cache {
497497
new GetObjectCommand({
498498
Bucket: CACHE_BUCKET_NAME,
499499
Key: this.buildS3Key(key, extension),
500-
})
500+
}),
501501
);
502502
return result;
503503
} catch (e) {
@@ -509,22 +509,22 @@ export default class S3Cache {
509509
private putS3Object(
510510
key: string,
511511
extension: Extension,
512-
value: PutObjectCommandInput["Body"]
512+
value: PutObjectCommandInput["Body"],
513513
) {
514514
return this.client.send(
515515
new PutObjectCommand({
516516
Bucket: CACHE_BUCKET_NAME,
517517
Key: this.buildS3Key(key, extension),
518518
Body: value,
519-
})
519+
}),
520520
);
521521
}
522522

523523
private async deleteS3Objects(key: string) {
524524
try {
525525
const regex = new RegExp(`\.(json|rsc|html|body|meta|fetch|redirect)$`);
526526
const s3Keys = (await this.listS3Object(key)).filter(
527-
(key) => key && regex.test(key)
527+
(key) => key && regex.test(key),
528528
);
529529

530530
await this.client.send(
@@ -533,7 +533,7 @@ export default class S3Cache {
533533
Delete: {
534534
Objects: s3Keys.map((Key) => ({ Key })),
535535
},
536-
})
536+
}),
537537
);
538538
} catch (e) {
539539
error("Failed to delete cache", e);

0 commit comments

Comments
 (0)