Skip to content

Commit 83cf882

Browse files
feat: add support for ReactRouter 7
1 parent 4b6990d commit 83cf882

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

src/configs/react.ts

+17
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import { interopDefault, loadPackages } from "../utils";
1616
const ReactRefreshAllowConstantExportPackages = ["vite"];
1717
const RemixPackages = ["@remix-run/node", "@remix-run/react", "@remix-run/serve", "@remix-run/dev"];
1818
const NextJsPackages = ["next"];
19+
const ReactRouterPackages = ["react-router"];
1920

2021
export async function react(
2122
options: Readonly<
@@ -36,6 +37,7 @@ export async function react(
3637
const isAllowConstantExport = ReactRefreshAllowConstantExportPackages.some((i) => isPackageExists(i));
3738
const isUsingRemix = RemixPackages.some((i) => isPackageExists(i));
3839
const isUsingNext = NextJsPackages.some((i) => isPackageExists(i));
40+
const isUsingReactRouter = ReactRouterPackages.some((i) => isPackageExists(i));
3941

4042
const plugins =
4143
((pluginReact.configs?.["all"] as any)?.plugins as Record<string, ESLint.Plugin> | undefined) ??
@@ -98,6 +100,21 @@ export async function react(
98100
? ["config", "generateStaticParams", "metadata", "generateMetadata", "viewport", "generateViewport"]
99101
: []),
100102
...(isUsingRemix ? ["meta", "links", "headers", "loader", "action"] : []),
103+
...(isUsingReactRouter
104+
? [
105+
"action",
106+
"clientAction",
107+
"clientloader",
108+
"ErrorBoundary",
109+
"handle",
110+
"headers",
111+
"HydrateFallback",
112+
"links",
113+
"loader",
114+
"meta",
115+
"shouldRevalidate",
116+
]
117+
: []),
101118
],
102119
},
103120
],

0 commit comments

Comments
 (0)