Files
millionco__react-doctor/vite.config.ts
T
Aiden Bai d71a6bf6eb feat(react-doctor): adopt user lint config, ship as ESLint plugin, remove browser surface (#151)
Squashes work that closes #143 plus follow-on cleanup of the browser
surface and dead-code.

**`adoptExistingLintConfig` (default-on)** — when a project has a
JSON-format `.oxlintrc.json` or `.eslintrc.json` at the scanned
directory or any ancestor up to the nearest project boundary, that
config is folded into the same scan via oxlint's `extends` field.
Diagnostics from the user's existing rules count toward the 0–100
health score alongside the curated react-doctor rule set; if oxlint
can't load the user config, react-doctor logs the reason on stderr
and retries the scan once without `extends`. JS / TS configs are
silently skipped (oxlint's `extends` can't evaluate them). Coverage
broadened to `.ts` and `.js` files (previously the parser dropped
non-JSX). Closes #143.

**`react-doctor/eslint-plugin` flat-config export** — the same
react-doctor rule set is shipped as an ESLint flat-config plugin so
projects that already run ESLint can wire it up without depending on
the CLI. Includes presets (`recommended`, `next`, `react-native`,
`tanstack-start`, `tanstack-query`, `all`) plus cherry-picking.

**Removed browser entrypoints, browser CLI, and `react-doctor-browser`
package** — the in-browser diagnostics pipeline (`react-doctor/browser`
+ `/worker`), the `react-doctor browser …` CLI subcommand
(`start` / `stop` / `status` / `snapshot` / `screenshot` /
`playwright`), and the standalone `react-doctor-browser` workspace
package (Playwright + CDP + cookie extraction) are gone. Nothing in
the monorepo consumed them and they pulled in a heavy dep footprint
(`playwright`, `libsql`). Source is preserved on the
`archive/browser` branch.

**`diagnose-core` engine inlined into `index.ts::diagnose`** —
the dependency-injection shape was designed for browser sharing.
Only one caller now, so collapsed into a flat orchestrator. Score
helpers moved from `src/core/` to `src/utils/`; `src/core/` directory
removed.

**Smaller cleanups** — drop unused `matchGlobPattern` wrapper,
`isMemberProperty` import in nextjs rule, `fileContainsPattern`
helper, and various dead test locals; ignore `tests/fixtures/**`
from workspace lint and add `.oxlintignore` so `lint --fix` against
fixture paths can't strip the `debugger;` statements that
`adoptExistingLintConfig` tests assert on.

Tests: 452 / 452 pass on Node 22 + 24. Build smoke green.
2026-05-06 22:41:34 -07:00

24 lines
493 B
TypeScript

import { defineConfig } from "vite-plus";
export default defineConfig({
staged: {
"*.{js,ts,tsx}": "vp check --fix",
},
lint: {
ignorePatterns: [
".turbo",
"dist",
"build",
"node_modules",
"packages/react-doctor/tests/fixtures/**",
],
plugins: ["typescript", "react", "import"],
rules: {},
},
fmt: {
semi: true,
singleQuote: false,
ignorePatterns: [".turbo", "node_modules", "dist", "build", "pnpm-lock.yaml"],
},
});