Rules Overview

Lynx Doctor rules are an executable distillation of Lynx community skills. Rules have a first-level category and a second-level subcategory.

The CLI category field uses the first-level domain: reactlynx, lynx-ui, rspeedy, or lynx-css.

reactlynx

Source skill: reactlynx-best-practices

Additional sources: lynx-typescript · lynx-api-docs

threading

  • reactlynx/background-only-api: detects lynx.getJSModule and NativeModules outside an obvious background-only context.

lifecycle

  • reactlynx/avoid-use-layout-effect: flags useLayoutEffect, which does not provide React DOM style synchronous layout behavior in ReactLynx.

events

  • reactlynx/main-thread-handler-directive: checks that main-thread:* event handlers point at functions with a top-level "main thread" directive.

configuration

  • reactlynx/global-props-event-mode: warns when globalPropsMode is event while code reads lynx.__globalProps directly without useGlobalPropsChanged.
  • reactlynx/typescript-jsx-import-source: checks tsconfig.json for jsxImportSource and isolatedModules settings expected by ReactLynx and Rspeedy.
  • reactlynx/types-package-missing: warns when a ReactLynx package does not declare @lynx-js/types.

performance

  • reactlynx/lazy-without-suspense: detects lazy component loading without an obvious Suspense boundary in the same file.

elements and packaging

  • reactlynx/no-dom-elements: warns about common Web elements in Lynx source.
  • reactlynx/native-element-events: checks Web event props on known native elements.
  • reactlynx/library-runtime-entry: warns about universal TS/TSX runtime entries in component libraries.
  • reactlynx/library-missing-artifact: with --package, checks literal runtime/declaration files after building.

lynx-ui

Source skill: lynx-ui

imports

  • lynx-ui/prefer-public-aggregate-import: warns when code imports directly from @lynx-js/lynx-ui-* component packages.

component-api

  • lynx-ui/button-uses-on-click: detects Button usage with native bind* or catch* tap handlers instead of the documented onClick prop.

gestures

  • lynx-ui/gesture-components-enable-new-gesture: warns when gesture-driven lynx-ui components are used without enableNewGesture: true.

rspeedy

Source skill: rspeedy-bundle-size

bundle-size

  • rspeedy/no-export-star-barrels: detects export * barrel files that can defeat tree-shaking and pull extra code into rspeedy bundles.
  • rspeedy/no-eval-in-bundle-code: detects eval() in source files because it can poison production name mangling in bundled output.

List local rules:

npx lynx-doctor@latest rules list

Explain one rule:

npx lynx-doctor@latest rules explain reactlynx/background-only-api

lynx-css

See CSS compatibility for lynx-css/unsupported, lynx-css/requires-newer-version, and lynx-css/conditional-support, including explicit targets and unknown coverage.