react-doctor 0.5.1-dev.04e72a4 → 0.5.1-dev.0a9d583
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 +30 -11
- package/dist/index.js +25 -7
- package/dist/lsp.js +25 -7
- package/package.json +3 -3
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]="5c7334de-5fd1-50a7-bb75-1a17b3b54e4e")}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";
|
|
@@ -41732,9 +41732,18 @@ const shouldSuppressLocalUseHookDiagnostic = (diagnostic, rootDirectory) => {
|
|
|
41732
41732
|
return bindingResolution !== null && !bindingResolution.isReactUseBinding;
|
|
41733
41733
|
};
|
|
41734
41734
|
const FILEPATH_WITH_LOCATION_PATTERN = /\S+\.\w+:\d+:\d+[\s\S]*$/;
|
|
41735
|
+
const LEADING_SEVERITY_LABEL_PATTERN = /^(?:Error|Warning):\s*/;
|
|
41736
|
+
const TRAILING_PERIOD_PATTERN = /\.$/;
|
|
41735
41737
|
const REACT_COMPILER_TITLE = "React Compiler can't optimize this";
|
|
41736
41738
|
const REACT_COMPILER_TODO_TITLE = "React Compiler doesn't support this syntax";
|
|
41737
|
-
const
|
|
41739
|
+
const REACT_COMPILER_IMPACT = "This component misses React Compiler's automatic memoization & re-renders more than it should";
|
|
41740
|
+
const REACT_COMPILER_ACTION = "Rewrite the flagged code so the compiler can optimize it.";
|
|
41741
|
+
const REACT_COMPILER_GENERIC_MESSAGE = `${REACT_COMPILER_IMPACT}. ${REACT_COMPILER_ACTION}`;
|
|
41742
|
+
const buildReactCompilerMessage = (reasonSummary) => {
|
|
41743
|
+
const normalizedSummary = reasonSummary.replace(TRAILING_PERIOD_PATTERN, "");
|
|
41744
|
+
if (!normalizedSummary) return REACT_COMPILER_GENERIC_MESSAGE;
|
|
41745
|
+
return `${REACT_COMPILER_IMPACT}: ${normalizedSummary}. ${REACT_COMPILER_ACTION}`;
|
|
41746
|
+
};
|
|
41738
41747
|
const PLUGIN_CATEGORY_MAP = {
|
|
41739
41748
|
react: "Bugs",
|
|
41740
41749
|
"react-hooks": "Bugs",
|
|
@@ -41773,10 +41782,19 @@ const cleanDiagnosticMessage = (message, help, plugin, rule, project) => {
|
|
|
41773
41782
|
};
|
|
41774
41783
|
};
|
|
41775
41784
|
const resolveCleanedDiagnostic = (message, help, plugin, rule, project) => {
|
|
41776
|
-
if (plugin === "react-hooks-js")
|
|
41777
|
-
message
|
|
41778
|
-
|
|
41779
|
-
|
|
41785
|
+
if (plugin === "react-hooks-js") {
|
|
41786
|
+
const bailoutReason = message.replace(FILEPATH_WITH_LOCATION_PATTERN, "").trim().replace(LEADING_SEVERITY_LABEL_PATTERN, "").trim();
|
|
41787
|
+
if (rule === "todo") return {
|
|
41788
|
+
message: REACT_COMPILER_GENERIC_MESSAGE,
|
|
41789
|
+
help: appendReanimatedSharedValueHint(bailoutReason || help, rule, project)
|
|
41790
|
+
};
|
|
41791
|
+
const [reasonSummary = "", ...reasonDetailLines] = bailoutReason.split("\n");
|
|
41792
|
+
const reasonDetail = reasonDetailLines.join("\n").trim();
|
|
41793
|
+
return {
|
|
41794
|
+
message: buildReactCompilerMessage(reasonSummary.trim()),
|
|
41795
|
+
help: appendReanimatedSharedValueHint(reasonDetail || help, rule, project)
|
|
41796
|
+
};
|
|
41797
|
+
}
|
|
41780
41798
|
return {
|
|
41781
41799
|
message: message.replace(FILEPATH_WITH_LOCATION_PATTERN, "").trim() || message,
|
|
41782
41800
|
help: help || getRuleRecommendation(rule, project) || ""
|
|
@@ -43742,7 +43760,7 @@ const makeNoopConsole = () => ({
|
|
|
43742
43760
|
});
|
|
43743
43761
|
//#endregion
|
|
43744
43762
|
//#region src/cli/utils/version.ts
|
|
43745
|
-
const VERSION = "0.5.1-dev.
|
|
43763
|
+
const VERSION = "0.5.1-dev.0a9d583";
|
|
43746
43764
|
//#endregion
|
|
43747
43765
|
//#region src/cli/utils/json-mode.ts
|
|
43748
43766
|
let context = null;
|
|
@@ -44100,13 +44118,13 @@ const isDevVersion = (version) => version === "0.0.0" || version.includes("-");
|
|
|
44100
44118
|
* uploads source-map artifacts under, so stack frames symbolicate. Honors the
|
|
44101
44119
|
* standard `SENTRY_RELEASE` override.
|
|
44102
44120
|
*/
|
|
44103
|
-
const resolveSentryRelease = () => process.env.SENTRY_RELEASE || `react-doctor@0.5.1-dev.
|
|
44121
|
+
const resolveSentryRelease = () => process.env.SENTRY_RELEASE || `react-doctor@0.5.1-dev.0a9d583`;
|
|
44104
44122
|
/**
|
|
44105
44123
|
* Deployment environment shown in Sentry's environment filter. Defaults to
|
|
44106
44124
|
* `production` for tagged releases and `development` for dev/unbuilt versions,
|
|
44107
44125
|
* overridable via the standard `SENTRY_ENVIRONMENT` env var.
|
|
44108
44126
|
*/
|
|
44109
|
-
const resolveSentryEnvironment = () => process.env.SENTRY_ENVIRONMENT || (isDevVersion("0.5.1-dev.
|
|
44127
|
+
const resolveSentryEnvironment = () => process.env.SENTRY_ENVIRONMENT || (isDevVersion("0.5.1-dev.0a9d583") ? "development" : "production");
|
|
44110
44128
|
/**
|
|
44111
44129
|
* Performance-tracing sample rate in `[0, 1]`. Reads `SENTRY_TRACES_SAMPLE_RATE`
|
|
44112
44130
|
* (set to `0` to disable tracing) and falls back to
|
|
@@ -48314,13 +48332,14 @@ const formatElapsedTime = (elapsedMilliseconds) => {
|
|
|
48314
48332
|
};
|
|
48315
48333
|
const formatRuleSummary = (ruleKey, ruleDiagnostics) => {
|
|
48316
48334
|
const firstDiagnostic = ruleDiagnostics[0];
|
|
48335
|
+
const distinctMessages = [...new Set(ruleDiagnostics.map((diagnostic) => diagnostic.message))];
|
|
48317
48336
|
const sections = [
|
|
48318
48337
|
`Rule: ${ruleKey}`,
|
|
48319
48338
|
`Severity: ${firstDiagnostic.severity}`,
|
|
48320
48339
|
`Category: ${firstDiagnostic.category}`,
|
|
48321
48340
|
`Count: ${ruleDiagnostics.length}`,
|
|
48322
48341
|
"",
|
|
48323
|
-
|
|
48342
|
+
distinctMessages.join("\n\n")
|
|
48324
48343
|
];
|
|
48325
48344
|
if (firstDiagnostic.help) sections.push("", `Suggestion: ${firstDiagnostic.help}`);
|
|
48326
48345
|
if (firstDiagnostic.url) sections.push("", `Docs: ${firstDiagnostic.url}`);
|
|
@@ -53781,4 +53800,4 @@ Promise.resolve().then(() => assertNoRemovedFlags(process.argv)).then(() => prog
|
|
|
53781
53800
|
export {};
|
|
53782
53801
|
|
|
53783
53802
|
//# sourceMappingURL=cli.js.map
|
|
53784
|
-
//# debugId=
|
|
53803
|
+
//# debugId=5c7334de-5fd1-50a7-bb75-1a17b3b54e4e
|
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]="c8ddec5f-75dd-56a9-93b8-c34b1f202f7c")}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";
|
|
@@ -38495,9 +38495,18 @@ const shouldSuppressLocalUseHookDiagnostic = (diagnostic, rootDirectory) => {
|
|
|
38495
38495
|
return bindingResolution !== null && !bindingResolution.isReactUseBinding;
|
|
38496
38496
|
};
|
|
38497
38497
|
const FILEPATH_WITH_LOCATION_PATTERN = /\S+\.\w+:\d+:\d+[\s\S]*$/;
|
|
38498
|
+
const LEADING_SEVERITY_LABEL_PATTERN = /^(?:Error|Warning):\s*/;
|
|
38499
|
+
const TRAILING_PERIOD_PATTERN = /\.$/;
|
|
38498
38500
|
const REACT_COMPILER_TITLE = "React Compiler can't optimize this";
|
|
38499
38501
|
const REACT_COMPILER_TODO_TITLE = "React Compiler doesn't support this syntax";
|
|
38500
|
-
const
|
|
38502
|
+
const REACT_COMPILER_IMPACT = "This component misses React Compiler's automatic memoization & re-renders more than it should";
|
|
38503
|
+
const REACT_COMPILER_ACTION = "Rewrite the flagged code so the compiler can optimize it.";
|
|
38504
|
+
const REACT_COMPILER_GENERIC_MESSAGE = `${REACT_COMPILER_IMPACT}. ${REACT_COMPILER_ACTION}`;
|
|
38505
|
+
const buildReactCompilerMessage = (reasonSummary) => {
|
|
38506
|
+
const normalizedSummary = reasonSummary.replace(TRAILING_PERIOD_PATTERN, "");
|
|
38507
|
+
if (!normalizedSummary) return REACT_COMPILER_GENERIC_MESSAGE;
|
|
38508
|
+
return `${REACT_COMPILER_IMPACT}: ${normalizedSummary}. ${REACT_COMPILER_ACTION}`;
|
|
38509
|
+
};
|
|
38501
38510
|
const PLUGIN_CATEGORY_MAP = {
|
|
38502
38511
|
react: "Bugs",
|
|
38503
38512
|
"react-hooks": "Bugs",
|
|
@@ -38536,10 +38545,19 @@ const cleanDiagnosticMessage = (message, help, plugin, rule, project) => {
|
|
|
38536
38545
|
};
|
|
38537
38546
|
};
|
|
38538
38547
|
const resolveCleanedDiagnostic = (message, help, plugin, rule, project) => {
|
|
38539
|
-
if (plugin === "react-hooks-js")
|
|
38540
|
-
message
|
|
38541
|
-
|
|
38542
|
-
|
|
38548
|
+
if (plugin === "react-hooks-js") {
|
|
38549
|
+
const bailoutReason = message.replace(FILEPATH_WITH_LOCATION_PATTERN, "").trim().replace(LEADING_SEVERITY_LABEL_PATTERN, "").trim();
|
|
38550
|
+
if (rule === "todo") return {
|
|
38551
|
+
message: REACT_COMPILER_GENERIC_MESSAGE,
|
|
38552
|
+
help: appendReanimatedSharedValueHint(bailoutReason || help, rule, project)
|
|
38553
|
+
};
|
|
38554
|
+
const [reasonSummary = "", ...reasonDetailLines] = bailoutReason.split("\n");
|
|
38555
|
+
const reasonDetail = reasonDetailLines.join("\n").trim();
|
|
38556
|
+
return {
|
|
38557
|
+
message: buildReactCompilerMessage(reasonSummary.trim()),
|
|
38558
|
+
help: appendReanimatedSharedValueHint(reasonDetail || help, rule, project)
|
|
38559
|
+
};
|
|
38560
|
+
}
|
|
38543
38561
|
return {
|
|
38544
38562
|
message: message.replace(FILEPATH_WITH_LOCATION_PATTERN, "").trim() || message,
|
|
38545
38563
|
help: help || getRuleRecommendation(rule, project) || ""
|
|
@@ -40294,4 +40312,4 @@ const toJsonReport = (result, options) => buildJsonReport({
|
|
|
40294
40312
|
export { AmbiguousProjectError, NoReactDependencyError, NotADirectoryError, PackageJsonNotFoundError, ProjectNotFoundError, ReactDoctorError, buildJsonReport, buildJsonReportError, clearCaches, defineConfig, diagnose, filterSourceFiles, getDiffInfo, isProjectDiscoveryError, isReactDoctorError, summarizeDiagnostics, toJsonReport };
|
|
40295
40313
|
|
|
40296
40314
|
//# sourceMappingURL=index.js.map
|
|
40297
|
-
//# debugId=
|
|
40315
|
+
//# debugId=c8ddec5f-75dd-56a9-93b8-c34b1f202f7c
|
package/dist/lsp.js
CHANGED
|
@@ -38481,9 +38481,18 @@ const shouldSuppressLocalUseHookDiagnostic = (diagnostic, rootDirectory) => {
|
|
|
38481
38481
|
return bindingResolution !== null && !bindingResolution.isReactUseBinding;
|
|
38482
38482
|
};
|
|
38483
38483
|
const FILEPATH_WITH_LOCATION_PATTERN = /\S+\.\w+:\d+:\d+[\s\S]*$/;
|
|
38484
|
+
const LEADING_SEVERITY_LABEL_PATTERN = /^(?:Error|Warning):\s*/;
|
|
38485
|
+
const TRAILING_PERIOD_PATTERN = /\.$/;
|
|
38484
38486
|
const REACT_COMPILER_TITLE = "React Compiler can't optimize this";
|
|
38485
38487
|
const REACT_COMPILER_TODO_TITLE = "React Compiler doesn't support this syntax";
|
|
38486
|
-
const
|
|
38488
|
+
const REACT_COMPILER_IMPACT = "This component misses React Compiler's automatic memoization & re-renders more than it should";
|
|
38489
|
+
const REACT_COMPILER_ACTION = "Rewrite the flagged code so the compiler can optimize it.";
|
|
38490
|
+
const REACT_COMPILER_GENERIC_MESSAGE = `${REACT_COMPILER_IMPACT}. ${REACT_COMPILER_ACTION}`;
|
|
38491
|
+
const buildReactCompilerMessage = (reasonSummary) => {
|
|
38492
|
+
const normalizedSummary = reasonSummary.replace(TRAILING_PERIOD_PATTERN, "");
|
|
38493
|
+
if (!normalizedSummary) return REACT_COMPILER_GENERIC_MESSAGE;
|
|
38494
|
+
return `${REACT_COMPILER_IMPACT}: ${normalizedSummary}. ${REACT_COMPILER_ACTION}`;
|
|
38495
|
+
};
|
|
38487
38496
|
const PLUGIN_CATEGORY_MAP = {
|
|
38488
38497
|
react: "Bugs",
|
|
38489
38498
|
"react-hooks": "Bugs",
|
|
@@ -38522,10 +38531,19 @@ const cleanDiagnosticMessage = (message, help, plugin, rule, project) => {
|
|
|
38522
38531
|
};
|
|
38523
38532
|
};
|
|
38524
38533
|
const resolveCleanedDiagnostic = (message, help, plugin, rule, project) => {
|
|
38525
|
-
if (plugin === "react-hooks-js")
|
|
38526
|
-
message
|
|
38527
|
-
|
|
38528
|
-
|
|
38534
|
+
if (plugin === "react-hooks-js") {
|
|
38535
|
+
const bailoutReason = message.replace(FILEPATH_WITH_LOCATION_PATTERN, "").trim().replace(LEADING_SEVERITY_LABEL_PATTERN, "").trim();
|
|
38536
|
+
if (rule === "todo") return {
|
|
38537
|
+
message: REACT_COMPILER_GENERIC_MESSAGE,
|
|
38538
|
+
help: appendReanimatedSharedValueHint(bailoutReason || help, rule, project)
|
|
38539
|
+
};
|
|
38540
|
+
const [reasonSummary = "", ...reasonDetailLines] = bailoutReason.split("\n");
|
|
38541
|
+
const reasonDetail = reasonDetailLines.join("\n").trim();
|
|
38542
|
+
return {
|
|
38543
|
+
message: buildReactCompilerMessage(reasonSummary.trim()),
|
|
38544
|
+
help: appendReanimatedSharedValueHint(reasonDetail || help, rule, project)
|
|
38545
|
+
};
|
|
38546
|
+
}
|
|
38529
38547
|
return {
|
|
38530
38548
|
message: message.replace(FILEPATH_WITH_LOCATION_PATTERN, "").trim() || message,
|
|
38531
38549
|
help: help || getRuleRecommendation(rule, project) || ""
|
|
@@ -42079,5 +42097,5 @@ const startLanguageServer = () => {
|
|
|
42079
42097
|
};
|
|
42080
42098
|
//#endregion
|
|
42081
42099
|
export { startLanguageServer };
|
|
42082
|
-
!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]="
|
|
42083
|
-
//# debugId=
|
|
42100
|
+
!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]="d189cded-30cd-5adf-aa54-2429b20c538b")}catch(e){}}();
|
|
42101
|
+
//# debugId=d189cded-30cd-5adf-aa54-2429b20c538b
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-doctor",
|
|
3
|
-
"version": "0.5.1-dev.
|
|
3
|
+
"version": "0.5.1-dev.0a9d583",
|
|
4
4
|
"description": "Your agent writes bad React. This catches it",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"accessibility",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"agent-install": "0.0.5",
|
|
55
55
|
"conf": "^15.1.0",
|
|
56
56
|
"confbox": "^0.2.4",
|
|
57
|
-
"deslop-js": "^0.0.
|
|
57
|
+
"deslop-js": "^0.0.24",
|
|
58
58
|
"eslint-plugin-react-hooks": "^7.1.1",
|
|
59
59
|
"jiti": "^2.7.0",
|
|
60
60
|
"magicast": "^0.5.3",
|
|
@@ -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.1-dev.
|
|
67
|
+
"oxlint-plugin-react-doctor": "0.5.1-dev.0a9d583"
|
|
68
68
|
},
|
|
69
69
|
"devDependencies": {
|
|
70
70
|
"@types/babel__code-frame": "^7.27.0",
|