@nesvet/biome-config 1.0.0 → 2.0.0

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 CHANGED
@@ -1,92 +1,30 @@
1
1
  # @nesvet/biome-config
2
2
 
3
- Shareable [Biome](https://biomejs.dev/) configuration: formatter, linter, and import organization.
3
+ [![CI](https://github.com/nesvet/biome-config/actions/workflows/ci.yaml/badge.svg)](https://github.com/nesvet/biome-config/actions/workflows/ci.yaml)
4
+ [![npm](https://img.shields.io/npm/v/@nesvet/biome-config)](https://www.npmjs.com/package/@nesvet/biome-config)
4
5
 
5
- Requires `@biomejs/biome` `>=2.4.0` (peer dependency).
6
+ My [Biome](https://biomejs.dev/) config. Tabs, double quotes, `type` over `interface`, no trailing commas, almost no wrapping (`lineWidth: 320`).
6
7
 
7
- ## Installation
8
+ Needs `@biomejs/biome` `^2.5.0`.
8
9
 
9
10
  ```sh
10
11
  bun add -d @nesvet/biome-config @biomejs/biome
11
12
  ```
12
13
 
13
- Or:
14
-
15
- ```sh
16
- npm install -D @nesvet/biome-config @biomejs/biome
17
- ```
18
-
19
- ## Setup
20
-
21
- **Node.js / CLI / backend** — `node:` import protocol enforced:
22
-
23
14
  ```json
24
15
  {
25
16
  "$schema": "./node_modules/@biomejs/biome/configuration_schema.json",
26
- "extends": ["@nesvet/biome-config/node"],
27
- "vcs": {
28
- "enabled": true,
29
- "clientKind": "git",
30
- "useIgnoreFile": true
31
- }
32
- }
33
- ```
34
-
35
- **Bun, browser, or generic TypeScript** — base config without `node:` protocol rule:
36
-
37
- ```json
38
- {
39
- "$schema": "./node_modules/@biomejs/biome/configuration_schema.json",
40
- "extends": ["@nesvet/biome-config"],
41
- "vcs": {
42
- "enabled": true,
43
- "clientKind": "git",
44
- "useIgnoreFile": true
45
- }
46
- }
47
- ```
48
-
49
- With `useIgnoreFile: true`, paths from `.gitignore` (including `node_modules/`) are skipped.
50
-
51
- Optional explicit exclusions:
52
-
53
- ```json
54
- {
55
- "files": {
56
- "includes": ["**", "!dist/**", "!build/**", "!out/**", "!**/*.min.js"]
57
- }
17
+ "extends": ["@nesvet/biome-config/node"]
58
18
  }
59
19
  ```
60
20
 
61
- Do **not** append `/biome.json` to `extends` — use the package export name only (for example `@nesvet/biome-config/node`).
62
-
63
- ## Exports
64
-
65
- | Export | Use case |
66
- |--------|----------|
67
- | `@nesvet/biome-config` | Base — formatter, linter, imports; no `node:` protocol requirement |
68
- | `@nesvet/biome-config/node` | Base + `useNodejsImportProtocol: error` |
69
-
70
- React and a11y rules apply to `**/*.{jsx,tsx}` in the base config.
21
+ `/node` requires the `node:` import protocol. Drop `/node` if you don't want that.
71
22
 
72
- ## Package defaults
23
+ `Bun` is a known global. Imports are grouped (bun/node, packages, aliases, paths, CSS) with no blank lines between groups. Floating Promises are errors. CommonJS is an error. JSX files get React and a11y rules even if `react` is not in `package.json`.
73
24
 
74
- - **`formatter.lineWidth: 320`** — no practical line wrapping; override locally for shorter lines.
75
- - **`files.ignoreUnknown: true`** — no diagnostics for unknown file types (monorepo-friendly).
76
- - **Import groups** — `:BUN:` / `:NODE:`, packages, aliases, relative paths (`organizeImports`).
77
- - **`noDefaultExport`** — warn.
25
+ Do not append `/biome.json` to `extends`.
78
26
 
79
- ## Monorepo
80
-
81
- Root `biome.json` (Node backend example):
82
-
83
- ```json
84
- {
85
- "extends": ["@nesvet/biome-config/node"]
86
- }
87
- ```
88
-
89
- Package `biome.json`:
27
+ Monorepo package:
90
28
 
91
29
  ```json
92
30
  {
@@ -94,21 +32,11 @@ Package `biome.json`:
94
32
  }
95
33
  ```
96
34
 
97
- ## Local overrides
98
-
99
- **Org-scoped import groups** — merge `assist.actions.source.organizeImports.options.groups` in your `biome.json` (see [organize imports](https://biomejs.dev/assist/actions/organize-imports/)).
100
-
101
- **Runtime globals** (`Bun`, `window`, `self`):
35
+ Override anything in your own `biome.json`.
102
36
 
103
- ```json
104
- {
105
- "javascript": {
106
- "globals": ["Bun", "window", "self"]
107
- }
108
- }
109
- ```
37
+ ## Contributing
110
38
 
111
- **Unused bindings** — prefix with `_` (for example `_unused`); Biome ignores them in unused-variable rules.
39
+ [CONTRIBUTING.md](CONTRIBUTING.md)
112
40
 
113
41
  ## License
114
42
 
package/biome.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "$schema": "./node_modules/@biomejs/biome/configuration_schema.json",
2
+ "$schema": "https://biomejs.dev/schemas/2.5.9/schema.json",
3
3
  "files": {
4
4
  "ignoreUnknown": true
5
5
  },
@@ -10,10 +10,11 @@
10
10
  "lineEnding": "lf"
11
11
  },
12
12
  "javascript": {
13
+ "globals": ["Bun"],
13
14
  "formatter": {
14
15
  "quoteStyle": "double",
15
16
  "semicolons": "always",
16
- "trailingCommas": "all",
17
+ "trailingCommas": "none",
17
18
  "arrowParentheses": "asNeeded",
18
19
  "bracketSpacing": true
19
20
  }
@@ -21,8 +22,7 @@
21
22
  "json": {
22
23
  "formatter": {
23
24
  "enabled": true,
24
- "indentStyle": "tab",
25
- "lineWidth": 320
25
+ "trailingCommas": "none"
26
26
  },
27
27
  "linter": {
28
28
  "enabled": true
@@ -35,7 +35,8 @@
35
35
  "organizeImports": {
36
36
  "level": "on",
37
37
  "options": {
38
- "groups": [[":BUN:", ":NODE:"], ":BLANK_LINE:", ":PACKAGE:", ":BLANK_LINE:", ":ALIAS:", ":BLANK_LINE:", ":PATH:"]
38
+ "sortBareImports": true,
39
+ "groups": [[":BUN:", ":NODE:"], ":PACKAGE:", ":ALIAS:", ":PATH:", ":STYLE:"]
39
40
  }
40
41
  }
41
42
  }
@@ -43,13 +44,23 @@
43
44
  },
44
45
  "linter": {
45
46
  "enabled": true,
47
+ "domains": {
48
+ "types": "all"
49
+ },
46
50
  "rules": {
47
- "recommended": true,
51
+ "preset": "recommended",
48
52
  "complexity": {
49
53
  "noForEach": "warn"
50
54
  },
51
55
  "nursery": {
52
- "noImpliedEval": "error"
56
+ "noFloatingPromises": "error",
57
+ "noImpliedEval": "error",
58
+ "noInvalidPropertyInitValue": "error",
59
+ "noLoopFunc": "warn",
60
+ "noMisusedPromises": "error",
61
+ "useAwaitThenable": "error",
62
+ "useDomNodeTextContent": "warn",
63
+ "useMathMinMax": "warn"
53
64
  },
54
65
  "security": {
55
66
  "noGlobalEval": "error"
@@ -70,10 +81,19 @@
70
81
  }
71
82
  },
72
83
  "style": {
84
+ "noCommonJs": "error",
73
85
  "noParameterAssign": "error",
74
86
  "useArrayLiterals": "warn",
75
87
  "useBlockStatements": "error",
76
88
  "useConst": "warn",
89
+ "useConsistentTypeDefinitions": {
90
+ "level": "error",
91
+ "options": {
92
+ "style": "type"
93
+ }
94
+ },
95
+ "useExportType": "error",
96
+ "useImportType": "error",
77
97
  "useNamingConvention": {
78
98
  "level": "error",
79
99
  "options": {
@@ -117,6 +137,9 @@
117
137
  ]
118
138
  }
119
139
  },
140
+ "useErrorCause": "warn",
141
+ "useNodejsImportProtocol": "off",
142
+ "useThrowNewError": "error",
120
143
  "useThrowOnlyError": "error",
121
144
  "noDefaultExport": "warn"
122
145
  },
@@ -127,6 +150,8 @@
127
150
  "allow": ["info", "warn", "error", "group", "groupEnd"]
128
151
  }
129
152
  },
153
+ "noEvolvingTypes": "warn",
154
+ "noUnassignedVariables": "error",
130
155
  "noDoubleEquals": {
131
156
  "level": "error",
132
157
  "options": {
@@ -166,9 +191,7 @@
166
191
  "includes": ["**/*.{jsonc,json5}"],
167
192
  "json": {
168
193
  "formatter": {
169
- "enabled": true,
170
- "indentStyle": "tab",
171
- "lineWidth": 320
194
+ "enabled": true
172
195
  },
173
196
  "linter": {
174
197
  "enabled": true
package/package.json CHANGED
@@ -1,21 +1,28 @@
1
1
  {
2
2
  "name": "@nesvet/biome-config",
3
- "version": "1.0.0",
4
- "description": "Nesvet Biome config",
3
+ "version": "2.0.0",
4
+ "description": "Shareable Biome config: formatter, linter, import organization, type-aware rules",
5
5
  "keywords": [
6
6
  "biome",
7
7
  "config",
8
- "nesvet"
8
+ "formatter",
9
+ "linter",
10
+ "shareable-config"
9
11
  ],
12
+ "homepage": "https://github.com/nesvet/biome-config#readme",
13
+ "bugs": {
14
+ "url": "https://github.com/nesvet/biome-config/issues"
15
+ },
10
16
  "repository": {
11
17
  "type": "git",
12
18
  "url": "git+https://github.com/nesvet/biome-config.git"
13
19
  },
14
20
  "license": "MIT",
15
- "publishConfig": {
16
- "access": "public"
17
- },
18
21
  "author": "Eugene Nesvetaev <dev@nesvet.dev> (https://nesvet.dev/)",
22
+ "funding": {
23
+ "type": "patreon",
24
+ "url": "https://www.patreon.com/nesvet"
25
+ },
19
26
  "type": "module",
20
27
  "exports": {
21
28
  ".": "./biome.json",
@@ -27,20 +34,19 @@
27
34
  "README.md",
28
35
  "LICENSE"
29
36
  ],
37
+ "publishConfig": {
38
+ "access": "public"
39
+ },
30
40
  "scripts": {
31
41
  "check": "biome check biome.json presets scripts",
32
42
  "check:fix": "biome check --write biome.json presets scripts",
33
- "check:tests": "node scripts/verify-fixtures.mjs"
43
+ "check:tests": "bun scripts/verify-fixtures.ts"
34
44
  },
35
45
  "peerDependencies": {
36
- "@biomejs/biome": ">=2.4.0"
46
+ "@biomejs/biome": "^2.5.0"
37
47
  },
38
48
  "devDependencies": {
39
- "@biomejs/biome": "^2.4.16"
49
+ "@biomejs/biome": "^2.5.9"
40
50
  },
41
- "packageManager": "bun@1.3.14",
42
- "engines": {
43
- "node": ">=22",
44
- "bun": ">=1.3"
45
- }
51
+ "packageManager": "bun@1.4.0"
46
52
  }
package/presets/node.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "$schema": "../node_modules/@biomejs/biome/configuration_schema.json",
2
+ "$schema": "https://biomejs.dev/schemas/2.5.9/schema.json",
3
3
  "extends": ["../biome.json"],
4
4
  "linter": {
5
5
  "rules": {