@maxchang/biome-config

0.1.4 • Public • Published

@maxchang/biome-config

npm Checked with Biome code style (Is that really a thing?)

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 .gitignore by default
  • Customizable TypeScript, JavaScript, and JSON rules
  • Predefined ignore patterns for common files/directories
  • Partial support for .vue, .svelte, and .astro files

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-config
yarn add -D @maxchang/biome-config
npm i @maxchang/biome-config --save-dev

Extend the config in your biome.json file:

{
  "$schema": "https://biomejs.dev/schemas/2.0.6/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-json
npx sort-package-json
* While Biome provides an assist action like useSortedKeys, it does not allow customization to sort keys in a specific order.

References

Package Sidebar

Install

npm i @maxchang/biome-config

Weekly Downloads

108

Version

0.1.4

License

MIT

Unpacked Size

6.68 kB

Total Files

4

Last publish

Collaborators

  • max3917