react-doctor 0.9.23-dev.ed93f67 → 0.9.23-dev.eeff4d4

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.
Files changed (42) hide show
  1. package/dist/{build-section-divider-DzuKtYKf.js → build-section-divider-M4JYIvJl.js} +5 -5
  2. package/dist/{ci-lxPnLNY2.js → ci-D7ljXIo9.js} +13 -13
  3. package/dist/cli.js +25 -25
  4. package/dist/{constants-EMNGZNtj.js → constants-BXN6vJ3T.js} +21 -8
  5. package/dist/{constants-T2clfs7L.js → constants-zyF-Em_y.js} +10 -3
  6. package/dist/{design-88ebRYs1.js → design-XQwuAooI.js} +4 -4
  7. package/dist/duplicate-jsx-worker.js +1 -1
  8. package/dist/{exit-gracefully-Dcr71UQz.js → exit-gracefully-BOyeEcyb.js} +6 -6
  9. package/dist/{handle-error-CU_FATUx.js → handle-error-UWlOKn6r.js} +6 -6
  10. package/dist/index.d.ts +1 -1
  11. package/dist/index.js +913 -60
  12. package/dist/{inspect-DAWaaj5s.js → inspect-F_2FwEY4.js} +16 -16
  13. package/dist/{install-DSkwdY2A.js → install-KoxCju0L.js} +10 -10
  14. package/dist/{install-doctor-script-BMFIMJNG.js → install-doctor-script-BrfKpUzQ.js} +5 -5
  15. package/dist/{install-github-workflow-CnUL3IaA.js → install-github-workflow-hAvw3S8o.js} +6 -6
  16. package/dist/{install-react-doctor-CyRBo17H.js → install-react-doctor-Dt86VM3q.js} +9 -9
  17. package/dist/{is-cache-globally-disabled-CYjFzsDs.js → is-cache-globally-disabled-DaT77eEZ.js} +4 -4
  18. package/dist/{jsx-runtime-Di-r43F6.js → jsx-runtime-BrXRMax1.js} +6 -6
  19. package/dist/oxlint-worker.js +1 -1
  20. package/dist/{print-branded-header-C_IdES5E.js → print-branded-header-BtUUFoRA.js} +4 -4
  21. package/dist/project-analysis-worker.js +105 -7
  22. package/dist/{prompt-runtime-scan-url-BfVNLYXF.js → prompt-runtime-scan-url-Buwk-3bK.js} +5 -5
  23. package/dist/{read-object-file-Lc7IMSGY.js → read-object-file-_cBPiQ53.js} +4 -4
  24. package/dist/{record-metric-D5cWO5c1.js → record-metric-CqZ2oVM5.js} +902 -61
  25. package/dist/{report-error-DNUzAKVW.js → report-error-TQ0RuHaV.js} +6 -6
  26. package/dist/{report-workflow-result-4mYTuWWb.js → report-workflow-result-AVT357TZ.js} +6 -6
  27. package/dist/{resolve-scan-exit-code-BTg4e2sN.js → resolve-scan-exit-code-DHwcZs-_.js} +13 -13
  28. package/dist/{resolve-scope-C3GbCfvM.js → resolve-scope-C0xGQv5Z.js} +6 -6
  29. package/dist/{rules-JNqrM_qU.js → rules-DrN3BHA6.js} +7 -7
  30. package/dist/{run-scan-app-DOOG-mGi.js → run-scan-app-DgD9ZUcX.js} +11 -11
  31. package/dist/{runtime-scan-BzDfOeYC.js → runtime-scan-CUd9z8wt.js} +10 -10
  32. package/dist/{sanitize-runtime-url-CxOV1srN.js → sanitize-runtime-url-BbR8vJyj.js} +4 -4
  33. package/dist/{scan-ivk9wx91.js → scan-DStBkQc_.js} +10 -10
  34. package/dist/{should-skip-prompts-Bictn_Xl.js → should-skip-prompts-B3A5qWMu.js} +4 -4
  35. package/dist/{should-use-tui-DGIYCdEm.js → should-use-tui-lowPvEnC.js} +4 -4
  36. package/dist/{start-scan-preamble-Zd-z2ssT.js → start-scan-preamble-CTa9UHkf.js} +5 -5
  37. package/dist/start-scan-preamble.js +3 -3
  38. package/dist/{telemetry-runtime-ByXNkZlA.js → telemetry-runtime-DJWGuzba.js} +7 -7
  39. package/dist/{version-CCx32laG.js → version-gbK4YNDr.js} +5 -5
  40. package/dist/{why-Bu3hAeLo.js → why-Cdmh9drp.js} +4 -4
  41. package/dist/{with-run-span-5rSWU2YJ.js → with-run-span-CmXGFcgD.js} +6 -6
  42. 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]="6d102103-5320-5a2f-9438-e95e18b45cf9")}catch(e){}}();
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]="4f395a61-8b10-59b6-9932-c6b841e1f49d")}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_SPLIT_TOTAL_BUDGET_MS, A as buildGitSourceListingRequest, An as TAILWIND_POSTCSS7_COMPAT_ALIAS, B as resolveGitCommand, Bt as MAINTAINABILITY_CATEGORY, Cn as SUPPLY_CHAIN_CACHE_SUBDIR, Dn as SUPPLY_CHAIN_OVERLAP_TIMEOUT_MS, Dt as FILE_LINT_CACHE_MAX_FILE_COUNT, En as SUPPLY_CHAIN_IGNORED_PACKAGES, Et as FILE_LINT_CACHE_FILENAME, F as lowerChildProcessPriority, Fn as TYPESCRIPT_DECLARATION_FILE_PATTERN, Ft as GIT_SOURCE_LISTING_ARGUMENTS, G as resolvePluginPath, Gt as MILLISECONDS_PER_SECOND, H as resolveOxlintThreadCount, Ht as MAINTAINABILITY_PLUGIN, In as VERCEL_NEXTJS_SECURITY_RELEASE_URL, It as HTML_FILE_PATTERN, J as resolveTsConfigRelativePath, Jt as OXLINT_IGNORED_DECLARATION_DIAGNOSTIC_CODES, K as resolveReactDoctorCacheDir, Kt as MINIFIED_SNIFF_BYTES, Ln as VITE_ENTRY_ASSET_FILE_PATTERN, Lt as IGNORED_DIRECTORIES, M as buildOxlintWorkerSpawnSpec, Mn as TELEMETRY_EXPORT_INTERVAL_MS, Mt as GIT_CHECK_ATTR_MAX_BUFFER_BYTES, Nn as TELEMETRY_SHUTDOWN_TIMEOUT_MS, Nt as GIT_LS_FILES_MAX_BUFFER_BYTES, On as SUPPLY_CHAIN_PLUGIN, Ot as GENERATED_BUNDLE_FILE_PATTERN, P as killUnadoptedOxlintWorkers, Pn as TSCONFIG_FILENAMES, Pt as GIT_SHOW_MAX_BUFFER_BYTES, Q as takeReactCompilerDetection, Qt as OXLINT_SPAWN_TIMEOUT_MS, R as readSystemConcurrencyFacts, Rn as VITE_ENTRY_DENSITY_SAMPLE_BYTES, Rt as JSX_DUPLICATION_SOURCE_FILE_PATTERN, Sn as STAGED_FILES_PROJECT_CONFIG_FILENAMES, St as DUPLICATE_JSX_WORKER_IDLE_TIMEOUT_MS, Tn as SUPPLY_CHAIN_CATEGORY, Tt as FETCH_TIMEOUT_MS, U as resolveOxlintToolchainVersions, V as resolveOxlintBinary, Vt as MAINTAINABILITY_DUPLICATE_JSX_RULE, W as resolveOxlintWorkerRuntime, Wt as MAX_GLOB_PATTERN_LENGTH_CHARS, X as spawnOxlintWorkerProcess, Xt as OXLINT_OOM_RESCUE_BUDGET_MS, Y as setChildProcessRef, Z as takePrespawnedOxlintWorker, Zt as OXLINT_OUTPUT_MAX_BYTES, _n as SOCKET_PACKAGE_PAGE_BASE, _t as DEFAULT_BRANCH_CANDIDATES, an as REACT_BLOG_RSC_ADVISORY_URL, bn as SPAWN_ARGS_MAX_LENGTH_CHARS_DARWIN, bt as DOCS_RULES_BASE_URL, cn as RECOMMENDED_PNPM_MINIMUM_RELEASE_AGE_MINUTES, ct as AXIOM_TRACES_PATH, d as METRIC_DISTRIBUTION_BOUNDARIES, dn as SCORE_API_URL, en as OXLINT_WORKER_JOB_END_MARKER, et as ABORT_EXIT_CODES, ft as COMPILER_CLEANUP_BUCKET, gn as SOCKET_FREE_USER_AGENT, hn as SOCKET_FREE_PURL_API_BASE, ht as CONFIG_FINGERPRINT_FILENAMES, in as PROJECT_ANALYSIS_WORKER_TIMEOUT_MS, it as AXIOM_DATASET_HEADER, j as buildOxlintChildEnv, jn as TARGET_BLANK_BROWSER_SUPPORT, jt as GITHUB_VIEWER_PERMISSION_TIMEOUT_MS, kn as SUPPLY_CHAIN_RULE, kt as GENERATED_SOURCE_DIRECTORY_PATTERN, l as INTERNAL_ERROR_JSON_FALLBACK, ln as ROOT_CAUSE_GROUPABLE_RULE_KEYS, mt as CONFIG_CACHE_TTL_MS, nn as PROJECT_ANALYSIS_WORKER_MEMORY_BUDGET_BYTES, nt as ADOPTED_LINT_CONFIG_MAX_BYTES, on as REACT_ROUTER_CAPABILITY_THRESHOLDS, ot as AXIOM_METRICS_DATASET_HEADER, pn as SIDECAR_LINT_CACHE_FILENAME, pt as COMPILER_CLEANUP_RULE_KEYS, q as resolveScanConcurrency, qt as OCCURRENCE_MATCHED_CATEGORIES, rn as PROJECT_ANALYSIS_WORKER_TIMEOUT_CEILING_MS, rt as APP_ONLY_RULE_KEYS, sn as REACT_SERVER_DOM_PACKAGES, st as AXIOM_METRICS_PATH, tn as PROJECT_ANALYSIS_WORKER_MAX_OLD_SPACE_MB, tt as ADOPTABLE_LINT_CONFIG_FILENAMES, un as SCANNED_DOT_DIRECTORIES, vn as SOURCE_FILE_PATTERN, vt as DIAGNOSTIC_CATEGORY_BUCKETS, wn as SUPPLY_CHAIN_CACHE_TTL_MS, wt as ES_TARGET_YEAR_BY_NAME, xn as SPAWN_ARGS_MAX_LENGTH_CHARS_POSIX, yn as SPAWN_ARGS_MAX_LENGTH_CHARS, yt as DISABLE_DIRECTIVE_BACKUP_DIRECTORY_SEGMENTS, z as resolveConfiguredScanConcurrency, zn as VITE_ENTRY_PRELUDE_SNIFF_BYTES } from "./constants-EMNGZNtj.js";
4
+ import { $ as warmReactCompilerDetection, $t as OXLINT_OUTPUT_MAX_BYTES, A as buildGitSourceListingRequest, An as SUPPLY_CHAIN_PLUGIN, B as resolveGitCommand, Bn as VITE_ENTRY_DENSITY_SAMPLE_BYTES, Bt as LINT_IGNORE_STYLE_FILENAMES, Cn as SPAWN_ARGS_MAX_LENGTH_CHARS_POSIX, Dn as SUPPLY_CHAIN_CATEGORY, Dt as FILE_LINT_CACHE_MAX_FILE_COUNT, En as SUPPLY_CHAIN_CACHE_TTL_MS, Et as FILE_LINT_CACHE_FILENAME, F as lowerChildProcessPriority, Fn as TELEMETRY_SHUTDOWN_TIMEOUT_MS, Ft as GIT_SOURCE_LISTING_ARGUMENTS, G as resolvePluginPath, H as resolveOxlintThreadCount, Ht as MAINTAINABILITY_CATEGORY, In as TSCONFIG_FILENAMES, It as HTML_FILE_PATTERN, J as resolveTsConfigRelativePath, Jt as MINIFIED_SNIFF_BYTES, K as resolveReactDoctorCacheDir, Kt as MAX_GLOB_PATTERN_LENGTH_CHARS, Ln as TYPESCRIPT_DECLARATION_FILE_PATTERN, Lt as IGNORED_DIRECTORIES, M as buildOxlintWorkerSpawnSpec, Mn as TAILWIND_POSTCSS7_COMPAT_ALIAS, Mt as GIT_CHECK_ATTR_MAX_BUFFER_BYTES, Nn as TARGET_BLANK_BROWSER_SUPPORT, Nt as GIT_LS_FILES_MAX_BUFFER_BYTES, On as SUPPLY_CHAIN_IGNORED_PACKAGES, Ot as GENERATED_BUNDLE_FILE_PATTERN, P as killUnadoptedOxlintWorkers, Pn as TELEMETRY_EXPORT_INTERVAL_MS, Pt as GIT_SHOW_MAX_BUFFER_BYTES, Q as takeReactCompilerDetection, Qt as OXLINT_OOM_RESCUE_BUDGET_MS, R as readSystemConcurrencyFacts, Rn as VERCEL_NEXTJS_SECURITY_RELEASE_URL, Rt as JSX_DUPLICATION_SOURCE_FILE_PATTERN, Sn as SPAWN_ARGS_MAX_LENGTH_CHARS_DARWIN, St as DUPLICATE_JSX_WORKER_IDLE_TIMEOUT_MS, Tn as SUPPLY_CHAIN_CACHE_SUBDIR, Tt as FETCH_TIMEOUT_MS, U as resolveOxlintToolchainVersions, Ut as MAINTAINABILITY_DUPLICATE_JSX_RULE, V as resolveOxlintBinary, Vn as VITE_ENTRY_PRELUDE_SNIFF_BYTES, Vt as LINT_LINGUIST_FILENAME, W as resolveOxlintWorkerRuntime, Wt as MAINTAINABILITY_PLUGIN, X as spawnOxlintWorkerProcess, Xt as OXLINT_IGNORED_DECLARATION_DIAGNOSTIC_CODES, Y as setChildProcessRef, Yt as OCCURRENCE_MATCHED_CATEGORIES, Z as takePrespawnedOxlintWorker, _n as SOCKET_FREE_PURL_API_BASE, _t as DEFAULT_BRANCH_CANDIDATES, an as PROJECT_ANALYSIS_WORKER_TIMEOUT_CEILING_MS, bn as SOURCE_FILE_PATTERN, bt as DOCS_RULES_BASE_URL, cn as REACT_ROUTER_CAPABILITY_THRESHOLDS, ct as AXIOM_TRACES_PATH, d as METRIC_DISTRIBUTION_BOUNDARIES, dn as ROOT_CAUSE_GROUPABLE_RULE_KEYS, en as OXLINT_SPAWN_TIMEOUT_MS, et as ABORT_EXIT_CODES, fn as SCANNED_DOT_DIRECTORIES, ft as COMPILER_CLEANUP_BUCKET, hn as SIDECAR_LINT_CACHE_FILENAME, ht as CONFIG_FINGERPRINT_FILENAMES, in as PROJECT_ANALYSIS_WORKER_MEMORY_BUDGET_BYTES, it as AXIOM_DATASET_HEADER, j as buildOxlintChildEnv, jn as SUPPLY_CHAIN_RULE, jt as GITHUB_VIEWER_PERMISSION_TIMEOUT_MS, kn as SUPPLY_CHAIN_OVERLAP_TIMEOUT_MS, kt as GENERATED_SOURCE_DIRECTORY_PATTERN, l as INTERNAL_ERROR_JSON_FALLBACK, ln as REACT_SERVER_DOM_PACKAGES, mt as CONFIG_CACHE_TTL_MS, nn as OXLINT_WORKER_JOB_END_MARKER, nt as ADOPTED_LINT_CONFIG_MAX_BYTES, on as PROJECT_ANALYSIS_WORKER_TIMEOUT_MS, ot as AXIOM_METRICS_DATASET_HEADER, pn as SCORE_API_URL, pt as COMPILER_CLEANUP_RULE_KEYS, q as resolveScanConcurrency, qt as MILLISECONDS_PER_SECOND, rn as PROJECT_ANALYSIS_WORKER_MAX_OLD_SPACE_MB, rt as APP_ONLY_RULE_KEYS, sn as REACT_BLOG_RSC_ADVISORY_URL, st as AXIOM_METRICS_PATH, tn as OXLINT_SPLIT_TOTAL_BUDGET_MS, tt as ADOPTABLE_LINT_CONFIG_FILENAMES, un as RECOMMENDED_PNPM_MINIMUM_RELEASE_AGE_MINUTES, vn as SOCKET_FREE_USER_AGENT, vt as DIAGNOSTIC_CATEGORY_BUCKETS, wn as STAGED_FILES_PROJECT_CONFIG_FILENAMES, wt as ES_TARGET_YEAR_BY_NAME, xn as SPAWN_ARGS_MAX_LENGTH_CHARS, yn as SOCKET_PACKAGE_PAGE_BASE, yt as DISABLE_DIRECTIVE_BACKUP_DIRECTORY_SEGMENTS, z as resolveConfiguredScanConcurrency, zn as VITE_ENTRY_ASSET_FILE_PATTERN } from "./constants-BXN6vJ3T.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";
@@ -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-BVJbM-5e.js
91
+ //#region ../core/dist/collect-unplugin-auto-import-global-scopes-nxDYvwKf.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([
@@ -192,6 +192,7 @@ const compileGlobPatternsLenient = (patterns, onInvalid) => {
192
192
  }
