Skip to content

Commit a0323b5

Browse files
committed
style: format code with Prettier
- Format package.json - Format scripts/updateContributors.ts
1 parent 79454c0 commit a0323b5

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,4 +67,4 @@
6767
"rehype-pretty-code": "^0.14.0",
6868
"striptags": "^3.2.0"
6969
}
70-
}
70+
}

scripts/updateContributors.ts

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,17 @@ async function fetchContributorsForRepo(repoName: string): Promise<Contributor[]
7373
try {
7474
return JSON.parse(text);
7575
} catch (parseError) {
76-
console.error(`✗ Invalid JSON for ${repoName}:`, parseError instanceof Error ? parseError.message : parseError);
76+
console.error(
77+
`✗ Invalid JSON for ${repoName}:`,
78+
parseError instanceof Error ? parseError.message : parseError
79+
);
7780
return [];
7881
}
7982
} catch (error) {
80-
console.error(`✗ Error fetching contributors for ${repoName}:`, error instanceof Error ? error.message : error);
83+
console.error(
84+
`✗ Error fetching contributors for ${repoName}:`,
85+
error instanceof Error ? error.message : error
86+
);
8187
return [];
8288
}
8389
}
@@ -96,9 +102,7 @@ async function fetchAllContributors(): Promise<Contributor[]> {
96102
const allContributors = contributorArrays.flat();
97103

98104
// Deduplicate by login
99-
const uniqueContributors = Array.from(
100-
new Map(allContributors.map((c) => [c.login, c])).values()
101-
);
105+
const uniqueContributors = Array.from(new Map(allContributors.map((c) => [c.login, c])).values());
102106

103107
console.log(`\n✓ Total unique contributors: ${uniqueContributors.length}`);
104108
return uniqueContributors;
@@ -153,10 +157,7 @@ function updateConstantsFile(contributors: Contributor[]): void {
153157

154158
// Format contributors list
155159
const contributorEntries = contributors
156-
.map(
157-
(c) =>
158-
`\t{\n\t\thtml_url: '${c.login}',\n\t\tavatar_url: '${c.avatar_url}'\n\t}`
159-
)
160+
.map((c) => `\t{\n\t\thtml_url: '${c.login}',\n\t\tavatar_url: '${c.avatar_url}'\n\t}`)
160161
.join(',\n');
161162

162163
const newList = `export const defaultContributorsList = [\n${contributorEntries}\n];`;

0 commit comments

Comments
 (0)