react-doctor 0.9.17-dev.fe5ed09 → 0.9.18-dev.84ad0c8
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 -74
- package/dist/{build-section-divider-jdDJ0_Vv.js → build-section-divider-B-0Npb8u.js} +5 -5
- package/dist/{ci-B69AXoJ9.js → ci-9ON49Bu6.js} +24 -14
- package/dist/cli.js +41 -32
- package/dist/{constants-DHn5rUeg.js → constants-ClqojoT2.js} +8 -5
- package/dist/constants-DNh19qg9.js +2 -2
- package/dist/{design-tfgkvQeX.js → design-BeVEhCLv.js} +4 -4
- package/dist/duplicate-jsx-worker.js +3 -3
- package/dist/{exit-gracefully-DZR14OKB.js → exit-gracefully-D2FYEGJS.js} +6 -6
- package/dist/{handle-error-Bj42p4Sw.js → handle-error-BsqqJmAO.js} +6 -6
- package/dist/index.d.ts +14 -6
- package/dist/index.js +334 -58
- package/dist/{inspect-CvENw7Ib.js → inspect-DwCSMHsS.js} +31 -23
- package/dist/{install-BczXj1aK.js → install-CpxB4W1u.js} +10 -10
- package/dist/{install-doctor-script-D2671Liy.js → install-doctor-script-D7sGRKum.js} +5 -5
- package/dist/{install-github-workflow-CRfLqBmy.js → install-github-workflow-CvZGQWwF.js} +21 -8
- package/dist/{install-react-doctor-DFwguFs-.js → install-react-doctor-DeX8yk4x.js} +9 -9
- package/dist/{is-cache-globally-disabled-DDlh_f1u.js → is-cache-globally-disabled-DnyI809X.js} +4 -4
- package/dist/{jsx-runtime-DcVXAnkV.js → jsx-runtime-DQ-tKHOv.js} +6 -6
- package/dist/{print-branded-header-DBVtv5Tr.js → print-branded-header-5sESdKnm.js} +4 -4
- package/dist/{prompt-runtime-scan-url-DbZhGuOm.js → prompt-runtime-scan-url-DGhmSMFv.js} +5 -5
- package/dist/{read-object-file-DB530_Fl.js → read-object-file-DEVTo4EH.js} +4 -4
- package/dist/{record-metric-B03OYFof.js → record-metric-C-qingN9.js} +439 -84
- package/dist/{report-error-BulWOi7r.js → report-error-HfFXI5vd.js} +6 -6
- package/dist/{report-workflow-result-Bu3ua6IL.js → report-workflow-result-Cm0adY-X.js} +8 -7
- package/dist/{should-fail-scan-gate-D2-LV9oP.js → resolve-scan-exit-code-BY2bQZUP.js} +37 -41
- package/dist/{resolve-scope-DpwfVe0L.js → resolve-scope-BajZr0FF.js} +10 -9
- package/dist/{rules-lsAfRYRW.js → rules-Cb5XoHlz.js} +7 -7
- package/dist/{run-scan-app-BKSG5wy7.js → run-scan-app-BMi9Dk74.js} +33 -23
- package/dist/{runtime-scan-BdEQdmNB.js → runtime-scan-y3m8LYbU.js} +10 -10
- package/dist/{sanitize-runtime-url-CR1L-ZVf.js → sanitize-runtime-url-RakASgaA.js} +4 -4
- package/dist/{scan-CSS_HWO-.js → scan-BMNqmD4X.js} +14 -13
- package/dist/{should-skip-prompts-lOJNuSDr.js → should-skip-prompts-xpfkejus.js} +4 -4
- package/dist/{should-use-tui-DmVzga6l.js → should-use-tui-BabyKy3n.js} +4 -4
- package/dist/skills/react-doctor/SKILL.md +19 -8
- package/dist/skills/react-doctor/references/explain.md +5 -0
- package/dist/{start-scan-preamble-BPz3nzCQ.js → start-scan-preamble-DgEn5GlY.js} +5 -5
- package/dist/start-scan-preamble.js +3 -3
- package/dist/{telemetry-runtime-Dp_wDVEZ.js → telemetry-runtime-UgvDG9lo.js} +7 -7
- package/dist/{version-BPQK2YWB.js → version-BEf9DbV_.js} +5 -5
- package/dist/{why-i1SnenZb.js → why-BWgYOBs8.js} +4 -4
- package/dist/{with-run-span--F1xHym-.js → with-run-span-DTnbt4wj.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]="13c7ffa9-5f60-5a29-97b7-32744ba6032c")}catch(e){}}();
|
|
3
3
|
import { i as __toESM, r as __require, t as __commonJSMin } from "./chunk-ChKA3wi6.js";
|
|
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-
|
|
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-ClqojoT2.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_RULES, REACT_DOCTOR_OPT_IN_PROJECT_RULE_IDS, REACT_DOCTOR_PROJECT_RULES, REACT_DOCTOR_RULES, REACT_DOCTOR_RULE_REGISTRY, REACT_DOCTOR_SCAN_RULES, classifySecurityScanFile, collectCrossFileDependencyProbes, resetManifestCaches, shouldReadSecurityScanContent } from "oxlint-plugin-react-doctor/core";
|
|
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_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-BQdHXHtB.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,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-Bzyc0NTl.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);
|
|
@@ -1083,7 +1083,7 @@ const detectDuplicateJsxSubtreesCooperative = async (sourceReader, options = {})
|
|
|
1083
1083
|
});
|
|
1084
1084
|
};
|
|
1085
1085
|
//#endregion
|
|
1086
|
-
//#region ../core/dist/detect-react-compiler-
|
|
1086
|
+
//#region ../core/dist/detect-react-compiler-CPYDw8CR.js
|
|
1087
1087
|
const NEXT_CONFIG_FILENAMES = [
|
|
1088
1088
|
"next.config.js",
|
|
1089
1089
|
"next.config.mjs",
|
|
@@ -5202,6 +5202,37 @@ const mapInput = /* @__PURE__ */ dual(2, (self, f) => make$37((b1, b2) => self(f
|
|
|
5202
5202
|
*/
|
|
5203
5203
|
const isGreaterThan$1 = (O) => dual(2, (self, that) => O(self, that) === 1);
|
|
5204
5204
|
/**
|
|
5205
|
+
* Checks whether one value is greater than or equal to another according to the given order.
|
|
5206
|
+
*
|
|
5207
|
+
* **When to use**
|
|
5208
|
+
*
|
|
5209
|
+
* Use when you need a boolean greater-than-or-equal predicate using an
|
|
5210
|
+
* `Order`.
|
|
5211
|
+
*
|
|
5212
|
+
* **Details**
|
|
5213
|
+
*
|
|
5214
|
+
* Returns `true` if the order returns `1` or `0`, and returns `false` only if
|
|
5215
|
+
* the order returns `-1`.
|
|
5216
|
+
*
|
|
5217
|
+
* **Example** (Checking greater-than-or-equal comparisons)
|
|
5218
|
+
*
|
|
5219
|
+
* ```ts
|
|
5220
|
+
* import { Order } from "effect"
|
|
5221
|
+
*
|
|
5222
|
+
* const isGreaterThanOrEqualToNumber = Order.isGreaterThanOrEqualTo(Order.Number)
|
|
5223
|
+
*
|
|
5224
|
+
* console.log(isGreaterThanOrEqualToNumber(2, 1)) // true
|
|
5225
|
+
* console.log(isGreaterThanOrEqualToNumber(1, 1)) // true
|
|
5226
|
+
* console.log(isGreaterThanOrEqualToNumber(1, 2)) // false
|
|
5227
|
+
* ```
|
|
5228
|
+
*
|
|
5229
|
+
* @see {@link isGreaterThan} for strict greater than
|
|
5230
|
+
* @see {@link isLessThanOrEqualTo} for less than or equal
|
|
5231
|
+
* @category predicates
|
|
5232
|
+
* @since 4.0.0
|
|
5233
|
+
*/
|
|
5234
|
+
const isGreaterThanOrEqualTo$1 = (O) => dual(2, (self, that) => O(self, that) !== -1);
|
|
5235
|
+
/**
|
|
5205
5236
|
* Returns the maximum of two values according to the given order. If they are equal, returns the first argument.
|
|
5206
5237
|
*
|
|
5207
5238
|
* **When to use**
|
|
@@ -22707,6 +22738,203 @@ function link$1() {
|
|
|
22707
22738
|
};
|
|
22708
22739
|
}
|
|
22709
22740
|
/**
|
|
22741
|
+
* Creates a custom validation filter from a predicate function.
|
|
22742
|
+
*
|
|
22743
|
+
* **Details**
|
|
22744
|
+
*
|
|
22745
|
+
* The predicate receives the decoded input value, the schema AST, and parse
|
|
22746
|
+
* options, and returns a `FilterOutput`. Non-success outputs are normalized into
|
|
22747
|
+
* schema issues. The `annotations` parameter annotates the filter itself; with
|
|
22748
|
+
* the default formatter, failures use `message` first, `expected` second, and
|
|
22749
|
+
* `<filter>` when neither is provided.
|
|
22750
|
+
*
|
|
22751
|
+
* When `abort` is `true`, parsing stops after this filter fails instead of
|
|
22752
|
+
* collecting later check failures.
|
|
22753
|
+
*
|
|
22754
|
+
* **Example** (Reporting failure at a nested path)
|
|
22755
|
+
*
|
|
22756
|
+
* ```ts
|
|
22757
|
+
* import { Schema } from "effect"
|
|
22758
|
+
*
|
|
22759
|
+
* const schema = Schema.Struct({ password: Schema.String, confirmPassword: Schema.String }).check(
|
|
22760
|
+
* Schema.makeFilter((o) =>
|
|
22761
|
+
* o.password === o.confirmPassword
|
|
22762
|
+
* ? undefined
|
|
22763
|
+
* : { path: ["password"], issue: "password and confirmPassword must match" }
|
|
22764
|
+
* )
|
|
22765
|
+
* )
|
|
22766
|
+
*
|
|
22767
|
+
* console.log(String(Schema.decodeUnknownExit(schema)({ password: "123456", confirmPassword: "1234567" })))
|
|
22768
|
+
* // Failure(Cause([Fail(SchemaError: password and confirmPassword must match
|
|
22769
|
+
* // at ["password"])]))
|
|
22770
|
+
* ```
|
|
22771
|
+
*
|
|
22772
|
+
* **Example** (Reporting multiple failures at once)
|
|
22773
|
+
*
|
|
22774
|
+
* ```ts
|
|
22775
|
+
* import { Schema } from "effect"
|
|
22776
|
+
*
|
|
22777
|
+
* const schema = Schema.Struct({ a: Schema.Finite, b: Schema.Finite, c: Schema.Finite }).check(
|
|
22778
|
+
* Schema.makeFilter((o) => {
|
|
22779
|
+
* const issues: Array<Schema.FilterIssue> = []
|
|
22780
|
+
* if (o.a > 0) {
|
|
22781
|
+
* if (o.b <= 0) issues.push({ path: ["b"], issue: "b must be greater than 0" })
|
|
22782
|
+
* if (o.c <= 0) issues.push({ path: ["c"], issue: "c must be greater than 0" })
|
|
22783
|
+
* }
|
|
22784
|
+
* return issues
|
|
22785
|
+
* })
|
|
22786
|
+
* )
|
|
22787
|
+
*
|
|
22788
|
+
* console.log(String(Schema.decodeUnknownExit(schema)({ a: 1, b: 0, c: 0 })))
|
|
22789
|
+
* // Failure(Cause([Fail(SchemaError: b must be greater than 0
|
|
22790
|
+
* // at ["b"]
|
|
22791
|
+
* // c must be greater than 0
|
|
22792
|
+
* // at ["c"])]))
|
|
22793
|
+
* ```
|
|
22794
|
+
*
|
|
22795
|
+
* @category constructors
|
|
22796
|
+
* @since 4.0.0
|
|
22797
|
+
*/
|
|
22798
|
+
const makeFilter = makeFilter$1;
|
|
22799
|
+
/**
|
|
22800
|
+
* Creates a greater-than (`>`) check for any ordered type from an
|
|
22801
|
+
* `Order.Order` instance.
|
|
22802
|
+
*
|
|
22803
|
+
* @category Order checks
|
|
22804
|
+
* @since 4.0.0
|
|
22805
|
+
*/
|
|
22806
|
+
function makeIsGreaterThan(options) {
|
|
22807
|
+
const gt = isGreaterThan$1(options.order);
|
|
22808
|
+
const formatter = options.formatter ?? format$1;
|
|
22809
|
+
return (exclusiveMinimum, annotations) => {
|
|
22810
|
+
return makeFilter((input) => gt(input, exclusiveMinimum), {
|
|
22811
|
+
expected: `a value greater than ${formatter(exclusiveMinimum)}`,
|
|
22812
|
+
arbitrary: { constraint: { ordered: {
|
|
22813
|
+
order: options.order,
|
|
22814
|
+
minimum: exclusiveMinimum,
|
|
22815
|
+
exclusiveMinimum: true
|
|
22816
|
+
} } },
|
|
22817
|
+
...options.annotate?.(exclusiveMinimum),
|
|
22818
|
+
...annotations
|
|
22819
|
+
});
|
|
22820
|
+
};
|
|
22821
|
+
}
|
|
22822
|
+
/**
|
|
22823
|
+
* Creates a greater-than-or-equal-to (`>=`) check for any ordered type from an
|
|
22824
|
+
* `Order.Order` instance.
|
|
22825
|
+
*
|
|
22826
|
+
* @category Order checks
|
|
22827
|
+
* @since 4.0.0
|
|
22828
|
+
*/
|
|
22829
|
+
function makeIsGreaterThanOrEqualTo(options) {
|
|
22830
|
+
const gte = isGreaterThanOrEqualTo$1(options.order);
|
|
22831
|
+
const formatter = options.formatter ?? format$1;
|
|
22832
|
+
return (minimum, annotations) => {
|
|
22833
|
+
return makeFilter((input) => gte(input, minimum), {
|
|
22834
|
+
expected: `a value greater than or equal to ${formatter(minimum)}`,
|
|
22835
|
+
arbitrary: { constraint: { ordered: {
|
|
22836
|
+
order: options.order,
|
|
22837
|
+
minimum
|
|
22838
|
+
} } },
|
|
22839
|
+
...options.annotate?.(minimum),
|
|
22840
|
+
...annotations
|
|
22841
|
+
});
|
|
22842
|
+
};
|
|
22843
|
+
}
|
|
22844
|
+
function encodeNumberPayload(number) {
|
|
22845
|
+
if (!globalThis.Number.isFinite(number)) throw new globalThis.RangeError(`Expected a finite number, got ${format$1(number)}`);
|
|
22846
|
+
return number;
|
|
22847
|
+
}
|
|
22848
|
+
/**
|
|
22849
|
+
* Validates that a number is greater than the specified value (exclusive).
|
|
22850
|
+
*
|
|
22851
|
+
* **Details**
|
|
22852
|
+
*
|
|
22853
|
+
* JSON Schema:
|
|
22854
|
+
*
|
|
22855
|
+
* This check corresponds to the `exclusiveMinimum` constraint in JSON Schema.
|
|
22856
|
+
*
|
|
22857
|
+
* Arbitrary:
|
|
22858
|
+
*
|
|
22859
|
+
* When generating test data with fast-check, this applies an
|
|
22860
|
+
* `exclusiveMinimum` constraint to ensure generated numbers are greater than
|
|
22861
|
+
* the specified value.
|
|
22862
|
+
*
|
|
22863
|
+
* @category Number checks
|
|
22864
|
+
* @since 4.0.0
|
|
22865
|
+
*/
|
|
22866
|
+
const isGreaterThan = /* @__PURE__ */ makeIsGreaterThan({
|
|
22867
|
+
order: Number$5,
|
|
22868
|
+
annotate: (exclusiveMinimum) => ({
|
|
22869
|
+
representation: {
|
|
22870
|
+
id: "effect/schema/isGreaterThan",
|
|
22871
|
+
payload: { exclusiveMinimum: encodeNumberPayload(exclusiveMinimum) }
|
|
22872
|
+
},
|
|
22873
|
+
toJsonSchema: () => ({ exclusiveMinimum }),
|
|
22874
|
+
toCode: () => ({ runtime: `Schema.isGreaterThan(${format$1(exclusiveMinimum)})` })
|
|
22875
|
+
})
|
|
22876
|
+
});
|
|
22877
|
+
/**
|
|
22878
|
+
* Validates that a number is greater than or equal to the specified value
|
|
22879
|
+
* (inclusive).
|
|
22880
|
+
*
|
|
22881
|
+
* **Details**
|
|
22882
|
+
*
|
|
22883
|
+
* JSON Schema:
|
|
22884
|
+
*
|
|
22885
|
+
* This check corresponds to the `minimum` constraint in JSON Schema.
|
|
22886
|
+
*
|
|
22887
|
+
* Arbitrary:
|
|
22888
|
+
*
|
|
22889
|
+
* When generating test data with fast-check, this applies a `minimum` constraint
|
|
22890
|
+
* to ensure generated numbers are greater than or equal to the specified value.
|
|
22891
|
+
*
|
|
22892
|
+
* @category Number checks
|
|
22893
|
+
* @since 4.0.0
|
|
22894
|
+
*/
|
|
22895
|
+
const isGreaterThanOrEqualTo = /* @__PURE__ */ makeIsGreaterThanOrEqualTo({
|
|
22896
|
+
order: Number$5,
|
|
22897
|
+
annotate: (minimum) => ({
|
|
22898
|
+
representation: {
|
|
22899
|
+
id: "effect/schema/isGreaterThanOrEqualTo",
|
|
22900
|
+
payload: { minimum: encodeNumberPayload(minimum) }
|
|
22901
|
+
},
|
|
22902
|
+
toJsonSchema: () => ({ minimum }),
|
|
22903
|
+
toCode: () => ({ runtime: `Schema.isGreaterThanOrEqualTo(${format$1(minimum)})` })
|
|
22904
|
+
})
|
|
22905
|
+
});
|
|
22906
|
+
/**
|
|
22907
|
+
* Validates that a number is a safe integer (within the safe integer range
|
|
22908
|
+
* that can be exactly represented in JavaScript).
|
|
22909
|
+
*
|
|
22910
|
+
* **Details**
|
|
22911
|
+
*
|
|
22912
|
+
* JSON Schema:
|
|
22913
|
+
*
|
|
22914
|
+
* This check corresponds to the `type: "integer"` constraint in JSON Schema.
|
|
22915
|
+
*
|
|
22916
|
+
* Arbitrary:
|
|
22917
|
+
*
|
|
22918
|
+
* When generating test data with fast-check, this applies an `integer: true`
|
|
22919
|
+
* constraint to ensure generated numbers are integers.
|
|
22920
|
+
*
|
|
22921
|
+
* @category Integer checks
|
|
22922
|
+
* @since 4.0.0
|
|
22923
|
+
*/
|
|
22924
|
+
function isInt(annotations) {
|
|
22925
|
+
return makeFilter((n) => globalThis.Number.isSafeInteger(n), {
|
|
22926
|
+
expected: "an integer",
|
|
22927
|
+
representation: {
|
|
22928
|
+
id: "effect/schema/isInt",
|
|
22929
|
+
payload: null
|
|
22930
|
+
},
|
|
22931
|
+
toJsonSchema: () => ({ type: "integer" }),
|
|
22932
|
+
toCode: () => ({ runtime: "Schema.isInt()" }),
|
|
22933
|
+
arbitrary: { constraint: { integer: true } },
|
|
22934
|
+
...annotations
|
|
22935
|
+
});
|
|
22936
|
+
}
|
|
22937
|
+
/**
|
|
22710
22938
|
* Schema for values that hide sensitive information from error output and
|
|
22711
22939
|
* inspection.
|
|
22712
22940
|
*
|
|
@@ -69610,6 +69838,7 @@ const SECURITY_SCAN_MAX_FILE_SIZE_BYTES = 2 * 1024 * 1024;
|
|
|
69610
69838
|
const SECURITY_SCAN_MAX_BUNDLE_FILE_SIZE_BYTES = 8 * 1024 * 1024;
|
|
69611
69839
|
const SKIPPED_DIRECTORY_NAMES = new Set([
|
|
69612
69840
|
".git",
|
|
69841
|
+
".open-next",
|
|
69613
69842
|
".turbo",
|
|
69614
69843
|
".vercel",
|
|
69615
69844
|
"coverage",
|
|
@@ -70751,39 +70980,46 @@ var Files = class Files extends Service()("react-doctor/Files") {
|
|
|
70751
70980
|
};
|
|
70752
70981
|
};
|
|
70753
70982
|
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;
|
|
70983
|
+
const parseChangedLineRanges = (patch, includeDeletions = false) => {
|
|
70984
|
+
const changesByFile = /* @__PURE__ */ new Map();
|
|
70985
|
+
let currentChanges = null;
|
|
70764
70986
|
for (const line of patch.split("\n")) {
|
|
70987
|
+
if (includeDeletions && line.startsWith("rename to ")) {
|
|
70988
|
+
const file = line.slice(10);
|
|
70989
|
+
changesByFile.set(file, {
|
|
70990
|
+
file,
|
|
70991
|
+
ranges: [],
|
|
70992
|
+
deletionLines: []
|
|
70993
|
+
});
|
|
70994
|
+
}
|
|
70765
70995
|
if (line.startsWith("+++ ")) {
|
|
70766
70996
|
const target = line.slice(4).trim();
|
|
70767
70997
|
if (target === "/dev/null") {
|
|
70768
|
-
|
|
70998
|
+
currentChanges = null;
|
|
70769
70999
|
continue;
|
|
70770
71000
|
}
|
|
70771
71001
|
const file = target.startsWith("b/") ? target.slice(2) : target;
|
|
70772
|
-
|
|
70773
|
-
|
|
71002
|
+
currentChanges = changesByFile.get(file) ?? {
|
|
71003
|
+
file,
|
|
71004
|
+
ranges: [],
|
|
71005
|
+
deletionLines: []
|
|
71006
|
+
};
|
|
71007
|
+
changesByFile.set(file, currentChanges);
|
|
70774
71008
|
continue;
|
|
70775
71009
|
}
|
|
70776
|
-
if (
|
|
71010
|
+
if (currentChanges === null) continue;
|
|
70777
71011
|
const hunk = HUNK_HEADER_PATTERN.exec(line);
|
|
70778
71012
|
if (hunk === null) continue;
|
|
70779
71013
|
const start = Number(hunk[1]);
|
|
70780
71014
|
const lineCount = hunk[2] === void 0 ? 1 : Number(hunk[2]);
|
|
70781
|
-
if (lineCount
|
|
70782
|
-
|
|
71015
|
+
if (lineCount === 0) {
|
|
71016
|
+
if (includeDeletions) currentChanges.deletionLines.push(start);
|
|
71017
|
+
} else currentChanges.ranges.push([start, start + lineCount - 1]);
|
|
70783
71018
|
}
|
|
70784
|
-
return [...
|
|
71019
|
+
return [...changesByFile.values()].filter((entry) => entry.ranges.length > 0 || includeDeletions).map(({ file, ranges, deletionLines }) => ({
|
|
70785
71020
|
file,
|
|
70786
|
-
ranges
|
|
71021
|
+
ranges,
|
|
71022
|
+
...deletionLines.length > 0 ? { deletionLines } : {}
|
|
70787
71023
|
}));
|
|
70788
71024
|
};
|
|
70789
71025
|
const trimOrNull = (value) => {
|
|
@@ -71268,7 +71504,7 @@ var Git = class Git extends Service()("react-doctor/Git") {
|
|
|
71268
71504
|
stdout: result.stdout
|
|
71269
71505
|
};
|
|
71270
71506
|
}).pipe(withSpan("Git.grep")),
|
|
71271
|
-
changedLineRanges: ({ directory, baseRef, cached, files, includeUntracked = false }) => gen(function* () {
|
|
71507
|
+
changedLineRanges: ({ directory, baseRef, cached, files, includeUntracked = false, includeDeletions = false }) => gen(function* () {
|
|
71272
71508
|
if (files.length === 0) return [];
|
|
71273
71509
|
if (baseRef !== void 0 && !isSafeGitRevision(baseRef)) return null;
|
|
71274
71510
|
const result = yield* runGit(directory, [
|
|
@@ -71283,7 +71519,7 @@ var Git = class Git extends Service()("react-doctor/Git") {
|
|
|
71283
71519
|
...files
|
|
71284
71520
|
]);
|
|
71285
71521
|
if (result.status !== 0) return null;
|
|
71286
|
-
const changedLineRanges = parseChangedLineRanges(result.stdout);
|
|
71522
|
+
const changedLineRanges = parseChangedLineRanges(result.stdout, includeDeletions);
|
|
71287
71523
|
if (cached || !includeUntracked) return changedLineRanges;
|
|
71288
71524
|
const untrackedFilePaths = yield* listUntrackedFilePaths(directory, files);
|
|
71289
71525
|
if (untrackedFilePaths === null) return changedLineRanges;
|
|
@@ -71723,6 +71959,7 @@ const normalizeConfigForHash = (config) => {
|
|
|
71723
71959
|
const clone = JSON.parse(JSON.stringify(config));
|
|
71724
71960
|
if (clone?.settings?.["react-doctor"]) {
|
|
71725
71961
|
const reactDoctorSettings = clone.settings["react-doctor"];
|
|
71962
|
+
delete reactDoctorSettings.diagnosticContextDirectory;
|
|
71726
71963
|
reactDoctorSettings.rootDirectory = ROOT_DIRECTORY_PLACEHOLDER;
|
|
71727
71964
|
if (Array.isArray(reactDoctorSettings.unpluginAutoImportRootDirectories)) reactDoctorSettings.unpluginAutoImportRootDirectories = [ROOT_DIRECTORY_PLACEHOLDER];
|
|
71728
71965
|
}
|
|
@@ -71884,7 +72121,7 @@ const buildUserPluginRules = (userPlugin, severityControls) => {
|
|
|
71884
72121
|
}
|
|
71885
72122
|
return enabled;
|
|
71886
72123
|
};
|
|
71887
|
-
const createOxlintConfig = ({ pluginPath, project, customRulesOnly = false, extendsPaths = [], ignoredTags = /* @__PURE__ */ new Set(), includedTags = /* @__PURE__ */ new Set(), includeTagDefaults = false, runtimeGlobals, unpluginAutoImportGlobalScopes, serverAuthFunctionNames, projectIndexModuleSources, severityControls, adoptedSettings = {}, userPlugins = [], disableReactHooksJsPlugin = false, ruleSelection, sidecarRuleIdFilter }) => {
|
|
72124
|
+
const createOxlintConfig = ({ pluginPath, diagnosticContextDirectory, project, customRulesOnly = false, extendsPaths = [], ignoredTags = /* @__PURE__ */ new Set(), includedTags = /* @__PURE__ */ new Set(), includeTagDefaults = false, runtimeGlobals, unpluginAutoImportGlobalScopes, serverAuthFunctionNames, projectIndexModuleSources, severityControls, adoptedSettings = {}, userPlugins = [], disableReactHooksJsPlugin = false, ruleSelection, sidecarRuleIdFilter }) => {
|
|
71888
72125
|
const hasIncludedTags = includedTags.size > 0;
|
|
71889
72126
|
const reactHooksJsPlugin = disableReactHooksJsPlugin || ruleSelection === "sidecar" || hasIncludedTags ? null : resolveReactHooksJsPlugin(project.hasReactCompiler || project.hasReactCompilerLintPlugin === true, customRulesOnly);
|
|
71890
72127
|
const reactCompilerRules = reactHooksJsPlugin ? applyRuleSeverityControls(filterRulesToAvailable(REACT_COMPILER_RULES, "react-hooks-js", reactHooksJsPlugin.availableRuleNames), severityControls) : {};
|
|
@@ -71904,10 +72141,10 @@ const createOxlintConfig = ({ pluginPath, project, customRulesOnly = false, exte
|
|
|
71904
72141
|
if (ruleSelection === "sidecar" && sidecarRuleIdFilter !== void 0 && !sidecarRuleIdFilter.has(registryEntry.id)) continue;
|
|
71905
72142
|
if (rule.isScanRule || rule.isProjectRule === true) continue;
|
|
71906
72143
|
if (registryEntry.id === "no-multi-component-file" && shouldUseExplicitNoMultiCompPolicy) continue;
|
|
71907
|
-
if (customRulesOnly && registryEntry.originallyExternal) continue;
|
|
71908
72144
|
if (rule.framework !== "global" && !rule.requires) continue;
|
|
71909
72145
|
if (!shouldEnableRule(rule.requires, rule.tags, capabilities, ignoredTags, rule.disabledWhen, includedTags)) continue;
|
|
71910
72146
|
const explicitRuleOverride = resolveRuleSeverityOverride({ ruleKey: registryEntry.key }, severityControls);
|
|
72147
|
+
if (customRulesOnly && registryEntry.originallyExternal && (explicitRuleOverride === void 0 || explicitRuleOverride === "off")) continue;
|
|
71911
72148
|
if (!shouldEnableRuleByDefaultStatus({
|
|
71912
72149
|
defaultEnabled: rule.defaultEnabled,
|
|
71913
72150
|
includeTagDefaults,
|
|
@@ -71944,6 +72181,7 @@ const createOxlintConfig = ({ pluginPath, project, customRulesOnly = false, exte
|
|
|
71944
72181
|
...adoptedSettings,
|
|
71945
72182
|
"react-doctor": {
|
|
71946
72183
|
portedRuleMode: "curated",
|
|
72184
|
+
...diagnosticContextDirectory ? { diagnosticContextDirectory } : {},
|
|
71947
72185
|
framework: project.framework,
|
|
71948
72186
|
rootDirectory: settingsRootDirectory,
|
|
71949
72187
|
capabilities: [...capabilities].sort(),
|
|
@@ -72617,22 +72855,14 @@ const runOxlintProbeJob = async (input) => {
|
|
|
72617
72855
|
if (!isProbeResult(parsed) || parsed.traces.length !== input.probeRequest.files.length) throw new Error("oxlint worker returned a malformed probe result");
|
|
72618
72856
|
return parsed;
|
|
72619
72857
|
};
|
|
72620
|
-
|
|
72621
|
-
|
|
72622
|
-
|
|
72623
|
-
|
|
72624
|
-
|
|
72625
|
-
|
|
72626
|
-
|
|
72627
|
-
|
|
72628
|
-
} catch {
|
|
72629
|
-
return;
|
|
72630
|
-
} finally {
|
|
72631
|
-
if (temporaryPath !== null) try {
|
|
72632
|
-
fs$1$2.rmSync(temporaryPath, { force: true });
|
|
72633
|
-
} catch {}
|
|
72634
|
-
}
|
|
72635
|
-
};
|
|
72858
|
+
var DiagnosticContextRangeSchema = class extends Class("DiagnosticContextRange")({
|
|
72859
|
+
offset: Number$1.check(isInt(), isGreaterThanOrEqualTo(0)),
|
|
72860
|
+
length: Number$1.check(isInt(), isGreaterThan(0))
|
|
72861
|
+
}) {};
|
|
72862
|
+
var CachedDiagnostic = class extends Class("CachedDiagnostic")({
|
|
72863
|
+
...Diagnostic.fields,
|
|
72864
|
+
contextRanges: optional(ArraySchema(DiagnosticContextRangeSchema))
|
|
72865
|
+
}) {};
|
|
72636
72866
|
const atomicWriteJson = (filePath, value) => {
|
|
72637
72867
|
try {
|
|
72638
72868
|
atomicWriteFile(filePath, JSON.stringify(value));
|
|
@@ -72640,7 +72870,7 @@ const atomicWriteJson = (filePath, value) => {
|
|
|
72640
72870
|
return;
|
|
72641
72871
|
}
|
|
72642
72872
|
};
|
|
72643
|
-
const validateDiagnostic$1 = decodeUnknownSync(
|
|
72873
|
+
const validateDiagnostic$1 = decodeUnknownSync(CachedDiagnostic);
|
|
72644
72874
|
const decodeDiagnostic = (raw) => {
|
|
72645
72875
|
const diagnostic = validateDiagnostic$1(raw);
|
|
72646
72876
|
return {
|
|
@@ -72760,7 +72990,7 @@ const createSidecarProbeAnswerResolver = (input) => {
|
|
|
72760
72990
|
toRelativePath
|
|
72761
72991
|
};
|
|
72762
72992
|
};
|
|
72763
|
-
const validateDiagnostic = decodeUnknownSync(
|
|
72993
|
+
const validateDiagnostic = decodeUnknownSync(CachedDiagnostic);
|
|
72764
72994
|
const isProbeKind = (value) => value === "content" || value === "exists";
|
|
72765
72995
|
const isProbeIdArray = (value, probeCount) => Array.isArray(value) && value.every((probeId) => typeof probeId === "number" && Number.isInteger(probeId) && probeId >= 0 && probeId < probeCount);
|
|
72766
72996
|
const createProbeTable = () => {
|
|
@@ -73002,6 +73232,29 @@ const columnOfUtf8Offset = (sourceBuffer, utf8Offset) => {
|
|
|
73002
73232
|
while (lineStartOffset > 0 && sourceBuffer[lineStartOffset - 1] !== 10) lineStartOffset--;
|
|
73003
73233
|
return sourceBuffer.subarray(lineStartOffset, boundedOffset).toString("utf8").length + 1;
|
|
73004
73234
|
};
|
|
73235
|
+
const decodeRanges = decodeUnknownSync(ArraySchema(DiagnosticContextRangeSchema));
|
|
73236
|
+
const createDiagnosticContextReader = (directory) => {
|
|
73237
|
+
const recordedRules = /* @__PURE__ */ new Set();
|
|
73238
|
+
if (directory) try {
|
|
73239
|
+
for (const filename of fs$1$2.readdirSync(directory)) {
|
|
73240
|
+
if (!filename.endsWith(".json")) continue;
|
|
73241
|
+
recordedRules.add(filename.slice(0, filename.lastIndexOf("-")));
|
|
73242
|
+
}
|
|
73243
|
+
} catch {
|
|
73244
|
+
recordedRules.clear();
|
|
73245
|
+
}
|
|
73246
|
+
return (identity) => {
|
|
73247
|
+
if (!directory || !recordedRules.has(encodeURIComponent(identity.rule))) return [];
|
|
73248
|
+
try {
|
|
73249
|
+
return decodeRanges(failOpenReadJson(getDiagnosticContextPath({
|
|
73250
|
+
...identity,
|
|
73251
|
+
directory
|
|
73252
|
+
}), []));
|
|
73253
|
+
} catch {
|
|
73254
|
+
return [];
|
|
73255
|
+
}
|
|
73256
|
+
};
|
|
73257
|
+
};
|
|
73005
73258
|
const utf8OffsetFromSourcePosition = (sourceBuffer, lineNumber, zeroBasedColumn) => {
|
|
73006
73259
|
if (lineNumber < 1 || zeroBasedColumn < 0) return null;
|
|
73007
73260
|
const sourceLines = sourceBuffer.toString("utf8").split("\n");
|
|
@@ -73643,7 +73896,7 @@ const isOxlintOutput = (value) => isRecord(value) && Array.isArray(value.diagnos
|
|
|
73643
73896
|
* to the first `{`. Raises `OxlintOutputUnparseable` when the
|
|
73644
73897
|
* stdout isn't valid JSON or doesn't carry a `diagnostics` array.
|
|
73645
73898
|
*/
|
|
73646
|
-
const parseOxlintOutput = (stdout, project, rootDirectory, sourcePathByLintPath, sourceMapByLintPath) => {
|
|
73899
|
+
const parseOxlintOutput = (stdout, project, rootDirectory, sourcePathByLintPath, sourceMapByLintPath, diagnosticContextDirectory) => {
|
|
73647
73900
|
if (!stdout) return [];
|
|
73648
73901
|
const jsonStart = stdout.indexOf("{");
|
|
73649
73902
|
const sanitizedStdout = jsonStart > 0 ? stdout.slice(jsonStart) : stdout;
|
|
@@ -73693,19 +73946,33 @@ const parseOxlintOutput = (stdout, project, rootDirectory, sourcePathByLintPath,
|
|
|
73693
73946
|
minifiedFileCache.set(absolutePath, minified);
|
|
73694
73947
|
return minified;
|
|
73695
73948
|
};
|
|
73696
|
-
|
|
73949
|
+
const readContextRanges = createDiagnosticContextReader(diagnosticContextDirectory);
|
|
73950
|
+
return suppressMemoizationInBailedOutFunctions(parsed.diagnostics.flatMap((rawDiagnostic) => {
|
|
73951
|
+
if (!isMappableOxlintDiagnostic(rawDiagnostic)) return [];
|
|
73952
|
+
const { plugin, rule } = parseRuleCode(rawDiagnostic.code);
|
|
73953
|
+
const primarySpan = rawDiagnostic.labels[0]?.span;
|
|
73954
|
+
const contextRanges = diagnosticContextDirectory && plugin === "react-doctor" && primarySpan ? readContextRanges({
|
|
73955
|
+
filename: resolveAbsolutePath(rawDiagnostic.filename),
|
|
73956
|
+
rule,
|
|
73957
|
+
offset: primarySpan.offset,
|
|
73958
|
+
message: rawDiagnostic.message
|
|
73959
|
+
}) : [];
|
|
73960
|
+
const diagnostic = {
|
|
73961
|
+
...rawDiagnostic,
|
|
73962
|
+
contextRanges
|
|
73963
|
+
};
|
|
73697
73964
|
const preparedSourceMap = resolvePreparedSourceMap(diagnostic.filename);
|
|
73698
73965
|
if (preparedSourceMap === void 0) return [diagnostic];
|
|
73699
|
-
const { plugin, rule } = parseRuleCode(diagnostic.code);
|
|
73700
73966
|
if (plugin !== "react-doctor" || !REACT_DOCTOR_RULE_REGISTRY[rule]?.tags?.includes("design")) return [];
|
|
73701
73967
|
const labels = mapPreparedSourceLabels(diagnostic.labels, preparedSourceMap);
|
|
73702
73968
|
const sourceFilename = resolveMappedSourceFilename(diagnostic.filename);
|
|
73703
73969
|
return labels === null || sourceFilename === void 0 ? [] : [{
|
|
73704
73970
|
...diagnostic,
|
|
73705
73971
|
filename: sourceFilename,
|
|
73706
|
-
labels
|
|
73972
|
+
labels,
|
|
73973
|
+
contextRanges: []
|
|
73707
73974
|
}];
|
|
73708
|
-
}).filter((diagnostic) =>
|
|
73975
|
+
}).filter((diagnostic) => isLintableSourceFile(resolveSourceFilename(diagnostic.filename)) && !(TYPESCRIPT_DECLARATION_FILE_PATTERN.test(diagnostic.filename) && OXLINT_IGNORED_DECLARATION_DIAGNOSTIC_CODES.has(diagnostic.code)) && !isMinifiedDiagnosticFile(diagnostic.filename) && !shouldSuppressLocalUseHookDiagnostic(diagnostic, rootDirectory) && !shouldSuppressCompilerFindingInWorklet(diagnostic, project, rootDirectory)).map((diagnostic) => {
|
|
73709
73976
|
const { plugin, rule } = parseRuleCode(diagnostic.code);
|
|
73710
73977
|
const primaryLabel = diagnostic.labels[0];
|
|
73711
73978
|
const cleaned = cleanDiagnosticMessage(diagnostic.message, diagnostic.help, plugin, rule, project);
|
|
@@ -73742,6 +74009,7 @@ const parseOxlintOutput = (stdout, project, rootDirectory, sourcePathByLintPath,
|
|
|
73742
74009
|
...primarySpanEndLine !== void 0 ? { endLine: primarySpanEndLine } : {}
|
|
73743
74010
|
} : {},
|
|
73744
74011
|
category,
|
|
74012
|
+
...diagnostic.contextRanges.length > 0 ? { contextRanges: diagnostic.contextRanges } : {},
|
|
73745
74013
|
...matchByOccurrence ? { matchByOccurrence: true } : {},
|
|
73746
74014
|
...relatedLocations.length > 0 ? { relatedLocations } : {}
|
|
73747
74015
|
};
|
|
@@ -73854,7 +74122,7 @@ const spawnLintBatches = async (input) => {
|
|
|
73854
74122
|
};
|
|
73855
74123
|
const stdout = input.spawnSlots === void 0 ? await spawnBatch() : await input.spawnSlots.run(spawnBatch, signal);
|
|
73856
74124
|
if (stdout === null) return [];
|
|
73857
|
-
return parseOxlintOutput(stdout, project, rootDirectory, sourcePathByLintPath, sourceMapByLintPath);
|
|
74125
|
+
return parseOxlintOutput(stdout, project, rootDirectory, sourcePathByLintPath, sourceMapByLintPath, input.diagnosticContextDirectory);
|
|
73858
74126
|
} catch (error) {
|
|
73859
74127
|
if (!isSplittableReactDoctorError(error)) throw error;
|
|
73860
74128
|
if (isPastDeadline()) {
|
|
@@ -74583,6 +74851,8 @@ const runOxlint = async (options) => {
|
|
|
74583
74851
|
const configDirectory = fs$1$2.mkdtempSync(path$1$1.join(os.tmpdir(), "react-doctor-oxlintrc-"));
|
|
74584
74852
|
const configPath = path$1$1.join(configDirectory, "oxlintrc.json");
|
|
74585
74853
|
try {
|
|
74854
|
+
const diagnosticContextDirectory = path$1$1.join(configDirectory, "contexts");
|
|
74855
|
+
fs$1$2.mkdirSync(diagnosticContextDirectory);
|
|
74586
74856
|
const oxlintBinary = resolveOxlintBinary();
|
|
74587
74857
|
const sharedArgs = [];
|
|
74588
74858
|
let tsconfigContent = null;
|
|
@@ -74631,6 +74901,7 @@ const runOxlint = async (options) => {
|
|
|
74631
74901
|
} : project;
|
|
74632
74902
|
const buildConfig = (overrides) => createOxlintConfig({
|
|
74633
74903
|
pluginPath,
|
|
74904
|
+
diagnosticContextDirectory,
|
|
74634
74905
|
project: lintProject,
|
|
74635
74906
|
customRulesOnly,
|
|
74636
74907
|
extendsPaths: overrides.extendsPaths,
|
|
@@ -74682,6 +74953,7 @@ const runOxlint = async (options) => {
|
|
|
74682
74953
|
project: lintProject,
|
|
74683
74954
|
sourcePathByLintPath: preparedLintSources.sourcePathByLintPath,
|
|
74684
74955
|
sourceMapByLintPath: preparedLintSources.sourceMapByLintPath,
|
|
74956
|
+
diagnosticContextDirectory,
|
|
74685
74957
|
onPartialFailure: reportPartialFailure,
|
|
74686
74958
|
onAnalyzedFiles: (filePaths) => {
|
|
74687
74959
|
analyzedFiles = filePaths;
|
|
@@ -74909,6 +75181,7 @@ const runOxlint = async (options) => {
|
|
|
74909
75181
|
project: lintProject,
|
|
74910
75182
|
sourcePathByLintPath: preparedLintSources.sourcePathByLintPath,
|
|
74911
75183
|
sourceMapByLintPath: preparedLintSources.sourceMapByLintPath,
|
|
75184
|
+
diagnosticContextDirectory,
|
|
74912
75185
|
onPartialFailure,
|
|
74913
75186
|
onAnalyzedFiles: (filePaths) => {
|
|
74914
75187
|
analyzedFiles = filePaths;
|
|
@@ -75205,7 +75478,7 @@ const ScoreApiResponseSchema = Struct({
|
|
|
75205
75478
|
});
|
|
75206
75479
|
const EMPTY_SCORE_REQUEST_METADATA = {};
|
|
75207
75480
|
const parseScoreResult = (value) => getOrNull(decodeUnknownOption(ScoreApiResponseSchema)(value));
|
|
75208
|
-
const sanitizeScoreDiagnostics = (diagnostics) => diagnostics.map(({ filePath, fileContext: _fileContext, fixGroupId: _fixGroupId, ...rest }) => ({
|
|
75481
|
+
const sanitizeScoreDiagnostics = (diagnostics) => diagnostics.map(({ filePath, fileContext: _fileContext, fixGroupId: _fixGroupId, contextRanges: _contextRanges, ...rest }) => ({
|
|
75209
75482
|
...rest,
|
|
75210
75483
|
filePath: redactSensitiveText(scrubSensitivePaths(filePath))
|
|
75211
75484
|
}));
|
|
@@ -76485,12 +76758,13 @@ const findWorstScoredProject = (projects) => {
|
|
|
76485
76758
|
return worst;
|
|
76486
76759
|
};
|
|
76487
76760
|
const toJsonReportDiagnostic = (diagnostic, projectRoot, reportRoot) => {
|
|
76761
|
+
const { contextRanges: _contextRanges, ...publicDiagnostic } = diagnostic;
|
|
76488
76762
|
const resolvedFilePath = resolveCandidateReadPath(projectRoot, diagnostic.filePath);
|
|
76489
76763
|
const normalizedFilePath = toNormalizedRelativePath(resolvedFilePath, projectRoot);
|
|
76490
76764
|
const reportRelativeFilePath = toNormalizedRelativePath(resolvedFilePath, reportRoot);
|
|
76491
76765
|
const ruleIdentity = getDiagnosticRuleIdentity(diagnostic);
|
|
76492
76766
|
return {
|
|
76493
|
-
...
|
|
76767
|
+
...publicDiagnostic,
|
|
76494
76768
|
id: buildDiagnosticIdentity({
|
|
76495
76769
|
filePath: reportRelativeFilePath,
|
|
76496
76770
|
line: diagnostic.line,
|
|
@@ -76630,7 +76904,7 @@ const getBaselineDiffPlan = (directory, ref) => runPromise(gen(function* () {
|
|
|
76630
76904
|
});
|
|
76631
76905
|
}).pipe(provide(Git.layerNode)));
|
|
76632
76906
|
/**
|
|
76633
|
-
* Programmatic façade over `Git.changedLineRanges` (the `lines`
|
|
76907
|
+
* Programmatic façade over `Git.changedLineRanges` (the `lines` / `contextual` scopes). Diffs
|
|
76634
76908
|
* `files` with `--unified=0` against `baseRef` (or the index when `cached`),
|
|
76635
76909
|
* returning per-file changed line ranges relative to `directory`. Returns
|
|
76636
76910
|
* `null` when the ranges can't be computed (git unavailable / unsafe ref /
|
|
@@ -76639,11 +76913,112 @@ const getBaselineDiffPlan = (directory, ref) => runPromise(gen(function* () {
|
|
|
76639
76913
|
*/
|
|
76640
76914
|
const getChangedLineRanges = (input) => runPromise(gen(function* () {
|
|
76641
76915
|
const ranges = yield* (yield* Git).changedLineRanges(input);
|
|
76642
|
-
return ranges === null ? null : ranges.map((entry) => ({
|
|
76643
|
-
file: entry.file,
|
|
76644
|
-
ranges: entry.ranges
|
|
76645
|
-
}));
|
|
76916
|
+
return ranges === null ? null : ranges.map((entry) => ({ ...entry }));
|
|
76646
76917
|
}).pipe(provide(Git.layerNode)));
|
|
76918
|
+
const lookupOwnRule = (rule) => Object.hasOwn(REACT_DOCTOR_RULE_REGISTRY, rule) ? REACT_DOCTOR_RULE_REGISTRY[rule] : void 0;
|
|
76919
|
+
/**
|
|
76920
|
+
* Returns presentation metadata for `<plugin>/<rule>`, or `null` when the
|
|
76921
|
+
* rule is not part of the bundled react-doctor plugin (e.g. an adopted
|
|
76922
|
+
* `eslint` / `unicorn` rule folded in via the user's lint config — those
|
|
76923
|
+
* carry their own help/url on the diagnostic instead).
|
|
76924
|
+
*/
|
|
76925
|
+
const getRuleMetadata = (plugin, rule) => {
|
|
76926
|
+
if (plugin !== "react-doctor") return null;
|
|
76927
|
+
const definition = lookupOwnRule(rule);
|
|
76928
|
+
if (!definition) return null;
|
|
76929
|
+
return {
|
|
76930
|
+
diffScope: definition.diffScope ?? "line",
|
|
76931
|
+
id: rule,
|
|
76932
|
+
plugin,
|
|
76933
|
+
category: definition.category ?? null,
|
|
76934
|
+
recommendation: definition.recommendation ?? null,
|
|
76935
|
+
tags: definition.tags ?? [],
|
|
76936
|
+
defaultEnabled: definition.defaultEnabled ?? true
|
|
76937
|
+
};
|
|
76938
|
+
};
|
|
76939
|
+
const doesContextIntersectChanges = ({ contexts, changes }) => contexts.some(({ range: [startLine, endLine], excludedRanges = [] }) => {
|
|
76940
|
+
for (const [changedStart, changedEnd] of changes.ranges) {
|
|
76941
|
+
let remainingStart = Math.max(startLine, changedStart);
|
|
76942
|
+
const remainingEnd = Math.min(endLine, changedEnd);
|
|
76943
|
+
for (const [childStart, childEnd] of excludedRanges) {
|
|
76944
|
+
if (childEnd < remainingStart) continue;
|
|
76945
|
+
if (childStart > remainingEnd) break;
|
|
76946
|
+
if (childStart > remainingStart) return true;
|
|
76947
|
+
remainingStart = Math.max(remainingStart, childEnd + 1);
|
|
76948
|
+
}
|
|
76949
|
+
if (remainingStart <= remainingEnd) return true;
|
|
76950
|
+
}
|
|
76951
|
+
return (changes.deletionLines ?? []).some((deletionLine) => deletionLine >= startLine && deletionLine < endLine && !excludedRanges.some(([childStart, childEnd]) => deletionLine >= childStart && deletionLine < childEnd));
|
|
76952
|
+
});
|
|
76953
|
+
const diagnosticIntersectsLineRanges = (diagnostic, lineRanges) => {
|
|
76954
|
+
const diagnosticEndLine = Math.max(diagnostic.line, diagnostic.endLine ?? diagnostic.line);
|
|
76955
|
+
return lineRanges.some(([rangeStartLine, rangeEndLine]) => diagnostic.line <= rangeEndLine && diagnosticEndLine >= rangeStartLine);
|
|
76956
|
+
};
|
|
76957
|
+
const getOwnedContext = ({ sourceFile, owner, isBoundary }) => {
|
|
76958
|
+
const excludedRanges = [];
|
|
76959
|
+
const collectChildren = (node) => {
|
|
76960
|
+
if (isBoundary(node)) {
|
|
76961
|
+
excludedRanges.push([sourceFile.getLineAndCharacterOfPosition(node.getStart(sourceFile)).line + 1, sourceFile.getLineAndCharacterOfPosition(node.getEnd() - 1).line + 1]);
|
|
76962
|
+
return;
|
|
76963
|
+
}
|
|
76964
|
+
typescriptBinding.forEachChild(node, collectChildren);
|
|
76965
|
+
};
|
|
76966
|
+
typescriptBinding.forEachChild(owner, collectChildren);
|
|
76967
|
+
return {
|
|
76968
|
+
range: [sourceFile.getLineAndCharacterOfPosition(owner.getStart(sourceFile)).line + 1, sourceFile.getLineAndCharacterOfPosition(owner.getEnd() - 1).line + 1],
|
|
76969
|
+
excludedRanges
|
|
76970
|
+
};
|
|
76971
|
+
};
|
|
76972
|
+
const createChangedLineMatcher = ({ directory, changedLineRanges, contextual = false }) => {
|
|
76973
|
+
const changesByFile = new Map(changedLineRanges.map((entry) => [path$1$1.resolve(directory, entry.file.replaceAll("\\", "/")), entry]));
|
|
76974
|
+
const sourceFiles = /* @__PURE__ */ new Map();
|
|
76975
|
+
return (diagnostic) => {
|
|
76976
|
+
const filePath = path$1$1.resolve(directory, diagnostic.filePath.replaceAll("\\", "/"));
|
|
76977
|
+
const changes = changesByFile.get(filePath);
|
|
76978
|
+
if (!changes) return false;
|
|
76979
|
+
if (diagnosticIntersectsLineRanges(diagnostic, changes.ranges)) return true;
|
|
76980
|
+
if (!contextual) return false;
|
|
76981
|
+
const ruleMetadata = getRuleMetadata(diagnostic.plugin, diagnostic.rule);
|
|
76982
|
+
const scope = ruleMetadata?.diffScope ?? "line";
|
|
76983
|
+
const explicitContextRanges = ruleMetadata ? diagnostic.contextRanges : void 0;
|
|
76984
|
+
if (!explicitContextRanges && scope === "file") return true;
|
|
76985
|
+
if (!explicitContextRanges && scope === "line" || !/\.[cm]?[jt]sx?$/i.test(filePath)) return false;
|
|
76986
|
+
if (!sourceFiles.has(filePath)) try {
|
|
76987
|
+
const sourceFile = typescriptBinding.createSourceFile(filePath, fs$1$2.readFileSync(filePath, "utf8"), typescriptBinding.ScriptTarget.Latest, true, getTypescriptScriptKind(filePath));
|
|
76988
|
+
const hasParseErrors = "parseDiagnostics" in sourceFile && Array.isArray(sourceFile.parseDiagnostics) && sourceFile.parseDiagnostics.length > 0;
|
|
76989
|
+
sourceFiles.set(filePath, hasParseErrors ? null : sourceFile);
|
|
76990
|
+
} catch {
|
|
76991
|
+
sourceFiles.set(filePath, null);
|
|
76992
|
+
}
|
|
76993
|
+
const sourceFile = sourceFiles.get(filePath);
|
|
76994
|
+
if (!sourceFile) return false;
|
|
76995
|
+
const sourceBuffer = Buffer.from(sourceFile.text);
|
|
76996
|
+
if (explicitContextRanges) return doesContextIntersectChanges({
|
|
76997
|
+
contexts: explicitContextRanges.filter(({ offset, length }) => Number.isSafeInteger(offset) && Number.isSafeInteger(length) && offset >= 0 && length > 0 && offset + length <= sourceBuffer.length).map(({ offset, length }) => ({ range: [lineOfUtf8Offset(sourceBuffer, offset), lineOfUtf8Offset(sourceBuffer, offset + length - 1)] })),
|
|
76998
|
+
changes
|
|
76999
|
+
});
|
|
77000
|
+
const byteOffset = diagnostic.offset ?? utf8OffsetFromSourcePosition(sourceBuffer, diagnostic.line, diagnostic.column - 1);
|
|
77001
|
+
if (byteOffset === null || byteOffset < 0 || byteOffset >= sourceBuffer.length) return false;
|
|
77002
|
+
const position = sourceBuffer.subarray(0, byteOffset).toString("utf8").length;
|
|
77003
|
+
const isBoundary = (node) => scope === "function" ? typescriptBinding.isFunctionLike(node) : typescriptBinding.isJsxElement(node) || typescriptBinding.isJsxSelfClosingElement(node) || typescriptBinding.isJsxFragment(node);
|
|
77004
|
+
let owner = null;
|
|
77005
|
+
const findOwner = (node) => {
|
|
77006
|
+
if (position < node.getStart(sourceFile) || position >= node.getEnd()) return;
|
|
77007
|
+
if (isBoundary(node)) owner = node;
|
|
77008
|
+
typescriptBinding.forEachChild(node, findOwner);
|
|
77009
|
+
};
|
|
77010
|
+
findOwner(sourceFile);
|
|
77011
|
+
if (!owner) return false;
|
|
77012
|
+
return doesContextIntersectChanges({
|
|
77013
|
+
contexts: [getOwnedContext({
|
|
77014
|
+
sourceFile,
|
|
77015
|
+
owner,
|
|
77016
|
+
isBoundary
|
|
77017
|
+
})],
|
|
77018
|
+
changes
|
|
77019
|
+
});
|
|
77020
|
+
};
|
|
77021
|
+
};
|
|
76647
77022
|
/**
|
|
76648
77023
|
* Array-shaped wrapper over `buildDiagnosticPipeline` for legacy
|
|
76649
77024
|
* callers and tests. Production code uses the streaming pipeline
|
|
@@ -76665,26 +77040,6 @@ const mergeAndFilterDiagnostics = (mergedDiagnostics, directory, userConfig, rea
|
|
|
76665
77040
|
}
|
|
76666
77041
|
return dedupeRelatedDiagnostics(result);
|
|
76667
77042
|
};
|
|
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
77043
|
/**
|
|
76689
77044
|
* Canonical URL for a rule's documentation page — its reviewer-tested fix
|
|
76690
77045
|
* recipe rendered for humans — served at
|
|
@@ -77095,7 +77450,7 @@ const makeNoopConsole = () => ({
|
|
|
77095
77450
|
});
|
|
77096
77451
|
//#endregion
|
|
77097
77452
|
//#region src/cli/utils/version.ts
|
|
77098
|
-
const VERSION = "0.9.
|
|
77453
|
+
const VERSION = "0.9.18-dev.84ad0c8";
|
|
77099
77454
|
//#endregion
|
|
77100
77455
|
//#region src/cli/utils/json-mode.ts
|
|
77101
77456
|
let context = null;
|
|
@@ -77437,7 +77792,7 @@ const recordDistribution = (name, value, options = {}) => {
|
|
|
77437
77792
|
} catch {}
|
|
77438
77793
|
};
|
|
77439
77794
|
//#endregion
|
|
77440
|
-
export { buildRuleSeverityControls as $,
|
|
77795
|
+
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
77796
|
|
|
77442
|
-
//# sourceMappingURL=record-metric-
|
|
77443
|
-
//# debugId=
|
|
77797
|
+
//# sourceMappingURL=record-metric-C-qingN9.js.map
|
|
77798
|
+
//# debugId=13c7ffa9-5f60-5a29-97b7-32744ba6032c
|