193
193
  return compiled;
194
194
  };
195
+ const isRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
195
196
  const isOxcAstNode = (value) => Boolean(value) && typeof value === "object" && typeof value.type === "string";
196
197
  const getStaticModuleSpecifier = (value) => {
197
198
  if (!isOxcAstNode(value)) return void 0;
@@ -526,7 +527,7 @@ const collectUnpluginAutoImportGlobalScopes = ({ rootDirectory, candidateFiles }
526
527
  return scopes.some((scope) => scope.names.length > 0) ? scopes : [];
527
528
  };
528
529
  //#endregion
529
- //#region ../core/dist/detect-duplicate-jsx-subtrees-D7-_Z6Mp.js
530
+ //#region ../core/dist/detect-duplicate-jsx-subtrees-DKRoO0e9.js
530
531
  const yieldToEventLoop = () => new Promise((resolve) => {
531
532
  setImmediate(resolve);
532
533
  });
@@ -1090,7 +1091,7 @@ const detectDuplicateJsxSubtreesCooperative = async (sourceReader, options = {})
1090
1091
  });
1091
1092
  };
1092
1093
  //#endregion
1093
- //#region ../core/dist/detect-react-compiler-DKfPrp2s.js
1094
+ //#region ../core/dist/detect-react-compiler-B2QVSnc0.js
1094
1095
  const NEXT_CONFIG_FILENAMES = [
1095
1096
  "next.config.js",
1096
1097
  "next.config.mjs",
@@ -9718,7 +9719,7 @@ const orDie$1 = (self) => catch_$2(self, die$1);
9718
9719
  /** @internal */
9719
9720
  const orElseSucceed$1 = /* @__PURE__ */ dual(2, (self, f) => catch_$2(self, (_) => sync$2(f)));
9720
9721
  /** @internal */
9721
- const ignore$1 = /* @__PURE__ */ dual((args) => isEffect$1(args[0]), (self, options) => {
9722
+ const ignore$2 = /* @__PURE__ */ dual((args) => isEffect$1(args[0]), (self, options) => {
9722
9723
  if (!options?.log) return matchEffect$2(self, {
9723
9724
  onFailure: (_) => void_$2,
9724
9725
  onSuccess: (_) => void_$2
@@ -15759,7 +15760,7 @@ const retry = retry$1;
15759
15760
  * @category error handling
15760
15761
  * @since 2.0.0
15761
15762
  */
15762
- const ignore = ignore$1;
15763
+ const ignore$1 = ignore$2;
15763
15764
  /**
15764
15765
  * Recovers from a typed failure by producing a fallback success value.
15765
15766
  *
@@ -60339,7 +60340,7 @@ const make$8 = /* @__PURE__ */ fnUntraced(function* (options) {
60339
60340
  if (disabledUntil !== void 0) return void_;
60340
60341
  runExportFork(runExport);
60341
60342
  return awaitEmpty(exportFibers);
60342
- }).pipe(ignore, interruptible, timeoutOption(options.shutdownTimeout)));
60343
+ }).pipe(ignore$1, interruptible, timeoutOption(options.shutdownTimeout)));
60343
60344
  yield* sleep(exportInterval).pipe(andThen(run(exportFibers, runExport)), flatMap$2(await_), forever, forkIn(scope));
60344
60345
  return { push(data) {
60345
60346
  if (disabledUntil !== void 0) return;
@@ -63009,11 +63010,11 @@ const layer$2 = /* @__PURE__ */ effect(ChildProcessSpawner, /* @__PURE__ */ gen(
63009
63010
  const killWithTimeout = withTimeout(childProcess, cmd, cmd.options);
63010
63011
  if (exited) {
63011
63012
  const [code] = yield* _await(exitSignal);
63012
- if (code !== 0 && isNotNull(code)) return yield* ignore(killWithTimeout(killProcessGroup));
63013
+ if (code !== 0 && isNotNull(code)) return yield* ignore$1(killWithTimeout(killProcessGroup));
63013
63014
  return yield* void_;
63014
63015
  }
63015
63016
  if (!isReferenced) return yield* void_;
63016
- return yield* killWithTimeout((command, childProcess, signal) => killProcessGroup(command, childProcess, signal).pipe(catch_$1(() => killProcess(command, childProcess, signal)), andThen(_await(exitSignal)))).pipe(ignore);
63017
+ return yield* killWithTimeout((command, childProcess, signal) => killProcessGroup(command, childProcess, signal).pipe(catch_$1(() => killProcess(command, childProcess, signal)), andThen(_await(exitSignal)))).pipe(ignore$1);
63017
63018
  }));
63018
63019
  const pid = ProcessId(childProcess.pid);
63019
63020
  childProcess.on("exit", (code) => {
@@ -63559,6 +63560,571 @@ const layer = /* @__PURE__ */ succeed$3(Path)({
63559
63560
  });
63560
63561
  //#endregion
63561
63562
  //#region ../../node_modules/.pnpm/@jridgewell+sourcemap-codec@1.5.5/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs
63563
+ var import_ignore = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((exports, module) => {
63564
+ function makeArray(subject) {
63565
+ return Array.isArray(subject) ? subject : [subject];
63566
+ }
63567
+ const UNDEFINED = void 0;
63568
+ const EMPTY = "";
63569
+ const SPACE = " ";
63570
+ const ESCAPE = "\\";
63571
+ const REGEX_LITERAL_SPECIAL = /[.*+?()[\]{}^$|\\/]/;
63572
+ const BOM = "";
63573
+ const REGEX_ANCHORED_GLOBSTAR = /^\/\*{2,}$/;
63574
+ const REGEX_REPLACE_LEADING_EXCAPED_EXCLAMATION = /^\\!/;
63575
+ const REGEX_REPLACE_LEADING_EXCAPED_HASH = /^\\#/;
63576
+ const REGEX_SPLITALL_CRLF = /\r?\n/g;
63577
+ const DOUBLE_SLASH = "//";
63578
+ const SLASH_CODE = 47;
63579
+ const DOT_CODE = 46;
63580
+ const SLASH = "/";
63581
+ let TMP_KEY_IGNORE = "node-ignore";
63582
+ /* istanbul ignore else */
63583
+ if (typeof Symbol !== "undefined") TMP_KEY_IGNORE = Symbol.for("node-ignore");
63584
+ const KEY_IGNORE = TMP_KEY_IGNORE;
63585
+ const define = (object, key, value) => {
63586
+ Object.defineProperty(object, key, { value });
63587
+ return value;
63588
+ };
63589
+ const RETURN_FALSE = () => false;
63590
+ const POSIX_CLASSES = {
63591
+ alnum: "0-9A-Za-z",
63592
+ alpha: "A-Za-z",
63593
+ blank: " \\t",
63594
+ cntrl: "\\x00-\\x1f\\x7f",
63595
+ digit: "0-9",
63596
+ graph: "!-.0-~",
63597
+ lower: "a-z",
63598
+ print: " -.0-~",
63599
+ punct: "!-.:-@\\[-`{-~",
63600
+ space: " \\t\\n\\r",
63601
+ upper: "A-Z",
63602
+ xdigit: "0-9A-Fa-f"
63603
+ };
63604
+ const CLASS_MEMBERS_TO_ESCAPE = "\\]^-[";
63605
+ const escapeMember = (char) => CLASS_MEMBERS_TO_ESCAPE.indexOf(char) < 0 ? char : ESCAPE + char;
63606
+ const NON_SLASH = "(?!\\/)";
63607
+ const classSource = (negated, body) => {
63608
+ if (negated) return `[^\\/${body}]`;
63609
+ const source = `[${body}]`;
63610
+ return new RegExp(source).test("/") ? NON_SLASH + source : source;
63611
+ };
63612
+ const scanBracket = (pattern, start) => {
63613
+ const { length } = pattern;
63614
+ let index = start + 1;
63615
+ let negated = EMPTY;
63616
+ const lead = pattern[index];
63617
+ if (lead === "!" || lead === "^") {
63618
+ negated = "^";
63619
+ index++;
63620
+ }
63621
+ let body = EMPTY;
63622
+ let prev = EMPTY;
63623
+ for (;;) {
63624
+ const char = pattern[index];
63625
+ if (char === UNDEFINED) return null;
63626
+ if (char === ESCAPE) {
63627
+ const escaped = pattern[++index];
63628
+ body += escapeMember(escaped);
63629
+ prev = escaped;
63630
+ } else if (char === "-" && prev && index + 1 < length && pattern[index + 1] !== "]") {
63631
+ index++;
63632
+ let to = pattern[index];
63633
+ if (to === ESCAPE) to = pattern[index += 1];
63634
+ if (prev <= to) body += `-${escapeMember(to)}`;
63635
+ prev = EMPTY;
63636
+ } else if (char === "[" && pattern[index + 1] === ":") {
63637
+ const nameStart = index + 2;
63638
+ let end = nameStart;
63639
+ while (end < length && pattern[end] !== "]") end++;
63640
+ if (end === length) return null;
63641
+ if (end > nameStart && pattern[end - 1] === ":") {
63642
+ const name = pattern.slice(nameStart, end - 1);
63643
+ if (!Object.prototype.hasOwnProperty.call(POSIX_CLASSES, name)) return null;
63644
+ body += POSIX_CLASSES[name];
63645
+ prev = EMPTY;
63646
+ index = end;
63647
+ } else {
63648
+ body += escapeMember("[");
63649
+ prev = "[";
63650
+ index = nameStart - 2;
63651
+ }
63652
+ } else {
63653
+ body += escapeMember(char);
63654
+ prev = char;
63655
+ }
63656
+ index++;
63657
+ if (pattern[index] === "]") return {
63658
+ end: index,
63659
+ source: classSource(negated, body)
63660
+ };
63661
+ }
63662
+ };
63663
+ const NEVER_MATCH = "[]";
63664
+ const PLACEHOLDER = "\0";
63665
+ const REGEX_RESTORE_PLACEHOLDER = new RegExp(`${PLACEHOLDER}(\\d+)${PLACEHOLDER}`, "g");
63666
+ const TRAILING_WILDCARD = "";
63667
+ const TRAILING_DOUBLESTAR = "";
63668
+ const isReserved = (char) => char === PLACEHOLDER || char === TRAILING_WILDCARD || char === TRAILING_DOUBLESTAR;
63669
+ const extractBrackets = (pattern) => {
63670
+ const sources = [];
63671
+ const hold = (source) => `${PLACEHOLDER}${sources.push(source) - 1}${PLACEHOLDER}`;
63672
+ const { length } = pattern;
63673
+ let out = EMPTY;
63674
+ let index = 0;
63675
+ while (index < length) {
63676
+ const char = pattern[index];
63677
+ if (char === ESCAPE) {
63678
+ const escaped = pattern[index + 1];
63679
+ if (escaped === SLASH && index + 2 === length) out += hold(NEVER_MATCH);
63680
+ else if (escaped === "*" || escaped === "[" || escaped === SPACE) out += pattern.slice(index, index + 2);
63681
+ else out += hold(REGEX_LITERAL_SPECIAL.test(escaped) ? ESCAPE + escaped : isReserved(escaped) ? `[${escaped}]` : escaped);
63682
+ index += 2;
63683
+ } else if (isReserved(char)) {
63684
+ out += hold(`[${char}]`);
63685
+ index++;
63686
+ } else if (char === "[") {
63687
+ const scanned = scanBracket(pattern, index);
63688
+ if (scanned === null) {
63689
+ out += hold(NEVER_MATCH);
63690
+ index = length;
63691
+ } else {
63692
+ out += hold(scanned.source);
63693
+ index = scanned.end + 1;
63694
+ }
63695
+ } else {
63696
+ out += char;
63697
+ index++;
63698
+ }
63699
+ }
63700
+ return {
63701
+ source: out,
63702
+ sources
63703
+ };
63704
+ };
63705
+ const DIRECT = null;
63706
+ const REGEX_INNER_SLASH = /\/(?!$)/;
63707
+ const WILDCARD = "[^\\/]*";
63708
+ const REPLACERS = [
63709
+ [
63710
+ /(\\+)( ?)/g,
63711
+ (_, run, space) => space ? run.slice(0, run.length - run.length % 2) + SPACE : run,
63712
+ ESCAPE + SPACE
63713
+ ],
63714
+ [
63715
+ /(^|\/)\*{3,}(?=\/|$)/g,
63716
+ (_, start) => `${start}**`,
63717
+ "*"
63718
+ ],
63719
+ [/[\\$.|*+(){^]/g, (match) => `\\${match}`],
63720
+ [
63721
+ /(?!\\)\?/g,
63722
+ () => "[^/]",
63723
+ "?"
63724
+ ],
63725
+ [
63726
+ /^\//,
63727
+ () => "^",
63728
+ SLASH
63729
+ ],
63730
+ [
63731
+ /\//g,
63732
+ () => "\\/",
63733
+ SLASH
63734
+ ],
63735
+ [
63736
+ /^\^*(?:\\\*\\\*\\\/)+/,
63737
+ () => "(?:^|\\/)",
63738
+ "*"
63739
+ ],
63740
+ [DIRECT, (source, pattern) => {
63741
+ if (!source || source[0] === "^" || source[0] === "(") return source;
63742
+ return (!REGEX_INNER_SLASH.test(pattern) ? "(?:^|\\/)" : "^") + source;
63743
+ }],
63744
+ [
63745
+ /\\\/\\\*\\\*(?=\\\/|$)/g,
63746
+ (_, index, str) => index + 6 < str.length ? str.slice(index + 6) === "\\/" ? "(?:\\/[^\\/]+)+" : "(?:\\/[^\\/]+)*" : `\\/${TRAILING_DOUBLESTAR}`,
63747
+ "*"
63748
+ ],
63749
+ [
63750
+ /(^|[^\\])(?:\\\*)+(?!$)/g,
63751
+ (_, p1) => p1 + WILDCARD,
63752
+ "*"
63753
+ ],
63754
+ [
63755
+ /(^|[^\\])((?:\\\\)*)\\\*$/,
63756
+ (match, p1, p2) => p2 === EMPTY ? p1 + TRAILING_WILDCARD : match,
63757
+ "*"
63758
+ ],
63759
+ [
63760
+ /\\\\\\(?=[$.|*+(){^])/g,
63761
+ () => ESCAPE,
63762
+ ESCAPE + ESCAPE
63763
+ ],
63764
+ [
63765
+ /\\\\/g,
63766
+ () => ESCAPE,
63767
+ ESCAPE + ESCAPE
63768
+ ],
63769
+ [
63770
+ /\\\[([^\]/]*?)($|\])/g,
63771
+ (match, range, close) => `\\[${range}${close}`,
63772
+ "["
63773
+ ],
63774
+ [DIRECT, (source) => {
63775
+ const last = source[source.length - 1];
63776
+ if (!last || last === TRAILING_WILDCARD || last === TRAILING_DOUBLESTAR) return source;
63777
+ return last === SLASH ? `${source}$` : `${source}(?=$|\\/$)`;
63778
+ }]
63779
+ ];
63780
+ const REGEX_REPLACE_TRAILING_WILDCARD = /(^|\\\/)?\uE000$/;
63781
+ const MODE_IGNORE = "regex";
63782
+ const MODE_CHECK_IGNORE = "checkRegex";
63783
+ const UNDERSCORE = "_";
63784
+ const replaceTrailingWildcard = (_, p1) => {
63785
+ return `${p1 ? `${p1}[^/]+` : "[^/]*"}(?=$|\\/$)`;
63786
+ };
63787
+ const REGEX_REPLACE_TRAILING_DOUBLESTAR = /\uE001$/;
63788
+ const replaceTrailingDoublestar = () => "[\\s\\S]";
63789
+ const separatorAfter = (run, at) => {
63790
+ let separator = EMPTY;
63791
+ for (let index = at + 1; index < run.length && !run[index].wildcard; index++) separator += run[index].single;
63792
+ return separator;
63793
+ };
63794
+ const pinWildcards = (source) => {
63795
+ if (source.indexOf(WILDCARD) < 0) return source;
63796
+ const tokens = [];
63797
+ const { length } = source;
63798
+ let index = 0;
63799
+ while (index < length) {
63800
+ const char = source[index];
63801
+ if (source.startsWith(WILDCARD, index)) {
63802
+ tokens.push({ wildcard: true });
63803
+ index += 6;
63804
+ } else if (char === "[") {
63805
+ let end = index + 1;
63806
+ if (source[end] === "^") end++;
63807
+ if (source[end] === "]") end++;
63808
+ while (end < length && source[end] !== "]") end += source[end] === ESCAPE ? 2 : 1;
63809
+ end++;
63810
+ tokens.push({ single: source.slice(index, end) });
63811
+ index = end;
63812
+ } else if (char === ESCAPE) {
63813
+ tokens.push({ single: source.slice(index, index + 2) });
63814
+ index += 2;
63815
+ } else if (char === "(") {
63816
+ let depth = 0;
63817
+ let end = index;
63818
+ do {
63819
+ if (source[end] === ESCAPE) end++;
63820
+ else if (source[end] === "(") depth++;
63821
+ else if (source[end] === ")") depth--;
63822
+ end++;
63823
+ } while (end < length && depth > 0);
63824
+ if ("*+?".indexOf(source[end]) >= 0) end++;
63825
+ tokens.push({ boundary: source.slice(index, end) });
63826
+ index = end;
63827
+ } else if (char === "^" || char === "$") {
63828
+ tokens.push({ boundary: char });
63829
+ index++;
63830
+ } else {
63831
+ tokens.push({ single: char });
63832
+ index++;
63833
+ }
63834
+ }
63835
+ let out = EMPTY;
63836
+ let run = [];
63837
+ const flush = () => {
63838
+ let lastWildcard;
63839
+ run.forEach((token, at) => {
63840
+ if (token.wildcard) lastWildcard = at;
63841
+ });
63842
+ run.forEach((token, at) => {
63843
+ if (!token.wildcard) {
63844
+ out += token.single;
63845
+ return;
63846
+ }
63847
+ out += at === lastWildcard ? WILDCARD : `(?:(?!${separatorAfter(run, at)})[^\\/])*`;
63848
+ });
63849
+ run = [];
63850
+ };
63851
+ tokens.forEach((token) => {
63852
+ if (token.boundary === void 0) {
63853
+ run.push(token);
63854
+ return;
63855
+ }
63856
+ flush();
63857
+ out += token.boundary;
63858
+ });
63859
+ flush();
63860
+ return out;
63861
+ };
63862
+ const makeRegexPrefix = (pattern) => {
63863
+ if (REGEX_ANCHORED_GLOBSTAR.test(pattern)) pattern = "**";
63864
+ const { source, sources } = extractBrackets(pattern);
63865
+ const replaced = REPLACERS.reduce((prev, [matcher, replacer, required]) => {
63866
+ if (matcher === DIRECT) return replacer(prev, pattern);
63867
+ if (required !== UNDEFINED && prev.indexOf(required) < 0) return prev;
63868
+ return matcher.test(prev) ? prev.replace(matcher, replacer.bind(pattern)) : prev;
63869
+ }, source);
63870
+ return sources.length ? replaced.replace(REGEX_RESTORE_PLACEHOLDER, (match, index) => sources[index]) : replaced;
63871
+ };
63872
+ const checkSourceOf = (body, prefix) => {
63873
+ if (body[body.length - 1] === SLASH) prefix = makeRegexPrefix(body.slice(0, -1));
63874
+ const head = prefix.slice(0, -1);
63875
+ const last = prefix[prefix.length - 1];
63876
+ return last === TRAILING_WILDCARD ? `${head}$` : last === TRAILING_DOUBLESTAR ? head : NEVER_MATCH;
63877
+ };
63878
+ const matchesBasename = (body) => {
63879
+ const index = body.indexOf(SLASH);
63880
+ return index < 0 || index === body.length - 1;
63881
+ };
63882
+ const basenameOf = (path) => {
63883
+ const end = path.length - 1;
63884
+ const index = path.lastIndexOf(SLASH, path[end] === SLASH ? end - 1 : end);
63885
+ return index < 0 ? path : path.slice(index + 1);
63886
+ };
63887
+ const parentOf = (path) => {
63888
+ if (path.charCodeAt(0) === SLASH_CODE || path.indexOf(DOUBLE_SLASH) >= 0) {
63889
+ const slices = path.split(SLASH).filter(Boolean);
63890
+ slices.pop();
63891
+ return slices.length ? slices.join(SLASH) + SLASH : EMPTY;
63892
+ }
63893
+ const end = path.length - 1;
63894
+ const cut = path.lastIndexOf(SLASH, path.charCodeAt(end) === SLASH_CODE ? end - 1 : end);
63895
+ return cut < 0 ? EMPTY : path.slice(0, cut + 1);
63896
+ };
63897
+ const isString = (subject) => typeof subject === "string";
63898
+ const checkPattern = (pattern) => pattern && isString(pattern);
63899
+ const splitPattern = (pattern) => (pattern[pattern.length - 1] === "\r" ? pattern.slice(0, -1) : pattern).split(REGEX_SPLITALL_CRLF).filter(Boolean);
63900
+ var IgnoreRule = class {
63901
+ constructor(pattern, mark, body, ignoreCase, negative, prefix) {
63902
+ this.pattern = pattern;
63903
+ this.mark = mark;
63904
+ this.negative = negative;
63905
+ define(this, "body", body);
63906
+ define(this, "ignoreCase", ignoreCase);
63907
+ define(this, "regexPrefix", prefix);
63908
+ }
63909
+ get _basenameOnly() {
63910
+ return define(this, "_basenameOnly", matchesBasename(this.body));
63911
+ }
63912
+ get regex() {
63913
+ const key = UNDERSCORE + MODE_IGNORE;
63914
+ if (this[key]) return this[key];
63915
+ return this._make(MODE_IGNORE, key);
63916
+ }
63917
+ get checkRegex() {
63918
+ const key = UNDERSCORE + MODE_CHECK_IGNORE;
63919
+ if (this[key]) return this[key];
63920
+ return this._make(MODE_CHECK_IGNORE, key);
63921
+ }
63922
+ _make(mode, key) {
63923
+ const str = pinWildcards(mode === MODE_IGNORE ? this.regexPrefix.replace(REGEX_REPLACE_TRAILING_WILDCARD, replaceTrailingWildcard).replace(REGEX_REPLACE_TRAILING_DOUBLESTAR, replaceTrailingDoublestar) : checkSourceOf(this.body, this.regexPrefix));
63924
+ const regex = this.ignoreCase ? new RegExp(str, "i") : new RegExp(str);
63925
+ return define(this, key, regex);
63926
+ }
63927
+ };
63928
+ const hasTrailingBackslash = (str) => {
63929
+ let count = 0;
63930
+ while (str[str.length - count - 1] === ESCAPE) count++;
63931
+ return count % 2 === 1;
63932
+ };
63933
+ const trimEnd = (body, stripLineEnd) => {
63934
+ let lineEnd = body.length;
63935
+ let end;
63936
+ for (;;) {
63937
+ if (stripLineEnd && body[lineEnd - 1] === "\r") lineEnd--;
63938
+ end = lineEnd;
63939
+ while (body[end - 1] === SPACE) end--;
63940
+ if (!stripLineEnd || body[end - 1] !== "\n") break;
63941
+ lineEnd = end - 1;
63942
+ }
63943
+ if (end === lineEnd) return body.slice(0, lineEnd);
63944
+ let backslashes = 0;
63945
+ while (body[end - backslashes - 1] === ESCAPE) backslashes++;
63946
+ return backslashes % 2 ? body.slice(0, end - 1) + SPACE : body.slice(0, end);
63947
+ };
63948
+ const createRule = (pattern, mark, ignoreCase, stripLineEnd, stripBOM) => {
63949
+ let body = stripBOM && pattern[0] === BOM ? pattern.slice(1) : pattern;
63950
+ if (body[0] === "#") return;
63951
+ let negative = false;
63952
+ if (body[0] === "!") {
63953
+ negative = true;
63954
+ body = body.slice(1);
63955
+ }
63956
+ const last = body[body.length - 1];
63957
+ if (last === SPACE || stripLineEnd && (last === "\r" || last === "\n")) body = trimEnd(body, stripLineEnd);
63958
+ if (!body || hasTrailingBackslash(body)) return;
63959
+ body = body.replace(REGEX_REPLACE_LEADING_EXCAPED_EXCLAMATION, "!").replace(REGEX_REPLACE_LEADING_EXCAPED_HASH, "#");
63960
+ const regexPrefix = makeRegexPrefix(body);
63961
+ return new IgnoreRule(pattern, mark, body, ignoreCase, negative, regexPrefix);
63962
+ };
63963
+ var RuleManager = class {
63964
+ constructor(ignoreCase) {
63965
+ this._ignoreCase = ignoreCase;
63966
+ this._rules = [];
63967
+ this._basenameCount = 0;
63968
+ }
63969
+ _add(pattern, index) {
63970
+ if (pattern && pattern[KEY_IGNORE]) {
63971
+ this._rules = this._rules.concat(pattern._rules._rules);
63972
+ this._basenameCount += pattern._rules._basenameCount;
63973
+ this._added = true;
63974
+ return;
63975
+ }
63976
+ const isStr = isString(pattern);
63977
+ const raw = isStr ? pattern : pattern.pattern;
63978
+ const rule = checkPattern(raw) && createRule(raw, isStr ? UNDEFINED : pattern.mark, this._ignoreCase, !this._split, this._stripBOM && !index);
63979
+ if (rule) {
63980
+ this._added = true;
63981
+ this._rules.push(rule);
63982
+ if (matchesBasename(rule.body)) this._basenameCount++;
63983
+ }
63984
+ }
63985
+ add(pattern) {
63986
+ this._added = false;
63987
+ this._split = isString(pattern);
63988
+ this._stripBOM = !this._split || pattern[0] === BOM;
63989
+ makeArray(this._split ? splitPattern(pattern) : pattern).forEach(this._add, this);
63990
+ if (this._added) this._literalRules = UNDEFINED;
63991
+ return this._added;
63992
+ }
63993
+ testLiteral(path) {
63994
+ const rules = this._literalRules || (this._literalRules = this._rules.filter(({ body }) => body[body.length - (body[body.length - 1] === SLASH ? 2 : 1)] === "*"));
63995
+ let ignored = false;
63996
+ let unignored = false;
63997
+ let matchedRule;
63998
+ for (let index = rules.length - 1; index >= 0; index--) {
63999
+ const rule = rules[index];
64000
+ if (rule.checkRegex.test(path)) {
64001
+ ignored = !rule.negative;
64002
+ unignored = rule.negative;
64003
+ matchedRule = rule.negative ? UNDEFINED : rule;
64004
+ break;
64005
+ }
64006
+ }
64007
+ const ret = {
64008
+ ignored,
64009
+ unignored
64010
+ };
64011
+ if (matchedRule) ret.rule = matchedRule;
64012
+ return ret;
64013
+ }
64014
+ test(path, mode) {
64015
+ const rules = this._rules;
64016
+ const { length } = rules;
64017
+ const shortcut = this._basenameCount * 2 >= length;
64018
+ const basename = shortcut ? basenameOf(path) : path;
64019
+ for (let index = length - 1; index >= 0; index--) {
64020
+ const rule = rules[index];
64021
+ if (rule[mode].test(shortcut && rule._basenameOnly ? basename : path)) {
64022
+ const { negative } = rule;
64023
+ const ret = {
64024
+ ignored: !negative,
64025
+ unignored: negative
64026
+ };
64027
+ if (!negative) ret.rule = rule;
64028
+ return ret;
64029
+ }
64030
+ }
64031
+ return {
64032
+ ignored: false,
64033
+ unignored: false
64034
+ };
64035
+ }
64036
+ };
64037
+ const throwError = (message, Ctor) => {
64038
+ throw new Ctor(message);
64039
+ };
64040
+ const checkPath = (path, originalPath, doThrow) => {
64041
+ if (!isString(path)) return doThrow(`path must be a string, but got \`${originalPath}\``, TypeError);
64042
+ if (!path) return doThrow(`path must not be empty`, TypeError);
64043
+ if (checkPath.isNotRelative(path)) return doThrow(`path should be a \`path.relative()\`d string, but got "${originalPath}"`, RangeError);
64044
+ return true;
64045
+ };
64046
+ const isNotRelative = (path) => {
64047
+ const first = path.charCodeAt(0);
64048
+ if (first === SLASH_CODE) return true;
64049
+ if (first !== DOT_CODE) return false;
64050
+ if (path.length === 1) return true;
64051
+ const second = path.charCodeAt(1);
64052
+ if (second === SLASH_CODE) return true;
64053
+ if (second !== DOT_CODE) return false;
64054
+ return path.length === 2 || path.charCodeAt(2) === SLASH_CODE;
64055
+ };
64056
+ checkPath.isNotRelative = isNotRelative;
64057
+ /* istanbul ignore next */
64058
+ checkPath.convert = (p) => p;
64059
+ const convertPath = (target) => isString(target) && checkPath.convert(target);
64060
+ var Ignore = class {
64061
+ constructor({ ignorecase = true, ignoreCase = ignorecase, allowRelativePaths = false } = {}) {
64062
+ define(this, KEY_IGNORE, true);
64063
+ this._rules = new RuleManager(ignoreCase);
64064
+ this._strictPathCheck = !allowRelativePaths;
64065
+ this._initCache();
64066
+ }
64067
+ _initCache() {
64068
+ this._ignoreCache = Object.create(null);
64069
+ this._testCache = Object.create(null);
64070
+ }
64071
+ add(pattern) {
64072
+ if (this._rules.add(pattern)) this._initCache();
64073
+ return this;
64074
+ }
64075
+ addPattern(pattern) {
64076
+ return this.add(pattern);
64077
+ }
64078
+ _test(originalPath, cache, path) {
64079
+ checkPath(path, originalPath, this._strictPathCheck ? throwError : RETURN_FALSE);
64080
+ return path ? this._t(path, cache) : {
64081
+ ignored: false,
64082
+ unignored: false
64083
+ };
64084
+ }
64085
+ checkIgnore(target) {
64086
+ const path = convertPath(target);
64087
+ if (!path || path.charCodeAt(path.length - 1) !== SLASH_CODE) return this._test(target, this._testCache, path);
64088
+ const dir = this._t(path, this._testCache);
64089
+ if (dir.ignored) return dir;
64090
+ const literal = this._rules.testLiteral(path);
64091
+ return literal.ignored || literal.unignored ? literal : dir;
64092
+ }
64093
+ _t(path, cache) {
64094
+ if (path in cache) return cache[path];
64095
+ const parentPath = parentOf(path);
64096
+ const parent = parentPath ? this._t(parentPath, cache) : UNDEFINED;
64097
+ return cache[path] = parent && parent.ignored ? parent : this._rules.test(path, MODE_IGNORE);
64098
+ }
64099
+ ignores(path) {
64100
+ return this._test(path, this._ignoreCache, convertPath(path)).ignored;
64101
+ }
64102
+ createFilter() {
64103
+ return (path) => !this.ignores(path);
64104
+ }
64105
+ filter(paths) {
64106
+ return makeArray(paths).filter(this.createFilter());
64107
+ }
64108
+ test(path) {
64109
+ return this._test(path, this._testCache, convertPath(path));
64110
+ }
64111
+ };
64112
+ const factory = (options) => new Ignore(options);
64113
+ const isPathValid = (path) => checkPath(convertPath(path), path, RETURN_FALSE);
64114
+ /* istanbul ignore next */
64115
+ const setupWindows = () => {
64116
+ const makePosix = (str) => /^\\\\\?\\/.test(str) || /["<>|\u0000-\u001F]+/u.test(str) ? str : str.replace(/\\/g, "/");
64117
+ checkPath.convert = makePosix;
64118
+ const REGEX_TEST_WINDOWS_PATH_ABSOLUTE = /^[a-z]:\//i;
64119
+ checkPath.isNotRelative = (path) => REGEX_TEST_WINDOWS_PATH_ABSOLUTE.test(path) || isNotRelative(path);
64120
+ };
64121
+ /* istanbul ignore next */
64122
+ if (typeof process !== "undefined" && process.platform === "win32") setupWindows();
64123
+ module.exports = factory;
64124
+ factory.default = factory;
64125
+ module.exports.isPathValid = isPathValid;
64126
+ define(module.exports, Symbol.for("setupWindows"), setupWindows);
64127
+ })))(), 1);
63562
64128
  var comma = ",".charCodeAt(0);
63563
64129
  ";".charCodeAt(0);
63564
64130
  var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
@@ -67840,7 +68406,6 @@ const DEFAULT_SURFACE_EXCLUDED_TAGS = {
67840
68406
  score: ["design"],
67841
68407
  ciFailure: ["design"]
67842
68408
  };
67843
- const isRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
67844
68409
  const KNOWN_RULE_KEYS = new Set([...ALL_REACT_DOCTOR_RULE_KEYS, ...EXTERNAL_RULES.map((rule) => rule.key)]);
67845
68410
  const BUNDLED_RULE_NAMESPACES = new Set([...KNOWN_RULE_KEYS].flatMap(getEquivalentRuleKeys).map((key) => key.slice(0, key.lastIndexOf("/"))));
67846
68411
  const getUnknownBundledRuleKeys = (rules) => Object.keys(rules ?? {}).filter((key) => {
@@ -71867,7 +72432,7 @@ const stripGitignoreEscape = (pattern) => {
71867
72432
  if (pattern.startsWith("\\#") || pattern.startsWith("\\!")) return pattern.slice(1);
71868
72433
  return pattern;
71869
72434
  };
71870
- const readIgnoreFile = (filePath) => {
72435
+ const readIgnoreFile = (filePath, { preserveSyntax = false } = {}) => {
71871
72436
  let content;
71872
72437
  try {
71873
72438
  content = fs$1$2.readFileSync(filePath, "utf-8");
@@ -71877,7 +72442,13 @@ const readIgnoreFile = (filePath) => {
71877
72442
  return [];
71878
72443
  }
71879
72444
  const patterns = [];
71880
- for (const line of content.split("\n")) {
72445
+ const source = preserveSyntax ? stripUtf8Bom(content) : content;
72446
+ for (const line of source.split("\n")) {
72447
+ if (preserveSyntax) {
72448
+ const pattern = line.replace(/\r$/, "");
72449
+ if (pattern.length > 0 && !pattern.startsWith("#")) patterns.push(pattern);
72450
+ continue;
72451
+ }
71881
72452
  const trimmed = line.trim();
71882
72453
  if (trimmed.length === 0) continue;
71883
72454
  if (trimmed.startsWith("#")) continue;
@@ -71885,30 +72456,48 @@ const readIgnoreFile = (filePath) => {
71885
72456
  }
71886
72457
  return patterns;
71887
72458
  };
71888
- const IGNORE_FILENAMES = [
71889
- ".eslintignore",
71890
- ".oxlintignore",
71891
- ".prettierignore"
71892
- ];
71893
- const cachedPatternsByRoot = /* @__PURE__ */ new Map();
71894
- const computeIgnorePatterns = (rootDirectory) => {
71895
- const seen = /* @__PURE__ */ new Set();
71896
- const patterns = [];
71897
- const addPattern = (pattern) => {
71898
- if (seen.has(pattern)) return;
71899
- seen.add(pattern);
71900
- patterns.push(pattern);
72459
+ const readLintIgnorePatterns = (rootDirectory, { preserveSyntax = false } = {}) => [...LINT_IGNORE_STYLE_FILENAMES.flatMap((filename) => readIgnoreFile(path$1$1.join(rootDirectory, filename), { preserveSyntax })), ...parseGitattributesLinguistPaths(path$1$1.join(rootDirectory, LINT_LINGUIST_FILENAME))];
72460
+ const rebasePattern = (pattern, directoryPrefix) => {
72461
+ const isNegated = pattern.startsWith("!");
72462
+ const body = isNegated ? pattern.slice(1) : pattern;
72463
+ const effectiveBody = body.replace(/ +$/, "");
72464
+ if (!effectiveBody.trim() || effectiveBody === "/") return null;
72465
+ const isAnchored = effectiveBody.startsWith("/") || effectiveBody.slice(0, -1).includes("/");
72466
+ const relativePattern = body.startsWith("/") ? body.slice(1) : body;
72467
+ return `${isNegated ? "!" : ""}/${directoryPrefix}/${isAnchored ? "" : "**/"}${relativePattern}`;
72468
+ };
72469
+ const readRebasedPatterns = (directory, boundary) => {
72470
+ const directoryPrefix = path$1$1.relative(boundary, directory).split(path$1$1.sep).join("/").replace(/[\\*?[\]]/g, "\\$&");
72471
+ return readLintIgnorePatterns(directory, { preserveSyntax: true }).map((pattern) => rebasePattern(pattern, directoryPrefix)).filter((pattern) => pattern !== null);
72472
+ };
72473
+ const resolveIgnoreBoundaryIndex = (directories) => {
72474
+ const boundaryIndex = directories.findIndex(isProjectBoundary);
72475
+ if (boundaryIndex <= 0) return 0;
72476
+ const packageDirectory = directories.slice(0, boundaryIndex).find((directory) => isFile(path$1$1.join(directory, "package.json")));
72477
+ if (!packageDirectory) return 0;
72478
+ const boundary = directories[boundaryIndex];
72479
+ return getWorkspacePatterns(boundary, readPackageJson(path$1$1.join(boundary, "package.json"))).some((pattern) => resolveWorkspaceDirectories(boundary, pattern).includes(packageDirectory)) ? boundaryIndex : 0;
72480
+ };
72481
+ const collectLintIgnorePolicy = (rootDirectory) => {
72482
+ const scanDirectory = path$1$1.resolve(rootDirectory);
72483
+ const directories = ancestorDirectories(scanDirectory, { includeStart: true });
72484
+ const boundaryIndex = resolveIgnoreBoundaryIndex(directories);
72485
+ const boundary = directories[boundaryIndex];
72486
+ const patterns = readLintIgnorePatterns(boundary, { preserveSyntax: true });
72487
+ for (const directory of directories.slice(0, boundaryIndex).reverse()) patterns.push(...readRebasedPatterns(directory, boundary));
72488
+ if (patterns.length === 0) return null;
72489
+ const matcher = (0, import_ignore.default)({
72490
+ ignorecase: false,
72491
+ allowRelativePaths: true
72492
+ }).add(patterns);
72493
+ return {
72494
+ patterns,
72495
+ includesFile: (filePath) => {
72496
+ const absolutePath = path$1$1.resolve(scanDirectory, filePath);
72497
+ if (!isPathInsideDirectory(absolutePath, scanDirectory)) return true;
72498
+ return !matcher.ignores(path$1$1.relative(boundary, absolutePath).split(path$1$1.sep).join("/"));
72499
+ }
71901
72500
  };
71902
- for (const filename of IGNORE_FILENAMES) for (const pattern of readIgnoreFile(path$1$1.join(rootDirectory, filename))) addPattern(pattern);
71903
- for (const linguistPath of parseGitattributesLinguistPaths(path$1$1.join(rootDirectory, ".gitattributes"))) addPattern(linguistPath);
71904
- return patterns;
71905
- };
71906
- const collectIgnorePatterns = (rootDirectory) => {
71907
- const cached = cachedPatternsByRoot.get(rootDirectory);
71908
- if (cached !== void 0) return cached;
71909
- const patterns = computeIgnorePatterns(rootDirectory);
71910
- cachedPatternsByRoot.set(rootDirectory, patterns);
71911
- return patterns;
71912
72501
  };
71913
72502
  const findFirstLintConfigInDirectory = (directory) => {
71914
72503
  for (const filename of ADOPTABLE_LINT_CONFIG_FILENAMES) {
@@ -72209,6 +72798,7 @@ const neutralizeDisableDirectives = async (rootDirectory, includePaths, options
72209
72798
  const onExit = () => restore();
72210
72799
  process.once("exit", onExit);
72211
72800
  const leaseCandidatePath = (absolutePath) => {
72801
+ if (options.includesFile?.(path$1$1.relative(resolvedRootDirectory, absolutePath)) === false) return;
72212
72802
  if (!isSymlinkFreePath(absolutePath, resolvedRootDirectory)) return;
72213
72803
  if (leasedPaths.has(absolutePath)) return;
72214
72804
  if (blockedPaths.has(absolutePath)) return;
@@ -73646,6 +74236,7 @@ const bridgeReactCompilerDiagnostic = (diagnostic) => {
73646
74236
  url: bridgeRule.compilerUrl
73647
74237
  };
73648
74238
  };
74239
+ const getUtf16Offset = (sourceText, utf8Offset) => Buffer.from(sourceText).subarray(0, utf8Offset).toString("utf8").length;
73649
74240
  const REACT_MODULE_SOURCE = "react";
73650
74241
  const REQUIRE_IDENTIFIER = "require";
73651
74242
  const USE_IDENTIFIER = "use";
@@ -73661,7 +74252,6 @@ const REACT_USE_BINDING_RESOLUTION = {
73661
74252
  isReactUseBinding: true,
73662
74253
  isReactNamespaceBinding: false
73663
74254
  };
73664
- const getUtf16Offset$1 = (sourceText, utf8Offset) => Buffer.from(sourceText).subarray(0, utf8Offset).toString("utf8").length;
73665
74255
  const getStaticPropertyName = (node) => {
73666
74256
  if (!node) return null;
73667
74257
  if (typescriptBinding.isIdentifier(node) || typescriptBinding.isStringLiteral(node) || typescriptBinding.isNumericLiteral(node)) return node.text;
@@ -73898,7 +74488,7 @@ const findUseCallIdentifier = (sourceFile, useOffset) => {
73898
74488
  };
73899
74489
  const resolveUseCallBinding = (sourceText, filename, utf8Offset) => {
73900
74490
  const sourceFile = typescriptBinding.createSourceFile(filename, sourceText, typescriptBinding.ScriptTarget.Latest, true, getTypescriptScriptKind(filename));
73901
- const useIdentifier = findUseCallIdentifier(sourceFile, getUtf16Offset$1(sourceText, utf8Offset));
74491
+ const useIdentifier = findUseCallIdentifier(sourceFile, getUtf16Offset(sourceText, utf8Offset));
73902
74492
  if (!useIdentifier) return null;
73903
74493
  return resolveIdentifierBinding(useIdentifier, collectReactImportBindings(sourceFile), sourceFile);
73904
74494
  };
@@ -73933,7 +74523,6 @@ const WORKLET_ACCEPTING_CALLEES = new Set([
73933
74523
  "executeOnUIRuntimeSync"
73934
74524
  ]);
73935
74525
  const GESTURE_ROOT_IDENTIFIER = "Gesture";
73936
- const getUtf16Offset = (sourceText, utf8Offset) => Buffer.from(sourceText).subarray(0, utf8Offset).toString("utf8").length;
73937
74526
  const hasWorkletDirective = (node) => {
73938
74527
  if (!typescriptBinding.isFunctionDeclaration(node) && !typescriptBinding.isFunctionExpression(node) && !typescriptBinding.isArrowFunction(node) && !typescriptBinding.isMethodDeclaration(node)) return false;
73939
74528
  const body = node.body;
@@ -74006,6 +74595,228 @@ const shouldSuppressCompilerFindingInWorklet = (diagnostic, project, rootDirecto
74006
74595
  }
74007
74596
  return isOffsetInsideWorklet(typescriptBinding.createSourceFile(absolutePath, sourceText, typescriptBinding.ScriptTarget.Latest, true, getTypescriptScriptKind(absolutePath)), getUtf16Offset(sourceText, primaryLabel.span.offset));
74008
74597
  };
74598
+ const REFLECTION_NAMES = new Set([
74599
+ "eval",
74600
+ "require",
74601
+ "Function",
74602
+ "Object",
74603
+ "Reflect",
74604
+ "Promise",
74605
+ "globalThis",
74606
+ "global",
74607
+ "window",
74608
+ "self",
74609
+ "constructor",
74610
+ "prototype",
74611
+ "__proto__",
74612
+ "__defineGetter__",
74613
+ "__defineSetter__",
74614
+ "__lookupGetter__",
74615
+ "__lookupSetter__"
74616
+ ]);
74617
+ const collectEffectSourceIndex = (sourceFile) => {
74618
+ const identifiers = /* @__PURE__ */ new Map();
74619
+ const calls = [];
74620
+ const pendingNodes = [sourceFile];
74621
+ let hasReflection = false;
74622
+ while (pendingNodes.length > 0) {
74623
+ const node = pendingNodes.pop();
74624
+ if (!node) continue;
74625
+ if (typescriptBinding.isIdentifier(node)) {
74626
+ const sameNameIdentifiers = identifiers.get(node.text) ?? /* @__PURE__ */ new Set();
74627
+ sameNameIdentifiers.add(node);
74628
+ identifiers.set(node.text, sameNameIdentifiers);
74629
+ if (REFLECTION_NAMES.has(node.text)) hasReflection = true;
74630
+ }
74631
+ let memberName;
74632
+ if (typescriptBinding.isPropertyAccessExpression(node)) memberName = node.name.text;
74633
+ else if (typescriptBinding.isElementAccessExpression(node)) {
74634
+ const memberArgument = unwrapTypescriptExpression(node.argumentExpression);
74635
+ if (typescriptBinding.isStringLiteral(memberArgument)) memberName = memberArgument.text;
74636
+ else hasReflection = true;
74637
+ } else if (typescriptBinding.isBindingElement(node) && node.propertyName && typescriptBinding.isStringLiteral(node.propertyName)) memberName = node.propertyName.text;
74638
+ else if (typescriptBinding.isPropertyAssignment(node) && typescriptBinding.isStringLiteral(node.name)) memberName = node.name.text;
74639
+ if (memberName && REFLECTION_NAMES.has(memberName)) hasReflection = true;
74640
+ if (typescriptBinding.isComputedPropertyName(node)) hasReflection = true;
74641
+ if (typescriptBinding.isWithStatement(node)) hasReflection = true;
74642
+ if (typescriptBinding.isCallExpression(node)) {
74643
+ calls.push(node);
74644
+ if (node.expression.kind === typescriptBinding.SyntaxKind.ImportKeyword) hasReflection = true;
74645
+ }
74646
+ typescriptBinding.forEachChild(node, (child) => {
74647
+ pendingNodes.push(child);
74648
+ });
74649
+ }
74650
+ return {
74651
+ identifiers,
74652
+ calls,
74653
+ hasReflection
74654
+ };
74655
+ };
74656
+ const isInertPrimitive = (expression) => {
74657
+ const unwrapped = unwrapTypescriptExpression(expression);
74658
+ return typescriptBinding.isStringLiteral(unwrapped) || typescriptBinding.isNoSubstitutionTemplateLiteral(unwrapped) || typescriptBinding.isNumericLiteral(unwrapped) || unwrapped.kind === typescriptBinding.SyntaxKind.TrueKeyword || unwrapped.kind === typescriptBinding.SyntaxKind.FalseKeyword || unwrapped.kind === typescriptBinding.SyntaxKind.NullKeyword || typescriptBinding.isPrefixUnaryExpression(unwrapped) && (unwrapped.operator === typescriptBinding.SyntaxKind.PlusToken || unwrapped.operator === typescriptBinding.SyntaxKind.MinusToken) && typescriptBinding.isNumericLiteral(unwrapped.operand);
74659
+ };
74660
+ const isAsyncZeroParameterFunction = (node) => (typescriptBinding.isArrowFunction(node) || typescriptBinding.isFunctionExpression(node)) && node.parameters.length === 0 && !(typescriptBinding.isFunctionExpression(node) && node.asteriskToken) && Boolean(node.modifiers?.some((modifier) => modifier.kind === typescriptBinding.SyntaxKind.AsyncKeyword));
74661
+ const getSoleCall = (body) => {
74662
+ if (body.statements.length !== 1) return null;
74663
+ const statement = body.statements[0];
74664
+ if (!typescriptBinding.isExpressionStatement(statement)) return null;
74665
+ let expression = unwrapTypescriptExpression(statement.expression);
74666
+ if (typescriptBinding.isVoidExpression(expression)) expression = unwrapTypescriptExpression(expression.expression);
74667
+ return typescriptBinding.isCallExpression(expression) && !expression.questionDotToken ? expression : null;
74668
+ };
74669
+ const findDirectConst = (body, name, beforeStatement) => {
74670
+ for (const statement of body.statements) {
74671
+ if (statement === beforeStatement) return null;
74672
+ if (!typescriptBinding.isVariableStatement(statement)) continue;
74673
+ if (!(statement.declarationList.flags & typescriptBinding.NodeFlags.Const)) continue;
74674
+ for (const declaration of statement.declarationList.declarations) if (typescriptBinding.isIdentifier(declaration.name) && declaration.name.text === name) return declaration;
74675
+ }
74676
+ return null;
74677
+ };
74678
+ const hasOnlyAllowedIdentifiers = (index, name, allowedIdentifiers) => {
74679
+ const allowed = new Set(allowedIdentifiers);
74680
+ return [...index.identifiers.get(name) ?? []].every((identifier) => allowed.has(identifier));
74681
+ };
74682
+ const isNativeReactCall = (call, importedName, sourceFile, index) => {
74683
+ const callee = unwrapTypescriptExpression(call.expression);
74684
+ if (!typescriptBinding.isIdentifier(callee) || call.questionDotToken) return false;
74685
+ let matchingImport = null;
74686
+ for (const statement of sourceFile.statements) {
74687
+ if (!typescriptBinding.isImportDeclaration(statement)) continue;
74688
+ if (!typescriptBinding.isStringLiteral(statement.moduleSpecifier) || statement.moduleSpecifier.text !== "react") continue;
74689
+ const clause = statement.importClause;
74690
+ if (!clause || clause.isTypeOnly) continue;
74691
+ if (clause.name || clause.namedBindings && typescriptBinding.isNamespaceImport(clause.namedBindings)) return false;
74692
+ if (!clause.namedBindings || !typescriptBinding.isNamedImports(clause.namedBindings)) continue;
74693
+ for (const specifier of clause.namedBindings.elements) {
74694
+ if (specifier.name.text !== callee.text) continue;
74695
+ if (matchingImport || specifier.isTypeOnly || (specifier.propertyName?.text ?? specifier.name.text) !== importedName || getImportModuleSource(specifier) !== "react") return false;
74696
+ matchingImport = specifier;
74697
+ }
74698
+ }
74699
+ if (!matchingImport) return false;
74700
+ const allowed = [matchingImport.name];
74701
+ if (matchingImport.propertyName && typescriptBinding.isIdentifier(matchingImport.propertyName)) allowed.push(matchingImport.propertyName);
74702
+ for (const candidateCall of index.calls) {
74703
+ const candidateCallee = unwrapTypescriptExpression(candidateCall.expression);
74704
+ if (typescriptBinding.isIdentifier(candidateCallee) && candidateCallee.text === callee.text) allowed.push(candidateCallee);
74705
+ }
74706
+ return hasOnlyAllowedIdentifiers(index, callee.text, allowed);
74707
+ };
74708
+ const hasDeferredLocalHelper = (helperCall, sourceFile, index) => {
74709
+ const helperIdentifier = unwrapTypescriptExpression(helperCall.expression);
74710
+ if (!typescriptBinding.isIdentifier(helperIdentifier) || helperCall.arguments.length !== 0) return false;
74711
+ let callbackNode = helperCall.parent;
74712
+ while (callbackNode && !typescriptBinding.isArrowFunction(callbackNode) && !typescriptBinding.isFunctionExpression(callbackNode)) callbackNode = callbackNode.parent;
74713
+ if (!callbackNode || !typescriptBinding.isBlock(callbackNode.body) || callbackNode.parameters.length !== 0 || callbackNode.modifiers?.some((modifier) => modifier.kind === typescriptBinding.SyntaxKind.AsyncKeyword) || typescriptBinding.isFunctionExpression(callbackNode) && callbackNode.asteriskToken || getSoleCall(callbackNode.body) !== helperCall) return false;
74714
+ const effectCall = callbackNode.parent;
74715
+ if (!typescriptBinding.isCallExpression(effectCall) || effectCall.arguments[0] !== callbackNode || effectCall.arguments.length !== 2 || !isNativeReactCall(effectCall, "useEffect", sourceFile, index) || !typescriptBinding.isExpressionStatement(effectCall.parent) || !typescriptBinding.isBlock(effectCall.parent.parent)) return false;
74716
+ const ownerBody = effectCall.parent.parent;
74717
+ if (!typescriptBinding.isArrowFunction(ownerBody.parent) && !typescriptBinding.isFunctionExpression(ownerBody.parent) && !typescriptBinding.isFunctionDeclaration(ownerBody.parent)) return false;
74718
+ if (ownerBody.parent.modifiers?.some((modifier) => modifier.kind === typescriptBinding.SyntaxKind.AsyncKeyword) || !typescriptBinding.isArrowFunction(ownerBody.parent) && ownerBody.parent.asteriskToken) return false;
74719
+ const dependencies = unwrapTypescriptExpression(effectCall.arguments[1]);
74720
+ if (!typescriptBinding.isArrayLiteralExpression(dependencies)) return false;
74721
+ const helperReferences = [helperIdentifier];
74722
+ for (const dependency of dependencies.elements) {
74723
+ const unwrappedDependency = unwrapTypescriptExpression(dependency);
74724
+ if (!typescriptBinding.isIdentifier(unwrappedDependency) || unwrappedDependency.text !== helperIdentifier.text) return false;
74725
+ helperReferences.push(unwrappedDependency);
74726
+ }
74727
+ const declaration = findDirectConst(ownerBody, helperIdentifier.text, effectCall.parent);
74728
+ if (!declaration?.initializer || !typescriptBinding.isIdentifier(declaration.name)) return false;
74729
+ helperReferences.push(declaration.name);
74730
+ if (!hasOnlyAllowedIdentifiers(index, helperIdentifier.text, helperReferences)) return false;
74731
+ let helper = unwrapTypescriptExpression(declaration.initializer);
74732
+ if (typescriptBinding.isCallExpression(helper)) {
74733
+ if (!isNativeReactCall(helper, "useCallback", sourceFile, index) || helper.arguments.length !== 2 || !typescriptBinding.isArrayLiteralExpression(helper.arguments[1]) || helper.arguments[1].elements.length !== 0) return false;
74734
+ helper = unwrapTypescriptExpression(helper.arguments[0]);
74735
+ }
74736
+ if (!isAsyncZeroParameterFunction(helper) || !typescriptBinding.isBlock(helper.body)) return false;
74737
+ if (helper.body.statements.length !== 1) return false;
74738
+ const tryStatement = helper.body.statements[0];
74739
+ if (!typescriptBinding.isTryStatement(tryStatement) || tryStatement.finallyBlock || !tryStatement.catchClause || tryStatement.catchClause.variableDeclaration) return false;
74740
+ const successCall = getSoleCall(tryStatement.tryBlock);
74741
+ const failureCall = getSoleCall(tryStatement.catchClause.block);
74742
+ if (!successCall || !failureCall || successCall.arguments.length !== 1 || failureCall.arguments.length !== 1) return false;
74743
+ const setterIdentifier = unwrapTypescriptExpression(successCall.expression);
74744
+ const failureSetter = unwrapTypescriptExpression(failureCall.expression);
74745
+ if (!typescriptBinding.isIdentifier(setterIdentifier) || !typescriptBinding.isIdentifier(failureSetter) || setterIdentifier.text !== failureSetter.text || !isInertPrimitive(failureCall.arguments[0])) return false;
74746
+ const awaitedValue = unwrapTypescriptExpression(successCall.arguments[0]);
74747
+ if (!typescriptBinding.isAwaitExpression(awaitedValue)) return false;
74748
+ const producerCall = unwrapTypescriptExpression(awaitedValue.expression);
74749
+ if (!typescriptBinding.isCallExpression(producerCall) || producerCall.questionDotToken || producerCall.arguments.length !== 0) return false;
74750
+ const producerIdentifier = unwrapTypescriptExpression(producerCall.expression);
74751
+ if (!typescriptBinding.isIdentifier(producerIdentifier)) return false;
74752
+ const producerDeclaration = findDirectConst(ownerBody, producerIdentifier.text, effectCall.parent);
74753
+ if (!producerDeclaration?.initializer || !typescriptBinding.isIdentifier(producerDeclaration.name)) return false;
74754
+ const producer = unwrapTypescriptExpression(producerDeclaration.initializer);
74755
+ if (!isAsyncZeroParameterFunction(producer)) return false;
74756
+ let producedValue;
74757
+ if (typescriptBinding.isBlock(producer.body)) {
74758
+ if (producer.body.statements.length !== 1) return false;
74759
+ const statement = producer.body.statements[0];
74760
+ if (!typescriptBinding.isReturnStatement(statement)) return false;
74761
+ producedValue = statement.expression;
74762
+ } else producedValue = producer.body;
74763
+ if (!producedValue || !isInertPrimitive(producedValue)) return false;
74764
+ if (!hasOnlyAllowedIdentifiers(index, producerIdentifier.text, [producerDeclaration.name, producerIdentifier])) return false;
74765
+ for (const statement of ownerBody.statements) {
74766
+ if (statement === effectCall.parent) return false;
74767
+ if (!typescriptBinding.isVariableStatement(statement) || !(statement.declarationList.flags & typescriptBinding.NodeFlags.Const)) continue;
74768
+ for (const stateDeclaration of statement.declarationList.declarations) {
74769
+ if (!typescriptBinding.isArrayBindingPattern(stateDeclaration.name) || stateDeclaration.name.elements.length !== 2 || !stateDeclaration.initializer) continue;
74770
+ const setterBinding = stateDeclaration.name.elements[1];
74771
+ if (typescriptBinding.isOmittedExpression(setterBinding) || !typescriptBinding.isIdentifier(setterBinding.name) || setterBinding.name.text !== setterIdentifier.text || setterBinding.initializer || setterBinding.dotDotDotToken || setterBinding.propertyName) continue;
74772
+ const stateInitializer = unwrapTypescriptExpression(stateDeclaration.initializer);
74773
+ if (!typescriptBinding.isCallExpression(stateInitializer) || !isNativeReactCall(stateInitializer, "useState", sourceFile, index)) continue;
74774
+ return hasOnlyAllowedIdentifiers(index, setterIdentifier.text, [
74775
+ setterBinding.name,
74776
+ setterIdentifier,
74777
+ failureSetter
74778
+ ]);
74779
+ }
74780
+ }
74781
+ return false;
74782
+ };
74783
+ const createDeferredEffectStateDiagnosticChecker = (rootDirectory) => {
74784
+ const parsedFiles = /* @__PURE__ */ new Map();
74785
+ const readAndParse = (filename) => {
74786
+ const cached = parsedFiles.get(filename);
74787
+ if (cached !== void 0) return cached;
74788
+ let parsed;
74789
+ try {
74790
+ const sourceText = fs$1$2.readFileSync(filename, "utf8");
74791
+ const sourceFile = typescriptBinding.createSourceFile(filename, sourceText, typescriptBinding.ScriptTarget.Latest, true, getTypescriptScriptKind(filename));
74792
+ parsed = "parseDiagnostics" in sourceFile && Array.isArray(sourceFile.parseDiagnostics) && sourceFile.parseDiagnostics.length > 0 ? null : {
74793
+ sourceText,
74794
+ sourceFile,
74795
+ index: collectEffectSourceIndex(sourceFile)
74796
+ };
74797
+ } catch {
74798
+ parsed = null;
74799
+ }
74800
+ parsedFiles.set(filename, parsed);
74801
+ return parsed;
74802
+ };
74803
+ return (diagnostic) => {
74804
+ if (diagnostic.code !== "react-hooks-js(set-state-in-effect)") return false;
74805
+ const span = diagnostic.labels[0]?.span;
74806
+ if (!span || !Number.isInteger(span.offset) || !Number.isInteger(span.length) || span.offset < 0 || span.length <= 0) return false;
74807
+ const parsed = readAndParse(path$1$1.resolve(rootDirectory, diagnostic.filename));
74808
+ if (!parsed || parsed.index.hasReflection) return false;
74809
+ const { sourceText, sourceFile, index } = parsed;
74810
+ const calleeOffset = getUtf16Offset(sourceText, span.offset);
74811
+ const helperCall = index.calls.find((call) => {
74812
+ const callee = unwrapTypescriptExpression(call.expression);
74813
+ return typescriptBinding.isIdentifier(callee) && callee.getStart(sourceFile) === calleeOffset;
74814
+ });
74815
+ if (!helperCall || helperCall.questionDotToken) return false;
74816
+ const callee = unwrapTypescriptExpression(helperCall.expression);
74817
+ return Buffer.byteLength(sourceText.slice(0, calleeOffset)) === span.offset && Buffer.byteLength(callee.getText(sourceFile)) === span.length && hasDeferredLocalHelper(helperCall, sourceFile, index);
74818
+ };
74819
+ };
74009
74820
  const MANUAL_MEMOIZATION_PLUGIN = "react-doctor";
74010
74821
  const MANUAL_MEMOIZATION_RULE = "react-compiler-no-manual-memoization";
74011
74822
  const REACT_COMPILER_PLUGIN = "react-hooks-js";
@@ -74294,7 +75105,7 @@ const parseOxlintOutput = (stdout, project, rootDirectory, sourcePathByLintPath,
74294
75105
  return minified;
74295
75106
  };
74296
75107
  const readContextRanges = createDiagnosticContextReader(diagnosticContextDirectory);
74297
- return suppressMemoizationInBailedOutFunctions(parsed.diagnostics.flatMap((unbridgedDiagnostic) => {
75108
+ const sourceMappedDiagnostics = parsed.diagnostics.flatMap((unbridgedDiagnostic) => {
74298
75109
  if (!isMappableOxlintDiagnostic(unbridgedDiagnostic)) return [];
74299
75110
  const rawDiagnostic = bridgeReactCompilerDiagnostic(unbridgedDiagnostic);
74300
75111
  const { plugin, rule } = parseRuleCode(rawDiagnostic.code);
@@ -74320,7 +75131,9 @@ const parseOxlintOutput = (stdout, project, rootDirectory, sourcePathByLintPath,
74320
75131
  labels,
74321
75132
  contextRanges: []
74322
75133
  }];
74323
- }).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) => {
75134
+ });
75135
+ const shouldSuppressDeferredEffectStateDiagnostic = createDeferredEffectStateDiagnosticChecker(rootDirectory);
75136
+ return suppressMemoizationInBailedOutFunctions(sourceMappedDiagnostics.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) && !shouldSuppressDeferredEffectStateDiagnostic(diagnostic) && !shouldSuppressCompilerFindingInWorklet(diagnostic, project, rootDirectory)).map((diagnostic) => {
74324
75137
  const { plugin, rule } = parseRuleCode(diagnostic.code);
74325
75138
  const primaryLabel = diagnostic.labels[0];
74326
75139
  const cleaned = cleanDiagnosticMessage(diagnostic.message, diagnostic.help, plugin, rule, project);
@@ -75221,7 +76034,11 @@ const runOxlint = async (options) => {
75221
76034
  const adoptableConfigPaths = detectedConfigPaths.filter(canOxlintExtendConfig);
75222
76035
  const adoptedSettings = detectedConfigPaths.length > 0 ? readAdoptedLintConfigSettings(detectedConfigPaths) : {};
75223
76036
  const userPlugins = includedTags.size > 0 ? [] : resolveUserPlugins(userConfig?.plugins, configSourceDirectory);
75224
- const restoreDisableDirectives = await neutralizeDisableDirectives(rootDirectory, includePaths ?? options.precomputedSourceFiles?.map((sourceFile) => sourceFile.path), { recoverOnly: respectInlineDisables });
76037
+ const lintIgnorePolicy = collectLintIgnorePolicy(rootDirectory);
76038
+ const restoreDisableDirectives = await neutralizeDisableDirectives(rootDirectory, includePaths ?? options.precomputedSourceFiles?.map((sourceFile) => sourceFile.path), {
76039
+ recoverOnly: respectInlineDisables,
76040
+ includesFile: lintIgnorePolicy?.includesFile
76041
+ });
75225
76042
  const configDirectory = fs$1$2.mkdtempSync(path$1$1.join(os.tmpdir(), "react-doctor-oxlintrc-"));
75226
76043
  const configPath = path$1$1.join(configDirectory, "oxlintrc.json");
75227
76044
  const workingDirectory = fs$1$2.existsSync(path$1$1.join(rootDirectory, "oxlint-suppressions.json")) ? configDirectory : void 0;
@@ -75247,10 +76064,10 @@ const runOxlint = async (options) => {
75247
76064
  }
75248
76065
  }
75249
76066
  }
75250
- const combinedPatterns = collectIgnorePatterns(rootDirectory);
75251
- if (combinedPatterns.length > 0) {
76067
+ const combinedPatterns = lintIgnorePolicy?.patterns ?? [];
76068
+ if (lintIgnorePolicy) {
75252
76069
  const combinedIgnorePath = path$1$1.join(configDirectory, "combined.ignore");
75253
- fs$1$2.writeFileSync(combinedIgnorePath, `${combinedPatterns.join("\n")}\n`);
76070
+ fs$1$2.writeFileSync(combinedIgnorePath, "");
75254
76071
  sharedArgs.push("--ignore-path", combinedIgnorePath);
75255
76072
  }
75256
76073
  const lintWorkerCount = resolveScanConcurrency(options.concurrency ?? 1);
@@ -75266,8 +76083,9 @@ const runOxlint = async (options) => {
75266
76083
  ];
75267
76084
  await yieldToEventLoop();
75268
76085
  const sizedScanFiles = options.precomputedSourceFiles ?? (includePaths === void 0 ? listSourceFilesWithSize(rootDirectory) : null);
75269
- const candidateFiles = sizedScanFiles === null ? includePaths ?? [] : sizedScanFiles.map((entry) => entry.path);
75270
- const projectIndexModuleSources = includePaths === void 0 && options.deadlineEpochMs === void 0 ? await collectProjectIndexModuleSources(rootDirectory, candidateFiles) : void 0;
76086
+ const discoveredFiles = sizedScanFiles === null ? includePaths ?? [] : sizedScanFiles.map((entry) => entry.path);
76087
+ const candidateFiles = lintIgnorePolicy ? discoveredFiles.filter(lintIgnorePolicy.includesFile) : discoveredFiles;
76088
+ const projectIndexModuleSources = includePaths === void 0 && options.deadlineEpochMs === void 0 ? await collectProjectIndexModuleSources(rootDirectory, discoveredFiles) : void 0;
75271
76089
  unpluginAutoImportGlobalScopes = collectUnpluginAutoImportGlobalScopes({
75272
76090
  rootDirectory,
75273
76091
  candidateFiles
@@ -76713,10 +77531,11 @@ const runInspect = (input, hooks = {}) => gen(function* () {
76713
77531
  const lintFailureState = yield* get$2(lintFailure);
76714
77532
  yield* afterLint(lintFailureState.didFail);
76715
77533
  if (lintFailureState.didFail) yield* scanProgress.fail(formatLintFailText(lintFailureState.reasonTag, process.version));
76716
- const candidateFiles = lintFileCoverageState.value === null ? [] : [...new Set(lintFileCoverageState.value.candidateFiles.map((filePath) => toNormalizedRelativePath(filePath, scanDirectory)))];
76717
- const analyzedFiles = lintFileCoverageState.value === null ? [] : [...new Set(lintFileCoverageState.value.analyzedFiles.map((filePath) => toNormalizedRelativePath(filePath, scanDirectory)))].sort();
76718
- const totalFileCount = candidateFiles.length || lastReportedTotalFileCount || (lintIncludePaths?.length ?? project.sourceFileCount);
76719
- const scannedFilePaths = input.suppressScanSummary ? candidateFiles.length > 0 ? candidateFiles.map((filePath) => path$1$1.resolve(scanDirectory, filePath)) : fallbackScannedFilePaths : [];
77534
+ const lintFileCoverage = lintFileCoverageState.value;
77535
+ const candidateFiles = lintFileCoverage === null ? [] : [...new Set(lintFileCoverage.candidateFiles.map((filePath) => toNormalizedRelativePath(filePath, scanDirectory)))];
77536
+ const analyzedFiles = lintFileCoverage === null ? [] : [...new Set(lintFileCoverage.analyzedFiles.map((filePath) => toNormalizedRelativePath(filePath, scanDirectory)))].sort();
77537
+ const totalFileCount = lintFileCoverage === null ? lastReportedTotalFileCount || (lintIncludePaths?.length ?? project.sourceFileCount) : candidateFiles.length;
77538
+ const scannedFilePaths = input.suppressScanSummary ? lintFileCoverage === null ? fallbackScannedFilePaths : candidateFiles.map((filePath) => path$1$1.resolve(scanDirectory, filePath)) : [];
76720
77539
  const scannedFilesLabel = `${totalFileCount} ${totalFileCount === 1 ? "file" : "files"}`;
76721
77540
  let maintainabilityCollected = [];
76722
77541
  if (lintFailureState.didFail) yield* interrupt(maintainabilityFiber);
@@ -76963,15 +77782,37 @@ const materializeSourceTree = (input) => gen(function* () {
76963
77782
  materializedFiles.push(relativePath);
76964
77783
  }
76965
77784
  yield* sync(() => {
76966
- for (const subdirectory of ["", ...input.configSubdirectories ?? []]) for (const configFilename of STAGED_FILES_PROJECT_CONFIG_FILENAMES) {
76967
- const sourcePath = path.join(input.directory, subdirectory, configFilename);
76968
- const targetPath = path.resolve(resolvedTempDirectory, subdirectory, configFilename);
76969
- if (!isPathInsideDirectory(targetPath, resolvedTempDirectory)) continue;
76970
- if (isFile(sourcePath) && !fs.existsSync(targetPath)) {
76971
- fs.mkdirSync(path.dirname(targetPath), { recursive: true });
76972
- fs.cpSync(sourcePath, targetPath);
77785
+ const sourceDirectory = path.resolve(input.directory);
77786
+ const projectDirectories = new Set(["", ...input.configSubdirectories ?? []]);
77787
+ const intermediateDirectories = /* @__PURE__ */ new Set();
77788
+ for (const subdirectory of projectDirectories) {
77789
+ const projectDirectory = path.resolve(sourceDirectory, subdirectory);
77790
+ if (!isPathInsideDirectory(projectDirectory, sourceDirectory)) continue;
77791
+ for (const ancestor of ancestorDirectories(projectDirectory, { includeStart: false })) {
77792
+ if (!isPathInsideDirectory(ancestor, sourceDirectory)) break;
77793
+ const relativeDirectory = path.relative(sourceDirectory, ancestor);
77794
+ if (!projectDirectories.has(relativeDirectory)) intermediateDirectories.add(relativeDirectory);
76973
77795
  }
76974
77796
  }
77797
+ const copyConfigs = (subdirectory, filenames) => {
77798
+ for (const configFilename of filenames) {
77799
+ const sourcePath = path.join(input.directory, subdirectory, configFilename);
77800
+ const targetPath = path.resolve(resolvedTempDirectory, subdirectory, configFilename);
77801
+ if (!isPathInsideDirectory(targetPath, resolvedTempDirectory)) continue;
77802
+ if (isFile(sourcePath) && !fs.existsSync(targetPath)) {
77803
+ fs.mkdirSync(path.dirname(targetPath), { recursive: true });
77804
+ fs.cpSync(sourcePath, targetPath);
77805
+ }
77806
+ }
77807
+ };
77808
+ for (const subdirectory of projectDirectories) copyConfigs(subdirectory, STAGED_FILES_PROJECT_CONFIG_FILENAMES);
77809
+ for (const subdirectory of intermediateDirectories) copyConfigs(subdirectory, [
77810
+ "package.json",
77811
+ "pnpm-workspace.yaml",
77812
+ "nx.json",
77813
+ ...LINT_IGNORE_STYLE_FILENAMES,
77814
+ LINT_LINGUIST_FILENAME
77815
+ ]);
76975
77816
  });
76976
77817
  return {
76977
77818
  tempDirectory: input.tempDirectory,
@@ -77836,7 +78677,7 @@ const makeNoopConsole = () => ({
77836
78677
  });
77837
78678
  //#endregion
77838
78679
  //#region src/cli/utils/version.ts
77839
- const VERSION = "0.9.23-dev.ed93f67";
78680
+ const VERSION = "0.9.23-dev.eeff4d4";
77840
78681
  //#endregion
77841
78682
  //#region src/cli/utils/json-mode.ts
77842
78683
  let context = null;
@@ -78180,5 +79021,5 @@ const recordDistribution = (name, value, options = {}) => {
78180
79021
  //#endregion
78181
79022
  export { buildRuleSeverityControls as $, runInspect as $t, Files as A, buildWithScope as An, hasPublishedFixRecipe as At, PerFileLintCacheEnabled as B, yieldToEventLoop as Bn, listSourceFiles as Bt, ACTION_INPUT_ENVIRONMENT_VARIABLES as C, provideContext as Cn, getChangedLineRanges as Ct, isCodingAgentEnvironment as D, sync as Dn, getRuleMetadata as Dt, isCiOrCodingAgentEnvironment as E, runSync as En, getEquivalentRuleKeys as Et, Linter as F, makeUnsafe$5 as Fn, isProjectDiscoveryError as Ft, SidecarLintCacheEnabled as G, isFile as Gn, materializeSourceTree as Gt, Project as H, toCanonicalPath as Hn, listWorkspacePackages as Ht, Maintainability as I, fail$5 as In, isReactDoctorError as It, anonymizeInPlace as J, remainingDeadlineBudgetMs as Jt, StagedFiles as K, isPlainObject as Kn, mergeAndFilterDiagnostics as Kt, NodeResolver as L, void_$1 as Ln, isSameRuleKey as Lt, InvocationCaches as M, provide$2 as Mn, hashFileContents as Mt, LEGACY_CONFIG_FILENAME as N, succeed$3 as Nn, highlighter as Nt, Config as O, try_ as On, getUnknownBundledRuleKeys as Ot, LintPartialFailures as P, close as Pn, isPathInsideDirectory as Pt, buildRuleDocsUrl as Q, restoreLegacyThrow as Qt, OxlintConcurrency as R, ParentSpan as Rn, isScanComplete as Rt, isDebugFlagEnabled as S, provide as Sn, getBaselineDiffPlan as St, isCiEnvironment as T, runPromise as Tn, getDiffInfo as Tt, Reporter as U, isDirectory as Un, loadConfigWithSource as Ut, Progress as V, messageFromUnknown as Vn, listSourceFilesCooperative as Vt, Score as W, isErrnoException as Wn, mapWithConcurrency as Wt, atomicWriteJson as X, resolveLintBatchOrdering as Xt, anonymizeText as Y, resolveGithubActionsScoreMetadata as Yt, buildJsonReport as Z, resolveScanTarget as Zt, VERSION as _, gen as _n, findGitRepositoryRoot as _t, isEnvFlagEnabled as a, validateConfigTypes as an, collectSourceFilesByDirectory as at, isNonInteractiveEnvironment as b, orElseSucceed as bn, formatErrorChain as bt, setSentryProjectInfo as c, Console as cn, countOptInProjectRuleSelections as ct, isJsonModeActive as d, log as dn, createOxlintSpawnSlots as dt, scrubSensitivePaths as en, buildSkippedChecks as et, setJsonReportDirectory as f, warn$1 as fn, detectAiTrainingEnvironment as ft, writeJsonReport as g, make$30 as gn, filterSourceFiles as gt, writeJsonErrorReport as h, decodeUnknownSync as hn, filterPathsOutsideDirectories as ht, isTelemetryEnabled as i, toRelativePath as in, clearConfigCache as it, Git as j, mergeAll$1 as jn, hasSupportedFrameworkOrLibrary as jt, DIAGNOSTIC_DELTA_IDENTITY as k, void_ as kn, groupBy as kt, getRunId as l, error as ln, createChangedLineMatcher as lt, writeJsonCancellationReport as m, JsonReport as mn, filterDiagnosticsForSurface as mt, recordDistribution as n, shouldUseMaintainabilityLayer as nn, canonicalizeUserRuleKey as nt, buildSentryScope as o, warmDuplicateJsxWorker as on, computeConfigFingerprint as ot, setJsonReportMode as p, Diagnostic as pn, discoverSupportedSubprojects as pt, SupplyChain as q, mergeReactDoctorConfigs as qt, toSpanAttributes as r, summarizeDiagnostics as rn, classifyFileContext as rt, buildSentryProjectContext as s, warmOxlintWorkerPool as sn, computeDiagnosticDelta as st, recordCount as t, setColorEnabled as tn, calculateScore as tt, enableJsonMode as u, info as un, createInvocationCaches as ut, makeNoopConsole as v, makeSpan$1 as vn, findLegacyConfig as vt, detectRunnerOs as w, provideService as wn, getDiagnosticRuleIdentity as wt, isGitHookEnvironment as x, promise as xn, formatReactDoctorError as xt, CliInputError as y, map$3 as yn, fingerprintDiagnosticEvidence as yt, OxlintSpawnSlots as z, isMonorepoRoot as zn, layerObservability as zt };
78182
79023
 
78183
- //# sourceMappingURL=record-metric-D5cWO5c1.js.map
78184
- //# debugId=6d102103-5320-5a2f-9438-e95e18b45cf9
79024
+ //# sourceMappingURL=record-metric-CqZ2oVM5.js.map
79025
+ //# debugId=4f395a61-8b10-59b6-9932-c6b841e1f49d