1.0.2 • Published 8 months ago
@ozturkgokhan/biome-config v1.0.2
@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/biomeUsage
- Create a
biome.jsonfile in your project's root directory and add the following content:
{
"extends": ["@gokhanozturk/biome-config/biome.json"]
}- Copy the VSCode settings to your project:
mkdir -p .vscode && cp node_modules/@gokhanozturk/biome-config/.vscode/settings.json .vscode/- 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 Biomenpm run lint: Lint all files using Biomenpm run check: Run both formatting and linting checks
Additional Configuration
The configuration includes:
- A11y rules with
noSvgWithoutTitledisabled - Class sorting with
useSortedClassesrule enabled forclassNameandcnattributes - 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