@eslint-react/core 2.9.1-next.0 → 2.9.1
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 +5 -5
- package/dist/index.js +1 -1
- package/package.json +5 -5
package/dist/index.d.ts
CHANGED
|
@@ -165,7 +165,7 @@ interface SemanticFunc extends SemanticNode {
|
|
|
165
165
|
/** The body of the function */
|
|
166
166
|
body: TSESTree.BlockStatement | TSESTree.Expression;
|
|
167
167
|
/** The directives of the function (e.g., "use strict", "use client", "use server", etc.) */
|
|
168
|
-
directives:
|
|
168
|
+
directives: ast.TSESTreeDirective[];
|
|
169
169
|
/** The parameters of the function */
|
|
170
170
|
parameters: TSESTree.Parameter[];
|
|
171
171
|
/** The type parameters of the function */
|
|
@@ -237,7 +237,7 @@ interface FunctionComponentSemanticNode extends SemanticNode {
|
|
|
237
237
|
/**
|
|
238
238
|
* The directives used in the function (e.g., "use strict", "use client", etc.)
|
|
239
239
|
*/
|
|
240
|
-
directives:
|
|
240
|
+
directives: ast.TSESTreeDirective[];
|
|
241
241
|
}
|
|
242
242
|
/**
|
|
243
243
|
* Represents a React Class Component
|
|
@@ -561,7 +561,7 @@ type FindEnclosingComponentOrHookFilter = (n: TSESTree.Node, name: string | null
|
|
|
561
561
|
* @param test Optional test function to customize component or hook identification
|
|
562
562
|
* @returns The enclosing component or hook node, or `null` if none is ASAST.
|
|
563
563
|
*/
|
|
564
|
-
declare function findEnclosingComponentOrHook(node: TSESTree.Node | unit, test?: FindEnclosingComponentOrHookFilter): TSESTree.ArrowFunctionExpression | TSESTree.
|
|
564
|
+
declare function findEnclosingComponentOrHook(node: TSESTree.Node | unit, test?: FindEnclosingComponentOrHookFilter): TSESTree.ArrowFunctionExpression | TSESTree.FunctionExpression | TSESTree.FunctionDeclarationWithName | TSESTree.FunctionDeclarationWithOptionalName | undefined;
|
|
565
565
|
//#endregion
|
|
566
566
|
//#region src/hierarchy/is-inside-component-or-hook.d.ts
|
|
567
567
|
/**
|
|
@@ -759,7 +759,7 @@ declare function resolveJsxAttributeValue(context: RuleContext, attribute: ast.T
|
|
|
759
759
|
readonly toStatic: () => string | number | bigint | boolean | RegExp | null;
|
|
760
760
|
} | {
|
|
761
761
|
readonly kind: "expression";
|
|
762
|
-
readonly node: TSESTree.
|
|
762
|
+
readonly node: TSESTree.Expression | TSESTree.JSXEmptyExpression;
|
|
763
763
|
readonly toStatic: () => unknown;
|
|
764
764
|
} | {
|
|
765
765
|
readonly kind: "element";
|
|
@@ -767,7 +767,7 @@ declare function resolveJsxAttributeValue(context: RuleContext, attribute: ast.T
|
|
|
767
767
|
readonly toStatic: () => undefined;
|
|
768
768
|
} | {
|
|
769
769
|
readonly kind: "spreadChild";
|
|
770
|
-
readonly node: TSESTree.
|
|
770
|
+
readonly node: TSESTree.Expression | TSESTree.JSXEmptyExpression;
|
|
771
771
|
readonly toStatic: () => undefined;
|
|
772
772
|
} | {
|
|
773
773
|
readonly kind: "spreadProps";
|
package/dist/index.js
CHANGED
|
@@ -975,7 +975,7 @@ function useComponentCollector(context, options = {}) {
|
|
|
975
975
|
};
|
|
976
976
|
functionEntries.push(entry);
|
|
977
977
|
if (!entry.isComponentDefinition || !isFunctionWithLooseComponentName(context, node, false)) return;
|
|
978
|
-
if (directives.some((d) => d.
|
|
978
|
+
if (directives.some((d) => d.directive === "use memo" || d.directive === "use no memo")) components.set(entry.key, entry);
|
|
979
979
|
};
|
|
980
980
|
const onFunctionExit = () => {
|
|
981
981
|
return functionEntries.pop();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eslint-react/core",
|
|
3
|
-
"version": "2.9.1
|
|
3
|
+
"version": "2.9.1",
|
|
4
4
|
"description": "ESLint React's ESLint utility module for static analysis of React core APIs and patterns.",
|
|
5
5
|
"homepage": "https://github.com/Rel1cx/eslint-react",
|
|
6
6
|
"bugs": {
|
|
@@ -34,10 +34,10 @@
|
|
|
34
34
|
"@typescript-eslint/types": "^8.54.0",
|
|
35
35
|
"@typescript-eslint/utils": "^8.54.0",
|
|
36
36
|
"ts-pattern": "^5.9.0",
|
|
37
|
-
"@eslint-react/
|
|
38
|
-
"@eslint-react/
|
|
39
|
-
"@eslint-react/
|
|
40
|
-
"@eslint-react/var": "2.9.1
|
|
37
|
+
"@eslint-react/ast": "2.9.1",
|
|
38
|
+
"@eslint-react/eff": "2.9.1",
|
|
39
|
+
"@eslint-react/shared": "2.9.1",
|
|
40
|
+
"@eslint-react/var": "2.9.1"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"tsdown": "^0.20.1",
|