Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
12 changes: 10 additions & 2 deletions eslint.config.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import { createRequire } from "node:module";
import { fixupPluginRules } from "@eslint/compat";
import { defineConfig } from "eslint/config";
import globals from "globals";

const require = createRequire(import.meta.url);
const eslintRequire = createRequire(require.resolve("eslint/package.json"));

const globals = eslintRequire("globals");
const reactAppConfig = require("eslint-config-react-app");

const flowtypePlugin = fixupPluginRules(require("eslint-plugin-flowtype"));
Expand All @@ -27,6 +26,9 @@ const reactAppTsOverride = reactAppConfig.overrides.find(
if (!reactAppTsOverride) {
throw new Error("Could not find the react-app TypeScript override.");
}
if (!jestPlugin.configs) {
throw new Error("Could not find the jest plugin configs.");
}

const jestRecommended = jestPlugin.configs["flat/recommended"];

Expand Down Expand Up @@ -119,6 +121,12 @@ export default defineConfig([
"react/jsx-uses-vars": "warn",
},
},
{
files: ["**/*.config.js", "**/jest.config*.js"],
rules: {
"import/no-anonymous-default-export": "off",
},
},
{
files: ["**/*.{ts,tsx}"],
languageOptions: {
Expand Down
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,13 @@
"eslint-plugin-react": "^7.37.5",
"eslint-plugin-react-hooks": "^7.1.1",
"fast-glob": "3.3.3",
"globals": "^17.6.0",
"isbot": "^5.1.40",
"jest": "^30.4.2",
"jest-environment-jsdom": "^30.4.1",
"jsdom": "^29.1.1",
"react": "catalog:",
"react-dom": "catalog:",
"picocolors": "^1.1.1",
"prettier": "^3.8.3",
"prompts": "^2.4.2",
Expand Down
2 changes: 0 additions & 2 deletions packages/react-router-dev/cli/run.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { readFileSync } from "node:fs";
import path from "node:path";
import arg from "arg";
import semver from "semver";
import colors from "picocolors";
Expand Down
5 changes: 4 additions & 1 deletion packages/react-router-dev/vite/has-dependency.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ export function hasDependency({
}) {
try {
return Boolean(nodeRequire.resolve(name, { paths: [rootDirectory] }));
} catch (err) {
} catch (
// eslint-disable-next-line @typescript-eslint/no-unused-vars
e
) {
return false;
}
}
24 changes: 1 addition & 23 deletions packages/react-router-dev/vite/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// context but want to use Vite's ESM build since Vite 7+ is ESM only
import type * as Vite from "vite";
import { type BinaryLike, createHash } from "node:crypto";
import { existsSync, readFileSync, readdirSync, rmSync } from "node:fs";
import { existsSync, readFileSync, readdirSync } from "node:fs";
import {
cp,
mkdir,
Expand Down Expand Up @@ -221,28 +221,6 @@ const isRouteVirtualModule = (id: string): boolean => {
return isRouteEntryModuleId(id) || isRouteChunkModuleId(id);
};

const isServerBuildVirtualModuleId = (id: string): boolean => {
return id.split("?")[0] === virtual.serverBuild.id;
};

const getServerBuildFile = (viteManifest: Vite.Manifest): string => {
let serverBuildIds = Object.keys(viteManifest).filter(
isServerBuildVirtualModuleId,
);

invariant(
serverBuildIds.length <= 1,
"Multiple server build files found in manifest",
);

invariant(
serverBuildIds.length === 1,
"Server build file not found in manifest",
);

return viteManifest[serverBuildIds[0]].file;
};

type ReactRouterPluginContext = {
buildManifest: BuildManifest | null;
rootDirectory: string;
Expand Down
1 change: 0 additions & 1 deletion packages/react-router/lib/rsc/server.rsc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import {
type Params,
type ShouldRevalidateFunction,
type RouteMatch,
type RouteObject,
type RouterContextProvider,
type TrackedPromise,
isAbsoluteUrl,
Expand Down
65 changes: 17 additions & 48 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.