1.0.2 • Published 8 months ago

@ozturkgokhan/biome-config v1.0.2

Weekly downloads
-
License
ISC
Repository
github
Last release
8 months ago

@gokhanozturk/biome-config

This package contains a shared configuration for Biome and VSCode. You can use it to maintain consistent code formatting and linting rules across your projects.

Requirements

  • Node.js >= 16.0.0
  • @biomejs/biome >= 1.5.3

Installation

npm install --save-dev @gokhanozturk/biome-config @biomejs/biome

Usage

  1. Create a biome.json file in your project's root directory and add the following content:
{
  "extends": ["@gokhanozturk/biome-config/biome.json"]
}
  1. Copy the VSCode settings to your project:
mkdir -p .vscode && cp node_modules/@gokhanozturk/biome-config/.vscode/settings.json .vscode/
  1. Add the following scripts to your package.json:
{
  "scripts": {
    "format": "biome format . --write",
    "lint": "biome lint .",
    "check": "biome check ."
  }
}

Features

Biome Configuration

  • Import organization
  • Linting rules
    • All recommended rules enabled
    • Error for unused variables
    • Warning for console.log usage
    • Enforced const usage
    • Enforced template literals
  • Formatting rules
    • 2 spaces for indentation
    • 100 characters line width
    • Single quotes for strings
    • ES5 trailing commas
    • Required semicolons
  • Ignored paths
    • node_modules
    • build
    • .next

VSCode Integration

  • Format on save enabled
  • Automatic import organization
  • Biome set as default formatter for:
    • JavaScript
    • TypeScript
    • React (JSX/TSX)
    • JSON
    • JSONC
  • Quick fixes enabled

Available Scripts

  • npm run format: Format all files using Biome
  • npm run lint: Lint all files using Biome
  • npm run check: Run both formatting and linting checks

Additional Configuration

The configuration includes:

  • A11y rules with noSvgWithoutTitle disabled
  • Class sorting with useSortedClasses rule enabled for className and cn attributes
  • Format on save with error tolerance
  • Organized imports

Contributing

Please read our Contributing Guide before submitting a Pull Request to the project.

Changelog

See CHANGELOG.md for a list of changes.

License

ISC © Gokhan Ozturk

1.0.2

8 months ago

1.0.1

8 months ago

1.0.0

8 months ago