Skip to content

Conversation

@ziracmo
Copy link
Contributor

@ziracmo ziracmo commented Jul 3, 2025

✨ Migrate linting & formatting to Biome + TypeScript improvements

This PR brings a major cleanup and tooling upgrade to our documentation project 🚀 which involves a lot of linting, formatting, file renaming, and file moving.

✅ Replaced ESLint/Prettier with Biome (⚡ super fast linter/formatter)
✅ Migrated JavaScript config files to TypeScript where possible
✅ Added GitHub Action to check code quality with Biome on PRs
✅ Added proper TypeScript types for Docusaurus sidebar/config
✅ Renamed files to follow consistent snake_case naming 🐍
🔥 Migrate some CSS code to Tailwind
💄 Update UI -> Alerts, Footer, Code blocks, Sidebar
⭐ Premium badge updated to align with Console

Let me know if you spot anything off 👀

Screenshots

Before/after

image

Next steps:

  • Align doc components to the same UI library, we currently have 3 components libraries (MUI, Radix and Shadcn)

@ziracmo ziracmo force-pushed the code-improvments branch from 201afe2 to a79c37b Compare July 3, 2025 14:24
@aws-amplify-eu-west-1
Copy link

This pull request is automatically being deployed by Amplify Hosting (learn more).

Access this pull request here: https://pr-813.d1to60jd2gb6y6.amplifyapp.com

@ziracmo ziracmo force-pushed the code-improvments branch 4 times, most recently from 2ac7616 to f19cba7 Compare July 8, 2025 08:22
@ziracmo ziracmo requested review from LaurenceJJones and Copilot July 8, 2025 08:26
@ziracmo ziracmo self-assigned this Jul 8, 2025
@ziracmo ziracmo marked this pull request as ready for review July 8, 2025 08:26
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR replaces ESLint/Prettier with Biome, strengthens TypeScript usage, and standardizes file/component naming.

  • Renamed React component imports and file paths to snake_case
  • Converted many JS modules to TypeScript and updated Docusaurus theme components
  • Adjusted tooling configs (tsconfig, tailwind.config, GitHub Action) for Biome and TypeScript

Reviewed Changes

Copilot reviewed 122 out of 124 changed files in this pull request and generated no comments.

File Description
versioned_docs/**/scenarios/create.md Updated import path from AcademyPromo to academy-promo
tsconfig.json Added module: "NodeNext"/moduleResolution and scoped @site/* paths
tailwind.config.js Simplified and reorganized theme color definitions
src/utils/index.ts Reordered clsx/twMerge imports and formatted cn
Files not reviewed (1)
  • crowdsec-docs/package-lock.json: Language not supported
Comments suppressed due to low confidence (4)

crowdsec-docs/src/components/academy-promo.tsx:13

  • Use Docusaurus' useBaseUrl helper for asset URLs (e.g. useBaseUrl('/img/academy/' + props.image)) to ensure correct base path resolution in production.
							<a href={LINK} target="_blank">

crowdsec-docs/src/components/academy-promo.tsx:4

  • Fallback for UTM parameters defaults to a space character, potentially resulting in malformed URLs. Use an empty string as the fallback or handle absence of props.utm explicitly.
	const LINK = `https://academy.crowdsec.net/course/${props.course}${process.env.NODE_ENV === "production" ? props.utm : " "}`;

crowdsec-docs/tsconfig.json:8

  • The @/* path alias was removed; verify no code still relies on that shortcut or consider re-adding it to avoid import errors.
      "paths": {

crowdsec-docs/src/utils/index.ts:5

  • [nitpick] This line is indented with a tab instead of spaces, which differs from the rest of the file; unify on the project's preferred indentation style for consistency.
	return twMerge(clsx(inputs));

@ziracmo ziracmo force-pushed the code-improvments branch from f19cba7 to ff8e9f4 Compare July 8, 2025 08:34
@LaurenceJJones
Copy link
Member

There probably a component UnderlineTooltip.js that needs adapting to the new snake case and migrating to typescript

@LaurenceJJones
Copy link
Member

LaurenceJJones commented Jul 8, 2025

In light mode none of the logos links like discord, github or hub are viewable

image

@LaurenceJJones
Copy link
Member

LaurenceJJones commented Jul 8, 2025

Your rebase on master seems to have missing files / edits that were in #810

link to previous comment about UnderlineTooltip.js as this component was made to provide additional information on hover.

@ziracmo ziracmo requested a review from rr404 July 8, 2025 10:38
@ziracmo ziracmo force-pushed the code-improvments branch 3 times, most recently from e886613 to 6cf96d1 Compare July 8, 2025 13:08
@ziracmo ziracmo force-pushed the code-improvments branch from 6cf96d1 to 8b51499 Compare July 8, 2025 13:08
@ziracmo ziracmo force-pushed the code-improvments branch from bbab162 to 9587785 Compare July 8, 2025 13:30
@ziracmo ziracmo merged commit 76025de into main Jul 8, 2025
2 of 3 checks passed
@ziracmo ziracmo deleted the code-improvments branch July 8, 2025 14:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants