react-doctor 0.5.6-dev.8908f98 → 0.5.6-dev.eafac9d
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 +19 -16
- package/dist/index.d.ts +4 -3
- package/dist/index.js +10 -7
- package/dist/lsp.js +10 -7
- package/package.json +4 -4
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]="54905d6a-f06f-5f80-9fb6-7d4ab857d553")}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";
|
|
@@ -39692,10 +39692,15 @@ const buildCapabilities = (project) => {
|
|
|
39692
39692
|
}
|
|
39693
39693
|
if (project.tailwindVersion !== null) {
|
|
39694
39694
|
capabilities.add("tailwind");
|
|
39695
|
-
|
|
39695
|
+
const tailwind = parseTailwindMajorMinor(project.tailwindVersion);
|
|
39696
|
+
if (isTailwindAtLeast(tailwind, {
|
|
39696
39697
|
major: 3,
|
|
39697
39698
|
minor: 4
|
|
39698
39699
|
})) capabilities.add("tailwind:3.4");
|
|
39700
|
+
if (tailwind !== null && isTailwindAtLeast(tailwind, {
|
|
39701
|
+
major: 4,
|
|
39702
|
+
minor: 0
|
|
39703
|
+
})) capabilities.add("tailwind:4");
|
|
39699
39704
|
}
|
|
39700
39705
|
if (project.zodVersion !== null) {
|
|
39701
39706
|
capabilities.add("zod");
|
|
@@ -39986,12 +39991,11 @@ const collectKnipPatterns = (rootDirectory, settingName) => {
|
|
|
39986
39991
|
if (!config) return [];
|
|
39987
39992
|
return [...normalizePatternList(config[settingName]), ...collectKnipWorkspacePatterns(config.workspaces, settingName)];
|
|
39988
39993
|
};
|
|
39989
|
-
const collectDeadCodeIgnorePatterns = (rootDirectory
|
|
39994
|
+
const collectDeadCodeIgnorePatterns = (rootDirectory) => {
|
|
39990
39995
|
const seen = /* @__PURE__ */ new Set();
|
|
39991
39996
|
const sources = [
|
|
39992
39997
|
readIgnoreFile(path.join(rootDirectory, ".gitignore")),
|
|
39993
39998
|
collectIgnorePatterns(rootDirectory),
|
|
39994
|
-
userConfig?.ignore?.files ?? [],
|
|
39995
39999
|
collectKnipPatterns(rootDirectory, "ignore")
|
|
39996
40000
|
];
|
|
39997
40001
|
for (const source of sources) for (const pattern of source) seen.add(pattern);
|
|
@@ -40269,11 +40273,10 @@ const runDeadCodeWorkerWithTimeout = (handle, timeoutMs) => new Promise((resolve
|
|
|
40269
40273
|
});
|
|
40270
40274
|
});
|
|
40271
40275
|
const checkDeadCode = async (options) => {
|
|
40272
|
-
const { userConfig } = options;
|
|
40273
40276
|
const rootDirectory = toCanonicalPath(options.rootDirectory);
|
|
40274
40277
|
if (!NFS.existsSync(Path.join(rootDirectory, "package.json"))) return [];
|
|
40275
40278
|
const entryPatterns = collectDeadCodeEntryPatterns(rootDirectory);
|
|
40276
|
-
const ignorePatterns = collectDeadCodeIgnorePatterns(rootDirectory
|
|
40279
|
+
const ignorePatterns = collectDeadCodeIgnorePatterns(rootDirectory);
|
|
40277
40280
|
const result = parseDeadCodeWorkerResult(await runDeadCodeWorkerWithTimeout((options.createWorker ?? createDeadCodeWorker)({
|
|
40278
40281
|
rootDirectory,
|
|
40279
40282
|
entryPatterns,
|
|
@@ -43972,7 +43975,7 @@ const makeNoopConsole = () => ({
|
|
|
43972
43975
|
});
|
|
43973
43976
|
//#endregion
|
|
43974
43977
|
//#region src/cli/utils/version.ts
|
|
43975
|
-
const VERSION = "0.5.6-dev.
|
|
43978
|
+
const VERSION = "0.5.6-dev.eafac9d";
|
|
43976
43979
|
//#endregion
|
|
43977
43980
|
//#region src/cli/utils/json-mode.ts
|
|
43978
43981
|
let context = null;
|
|
@@ -44330,13 +44333,13 @@ const isDevVersion = (version) => version === "0.0.0" || version.includes("-");
|
|
|
44330
44333
|
* uploads source-map artifacts under, so stack frames symbolicate. Honors the
|
|
44331
44334
|
* standard `SENTRY_RELEASE` override.
|
|
44332
44335
|
*/
|
|
44333
|
-
const resolveSentryRelease = () => process.env.SENTRY_RELEASE || `react-doctor@0.5.6-dev.
|
|
44336
|
+
const resolveSentryRelease = () => process.env.SENTRY_RELEASE || `react-doctor@0.5.6-dev.eafac9d`;
|
|
44334
44337
|
/**
|
|
44335
44338
|
* Deployment environment shown in Sentry's environment filter. Defaults to
|
|
44336
44339
|
* `production` for tagged releases and `development` for dev/unbuilt versions,
|
|
44337
44340
|
* overridable via the standard `SENTRY_ENVIRONMENT` env var.
|
|
44338
44341
|
*/
|
|
44339
|
-
const resolveSentryEnvironment = () => process.env.SENTRY_ENVIRONMENT || (isDevVersion("0.5.6-dev.
|
|
44342
|
+
const resolveSentryEnvironment = () => process.env.SENTRY_ENVIRONMENT || (isDevVersion("0.5.6-dev.eafac9d") ? "development" : "production");
|
|
44340
44343
|
/**
|
|
44341
44344
|
* Performance-tracing sample rate in `[0, 1]`. Reads `SENTRY_TRACES_SAMPLE_RATE`
|
|
44342
44345
|
* (set to `0` to disable tracing) and falls back to
|
|
@@ -48118,7 +48121,7 @@ const AGENT_GUIDANCE_LINES = [
|
|
|
48118
48121
|
"Investigate deeply where relevant: race conditions, security-sensitive flows, state propagation, multi-file refactors, and downstream dependency chains.",
|
|
48119
48122
|
"Ignore pure style preferences, theoretical issues without real impact, missing features, and unrelated pre-existing code.",
|
|
48120
48123
|
"Start with high-confidence fixes that preserve behavior. Leave low-confidence or product-dependent changes as notes.",
|
|
48121
|
-
"Run `npx react-doctor@latest --verbose --
|
|
48124
|
+
"Run `npx react-doctor@latest --verbose --scope changed` before and after changes, plus relevant tests after each focused batch.",
|
|
48122
48125
|
"When available, spawn subagents or isolated worktrees for independent rule families, then review and merge only the best safe fixes.",
|
|
48123
48126
|
"Split unrelated, broad, or behavior-changing work into separate PRs/branches instead of one large cleanup.",
|
|
48124
48127
|
"For confirmed issues that cannot be fixed now, create GitHub issues with the rule, file/line, confidence, impact, and proposed fix.",
|
|
@@ -50760,22 +50763,22 @@ const buildAgentHookScript = () => [
|
|
|
50760
50763
|
"",
|
|
50761
50764
|
"run_react_doctor() {",
|
|
50762
50765
|
" if [ -x ./node_modules/.bin/react-doctor ]; then",
|
|
50763
|
-
" ./node_modules/.bin/react-doctor --verbose --
|
|
50766
|
+
" ./node_modules/.bin/react-doctor --verbose --scope changed --blocking warning --no-score",
|
|
50764
50767
|
" return",
|
|
50765
50768
|
" fi",
|
|
50766
50769
|
"",
|
|
50767
50770
|
" if command -v react-doctor >/dev/null 2>&1; then",
|
|
50768
|
-
" react-doctor --verbose --
|
|
50771
|
+
" react-doctor --verbose --scope changed --blocking warning --no-score",
|
|
50769
50772
|
" return",
|
|
50770
50773
|
" fi",
|
|
50771
50774
|
"",
|
|
50772
50775
|
" if command -v pnpm >/dev/null 2>&1; then",
|
|
50773
|
-
" pnpm dlx react-doctor@latest --verbose --
|
|
50776
|
+
" pnpm dlx react-doctor@latest --verbose --scope changed --blocking warning --no-score",
|
|
50774
50777
|
" return",
|
|
50775
50778
|
" fi",
|
|
50776
50779
|
"",
|
|
50777
50780
|
" if command -v npx >/dev/null 2>&1; then",
|
|
50778
|
-
" npx --yes react-doctor@latest --verbose --
|
|
50781
|
+
" npx --yes react-doctor@latest --verbose --scope changed --blocking warning --no-score",
|
|
50779
50782
|
" return",
|
|
50780
50783
|
" fi",
|
|
50781
50784
|
"",
|
|
@@ -53872,7 +53875,7 @@ ${highlighter.dim("Examples:")}
|
|
|
53872
53875
|
${formatExampleLines([
|
|
53873
53876
|
["react-doctor", "scan the current project"],
|
|
53874
53877
|
["react-doctor ./apps/web", "scan a specific directory"],
|
|
53875
|
-
["react-doctor --
|
|
53878
|
+
["react-doctor --scope changed --base main", "scan only new issues vs. main"],
|
|
53876
53879
|
["react-doctor --project modules/a,modules/b", "score each module separately (names or paths)"],
|
|
53877
53880
|
["react-doctor --staged", "scan staged files (pre-commit hook)"],
|
|
53878
53881
|
["react-doctor --category Security", "show only one diagnostic category"],
|
|
@@ -53948,4 +53951,4 @@ Promise.resolve().then(() => assertNoRemovedFlags(process.argv)).then(() => prog
|
|
|
53948
53951
|
export {};
|
|
53949
53952
|
|
|
53950
53953
|
//# sourceMappingURL=cli.js.map
|
|
53951
|
-
//# debugId=
|
|
53954
|
+
//# debugId=54905d6a-f06f-5f80-9fb6-7d4ab857d553
|
package/dist/index.d.ts
CHANGED
|
@@ -9280,9 +9280,10 @@ interface ReactDoctorConfig {
|
|
|
9280
9280
|
* list, user-provided names are treated as distinctive and never
|
|
9281
9281
|
* subject to receiver-object disambiguation.
|
|
9282
9282
|
*
|
|
9283
|
-
*
|
|
9284
|
-
*
|
|
9285
|
-
*
|
|
9283
|
+
* Common guard conventions are already recognized automatically
|
|
9284
|
+
* (`requireAdmin`, `ensureSignedIn`, `getCurrentUser`, `hasRole`, …),
|
|
9285
|
+
* so this is only needed for domain-specific guards whose names carry
|
|
9286
|
+
* no auth noun — e.g. a project-local `requireWorkspaceMember`.
|
|
9286
9287
|
*/
|
|
9287
9288
|
serverAuthFunctionNames?: string[];
|
|
9288
9289
|
/**
|
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]="b4f6f7e7-99db-553a-aa15-14b646162f39")}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 * as NFS from "node:fs";
|
|
@@ -36472,10 +36472,15 @@ const buildCapabilities = (project) => {
|
|
|
36472
36472
|
}
|
|
36473
36473
|
if (project.tailwindVersion !== null) {
|
|
36474
36474
|
capabilities.add("tailwind");
|
|
36475
|
-
|
|
36475
|
+
const tailwind = parseTailwindMajorMinor(project.tailwindVersion);
|
|
36476
|
+
if (isTailwindAtLeast(tailwind, {
|
|
36476
36477
|
major: 3,
|
|
36477
36478
|
minor: 4
|
|
36478
36479
|
})) capabilities.add("tailwind:3.4");
|
|
36480
|
+
if (tailwind !== null && isTailwindAtLeast(tailwind, {
|
|
36481
|
+
major: 4,
|
|
36482
|
+
minor: 0
|
|
36483
|
+
})) capabilities.add("tailwind:4");
|
|
36479
36484
|
}
|
|
36480
36485
|
if (project.zodVersion !== null) {
|
|
36481
36486
|
capabilities.add("zod");
|
|
@@ -36750,12 +36755,11 @@ const collectKnipPatterns = (rootDirectory, settingName) => {
|
|
|
36750
36755
|
if (!config) return [];
|
|
36751
36756
|
return [...normalizePatternList(config[settingName]), ...collectKnipWorkspacePatterns(config.workspaces, settingName)];
|
|
36752
36757
|
};
|
|
36753
|
-
const collectDeadCodeIgnorePatterns = (rootDirectory
|
|
36758
|
+
const collectDeadCodeIgnorePatterns = (rootDirectory) => {
|
|
36754
36759
|
const seen = /* @__PURE__ */ new Set();
|
|
36755
36760
|
const sources = [
|
|
36756
36761
|
readIgnoreFile(path.join(rootDirectory, ".gitignore")),
|
|
36757
36762
|
collectIgnorePatterns(rootDirectory),
|
|
36758
|
-
userConfig?.ignore?.files ?? [],
|
|
36759
36763
|
collectKnipPatterns(rootDirectory, "ignore")
|
|
36760
36764
|
];
|
|
36761
36765
|
for (const source of sources) for (const pattern of source) seen.add(pattern);
|
|
@@ -37033,11 +37037,10 @@ const runDeadCodeWorkerWithTimeout = (handle, timeoutMs) => new Promise((resolve
|
|
|
37033
37037
|
});
|
|
37034
37038
|
});
|
|
37035
37039
|
const checkDeadCode = async (options) => {
|
|
37036
|
-
const { userConfig } = options;
|
|
37037
37040
|
const rootDirectory = toCanonicalPath(options.rootDirectory);
|
|
37038
37041
|
if (!NFS.existsSync(Path.join(rootDirectory, "package.json"))) return [];
|
|
37039
37042
|
const entryPatterns = collectDeadCodeEntryPatterns(rootDirectory);
|
|
37040
|
-
const ignorePatterns = collectDeadCodeIgnorePatterns(rootDirectory
|
|
37043
|
+
const ignorePatterns = collectDeadCodeIgnorePatterns(rootDirectory);
|
|
37041
37044
|
const result = parseDeadCodeWorkerResult(await runDeadCodeWorkerWithTimeout((options.createWorker ?? createDeadCodeWorker)({
|
|
37042
37045
|
rootDirectory,
|
|
37043
37046
|
entryPatterns,
|
|
@@ -40573,4 +40576,4 @@ const toJsonReport = (result, options) => buildJsonReport({
|
|
|
40573
40576
|
export { AmbiguousProjectError, NoReactDependencyError, NotADirectoryError, PackageJsonNotFoundError, ProjectNotFoundError, ReactDoctorError, buildJsonReport, buildJsonReportError, clearCaches, defineConfig, diagnose, filterSourceFiles, getDiffInfo, isProjectDiscoveryError, isReactDoctorError, summarizeDiagnostics, toJsonReport };
|
|
40574
40577
|
|
|
40575
40578
|
//# sourceMappingURL=index.js.map
|
|
40576
|
-
//# debugId=
|
|
40579
|
+
//# debugId=b4f6f7e7-99db-553a-aa15-14b646162f39
|
package/dist/lsp.js
CHANGED
|
@@ -36458,10 +36458,15 @@ const buildCapabilities = (project) => {
|
|
|
36458
36458
|
}
|
|
36459
36459
|
if (project.tailwindVersion !== null) {
|
|
36460
36460
|
capabilities.add("tailwind");
|
|
36461
|
-
|
|
36461
|
+
const tailwind = parseTailwindMajorMinor(project.tailwindVersion);
|
|
36462
|
+
if (isTailwindAtLeast(tailwind, {
|
|
36462
36463
|
major: 3,
|
|
36463
36464
|
minor: 4
|
|
36464
36465
|
})) capabilities.add("tailwind:3.4");
|
|
36466
|
+
if (tailwind !== null && isTailwindAtLeast(tailwind, {
|
|
36467
|
+
major: 4,
|
|
36468
|
+
minor: 0
|
|
36469
|
+
})) capabilities.add("tailwind:4");
|
|
36465
36470
|
}
|
|
36466
36471
|
if (project.zodVersion !== null) {
|
|
36467
36472
|
capabilities.add("zod");
|
|
@@ -36736,12 +36741,11 @@ const collectKnipPatterns = (rootDirectory, settingName) => {
|
|
|
36736
36741
|
if (!config) return [];
|
|
36737
36742
|
return [...normalizePatternList(config[settingName]), ...collectKnipWorkspacePatterns(config.workspaces, settingName)];
|
|
36738
36743
|
};
|
|
36739
|
-
const collectDeadCodeIgnorePatterns = (rootDirectory
|
|
36744
|
+
const collectDeadCodeIgnorePatterns = (rootDirectory) => {
|
|
36740
36745
|
const seen = /* @__PURE__ */ new Set();
|
|
36741
36746
|
const sources = [
|
|
36742
36747
|
readIgnoreFile(path.join(rootDirectory, ".gitignore")),
|
|
36743
36748
|
collectIgnorePatterns(rootDirectory),
|
|
36744
|
-
userConfig?.ignore?.files ?? [],
|
|
36745
36749
|
collectKnipPatterns(rootDirectory, "ignore")
|
|
36746
36750
|
];
|
|
36747
36751
|
for (const source of sources) for (const pattern of source) seen.add(pattern);
|
|
@@ -37019,11 +37023,10 @@ const runDeadCodeWorkerWithTimeout = (handle, timeoutMs) => new Promise((resolve
|
|
|
37019
37023
|
});
|
|
37020
37024
|
});
|
|
37021
37025
|
const checkDeadCode = async (options) => {
|
|
37022
|
-
const { userConfig } = options;
|
|
37023
37026
|
const rootDirectory = toCanonicalPath(options.rootDirectory);
|
|
37024
37027
|
if (!NFS.existsSync(Path.join(rootDirectory, "package.json"))) return [];
|
|
37025
37028
|
const entryPatterns = collectDeadCodeEntryPatterns(rootDirectory);
|
|
37026
|
-
const ignorePatterns = collectDeadCodeIgnorePatterns(rootDirectory
|
|
37029
|
+
const ignorePatterns = collectDeadCodeIgnorePatterns(rootDirectory);
|
|
37027
37030
|
const result = parseDeadCodeWorkerResult(await runDeadCodeWorkerWithTimeout((options.createWorker ?? createDeadCodeWorker)({
|
|
37028
37031
|
rootDirectory,
|
|
37029
37032
|
entryPatterns,
|
|
@@ -42358,5 +42361,5 @@ const startLanguageServer = () => {
|
|
|
42358
42361
|
};
|
|
42359
42362
|
//#endregion
|
|
42360
42363
|
export { startLanguageServer };
|
|
42361
|
-
!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]="
|
|
42362
|
-
//# debugId=
|
|
42364
|
+
!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]="9421149c-0ed9-5e00-81da-4f7dd8faf332")}catch(e){}}();
|
|
42365
|
+
//# debugId=9421149c-0ed9-5e00-81da-4f7dd8faf332
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-doctor",
|
|
3
|
-
"version": "0.5.6-dev.
|
|
3
|
+
"version": "0.5.6-dev.eafac9d",
|
|
4
4
|
"description": "Your agent writes bad React. This catches it",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"accessibility",
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"vscode-languageserver": "^9.0.1",
|
|
65
65
|
"vscode-languageserver-textdocument": "^1.0.12",
|
|
66
66
|
"vscode-uri": "^3.1.0",
|
|
67
|
-
"oxlint-plugin-react-doctor": "0.5.6-dev.
|
|
67
|
+
"oxlint-plugin-react-doctor": "0.5.6-dev.eafac9d"
|
|
68
68
|
},
|
|
69
69
|
"devDependencies": {
|
|
70
70
|
"@types/babel__code-frame": "^7.27.0",
|
|
@@ -72,9 +72,9 @@
|
|
|
72
72
|
"@xterm/headless": "^6.0.0",
|
|
73
73
|
"commander": "^14.0.3",
|
|
74
74
|
"ora": "^9.4.0",
|
|
75
|
+
"@react-doctor/core": "0.5.6",
|
|
75
76
|
"@react-doctor/api": "0.5.6",
|
|
76
|
-
"@react-doctor/language-server": "0.5.6"
|
|
77
|
-
"@react-doctor/core": "0.5.6"
|
|
77
|
+
"@react-doctor/language-server": "0.5.6"
|
|
78
78
|
},
|
|
79
79
|
"engines": {
|
|
80
80
|
"node": "^20.19.0 || >=22.13.0"
|