Skip to content

Commit 11dbdfb

Browse files
committed
refactor(website): minor improvements
1 parent 5248f3a commit 11dbdfb

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

scripts/build-used-by.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@ async function fetchGitHubAvatar(repo: string, token?: string): Promise<string>
5353
}
5454

5555
async function buildUsedByImage(users: string[]) {
56+
const gap = 16;
5657
const viewWidth = 1024;
5758
const viewHeight = users.length / 8 * (viewWidth / 8);
58-
const gap = 16;
5959
const getItemX = (index: number) => index % 8 * (viewWidth / 8) + gap * 0.5;
6060
const getItemY = (index: number) => Math.floor(index / 8) * (viewWidth / 8) + gap * 0.5;
6161
const canvas = createCanvas(viewWidth, viewHeight);
@@ -73,4 +73,5 @@ const token = process.env["GITHUB_TOKEN"];
7373
const avatars = await Promise.all(projects.map(async (repo) => fetchGitHubAvatar(repo, token)));
7474
const avatarsDeDup = Array.from(new Set(avatars));
7575
const img = await buildUsedByImage(avatarsDeDup);
76+
await fs.writeFile("website/assets/used_by.png", img);
7677
await fs.writeFile("website/public/used_by.png", img);

website/assets/used_by.png

295 KB
Loading

website/pages/index.mdx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,9 @@ A series of composable ESLint plugins for libraries and frameworks that use Reac
2626
- [`eslint-plugin-react-hooks-extra`](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-hooks-extra) - Extra React Hooks rules.
2727
- [`eslint-plugin-react-naming-convention`](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-naming-convention) - Naming convention rules.
2828

29-
### Used by
29+
## Used by
3030

31-
![used-by](https://eslint-react.xyz/used_by.png)
32-
33-
_Data collected from GitHub dependents network, if there are any mismatch or outdated information, feel free to [open issue](https://github.com/Rel1cx/eslint-react/issues/new?assignees=&labels=type%3A+documentation&projects=&template=docs_report.md&title=%5Bdocs%5D+) or pull request._
31+
![used-by](../assets/used_by.png)
3432

3533
## FAQ
3634

0 commit comments

Comments
 (0)