Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

frontend: use biome #1534

Merged
merged 10 commits into from
Nov 28, 2024
Merged

frontend: use biome #1534

merged 10 commits into from
Nov 28, 2024

Conversation

malinskibeniamin
Copy link
Contributor

@malinskibeniamin malinskibeniamin commented Nov 28, 2024

Cover Letter

TL:DR; What is Biome? Why are we switching?

  1. Console frontend never had formatter configured for the project, only linter (ESLint)
  2. Console now falls under UX team, meaning it's important to make it easier with context switching between apps. The UIs are very different from each other so having the same config for linting/formatting/testing is essential to deliver good quality code and avoid increasing tech debt where possible.
  3. Biome is simplifying the config as it removes all Prettier/ESLint configuration, it has all the plugins required for React Hooks or anything else that may be required.
  4. Using Biome (used to be called Rome) for Public API was a very good experience.
  5. With ESLint, it was not easy to have a similar config that would make sense previously for both UI and backend apps.
  6. Biome is written in Rust, so it's fast.

PLEASE READ THIS: The only commits worth reviewing are config setup and manual fixes - the rest is just formatting, unfortunately with a linter/formatter update there is no way to avoid massive diffs.

  1. Using biome.json config from the root of the monorepo. This is required in order to make sure the VSCode-based IDEs work properly with the Biome plugin.
  2. Admin UI, Cloud UI and Public API TS app both already use Biome.
  3. Biome config is minimal and is using recommended rules, which already contain all the plugins that previously had to be imported 1 by 1 when using Prettier or ESLint.

Refs

Cloud UI PR

Biome plugin - VSCode Marketplace

You can delete ESLint and Prettier plugins

Examples of issues found:
Screenshot 2024-11-27 at 22 18 33
Screenshot 2024-11-27 at 22 24 19
Screenshot 2024-11-27 at 22 39 17

Welcome to Biome! Let's get you started...

Files created 

  - biome.json
    Your project configuration. See https://biomejs.dev/reference/configuration

Next Steps 

  1. Setup an editor extension
     Get live errors as you type and format when you save.
     Learn more at https://biomejs.dev/guides/integrate-in-editor/

  2. Try a command
     biome check  checks formatting, import sorting, and lint rules.
     biome --help displays the available commands.

  3. Migrate from ESLint and Prettier
     biome migrate eslint   migrates your ESLint configuration to Biome.
     biome migrate prettier migrates your Prettier configuration to Biome.

  9. Read the documentation
     Find guides and documentation at https://biomejs.dev/guides/getting-started/

  10. Get involved with the community
     Ask questions and contribute on GitHub: https://github.com/biomejs/biome
     Seek for help on Discord: https://biomejs.dev/chat

@malinskibeniamin malinskibeniamin merged commit e98da7f into master Nov 28, 2024
6 checks passed
@malinskibeniamin malinskibeniamin deleted the console-frontend-biome branch November 28, 2024 17:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants