oxlint-plugin-react-doctor 0.8.2 → 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/index.js +5 -3
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -20888,7 +20888,7 @@ const isNodeReachable = (node, cfg) => {
|
|
|
20888
20888
|
};
|
|
20889
20889
|
const isCustomHookFunction = (functionNode, fallbackName) => {
|
|
20890
20890
|
const displayName = componentOrHookDisplayNameForFunction(functionNode) ?? fallbackName ?? "";
|
|
20891
|
-
return
|
|
20891
|
+
return displayName !== "use" && isReactHookName(displayName);
|
|
20892
20892
|
};
|
|
20893
20893
|
const getImportedHookBinding$1 = (callee, scopes) => {
|
|
20894
20894
|
if (!isNodeOfType(callee, "Identifier")) return null;
|
|
@@ -20908,6 +20908,8 @@ const resolveImportedHookFunction = (callee, scopes, currentFilename) => {
|
|
|
20908
20908
|
if (!currentFilename) return null;
|
|
20909
20909
|
const importedBinding = getImportedHookBinding$1(callee, scopes);
|
|
20910
20910
|
if (!importedBinding) return null;
|
|
20911
|
+
const localName = isNodeOfType(callee, "Identifier") ? callee.name : "";
|
|
20912
|
+
if (importedBinding.source === "react" || !isReactHookName(localName) && !isReactHookName(importedBinding.exportedName)) return null;
|
|
20911
20913
|
const resolved = resolveCrossFileFunctionExportWithFilePath(currentFilename, importedBinding.source, importedBinding.exportedName);
|
|
20912
20914
|
if (!resolved || !isCustomHookFunction(resolved.functionNode, importedBinding.exportedName)) return null;
|
|
20913
20915
|
return {
|
|
@@ -21169,10 +21171,10 @@ const findForwardedFreshHookDependencies = (callExpression, context, dependencyH
|
|
|
21169
21171
|
const findings = [];
|
|
21170
21172
|
if (cacheForCall) cacheForCall.set(cacheKey, findings);
|
|
21171
21173
|
else forwardedFreshDependencyCache.set(callExpression, new Map([[cacheKey, findings]]));
|
|
21172
|
-
if (!findRenderPhaseComponentOrHook(callExpression, context.scopes)) return findings;
|
|
21173
|
-
if (!isNodeReachable(callExpression, context.cfg)) return findings;
|
|
21174
21174
|
const target = resolveHookFunction(callExpression, context.scopes, context.cfg, context.filename);
|
|
21175
21175
|
if (!target) return findings;
|
|
21176
|
+
if (!findRenderPhaseComponentOrHook(callExpression, context.scopes)) return findings;
|
|
21177
|
+
if (!isNodeReachable(callExpression, context.cfg)) return findings;
|
|
21176
21178
|
for (const parameter of collectParameterBindings(target.functionNode)) {
|
|
21177
21179
|
const targetSymbol = target.scopes.symbolFor(parameter.bindingIdentifier);
|
|
21178
21180
|
if (!targetSymbol || isSymbolMutated(targetSymbol)) continue;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "oxlint-plugin-react-doctor",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.3-dev.3d7ea66",
|
|
4
4
|
"description": "React Doctor rules for oxlint.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"accessibility",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"@typescript-eslint/types": "^8.59.3",
|
|
46
46
|
"eslint-scope": "^9.1.2",
|
|
47
47
|
"eslint-visitor-keys": "^5.0.1",
|
|
48
|
-
"oxc-parser": "^0.
|
|
48
|
+
"oxc-parser": "^0.141.0"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"@types/node": "^25.6.0"
|