react-doctor 0.7.6-dev.dfd47a7 → 0.7.6-dev.e026a23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.js CHANGED
@@ -1,5 +1,5 @@
1
1
 
2
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="63b8a227-543e-5501-a998-58c03a1fb10e")}catch(e){}}();
2
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="bc56f5c4-5b95-5727-8e86-d43a534abbbc")}catch(e){}}();
3
3
  import { createRequire } from "node:module";
4
4
  import * as NodeChildProcess from "node:child_process";
5
5
  import { execFile, execFileSync, spawn, spawnSync } from "node:child_process";
@@ -40762,9 +40762,7 @@ const setColorEnabled = (enabled) => {
40762
40762
  highlighter.gray = colors.gray;
40763
40763
  highlighter.bold = colors.bold;
40764
40764
  };
40765
- const NEXT_ENTRY_FILE_PATTERN = /^(?:\.\/)?(?:src\/)?(?:middleware|proxy)\.(?:tsx?|jsx?|mts|mjs)$/;
40766
- const shouldIncludeExplicitLintPath = (filePath, project) => JSX_FILE_PATTERN.test(filePath) || project?.framework === "nextjs" && NEXT_ENTRY_FILE_PATTERN.test(filePath);
40767
- const computeExplicitLintIncludePaths = (includePaths, project) => includePaths.length > 0 ? includePaths.filter((filePath) => shouldIncludeExplicitLintPath(filePath, project)) : void 0;
40765
+ const computeExplicitLintIncludePaths = (includePaths) => includePaths.length > 0 ? includePaths.filter(isLintableSourceFile) : void 0;
40768
40766
  const LINGUIST_ATTRIBUTE_PATTERN = /^linguist-(?:vendored|generated)(?:=([a-zA-Z0-9]+))?$/i;
