@webority/biome-config 0.163.0 → 0.164.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 CHANGED
@@ -59,8 +59,8 @@ A component named here must draw its string children inside `Text`. Raw text in
59
59
  - **`noConsole`** off for `scripts/**` and `logger.js`; CSS and SCSS not linted, except a server-rendered site's own page styles under `wwwroot/` (linted with the recommended CSS rules); the icon module's mixed export allowed.
60
60
  - **Page scripts and styles** of a server-rendered site (`.js`, `.mjs` and `.css` under `wwwroot/`) are linted like portal code when the root `biome.json` includes them. Keep vendored and minified files out of `files.includes` (`!**/wwwroot/lib`, `!**/*.min.js`, `!**/*.min.css`). `webority-repo-checks` counts their findings per file as `page-lint` against the shrink-only baseline.
61
61
  - **`StyleSheet.absoluteFillObject`** is an error, through the `no-absolute-fill-object` plugin (below).
62
- - **Twenty-seven GritQL plugins** (`mobile-grit-*`, `web-grit-*`, `no-absolute-fill-object`, `no-raw-form`, `no-locale-in-screen`, `no-store-checks-off`, `no-whole-slice-selector`, `form-needs-no-validate`, `no-fixed-key-reflect-get`, `web-grit-ime-enter-submit`, `web-grit-hand-built-overlay`, `no-legacy-component-props` and `no-legacy-react-test-api`, below) are errors.
63
- - **Deprecated and retired APIs: `error`.** `noDeprecatedImports` fails a named import of anything its own library marks `@deprecated` and prints the replacement the tag names (it does not follow `ns.member` through a namespace import). `noReactStringRefs` fails a string ref, which React 19 removed. Patterns React, React Native and React Navigation still support (class components, `forwardRef`, `Animated`, class `defaultProps`) are not banned. `webority-repo-checks` counts these findings and the three retired-pattern plugins per file against the shrink-only baseline, so a product adopts them with `--baseline-adopt`.
62
+ - **Forty GritQL plugins** (`mobile-grit-*`, `web-grit-*`, `no-absolute-fill-object`, `no-raw-form`, `no-locale-in-screen`, `no-store-checks-off`, `no-whole-slice-selector`, `form-needs-no-validate`, `no-fixed-key-reflect-get`, `web-grit-ime-enter-submit`, `web-grit-hand-built-overlay`, `no-legacy-component-props`, `no-legacy-react-test-api`, `no-legacy-node-sqlite`, `no-legacy-element-ref`, `no-legacy-context`, `no-shake-hash-without-output-length` and `no-spawn-args-with-shell`, below) are errors.
63
+ - **Deprecated and retired APIs: `error`.** `noDeprecatedImports` fails a named import of anything its own library marks `@deprecated` and prints the replacement the tag names (it does not follow `ns.member` through a namespace import). `noReactStringRefs` fails a string ref, which React 19 removed. Patterns React, React Native and React Navigation still support (class components, `forwardRef`, `Animated`, class `defaultProps`) are not banned. `webority-repo-checks` counts these findings and the four retired-pattern plugins per file against the shrink-only baseline, so a product adopts them with `--baseline-adopt`.
64
64
  - `**/razor-js/*.ts`: classic page scripts keep `"use strict"`, function declarations and string concatenation; four module-only rules are off.
65
65
  - `**/*.md`: Markdown is neither formatted nor linted, because Biome rewrites bare glob paths and a lint fix under `check --write` would rewrite a changelog's released sections.
66
66
 
@@ -124,7 +124,7 @@ The config ships lint plugins in `plugins/` and turns them on for every product
124
124
  | `no-absolute-fill-object` | `StyleSheet.absoluteFillObject` | React Native 0.86 removed it. It is `undefined`, and spreading it silently leaves the view in the layout flow. Use `StyleSheet.absoluteFill` (spread it or use it directly). |
125
125
  | `no-raw-form` | A JSX `<form>` element in any file other than `AppForm.tsx` | A raw form lets a double click submit twice and sends no idempotency key. Use `AppForm` from `@webority/ui-react`. |
