react-doctor 0.4.1-dev.d17dc87 → 0.4.1
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/README.md +55 -6
- package/dist/cli.js +17 -66
- package/dist/index.d.ts +1 -11
- package/dist/index.js +4 -41
- package/dist/lsp.js +3 -33
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -37,11 +37,60 @@ npx react-doctor@latest install
|
|
|
37
37
|
|
|
38
38
|
Works with Claude Code, Cursor, Codex, OpenCode, and many more.
|
|
39
39
|
|
|
40
|
-
### 3.
|
|
40
|
+
### 3. Use in your editor (LSP)
|
|
41
41
|
|
|
42
|
-
React Doctor
|
|
42
|
+
React Doctor ships an experimental language server, so diagnostics show up live as you type — underlined inline, with rich hovers and quick fixes — in VS Code, Cursor, Zed, Neovim, Sublime, Emacs, Helix, or any LSP client. The universal launch command is:
|
|
43
43
|
|
|
44
|
-
|
|
44
|
+
```bash
|
|
45
|
+
react-doctor experimental-lsp --stdio
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
> The editor language server is experimental — its protocol, caching, and diagnostics may change between releases, hence the `experimental-` prefix.
|
|
49
|
+
|
|
50
|
+
Companion extensions for VS Code/Cursor and Zed live under `packages/`; any other LSP client can run the command above directly over stdio.
|
|
51
|
+
|
|
52
|
+
### 4. Run in CI (GitHub Actions) for your team
|
|
53
|
+
|
|
54
|
+
[](https://github.com/marketplace/actions/react-doctor)
|
|
55
|
+
|
|
56
|
+
On a pull request the Action reports only the issues your change **introduced** — it scans the PR and the merge-base and reports the difference (like Codecov for coverage), leaving pre-existing findings alone. It posts inline review comments on the changed lines and a sticky summary with the new / fixed delta.
|
|
57
|
+
|
|
58
|
+
```yaml
|
|
59
|
+
name: React Doctor
|
|
60
|
+
|
|
61
|
+
on:
|
|
62
|
+
pull_request:
|
|
63
|
+
types: [opened, synchronize, reopened, ready_for_review]
|
|
64
|
+
|
|
65
|
+
permissions:
|
|
66
|
+
contents: read
|
|
67
|
+
pull-requests: write
|
|
68
|
+
issues: write
|
|
69
|
+
statuses: write # lets the action publish the score as a commit status
|
|
70
|
+
|
|
71
|
+
concurrency:
|
|
72
|
+
group: react-doctor-${{ github.event.pull_request.number || github.ref }}
|
|
73
|
+
cancel-in-progress: true
|
|
74
|
+
|
|
75
|
+
jobs:
|
|
76
|
+
react-doctor:
|
|
77
|
+
runs-on: ubuntu-latest
|
|
78
|
+
steps:
|
|
79
|
+
- uses: actions/checkout@v5
|
|
80
|
+
with:
|
|
81
|
+
fetch-depth: 0 # so React Doctor can diff against the merge-base for new-vs-existing
|
|
82
|
+
- uses: millionco/react-doctor@v2
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
`fetch-depth: 0` is recommended so the baseline comparison can read the base commit; without enough history the Action falls back to reporting every finding in the changed files.
|
|
86
|
+
|
|
87
|
+
`@v2` always resolves to the latest `v2.x` release of the Action. For hardened CI — recommended whenever the workflow is granted `pull-requests: write` — pin to a full commit SHA instead and let Dependabot or Renovate keep it current:
|
|
88
|
+
|
|
89
|
+
```yaml
|
|
90
|
+
- uses: millionco/react-doctor@75932719d11ef50e110eac01ce04acdc05fde074 # v2.0.1
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
[Add GitHub Action →](https://github.com/marketplace/actions/react-doctor)
|
|
45
94
|
|
|
46
95
|
### 4. Configure rules in `doctor.config.ts`
|
|
47
96
|
|
|
@@ -49,14 +98,14 @@ Configure with a `doctor.config.ts` (or `.js`, `.mjs`, `.cjs`, `.json`, `.jsonc`
|
|
|
49
98
|
|
|
50
99
|
```ts
|
|
51
100
|
// doctor.config.ts
|
|
52
|
-
import {
|
|
101
|
+
import type { ReactDoctorConfig } from "react-doctor/api";
|
|
53
102
|
|
|
54
|
-
export default
|
|
103
|
+
export default {
|
|
55
104
|
lint: true,
|
|
56
105
|
rules: {
|
|
57
106
|
"react-doctor/no-array-index-as-key": "off",
|
|
58
107
|
},
|
|
59
|
-
}
|
|
108
|
+
} satisfies ReactDoctorConfig;
|
|
60
109
|
```
|
|
61
110
|
|
|
62
111
|
Prefer JSON? Use `doctor.config.json`:
|
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]="
|
|
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]="30809678-4fe4-55cc-938c-ee6301ab7888")}catch(e){}}();
|
|
3
3
|
import { createRequire } from "node:module";
|
|
4
4
|
import { execFile, execFileSync, spawn, spawnSync } from "node:child_process";
|
|
5
5
|
import * as path$1 from "node:path";
|
|
@@ -7629,35 +7629,6 @@ const loadPackageJsonConfig = (directory) => {
|
|
|
7629
7629
|
format: "package-json"
|
|
7630
7630
|
};
|
|
7631
7631
|
};
|
|
7632
|
-
const loadLegacyConfig = (directory) => {
|
|
7633
|
-
const legacyFilePath = path$1.join(directory, LEGACY_CONFIG_FILENAME);
|
|
7634
|
-
if (!isFile(legacyFilePath)) return {
|
|
7635
|
-
status: "absent",
|
|
7636
|
-
loaded: null
|
|
7637
|
-
};
|
|
7638
|
-
try {
|
|
7639
|
-
const parsed = readDataConfig(legacyFilePath);
|
|
7640
|
-
if (isPlainObject(parsed)) {
|
|
7641
|
-
warn(`${LEGACY_CONFIG_FILENAME} is deprecated — rename it to ${CONFIG_BASENAME}.json (or author a ${CONFIG_BASENAME}.ts). It is still read for now.`);
|
|
7642
|
-
return {
|
|
7643
|
-
status: "found",
|
|
7644
|
-
loaded: {
|
|
7645
|
-
config: validateConfigTypes(parsed),
|
|
7646
|
-
sourceDirectory: directory,
|
|
7647
|
-
configFilePath: legacyFilePath,
|
|
7648
|
-
format: "json"
|
|
7649
|
-
}
|
|
7650
|
-
};
|
|
7651
|
-
}
|
|
7652
|
-
warn(`${LEGACY_CONFIG_FILENAME} must contain an object, ignoring.`);
|
|
7653
|
-
} catch (error) {
|
|
7654
|
-
warn(`Failed to load ${LEGACY_CONFIG_FILENAME}: ${formatError(error)}`);
|
|
7655
|
-
}
|
|
7656
|
-
return {
|
|
7657
|
-
status: "invalid",
|
|
7658
|
-
loaded: null
|
|
7659
|
-
};
|
|
7660
|
-
};
|
|
7661
7632
|
const loadConfigFromDirectory = async (directory) => {
|
|
7662
7633
|
let sawBrokenConfigFile = false;
|
|
7663
7634
|
for (const extension of CONFIG_EXTENSIONS) {
|
|
@@ -7687,8 +7658,7 @@ const loadConfigFromDirectory = async (directory) => {
|
|
|
7687
7658
|
status: "found",
|
|
7688
7659
|
loaded: packageJsonConfig
|
|
7689
7660
|
};
|
|
7690
|
-
|
|
7691
|
-
if (legacyResult.status !== "absent") return legacyResult;
|
|
7661
|
+
if (isFile(path$1.join(directory, LEGACY_CONFIG_FILENAME))) warn(`${LEGACY_CONFIG_FILENAME} is no longer read — rename it to ${CONFIG_BASENAME}.json (or author a ${CONFIG_BASENAME}.ts).`);
|
|
7692
7662
|
return {
|
|
7693
7663
|
status: sawBrokenConfigFile ? "invalid" : "absent",
|
|
7694
7664
|
loaded: null
|
|
@@ -7725,9 +7695,7 @@ const directoryHasCurrentConfig = (directory) => {
|
|
|
7725
7695
|
/**
|
|
7726
7696
|
* Walks up from `rootDirectory` (same boundary semantics as
|
|
7727
7697
|
* `loadConfigWithSource`) looking for a pre-migration
|
|
7728
|
-
* `react-doctor.config.json
|
|
7729
|
-
* fallback (see `loadLegacyConfig`); this detector is what lets the interactive
|
|
7730
|
-
* CLI offer to rename it to a current-format config. Returns the first one
|
|
7698
|
+
* `react-doctor.config.json` that is no longer read. Returns the first one
|
|
7731
7699
|
* found, or `null` when a current-format config supersedes it or none exists
|
|
7732
7700
|
* before a project boundary. Detection only — the CLI performs the rename.
|
|
7733
7701
|
*/
|
|
@@ -12247,7 +12215,7 @@ const makeNoopConsole = () => ({
|
|
|
12247
12215
|
});
|
|
12248
12216
|
//#endregion
|
|
12249
12217
|
//#region src/cli/utils/version.ts
|
|
12250
|
-
const VERSION = "0.4.1
|
|
12218
|
+
const VERSION = "0.4.1";
|
|
12251
12219
|
//#endregion
|
|
12252
12220
|
//#region src/cli/utils/json-mode.ts
|
|
12253
12221
|
let context = null;
|
|
@@ -12605,13 +12573,13 @@ const isDevVersion = (version) => version === "0.0.0" || version.includes("-");
|
|
|
12605
12573
|
* uploads source-map artifacts under, so stack frames symbolicate. Honors the
|
|
12606
12574
|
* standard `SENTRY_RELEASE` override.
|
|
12607
12575
|
*/
|
|
12608
|
-
const resolveSentryRelease = () => process.env.SENTRY_RELEASE || `react-doctor@0.4.1
|
|
12576
|
+
const resolveSentryRelease = () => process.env.SENTRY_RELEASE || `react-doctor@0.4.1`;
|
|
12609
12577
|
/**
|
|
12610
12578
|
* Deployment environment shown in Sentry's environment filter. Defaults to
|
|
12611
12579
|
* `production` for tagged releases and `development` for dev/unbuilt versions,
|
|
12612
12580
|
* overridable via the standard `SENTRY_ENVIRONMENT` env var.
|
|
12613
12581
|
*/
|
|
12614
|
-
const resolveSentryEnvironment = () => process.env.SENTRY_ENVIRONMENT || (isDevVersion("0.4.1
|
|
12582
|
+
const resolveSentryEnvironment = () => process.env.SENTRY_ENVIRONMENT || (isDevVersion("0.4.1") ? "development" : "production");
|
|
12615
12583
|
/**
|
|
12616
12584
|
* Performance-tracing sample rate in `[0, 1]`. Reads `SENTRY_TRACES_SAMPLE_RATE`
|
|
12617
12585
|
* (set to `0` to disable tracing) and falls back to
|
|
@@ -20305,8 +20273,8 @@ const buildChangedFilesDiffInfo = (changedFiles) => ({
|
|
|
20305
20273
|
* `react-doctor.config.json` to `doctor.config.ts` before config is loaded,
|
|
20306
20274
|
* so the scan reads the renamed file and the user is told once. CI, coding
|
|
20307
20275
|
* agents, JSON/score output, pre-commit (`--staged`) hooks, and non-TTY runs
|
|
20308
|
-
* are left untouched — the loader still
|
|
20309
|
-
*
|
|
20276
|
+
* are left untouched — the loader's warning still nudges them — so a scan
|
|
20277
|
+
* never mutates the repo unattended.
|
|
20310
20278
|
*/
|
|
20311
20279
|
const maybeMigrateLegacyConfig = (requestedDirectory, { isQuiet, isStaged }) => {
|
|
20312
20280
|
if (!(!isQuiet && !isStaged && process.stdout.isTTY === true && !isCiOrCodingAgentEnvironment())) return;
|
|
@@ -20668,27 +20636,13 @@ const resolveRuleConfigTarget = async (projectRoot) => {
|
|
|
20668
20636
|
config: isPlainObject(embedded) ? embedded : {}
|
|
20669
20637
|
};
|
|
20670
20638
|
}
|
|
20671
|
-
if (loaded.format === "json") {
|
|
20672
|
-
|
|
20673
|
-
|
|
20674
|
-
|
|
20675
|
-
|
|
20676
|
-
|
|
20677
|
-
|
|
20678
|
-
directory: loaded.sourceDirectory,
|
|
20679
|
-
exists: false,
|
|
20680
|
-
config: legacyConfig,
|
|
20681
|
-
migratedFromFilePath: loaded.configFilePath
|
|
20682
|
-
};
|
|
20683
|
-
}
|
|
20684
|
-
return {
|
|
20685
|
-
format: "json",
|
|
20686
|
-
filePath: loaded.configFilePath,
|
|
20687
|
-
directory: loaded.sourceDirectory,
|
|
20688
|
-
exists: true,
|
|
20689
|
-
config: readObjectFile(loaded.configFilePath) ?? {}
|
|
20690
|
-
};
|
|
20691
|
-
}
|
|
20639
|
+
if (loaded.format === "json") return {
|
|
20640
|
+
format: "json",
|
|
20641
|
+
filePath: loaded.configFilePath,
|
|
20642
|
+
directory: loaded.sourceDirectory,
|
|
20643
|
+
exists: true,
|
|
20644
|
+
config: readObjectFile(loaded.configFilePath) ?? {}
|
|
20645
|
+
};
|
|
20692
20646
|
return {
|
|
20693
20647
|
format: "module",
|
|
20694
20648
|
filePath: loaded.configFilePath,
|
|
@@ -20767,10 +20721,7 @@ const writeRuleConfig = async (target, nextConfig) => {
|
|
|
20767
20721
|
return { written };
|
|
20768
20722
|
}
|
|
20769
20723
|
if (target.format === "package-json") writePackageJsonConfig(target.filePath, nextConfig);
|
|
20770
|
-
else
|
|
20771
|
-
writeJsonConfig(target.filePath, nextConfig);
|
|
20772
|
-
if (target.migratedFromFilePath) fs$1.rmSync(target.migratedFromFilePath, { force: true });
|
|
20773
|
-
}
|
|
20724
|
+
else writeJsonConfig(target.filePath, nextConfig);
|
|
20774
20725
|
clearConfigCache();
|
|
20775
20726
|
return { written: true };
|
|
20776
20727
|
};
|
|
@@ -21521,4 +21472,4 @@ Promise.resolve().then(() => assertNoRemovedFlags(process.argv)).then(() => prog
|
|
|
21521
21472
|
export {};
|
|
21522
21473
|
|
|
21523
21474
|
//# sourceMappingURL=cli.js.map
|
|
21524
|
-
//# debugId=
|
|
21475
|
+
//# debugId=30809678-4fe4-55cc-938c-ee6301ab7888
|
package/dist/index.d.ts
CHANGED
|
@@ -942,16 +942,6 @@ declare const filterSourceFiles: (filePaths: string[]) => string[]; //#endregion
|
|
|
942
942
|
declare const summarizeDiagnostics: (diagnostics: Diagnostic[], worstScore?: number | null, worstScoreLabel?: string | null) => JsonReportSummary; //#endregion
|
|
943
943
|
//#region src/validate-config-types.d.ts
|
|
944
944
|
//#endregion
|
|
945
|
-
//#region src/utils/define-config.d.ts
|
|
946
|
-
/**
|
|
947
|
-
* Identity helper for authoring a typed `doctor.config.{ts,js,mjs,cjs}`.
|
|
948
|
-
* Gives editor autocomplete and type-checking for the config object without
|
|
949
|
-
* an explicit `satisfies ReactDoctorConfig` annotation; returns the config
|
|
950
|
-
* untouched so the loader sees the same plain object either way.
|
|
951
|
-
*/
|
|
952
|
-
declare const defineConfig: (config: ReactDoctorConfig) => ReactDoctorConfig; //#endregion
|
|
953
|
-
//#region src/utils/group-by.d.ts
|
|
954
|
-
//#endregion
|
|
955
945
|
//#region ../api/dist/index.d.ts
|
|
956
946
|
//#region src/diagnose.d.ts
|
|
957
947
|
declare const diagnose: (directory: string, options?: DiagnoseOptions) => Promise<DiagnoseResult>;
|
|
@@ -999,5 +989,5 @@ interface ToJsonReportOptions {
|
|
|
999
989
|
}
|
|
1000
990
|
declare const toJsonReport: (result: DiagnoseResult, options: ToJsonReportOptions) => JsonReport;
|
|
1001
991
|
//#endregion
|
|
1002
|
-
export { AmbiguousProjectError, type DiagnoseOptions, type DiagnoseResult, type Diagnostic, type DiffInfo, type JsonReport, type JsonReportDiffInfo, type JsonReportError, type JsonReportMode, type JsonReportProjectEntry, type JsonReportSummary, NoReactDependencyError, NotADirectoryError, PackageJsonNotFoundError, type ProjectInfo, ProjectNotFoundError, type ReactDoctorConfig, ReactDoctorError, type ScoreResult, buildJsonReport, buildJsonReportError, clearCaches,
|
|
992
|
+
export { AmbiguousProjectError, type DiagnoseOptions, type DiagnoseResult, type Diagnostic, type DiffInfo, type JsonReport, type JsonReportDiffInfo, type JsonReportError, type JsonReportMode, type JsonReportProjectEntry, type JsonReportSummary, NoReactDependencyError, NotADirectoryError, PackageJsonNotFoundError, type ProjectInfo, ProjectNotFoundError, type ReactDoctorConfig, ReactDoctorError, type ScoreResult, buildJsonReport, buildJsonReportError, clearCaches, diagnose, filterSourceFiles, getDiffInfo, isProjectDiscoveryError, isReactDoctorError, summarizeDiagnostics, toJsonReport };
|
|
1003
993
|
//# sourceMappingURL=index.d.ts.map
|
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]="
|
|
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]="f737dd06-c590-5a34-8fb0-b8aa0278cc0d")}catch(e){}}();
|
|
3
3
|
import { createRequire } from "node:module";
|
|
4
4
|
import * as Schema from "effect/Schema";
|
|
5
5
|
import * as fs$1 from "node:fs";
|
|
@@ -4604,35 +4604,6 @@ const loadPackageJsonConfig = (directory) => {
|
|
|
4604
4604
|
format: "package-json"
|
|
4605
4605
|
};
|
|
4606
4606
|
};
|
|
4607
|
-
const loadLegacyConfig = (directory) => {
|
|
4608
|
-
const legacyFilePath = path$1.join(directory, LEGACY_CONFIG_FILENAME);
|
|
4609
|
-
if (!isFile(legacyFilePath)) return {
|
|
4610
|
-
status: "absent",
|
|
4611
|
-
loaded: null
|
|
4612
|
-
};
|
|
4613
|
-
try {
|
|
4614
|
-
const parsed = readDataConfig(legacyFilePath);
|
|
4615
|
-
if (isPlainObject(parsed)) {
|
|
4616
|
-
warn(`${LEGACY_CONFIG_FILENAME} is deprecated — rename it to ${CONFIG_BASENAME}.json (or author a ${CONFIG_BASENAME}.ts). It is still read for now.`);
|
|
4617
|
-
return {
|
|
4618
|
-
status: "found",
|
|
4619
|
-
loaded: {
|
|
4620
|
-
config: validateConfigTypes(parsed),
|
|
4621
|
-
sourceDirectory: directory,
|
|
4622
|
-
configFilePath: legacyFilePath,
|
|
4623
|
-
format: "json"
|
|
4624
|
-
}
|
|
4625
|
-
};
|
|
4626
|
-
}
|
|
4627
|
-
warn(`${LEGACY_CONFIG_FILENAME} must contain an object, ignoring.`);
|
|
4628
|
-
} catch (error) {
|
|
4629
|
-
warn(`Failed to load ${LEGACY_CONFIG_FILENAME}: ${formatError(error)}`);
|
|
4630
|
-
}
|
|
4631
|
-
return {
|
|
4632
|
-
status: "invalid",
|
|
4633
|
-
loaded: null
|
|
4634
|
-
};
|
|
4635
|
-
};
|
|
4636
4607
|
const loadConfigFromDirectory = async (directory) => {
|
|
4637
4608
|
let sawBrokenConfigFile = false;
|
|
4638
4609
|
for (const extension of CONFIG_EXTENSIONS) {
|
|
@@ -4662,8 +4633,7 @@ const loadConfigFromDirectory = async (directory) => {
|
|
|
4662
4633
|
status: "found",
|
|
4663
4634
|
loaded: packageJsonConfig
|
|
4664
4635
|
};
|
|
4665
|
-
|
|
4666
|
-
if (legacyResult.status !== "absent") return legacyResult;
|
|
4636
|
+
if (isFile(path$1.join(directory, LEGACY_CONFIG_FILENAME))) warn(`${LEGACY_CONFIG_FILENAME} is no longer read — rename it to ${CONFIG_BASENAME}.json (or author a ${CONFIG_BASENAME}.ts).`);
|
|
4667
4637
|
return {
|
|
4668
4638
|
status: sawBrokenConfigFile ? "invalid" : "absent",
|
|
4669
4639
|
loaded: null
|
|
@@ -8915,13 +8885,6 @@ const filterSourceFiles = (filePaths) => filePaths.filter(isLintableSourceFile);
|
|
|
8915
8885
|
* other `clear*` helpers.
|
|
8916
8886
|
*/
|
|
8917
8887
|
const clearAutoSuppressionCaches = () => {};
|
|
8918
|
-
/**
|
|
8919
|
-
* Identity helper for authoring a typed `doctor.config.{ts,js,mjs,cjs}`.
|
|
8920
|
-
* Gives editor autocomplete and type-checking for the config object without
|
|
8921
|
-
* an explicit `satisfies ReactDoctorConfig` annotation; returns the config
|
|
8922
|
-
* untouched so the loader sees the same plain object either way.
|
|
8923
|
-
*/
|
|
8924
|
-
const defineConfig = (config) => config;
|
|
8925
8888
|
//#endregion
|
|
8926
8889
|
//#region ../api/dist/index.js
|
|
8927
8890
|
const buildDiagnoseLayer = (configLayer = Config.layerNode) => Layer.mergeAll(Project.layerNode, configLayer, DeadCode.layerNode, Files.layerNode, Git.layerNode, Linter.layerOxlint, LintPartialFailures.layerLive, Progress.layerNoop, Reporter.layerNoop, Score.layerHttp);
|
|
@@ -8987,7 +8950,7 @@ const toJsonReport = (result, options) => buildJsonReport({
|
|
|
8987
8950
|
totalElapsedMilliseconds: result.elapsedMilliseconds
|
|
8988
8951
|
});
|
|
8989
8952
|
//#endregion
|
|
8990
|
-
export { AmbiguousProjectError, NoReactDependencyError, NotADirectoryError, PackageJsonNotFoundError, ProjectNotFoundError, ReactDoctorError, buildJsonReport, buildJsonReportError, clearCaches,
|
|
8953
|
+
export { AmbiguousProjectError, NoReactDependencyError, NotADirectoryError, PackageJsonNotFoundError, ProjectNotFoundError, ReactDoctorError, buildJsonReport, buildJsonReportError, clearCaches, diagnose, filterSourceFiles, getDiffInfo, isProjectDiscoveryError, isReactDoctorError, summarizeDiagnostics, toJsonReport };
|
|
8991
8954
|
|
|
8992
8955
|
//# sourceMappingURL=index.js.map
|
|
8993
|
-
//# debugId=
|
|
8956
|
+
//# debugId=f737dd06-c590-5a34-8fb0-b8aa0278cc0d
|
package/dist/lsp.js
CHANGED
|
@@ -4589,35 +4589,6 @@ const loadPackageJsonConfig = (directory) => {
|
|
|
4589
4589
|
format: "package-json"
|
|
4590
4590
|
};
|
|
4591
4591
|
};
|
|
4592
|
-
const loadLegacyConfig = (directory) => {
|
|
4593
|
-
const legacyFilePath = path$1.join(directory, LEGACY_CONFIG_FILENAME);
|
|
4594
|
-
if (!isFile(legacyFilePath)) return {
|
|
4595
|
-
status: "absent",
|
|
4596
|
-
loaded: null
|
|
4597
|
-
};
|
|
4598
|
-
try {
|
|
4599
|
-
const parsed = readDataConfig(legacyFilePath);
|
|
4600
|
-
if (isPlainObject(parsed)) {
|
|
4601
|
-
warn(`${LEGACY_CONFIG_FILENAME} is deprecated — rename it to ${CONFIG_BASENAME}.json (or author a ${CONFIG_BASENAME}.ts). It is still read for now.`);
|
|
4602
|
-
return {
|
|
4603
|
-
status: "found",
|
|
4604
|
-
loaded: {
|
|
4605
|
-
config: validateConfigTypes(parsed),
|
|
4606
|
-
sourceDirectory: directory,
|
|
4607
|
-
configFilePath: legacyFilePath,
|
|
4608
|
-
format: "json"
|
|
4609
|
-
}
|
|
4610
|
-
};
|
|
4611
|
-
}
|
|
4612
|
-
warn(`${LEGACY_CONFIG_FILENAME} must contain an object, ignoring.`);
|
|
4613
|
-
} catch (error) {
|
|
4614
|
-
warn(`Failed to load ${LEGACY_CONFIG_FILENAME}: ${formatError(error)}`);
|
|
4615
|
-
}
|
|
4616
|
-
return {
|
|
4617
|
-
status: "invalid",
|
|
4618
|
-
loaded: null
|
|
4619
|
-
};
|
|
4620
|
-
};
|
|
4621
4592
|
const loadConfigFromDirectory = async (directory) => {
|
|
4622
4593
|
let sawBrokenConfigFile = false;
|
|
4623
4594
|
for (const extension of CONFIG_EXTENSIONS) {
|
|
@@ -4647,8 +4618,7 @@ const loadConfigFromDirectory = async (directory) => {
|
|
|
4647
4618
|
status: "found",
|
|
4648
4619
|
loaded: packageJsonConfig
|
|
4649
4620
|
};
|
|
4650
|
-
|
|
4651
|
-
if (legacyResult.status !== "absent") return legacyResult;
|
|
4621
|
+
if (isFile(path$1.join(directory, LEGACY_CONFIG_FILENAME))) warn(`${LEGACY_CONFIG_FILENAME} is no longer read — rename it to ${CONFIG_BASENAME}.json (or author a ${CONFIG_BASENAME}.ts).`);
|
|
4652
4622
|
return {
|
|
4653
4623
|
status: sawBrokenConfigFile ? "invalid" : "absent",
|
|
4654
4624
|
loaded: null
|
|
@@ -10854,5 +10824,5 @@ const startLanguageServer = () => {
|
|
|
10854
10824
|
};
|
|
10855
10825
|
//#endregion
|
|
10856
10826
|
export { startLanguageServer };
|
|
10857
|
-
!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]="
|
|
10858
|
-
//# debugId=
|
|
10827
|
+
!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]="8723a353-8e8c-5ecc-8264-6fbb48af2b40")}catch(e){}}();
|
|
10828
|
+
//# debugId=8723a353-8e8c-5ecc-8264-6fbb48af2b40
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-doctor",
|
|
3
|
-
"version": "0.4.1
|
|
3
|
+
"version": "0.4.1",
|
|
4
4
|
"description": "Diagnose and fix React codebases for security, performance, correctness, accessibility, bundle-size, and architecture issues",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"accessibility",
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"vscode-languageserver": "^9.0.1",
|
|
67
67
|
"vscode-languageserver-textdocument": "^1.0.12",
|
|
68
68
|
"vscode-uri": "^3.1.0",
|
|
69
|
-
"oxlint-plugin-react-doctor": "0.4.1
|
|
69
|
+
"oxlint-plugin-react-doctor": "0.4.1"
|
|
70
70
|
},
|
|
71
71
|
"devDependencies": {
|
|
72
72
|
"@types/babel__code-frame": "^7.27.0",
|