react-doctor 0.8.1-dev.90e794f → 0.8.1-dev.a2f9bf4
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 +21 -23
- package/dist/index.js +18 -20
- package/dist/lsp.js +18 -20
- package/package.json +4 -4
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]="
|
|
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]="24153a3f-aef9-53fd-8dff-9b016a9613fb")}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";
|
|
@@ -37977,6 +37977,7 @@ const LEGACY_RULE_KEY_TO_NATIVE_RULE_KEY = {
|
|
|
37977
37977
|
"react/jsx-no-new-function-as-prop": "react-doctor/jsx-no-new-function-as-prop",
|
|
37978
37978
|
"react/jsx-no-new-object-as-prop": "react-doctor/jsx-no-new-object-as-prop",
|
|
37979
37979
|
"react/jsx-no-script-url": "react-doctor/jsx-no-script-url",
|
|
37980
|
+
"react/jsx-no-target-blank": "react-doctor/jsx-no-target-blank",
|
|
37980
37981
|
"react/jsx-no-undef": "react-doctor/jsx-no-undef",
|
|
37981
37982
|
"react/jsx-no-useless-fragment": "react-doctor/jsx-no-useless-fragment",
|
|
37982
37983
|
"react/jsx-pascal-case": "react-doctor/jsx-pascal-case",
|
|
@@ -40298,25 +40299,9 @@ const BABEL_CONFIG_FILE_NAMES = [
|
|
|
40298
40299
|
".babelrc.json"
|
|
40299
40300
|
];
|
|
40300
40301
|
const LEGACY_PRESET_SPEC = "module:metro-react-native-babel-preset";
|
|
40301
|
-
const LEGACY_PRESET_PACKAGE = "metro-react-native-babel-preset";
|
|
40302
|
-
const REACT_NATIVE_PACKAGE = "react-native";
|
|
40303
|
-
const PRESET_RENAME_MINIMUM_REACT_NATIVE_VERSION = "0.73.0";
|
|
40304
|
-
const LEGACY_PRESET_REFERENCE = new RegExp(`['"]${LEGACY_PRESET_SPEC}['"]`);
|
|
40305
40302
|
const MODERN_PRESET_REFERENCE = new RegExp(`['"]module:@react-native/babel-preset['"]`);
|
|
40306
40303
|
const ENABLE_BABEL_RUNTIME_VERSION = /enableBabelRuntime["']?\s*:\s*['"]/;
|
|
40307
|
-
const isReactNativeVersionAtLeastPresetRename = (rootDirectory, packageJson) => {
|
|
40308
|
-
const installedReactNativeManifestPath = Path.join(rootDirectory, "node_modules", REACT_NATIVE_PACKAGE, "package.json");
|
|
40309
|
-
const reactNativeVersionSpec = (isFile(installedReactNativeManifestPath) ? readPackageJson$1(installedReactNativeManifestPath).version : void 0) ?? getDependencySpec(packageJson, REACT_NATIVE_PACKAGE);
|
|
40310
|
-
if (reactNativeVersionSpec === null || reactNativeVersionSpec === void 0) return false;
|
|
40311
|
-
const normalizedVersionRange = import_semver.validRange(reactNativeVersionSpec);
|
|
40312
|
-
if (normalizedVersionRange === null) return false;
|
|
40313
|
-
const minimumVersion = import_semver.minVersion(normalizedVersionRange);
|
|
40314
|
-
return minimumVersion !== null && import_semver.gte(minimumVersion, PRESET_RENAME_MINIMUM_REACT_NATIVE_VERSION);
|
|
40315
|
-
};
|
|
40316
|
-
const canResolveLegacyPreset = (rootDirectory, packageJson) => getDependencySpec(packageJson, LEGACY_PRESET_PACKAGE) !== null || isFile(Path.join(rootDirectory, "node_modules", LEGACY_PRESET_PACKAGE, "package.json"));
|
|
40317
40304
|
const checkReactNativeMetroBabelPreset = (rootDirectory) => {
|
|
40318
|
-
const packageJson = readPackageJson$1(Path.join(rootDirectory, "package.json"));
|
|
40319
|
-
const shouldReportLegacyPreset = isReactNativeVersionAtLeastPresetRename(rootDirectory, packageJson) && !canResolveLegacyPreset(rootDirectory, packageJson);
|
|
40320
40305
|
for (const fileName of BABEL_CONFIG_FILE_NAMES) {
|
|
40321
40306
|
const filePath = Path.join(rootDirectory, fileName);
|
|
40322
40307
|
if (!isFile(filePath)) continue;
|
|
@@ -40326,7 +40311,7 @@ const checkReactNativeMetroBabelPreset = (rootDirectory) => {
|
|
|
40326
40311
|
} catch {
|
|
40327
40312
|
continue;
|
|
40328
40313
|
}
|
|
40329
|
-
if (
|
|
40314
|
+
if (contents.includes(LEGACY_PRESET_SPEC)) return [buildReactNativeDiagnostic({
|
|
40330
40315
|
filePath: fileName,
|
|
40331
40316
|
rule: "rn-no-metro-babel-preset",
|
|
40332
40317
|
severity: "error",
|
|
@@ -40349,6 +40334,12 @@ const checkReactNativeProject = (rootDirectory, project) => {
|
|
|
40349
40334
|
return [...checkReactNativeMetroBabelPreset(rootDirectory), ...checkReactNativeLibraryDependencies(rootDirectory)];
|
|
40350
40335
|
};
|
|
40351
40336
|
const RULE_KEY = "no-vulnerable-react-server-components";
|
|
40337
|
+
const DEPENDENCY_SECTIONS = [
|
|
40338
|
+
"dependencies",
|
|
40339
|
+
"devDependencies",
|
|
40340
|
+
"peerDependencies",
|
|
40341
|
+
"optionalDependencies"
|
|
40342
|
+
];
|
|
40352
40343
|
const REACT_RSC_ADVISORIES_BY_MINOR = {
|
|
40353
40344
|
"19.0": {
|
|
40354
40345
|
rceFixedVersion: "19.0.1",
|
|
@@ -40395,13 +40386,20 @@ const enumerateWorkspaceDirectories = (workspaceRoot) => {
|
|
|
40395
40386
|
for (const pattern of patterns) for (const directory of resolveWorkspaceDirectories(workspaceRoot, pattern)) directories.add(directory);
|
|
40396
40387
|
return [...directories];
|
|
40397
40388
|
};
|
|
40389
|
+
const readDeclaredSpec = (packageJson, packageName) => {
|
|
40390
|
+
for (const section of DEPENDENCY_SECTIONS) {
|
|
40391
|
+
const spec = packageJson[section]?.[packageName];
|
|
40392
|
+
if (typeof spec === "string") return spec;
|
|
40393
|
+
}
|
|
40394
|
+
return null;
|
|
40395
|
+
};
|
|
40398
40396
|
const resolveVersionInDirectory = (directory, packageName, declaredSpecOverride) => {
|
|
40399
40397
|
const manifestPath = Path.join(directory, "node_modules", packageName, "package.json");
|
|
40400
40398
|
if (isFile(manifestPath)) {
|
|
40401
40399
|
const installedVersion = import_semver.valid(readPackageJson$1(manifestPath).version ?? null);
|
|
40402
40400
|
if (installedVersion !== null) return installedVersion;
|
|
40403
40401
|
}
|
|
40404
|
-
const candidateSpecs = [
|
|
40402
|
+
const candidateSpecs = [readDeclaredSpec(readPackageJson$1(Path.join(directory, "package.json")), packageName), declaredSpecOverride];
|
|
40405
40403
|
for (const spec of candidateSpecs) {
|
|
40406
40404
|
const pinnedVersion = spec === null ? null : import_semver.valid(spec);
|
|
40407
40405
|
if (pinnedVersion !== null) return pinnedVersion;
|
|
@@ -47367,7 +47365,7 @@ const makeNoopConsole = () => ({
|
|
|
47367
47365
|
});
|
|
47368
47366
|
//#endregion
|
|
47369
47367
|
//#region src/cli/utils/version.ts
|
|
47370
|
-
const VERSION = "0.8.1-dev.
|
|
47368
|
+
const VERSION = "0.8.1-dev.a2f9bf4";
|
|
47371
47369
|
//#endregion
|
|
47372
47370
|
//#region src/cli/utils/json-mode.ts
|
|
47373
47371
|
let context = null;
|
|
@@ -47719,13 +47717,13 @@ const isDevVersion = (version) => version === "0.0.0" || version.includes("-");
|
|
|
47719
47717
|
* uploads source-map artifacts under, so stack frames symbolicate. Honors the
|
|
47720
47718
|
* standard `SENTRY_RELEASE` override.
|
|
47721
47719
|
*/
|
|
47722
|
-
const resolveSentryRelease = () => process.env.SENTRY_RELEASE || `react-doctor@0.8.1-dev.
|
|
47720
|
+
const resolveSentryRelease = () => process.env.SENTRY_RELEASE || `react-doctor@0.8.1-dev.a2f9bf4`;
|
|
47723
47721
|
/**
|
|
47724
47722
|
* Deployment environment shown in Sentry's environment filter. Defaults to
|
|
47725
47723
|
* `production` for tagged releases and `development` for dev/unbuilt versions,
|
|
47726
47724
|
* overridable via the standard `SENTRY_ENVIRONMENT` env var.
|
|
47727
47725
|
*/
|
|
47728
|
-
const resolveSentryEnvironment = () => process.env.SENTRY_ENVIRONMENT || (isDevVersion("0.8.1-dev.
|
|
47726
|
+
const resolveSentryEnvironment = () => process.env.SENTRY_ENVIRONMENT || (isDevVersion("0.8.1-dev.a2f9bf4") ? "development" : "production");
|
|
47729
47727
|
/**
|
|
47730
47728
|
* Performance-tracing sample rate in `[0, 1]`. Reads `SENTRY_TRACES_SAMPLE_RATE`
|
|
47731
47729
|
* (set to `0` to disable tracing) and falls back to
|
|
@@ -66405,4 +66403,4 @@ Promise.resolve().then(() => assertNoRemovedFlags(process.argv)).then(() => prog
|
|
|
66405
66403
|
export {};
|
|
66406
66404
|
|
|
66407
66405
|
//# sourceMappingURL=cli.js.map
|
|
66408
|
-
//# debugId=
|
|
66406
|
+
//# debugId=24153a3f-aef9-53fd-8dff-9b016a9613fb
|
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]="
|
|
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]="14f17993-c8fc-5c43-a518-2b2055f5d836")}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 reactDoctorPlugin, { ALL_REACT_DOCTOR_RULE_KEYS, CROSS_FILE_DEPENDENCY_COLLECTORS, CROSS_FILE_RULE_IDS, FRAMEWORK_SPECIFIC_RULE_KEYS, FRAMEWORK_TOKENS, MOTION_LIBRARY_PACKAGES, REACT_COMPILER_RULES, REACT_DOCTOR_RULES, classifySecurityScanFile, collectCrossFileDependencyProbes, resetManifestCaches, shouldReadSecurityScanContent } from "oxlint-plugin-react-doctor";
|
|
@@ -34784,6 +34784,7 @@ const LEGACY_RULE_KEY_TO_NATIVE_RULE_KEY = {
|
|
|
34784
34784
|
"react/jsx-no-new-function-as-prop": "react-doctor/jsx-no-new-function-as-prop",
|
|
34785
34785
|
"react/jsx-no-new-object-as-prop": "react-doctor/jsx-no-new-object-as-prop",
|
|
34786
34786
|
"react/jsx-no-script-url": "react-doctor/jsx-no-script-url",
|
|
34787
|
+
"react/jsx-no-target-blank": "react-doctor/jsx-no-target-blank",
|
|
34787
34788
|
"react/jsx-no-undef": "react-doctor/jsx-no-undef",
|
|
34788
34789
|
"react/jsx-no-useless-fragment": "react-doctor/jsx-no-useless-fragment",
|
|
34789
34790
|
"react/jsx-pascal-case": "react-doctor/jsx-pascal-case",
|
|
@@ -37070,25 +37071,9 @@ const BABEL_CONFIG_FILE_NAMES = [
|
|
|
37070
37071
|
".babelrc.json"
|
|
37071
37072
|
];
|
|
37072
37073
|
const LEGACY_PRESET_SPEC = "module:metro-react-native-babel-preset";
|
|
37073
|
-
const LEGACY_PRESET_PACKAGE = "metro-react-native-babel-preset";
|
|
37074
|
-
const REACT_NATIVE_PACKAGE = "react-native";
|
|
37075
|
-
const PRESET_RENAME_MINIMUM_REACT_NATIVE_VERSION = "0.73.0";
|
|
37076
|
-
const LEGACY_PRESET_REFERENCE = new RegExp(`['"]${LEGACY_PRESET_SPEC}['"]`);
|
|
37077
37074
|
const MODERN_PRESET_REFERENCE = new RegExp(`['"]module:@react-native/babel-preset['"]`);
|
|
37078
37075
|
const ENABLE_BABEL_RUNTIME_VERSION = /enableBabelRuntime["']?\s*:\s*['"]/;
|
|
37079
|
-
const isReactNativeVersionAtLeastPresetRename = (rootDirectory, packageJson) => {
|
|
37080
|
-
const installedReactNativeManifestPath = Path.join(rootDirectory, "node_modules", REACT_NATIVE_PACKAGE, "package.json");
|
|
37081
|
-
const reactNativeVersionSpec = (isFile(installedReactNativeManifestPath) ? readPackageJson(installedReactNativeManifestPath).version : void 0) ?? getDependencySpec(packageJson, REACT_NATIVE_PACKAGE);
|
|
37082
|
-
if (reactNativeVersionSpec === null || reactNativeVersionSpec === void 0) return false;
|
|
37083
|
-
const normalizedVersionRange = import_semver.validRange(reactNativeVersionSpec);
|
|
37084
|
-
if (normalizedVersionRange === null) return false;
|
|
37085
|
-
const minimumVersion = import_semver.minVersion(normalizedVersionRange);
|
|
37086
|
-
return minimumVersion !== null && import_semver.gte(minimumVersion, PRESET_RENAME_MINIMUM_REACT_NATIVE_VERSION);
|
|
37087
|
-
};
|
|
37088
|
-
const canResolveLegacyPreset = (rootDirectory, packageJson) => getDependencySpec(packageJson, LEGACY_PRESET_PACKAGE) !== null || isFile(Path.join(rootDirectory, "node_modules", LEGACY_PRESET_PACKAGE, "package.json"));
|
|
37089
37076
|
const checkReactNativeMetroBabelPreset = (rootDirectory) => {
|
|
37090
|
-
const packageJson = readPackageJson(Path.join(rootDirectory, "package.json"));
|
|
37091
|
-
const shouldReportLegacyPreset = isReactNativeVersionAtLeastPresetRename(rootDirectory, packageJson) && !canResolveLegacyPreset(rootDirectory, packageJson);
|
|
37092
37077
|
for (const fileName of BABEL_CONFIG_FILE_NAMES) {
|
|
37093
37078
|
const filePath = Path.join(rootDirectory, fileName);
|
|
37094
37079
|
if (!isFile(filePath)) continue;
|
|
@@ -37098,7 +37083,7 @@ const checkReactNativeMetroBabelPreset = (rootDirectory) => {
|
|
|
37098
37083
|
} catch {
|
|
37099
37084
|
continue;
|
|
37100
37085
|
}
|
|
37101
|
-
if (
|
|
37086
|
+
if (contents.includes(LEGACY_PRESET_SPEC)) return [buildReactNativeDiagnostic({
|
|
37102
37087
|
filePath: fileName,
|
|
37103
37088
|
rule: "rn-no-metro-babel-preset",
|
|
37104
37089
|
severity: "error",
|
|
@@ -37121,6 +37106,12 @@ const checkReactNativeProject = (rootDirectory, project) => {
|
|
|
37121
37106
|
return [...checkReactNativeMetroBabelPreset(rootDirectory), ...checkReactNativeLibraryDependencies(rootDirectory)];
|
|
37122
37107
|
};
|
|
37123
37108
|
const RULE_KEY = "no-vulnerable-react-server-components";
|
|
37109
|
+
const DEPENDENCY_SECTIONS = [
|
|
37110
|
+
"dependencies",
|
|
37111
|
+
"devDependencies",
|
|
37112
|
+
"peerDependencies",
|
|
37113
|
+
"optionalDependencies"
|
|
37114
|
+
];
|
|
37124
37115
|
const REACT_RSC_ADVISORIES_BY_MINOR = {
|
|
37125
37116
|
"19.0": {
|
|
37126
37117
|
rceFixedVersion: "19.0.1",
|
|
@@ -37167,13 +37158,20 @@ const enumerateWorkspaceDirectories = (workspaceRoot) => {
|
|
|
37167
37158
|
for (const pattern of patterns) for (const directory of resolveWorkspaceDirectories(workspaceRoot, pattern)) directories.add(directory);
|
|
37168
37159
|
return [...directories];
|
|
37169
37160
|
};
|
|
37161
|
+
const readDeclaredSpec = (packageJson, packageName) => {
|
|
37162
|
+
for (const section of DEPENDENCY_SECTIONS) {
|
|
37163
|
+
const spec = packageJson[section]?.[packageName];
|
|
37164
|
+
if (typeof spec === "string") return spec;
|
|
37165
|
+
}
|
|
37166
|
+
return null;
|
|
37167
|
+
};
|
|
37170
37168
|
const resolveVersionInDirectory = (directory, packageName, declaredSpecOverride) => {
|
|
37171
37169
|
const manifestPath = Path.join(directory, "node_modules", packageName, "package.json");
|
|
37172
37170
|
if (isFile(manifestPath)) {
|
|
37173
37171
|
const installedVersion = import_semver.valid(readPackageJson(manifestPath).version ?? null);
|
|
37174
37172
|
if (installedVersion !== null) return installedVersion;
|
|
37175
37173
|
}
|
|
37176
|
-
const candidateSpecs = [
|
|
37174
|
+
const candidateSpecs = [readDeclaredSpec(readPackageJson(Path.join(directory, "package.json")), packageName), declaredSpecOverride];
|
|
37177
37175
|
for (const spec of candidateSpecs) {
|
|
37178
37176
|
const pinnedVersion = spec === null ? null : import_semver.valid(spec);
|
|
37179
37177
|
if (pinnedVersion !== null) return pinnedVersion;
|
|
@@ -43839,4 +43837,4 @@ const toJsonReport = (result, options) => buildJsonReport({
|
|
|
43839
43837
|
export { AmbiguousProjectError, NoReactDependencyError, NotADirectoryError, PackageJsonNotFoundError, ProjectNotFoundError, ReactDoctorError, buildJsonReport, buildJsonReportError, clearCaches, defineConfig, diagnose, filterSourceFiles, getDiffInfo, hasReactRuntime, isProjectDiscoveryError, isReactDoctorError, summarizeDiagnostics, toJsonReport };
|
|
43840
43838
|
|
|
43841
43839
|
//# sourceMappingURL=index.js.map
|
|
43842
|
-
//# debugId=
|
|
43840
|
+
//# debugId=14f17993-c8fc-5c43-a518-2b2055f5d836
|
package/dist/lsp.js
CHANGED
|
@@ -34836,6 +34836,7 @@ const LEGACY_RULE_KEY_TO_NATIVE_RULE_KEY = {
|
|
|
34836
34836
|
"react/jsx-no-new-function-as-prop": "react-doctor/jsx-no-new-function-as-prop",
|
|
34837
34837
|
"react/jsx-no-new-object-as-prop": "react-doctor/jsx-no-new-object-as-prop",
|
|
34838
34838
|
"react/jsx-no-script-url": "react-doctor/jsx-no-script-url",
|
|
34839
|
+
"react/jsx-no-target-blank": "react-doctor/jsx-no-target-blank",
|
|
34839
34840
|
"react/jsx-no-undef": "react-doctor/jsx-no-undef",
|
|
34840
34841
|
"react/jsx-no-useless-fragment": "react-doctor/jsx-no-useless-fragment",
|
|
34841
34842
|
"react/jsx-pascal-case": "react-doctor/jsx-pascal-case",
|
|
@@ -37048,25 +37049,9 @@ const BABEL_CONFIG_FILE_NAMES = [
|
|
|
37048
37049
|
".babelrc.json"
|
|
37049
37050
|
];
|
|
37050
37051
|
const LEGACY_PRESET_SPEC = "module:metro-react-native-babel-preset";
|
|
37051
|
-
const LEGACY_PRESET_PACKAGE = "metro-react-native-babel-preset";
|
|
37052
|
-
const REACT_NATIVE_PACKAGE = "react-native";
|
|
37053
|
-
const PRESET_RENAME_MINIMUM_REACT_NATIVE_VERSION = "0.73.0";
|
|
37054
|
-
const LEGACY_PRESET_REFERENCE = new RegExp(`['"]${LEGACY_PRESET_SPEC}['"]`);
|
|
37055
37052
|
const MODERN_PRESET_REFERENCE = new RegExp(`['"]module:@react-native/babel-preset['"]`);
|
|
37056
37053
|
const ENABLE_BABEL_RUNTIME_VERSION = /enableBabelRuntime["']?\s*:\s*['"]/;
|
|
37057
|
-
const isReactNativeVersionAtLeastPresetRename = (rootDirectory, packageJson) => {
|
|
37058
|
-
const installedReactNativeManifestPath = Path.join(rootDirectory, "node_modules", REACT_NATIVE_PACKAGE, "package.json");
|
|
37059
|
-
const reactNativeVersionSpec = (isFile(installedReactNativeManifestPath) ? readPackageJson(installedReactNativeManifestPath).version : void 0) ?? getDependencySpec(packageJson, REACT_NATIVE_PACKAGE);
|
|
37060
|
-
if (reactNativeVersionSpec === null || reactNativeVersionSpec === void 0) return false;
|
|
37061
|
-
const normalizedVersionRange = import_semver.validRange(reactNativeVersionSpec);
|
|
37062
|
-
if (normalizedVersionRange === null) return false;
|
|
37063
|
-
const minimumVersion = import_semver.minVersion(normalizedVersionRange);
|
|
37064
|
-
return minimumVersion !== null && import_semver.gte(minimumVersion, PRESET_RENAME_MINIMUM_REACT_NATIVE_VERSION);
|
|
37065
|
-
};
|
|
37066
|
-
const canResolveLegacyPreset = (rootDirectory, packageJson) => getDependencySpec(packageJson, LEGACY_PRESET_PACKAGE) !== null || isFile(Path.join(rootDirectory, "node_modules", LEGACY_PRESET_PACKAGE, "package.json"));
|
|
37067
37054
|
const checkReactNativeMetroBabelPreset = (rootDirectory) => {
|
|
37068
|
-
const packageJson = readPackageJson(Path.join(rootDirectory, "package.json"));
|
|
37069
|
-
const shouldReportLegacyPreset = isReactNativeVersionAtLeastPresetRename(rootDirectory, packageJson) && !canResolveLegacyPreset(rootDirectory, packageJson);
|
|
37070
37055
|
for (const fileName of BABEL_CONFIG_FILE_NAMES) {
|
|
37071
37056
|
const filePath = Path.join(rootDirectory, fileName);
|
|
37072
37057
|
if (!isFile(filePath)) continue;
|
|
@@ -37076,7 +37061,7 @@ const checkReactNativeMetroBabelPreset = (rootDirectory) => {
|
|
|
37076
37061
|
} catch {
|
|
37077
37062
|
continue;
|
|
37078
37063
|
}
|
|
37079
|
-
if (
|
|
37064
|
+
if (contents.includes(LEGACY_PRESET_SPEC)) return [buildReactNativeDiagnostic({
|
|
37080
37065
|
filePath: fileName,
|
|
37081
37066
|
rule: "rn-no-metro-babel-preset",
|
|
37082
37067
|
severity: "error",
|
|
@@ -37099,6 +37084,12 @@ const checkReactNativeProject = (rootDirectory, project) => {
|
|
|
37099
37084
|
return [...checkReactNativeMetroBabelPreset(rootDirectory), ...checkReactNativeLibraryDependencies(rootDirectory)];
|
|
37100
37085
|
};
|
|
37101
37086
|
const RULE_KEY = "no-vulnerable-react-server-components";
|
|
37087
|
+
const DEPENDENCY_SECTIONS = [
|
|
37088
|
+
"dependencies",
|
|
37089
|
+
"devDependencies",
|
|
37090
|
+
"peerDependencies",
|
|
37091
|
+
"optionalDependencies"
|
|
37092
|
+
];
|
|
37102
37093
|
const REACT_RSC_ADVISORIES_BY_MINOR = {
|
|
37103
37094
|
"19.0": {
|
|
37104
37095
|
rceFixedVersion: "19.0.1",
|
|
@@ -37145,13 +37136,20 @@ const enumerateWorkspaceDirectories = (workspaceRoot) => {
|
|
|
37145
37136
|
for (const pattern of patterns) for (const directory of resolveWorkspaceDirectories(workspaceRoot, pattern)) directories.add(directory);
|
|
37146
37137
|
return [...directories];
|
|
37147
37138
|
};
|
|
37139
|
+
const readDeclaredSpec = (packageJson, packageName) => {
|
|
37140
|
+
for (const section of DEPENDENCY_SECTIONS) {
|
|
37141
|
+
const spec = packageJson[section]?.[packageName];
|
|
37142
|
+
if (typeof spec === "string") return spec;
|
|
37143
|
+
}
|
|
37144
|
+
return null;
|
|
37145
|
+
};
|
|
37148
37146
|
const resolveVersionInDirectory = (directory, packageName, declaredSpecOverride) => {
|
|
37149
37147
|
const manifestPath = Path.join(directory, "node_modules", packageName, "package.json");
|
|
37150
37148
|
if (isFile(manifestPath)) {
|
|
37151
37149
|
const installedVersion = import_semver.valid(readPackageJson(manifestPath).version ?? null);
|
|
37152
37150
|
if (installedVersion !== null) return installedVersion;
|
|
37153
37151
|
}
|
|
37154
|
-
const candidateSpecs = [
|
|
37152
|
+
const candidateSpecs = [readDeclaredSpec(readPackageJson(Path.join(directory, "package.json")), packageName), declaredSpecOverride];
|
|
37155
37153
|
for (const spec of candidateSpecs) {
|
|
37156
37154
|
const pinnedVersion = spec === null ? null : import_semver.valid(spec);
|
|
37157
37155
|
if (pinnedVersion !== null) return pinnedVersion;
|
|
@@ -45459,5 +45457,5 @@ const startLanguageServer = () => {
|
|
|
45459
45457
|
};
|
|
45460
45458
|
//#endregion
|
|
45461
45459
|
export { startLanguageServer };
|
|
45462
|
-
!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]="
|
|
45463
|
-
//# debugId=
|
|
45460
|
+
!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]="ecc1704a-4f8c-583e-93b2-78c6feb9cfd6")}catch(e){}}();
|
|
45461
|
+
//# debugId=ecc1704a-4f8c-583e-93b2-78c6feb9cfd6
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-doctor",
|
|
3
|
-
"version": "0.8.1-dev.
|
|
3
|
+
"version": "0.8.1-dev.a2f9bf4",
|
|
4
4
|
"description": "Your agent writes bad React. This catches it",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"accessibility",
|
|
@@ -65,8 +65,8 @@
|
|
|
65
65
|
"vscode-languageserver-textdocument": "^1.0.12",
|
|
66
66
|
"vscode-uri": "^3.1.0",
|
|
67
67
|
"yaml": "^2.9.0",
|
|
68
|
-
"
|
|
69
|
-
"
|
|
68
|
+
"deslop-js": "0.8.1",
|
|
69
|
+
"oxlint-plugin-react-doctor": "0.8.1-dev.a2f9bf4"
|
|
70
70
|
},
|
|
71
71
|
"devDependencies": {
|
|
72
72
|
"@types/babel__code-frame": "^7.27.0",
|
|
@@ -74,8 +74,8 @@
|
|
|
74
74
|
"@xterm/headless": "^6.0.0",
|
|
75
75
|
"commander": "^14.0.3",
|
|
76
76
|
"ora": "^9.4.0",
|
|
77
|
-
"@react-doctor/core": "0.8.1",
|
|
78
77
|
"@react-doctor/api": "0.8.1",
|
|
78
|
+
"@react-doctor/core": "0.8.1",
|
|
79
79
|
"@react-doctor/language-server": "0.8.1"
|
|
80
80
|
},
|
|
81
81
|
"engines": {
|