40769
40767
  const FALSY_VALUES = new Set([
40770
40768
  "false",
@@ -41603,11 +41601,11 @@ const resolveDeadCodeTimeout = (input) => {
41603
41601
  phaseTimeoutMs: workerTimeoutMs + DEAD_CODE_PHASE_TIMEOUT_OVER_WORKER_MS
41604
41602
  };
41605
41603
  };
41606
- const resolveLintIncludePaths = (rootDirectory, userConfig, project) => {
41604
+ const resolveLintIncludePaths = (rootDirectory, userConfig) => {
41607
41605
  if (!Array.isArray(userConfig?.ignore?.files) || userConfig.ignore.files.length === 0) return;
41608
41606
  const ignoredPatterns = compileIgnoredFilePatterns(userConfig);
41609
41607
  return listSourceFiles(rootDirectory).filter((filePath) => {
41610
- if (!shouldIncludeExplicitLintPath(filePath, project)) return false;
41608
+ if (!isLintableSourceFile(filePath)) return false;
41611
41609
  return !isFileIgnoredByPatterns(filePath, rootDirectory, ignoredPatterns);
41612
41610
  });
41613
41611
  };
@@ -45489,7 +45487,7 @@ const runInspect = (input, hooks = {}) => gen(function* () {
45489
45487
  directory: scanDirectory,
45490
45488
  repo
45491
45489
  }).pipe(orElseSucceed(() => null)) : succeed$2(null));
45492
- const lintIncludePaths = (input.skipJsxIncludeFilter ? input.includePaths.length > 0 ? [...input.includePaths] : void 0 : computeExplicitLintIncludePaths([...input.includePaths], project)) ?? resolveLintIncludePaths(scanDirectory, resolvedConfig.config, project);
45490
+ const lintIncludePaths = (input.skipExplicitIncludePathFilter ? input.includePaths.length > 0 ? [...input.includePaths] : void 0 : computeExplicitLintIncludePaths([...input.includePaths])) ?? resolveLintIncludePaths(scanDirectory, resolvedConfig.config);
45493
45491
  const fallbackScannedFilePaths = input.suppressScanSummary ? (lintIncludePaths ?? (yield* filesService.listSourceFiles(scanDirectory))).map((relativePath) => Path.resolve(scanDirectory, relativePath)) : [];
45494
45492
  const beforeLint = hooks.beforeLint ?? NO_HOOKS.beforeLint;
45495
45493
  const afterLint = hooks.afterLint ?? NO_HOOKS.afterLint;
@@ -46667,7 +46665,7 @@ const makeNoopConsole = () => ({
46667
46665
  });
46668
46666
  //#endregion
46669
46667
  //#region src/cli/utils/version.ts
46670
- const VERSION = "0.7.6-dev.dfd47a7";
46668
+ const VERSION = "0.7.6-dev.e026a23";
46671
46669
  //#endregion
46672
46670
  //#region src/cli/utils/json-mode.ts
46673
46671
  let context = null;
@@ -47036,13 +47034,13 @@ const isDevVersion = (version) => version === "0.0.0" || version.includes("-");
47036
47034
  * uploads source-map artifacts under, so stack frames symbolicate. Honors the
47037
47035
  * standard `SENTRY_RELEASE` override.
47038
47036
  */
47039
- const resolveSentryRelease = () => process.env.SENTRY_RELEASE || `react-doctor@0.7.6-dev.dfd47a7`;
47037
+ const resolveSentryRelease = () => process.env.SENTRY_RELEASE || `react-doctor@0.7.6-dev.e026a23`;
47040
47038
  /**
47041
47039
  * Deployment environment shown in Sentry's environment filter. Defaults to
47042
47040
  * `production` for tagged releases and `development` for dev/unbuilt versions,
47043
47041
  * overridable via the standard `SENTRY_ENVIRONMENT` env var.
47044
47042
  */
47045
- const resolveSentryEnvironment = () => process.env.SENTRY_ENVIRONMENT || (isDevVersion("0.7.6-dev.dfd47a7") ? "development" : "production");
47043
+ const resolveSentryEnvironment = () => process.env.SENTRY_ENVIRONMENT || (isDevVersion("0.7.6-dev.e026a23") ? "development" : "production");
47046
47044
  /**
47047
47045
  * Performance-tracing sample rate in `[0, 1]`. Reads `SENTRY_TRACES_SAMPLE_RATE`
47048
47046
  * (set to `0` to disable tracing) and falls back to
@@ -59202,7 +59200,7 @@ const buildDirtyPathContentFingerprint = (absolutePath, statusCode) => {
59202
59200
  return null;
59203
59201
  }
59204
59202
  if (!stats.isFile()) return null;
59205
- if (stats.size > 10485760) return `stat:${stats.mtimeMs}:${stats.size}`;
59203
+ if (stats.size > 10485760) return null;
59206
59204
  return hashFileContents(absolutePath);
59207
59205
  };
59208
59206
  const buildWorktreeFingerprint = (projectDirectory) => {
@@ -59676,7 +59674,8 @@ const buildScanAttributes = (input) => {
59676
59674
  hasCustomConfig: input.hasCustomConfig,
59677
59675
  rulesConfigured: ruleKeys.length,
59678
59676
  rulesDisabled: ruleKeys.filter((key) => ruleOverrides[key] === "off").length,
59679
- fileCount: input.result?.scannedFileCount ?? null
59677
+ fileCount: input.result?.scannedFileCount ?? null,
59678
+ nonJsxFileCount: input.result?.analyzedFiles?.filter((filePath) => !JSX_FILE_PATTERN.test(filePath)).length ?? null
59680
59679
  });
59681
59680
  };
59682
59681
  /**
@@ -65181,7 +65180,7 @@ ${highlighter.dim("Learn more:")}
65181
65180
  ${highlighter.info(CI_URL)}
65182
65181
  `;
65183
65182
  const collectCategoryOption = (value, previousValues) => [...previousValues ?? [], value];
65184
- const program = new Command().name("react-doctor").description("Diagnose React codebase health").version(VERSION, "-v, --version", "display the version number").argument("[directory]", "project directory to scan", ".").option("--lint", "enable linting").option("--no-lint", "skip linting").option("--dead-code", "enable dead-code analysis (default)").option("--no-dead-code", "skip dead-code analysis (unused files / exports / dependencies, circular imports)").option("--supply-chain", "enable the dependency supply-chain scan (default)").option("--no-supply-chain", "skip the dependency supply-chain scan (Socket.dev dependency health checks)").option("--verbose", "show every rule and per-file details (default shows top 3 rules)").option("--debug", "force a Sentry trace and print its id at the end (paste it into a bug report)").option("--output-dir <dir>", "directory for the full diagnostics dump (default: a temp folder)").option("--score", "output only the score").option("--json", "output a single structured JSON report (suppresses other output)").option("--json-compact", "with --json, emit compact JSON (no indentation)").option("--json-out <path>", "with --json, write the report to a file instead of stdout").option("-y, --yes", "skip prompts, scan all workspace projects").option("--no-parallel", "lint serially with one worker (default: parallel across CPU cores; set the worker count with REACT_DOCTOR_PARALLEL)").option("--project <name>", "select projects: workspace names or directory paths (comma-separated for multiple); overrides the `projects` config field").option("--scope <value>", "how much to scan/report: full (default), files, changed (only new issues vs base), or lines (only changed lines)").option("--base <ref>", "base git ref for files/changed/lines scope (auto-detected when omitted)").addOption(new Option("--diff [base]", "[deprecated] alias for --scope changed (pass `false` to force a full scan)").hideHelp()).addOption(new Option("--changed-files-from <file>", "scan source files listed in a newline-delimited changed-files file").hideHelp()).option("--no-score", "skip the score API, the share URL, and crash reporting").addOption(new Option("--category <category>", "only show diagnostics in a category (repeatable; e.g. Security)").argParser(collectCategoryOption)).option("--no-telemetry", "alias for --no-score (skip the score API, share URL, and crash reporting)").option("--staged", "scan only staged (git index) files for pre-commit hooks").option("--max-duration <seconds>", "scan time budget for the whole run, shared across workspace projects: past it, remaining lint batches and dead-code are skipped and partial results are reported (skipped files are listed in the JSON report)").option("--blocking <level>", "severity that fails CI: error (default), warning, or none (advisory)").addOption(new Option("--fail-on <level>", "[deprecated] alias for --blocking <level>").hideHelp()).option("--no-respect-inline-disables", "audit mode: neutralize inline lint suppressions before scanning").option("--warnings", "show warning-severity diagnostics (default)").option("--no-warnings", "hide warning-severity diagnostics (errors only)").option("--color", "force colored output").option("--no-color", "disable colored output (also honors NO_COLOR)").addHelpText("after", renderRootHelpEpilog);
65183
+ const program = new Command().name("react-doctor").description("Diagnose React codebase health").version(VERSION, "-v, --version", "display the version number").argument("[directory]", "project directory to scan", ".").option("--lint", "enable linting").option("--no-lint", "skip linting").option("--dead-code", "enable dead-code analysis (default)").option("--no-dead-code", "skip dead-code analysis (unused files / exports / dependencies, circular imports)").option("--supply-chain", "enable the dependency supply-chain scan (default)").option("--no-supply-chain", "skip the dependency supply-chain scan (Socket.dev dependency health checks)").option("--verbose", "show every rule and per-file details (default shows top 3 rules)").option("--debug", "force a Sentry trace and print its id at the end (paste it into a bug report)").option("--output-dir <dir>", "directory for the full diagnostics dump (default: a temp folder)").option("--score", "output only the score").option("--json", "output a single structured JSON report (suppresses other output)").option("--json-compact", "with --json, emit compact JSON (no indentation)").option("--json-out <path>", "with --json, write the report to a file instead of stdout").option("-y, --yes", "skip prompts, scan all workspace projects").option("--no-parallel", "lint serially with one worker (default: parallel across CPU cores; set the worker count with REACT_DOCTOR_PARALLEL)").option("--project <name>", "select projects: workspace names or directory paths (comma-separated for multiple); overrides the `projects` config field").option("--scope <value>", "how much supported JS/TS source to scan/report: full (default), files, changed (only new issues vs base), or lines (only changed lines)").option("--base <ref>", "base git ref for files/changed/lines scope (auto-detected when omitted)").addOption(new Option("--diff [base]", "[deprecated] alias for --scope changed (pass `false` to force a full scan)").hideHelp()).addOption(new Option("--changed-files-from <file>", "scan source files listed in a newline-delimited changed-files file").hideHelp()).option("--no-score", "skip the score API, the share URL, and crash reporting").addOption(new Option("--category <category>", "only show diagnostics in a category (repeatable; e.g. Security)").argParser(collectCategoryOption)).option("--no-telemetry", "alias for --no-score (skip the score API, share URL, and crash reporting)").option("--staged", "scan only staged (git index) files for pre-commit hooks").option("--max-duration <seconds>", "scan time budget for the whole run, shared across workspace projects: past it, remaining lint batches and dead-code are skipped and partial results are reported (skipped files are listed in the JSON report)").option("--blocking <level>", "severity that fails CI: error (default), warning, or none (advisory)").addOption(new Option("--fail-on <level>", "[deprecated] alias for --blocking <level>").hideHelp()).option("--no-respect-inline-disables", "audit mode: neutralize inline lint suppressions before scanning").option("--warnings", "show warning-severity diagnostics (default)").option("--no-warnings", "hide warning-severity diagnostics (errors only)").option("--color", "force colored output").option("--no-color", "disable colored output (also honors NO_COLOR)").addHelpText("after", renderRootHelpEpilog);
65185
65184
  program.action(inspectAction);
65186
65185
  program.command("why <location>").description("Explain why a rule fired (or why a suppression didn't apply) at a file:line").option("--project <name>", "select projects: workspace names or directory paths (comma-separated for multiple)").option("-c, --cwd <cwd>", "working directory", process.cwd()).option("--color", "force colored output").option("--no-color", "disable colored output (also honors NO_COLOR)").action((location, options) => whyAction(location, options));
65187
65186
  program.command("install").alias("setup").description("Install the react-doctor skill into your coding agents and optional git hook").option("-y, --yes", "skip prompts, install for all detected agents").option("--dry-run", "show what would be installed without writing files").option("--agent-hooks", "install native non-blocking agent hooks for Claude Code and Cursor").option("-c, --cwd <cwd>", "working directory", process.cwd()).option("--color", "force colored output").option("--no-color", "disable colored output (also honors NO_COLOR)").addHelpText("after", renderInstallHelpEpilog).action(installAction);
@@ -65231,4 +65230,4 @@ Promise.resolve().then(() => assertNoRemovedFlags(process.argv)).then(() => prog
65231
65230
  export {};
65232
65231
 
65233
65232
  //# sourceMappingURL=cli.js.map
65234
- //# debugId=63b8a227-543e-5501-a998-58c03a1fb10e
65233
+ //# debugId=bc56f5c4-5b95-5727-8e86-d43a534abbbc
package/dist/index.d.ts CHANGED
@@ -9654,6 +9654,7 @@ interface DiagnoseOptions {
9654
9654
  /** See `ReactDoctorConfig.deadCode`. Ignored in diff mode. */
9655
9655
  deadCode?: boolean;
9656
9656
  verbose?: boolean;
9657
+ /** Restrict linting to these supported JS/TS source files. */
9657
9658
  includePaths?: string[];
9658
9659
  /**
9659
9660
  * Per-call override for `ReactDoctorConfig.respectInlineDisables`.
@@ -9915,9 +9916,9 @@ interface JsonReportProjectEntry {
9915
9916
  skippedCheckReasons?: Record<string, string>;
9916
9917
  /**
9917
9918
  * Number of source files this scan's linter examined. In diff / changed
9918
- * mode it's the count of changed React-eligible files (`.tsx`/`.jsx` plus
9919
- * framework entry files); in a full scan it's the whole source tree. `0`
9920
- * in a diff scan means the changed files held nothing React Doctor lints —
9919
+ * mode it's the count of changed supported JS/TS source files; in a full
9920
+ * scan it's the whole source tree. `0` in a diff scan means the changed
9921
+ * files held nothing React Doctor lints —
9921
9922
  * the GitHub Action reads that as "nothing to report" (skips the PR comment;
9922
9923
  * the commit status says "skipped"). Optional: absent on reports from
9923
9924
  * constructors that don't track it (e.g. `toJsonReport`).
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
 
2
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="7a10d23c-04fd-53e1-a623-a3dc5d6d0830")}catch(e){}}();
2
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="3e7262c1-34a6-5fd7-a4a2-5e7a15ca735d")}catch(e){}}();
3
3
  import { r as __toESM$1, t as __commonJSMin$1 } from "./chunk-N93fKeF6.js";
4
4
  import { createRequire } from "node:module";
5
5
  import reactDoctorPlugin, { ALL_REACT_DOCTOR_RULE_KEYS, CROSS_FILE_DEPENDENCY_COLLECTORS, CROSS_FILE_RULE_IDS, FRAMEWORK_SPECIFIC_RULE_KEYS, FRAMEWORK_TOKENS, MOTION_LIBRARY_PACKAGES, REACT_COMPILER_RULES, REACT_DOCTOR_RULES, classifySecurityScanFile, collectCrossFileDependencyProbes, resetManifestCaches, shouldReadSecurityScanContent } from "oxlint-plugin-react-doctor";
@@ -32930,7 +32930,6 @@ const IGNORED_DIRECTORIES = new Set([
32930
32930
  "out",
32931
32931
  "storybook-static"
32932
32932
  ]);
32933
- const JSX_FILE_PATTERN = /\.(tsx|jsx)$/;
32934
32933
  const MILLISECONDS_PER_SECOND = 1e3;
32935
32934
  const SCORE_API_URL = "https://www.react.doctor/api/score";
32936
32935
  const FETCH_TIMEOUT_MS = 1e4;
@@ -37516,9 +37515,7 @@ const highlighter = {
37516
37515
  gray: import_picocolors.default.gray,
37517
37516
  bold: import_picocolors.default.bold
37518
37517
  };
37519
- const NEXT_ENTRY_FILE_PATTERN = /^(?:\.\/)?(?:src\/)?(?:middleware|proxy)\.(?:tsx?|jsx?|mts|mjs)$/;
37520
- const shouldIncludeExplicitLintPath = (filePath, project) => JSX_FILE_PATTERN.test(filePath) || project?.framework === "nextjs" && NEXT_ENTRY_FILE_PATTERN.test(filePath);
37521
- const computeExplicitLintIncludePaths = (includePaths, project) => includePaths.length > 0 ? includePaths.filter((filePath) => shouldIncludeExplicitLintPath(filePath, project)) : void 0;
37518
+ const computeExplicitLintIncludePaths = (includePaths) => includePaths.length > 0 ? includePaths.filter(isLintableSourceFile) : void 0;
37522
37519
  const LINGUIST_ATTRIBUTE_PATTERN = /^linguist-(?:vendored|generated)(?:=([a-zA-Z0-9]+))?$/i;
37523
37520
  const FALSY_VALUES = new Set([
37524
37521
  "false",
@@ -38360,11 +38357,11 @@ const resolveDeadCodeTimeout = (input) => {
38360
38357
  phaseTimeoutMs: workerTimeoutMs + DEAD_CODE_PHASE_TIMEOUT_OVER_WORKER_MS
38361
38358
  };
38362
38359
  };
38363
- const resolveLintIncludePaths = (rootDirectory, userConfig, project) => {
38360
+ const resolveLintIncludePaths = (rootDirectory, userConfig) => {
38364
38361
  if (!Array.isArray(userConfig?.ignore?.files) || userConfig.ignore.files.length === 0) return;
38365
38362
  const ignoredPatterns = compileIgnoredFilePatterns(userConfig);
38366
38363
  return listSourceFiles(rootDirectory).filter((filePath) => {
38367
- if (!shouldIncludeExplicitLintPath(filePath, project)) return false;
38364
+ if (!isLintableSourceFile(filePath)) return false;
38368
38365
  return !isFileIgnoredByPatterns(filePath, rootDirectory, ignoredPatterns);
38369
38366
  });
38370
38367
  };
@@ -42246,7 +42243,7 @@ const runInspect = (input, hooks = {}) => gen(function* () {
42246
42243
  directory: scanDirectory,
42247
42244
  repo
42248
42245
  }).pipe(orElseSucceed(() => null)) : succeed$2(null));
42249
- const lintIncludePaths = (input.skipJsxIncludeFilter ? input.includePaths.length > 0 ? [...input.includePaths] : void 0 : computeExplicitLintIncludePaths([...input.includePaths], project)) ?? resolveLintIncludePaths(scanDirectory, resolvedConfig.config, project);
42246
+ const lintIncludePaths = (input.skipExplicitIncludePathFilter ? input.includePaths.length > 0 ? [...input.includePaths] : void 0 : computeExplicitLintIncludePaths([...input.includePaths])) ?? resolveLintIncludePaths(scanDirectory, resolvedConfig.config);
42250
42247
  const fallbackScannedFilePaths = input.suppressScanSummary ? (lintIncludePaths ?? (yield* filesService.listSourceFiles(scanDirectory))).map((relativePath) => Path.resolve(scanDirectory, relativePath)) : [];
42251
42248
  const beforeLint = hooks.beforeLint ?? NO_HOOKS.beforeLint;
42252
42249
  const afterLint = hooks.afterLint ?? NO_HOOKS.afterLint;
@@ -43210,4 +43207,4 @@ const toJsonReport = (result, options) => buildJsonReport({
43210
43207
  export { AmbiguousProjectError, NoReactDependencyError, NotADirectoryError, PackageJsonNotFoundError, ProjectNotFoundError, ReactDoctorError, buildJsonReport, buildJsonReportError, clearCaches, defineConfig, diagnose, filterSourceFiles, getDiffInfo, hasReactRuntime, isProjectDiscoveryError, isReactDoctorError, summarizeDiagnostics, toJsonReport };
43211
43208
 
43212
43209
  //# sourceMappingURL=index.js.map
43213
- //# debugId=7a10d23c-04fd-53e1-a623-a3dc5d6d0830
43210
+ //# debugId=3e7262c1-34a6-5fd7-a4a2-5e7a15ca735d
package/dist/lsp.js CHANGED
@@ -32959,7 +32959,6 @@ const IGNORED_DIRECTORIES = new Set([
32959
32959
  "out",
32960
32960
  "storybook-static"
32961
32961
  ]);
32962
- const JSX_FILE_PATTERN = /\.(tsx|jsx)$/;
32963
32962
  const MILLISECONDS_PER_SECOND = 1e3;
32964
32963
  const SCORE_API_URL = "https://www.react.doctor/api/score";
32965
32964
  const FETCH_TIMEOUT_MS = 1e4;
@@ -37494,9 +37493,7 @@ const highlighter = {
37494
37493
  gray: import_picocolors.default.gray,
37495
37494
  bold: import_picocolors.default.bold
37496
37495
  };
37497
- const NEXT_ENTRY_FILE_PATTERN = /^(?:\.\/)?(?:src\/)?(?:middleware|proxy)\.(?:tsx?|jsx?|mts|mjs)$/;
37498
- const shouldIncludeExplicitLintPath = (filePath, project) => JSX_FILE_PATTERN.test(filePath) || project?.framework === "nextjs" && NEXT_ENTRY_FILE_PATTERN.test(filePath);
37499
- const computeExplicitLintIncludePaths = (includePaths, project) => includePaths.length > 0 ? includePaths.filter((filePath) => shouldIncludeExplicitLintPath(filePath, project)) : void 0;
37496
+ const computeExplicitLintIncludePaths = (includePaths) => includePaths.length > 0 ? includePaths.filter(isLintableSourceFile) : void 0;
37500
37497
  const LINGUIST_ATTRIBUTE_PATTERN = /^linguist-(?:vendored|generated)(?:=([a-zA-Z0-9]+))?$/i;
37501
37498
  const FALSY_VALUES = new Set([
37502
37499
  "false",
@@ -38338,11 +38335,11 @@ const resolveDeadCodeTimeout = (input) => {
38338
38335
  phaseTimeoutMs: workerTimeoutMs + DEAD_CODE_PHASE_TIMEOUT_OVER_WORKER_MS
38339
38336
  };
38340
38337
  };
38341
- const resolveLintIncludePaths = (rootDirectory, userConfig, project) => {
38338
+ const resolveLintIncludePaths = (rootDirectory, userConfig) => {
38342
38339
  if (!Array.isArray(userConfig?.ignore?.files) || userConfig.ignore.files.length === 0) return;
38343
38340
  const ignoredPatterns = compileIgnoredFilePatterns(userConfig);
38344
38341
  return listSourceFiles(rootDirectory).filter((filePath) => {
38345
- if (!shouldIncludeExplicitLintPath(filePath, project)) return false;
38342
+ if (!isLintableSourceFile(filePath)) return false;
38346
38343
  return !isFileIgnoredByPatterns(filePath, rootDirectory, ignoredPatterns);
38347
38344
  });
38348
38345
  };
@@ -42224,7 +42221,7 @@ const runInspect = (input, hooks = {}) => gen(function* () {
42224
42221
  directory: scanDirectory,
42225
42222
  repo
42226
42223
  }).pipe(orElseSucceed(() => null)) : succeed$2(null));
42227
- const lintIncludePaths = (input.skipJsxIncludeFilter ? input.includePaths.length > 0 ? [...input.includePaths] : void 0 : computeExplicitLintIncludePaths([...input.includePaths], project)) ?? resolveLintIncludePaths(scanDirectory, resolvedConfig.config, project);
42224
+ const lintIncludePaths = (input.skipExplicitIncludePathFilter ? input.includePaths.length > 0 ? [...input.includePaths] : void 0 : computeExplicitLintIncludePaths([...input.includePaths])) ?? resolveLintIncludePaths(scanDirectory, resolvedConfig.config);
42228
42225
  const fallbackScannedFilePaths = input.suppressScanSummary ? (lintIncludePaths ?? (yield* filesService.listSourceFiles(scanDirectory))).map((relativePath) => Path.resolve(scanDirectory, relativePath)) : [];
42229
42226
  const beforeLint = hooks.beforeLint ?? NO_HOOKS.beforeLint;
42230
42227
  const afterLint = hooks.afterLint ?? NO_HOOKS.afterLint;
@@ -42719,7 +42716,7 @@ const runEditorScan = async (input) => {
42719
42716
  warnings,
42720
42717
  isCi: false,
42721
42718
  resolveLocalGithubViewerPermission: false,
42722
- skipJsxIncludeFilter: true
42719
+ skipExplicitIncludePathFilter: true
42723
42720
  }).pipe(withSpan("runEditorScan", { attributes: {
42724
42721
  "editor.lint": lint,
42725
42722
  "editor.runDeadCode": runDeadCode
@@ -43482,7 +43479,7 @@ const createLintCache = (input) => {
43482
43479
  let persistTimer = null;
43483
43480
  try {
43484
43481
  const parsed = JSON.parse(fs.readFileSync(cacheFilePath, "utf8"));
43485
- if (parsed.version === 1 && parsed.fingerprint === input.fingerprint) for (const [fsPath, entry] of Object.entries(parsed.entries)) entries.set(fsPath, entry);
43482
+ if (parsed.version === 2 && parsed.fingerprint === input.fingerprint) for (const [fsPath, entry] of Object.entries(parsed.entries)) entries.set(fsPath, entry);
43486
43483
  } catch {}
43487
43484
  const persist = () => {
43488
43485
  if (persistTimer) {
@@ -43493,7 +43490,7 @@ const createLintCache = (input) => {
43493
43490
  dirty = false;
43494
43491
  try {
43495
43492
  const payload = {
43496
- version: 1,
43493
+ version: 2,
43497
43494
  fingerprint: input.fingerprint,
43498
43495
  entries: Object.fromEntries(entries)
43499
43496
  };
@@ -43506,14 +43503,14 @@ const createLintCache = (input) => {
43506
43503
  }
43507
43504
  };
43508
43505
  return {
43509
- lookup: (fsPath, stat) => {
43506
+ lookup: (fsPath, identity) => {
43510
43507
  const entry = entries.get(fsPath);
43511
- if (entry !== void 0 && entry.mtimeMs === stat.mtimeMs && entry.size === stat.size) return entry.diagnostics;
43508
+ if (entry !== void 0 && entry.contentHash === identity.contentHash) return entry.diagnostics;
43512
43509
  return null;
43513
43510
  },
43514
- store: (fsPath, stat, diagnostics) => {
43511
+ store: (fsPath, identity, diagnostics) => {
43515
43512
  entries.set(fsPath, {
43516
- ...stat,
43513
+ ...identity,
43517
43514
  diagnostics
43518
43515
  });
43519
43516
  dirty = true;
@@ -43602,16 +43599,9 @@ const resolveDiagnosticFsPath = (rawFilePath, scanDirectory, projectDirectory, o
43602
43599
  }
43603
43600
  return normalizeFsPath(absolute);
43604
43601
  };
43605
- const statSafe = (fsPath) => {
43606
- try {
43607
- const stat = fs.statSync(fsPath);
43608
- return {
43609
- mtimeMs: stat.mtimeMs,
43610
- size: stat.size
43611
- };
43612
- } catch {
43613
- return null;
43614
- }
43602
+ const readFileIdentity = (fsPath) => {
43603
+ const contentHash = hashFileContents(fsPath);
43604
+ return contentHash === null ? null : { contentHash };
43615
43605
  };
43616
43606
  /**
43617
43607
  * Outcome for a per-file request served without running oxlint (every
@@ -43637,7 +43627,7 @@ const outcomeWithoutScan = (request, byFile, requestedPaths) => ({
43637
43627
  * overlay tree (unsaved buffers) or disk, groups diagnostics by canonical
43638
43628
  * absolute path, and reports stale-detection metadata.
43639
43629
  *
43640
- * A persistent per-file lint cache (keyed by mtime + size, namespaced by a
43630
+ * A persistent per-file lint cache (keyed by content, namespaced by a
43641
43631
  * config fingerprint) short-circuits unchanged files so a re-opened editor
43642
43632
  * or repeated workspace scan skips the oxlint subprocess for everything it
43643
43633
  * hasn't edited. The cache applies only to disk-based, lint-only, per-file
@@ -43667,15 +43657,15 @@ const createScanRunner = (options) => {
43667
43657
  const requestedPaths = request.priority === "background" && !request.useOverlay && options.isOpen ? allRequested.filter((fsPath) => !options.isOpen?.(fsPath)) : allRequested;
43668
43658
  const cache = cacheEnabled && !isWholeProject && !request.useOverlay && !request.runDeadCode ? getCache(projectDirectory) : null;
43669
43659
  const byFile = /* @__PURE__ */ new Map();
43670
- const statByPath = /* @__PURE__ */ new Map();
43660
+ const identityByPath = /* @__PURE__ */ new Map();
43671
43661
  let filesToScan = requestedPaths;
43672
43662
  if (cache) {
43673
43663
  const uncached = [];
43674
43664
  for (const fsPath of requestedPaths) {
43675
- const stat = statSafe(fsPath);
43676
- if (stat) {
43677
- statByPath.set(fsPath, stat);
43678
- const hit = cache.lookup(fsPath, stat);
43665
+ const identity = readFileIdentity(fsPath);
43666
+ if (identity) {
43667
+ identityByPath.set(fsPath, identity);
43668
+ const hit = cache.lookup(fsPath, identity);
43679
43669
  if (hit !== null) {
43680
43670
  if (hit.length > 0) byFile.set(fsPath, hit);
43681
43671
  continue;
@@ -43718,9 +43708,9 @@ const createScanRunner = (options) => {
43718
43708
  }
43719
43709
  if (cache && result.ok && !result.skipped && !result.didLintFail && result.lintPartialFailures.length === 0) {
43720
43710
  for (const fsPath of filesToScan) {
43721
- const stat = statByPath.get(fsPath);
43722
- if (!stat) continue;
43723
- cache.store(fsPath, stat, byFile.get(fsPath) ?? []);
43711
+ const identity = identityByPath.get(fsPath);
43712
+ if (!identity) continue;
43713
+ cache.store(fsPath, identity, byFile.get(fsPath) ?? []);
43724
43714
  }
43725
43715
  cache.schedulePersist();
43726
43716
  }
@@ -44854,5 +44844,5 @@ const startLanguageServer = () => {
44854
44844
  };
44855
44845
  //#endregion
44856
44846
  export { startLanguageServer };
44857
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="b77898db-d8e8-531a-a32b-9de2d1a63635")}catch(e){}}();
44858
- //# debugId=b77898db-d8e8-531a-a32b-9de2d1a63635
44847
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="a3135dfe-cc85-5d34-adea-93f5c29d9bcb")}catch(e){}}();
44848
+ //# debugId=a3135dfe-cc85-5d34-adea-93f5c29d9bcb
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-doctor",
3
- "version": "0.7.6-dev.dfd47a7",
3
+ "version": "0.7.6-dev.e026a23",
4
4
  "description": "Your agent writes bad React. This catches it",
5
5
  "keywords": [
6
6
  "accessibility",
@@ -65,8 +65,8 @@
65
65
  "vscode-languageserver-textdocument": "^1.0.12",
66
66
  "vscode-uri": "^3.1.0",
67
67
  "yaml": "^2.9.0",
68
- "deslop-js": "0.7.6",
69
- "oxlint-plugin-react-doctor": "0.7.6-dev.dfd47a7"
68
+ "oxlint-plugin-react-doctor": "0.7.6-dev.e026a23",
69
+ "deslop-js": "0.7.6"
70
70
  },
71
71
  "devDependencies": {
72
72
  "@types/babel__code-frame": "^7.27.0",
@@ -74,8 +74,8 @@
74
74
  "@xterm/headless": "^6.0.0",
75
75
  "commander": "^14.0.3",
76
76
  "ora": "^9.4.0",
77
- "@react-doctor/api": "0.7.6",
78
77
  "@react-doctor/core": "0.7.6",
78
+ "@react-doctor/api": "0.7.6",
79
79
  "@react-doctor/language-server": "0.7.6"
80
80
  },
81
81
  "engines": {