react-doctor 0.9.22 → 0.9.23-dev.190b5b6
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-BU7zNHk5.js} +5 -5
- package/dist/{ci-BWu53Ijl.js → ci-CxQu6pYP.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-C34SZKwj.js} +4 -4
- package/dist/duplicate-jsx-worker.js +17 -10
- package/dist/{exit-gracefully-BMgB2pVu.js → exit-gracefully-CkEQoYgZ.js} +6 -6
- package/dist/{handle-error-CoIUQwLf.js → handle-error-BzkQHg93.js} +6 -6
- package/dist/index.d.ts +5 -2
- package/dist/index.js +217 -40
- package/dist/{inspect-D4QLdCtm.js → inspect-hnNj6rGU.js} +16 -16
- package/dist/{install-R6-fv9t4.js → install-Phi-3Ez6.js} +10 -10
- package/dist/{install-doctor-script-D9-Bdbx6.js → install-doctor-script-_STqoxaF.js} +5 -5
- package/dist/{install-github-workflow-B01vSPPa.js → install-github-workflow-CrKVCl4g.js} +6 -6
- package/dist/{install-react-doctor-DZnPIaiY.js → install-react-doctor-B8HIm5Lp.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-DiY2NpiM.js} +6 -6
- package/dist/oxlint-worker.js +1 -1
- package/dist/{print-branded-header-BegpykMJ.js → print-branded-header-FknctS29.js} +4 -4
- package/dist/project-analysis-worker.js +1 -1
- package/dist/{prompt-runtime-scan-url-OIHMChS6.js → prompt-runtime-scan-url-DlatGgXM.js} +5 -5
- package/dist/{read-object-file-Bd06Y-EV.js → read-object-file-DHewkQSw.js} +4 -4
- package/dist/{record-metric-5SPbuLyj.js → record-metric-vW6WPfqn.js} +202 -42
- package/dist/{report-error-DayUUIc-.js → report-error-BjXxJDFZ.js} +6 -6
- package/dist/{report-workflow-result-tdrT9lW-.js → report-workflow-result-CDrgxyIL.js} +6 -6
- package/dist/{resolve-scan-exit-code-DWrr-Xuv.js → resolve-scan-exit-code-C-YB4nGN.js} +41 -30
- package/dist/{resolve-scope-OdFJKZGv.js → resolve-scope-C0FwbRLp.js} +6 -6
- package/dist/{rules-DNgtXPXx.js → rules-C6snQ3OR.js} +7 -7
- package/dist/{run-scan-app-COJWBnqC.js → run-scan-app-_LByQegJ.js} +11 -11
- package/dist/{runtime-scan-CkpS56h8.js → runtime-scan-Ccac6VQX.js} +10 -10
- package/dist/{sanitize-runtime-url-fwyTS789.js → sanitize-runtime-url-DtyYWhiJ.js} +4 -4
- package/dist/{scan-iZF-ydER.js → scan-Dh42XoyC.js} +10 -10
- package/dist/{should-skip-prompts-BvvlROWq.js → should-skip-prompts-DTeGXHCQ.js} +4 -4
- package/dist/{should-use-tui-BjzxYIbC.js → should-use-tui-BVBFFxIp.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-ChQH6lX-.js} +13 -7
- package/dist/{version-BasyRE1W.js → version-D4xkODb4.js} +5 -5
- package/dist/{why-ni8gAKZe.js → why-CSKd9jLA.js} +4 -4
- package/dist/{with-run-span-eDYTicUo.js → with-run-span-DurLMv1A.js} +6 -6
- package/package.json +4 -4
|
@@ -1,7 +1,7 @@
|
|
|
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]="860e2d53-ec55-529b-a297-6f138d750c5d")}catch(e){}}();
|
|
3
3
|
import { i as __toESM, r as __require, t as __commonJSMin } from "./chunk-ChKA3wi6.js";
|
|
4
|
-
import { $ as warmReactCompilerDetection, $t as
|
|
4
|
+
import { $ as warmReactCompilerDetection, $t as OXLINT_SPLIT_TOTAL_BUDGET_MS, A as buildGitSourceListingRequest, An as TAILWIND_POSTCSS7_COMPAT_ALIAS, B as resolveGitCommand, Bt as MAINTAINABILITY_CATEGORY, Cn as SUPPLY_CHAIN_CACHE_SUBDIR, Dn as SUPPLY_CHAIN_OVERLAP_TIMEOUT_MS, Dt as FILE_LINT_CACHE_MAX_FILE_COUNT, En as SUPPLY_CHAIN_IGNORED_PACKAGES, Et as FILE_LINT_CACHE_FILENAME, F as lowerChildProcessPriority, Fn as TYPESCRIPT_DECLARATION_FILE_PATTERN, Ft as GIT_SOURCE_LISTING_ARGUMENTS, G as resolvePluginPath, Gt as MILLISECONDS_PER_SECOND, H as resolveOxlintThreadCount, Ht as MAINTAINABILITY_PLUGIN, In as VERCEL_NEXTJS_SECURITY_RELEASE_URL, It as HTML_FILE_PATTERN, J as resolveTsConfigRelativePath, Jt as OXLINT_IGNORED_DECLARATION_DIAGNOSTIC_CODES, K as resolveReactDoctorCacheDir, Kt as MINIFIED_SNIFF_BYTES, Lt as IGNORED_DIRECTORIES, M as buildOxlintWorkerSpawnSpec, Mn as TELEMETRY_EXPORT_INTERVAL_MS, Mt as GIT_CHECK_ATTR_MAX_BUFFER_BYTES, Nn as TELEMETRY_SHUTDOWN_TIMEOUT_MS, Nt as GIT_LS_FILES_MAX_BUFFER_BYTES, On as SUPPLY_CHAIN_PLUGIN, Ot as GENERATED_BUNDLE_FILE_PATTERN, P as killUnadoptedOxlintWorkers, Pn as TSCONFIG_FILENAMES, Pt as GIT_SHOW_MAX_BUFFER_BYTES, Q as takeReactCompilerDetection, Qt as OXLINT_SPAWN_TIMEOUT_MS, R as readSystemConcurrencyFacts, Rt as JSX_DUPLICATION_SOURCE_FILE_PATTERN, Sn as STAGED_FILES_PROJECT_CONFIG_FILENAMES, St as DUPLICATE_JSX_WORKER_IDLE_TIMEOUT_MS, Tn as SUPPLY_CHAIN_CATEGORY, Tt as FETCH_TIMEOUT_MS, U as resolveOxlintToolchainVersions, V as resolveOxlintBinary, Vt as MAINTAINABILITY_DUPLICATE_JSX_RULE, W as resolveOxlintWorkerRuntime, Wt as MAX_GLOB_PATTERN_LENGTH_CHARS, X as spawnOxlintWorkerProcess, Xt as OXLINT_OOM_RESCUE_BUDGET_MS, Y as setChildProcessRef, Z as takePrespawnedOxlintWorker, Zt as OXLINT_OUTPUT_MAX_BYTES, _n as SOCKET_PACKAGE_PAGE_BASE, _t as DEFAULT_BRANCH_CANDIDATES, an as REACT_BLOG_RSC_ADVISORY_URL, bn as SPAWN_ARGS_MAX_LENGTH_CHARS_DARWIN, bt as DOCS_RULES_BASE_URL, cn as RECOMMENDED_PNPM_MINIMUM_RELEASE_AGE_MINUTES, ct as AXIOM_TRACES_PATH, d as METRIC_DISTRIBUTION_BOUNDARIES, dn as SCORE_API_URL, en as OXLINT_WORKER_JOB_END_MARKER, et as ABORT_EXIT_CODES, ft as COMPILER_CLEANUP_BUCKET, gn as SOCKET_FREE_USER_AGENT, hn as SOCKET_FREE_PURL_API_BASE, ht as CONFIG_FINGERPRINT_FILENAMES, in as PROJECT_ANALYSIS_WORKER_TIMEOUT_MS, it as AXIOM_DATASET_HEADER, j as buildOxlintChildEnv, jn as TARGET_BLANK_BROWSER_SUPPORT, jt as GITHUB_VIEWER_PERMISSION_TIMEOUT_MS, kn as SUPPLY_CHAIN_RULE, kt as GENERATED_SOURCE_DIRECTORY_PATTERN, l as INTERNAL_ERROR_JSON_FALLBACK, ln as ROOT_CAUSE_GROUPABLE_RULE_KEYS, mt as CONFIG_CACHE_TTL_MS, nn as PROJECT_ANALYSIS_WORKER_MEMORY_BUDGET_BYTES, nt as ADOPTED_LINT_CONFIG_MAX_BYTES, on as REACT_ROUTER_CAPABILITY_THRESHOLDS, ot as AXIOM_METRICS_DATASET_HEADER, pn as SIDECAR_LINT_CACHE_FILENAME, pt as COMPILER_CLEANUP_RULE_KEYS, q as resolveScanConcurrency, qt as OCCURRENCE_MATCHED_CATEGORIES, rn as PROJECT_ANALYSIS_WORKER_TIMEOUT_CEILING_MS, rt as APP_ONLY_RULE_KEYS, sn as REACT_SERVER_DOM_PACKAGES, st as AXIOM_METRICS_PATH, tn as PROJECT_ANALYSIS_WORKER_MAX_OLD_SPACE_MB, tt as ADOPTABLE_LINT_CONFIG_FILENAMES, un as SCANNED_DOT_DIRECTORIES, vn as SOURCE_FILE_PATTERN, vt as DIAGNOSTIC_CATEGORY_BUCKETS, wn as SUPPLY_CHAIN_CACHE_TTL_MS, wt as ES_TARGET_YEAR_BY_NAME, xn as SPAWN_ARGS_MAX_LENGTH_CHARS_POSIX, yn as SPAWN_ARGS_MAX_LENGTH_CHARS, yt as DISABLE_DIRECTIVE_BACKUP_DIRECTORY_SEGMENTS, z as resolveConfiguredScanConcurrency } from "./constants-BmD_c3Yq.js";
|
|
5
5
|
import { n as require_picomatch, t as require_semver } from "./semver-BZIuy1gP.js";
|
|
6
6
|
import { createRequire } from "node:module";
|
|
7
7
|
import * as fs$1$2 from "node:fs";
|
|
@@ -20,7 +20,7 @@ import { Worker } from "node:worker_threads";
|
|
|
20
20
|
import { parseSync } from "oxc-parser";
|
|
21
21
|
import * as fs$1$1 from "node:fs/promises";
|
|
22
22
|
import { ResolverFactory } from "oxc-resolver";
|
|
23
|
-
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";
|
|
23
|
+
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";
|
|
24
24
|
import { parseJSON5, parseJSONC } from "confbox";
|
|
25
25
|
import { createJiti } from "jiti";
|
|
26
26
|
import { PassThrough } from "node:stream";
|
|
@@ -88,7 +88,7 @@ const unwrapTypescriptExpression = (expression) => {
|
|
|
88
88
|
return currentExpression;
|
|
89
89
|
};
|
|
90
90
|
//#endregion
|
|
91
|
-
//#region ../core/dist/collect-unplugin-auto-import-global-scopes-
|
|
91
|
+
//#region ../core/dist/collect-unplugin-auto-import-global-scopes-Z9dhela6.js
|
|
92
92
|
var import_picomatch = /* @__PURE__ */ __toESM(require_picomatch(), 1);
|
|
93
93
|
const LINGUIST_ATTRIBUTES = ["linguist-generated", "linguist-vendored"];
|
|
94
94
|
const DISABLED_ATTRIBUTE_VALUES = new Set([
|
|
@@ -526,7 +526,7 @@ const collectUnpluginAutoImportGlobalScopes = ({ rootDirectory, candidateFiles }
|
|
|
526
526
|
return scopes.some((scope) => scope.names.length > 0) ? scopes : [];
|
|
527
527
|
};
|
|
528
528
|
//#endregion
|
|
529
|
-
//#region ../core/dist/detect-duplicate-jsx-subtrees-
|
|
529
|
+
//#region ../core/dist/detect-duplicate-jsx-subtrees-B5UWtUyz.js
|
|
530
530
|
const yieldToEventLoop = () => new Promise((resolve) => {
|
|
531
531
|
setImmediate(resolve);
|
|
532
532
|
});
|
|
@@ -651,7 +651,7 @@ const resolveOptions$1 = (options) => ({
|
|
|
651
651
|
minimumDistinctFiles: options.minimumDistinctFiles ?? 1,
|
|
652
652
|
maxSourceFiles: options.budget?.maxSourceFiles ?? 5e3,
|
|
653
653
|
maxSourceLengthChars: options.budget?.maxSourceLengthChars ?? 1e6,
|
|
654
|
-
maxJsxNodes: options.budget?.maxJsxNodes ??
|
|
654
|
+
maxJsxNodes: options.budget?.maxJsxNodes ?? 5e5,
|
|
655
655
|
maxFamilies: options.budget?.maxFamilies ?? 20
|
|
656
656
|
});
|
|
657
657
|
const hashParts = (parts) => {
|
|
@@ -865,10 +865,12 @@ const collectCandidates = (source, sourceFile, signal, maximumCandidateCount) =>
|
|
|
865
865
|
const jsxNodes = [];
|
|
866
866
|
const pendingNodes = [sourceFile];
|
|
867
867
|
let limitExceeded = false;
|
|
868
|
+
let observedJsxNodeCount = 0;
|
|
868
869
|
while (pendingNodes.length > 0 && !limitExceeded && !signal?.aborted) {
|
|
869
870
|
const currentNode = pendingNodes.pop();
|
|
870
871
|
if (currentNode === void 0) continue;
|
|
871
872
|
if (isJsxSubtreeNode(currentNode)) {
|
|
873
|
+
observedJsxNodeCount += 1;
|
|
872
874
|
if (jsxNodes.length >= maximumCandidateCount) {
|
|
873
875
|
limitExceeded = true;
|
|
874
876
|
continue;
|
|
@@ -884,7 +886,8 @@ const collectCandidates = (source, sourceFile, signal, maximumCandidateCount) =>
|
|
|
884
886
|
if (limitExceeded || signal?.aborted) return {
|
|
885
887
|
candidates: [],
|
|
886
888
|
aborted: signal?.aborted ?? false,
|
|
887
|
-
limitExceeded
|
|
889
|
+
limitExceeded,
|
|
890
|
+
observedJsxNodeCount
|
|
888
891
|
};
|
|
889
892
|
const metadataByNode = /* @__PURE__ */ new Map();
|
|
890
893
|
const functionIdentityByNode = /* @__PURE__ */ new Map();
|
|
@@ -892,7 +895,8 @@ const collectCandidates = (source, sourceFile, signal, maximumCandidateCount) =>
|
|
|
892
895
|
if (signal?.aborted) return {
|
|
893
896
|
candidates: [],
|
|
894
897
|
aborted: true,
|
|
895
|
-
limitExceeded: false
|
|
898
|
+
limitExceeded: false,
|
|
899
|
+
observedJsxNodeCount
|
|
896
900
|
};
|
|
897
901
|
buildJsxSubtreeMetadata(jsxNodes[nodeIndex], metadataByNode);
|
|
898
902
|
}
|
|
@@ -910,7 +914,8 @@ const collectCandidates = (source, sourceFile, signal, maximumCandidateCount) =>
|
|
|
910
914
|
};
|
|
911
915
|
}),
|
|
912
916
|
aborted: false,
|
|
913
|
-
limitExceeded: false
|
|
917
|
+
limitExceeded: false,
|
|
918
|
+
observedJsxNodeCount
|
|
914
919
|
};
|
|
915
920
|
};
|
|
916
921
|
const scanSource = (input) => {
|
|
@@ -947,8 +952,7 @@ const scanSource = (input) => {
|
|
|
947
952
|
incompleteReason: {
|
|
948
953
|
kind: "jsx-node-limit",
|
|
949
954
|
limit: input.options.maxJsxNodes,
|
|
950
|
-
observed: input.
|
|
951
|
-
path: input.source.path
|
|
955
|
+
observed: input.scannedJsxNodeCount + collectedCandidates.observedJsxNodeCount
|
|
952
956
|
},
|
|
953
957
|
didAbort: false,
|
|
954
958
|
didScan: false
|
|
@@ -1065,7 +1069,10 @@ const detectDuplicateJsxSubtreesCooperative = async (sourceReader, options = {})
|
|
|
1065
1069
|
scannedSourceFileCount,
|
|
1066
1070
|
scannedJsxNodeCount
|
|
1067
1071
|
});
|
|
1068
|
-
if (scannedSource.incompleteReason !== null)
|
|
1072
|
+
if (scannedSource.incompleteReason !== null) {
|
|
1073
|
+
incompleteReasons.push(scannedSource.incompleteReason);
|
|
1074
|
+
if (scannedSource.incompleteReason.kind === "jsx-node-limit") break;
|
|
1075
|
+
}
|
|
1069
1076
|
if (scannedSource.didScan) {
|
|
1070
1077
|
candidates.push(...scannedSource.candidates);
|
|
1071
1078
|
scannedJsxNodeCount += scannedSource.candidates.length;
|
|
@@ -1083,7 +1090,7 @@ const detectDuplicateJsxSubtreesCooperative = async (sourceReader, options = {})
|
|
|
1083
1090
|
});
|
|
1084
1091
|
};
|
|
1085
1092
|
//#endregion
|
|
1086
|
-
//#region ../core/dist/detect-react-compiler-
|
|
1093
|
+
//#region ../core/dist/detect-react-compiler-DLpaU8gr.js
|
|
1087
1094
|
const NEXT_CONFIG_FILENAMES = [
|
|
1088
1095
|
"next.config.js",
|
|
1089
1096
|
"next.config.mjs",
|
|
@@ -65690,13 +65697,17 @@ const getBrowserslistProtectionRequirement = (directory) => {
|
|
|
65690
65697
|
env: "production"
|
|
65691
65698
|
});
|
|
65692
65699
|
if (!queries) return void 0;
|
|
65700
|
+
if ((typeof queries === "string" ? [queries] : queries).some((query) => /\b(?:extends|stats)\b|\bbrowserslist\s+config\b/i.test(query))) return;
|
|
65693
65701
|
let requirement;
|
|
65694
65702
|
let hasUnsupportedTarget = false;
|
|
65695
65703
|
const previousIgnoreOldData = process.env.BROWSERSLIST_IGNORE_OLD_DATA;
|
|
65696
65704
|
let browserTargets = [];
|
|
65697
65705
|
try {
|
|
65698
65706
|
process.env.BROWSERSLIST_IGNORE_OLD_DATA = "true";
|
|
65699
|
-
browserTargets = (0, import_browserslist.default)(queries
|
|
65707
|
+
browserTargets = (0, import_browserslist.default)(queries, {
|
|
65708
|
+
path: false,
|
|
65709
|
+
stats: {}
|
|
65710
|
+
});
|
|
65700
65711
|
} finally {
|
|
65701
65712
|
if (previousIgnoreOldData === void 0) delete process.env.BROWSERSLIST_IGNORE_OLD_DATA;
|
|
65702
65713
|
else process.env.BROWSERSLIST_IGNORE_OLD_DATA = previousIgnoreOldData;
|
|
@@ -67797,6 +67808,13 @@ const DEFAULT_SURFACE_EXCLUDED_TAGS = {
|
|
|
67797
67808
|
ciFailure: ["design"]
|
|
67798
67809
|
};
|
|
67799
67810
|
const isRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
67811
|
+
const KNOWN_RULE_KEYS = new Set([...ALL_REACT_DOCTOR_RULE_KEYS, ...EXTERNAL_RULES.map((rule) => rule.key)]);
|
|
67812
|
+
const BUNDLED_RULE_NAMESPACES = new Set([...KNOWN_RULE_KEYS].flatMap(getEquivalentRuleKeys).map((key) => key.slice(0, key.lastIndexOf("/"))));
|
|
67813
|
+
const getUnknownBundledRuleKeys = (rules) => Object.keys(rules ?? {}).filter((key) => {
|
|
67814
|
+
const canonicalKey = canonicalizeUserRuleKey(key);
|
|
67815
|
+
const namespace = canonicalKey.slice(0, canonicalKey.lastIndexOf("/"));
|
|
67816
|
+
return BUNDLED_RULE_NAMESPACES.has(namespace) && !KNOWN_RULE_KEYS.has(canonicalKey);
|
|
67817
|
+
});
|
|
67800
67818
|
const VALID_RULE_SEVERITIES = [
|
|
67801
67819
|
"error",
|
|
67802
67820
|
"warn",
|
|
@@ -67981,6 +67999,7 @@ const validateConfigTypes = (config) => {
|
|
|
67981
67999
|
applyFieldValidator(config, validated, "surfaces", validateSurfacesField);
|
|
67982
68000
|
for (const fieldName of SEVERITY_FIELD_NAMES) applyFieldValidator(config, validated, fieldName, (value) => validateSeverityMap(fieldName, value, fieldName === "categories"));
|
|
67983
68001
|
applyFieldValidator(config, validated, "plugins", (value) => validateStringArrayField("plugins", value));
|
|
68002
|
+
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.`);
|
|
67984
68003
|
return validated;
|
|
67985
68004
|
};
|
|
67986
68005
|
const warn = (message) => {
|
|
@@ -68302,7 +68321,7 @@ const dedupeRelatedDiagnostics = (diagnostics) => {
|
|
|
68302
68321
|
};
|
|
68303
68322
|
const isPathInsideDirectory = (childAbsolutePath, parentAbsolutePath) => {
|
|
68304
68323
|
const relativePath = path$1$1.relative(parentAbsolutePath, childAbsolutePath);
|
|
68305
|
-
return Boolean(relativePath) && !relativePath.startsWith(
|
|
68324
|
+
return Boolean(relativePath) && relativePath !== ".." && !relativePath.startsWith(`..${path$1$1.sep}`) && !path$1$1.isAbsolute(relativePath);
|
|
68306
68325
|
};
|
|
68307
68326
|
const compareStrings = (left, right) => left < right ? -1 : left > right ? 1 : 0;
|
|
68308
68327
|
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));
|
|
@@ -70161,16 +70180,24 @@ const createSecurityScanSession = (rootDirectory, options) => {
|
|
|
70161
70180
|
const rule = entry.rule;
|
|
70162
70181
|
const scan = rule.scan;
|
|
70163
70182
|
if (typeof scan !== "function") return [];
|
|
70183
|
+
const explicitRuleOverride = resolveRuleSeverityOverride({ ruleKey: entry.key }, options.severityControls);
|
|
70184
|
+
const severityOverride = explicitRuleOverride ?? resolveRuleSeverityOverride({
|
|
70185
|
+
ruleKey: entry.key,
|
|
70186
|
+
category: "Security"
|
|
70187
|
+
}, options.severityControls);
|
|
70188
|
+
if (severityOverride === "off") return [];
|
|
70164
70189
|
if (!shouldEnableRuleByDefaultStatus({
|
|
70165
70190
|
defaultEnabled: rule.defaultEnabled,
|
|
70166
70191
|
includeTagDefaults: options.includeTagDefaults === true,
|
|
70167
|
-
hasIncludedTags: includedTags.size > 0
|
|
70192
|
+
hasIncludedTags: includedTags.size > 0,
|
|
70193
|
+
hasExplicitOverride: explicitRuleOverride !== void 0
|
|
70168
70194
|
})) return [];
|
|
70169
70195
|
if (!shouldEnableRule(rule.requires, rule.tags, capabilities, ignoredTags, rule.disabledWhen, includedTags)) return [];
|
|
70170
70196
|
return [{
|
|
70171
70197
|
entry,
|
|
70172
70198
|
scan,
|
|
70173
|
-
|
|
70199
|
+
severityOverride,
|
|
70200
|
+
committedFilesOnly: rule.committedFilesOnly !== false
|
|
70174
70201
|
}];
|
|
70175
70202
|
});
|
|
70176
70203
|
if (enabledScanRules.length === 0) return null;
|
|
@@ -70187,10 +70214,13 @@ const createSecurityScanSession = (rootDirectory, options) => {
|
|
|
70187
70214
|
};
|
|
70188
70215
|
const scanFileByRule = function* (file) {
|
|
70189
70216
|
if (file === null) return;
|
|
70190
|
-
for (const { entry, scan, committedFilesOnly } of enabledScanRules) {
|
|
70217
|
+
for (const { entry, scan, severityOverride, committedFilesOnly } of enabledScanRules) {
|
|
70191
70218
|
for (const finding of scan(file)) {
|
|
70192
|
-
if (committedFilesOnly && isFileGitIgnored(file)) continue;
|
|
70193
|
-
const diagnostic = buildSecurityScanDiagnostic(finding
|
|
70219
|
+
if ((finding.committedFilesOnly ?? committedFilesOnly) && isFileGitIgnored(file)) continue;
|
|
70220
|
+
const diagnostic = buildSecurityScanDiagnostic(severityOverride === void 0 ? finding : {
|
|
70221
|
+
...finding,
|
|
70222
|
+
severity: severityOverride
|
|
70223
|
+
}, entry, file.relativePath);
|
|
70194
70224
|
const key = `${diagnostic.rule}:${diagnostic.filePath}:${diagnostic.line}:${diagnostic.column}:${diagnostic.message}`;
|
|
70195
70225
|
if (seen.has(key)) continue;
|
|
70196
70226
|
seen.add(key);
|
|
@@ -71840,6 +71870,82 @@ const detectUserLintConfigPaths = (rootDirectory) => {
|
|
|
71840
71870
|
}
|
|
71841
71871
|
return [];
|
|
71842
71872
|
};
|
|
71873
|
+
const isSymlinkFreePath = (filePath, rootDirectory) => {
|
|
71874
|
+
if (!isPathInsideDirectory(filePath, rootDirectory)) return false;
|
|
71875
|
+
let currentPath = rootDirectory;
|
|
71876
|
+
for (const segment of path$1$1.relative(rootDirectory, filePath).split(path$1$1.sep)) {
|
|
71877
|
+
currentPath = path$1$1.join(currentPath, segment);
|
|
71878
|
+
try {
|
|
71879
|
+
if (fs$1$2.lstatSync(currentPath).isSymbolicLink()) return false;
|
|
71880
|
+
} catch (error) {
|
|
71881
|
+
return isErrnoException(error) && error.code === "ENOENT";
|
|
71882
|
+
}
|
|
71883
|
+
}
|
|
71884
|
+
return true;
|
|
71885
|
+
};
|
|
71886
|
+
const snapshotAdoptedLintConfigs = (input) => {
|
|
71887
|
+
const sourceBoundaryDirectory = path$1$1.resolve(findGitRepositoryRoot(input.rootDirectory) ?? input.rootDirectory);
|
|
71888
|
+
const boundaryDirectory = fs$1$2.realpathSync(sourceBoundaryDirectory);
|
|
71889
|
+
const snapshots = /* @__PURE__ */ new Map();
|
|
71890
|
+
const expandedFileCounts = /* @__PURE__ */ new Map();
|
|
71891
|
+
const activePaths = /* @__PURE__ */ new Set();
|
|
71892
|
+
let expandedFileCount = 0;
|
|
71893
|
+
const snapshotConfig = (configPath, depth) => {
|
|
71894
|
+
const resolvedPath = path$1$1.resolve(configPath);
|
|
71895
|
+
const existingSnapshot = snapshots.get(resolvedPath);
|
|
71896
|
+
if (existingSnapshot) {
|
|
71897
|
+
expandedFileCount += expandedFileCounts.get(resolvedPath) ?? 1;
|
|
71898
|
+
if (expandedFileCount > 64) throw new Error("Adopted lint config expands too many files");
|
|
71899
|
+
return existingSnapshot;
|
|
71900
|
+
}
|
|
71901
|
+
if (depth > 32 || expandedFileCount >= 64 || activePaths.has(resolvedPath) || !isSymlinkFreePath(resolvedPath, boundaryDirectory)) throw new Error("Unsafe adopted lint config chain");
|
|
71902
|
+
const configStats = fs$1$2.lstatSync(resolvedPath);
|
|
71903
|
+
if (!configStats.isFile() || configStats.size > 1048576) throw new Error("Unsupported adopted lint config file");
|
|
71904
|
+
const previousFileCount = expandedFileCount;
|
|
71905
|
+
expandedFileCount += 1;
|
|
71906
|
+
activePaths.add(resolvedPath);
|
|
71907
|
+
try {
|
|
71908
|
+
const parsed = parseJSONC(readTextFileUpToCharacterLimitSync({
|
|
71909
|
+
filePath: resolvedPath,
|
|
71910
|
+
maximumLengthChars: ADOPTED_LINT_CONFIG_MAX_BYTES,
|
|
71911
|
+
sizeBytes: configStats.size
|
|
71912
|
+
}), { allowTrailingComma: true });
|
|
71913
|
+
if (!isPlainObject(parsed)) throw new Error("Invalid adopted lint config");
|
|
71914
|
+
const sanitized = snapshotValue(parsed, resolvedPath, depth);
|
|
71915
|
+
const snapshotPath = path$1$1.join(input.snapshotDirectory, `adopted-${snapshots.size}.json`);
|
|
71916
|
+
fs$1$2.writeFileSync(snapshotPath, JSON.stringify(sanitized), {
|
|
71917
|
+
flag: "wx",
|
|
71918
|
+
mode: 384
|
|
71919
|
+
});
|
|
71920
|
+
snapshots.set(resolvedPath, snapshotPath);
|
|
71921
|
+
expandedFileCounts.set(resolvedPath, expandedFileCount - previousFileCount);
|
|
71922
|
+
return snapshotPath;
|
|
71923
|
+
} finally {
|
|
71924
|
+
activePaths.delete(resolvedPath);
|
|
71925
|
+
}
|
|
71926
|
+
};
|
|
71927
|
+
const snapshotValue = (value, configPath, depth) => {
|
|
71928
|
+
if (depth > 32) throw new Error("Adopted lint config too deep");
|
|
71929
|
+
if (Array.isArray(value)) return value.map((entry) => snapshotValue(entry, configPath, depth + 1));
|
|
71930
|
+
if (!isPlainObject(value)) return value;
|
|
71931
|
+
if (Object.hasOwn(value, "jsPlugins")) throw new Error("Executable adopted lint config");
|
|
71932
|
+
return Object.fromEntries(Object.entries(value).map(([key, entry]) => {
|
|
71933
|
+
if (key !== "extends") return [key, snapshotValue(entry, configPath, depth + 1)];
|
|
71934
|
+
return [key, (Array.isArray(entry) ? entry : [entry]).map((extendedPath) => {
|
|
71935
|
+
if (typeof extendedPath !== "string") throw new Error("Invalid lint config extends");
|
|
71936
|
+
return snapshotConfig(path$1$1.resolve(path$1$1.dirname(configPath), extendedPath), depth + 1);
|
|
71937
|
+
})];
|
|
71938
|
+
}));
|
|
71939
|
+
};
|
|
71940
|
+
return input.configPaths.flatMap((configPath) => {
|
|
71941
|
+
try {
|
|
71942
|
+
if (!isPathInsideDirectory(configPath, sourceBoundaryDirectory)) return [];
|
|
71943
|
+
return [snapshotConfig(path$1$1.join(boundaryDirectory, path$1$1.relative(sourceBoundaryDirectory, configPath)), 0)];
|
|
71944
|
+
} catch {
|
|
71945
|
+
return [];
|
|
71946
|
+
}
|
|
71947
|
+
});
|
|
71948
|
+
};
|
|
71843
71949
|
const readAdoptedLintConfigSettings = (configPaths) => {
|
|
71844
71950
|
const mergedSettings = /* @__PURE__ */ new Map();
|
|
71845
71951
|
for (const configPath of configPaths) {
|
|
@@ -71867,6 +71973,7 @@ const getBackupPath = (rootDirectory, absolutePath) => {
|
|
|
71867
71973
|
};
|
|
71868
71974
|
const removeBackupRootIfEmpty = (rootDirectory) => {
|
|
71869
71975
|
const backupRootDirectory = getBackupRootDirectory(rootDirectory);
|
|
71976
|
+
if (!isSymlinkFreePath(backupRootDirectory, rootDirectory)) return;
|
|
71870
71977
|
if (!walkSourceTreeFiles(backupRootDirectory).next().done) return;
|
|
71871
71978
|
fs$1$2.rmSync(backupRootDirectory, {
|
|
71872
71979
|
recursive: true,
|
|
@@ -71967,8 +72074,13 @@ const collectNeutralizationCandidatePaths = (rootDirectory, discoveredRelativePa
|
|
|
71967
72074
|
const recoverOrphanedBackups = (rootDirectory) => {
|
|
71968
72075
|
const blockedPaths = /* @__PURE__ */ new Set();
|
|
71969
72076
|
const backupRootDirectory = getBackupRootDirectory(rootDirectory);
|
|
72077
|
+
if (!isSymlinkFreePath(backupRootDirectory, rootDirectory)) return blockedPaths;
|
|
71970
72078
|
for (const { absolutePath: backupPath } of walkSourceTreeFiles(backupRootDirectory)) {
|
|
71971
72079
|
const originalPath = path$1$1.join(rootDirectory, path$1$1.relative(backupRootDirectory, backupPath));
|
|
72080
|
+
if (!isSymlinkFreePath(backupPath, rootDirectory) || !isSymlinkFreePath(originalPath, rootDirectory)) {
|
|
72081
|
+
blockedPaths.add(originalPath);
|
|
72082
|
+
continue;
|
|
72083
|
+
}
|
|
71972
72084
|
if (neutralizedFileLeases.has(originalPath)) continue;
|
|
71973
72085
|
let backupContent;
|
|
71974
72086
|
let currentContent;
|
|
@@ -72019,6 +72131,7 @@ const neutralizeDisableDirectives = async (rootDirectory, includePaths, options
|
|
|
72019
72131
|
lease.referenceCount -= 1;
|
|
72020
72132
|
if (lease.referenceCount > 0) continue;
|
|
72021
72133
|
neutralizedFileLeases.delete(absolutePath);
|
|
72134
|
+
if (!isSymlinkFreePath(absolutePath, lease.rootDirectory) || !isSymlinkFreePath(lease.backupPath, lease.rootDirectory)) continue;
|
|
72022
72135
|
try {
|
|
72023
72136
|
const currentContent = fs$1$2.readFileSync(absolutePath, "utf-8");
|
|
72024
72137
|
if (currentContent !== lease.neutralizedContent && currentContent !== lease.originalContent) {
|
|
@@ -72036,6 +72149,7 @@ const neutralizeDisableDirectives = async (rootDirectory, includePaths, options
|
|
|
72036
72149
|
const onExit = () => restore();
|
|
72037
72150
|
process.once("exit", onExit);
|
|
72038
72151
|
const leaseCandidatePath = (absolutePath) => {
|
|
72152
|
+
if (!isSymlinkFreePath(absolutePath, resolvedRootDirectory)) return;
|
|
72039
72153
|
if (leasedPaths.has(absolutePath)) return;
|
|
72040
72154
|
if (blockedPaths.has(absolutePath)) return;
|
|
72041
72155
|
const existingLease = neutralizedFileLeases.get(absolutePath);
|
|
@@ -72053,7 +72167,7 @@ const neutralizeDisableDirectives = async (rootDirectory, includePaths, options
|
|
|
72053
72167
|
const neutralizedContent = neutralizeContent(originalContent);
|
|
72054
72168
|
if (neutralizedContent !== originalContent) {
|
|
72055
72169
|
const backupPath = getBackupPath(resolvedRootDirectory, absolutePath);
|
|
72056
|
-
if (backupPath === null) return;
|
|
72170
|
+
if (backupPath === null || !isSymlinkFreePath(backupPath, resolvedRootDirectory)) return;
|
|
72057
72171
|
try {
|
|
72058
72172
|
fs$1$2.mkdirSync(path$1$1.dirname(backupPath), { recursive: true });
|
|
72059
72173
|
fs$1$2.writeFileSync(backupPath, originalContent, { flag: "wx" });
|
|
@@ -72063,6 +72177,7 @@ const neutralizeDisableDirectives = async (rootDirectory, includePaths, options
|
|
|
72063
72177
|
}
|
|
72064
72178
|
fs$1$2.writeFileSync(absolutePath, neutralizedContent);
|
|
72065
72179
|
neutralizedFileLeases.set(absolutePath, {
|
|
72180
|
+
rootDirectory: resolvedRootDirectory,
|
|
72066
72181
|
backupPath,
|
|
72067
72182
|
originalContent,
|
|
72068
72183
|
neutralizedContent,
|
|
@@ -72101,7 +72216,13 @@ const normalizeConfigForHash = (config) => {
|
|
|
72101
72216
|
if (Array.isArray(clone?.jsPlugins)) clone.jsPlugins = clone.jsPlugins.map((_, index) => `<plugin:${index}>`);
|
|
72102
72217
|
return clone;
|
|
72103
72218
|
};
|
|
72104
|
-
const computeRulesetHash = (input) => crypto.createHash("sha1").update(
|
|
72219
|
+
const computeRulesetHash = (input) => crypto.createHash("sha1").update("project-bulk-suppressions-isolated\0").update(JSON.stringify([
|
|
72220
|
+
normalizeConfigForHash(input.config),
|
|
72221
|
+
input.toolchainVersions,
|
|
72222
|
+
input.ignorePatterns,
|
|
72223
|
+
input.tsconfigContent,
|
|
72224
|
+
input.respectInlineDisables
|
|
72225
|
+
])).digest("hex");
|
|
72105
72226
|
/**
|
|
72106
72227
|
* Loads a plugin module via the local require resolver and extracts
|
|
72107
72228
|
* `(name, ruleNames)` from either `module.exports.meta + rules` or
|
|
@@ -74254,35 +74375,64 @@ const spawnLintBatches = async (input) => {
|
|
|
74254
74375
|
batchState.deadlineSkippedFileCount += batch.length;
|
|
74255
74376
|
return [];
|
|
74256
74377
|
}
|
|
74257
|
-
const batchArgs = [
|
|
74378
|
+
const batchArgs = [
|
|
74379
|
+
...baseArgs,
|
|
74380
|
+
"--",
|
|
74381
|
+
...batch
|
|
74382
|
+
];
|
|
74258
74383
|
try {
|
|
74259
|
-
const spawnBatch = () => {
|
|
74384
|
+
const spawnBatch = async () => {
|
|
74260
74385
|
const effectiveSpawnTimeoutMs = resolveSpawnTimeoutMs();
|
|
74261
74386
|
if (effectiveSpawnTimeoutMs === 0) {
|
|
74262
74387
|
deadlineSkippedFiles.push(...batch);
|
|
74263
74388
|
batchState.deadlineSkippedFileCount += batch.length;
|
|
74264
|
-
return
|
|
74389
|
+
return null;
|
|
74390
|
+
}
|
|
74391
|
+
const onStart = () => {
|
|
74392
|
+
if (batchState.didStart) return;
|
|
74393
|
+
batchState.didStart = true;
|
|
74394
|
+
startedFileCount += batchState.initialFileCount;
|
|
74395
|
+
reportBatchStarted(passBatches.length);
|
|
74396
|
+
};
|
|
74397
|
+
let argumentsList = batchArgs;
|
|
74398
|
+
if (input.workingDirectory !== void 0) {
|
|
74399
|
+
const selectedFiles = (await spawnOxlint([
|
|
74400
|
+
...baseArgs,
|
|
74401
|
+
"--debug",
|
|
74402
|
+
"files",
|
|
74403
|
+
...batch
|
|
74404
|
+
], rootDirectory, nodeBinaryPath, effectiveSpawnTimeoutMs, outputMaxBytes, signal, onStart)).split(/\r?\n/).filter(Boolean).map((filePath) => path$1$1.resolve(rootDirectory, filePath));
|
|
74405
|
+
if (selectedFiles.length === 0) return JSON.stringify({ diagnostics: [] });
|
|
74406
|
+
argumentsList = [
|
|
74407
|
+
...baseArgs,
|
|
74408
|
+
"--no-ignore",
|
|
74409
|
+
...selectedFiles
|
|
74410
|
+
];
|
|
74265
74411
|
}
|
|
74266
74412
|
return runOxlintJob({
|
|
74267
|
-
argumentsList
|
|
74268
|
-
rootDirectory,
|
|
74413
|
+
argumentsList,
|
|
74414
|
+
rootDirectory: input.workingDirectory ?? rootDirectory,
|
|
74269
74415
|
nodeBinaryPath,
|
|
74270
74416
|
spawnTimeoutMs: effectiveSpawnTimeoutMs ?? 6e4,
|
|
74271
74417
|
outputMaxBytes: outputMaxBytes ?? 52428800,
|
|
74272
74418
|
maxWorkers: requestedConcurrency,
|
|
74273
74419
|
filesystemCacheEpoch: input.spawnSlots?.filesystemCacheEpoch ?? null,
|
|
74274
74420
|
abortSignal: signal,
|
|
74275
|
-
onStart
|
|
74276
|
-
if (batchState.didStart) return;
|
|
74277
|
-
batchState.didStart = true;
|
|
74278
|
-
startedFileCount += batchState.initialFileCount;
|
|
74279
|
-
reportBatchStarted(passBatches.length);
|
|
74280
|
-
}
|
|
74421
|
+
onStart
|
|
74281
74422
|
});
|
|
74282
74423
|
};
|
|
74283
74424
|
const stdout = input.spawnSlots === void 0 ? await spawnBatch() : await input.spawnSlots.run(spawnBatch, signal);
|
|
74284
74425
|
if (stdout === null) return [];
|
|
74285
|
-
|
|
74426
|
+
const diagnostics = parseOxlintOutput(stdout, project, rootDirectory, sourcePathByLintPath, sourceMapByLintPath, input.diagnosticContextDirectory);
|
|
74427
|
+
if (input.workingDirectory === void 0) return diagnostics;
|
|
74428
|
+
return diagnostics.map((diagnostic) => ({
|
|
74429
|
+
...diagnostic,
|
|
74430
|
+
filePath: toNormalizedRelativePath(diagnostic.filePath, rootDirectory),
|
|
74431
|
+
...diagnostic.relatedLocations ? { relatedLocations: diagnostic.relatedLocations.map((location) => ({
|
|
74432
|
+
...location,
|
|
74433
|
+
filePath: toNormalizedRelativePath(location.filePath, rootDirectory)
|
|
74434
|
+
})) } : {}
|
|
74435
|
+
}));
|
|
74286
74436
|
} catch (error) {
|
|
74287
74437
|
if (!isSplittableReactDoctorError(error)) throw error;
|
|
74288
74438
|
if (isPastDeadline()) {
|
|
@@ -75004,13 +75154,19 @@ const runOxlint = async (options) => {
|
|
|
75004
75154
|
}
|
|
75005
75155
|
const pluginPath = resolvePluginPath();
|
|
75006
75156
|
const detectedConfigPaths = adoptExistingLintConfig && !customRulesOnly ? detectUserLintConfigPaths(rootDirectory) : [];
|
|
75007
|
-
const
|
|
75157
|
+
const adoptableConfigPaths = detectedConfigPaths.filter(canOxlintExtendConfig);
|
|
75008
75158
|
const adoptedSettings = detectedConfigPaths.length > 0 ? readAdoptedLintConfigSettings(detectedConfigPaths) : {};
|
|
75009
75159
|
const userPlugins = includedTags.size > 0 ? [] : resolveUserPlugins(userConfig?.plugins, configSourceDirectory);
|
|
75010
75160
|
const restoreDisableDirectives = await neutralizeDisableDirectives(rootDirectory, includePaths ?? options.precomputedSourceFiles?.map((sourceFile) => sourceFile.path), { recoverOnly: respectInlineDisables });
|
|
75011
75161
|
const configDirectory = fs$1$2.mkdtempSync(path$1$1.join(os.tmpdir(), "react-doctor-oxlintrc-"));
|
|
75012
75162
|
const configPath = path$1$1.join(configDirectory, "oxlintrc.json");
|
|
75163
|
+
const workingDirectory = fs$1$2.existsSync(path$1$1.join(rootDirectory, "oxlint-suppressions.json")) ? configDirectory : void 0;
|
|
75013
75164
|
try {
|
|
75165
|
+
const extendsPaths = snapshotAdoptedLintConfigs({
|
|
75166
|
+
configPaths: adoptableConfigPaths,
|
|
75167
|
+
rootDirectory,
|
|
75168
|
+
snapshotDirectory: configDirectory
|
|
75169
|
+
});
|
|
75014
75170
|
const diagnosticContextDirectory = path$1$1.join(configDirectory, "contexts");
|
|
75015
75171
|
fs$1$2.mkdirSync(diagnosticContextDirectory);
|
|
75016
75172
|
const oxlintBinary = resolveOxlintBinary();
|
|
@@ -75019,7 +75175,7 @@ const runOxlint = async (options) => {
|
|
|
75019
75175
|
if (project.hasTypeScript) {
|
|
75020
75176
|
const tsconfigRelativePath = resolveTsConfigRelativePath(rootDirectory);
|
|
75021
75177
|
if (tsconfigRelativePath) {
|
|
75022
|
-
sharedArgs.push("--tsconfig", tsconfigRelativePath);
|
|
75178
|
+
sharedArgs.push("--tsconfig", path$1$1.resolve(rootDirectory, tsconfigRelativePath));
|
|
75023
75179
|
try {
|
|
75024
75180
|
tsconfigContent = fs$1$2.readFileSync(path$1$1.resolve(rootDirectory, tsconfigRelativePath), "utf8");
|
|
75025
75181
|
} catch {
|
|
@@ -75108,6 +75264,7 @@ const runOxlint = async (options) => {
|
|
|
75108
75264
|
return spawnLintBatches({
|
|
75109
75265
|
baseArgs: passBaseArgs,
|
|
75110
75266
|
fileBatches: passFileBatches,
|
|
75267
|
+
workingDirectory,
|
|
75111
75268
|
rootDirectory,
|
|
75112
75269
|
nodeBinaryPath,
|
|
75113
75270
|
project: lintProject,
|
|
@@ -75336,6 +75493,7 @@ const runOxlint = async (options) => {
|
|
|
75336
75493
|
const runBatches = () => spawnLintBatches({
|
|
75337
75494
|
baseArgs,
|
|
75338
75495
|
fileBatches,
|
|
75496
|
+
workingDirectory,
|
|
75339
75497
|
rootDirectory,
|
|
75340
75498
|
nodeBinaryPath,
|
|
75341
75499
|
project: lintProject,
|
|
@@ -76327,7 +76485,8 @@ const runInspect = (input, hooks = {}) => gen(function* () {
|
|
|
76327
76485
|
return filteredDiagnostic === null ? none() : some(filteredDiagnostic);
|
|
76328
76486
|
})));
|
|
76329
76487
|
const applyPerElementPipeline = (rawStream) => filterPerElementPipeline(rawStream).pipe(tap((diagnostic) => reporterService.emit(diagnostic)));
|
|
76330
|
-
const
|
|
76488
|
+
const severityControls = buildRuleSeverityControls(resolvedConfig.config);
|
|
76489
|
+
const pnpmHardeningSeverity = resolveRuleSeverityOverride({ ruleKey: "react-doctor/require-pnpm-hardening" }, severityControls);
|
|
76331
76490
|
const envCollected = yield* runCollect(applyPerElementPipeline(fromIterable$1(isDiffMode ? [] : [
|
|
76332
76491
|
...checkReducedMotion(scanDirectory),
|
|
76333
76492
|
...pnpmHardeningSeverity === "warn" || pnpmHardeningSeverity === "error" ? checkPnpmHardening(scanDirectory) : [],
|
|
@@ -76339,6 +76498,7 @@ const runInspect = (input, hooks = {}) => gen(function* () {
|
|
|
76339
76498
|
let didSecurityScanReachDeadline = false;
|
|
76340
76499
|
const securityScanFiber = yield* forkChild(runCollect(applyPerElementPipeline(isDiffMode ? empty$4 : unwrap(tryPromise((signal) => checkSecurityScanCooperative(scanDirectory, {
|
|
76341
76500
|
project,
|
|
76501
|
+
severityControls,
|
|
76342
76502
|
ignoredTags: input.ignoredTags,
|
|
76343
76503
|
includedTags: input.includedTags,
|
|
76344
76504
|
includeTagDefaults: input.includeTagDefaults,
|
|
@@ -76386,7 +76546,7 @@ const runInspect = (input, hooks = {}) => gen(function* () {
|
|
|
76386
76546
|
const maintainabilityPhaseTimeoutMs = yield* DeadCodePhaseTimeoutMs;
|
|
76387
76547
|
const workerCountSuffix = scanConcurrency > 1 ? ` ${highlighter.dim(`[~${scanConcurrency} workers]`)}` : "";
|
|
76388
76548
|
const projectCapabilities = getCapabilities(project);
|
|
76389
|
-
const projectRuleSelections = resolveProjectRuleSelections(
|
|
76549
|
+
const projectRuleSelections = resolveProjectRuleSelections(severityControls).filter((selection) => {
|
|
76390
76550
|
const rule = REACT_DOCTOR_RULE_REGISTRY[selection.ruleId];
|
|
76391
76551
|
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]));
|
|
76392
76552
|
});
|
|
@@ -77611,7 +77771,7 @@ const makeNoopConsole = () => ({
|
|
|
77611
77771
|
});
|
|
77612
77772
|
//#endregion
|
|
77613
77773
|
//#region src/cli/utils/version.ts
|
|
77614
|
-
const VERSION = "0.9.
|
|
77774
|
+
const VERSION = "0.9.23-dev.190b5b6";
|
|
77615
77775
|
//#endregion
|
|
77616
77776
|
//#region src/cli/utils/json-mode.ts
|
|
77617
77777
|
let context = null;
|
|
@@ -77953,7 +78113,7 @@ const recordDistribution = (name, value, options = {}) => {
|
|
|
77953
78113
|
} catch {}
|
|
77954
78114
|
};
|
|
77955
78115
|
//#endregion
|
|
77956
|
-
export { buildRuleSeverityControls as $,
|
|
78116
|
+
export { buildRuleSeverityControls as $, runInspect as $t, Files as A, buildWithScope as An, hasPublishedFixRecipe as At, PerFileLintCacheEnabled as B, yieldToEventLoop as Bn, listSourceFiles as Bt, ACTION_INPUT_ENVIRONMENT_VARIABLES as C, provideContext as Cn, getChangedLineRanges as Ct, isCodingAgentEnvironment as D, sync as Dn, getRuleMetadata as Dt, isCiOrCodingAgentEnvironment as E, runSync as En, getEquivalentRuleKeys as Et, Linter as F, makeUnsafe$5 as Fn, isProjectDiscoveryError as Ft, SidecarLintCacheEnabled as G, isFile as Gn, materializeSourceTree as Gt, Project as H, toCanonicalPath as Hn, listWorkspacePackages as Ht, Maintainability as I, fail$5 as In, isReactDoctorError as It, anonymizeInPlace as J, remainingDeadlineBudgetMs as Jt, StagedFiles as K, isPlainObject as Kn, mergeAndFilterDiagnostics as Kt, NodeResolver as L, void_$1 as Ln, isSameRuleKey as Lt, InvocationCaches as M, provide$2 as Mn, hashFileContents as Mt, LEGACY_CONFIG_FILENAME as N, succeed$3 as Nn, highlighter as Nt, Config as O, try_ as On, getUnknownBundledRuleKeys as Ot, LintPartialFailures as P, close as Pn, isPathInsideDirectory as Pt, buildRuleDocsUrl as Q, restoreLegacyThrow as Qt, OxlintConcurrency as R, ParentSpan as Rn, isScanComplete as Rt, isDebugFlagEnabled as S, provide as Sn, getBaselineDiffPlan as St, isCiEnvironment as T, runPromise as Tn, getDiffInfo as Tt, Reporter as U, isDirectory as Un, loadConfigWithSource as Ut, Progress as V, messageFromUnknown as Vn, listSourceFilesCooperative as Vt, Score as W, isErrnoException as Wn, mapWithConcurrency as Wt, atomicWriteJson as X, resolveLintBatchOrdering as Xt, anonymizeText as Y, resolveGithubActionsScoreMetadata as Yt, buildJsonReport as Z, resolveScanTarget as Zt, VERSION as _, gen as _n, findGitRepositoryRoot as _t, isEnvFlagEnabled as a, validateConfigTypes as an, collectSourceFilesByDirectory as at, isNonInteractiveEnvironment as b, orElseSucceed as bn, formatErrorChain as bt, setSentryProjectInfo as c, Console as cn, countOptInProjectRuleSelections as ct, isJsonModeActive as d, log as dn, createOxlintSpawnSlots as dt, scrubSensitivePaths as en, buildSkippedChecks as et, setJsonReportDirectory as f, warn$1 as fn, detectAiTrainingEnvironment as ft, writeJsonReport as g, make$30 as gn, filterSourceFiles as gt, writeJsonErrorReport as h, decodeUnknownSync as hn, filterPathsOutsideDirectories as ht, isTelemetryEnabled as i, toRelativePath as in, clearConfigCache as it, Git as j, mergeAll$1 as jn, hasSupportedFrameworkOrLibrary as jt, DIAGNOSTIC_DELTA_IDENTITY as k, void_ as kn, groupBy as kt, getRunId as l, error as ln, createChangedLineMatcher as lt, writeJsonCancellationReport as m, JsonReport as mn, filterDiagnosticsForSurface as mt, recordDistribution as n, shouldUseMaintainabilityLayer as nn, canonicalizeUserRuleKey as nt, buildSentryScope as o, warmDuplicateJsxWorker as on, computeConfigFingerprint as ot, setJsonReportMode as p, Diagnostic as pn, discoverSupportedSubprojects as pt, SupplyChain as q, mergeReactDoctorConfigs as qt, toSpanAttributes as r, summarizeDiagnostics as rn, classifyFileContext as rt, buildSentryProjectContext as s, warmOxlintWorkerPool as sn, computeDiagnosticDelta as st, recordCount as t, setColorEnabled as tn, calculateScore as tt, enableJsonMode as u, info as un, createInvocationCaches as ut, makeNoopConsole as v, makeSpan$1 as vn, findLegacyConfig as vt, detectRunnerOs as w, provideService as wn, getDiagnosticRuleIdentity as wt, isGitHookEnvironment as x, promise as xn, formatReactDoctorError as xt, CliInputError as y, map$3 as yn, fingerprintDiagnosticEvidence as yt, OxlintSpawnSlots as z, isMonorepoRoot as zn, layerObservability as zt };
|
|
77957
78117
|
|
|
77958
|
-
//# sourceMappingURL=record-metric-
|
|
77959
|
-
//# debugId=
|
|
78118
|
+
//# sourceMappingURL=record-metric-vW6WPfqn.js.map
|
|
78119
|
+
//# debugId=860e2d53-ec55-529b-a297-6f138d750c5d
|
|
@@ -1,8 +1,8 @@
|
|
|
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 { S as SENTRY_FLUSH_TIMEOUT_MS, u as METRIC } from "./constants-
|
|
4
|
-
import {
|
|
5
|
-
import { i as getSentry, n as shutdownTelemetry, o as isExpectedUserError } from "./telemetry-runtime-
|
|
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]="8d472cf3-dc42-5b3e-b246-6136f8774f62")}catch(e){}}();
|
|
3
|
+
import { S as SENTRY_FLUSH_TIMEOUT_MS, u as METRIC } from "./constants-BmD_c3Yq.js";
|
|
4
|
+
import { It as isReactDoctorError, l as getRunId, o as buildSentryScope, t as recordCount } from "./record-metric-vW6WPfqn.js";
|
|
5
|
+
import { i as getSentry, n as shutdownTelemetry, o as isExpectedUserError } from "./telemetry-runtime-ChQH6lX-.js";
|
|
6
6
|
import { r as recordRunTraceId, t as getActiveRunTrace } from "./active-run-trace-Dewycxda.js";
|
|
7
7
|
//#region src/cli/utils/report-error.ts
|
|
8
8
|
/**
|
|
@@ -61,5 +61,5 @@ const reportErrorToSentry = async (error) => {
|
|
|
61
61
|
//#endregion
|
|
62
62
|
export { reportErrorToSentry as t };
|
|
63
63
|
|
|
64
|
-
//# sourceMappingURL=report-error-
|
|
65
|
-
//# debugId=
|
|
64
|
+
//# sourceMappingURL=report-error-BjXxJDFZ.js.map
|
|
65
|
+
//# debugId=8d472cf3-dc42-5b3e-b246-6136f8774f62
|
|
@@ -1,8 +1,8 @@
|
|
|
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 { m as REACT_DOCTOR_CONFIG_PROJECT_NAME, u as METRIC } from "./constants-
|
|
4
|
-
import { t as recordCount } from "./record-metric-
|
|
5
|
-
import { u as isCommandAvailable } from "./install-github-workflow-
|
|
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]="9285b600-b6ad-527a-a460-4a6041fc10d6")}catch(e){}}();
|
|
3
|
+
import { m as REACT_DOCTOR_CONFIG_PROJECT_NAME, u as METRIC } from "./constants-BmD_c3Yq.js";
|
|
4
|
+
import { t as recordCount } from "./record-metric-vW6WPfqn.js";
|
|
5
|
+
import { u as isCommandAvailable } from "./install-github-workflow-CrKVCl4g.js";
|
|
6
6
|
import { createRequire } from "node:module";
|
|
7
7
|
import * as path$1 from "node:path";
|
|
8
8
|
import { spawn } from "node:child_process";
|
|
@@ -289,5 +289,5 @@ const reportWorkflowResult = (workflowSpinner, result, projectRoot) => {
|
|
|
289
289
|
//#endregion
|
|
290
290
|
export { recordGate as a, ACTION_UPGRADE_EVENT as c, INSTALL_AGENTS_PREFERENCE_ID as d, ONBOARDING_EVENT as f, loadAgentInstall as g, detectAvailableAgents as h, readPreference as i, CI_PITCH_EVENT as l, computeDefaultSelectedAgents as m, openUrl as n, runMigrations as o, SETUP_HINT_EVENT as p, isGatePending as r, writePreference as s, reportWorkflowResult as t, HANDOFF_TARGET_PREFERENCE_ID as u };
|
|
291
291
|
|
|
292
|
-
//# sourceMappingURL=report-workflow-result-
|
|
293
|
-
//# debugId=
|
|
292
|
+
//# sourceMappingURL=report-workflow-result-CDrgxyIL.js.map
|
|
293
|
+
//# debugId=9285b600-b6ad-527a-a460-4a6041fc10d6
|