@dvashim/biome-config 1.9.0 → 1.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +61 -96
- package/dist/biome.react-balanced-stable.json +1 -1
- package/dist/biome.react-balanced.json +1 -1
- package/dist/biome.react-recommended.json +1 -1
- package/dist/biome.react-strict-stable.json +1 -1
- package/dist/biome.react-strict.json +1 -1
- package/dist/biome.recommended.json +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# Biome Configurations
|
|
2
2
|
|
|
3
|
+
Shared [Biome](https://biomejs.dev) configuration presets — a base recommended config plus a family of React presets (`recommended`, `strict`, `balanced`, and nursery-free `-stable` variants) that you extend in your own `biome.json`.
|
|
4
|
+
|
|
3
5
|
[![CI][ci-badge]][ci-url]
|
|
4
6
|
[![npm version][version-badge]][npm-url]
|
|
5
7
|
[![npm downloads][downloads-badge]][npm-url]
|
|
@@ -19,123 +21,63 @@
|
|
|
19
21
|
[socket-badge]: https://socket.dev/api/badge/npm/package/@dvashim/biome-config
|
|
20
22
|
[socket-url]: https://socket.dev/npm/package/@dvashim/biome-config
|
|
21
23
|
|
|
24
|
+
## Table of Contents
|
|
25
|
+
|
|
26
|
+
- [Installation](#installation)
|
|
27
|
+
- [Configurations](#configurations)
|
|
28
|
+
- [Usage](#usage)
|
|
29
|
+
- [Defaults](#defaults)
|
|
30
|
+
- [Rules](#rules)
|
|
31
|
+
- [FAQ](#faq)
|
|
32
|
+
- [Contributing](#contributing)
|
|
33
|
+
- [License](#license)
|
|
34
|
+
|
|
22
35
|
## Installation
|
|
23
36
|
|
|
37
|
+
Install the presets together with [Biome](https://biomejs.dev) (which is not bundled) as dev dependencies.
|
|
38
|
+
|
|
24
39
|
npm:
|
|
25
40
|
|
|
26
41
|
```bash
|
|
27
|
-
npm install -D @dvashim/biome-config
|
|
42
|
+
npm install -D @dvashim/biome-config @biomejs/biome
|
|
28
43
|
```
|
|
29
44
|
|
|
30
45
|
or pnpm:
|
|
31
46
|
|
|
32
47
|
```bash
|
|
33
|
-
pnpm add -D @dvashim/biome-config
|
|
48
|
+
pnpm add -D @dvashim/biome-config @biomejs/biome
|
|
34
49
|
```
|
|
35
50
|
|
|
51
|
+
> **Requirements:** Biome **2.4.16+** (the version these presets target) and Node.js **>= 24**.
|
|
52
|
+
|
|
36
53
|
## Configurations
|
|
37
54
|
|
|
38
55
|
| Domain | Level | Path |
|
|
39
|
-
|
|
40
|
-
| Base | recommended | `@dvashim/biome-config` or `@dvashim/biome-config/recommended` |
|
|
41
|
-
| React | recommended | `@dvashim/biome-config/react-recommended` |
|
|
42
|
-
| React | strict | `@dvashim/biome-config/react-strict` |
|
|
43
|
-
| React | strict-stable | `@dvashim/biome-config/react-strict-stable` |
|
|
44
|
-
| React | balanced | `@dvashim/biome-config/react-balanced` |
|
|
45
|
-
| React | balanced-stable | `@dvashim/biome-config/react-balanced-stable` |
|
|
56
|
+
|--------|-------|------|
|
|
57
|
+
| Base | [recommended](#base-recommended) | `@dvashim/biome-config` or `@dvashim/biome-config/recommended` |
|
|
58
|
+
| React | [recommended](#react-recommended) | `@dvashim/biome-config/react-recommended` |
|
|
59
|
+
| React | [strict](#react-strict) | `@dvashim/biome-config/react-strict` |
|
|
60
|
+
| React | [strict-stable](#react-strict-stable) | `@dvashim/biome-config/react-strict-stable` |
|
|
61
|
+
| React | [balanced](#react-balanced) | `@dvashim/biome-config/react-balanced` |
|
|
62
|
+
| React | [balanced-stable](#react-balanced-stable) | `@dvashim/biome-config/react-balanced-stable` |
|
|
46
63
|
|
|
64
|
+
_Not sure which to pick? See [Which config should I start with?](#which-config-should-i-start-with) in the FAQ._
|
|
47
65
|
|
|
48
|
-
##
|
|
66
|
+
## Usage
|
|
49
67
|
|
|
50
|
-
|
|
68
|
+
Add a `biome.json` to your project root and extend a preset. The only line you change between presets is the `extends` path:
|
|
51
69
|
|
|
52
70
|
```jsonc
|
|
53
|
-
// biome.json
|
|
54
|
-
// ────────────────────────────────────────
|
|
55
|
-
// This configuration provides a base setup for linting,
|
|
56
|
-
// formatting, and code consistency across JavaScript,
|
|
57
|
-
// JSX, JSON, and HTML files.
|
|
58
|
-
// No files.includes is set — Biome will process all supported
|
|
59
|
-
// files in the project directory by default.
|
|
60
|
-
|
|
71
|
+
// biome.json
|
|
61
72
|
{
|
|
62
73
|
"$schema": "https://biomejs.dev/schemas/latest/schema.json",
|
|
63
74
|
"extends": ["@dvashim/biome-config"]
|
|
64
75
|
}
|
|
65
76
|
```
|
|
66
77
|
|
|
67
|
-
React
|
|
68
|
-
|
|
69
|
-
```jsonc
|
|
70
|
-
// biome.json (React recommended)
|
|
71
|
-
// ────────────────────────────────────────
|
|
72
|
-
// This configuration extends the base recommended configuration
|
|
73
|
-
// and enables the recommended rules for the React domain.
|
|
74
|
-
// Includes all files except dist/ (files.includes: ["**", "!!**/dist"]).
|
|
75
|
-
|
|
76
|
-
{
|
|
77
|
-
"$schema": "https://biomejs.dev/schemas/latest/schema.json",
|
|
78
|
-
"extends": ["@dvashim/biome-config/react-recommended"]
|
|
79
|
-
}
|
|
80
|
-
```
|
|
81
|
-
|
|
82
|
-
React strict configuration:
|
|
78
|
+
To use a different preset, swap the `extends` value for any path from the [Configurations](#configurations) table above — for example `"@dvashim/biome-config/react-balanced"`. The React presets automatically exclude build output (`files.includes: ["**", "!!**/dist"]`); the base preset sets no `files.includes`, so Biome processes all supported files by default.
|
|
83
79
|
|
|
84
|
-
|
|
85
|
-
// biome.json (React strict)
|
|
86
|
-
// ────────────────────────────────────────
|
|
87
|
-
// The most opinionated configuration — enables recommended rules,
|
|
88
|
-
// React-specific rules, and 200+ optional and nursery (experimental) rules.
|
|
89
|
-
// Includes all files except dist/ (files.includes: ["**", "!!**/dist"]).
|
|
90
|
-
|
|
91
|
-
{
|
|
92
|
-
"$schema": "https://biomejs.dev/schemas/latest/schema.json",
|
|
93
|
-
"extends": ["@dvashim/biome-config/react-strict"]
|
|
94
|
-
}
|
|
95
|
-
```
|
|
96
|
-
|
|
97
|
-
React strict-stable configuration:
|
|
98
|
-
|
|
99
|
-
```jsonc
|
|
100
|
-
// biome.json (React strict-stable)
|
|
101
|
-
// ────────────────────────────────────────
|
|
102
|
-
// Same as React strict, but without nursery (experimental) rules.
|
|
103
|
-
// Includes all files except dist/ (files.includes: ["**", "!!**/dist"]).
|
|
104
|
-
|
|
105
|
-
{
|
|
106
|
-
"$schema": "https://biomejs.dev/schemas/latest/schema.json",
|
|
107
|
-
"extends": ["@dvashim/biome-config/react-strict-stable"]
|
|
108
|
-
}
|
|
109
|
-
```
|
|
110
|
-
|
|
111
|
-
React balanced configuration:
|
|
112
|
-
|
|
113
|
-
```jsonc
|
|
114
|
-
// biome.json (React balanced)
|
|
115
|
-
// ────────────────────────────────────────
|
|
116
|
-
// Same as React strict, with targeted relaxations
|
|
117
|
-
// to reduce false positives / noise.
|
|
118
|
-
// Includes all files except dist/ (files.includes: ["**", "!!**/dist"]).
|
|
119
|
-
|
|
120
|
-
{
|
|
121
|
-
"$schema": "https://biomejs.dev/schemas/latest/schema.json",
|
|
122
|
-
"extends": ["@dvashim/biome-config/react-balanced"]
|
|
123
|
-
}
|
|
124
|
-
```
|
|
125
|
-
|
|
126
|
-
React balanced-stable configuration:
|
|
127
|
-
|
|
128
|
-
```jsonc
|
|
129
|
-
// biome.json (React balanced-stable)
|
|
130
|
-
// ────────────────────────────────────────
|
|
131
|
-
// Same as React balanced, but without nursery (experimental) rules.
|
|
132
|
-
// Includes all files except dist/ (files.includes: ["**", "!!**/dist"]).
|
|
133
|
-
|
|
134
|
-
{
|
|
135
|
-
"$schema": "https://biomejs.dev/schemas/latest/schema.json",
|
|
136
|
-
"extends": ["@dvashim/biome-config/react-balanced-stable"]
|
|
137
|
-
}
|
|
138
|
-
```
|
|
80
|
+
> The examples use the `latest` schema URL for convenience. To match a preset exactly and silence editor warnings about unknown fields, pin it to the version shown under [Defaults → Schema](#schema).
|
|
139
81
|
|
|
140
82
|
## Defaults
|
|
141
83
|
|
|
@@ -143,7 +85,7 @@ All configurations share the same base defaults.
|
|
|
143
85
|
|
|
144
86
|
### Schema
|
|
145
87
|
|
|
146
|
-
`https://biomejs.dev/schemas/2.4.
|
|
88
|
+
`https://biomejs.dev/schemas/2.4.16/schema.json`
|
|
147
89
|
|
|
148
90
|
### Formatter
|
|
149
91
|
|
|
@@ -209,10 +151,10 @@ All configurations share the same base defaults.
|
|
|
209
151
|
|
|
210
152
|
### Overrides
|
|
211
153
|
|
|
212
|
-
| File pattern
|
|
213
|
-
|
|
214
|
-
| `**/package.json` | assist.actions.source.useSortedKeys
|
|
215
|
-
| `**/package.json` | json.formatter.expand
|
|
154
|
+
| File pattern | Setting | Value |
|
|
155
|
+
|------|---------|-------|
|
|
156
|
+
| `**/package.json` | assist.actions.source.useSortedKeys | `"off"` |
|
|
157
|
+
| `**/package.json` | json.formatter.expand | `"always"` |
|
|
216
158
|
|
|
217
159
|
### Assist
|
|
218
160
|
|
|
@@ -239,7 +181,7 @@ Same as base recommended, plus enables the **React domain** (`"react": "recommen
|
|
|
239
181
|
|
|
240
182
|
The most opinionated configuration. Enables all recommended rules plus **200+ optional and nursery rules** across 8 categories. Every non-recommended JS/TS rule available in Biome is explicitly configured.
|
|
241
183
|
|
|
242
|
-
- **a11y** — Selectively disables noisy rules (`useButtonType`, `useKeyWithClickEvents`, `useSemanticElements`, `noStaticElementInteractions`, `noNoninteractiveElementToInteractiveRole`) while keeping the rest at recommended defaults.
|
|
184
|
+
- **a11y** — Selectively disables noisy rules (`useButtonType`, `useKeyWithClickEvents`, `useSemanticElements`, `noStaticElementInteractions`, `noNoninteractiveElementToInteractiveRole`) and downgrades `useFocusableInteractive` to `info`, while keeping the rest at recommended defaults.
|
|
243
185
|
|
|
244
186
|
- **complexity** (12 rules) — Monitors cognitive complexity, function length, nested test suites, and logic expressions. Warns on `forEach`, implicit coercions, `void`, and useless patterns.
|
|
245
187
|
|
|
@@ -317,6 +259,16 @@ Same as React balanced, but **without nursery (experimental) rules**. All non-nu
|
|
|
317
259
|
- **Non-React projects** — use `@dvashim/biome-config` (base recommended).
|
|
318
260
|
- **React projects** — start with `react-balanced` for a good trade-off between strictness and practicality. Move to `react-strict` once your codebase is clean, or `react-recommended` if you only want Biome's built-in defaults. Use the `-stable` variants if you want to avoid nursery (experimental) rules.
|
|
319
261
|
|
|
262
|
+
### What version of Biome and Node do I need?
|
|
263
|
+
|
|
264
|
+
These presets are built and tested against **Biome 2.4.16** — the version their `$schema` is pinned to (see [Defaults → Schema](#schema)) — and require **Node.js >= 24**. Biome is not bundled, so install a compatible version yourself:
|
|
265
|
+
|
|
266
|
+
```bash
|
|
267
|
+
pnpm add -D @biomejs/biome@^2.4.16
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
The `$schema` in the examples uses `.../schemas/latest/schema.json` for convenience; pin it to `.../schemas/2.4.16/schema.json` to match the presets exactly and silence editor warnings about unknown fields.
|
|
271
|
+
|
|
320
272
|
### How do I override a rule from the preset?
|
|
321
273
|
|
|
322
274
|
Add a `linter.rules` section in your `biome.json`. Local settings merge with and take precedence over the preset:
|
|
@@ -362,3 +314,16 @@ Yes. Biome natively supports TypeScript — no additional configuration is neede
|
|
|
362
314
|
### Can I use this in a monorepo?
|
|
363
315
|
|
|
364
316
|
Yes. Install the package at the root and reference it in each workspace's `biome.json`. Each workspace can extend a different preset and add its own overrides.
|
|
317
|
+
|
|
318
|
+
## Contributing
|
|
319
|
+
|
|
320
|
+
Issues and pull requests are welcome. The repo uses [pnpm](https://pnpm.io) and [Changesets](https://github.com/changesets/changesets):
|
|
321
|
+
|
|
322
|
+
1. `pnpm install`
|
|
323
|
+
2. Edit the presets in `dist/` — they are checked in directly, so there is no build step. After changing `react-strict` or `react-balanced`, run `pnpm run sync-stable` to regenerate the `-stable` variants.
|
|
324
|
+
3. `pnpm run check` to validate formatting, package exports, and `-stable` sync.
|
|
325
|
+
4. `pnpm changeset` to record a user-facing change.
|
|
326
|
+
|
|
327
|
+
## License
|
|
328
|
+
|
|
329
|
+
[MIT](LICENSE)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dvashim/biome-config",
|
|
3
|
-
"version": "1.9.
|
|
3
|
+
"version": "1.9.1",
|
|
4
4
|
"description": "Shared Biome Configurations",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"biome",
|
|
@@ -46,10 +46,10 @@
|
|
|
46
46
|
"dist"
|
|
47
47
|
],
|
|
48
48
|
"devDependencies": {
|
|
49
|
-
"@biomejs/biome": "^2.4.
|
|
49
|
+
"@biomejs/biome": "^2.4.16",
|
|
50
50
|
"@changesets/changelog-github": "^0.7.0",
|
|
51
51
|
"@changesets/cli": "^2.31.0",
|
|
52
|
-
"validate-package-exports": "^0.
|
|
52
|
+
"validate-package-exports": "^1.0.0"
|
|
53
53
|
},
|
|
54
54
|
"engines": {
|
|
55
55
|
"node": ">=24"
|