@webority/biome-config 0.144.2 → 0.146.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/biome.jsonc CHANGED
@@ -40,6 +40,8 @@
40
40
  // mobile-grit-keyboard-avoiding: KeyboardAvoidingView and Keyboard.addListener; react-native-keyboard-controller replaces them.
41
41
  // mobile-grit-keychain-internet: set, get and has InternetCredentials for a token; the generic password API replaces them.
42
42
  // web-grit-axios-module-config: axios.create reading baseURL or timeout from config at module scope; resolve at call time.
43
+ // web-grit-empty-catch: an empty catch block (a comment alone included) swallows the error.
44
+ // mobile-grit-unchecked-native-call: a NativeModules or codegen spec call whose result is dropped, voided or swallowed.
43
45
  "plugins": [
44
46
  "./node_modules/@webority/biome-config/plugins/no-absolute-fill-object.grit",
45
47
  "./node_modules/@webority/biome-config/plugins/mobile-grit-alert-alert.grit",
@@ -51,7 +53,9 @@
51
53
  "./node_modules/@webority/biome-config/plugins/mobile-grit-select-from-result.grit",
52
54
  "./node_modules/@webority/biome-config/plugins/mobile-grit-keyboard-avoiding.grit",
53
55
  "./node_modules/@webority/biome-config/plugins/mobile-grit-keychain-internet.grit",
54
- "./node_modules/@webority/biome-config/plugins/web-grit-axios-module-config.grit"
56
+ "./node_modules/@webority/biome-config/plugins/web-grit-axios-module-config.grit",
57
+ "./node_modules/@webority/biome-config/plugins/web-grit-empty-catch.grit",
58
+ "./node_modules/@webority/biome-config/plugins/mobile-grit-unchecked-native-call.grit"
55
59
  ],
56
60
  "linter": {
57
61
  "enabled": true,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webority/biome-config",
3
- "version": "0.144.2",
3
+ "version": "0.146.0",
4
4
  "description": "Shared Biome lint + format policy for Webority frontend products. Extend it from a product biome.json so every repo inherits one shared ruleset, bumped by version — no per-repo drift.",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "publishConfig": {
@@ -0,0 +1,31 @@
1
+ language js
2
+
3
+ // react-native.md → Failing loud: check the result of every native module call. A call through NativeModules or
4
+ // through a codegen spec (a default import from a Native<Name> module) whose result is dropped or voided, or caught
5
+ // by a handler that does nothing (awaited or not), hides a failed call. An awaited call with no catch is checked.
6
+ JsExpressionStatement(expression=$call) as $stmt where {
7
+ $call <: or {
8
+ JsCallExpression(),
9
+ JsUnaryExpression(),
10
+ JsAwaitExpression()
11
+ },
12
+ or {
13
+ and {
14
+ $call <: r"(?s)(?:void\s+)?NativeModules\??\.[A-Za-z_$][\w$]*\??\.[A-Za-z_$][\w$]*\(.*",
15
+ $call <: not r"(?s).*\.catch\(.*\)\s*$"
16
+ },
17
+ $call <: r"(?s)(?:void\s+|await\s+)?NativeModules\??\..*\.catch\(\s*(?:\(\s*[\w$]*\s*\)|[\w$]+)?\s*=>\s*(?:\{\s*\}|undefined|null|void 0)\s*\)\s*$",
18
+ and {
19
+ $call <: r"(?s)(?:void\s+|await\s+)?([A-Za-z_$][\w$]*)\??\.[A-Za-z_$][\w$]*\(.*"($native),
20
+ $program <: contains `import $name from $source` where {
21
+ $name <: $native,
22
+ $source <: r"[\"'](?:.*/)?Native[A-Z][A-Za-z0-9]*[\"']"
23
+ },
24
+ or {
25
+ and { $call <: not r"(?s)await\s.*", $call <: not r"(?s).*\.catch\(.*\)\s*$" },
26
+ $call <: r"(?s).*\.catch\(\s*(?:\(\s*[\w$]*\s*\)|[\w$]+)?\s*=>\s*(?:\{\s*\}|undefined|null|void 0)\s*\)\s*$"
27
+ }
28
+ }
29
+ },
30
+ register_diagnostic(span=$stmt, message="This native module call's result is never checked, so a failed call goes unnoticed. Await it and handle the failure, or return it to a caller that does.", severity="error")
31
+ }
@@ -0,0 +1,8 @@
1
+ language js
2
+
3
+ // react.md → Failing loud: a catch handles the error, retries it as a classified transient, or logs and rethrows it.
4
+ // A comment alone does not handle it; a documented best-effort path carries `biome-ignore lint/plugin/web-grit-empty-catch: <why>`.
5
+ JsCatchClause(body=$body) as $catch where {
6
+ $body <: `{}`,
7
+ register_diagnostic(span=$catch, message="This catch swallows the error. Handle it, retry it as a classified transient, or log it and rethrow it. A documented best-effort path says why in a biome-ignore lint/plugin/web-grit-empty-catch comment.", severity="error")
8
+ }