react-doctor 0.4.2-dev.25cc69b → 0.4.2-dev.48e61bc

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -487,6 +487,17 @@ interface ProjectInfo {
487
487
  * apply, instead of on every React Native project.
488
488
  */
489
489
  hasReanimated: boolean;
490
+ /**
491
+ * `true` when the project's `tsconfig.json` `compilerOptions.target` or
492
+ * `compilerOptions.lib` indicates the output environment predates ES2023
493
+ * (e.g. `target: "es2022"` or `lib: ["es2022"]`). Drives the `pre-es2023`
494
+ * capability in `buildCapabilities` so rules recommending ES2023-only
495
+ * methods (`toSorted`, `toReversed`, `toSpliced`, `with`, etc.) are
496
+ * silenced on projects that would get a type error or runtime crash.
497
+ * `false` when no tsconfig is found, when the target is ES2023+, or when
498
+ * the config is unparseable — the safe default is to keep the rule active.
499
+ */
500
+ isPreES2023Target: boolean;
490
501
  sourceFileCount: number;
491
502
  }
492
503
  //#endregion
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
 
2
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="9c92e27f-f5cc-5567-8d2c-50a861beaec5")}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]="9bcfadac-add8-5228-906c-b747130f5ba9")}catch(e){}}();
3
3
  import { createRequire } from "node:module";
4
4
  import * as Schema from "effect/Schema";
5
5
  import * as fs$1 from "node:fs";
@@ -7,6 +7,7 @@ import fs from "node:fs";
7
7
  import * as path$1 from "node:path";
8
8
  import path from "node:path";
9
9
  import { spawn, spawnSync } from "node:child_process";
10
+ import * as ts from "typescript";
10
11
  import reactDoctorPlugin, { ALL_REACT_DOCTOR_RULE_KEYS, FRAMEWORK_SPECIFIC_RULE_KEYS, MOTION_LIBRARY_PACKAGES, REACT_COMPILER_RULES, REACT_DOCTOR_RULES } from "oxlint-plugin-react-doctor";
11
12
  import * as Cause from "effect/Cause";
12
13
  import * as Effect from "effect/Effect";
@@ -31,7 +32,6 @@ import * as NodeFileSystem from "@effect/platform-node-shared/NodeFileSystem";
31
32
  import * as NodePath from "@effect/platform-node-shared/NodePath";
32
33
  import * as ChildProcess from "effect/unstable/process/ChildProcess";
33
34
  import { ChildProcessSpawner } from "effect/unstable/process/ChildProcessSpawner";
34
- import * as ts from "typescript";
35
35
  import { gzipSync } from "node:zlib";
36
36
  import "effect/Exit";
37
37
  //#region \0rolldown/runtime.js
@@ -2125,8 +2125,8 @@ const isFile = (filePath) => {
2125
2125
  return false;
2126
2126
  }
2127
2127
  };
2128
- const SOURCE_FILE_PATTERN = /\.(tsx?|jsx?)$/;
2129
- const GENERATED_BUNDLE_FILE_PATTERN = /\.(iife|umd|global|min)\.js$/i;
2128
+ const SOURCE_FILE_PATTERN = /\.(tsx?|jsx?|mts|mjs)$/;
2129
+ const GENERATED_BUNDLE_FILE_PATTERN = /\.(iife|umd|global|min)\.m?js$/i;
2130
2130
  const MINIFIED_SNIFF_BYTES = 65536;
2131
2131
  const GIT_LS_FILES_MAX_BUFFER_BYTES = 50 * 1024 * 1024;