126
126
  | `web-grit-ime-enter-submit` | An `Enter` key check (`e.key === "Enter"`) in a function that never reads `isComposing` or `isImeSafeEnter` | An Enter that confirms an input method composition (Hindi, Chinese, Japanese) would submit early; Safari reports it with keyCode 229. Use `isImeSafeEnter(event)` from `@webority/ui-react` or `@webority/ui-elements/helpers`, or check `!event.isComposing && event.keyCode !== 229`. |
127
- | `web-grit-hand-built-overlay` | A JSX element with `role="dialog"`, `role="alertdialog"` or any `aria-modal` attribute, outside the library's own sources | A hand-built dialog or overlay misses the library's focus trap, Escape and stacking. Use `AppModal`, `AppDrawer`, `AppConfirmDialog`, `AppPopover` or `AppDropdown` from `@webority/ui-react`. |
127
+ | `web-grit-hand-built-overlay` | A JSX element with `role="dialog"`, `role="alertdialog"` or any `aria-modal` attribute, a lower-case `dialog` element or a `popover` attribute, or an import of `Modal`, `Offcanvas`, `Overlay`, `OverlayTrigger`, `Tooltip`, `Popover` or `Dropdown` from `react-bootstrap`, outside the library's own sources | A hand-built dialog or overlay misses the library's focus trap, Escape and stacking. Use `AppModal`, `AppDrawer`, `AppConfirmDialog`, `AppPopover` or `AppDropdown` from `@webority/ui-react`. react-bootstrap overlays draw under the library's and are inert behind them. |
128
128
  | `no-locale-in-screen` | A `toLocale*()` call, or an `Intl.*` / `new Intl.*` call, in a file under a `screens/` folder (tests exempt), for example `d.toLocaleDateString("en-IN")` | A screen formats through the shared formatters: `formatDate`, `formatDateTime`, `formatNumber`, `formatINR` from `@webority/web-core` (`@webority/mobile-core` on phone). |
129
129
  | `no-store-checks-off` | `serializableCheck: false` or `immutableCheck: false` | The store's checks catch a non-plain value or a mutation in development. Exclude only named `ignoredActions` or `ignoredPaths`, each with a one-line reason. |
130
130
  | `no-whole-slice-selector` | An inline function passed to `useSelector` or `useAppSelector`, or a destructured result, for example `const { token } = useSelector(selectAccount)` | A selector returns one primitive or one stored reference, so the component re-renders only when that value changes. Write `useSelector(selectX)` and export derived data as a memoized selector from the slice file. |
@@ -148,6 +148,13 @@ The config ships lint plugins in `plugins/` and turns them on for every product
148
148
  | `web-grit-empty-catch` | An empty `catch {}` block, or a promise `.catch(...)` whose handler is empty or returns only `null` or `undefined`, for example `.catch(() => {})` | The 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. |
149
149
  | `web-grit-raw-query-read` | An RTK Query hook result read outside `useDataState`, for example `const { data } = useGetXQuery()` or `api.endpoints.x.useQuery()`. A read that draws nothing for loading or error passes: one fed to `useDataState` or `useInfiniteDataState` through a variable, one with `selectFromResult`, a bare call that only holds the cache subscription, and one destructured with none of `isLoading`, `isFetching`, `isError`, `error` or `isUninitialized` (but not `{ data }` alone) | A screen reads a query only as a data state. Write `useDataState(useXQuery(args))` and draw it with AppAsyncBlock (AsyncBlock on phone). |
150
150
  | `web-grit-route-lazy-reload` | A `lazy(...)` or `React.lazy(...)` call, or a route `lazy:` property, whose argument is `import(...)` without the reload helper, for example `lazy: () => import(...)` | A tab opened before a deploy breaks on its next navigation. Load a route with `lazy: importWithReload(() => import(...))`, or a component with `lazyWithReload(() => import(...))`, both from `@webority/web-core/router`. |
