@nesvet/biome-config 1.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Eugene Nesvetaev
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,115 @@
1
+ # @nesvet/biome-config
2
+
3
+ Shareable [Biome](https://biomejs.dev/) configuration: formatter, linter, and import organization.
4
+
5
+ Requires `@biomejs/biome` `>=2.4.0` (peer dependency).
6
+
7
+ ## Installation
8
+
9
+ ```sh
10
+ bun add -d @nesvet/biome-config @biomejs/biome
11
+ ```
12
+
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
+ ```json
24
+ {
25
+ "$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
+ }
58
+ }
59
+ ```
60
+
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.
71
+
72
+ ## Package defaults
73
+
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.
78
+
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`:
90
+
91
+ ```json
92
+ {
93
+ "extends": "//"
94
+ }
95
+ ```
96
+
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`):
102
+
103
+ ```json
104
+ {
105
+ "javascript": {
106
+ "globals": ["Bun", "window", "self"]
107
+ }
108
+ }
109
+ ```
110
+
111
+ **Unused bindings** — prefix with `_` (for example `_unused`); Biome ignores them in unused-variable rules.
112
+
113
+ ## License
114
+
115
+ MIT
package/biome.json ADDED
@@ -0,0 +1,179 @@
1
+ {
2
+ "$schema": "./node_modules/@biomejs/biome/configuration_schema.json",
3
+ "files": {
4
+ "ignoreUnknown": true
5
+ },
6
+ "formatter": {
7
+ "enabled": true,
8
+ "indentStyle": "tab",
9
+ "lineWidth": 320,
10
+ "lineEnding": "lf"
11
+ },
12
+ "javascript": {
13
+ "formatter": {
14
+ "quoteStyle": "double",
15
+ "semicolons": "always",
16
+ "trailingCommas": "all",
17
+ "arrowParentheses": "asNeeded",
18
+ "bracketSpacing": true
19
+ }
20
+ },
21
+ "json": {
22
+ "formatter": {
23
+ "enabled": true,
24
+ "indentStyle": "tab",
25
+ "lineWidth": 320
26
+ },
27
+ "linter": {
28
+ "enabled": true
29
+ }
30
+ },
31
+ "assist": {
32
+ "enabled": true,
33
+ "actions": {
34
+ "source": {
35
+ "organizeImports": {
36
+ "level": "on",
37
+ "options": {
38
+ "groups": [[":BUN:", ":NODE:"], ":BLANK_LINE:", ":PACKAGE:", ":BLANK_LINE:", ":ALIAS:", ":BLANK_LINE:", ":PATH:"]
39
+ }
40
+ }
41
+ }
42
+ }
43
+ },
44
+ "linter": {
45
+ "enabled": true,
46
+ "rules": {
47
+ "recommended": true,
48
+ "complexity": {
49
+ "noForEach": "warn"
50
+ },
51
+ "nursery": {
52
+ "noImpliedEval": "error"
53
+ },
54
+ "security": {
55
+ "noGlobalEval": "error"
56
+ },
57
+ "correctness": {
58
+ "noUnusedImports": "error",
59
+ "noUnusedFunctionParameters": {
60
+ "level": "error",
61
+ "options": {
62
+ "ignoreRestSiblings": true
63
+ }
64
+ },
65
+ "noUnusedVariables": {
66
+ "level": "error",
67
+ "options": {
68
+ "ignoreRestSiblings": true
69
+ }
70
+ }
71
+ },
72
+ "style": {
73
+ "noParameterAssign": "error",
74
+ "useArrayLiterals": "warn",
75
+ "useBlockStatements": "error",
76
+ "useConst": "warn",
77
+ "useNamingConvention": {
78
+ "level": "error",
79
+ "options": {
80
+ "strictCase": false,
81
+ "conventions": [
82
+ {
83
+ "selector": { "kind": "variable" },
84
+ "match": "(_*)?(.*)",
85
+ "formats": ["camelCase"]
86
+ },
87
+ {
88
+ "selector": { "kind": "function" },
89
+ "match": "(_*)?(.*)",
90
+ "formats": ["camelCase", "PascalCase"]
91
+ },
92
+ {
93
+ "selector": { "kind": "class" },
94
+ "formats": ["PascalCase"]
95
+ },
96
+ {
97
+ "selector": { "kind": "interface" },
98
+ "formats": ["PascalCase"]
99
+ },
100
+ {
101
+ "selector": { "kind": "typeAlias" },
102
+ "formats": ["PascalCase"]
103
+ },
104
+ {
105
+ "selector": { "kind": "enum" },
106
+ "formats": ["PascalCase"]
107
+ },
108
+ {
109
+ "selector": { "kind": "enumMember" },
110
+ "formats": ["PascalCase"]
111
+ },
112
+ {
113
+ "selector": { "kind": "const", "scope": "global" },
114
+ "match": "(_*)?(.*)",
115
+ "formats": ["camelCase", "CONSTANT_CASE", "PascalCase"]
116
+ }
117
+ ]
118
+ }
119
+ },
120
+ "useThrowOnlyError": "error",
121
+ "noDefaultExport": "warn"
122
+ },
123
+ "suspicious": {
124
+ "noConsole": {
125
+ "level": "warn",
126
+ "options": {
127
+ "allow": ["info", "warn", "error", "group", "groupEnd"]
128
+ }
129
+ },
130
+ "noDoubleEquals": {
131
+ "level": "error",
132
+ "options": {
133
+ "ignoreNull": true
134
+ }
135
+ },
136
+ "noUnusedExpressions": "error",
137
+ "noVar": "error",
138
+ "noSelfCompare": "error",
139
+ "noTemplateCurlyInString": "error",
140
+ "useAwait": "error"
141
+ }
142
+ }
143
+ },
144
+ "overrides": [
145
+ {
146
+ "includes": ["**/*.{jsx,tsx}"],
147
+ "linter": {
148
+ "rules": {
149
+ "correctness": {
150
+ "useExhaustiveDependencies": "warn",
151
+ "noUnknownProperty": "error",
152
+ "noChildrenProp": "error",
153
+ "useJsxKeyInIterable": "error"
154
+ },
155
+ "a11y": {
156
+ "useKeyWithClickEvents": "warn",
157
+ "useValidAnchor": "warn"
158
+ },
159
+ "style": {
160
+ "useSelfClosingElements": "warn"
161
+ }
162
+ }
163
+ }
164
+ },
165
+ {
166
+ "includes": ["**/*.{jsonc,json5}"],
167
+ "json": {
168
+ "formatter": {
169
+ "enabled": true,
170
+ "indentStyle": "tab",
171
+ "lineWidth": 320
172
+ },
173
+ "linter": {
174
+ "enabled": true
175
+ }
176
+ }
177
+ }
178
+ ]
179
+ }
package/package.json ADDED
@@ -0,0 +1,46 @@
1
+ {
2
+ "name": "@nesvet/biome-config",
3
+ "version": "1.0.0",
4
+ "description": "Nesvet Biome config",
5
+ "keywords": [
6
+ "biome",
7
+ "config",
8
+ "nesvet"
9
+ ],
10
+ "repository": {
11
+ "type": "git",
12
+ "url": "git+https://github.com/nesvet/biome-config.git"
13
+ },
14
+ "license": "MIT",
15
+ "publishConfig": {
16
+ "access": "public"
17
+ },
18
+ "author": "Eugene Nesvetaev <dev@nesvet.dev> (https://nesvet.dev/)",
19
+ "type": "module",
20
+ "exports": {
21
+ ".": "./biome.json",
22
+ "./node": "./presets/node.json"
23
+ },
24
+ "files": [
25
+ "biome.json",
26
+ "presets",
27
+ "README.md",
28
+ "LICENSE"
29
+ ],
30
+ "scripts": {
31
+ "check": "biome check biome.json presets scripts",
32
+ "check:fix": "biome check --write biome.json presets scripts",
33
+ "check:tests": "node scripts/verify-fixtures.mjs"
34
+ },
35
+ "peerDependencies": {
36
+ "@biomejs/biome": ">=2.4.0"
37
+ },
38
+ "devDependencies": {
39
+ "@biomejs/biome": "^2.4.16"
40
+ },
41
+ "packageManager": "bun@1.3.14",
42
+ "engines": {
43
+ "node": ">=22",
44
+ "bun": ">=1.3"
45
+ }
46
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "$schema": "../node_modules/@biomejs/biome/configuration_schema.json",
3
+ "extends": ["../biome.json"],
4
+ "linter": {
5
+ "rules": {
6
+ "style": {
7
+ "useNodejsImportProtocol": "error"
8
+ }
9
+ }
10
+ }
11
+ }