2132
2132
  const IGNORED_DIRECTORIES = new Set([
@@ -3041,6 +3041,171 @@ const resolveEffectiveReactMajor = (reactVersion, packageJson) => {
3041
3041
  if (peerFloor === null) return hasUpperBoundOnlyPeerRange(peerReactRange) ? null : installedReactMajor;
3042
3042
  return installedReactMajor !== null ? Math.min(installedReactMajor, peerFloor) : peerFloor;
3043
3043
  };
3044
+ const JSX_FILE_PATTERN = /\.(tsx|jsx)$/;
3045
+ const MILLISECONDS_PER_SECOND = 1e3;
3046
+ const SCORE_API_URL = "https://www.react.doctor/api/score";
3047
+ const FETCH_TIMEOUT_MS = 1e4;
3048
+ const GITHUB_VIEWER_PERMISSION_TIMEOUT_MS = 2e3;
3049
+ const DEFAULT_BRANCH_CANDIDATES = ["main", "master"];
3050
+ const ADOPTABLE_LINT_CONFIG_FILENAMES = [".oxlintrc.json", ".eslintrc.json"];
3051
+ const GIT_SHOW_MAX_BUFFER_BYTES = 10 * 1024 * 1024;
3052
+ const ES_TARGET_YEAR_BY_NAME = {
3053
+ es3: 1999,
3054
+ es5: 2009,
3055
+ es6: 2015,
3056
+ es2015: 2015,
3057
+ es2016: 2016,
3058
+ es2017: 2017,
3059
+ es2018: 2018,
3060
+ es2019: 2019,
3061
+ es2020: 2020,
3062
+ es2021: 2021,
3063
+ es2022: 2022,
3064
+ es2023: 2023,
3065
+ es2024: 2024,
3066
+ es2025: 2025,
3067
+ esnext: 9999
3068
+ };
3069
+ /**
3070
+ * Project-config files that `StagedFiles.materialize` copies into
3071
+ * the temp directory alongside staged sources so oxlint resolves
3072
+ * `tsconfig` / `package.json` / lint configs the same way it would
3073
+ * in the working tree. Hoisted out of the staged-files helper so
3074
+ * the constant lives next to the rest of the IO budget knobs.
3075
+ */
3076
+ const STAGED_FILES_PROJECT_CONFIG_FILENAMES = [
3077
+ "tsconfig.json",
3078
+ "tsconfig.base.json",
3079
+ "package.json",
3080
+ "doctor.config.ts",
3081
+ "doctor.config.mts",
3082
+ "doctor.config.cts",
3083
+ "doctor.config.js",
3084
+ "doctor.config.mjs",
3085
+ "doctor.config.cjs",
3086
+ "doctor.config.json",
3087
+ "doctor.config.jsonc",
3088
+ "oxlint.json",
3089
+ ".oxlintrc.json"
3090
+ ];
3091
+ const OXLINT_OUTPUT_MAX_BYTES = 50 * 1024 * 1024;
3092
+ const OXLINT_SPAWN_TIMEOUT_MS = 6e4;
3093
+ const DEAD_CODE_WORKER_MAX_OLD_SPACE_MB = 8192;
3094
+ const RECOMMENDED_PNPM_MINIMUM_RELEASE_AGE_MINUTES = 10080;
3095
+ const DIAGNOSTIC_CATEGORY_BUCKETS = [
3096
+ "Security",
3097
+ "Bugs",
3098
+ "Performance",
3099
+ "Accessibility",
3100
+ "Maintainability"
3101
+ ];
3102
+ const APP_ONLY_RULE_KEYS = new Set([
3103
+ "react-hooks-js/static-components",
3104
+ "react-doctor/no-render-prop-children",
3105
+ "react-doctor/prefer-explicit-variants"
3106
+ ]);
3107
+ const COMPILER_CLEANUP_BUCKET = "compiler-cleanup";
3108
+ const COMPILER_CLEANUP_RULE_KEYS = new Set(["react-doctor/react-compiler-no-manual-memoization"]);
3109
+ const MAX_GLOB_PATTERN_LENGTH_CHARS = 1024;
3110
+ const CONFIG_CACHE_TTL_MS = 300 * 1e3;
3111
+ const TSCONFIG_FILENAME = "tsconfig.json";
3112
+ const isRelativeExtendsValue = (extendsValue) => extendsValue.startsWith("./") || extendsValue.startsWith("../") || path$1.isAbsolute(extendsValue);
3113
+ const ensureJsonExtension = (filePath) => path$1.extname(filePath) === "" ? `${filePath}.json` : filePath;
3114
+ const resolvePackageExtendsPath = (extendsValue, fromConfigDirectory) => {
3115
+ const requireFromConfig = createRequire(path$1.join(fromConfigDirectory, "tsconfig.json"));
3116
+ const candidates = [
3117
+ extendsValue,
3118
+ ensureJsonExtension(extendsValue),
3119
+ `${extendsValue.replace(/\/$/, "")}/tsconfig.json`
3120
+ ];
3121
+ for (const candidate of candidates) try {
3122
+ return requireFromConfig.resolve(candidate);
3123
+ } catch {
3124
+ continue;
3125
+ }
3126
+ return null;
3127
+ };
3128
+ const resolveExtendsPath = (extendsValue, fromConfigDirectory) => {
3129
+ if (isRelativeExtendsValue(extendsValue)) return ensureJsonExtension(path$1.resolve(fromConfigDirectory, extendsValue));
3130
+ return resolvePackageExtendsPath(extendsValue, fromConfigDirectory);
3131
+ };
3132
+ const normalizeCompilerOptions = (compilerOptions) => {
3133
+ if (!isPlainObject(compilerOptions)) return { hasExplicitLib: false };
3134
+ const target = typeof compilerOptions.target === "string" ? compilerOptions.target : void 0;
3135
+ const hasExplicitLib = Object.hasOwn(compilerOptions, "lib");
3136
+ return {
3137
+ target,
3138
+ lib: Array.isArray(compilerOptions.lib) ? compilerOptions.lib.filter((entry) => typeof entry === "string") : void 0,
3139
+ hasExplicitLib
3140
+ };
3141
+ };
3142
+ const readTsConfig = (filePath) => {
3143
+ let content;
3144
+ try {
3145
+ content = fs$1.readFileSync(filePath, "utf-8");
3146
+ } catch {
3147
+ return null;
3148
+ }
3149
+ const parsed = ts.parseConfigFileTextToJson(filePath, content);
3150
+ if (!isPlainObject(parsed.config)) return null;
3151
+ return {
3152
+ extends: typeof parsed.config.extends === "string" ? parsed.config.extends : void 0,
3153
+ compilerOptions: normalizeCompilerOptions(parsed.config.compilerOptions)
3154
+ };
3155
+ };
3156
+ const mergeCompilerOptions = (inherited, current) => {
3157
+ const target = current.target ?? inherited?.target;
3158
+ const hasExplicitLib = current.hasExplicitLib || Boolean(inherited?.hasExplicitLib);
3159
+ return {
3160
+ target,
3161
+ lib: current.hasExplicitLib ? current.lib : inherited?.lib,
3162
+ hasExplicitLib
3163
+ };
3164
+ };
3165
+ const readResolvedCompilerOptions = (tsConfigPath, extendsDepth, visitedPaths) => {
3166
+ const realPath = fs$1.realpathSync.native(tsConfigPath);
3167
+ if (visitedPaths.has(realPath)) return null;
3168
+ const tsConfig = readTsConfig(realPath);
3169
+ if (!tsConfig) return null;
3170
+ const nextVisitedPaths = new Set(visitedPaths);
3171
+ nextVisitedPaths.add(realPath);
3172
+ if (tsConfig.extends && extendsDepth < 8) {
3173
+ const parentPath = resolveExtendsPath(tsConfig.extends, path$1.dirname(realPath));
3174
+ if (parentPath && isFile(parentPath)) return mergeCompilerOptions(readResolvedCompilerOptions(parentPath, extendsDepth + 1, nextVisitedPaths), tsConfig.compilerOptions);
3175
+ }
3176
+ return tsConfig.compilerOptions;
3177
+ };
3178
+ const targetYearIsPreES2023 = (target) => {
3179
+ const year = ES_TARGET_YEAR_BY_NAME[target.toLowerCase()];
3180
+ return year !== void 0 && year < 2023;
3181
+ };
3182
+ const libEntryIncludesES2023Array = (entry) => {
3183
+ const normalizedEntry = entry.toLowerCase();
3184
+ if (normalizedEntry === "esnext" || normalizedEntry === "esnext.array") return true;
3185
+ const esYearMatch = /^es(\d{4})(?:\.(.+))?$/.exec(normalizedEntry);
3186
+ if (!esYearMatch) return false;
3187
+ if (Number(esYearMatch[1]) < 2023) return false;
3188
+ const component = esYearMatch[2];
3189
+ return component === void 0 || component === "array";
3190
+ };
3191
+ const libIncludesES2023 = (lib) => lib.some(libEntryIncludesES2023Array);
3192
+ const compilerOptionsArePreES2023 = (compilerOptions) => {
3193
+ if (compilerOptions.hasExplicitLib) return !libIncludesES2023(compilerOptions.lib ?? []);
3194
+ if (compilerOptions.target) return targetYearIsPreES2023(compilerOptions.target);
3195
+ return false;
3196
+ };
3197
+ const compilerOptionsDeclareTargetOrLib = (compilerOptions) => compilerOptions.hasExplicitLib || compilerOptions.target !== void 0;
3198
+ const detectPreES2023FromConfig = (tsConfigPath) => {
3199
+ const compilerOptions = readResolvedCompilerOptions(tsConfigPath, 0, /* @__PURE__ */ new Set());
3200
+ if (!compilerOptions) return false;
3201
+ if (!compilerOptionsDeclareTargetOrLib(compilerOptions)) return false;
3202
+ return compilerOptionsArePreES2023(compilerOptions);
3203
+ };
3204
+ const detectPreES2023Target = (directory) => {
3205
+ const tsConfigPath = path$1.join(directory, TSCONFIG_FILENAME);
3206
+ if (isFile(tsConfigPath)) return detectPreES2023FromConfig(tsConfigPath);
3207
+ return false;
3208
+ };
3044
3209
  const REACT_DEPENDENCY_NAMES = new Set([
3045
3210
  "react",
3046
3211
  "react-native",
@@ -3245,6 +3410,7 @@ const discoverProject = (directory) => {
3245
3410
  version: findNextjsVersion(directory, packageJson)
3246
3411
  }) : null;
3247
3412
  const preactVersion = getPreactVersion(packageJson);
3413
+ const isPreES2023Target = hasTypeScript && detectPreES2023Target(directory);
3248
3414
  const projectInfo = {
3249
3415
  rootDirectory: directory,
3250
3416
  projectName,
@@ -3266,6 +3432,7 @@ const discoverProject = (directory) => {
3266
3432
  shopifyFlashListVersion,
3267
3433
  shopifyFlashListMajorVersion: shopifyFlashListVersion === null ? null : getLowestDependencyMajor(shopifyFlashListVersion),
3268
3434
  hasReanimated,
3435
+ isPreES2023Target,
3269
3436
  sourceFileCount
3270
3437
  };
3271
3438
  cachedProjectInfos.set(directory, projectInfo);
@@ -3335,56 +3502,6 @@ const isTailwindAtLeast = (detected, required) => {
3335
3502
  if (detected.major !== required.major) return detected.major > required.major;
3336
3503
  return detected.minor >= required.minor;
3337
3504
  };
3338
- const JSX_FILE_PATTERN = /\.(tsx|jsx)$/;
3339
- const MILLISECONDS_PER_SECOND = 1e3;
3340
- const SCORE_API_URL = "https://www.react.doctor/api/score";
3341
- const FETCH_TIMEOUT_MS = 1e4;
3342
- const GITHUB_VIEWER_PERMISSION_TIMEOUT_MS = 2e3;
3343
- const DEFAULT_BRANCH_CANDIDATES = ["main", "master"];
3344
- const ADOPTABLE_LINT_CONFIG_FILENAMES = [".oxlintrc.json", ".eslintrc.json"];
3345
- const GIT_SHOW_MAX_BUFFER_BYTES = 10 * 1024 * 1024;
3346
- /**
3347
- * Project-config files that `StagedFiles.materialize` copies into
3348
- * the temp directory alongside staged sources so oxlint resolves
3349
- * `tsconfig` / `package.json` / lint configs the same way it would
3350
- * in the working tree. Hoisted out of the staged-files helper so
3351
- * the constant lives next to the rest of the IO budget knobs.
3352
- */
3353
- const STAGED_FILES_PROJECT_CONFIG_FILENAMES = [
3354
- "tsconfig.json",
3355
- "tsconfig.base.json",
3356
- "package.json",
3357
- "doctor.config.ts",
3358
- "doctor.config.mts",
3359
- "doctor.config.cts",
3360
- "doctor.config.js",
3361
- "doctor.config.mjs",
3362
- "doctor.config.cjs",
3363
- "doctor.config.json",
3364
- "doctor.config.jsonc",
3365
- "oxlint.json",
3366
- ".oxlintrc.json"
3367
- ];
3368
- const OXLINT_OUTPUT_MAX_BYTES = 50 * 1024 * 1024;
3369
- const OXLINT_SPAWN_TIMEOUT_MS = 6e4;
3370
- const DEAD_CODE_WORKER_MAX_OLD_SPACE_MB = 8192;
3371
- const RECOMMENDED_PNPM_MINIMUM_RELEASE_AGE_MINUTES = 10080;
3372
- const DIAGNOSTIC_CATEGORY_BUCKETS = [
3373
- "Security",
3374
- "Bugs",
3375
- "Performance",
3376
- "Accessibility",
3377
- "Maintainability"
3378
- ];
3379
- const APP_ONLY_RULE_KEYS = new Set([
3380
- "react-hooks-js/static-components",
3381
- "react-doctor/no-render-prop-children",
3382
- "react-doctor/prefer-explicit-variants"
3383
- ]);
3384
- const COMPILER_CLEANUP_BUCKET = "compiler-cleanup";
3385
- const COMPILER_CLEANUP_RULE_KEYS = new Set(["react-doctor/react-compiler-no-manual-memoization"]);
3386
- const MAX_GLOB_PATTERN_LENGTH_CHARS = 1024;
3387
- const CONFIG_CACHE_TTL_MS = 300 * 1e3;
3388
3505
  var InvalidGlobPatternError = class extends Error {
3389
3506
  pattern;
3390
3507
  reason;
@@ -3695,7 +3812,6 @@ const LEGACY_RULE_KEY_TO_NATIVE_RULE_KEY = {
3695
3812
  "react/jsx-no-new-function-as-prop": "react-doctor/jsx-no-new-function-as-prop",
3696
3813
  "react/jsx-no-new-object-as-prop": "react-doctor/jsx-no-new-object-as-prop",
3697
3814
  "react/jsx-no-script-url": "react-doctor/jsx-no-script-url",
3698
- "react/jsx-no-target-blank": "react-doctor/jsx-no-target-blank",
3699
3815
  "react/jsx-no-undef": "react-doctor/jsx-no-undef",
3700
3816
  "react/jsx-no-useless-fragment": "react-doctor/jsx-no-useless-fragment",
3701
3817
  "react/jsx-pascal-case": "react-doctor/jsx-pascal-case",
@@ -4867,51 +4983,51 @@ const FLAGGED_DEPENDENCIES = [
4867
4983
  {
4868
4984
  packageName: "expo-modules-autolinking",
4869
4985
  rule: "expo-no-redundant-dependency",
4870
- message: "\"expo-modules-autolinking\" should not be a direct dependency — Expo installs it transitively as needed",
4986
+ message: "\"expo-modules-autolinking\" should not be a direct dependency. Expo pins the compatible version through the SDK, and a direct entry can drift to a version that breaks prebuild, Metro, or native builds",
4871
4987
  help: "Remove `expo-modules-autolinking` from your package.json"
4872
4988
  },
4873
4989
  {
4874
4990
  packageName: "expo-dev-launcher",
4875
4991
  rule: "expo-no-redundant-dependency",
4876
- message: "\"expo-dev-launcher\" should not be a direct dependency — it is pulled in by `expo-dev-client`",
4992
+ message: "\"expo-dev-launcher\" should not be a direct dependency. `expo-dev-client` pins the compatible launcher, and a direct entry can drift to a version that breaks native builds",
4877
4993
  help: "Remove `expo-dev-launcher` and depend on `expo-dev-client` instead"
4878
4994
  },
4879
4995
  {
4880
4996
  packageName: "expo-dev-menu",
4881
4997
  rule: "expo-no-redundant-dependency",
4882
- message: "\"expo-dev-menu\" should not be a direct dependency — it is pulled in by `expo-dev-client`",
4998
+ message: "\"expo-dev-menu\" should not be a direct dependency. `expo-dev-client` pins the compatible dev menu, and a direct entry can drift to a version that breaks native builds",
4883
4999
  help: "Remove `expo-dev-menu` and depend on `expo-dev-client` instead"
4884
5000
  },
4885
5001
  {
4886
5002
  packageName: "expo-modules-core",
4887
5003
  rule: "expo-no-redundant-dependency",
4888
- message: "\"expo-modules-core\" should not be a direct dependency — use the API re-exported from the `expo` package",
5004
+ message: "\"expo-modules-core\" should not be a direct dependency. Expo pins the compatible native core, and a direct entry can drift to a version that breaks prebuild or native builds",
4889
5005
  help: "Remove `expo-modules-core` from your package.json and import from `expo` instead"
4890
5006
  },
4891
5007
  {
4892
5008
  packageName: "@expo/metro-config",
4893
5009
  rule: "expo-no-redundant-dependency",
4894
- message: "\"@expo/metro-config\" should not be a direct dependency — use the `expo/metro-config` sub-export of the `expo` package",
5010
+ message: "\"@expo/metro-config\" should not be a direct dependency. Expo pins the compatible Metro config, and a direct entry can drift to a version that breaks bundling",
4895
5011
  help: "Remove `@expo/metro-config` and import `expo/metro-config` in your metro.config.js"
4896
5012
  },
4897
5013
  {
4898
5014
  packageName: "@types/react-native",
4899
5015
  rule: "expo-no-redundant-dependency",
4900
- message: "\"@types/react-native\" should not be installed — React Native ships its own types since SDK 48",
5016
+ message: "\"@types/react-native\" should not be installed. React Native ships its own types since SDK 48, so the extra package can introduce duplicate or stale type definitions",
4901
5017
  help: "Remove `@types/react-native` from your package.json",
4902
5018
  minSdkMajor: 48
4903
5019
  },
4904
5020
  {
4905
5021
  packageName: "@expo/config-plugins",
4906
5022
  rule: "expo-no-redundant-dependency",
4907
- message: "\"@expo/config-plugins\" should not be a direct dependency — use the `expo/config-plugins` sub-export of the `expo` package",
5023
+ message: "\"@expo/config-plugins\" should not be a direct dependency. Expo pins the compatible config-plugin API, and a direct entry can drift to a version that breaks prebuild",
4908
5024
  help: "Remove `@expo/config-plugins`; config-plugin authors should import from `expo/config-plugins`. See https://github.com/expo/expo/pull/18855",
4909
5025
  minSdkMajor: 48
4910
5026
  },
4911
5027
  {
4912
5028
  packageName: "@expo/prebuild-config",
4913
5029
  rule: "expo-no-redundant-dependency",
4914
- message: "\"@expo/prebuild-config\" should not be a direct dependency — Expo installs it transitively",
5030
+ message: "\"@expo/prebuild-config\" should not be a direct dependency. Expo pins the compatible prebuild config, and a direct entry can drift to a version that breaks prebuild",
4915
5031
  help: "Remove `@expo/prebuild-config` from your package.json",
4916
5032
  minSdkMajor: 53
4917
5033
  },
@@ -4925,28 +5041,28 @@ const FLAGGED_DEPENDENCIES = [
4925
5041
  {
4926
5042
  packageName: "expo-app-loading",
4927
5043
  rule: "expo-no-redundant-dependency",
4928
- message: "\"expo-app-loading\" was removed in SDK 49",
5044
+ message: "\"expo-app-loading\" was removed in SDK 49, so keeping it can leave imports unresolved after upgrading Expo",
4929
5045
  help: "Remove `expo-app-loading` and use `expo-splash-screen` instead. See https://docs.expo.dev/versions/latest/sdk/splash-screen/",
4930
5046
  minSdkMajor: 49
4931
5047
  },
4932
5048
  {
4933
5049
  packageName: "expo-firebase-analytics",
4934
5050
  rule: "expo-no-redundant-dependency",
4935
- message: "\"expo-firebase-analytics\" was removed in SDK 48",
5051
+ message: "\"expo-firebase-analytics\" was removed in SDK 48, so keeping it can leave imports unresolved or fail native builds after upgrading Expo",
4936
5052
  help: FIREBASE_HELP,
4937
5053
  minSdkMajor: 48
4938
5054
  },
4939
5055
  {
4940
5056
  packageName: "expo-firebase-recaptcha",
4941
5057
  rule: "expo-no-redundant-dependency",
4942
- message: "\"expo-firebase-recaptcha\" was removed in SDK 48",
5058
+ message: "\"expo-firebase-recaptcha\" was removed in SDK 48, so keeping it can leave imports unresolved or fail native builds after upgrading Expo",
4943
5059
  help: FIREBASE_HELP,
4944
5060
  minSdkMajor: 48
4945
5061
  },
4946
5062
  {
4947
5063
  packageName: "expo-firebase-core",
4948
5064
  rule: "expo-no-redundant-dependency",
4949
- message: "\"expo-firebase-core\" was removed in SDK 48",
5065
+ message: "\"expo-firebase-core\" was removed in SDK 48, so keeping it can leave imports unresolved or fail native builds after upgrading Expo",
4950
5066
  help: FIREBASE_HELP,
4951
5067
  minSdkMajor: 48
4952
5068
  }
@@ -4987,7 +5103,7 @@ const checkExpoGitignore = (context) => {
4987
5103
  }));
4988
5104
  if (findLocalModuleNativeFiles(rootDirectory).find((nativeFilePath) => isPathGitIgnored(rootDirectory, nativeFilePath) === true) !== void 0) diagnostics.push(buildExpoDiagnostic({
4989
5105
  rule: "expo-gitignore",
4990
- message: "The native `ios`/`android` directories of a local Expo module under `modules/` are gitignored — usually caused by an overly broad `ios`/`android` ignore rule",
5106
+ message: "The native `ios`/`android` directories of a local Expo module under `modules/` are gitignored, so required native code can be missing from CI or teammate checkouts.",
4991
5107
  help: "Use anchored patterns like `/ios` and `/android` in .gitignore so only the top-level native directories are excluded, not those inside `modules/`"
4992
5108
  }));
4993
5109
  return diagnostics;
@@ -5049,17 +5165,16 @@ const checkExpoPackageJsonConflicts = (context) => {
5049
5165
  const conflictingScriptNames = CONFLICTING_SCRIPT_NAMES.filter((scriptName) => Boolean(packageJson.scripts?.[scriptName]));
5050
5166
  if (conflictingScriptNames.length > 0) {
5051
5167
  const quotedNames = conflictingScriptNames.map((name) => `"${name}"`).join(", ");
5052
- const shadowsExpoCli = conflictingScriptNames.includes("expo");
5053
5168
  diagnostics.push(buildExpoDiagnostic({
5054
5169
  rule: "expo-package-json-conflict",
5055
- message: `package.json defines ${quotedNames} ${conflictingScriptNames.length === 1 ? "as a script that conflicts" : "as scripts that conflict"} with binaries in node_modules/.bin${shadowsExpoCli ? " — a `expo` script shadows the Expo CLI and will likely cause build failures" : ""}`,
5170
+ message: `package.json defines ${quotedNames} ${conflictingScriptNames.length === 1 ? "as a script that shadows" : "as scripts that shadow"} Expo/React Native binaries in node_modules/.bin, so tooling can run the local script instead of the expected CLI and fail builds.`,
5056
5171
  help: "Rename these scripts so they don't collide with the `expo` / `react-native` binaries"
5057
5172
  }));
5058
5173
  }
5059
5174
  const packageName = packageJson.name;
5060
5175
  if (typeof packageName === "string" && context.directDependencyNames.has(packageName)) diagnostics.push(buildExpoDiagnostic({
5061
5176
  rule: "expo-package-json-conflict",
5062
- message: `package.json "name" is "${packageName}", which collides with a dependency of the same name`,
5177
+ message: `package.json "name" is "${packageName}", which collides with a dependency of the same name, so package self-resolution can shadow the dependency and break imports that expect the installed package.`,
5063
5178
  help: "Rename your package so it no longer matches one of its dependencies"
5064
5179
  }));
5065
5180
  return diagnostics;
@@ -5130,7 +5245,7 @@ const checkExpoRouterReactNavigation = (context) => {
5130
5245
  if (reactNavigationNames.length === 0) return [];
5131
5246
  return [buildExpoDiagnostic({
5132
5247
  rule: "expo-router-no-react-navigation",
5133
- message: `As of SDK 56, expo-router is no longer compatible with react-navigation, but ${reactNavigationNames.map((name) => `"${name}"`).join(", ")} ${reactNavigationNames.length === 1 ? "is" : "are"} installed as direct ${reactNavigationNames.length === 1 ? "dependency" : "dependencies"}`,
5248
+ message: `As of SDK 56, expo-router is no longer compatible with directly installed @react-navigation packages, so keeping ${reactNavigationNames.map((name) => `"${name}"`).join(", ")} can break routing or linking behavior after the SDK upgrade.`,
5134
5249
  help: "Remove these `@react-navigation/*` packages and replace direct imports with their expo-router equivalents. See https://docs.expo.dev/router/migrate/sdk-55-to-56/"
5135
5250
  })];
5136
5251
  };
@@ -5483,7 +5598,9 @@ const highlighter = {
5483
5598
  gray: import_picocolors.default.gray,
5484
5599
  bold: import_picocolors.default.bold
5485
5600
  };
5486
- const computeJsxIncludePaths = (includePaths) => includePaths.length > 0 ? includePaths.filter((filePath) => JSX_FILE_PATTERN.test(filePath)) : void 0;
5601
+ const NEXT_ENTRY_FILE_PATTERN = /^(?:\.\/)?(?:src\/)?(?:middleware|proxy)\.(?:tsx?|jsx?|mts|mjs)$/;
5602
+ const shouldIncludeExplicitLintPath = (filePath, project) => JSX_FILE_PATTERN.test(filePath) || project?.framework === "nextjs" && NEXT_ENTRY_FILE_PATTERN.test(filePath);
5603
+ const computeExplicitLintIncludePaths = (includePaths, project) => includePaths.length > 0 ? includePaths.filter((filePath) => shouldIncludeExplicitLintPath(filePath, project)) : void 0;
5487
5604
  const LINGUIST_ATTRIBUTE_PATTERN = /^linguist-(?:vendored|generated)(?:=([a-zA-Z0-9]+))?$/i;
5488
5605
  const FALSY_VALUES = new Set([
5489
5606
  "false",
@@ -5912,7 +6029,7 @@ const checkDeadCode = async (options) => {
5912
6029
  plugin: DEAD_CODE_PLUGIN,
5913
6030
  rule: "unused-file",
5914
6031
  severity: "warning",
5915
- message: "Unused file — not reachable from any entry point",
6032
+ message: "Unused file is not reachable from any entry point, so it adds maintenance surface without shipping any code.",
5916
6033
  help: "Delete the file if it is truly unreachable, or import it from an entry point.",
5917
6034
  line: 0,
5918
6035
  column: 0,
@@ -5925,7 +6042,7 @@ const checkDeadCode = async (options) => {
5925
6042
  plugin: DEAD_CODE_PLUGIN,
5926
6043
  rule: unusedExport.isTypeOnly ? "unused-type" : "unused-export",
5927
6044
  severity: "warning",
5928
- message: `Unused ${label}: \`${unusedExport.name}\``,
6045
+ message: `Unused ${label}: \`${unusedExport.name}\` is exported but no module imports it, so it expands the public surface and can mislead callers about supported API.`,
5929
6046
  help: "Drop the `export` keyword (or remove the declaration) if no other module uses this symbol.",
5930
6047
  line: unusedExport.line,
5931
6048
  column: unusedExport.column,
@@ -5940,7 +6057,7 @@ const checkDeadCode = async (options) => {
5940
6057
  rule: unusedDependency.isDevDependency ? "unused-dev-dependency" : "unused-dependency",
5941
6058
  severity: "warning",
5942
6059
  message: `Unused ${label}: \`${unusedDependency.name}\``,
5943
- help: "Remove the dependency from package.json if it is genuinely unused.",
6060
+ help: `An unused ${label} adds install time and supply-chain surface without being used; remove it from package.json if it is genuinely unused.`,
5944
6061
  line: 0,
5945
6062
  column: 0,
5946
6063
  category: DEAD_CODE_CATEGORY
@@ -5953,7 +6070,7 @@ const checkDeadCode = async (options) => {
5953
6070
  plugin: DEAD_CODE_PLUGIN,
5954
6071
  rule: "circular-dependency",
5955
6072
  severity: "warning",
5956
- message: `Circular import cycle: ${cycle.files.map(toRelative).join(" → ")}`,
6073
+ message: `Circular import cycle: ${cycle.files.map(toRelative).join(" → ")}. Modules in the cycle can observe partially initialized exports, causing order-dependent bugs.`,
5957
6074
  help: "Break the cycle by extracting the shared code into a third module that both files import.",
5958
6075
  line: 0,
5959
6076
  column: 0,
@@ -6036,11 +6153,11 @@ const listSourceFilesViaFilesystem = (rootDirectory) => {
6036
6153
  return filePaths;
6037
6154
  };
6038
6155
  const listSourceFiles = (rootDirectory) => excludeMinifiedFiles(rootDirectory, listSourceFilesViaGit(rootDirectory) ?? listSourceFilesViaFilesystem(rootDirectory));
6039
- const resolveLintIncludePaths = (rootDirectory, userConfig) => {
6156
+ const resolveLintIncludePaths = (rootDirectory, userConfig, project) => {
6040
6157
  if (!Array.isArray(userConfig?.ignore?.files) || userConfig.ignore.files.length === 0) return;
6041
6158
  const ignoredPatterns = compileIgnoredFilePatterns(userConfig);
6042
6159
  return listSourceFiles(rootDirectory).filter((filePath) => {
6043
- if (!JSX_FILE_PATTERN.test(filePath)) return false;
6160
+ if (!shouldIncludeExplicitLintPath(filePath, project)) return false;
6044
6161
  return !isFileIgnoredByPatterns(filePath, rootDirectory, ignoredPatterns);
6045
6162
  });
6046
6163
  };
@@ -6768,6 +6885,7 @@ const buildCapabilities = (project) => {
6768
6885
  capabilities.add("zod");
6769
6886
  if (project.zodMajorVersion !== null && project.zodMajorVersion >= 4) capabilities.add("zod:4");
6770
6887
  }
6888
+ if (project.isPreES2023Target) capabilities.add("pre-es2023");
6771
6889
  if (project.hasReactCompiler) capabilities.add("react-compiler");
6772
6890
  if (project.hasTanStackQuery) capabilities.add("tanstack-query");
6773
6891
  if (project.hasTypeScript) capabilities.add("typescript");
@@ -8392,7 +8510,7 @@ const runInspect = (input, hooks = {}) => Effect.gen(function* () {
8392
8510
  directory: scanDirectory,
8393
8511
  repo
8394
8512
  }).pipe(Effect.orElseSucceed(() => null)) : Effect.succeed(null));
8395
- const lintIncludePaths = (input.skipJsxIncludeFilter ? input.includePaths.length > 0 ? [...input.includePaths] : void 0 : computeJsxIncludePaths([...input.includePaths])) ?? resolveLintIncludePaths(scanDirectory, resolvedConfig.config);
8513
+ const lintIncludePaths = (input.skipJsxIncludeFilter ? input.includePaths.length > 0 ? [...input.includePaths] : void 0 : computeExplicitLintIncludePaths([...input.includePaths], project)) ?? resolveLintIncludePaths(scanDirectory, resolvedConfig.config, project);
8396
8514
  const scannedFilePaths = input.suppressScanSummary ? (lintIncludePaths ?? (yield* filesService.listSourceFiles(scanDirectory))).map((relativePath) => path$1.resolve(scanDirectory, relativePath)) : [];
8397
8515
  const beforeLint = hooks.beforeLint ?? NO_HOOKS.beforeLint;
8398
8516
  const afterLint = hooks.afterLint ?? NO_HOOKS.afterLint;
@@ -8990,4 +9108,4 @@ const toJsonReport = (result, options) => buildJsonReport({
8990
9108
  export { AmbiguousProjectError, NoReactDependencyError, NotADirectoryError, PackageJsonNotFoundError, ProjectNotFoundError, ReactDoctorError, buildJsonReport, buildJsonReportError, clearCaches, defineConfig, diagnose, filterSourceFiles, getDiffInfo, isProjectDiscoveryError, isReactDoctorError, summarizeDiagnostics, toJsonReport };
8991
9109
 
8992
9110
  //# sourceMappingURL=index.js.map
8993
- //# debugId=9c92e27f-f5cc-5567-8d2c-50a861beaec5
9111
+ //# debugId=9bcfadac-add8-5228-906c-b747130f5ba9