eslint-plugin-react-x 3.0.0-next.57 → 3.0.0-next.58

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.js +5 -2
  2. package/package.json +6 -6
package/dist/index.js CHANGED
@@ -68,7 +68,7 @@ const rules$7 = {
68
68
  //#endregion
69
69
  //#region package.json
70
70
  var name$6 = "eslint-plugin-react-x";
71
- var version = "3.0.0-next.57";
71
+ var version = "3.0.0-next.58";
72
72
 
73
73
  //#endregion
74
74
  //#region src/utils/create-rule.ts
@@ -3976,7 +3976,6 @@ function create$9(context, [option]) {
3976
3976
  * Check if a fragment node is useless and should be reported
3977
3977
  */
3978
3978
  function checkNode(context, node) {
3979
- if (node.type === AST_NODE_TYPES.JSXElement && core.getJsxAttribute(context, node)("key") != null) return;
3980
3979
  if (core.isJsxHostElement(context, node.parent)) context.report({
3981
3980
  messageId: "default",
3982
3981
  node,
@@ -4042,6 +4041,8 @@ function create$9(context, [option]) {
4042
4041
  return defineRuleListener({
4043
4042
  JSXElement(node) {
4044
4043
  if (!core.isJsxFragmentElement(context, node, jsxConfig)) return;
4044
+ if (core.getJsxAttribute(context, node)("key") != null) return;
4045
+ if (core.getJsxAttribute(context, node)("ref") != null) return;
4045
4046
  checkNode(context, node);
4046
4047
  },
4047
4048
  JSXFragment(node) {
@@ -4248,6 +4249,8 @@ function create$5(context) {
4248
4249
  /**
4249
4250
  * Check if a test expression is a null check on `ref.current` for a given ref name.
4250
4251
  * Matches forms like `ref.current === null`, `null === ref.current`, and their != variants.
4252
+ * @param test
4253
+ * @param refName
4251
4254
  */
4252
4255
  function isRefCurrentNullCheck(test, refName) {
4253
4256
  if (test.type !== AST_NODE_TYPES.BinaryExpression) return false;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-plugin-react-x",
3
- "version": "3.0.0-next.57",
3
+ "version": "3.0.0-next.58",
4
4
  "description": "A set of composable ESLint rules for libraries and frameworks that use React as a UI runtime.",
5
5
  "keywords": [
6
6
  "react",
@@ -45,11 +45,11 @@
45
45
  "string-ts": "^2.3.1",
46
46
  "ts-api-utils": "^2.4.0",
47
47
  "ts-pattern": "^5.9.0",
48
- "@eslint-react/ast": "3.0.0-next.57",
49
- "@eslint-react/eff": "3.0.0-next.57",
50
- "@eslint-react/shared": "3.0.0-next.57",
51
- "@eslint-react/var": "3.0.0-next.57",
52
- "@eslint-react/core": "3.0.0-next.57"
48
+ "@eslint-react/ast": "3.0.0-next.58",
49
+ "@eslint-react/core": "3.0.0-next.58",
50
+ "@eslint-react/eff": "3.0.0-next.58",
51
+ "@eslint-react/var": "3.0.0-next.58",
52
+ "@eslint-react/shared": "3.0.0-next.58"
53
53
  },
54
54
  "devDependencies": {
55
55
  "@types/react": "^19.2.14",