@yuu1111/biome-config 1.3.5 → 1.3.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 CHANGED
@@ -46,7 +46,7 @@ Custom rules are opt-in. Add one preset after the base or React configuration:
46
46
 
47
47
  Choose the most specific preset needed by the project:
48
48
 
49
- - `plugins/core` checks re-exports, incomplete implementations, type-safety bypasses, unsafe errno assertions, meaningless tests, and pass-through wrappers
49
+ - `plugins/core` checks re-exports, incomplete implementations, type-safety bypasses, unsafe errno assertions, meaningless tests, pass-through wrappers, nested ternaries, and ternaries used for side effects
50
50
  - `plugins/network` includes `core`, requires an `AbortSignal` for `fetch`, and checks cleanup for manually scheduled abort timeouts
51
51
  - `plugins/discord` includes `network` and checks dynamic Discord messages for explicit mention handling
52
52
 
@@ -60,6 +60,8 @@ Do not list parent presets separately. Each child preset includes its parent rul
60
60
  - `no-unsafe-errno-assertion` warns when code reads `code` directly through a `NodeJS.ErrnoException` assertion without validating the caught value
61
61
  - `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
62
  - `no-useless-abstraction` warns about named single-argument arrow functions that only pass the same argument to another function, including the equivalent async form
63
+ - `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
64
+ - `no-nested-ternary` (Biome built-in) warns when a ternary operator is nested inside another ternary operator
63
65
 
64
66
  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
67
 
@@ -77,6 +79,9 @@ test("placeholder", () => {})
77
79
  expect(result).toEqual(result)
78
80
 
79
81
  const loadUser = (id) => fetchUser(id)
82
+
83
+ const size = small ? "s" : medium ? "m" : "l"
84
+ flag ? enable() : disable()
80
85
  ```
81
86
 
82
87
  Suppress an intentional exception with a reason:
package/base.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "$schema": "https://biomejs.dev/schemas/2.4.14/schema.json",
2
+ "$schema": "https://biomejs.dev/schemas/2.5.13/schema.json",
3
3
  "vcs": {
4
4
  "enabled": true,
5
5
  "clientKind": "git",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yuu1111/biome-config",
3
- "version": "1.3.5",
3
+ "version": "1.3.6",
4
4
  "description": "Shared Biome configuration",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -0,0 +1,6 @@
1
+ engine biome(1.0)
2
+ language js(typescript)
3
+
4
+ JsExpressionStatement(expression=JsConditionalExpression()) as $match where {
5
+ register_diagnostic(span=$match, message="Use an if/else statement instead of a ternary operator for side effects", severity="warn")
6
+ }
package/plugins-core.json CHANGED
@@ -1,11 +1,19 @@
1
1
  {
2
- "$schema": "https://biomejs.dev/schemas/2.4.14/schema.json",
2
+ "$schema": "https://biomejs.dev/schemas/2.5.13/schema.json",
3
+ "linter": {
4
+ "rules": {
5
+ "style": {
6
+ "noNestedTernary": "warn"
7
+ }
8
+ }
9
+ },
3
10
  "plugins": [
4
11
  "./node_modules/@yuu1111/biome-config/plugins/no-reexports.grit",
5
12
  "./node_modules/@yuu1111/biome-config/plugins/no-incomplete-implementation.grit",
6
13
  "./node_modules/@yuu1111/biome-config/plugins/no-type-safety-bypass.grit",
7
14
  "./node_modules/@yuu1111/biome-config/plugins/no-unsafe-errno-assertion.grit",
8
15
  "./node_modules/@yuu1111/biome-config/plugins/no-meaningless-test.grit",
9
- "./node_modules/@yuu1111/biome-config/plugins/no-useless-abstraction.grit"
16
+ "./node_modules/@yuu1111/biome-config/plugins/no-useless-abstraction.grit",
17
+ "./node_modules/@yuu1111/biome-config/plugins/no-ternary-statement.grit"
10
18
  ]
11
19
  }
@@ -1,5 +1,12 @@
1
1
  {
2
- "$schema": "https://biomejs.dev/schemas/2.4.14/schema.json",
2
+ "$schema": "https://biomejs.dev/schemas/2.5.13/schema.json",
3
+ "linter": {
4
+ "rules": {
5
+ "style": {
6
+ "noNestedTernary": "warn"
7
+ }
8
+ }
9
+ },
3
10
  "plugins": [
4
11
  "./node_modules/@yuu1111/biome-config/plugins/no-reexports.grit",
5
12
  "./node_modules/@yuu1111/biome-config/plugins/no-incomplete-implementation.grit",
@@ -7,6 +14,7 @@
7
14
  "./node_modules/@yuu1111/biome-config/plugins/no-unsafe-errno-assertion.grit",
8
15
  "./node_modules/@yuu1111/biome-config/plugins/no-meaningless-test.grit",
9
16
  "./node_modules/@yuu1111/biome-config/plugins/no-useless-abstraction.grit",
17
+ "./node_modules/@yuu1111/biome-config/plugins/no-ternary-statement.grit",
10
18
  "./node_modules/@yuu1111/biome-config/plugins/require-fetch-abort-signal.grit",
11
19
  "./node_modules/@yuu1111/biome-config/plugins/require-abort-timeout-cleanup.grit",
12
20
  "./node_modules/@yuu1111/biome-config/plugins/no-unsafe-dynamic-discord-message.grit"
@@ -1,5 +1,12 @@
1
1
  {
2
- "$schema": "https://biomejs.dev/schemas/2.4.14/schema.json",
2
+ "$schema": "https://biomejs.dev/schemas/2.5.13/schema.json",
3
+ "linter": {
4
+ "rules": {
5
+ "style": {
6
+ "noNestedTernary": "warn"
7
+ }
8
+ }
9
+ },
3
10
  "plugins": [
4
11
  "./node_modules/@yuu1111/biome-config/plugins/no-reexports.grit",
5
12
  "./node_modules/@yuu1111/biome-config/plugins/no-incomplete-implementation.grit",
@@ -7,6 +14,7 @@
7
14
  "./node_modules/@yuu1111/biome-config/plugins/no-unsafe-errno-assertion.grit",
8
15
  "./node_modules/@yuu1111/biome-config/plugins/no-meaningless-test.grit",
9
16
  "./node_modules/@yuu1111/biome-config/plugins/no-useless-abstraction.grit",
17
+ "./node_modules/@yuu1111/biome-config/plugins/no-ternary-statement.grit",
10
18
  "./node_modules/@yuu1111/biome-config/plugins/require-fetch-abort-signal.grit",
11
19
  "./node_modules/@yuu1111/biome-config/plugins/require-abort-timeout-cleanup.grit"
12
20
  ]
package/react.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "$schema": "https://biomejs.dev/schemas/2.4.14/schema.json",
2
+ "$schema": "https://biomejs.dev/schemas/2.5.13/schema.json",
3
3
  "vcs": {
4
4
  "enabled": true,
5
5
  "clientKind": "git",