Repository navigation
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Co-authored-by: manudeli <61593290+manudeli@users.noreply.github.com>
Co-authored-by: manudeli <61593290+manudeli@users.noreply.github.com>
…ntation Co-authored-by: manudeli <61593290+manudeli@users.noreply.github.com>
|
@copilot rebase please |
People can be co-author:
|
| }) => <>{children(useSuspenseInfiniteQuery(options))}</> | ||
| }) => ( | ||
| <> | ||
| {/* eslint-disable-next-line @suspensive/check-parent-suspense */} |
There was a problem hiding this comment.
@copilot In packages/*, ignore this eslint rule
There was a problem hiding this comment.
I've disabled the @suspensive/check-parent-suspense rule for all files in packages/**/*.{ts,tsx} by adding a configuration block to the ESLint config and removing the individual eslint-disable comments from 13 files across the packages.
The rule is now ignored in all packages while still being enforced in examples and application code.
Commit: 2146269
Co-authored-by: manudeli <61593290+manudeli@users.noreply.github.com>
Sure! Thank you for giving me the opportunity. |
|
@copilot resolve conflict |
I've successfully resolved the merge conflicts and rebased the branch onto the latest main. The conflicts were in:
The rebase is complete and all ESLint rule tests are still passing. The branch is now up to date with the latest main branch changes. Commit: 0ded5c5 |
|
I love it! I really hope this works. I'll review it as well! |
|
@copilot rebase this |
There was a problem hiding this comment.
🟡 Changes recommended
Hook-boundary analysis produces false results, and the package exemption does not apply during package-local lint runs.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
Files not reviewed (1)
- pnpm-lock.yaml: Generated file
Suppressed comments (1)
configs/eslint-config/rules/check-parent-suspense.js:98
- Matching only the callee's spelling does not reliably detect the configured API.
import { useSuspenseQuery as useQuery } ...; useQuery()is missed, while an unrelated locally declareduseSuspenseQuery()is reported; member expressions have the same shadowing problem. Resolve the binding/import (and apply the same approach to configured JSX components andlazy) so aliases and unrelated symbols are handled correctly.
} else if (node.callee.type === 'MemberExpression' && node.callee.property.type === 'Identifier') {
name = node.callee.property.name
}
return name && suspenseHooks.has(name)
- Files reviewed: 17/18 changed files
- Comments generated: 2
- Review effort level: Balanced
| let parent = node.parent | ||
| while (parent) { | ||
| if (parent.type === 'JSXElement' && parent.openingElement && parent.openingElement.name) { | ||
| const elementName = getJSXElementName(parent.openingElement.name) | ||
| if (suspenseWrappers.has(elementName)) { |
| { | ||
| files: ['packages/**/*.{ts,tsx}'], | ||
| rules: { | ||
| '@suspensive/check-parent-suspense': 'off', | ||
| }, |
# Conflicts: # configs/eslint-config/index.js # configs/eslint-config/package.json # examples/next-streaming-react-query/src/app/page.tsx # examples/visualization/src/app/react/zodSearchParams/page.tsx # examples/vite-react-18-suspense-prerender-siblings-problem/tsconfig.tsbuildinfo # pnpm-lock.yaml Co-authored-by: manudeli <61593290+manudeli@users.noreply.github.com>
Merged the latest Commits:
|
This PR implements a new ESLint rule
@suspensive/check-parent-suspensethat ensures components using Suspense-related APIs are properly wrapped in a Suspense boundary.What it does
The rule detects usage of Suspense-related APIs and validates they are wrapped in a
<Suspense>component:Detected APIs:
useSuspenseQuery,useSuspenseInfiniteQuery,useSuspenseQueriesSuspenseQuery,SuspenseInfiniteQuery,SuspenseQuerieslazy()functionConfiguration
The rule is enabled by default in React TypeScript configurations but disabled for all files in
packages/**to exempt library code from the check while still enforcing it in application code and examples.Examples
❌ Before (produces errors):
✅ After (correct usage):
Implementation details
configs/eslint-config/rules/check-parent-suspense.js@suspensive/eslint-configand enabled by default in React TypeScript configurationspackages/**/*.{ts,tsx}files to allow library components that are designed to be used within Suspense boundariesRecent Updates
configs/eslint-config/package.jsonandpnpm-lock.yamlpackages/**/*.{ts,tsx}filesReal-world impact
The rule successfully identified several legitimate issues in the existing codebase where Suspense-related APIs were used without proper Suspense boundaries, demonstrating its practical value for preventing runtime errors.
For cases where the rule is too strict, developers can use
// eslint-disable-next-line @suspensive/check-parent-suspenseto disable the rule locally, though this is typically not needed since library code in packages is automatically exempted.Fixes #1654.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.