react-doctor 0.9.22 → 0.9.23-dev.dfffab3
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/{build-section-divider-JXerAqjw.js → build-section-divider-BFxWf70B.js} +5 -5
- package/dist/{ci-BWu53Ijl.js → ci-CLtdQCIE.js} +13 -13
- package/dist/cli.js +25 -25
- package/dist/{constants-lt2tTZjE.js → constants-BmD_c3Yq.js} +12 -6
- package/dist/{constants-DNh19qg9.js → constants-T2clfs7L.js} +4 -4
- package/dist/{design-CN12FgvK.js → design-BMqPn207.js} +4 -4
- package/dist/duplicate-jsx-worker.js +17 -10
- package/dist/{exit-gracefully-BMgB2pVu.js → exit-gracefully-Bhyw-8gk.js} +6 -6
- package/dist/{handle-error-CoIUQwLf.js → handle-error-BJ_4E2kS.js} +6 -6
- package/dist/index.d.ts +5 -2
- package/dist/index.js +215 -38
- package/dist/{inspect-D4QLdCtm.js → inspect-BuLr42QI.js} +16 -16
- package/dist/{install-R6-fv9t4.js → install-DsuiRD1t.js} +10 -10
- package/dist/{install-doctor-script-D9-Bdbx6.js → install-doctor-script-DJ6UbhZJ.js} +5 -5
- package/dist/{install-github-workflow-B01vSPPa.js → install-github-workflow-BNRbJHjd.js} +6 -6
- package/dist/{install-react-doctor-DZnPIaiY.js → install-react-doctor-BcsOSw5y.js} +9 -9
- package/dist/{is-cache-globally-disabled-af0VF8nQ.js → is-cache-globally-disabled-CveNGcRi.js} +4 -4
- package/dist/{jsx-runtime-D_p1BwrV.js → jsx-runtime-BDdabT1T.js} +6 -6
- package/dist/oxlint-worker.js +1 -1
- package/dist/{print-branded-header-BegpykMJ.js → print-branded-header-BFh1P9t6.js} +4 -4
- package/dist/project-analysis-worker.js +1 -1
- package/dist/{prompt-runtime-scan-url-OIHMChS6.js → prompt-runtime-scan-url-CRx8qrV0.js} +5 -5
- package/dist/{read-object-file-Bd06Y-EV.js → read-object-file-D3pRnLyV.js} +4 -4
- package/dist/{record-metric-5SPbuLyj.js → record-metric-CWxS2npr.js} +200 -40
- package/dist/{report-error-DayUUIc-.js → report-error-DA8uMulb.js} +6 -6
- package/dist/{report-workflow-result-tdrT9lW-.js → report-workflow-result-D6NNwRMm.js} +6 -6
- package/dist/{resolve-scan-exit-code-DWrr-Xuv.js → resolve-scan-exit-code-DE6AIQwU.js} +41 -30
- package/dist/{resolve-scope-OdFJKZGv.js → resolve-scope-B3xmSQ0a.js} +6 -6
- package/dist/{rules-DNgtXPXx.js → rules-CHxjoZwR.js} +7 -7
- package/dist/{run-scan-app-COJWBnqC.js → run-scan-app-BuI_XZcx.js} +11 -11
- package/dist/{runtime-scan-CkpS56h8.js → runtime-scan-0pSZm3M0.js} +10 -10
- package/dist/{sanitize-runtime-url-fwyTS789.js → sanitize-runtime-url-BCw_Ixks.js} +4 -4
- package/dist/{scan-iZF-ydER.js → scan-Be7a-iK7.js} +10 -10
- package/dist/{should-skip-prompts-BvvlROWq.js → should-skip-prompts-CDudIC40.js} +4 -4
- package/dist/{should-use-tui-BjzxYIbC.js → should-use-tui-HuQLii4U.js} +4 -4
- package/dist/skills/react-doctor/references/explain.md +5 -0
- package/dist/{start-scan-preamble-CQy0CKXS.js → start-scan-preamble-DDAT_0oB.js} +5 -5
- package/dist/start-scan-preamble.js +3 -3
- package/dist/{telemetry-runtime-DQLNzRNG.js → telemetry-runtime-De9QafWu.js} +13 -7
- package/dist/{version-BasyRE1W.js → version-uDDHk7KW.js} +5 -5
- package/dist/{why-ni8gAKZe.js → why-Dww_fJtq.js} +4 -4
- package/dist/{with-run-span-eDYTicUo.js → with-run-span-CRYkeESN.js} +6 -6
- package/package.json +4 -4
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]="5255a206-f2ac-51fa-9a2f-9480ba58e9d7")}catch(e){}}();
|
|
3
3
|
import { i as __toESM, r as __require, t as __commonJSMin } from "./chunk-ChKA3wi6.js";
|
|
4
4
|
import { createRequire } from "node:module";
|
|
5
5
|
import * as fs$1$2 from "node:fs";
|
|
@@ -19,14 +19,14 @@ import * as net from "node:net";
|
|
|
19
19
|
import { parseSync } from "oxc-parser";
|
|
20
20
|
import * as fs$1$1 from "node:fs/promises";
|
|
21
21
|
import { ResolverFactory } from "oxc-resolver";
|
|
22
|
-
import { ALL_REACT_DOCTOR_RULE_KEYS, CROSS_FILE_DEPENDENCY_COLLECTORS, CROSS_FILE_RULE_IDS, FRAMEWORK_SPECIFIC_RULE_KEYS, FRAMEWORK_TOKENS, MOTION_LIBRARY_PACKAGES, REACT_COMPILER_BRIDGE_RULES, REACT_COMPILER_RULES, REACT_DOCTOR_OPT_IN_PROJECT_RULE_IDS, REACT_DOCTOR_PROJECT_RULES, REACT_DOCTOR_RULES, REACT_DOCTOR_RULE_REGISTRY, REACT_DOCTOR_SCAN_RULES, atomicWriteFile, classifySecurityScanFile, collectCrossFileDependencyProbes, getDiagnosticContextPath, resetManifestCaches, shouldReadSecurityScanContent } from "oxlint-plugin-react-doctor/core";
|
|
22
|
+
import { ALL_REACT_DOCTOR_RULE_KEYS, CROSS_FILE_DEPENDENCY_COLLECTORS, CROSS_FILE_RULE_IDS, EXTERNAL_RULES, FRAMEWORK_SPECIFIC_RULE_KEYS, FRAMEWORK_TOKENS, MOTION_LIBRARY_PACKAGES, REACT_COMPILER_BRIDGE_RULES, REACT_COMPILER_RULES, REACT_DOCTOR_OPT_IN_PROJECT_RULE_IDS, REACT_DOCTOR_PROJECT_RULES, REACT_DOCTOR_RULES, REACT_DOCTOR_RULE_REGISTRY, REACT_DOCTOR_SCAN_RULES, atomicWriteFile, classifySecurityScanFile, collectCrossFileDependencyProbes, getDiagnosticContextPath, resetManifestCaches, shouldReadSecurityScanContent } from "oxlint-plugin-react-doctor/core";
|
|
23
23
|
import { parseJSON5, parseJSONC } from "confbox";
|
|
24
24
|
import { createJiti } from "jiti";
|
|
25
25
|
import { PassThrough } from "node:stream";
|
|
26
26
|
import { convertToTSX } from "@astrojs/compiler/sync";
|
|
27
27
|
import { STATUS_CODES } from "node:http";
|
|
28
28
|
import { gzipSync } from "node:zlib";
|
|
29
|
-
//#region ../core/dist/constants-
|
|
29
|
+
//#region ../core/dist/constants-BSeQaOcv.js
|
|
30
30
|
const HTML_FILE_PATTERN = /\.html$/i;
|
|
31
31
|
const SOURCE_FILE_PATTERN = /\.(?:astro|tsx?|jsx?|mts|mjs|[hH][tT][mM][lL])$/;
|
|
32
32
|
const GENERATED_BUNDLE_FILE_PATTERN = /\.(iife|umd|global|min)\.m?js$/i;
|
|
@@ -393,6 +393,7 @@ const JSX_DUPLICATION_SOURCE_FILE_PATTERN = /\.[cm]?(?:jsx?|tsx)$/;
|
|
|
393
393
|
const MAINTAINABILITY_PLUGIN = "react-doctor";
|
|
394
394
|
const MAINTAINABILITY_DUPLICATE_JSX_RULE = "duplicate-jsx-subtree";
|
|
395
395
|
const MAINTAINABILITY_CATEGORY = "Maintainability";
|
|
396
|
+
const ADOPTED_LINT_CONFIG_MAX_BYTES = 1024 * 1024;
|
|
396
397
|
//#endregion
|
|
397
398
|
//#region ../core/dist/fs-utils-3PlHYkCD.js
|
|
398
399
|
const isErrnoException = (error) => error instanceof Error && "code" in error;
|
|
@@ -440,7 +441,7 @@ const isPlainObject = (value) => {
|
|
|
440
441
|
//#region ../core/dist/react-compiler-detection-worker-protocol-Dp5LlrE8.js
|
|
441
442
|
const isReactCompilerDetectionReply = (value) => typeof value === "object" && value !== null && "id" in value && typeof value.id === "number" && "hasReactCompiler" in value && (typeof value.hasReactCompiler === "boolean" || value.hasReactCompiler === null);
|
|
442
443
|
//#endregion
|
|
443
|
-
//#region ../core/dist/react-compiler-detection-client-
|
|
444
|
+
//#region ../core/dist/react-compiler-detection-client-oiOwecj7.js
|
|
444
445
|
const pendingOutputsByRequestKey = /* @__PURE__ */ new Map();
|
|
445
446
|
const toRequestKey = (request) => [
|
|
446
447
|
request.directory,
|
|
@@ -573,6 +574,11 @@ const buildOxlintChildEnv = (sourceEnv) => {
|
|
|
573
574
|
if (name.startsWith("npm_config_")) continue;
|
|
574
575
|
childEnv[name] = value;
|
|
575
576
|
}
|
|
577
|
+
childEnv.BROWSERSLIST = "defaults";
|
|
578
|
+
childEnv.BROWSERSLIST_IGNORE_OLD_DATA = "true";
|
|
579
|
+
delete childEnv.BROWSERSLIST_CONFIG;
|
|
580
|
+
delete childEnv.BROWSERSLIST_STATS;
|
|
581
|
+
delete childEnv.BROWSERSLIST_DANGEROUS_EXTEND;
|
|
576
582
|
const isCompileCacheDisabled = Boolean(sourceEnv.NODE_DISABLE_COMPILE_CACHE);
|
|
577
583
|
const isCompileCacheAlreadySet = childEnv.NODE_COMPILE_CACHE !== void 0;
|
|
578
584
|
if (!isCompileCacheDisabled && !isCompileCacheAlreadySet) childEnv.NODE_COMPILE_CACHE = path$1$1.join(os.tmpdir(), NODE_COMPILE_CACHE_DIR_NAME);
|
|
@@ -2710,7 +2716,7 @@ var require_picomatch$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
2710
2716
|
module.exports = picomatch;
|
|
2711
2717
|
}));
|
|
2712
2718
|
//#endregion
|
|
2713
|
-
//#region ../core/dist/collect-unplugin-auto-import-global-scopes-
|
|
2719
|
+
//#region ../core/dist/collect-unplugin-auto-import-global-scopes-Z9dhela6.js
|
|
2714
2720
|
var import_picomatch = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2715
2721
|
const pico = require_picomatch$1();
|
|
2716
2722
|
const utils = require_utils();
|
|
@@ -3160,7 +3166,7 @@ const collectUnpluginAutoImportGlobalScopes = ({ rootDirectory, candidateFiles }
|
|
|
3160
3166
|
return scopes.some((scope) => scope.names.length > 0) ? scopes : [];
|
|
3161
3167
|
};
|
|
3162
3168
|
//#endregion
|
|
3163
|
-
//#region ../core/dist/detect-duplicate-jsx-subtrees-
|
|
3169
|
+
//#region ../core/dist/detect-duplicate-jsx-subtrees-B5UWtUyz.js
|
|
3164
3170
|
const yieldToEventLoop = () => new Promise((resolve) => {
|
|
3165
3171
|
setImmediate(resolve);
|
|
3166
3172
|
});
|
|
@@ -3285,7 +3291,7 @@ const resolveOptions$1 = (options) => ({
|
|
|
3285
3291
|
minimumDistinctFiles: options.minimumDistinctFiles ?? 1,
|
|
3286
3292
|
maxSourceFiles: options.budget?.maxSourceFiles ?? 5e3,
|
|
3287
3293
|
maxSourceLengthChars: options.budget?.maxSourceLengthChars ?? 1e6,
|
|
3288
|
-
maxJsxNodes: options.budget?.maxJsxNodes ??
|
|
3294
|
+
maxJsxNodes: options.budget?.maxJsxNodes ?? 5e5,
|
|
3289
3295
|
maxFamilies: options.budget?.maxFamilies ?? 20
|
|
3290
3296
|
});
|
|
3291
3297
|
const hashParts = (parts) => {
|
|
@@ -3499,10 +3505,12 @@ const collectCandidates = (source, sourceFile, signal, maximumCandidateCount) =>
|
|
|
3499
3505
|
const jsxNodes = [];
|
|
3500
3506
|
const pendingNodes = [sourceFile];
|
|
3501
3507
|
let limitExceeded = false;
|
|
3508
|
+
let observedJsxNodeCount = 0;
|
|
3502
3509
|
while (pendingNodes.length > 0 && !limitExceeded && !signal?.aborted) {
|
|
3503
3510
|
const currentNode = pendingNodes.pop();
|
|
3504
3511
|
if (currentNode === void 0) continue;
|
|
3505
3512
|
if (isJsxSubtreeNode(currentNode)) {
|
|
3513
|
+
observedJsxNodeCount += 1;
|
|
3506
3514
|
if (jsxNodes.length >= maximumCandidateCount) {
|
|
3507
3515
|
limitExceeded = true;
|
|
3508
3516
|
continue;
|
|
@@ -3518,7 +3526,8 @@ const collectCandidates = (source, sourceFile, signal, maximumCandidateCount) =>
|
|
|
3518
3526
|
if (limitExceeded || signal?.aborted) return {
|
|
3519
3527
|
candidates: [],
|
|
3520
3528
|
aborted: signal?.aborted ?? false,
|
|
3521
|
-
limitExceeded
|
|
3529
|
+
limitExceeded,
|
|
3530
|
+
observedJsxNodeCount
|
|
3522
3531
|
};
|
|
3523
3532
|
const metadataByNode = /* @__PURE__ */ new Map();
|
|
3524
3533
|
const functionIdentityByNode = /* @__PURE__ */ new Map();
|
|
@@ -3526,7 +3535,8 @@ const collectCandidates = (source, sourceFile, signal, maximumCandidateCount) =>
|
|
|
3526
3535
|
if (signal?.aborted) return {
|
|
3527
3536
|
candidates: [],
|
|
3528
3537
|
aborted: true,
|
|
3529
|
-
limitExceeded: false
|
|
3538
|
+
limitExceeded: false,
|
|
3539
|
+
observedJsxNodeCount
|
|
3530
3540
|
};
|
|
3531
3541
|
buildJsxSubtreeMetadata(jsxNodes[nodeIndex], metadataByNode);
|
|
3532
3542
|
}
|
|
@@ -3544,7 +3554,8 @@ const collectCandidates = (source, sourceFile, signal, maximumCandidateCount) =>
|
|
|
3544
3554
|
};
|
|
3545
3555
|
}),
|
|
3546
3556
|
aborted: false,
|
|
3547
|
-
limitExceeded: false
|
|
3557
|
+
limitExceeded: false,
|
|
3558
|
+
observedJsxNodeCount
|
|
3548
3559
|
};
|
|
3549
3560
|
};
|
|
3550
3561
|
const scanSource = (input) => {
|
|
@@ -3581,8 +3592,7 @@ const scanSource = (input) => {
|
|
|
3581
3592
|
incompleteReason: {
|
|
3582
3593
|
kind: "jsx-node-limit",
|
|
3583
3594
|
limit: input.options.maxJsxNodes,
|
|
3584
|
-
observed: input.
|
|
3585
|
-
path: input.source.path
|
|
3595
|
+
observed: input.scannedJsxNodeCount + collectedCandidates.observedJsxNodeCount
|
|
3586
3596
|
},
|
|
3587
3597
|
didAbort: false,
|
|
3588
3598
|
didScan: false
|
|
@@ -3699,7 +3709,10 @@ const detectDuplicateJsxSubtreesCooperative = async (sourceReader, options = {})
|
|
|
3699
3709
|
scannedSourceFileCount,
|
|
3700
3710
|
scannedJsxNodeCount
|
|
3701
3711
|
});
|
|
3702
|
-
if (scannedSource.incompleteReason !== null)
|
|
3712
|
+
if (scannedSource.incompleteReason !== null) {
|
|
3713
|
+
incompleteReasons.push(scannedSource.incompleteReason);
|
|
3714
|
+
if (scannedSource.incompleteReason.kind === "jsx-node-limit") break;
|
|
3715
|
+
}
|
|
3703
3716
|
if (scannedSource.didScan) {
|
|
3704
3717
|
candidates.push(...scannedSource.candidates);
|
|
3705
3718
|
scannedJsxNodeCount += scannedSource.candidates.length;
|
|
@@ -3717,7 +3730,7 @@ const detectDuplicateJsxSubtreesCooperative = async (sourceReader, options = {})
|
|
|
3717
3730
|
});
|
|
3718
3731
|
};
|
|
3719
3732
|
//#endregion
|
|
3720
|
-
//#region ../core/dist/detect-react-compiler-
|
|
3733
|
+
//#region ../core/dist/detect-react-compiler-DLpaU8gr.js
|
|
3721
3734
|
const NEXT_CONFIG_FILENAMES = [
|
|
3722
3735
|
"next.config.js",
|
|
3723
3736
|
"next.config.mjs",
|
|
@@ -68438,13 +68451,17 @@ const getBrowserslistProtectionRequirement = (directory) => {
|
|
|
68438
68451
|
env: "production"
|
|
68439
68452
|
});
|
|
68440
68453
|
if (!queries) return void 0;
|
|
68454
|
+
if ((typeof queries === "string" ? [queries] : queries).some((query) => /\b(?:extends|stats)\b|\bbrowserslist\s+config\b/i.test(query))) return;
|
|
68441
68455
|
let requirement;
|
|
68442
68456
|
let hasUnsupportedTarget = false;
|
|
68443
68457
|
const previousIgnoreOldData = process.env.BROWSERSLIST_IGNORE_OLD_DATA;
|
|
68444
68458
|
let browserTargets = [];
|
|
68445
68459
|
try {
|
|
68446
68460
|
process.env.BROWSERSLIST_IGNORE_OLD_DATA = "true";
|
|
68447
|
-
browserTargets = (0, import_browserslist.default)(queries
|
|
68461
|
+
browserTargets = (0, import_browserslist.default)(queries, {
|
|
68462
|
+
path: false,
|
|
68463
|
+
stats: {}
|
|
68464
|
+
});
|
|
68448
68465
|
} finally {
|
|
68449
68466
|
if (previousIgnoreOldData === void 0) delete process.env.BROWSERSLIST_IGNORE_OLD_DATA;
|
|
68450
68467
|
else process.env.BROWSERSLIST_IGNORE_OLD_DATA = previousIgnoreOldData;
|
|
@@ -68986,11 +69003,22 @@ for (const [legacyRuleKey, nativeRuleKey] of Object.entries(LEGACY_RULE_KEY_TO_N
|
|
|
68986
69003
|
NATIVE_RULE_KEY_TO_LEGACY_RULE_KEYS.set(nativeRuleKey, aliases);
|
|
68987
69004
|
}
|
|
68988
69005
|
const getLegacyRuleKeysForNative = (ruleKey) => NATIVE_RULE_KEY_TO_LEGACY_RULE_KEYS.get(ruleKey) ?? [];
|
|
69006
|
+
const REACT_DOCTOR_RULE_KEY_PREFIX = "react-doctor/";
|
|
68989
69007
|
const canonicalizeRuleKey = (ruleKey) => {
|
|
68990
69008
|
const nativeRuleKey = LEGACY_RULE_KEY_TO_NATIVE_RULE_KEY[ruleKey];
|
|
68991
69009
|
return typeof nativeRuleKey === "string" ? nativeRuleKey : ruleKey;
|
|
68992
69010
|
};
|
|
68993
69011
|
const isReactDoctorShortIdOf = (bareRuleKey, qualifiedRuleKey) => !bareRuleKey.includes("/") && qualifiedRuleKey === `react-doctor/${bareRuleKey}`;
|
|
69012
|
+
/**
|
|
69013
|
+
* Canonicalizes a rule key as users write it in config: a legacy alias
|
|
69014
|
+
* (`react/jsx-key`) maps to its native key, and a bare short id (`no-eval`)
|
|
69015
|
+
* qualifies as `react-doctor/<id>` — mirroring `isSameRuleKey`'s matching —
|
|
69016
|
+
* so telemetry groups every spelling of one rule under one key.
|
|
69017
|
+
*/
|
|
69018
|
+
const canonicalizeUserRuleKey = (ruleKey) => {
|
|
69019
|
+
const nativeRuleKey = canonicalizeRuleKey(ruleKey);
|
|
69020
|
+
return nativeRuleKey.includes("/") ? nativeRuleKey : `${REACT_DOCTOR_RULE_KEY_PREFIX}${nativeRuleKey}`;
|
|
69021
|
+
};
|
|
68994
69022
|
const isSameRuleKey = (candidateRuleKey, targetRuleKey) => {
|
|
68995
69023
|
const canonicalCandidate = canonicalizeRuleKey(candidateRuleKey);
|
|
68996
69024
|
const canonicalTarget = canonicalizeRuleKey(targetRuleKey);
|
|
@@ -70321,6 +70349,13 @@ const DEFAULT_SURFACE_EXCLUDED_TAGS = {
|
|
|
70321
70349
|
ciFailure: ["design"]
|
|
70322
70350
|
};
|
|
70323
70351
|
const isRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
70352
|
+
const KNOWN_RULE_KEYS = new Set([...ALL_REACT_DOCTOR_RULE_KEYS, ...EXTERNAL_RULES.map((rule) => rule.key)]);
|
|
70353
|
+
const BUNDLED_RULE_NAMESPACES = new Set([...KNOWN_RULE_KEYS].flatMap(getEquivalentRuleKeys).map((key) => key.slice(0, key.lastIndexOf("/"))));
|
|
70354
|
+
const getUnknownBundledRuleKeys = (rules) => Object.keys(rules ?? {}).filter((key) => {
|
|
70355
|
+
const canonicalKey = canonicalizeUserRuleKey(key);
|
|
70356
|
+
const namespace = canonicalKey.slice(0, canonicalKey.lastIndexOf("/"));
|
|
70357
|
+
return BUNDLED_RULE_NAMESPACES.has(namespace) && !KNOWN_RULE_KEYS.has(canonicalKey);
|
|
70358
|
+
});
|
|
70324
70359
|
const VALID_RULE_SEVERITIES = [
|
|
70325
70360
|
"error",
|
|
70326
70361
|
"warn",
|
|
@@ -70505,6 +70540,7 @@ const validateConfigTypes = (config) => {
|
|
|
70505
70540
|
applyFieldValidator(config, validated, "surfaces", validateSurfacesField);
|
|
70506
70541
|
for (const fieldName of SEVERITY_FIELD_NAMES) applyFieldValidator(config, validated, fieldName, (value) => validateSeverityMap(fieldName, value, fieldName === "categories"));
|
|
70507
70542
|
applyFieldValidator(config, validated, "plugins", (value) => validateStringArrayField("plugins", value));
|
|
70543
|
+
for (const ruleKey of getUnknownBundledRuleKeys(validated.rules)) warnConfigIssue(`config field "rules.${ruleKey}" is not a known bundled rule; this override has no effect. Run "react-doctor rules list" to find its rule ID.`);
|
|
70508
70544
|
return validated;
|
|
70509
70545
|
};
|
|
70510
70546
|
const warn = (message) => {
|
|
@@ -70798,7 +70834,7 @@ const dedupeRelatedDiagnostics = (diagnostics) => {
|
|
|
70798
70834
|
};
|
|
70799
70835
|
const isPathInsideDirectory = (childAbsolutePath, parentAbsolutePath) => {
|
|
70800
70836
|
const relativePath = path$1$1.relative(parentAbsolutePath, childAbsolutePath);
|
|
70801
|
-
return Boolean(relativePath) && !relativePath.startsWith(
|
|
70837
|
+
return Boolean(relativePath) && relativePath !== ".." && !relativePath.startsWith(`..${path$1$1.sep}`) && !path$1$1.isAbsolute(relativePath);
|
|
70802
70838
|
};
|
|
70803
70839
|
const compareStrings = (left, right) => left < right ? -1 : left > right ? 1 : 0;
|
|
70804
70840
|
const sortDiagnosticsStable = (diagnostics) => [...diagnostics].sort((left, right) => compareStrings(left.filePath, right.filePath) || left.line - right.line || left.column - right.column || compareStrings(left.plugin, right.plugin) || compareStrings(left.rule, right.rule) || compareStrings(left.severity, right.severity) || compareStrings(left.message, right.message));
|
|
@@ -72657,15 +72693,23 @@ const createSecurityScanSession = (rootDirectory, options) => {
|
|
|
72657
72693
|
const rule = entry.rule;
|
|
72658
72694
|
const scan = rule.scan;
|
|
72659
72695
|
if (typeof scan !== "function") return [];
|
|
72696
|
+
const explicitRuleOverride = resolveRuleSeverityOverride({ ruleKey: entry.key }, options.severityControls);
|
|
72697
|
+
const severityOverride = explicitRuleOverride ?? resolveRuleSeverityOverride({
|
|
72698
|
+
ruleKey: entry.key,
|
|
72699
|
+
category: "Security"
|
|
72700
|
+
}, options.severityControls);
|
|
72701
|
+
if (severityOverride === "off") return [];
|
|
72660
72702
|
if (!shouldEnableRuleByDefaultStatus({
|
|
72661
72703
|
defaultEnabled: rule.defaultEnabled,
|
|
72662
72704
|
includeTagDefaults: options.includeTagDefaults === true,
|
|
72663
|
-
hasIncludedTags: includedTags.size > 0
|
|
72705
|
+
hasIncludedTags: includedTags.size > 0,
|
|
72706
|
+
hasExplicitOverride: explicitRuleOverride !== void 0
|
|
72664
72707
|
})) return [];
|
|
72665
72708
|
if (!shouldEnableRule(rule.requires, rule.tags, capabilities, ignoredTags, rule.disabledWhen, includedTags)) return [];
|
|
72666
72709
|
return [{
|
|
72667
72710
|
entry,
|
|
72668
72711
|
scan,
|
|
72712
|
+
severityOverride,
|
|
72669
72713
|
committedFilesOnly: rule.committedFilesOnly === true
|
|
72670
72714
|
}];
|
|
72671
72715
|
});
|
|
@@ -72683,10 +72727,13 @@ const createSecurityScanSession = (rootDirectory, options) => {
|
|
|
72683
72727
|
};
|
|
72684
72728
|
const scanFileByRule = function* (file) {
|
|
72685
72729
|
if (file === null) return;
|
|
72686
|
-
for (const { entry, scan, committedFilesOnly } of enabledScanRules) {
|
|
72730
|
+
for (const { entry, scan, severityOverride, committedFilesOnly } of enabledScanRules) {
|
|
72687
72731
|
for (const finding of scan(file)) {
|
|
72688
72732
|
if (committedFilesOnly && isFileGitIgnored(file)) continue;
|
|
72689
|
-
const diagnostic = buildSecurityScanDiagnostic(finding
|
|
72733
|
+
const diagnostic = buildSecurityScanDiagnostic(severityOverride === void 0 ? finding : {
|
|
72734
|
+
...finding,
|
|
72735
|
+
severity: severityOverride
|
|
72736
|
+
}, entry, file.relativePath);
|
|
72690
72737
|
const key = `${diagnostic.rule}:${diagnostic.filePath}:${diagnostic.line}:${diagnostic.column}:${diagnostic.message}`;
|
|
72691
72738
|
if (seen.has(key)) continue;
|
|
72692
72739
|
seen.add(key);
|
|
@@ -74201,6 +74248,82 @@ const detectUserLintConfigPaths = (rootDirectory) => {
|
|
|
74201
74248
|
}
|
|
74202
74249
|
return [];
|
|
74203
74250
|
};
|
|
74251
|
+
const isSymlinkFreePath = (filePath, rootDirectory) => {
|
|
74252
|
+
if (!isPathInsideDirectory(filePath, rootDirectory)) return false;
|
|
74253
|
+
let currentPath = rootDirectory;
|
|
74254
|
+
for (const segment of path$1$1.relative(rootDirectory, filePath).split(path$1$1.sep)) {
|
|
74255
|
+
currentPath = path$1$1.join(currentPath, segment);
|
|
74256
|
+
try {
|
|
74257
|
+
if (fs$1$2.lstatSync(currentPath).isSymbolicLink()) return false;
|
|
74258
|
+
} catch (error) {
|
|
74259
|
+
return isErrnoException(error) && error.code === "ENOENT";
|
|
74260
|
+
}
|
|
74261
|
+
}
|
|
74262
|
+
return true;
|
|
74263
|
+
};
|
|
74264
|
+
const snapshotAdoptedLintConfigs = (input) => {
|
|
74265
|
+
const sourceBoundaryDirectory = path$1$1.resolve(findGitRepositoryRoot(input.rootDirectory) ?? input.rootDirectory);
|
|
74266
|
+
const boundaryDirectory = fs$1$2.realpathSync(sourceBoundaryDirectory);
|
|
74267
|
+
const snapshots = /* @__PURE__ */ new Map();
|
|
74268
|
+
const expandedFileCounts = /* @__PURE__ */ new Map();
|
|
74269
|
+
const activePaths = /* @__PURE__ */ new Set();
|
|
74270
|
+
let expandedFileCount = 0;
|
|
74271
|
+
const snapshotConfig = (configPath, depth) => {
|
|
74272
|
+
const resolvedPath = path$1$1.resolve(configPath);
|
|
74273
|
+
const existingSnapshot = snapshots.get(resolvedPath);
|
|
74274
|
+
if (existingSnapshot) {
|
|
74275
|
+
expandedFileCount += expandedFileCounts.get(resolvedPath) ?? 1;
|
|
74276
|
+
if (expandedFileCount > 64) throw new Error("Adopted lint config expands too many files");
|
|
74277
|
+
return existingSnapshot;
|
|
74278
|
+
}
|
|
74279
|
+
if (depth > 32 || expandedFileCount >= 64 || activePaths.has(resolvedPath) || !isSymlinkFreePath(resolvedPath, boundaryDirectory)) throw new Error("Unsafe adopted lint config chain");
|
|
74280
|
+
const configStats = fs$1$2.lstatSync(resolvedPath);
|
|
74281
|
+
if (!configStats.isFile() || configStats.size > 1048576) throw new Error("Unsupported adopted lint config file");
|
|
74282
|
+
const previousFileCount = expandedFileCount;
|
|
74283
|
+
expandedFileCount += 1;
|
|
74284
|
+
activePaths.add(resolvedPath);
|
|
74285
|
+
try {
|
|
74286
|
+
const parsed = parseJSONC(readTextFileUpToCharacterLimitSync({
|
|
74287
|
+
filePath: resolvedPath,
|
|
74288
|
+
maximumLengthChars: ADOPTED_LINT_CONFIG_MAX_BYTES,
|
|
74289
|
+
sizeBytes: configStats.size
|
|
74290
|
+
}), { allowTrailingComma: true });
|
|
74291
|
+
if (!isPlainObject(parsed)) throw new Error("Invalid adopted lint config");
|
|
74292
|
+
const sanitized = snapshotValue(parsed, resolvedPath, depth);
|
|
74293
|
+
const snapshotPath = path$1$1.join(input.snapshotDirectory, `adopted-${snapshots.size}.json`);
|
|
74294
|
+
fs$1$2.writeFileSync(snapshotPath, JSON.stringify(sanitized), {
|
|
74295
|
+
flag: "wx",
|
|
74296
|
+
mode: 384
|
|
74297
|
+
});
|
|
74298
|
+
snapshots.set(resolvedPath, snapshotPath);
|
|
74299
|
+
expandedFileCounts.set(resolvedPath, expandedFileCount - previousFileCount);
|
|
74300
|
+
return snapshotPath;
|
|
74301
|
+
} finally {
|
|
74302
|
+
activePaths.delete(resolvedPath);
|
|
74303
|
+
}
|
|
74304
|
+
};
|
|
74305
|
+
const snapshotValue = (value, configPath, depth) => {
|
|
74306
|
+
if (depth > 32) throw new Error("Adopted lint config too deep");
|
|
74307
|
+
if (Array.isArray(value)) return value.map((entry) => snapshotValue(entry, configPath, depth + 1));
|
|
74308
|
+
if (!isPlainObject(value)) return value;
|
|
74309
|
+
if (Object.hasOwn(value, "jsPlugins")) throw new Error("Executable adopted lint config");
|
|
74310
|
+
return Object.fromEntries(Object.entries(value).map(([key, entry]) => {
|
|
74311
|
+
if (key !== "extends") return [key, snapshotValue(entry, configPath, depth + 1)];
|
|
74312
|
+
return [key, (Array.isArray(entry) ? entry : [entry]).map((extendedPath) => {
|
|
74313
|
+
if (typeof extendedPath !== "string") throw new Error("Invalid lint config extends");
|
|
74314
|
+
return snapshotConfig(path$1$1.resolve(path$1$1.dirname(configPath), extendedPath), depth + 1);
|
|
74315
|
+
})];
|
|
74316
|
+
}));
|
|
74317
|
+
};
|
|
74318
|
+
return input.configPaths.flatMap((configPath) => {
|
|
74319
|
+
try {
|
|
74320
|
+
if (!isPathInsideDirectory(configPath, sourceBoundaryDirectory)) return [];
|
|
74321
|
+
return [snapshotConfig(path$1$1.join(boundaryDirectory, path$1$1.relative(sourceBoundaryDirectory, configPath)), 0)];
|
|
74322
|
+
} catch {
|
|
74323
|
+
return [];
|
|
74324
|
+
}
|
|
74325
|
+
});
|
|
74326
|
+
};
|
|
74204
74327
|
const readAdoptedLintConfigSettings = (configPaths) => {
|
|
74205
74328
|
const mergedSettings = /* @__PURE__ */ new Map();
|
|
74206
74329
|
for (const configPath of configPaths) {
|
|
@@ -74228,6 +74351,7 @@ const getBackupPath = (rootDirectory, absolutePath) => {
|
|
|
74228
74351
|
};
|
|
74229
74352
|
const removeBackupRootIfEmpty = (rootDirectory) => {
|
|
74230
74353
|
const backupRootDirectory = getBackupRootDirectory(rootDirectory);
|
|
74354
|
+
if (!isSymlinkFreePath(backupRootDirectory, rootDirectory)) return;
|
|
74231
74355
|
if (!walkSourceTreeFiles(backupRootDirectory).next().done) return;
|
|
74232
74356
|
fs$1$2.rmSync(backupRootDirectory, {
|
|
74233
74357
|
recursive: true,
|
|
@@ -74328,8 +74452,13 @@ const collectNeutralizationCandidatePaths = (rootDirectory, discoveredRelativePa
|
|
|
74328
74452
|
const recoverOrphanedBackups = (rootDirectory) => {
|
|
74329
74453
|
const blockedPaths = /* @__PURE__ */ new Set();
|
|
74330
74454
|
const backupRootDirectory = getBackupRootDirectory(rootDirectory);
|
|
74455
|
+
if (!isSymlinkFreePath(backupRootDirectory, rootDirectory)) return blockedPaths;
|
|
74331
74456
|
for (const { absolutePath: backupPath } of walkSourceTreeFiles(backupRootDirectory)) {
|
|
74332
74457
|
const originalPath = path$1$1.join(rootDirectory, path$1$1.relative(backupRootDirectory, backupPath));
|
|
74458
|
+
if (!isSymlinkFreePath(backupPath, rootDirectory) || !isSymlinkFreePath(originalPath, rootDirectory)) {
|
|
74459
|
+
blockedPaths.add(originalPath);
|
|
74460
|
+
continue;
|
|
74461
|
+
}
|
|
74333
74462
|
if (neutralizedFileLeases.has(originalPath)) continue;
|
|
74334
74463
|
let backupContent;
|
|
74335
74464
|
let currentContent;
|
|
@@ -74380,6 +74509,7 @@ const neutralizeDisableDirectives = async (rootDirectory, includePaths, options
|
|
|
74380
74509
|
lease.referenceCount -= 1;
|
|
74381
74510
|
if (lease.referenceCount > 0) continue;
|
|
74382
74511
|
neutralizedFileLeases.delete(absolutePath);
|
|
74512
|
+
if (!isSymlinkFreePath(absolutePath, lease.rootDirectory) || !isSymlinkFreePath(lease.backupPath, lease.rootDirectory)) continue;
|
|
74383
74513
|
try {
|
|
74384
74514
|
const currentContent = fs$1$2.readFileSync(absolutePath, "utf-8");
|
|
74385
74515
|
if (currentContent !== lease.neutralizedContent && currentContent !== lease.originalContent) {
|
|
@@ -74397,6 +74527,7 @@ const neutralizeDisableDirectives = async (rootDirectory, includePaths, options
|
|
|
74397
74527
|
const onExit = () => restore();
|
|
74398
74528
|
process.once("exit", onExit);
|
|
74399
74529
|
const leaseCandidatePath = (absolutePath) => {
|
|
74530
|
+
if (!isSymlinkFreePath(absolutePath, resolvedRootDirectory)) return;
|
|
74400
74531
|
if (leasedPaths.has(absolutePath)) return;
|
|
74401
74532
|
if (blockedPaths.has(absolutePath)) return;
|
|
74402
74533
|
const existingLease = neutralizedFileLeases.get(absolutePath);
|
|
@@ -74414,7 +74545,7 @@ const neutralizeDisableDirectives = async (rootDirectory, includePaths, options
|
|
|
74414
74545
|
const neutralizedContent = neutralizeContent(originalContent);
|
|
74415
74546
|
if (neutralizedContent !== originalContent) {
|
|
74416
74547
|
const backupPath = getBackupPath(resolvedRootDirectory, absolutePath);
|
|
74417
|
-
if (backupPath === null) return;
|
|
74548
|
+
if (backupPath === null || !isSymlinkFreePath(backupPath, resolvedRootDirectory)) return;
|
|
74418
74549
|
try {
|
|
74419
74550
|
fs$1$2.mkdirSync(path$1$1.dirname(backupPath), { recursive: true });
|
|
74420
74551
|
fs$1$2.writeFileSync(backupPath, originalContent, { flag: "wx" });
|
|
@@ -74424,6 +74555,7 @@ const neutralizeDisableDirectives = async (rootDirectory, includePaths, options
|
|
|
74424
74555
|
}
|
|
74425
74556
|
fs$1$2.writeFileSync(absolutePath, neutralizedContent);
|
|
74426
74557
|
neutralizedFileLeases.set(absolutePath, {
|
|
74558
|
+
rootDirectory: resolvedRootDirectory,
|
|
74427
74559
|
backupPath,
|
|
74428
74560
|
originalContent,
|
|
74429
74561
|
neutralizedContent,
|
|
@@ -74462,7 +74594,13 @@ const normalizeConfigForHash = (config) => {
|
|
|
74462
74594
|
if (Array.isArray(clone?.jsPlugins)) clone.jsPlugins = clone.jsPlugins.map((_, index) => `<plugin:${index}>`);
|
|
74463
74595
|
return clone;
|
|
74464
74596
|
};
|
|
74465
|
-
const computeRulesetHash = (input) => crypto.createHash("sha1").update(
|
|
74597
|
+
const computeRulesetHash = (input) => crypto.createHash("sha1").update("project-bulk-suppressions-isolated\0").update(JSON.stringify([
|
|
74598
|
+
normalizeConfigForHash(input.config),
|
|
74599
|
+
input.toolchainVersions,
|
|
74600
|
+
input.ignorePatterns,
|
|
74601
|
+
input.tsconfigContent,
|
|
74602
|
+
input.respectInlineDisables
|
|
74603
|
+
])).digest("hex");
|
|
74466
74604
|
/**
|
|
74467
74605
|
* Loads a plugin module via the local require resolver and extracts
|
|
74468
74606
|
* `(name, ruleNames)` from either `module.exports.meta + rules` or
|
|
@@ -76611,35 +76749,64 @@ const spawnLintBatches = async (input) => {
|
|
|
76611
76749
|
batchState.deadlineSkippedFileCount += batch.length;
|
|
76612
76750
|
return [];
|
|
76613
76751
|
}
|
|
76614
|
-
const batchArgs = [
|
|
76752
|
+
const batchArgs = [
|
|
76753
|
+
...baseArgs,
|
|
76754
|
+
"--",
|
|
76755
|
+
...batch
|
|
76756
|
+
];
|
|
76615
76757
|
try {
|
|
76616
|
-
const spawnBatch = () => {
|
|
76758
|
+
const spawnBatch = async () => {
|
|
76617
76759
|
const effectiveSpawnTimeoutMs = resolveSpawnTimeoutMs();
|
|
76618
76760
|
if (effectiveSpawnTimeoutMs === 0) {
|
|
76619
76761
|
deadlineSkippedFiles.push(...batch);
|
|
76620
76762
|
batchState.deadlineSkippedFileCount += batch.length;
|
|
76621
|
-
return
|
|
76763
|
+
return null;
|
|
76764
|
+
}
|
|
76765
|
+
const onStart = () => {
|
|
76766
|
+
if (batchState.didStart) return;
|
|
76767
|
+
batchState.didStart = true;
|
|
76768
|
+
startedFileCount += batchState.initialFileCount;
|
|
76769
|
+
reportBatchStarted(passBatches.length);
|
|
76770
|
+
};
|
|
76771
|
+
let argumentsList = batchArgs;
|
|
76772
|
+
if (input.workingDirectory !== void 0) {
|
|
76773
|
+
const selectedFiles = (await spawnOxlint([
|
|
76774
|
+
...baseArgs,
|
|
76775
|
+
"--debug",
|
|
76776
|
+
"files",
|
|
76777
|
+
...batch
|
|
76778
|
+
], rootDirectory, nodeBinaryPath, effectiveSpawnTimeoutMs, outputMaxBytes, signal, onStart)).split(/\r?\n/).filter(Boolean).map((filePath) => path$1$1.resolve(rootDirectory, filePath));
|
|
76779
|
+
if (selectedFiles.length === 0) return JSON.stringify({ diagnostics: [] });
|
|
76780
|
+
argumentsList = [
|
|
76781
|
+
...baseArgs,
|
|
76782
|
+
"--no-ignore",
|
|
76783
|
+
...selectedFiles
|
|
76784
|
+
];
|
|
76622
76785
|
}
|
|
76623
76786
|
return runOxlintJob({
|
|
76624
|
-
argumentsList
|
|
76625
|
-
rootDirectory,
|
|
76787
|
+
argumentsList,
|
|
76788
|
+
rootDirectory: input.workingDirectory ?? rootDirectory,
|
|
76626
76789
|
nodeBinaryPath,
|
|
76627
76790
|
spawnTimeoutMs: effectiveSpawnTimeoutMs ?? 6e4,
|
|
76628
76791
|
outputMaxBytes: outputMaxBytes ?? 52428800,
|
|
76629
76792
|
maxWorkers: requestedConcurrency,
|
|
76630
76793
|
filesystemCacheEpoch: input.spawnSlots?.filesystemCacheEpoch ?? null,
|
|
76631
76794
|
abortSignal: signal,
|
|
76632
|
-
onStart
|
|
76633
|
-
if (batchState.didStart) return;
|
|
76634
|
-
batchState.didStart = true;
|
|
76635
|
-
startedFileCount += batchState.initialFileCount;
|
|
76636
|
-
reportBatchStarted(passBatches.length);
|
|
76637
|
-
}
|
|
76795
|
+
onStart
|
|
76638
76796
|
});
|
|
76639
76797
|
};
|
|
76640
76798
|
const stdout = input.spawnSlots === void 0 ? await spawnBatch() : await input.spawnSlots.run(spawnBatch, signal);
|
|
76641
76799
|
if (stdout === null) return [];
|
|
76642
|
-
|
|
76800
|
+
const diagnostics = parseOxlintOutput(stdout, project, rootDirectory, sourcePathByLintPath, sourceMapByLintPath, input.diagnosticContextDirectory);
|
|
76801
|
+
if (input.workingDirectory === void 0) return diagnostics;
|
|
76802
|
+
return diagnostics.map((diagnostic) => ({
|
|
76803
|
+
...diagnostic,
|
|
76804
|
+
filePath: toNormalizedRelativePath(diagnostic.filePath, rootDirectory),
|
|
76805
|
+
...diagnostic.relatedLocations ? { relatedLocations: diagnostic.relatedLocations.map((location) => ({
|
|
76806
|
+
...location,
|
|
76807
|
+
filePath: toNormalizedRelativePath(location.filePath, rootDirectory)
|
|
76808
|
+
})) } : {}
|
|
76809
|
+
}));
|
|
76643
76810
|
} catch (error) {
|
|
76644
76811
|
if (!isSplittableReactDoctorError(error)) throw error;
|
|
76645
76812
|
if (isPastDeadline()) {
|
|
@@ -77361,13 +77528,19 @@ const runOxlint = async (options) => {
|
|
|
77361
77528
|
}
|
|
77362
77529
|
const pluginPath = resolvePluginPath();
|
|
77363
77530
|
const detectedConfigPaths = adoptExistingLintConfig && !customRulesOnly ? detectUserLintConfigPaths(rootDirectory) : [];
|
|
77364
|
-
const
|
|
77531
|
+
const adoptableConfigPaths = detectedConfigPaths.filter(canOxlintExtendConfig);
|
|
77365
77532
|
const adoptedSettings = detectedConfigPaths.length > 0 ? readAdoptedLintConfigSettings(detectedConfigPaths) : {};
|
|
77366
77533
|
const userPlugins = includedTags.size > 0 ? [] : resolveUserPlugins(userConfig?.plugins, configSourceDirectory);
|
|
77367
77534
|
const restoreDisableDirectives = await neutralizeDisableDirectives(rootDirectory, includePaths ?? options.precomputedSourceFiles?.map((sourceFile) => sourceFile.path), { recoverOnly: respectInlineDisables });
|
|
77368
77535
|
const configDirectory = fs$1$2.mkdtempSync(path$1$1.join(os.tmpdir(), "react-doctor-oxlintrc-"));
|
|
77369
77536
|
const configPath = path$1$1.join(configDirectory, "oxlintrc.json");
|
|
77537
|
+
const workingDirectory = fs$1$2.existsSync(path$1$1.join(rootDirectory, "oxlint-suppressions.json")) ? configDirectory : void 0;
|
|
77370
77538
|
try {
|
|
77539
|
+
const extendsPaths = snapshotAdoptedLintConfigs({
|
|
77540
|
+
configPaths: adoptableConfigPaths,
|
|
77541
|
+
rootDirectory,
|
|
77542
|
+
snapshotDirectory: configDirectory
|
|
77543
|
+
});
|
|
77371
77544
|
const diagnosticContextDirectory = path$1$1.join(configDirectory, "contexts");
|
|
77372
77545
|
fs$1$2.mkdirSync(diagnosticContextDirectory);
|
|
77373
77546
|
const oxlintBinary = resolveOxlintBinary();
|
|
@@ -77376,7 +77549,7 @@ const runOxlint = async (options) => {
|
|
|
77376
77549
|
if (project.hasTypeScript) {
|
|
77377
77550
|
const tsconfigRelativePath = resolveTsConfigRelativePath(rootDirectory);
|
|
77378
77551
|
if (tsconfigRelativePath) {
|
|
77379
|
-
sharedArgs.push("--tsconfig", tsconfigRelativePath);
|
|
77552
|
+
sharedArgs.push("--tsconfig", path$1$1.resolve(rootDirectory, tsconfigRelativePath));
|
|
77380
77553
|
try {
|
|
77381
77554
|
tsconfigContent = fs$1$2.readFileSync(path$1$1.resolve(rootDirectory, tsconfigRelativePath), "utf8");
|
|
77382
77555
|
} catch {
|
|
@@ -77465,6 +77638,7 @@ const runOxlint = async (options) => {
|
|
|
77465
77638
|
return spawnLintBatches({
|
|
77466
77639
|
baseArgs: passBaseArgs,
|
|
77467
77640
|
fileBatches: passFileBatches,
|
|
77641
|
+
workingDirectory,
|
|
77468
77642
|
rootDirectory,
|
|
77469
77643
|
nodeBinaryPath,
|
|
77470
77644
|
project: lintProject,
|
|
@@ -77693,6 +77867,7 @@ const runOxlint = async (options) => {
|
|
|
77693
77867
|
const runBatches = () => spawnLintBatches({
|
|
77694
77868
|
baseArgs,
|
|
77695
77869
|
fileBatches,
|
|
77870
|
+
workingDirectory,
|
|
77696
77871
|
rootDirectory,
|
|
77697
77872
|
nodeBinaryPath,
|
|
77698
77873
|
project: lintProject,
|
|
@@ -78684,7 +78859,8 @@ const runInspect = (input, hooks = {}) => gen(function* () {
|
|
|
78684
78859
|
return filteredDiagnostic === null ? none() : some(filteredDiagnostic);
|
|
78685
78860
|
})));
|
|
78686
78861
|
const applyPerElementPipeline = (rawStream) => filterPerElementPipeline(rawStream).pipe(tap((diagnostic) => reporterService.emit(diagnostic)));
|
|
78687
|
-
const
|
|
78862
|
+
const severityControls = buildRuleSeverityControls(resolvedConfig.config);
|
|
78863
|
+
const pnpmHardeningSeverity = resolveRuleSeverityOverride({ ruleKey: "react-doctor/require-pnpm-hardening" }, severityControls);
|
|
78688
78864
|
const envCollected = yield* runCollect(applyPerElementPipeline(fromIterable$1(isDiffMode ? [] : [
|
|
78689
78865
|
...checkReducedMotion(scanDirectory),
|
|
78690
78866
|
...pnpmHardeningSeverity === "warn" || pnpmHardeningSeverity === "error" ? checkPnpmHardening(scanDirectory) : [],
|
|
@@ -78696,6 +78872,7 @@ const runInspect = (input, hooks = {}) => gen(function* () {
|
|
|
78696
78872
|
let didSecurityScanReachDeadline = false;
|
|
78697
78873
|
const securityScanFiber = yield* forkChild(runCollect(applyPerElementPipeline(isDiffMode ? empty$4 : unwrap(tryPromise((signal) => checkSecurityScanCooperative(scanDirectory, {
|
|
78698
78874
|
project,
|
|
78875
|
+
severityControls,
|
|
78699
78876
|
ignoredTags: input.ignoredTags,
|
|
78700
78877
|
includedTags: input.includedTags,
|
|
78701
78878
|
includeTagDefaults: input.includeTagDefaults,
|
|
@@ -78743,7 +78920,7 @@ const runInspect = (input, hooks = {}) => gen(function* () {
|
|
|
78743
78920
|
const maintainabilityPhaseTimeoutMs = yield* DeadCodePhaseTimeoutMs;
|
|
78744
78921
|
const workerCountSuffix = scanConcurrency > 1 ? ` ${highlighter.dim(`[~${scanConcurrency} workers]`)}` : "";
|
|
78745
78922
|
const projectCapabilities = getCapabilities(project);
|
|
78746
|
-
const projectRuleSelections = resolveProjectRuleSelections(
|
|
78923
|
+
const projectRuleSelections = resolveProjectRuleSelections(severityControls).filter((selection) => {
|
|
78747
78924
|
const rule = REACT_DOCTOR_RULE_REGISTRY[selection.ruleId];
|
|
78748
78925
|
return rule !== void 0 && shouldEnableRule(rule.requires, rule.tags, projectCapabilities, input.ignoredTags, rule.disabledWhen, input.includedTags) && (selection.ruleId === "duplicate-jsx-subtree" ? input.runDeadCode : !isDiffMode) && (showWarnings || projectRuleSelectionsMaySurfaceWhenWarningsAreHidden([selection]));
|
|
78749
78926
|
});
|
|
@@ -79750,4 +79927,4 @@ const toJsonReport = (result, options) => buildJsonReport({
|
|
|
79750
79927
|
export { AmbiguousProjectError, NoReactDependencyError, NotADirectoryError, PackageJsonNotFoundError, ProjectNotFoundError, ReactDoctorError, buildJsonReport, buildJsonReportError, clearCaches, defineConfig, diagnose, filterSourceFiles, getDiffInfo, hasReactRuntime, isProjectDiscoveryError, isReactDoctorError, summarizeDiagnostics, toJsonReport };
|
|
79751
79928
|
|
|
79752
79929
|
//# sourceMappingURL=index.js.map
|
|
79753
|
-
//# debugId=
|
|
79930
|
+
//# debugId=5255a206-f2ac-51fa-9a2f-9480ba58e9d7
|
|
@@ -1,19 +1,19 @@
|
|
|
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]="
|
|
3
|
-
import { N as discardPrefetchedGitCommands,
|
|
4
|
-
import {
|
|
5
|
-
import { n as shutdownTelemetry, o as isExpectedUserError, r as flushSentry } from "./telemetry-runtime-
|
|
6
|
-
import { n as handleUserError, t as handleError } from "./handle-error-
|
|
7
|
-
import { t as reportErrorToSentry } from "./report-error-
|
|
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]="70e0026e-0b5f-5b95-bafe-20ff54e5f7a5")}catch(e){}}();
|
|
3
|
+
import { N as discardPrefetchedGitCommands, Sn as STAGED_FILES_PROJECT_CONFIG_FILENAMES, T as STAGED_SNAPSHOT_ADDITIONAL_CONFIG_FILENAMES, u as METRIC, ut as CANONICAL_GITHUB_URL, w as STAGED_FILES_TEMP_DIR_PREFIX } from "./constants-BmD_c3Yq.js";
|
|
4
|
+
import { Ct as getChangedLineRanges, D as isCodingAgentEnvironment, E as isCiOrCodingAgentEnvironment, Ht as listWorkspacePackages, Jt as remainingDeadlineBudgetMs, K as StagedFiles, Kn as isPlainObject, Mn as provide, Nt as highlighter, S as isDebugFlagEnabled, Sn as provide$1, St as getBaselineDiffPlan, Tn as runPromise, Tt as getDiffInfo, Vn as messageFromUnknown, Wn as isErrnoException, Wt as mapWithConcurrency, Z as buildJsonReport, Zt as resolveScanTarget, _ as VERSION, _n as gen, f as setJsonReportDirectory, ft as detectAiTrainingEnvironment, g as writeJsonReport, h as writeJsonErrorReport, hn as decodeUnknownSync, in as toRelativePath, j as Git, jt as hasSupportedFrameworkOrLibrary, mn as JsonReport, n as recordDistribution, p as setJsonReportMode, pt as discoverSupportedSubprojects, t as recordCount, u as enableJsonMode, vt as findLegacyConfig, y as CliInputError } from "./record-metric-CWxS2npr.js";
|
|
5
|
+
import { n as shutdownTelemetry, o as isExpectedUserError, r as flushSentry } from "./telemetry-runtime-De9QafWu.js";
|
|
6
|
+
import { n as handleUserError, t as handleError } from "./handle-error-BJ_4E2kS.js";
|
|
7
|
+
import { t as reportErrorToSentry } from "./report-error-DA8uMulb.js";
|
|
8
8
|
import { t as toForwardSlashes } from "./path-format-By20mo8A.js";
|
|
9
|
-
import { N as cliLogger, c as spinner, i as hasDoctorScript, j as runGitRaw, k as runGit, n as findNearestPackageDirectory, o as isSpinnerSilent, s as setSpinnerSilent } from "./install-doctor-script-
|
|
10
|
-
import { a as readReactDoctorWorkflow, c as workflowUsesV1Action, i as isReactDoctorWorkflowInstalled, l as prompts, s as upgradeWorkflowActionToV2 } from "./install-github-workflow-
|
|
11
|
-
import { c as openWorkflowPullRequest, i as warnDeprecatedDiff, l as stageWorkflowFile, r as resolveScope, s as resolveBlockingLevel, t as finalizeScope } from "./resolve-scope-
|
|
12
|
-
import { t as shouldSkipPrompts } from "./should-skip-prompts-
|
|
13
|
-
import { A as createInvocationInspect, C as detectLaunchableAgents, D as buildHandoffPayload, E as launchCliAgent, M as resolveMergeBaseRef, N as printHeadlessReport, O as collectProjectSourceFiles, R as printDiagnosticsDump, S as setUpGitHubActions, T as copyToClipboard, U as buildEmptyReportMessage, V as filterDiagnosticsByCategories, W as resolveInvocationOxlintConcurrency, _ as retryMissingProjectScores, a as validateModeFlags, b as filterScansForSurface, c as partitionProjectScanOutcomes, d as buildCodeFrame, f as resolveProjectScan, g as resolveProjectRelativeDirectory, h as resolveProjectSourceFilePaths, i as validateIncludeUntrackedScope, j as inspect, k as deduplicateProjectScans, l as discoverWorkspacePackages, m as resolveProjectDiffIncludePaths, n as formatSkippedProjectsMessage, o as resolveExcludedProjectDirectories, p as resolveProjectChangedLineRanges, s as projectManifestChanged, t as resolveScanExitCode, u as selectProjects, v as resolveWorkspaceDeadCodeOwner, w as CLI_AGENT_BINARIES, x as countUniqueScannedFiles, y as resolveCliInspectOptions } from "./resolve-scan-exit-code-
|
|
14
|
-
import { a as recordGate, g as loadAgentInstall, i as readPreference, o as runMigrations, p as SETUP_HINT_EVENT, r as isGatePending, s as writePreference, u as HANDOFF_TARGET_PREFERENCE_ID } from "./report-workflow-result-
|
|
15
|
-
import { a as askUpgradeActionVersion, c as recordCiPromptDecision, i as installReactDoctorAgentHooks, l as hasHandledActionUpgrade, o as askAddToGitHubActions, r as findAgentsWithOutdatedReactDoctorHooks, s as hasHandledCiPrompt, t as getSkillSourceDirectory, u as recordActionUpgradeDecision } from "./install-react-doctor-
|
|
16
|
-
import { t as readObjectFile } from "./read-object-file-
|
|
9
|
+
import { N as cliLogger, c as spinner, i as hasDoctorScript, j as runGitRaw, k as runGit, n as findNearestPackageDirectory, o as isSpinnerSilent, s as setSpinnerSilent } from "./install-doctor-script-DJ6UbhZJ.js";
|
|
10
|
+
import { a as readReactDoctorWorkflow, c as workflowUsesV1Action, i as isReactDoctorWorkflowInstalled, l as prompts, s as upgradeWorkflowActionToV2 } from "./install-github-workflow-BNRbJHjd.js";
|
|
11
|
+
import { c as openWorkflowPullRequest, i as warnDeprecatedDiff, l as stageWorkflowFile, r as resolveScope, s as resolveBlockingLevel, t as finalizeScope } from "./resolve-scope-B3xmSQ0a.js";
|
|
12
|
+
import { t as shouldSkipPrompts } from "./should-skip-prompts-CDudIC40.js";
|
|
13
|
+
import { A as createInvocationInspect, C as detectLaunchableAgents, D as buildHandoffPayload, E as launchCliAgent, M as resolveMergeBaseRef, N as printHeadlessReport, O as collectProjectSourceFiles, R as printDiagnosticsDump, S as setUpGitHubActions, T as copyToClipboard, U as buildEmptyReportMessage, V as filterDiagnosticsByCategories, W as resolveInvocationOxlintConcurrency, _ as retryMissingProjectScores, a as validateModeFlags, b as filterScansForSurface, c as partitionProjectScanOutcomes, d as buildCodeFrame, f as resolveProjectScan, g as resolveProjectRelativeDirectory, h as resolveProjectSourceFilePaths, i as validateIncludeUntrackedScope, j as inspect, k as deduplicateProjectScans, l as discoverWorkspacePackages, m as resolveProjectDiffIncludePaths, n as formatSkippedProjectsMessage, o as resolveExcludedProjectDirectories, p as resolveProjectChangedLineRanges, s as projectManifestChanged, t as resolveScanExitCode, u as selectProjects, v as resolveWorkspaceDeadCodeOwner, w as CLI_AGENT_BINARIES, x as countUniqueScannedFiles, y as resolveCliInspectOptions } from "./resolve-scan-exit-code-DE6AIQwU.js";
|
|
14
|
+
import { a as recordGate, g as loadAgentInstall, i as readPreference, o as runMigrations, p as SETUP_HINT_EVENT, r as isGatePending, s as writePreference, u as HANDOFF_TARGET_PREFERENCE_ID } from "./report-workflow-result-D6NNwRMm.js";
|
|
15
|
+
import { a as askUpgradeActionVersion, c as recordCiPromptDecision, i as installReactDoctorAgentHooks, l as hasHandledActionUpgrade, o as askAddToGitHubActions, r as findAgentsWithOutdatedReactDoctorHooks, s as hasHandledCiPrompt, t as getSkillSourceDirectory, u as recordActionUpgradeDecision } from "./install-react-doctor-BcsOSw5y.js";
|
|
16
|
+
import { t as readObjectFile } from "./read-object-file-D3pRnLyV.js";
|
|
17
17
|
import * as fs$1 from "node:fs";
|
|
18
18
|
import fs from "node:fs";
|
|
19
19
|
import * as path$1 from "node:path";
|
|
@@ -1528,5 +1528,5 @@ const inspectAction = async (directory, flags, invocationCommand = "inspect", se
|
|
|
1528
1528
|
//#endregion
|
|
1529
1529
|
export { warnDeprecatedFailOn as n, runProjectMigrations as r, inspectAction as t };
|
|
1530
1530
|
|
|
1531
|
-
//# sourceMappingURL=inspect-
|
|
1532
|
-
//# debugId=
|
|
1531
|
+
//# sourceMappingURL=inspect-BuLr42QI.js.map
|
|
1532
|
+
//# debugId=70e0026e-0b5f-5b95-bafe-20ff54e5f7a5
|
|
@@ -1,12 +1,12 @@
|
|
|
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]="
|
|
3
|
-
import { u as METRIC } from "./constants-
|
|
4
|
-
import {
|
|
5
|
-
import { o as isExpectedUserError } from "./telemetry-runtime-
|
|
6
|
-
import { n as handleUserError, t as handleError } from "./handle-error-
|
|
7
|
-
import { t as reportErrorToSentry } from "./report-error-
|
|
8
|
-
import { t as printBrandedHeader } from "./print-branded-header-
|
|
9
|
-
import { n as runInstallReactDoctor } from "./install-react-doctor-
|
|
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]="f4321b72-9cf9-5f93-af58-c76bd3013bd4")}catch(e){}}();
|
|
3
|
+
import { u as METRIC } from "./constants-BmD_c3Yq.js";
|
|
4
|
+
import { En as runSync, t as recordCount } from "./record-metric-CWxS2npr.js";
|
|
5
|
+
import { o as isExpectedUserError } from "./telemetry-runtime-De9QafWu.js";
|
|
6
|
+
import { n as handleUserError, t as handleError } from "./handle-error-BJ_4E2kS.js";
|
|
7
|
+
import { t as reportErrorToSentry } from "./report-error-DA8uMulb.js";
|
|
8
|
+
import { t as printBrandedHeader } from "./print-branded-header-BFh1P9t6.js";
|
|
9
|
+
import { n as runInstallReactDoctor } from "./install-react-doctor-BcsOSw5y.js";
|
|
10
10
|
//#region src/cli/commands/install.ts
|
|
11
11
|
const installAction = async (options, command) => {
|
|
12
12
|
recordCount(METRIC.cliInvoked, 1, { command: "install" });
|
|
@@ -30,5 +30,5 @@ const installAction = async (options, command) => {
|
|
|
30
30
|
//#endregion
|
|
31
31
|
export { installAction };
|
|
32
32
|
|
|
33
|
-
//# sourceMappingURL=install-
|
|
34
|
-
//# debugId=
|
|
33
|
+
//# sourceMappingURL=install-DsuiRD1t.js.map
|
|
34
|
+
//# debugId=f4321b72-9cf9-5f93-af58-c76bd3013bd4
|