react-doctor 0.7.5-dev.037bd56 → 0.7.5-dev.0f07133
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 +11 -49
- package/dist/index.d.ts +3 -3
- package/dist/index.js +8 -46
- package/dist/lsp.js +8 -46
- package/package.json +5 -5
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]="1f5aa17d-d175-5919-bcb6-74e375355216")}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";
|
|
@@ -42368,7 +42368,7 @@ const normalizeConfigForHash = (config) => {
|
|
|
42368
42368
|
if (Array.isArray(clone?.jsPlugins)) clone.jsPlugins = clone.jsPlugins.map((_, index) => `<plugin:${index}>`);
|
|
42369
42369
|
return clone;
|
|
42370
42370
|
};
|
|
42371
|
-
const computeRulesetHash = (input) => crypto.createHash("sha1").update(JSON.stringify(normalizeConfigForHash(input.config))).update("\0").update([...input.toolchainVersions].join("\0")).update("\0").update([...input.ignorePatterns].join("\n")).update("\0").update(input.tsconfigContent ?? "").
|
|
42371
|
+
const computeRulesetHash = (input) => crypto.createHash("sha1").update(JSON.stringify(normalizeConfigForHash(input.config))).update("\0").update([...input.toolchainVersions].join("\0")).update("\0").update([...input.ignorePatterns].join("\n")).update("\0").update(input.tsconfigContent ?? "").digest("hex");
|
|
42372
42372
|
/**
|
|
42373
42373
|
* Loads a plugin module via the local require resolver and extracts
|
|
42374
42374
|
* `(name, ruleNames)` from either `module.exports.meta + rules` or
|
|
@@ -42404,7 +42404,7 @@ const resolveReactHooksJsPlugin = (hasReactCompiler, customRulesOnly) => {
|
|
|
42404
42404
|
} catch {
|
|
42405
42405
|
return null;
|
|
42406
42406
|
}
|
|
42407
|
-
const { ruleNames } = readPluginShape(pluginSpecifier, (
|
|
42407
|
+
const { ruleNames } = readPluginShape(pluginSpecifier, (spec) => bundledRequire$1(spec));
|
|
42408
42408
|
return {
|
|
42409
42409
|
entry: {
|
|
42410
42410
|
name: "react-hooks-js",
|
|
@@ -42812,23 +42812,6 @@ const resolveTsConfigRelativePath = (rootDirectory) => {
|
|
|
42812
42812
|
for (const filename of TSCONFIG_FILENAMES) if (NFS.existsSync(Path.join(rootDirectory, filename))) return `./${filename}`;
|
|
42813
42813
|
return null;
|
|
42814
42814
|
};
|
|
42815
|
-
const DERIVED_STATE_RULE_PRIORITY = new Map([
|
|
42816
|
-
["no-initialize-state", 0],
|
|
42817
|
-
["no-adjust-state-on-prop-change", 1],
|
|
42818
|
-
["no-derived-state", 2],
|
|
42819
|
-
["no-derived-state-effect", 3]
|
|
42820
|
-
]);
|
|
42821
|
-
const doDiagnosticSpansOverlap = (first, second) => {
|
|
42822
|
-
if (first.filePath !== second.filePath || first.plugin !== second.plugin) return false;
|
|
42823
|
-
if (first.offset !== void 0 && second.offset !== void 0) {
|
|
42824
|
-
const firstEnd = first.offset + Math.max(first.length ?? 1, 1);
|
|
42825
|
-
const secondEnd = second.offset + Math.max(second.length ?? 1, 1);
|
|
42826
|
-
return first.offset < secondEnd && second.offset < firstEnd;
|
|
42827
|
-
}
|
|
42828
|
-
const firstEndLine = first.endLine ?? first.line;
|
|
42829
|
-
const secondEndLine = second.endLine ?? second.line;
|
|
42830
|
-
return first.line <= secondEndLine && second.line <= firstEndLine;
|
|
42831
|
-
};
|
|
42832
42815
|
const dedupeDiagnostics = (diagnostics) => {
|
|
42833
42816
|
const seenKeys = /* @__PURE__ */ new Set();
|
|
42834
42817
|
const uniqueDiagnostics = [];
|
|
@@ -42836,16 +42819,6 @@ const dedupeDiagnostics = (diagnostics) => {
|
|
|
42836
42819
|
const key = `${diagnostic.filePath}\u0000${diagnostic.line}\u0000${diagnostic.column}\u0000${diagnostic.plugin}\u0000${diagnostic.rule}\u0000${diagnostic.severity}\u0000${diagnostic.message}`;
|
|
42837
42820
|
if (seenKeys.has(key)) continue;
|
|
42838
42821
|
seenKeys.add(key);
|
|
42839
|
-
const priority = DERIVED_STATE_RULE_PRIORITY.get(diagnostic.rule);
|
|
42840
|
-
if (priority !== void 0) {
|
|
42841
|
-
const overlappingDiagnosticIndex = uniqueDiagnostics.findIndex((candidate) => candidate.rule !== diagnostic.rule && candidate.severity === diagnostic.severity && DERIVED_STATE_RULE_PRIORITY.has(candidate.rule) && doDiagnosticSpansOverlap(candidate, diagnostic));
|
|
42842
|
-
if (overlappingDiagnosticIndex >= 0) {
|
|
42843
|
-
const existingDiagnostic = uniqueDiagnostics[overlappingDiagnosticIndex];
|
|
42844
|
-
const existingPriority = existingDiagnostic ? DERIVED_STATE_RULE_PRIORITY.get(existingDiagnostic.rule) : void 0;
|
|
42845
|
-
if (existingPriority !== void 0 && priority < existingPriority) uniqueDiagnostics[overlappingDiagnosticIndex] = diagnostic;
|
|
42846
|
-
continue;
|
|
42847
|
-
}
|
|
42848
|
-
}
|
|
42849
42822
|
uniqueDiagnostics.push(diagnostic);
|
|
42850
42823
|
}
|
|
42851
42824
|
return uniqueDiagnostics;
|
|
@@ -43719,11 +43692,6 @@ const buildOxlintChildEnv = (sourceEnv) => {
|
|
|
43719
43692
|
if (!isCompileCacheDisabled && !isCompileCacheAlreadySet) childEnv.NODE_COMPILE_CACHE = Path.join(os.tmpdir(), NODE_COMPILE_CACHE_DIR_NAME);
|
|
43720
43693
|
return childEnv;
|
|
43721
43694
|
};
|
|
43722
|
-
const buildProfiledNodeArguments = (input) => [
|
|
43723
|
-
...input.cpuProfileDirectory ? ["--cpu-prof", `--cpu-prof-dir=${input.cpuProfileDirectory}`] : [],
|
|
43724
|
-
...input.heapProfileDirectory ? ["--heap-prof", `--heap-prof-dir=${input.heapProfileDirectory}`] : [],
|
|
43725
|
-
...input.argumentsList
|
|
43726
|
-
];
|
|
43727
43695
|
const SANITIZED_ENV = buildOxlintChildEnv(process.env);
|
|
43728
43696
|
/**
|
|
43729
43697
|
* Spawn one oxlint subprocess with hard ceilings on wall time and
|
|
@@ -43748,11 +43716,7 @@ const spawnOxlint = (args, rootDirectory, nodeBinaryPath, spawnTimeoutMs = OXLIN
|
|
|
43748
43716
|
reject(new ReactDoctorError({ reason: new OxlintSpawnFailed({ cause: "lint phase aborted" }) }));
|
|
43749
43717
|
return;
|
|
43750
43718
|
}
|
|
43751
|
-
const child = spawn(nodeBinaryPath,
|
|
43752
|
-
argumentsList: args,
|
|
43753
|
-
cpuProfileDirectory: SANITIZED_ENV.REACT_DOCTOR_CPU_PROFILE_DIR,
|
|
43754
|
-
heapProfileDirectory: SANITIZED_ENV.REACT_DOCTOR_HEAP_PROFILE_DIR
|
|
43755
|
-
}), {
|
|
43719
|
+
const child = spawn(nodeBinaryPath, args, {
|
|
43756
43720
|
cwd: rootDirectory,
|
|
43757
43721
|
env: SANITIZED_ENV,
|
|
43758
43722
|
stdio: [
|
|
@@ -44396,7 +44360,7 @@ const runOxlint = async (options) => {
|
|
|
44396
44360
|
};
|
|
44397
44361
|
}
|
|
44398
44362
|
};
|
|
44399
|
-
if (perFileLintCacheEnabled && !project.hasReactCompiler && extendsPaths.length === 0 && userPlugins.length === 0) {
|
|
44363
|
+
if (perFileLintCacheEnabled && respectInlineDisables && !project.hasReactCompiler && extendsPaths.length === 0 && userPlugins.length === 0) {
|
|
44400
44364
|
const rulesetHash = computeRulesetHash({
|
|
44401
44365
|
config: buildConfig({
|
|
44402
44366
|
extendsPaths: [],
|
|
@@ -44404,8 +44368,7 @@ const runOxlint = async (options) => {
|
|
|
44404
44368
|
}),
|
|
44405
44369
|
toolchainVersions: resolveOxlintToolchainVersions(nodeBinaryPath),
|
|
44406
44370
|
ignorePatterns: combinedPatterns,
|
|
44407
|
-
tsconfigContent
|
|
44408
|
-
respectInlineDisables
|
|
44371
|
+
tsconfigContent
|
|
44409
44372
|
});
|
|
44410
44373
|
const cache = createFileLintCache(resolveReactDoctorCacheDir(rootDirectory), rulesetHash);
|
|
44411
44374
|
const cacheKeyByFile = /* @__PURE__ */ new Map();
|
|
@@ -44448,8 +44411,7 @@ const runOxlint = async (options) => {
|
|
|
44448
44411
|
}),
|
|
44449
44412
|
toolchainVersions: resolveOxlintToolchainVersions(nodeBinaryPath),
|
|
44450
44413
|
ignorePatterns: combinedPatterns,
|
|
44451
|
-
tsconfigContent
|
|
44452
|
-
respectInlineDisables
|
|
44414
|
+
tsconfigContent
|
|
44453
44415
|
})) : null;
|
|
44454
44416
|
const probeAnswers = createSidecarProbeAnswerResolver({
|
|
44455
44417
|
rootDirectory,
|
|
@@ -46667,7 +46629,7 @@ const makeNoopConsole = () => ({
|
|
|
46667
46629
|
});
|
|
46668
46630
|
//#endregion
|
|
46669
46631
|
//#region src/cli/utils/version.ts
|
|
46670
|
-
const VERSION = "0.7.5-dev.
|
|
46632
|
+
const VERSION = "0.7.5-dev.0f07133";
|
|
46671
46633
|
//#endregion
|
|
46672
46634
|
//#region src/cli/utils/json-mode.ts
|
|
46673
46635
|
let context = null;
|
|
@@ -47036,13 +46998,13 @@ const isDevVersion = (version) => version === "0.0.0" || version.includes("-");
|
|
|
47036
46998
|
* uploads source-map artifacts under, so stack frames symbolicate. Honors the
|
|
47037
46999
|
* standard `SENTRY_RELEASE` override.
|
|
47038
47000
|
*/
|
|
47039
|
-
const resolveSentryRelease = () => process.env.SENTRY_RELEASE || `react-doctor@0.7.5-dev.
|
|
47001
|
+
const resolveSentryRelease = () => process.env.SENTRY_RELEASE || `react-doctor@0.7.5-dev.0f07133`;
|
|
47040
47002
|
/**
|
|
47041
47003
|
* Deployment environment shown in Sentry's environment filter. Defaults to
|
|
47042
47004
|
* `production` for tagged releases and `development` for dev/unbuilt versions,
|
|
47043
47005
|
* overridable via the standard `SENTRY_ENVIRONMENT` env var.
|
|
47044
47006
|
*/
|
|
47045
|
-
const resolveSentryEnvironment = () => process.env.SENTRY_ENVIRONMENT || (isDevVersion("0.7.5-dev.
|
|
47007
|
+
const resolveSentryEnvironment = () => process.env.SENTRY_ENVIRONMENT || (isDevVersion("0.7.5-dev.0f07133") ? "development" : "production");
|
|
47046
47008
|
/**
|
|
47047
47009
|
* Performance-tracing sample rate in `[0, 1]`. Reads `SENTRY_TRACES_SAMPLE_RATE`
|
|
47048
47010
|
* (set to `0` to disable tracing) and falls back to
|
|
@@ -65231,4 +65193,4 @@ Promise.resolve().then(() => assertNoRemovedFlags(process.argv)).then(() => prog
|
|
|
65231
65193
|
export {};
|
|
65232
65194
|
|
|
65233
65195
|
//# sourceMappingURL=cli.js.map
|
|
65234
|
-
//# debugId=
|
|
65196
|
+
//# debugId=1f5aa17d-d175-5919-bcb6-74e375355216
|
package/dist/index.d.ts
CHANGED
|
@@ -9800,9 +9800,9 @@ interface InspectResult {
|
|
|
9800
9800
|
scanElapsedMilliseconds?: number;
|
|
9801
9801
|
/**
|
|
9802
9802
|
* Per-file lint cache outcome: files served from cache, and total files
|
|
9803
|
-
* considered. Both absent when the cache was off or bypassed (
|
|
9804
|
-
* `extends`, user plugins
|
|
9805
|
-
*
|
|
9803
|
+
* considered. Both absent when the cache was off or bypassed (audit mode,
|
|
9804
|
+
* adopted `extends`, user plugins). The CLI projects these onto the Sentry
|
|
9805
|
+
* wide event as `lint.cacheHitRatio`.
|
|
9806
9806
|
*/
|
|
9807
9807
|
lintCacheHitFileCount?: number | null;
|
|
9808
9808
|
lintCacheTotalFileCount?: number | null;
|
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]="ab586686-464c-58e6-a96d-70f7b39b1c5d")}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";
|
|
@@ -39125,7 +39125,7 @@ const normalizeConfigForHash = (config) => {
|
|
|
39125
39125
|
if (Array.isArray(clone?.jsPlugins)) clone.jsPlugins = clone.jsPlugins.map((_, index) => `<plugin:${index}>`);
|
|
39126
39126
|
return clone;
|
|
39127
39127
|
};
|
|
39128
|
-
const computeRulesetHash = (input) => crypto.createHash("sha1").update(JSON.stringify(normalizeConfigForHash(input.config))).update("\0").update([...input.toolchainVersions].join("\0")).update("\0").update([...input.ignorePatterns].join("\n")).update("\0").update(input.tsconfigContent ?? "").
|
|
39128
|
+
const computeRulesetHash = (input) => crypto.createHash("sha1").update(JSON.stringify(normalizeConfigForHash(input.config))).update("\0").update([...input.toolchainVersions].join("\0")).update("\0").update([...input.ignorePatterns].join("\n")).update("\0").update(input.tsconfigContent ?? "").digest("hex");
|
|
39129
39129
|
/**
|
|
39130
39130
|
* Loads a plugin module via the local require resolver and extracts
|
|
39131
39131
|
* `(name, ruleNames)` from either `module.exports.meta + rules` or
|
|
@@ -39161,7 +39161,7 @@ const resolveReactHooksJsPlugin = (hasReactCompiler, customRulesOnly) => {
|
|
|
39161
39161
|
} catch {
|
|
39162
39162
|
return null;
|
|
39163
39163
|
}
|
|
39164
|
-
const { ruleNames } = readPluginShape(pluginSpecifier, (
|
|
39164
|
+
const { ruleNames } = readPluginShape(pluginSpecifier, (spec) => bundledRequire$1(spec));
|
|
39165
39165
|
return {
|
|
39166
39166
|
entry: {
|
|
39167
39167
|
name: "react-hooks-js",
|
|
@@ -39569,23 +39569,6 @@ const resolveTsConfigRelativePath = (rootDirectory) => {
|
|
|
39569
39569
|
for (const filename of TSCONFIG_FILENAMES) if (NFS.existsSync(Path.join(rootDirectory, filename))) return `./${filename}`;
|
|
39570
39570
|
return null;
|
|
39571
39571
|
};
|
|
39572
|
-
const DERIVED_STATE_RULE_PRIORITY = new Map([
|
|
39573
|
-
["no-initialize-state", 0],
|
|
39574
|
-
["no-adjust-state-on-prop-change", 1],
|
|
39575
|
-
["no-derived-state", 2],
|
|
39576
|
-
["no-derived-state-effect", 3]
|
|
39577
|
-
]);
|
|
39578
|
-
const doDiagnosticSpansOverlap = (first, second) => {
|
|
39579
|
-
if (first.filePath !== second.filePath || first.plugin !== second.plugin) return false;
|
|
39580
|
-
if (first.offset !== void 0 && second.offset !== void 0) {
|
|
39581
|
-
const firstEnd = first.offset + Math.max(first.length ?? 1, 1);
|
|
39582
|
-
const secondEnd = second.offset + Math.max(second.length ?? 1, 1);
|
|
39583
|
-
return first.offset < secondEnd && second.offset < firstEnd;
|
|
39584
|
-
}
|
|
39585
|
-
const firstEndLine = first.endLine ?? first.line;
|
|
39586
|
-
const secondEndLine = second.endLine ?? second.line;
|
|
39587
|
-
return first.line <= secondEndLine && second.line <= firstEndLine;
|
|
39588
|
-
};
|
|
39589
39572
|
const dedupeDiagnostics = (diagnostics) => {
|
|
39590
39573
|
const seenKeys = /* @__PURE__ */ new Set();
|
|
39591
39574
|
const uniqueDiagnostics = [];
|
|
@@ -39593,16 +39576,6 @@ const dedupeDiagnostics = (diagnostics) => {
|
|
|
39593
39576
|
const key = `${diagnostic.filePath}\u0000${diagnostic.line}\u0000${diagnostic.column}\u0000${diagnostic.plugin}\u0000${diagnostic.rule}\u0000${diagnostic.severity}\u0000${diagnostic.message}`;
|
|
39594
39577
|
if (seenKeys.has(key)) continue;
|
|
39595
39578
|
seenKeys.add(key);
|
|
39596
|
-
const priority = DERIVED_STATE_RULE_PRIORITY.get(diagnostic.rule);
|
|
39597
|
-
if (priority !== void 0) {
|
|
39598
|
-
const overlappingDiagnosticIndex = uniqueDiagnostics.findIndex((candidate) => candidate.rule !== diagnostic.rule && candidate.severity === diagnostic.severity && DERIVED_STATE_RULE_PRIORITY.has(candidate.rule) && doDiagnosticSpansOverlap(candidate, diagnostic));
|
|
39599
|
-
if (overlappingDiagnosticIndex >= 0) {
|
|
39600
|
-
const existingDiagnostic = uniqueDiagnostics[overlappingDiagnosticIndex];
|
|
39601
|
-
const existingPriority = existingDiagnostic ? DERIVED_STATE_RULE_PRIORITY.get(existingDiagnostic.rule) : void 0;
|
|
39602
|
-
if (existingPriority !== void 0 && priority < existingPriority) uniqueDiagnostics[overlappingDiagnosticIndex] = diagnostic;
|
|
39603
|
-
continue;
|
|
39604
|
-
}
|
|
39605
|
-
}
|
|
39606
39579
|
uniqueDiagnostics.push(diagnostic);
|
|
39607
39580
|
}
|
|
39608
39581
|
return uniqueDiagnostics;
|
|
@@ -40476,11 +40449,6 @@ const buildOxlintChildEnv = (sourceEnv) => {
|
|
|
40476
40449
|
if (!isCompileCacheDisabled && !isCompileCacheAlreadySet) childEnv.NODE_COMPILE_CACHE = Path.join(os.tmpdir(), NODE_COMPILE_CACHE_DIR_NAME);
|
|
40477
40450
|
return childEnv;
|
|
40478
40451
|
};
|
|
40479
|
-
const buildProfiledNodeArguments = (input) => [
|
|
40480
|
-
...input.cpuProfileDirectory ? ["--cpu-prof", `--cpu-prof-dir=${input.cpuProfileDirectory}`] : [],
|
|
40481
|
-
...input.heapProfileDirectory ? ["--heap-prof", `--heap-prof-dir=${input.heapProfileDirectory}`] : [],
|
|
40482
|
-
...input.argumentsList
|
|
40483
|
-
];
|
|
40484
40452
|
const SANITIZED_ENV = buildOxlintChildEnv(process.env);
|
|
40485
40453
|
/**
|
|
40486
40454
|
* Spawn one oxlint subprocess with hard ceilings on wall time and
|
|
@@ -40505,11 +40473,7 @@ const spawnOxlint = (args, rootDirectory, nodeBinaryPath, spawnTimeoutMs = OXLIN
|
|
|
40505
40473
|
reject(new ReactDoctorError({ reason: new OxlintSpawnFailed({ cause: "lint phase aborted" }) }));
|
|
40506
40474
|
return;
|
|
40507
40475
|
}
|
|
40508
|
-
const child = spawn(nodeBinaryPath,
|
|
40509
|
-
argumentsList: args,
|
|
40510
|
-
cpuProfileDirectory: SANITIZED_ENV.REACT_DOCTOR_CPU_PROFILE_DIR,
|
|
40511
|
-
heapProfileDirectory: SANITIZED_ENV.REACT_DOCTOR_HEAP_PROFILE_DIR
|
|
40512
|
-
}), {
|
|
40476
|
+
const child = spawn(nodeBinaryPath, args, {
|
|
40513
40477
|
cwd: rootDirectory,
|
|
40514
40478
|
env: SANITIZED_ENV,
|
|
40515
40479
|
stdio: [
|
|
@@ -41153,7 +41117,7 @@ const runOxlint = async (options) => {
|
|
|
41153
41117
|
};
|
|
41154
41118
|
}
|
|
41155
41119
|
};
|
|
41156
|
-
if (perFileLintCacheEnabled && !project.hasReactCompiler && extendsPaths.length === 0 && userPlugins.length === 0) {
|
|
41120
|
+
if (perFileLintCacheEnabled && respectInlineDisables && !project.hasReactCompiler && extendsPaths.length === 0 && userPlugins.length === 0) {
|
|
41157
41121
|
const rulesetHash = computeRulesetHash({
|
|
41158
41122
|
config: buildConfig({
|
|
41159
41123
|
extendsPaths: [],
|
|
@@ -41161,8 +41125,7 @@ const runOxlint = async (options) => {
|
|
|
41161
41125
|
}),
|
|
41162
41126
|
toolchainVersions: resolveOxlintToolchainVersions(nodeBinaryPath),
|
|
41163
41127
|
ignorePatterns: combinedPatterns,
|
|
41164
|
-
tsconfigContent
|
|
41165
|
-
respectInlineDisables
|
|
41128
|
+
tsconfigContent
|
|
41166
41129
|
});
|
|
41167
41130
|
const cache = createFileLintCache(resolveReactDoctorCacheDir(rootDirectory), rulesetHash);
|
|
41168
41131
|
const cacheKeyByFile = /* @__PURE__ */ new Map();
|
|
@@ -41205,8 +41168,7 @@ const runOxlint = async (options) => {
|
|
|
41205
41168
|
}),
|
|
41206
41169
|
toolchainVersions: resolveOxlintToolchainVersions(nodeBinaryPath),
|
|
41207
41170
|
ignorePatterns: combinedPatterns,
|
|
41208
|
-
tsconfigContent
|
|
41209
|
-
respectInlineDisables
|
|
41171
|
+
tsconfigContent
|
|
41210
41172
|
})) : null;
|
|
41211
41173
|
const probeAnswers = createSidecarProbeAnswerResolver({
|
|
41212
41174
|
rootDirectory,
|
|
@@ -43210,4 +43172,4 @@ const toJsonReport = (result, options) => buildJsonReport({
|
|
|
43210
43172
|
export { AmbiguousProjectError, NoReactDependencyError, NotADirectoryError, PackageJsonNotFoundError, ProjectNotFoundError, ReactDoctorError, buildJsonReport, buildJsonReportError, clearCaches, defineConfig, diagnose, filterSourceFiles, getDiffInfo, hasReactRuntime, isProjectDiscoveryError, isReactDoctorError, summarizeDiagnostics, toJsonReport };
|
|
43211
43173
|
|
|
43212
43174
|
//# sourceMappingURL=index.js.map
|
|
43213
|
-
//# debugId=
|
|
43175
|
+
//# debugId=ab586686-464c-58e6-a96d-70f7b39b1c5d
|
package/dist/lsp.js
CHANGED
|
@@ -39103,7 +39103,7 @@ const normalizeConfigForHash = (config) => {
|
|
|
39103
39103
|
if (Array.isArray(clone?.jsPlugins)) clone.jsPlugins = clone.jsPlugins.map((_, index) => `<plugin:${index}>`);
|
|
39104
39104
|
return clone;
|
|
39105
39105
|
};
|
|
39106
|
-
const computeRulesetHash = (input) => crypto.createHash("sha1").update(JSON.stringify(normalizeConfigForHash(input.config))).update("\0").update([...input.toolchainVersions].join("\0")).update("\0").update([...input.ignorePatterns].join("\n")).update("\0").update(input.tsconfigContent ?? "").
|
|
39106
|
+
const computeRulesetHash = (input) => crypto.createHash("sha1").update(JSON.stringify(normalizeConfigForHash(input.config))).update("\0").update([...input.toolchainVersions].join("\0")).update("\0").update([...input.ignorePatterns].join("\n")).update("\0").update(input.tsconfigContent ?? "").digest("hex");
|
|
39107
39107
|
/**
|
|
39108
39108
|
* Loads a plugin module via the local require resolver and extracts
|
|
39109
39109
|
* `(name, ruleNames)` from either `module.exports.meta + rules` or
|
|
@@ -39139,7 +39139,7 @@ const resolveReactHooksJsPlugin = (hasReactCompiler, customRulesOnly) => {
|
|
|
39139
39139
|
} catch {
|
|
39140
39140
|
return null;
|
|
39141
39141
|
}
|
|
39142
|
-
const { ruleNames } = readPluginShape(pluginSpecifier, (
|
|
39142
|
+
const { ruleNames } = readPluginShape(pluginSpecifier, (spec) => bundledRequire$1(spec));
|
|
39143
39143
|
return {
|
|
39144
39144
|
entry: {
|
|
39145
39145
|
name: "react-hooks-js",
|
|
@@ -39547,23 +39547,6 @@ const resolveTsConfigRelativePath = (rootDirectory) => {
|
|
|
39547
39547
|
for (const filename of TSCONFIG_FILENAMES) if (NFS.existsSync(Path.join(rootDirectory, filename))) return `./${filename}`;
|
|
39548
39548
|
return null;
|
|
39549
39549
|
};
|
|
39550
|
-
const DERIVED_STATE_RULE_PRIORITY = new Map([
|
|
39551
|
-
["no-initialize-state", 0],
|
|
39552
|
-
["no-adjust-state-on-prop-change", 1],
|
|
39553
|
-
["no-derived-state", 2],
|
|
39554
|
-
["no-derived-state-effect", 3]
|
|
39555
|
-
]);
|
|
39556
|
-
const doDiagnosticSpansOverlap = (first, second) => {
|
|
39557
|
-
if (first.filePath !== second.filePath || first.plugin !== second.plugin) return false;
|
|
39558
|
-
if (first.offset !== void 0 && second.offset !== void 0) {
|
|
39559
|
-
const firstEnd = first.offset + Math.max(first.length ?? 1, 1);
|
|
39560
|
-
const secondEnd = second.offset + Math.max(second.length ?? 1, 1);
|
|
39561
|
-
return first.offset < secondEnd && second.offset < firstEnd;
|
|
39562
|
-
}
|
|
39563
|
-
const firstEndLine = first.endLine ?? first.line;
|
|
39564
|
-
const secondEndLine = second.endLine ?? second.line;
|
|
39565
|
-
return first.line <= secondEndLine && second.line <= firstEndLine;
|
|
39566
|
-
};
|
|
39567
39550
|
const dedupeDiagnostics = (diagnostics) => {
|
|
39568
39551
|
const seenKeys = /* @__PURE__ */ new Set();
|
|
39569
39552
|
const uniqueDiagnostics = [];
|
|
@@ -39571,16 +39554,6 @@ const dedupeDiagnostics = (diagnostics) => {
|
|
|
39571
39554
|
const key = `${diagnostic.filePath}\u0000${diagnostic.line}\u0000${diagnostic.column}\u0000${diagnostic.plugin}\u0000${diagnostic.rule}\u0000${diagnostic.severity}\u0000${diagnostic.message}`;
|
|
39572
39555
|
if (seenKeys.has(key)) continue;
|
|
39573
39556
|
seenKeys.add(key);
|
|
39574
|
-
const priority = DERIVED_STATE_RULE_PRIORITY.get(diagnostic.rule);
|
|
39575
|
-
if (priority !== void 0) {
|
|
39576
|
-
const overlappingDiagnosticIndex = uniqueDiagnostics.findIndex((candidate) => candidate.rule !== diagnostic.rule && candidate.severity === diagnostic.severity && DERIVED_STATE_RULE_PRIORITY.has(candidate.rule) && doDiagnosticSpansOverlap(candidate, diagnostic));
|
|
39577
|
-
if (overlappingDiagnosticIndex >= 0) {
|
|
39578
|
-
const existingDiagnostic = uniqueDiagnostics[overlappingDiagnosticIndex];
|
|
39579
|
-
const existingPriority = existingDiagnostic ? DERIVED_STATE_RULE_PRIORITY.get(existingDiagnostic.rule) : void 0;
|
|
39580
|
-
if (existingPriority !== void 0 && priority < existingPriority) uniqueDiagnostics[overlappingDiagnosticIndex] = diagnostic;
|
|
39581
|
-
continue;
|
|
39582
|
-
}
|
|
39583
|
-
}
|
|
39584
39557
|
uniqueDiagnostics.push(diagnostic);
|
|
39585
39558
|
}
|
|
39586
39559
|
return uniqueDiagnostics;
|
|
@@ -40454,11 +40427,6 @@ const buildOxlintChildEnv = (sourceEnv) => {
|
|
|
40454
40427
|
if (!isCompileCacheDisabled && !isCompileCacheAlreadySet) childEnv.NODE_COMPILE_CACHE = Path.join(os.tmpdir(), NODE_COMPILE_CACHE_DIR_NAME);
|
|
40455
40428
|
return childEnv;
|
|
40456
40429
|
};
|
|
40457
|
-
const buildProfiledNodeArguments = (input) => [
|
|
40458
|
-
...input.cpuProfileDirectory ? ["--cpu-prof", `--cpu-prof-dir=${input.cpuProfileDirectory}`] : [],
|
|
40459
|
-
...input.heapProfileDirectory ? ["--heap-prof", `--heap-prof-dir=${input.heapProfileDirectory}`] : [],
|
|
40460
|
-
...input.argumentsList
|
|
40461
|
-
];
|
|
40462
40430
|
const SANITIZED_ENV = buildOxlintChildEnv(process.env);
|
|
40463
40431
|
/**
|
|
40464
40432
|
* Spawn one oxlint subprocess with hard ceilings on wall time and
|
|
@@ -40483,11 +40451,7 @@ const spawnOxlint = (args, rootDirectory, nodeBinaryPath, spawnTimeoutMs = OXLIN
|
|
|
40483
40451
|
reject(new ReactDoctorError({ reason: new OxlintSpawnFailed({ cause: "lint phase aborted" }) }));
|
|
40484
40452
|
return;
|
|
40485
40453
|
}
|
|
40486
|
-
const child = spawn(nodeBinaryPath,
|
|
40487
|
-
argumentsList: args,
|
|
40488
|
-
cpuProfileDirectory: SANITIZED_ENV.REACT_DOCTOR_CPU_PROFILE_DIR,
|
|
40489
|
-
heapProfileDirectory: SANITIZED_ENV.REACT_DOCTOR_HEAP_PROFILE_DIR
|
|
40490
|
-
}), {
|
|
40454
|
+
const child = spawn(nodeBinaryPath, args, {
|
|
40491
40455
|
cwd: rootDirectory,
|
|
40492
40456
|
env: SANITIZED_ENV,
|
|
40493
40457
|
stdio: [
|
|
@@ -41131,7 +41095,7 @@ const runOxlint = async (options) => {
|
|
|
41131
41095
|
};
|
|
41132
41096
|
}
|
|
41133
41097
|
};
|
|
41134
|
-
if (perFileLintCacheEnabled && !project.hasReactCompiler && extendsPaths.length === 0 && userPlugins.length === 0) {
|
|
41098
|
+
if (perFileLintCacheEnabled && respectInlineDisables && !project.hasReactCompiler && extendsPaths.length === 0 && userPlugins.length === 0) {
|
|
41135
41099
|
const rulesetHash = computeRulesetHash({
|
|
41136
41100
|
config: buildConfig({
|
|
41137
41101
|
extendsPaths: [],
|
|
@@ -41139,8 +41103,7 @@ const runOxlint = async (options) => {
|
|
|
41139
41103
|
}),
|
|
41140
41104
|
toolchainVersions: resolveOxlintToolchainVersions(nodeBinaryPath),
|
|
41141
41105
|
ignorePatterns: combinedPatterns,
|
|
41142
|
-
tsconfigContent
|
|
41143
|
-
respectInlineDisables
|
|
41106
|
+
tsconfigContent
|
|
41144
41107
|
});
|
|
41145
41108
|
const cache = createFileLintCache(resolveReactDoctorCacheDir(rootDirectory), rulesetHash);
|
|
41146
41109
|
const cacheKeyByFile = /* @__PURE__ */ new Map();
|
|
@@ -41183,8 +41146,7 @@ const runOxlint = async (options) => {
|
|
|
41183
41146
|
}),
|
|
41184
41147
|
toolchainVersions: resolveOxlintToolchainVersions(nodeBinaryPath),
|
|
41185
41148
|
ignorePatterns: combinedPatterns,
|
|
41186
|
-
tsconfigContent
|
|
41187
|
-
respectInlineDisables
|
|
41149
|
+
tsconfigContent
|
|
41188
41150
|
})) : null;
|
|
41189
41151
|
const probeAnswers = createSidecarProbeAnswerResolver({
|
|
41190
41152
|
rootDirectory,
|
|
@@ -44854,5 +44816,5 @@ const startLanguageServer = () => {
|
|
|
44854
44816
|
};
|
|
44855
44817
|
//#endregion
|
|
44856
44818
|
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]="
|
|
44858
|
-
//# debugId=
|
|
44819
|
+
!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]="c7260006-9441-53b6-807e-078a5823b211")}catch(e){}}();
|
|
44820
|
+
//# debugId=c7260006-9441-53b6-807e-078a5823b211
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-doctor",
|
|
3
|
-
"version": "0.7.5-dev.
|
|
3
|
+
"version": "0.7.5-dev.0f07133",
|
|
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
|
+
"deslop-js": "0.7.5",
|
|
69
|
+
"oxlint-plugin-react-doctor": "0.7.5-dev.0f07133"
|
|
70
70
|
},
|
|
71
71
|
"devDependencies": {
|
|
72
72
|
"@types/babel__code-frame": "^7.27.0",
|
|
@@ -75,8 +75,8 @@
|
|
|
75
75
|
"commander": "^14.0.3",
|
|
76
76
|
"ora": "^9.4.0",
|
|
77
77
|
"@react-doctor/api": "0.7.5",
|
|
78
|
-
"@react-doctor/
|
|
79
|
-
"@react-doctor/
|
|
78
|
+
"@react-doctor/core": "0.7.5",
|
|
79
|
+
"@react-doctor/language-server": "0.7.5"
|
|
80
80
|
},
|
|
81
81
|
"engines": {
|
|
82
82
|
"node": "^20.19.0 || >=22.13.0"
|