react-doctor 0.8.1-dev.b852961 → 0.8.1-dev.c9f2c4b
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 +5 -14
- package/dist/index.js +2 -11
- package/dist/lsp.js +2 -11
- 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]="c24708ed-97a3-59cc-81f7-4cf277ab29f2")}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";
|
|
@@ -44091,17 +44091,12 @@ const REACT_ERROR_BOUNDARY_MESSAGE = "This try/catch cannot catch errors thrown
|
|
|
44091
44091
|
const REACT_COMPILER_IMPACT = "This component misses React Compiler's automatic memoization & re-renders more than it should";
|
|
44092
44092
|
const REACT_COMPILER_ACTION = "Rewrite the flagged code so the compiler can optimize it.";
|
|
44093
44093
|
const REACT_COMPILER_INCOMPATIBLE_LIBRARY_ACTION = "It's how the library works, not a bug in your code. Memoize values you pass from it into other memoized components, or suppress it with `// react-doctor-disable-next-line react-hooks-js/incompatible-library`.";
|
|
44094
|
-
const SET_STATE_IN_EFFECT_ACTION = "Prefer deriving or initializing the value before render. If the effect must read a browser API after mount, treat this as advisory or suppress it with `// react-doctor-disable-next-line react-hooks-js/set-state-in-effect`.";
|
|
44095
44094
|
const REACT_COMPILER_GENERIC_MESSAGE = `${REACT_COMPILER_IMPACT}. ${REACT_COMPILER_ACTION}`;
|
|
44096
44095
|
const buildReactCompilerMessage = (reasonSummary, action = REACT_COMPILER_ACTION) => {
|
|
44097
44096
|
const normalizedSummary = reasonSummary.replace(TRAILING_PERIOD_PATTERN, "");
|
|
44098
44097
|
if (!normalizedSummary) return `${REACT_COMPILER_IMPACT}. ${action}`;
|
|
44099
44098
|
return `${REACT_COMPILER_IMPACT}: ${normalizedSummary}. ${action}`;
|
|
44100
44099
|
};
|
|
44101
|
-
const buildSetStateInEffectMessage = (reasonSummary) => {
|
|
44102
|
-
const normalizedSummary = reasonSummary.replace(TRAILING_PERIOD_PATTERN, "");
|
|
44103
|
-
return `This synchronous effect update causes an extra render${normalizedSummary ? `: ${normalizedSummary}` : ""}. ${SET_STATE_IN_EFFECT_ACTION}`;
|
|
44104
|
-
};
|
|
44105
44100
|
const PLUGIN_CATEGORY_MAP = {
|
|
44106
44101
|
react: "Bugs",
|
|
44107
44102
|
"react-hooks": "Bugs",
|
|
@@ -44159,10 +44154,6 @@ const resolveCleanedDiagnostic = (message, help, plugin, rule, project) => {
|
|
|
44159
44154
|
message: REACT_ERROR_BOUNDARY_MESSAGE,
|
|
44160
44155
|
help: reasonDetail || help
|
|
44161
44156
|
};
|
|
44162
|
-
if (rule === "set-state-in-effect") return {
|
|
44163
|
-
message: buildSetStateInEffectMessage(reasonSummary.trim()),
|
|
44164
|
-
help: reasonDetail || help
|
|
44165
|
-
};
|
|
44166
44157
|
return {
|
|
44167
44158
|
message: buildReactCompilerMessage(reasonSummary.trim(), rule === "incompatible-library" ? REACT_COMPILER_INCOMPATIBLE_LIBRARY_ACTION : REACT_COMPILER_ACTION),
|
|
44168
44159
|
help: appendReanimatedSharedValueHint(reasonDetail || help, rule, project)
|
|
@@ -47365,7 +47356,7 @@ const makeNoopConsole = () => ({
|
|
|
47365
47356
|
});
|
|
47366
47357
|
//#endregion
|
|
47367
47358
|
//#region src/cli/utils/version.ts
|
|
47368
|
-
const VERSION = "0.8.1-dev.
|
|
47359
|
+
const VERSION = "0.8.1-dev.c9f2c4b";
|
|
47369
47360
|
//#endregion
|
|
47370
47361
|
//#region src/cli/utils/json-mode.ts
|
|
47371
47362
|
let context = null;
|
|
@@ -47717,13 +47708,13 @@ const isDevVersion = (version) => version === "0.0.0" || version.includes("-");
|
|
|
47717
47708
|
* uploads source-map artifacts under, so stack frames symbolicate. Honors the
|
|
47718
47709
|
* standard `SENTRY_RELEASE` override.
|
|
47719
47710
|
*/
|
|
47720
|
-
const resolveSentryRelease = () => process.env.SENTRY_RELEASE || `react-doctor@0.8.1-dev.
|
|
47711
|
+
const resolveSentryRelease = () => process.env.SENTRY_RELEASE || `react-doctor@0.8.1-dev.c9f2c4b`;
|
|
47721
47712
|
/**
|
|
47722
47713
|
* Deployment environment shown in Sentry's environment filter. Defaults to
|
|
47723
47714
|
* `production` for tagged releases and `development` for dev/unbuilt versions,
|
|
47724
47715
|
* overridable via the standard `SENTRY_ENVIRONMENT` env var.
|
|
47725
47716
|
*/
|
|
47726
|
-
const resolveSentryEnvironment = () => process.env.SENTRY_ENVIRONMENT || (isDevVersion("0.8.1-dev.
|
|
47717
|
+
const resolveSentryEnvironment = () => process.env.SENTRY_ENVIRONMENT || (isDevVersion("0.8.1-dev.c9f2c4b") ? "development" : "production");
|
|
47727
47718
|
/**
|
|
47728
47719
|
* Performance-tracing sample rate in `[0, 1]`. Reads `SENTRY_TRACES_SAMPLE_RATE`
|
|
47729
47720
|
* (set to `0` to disable tracing) and falls back to
|
|
@@ -66403,4 +66394,4 @@ Promise.resolve().then(() => assertNoRemovedFlags(process.argv)).then(() => prog
|
|
|
66403
66394
|
export {};
|
|
66404
66395
|
|
|
66405
66396
|
//# sourceMappingURL=cli.js.map
|
|
66406
|
-
//# debugId=
|
|
66397
|
+
//# debugId=c24708ed-97a3-59cc-81f7-4cf277ab29f2
|
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]="f645a3f8-ff1c-5f09-a174-8281db00eaa4")}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";
|
|
@@ -40847,17 +40847,12 @@ const REACT_ERROR_BOUNDARY_MESSAGE = "This try/catch cannot catch errors thrown
|
|
|
40847
40847
|
const REACT_COMPILER_IMPACT = "This component misses React Compiler's automatic memoization & re-renders more than it should";
|
|
40848
40848
|
const REACT_COMPILER_ACTION = "Rewrite the flagged code so the compiler can optimize it.";
|
|
40849
40849
|
const REACT_COMPILER_INCOMPATIBLE_LIBRARY_ACTION = "It's how the library works, not a bug in your code. Memoize values you pass from it into other memoized components, or suppress it with `// react-doctor-disable-next-line react-hooks-js/incompatible-library`.";
|
|
40850
|
-
const SET_STATE_IN_EFFECT_ACTION = "Prefer deriving or initializing the value before render. If the effect must read a browser API after mount, treat this as advisory or suppress it with `// react-doctor-disable-next-line react-hooks-js/set-state-in-effect`.";
|
|
40851
40850
|
const REACT_COMPILER_GENERIC_MESSAGE = `${REACT_COMPILER_IMPACT}. ${REACT_COMPILER_ACTION}`;
|
|
40852
40851
|
const buildReactCompilerMessage = (reasonSummary, action = REACT_COMPILER_ACTION) => {
|
|
40853
40852
|
const normalizedSummary = reasonSummary.replace(TRAILING_PERIOD_PATTERN, "");
|
|
40854
40853
|
if (!normalizedSummary) return `${REACT_COMPILER_IMPACT}. ${action}`;
|
|
40855
40854
|
return `${REACT_COMPILER_IMPACT}: ${normalizedSummary}. ${action}`;
|
|
40856
40855
|
};
|
|
40857
|
-
const buildSetStateInEffectMessage = (reasonSummary) => {
|
|
40858
|
-
const normalizedSummary = reasonSummary.replace(TRAILING_PERIOD_PATTERN, "");
|
|
40859
|
-
return `This synchronous effect update causes an extra render${normalizedSummary ? `: ${normalizedSummary}` : ""}. ${SET_STATE_IN_EFFECT_ACTION}`;
|
|
40860
|
-
};
|
|
40861
40856
|
const PLUGIN_CATEGORY_MAP = {
|
|
40862
40857
|
react: "Bugs",
|
|
40863
40858
|
"react-hooks": "Bugs",
|
|
@@ -40915,10 +40910,6 @@ const resolveCleanedDiagnostic = (message, help, plugin, rule, project) => {
|
|
|
40915
40910
|
message: REACT_ERROR_BOUNDARY_MESSAGE,
|
|
40916
40911
|
help: reasonDetail || help
|
|
40917
40912
|
};
|
|
40918
|
-
if (rule === "set-state-in-effect") return {
|
|
40919
|
-
message: buildSetStateInEffectMessage(reasonSummary.trim()),
|
|
40920
|
-
help: reasonDetail || help
|
|
40921
|
-
};
|
|
40922
40913
|
return {
|
|
40923
40914
|
message: buildReactCompilerMessage(reasonSummary.trim(), rule === "incompatible-library" ? REACT_COMPILER_INCOMPATIBLE_LIBRARY_ACTION : REACT_COMPILER_ACTION),
|
|
40924
40915
|
help: appendReanimatedSharedValueHint(reasonDetail || help, rule, project)
|
|
@@ -43837,4 +43828,4 @@ const toJsonReport = (result, options) => buildJsonReport({
|
|
|
43837
43828
|
export { AmbiguousProjectError, NoReactDependencyError, NotADirectoryError, PackageJsonNotFoundError, ProjectNotFoundError, ReactDoctorError, buildJsonReport, buildJsonReportError, clearCaches, defineConfig, diagnose, filterSourceFiles, getDiffInfo, hasReactRuntime, isProjectDiscoveryError, isReactDoctorError, summarizeDiagnostics, toJsonReport };
|
|
43838
43829
|
|
|
43839
43830
|
//# sourceMappingURL=index.js.map
|
|
43840
|
-
//# debugId=
|
|
43831
|
+
//# debugId=f645a3f8-ff1c-5f09-a174-8281db00eaa4
|
package/dist/lsp.js
CHANGED
|
@@ -40825,17 +40825,12 @@ const REACT_ERROR_BOUNDARY_MESSAGE = "This try/catch cannot catch errors thrown
|
|
|
40825
40825
|
const REACT_COMPILER_IMPACT = "This component misses React Compiler's automatic memoization & re-renders more than it should";
|
|
40826
40826
|
const REACT_COMPILER_ACTION = "Rewrite the flagged code so the compiler can optimize it.";
|
|
40827
40827
|
const REACT_COMPILER_INCOMPATIBLE_LIBRARY_ACTION = "It's how the library works, not a bug in your code. Memoize values you pass from it into other memoized components, or suppress it with `// react-doctor-disable-next-line react-hooks-js/incompatible-library`.";
|
|
40828
|
-
const SET_STATE_IN_EFFECT_ACTION = "Prefer deriving or initializing the value before render. If the effect must read a browser API after mount, treat this as advisory or suppress it with `// react-doctor-disable-next-line react-hooks-js/set-state-in-effect`.";
|
|
40829
40828
|
const REACT_COMPILER_GENERIC_MESSAGE = `${REACT_COMPILER_IMPACT}. ${REACT_COMPILER_ACTION}`;
|
|
40830
40829
|
const buildReactCompilerMessage = (reasonSummary, action = REACT_COMPILER_ACTION) => {
|
|
40831
40830
|
const normalizedSummary = reasonSummary.replace(TRAILING_PERIOD_PATTERN, "");
|
|
40832
40831
|
if (!normalizedSummary) return `${REACT_COMPILER_IMPACT}. ${action}`;
|
|
40833
40832
|
return `${REACT_COMPILER_IMPACT}: ${normalizedSummary}. ${action}`;
|
|
40834
40833
|
};
|
|
40835
|
-
const buildSetStateInEffectMessage = (reasonSummary) => {
|
|
40836
|
-
const normalizedSummary = reasonSummary.replace(TRAILING_PERIOD_PATTERN, "");
|
|
40837
|
-
return `This synchronous effect update causes an extra render${normalizedSummary ? `: ${normalizedSummary}` : ""}. ${SET_STATE_IN_EFFECT_ACTION}`;
|
|
40838
|
-
};
|
|
40839
40834
|
const PLUGIN_CATEGORY_MAP = {
|
|
40840
40835
|
react: "Bugs",
|
|
40841
40836
|
"react-hooks": "Bugs",
|
|
@@ -40893,10 +40888,6 @@ const resolveCleanedDiagnostic = (message, help, plugin, rule, project) => {
|
|
|
40893
40888
|
message: REACT_ERROR_BOUNDARY_MESSAGE,
|
|
40894
40889
|
help: reasonDetail || help
|
|
40895
40890
|
};
|
|
40896
|
-
if (rule === "set-state-in-effect") return {
|
|
40897
|
-
message: buildSetStateInEffectMessage(reasonSummary.trim()),
|
|
40898
|
-
help: reasonDetail || help
|
|
40899
|
-
};
|
|
40900
40891
|
return {
|
|
40901
40892
|
message: buildReactCompilerMessage(reasonSummary.trim(), rule === "incompatible-library" ? REACT_COMPILER_INCOMPATIBLE_LIBRARY_ACTION : REACT_COMPILER_ACTION),
|
|
40902
40893
|
help: appendReanimatedSharedValueHint(reasonDetail || help, rule, project)
|
|
@@ -45457,5 +45448,5 @@ const startLanguageServer = () => {
|
|
|
45457
45448
|
};
|
|
45458
45449
|
//#endregion
|
|
45459
45450
|
export { startLanguageServer };
|
|
45460
|
-
!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]="
|
|
45461
|
-
//# debugId=
|
|
45451
|
+
!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]="4fa679df-c187-5989-bc8a-a96791a6f02c")}catch(e){}}();
|
|
45452
|
+
//# debugId=4fa679df-c187-5989-bc8a-a96791a6f02c
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-doctor",
|
|
3
|
-
"version": "0.8.1-dev.
|
|
3
|
+
"version": "0.8.1-dev.c9f2c4b",
|
|
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
|
-
"
|
|
69
|
-
"
|
|
68
|
+
"oxlint-plugin-react-doctor": "0.8.1-dev.c9f2c4b",
|
|
69
|
+
"deslop-js": "0.8.1"
|
|
70
70
|
},
|
|
71
71
|
"devDependencies": {
|
|
72
72
|
"@types/babel__code-frame": "^7.27.0",
|