A place for all our biome configs - with the hope that it's only going to be one, actually
Right now, only the frontend config exists, but it should work for non-frontend codebases just as well.
At the time of writing, this config is working with biome version 2.3.5 and most likely above.
Add this npm package to your project's `devDependencies:
npm install --save-dev @rio-cloud/biome-configNow, your minimal biome.json could look like this:
{
"$schema": "node_modules/@biomejs/biome/configuration_schema.json",
"extends": ["@rio-cloud/biome-config/frontend.json"],
"root": true
}By default, this config tells biome to integrate with your git repository so that it automatically ignores filed
specified in your .gitignore file. You can, however, fine-tune what's
covered by biome and what's not by setting the files.includes property.
Take a look at the the biome docs for reference.
To make interacting with biome in the terminal easier, you can add some
npm scripts to your package.json:
{
/* ... */
"scripts": {
/* ... */
"format-code": "biome format --write .",
"lint": "biome lint .",
"lint-fix": "biome lint --write .",
"lint-fix-unsafe": "biome lint --write --unsafe .",
}
/* ... */
}Depending on your IDE, we also recommend to activate biome and have it fix stuff on save automatically for you. There is a pretty good biome extension for intelliJ that allows these settings, for example:
If you have a biome config that would like to see added here, please double-check if there's not already one that works for you. The frontend config should be sufficient for most (if not all) projects that are using TypeScript. And remember that you can always overrule or add settings to your local biome config without having to push those settings "upstream". After all, the configs in this repository are supposed to be a solid baseline for most of our projects - and hopefully, we can homogenize our code a bit.
If you see a config here and do want to change settings because you're sure that change needs to happen for everyone at RIO, feel free to open an issue on GitHub 😎
