react-doctor 0.5.1-dev.0a9d583 → 0.5.1-dev.0f91fa3

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/cli.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]="5c7334de-5fd1-50a7-bb75-1a17b3b54e4e")}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]="1d684d2d-e86c-59eb-9d49-df82d09c24a5")}catch(e){}}();
3
3
  import { createRequire } from "node:module";
4
4
  import * as NodeChildProcess from "node:child_process";
5
5
  import { execFile, execFileSync, spawn, spawnSync } from "node:child_process";
@@ -39266,6 +39266,17 @@ const checkPnpmHardening = (rootDirectory) => {
39266
39266
  }));
39267
39267
  return diagnostics;
39268
39268
  };
39269
+ const buildReactNativeDiagnostic = (input) => ({
39270
+ filePath: input.filePath,
39271
+ plugin: "react-doctor",
39272
+ rule: input.rule,
39273
+ severity: input.severity ?? "warning",
39274
+ message: input.message,
39275
+ help: input.help,
39276
+ line: input.line ?? 0,
39277
+ column: input.column ?? 0,
39278
+ category: input.category ?? "Correctness"
39279
+ });
39269
39280
  const BUILDER_BOB_PACKAGE = "react-native-builder-bob";
39270
39281
  const isBuilderBobLibrary = (packageJson) => {
39271
39282
  const bobConfig = packageJson[BUILDER_BOB_PACKAGE];
@@ -39277,17 +39288,12 @@ const checkReactNativeLibraryDependencies = (rootDirectory) => {
39277
39288
  const misplaced = ["react", "react-native"].filter((name) => packageJson.dependencies?.[name] !== void 0);
39278
39289
  if (misplaced.length === 0) return [];
39279
39290
  const quoted = misplaced.map((name) => `"${name}"`).join(" and ");
39280
- return [{
39291
+ return [buildReactNativeDiagnostic({
39281
39292
  filePath: "package.json",
39282
- plugin: "react-doctor",
39283
39293
  rule: "rn-library-react-in-dependencies",
39284
- severity: "warning",
39285
39294
  message: `This react-native-builder-bob library lists ${quoted} in \`dependencies\` — that ships a second copy into consumer apps, causing "Invalid hook call" (duplicate React) and duplicate-native-module crashes.`,
39286
- help: `Move ${quoted} to \`peerDependencies\` (keep ${misplaced.length === 1 ? "it" : "them"} in \`devDependencies\` for local development).`,
39287
- line: 0,
39288
- column: 0,
39289
- category: "Correctness"
39290
- }];
39295
+ help: `Move ${quoted} to \`peerDependencies\` (keep ${misplaced.length === 1 ? "it" : "them"} in \`devDependencies\` for local development).`
39296
+ })];
39291
39297
  };
39292
39298
  const BABEL_CONFIG_FILE_NAMES = [
39293
39299
  "babel.config.js",
@@ -39299,6 +39305,8 @@ const BABEL_CONFIG_FILE_NAMES = [
39299
39305
  ".babelrc.json"
39300
39306
  ];
39301
39307
  const LEGACY_PRESET_SPEC = "module:metro-react-native-babel-preset";
39308
+ const MODERN_PRESET_REFERENCE = new RegExp(`['"]module:@react-native/babel-preset['"]`);
39309
+ const ENABLE_BABEL_RUNTIME_VERSION = /enableBabelRuntime["']?\s*:\s*['"]/;
39302
39310
  const checkReactNativeMetroBabelPreset = (rootDirectory) => {
39303
39311
  for (const fileName of BABEL_CONFIG_FILE_NAMES) {
39304
39312
  const filePath = Path.join(rootDirectory, fileName);
@@ -39309,18 +39317,20 @@ const checkReactNativeMetroBabelPreset = (rootDirectory) => {
39309
39317
  } catch {
39310
39318
  continue;
39311
39319
  }
39312
- if (!contents.includes(LEGACY_PRESET_SPEC)) continue;
39313
- return [{
39320
+ if (contents.includes(LEGACY_PRESET_SPEC)) return [buildReactNativeDiagnostic({
39314
39321
  filePath: fileName,
39315
- plugin: "react-doctor",
39316
39322
  rule: "rn-no-metro-babel-preset",
39317
39323
  severity: "error",
39318
39324
  message: "`module:metro-react-native-babel-preset` was renamed to `@react-native/babel-preset` and is no longer installed by React Native 0.73+ — this preset reference fails to resolve and breaks the Metro/Babel transform.",
39319
- help: "Replace the preset with `module:@react-native/babel-preset` (or `babel-preset-expo` on Expo) and remove the old `metro-react-native-babel-preset` dependency.",
39320
- line: 0,
39321
- column: 0,
39322
- category: "Correctness"
39323
- }];
39325
+ help: "Replace the preset with `module:@react-native/babel-preset` (or `babel-preset-expo` on Expo) and remove the old `metro-react-native-babel-preset` dependency."
39326
+ })];
39327
+ if (MODERN_PRESET_REFERENCE.test(contents) && !ENABLE_BABEL_RUNTIME_VERSION.test(contents)) return [buildReactNativeDiagnostic({
39328
+ filePath: fileName,
39329
+ rule: "rn-no-metro-babel-runtime-version",
39330
+ severity: "warning",
39331
+ message: "`module:@react-native/babel-preset` has no `enableBabelRuntime` version, so Babel runtime helpers can be duplicated across files instead of imported once from @babel/runtime, increasing the JS bundle size.",
39332
+ help: "Set `enableBabelRuntime` to the @babel/runtime version from package.json, e.g. `['module:@react-native/babel-preset', { enableBabelRuntime: '^7.26.0' }]`."
39333
+ })];
39324
39334
  }
39325
39335
  return [];
39326
39336
  };
@@ -43760,7 +43770,7 @@ const makeNoopConsole = () => ({
43760
43770
  });
43761
43771
  //#endregion
43762
43772
  //#region src/cli/utils/version.ts
43763
- const VERSION = "0.5.1-dev.0a9d583";
43773
+ const VERSION = "0.5.1-dev.0f91fa3";
43764
43774
  //#endregion
43765
43775
  //#region src/cli/utils/json-mode.ts
43766
43776
  let context = null;
@@ -44118,13 +44128,13 @@ const isDevVersion = (version) => version === "0.0.0" || version.includes("-");
44118
44128
  * uploads source-map artifacts under, so stack frames symbolicate. Honors the
44119
44129
  * standard `SENTRY_RELEASE` override.
44120
44130
  */
44121
- const resolveSentryRelease = () => process.env.SENTRY_RELEASE || `react-doctor@0.5.1-dev.0a9d583`;
44131
+ const resolveSentryRelease = () => process.env.SENTRY_RELEASE || `react-doctor@0.5.1-dev.0f91fa3`;
44122
44132
  /**
44123
44133
  * Deployment environment shown in Sentry's environment filter. Defaults to
44124
44134
  * `production` for tagged releases and `development` for dev/unbuilt versions,
44125
44135
  * overridable via the standard `SENTRY_ENVIRONMENT` env var.
44126
44136
  */
44127
- const resolveSentryEnvironment = () => process.env.SENTRY_ENVIRONMENT || (isDevVersion("0.5.1-dev.0a9d583") ? "development" : "production");
44137
+ const resolveSentryEnvironment = () => process.env.SENTRY_ENVIRONMENT || (isDevVersion("0.5.1-dev.0f91fa3") ? "development" : "production");
44128
44138
  /**
44129
44139
  * Performance-tracing sample rate in `[0, 1]`. Reads `SENTRY_TRACES_SAMPLE_RATE`
44130
44140
  * (set to `0` to disable tracing) and falls back to
@@ -53800,4 +53810,4 @@ Promise.resolve().then(() => assertNoRemovedFlags(process.argv)).then(() => prog
53800
53810
  export {};
53801
53811
 
53802
53812
  //# sourceMappingURL=cli.js.map
53803
- //# debugId=5c7334de-5fd1-50a7-bb75-1a17b3b54e4e
53813
+ //# debugId=1d684d2d-e86c-59eb-9d49-df82d09c24a5
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]="c8ddec5f-75dd-56a9-93b8-c34b1f202f7c")}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]="aec4d374-d95e-51fe-a6c6-578b187e2520")}catch(e){}}();
3
3
  import { r as __toESM$1, t as __commonJSMin$1 } from "./chunk-N93fKeF6.js";
4
4
  import { createRequire } from "node:module";
5
5
  import * as NFS from "node:fs";
@@ -36045,6 +36045,17 @@ const checkPnpmHardening = (rootDirectory) => {
36045
36045
  }));
36046
36046
  return diagnostics;
36047
36047
  };
36048
+ const buildReactNativeDiagnostic = (input) => ({
36049
+ filePath: input.filePath,
36050
+ plugin: "react-doctor",
36051
+ rule: input.rule,
36052
+ severity: input.severity ?? "warning",
36053
+ message: input.message,
36054
+ help: input.help,
36055
+ line: input.line ?? 0,
36056
+ column: input.column ?? 0,
36057
+ category: input.category ?? "Correctness"
36058
+ });
36048
36059
  const BUILDER_BOB_PACKAGE = "react-native-builder-bob";
36049
36060
  const isBuilderBobLibrary = (packageJson) => {
36050
36061
  const bobConfig = packageJson[BUILDER_BOB_PACKAGE];
@@ -36056,17 +36067,12 @@ const checkReactNativeLibraryDependencies = (rootDirectory) => {
36056
36067
  const misplaced = ["react", "react-native"].filter((name) => packageJson.dependencies?.[name] !== void 0);
36057
36068
  if (misplaced.length === 0) return [];
36058
36069
  const quoted = misplaced.map((name) => `"${name}"`).join(" and ");
36059
- return [{
36070
+ return [buildReactNativeDiagnostic({
36060
36071
  filePath: "package.json",
36061
- plugin: "react-doctor",
36062
36072
  rule: "rn-library-react-in-dependencies",
36063
- severity: "warning",
36064
36073
  message: `This react-native-builder-bob library lists ${quoted} in \`dependencies\` — that ships a second copy into consumer apps, causing "Invalid hook call" (duplicate React) and duplicate-native-module crashes.`,
36065
- help: `Move ${quoted} to \`peerDependencies\` (keep ${misplaced.length === 1 ? "it" : "them"} in \`devDependencies\` for local development).`,
36066
- line: 0,
36067
- column: 0,
36068
- category: "Correctness"
36069
- }];
36074
+ help: `Move ${quoted} to \`peerDependencies\` (keep ${misplaced.length === 1 ? "it" : "them"} in \`devDependencies\` for local development).`
36075
+ })];
36070
36076
  };
36071
36077
  const BABEL_CONFIG_FILE_NAMES = [
36072
36078
  "babel.config.js",
@@ -36078,6 +36084,8 @@ const BABEL_CONFIG_FILE_NAMES = [
36078
36084
  ".babelrc.json"
36079
36085
  ];
36080
36086
  const LEGACY_PRESET_SPEC = "module:metro-react-native-babel-preset";
36087
+ const MODERN_PRESET_REFERENCE = new RegExp(`['"]module:@react-native/babel-preset['"]`);
36088
+ const ENABLE_BABEL_RUNTIME_VERSION = /enableBabelRuntime["']?\s*:\s*['"]/;
36081
36089
  const checkReactNativeMetroBabelPreset = (rootDirectory) => {
36082
36090
  for (const fileName of BABEL_CONFIG_FILE_NAMES) {
36083
36091
  const filePath = Path.join(rootDirectory, fileName);
@@ -36088,18 +36096,20 @@ const checkReactNativeMetroBabelPreset = (rootDirectory) => {
36088
36096
  } catch {
36089
36097
  continue;
36090
36098
  }
36091
- if (!contents.includes(LEGACY_PRESET_SPEC)) continue;
36092
- return [{
36099
+ if (contents.includes(LEGACY_PRESET_SPEC)) return [buildReactNativeDiagnostic({
36093
36100
  filePath: fileName,
36094
- plugin: "react-doctor",
36095
36101
  rule: "rn-no-metro-babel-preset",
36096
36102
  severity: "error",
36097
36103
  message: "`module:metro-react-native-babel-preset` was renamed to `@react-native/babel-preset` and is no longer installed by React Native 0.73+ — this preset reference fails to resolve and breaks the Metro/Babel transform.",
36098
- help: "Replace the preset with `module:@react-native/babel-preset` (or `babel-preset-expo` on Expo) and remove the old `metro-react-native-babel-preset` dependency.",
36099
- line: 0,
36100
- column: 0,
36101
- category: "Correctness"
36102
- }];
36104
+ help: "Replace the preset with `module:@react-native/babel-preset` (or `babel-preset-expo` on Expo) and remove the old `metro-react-native-babel-preset` dependency."
36105
+ })];
36106
+ if (MODERN_PRESET_REFERENCE.test(contents) && !ENABLE_BABEL_RUNTIME_VERSION.test(contents)) return [buildReactNativeDiagnostic({
36107
+ filePath: fileName,
36108
+ rule: "rn-no-metro-babel-runtime-version",
36109
+ severity: "warning",
36110
+ message: "`module:@react-native/babel-preset` has no `enableBabelRuntime` version, so Babel runtime helpers can be duplicated across files instead of imported once from @babel/runtime, increasing the JS bundle size.",
36111
+ help: "Set `enableBabelRuntime` to the @babel/runtime version from package.json, e.g. `['module:@react-native/babel-preset', { enableBabelRuntime: '^7.26.0' }]`."
36112
+ })];
36103
36113
  }
36104
36114
  return [];
36105
36115
  };
@@ -40312,4 +40322,4 @@ const toJsonReport = (result, options) => buildJsonReport({
40312
40322
  export { AmbiguousProjectError, NoReactDependencyError, NotADirectoryError, PackageJsonNotFoundError, ProjectNotFoundError, ReactDoctorError, buildJsonReport, buildJsonReportError, clearCaches, defineConfig, diagnose, filterSourceFiles, getDiffInfo, isProjectDiscoveryError, isReactDoctorError, summarizeDiagnostics, toJsonReport };
40313
40323
 
40314
40324
  //# sourceMappingURL=index.js.map
40315
- //# debugId=c8ddec5f-75dd-56a9-93b8-c34b1f202f7c
40325
+ //# debugId=aec4d374-d95e-51fe-a6c6-578b187e2520
package/dist/lsp.js CHANGED
@@ -36031,6 +36031,17 @@ const checkPnpmHardening = (rootDirectory) => {
36031
36031
  }));
36032
36032
  return diagnostics;
36033
36033
  };
36034
+ const buildReactNativeDiagnostic = (input) => ({
36035
+ filePath: input.filePath,
36036
+ plugin: "react-doctor",
36037
+ rule: input.rule,
36038
+ severity: input.severity ?? "warning",
36039
+ message: input.message,
36040
+ help: input.help,
36041
+ line: input.line ?? 0,
36042
+ column: input.column ?? 0,
36043
+ category: input.category ?? "Correctness"
36044
+ });
36034
36045
  const BUILDER_BOB_PACKAGE = "react-native-builder-bob";
36035
36046
  const isBuilderBobLibrary = (packageJson) => {
36036
36047
  const bobConfig = packageJson[BUILDER_BOB_PACKAGE];
@@ -36042,17 +36053,12 @@ const checkReactNativeLibraryDependencies = (rootDirectory) => {
36042
36053
  const misplaced = ["react", "react-native"].filter((name) => packageJson.dependencies?.[name] !== void 0);
36043
36054
  if (misplaced.length === 0) return [];
36044
36055
  const quoted = misplaced.map((name) => `"${name}"`).join(" and ");
36045
- return [{
36056
+ return [buildReactNativeDiagnostic({
36046
36057
  filePath: "package.json",
36047
- plugin: "react-doctor",
36048
36058
  rule: "rn-library-react-in-dependencies",
36049
- severity: "warning",
36050
36059
  message: `This react-native-builder-bob library lists ${quoted} in \`dependencies\` — that ships a second copy into consumer apps, causing "Invalid hook call" (duplicate React) and duplicate-native-module crashes.`,
36051
- help: `Move ${quoted} to \`peerDependencies\` (keep ${misplaced.length === 1 ? "it" : "them"} in \`devDependencies\` for local development).`,
36052
- line: 0,
36053
- column: 0,
36054
- category: "Correctness"
36055
- }];
36060
+ help: `Move ${quoted} to \`peerDependencies\` (keep ${misplaced.length === 1 ? "it" : "them"} in \`devDependencies\` for local development).`
36061
+ })];
36056
36062
  };
36057
36063
  const BABEL_CONFIG_FILE_NAMES = [
36058
36064
  "babel.config.js",
@@ -36064,6 +36070,8 @@ const BABEL_CONFIG_FILE_NAMES = [
36064
36070
  ".babelrc.json"
36065
36071
  ];
36066
36072
  const LEGACY_PRESET_SPEC = "module:metro-react-native-babel-preset";
36073
+ const MODERN_PRESET_REFERENCE = new RegExp(`['"]module:@react-native/babel-preset['"]`);
36074
+ const ENABLE_BABEL_RUNTIME_VERSION = /enableBabelRuntime["']?\s*:\s*['"]/;
36067
36075
  const checkReactNativeMetroBabelPreset = (rootDirectory) => {
36068
36076
  for (const fileName of BABEL_CONFIG_FILE_NAMES) {
36069
36077
  const filePath = Path.join(rootDirectory, fileName);
@@ -36074,18 +36082,20 @@ const checkReactNativeMetroBabelPreset = (rootDirectory) => {
36074
36082
  } catch {
36075
36083
  continue;
36076
36084
  }
36077
- if (!contents.includes(LEGACY_PRESET_SPEC)) continue;
36078
- return [{
36085
+ if (contents.includes(LEGACY_PRESET_SPEC)) return [buildReactNativeDiagnostic({
36079
36086
  filePath: fileName,
36080
- plugin: "react-doctor",
36081
36087
  rule: "rn-no-metro-babel-preset",
36082
36088
  severity: "error",
36083
36089
  message: "`module:metro-react-native-babel-preset` was renamed to `@react-native/babel-preset` and is no longer installed by React Native 0.73+ — this preset reference fails to resolve and breaks the Metro/Babel transform.",
36084
- help: "Replace the preset with `module:@react-native/babel-preset` (or `babel-preset-expo` on Expo) and remove the old `metro-react-native-babel-preset` dependency.",
36085
- line: 0,
36086
- column: 0,
36087
- category: "Correctness"
36088
- }];
36090
+ help: "Replace the preset with `module:@react-native/babel-preset` (or `babel-preset-expo` on Expo) and remove the old `metro-react-native-babel-preset` dependency."
36091
+ })];
36092
+ if (MODERN_PRESET_REFERENCE.test(contents) && !ENABLE_BABEL_RUNTIME_VERSION.test(contents)) return [buildReactNativeDiagnostic({
36093
+ filePath: fileName,
36094
+ rule: "rn-no-metro-babel-runtime-version",
36095
+ severity: "warning",
36096
+ message: "`module:@react-native/babel-preset` has no `enableBabelRuntime` version, so Babel runtime helpers can be duplicated across files instead of imported once from @babel/runtime, increasing the JS bundle size.",
36097
+ help: "Set `enableBabelRuntime` to the @babel/runtime version from package.json, e.g. `['module:@react-native/babel-preset', { enableBabelRuntime: '^7.26.0' }]`."
36098
+ })];
36089
36099
  }
36090
36100
  return [];
36091
36101
  };
@@ -42097,5 +42107,5 @@ const startLanguageServer = () => {
42097
42107
  };
42098
42108
  //#endregion
42099
42109
  export { startLanguageServer };
42100
- !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]="d189cded-30cd-5adf-aa54-2429b20c538b")}catch(e){}}();
42101
- //# debugId=d189cded-30cd-5adf-aa54-2429b20c538b
42110
+ !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]="1181bb4c-4d5f-57b6-a733-98f432895c80")}catch(e){}}();
42111
+ //# debugId=1181bb4c-4d5f-57b6-a733-98f432895c80
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-doctor",
3
- "version": "0.5.1-dev.0a9d583",
3
+ "version": "0.5.1-dev.0f91fa3",
4
4
  "description": "Your agent writes bad React. This catches it",
5
5
  "keywords": [
6
6
  "accessibility",
@@ -64,7 +64,7 @@
64
64
  "vscode-languageserver": "^9.0.1",
65
65
  "vscode-languageserver-textdocument": "^1.0.12",
66
66
  "vscode-uri": "^3.1.0",
67
- "oxlint-plugin-react-doctor": "0.5.1-dev.0a9d583"
67
+ "oxlint-plugin-react-doctor": "0.5.1-dev.0f91fa3"
68
68
  },
69
69
  "devDependencies": {
70
70
  "@types/babel__code-frame": "^7.27.0",