@yuu1111/biome-config 1.3.5 → 1.3.7
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 +10 -1
- package/base.json +4 -1
- package/package.json +1 -1
- package/plugins/no-ternary-statement.grit +6 -0
- package/plugins-core.json +3 -2
- package/plugins-discord.json +2 -1
- package/plugins-network.json +2 -1
- package/react.json +4 -1
package/README.md
CHANGED
|
@@ -19,6 +19,12 @@ bun add -D @yuu1111/biome-config
|
|
|
19
19
|
}
|
|
20
20
|
```
|
|
21
21
|
|
|
22
|
+
The base configuration enables the recommended rules, errors on barrel files and re-export-all, and warns about nested ternaries:
|
|
23
|
+
|
|
24
|
+
```ts
|
|
25
|
+
const size = small ? "s" : medium ? "m" : "l"
|
|
26
|
+
```
|
|
27
|
+
|
|
22
28
|
### React
|
|
23
29
|
|
|
24
30
|
CSS/Tailwind support included.
|
|
@@ -46,7 +52,7 @@ Custom rules are opt-in. Add one preset after the base or React configuration:
|
|
|
46
52
|
|
|
47
53
|
Choose the most specific preset needed by the project:
|
|
48
54
|
|
|
49
|
-
- `plugins/core` checks re-exports, incomplete implementations, type-safety bypasses, unsafe errno assertions, meaningless tests,
|
|
55
|
+
- `plugins/core` checks re-exports, incomplete implementations, type-safety bypasses, unsafe errno assertions, meaningless tests, pass-through wrappers, and ternaries used for side effects
|
|
50
56
|
- `plugins/network` includes `core`, requires an `AbortSignal` for `fetch`, and checks cleanup for manually scheduled abort timeouts
|
|
51
57
|
- `plugins/discord` includes `network` and checks dynamic Discord messages for explicit mention handling
|
|
52
58
|
|
|
@@ -60,6 +66,7 @@ Do not list parent presets separately. Each child preset includes its parent rul
|
|
|
60
66
|
- `no-unsafe-errno-assertion` warns when code reads `code` directly through a `NodeJS.ErrnoException` assertion without validating the caught value
|
|
61
67
|
- `no-meaningless-test` warns about empty `test` or `it` callbacks and `toBe`, `toEqual`, or `toStrictEqual` comparisons where an identifier or literal is compared with itself
|
|
62
68
|
- `no-useless-abstraction` warns about named single-argument arrow functions that only pass the same argument to another function, including the equivalent async form
|
|
69
|
+
- `no-ternary-statement` warns when a ternary operator is used as a standalone statement, such as `flag ? enable() : disable()`, where an if/else statement is clearer
|
|
63
70
|
|
|
64
71
|
The rules intentionally stay narrow. A wrapper that validates, transforms, logs, caches, starts a transaction, or performs another operation is not reported as a pass-through wrapper. Tests with setup or assertions are not treated as empty.
|
|
65
72
|
|
|
@@ -77,6 +84,8 @@ test("placeholder", () => {})
|
|
|
77
84
|
expect(result).toEqual(result)
|
|
78
85
|
|
|
79
86
|
const loadUser = (id) => fetchUser(id)
|
|
87
|
+
|
|
88
|
+
flag ? enable() : disable()
|
|
80
89
|
```
|
|
81
90
|
|
|
82
91
|
Suppress an intentional exception with a reason:
|
package/base.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"$schema": "https://biomejs.dev/schemas/2.
|
|
2
|
+
"$schema": "https://biomejs.dev/schemas/2.5.13/schema.json",
|
|
3
3
|
"vcs": {
|
|
4
4
|
"enabled": true,
|
|
5
5
|
"clientKind": "git",
|
|
@@ -21,6 +21,9 @@
|
|
|
21
21
|
"performance": {
|
|
22
22
|
"noBarrelFile": "error",
|
|
23
23
|
"noReExportAll": "error"
|
|
24
|
+
},
|
|
25
|
+
"style": {
|
|
26
|
+
"noNestedTernary": "warn"
|
|
24
27
|
}
|
|
25
28
|
}
|
|
26
29
|
},
|
package/package.json
CHANGED
package/plugins-core.json
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
{
|
|
2
|
-
"$schema": "https://biomejs.dev/schemas/2.
|
|
2
|
+
"$schema": "https://biomejs.dev/schemas/2.5.13/schema.json",
|
|
3
3
|
"plugins": [
|
|
4
4
|
"./node_modules/@yuu1111/biome-config/plugins/no-reexports.grit",
|
|
5
5
|
"./node_modules/@yuu1111/biome-config/plugins/no-incomplete-implementation.grit",
|
|
6
6
|
"./node_modules/@yuu1111/biome-config/plugins/no-type-safety-bypass.grit",
|
|
7
7
|
"./node_modules/@yuu1111/biome-config/plugins/no-unsafe-errno-assertion.grit",
|
|
8
8
|
"./node_modules/@yuu1111/biome-config/plugins/no-meaningless-test.grit",
|
|
9
|
-
"./node_modules/@yuu1111/biome-config/plugins/no-useless-abstraction.grit"
|
|
9
|
+
"./node_modules/@yuu1111/biome-config/plugins/no-useless-abstraction.grit",
|
|
10
|
+
"./node_modules/@yuu1111/biome-config/plugins/no-ternary-statement.grit"
|
|
10
11
|
]
|
|
11
12
|
}
|
package/plugins-discord.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"$schema": "https://biomejs.dev/schemas/2.
|
|
2
|
+
"$schema": "https://biomejs.dev/schemas/2.5.13/schema.json",
|
|
3
3
|
"plugins": [
|
|
4
4
|
"./node_modules/@yuu1111/biome-config/plugins/no-reexports.grit",
|
|
5
5
|
"./node_modules/@yuu1111/biome-config/plugins/no-incomplete-implementation.grit",
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
"./node_modules/@yuu1111/biome-config/plugins/no-unsafe-errno-assertion.grit",
|
|
8
8
|
"./node_modules/@yuu1111/biome-config/plugins/no-meaningless-test.grit",
|
|
9
9
|
"./node_modules/@yuu1111/biome-config/plugins/no-useless-abstraction.grit",
|
|
10
|
+
"./node_modules/@yuu1111/biome-config/plugins/no-ternary-statement.grit",
|
|
10
11
|
"./node_modules/@yuu1111/biome-config/plugins/require-fetch-abort-signal.grit",
|
|
11
12
|
"./node_modules/@yuu1111/biome-config/plugins/require-abort-timeout-cleanup.grit",
|
|
12
13
|
"./node_modules/@yuu1111/biome-config/plugins/no-unsafe-dynamic-discord-message.grit"
|
package/plugins-network.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"$schema": "https://biomejs.dev/schemas/2.
|
|
2
|
+
"$schema": "https://biomejs.dev/schemas/2.5.13/schema.json",
|
|
3
3
|
"plugins": [
|
|
4
4
|
"./node_modules/@yuu1111/biome-config/plugins/no-reexports.grit",
|
|
5
5
|
"./node_modules/@yuu1111/biome-config/plugins/no-incomplete-implementation.grit",
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
"./node_modules/@yuu1111/biome-config/plugins/no-unsafe-errno-assertion.grit",
|
|
8
8
|
"./node_modules/@yuu1111/biome-config/plugins/no-meaningless-test.grit",
|
|
9
9
|
"./node_modules/@yuu1111/biome-config/plugins/no-useless-abstraction.grit",
|
|
10
|
+
"./node_modules/@yuu1111/biome-config/plugins/no-ternary-statement.grit",
|
|
10
11
|
"./node_modules/@yuu1111/biome-config/plugins/require-fetch-abort-signal.grit",
|
|
11
12
|
"./node_modules/@yuu1111/biome-config/plugins/require-abort-timeout-cleanup.grit"
|
|
12
13
|
]
|
package/react.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"$schema": "https://biomejs.dev/schemas/2.
|
|
2
|
+
"$schema": "https://biomejs.dev/schemas/2.5.13/schema.json",
|
|
3
3
|
"vcs": {
|
|
4
4
|
"enabled": true,
|
|
5
5
|
"clientKind": "git",
|
|
@@ -21,6 +21,9 @@
|
|
|
21
21
|
"performance": {
|
|
22
22
|
"noBarrelFile": "error",
|
|
23
23
|
"noReExportAll": "error"
|
|
24
|
+
},
|
|
25
|
+
"style": {
|
|
26
|
+
"noNestedTernary": "warn"
|
|
24
27
|
}
|
|
25
28
|
}
|
|
26
29
|
},
|