Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .changeset/eslint-react19-context-ref.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
'@hyperdx/app': patch
---

Adopt React 19 context and ref APIs across the app and enforce them via ESLint.
Render `<Context>` directly instead of `<Context.Provider>`, use the `use` hook
instead of `useContext`, and pass `ref` as a regular prop instead of wrapping
components in `forwardRef`. The corresponding `@eslint-react/no-context-provider`,
`no-use-context`, and `no-forward-ref` rules are promoted to `error` and the
app's `--max-warnings` ceiling is lowered. Behavior is unchanged.
6 changes: 6 additions & 0 deletions packages/app/eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,12 @@ export default [

'react-hook-form/no-use-watch': 'error',
'@eslint-react/no-unstable-default-props': 'error',
// React 19 API adoption (all migrated): render <Context> instead of
// <Context.Provider>, use the `use` hook instead of `useContext`, and
// pass `ref` as a regular prop instead of wrapping in forwardRef.
'@eslint-react/no-context-provider': 'error',
'@eslint-react/no-use-context': 'error',
'@eslint-react/no-forward-ref': 'error',
'@typescript-eslint/ban-ts-comment': 'error',
// Empty no-op functions are common and intentional (test mocks, default
// callback props like onClose/onChange). Flagging them adds noise without
Expand Down
2 changes: 1 addition & 1 deletion packages/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"build:clickhouse": "NEXT_PUBLIC_THEME=clickstack NEXT_PUBLIC_IS_LOCAL_MODE=true NEXT_PUBLIC_CLICKHOUSE_BUILD=true next build --webpack && node scripts/prepare-clickhouse-build-export.js",
"run:clickhouse": "test -d out && npx rimraf tmp && mkdir tmp && cp -r out tmp/clickstack && echo 'visit http://localhost:3000/clickstack to start' && npx serve tmp -l 3000 || echo 'run build:clickhouse first'",
"start": "next start",
"lint": "npx eslint . --ext .ts,.tsx --max-warnings 601",
"lint": "npx eslint . --ext .ts,.tsx --max-warnings 564",
"lint:fix": "npx eslint . --ext .ts,.tsx --fix",
"lint:styles": "stylelint **/*/*.{css,scss}",
"ci:lint": "yarn lint && yarn tsc --noEmit && yarn lint:styles --quiet",
Expand Down
Loading
Loading