@dvashim/biome-config 1.5.4 → 1.5.6
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 +73 -3
- package/dist/biome.recommended.jsonc +0 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,20 @@
|
|
|
1
1
|
# Biome Configurations
|
|
2
2
|
|
|
3
|
-
[![
|
|
3
|
+
[![CI][ci-badge]][ci-url]
|
|
4
|
+
[![npm version][version-badge]][npm-url]
|
|
5
|
+
[![npm downloads][downloads-badge]][npm-url]
|
|
6
|
+
[![license][license-badge]][license-url]
|
|
7
|
+
[![Checked with Biome][biome-badge]][biome-url]
|
|
8
|
+
|
|
9
|
+
[ci-badge]: https://img.shields.io/github/actions/workflow/status/dvashim/biome-config/check.yml?style=flat-square&logo=github&label=CI
|
|
10
|
+
[ci-url]: https://github.com/dvashim/biome-config/actions/workflows/check.yml
|
|
11
|
+
[version-badge]: https://img.shields.io/npm/v/@dvashim/biome-config.svg?logo=npm&style=flat-square&color=07c&label=@dvashim/biome-config
|
|
12
|
+
[downloads-badge]: https://img.shields.io/npm/dm/@dvashim/biome-config?logo=npm&style=flat-square&color=07c
|
|
13
|
+
[npm-url]: https://www.npmjs.com/package/@dvashim/biome-config
|
|
14
|
+
[license-badge]: https://img.shields.io/npm/l/@dvashim/biome-config?style=flat-square&color=07c
|
|
15
|
+
[license-url]: https://github.com/dvashim/biome-config/blob/main/LICENSE
|
|
16
|
+
[biome-badge]: https://img.shields.io/badge/Checked_with-Biome-60a5fa?style=flat-square&logo=biome&color=07c&logoColor=fff
|
|
17
|
+
[biome-url]: https://biomejs.dev
|
|
4
18
|
|
|
5
19
|
## Installation
|
|
6
20
|
|
|
@@ -36,6 +50,8 @@ Base recommended configuration:
|
|
|
36
50
|
// This configuration provides a base setup for linting,
|
|
37
51
|
// formatting, and code consistency across JavaScript,
|
|
38
52
|
// JSX, JSON, and HTML files.
|
|
53
|
+
// No files.includes is set — Biome will process all supported
|
|
54
|
+
// files in the project directory by default.
|
|
39
55
|
|
|
40
56
|
{
|
|
41
57
|
"extends": ["@dvashim/biome-config"]
|
|
@@ -47,7 +63,8 @@ React recommended configuration:
|
|
|
47
63
|
```jsonc
|
|
48
64
|
// biome.json (React recommended)
|
|
49
65
|
// This configuration extends the base recommended configuration
|
|
50
|
-
// and enables the recommended rules for the React domain
|
|
66
|
+
// and enables the recommended rules for the React domain.
|
|
67
|
+
// Includes all files except dist/ (files.includes: ["**", "!!**/dist"]).
|
|
51
68
|
|
|
52
69
|
{
|
|
53
70
|
"extends": ["@dvashim/biome-config/react-recommended"]
|
|
@@ -61,6 +78,7 @@ React strict configuration:
|
|
|
61
78
|
// This configuration enables recommended lint rules,
|
|
62
79
|
// including React-specific recommended rules,
|
|
63
80
|
// and opts into nursery (experimental) rules.
|
|
81
|
+
// Includes all files except dist/ (files.includes: ["**", "!!**/dist"]).
|
|
64
82
|
|
|
65
83
|
{
|
|
66
84
|
"extends": ["@dvashim/biome-config/react-strict"]
|
|
@@ -75,6 +93,7 @@ React balanced configuration:
|
|
|
75
93
|
// including React-specific recommended rules,
|
|
76
94
|
// with a few rules intentionally disabled
|
|
77
95
|
// to reduce false positives / noise.
|
|
96
|
+
// Includes all files except dist/ (files.includes: ["**", "!!**/dist"]).
|
|
78
97
|
|
|
79
98
|
{
|
|
80
99
|
"extends": ["@dvashim/biome-config/react-balanced"]
|
|
@@ -136,7 +155,7 @@ All configurations share the same base defaults.
|
|
|
136
155
|
|--------|-------|
|
|
137
156
|
| experimentalFullSupportEnabled | `true` |
|
|
138
157
|
|
|
139
|
-
### Files
|
|
158
|
+
### Files (React configs only)
|
|
140
159
|
|
|
141
160
|
| Option | Value |
|
|
142
161
|
|--------|-------|
|
|
@@ -231,3 +250,54 @@ Same rule set as strict, with **targeted relaxations** to reduce false positives
|
|
|
231
250
|
| `noMagicNumbers` | warn | info | Informational only |
|
|
232
251
|
| `noNestedTernary` | warn | off | Allows nested ternaries |
|
|
233
252
|
| `useNamingConvention` | strictCase: true | strictCase: false | More lenient casing |
|
|
253
|
+
|
|
254
|
+
## FAQ
|
|
255
|
+
|
|
256
|
+
### Which config should I start with?
|
|
257
|
+
|
|
258
|
+
- **Non-React projects** — use `@dvashim/biome-config` (base recommended).
|
|
259
|
+
- **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.
|
|
260
|
+
|
|
261
|
+
### How do I override a rule from the preset?
|
|
262
|
+
|
|
263
|
+
Add a `linter.rules` section in your `biome.json`. Local settings merge with and take precedence over the preset:
|
|
264
|
+
|
|
265
|
+
```jsonc
|
|
266
|
+
{
|
|
267
|
+
"extends": ["@dvashim/biome-config/react-balanced"],
|
|
268
|
+
"linter": {
|
|
269
|
+
"rules": {
|
|
270
|
+
"style": {
|
|
271
|
+
"noDefaultExport": "error"
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
```
|
|
277
|
+
|
|
278
|
+
### How do I exclude additional files or directories?
|
|
279
|
+
|
|
280
|
+
The simplest approach is to add paths to your `.gitignore` — all presets enable `vcs.useIgnoreFile`, so Biome respects `.gitignore` patterns automatically.
|
|
281
|
+
|
|
282
|
+
For exclusions that should not affect Git tracking, use negated patterns in `files.includes`. The `!!` prefix force-ignores paths (prevents scanning entirely), while `!` excludes matches from results:
|
|
283
|
+
|
|
284
|
+
```jsonc
|
|
285
|
+
{
|
|
286
|
+
"extends": ["@dvashim/biome-config"],
|
|
287
|
+
"files": {
|
|
288
|
+
"includes": ["**", "!!**/generated", "!!**/coverage"]
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
### Why does the base config not set `files.includes`?
|
|
294
|
+
|
|
295
|
+
The base recommended config intentionally omits `files.includes` so consumers control their own file scope. Biome processes all supported files by default when no `includes` is set. The React configs set `files.includes` to `["**", "!!**/dist"]` to explicitly exclude build output.
|
|
296
|
+
|
|
297
|
+
### Can I use this with TypeScript?
|
|
298
|
+
|
|
299
|
+
Yes. Biome natively supports TypeScript — no additional configuration is needed. All presets apply to `.ts` and `.tsx` files automatically.
|
|
300
|
+
|
|
301
|
+
### Can I use this in a monorepo?
|
|
302
|
+
|
|
303
|
+
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.
|