151
+ | `web-grit-duplex-to-web-type` | A `Duplex.toWeb()` call with a second argument that carries a `type` option, for example `Duplex.toWeb(stream, { type: "bytes" })` | Node 26 deprecates the `type` option, and the warning prints only when the call runs. Call `Duplex.toWeb(stream)` with no options object. |
152
+ | `web-grit-router-view-transition` | A JSX element with a `viewTransition` attribute, an object with a `viewTransition` option (for example `navigate(to, { viewTransition: true })`), a `useViewTransitionState(...)` call, or an arrow function that destructures `isTransitioning` (a router link's render value) | React Router deprecates these in favour of React's `ViewTransition` component (React 19.3+). The APIs still work through React Router v8 and are removed in v9. Wrap the Outlet of a persistent layout in `ViewTransition` from `react`. |
153
+ | `no-legacy-node-sqlite` | `DatabaseSync` or `StatementSync` imported from `node:sqlite` | Node 26.11 renamed them to `Database` and `Statement`; the old names are documentation-only deprecated, so no type definition flags them. Import `Database` and `Statement`, which have the same constructor and methods. |
154
+ | `no-legacy-element-ref` | A read of `.ref` on a value named `child`, `element`, `el` or `elem`, for example `element.ref` | React 19 deprecates `element.ref`; the types tag it `@deprecated`. Read `element.props.ref` in its place. |
155
+ | `no-legacy-context` | A `contextTypes`, `childContextTypes` or `getChildContext` member of a class, a static field of one of those names, or an assignment to one of them. | React 19 removed legacy context and ignores it. Use `createContext` with `useContext`, or a context consumer. |
156
+ | `no-shake-hash-without-output-length` | A `createHash` call with `"shake128"` or `"shake256"` as its only argument, bare or as `crypto.createHash`; a call with an options object is not matched | Node deprecated SHAKE digests created without an explicit output length. Pass `{ outputLength: <bytes the caller needs> }` as the second argument, for example `createHash("shake256", { outputLength: 32 })`. |
157
+ | `no-spawn-args-with-shell` | A `spawn`, `spawnSync`, `execFile` or `execFileSync` call, bare or as a member call (`childProcess.spawn(...)`), with an arguments array as its second argument and `shell: true` in its options | Node's DEP0190: with the shell option the arguments are joined with spaces and not escaped, so a value with shell characters can run a command. Drop `shell: true` and pass the array; where a shell is truly needed, pass one command string built from escaped values. |
151
158
 
152
159
  A plugin finding is an error, so `biome check` and `biome lint` fail on it.
153
160
 
package/biome.jsonc CHANGED
@@ -40,9 +40,11 @@
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-duplex-to-web-type: Duplex.toWeb with a type option, which Node 26 deprecates; the call with no options replaces it.
43
44
  // web-grit-empty-catch: an empty catch block (a comment alone included) swallows the error.
44
45
  // web-grit-raw-query-read: an RTK Query hook result read outside useDataState.
45
46
  // web-grit-route-lazy-reload: a route's lazy or a React.lazy that loads a screen without the reload helper.
47
+ // web-grit-router-view-transition: a React Router view transition API (the viewTransition prop or option, useViewTransitionState, or the isTransitioning render value); React's ViewTransition replaces it.
46
48
  // mobile-grit-unchecked-native-call: a NativeModules call whose result is dropped, voided or swallowed.
47
49
  // mobile-grit-unchecked-native-spec-call: a codegen spec call (a default import from Native<Name>) whose result is dropped, voided or swallowed.
48
50
  // no-raw-form: a JSX form element outside AppForm.tsx; AppForm drops a double submit and carries an idempotency key.
@@ -52,6 +54,10 @@
52
54
  // form-needs-no-validate: a form or AppForm submitted through handleSubmit without noValidate.
53
55
  // no-legacy-component-props: defaultProps or propTypes assigned to a component; React 19 ignores both on a function component.
54
56
  // no-legacy-react-test-api: react-test-renderer, or act from react-dom/test-utils; React 19 retired both.
57
+ // no-legacy-node-sqlite: DatabaseSync or StatementSync imported from node:sqlite; Node 26.11 renamed them to Database and Statement.
58
+ // no-legacy-element-ref: a read of .ref on a React element (child, element, el, elem); React 19 deprecates it and element.props.ref replaces it.
59
+ // no-legacy-context: contextTypes, childContextTypes or getChildContext; React 19 removed legacy context and ignores it.
60
+ // no-shake-hash-without-output-length: createHash with shake128 or shake256 and no outputLength option; Node deprecated the default length.
55
61
  // mobile-grit-navigation-shims: React Navigation 7's migration shims and the removed independent prop.
56
62
  // mobile-grit-accessibility-focus: AccessibilityInfo.setAccessibilityFocus; sendAccessibilityEvent(ref, 'focus') replaces it.
57
63
  // mobile-grit-blur-on-submit: TextInput's removed blurOnSubmit prop; submitBehavior replaces it.
@@ -59,6 +65,7 @@
59
65
  // mobile-grit-experimental-background: the experimental_ prefixed background style keys; the unprefixed keys replace them.
60
66
  // mobile-grit-large-title: the headerLargeTitle screen option React Navigation 8 removes; headerLargeTitleEnabled replaces it.
61
67
  // mobile-grit-navigator-id: a navigator's id prop and getParent with an id, both removed in React Navigation 8.
68
+ // no-spawn-args-with-shell: an arguments array beside shell: true, which Node joins unescaped (DEP0190); an array without the shell option, or one escaped command string, replaces it.
62
69
  "plugins": [
63
70
  "./node_modules/@webority/biome-config/plugins/no-absolute-fill-object.grit",
64
71
  "./node_modules/@webority/biome-config/plugins/mobile-grit-alert-alert.grit",
@@ -71,9 +78,11 @@
71
78
  "./node_modules/@webority/biome-config/plugins/mobile-grit-keyboard-avoiding.grit",
72
79
  "./node_modules/@webority/biome-config/plugins/mobile-grit-keychain-internet.grit",
73
80
  "./node_modules/@webority/biome-config/plugins/web-grit-axios-module-config.grit",
81
+ "./node_modules/@webority/biome-config/plugins/web-grit-duplex-to-web-type.grit",
74
82
  "./node_modules/@webority/biome-config/plugins/web-grit-empty-catch.grit",
75
83
  "./node_modules/@webority/biome-config/plugins/web-grit-raw-query-read.grit",
76
84
  "./node_modules/@webority/biome-config/plugins/web-grit-route-lazy-reload.grit",
85
+ "./node_modules/@webority/biome-config/plugins/web-grit-router-view-transition.grit",
77
86
  "./node_modules/@webority/biome-config/plugins/mobile-grit-unchecked-native-call.grit",
78
87
  "./node_modules/@webority/biome-config/plugins/mobile-grit-unchecked-native-spec-call.grit",
79
88
  "./node_modules/@webority/biome-config/plugins/no-raw-form.grit",
@@ -86,13 +95,18 @@
86
95
  "./node_modules/@webority/biome-config/plugins/web-grit-hand-built-overlay.grit",
87
96
  "./node_modules/@webority/biome-config/plugins/no-legacy-component-props.grit",
88
97
  "./node_modules/@webority/biome-config/plugins/no-legacy-react-test-api.grit",
98
+ "./node_modules/@webority/biome-config/plugins/no-legacy-node-sqlite.grit",
99
+ "./node_modules/@webority/biome-config/plugins/no-legacy-element-ref.grit",
100
+ "./node_modules/@webority/biome-config/plugins/no-legacy-context.grit",
101
+ "./node_modules/@webority/biome-config/plugins/no-shake-hash-without-output-length.grit",
89
102
  "./node_modules/@webority/biome-config/plugins/mobile-grit-navigation-shims.grit",
90
103
  "./node_modules/@webority/biome-config/plugins/mobile-grit-accessibility-focus.grit",
91
104
  "./node_modules/@webority/biome-config/plugins/mobile-grit-blur-on-submit.grit",
92
105
  "./node_modules/@webority/biome-config/plugins/mobile-grit-deep-imports.grit",
93
106
  "./node_modules/@webority/biome-config/plugins/mobile-grit-experimental-background.grit",
94
107
  "./node_modules/@webority/biome-config/plugins/mobile-grit-large-title.grit",
95
- "./node_modules/@webority/biome-config/plugins/mobile-grit-navigator-id.grit"
108
+ "./node_modules/@webority/biome-config/plugins/mobile-grit-navigator-id.grit",
109
+ "./node_modules/@webority/biome-config/plugins/no-spawn-args-with-shell.grit"
96
110
  ],
97
111
  "linter": {
98
112
  "enabled": true,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webority/biome-config",
3
- "version": "0.163.0",
3
+ "version": "0.164.0",
4
4
  "description": "Shared Webority code standards: the Biome lint and format policy and the TypeScript compiler presets for web apps, phone apps, Razor page scripts and Node packages.",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "publishConfig": {
@@ -0,0 +1,22 @@
1
+ language js
2
+
3
+ // React 19 removed legacy context (contextTypes, childContextTypes, getChildContext) and ignores it at run time. A class's static field of these names is the legacy form itself, so it is matched; the sibling no-legacy-component-props skips static fields only because a static defaultProps is valid in React 19.
4
+ or {
5
+ `$x.contextTypes = $_` as $use where {
6
+ register_diagnostic(span=$use, message="Legacy context was removed in React 19. Use createContext with useContext.", severity="error")
7
+ },
8
+ `$x.childContextTypes = $_` as $use where {
9
+ register_diagnostic(span=$use, message="Legacy context was removed in React 19. Use createContext with useContext.", severity="error")
10
+ },
11
+ `$x.getChildContext = $_` as $use where {
12
+ register_diagnostic(span=$use, message="Legacy context was removed in React 19. Use createContext with useContext.", severity="error")
13
+ },
14
+ JsMethodClassMember() as $use where {
15
+ $use <: r"(?s)^(?:static\s+)?getChildContext\s*\(.*",
16
+ register_diagnostic(span=$use, message="Legacy context was removed in React 19. Use createContext with useContext.", severity="error")
17
+ },
18
+ JsPropertyClassMember() as $use where {
19
+ $use <: r"(?s)^(?:static\s+)?(?:contextTypes|childContextTypes)\s*[:=].*",
20
+ register_diagnostic(span=$use, message="Legacy context was removed in React 19. Use createContext with useContext.", severity="error")
21
+ }
22
+ }
@@ -0,0 +1,10 @@
1
+ language js
2
+
3
+ // React 19 deprecates element.ref in favour of element.props.ref. The types only tag element.ref @deprecated, and the
4
+ // deprecated-import lint does not read member access, so this rule reads it.
5
+ // Matched by the receiver name of a React element (child, element, el, elem): GritQL reads no types, and any other
6
+ // object with a .ref field (a form library's field, a ref holder, props.ref) is left alone.
7
+ `$obj.ref` as $use where {
8
+ $obj <: r"^(?:child|element|el|elem)$",
9
+ register_diagnostic(span=$use, message="element.ref is deprecated in React 19 and will be removed from the element type. Read element.props.ref instead.", severity="error")
10
+ }
@@ -0,0 +1,15 @@
1
+ language js
2
+
3
+ // Node 26.11 renamed both classes, the old names are documentation-only deprecated, so no type definition tags them.
4
+ or {
5
+ `import { $names } from $source` as $use where {
6
+ $source <: r"[\"']node:sqlite[\"']",
7
+ $names <: contains `DatabaseSync`,
8
+ register_diagnostic(span=$use, message="DatabaseSync from node:sqlite is deprecated in Node 26.11. Import Database from node:sqlite; it has the same constructor and methods.", severity="error")
9
+ },
10
+ `import { $names } from $source` as $use where {
11
+ $source <: r"[\"']node:sqlite[\"']",
12
+ $names <: contains `StatementSync`,
13
+ register_diagnostic(span=$use, message="StatementSync from node:sqlite is deprecated in Node 26.11. Import Statement from node:sqlite; it has the same methods.", severity="error")
14
+ }
15
+ }
@@ -0,0 +1,11 @@
1
+ language js
2
+
3
+ // Node deprecated SHAKE-128 and SHAKE-256 digests created without options.outputLength (since v25.0.0).
4
+ // Matches the one-argument call only: a call with an options object has two arguments and is not matched.
5
+ or {
6
+ `createHash($alg)` as $call,
7
+ `$hash.createHash($alg)` as $call
8
+ } where {
9
+ $alg <: r"^[\"'`](?i:shake128|shake256)[\"'`]$",
10
+ register_diagnostic(span=$call, message="SHAKE128 and SHAKE256 digests need an explicit outputLength option, because Node deprecated the default length. Pass { outputLength: <the bytes the caller needs> } as the second argument.", severity="error")
11
+ }
@@ -0,0 +1,18 @@
1
+ language js
2
+
3
+ // DEP0190: an arguments array beside shell: true is joined with spaces and not escaped, so a value with shell characters can run as a command.
4
+ // A command string as the first argument, a call with no array, or an options object without the literal shell: true is not matched.
5
+ or {
6
+ `spawn($cmd, $args, $opts)` as $call,
7
+ `spawnSync($cmd, $args, $opts)` as $call,
8
+ `execFile($cmd, $args, $opts)` as $call,
9
+ `execFileSync($cmd, $args, $opts)` as $call,
10
+ `$obj.spawn($cmd, $args, $opts)` as $call,
11
+ `$obj.spawnSync($cmd, $args, $opts)` as $call,
12
+ `$obj.execFile($cmd, $args, $opts)` as $call,
13
+ `$obj.execFileSync($cmd, $args, $opts)` as $call
14
+ } where {
15
+ $args <: JsArrayExpression(),
16
+ $opts <: contains `shell: true`,
17
+ register_diagnostic(span=$call, message="An arguments array with shell: true is Node's DEP0190: the arguments are joined with spaces and not escaped. Drop shell: true and pass the array; where a shell is truly needed, pass one command string built from escaped values.", severity="error")
18
+ }
@@ -0,0 +1,14 @@
1
+ language js
2
+
3
+ // Node 26 deprecates the type option of Duplex.toWeb(): the runtime warns only when the call runs, so no build reports a new use.
4
+ // The replacement is the call with no options object, Duplex.toWeb(stream).
5
+ or {
6
+ `Duplex.toWeb($stream, $options)` as $call,
7
+ `$ns.Duplex.toWeb($stream, $options)` as $call
8
+ } where {
9
+ $options <: contains or {
10
+ `type: $value`,
11
+ `type`
12
+ },
13
+ register_diagnostic(span=$call, message="Node 26 deprecates the type option of Duplex.toWeb(). Call Duplex.toWeb(stream) with no options object.", severity="error")
14
+ }
@@ -2,13 +2,23 @@ language js
2
2
 
3
3
  // The library's own sources build the dialogs and overlays the rule points to, so they are exempt.
4
4
  // Only a plain HTML element (lower-case name) is hand-built; a component passing role="dialog" is the library's own.
5
+ // A lower-case dialog element or popover attribute is the native overlay, drawn with no focus trap or stacking from the library.
5
6
  or {
6
- JsxOpeningElement(name=$name) as $el,
7
- JsxSelfClosingElement(name=$name) as $el
8
- } where {
9
- $name <: r"[a-z][a-z0-9-]*",
10
- $el <: r"(?s).*(?:\brole=\"(?:dialog|alertdialog)\"|\baria-modal\b).*",
11
- $filename <: not r"^(?:.*/)?(?:__tests__/.*|[^/]*\.test\.[jt]sx?)$",
12
- $filename <: not r"^(?:.*/)?packages/(?:ui-react|elements)/src/.*",
13
- register_diagnostic(span=$el, message="A hand-built dialog or overlay misses the library's focus trap, Escape and stacking. Use AppModal, AppDrawer, AppConfirmDialog, AppPopover or AppDropdown from @webority/ui-react.", severity="error")
7
+ or {
8
+ JsxOpeningElement(name=$name) as $el,
9
+ JsxSelfClosingElement(name=$name) as $el
10
+ } where {
11
+ $name <: r"[a-z][a-z0-9-]*",
12
+ $el <: r"(?s)(?:<dialog[\s/>]|.*(?:\brole=\"(?:dialog|alertdialog)\"|\baria-modal\b|\spopover(?:[\s/>=]|$))).*",
13
+ $filename <: not r"^(?:.*/)?(?:__tests__/.*|[^/]*\.test\.[jt]sx?)$",
14
+ $filename <: not r"^(?:.*/)?packages/(?:ui-react|elements)/src/.*",
15
+ register_diagnostic(span=$el, message="A hand-built dialog or overlay misses the library's focus trap, Escape and stacking. Use AppModal, AppDrawer, AppConfirmDialog, AppPopover or AppDropdown from @webority/ui-react. react-bootstrap overlays draw under the library's and are inert behind them.", severity="error")
16
+ },
17
+ `import $clause from $source` as $import where {
18
+ $source <: r"[\"']react-bootstrap(?:/[^\"']*)?[\"']",
19
+ $clause <: r"(?s).*\b(?:Modal|Offcanvas|Overlay|OverlayTrigger|Tooltip|Popover|Dropdown)\b.*",
20
+ $filename <: not r"^(?:.*/)?(?:__tests__/.*|[^/]*\.test\.[jt]sx?)$",
21
+ $filename <: not r"^(?:.*/)?packages/(?:ui-react|elements)/src/.*",
22
+ register_diagnostic(span=$import, message="A hand-built dialog or overlay misses the library's focus trap, Escape and stacking. Use AppModal, AppDrawer, AppConfirmDialog, AppPopover or AppDropdown from @webority/ui-react. react-bootstrap overlays draw under the library's and are inert behind them.", severity="error")
23
+ }
14
24
  }
@@ -0,0 +1,28 @@
1
+ language js
2
+
3
+ // React Router deprecates its view transition APIs in favour of React's ViewTransition component (React Router 8.5.0 changelog).
4
+ // The APIs keep working through React Router v8 and are removed in v9, so this rule stops the first new use.
5
+ // React's own ViewTransition and the browser's document.startViewTransition are not matched.
6
+ // Each regex matches the whole node text. The prop and the option are matched on their own attribute or member, anchored at
7
+ // its name, so a string that merely contains the word, or an object that only encloses the option, is not matched.
8
+ or {
9
+ JsxAttribute() as $attr where {
10
+ $attr <: r"(?s)^viewTransition\b.*",
11
+ register_diagnostic(span=$attr, message="React Router view transition APIs are deprecated in favour of the ViewTransition component from react, available in React 19.3+. Wrap the Outlet of a persistent layout in ViewTransition instead.", severity="error")
12
+ },
13
+ JsPropertyObjectMember() as $member where {
14
+ $member <: r"(?s)^viewTransition\s*:.*",
15
+ register_diagnostic(span=$member, message="React Router view transition APIs are deprecated in favour of the ViewTransition component from react, available in React 19.3+. Wrap the Outlet of a persistent layout in ViewTransition instead.", severity="error")
16
+ },
17
+ JsShorthandPropertyObjectMember() as $member where {
18
+ $member <: r"^viewTransition$",
19
+ register_diagnostic(span=$member, message="React Router view transition APIs are deprecated in favour of the ViewTransition component from react, available in React 19.3+. Wrap the Outlet of a persistent layout in ViewTransition instead.", severity="error")
20
+ },
21
+ `useViewTransitionState($...)` as $use where {
22
+ register_diagnostic(span=$use, message="React Router view transition APIs are deprecated in favour of the ViewTransition component from react, available in React 19.3+. Wrap the Outlet of a persistent layout in ViewTransition instead.", severity="error")
23
+ },
24
+ JsArrowFunctionExpression() as $fn where {
25
+ $fn <: r"(?s).*\(\s*\{[^}]*\bisTransitioning\b[^}]*\}\s*\)\s*=>.*",
26
+ register_diagnostic(span=$fn, message="React Router view transition APIs are deprecated in favour of the ViewTransition component from react, available in React 19.3+. Wrap the Outlet of a persistent layout in ViewTransition instead.", severity="error")
27
+ }
28
+ }