react-doctor 0.7.4-dev.b47d053 → 0.7.4-dev.b686594
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 +0 -8
- package/dist/cli.js +79 -276
- package/dist/index.d.ts +5 -47
- package/dist/index.js +64 -251
- package/dist/lsp.js +33 -174
- package/package.json +5 -5
package/dist/lsp.js
CHANGED
|
@@ -5,10 +5,10 @@ import * as OS from "node:os";
|
|
|
5
5
|
import os from "node:os";
|
|
6
6
|
import * as Path from "node:path";
|
|
7
7
|
import path from "node:path";
|
|
8
|
-
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";
|
|
9
8
|
import * as NodeChildProcess from "node:child_process";
|
|
10
9
|
import { execFileSync, spawn, spawnSync } from "node:child_process";
|
|
11
10
|
import ts from "typescript";
|
|
11
|
+
import reactDoctorPlugin, { ALL_REACT_DOCTOR_RULE_KEYS, CROSS_FILE_DEPENDENCY_COLLECTORS, CROSS_FILE_RULE_IDS, FRAMEWORK_SPECIFIC_RULE_KEYS, MOTION_LIBRARY_PACKAGES, REACT_COMPILER_RULES, REACT_DOCTOR_RULES, classifySecurityScanFile, collectCrossFileDependencyProbes, resetManifestCaches, shouldReadSecurityScanContent } from "oxlint-plugin-react-doctor";
|
|
12
12
|
import { parseJSON5 } from "confbox";
|
|
13
13
|
import * as NodeUrl from "node:url";
|
|
14
14
|
import { fileURLToPath } from "node:url";
|
|
@@ -19339,31 +19339,6 @@ var Diagnostic = class extends Class("Diagnostic")({
|
|
|
19339
19339
|
relatedLocations: optional(ArraySchema(DiagnosticRelatedLocation)),
|
|
19340
19340
|
fixGroupId: optional(String$1)
|
|
19341
19341
|
}) {};
|
|
19342
|
-
var JsonReportDiagnosticV3 = class extends Class("JsonReportDiagnosticV3")({
|
|
19343
|
-
id: String$1,
|
|
19344
|
-
normalizedFilePath: String$1,
|
|
19345
|
-
filePath: String$1,
|
|
19346
|
-
plugin: String$1,
|
|
19347
|
-
rule: String$1,
|
|
19348
|
-
severity: Severity,
|
|
19349
|
-
tags: ArraySchema(String$1),
|
|
19350
|
-
title: optional(String$1),
|
|
19351
|
-
message: String$1,
|
|
19352
|
-
help: String$1,
|
|
19353
|
-
url: optional(String$1),
|
|
19354
|
-
line: Number$1,
|
|
19355
|
-
column: Number$1,
|
|
19356
|
-
offset: optional(Number$1),
|
|
19357
|
-
length: optional(Number$1),
|
|
19358
|
-
endLine: optional(Number$1),
|
|
19359
|
-
endColumn: optional(Number$1),
|
|
19360
|
-
category: String$1,
|
|
19361
|
-
matchByOccurrence: optional(Boolean$1),
|
|
19362
|
-
fileContext: optional(Literals(["test", "story"])),
|
|
19363
|
-
suppressionHint: optional(String$1),
|
|
19364
|
-
relatedLocations: optional(ArraySchema(DiagnosticRelatedLocation)),
|
|
19365
|
-
fixGroupId: optional(String$1)
|
|
19366
|
-
}) {};
|
|
19367
19342
|
/**
|
|
19368
19343
|
* Deterministic identity string for a diagnostic. Same diagnostic
|
|
19369
19344
|
* across two scans yields the same identity; lets baselines,
|
|
@@ -19377,7 +19352,6 @@ const JsonReportMode = Literals([
|
|
|
19377
19352
|
"staged",
|
|
19378
19353
|
"baseline"
|
|
19379
19354
|
]);
|
|
19380
|
-
const Framework = Literals(FRAMEWORK_TOKENS);
|
|
19381
19355
|
var JsonReportSummary = class extends Class("JsonReportSummary")({
|
|
19382
19356
|
errorCount: Number$1,
|
|
19383
19357
|
warningCount: Number$1,
|
|
@@ -19415,22 +19389,13 @@ var JsonReportProjectEntry = class extends Class("JsonReportProjectEntry")({
|
|
|
19415
19389
|
scannedFileCount: optional(Number$1),
|
|
19416
19390
|
elapsedMilliseconds: Number$1
|
|
19417
19391
|
}) {};
|
|
19418
|
-
|
|
19419
|
-
|
|
19420
|
-
|
|
19421
|
-
|
|
19422
|
-
|
|
19423
|
-
|
|
19424
|
-
|
|
19425
|
-
skippedChecks: ArraySchema(String$1),
|
|
19426
|
-
skippedCheckReasons: optional(Record$1(String$1, String$1)),
|
|
19427
|
-
analyzedFiles: ArraySchema(String$1),
|
|
19428
|
-
analyzedFileCount: Number$1,
|
|
19429
|
-
complete: Boolean$1,
|
|
19430
|
-
scannedFileCount: optional(Number$1),
|
|
19431
|
-
elapsedMilliseconds: Number$1
|
|
19432
|
-
}) {};
|
|
19433
|
-
/** Original full, diff, and staged report contract. */
|
|
19392
|
+
/**
|
|
19393
|
+
* Versioned JsonReport schema. `JsonReport` is a `Schema.Union` so we
|
|
19394
|
+
* can add `schemaVersion: 2` later as one new union member without
|
|
19395
|
+
* breaking existing v1 consumers (the GitHub Action keys off the
|
|
19396
|
+
* version literal). Today's union is single-arm; the shape is
|
|
19397
|
+
* intentional.
|
|
19398
|
+
*/
|
|
19434
19399
|
var JsonReportV1 = class extends Class("JsonReportV1")({
|
|
19435
19400
|
schemaVersion: Literal(1),
|
|
19436
19401
|
version: String$1,
|
|
@@ -19491,27 +19456,7 @@ var JsonReportV2 = class extends Class("JsonReportV2")({
|
|
|
19491
19456
|
elapsedMilliseconds: Number$1,
|
|
19492
19457
|
error: NullOr(JsonReportError)
|
|
19493
19458
|
}) {};
|
|
19494
|
-
|
|
19495
|
-
schemaVersion: Literal(3),
|
|
19496
|
-
version: String$1,
|
|
19497
|
-
ok: Boolean$1,
|
|
19498
|
-
directory: String$1,
|
|
19499
|
-
mode: JsonReportMode,
|
|
19500
|
-
baselineDegraded: optional(Boolean$1),
|
|
19501
|
-
reactDetected: optional(Boolean$1),
|
|
19502
|
-
diff: NullOr(JsonReportDiffInfo),
|
|
19503
|
-
baseline: optional(JsonReportBaseline),
|
|
19504
|
-
projects: ArraySchema(JsonReportProjectEntryV3),
|
|
19505
|
-
diagnostics: ArraySchema(JsonReportDiagnosticV3),
|
|
19506
|
-
summary: JsonReportSummary,
|
|
19507
|
-
elapsedMilliseconds: Number$1,
|
|
19508
|
-
error: NullOr(JsonReportError)
|
|
19509
|
-
}) {};
|
|
19510
|
-
Union([
|
|
19511
|
-
JsonReportV1,
|
|
19512
|
-
JsonReportV2,
|
|
19513
|
-
JsonReportV3
|
|
19514
|
-
]);
|
|
19459
|
+
Union([JsonReportV1, JsonReportV2]);
|
|
19515
19460
|
//#endregion
|
|
19516
19461
|
//#region ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/internal/constants.js
|
|
19517
19462
|
var require_constants$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
|
|
@@ -34004,22 +33949,6 @@ const isPackageJsonReanimatedAware = (packageJson) => {
|
|
|
34004
33949
|
};
|
|
34005
33950
|
return Object.hasOwn(allDependencies, REANIMATED_DEPENDENCY_NAME$1);
|
|
34006
33951
|
};
|
|
34007
|
-
const SSR_DEPENDENCY_NAMES = new Set([
|
|
34008
|
-
"@react-router/cloudflare",
|
|
34009
|
-
"@react-router/node",
|
|
34010
|
-
"@react-router/serve",
|
|
34011
|
-
"vike",
|
|
34012
|
-
"vite-plugin-ssr"
|
|
34013
|
-
]);
|
|
34014
|
-
const isPackageJsonSsrAware = (packageJson) => {
|
|
34015
|
-
const allDependencies = {
|
|
34016
|
-
...packageJson.peerDependencies,
|
|
34017
|
-
...packageJson.dependencies,
|
|
34018
|
-
...packageJson.devDependencies,
|
|
34019
|
-
...packageJson.optionalDependencies
|
|
34020
|
-
};
|
|
34021
|
-
return Object.keys(allDependencies).some((packageName) => SSR_DEPENDENCY_NAMES.has(packageName));
|
|
34022
|
-
};
|
|
34023
33952
|
const getWorkspacePatterns = (rootDirectory, packageJson) => {
|
|
34024
33953
|
const pnpmPatterns = parsePnpmWorkspacePatterns(rootDirectory);
|
|
34025
33954
|
if (pnpmPatterns.length > 0) return pnpmPatterns;
|
|
@@ -34160,7 +34089,6 @@ const evaluateManifestFacts = (facts, packageJson, directory) => {
|
|
|
34160
34089
|
}
|
|
34161
34090
|
facts.hasReactNativeAwarePackage = facts.hasReactNativeAwarePackage || isPackageJsonReactNativeAware(packageJson);
|
|
34162
34091
|
facts.hasReanimatedAwarePackage = facts.hasReanimatedAwarePackage || isPackageJsonReanimatedAware(packageJson);
|
|
34163
|
-
facts.hasSsrDependency = facts.hasSsrDependency || isPackageJsonSsrAware(packageJson);
|
|
34164
34092
|
};
|
|
34165
34093
|
const collectWorkspaceFacts = (rootDirectory, rootPackageJson, { collectReactGroup }) => {
|
|
34166
34094
|
const facts = {
|
|
@@ -34182,7 +34110,6 @@ const collectWorkspaceFacts = (rootDirectory, rootPackageJson, { collectReactGro
|
|
|
34182
34110
|
},
|
|
34183
34111
|
hasReactNativeAwarePackage: false,
|
|
34184
34112
|
hasReanimatedAwarePackage: false,
|
|
34185
|
-
hasSsrDependency: false,
|
|
34186
34113
|
reanimatedVersion: null
|
|
34187
34114
|
};
|
|
34188
34115
|
evaluateManifestFacts(facts, rootPackageJson, rootDirectory);
|
|
@@ -34422,7 +34349,6 @@ const discoverProjectWithoutPackageJson = (directory) => {
|
|
|
34422
34349
|
hasTypeScript: hasOwnTsConfig,
|
|
34423
34350
|
hasReactCompiler: false,
|
|
34424
34351
|
hasTanStackQuery: false,
|
|
34425
|
-
hasSsrDependency: false,
|
|
34426
34352
|
preactVersion: null,
|
|
34427
34353
|
preactMajorVersion: null,
|
|
34428
34354
|
hasReactNativeWorkspace: false,
|
|
@@ -34542,7 +34468,6 @@ const discoverProject = (directory) => {
|
|
|
34542
34468
|
hasTypeScript,
|
|
34543
34469
|
hasReactCompiler: detectReactCompiler(directory, packageJson),
|
|
34544
34470
|
hasTanStackQuery: hasTanStackQuery(packageJson),
|
|
34545
|
-
hasSsrDependency: workspaceFacts.hasSsrDependency,
|
|
34546
34471
|
preactVersion,
|
|
34547
34472
|
preactMajorVersion: parseReactMajor(preactVersion),
|
|
34548
34473
|
hasReactNativeWorkspace,
|
|
@@ -37287,12 +37212,6 @@ const CLIENT_ONLY_FRAMEWORKS = new Set([
|
|
|
37287
37212
|
"react-native",
|
|
37288
37213
|
"expo"
|
|
37289
37214
|
]);
|
|
37290
|
-
const SSR_FRAMEWORKS = new Set([
|
|
37291
|
-
"nextjs",
|
|
37292
|
-
"remix",
|
|
37293
|
-
"gatsby",
|
|
37294
|
-
"tanstack-start"
|
|
37295
|
-
]);
|
|
37296
37215
|
const addMajorLadder = (capabilities, name, major, earliest, latest) => {
|
|
37297
37216
|
if (major === null) return;
|
|
37298
37217
|
const cappedMajor = Math.min(major, latest);
|
|
@@ -37305,7 +37224,6 @@ const buildCapabilities = (project) => {
|
|
|
37305
37224
|
if (project.framework === "expo" || project.framework === "react-native" || project.hasReactNativeWorkspace) capabilities.add("react-native");
|
|
37306
37225
|
if (project.expoVersion !== null) capabilities.add("expo");
|
|
37307
37226
|
if ((project.framework === "nextjs" || project.framework === "tanstack-start" || project.framework === "remix") && !project.isStaticExport) capabilities.add("server-actions");
|
|
37308
|
-
if (SSR_FRAMEWORKS.has(project.framework) || project.hasSsrDependency) capabilities.add("ssr");
|
|
37309
37227
|
if (CLIENT_ONLY_FRAMEWORKS.has(project.framework)) capabilities.add("client-only");
|
|
37310
37228
|
if (project.isStaticExport) capabilities.add("nextjs:static-export");
|
|
37311
37229
|
if (project.nextjsMajorVersion !== null && project.nextjsMajorVersion >= 15) capabilities.add("nextjs:15");
|
|
@@ -40710,8 +40628,6 @@ const spawnLintBatches = async (input) => {
|
|
|
40710
40628
|
const reasonHint = firstDropReason ? ` — first failure: ${firstDropReason}` : "";
|
|
40711
40629
|
reportSkippedFiles(droppedFiles, (fileListPreview) => `${droppedFiles.length} file(s) failed to lint and were skipped (${fileListPreview})${reasonHint}`);
|
|
40712
40630
|
reportSkippedFiles(outcome.deadlineSkippedFiles, (fileListPreview) => `${outcome.deadlineSkippedFiles.length} file(s) skipped — max scan duration reached before they were linted (${fileListPreview})`);
|
|
40713
|
-
const unavailableFiles = new Set([...droppedFiles, ...outcome.deadlineSkippedFiles]);
|
|
40714
|
-
input.onAnalyzedFiles?.([...new Set(fileBatches.flat().filter((filePath) => !unavailableFiles.has(filePath)))].sort());
|
|
40715
40631
|
return dedupeDiagnostics(diagnostics);
|
|
40716
40632
|
};
|
|
40717
40633
|
let didValidate = false;
|
|
@@ -40968,18 +40884,12 @@ const reactHooksJsPluginDropNote = (error) => {
|
|
|
40968
40884
|
* 6. always restore disable directives + clean up the temp dir
|
|
40969
40885
|
*/
|
|
40970
40886
|
const runOxlint = async (options) => {
|
|
40971
|
-
const { rootDirectory, project, includePaths, nodeBinaryPath = process.execPath, customRulesOnly = false, respectInlineDisables = true, adoptExistingLintConfig = true, ignoredTags = /* @__PURE__ */ new Set(), userConfig, configSourceDirectory = rootDirectory, onPartialFailure,
|
|
40887
|
+
const { rootDirectory, project, includePaths, nodeBinaryPath = process.execPath, customRulesOnly = false, respectInlineDisables = true, adoptExistingLintConfig = true, ignoredTags = /* @__PURE__ */ new Set(), userConfig, configSourceDirectory = rootDirectory, onPartialFailure, perFileLintCacheEnabled = false, sidecarLintCacheEnabled = false, onCacheStats, onSidecarStats, spawnTimeoutMs, outputMaxBytes, lintBatchOrdering = "cost" } = options;
|
|
40972
40888
|
const serverAuthFunctionNames = Array.isArray(userConfig?.serverAuthFunctionNames) ? userConfig.serverAuthFunctionNames.filter((entry) => typeof entry === "string" && entry.length > 0) : void 0;
|
|
40973
40889
|
const severityControls = buildRuleSeverityControls(userConfig);
|
|
40974
40890
|
validateRuleRegistration();
|
|
40975
40891
|
resetManifestCaches();
|
|
40976
|
-
if (includePaths !== void 0 && includePaths.length === 0)
|
|
40977
|
-
onFileCoverage?.({
|
|
40978
|
-
candidateFiles: [],
|
|
40979
|
-
analyzedFiles: []
|
|
40980
|
-
});
|
|
40981
|
-
return [];
|
|
40982
|
-
}
|
|
40892
|
+
if (includePaths !== void 0 && includePaths.length === 0) return [];
|
|
40983
40893
|
const pluginPath = resolvePluginPath();
|
|
40984
40894
|
const extendsPaths = (adoptExistingLintConfig && !customRulesOnly ? detectUserLintConfigPaths(rootDirectory) : []).filter(canOxlintExtendConfig);
|
|
40985
40895
|
const userPlugins = resolveUserPlugins(userConfig?.plugins, configSourceDirectory);
|
|
@@ -41040,7 +40950,6 @@ const runOxlint = async (options) => {
|
|
|
41040
40950
|
const runConfigOverFiles = async (buildConfigForPass, configFileName, files, fileProgress) => {
|
|
41041
40951
|
if (files.length === 0) return {
|
|
41042
40952
|
diagnostics: [],
|
|
41043
|
-
analyzedFiles: [],
|
|
41044
40953
|
didDropReactHooksJsPlugin: false,
|
|
41045
40954
|
hadPartialFailure: false
|
|
41046
40955
|
};
|
|
@@ -41052,32 +40961,24 @@ const runOxlint = async (options) => {
|
|
|
41052
40961
|
const passConfigPath = Path.join(configDirectory, configFileName);
|
|
41053
40962
|
const passBaseArgs = makeBaseArgs(passConfigPath);
|
|
41054
40963
|
const passFileBatches = buildFileBatches(passBaseArgs, files);
|
|
41055
|
-
|
|
41056
|
-
|
|
41057
|
-
|
|
41058
|
-
|
|
41059
|
-
|
|
41060
|
-
|
|
41061
|
-
|
|
41062
|
-
|
|
41063
|
-
|
|
41064
|
-
|
|
41065
|
-
|
|
41066
|
-
|
|
41067
|
-
|
|
41068
|
-
|
|
41069
|
-
spawnTimeoutMs,
|
|
41070
|
-
outputMaxBytes,
|
|
41071
|
-
concurrency: options.concurrency,
|
|
41072
|
-
signal: options.signal,
|
|
41073
|
-
deadlineEpochMs: options.deadlineEpochMs
|
|
41074
|
-
});
|
|
41075
|
-
};
|
|
40964
|
+
const spawnPass = () => spawnLintBatches({
|
|
40965
|
+
baseArgs: passBaseArgs,
|
|
40966
|
+
fileBatches: passFileBatches,
|
|
40967
|
+
rootDirectory,
|
|
40968
|
+
nodeBinaryPath,
|
|
40969
|
+
project,
|
|
40970
|
+
onPartialFailure: reportPartialFailure,
|
|
40971
|
+
onFileProgress: fileProgress,
|
|
40972
|
+
spawnTimeoutMs,
|
|
40973
|
+
outputMaxBytes,
|
|
40974
|
+
concurrency: options.concurrency,
|
|
40975
|
+
signal: options.signal,
|
|
40976
|
+
deadlineEpochMs: options.deadlineEpochMs
|
|
40977
|
+
});
|
|
41076
40978
|
writeOxlintConfig(passConfigPath, buildConfigForPass({}));
|
|
41077
40979
|
try {
|
|
41078
40980
|
return {
|
|
41079
40981
|
diagnostics: await spawnPass(),
|
|
41080
|
-
analyzedFiles,
|
|
41081
40982
|
didDropReactHooksJsPlugin: false,
|
|
41082
40983
|
hadPartialFailure
|
|
41083
40984
|
};
|
|
@@ -41089,7 +40990,6 @@ const runOxlint = async (options) => {
|
|
|
41089
40990
|
reportPartialFailure(reactHooksJsDropNote);
|
|
41090
40991
|
return {
|
|
41091
40992
|
diagnostics,
|
|
41092
|
-
analyzedFiles,
|
|
41093
40993
|
didDropReactHooksJsPlugin: true,
|
|
41094
40994
|
hadPartialFailure
|
|
41095
40995
|
};
|
|
@@ -41165,7 +41065,6 @@ const runOxlint = async (options) => {
|
|
|
41165
41065
|
const missFileSet = new Set(missFiles);
|
|
41166
41066
|
const hitFiles = candidateFiles.filter((candidateFile) => !missFileSet.has(candidateFile));
|
|
41167
41067
|
const sidecarReplayedDiagnostics = [];
|
|
41168
|
-
const sidecarReplayedFiles = [];
|
|
41169
41068
|
const sidecarLintFiles = [];
|
|
41170
41069
|
if (sidecarCache === null) sidecarLintFiles.push(...hitFiles);
|
|
41171
41070
|
else {
|
|
@@ -41173,10 +41072,8 @@ const runOxlint = async (options) => {
|
|
|
41173
41072
|
for (const hitFile of hitFiles) {
|
|
41174
41073
|
const cacheKey = cacheKeyByFile.get(hitFile);
|
|
41175
41074
|
const entry = cacheKey === void 0 ? null : sidecarCache.lookup(cacheKey);
|
|
41176
|
-
if (entry !== null && entry.probes.every((probe) => probeAnswers.answerFor(probe.kind, probe.path) === probe.answer))
|
|
41177
|
-
|
|
41178
|
-
sidecarReplayedDiagnostics.push(...entry.diagnostics);
|
|
41179
|
-
} else sidecarLintFiles.push(hitFile);
|
|
41075
|
+
if (entry !== null && entry.probes.every((probe) => probeAnswers.answerFor(probe.kind, probe.path) === probe.answer)) sidecarReplayedDiagnostics.push(...entry.diagnostics);
|
|
41076
|
+
else sidecarLintFiles.push(hitFile);
|
|
41180
41077
|
if (performance.now() - verifySliceStartedAt >= 12) {
|
|
41181
41078
|
await yieldToEventLoop();
|
|
41182
41079
|
verifySliceStartedAt = performance.now();
|
|
@@ -41202,7 +41099,6 @@ const runOxlint = async (options) => {
|
|
|
41202
41099
|
sidecarRuleIdFilter: new Set(unboundedSidecarRuleIds)
|
|
41203
41100
|
}), "oxlintrc.sidecar-unbounded.json", hitFiles, void 0) : {
|
|
41204
41101
|
diagnostics: [],
|
|
41205
|
-
analyzedFiles: [],
|
|
41206
41102
|
didDropReactHooksJsPlugin: false,
|
|
41207
41103
|
hadPartialFailure: false
|
|
41208
41104
|
};
|
|
@@ -41233,15 +41129,6 @@ const runOxlint = async (options) => {
|
|
|
41233
41129
|
probesByFile: await missProbesTask
|
|
41234
41130
|
}]
|
|
41235
41131
|
});
|
|
41236
|
-
const analyzedFileSet = new Set(fullResult.analyzedFiles);
|
|
41237
|
-
const boundedSidecarAnalyzedFileSet = new Set(boundedSidecarResult.analyzedFiles);
|
|
41238
|
-
const unboundedSidecarAnalyzedFileSet = new Set(unboundedSidecarResult.analyzedFiles);
|
|
41239
|
-
const sidecarReplayedFileSet = new Set(sidecarReplayedFiles);
|
|
41240
|
-
for (const hitFile of hitFiles) if (useSidecarCache ? (sidecarReplayedFileSet.has(hitFile) || boundedSidecarAnalyzedFileSet.has(hitFile)) && (unboundedSidecarRuleIds.length === 0 || unboundedSidecarAnalyzedFileSet.has(hitFile)) : boundedSidecarAnalyzedFileSet.has(hitFile)) analyzedFileSet.add(hitFile);
|
|
41241
|
-
onFileCoverage?.({
|
|
41242
|
-
candidateFiles,
|
|
41243
|
-
analyzedFiles: candidateFiles.filter((candidateFile) => analyzedFileSet.has(candidateFile))
|
|
41244
|
-
});
|
|
41245
41132
|
return dedupeDiagnostics([
|
|
41246
41133
|
...replayedDiagnostics,
|
|
41247
41134
|
...fullResult.diagnostics,
|
|
@@ -41252,7 +41139,6 @@ const runOxlint = async (options) => {
|
|
|
41252
41139
|
}
|
|
41253
41140
|
const baseArgs = makeBaseArgs(configPath);
|
|
41254
41141
|
const fileBatches = buildFileBatches(baseArgs, candidateFiles);
|
|
41255
|
-
let analyzedFiles = [];
|
|
41256
41142
|
const runBatches = () => spawnLintBatches({
|
|
41257
41143
|
baseArgs,
|
|
41258
41144
|
fileBatches,
|
|
@@ -41260,9 +41146,6 @@ const runOxlint = async (options) => {
|
|
|
41260
41146
|
nodeBinaryPath,
|
|
41261
41147
|
project,
|
|
41262
41148
|
onPartialFailure,
|
|
41263
|
-
onAnalyzedFiles: (filePaths) => {
|
|
41264
|
-
analyzedFiles = filePaths;
|
|
41265
|
-
},
|
|
41266
41149
|
onFileProgress: options.onFileProgress,
|
|
41267
41150
|
spawnTimeoutMs,
|
|
41268
41151
|
outputMaxBytes,
|
|
@@ -41272,12 +41155,7 @@ const runOxlint = async (options) => {
|
|
|
41272
41155
|
});
|
|
41273
41156
|
writeOxlintConfig(configPath, buildConfig({ extendsPaths }));
|
|
41274
41157
|
try {
|
|
41275
|
-
|
|
41276
|
-
onFileCoverage?.({
|
|
41277
|
-
candidateFiles,
|
|
41278
|
-
analyzedFiles
|
|
41279
|
-
});
|
|
41280
|
-
return diagnostics;
|
|
41158
|
+
return await runBatches();
|
|
41281
41159
|
} catch (error) {
|
|
41282
41160
|
const reactHooksJsDropNote = reactHooksJsPluginDropNote(error);
|
|
41283
41161
|
if (reactHooksJsDropNote !== null) {
|
|
@@ -41287,20 +41165,11 @@ const runOxlint = async (options) => {
|
|
|
41287
41165
|
}));
|
|
41288
41166
|
const diagnostics = await runBatches();
|
|
41289
41167
|
onPartialFailure?.(reactHooksJsDropNote);
|
|
41290
|
-
onFileCoverage?.({
|
|
41291
|
-
candidateFiles,
|
|
41292
|
-
analyzedFiles
|
|
41293
|
-
});
|
|
41294
41168
|
return diagnostics;
|
|
41295
41169
|
}
|
|
41296
41170
|
if (extendsPaths.length === 0) throw error;
|
|
41297
41171
|
writeOxlintConfig(configPath, buildConfig({ extendsPaths: [] }));
|
|
41298
|
-
|
|
41299
|
-
onFileCoverage?.({
|
|
41300
|
-
candidateFiles,
|
|
41301
|
-
analyzedFiles
|
|
41302
|
-
});
|
|
41303
|
-
return diagnostics;
|
|
41172
|
+
return await runBatches();
|
|
41304
41173
|
}
|
|
41305
41174
|
} finally {
|
|
41306
41175
|
restoreDisableDirectives();
|
|
@@ -41380,7 +41249,6 @@ var Linter = class Linter extends Service()("react-doctor/Linter") {
|
|
|
41380
41249
|
onPartialFailure: (reason) => {
|
|
41381
41250
|
collectedFailures.push(reason);
|
|
41382
41251
|
},
|
|
41383
|
-
onFileCoverage: input.onFileCoverage,
|
|
41384
41252
|
onFileProgress: input.onFileProgress,
|
|
41385
41253
|
perFileLintCacheEnabled,
|
|
41386
41254
|
sidecarLintCacheEnabled,
|
|
@@ -42088,7 +41956,6 @@ const resolveGithubActionsScoreMetadata = (environment = process.env) => {
|
|
|
42088
41956
|
...actorAssociation !== void 0 ? { githubActorAssociation: actorAssociation } : {}
|
|
42089
41957
|
};
|
|
42090
41958
|
};
|
|
42091
|
-
const toNormalizedRelativePath = (filePath, rootDirectory) => Path.relative(Path.resolve(rootDirectory), Path.resolve(rootDirectory, filePath)).replaceAll("\\", "/") || ".";
|
|
42092
41959
|
const NO_HOOKS = {
|
|
42093
41960
|
beforeLint: () => void_,
|
|
42094
41961
|
afterLint: () => void_
|
|
@@ -42187,7 +42054,7 @@ const runInspect = (input, hooks = {}) => gen(function* () {
|
|
|
42187
42054
|
repo
|
|
42188
42055
|
}).pipe(orElseSucceed(() => null)) : succeed$2(null));
|
|
42189
42056
|
const lintIncludePaths = (input.skipJsxIncludeFilter ? input.includePaths.length > 0 ? [...input.includePaths] : void 0 : computeExplicitLintIncludePaths([...input.includePaths], project)) ?? resolveLintIncludePaths(scanDirectory, resolvedConfig.config, project);
|
|
42190
|
-
const
|
|
42057
|
+
const scannedFilePaths = input.suppressScanSummary ? (lintIncludePaths ?? (yield* filesService.listSourceFiles(scanDirectory))).map((relativePath) => Path.resolve(scanDirectory, relativePath)) : [];
|
|
42191
42058
|
const beforeLint = hooks.beforeLint ?? NO_HOOKS.beforeLint;
|
|
42192
42059
|
const afterLint = hooks.afterLint ?? NO_HOOKS.afterLint;
|
|
42193
42060
|
yield* beforeLint(project, lintIncludePaths ?? void 0);
|
|
@@ -42292,7 +42159,6 @@ const runInspect = (input, hooks = {}) => gen(function* () {
|
|
|
42292
42159
|
let deadCodeCacheHit = null;
|
|
42293
42160
|
let deadCodeSummaryCacheHits = null;
|
|
42294
42161
|
let deadCodeSummaryCacheMisses = null;
|
|
42295
|
-
const lintFileCoverageState = { value: null };
|
|
42296
42162
|
const baseLintStream = linterService.run({
|
|
42297
42163
|
rootDirectory: scanDirectory,
|
|
42298
42164
|
project,
|
|
@@ -42308,9 +42174,6 @@ const runInspect = (input, hooks = {}) => gen(function* () {
|
|
|
42308
42174
|
lastReportedTotalFileCount = totalFileCount;
|
|
42309
42175
|
runSync(scanProgress.update(`Scanning files (${scannedFileCount}/${totalFileCount})${workerCountSuffix}...`));
|
|
42310
42176
|
},
|
|
42311
|
-
onFileCoverage: (coverage) => {
|
|
42312
|
-
lintFileCoverageState.value = coverage;
|
|
42313
|
-
},
|
|
42314
42177
|
onCacheStats: (cacheHitFileCount, totalConsideredFileCount) => {
|
|
42315
42178
|
lintCacheHitFileCount = cacheHitFileCount;
|
|
42316
42179
|
lintCacheTotalFileCount = totalConsideredFileCount;
|
|
@@ -42341,10 +42204,7 @@ const runInspect = (input, hooks = {}) => gen(function* () {
|
|
|
42341
42204
|
const lintFailureState = yield* get$2(lintFailure);
|
|
42342
42205
|
yield* afterLint(lintFailureState.didFail);
|
|
42343
42206
|
if (lintFailureState.didFail) yield* scanProgress.fail(formatLintFailText(lintFailureState.reasonTag, process.version));
|
|
42344
|
-
const
|
|
42345
|
-
const analyzedFiles = lintFileCoverageState.value === null ? [] : [...new Set(lintFileCoverageState.value.analyzedFiles.map((filePath) => toNormalizedRelativePath(filePath, scanDirectory)))].sort();
|
|
42346
|
-
const totalFileCount = candidateFiles.length || lastReportedTotalFileCount || (lintIncludePaths?.length ?? project.sourceFileCount);
|
|
42347
|
-
const scannedFilePaths = input.suppressScanSummary ? candidateFiles.length > 0 ? candidateFiles.map((filePath) => Path.resolve(scanDirectory, filePath)) : fallbackScannedFilePaths : [];
|
|
42207
|
+
const totalFileCount = lastReportedTotalFileCount || (lintIncludePaths?.length ?? project.sourceFileCount);
|
|
42348
42208
|
const scannedFilesLabel = `${totalFileCount} ${totalFileCount === 1 ? "file" : "files"}`;
|
|
42349
42209
|
let deadCodeCollected = [];
|
|
42350
42210
|
if (lintFailureState.didFail) {
|
|
@@ -42426,7 +42286,6 @@ const runInspect = (input, hooks = {}) => gen(function* () {
|
|
|
42426
42286
|
deadCodeOverlapped: shouldOverlapDeadCode,
|
|
42427
42287
|
scannedFileCount: totalFileCount,
|
|
42428
42288
|
scannedFilePaths,
|
|
42429
|
-
analyzedFiles,
|
|
42430
42289
|
scanElapsedMilliseconds,
|
|
42431
42290
|
scanConcurrency,
|
|
42432
42291
|
supplyChainOverlapTimedOut: supplyChainResult.timedOut,
|
|
@@ -44816,5 +44675,5 @@ const startLanguageServer = () => {
|
|
|
44816
44675
|
};
|
|
44817
44676
|
//#endregion
|
|
44818
44677
|
export { startLanguageServer };
|
|
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]="
|
|
44820
|
-
//# debugId=
|
|
44678
|
+
!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]="d2e32daa-f348-51ee-b9ac-760655d4ae8f")}catch(e){}}();
|
|
44679
|
+
//# debugId=d2e32daa-f348-51ee-b9ac-760655d4ae8f
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-doctor",
|
|
3
|
-
"version": "0.7.4-dev.
|
|
3
|
+
"version": "0.7.4-dev.b686594",
|
|
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.4",
|
|
69
|
+
"oxlint-plugin-react-doctor": "0.7.4-dev.b686594"
|
|
70
70
|
},
|
|
71
71
|
"devDependencies": {
|
|
72
72
|
"@types/babel__code-frame": "^7.27.0",
|
|
@@ -74,9 +74,9 @@
|
|
|
74
74
|
"@xterm/headless": "^6.0.0",
|
|
75
75
|
"commander": "^14.0.3",
|
|
76
76
|
"ora": "^9.4.0",
|
|
77
|
-
"@react-doctor/
|
|
77
|
+
"@react-doctor/language-server": "0.7.4",
|
|
78
78
|
"@react-doctor/core": "0.7.4",
|
|
79
|
-
"@react-doctor/
|
|
79
|
+
"@react-doctor/api": "0.7.4"
|
|
80
80
|
},
|
|
81
81
|
"engines": {
|
|
82
82
|
"node": "^20.19.0 || >=22.13.0"
|