https://github.com/cxa/lsp-biome
lsp-mode client for Biome
https://github.com/cxa/lsp-biome
Last synced: 4 months ago
JSON representation
lsp-mode client for Biome
- Host: GitHub
- URL: https://github.com/cxa/lsp-biome
- Owner: cxa
- Created: 2024-01-01T05:12:17.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2025-01-10T11:57:44.000Z (over 1 year ago)
- Last Synced: 2025-01-10T12:46:57.648Z (over 1 year ago)
- Language: Emacs Lisp
- Homepage:
- Size: 28.3 KB
- Stars: 11
- Watchers: 2
- Forks: 3
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
> [!NOTE]
> If you like to run `biome` with Eglot, check out .
# lsp-biome
**lsp-mode client for [Biome](https://biomejs.dev/)**.
## Installation
To integrate `lsp-biome` into your Emacs setup, you can take either:
1. Clone this repo, add the `lsp-biome.el` file to your Emacs `load-path`.
```elisp
(add-to-list 'load-path "/path/to/lsp-biome/")
```
Replace "/path/to/lsp-biome/" with the actual path to the `lsp-biome` directory.
2. Alternatively, if you're using a package manager like `use-package` with `quelpa`, add the following configuration:
```elisp
(use-package lsp-biome
:vc (:url "https://github.com/cxa/lsp-biome" :rev :newest))
;; or :quelpa (lsp-biome :fetcher github :repo "cxa/lsp-biome")) if are using Emacs below 30
```
## Configuration
Customize the behavior of `lsp-biome` using the following configuration options:
- `lsp-biome-active-file-types`: file types that `lsp-biome` should activate, default is:
```elsip
(list (rx "." (or "tsx" "jsx"
"ts" "js"
"mts" "mjs"
"cts" "cjs"
"json" "jsonc"
"css")
eos)
```
- `lsp-biome-active-hook`: Hooks to run after activation, default is `nil`. See below for a usage example.
## Commands
Explore the following commands provided by `lsp-biome`:
- **`lsp-biome-organize-imports`**: Organize imports in the current buffer.
- **`lsp-biome-fix-all`**: Apply automatic code fixes in current buffer.
## Tips
Use with `apheleia`:
``` elsip
(use-package lsp-biome
:vc (:url "https://github.com/cxa/lsp-biome" :rev :newest)
:preface
(defun my/lsp-biome-active-hook ()
(setq-local apheleia-formatter '(biome)))
:config
(add-hook 'lsp-biome-active-hook #'my/lsp-biome-active-hook))
```
## Notice
To use `lsp-biome`, you must install `biome` either within your project or globally (ensure that Emacs can locate your `biome` in the `$PATH`).