@eslint-react/core 5.28.0 → 5.28.2

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.
Files changed (2) hide show
  1. package/dist/index.d.ts +10 -8
  2. package/package.json +6 -6
package/dist/index.d.ts CHANGED
@@ -13,12 +13,12 @@ export declare namespace isAPI {
13
13
  };
14
14
  }
15
15
  /**
16
- * Check if the node is a React API identifier or member expression.
16
+ * Check if the node is an API identifier or member expression.
17
17
  * @remarks
18
18
  * Matching is namespace-agnostic by design: the fully qualified name of the node is compared
19
19
  * against the API name by exact match or by suffix (`.${api}`), so `foo.bar.useState` matches
20
20
  * `"useState"` just as `React.useState` does.
21
- * @param api The React API name to check against (ex: "useState", "React.memo").
21
+ * @param api The API name to check against (ex: "useState", "React.memo").
22
22
  * @returns A dual-signature predicate: call it as `(context, node)` to check a node directly,
23
23
  * or as `(context)` to get a `(node) => boolean` predicate (ex: for use in array filters).
24
24
  */
@@ -31,8 +31,8 @@ export declare namespace isAPICall {
31
31
  };
32
32
  }
33
33
  /**
34
- * Check if the node is a call expression to a specific React API.
35
- * @param api The React API name to check against.
34
+ * Check if the node is a call expression to a specific API.
35
+ * @param api The API name to check against.
36
36
  * @returns A dual-signature predicate: call it as `(context, node)` to check a node directly,
37
37
  * or as `(context)` to get a `(node) => node is TSESTree.CallExpression` predicate (ex: for use in array filters).
38
38
  */
@@ -390,10 +390,12 @@ export declare function getCreateElementProp(context: RuleContext, node: null |
390
390
  */
391
391
  export declare function isCreateElementChildrenArgument(context: RuleContext, node: TSESTree.Node): boolean;
392
392
  /**
393
- * Check if the node is inside the props object (the second argument) of a `createElement` call.
393
+ * Check if the node is directly inside the props object (the second argument) of a `createElement` call,
394
+ * that is, its closest `ObjectExpression` ancestor is the props object itself. Nodes nested deeper
395
+ * (ex: inside an object nested in the props object) are not considered inside.
394
396
  * @param context The ESLint rule context.
395
397
  * @param node The node to check.
396
- * @returns `true` if the node is inside `createElement`'s props object.
398
+ * @returns `true` if the node is directly inside `createElement`'s props object.
397
399
  */
398
400
  export declare function isInsideCreateElementProps(context: RuleContext, node: TSESTree.Node): boolean;
399
401
  //#endregion
@@ -436,7 +438,7 @@ export type FunctionSemanticNode = ClientFunctionSemanticNode | ServerFunctionSe
436
438
  * nodes as the ECMAScript spec's `IsAnonymousFunctionDefinition()` with some
437
439
  * exceptions to better fit our use case.
438
440
  *
439
- * Ported from {@link https://github.com/facebook/react/blob/bb8a76c6cc77ea2976d690ea09f5a1b3d9b1792a/packages/eslint-plugin-react-hooks/src/rules/RulesOfHooks.ts#L860 | RulesOfHooks.ts}
441
+ * Ported from {@link https://github.com/react/react/blob/bb8a76c6cc77ea2976d690ea09f5a1b3d9b1792a/packages/eslint-plugin-react-hooks/src/rules/RulesOfHooks.ts#L860 | RulesOfHooks.ts}
440
442
  *
441
443
  * @param node The function node to analyze.
442
444
  * @returns The identifier node if found, `null` otherwise.
@@ -522,7 +524,7 @@ export type HookCall = TSESTree.CallExpression | TSESTree.TaggedTemplateExpressi
522
524
  * Check if the name is a hook name (`use` itself, or starts with `use` followed by an uppercase letter or digit).
523
525
  * @param name The name of the identifier to check.
524
526
  * @returns `true` if the name is a hook name.
525
- * @see https://github.com/facebook/react/blob/1d6c8168db1d82713202e842df3167787ffa00ed/packages/eslint-plugin-react-hooks/src/rules/RulesOfHooks.ts#L16
527
+ * @see https://github.com/react/react/blob/1d6c8168db1d82713202e842df3167787ffa00ed/packages/eslint-plugin-react-hooks/src/rules/RulesOfHooks.ts#L16
526
528
  */
527
529
  export declare function isHookName(name: string): boolean;
528
530
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eslint-react/core",
3
- "version": "5.28.0",
3
+ "version": "5.28.2",
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": {
@@ -29,10 +29,10 @@
29
29
  "dist"
30
30
  ],
31
31
  "dependencies": {
32
- "@eslint-react/ast": "5.28.0",
33
- "@eslint-react/eslint": "5.28.0",
34
- "@eslint-react/shared": "5.28.0",
35
- "@eslint-react/var": "5.28.0",
32
+ "@eslint-react/ast": "5.28.2",
33
+ "@eslint-react/eslint": "5.28.2",
34
+ "@eslint-react/shared": "5.28.2",
35
+ "@eslint-react/var": "5.28.2",
36
36
  "@typescript-eslint/types": "^8.71.2",
37
37
  "@typescript-eslint/utils": "^8.71.2",
38
38
  "ts-pattern": "^5.9.2"
@@ -45,7 +45,7 @@
45
45
  "@types/node": "^20.19.43",
46
46
  "@typescript-eslint/typescript-estree": "^8.71.2",
47
47
  "dedent": "^1.7.2",
48
- "eslint": "^10.12.0",
48
+ "eslint": "^10.13.0",
49
49
  "tsdown": "^0.23.1",
50
50
  "typescript": "6.0.3",
51
51
  "vitest": "^5.0.5"