@noctcore/eslint-plugin-rsc
v0.1.2
Published
React Server Components and App Router correctness rules: control-flow errors that must not be swallowed.
Maintainers
Readme
@noctcore/eslint-plugin-rsc
React Server Components and App Router correctness rules: the server-side control flow that
compiles, type-checks and still silently does the wrong thing. Framework-neutral where the RSC model
allows; a rule tied to one framework's API (Next.js next/navigation, for example) says so and only
fires on that framework's imports.
Docs: noctcore.github.io/eslint-plugins/packages/rsc
Not a good fit for anything outside a React Server Components codebase, where it does nothing.
Requirements
- ESLint 9 or newer, flat config (
eslint.config.js) only. configs.recommendedregisters the plugin and sets rule severities, nothing else. It sets nofilesand no parser, so it applies to whatever files the rest of your config lints. To lint TypeScript, add afilespattern and@typescript-eslint/parser, as in the quick start.
Install
bun add -D @noctcore/eslint-plugin-rsc @typescript-eslint/parser # or npm i -D / pnpm add -DQuick start
// eslint.config.js
import tsParser from '@typescript-eslint/parser';
import rsc from '@noctcore/eslint-plugin-rsc';
export default [
{
...rsc.configs.recommended,
files: ['**/*.{ts,tsx}'],
languageOptions: { parser: tsParser },
},
];Rules
✅ on in recommended (error) · 🔘 opt-in: not on in recommended, enable it yourself · ⚙️ needs options · 🔧 --fix · 💡 suggestions · 💭 needs type info · ❌ deprecated
| Rule | Description | Preset | ⚙️ | 🔧 | 💡 | 💭 |
| --- | --- | :-: | :-: | :-: | :-: | :-: |
| no-navigation-throw-in-try | Disallow redirect(), notFound() and the other throwing next/navigation calls inside a try whose catch swallows the error instead of rethrowing it. | ✅ | | | | |
Severity policy
Every rule is error or off, never warn: a warning is a rule nobody obeys. See the
severity policy.
