react-doctor 0.8.3-dev.01820bb → 0.8.3-dev.3d7ea66
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 +162 -250
- package/dist/index.js +7 -16
- package/dist/lsp.js +7 -16
- package/package.json +3 -9
- package/dist/run-scan-app-DZ5jGWFf.js +0 -1661
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]="cf84418d-5713-5c93-95cf-6a6747b9f247")}catch(e){}}();
|
|
3
3
|
import { i as __toESM$1, r as __require, t as __commonJSMin$1 } from "./chunk-ChKA3wi6.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";
|
|
@@ -61762,13 +61762,6 @@ const DIAGNOSTIC_CATEGORY_BUCKETS = [
|
|
|
61762
61762
|
"Maintainability"
|
|
61763
61763
|
];
|
|
61764
61764
|
const OCCURRENCE_MATCHED_CATEGORIES = new Set(["Accessibility"]);
|
|
61765
|
-
new Map(Object.entries({
|
|
61766
|
-
Security: "An attacker can read user data, act as your users, or run code you never shipped.",
|
|
61767
|
-
Bugs: "Real users hit crashes, wrong output, or state that silently corrupts.",
|
|
61768
|
-
Performance: "Users feel extra latency and wasted renders on every interaction.",
|
|
61769
|
-
Accessibility: "Users on screen readers, keyboards, or assistive tech get locked out.",
|
|
61770
|
-
Maintainability: "Every future change gets slower and riskier to make."
|
|
61771
|
-
}));
|
|
61772
61765
|
const APP_ONLY_RULE_KEYS = new Set([
|
|
61773
61766
|
"react-hooks-js/static-components",
|
|
61774
61767
|
"react-doctor/no-render-prop-children",
|
|
@@ -62518,20 +62511,18 @@ const getReactCompilerFlagState = (expression, analysis) => {
|
|
|
62518
62511
|
}
|
|
62519
62512
|
return null;
|
|
62520
62513
|
};
|
|
62521
|
-
const getSelectedObjectProperty = (expression, propertyName, analysis
|
|
62514
|
+
const getSelectedObjectProperty = (expression, propertyName, analysis) => {
|
|
62522
62515
|
let resolvedExpression = expression;
|
|
62523
62516
|
while (ts.isParenthesizedExpression(resolvedExpression) || ts.isAsExpression(resolvedExpression) || ts.isTypeAssertionExpression(resolvedExpression) || ts.isSatisfiesExpression(resolvedExpression) || ts.isNonNullExpression(resolvedExpression)) resolvedExpression = resolvedExpression.expression;
|
|
62524
|
-
if (visitedExpressions.has(resolvedExpression)) return null;
|
|
62525
|
-
visitedExpressions.add(resolvedExpression);
|
|
62526
62517
|
if (ts.isIdentifier(resolvedExpression)) {
|
|
62527
62518
|
if (analysis.localBindings.has(resolvedExpression.text)) {
|
|
62528
62519
|
const localInitializer = analysis.localBindings.get(resolvedExpression.text);
|
|
62529
|
-
return localInitializer ? getSelectedObjectProperty(localInitializer, propertyName, analysis
|
|
62520
|
+
return localInitializer ? getSelectedObjectProperty(localInitializer, propertyName, analysis) : null;
|
|
62530
62521
|
}
|
|
62531
62522
|
const scopedBinding = getScopedConfigBinding(resolvedExpression);
|
|
62532
|
-
if (scopedBinding.wasFound) return scopedBinding.initializer ? getSelectedObjectProperty(scopedBinding.initializer, propertyName, analysis
|
|
62523
|
+
if (scopedBinding.wasFound) return scopedBinding.initializer ? getSelectedObjectProperty(scopedBinding.initializer, propertyName, analysis) : null;
|
|
62533
62524
|
const topLevelBinding = getTopLevelBinding(analysis.sourceFile, resolvedExpression.text);
|
|
62534
|
-
return topLevelBinding && ts.isExpression(topLevelBinding) ? getSelectedObjectProperty(topLevelBinding, propertyName, analysis
|
|
62525
|
+
return topLevelBinding && ts.isExpression(topLevelBinding) ? getSelectedObjectProperty(topLevelBinding, propertyName, analysis) : null;
|
|
62535
62526
|
}
|
|
62536
62527
|
if (!ts.isObjectLiteralExpression(resolvedExpression)) return null;
|
|
62537
62528
|
for (const property of [...resolvedExpression.properties].reverse()) {
|
|
@@ -62539,7 +62530,7 @@ const getSelectedObjectProperty = (expression, propertyName, analysis, visitedEx
|
|
|
62539
62530
|
if (ts.isMethodDeclaration(property) && getStaticPropertyName$1(property.name) === propertyName) return property;
|
|
62540
62531
|
if (ts.isShorthandPropertyAssignment(property) && property.name.text === propertyName) return property.name;
|
|
62541
62532
|
if (ts.isSpreadAssignment(property)) {
|
|
62542
|
-
const spreadProperty = getSelectedObjectProperty(property.expression, propertyName, analysis
|
|
62533
|
+
const spreadProperty = getSelectedObjectProperty(property.expression, propertyName, analysis);
|
|
62543
62534
|
if (spreadProperty) return spreadProperty;
|
|
62544
62535
|
}
|
|
62545
62536
|
}
|
|
@@ -73883,4 +73874,4 @@ const toJsonReport = (result, options) => buildJsonReport({
|
|
|
73883
73874
|
export { AmbiguousProjectError, NoReactDependencyError, NotADirectoryError, PackageJsonNotFoundError, ProjectNotFoundError, ReactDoctorError, buildJsonReport, buildJsonReportError, clearCaches, defineConfig, diagnose, filterSourceFiles, getDiffInfo, hasReactRuntime, isProjectDiscoveryError, isReactDoctorError, summarizeDiagnostics, toJsonReport };
|
|
73884
73875
|
|
|
73885
73876
|
//# sourceMappingURL=index.js.map
|
|
73886
|
-
//# debugId=
|
|
73877
|
+
//# debugId=cf84418d-5713-5c93-95cf-6a6747b9f247
|
package/dist/lsp.js
CHANGED
|
@@ -61815,13 +61815,6 @@ const DIAGNOSTIC_CATEGORY_BUCKETS = [
|
|
|
61815
61815
|
"Maintainability"
|
|
61816
61816
|
];
|
|
61817
61817
|
const OCCURRENCE_MATCHED_CATEGORIES = new Set(["Accessibility"]);
|
|
61818
|
-
new Map(Object.entries({
|
|
61819
|
-
Security: "An attacker can read user data, act as your users, or run code you never shipped.",
|
|
61820
|
-
Bugs: "Real users hit crashes, wrong output, or state that silently corrupts.",
|
|
61821
|
-
Performance: "Users feel extra latency and wasted renders on every interaction.",
|
|
61822
|
-
Accessibility: "Users on screen readers, keyboards, or assistive tech get locked out.",
|
|
61823
|
-
Maintainability: "Every future change gets slower and riskier to make."
|
|
61824
|
-
}));
|
|
61825
61818
|
const APP_ONLY_RULE_KEYS = new Set([
|
|
61826
61819
|
"react-hooks-js/static-components",
|
|
61827
61820
|
"react-doctor/no-render-prop-children",
|
|
@@ -62571,20 +62564,18 @@ const getReactCompilerFlagState = (expression, analysis) => {
|
|
|
62571
62564
|
}
|
|
62572
62565
|
return null;
|
|
62573
62566
|
};
|
|
62574
|
-
const getSelectedObjectProperty = (expression, propertyName, analysis
|
|
62567
|
+
const getSelectedObjectProperty = (expression, propertyName, analysis) => {
|
|
62575
62568
|
let resolvedExpression = expression;
|
|
62576
62569
|
while (ts.isParenthesizedExpression(resolvedExpression) || ts.isAsExpression(resolvedExpression) || ts.isTypeAssertionExpression(resolvedExpression) || ts.isSatisfiesExpression(resolvedExpression) || ts.isNonNullExpression(resolvedExpression)) resolvedExpression = resolvedExpression.expression;
|
|
62577
|
-
if (visitedExpressions.has(resolvedExpression)) return null;
|
|
62578
|
-
visitedExpressions.add(resolvedExpression);
|
|
62579
62570
|
if (ts.isIdentifier(resolvedExpression)) {
|
|
62580
62571
|
if (analysis.localBindings.has(resolvedExpression.text)) {
|
|
62581
62572
|
const localInitializer = analysis.localBindings.get(resolvedExpression.text);
|
|
62582
|
-
return localInitializer ? getSelectedObjectProperty(localInitializer, propertyName, analysis
|
|
62573
|
+
return localInitializer ? getSelectedObjectProperty(localInitializer, propertyName, analysis) : null;
|
|
62583
62574
|
}
|
|
62584
62575
|
const scopedBinding = getScopedConfigBinding(resolvedExpression);
|
|
62585
|
-
if (scopedBinding.wasFound) return scopedBinding.initializer ? getSelectedObjectProperty(scopedBinding.initializer, propertyName, analysis
|
|
62576
|
+
if (scopedBinding.wasFound) return scopedBinding.initializer ? getSelectedObjectProperty(scopedBinding.initializer, propertyName, analysis) : null;
|
|
62586
62577
|
const topLevelBinding = getTopLevelBinding(analysis.sourceFile, resolvedExpression.text);
|
|
62587
|
-
return topLevelBinding && ts.isExpression(topLevelBinding) ? getSelectedObjectProperty(topLevelBinding, propertyName, analysis
|
|
62578
|
+
return topLevelBinding && ts.isExpression(topLevelBinding) ? getSelectedObjectProperty(topLevelBinding, propertyName, analysis) : null;
|
|
62588
62579
|
}
|
|
62589
62580
|
if (!ts.isObjectLiteralExpression(resolvedExpression)) return null;
|
|
62590
62581
|
for (const property of [...resolvedExpression.properties].reverse()) {
|
|
@@ -62592,7 +62583,7 @@ const getSelectedObjectProperty = (expression, propertyName, analysis, visitedEx
|
|
|
62592
62583
|
if (ts.isMethodDeclaration(property) && getStaticPropertyName$1(property.name) === propertyName) return property;
|
|
62593
62584
|
if (ts.isShorthandPropertyAssignment(property) && property.name.text === propertyName) return property.name;
|
|
62594
62585
|
if (ts.isSpreadAssignment(property)) {
|
|
62595
|
-
const spreadProperty = getSelectedObjectProperty(property.expression, propertyName, analysis
|
|
62586
|
+
const spreadProperty = getSelectedObjectProperty(property.expression, propertyName, analysis);
|
|
62596
62587
|
if (spreadProperty) return spreadProperty;
|
|
62597
62588
|
}
|
|
62598
62589
|
}
|
|
@@ -75504,5 +75495,5 @@ const startLanguageServer = () => {
|
|
|
75504
75495
|
};
|
|
75505
75496
|
//#endregion
|
|
75506
75497
|
export { startLanguageServer };
|
|
75507
|
-
!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]="
|
|
75508
|
-
//# debugId=
|
|
75498
|
+
!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]="97b31424-577f-5b74-ac26-46212d2f1aaf")}catch(e){}}();
|
|
75499
|
+
//# debugId=97b31424-577f-5b74-ac26-46212d2f1aaf
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-doctor",
|
|
3
|
-
"version": "0.8.3-dev.
|
|
3
|
+
"version": "0.8.3-dev.3d7ea66",
|
|
4
4
|
"description": "Your agent writes bad React. This catches it",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"accessibility",
|
|
@@ -56,32 +56,26 @@
|
|
|
56
56
|
"conf": "^15.1.0",
|
|
57
57
|
"confbox": "^0.2.4",
|
|
58
58
|
"eslint-plugin-react-hooks": "^7.1.1",
|
|
59
|
-
"figures": "^6.1.0",
|
|
60
|
-
"ink": "^7.1.0",
|
|
61
|
-
"ink-spinner": "^5.0.0",
|
|
62
59
|
"jiti": "^2.7.0",
|
|
63
60
|
"magicast": "^0.5.3",
|
|
64
61
|
"oxlint": ">=1.74.0 <1.75.0",
|
|
65
62
|
"prompts": "^2.4.2",
|
|
66
|
-
"react": "19.2.5",
|
|
67
63
|
"typescript": ">=5.0.4 <6",
|
|
68
64
|
"vscode-languageserver": "^9.0.1",
|
|
69
65
|
"vscode-languageserver-textdocument": "^1.0.12",
|
|
70
66
|
"vscode-uri": "^3.1.0",
|
|
71
67
|
"yaml": "^2.9.0",
|
|
72
68
|
"deslop-js": "0.8.3",
|
|
73
|
-
"oxlint-plugin-react-doctor": "0.8.3-dev.
|
|
69
|
+
"oxlint-plugin-react-doctor": "0.8.3-dev.3d7ea66"
|
|
74
70
|
},
|
|
75
71
|
"devDependencies": {
|
|
76
72
|
"@types/babel__code-frame": "^7.27.0",
|
|
77
73
|
"@types/prompts": "^2.4.9",
|
|
78
|
-
"@types/react": "^19.2.14",
|
|
79
74
|
"@xterm/headless": "^6.0.0",
|
|
80
75
|
"commander": "^14.0.3",
|
|
81
|
-
"ink-testing-library": "^4.0.0",
|
|
82
76
|
"ora": "^9.4.0",
|
|
83
|
-
"@react-doctor/core": "0.8.3",
|
|
84
77
|
"@react-doctor/api": "0.8.3",
|
|
78
|
+
"@react-doctor/core": "0.8.3",
|
|
85
79
|
"@react-doctor/language-server": "0.8.3"
|
|
86
80
|
},
|
|
87
81
|
"engines": {
|