Skip to content

Latest commit

 

History

History
175 lines (135 loc) · 4.93 KB

File metadata and controls

175 lines (135 loc) · 4.93 KB

@nndvn/cfgs

MIT License Last commit Github package.json version NPM package version

@nndvn/cfgs

My editor configurations: Biome, Bun, EditorConfig, VSCode, Zed, ...

Biome Bun EditorConfig Visual Code Studio Zed


Table of Contents

🛠️ Installation

Important

Install configuration package directly from GitHub repository.

bun add --dev --exact git+https://github.com/nndvn/cfgs.git

⚙️ Configuration

  1. Add the extends array to your biome.json file:
// <project-root>/biome.json
{
    "$schema": "https://biomejs.dev/schemas/2.0.6/schema.json",
    "extends": ["@nndvn/cfgs"],
    // ...
}
  1. Add scripts to your package.json if you haven't already:
// <project-root>/package.json
{
    //...
    "scripts": {
        "check": "biome check --fix",
        "format": "biome format --fix",
        "lint": "biome lint  --fix"
    },
    // ...
}

💻 Usage

Command-line interface (CLI)

# Format all files
bun run format

# Format specific files
bun run format <files>

# Lint and apply safe fixes to all files
bun run lint

# Lint files and apply safe fixes to specific files
bun run lint <files>

# Format, lint, and organize imports of all files
bun run check

# Format, lint, and organize imports of specific files
bun run check <files>

Editor integrations (IDEs)

Visual Studio Code

Add the following extensions to your .vscode/extensions.json file:

// <project-root>/.vscode/extensions.json
{
    "recommendations": [
        "biomejs.biome"
    ]
}

Add the following settings to your .vscode/settings.json file:

// <project-root>/.vscode/settings.json
{
    "[javascript][typescript][json]": {
        "editor.defaultFormatter": "biomejs.biome",
        "editor.formatOnPaste": true,
        "editor.formatOnSave": true,
        "editor.codeActionsOnSave": {
            "source.fixAll.biome": "explicit",
            "source.organizeImports.biome": "explicit"
        }
    }
}

Zed

Add the following settings to your .zed/settings.json file:

// <project-root>/.zed/settings.json
{
    "auto_install_extensions": {
        "biome": true
    },
    "file_types": {
        "Shell Script": [".editorconfig"]
    },
    "formatter": {
        "language_server": {
            "name": "biome"
        }
    },
    "code_actions_on_format": {
        "source.organizeImports.biome": true,
        "source.fixAll.biome": true
    }
}

Continuous integration (CI) 🚧

https://biomejs.dev/recipes/continuous-integration/


🎗️ License

This project is released under the MIT License. For more details, refer to the LICENSE file.


🙌 Acknowledgements