0.0.6 • Published 6 months ago
@maxchang/biome-config v0.0.6
@maxchang/biome-config
Convention
- Based on recommended rules from Biome
- Using spaces as indentation, default 4 spaces for JS/TS
- Sorted imports, dangling commas
- Single quotes, semicolons as needed
Features
- Automatic import organization
- Git integration, respects
.gitignoreby default - Customizable TypeScript, JavaScript, and JSON rules
- Predefined ignore patterns for common files/directories
- Partial support for
.vue,.svelte, and.astrofiles
Usage
Not sure how to set up Biome? Take a look at the Getting Started guide from the official docs.
pnpm i -D @maxchang/biome-configyarn add -D @maxchang/biome-confignpm i @maxchang/biome-config --save-devExtend the config in your biome.json file:
{
"$schema": "https://biomejs.dev/schemas/1.9.4/schema.json",
"extends": ["@maxchang/biome-config"]
}Add the following scripts to your package.json:
"scripts": {
"lint": "biome check",
"lint:fix": "biome check --write ."
}If you use VS Code, here is a reference settings.json, with automatic formatting on save and Biome as the default formatter for languages needed.
Recipes
Sort package.json keys
Since Biome has no plans to implement something like prettier-plugin-packagejson and currently lacks equivalent rules such as jsonc/sort-keys*, you can use sort-package-json as a workaround.
pnpx sort-package-jsonnpx sort-package-json