Skip to content

Commit 0d919bb

Browse files
committed
Lint
1 parent 9c96533 commit 0d919bb

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

scripts/fetch-mdn.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ const url = "https://developer.mozilla.org/en-US/metadata.json";
66
async function fetchAndFilterMDN() {
77
try {
88
const res = await fetch(url);
9-
if (!res.ok) throw new Error(`Fetch failed: ${res.statusText}`);
9+
if (!res.ok) {
10+
throw new Error(`Fetch failed: ${res.statusText}`);
11+
}
1012

1113
const data = await res.json();
1214

src/build/mdn-comments.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,9 @@ function insertComment(
4747

4848
function extractSlug(slug: string): string[] {
4949
for (const subdirectory of subdirectories) {
50-
if (!slug.toLowerCase().startsWith(subdirectory)) continue;
50+
if (!slug.toLowerCase().startsWith(subdirectory)) {
51+
continue;
52+
}
5153
return slug
5254
.slice(subdirectory.length)
5355
.replace(/_static/g, "")
@@ -83,7 +85,9 @@ export async function generateDescriptions(): Promise<{
8385
const slugArr = extractSlug(mdnUrl);
8486
const path = paths[entry.pageType];
8587
const comment = generateComment(entry.summary, slugArr[slugArr.length - 1]);
86-
if (!slugArr.length || !path) continue;
88+
if (!slugArr.length || !path) {
89+
continue;
90+
}
8791
insertComment(results, slugArr, comment, path);
8892
}
8993
return { interfaces: { interface: results } };

0 commit comments

Comments
 (0)