react-doctor 0.9.17-dev.6932e7d → 0.9.17-dev.695e46e
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +16 -68
- package/dist/{build-section-divider-CCkdYDGY.js → build-section-divider-BlNg8CJ3.js} +4 -4
- package/dist/{ci-CLau9lJp.js → ci-dPYHQlYK.js} +18 -12
- package/dist/cli.js +27 -27
- package/dist/{design-tLYKOrgj.js → design-CEbK8378.js} +4 -4
- package/dist/duplicate-jsx-worker.js +3 -3
- package/dist/{exit-gracefully-CJYxagiG.js → exit-gracefully-C8JRlcU-.js} +6 -6
- package/dist/{handle-error-CXKa5V_C.js → handle-error-qi-5p5I2.js} +5 -5
- package/dist/index.d.ts +12 -5
- package/dist/index.js +32 -25
- package/dist/{inspect-kY0lepPl.js → inspect-BJE38z7r.js} +24 -19
- package/dist/{install-CcgxmHS7.js → install-R-4Yhbnt.js} +9 -9
- package/dist/{install-doctor-script-BYia3c6r.js → install-doctor-script-CzA3N60N.js} +4 -4
- package/dist/{install-github-workflow-DT9g71vu.js → install-github-workflow-DqIx2JgD.js} +5 -5
- package/dist/{install-react-doctor-gIlaQo52.js → install-react-doctor-BzFeAPsN.js} +8 -8
- package/dist/{jsx-runtime-Dz1BgjFv.js → jsx-runtime-BkWtbZXO.js} +5 -5
- package/dist/{print-branded-header-DcuhNpZD.js → print-branded-header-CO4r1oDZ.js} +4 -4
- package/dist/{prompt-runtime-scan-url-CU7G3L34.js → prompt-runtime-scan-url-sBG2_LDZ.js} +5 -5
- package/dist/{read-object-file-vLexPMRt.js → read-object-file-Bl7a4v-9.js} +4 -4
- package/dist/{record-metric-BzJGgUyE.js → record-metric-DcSvz1k4.js} +129 -53
- package/dist/{report-error-yT3d2npg.js → report-error-BmvMTKij.js} +5 -5
- package/dist/{report-workflow-result-Ch1KGhmX.js → report-workflow-result-K7NFRSY6.js} +5 -5
- package/dist/{resolve-scan-exit-code-7pqpigjA.js → resolve-scan-exit-code-KDrMkTrJ.js} +24 -32
- package/dist/{resolve-scope-C9r6_i2P.js → resolve-scope-DIgYBn32.js} +10 -9
- package/dist/{rules-53y-4mhG.js → rules-H0yqeV5v.js} +6 -6
- package/dist/{run-scan-app-xQcO9Chd.js → run-scan-app-ChPI8NEg.js} +16 -14
- package/dist/{runtime-scan-Dna29iOk.js → runtime-scan-XUqvrTH4.js} +9 -9
- package/dist/{sanitize-runtime-url-BAn4mEFw.js → sanitize-runtime-url-D_7VZU0F.js} +4 -4
- package/dist/{scan-Dcsq2-gA.js → scan-BTohT6wy.js} +9 -9
- package/dist/{should-skip-prompts-gmTKMHB5.js → should-skip-prompts-BX-idWyW.js} +4 -4
- package/dist/{should-use-tui-C8mCTPBf.js → should-use-tui-CnsREuvI.js} +4 -4
- package/dist/skills/react-doctor/SKILL.md +9 -8
- package/dist/skills/react-doctor/references/explain.md +5 -0
- package/dist/{telemetry-runtime-DUAbnIzM.js → telemetry-runtime-BufSIW3d.js} +6 -6
- package/dist/{version-Bk87XkeX.js → version-BVBbh_L8.js} +4 -4
- package/dist/{why-Cv45HYJ4.js → why-BJoyzEcf.js} +4 -4
- package/dist/{with-run-span-CmzJ3vFq.js → with-run-span-xUMrAJ_a.js} +5 -5
- package/package.json +2 -2
|
@@ -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]="60081890-ce9e-5132-8ff2-6180d62dcf24")}catch(e){}}();
|
|
3
3
|
import { i as __toESM, r as __require, t as __commonJSMin } from "./chunk-ChKA3wi6.js";
|
|
4
4
|
import { $ as warmReactCompilerDetection, $t as OXLINT_WORKER_JOB_END_MARKER, A as buildGitSourceListingRequest, An as TARGET_BLANK_BROWSER_SUPPORT, At as GITHUB_VIEWER_PERMISSION_TIMEOUT_MS, B as resolveGitCommand, Bt as MAINTAINABILITY_DUPLICATE_JSX_RULE, Cn as SUPPLY_CHAIN_CACHE_TTL_MS, Ct as ES_TARGET_YEAR_BY_NAME, Dn as SUPPLY_CHAIN_PLUGIN, Dt as GENERATED_BUNDLE_FILE_PATTERN, En as SUPPLY_CHAIN_OVERLAP_TIMEOUT_MS, Et as FILE_LINT_CACHE_MAX_FILE_COUNT, F as lowerChildProcessPriority, Fn as VERCEL_NEXTJS_SECURITY_RELEASE_URL, Ft as HTML_FILE_PATTERN, G as resolvePluginPath, Gt as MINIFIED_SNIFF_BYTES, H as resolveOxlintThreadCount, It as IGNORED_DIRECTORIES, J as resolveTsConfigRelativePath, K as resolveReactDoctorCacheDir, Kt as OCCURRENCE_MATCHED_CATEGORIES, Lt as JSX_DUPLICATION_SOURCE_FILE_PATTERN, M as buildOxlintWorkerSpawnSpec, Mn as TELEMETRY_SHUTDOWN_TIMEOUT_MS, Mt as GIT_LS_FILES_MAX_BUFFER_BYTES, Nn as TSCONFIG_FILENAMES, Nt as GIT_SHOW_MAX_BUFFER_BYTES, On as SUPPLY_CHAIN_RULE, Ot as GENERATED_SOURCE_DIRECTORY_PATTERN, P as killUnadoptedOxlintWorkers, Pn as TYPESCRIPT_DECLARATION_FILE_PATTERN, Pt as GIT_SOURCE_LISTING_ARGUMENTS, Q as takeReactCompilerDetection, Qt as OXLINT_SPLIT_TOTAL_BUDGET_MS, R as readSystemConcurrencyFacts, Sn as SUPPLY_CHAIN_CACHE_SUBDIR, Tn as SUPPLY_CHAIN_IGNORED_PACKAGES, Tt as FILE_LINT_CACHE_FILENAME, U as resolveOxlintToolchainVersions, Ut as MAX_GLOB_PATTERN_LENGTH_CHARS, V as resolveOxlintBinary, Vt as MAINTAINABILITY_PLUGIN, W as resolveOxlintWorkerRuntime, Wt as MILLISECONDS_PER_SECOND, X as spawnOxlintWorkerProcess, Xt as OXLINT_OUTPUT_MAX_BYTES, Y as setChildProcessRef, Yt as OXLINT_OOM_RESCUE_BUDGET_MS, Z as takePrespawnedOxlintWorker, Zt as OXLINT_SPAWN_TIMEOUT_MS, _n as SOURCE_FILE_PATTERN, _t as DIAGNOSTIC_CATEGORY_BUCKETS, an as REACT_ROUTER_CAPABILITY_THRESHOLDS, at as AXIOM_METRICS_DATASET_HEADER, bn as SPAWN_ARGS_MAX_LENGTH_CHARS_POSIX, cn as ROOT_CAUSE_GROUPABLE_RULE_KEYS, d as METRIC_DISTRIBUTION_BOUNDARIES, dt as COMPILER_CLEANUP_BUCKET, en as PROJECT_ANALYSIS_WORKER_MAX_OLD_SPACE_MB, et as ABORT_EXIT_CODES, fn as SIDECAR_LINT_CACHE_FILENAME, ft as COMPILER_CLEANUP_RULE_KEYS, gn as SOCKET_PACKAGE_PAGE_BASE, gt as DEFAULT_BRANCH_CANDIDATES, hn as SOCKET_FREE_USER_AGENT, in as REACT_BLOG_RSC_ADVISORY_URL, j as buildOxlintChildEnv, jn as TELEMETRY_EXPORT_INTERVAL_MS, jt as GIT_CHECK_ATTR_MAX_BUFFER_BYTES, kn as TAILWIND_POSTCSS7_COMPAT_ALIAS, l as INTERNAL_ERROR_JSON_FALLBACK, ln as SCANNED_DOT_DIRECTORIES, mn as SOCKET_FREE_PURL_API_BASE, mt as CONFIG_FINGERPRINT_FILENAMES, nn as PROJECT_ANALYSIS_WORKER_TIMEOUT_CEILING_MS, nt as APP_ONLY_RULE_KEYS, on as REACT_SERVER_DOM_PACKAGES, ot as AXIOM_METRICS_PATH, pt as CONFIG_CACHE_TTL_MS, q as resolveScanConcurrency, qt as OXLINT_IGNORED_DECLARATION_DIAGNOSTIC_CODES, rn as PROJECT_ANALYSIS_WORKER_TIMEOUT_MS, rt as AXIOM_DATASET_HEADER, sn as RECOMMENDED_PNPM_MINIMUM_RELEASE_AGE_MINUTES, st as AXIOM_TRACES_PATH, tn as PROJECT_ANALYSIS_WORKER_MEMORY_BUDGET_BYTES, tt as ADOPTABLE_LINT_CONFIG_FILENAMES, un as SCORE_API_URL, vn as SPAWN_ARGS_MAX_LENGTH_CHARS, vt as DISABLE_DIRECTIVE_BACKUP_DIRECTORY_SEGMENTS, wn as SUPPLY_CHAIN_CATEGORY, wt as FETCH_TIMEOUT_MS, xn as STAGED_FILES_PROJECT_CONFIG_FILENAMES, xt as DUPLICATE_JSX_WORKER_IDLE_TIMEOUT_MS, yn as SPAWN_ARGS_MAX_LENGTH_CHARS_DARWIN, yt as DOCS_RULES_BASE_URL, z as resolveConfiguredScanConcurrency, zt as MAINTAINABILITY_CATEGORY } from "./constants-Bwylqy0B.js";
|
|
5
5
|
import { n as require_picomatch, t as require_semver } from "./semver-BZIuy1gP.js";
|
|
@@ -526,14 +526,14 @@ 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-BWvh1lk5.js
|
|
530
530
|
const yieldToEventLoop = () => new Promise((resolve) => {
|
|
531
531
|
setImmediate(resolve);
|
|
532
532
|
});
|
|
533
533
|
const getTypescriptScriptKind = (fileName) => {
|
|
534
534
|
if (fileName.endsWith(".tsx")) return typescriptBinding.ScriptKind.TSX;
|
|
535
535
|
if (fileName.endsWith(".jsx")) return typescriptBinding.ScriptKind.JSX;
|
|
536
|
-
if (fileName
|
|
536
|
+
if (/\.[cm]?ts$/.test(fileName)) return typescriptBinding.ScriptKind.TS;
|
|
537
537
|
return typescriptBinding.ScriptKind.JS;
|
|
538
538
|
};
|
|
539
539
|
const resolveBoundedSourceReadBytes = (maximumLengthChars, sizeBytes) => Math.min(sizeBytes, maximumLengthChars * 3 + 1);
|
|
@@ -70751,39 +70751,46 @@ var Files = class Files extends Service()("react-doctor/Files") {
|
|
|
70751
70751
|
};
|
|
70752
70752
|
};
|
|
70753
70753
|
const HUNK_HEADER_PATTERN = /^@@ -\d+(?:,\d+)? \+(\d+)(?:,(\d+))? @@/;
|
|
70754
|
-
|
|
70755
|
-
|
|
70756
|
-
|
|
70757
|
-
* the `+++ b/<path>` header (with `--relative`, relative to the diff's cwd).
|
|
70758
|
-
* Added/renamed/modified files appear; pure deletions (`+++ /dev/null`) are
|
|
70759
|
-
* skipped because they have no new-side line to report on.
|
|
70760
|
-
*/
|
|
70761
|
-
const parseChangedLineRanges = (patch) => {
|
|
70762
|
-
const rangesByFile = /* @__PURE__ */ new Map();
|
|
70763
|
-
let currentRanges = null;
|
|
70754
|
+
const parseChangedLineRanges = (patch, includeDeletions = false) => {
|
|
70755
|
+
const changesByFile = /* @__PURE__ */ new Map();
|
|
70756
|
+
let currentChanges = null;
|
|
70764
70757
|
for (const line of patch.split("\n")) {
|
|
70758
|
+
if (includeDeletions && line.startsWith("rename to ")) {
|
|
70759
|
+
const file = line.slice(10);
|
|
70760
|
+
changesByFile.set(file, {
|
|
70761
|
+
file,
|
|
70762
|
+
ranges: [],
|
|
70763
|
+
deletionLines: []
|
|
70764
|
+
});
|
|
70765
|
+
}
|
|
70765
70766
|
if (line.startsWith("+++ ")) {
|
|
70766
70767
|
const target = line.slice(4).trim();
|
|
70767
70768
|
if (target === "/dev/null") {
|
|
70768
|
-
|
|
70769
|
+
currentChanges = null;
|
|
70769
70770
|
continue;
|
|
70770
70771
|
}
|
|
70771
70772
|
const file = target.startsWith("b/") ? target.slice(2) : target;
|
|
70772
|
-
|
|
70773
|
-
|
|
70773
|
+
currentChanges = changesByFile.get(file) ?? {
|
|
70774
|
+
file,
|
|
70775
|
+
ranges: [],
|
|
70776
|
+
deletionLines: []
|
|
70777
|
+
};
|
|
70778
|
+
changesByFile.set(file, currentChanges);
|
|
70774
70779
|
continue;
|
|
70775
70780
|
}
|
|
70776
|
-
if (
|
|
70781
|
+
if (currentChanges === null) continue;
|
|
70777
70782
|
const hunk = HUNK_HEADER_PATTERN.exec(line);
|
|
70778
70783
|
if (hunk === null) continue;
|
|
70779
70784
|
const start = Number(hunk[1]);
|
|
70780
70785
|
const lineCount = hunk[2] === void 0 ? 1 : Number(hunk[2]);
|
|
70781
|
-
if (lineCount
|
|
70782
|
-
|
|
70786
|
+
if (lineCount === 0) {
|
|
70787
|
+
if (includeDeletions) currentChanges.deletionLines.push(start);
|
|
70788
|
+
} else currentChanges.ranges.push([start, start + lineCount - 1]);
|
|
70783
70789
|
}
|
|
70784
|
-
return [...
|
|
70790
|
+
return [...changesByFile.values()].filter((entry) => entry.ranges.length > 0 || includeDeletions).map(({ file, ranges, deletionLines }) => ({
|
|
70785
70791
|
file,
|
|
70786
|
-
ranges
|
|
70792
|
+
ranges,
|
|
70793
|
+
...deletionLines.length > 0 ? { deletionLines } : {}
|
|
70787
70794
|
}));
|
|
70788
70795
|
};
|
|
70789
70796
|
const trimOrNull = (value) => {
|
|
@@ -71268,7 +71275,7 @@ var Git = class Git extends Service()("react-doctor/Git") {
|
|
|
71268
71275
|
stdout: result.stdout
|
|
71269
71276
|
};
|
|
71270
71277
|
}).pipe(withSpan("Git.grep")),
|
|
71271
|
-
changedLineRanges: ({ directory, baseRef, cached, files, includeUntracked = false }) => gen(function* () {
|
|
71278
|
+
changedLineRanges: ({ directory, baseRef, cached, files, includeUntracked = false, includeDeletions = false }) => gen(function* () {
|
|
71272
71279
|
if (files.length === 0) return [];
|
|
71273
71280
|
if (baseRef !== void 0 && !isSafeGitRevision(baseRef)) return null;
|
|
71274
71281
|
const result = yield* runGit(directory, [
|
|
@@ -71283,7 +71290,7 @@ var Git = class Git extends Service()("react-doctor/Git") {
|
|
|
71283
71290
|
...files
|
|
71284
71291
|
]);
|
|
71285
71292
|
if (result.status !== 0) return null;
|
|
71286
|
-
const changedLineRanges = parseChangedLineRanges(result.stdout);
|
|
71293
|
+
const changedLineRanges = parseChangedLineRanges(result.stdout, includeDeletions);
|
|
71287
71294
|
if (cached || !includeUntracked) return changedLineRanges;
|
|
71288
71295
|
const untrackedFilePaths = yield* listUntrackedFilePaths(directory, files);
|
|
71289
71296
|
if (untrackedFilePaths === null) return changedLineRanges;
|
|
@@ -71904,10 +71911,10 @@ const createOxlintConfig = ({ pluginPath, project, customRulesOnly = false, exte
|
|
|
71904
71911
|
if (ruleSelection === "sidecar" && sidecarRuleIdFilter !== void 0 && !sidecarRuleIdFilter.has(registryEntry.id)) continue;
|
|
71905
71912
|
if (rule.isScanRule || rule.isProjectRule === true) continue;
|
|
71906
71913
|
if (registryEntry.id === "no-multi-component-file" && shouldUseExplicitNoMultiCompPolicy) continue;
|
|
71907
|
-
if (customRulesOnly && registryEntry.originallyExternal) continue;
|
|
71908
71914
|
if (rule.framework !== "global" && !rule.requires) continue;
|
|
71909
71915
|
if (!shouldEnableRule(rule.requires, rule.tags, capabilities, ignoredTags, rule.disabledWhen, includedTags)) continue;
|
|
71910
71916
|
const explicitRuleOverride = resolveRuleSeverityOverride({ ruleKey: registryEntry.key }, severityControls);
|
|
71917
|
+
if (customRulesOnly && registryEntry.originallyExternal && (explicitRuleOverride === void 0 || explicitRuleOverride === "off")) continue;
|
|
71911
71918
|
if (!shouldEnableRuleByDefaultStatus({
|
|
71912
71919
|
defaultEnabled: rule.defaultEnabled,
|
|
71913
71920
|
includeTagDefaults,
|
|
@@ -76630,7 +76637,7 @@ const getBaselineDiffPlan = (directory, ref) => runPromise(gen(function* () {
|
|
|
76630
76637
|
});
|
|
76631
76638
|
}).pipe(provide(Git.layerNode)));
|
|
76632
76639
|
/**
|
|
76633
|
-
* Programmatic façade over `Git.changedLineRanges` (the `lines`
|
|
76640
|
+
* Programmatic façade over `Git.changedLineRanges` (the `lines` / `contextual` scopes). Diffs
|
|
76634
76641
|
* `files` with `--unified=0` against `baseRef` (or the index when `cached`),
|
|
76635
76642
|
* returning per-file changed line ranges relative to `directory`. Returns
|
|
76636
76643
|
* `null` when the ranges can't be computed (git unavailable / unsafe ref /
|
|
@@ -76639,11 +76646,100 @@ const getBaselineDiffPlan = (directory, ref) => runPromise(gen(function* () {
|
|
|
76639
76646
|
*/
|
|
76640
76647
|
const getChangedLineRanges = (input) => runPromise(gen(function* () {
|
|
76641
76648
|
const ranges = yield* (yield* Git).changedLineRanges(input);
|
|
76642
|
-
return ranges === null ? null : ranges.map((entry) => ({
|
|
76643
|
-
file: entry.file,
|
|
76644
|
-
ranges: entry.ranges
|
|
76645
|
-
}));
|
|
76649
|
+
return ranges === null ? null : ranges.map((entry) => ({ ...entry }));
|
|
76646
76650
|
}).pipe(provide(Git.layerNode)));
|
|
76651
|
+
const lookupOwnRule = (rule) => Object.hasOwn(REACT_DOCTOR_RULE_REGISTRY, rule) ? REACT_DOCTOR_RULE_REGISTRY[rule] : void 0;
|
|
76652
|
+
/**
|
|
76653
|
+
* Returns presentation metadata for `<plugin>/<rule>`, or `null` when the
|
|
76654
|
+
* rule is not part of the bundled react-doctor plugin (e.g. an adopted
|
|
76655
|
+
* `eslint` / `unicorn` rule folded in via the user's lint config — those
|
|
76656
|
+
* carry their own help/url on the diagnostic instead).
|
|
76657
|
+
*/
|
|
76658
|
+
const getRuleMetadata = (plugin, rule) => {
|
|
76659
|
+
if (plugin !== "react-doctor") return null;
|
|
76660
|
+
const definition = lookupOwnRule(rule);
|
|
76661
|
+
if (!definition) return null;
|
|
76662
|
+
return {
|
|
76663
|
+
diffScope: definition.diffScope ?? "line",
|
|
76664
|
+
id: rule,
|
|
76665
|
+
plugin,
|
|
76666
|
+
category: definition.category ?? null,
|
|
76667
|
+
recommendation: definition.recommendation ?? null,
|
|
76668
|
+
tags: definition.tags ?? [],
|
|
76669
|
+
defaultEnabled: definition.defaultEnabled ?? true
|
|
76670
|
+
};
|
|
76671
|
+
};
|
|
76672
|
+
const doesContextIntersectChanges = ({ sourceFile, owner, changes, isBoundary }) => {
|
|
76673
|
+
const startLine = sourceFile.getLineAndCharacterOfPosition(owner.getStart(sourceFile)).line + 1;
|
|
76674
|
+
const endLine = sourceFile.getLineAndCharacterOfPosition(owner.getEnd() - 1).line + 1;
|
|
76675
|
+
const childRanges = [];
|
|
76676
|
+
const collectChildren = (node) => {
|
|
76677
|
+
if (isBoundary(node)) {
|
|
76678
|
+
childRanges.push([sourceFile.getLineAndCharacterOfPosition(node.getStart(sourceFile)).line + 1, sourceFile.getLineAndCharacterOfPosition(node.getEnd() - 1).line + 1]);
|
|
76679
|
+
return;
|
|
76680
|
+
}
|
|
76681
|
+
typescriptBinding.forEachChild(node, collectChildren);
|
|
76682
|
+
};
|
|
76683
|
+
typescriptBinding.forEachChild(owner, collectChildren);
|
|
76684
|
+
for (const [changedStart, changedEnd] of changes.ranges) {
|
|
76685
|
+
let remainingStart = Math.max(startLine, changedStart);
|
|
76686
|
+
const remainingEnd = Math.min(endLine, changedEnd);
|
|
76687
|
+
for (const [childStart, childEnd] of childRanges) {
|
|
76688
|
+
if (childEnd < remainingStart) continue;
|
|
76689
|
+
if (childStart > remainingEnd) break;
|
|
76690
|
+
if (childStart > remainingStart) return true;
|
|
76691
|
+
remainingStart = Math.max(remainingStart, childEnd + 1);
|
|
76692
|
+
}
|
|
76693
|
+
if (remainingStart <= remainingEnd) return true;
|
|
76694
|
+
}
|
|
76695
|
+
return (changes.deletionLines ?? []).some((deletionLine) => deletionLine >= startLine && deletionLine < endLine && !childRanges.some(([childStart, childEnd]) => deletionLine >= childStart && deletionLine < childEnd));
|
|
76696
|
+
};
|
|
76697
|
+
const diagnosticIntersectsLineRanges = (diagnostic, lineRanges) => {
|
|
76698
|
+
const diagnosticEndLine = Math.max(diagnostic.line, diagnostic.endLine ?? diagnostic.line);
|
|
76699
|
+
return lineRanges.some(([rangeStartLine, rangeEndLine]) => diagnostic.line <= rangeEndLine && diagnosticEndLine >= rangeStartLine);
|
|
76700
|
+
};
|
|
76701
|
+
const createChangedLineMatcher = ({ directory, changedLineRanges, contextual = false }) => {
|
|
76702
|
+
const changesByFile = new Map(changedLineRanges.map((entry) => [path$1$1.resolve(directory, entry.file.replaceAll("\\", "/")), entry]));
|
|
76703
|
+
const sourceFiles = /* @__PURE__ */ new Map();
|
|
76704
|
+
return (diagnostic) => {
|
|
76705
|
+
const filePath = path$1$1.resolve(directory, diagnostic.filePath.replaceAll("\\", "/"));
|
|
76706
|
+
const changes = changesByFile.get(filePath);
|
|
76707
|
+
if (!changes) return false;
|
|
76708
|
+
if (diagnosticIntersectsLineRanges(diagnostic, changes.ranges)) return true;
|
|
76709
|
+
if (!contextual) return false;
|
|
76710
|
+
const scope = getRuleMetadata(diagnostic.plugin, diagnostic.rule)?.diffScope ?? "line";
|
|
76711
|
+
if (scope === "file") return true;
|
|
76712
|
+
if (scope === "line" || !/\.[cm]?[jt]sx?$/i.test(filePath)) return false;
|
|
76713
|
+
if (!sourceFiles.has(filePath)) try {
|
|
76714
|
+
const sourceFile = typescriptBinding.createSourceFile(filePath, fs$1$2.readFileSync(filePath, "utf8"), typescriptBinding.ScriptTarget.Latest, true, getTypescriptScriptKind(filePath));
|
|
76715
|
+
const hasParseErrors = "parseDiagnostics" in sourceFile && Array.isArray(sourceFile.parseDiagnostics) && sourceFile.parseDiagnostics.length > 0;
|
|
76716
|
+
sourceFiles.set(filePath, hasParseErrors ? null : sourceFile);
|
|
76717
|
+
} catch {
|
|
76718
|
+
sourceFiles.set(filePath, null);
|
|
76719
|
+
}
|
|
76720
|
+
const sourceFile = sourceFiles.get(filePath);
|
|
76721
|
+
if (!sourceFile) return false;
|
|
76722
|
+
const sourceBuffer = Buffer.from(sourceFile.text);
|
|
76723
|
+
const byteOffset = diagnostic.offset ?? utf8OffsetFromSourcePosition(sourceBuffer, diagnostic.line, diagnostic.column - 1);
|
|
76724
|
+
if (byteOffset === null || byteOffset < 0 || byteOffset >= sourceBuffer.length) return false;
|
|
76725
|
+
const position = sourceBuffer.subarray(0, byteOffset).toString("utf8").length;
|
|
76726
|
+
const isBoundary = (node) => scope === "function" ? typescriptBinding.isFunctionLike(node) : typescriptBinding.isJsxElement(node) || typescriptBinding.isJsxSelfClosingElement(node) || typescriptBinding.isJsxFragment(node);
|
|
76727
|
+
let owner = null;
|
|
76728
|
+
const findOwner = (node) => {
|
|
76729
|
+
if (position < node.getStart(sourceFile) || position >= node.getEnd()) return;
|
|
76730
|
+
if (isBoundary(node)) owner = node;
|
|
76731
|
+
typescriptBinding.forEachChild(node, findOwner);
|
|
76732
|
+
};
|
|
76733
|
+
findOwner(sourceFile);
|
|
76734
|
+
if (!owner) return false;
|
|
76735
|
+
return doesContextIntersectChanges({
|
|
76736
|
+
sourceFile,
|
|
76737
|
+
owner,
|
|
76738
|
+
changes,
|
|
76739
|
+
isBoundary
|
|
76740
|
+
});
|
|
76741
|
+
};
|
|
76742
|
+
};
|
|
76647
76743
|
/**
|
|
76648
76744
|
* Array-shaped wrapper over `buildDiagnosticPipeline` for legacy
|
|
76649
76745
|
* callers and tests. Production code uses the streaming pipeline
|
|
@@ -76665,26 +76761,6 @@ const mergeAndFilterDiagnostics = (mergedDiagnostics, directory, userConfig, rea
|
|
|
76665
76761
|
}
|
|
76666
76762
|
return dedupeRelatedDiagnostics(result);
|
|
76667
76763
|
};
|
|
76668
|
-
const lookupOwnRule = (rule) => Object.hasOwn(REACT_DOCTOR_RULE_REGISTRY, rule) ? REACT_DOCTOR_RULE_REGISTRY[rule] : void 0;
|
|
76669
|
-
/**
|
|
76670
|
-
* Returns presentation metadata for `<plugin>/<rule>`, or `null` when the
|
|
76671
|
-
* rule is not part of the bundled react-doctor plugin (e.g. an adopted
|
|
76672
|
-
* `eslint` / `unicorn` rule folded in via the user's lint config — those
|
|
76673
|
-
* carry their own help/url on the diagnostic instead).
|
|
76674
|
-
*/
|
|
76675
|
-
const getRuleMetadata = (plugin, rule) => {
|
|
76676
|
-
if (plugin !== "react-doctor") return null;
|
|
76677
|
-
const definition = lookupOwnRule(rule);
|
|
76678
|
-
if (!definition) return null;
|
|
76679
|
-
return {
|
|
76680
|
-
id: rule,
|
|
76681
|
-
plugin,
|
|
76682
|
-
category: definition.category ?? null,
|
|
76683
|
-
recommendation: definition.recommendation ?? null,
|
|
76684
|
-
tags: definition.tags ?? [],
|
|
76685
|
-
defaultEnabled: definition.defaultEnabled ?? true
|
|
76686
|
-
};
|
|
76687
|
-
};
|
|
76688
76764
|
/**
|
|
76689
76765
|
* Canonical URL for a rule's documentation page — its reviewer-tested fix
|
|
76690
76766
|
* recipe rendered for humans — served at
|
|
@@ -77095,7 +77171,7 @@ const makeNoopConsole = () => ({
|
|
|
77095
77171
|
});
|
|
77096
77172
|
//#endregion
|
|
77097
77173
|
//#region src/cli/utils/version.ts
|
|
77098
|
-
const VERSION = "0.9.17-dev.
|
|
77174
|
+
const VERSION = "0.9.17-dev.695e46e";
|
|
77099
77175
|
//#endregion
|
|
77100
77176
|
//#region src/cli/utils/json-mode.ts
|
|
77101
77177
|
let context = null;
|
|
@@ -77437,7 +77513,7 @@ const recordDistribution = (name, value, options = {}) => {
|
|
|
77437
77513
|
} catch {}
|
|
77438
77514
|
};
|
|
77439
77515
|
//#endregion
|
|
77440
|
-
export { buildRuleSeverityControls as $,
|
|
77516
|
+
export { buildRuleSeverityControls as $, scrubSensitivePaths as $t, Files as A, mergeAll$1 as An, hasSupportedFrameworkOrLibrary as At, PerFileLintCacheEnabled as B, messageFromUnknown as Bn, listSourceFilesCooperative as Bt, ACTION_INPUT_ENVIRONMENT_VARIABLES as C, provideService as Cn, getChangedLineRanges as Ct, isCodingAgentEnvironment as D, try_ as Dn, getRuleMetadata as Dt, isCiOrCodingAgentEnvironment as E, sync as En, getEquivalentRuleKeys as Et, Linter as F, fail$5 as Fn, isReactDoctorError as Ft, SidecarLintCacheEnabled as G, isPlainObject as Gn, mergeAndFilterDiagnostics as Gt, Project as H, isDirectory as Hn, loadConfigWithSource as Ht, Maintainability as I, void_$1 as In, isSameRuleKey as It, anonymizeInPlace as J, resolveGithubActionsScoreMetadata as Jt, StagedFiles as K, mergeReactDoctorConfigs as Kt, NodeResolver as L, ParentSpan as Ln, isScanComplete as Lt, InvocationCaches as M, succeed$3 as Mn, highlighter as Mt, LEGACY_CONFIG_FILENAME as N, close as Nn, isPathInsideDirectory as Nt, Config as O, void_ as On, groupBy as Ot, LintPartialFailures as P, makeUnsafe$5 as Pn, isProjectDiscoveryError as Pt, buildRuleDocsUrl as Q, runInspect as Qt, OxlintConcurrency as R, isMonorepoRoot as Rn, layerObservability as Rt, isDebugFlagEnabled as S, provideContext as Sn, getBaselineDiffPlan as St, isCiEnvironment as T, runSync as Tn, getDiffInfo as Tt, Reporter as U, isErrnoException as Un, mapWithConcurrency as Ut, Progress as V, toCanonicalPath as Vn, listWorkspacePackages as Vt, Score as W, isFile as Wn, materializeSourceTree as Wt, atomicWriteJson as X, resolveScanTarget as Xt, anonymizeText as Y, resolveLintBatchOrdering as Yt, buildJsonReport as Z, restoreLegacyThrow as Zt, VERSION as _, makeSpan$1 as _n, findGitRepositoryRoot as _t, isEnvFlagEnabled as a, warmDuplicateJsxWorker as an, collectSourceFilesByDirectory as at, isNonInteractiveEnvironment as b, promise as bn, formatErrorChain as bt, setSentryProjectInfo as c, error as cn, countOptInProjectRuleSelections as ct, isJsonModeActive as d, warn$1 as dn, createOxlintSpawnSlots as dt, setColorEnabled as en, buildSkippedChecks as et, setJsonReportDirectory as f, Diagnostic as fn, detectAiTrainingEnvironment as ft, writeJsonReport as g, gen as gn, filterSourceFiles as gt, writeJsonErrorReport as h, make$30 as hn, filterPathsOutsideDirectories as ht, isTelemetryEnabled as i, validateConfigTypes as in, clearConfigCache as it, Git as j, provide$2 as jn, hashFileContents as jt, DIAGNOSTIC_DELTA_IDENTITY as k, buildWithScope as kn, hasPublishedFixRecipe as kt, getRunId as l, info as ln, createChangedLineMatcher as lt, writeJsonCancellationReport as m, decodeUnknownSync as mn, filterDiagnosticsForSurface as mt, recordDistribution as n, summarizeDiagnostics as nn, canonicalizeUserRuleKey as nt, buildSentryScope as o, warmOxlintWorkerPool as on, computeConfigFingerprint as ot, setJsonReportMode as p, JsonReport as pn, discoverSupportedSubprojects as pt, SupplyChain as q, remainingDeadlineBudgetMs as qt, toSpanAttributes as r, toRelativePath as rn, classifyFileContext as rt, buildSentryProjectContext as s, Console as sn, computeDiagnosticDelta as st, recordCount as t, shouldUseMaintainabilityLayer as tn, calculateScore as tt, enableJsonMode as u, log as un, createInvocationCaches as ut, makeNoopConsole as v, map$3 as vn, findLegacyConfig as vt, detectRunnerOs as w, runPromise as wn, getDiagnosticRuleIdentity as wt, isGitHookEnvironment as x, provide as xn, formatReactDoctorError as xt, CliInputError as y, orElseSucceed as yn, fingerprintDiagnosticEvidence as yt, OxlintSpawnSlots as z, yieldToEventLoop as zn, listSourceFiles as zt };
|
|
77441
77517
|
|
|
77442
|
-
//# sourceMappingURL=record-metric-
|
|
77443
|
-
//# debugId=
|
|
77518
|
+
//# sourceMappingURL=record-metric-DcSvz1k4.js.map
|
|
77519
|
+
//# debugId=60081890-ce9e-5132-8ff2-6180d62dcf24
|
|
@@ -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]="
|
|
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]="d3bb8668-c0df-52cd-9208-f8159dcca4e3")}catch(e){}}();
|
|
3
3
|
import { S as SENTRY_FLUSH_TIMEOUT_MS, u as METRIC } from "./constants-Bwylqy0B.js";
|
|
4
|
-
import {
|
|
5
|
-
import { i as getSentry, n as shutdownTelemetry, o as isExpectedUserError } from "./telemetry-runtime-
|
|
4
|
+
import { Ft as isReactDoctorError, l as getRunId, o as buildSentryScope, t as recordCount } from "./record-metric-DcSvz1k4.js";
|
|
5
|
+
import { i as getSentry, n as shutdownTelemetry, o as isExpectedUserError } from "./telemetry-runtime-BufSIW3d.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-BmvMTKij.js.map
|
|
65
|
+
//# debugId=d3bb8668-c0df-52cd-9208-f8159dcca4e3
|
|
@@ -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]="
|
|
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]="9cae8e91-3dfd-5942-baa5-09003db53943")}catch(e){}}();
|
|
3
3
|
import { m as REACT_DOCTOR_CONFIG_PROJECT_NAME, u as METRIC } from "./constants-Bwylqy0B.js";
|
|
4
|
-
import { t as recordCount } from "./record-metric-
|
|
5
|
-
import { u as isCommandAvailable } from "./install-github-workflow-
|
|
4
|
+
import { t as recordCount } from "./record-metric-DcSvz1k4.js";
|
|
5
|
+
import { u as isCommandAvailable } from "./install-github-workflow-DqIx2JgD.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-K7NFRSY6.js.map
|
|
293
|
+
//# debugId=9cae8e91-3dfd-5942-baa5-09003db53943
|
|
@@ -1,18 +1,18 @@
|
|
|
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]="2b8a2308-679c-5d62-9144-4797dcd6a5dc")}catch(e){}}();
|
|
3
3
|
import { E as TRACKED_FILE_FLAGS_GIT_ARGUMENTS, Ft as HTML_FILE_PATTERN, Ht as MAINTAINABILITY_SOURCE_FILE_PATTERN, Jt as OXLINT_NODE_REQUIREMENT, K as resolveReactDoctorCacheDir, Nt as GIT_SHOW_MAX_BUFFER_BYTES, Rt as JSX_FILE_PATTERN, St as ENTERPRISE_CONTACT_URL, Wt as MILLISECONDS_PER_SECOND, _t as DIAGNOSTIC_CATEGORY_BUCKETS, c as HEAD_SHA_GIT_ARGUMENTS, dn as SHARE_BASE_URL, h as REPOSITORY_ROOT_GIT_ARGUMENTS, i as BASELINE_FILES_TEMP_DIR_PREFIX, k as WORKTREE_STATUS_GIT_ARGUMENTS, q as resolveScanConcurrency, u as METRIC, ut as CI_URL, v as SCAN_RESULT_CACHE_FILENAME } from "./constants-Bwylqy0B.js";
|
|
4
4
|
import { t as isCacheGloballyDisabled } from "./is-cache-globally-disabled-BvdYcw6Q.js";
|
|
5
|
-
import { $ as buildRuleSeverityControls, A as Files,
|
|
6
|
-
import { t as getTelemetryContext } from "./telemetry-runtime-
|
|
5
|
+
import { $ as buildRuleSeverityControls, A as Files, An as mergeAll, B as PerFileLintCacheEnabled, Bt as listSourceFilesCooperative, C as ACTION_INPUT_ENVIRONMENT_VARIABLES, Cn as provideService, Dn as try_, Dt as getRuleMetadata, E as isCiOrCodingAgentEnvironment, En as sync, F as Linter, Ft as isReactDoctorError, G as SidecarLintCacheEnabled, Gt as mergeAndFilterDiagnostics, H as Project, Hn as isDirectory, I as Maintainability, Jt as resolveGithubActionsScoreMetadata, Kt as mergeReactDoctorConfigs, L as NodeResolver, Ln as ParentSpan, Lt as isScanComplete, M as InvocationCaches, Mn as succeed, Mt as highlighter, Nt as isPathInsideDirectory, O as Config, Ot as groupBy, P as LintPartialFailures, Q as buildRuleDocsUrl, Qt as runInspect, R as OxlintConcurrency, Rn as isMonorepoRoot, Sn as provideContext, T as isCiEnvironment, Tn as runSync, U as Reporter, Ut as mapWithConcurrency, V as Progress, Vt as listWorkspacePackages, W as Score, Wn as isFile, Wt as materializeSourceTree, X as atomicWriteJson, Xt as resolveScanTarget, Yt as resolveLintBatchOrdering, Zt as restoreLegacyThrow, _ as VERSION, an as warmDuplicateJsxWorker, at as collectSourceFilesByDirectory, b as isNonInteractiveEnvironment, bn as promise, cn as error, ct as countOptInProjectRuleSelections, d as isJsonModeActive, dn as warn, dt as createOxlintSpawnSlots, et as buildSkippedChecks, fn as Diagnostic, gn as gen, gt as filterSourceFiles, ht as filterPathsOutsideDirectories, j as Git, jt as hashFileContents, k as DIAGNOSTIC_DELTA_IDENTITY, kt as hasPublishedFixRecipe, l as getRunId, lt as createChangedLineMatcher, mn as decodeUnknownSync, mt as filterDiagnosticsForSurface, n as recordDistribution, nn as summarizeDiagnostics, nt as canonicalizeUserRuleKey, on as warmOxlintWorkerPool, ot as computeConfigFingerprint, pt as discoverSupportedSubprojects, q as SupplyChain, qt as remainingDeadlineBudgetMs, r as toSpanAttributes, rt as classifyFileContext, sn as Console, st as computeDiagnosticDelta, t as recordCount, tn as shouldUseMaintainabilityLayer, tt as calculateScore, un as log, ut as createInvocationCaches, v as makeNoopConsole, vn as map, w as detectRunnerOs, wn as runPromise, wt as getDiagnosticRuleIdentity, xn as provide, y as CliInputError, yn as orElseSucceed, yt as fingerprintDiagnosticEvidence, z as OxlintSpawnSlots, zn as yieldToEventLoop, zt as listSourceFiles } from "./record-metric-DcSvz1k4.js";
|
|
6
|
+
import { t as getTelemetryContext } from "./telemetry-runtime-BufSIW3d.js";
|
|
7
7
|
import { t as activeScanAbortRegistry } from "./active-scan-abort-registry-CCTgal0O.js";
|
|
8
|
-
import { n as buildFooterLinkLines, t as buildSectionDivider } from "./build-section-divider-
|
|
8
|
+
import { n as buildFooterLinkLines, t as buildSectionDivider } from "./build-section-divider-BlNg8CJ3.js";
|
|
9
9
|
import { t as toForwardSlashes } from "./path-format-By20mo8A.js";
|
|
10
10
|
import { t as typescriptBinding } from "./_react-doctor_require-typescript-DXQDYeWK.js";
|
|
11
|
-
import { A as runGitAsync, C as isRecord, N as cliLogger, S as getPackageJsonPath, a as installReactDoctorScriptStep, c as spinner, j as runGitRaw, k as runGit, n as findNearestPackageDirectory, o as isSpinnerSilent, s as setSpinnerSilent } from "./install-doctor-script-
|
|
12
|
-
import { d as detectDefaultBranch, l as prompts, r as installReactDoctorWorkflow, u as isCommandAvailable } from "./install-github-workflow-
|
|
13
|
-
import { a as isValidBlockingLevel, c as openWorkflowPullRequest, l as stageWorkflowFile, o as pickBlockingLevel } from "./resolve-scope-
|
|
14
|
-
import { n as resetSentryRunState, r as withRunSpan, t as recordSentryProjectContext } from "./with-run-span-
|
|
15
|
-
import { h as detectAvailableAgents, t as reportWorkflowResult } from "./report-workflow-result-
|
|
11
|
+
import { A as runGitAsync, C as isRecord, N as cliLogger, S as getPackageJsonPath, a as installReactDoctorScriptStep, c as spinner, j as runGitRaw, k as runGit, n as findNearestPackageDirectory, o as isSpinnerSilent, s as setSpinnerSilent } from "./install-doctor-script-CzA3N60N.js";
|
|
12
|
+
import { d as detectDefaultBranch, l as prompts, r as installReactDoctorWorkflow, u as isCommandAvailable } from "./install-github-workflow-DqIx2JgD.js";
|
|
13
|
+
import { a as isValidBlockingLevel, c as openWorkflowPullRequest, l as stageWorkflowFile, o as pickBlockingLevel } from "./resolve-scope-DIgYBn32.js";
|
|
14
|
+
import { n as resetSentryRunState, r as withRunSpan, t as recordSentryProjectContext } from "./with-run-span-xUMrAJ_a.js";
|
|
15
|
+
import { h as detectAvailableAgents, t as reportWorkflowResult } from "./report-workflow-result-K7NFRSY6.js";
|
|
16
16
|
import { createRequire } from "node:module";
|
|
17
17
|
import * as fs$2 from "node:fs";
|
|
18
18
|
import fs, { mkdtempSync, rmSync } from "node:fs";
|
|
@@ -555,6 +555,7 @@ const buildScanAttributes = (input) => {
|
|
|
555
555
|
usedOutputDir: input.usedOutputDir,
|
|
556
556
|
ignoredTagCount: input.ignoredTagCount,
|
|
557
557
|
hasCustomConfig: input.hasCustomConfig,
|
|
558
|
+
customRulesOnly: input.userConfig?.customRulesOnly ?? false,
|
|
558
559
|
rulesConfigured: ruleKeys.length,
|
|
559
560
|
rulesDisabled: ruleKeys.filter((key) => ruleOverrides[key] === "off").length,
|
|
560
561
|
projectAnalysisRuleCount: countOptInProjectRuleSelections(buildRuleSeverityControls(input.userConfig)),
|
|
@@ -597,21 +598,9 @@ const recordRunEvent = (rootSpan, input) => {
|
|
|
597
598
|
} catch {}
|
|
598
599
|
};
|
|
599
600
|
//#endregion
|
|
600
|
-
//#region src/cli/utils/diagnostic-intersects-line-ranges.ts
|
|
601
|
-
const diagnosticIntersectsLineRanges = (diagnostic, lineRanges) => {
|
|
602
|
-
const diagnosticEndLine = Math.max(diagnostic.line, diagnostic.endLine ?? diagnostic.line);
|
|
603
|
-
return lineRanges.some(([rangeStartLine, rangeEndLine]) => diagnostic.line <= rangeEndLine && diagnosticEndLine >= rangeStartLine);
|
|
604
|
-
};
|
|
605
|
-
//#endregion
|
|
606
601
|
//#region src/cli/utils/filter-diagnostics-by-changed-lines.ts
|
|
607
602
|
const filterDiagnosticsByChangedLines = (input) => {
|
|
608
|
-
|
|
609
|
-
for (const entry of input.changedLineRanges) rangesByFile.set(toForwardSlashes(entry.file), entry.ranges);
|
|
610
|
-
return input.diagnostics.filter((diagnostic) => {
|
|
611
|
-
const relativePath = toForwardSlashes(path.isAbsolute(diagnostic.filePath) ? path.relative(input.directory, diagnostic.filePath) : diagnostic.filePath);
|
|
612
|
-
const ranges = rangesByFile.get(relativePath);
|
|
613
|
-
return ranges !== void 0 && diagnosticIntersectsLineRanges(diagnostic, ranges);
|
|
614
|
-
});
|
|
603
|
+
return input.diagnostics.filter(createChangedLineMatcher(input));
|
|
615
604
|
};
|
|
616
605
|
//#endregion
|
|
617
606
|
//#region src/cli/utils/resolve-invocation-oxlint-concurrency.ts
|
|
@@ -733,6 +722,7 @@ const resolveInspectOptions = (inputOptions, userConfig) => {
|
|
|
733
722
|
maxDurationMs: inputOptions.maxDurationMs ?? null,
|
|
734
723
|
baselineReport: inputOptions.baselineReport ?? null,
|
|
735
724
|
baseline: inputOptions.baseline ?? null,
|
|
725
|
+
contextual: inputOptions.contextual ?? false,
|
|
736
726
|
changedLineRanges: inputOptions.changedLineRanges ?? null,
|
|
737
727
|
supplyChainManifestChanged: inputOptions.supplyChainManifestChanged ?? false,
|
|
738
728
|
excludedProjectDirectories: inputOptions.excludedProjectDirectories ?? [],
|
|
@@ -1101,7 +1091,7 @@ const resolveWorkerTelemetry = (resolvedWorkerCount, pinnedConcurrency) => {
|
|
|
1101
1091
|
const silentConsole$2 = makeNoopConsole();
|
|
1102
1092
|
const deriveScope = (options) => {
|
|
1103
1093
|
if (options.baseline || options.baselineReport) return "changed";
|
|
1104
|
-
if (options.changedLineRanges !== null) return "lines";
|
|
1094
|
+
if (options.changedLineRanges !== null) return options.contextual ? "contextual" : "lines";
|
|
1105
1095
|
return options.includePaths.length > 0 ? "files" : "full";
|
|
1106
1096
|
};
|
|
1107
1097
|
const buildRunEventConfig = (options, userConfig, resolvedWorkerCount) => {
|
|
@@ -2223,6 +2213,7 @@ const buildScanResultCacheKey = async (input) => {
|
|
|
2223
2213
|
lintBatchOrdering: resolveLintBatchOrdering(),
|
|
2224
2214
|
baselineRef: input.options.baseline?.ref,
|
|
2225
2215
|
changedLineRanges: input.options.changedLineRanges ?? void 0,
|
|
2216
|
+
contextual: input.options.contextual ?? false,
|
|
2226
2217
|
noScore: input.options.noScore,
|
|
2227
2218
|
isCi: input.options.isCi,
|
|
2228
2219
|
suppressRendering: input.options.suppressRendering,
|
|
@@ -2519,6 +2510,7 @@ const runInspectWithRuntime = async (directory, options, userConfig, hasConfigOv
|
|
|
2519
2510
|
} else if (options.changedLineRanges !== null && isDiffMode) inspectDiagnostics = filterDiagnosticsByChangedLines({
|
|
2520
2511
|
directory,
|
|
2521
2512
|
diagnostics: headDiagnostics,
|
|
2513
|
+
contextual: options.contextual,
|
|
2522
2514
|
changedLineRanges: options.changedLineRanges
|
|
2523
2515
|
});
|
|
2524
2516
|
const baselineDegraded = (Boolean(options.baselineReport) || Boolean(options.baseline) && isDiffMode) && baselineDelta === void 0;
|
|
@@ -2917,8 +2909,8 @@ const resolveProjectChangedLineRanges = (rootDirectory, projectDirectory, ranges
|
|
|
2917
2909
|
const relativeProjectDirectory = resolveProjectRelativeDirectory(rootDirectory, projectDirectory);
|
|
2918
2910
|
if (relativeProjectDirectory === null) return [];
|
|
2919
2911
|
if (relativeProjectDirectory.length === 0) return ranges.map((entry) => ({
|
|
2920
|
-
|
|
2921
|
-
|
|
2912
|
+
...entry,
|
|
2913
|
+
file: toForwardSlashes(entry.file)
|
|
2922
2914
|
}));
|
|
2923
2915
|
const projectPrefix = `${relativeProjectDirectory}/`;
|
|
2924
2916
|
return ranges.flatMap((entry) => {
|
|
@@ -2926,8 +2918,8 @@ const resolveProjectChangedLineRanges = (rootDirectory, projectDirectory, ranges
|
|
|
2926
2918
|
if (!normalizedFilePath.startsWith(projectPrefix)) return [];
|
|
2927
2919
|
const projectRelativePath = normalizedFilePath.slice(projectPrefix.length);
|
|
2928
2920
|
return projectRelativePath.length > 0 ? [{
|
|
2929
|
-
|
|
2930
|
-
|
|
2921
|
+
...entry,
|
|
2922
|
+
file: projectRelativePath
|
|
2931
2923
|
}] : [];
|
|
2932
2924
|
});
|
|
2933
2925
|
};
|
|
@@ -3136,7 +3128,7 @@ const usedDiffAlias = (flags) => flags.diff !== void 0 && flags.diff !== false &
|
|
|
3136
3128
|
const usedScope = (flags) => typeof flags.scope === "string" && flags.scope.length > 0;
|
|
3137
3129
|
const validateIncludeUntrackedScope = (includeUntracked, scope) => {
|
|
3138
3130
|
if (!includeUntracked || scope !== void 0 && scope !== "full") return;
|
|
3139
|
-
throw new CliInputError("--include-untracked requires the files, changed, or
|
|
3131
|
+
throw new CliInputError("--include-untracked requires the files, changed, lines, or contextual scope (via --scope, --diff, or config).");
|
|
3140
3132
|
};
|
|
3141
3133
|
const validateFilePathSelectionFlags = (flags) => {
|
|
3142
3134
|
if (flags.staged || flags.changedFilesFrom !== void 0) throw new CliInputError("Cannot combine file path arguments with --staged or --changed-files-from. Use one file source.");
|
|
@@ -3145,10 +3137,10 @@ const validateFilePathSelectionFlags = (flags) => {
|
|
|
3145
3137
|
if (flags.base !== void 0) throw new CliInputError("Cannot combine file path arguments with --base. The selected files do not need a Git base.");
|
|
3146
3138
|
};
|
|
3147
3139
|
const validateModeFlags = (flags) => {
|
|
3148
|
-
if (flags.baseline && (flags.staged || flags.scope === "lines" || flags.scope === "files")) throw new CliInputError("--baseline requires a full or changed scan; it cannot be combined with --staged.");
|
|
3140
|
+
if (flags.baseline && (flags.staged || flags.scope === "lines" || flags.scope === "contextual" || flags.scope === "files")) throw new CliInputError("--baseline requires a full or changed scan; it cannot be combined with --staged.");
|
|
3149
3141
|
if (usedScope(flags) && usedDiffAlias(flags)) throw new CliInputError("Cannot combine --scope and --diff; --diff is the deprecated alias.");
|
|
3150
3142
|
if (flags.staged && usedDiffAlias(flags)) throw new CliInputError("Cannot combine --staged and --diff; pick one mode.");
|
|
3151
|
-
if (flags.staged && (flags.scope === "full" || flags.scope === "changed")) throw new CliInputError(`Cannot combine --staged with --scope ${flags.scope}; use --scope files or --scope
|
|
3143
|
+
if (flags.staged && (flags.scope === "full" || flags.scope === "changed")) throw new CliInputError(`Cannot combine --staged with --scope ${flags.scope}; use --scope files, --scope lines, or --scope contextual, or drop --scope.`);
|
|
3152
3144
|
if (flags.includeUntracked && flags.staged) throw new CliInputError("Cannot combine --include-untracked with --staged; the git index never holds untracked files.");
|
|
3153
3145
|
if (flags.score && flags.json) throw new CliInputError("Cannot combine --score and --json; pick one output mode.");
|
|
3154
3146
|
if (flags.score && flags.telemetry === false) throw new CliInputError("Cannot combine --score with --no-telemetry; --score prints the score that --no-telemetry disables.");
|
|
@@ -3174,5 +3166,5 @@ const resolveScanExitCode = (input) => {
|
|
|
3174
3166
|
//#endregion
|
|
3175
3167
|
export { createInvocationInspect as A, hasIncompleteScoreAnalysis as B, detectLaunchableAgents as C, buildHandoffPayload as D, launchCliAgent as E, formatSkippedCheckLabel as F, hasLintHardFailure as G, buildNoScoreMessage as H, formatElapsedTime as I, formatFixRecipeLine as J, buildRulePriorityMap as K, printFooter as L, resolveMergeBaseRef as M, printHeadlessReport as N, collectProjectSourceFiles as O, pluralize as P, printDiagnosticsDump as R, setUpGitHubActions as S, copyToClipboard as T, buildEmptyReportMessage as U, filterDiagnosticsByCategories as V, resolveInvocationOxlintConcurrency as W, formatLearnMoreLine as Y, retryMissingProjectScores as _, validateModeFlags as a, filterScansForSurface as b, partitionProjectScanOutcomes as c, buildCodeFrame as d, resolveProjectScan as f, resolveProjectRelativeDirectory as g, resolveProjectSourceFilePaths as h, validateIncludeUntrackedScope as i, inspect as j, deduplicateProjectScans as k, discoverWorkspacePackages as l, resolveProjectDiffIncludePaths as m, formatSkippedProjectsMessage as n, resolveExcludedProjectDirectories as o, resolveProjectChangedLineRanges as p, buildSortedRuleGroups as q, validateFilePathSelectionFlags as r, projectManifestChanged as s, resolveScanExitCode as t, selectProjects as u, resolveWorkspaceDeadCodeOwner as v, CLI_AGENT_BINARIES as w, countUniqueScannedFiles as x, resolveCliInspectOptions as y, formatDiagnosticSite as z };
|
|
3176
3168
|
|
|
3177
|
-
//# sourceMappingURL=resolve-scan-exit-code-
|
|
3178
|
-
//# debugId=
|
|
3169
|
+
//# sourceMappingURL=resolve-scan-exit-code-KDrMkTrJ.js.map
|
|
3170
|
+
//# debugId=2b8a2308-679c-5d62-9144-4797dcd6a5dc
|
|
@@ -1,9 +1,9 @@
|
|
|
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 {
|
|
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]="e8cde451-9876-5890-8854-ca0b4ee10d91")}catch(e){}}();
|
|
3
|
+
import { Nt as isPathInsideDirectory, Vn as toCanonicalPath, gt as filterSourceFiles } from "./record-metric-DcSvz1k4.js";
|
|
4
4
|
import { t as toForwardSlashes } from "./path-format-By20mo8A.js";
|
|
5
|
-
import { N as cliLogger } from "./install-doctor-script-
|
|
6
|
-
import { d as detectDefaultBranch, f as runCommand, l as prompts, u as isCommandAvailable } from "./install-github-workflow-
|
|
5
|
+
import { N as cliLogger } from "./install-doctor-script-CzA3N60N.js";
|
|
6
|
+
import { d as detectDefaultBranch, f as runCommand, l as prompts, u as isCommandAvailable } from "./install-github-workflow-DqIx2JgD.js";
|
|
7
7
|
import * as path$1 from "node:path";
|
|
8
8
|
//#region src/cli/utils/open-workflow-pull-request.ts
|
|
9
9
|
const NEW_BRANCH_PREFIX = "react-doctor/add-github-actions";
|
|
@@ -223,7 +223,8 @@ const SCOPE_VALUES = new Set([
|
|
|
223
223
|
"full",
|
|
224
224
|
"files",
|
|
225
225
|
"changed",
|
|
226
|
-
"lines"
|
|
226
|
+
"lines",
|
|
227
|
+
"contextual"
|
|
227
228
|
]);
|
|
228
229
|
const isScopeValue = (value) => SCOPE_VALUES.has(value);
|
|
229
230
|
const coerceDeprecatedDiff = (value) => {
|
|
@@ -252,7 +253,7 @@ const resolveScope = (flags, userConfig) => {
|
|
|
252
253
|
base,
|
|
253
254
|
usedDeprecatedDiff: false
|
|
254
255
|
};
|
|
255
|
-
cliLogger.warn(`Invalid --scope "${flags.scope}". Expected one of: full, files, changed, lines. Ignoring.`);
|
|
256
|
+
cliLogger.warn(`Invalid --scope "${flags.scope}". Expected one of: full, files, changed, lines, contextual. Ignoring.`);
|
|
256
257
|
}
|
|
257
258
|
const flagDiff = coerceDeprecatedDiff(flags.diff);
|
|
258
259
|
if (flagDiff !== void 0) return {
|
|
@@ -266,7 +267,7 @@ const resolveScope = (flags, userConfig) => {
|
|
|
266
267
|
base,
|
|
267
268
|
usedDeprecatedDiff: false
|
|
268
269
|
};
|
|
269
|
-
cliLogger.warn(`Invalid scope "${userConfig.scope}" in config. Expected one of: full, files, changed, lines. Ignoring.`);
|
|
270
|
+
cliLogger.warn(`Invalid scope "${userConfig.scope}" in config. Expected one of: full, files, changed, lines, contextual. Ignoring.`);
|
|
270
271
|
}
|
|
271
272
|
const configDiff = coerceDeprecatedDiff(userConfig?.diff);
|
|
272
273
|
if (configDiff !== void 0) return {
|
|
@@ -333,5 +334,5 @@ const finalizeScope = async ({ requested, diffInfo, skipPrompts, isQuiet }) => {
|
|
|
333
334
|
//#endregion
|
|
334
335
|
export { isValidBlockingLevel as a, openWorkflowPullRequest as c, warnDeprecatedDiff as i, stageWorkflowFile as l, isScopeValue as n, pickBlockingLevel as o, resolveScope as r, resolveBlockingLevel as s, finalizeScope as t };
|
|
335
336
|
|
|
336
|
-
//# sourceMappingURL=resolve-scope-
|
|
337
|
-
//# debugId=
|
|
337
|
+
//# sourceMappingURL=resolve-scope-DIgYBn32.js.map
|
|
338
|
+
//# debugId=e8cde451-9876-5890-8854-ca0b4ee10d91
|
|
@@ -1,9 +1,9 @@
|
|
|
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]="57d7e930-9f4d-5e5b-9a3f-aa292839b975")}catch(e){}}();
|
|
3
3
|
import { dt as COMPILER_CLEANUP_BUCKET, ft as COMPILER_CLEANUP_RULE_KEYS, u as METRIC } from "./constants-Bwylqy0B.js";
|
|
4
|
-
import {
|
|
5
|
-
import { N as cliLogger, n as findNearestPackageDirectory } from "./install-doctor-script-
|
|
6
|
-
import { t as readObjectFile } from "./read-object-file-
|
|
4
|
+
import { Et as getEquivalentRuleKeys, Gn as isPlainObject, Ht as loadConfigWithSource, It as isSameRuleKey, Mt as highlighter, Q as buildRuleDocsUrl, in as validateConfigTypes, it as clearConfigCache, t as recordCount } from "./record-metric-DcSvz1k4.js";
|
|
5
|
+
import { N as cliLogger, n as findNearestPackageDirectory } from "./install-doctor-script-CzA3N60N.js";
|
|
6
|
+
import { t as readObjectFile } from "./read-object-file-Bl7a4v-9.js";
|
|
7
7
|
import * as fs$1 from "node:fs";
|
|
8
8
|
import * as path$1 from "node:path";
|
|
9
9
|
import { REACT_DOCTOR_RULES } from "oxlint-plugin-react-doctor/core";
|
|
@@ -578,5 +578,5 @@ const rulesUnignoreTagAction = async (tag, options) => {
|
|
|
578
578
|
//#endregion
|
|
579
579
|
export { rulesCategoryAction, rulesDisableAction, rulesEnableAction, rulesExplainAction, rulesIgnoreTagAction, rulesListAction, rulesSetAction, rulesUnignoreTagAction };
|
|
580
580
|
|
|
581
|
-
//# sourceMappingURL=rules-
|
|
582
|
-
//# debugId=
|
|
581
|
+
//# sourceMappingURL=rules-H0yqeV5v.js.map
|
|
582
|
+
//# debugId=57d7e930-9f4d-5e5b-9a3f-aa292839b975
|