@webority/biome-config 0.119.0 → 0.120.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/README.md +2 -1
- package/biome.jsonc +2 -0
- package/package.json +1 -1
- package/plugins/mobile-grit-select-from-result.grit +16 -0
package/README.md
CHANGED
|
@@ -55,7 +55,7 @@ fails every file in the repo at once, drowning any real violation (one repo's le
|
|
|
55
55
|
module's mixed export allowed.
|
|
56
56
|
- **`StyleSheet.absoluteFillObject`** is an error, through the `no-absolute-fill-object` plugin
|
|
57
57
|
(below).
|
|
58
|
-
- **
|
|
58
|
+
- **Eleven GritQL plugins** (`mobile-grit-*`, `web-grit-*` and `no-absolute-fill-object`, below) are errors.
|
|
59
59
|
|
|
60
60
|
## Plugins (GritQL)
|
|
61
61
|
|
|
@@ -70,6 +70,7 @@ The config ships lint plugins in `plugins/` and turns them on for every product
|
|
|
70
70
|
| `mobile-grit-font-scaling-off` | `allowFontScaling={false}` | Turns off text scaling for people who need larger text. Cap a dense row with `maxFontSizeMultiplier`. |
|
|
71
71
|
| `mobile-grit-firebase-default-import` | `import x from "@react-native-firebase/..."` | `@react-native-firebase` 26 has no default export: the import is `undefined` and calling it crashes at launch. Import the modular functions by name. |
|
|
72
72
|
| `mobile-grit-is-refreshing` | `isRefreshing = <value>` (a declaration with a value, or an assignment) | A bare boolean flag races and wedges the client when the refresh throws. Share one refresh promise that every waiter awaits. |
|
|
73
|
+
| `mobile-grit-select-from-result` | an RTK Query `selectFromResult` that returns a non-object value, or that takes `refetch` | RTK Query spreads the result beside `refetch`, so a plain value replaces the hook result. Return `{ name: value }` and destructure; take `refetch` from the hook's own result. |
|
|
73
74
|
| `mobile-grit-keyboard-avoiding` | `KeyboardAvoidingView`, `Keyboard.addListener` | Keyboard handling is `react-native-keyboard-controller`: `KeyboardProvider`, `KeyboardAwareScrollView`, `KeyboardStickyView`. |
|
|
74
75
|
| `mobile-grit-keychain-internet` | `setInternetCredentials`, `getInternetCredentials`, `hasInternetCredentials` | A token is a generic password. Use `setGenericPassword`, `getGenericPassword` and `resetGenericPassword`. `resetInternetCredentials` stays allowed for the first-install clean-up. |
|
|
75
76
|
| `web-grit-axios-module-config` | `axios.create({ baseURL: <non-literal> })` or `timeout: <non-literal>` outside a function | Config read at import time cannot be set later. Resolve it at call time in an interceptor. |
|
package/biome.jsonc
CHANGED
|
@@ -36,6 +36,7 @@
|
|
|
36
36
|
// mobile-grit-font-scaling-off: allowFontScaling={false}; maxFontSizeMultiplier caps a dense row instead.
|
|
37
37
|
// mobile-grit-firebase-default-import: a default import from @react-native-firebase, which is undefined.
|
|
38
38
|
// mobile-grit-is-refreshing: a bare isRefreshing flag guarding a token refresh; one shared refresh promise replaces it.
|
|
39
|
+
// mobile-grit-select-from-result: an RTK Query selectFromResult that returns a plain value or takes refetch.
|
|
39
40
|
// mobile-grit-keyboard-avoiding: KeyboardAvoidingView and Keyboard.addListener; react-native-keyboard-controller replaces them.
|
|
40
41
|
// mobile-grit-keychain-internet: set, get and has InternetCredentials for a token; the generic password API replaces them.
|
|
41
42
|
// web-grit-axios-module-config: axios.create reading baseURL or timeout from config at module scope; resolve at call time.
|
|
@@ -47,6 +48,7 @@
|
|
|
47
48
|
"./node_modules/@webority/biome-config/plugins/mobile-grit-font-scaling-off.grit",
|
|
48
49
|
"./node_modules/@webority/biome-config/plugins/mobile-grit-firebase-default-import.grit",
|
|
49
50
|
"./node_modules/@webority/biome-config/plugins/mobile-grit-is-refreshing.grit",
|
|
51
|
+
"./node_modules/@webority/biome-config/plugins/mobile-grit-select-from-result.grit",
|
|
50
52
|
"./node_modules/@webority/biome-config/plugins/mobile-grit-keyboard-avoiding.grit",
|
|
51
53
|
"./node_modules/@webority/biome-config/plugins/mobile-grit-keychain-internet.grit",
|
|
52
54
|
"./node_modules/@webority/biome-config/plugins/web-grit-axios-module-config.grit"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webority/biome-config",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.120.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,16 @@
|
|
|
1
|
+
language js
|
|
2
|
+
|
|
3
|
+
// RTK Query spreads selectFromResult's result beside refetch, so it must be an object literal and refetch comes from the hook.
|
|
4
|
+
or {
|
|
5
|
+
`selectFromResult: ($args) => $body` as $prop where {
|
|
6
|
+
$body <: not or {
|
|
7
|
+
JsObjectExpression(),
|
|
8
|
+
`({ $fields })`
|
|
9
|
+
},
|
|
10
|
+
register_diagnostic(span=$prop, message="selectFromResult must return an object literal: RTK Query spreads its result beside refetch, so a plain value makes the whole hook result stand in for it. Return { name: value } and destructure.", severity="error")
|
|
11
|
+
},
|
|
12
|
+
`selectFromResult: ($args) => $_` as $prop where {
|
|
13
|
+
$args <: r"(?s).*\brefetch\b.*",
|
|
14
|
+
register_diagnostic(span=$prop, message="selectFromResult never receives refetch; take refetch from the hook's own result.", severity="error")
|
|
15
|
+
}
|
|
16
|
+
}
|