@webority/biome-config 0.7.3
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 +5 -0
- package/README.md +47 -0
- package/biome.jsonc +117 -0
- package/package.json +22 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
Copyright (c) Webority Technologies. All rights reserved.
|
|
2
|
+
|
|
3
|
+
This software and its source code are proprietary and confidential to
|
|
4
|
+
Webority Technologies. Use is restricted to Webority products and teams under
|
|
5
|
+
internal license. Redistribution outside Webority Technologies is prohibited.
|
package/README.md
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# @webority/biome-config
|
|
2
|
+
|
|
3
|
+
The **single source of truth** for Biome lint + format policy across Webority frontend
|
|
4
|
+
products. Extend it from a product's `biome.json` so every repo inherits the same
|
|
5
|
+
fleet-decided ruleset — and a policy change is one version bump, not an N-way copy that
|
|
6
|
+
drifts. Same model as the shared `@webority/theme` + `@webority/ui-react`.
|
|
7
|
+
|
|
8
|
+
## Use
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
npm install -D @webority/biome-config @biomejs/biome
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Then a product's `biome.json` extends this base and adds **only** its own repo-specific
|
|
15
|
+
bits — `vcs.root`, `files.includes`, and `formatter.lineEnding` (LF is Biome's default;
|
|
16
|
+
set `crlf` only for a CRLF repo):
|
|
17
|
+
|
|
18
|
+
```jsonc
|
|
19
|
+
{
|
|
20
|
+
"$schema": "https://biomejs.dev/schemas/2.5.5/schema.json",
|
|
21
|
+
"extends": ["@webority/biome-config/biome.jsonc"],
|
|
22
|
+
"vcs": { "enabled": true, "clientKind": "git", "useIgnoreFile": true, "root": ".." },
|
|
23
|
+
"files": {
|
|
24
|
+
"ignoreUnknown": true,
|
|
25
|
+
"includes": ["**", "!!**/dist", "!!**/build", "!!**/node_modules", "!**/src/appsettings.Compiled.json", "!**/public/version.json"]
|
|
26
|
+
},
|
|
27
|
+
// Only if the repo is CRLF (e.g. a Windows repo with `end_of_line = crlf`).
|
|
28
|
+
"formatter": { "lineEnding": "crlf" }
|
|
29
|
+
}
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## What's decided here (once, for the fleet)
|
|
33
|
+
|
|
34
|
+
- **Format:** 4-space, width 140, double quotes, semicolons, trailing commas.
|
|
35
|
+
- **`useExhaustiveDependencies: off`** — noise-by-nature on correct React effect/RHF code.
|
|
36
|
+
- **`noArrayIndexKey: warn`** — kept on (catches real dynamic-list bugs); genuine
|
|
37
|
+
static-list exceptions get a documented per-line `biome-ignore`.
|
|
38
|
+
- **`noConsole`** off for `scripts/**` + `logger.js`; CSS/SCSS not linted; the icon
|
|
39
|
+
module's mixed export allowed.
|
|
40
|
+
|
|
41
|
+
Product-specific one-offs (a bespoke file that co-exports, etc.) still use a local
|
|
42
|
+
`overrides` entry or a documented inline `biome-ignore` in that product.
|
|
43
|
+
|
|
44
|
+
## Versioning
|
|
45
|
+
|
|
46
|
+
Published from the `webority-ui` monorepo on each release, in lockstep with the other
|
|
47
|
+
`@webority/*` packages. Pin a version; bump to adopt policy changes deliberately.
|
package/biome.jsonc
ADDED
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://biomejs.dev/schemas/2.5.5/schema.json",
|
|
3
|
+
// Not a standalone root config — it exists only to be `extends`-ed by a product's
|
|
4
|
+
// biome.json (which is the root). `root: false` stops Biome treating it as a nested
|
|
5
|
+
// competing root inside the monorepo that ships it.
|
|
6
|
+
"root": false,
|
|
7
|
+
// Shared Webority frontend lint + format policy. Products EXTEND this and add
|
|
8
|
+
// only their own repo-specific bits (vcs.root, files.includes, formatter.lineEnding).
|
|
9
|
+
// Every rule decision below is made ONCE for the fleet, with rationale, and inherited
|
|
10
|
+
// by every product via a version bump — no per-repo drift.
|
|
11
|
+
"formatter": {
|
|
12
|
+
"enabled": true,
|
|
13
|
+
"indentStyle": "space",
|
|
14
|
+
"indentWidth": 4,
|
|
15
|
+
"lineWidth": 140,
|
|
16
|
+
"attributePosition": "auto",
|
|
17
|
+
"bracketSameLine": false,
|
|
18
|
+
"bracketSpacing": true,
|
|
19
|
+
"useEditorconfig": false
|
|
20
|
+
},
|
|
21
|
+
"linter": {
|
|
22
|
+
"enabled": true,
|
|
23
|
+
"rules": {
|
|
24
|
+
"preset": "recommended",
|
|
25
|
+
"a11y": "warn",
|
|
26
|
+
"complexity": {
|
|
27
|
+
"noImportantStyles": "off",
|
|
28
|
+
"useOptionalChain": "off",
|
|
29
|
+
"noUselessFragments": "off"
|
|
30
|
+
},
|
|
31
|
+
"correctness": {
|
|
32
|
+
"noUnusedVariables": "error",
|
|
33
|
+
"noUnusedFunctionParameters": "warn",
|
|
34
|
+
// Noise-by-nature on correct React effect/RHF code (fires on every
|
|
35
|
+
// deliberate trigger-only / run-once effect). Fleet decision: off.
|
|
36
|
+
"useExhaustiveDependencies": "off",
|
|
37
|
+
"useHookAtTopLevel": "error"
|
|
38
|
+
},
|
|
39
|
+
"style": {
|
|
40
|
+
"useTemplate": "off",
|
|
41
|
+
"noDescendingSpecificity": "off",
|
|
42
|
+
"useComponentExportOnlyModules": "warn"
|
|
43
|
+
},
|
|
44
|
+
"suspicious": {
|
|
45
|
+
// Valuable on dynamic lists (reorder/reconciliation bugs). Genuine
|
|
46
|
+
// static-list exceptions get a documented per-line biome-ignore.
|
|
47
|
+
"noArrayIndexKey": "warn",
|
|
48
|
+
"useIterableCallbackReturn": "off",
|
|
49
|
+
"noGlobalIsNan": "off",
|
|
50
|
+
"noAssignInExpressions": "off",
|
|
51
|
+
"noDuplicateProperties": "warn",
|
|
52
|
+
"noConsole": {
|
|
53
|
+
"level": "warn",
|
|
54
|
+
"options": {
|
|
55
|
+
"allow": ["warn", "error"]
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
"javascript": {
|
|
62
|
+
"formatter": {
|
|
63
|
+
"jsxQuoteStyle": "double",
|
|
64
|
+
"quoteProperties": "asNeeded",
|
|
65
|
+
"trailingCommas": "all",
|
|
66
|
+
"semicolons": "always",
|
|
67
|
+
"arrowParentheses": "always",
|
|
68
|
+
"bracketSameLine": false,
|
|
69
|
+
"quoteStyle": "double",
|
|
70
|
+
"attributePosition": "auto",
|
|
71
|
+
"bracketSpacing": true
|
|
72
|
+
},
|
|
73
|
+
"jsxRuntime": "transparent"
|
|
74
|
+
},
|
|
75
|
+
"assist": {
|
|
76
|
+
"enabled": true,
|
|
77
|
+
"actions": {
|
|
78
|
+
"source": {
|
|
79
|
+
"organizeImports": "off"
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
"overrides": [
|
|
84
|
+
{
|
|
85
|
+
// Loggers + build/tooling scripts legitimately use console.
|
|
86
|
+
"includes": ["scripts/**", "**/logger.js"],
|
|
87
|
+
"linter": {
|
|
88
|
+
"rules": {
|
|
89
|
+
"suspicious": {
|
|
90
|
+
"noConsole": "off"
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
// The icon module co-exports a component + its glyph map by design.
|
|
97
|
+
"includes": ["**/icons.jsx"],
|
|
98
|
+
"linter": {
|
|
99
|
+
"rules": {
|
|
100
|
+
"style": {
|
|
101
|
+
"useComponentExportOnlyModules": "off"
|
|
102
|
+
},
|
|
103
|
+
"suspicious": {
|
|
104
|
+
"noArrayIndexKey": "off"
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
// Styling lives in the shared theme; product CSS/SCSS isn't linted here.
|
|
111
|
+
"includes": ["**/*.css", "**/*.scss"],
|
|
112
|
+
"linter": {
|
|
113
|
+
"enabled": false
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
]
|
|
117
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@webority/biome-config",
|
|
3
|
+
"version": "0.7.3",
|
|
4
|
+
"description": "Shared Biome lint + format policy for Webority frontend products. Extend it from a product biome.json so every repo inherits one fleet-decided ruleset, bumped by version — no per-repo drift.",
|
|
5
|
+
"license": "SEE LICENSE IN LICENSE",
|
|
6
|
+
"publishConfig": {
|
|
7
|
+
"access": "public",
|
|
8
|
+
"registry": "https://registry.npmjs.org/"
|
|
9
|
+
},
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "git+https://github.com/Webority/webority-ui.git",
|
|
13
|
+
"directory": "packages/biome-config"
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"biome.jsonc"
|
|
17
|
+
],
|
|
18
|
+
"main": "biome.jsonc",
|
|
19
|
+
"peerDependencies": {
|
|
20
|
+
"@biomejs/biome": ">=2.5.0"
|
|
21
|
+
}
|
|
22
|
+
}
|