eslint-plugin-react-x 1.22.2-next.7 → 1.22.2-next.8

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 CHANGED
@@ -42,7 +42,7 @@ var ts__default = /*#__PURE__*/_interopDefault(ts);
42
42
 
43
43
  // package.json
44
44
  var name = "eslint-plugin-react-x";
45
- var version = "1.22.2-next.7";
45
+ var version = "1.22.2-next.8";
46
46
  var createRule = shared.createRuleForPlugin("x");
47
47
 
48
48
  // src/rules/avoid-shorthand-boolean.ts
@@ -1123,15 +1123,13 @@ var no_duplicate_key_default = createRule({
1123
1123
  },
1124
1124
  name: RULE_NAME24,
1125
1125
  create(context) {
1126
+ if (!context.sourceCode.getText().includes("key=")) return {};
1126
1127
  const keyedEntries = /* @__PURE__ */ new Map();
1127
1128
  function isKeyValueEqual(a, b) {
1128
1129
  const aValue = a.value;
1129
1130
  const bValue = b.value;
1130
1131
  if (aValue === null || bValue === null) return false;
1131
- return VAR__namespace.isNodeValueEqual(aValue, bValue, [
1132
- context.sourceCode.getScope(aValue),
1133
- context.sourceCode.getScope(bValue)
1134
- ]);
1132
+ return AST11__namespace.isNodeEqual(aValue, bValue);
1135
1133
  }
1136
1134
  return {
1137
1135
  "JSXAttribute[name.name='key']"(node) {
@@ -1153,11 +1151,11 @@ var no_duplicate_key_default = createRule({
1153
1151
  const entry = eff.F.pipe(
1154
1152
  eff.O.Do,
1155
1153
  eff.O.bind("call", () => AST11__namespace.traverseUpGuard(jsxElement, AST11__namespace.isMapCallLoose)),
1156
- eff.O.bind("ietr", ({ call }) => AST11__namespace.traverseUpStop(jsxElement, call, AST11__namespace.isFunction)),
1154
+ eff.O.bind("iter", ({ call }) => AST11__namespace.traverseUpStop(jsxElement, call, AST11__namespace.isFunction)),
1157
1155
  eff.O.bind("arg0", ({ call }) => eff.O.fromNullable(call.arguments[0]))
1158
1156
  );
1159
- for (const { arg0, call, ietr } of eff.O.toArray(entry)) {
1160
- if (AST11__namespace.unwrapTypeExpression(arg0) !== ietr) continue;
1157
+ for (const { arg0, call, iter } of eff.O.toArray(entry)) {
1158
+ if (AST11__namespace.unwrapTypeExpression(arg0) !== iter) continue;
1161
1159
  keyedEntries.set(call, {
1162
1160
  hasDuplicate: node.value?.type === types.AST_NODE_TYPES.Literal,
1163
1161
  keys: [node],
package/dist/index.mjs CHANGED
@@ -15,7 +15,7 @@ import { getTypeImmutability, isUnknown, isImmutable, isReadonlyShallow, isReado
15
15
 
16
16
  // package.json
17
17
  var name = "eslint-plugin-react-x";
18
- var version = "1.22.2-next.7";
18
+ var version = "1.22.2-next.8";
19
19
  var createRule = createRuleForPlugin("x");
20
20
 
21
21
  // src/rules/avoid-shorthand-boolean.ts
@@ -1096,15 +1096,13 @@ var no_duplicate_key_default = createRule({
1096
1096
  },
1097
1097
  name: RULE_NAME24,
1098
1098
  create(context) {
1099
+ if (!context.sourceCode.getText().includes("key=")) return {};
1099
1100
  const keyedEntries = /* @__PURE__ */ new Map();
1100
1101
  function isKeyValueEqual(a, b) {
1101
1102
  const aValue = a.value;
1102
1103
  const bValue = b.value;
1103
1104
  if (aValue === null || bValue === null) return false;
1104
- return VAR.isNodeValueEqual(aValue, bValue, [
1105
- context.sourceCode.getScope(aValue),
1106
- context.sourceCode.getScope(bValue)
1107
- ]);
1105
+ return AST11.isNodeEqual(aValue, bValue);
1108
1106
  }
1109
1107
  return {
1110
1108
  "JSXAttribute[name.name='key']"(node) {
@@ -1126,11 +1124,11 @@ var no_duplicate_key_default = createRule({
1126
1124
  const entry = F.pipe(
1127
1125
  O.Do,
1128
1126
  O.bind("call", () => AST11.traverseUpGuard(jsxElement, AST11.isMapCallLoose)),
1129
- O.bind("ietr", ({ call }) => AST11.traverseUpStop(jsxElement, call, AST11.isFunction)),
1127
+ O.bind("iter", ({ call }) => AST11.traverseUpStop(jsxElement, call, AST11.isFunction)),
1130
1128
  O.bind("arg0", ({ call }) => O.fromNullable(call.arguments[0]))
1131
1129
  );
1132
- for (const { arg0, call, ietr } of O.toArray(entry)) {
1133
- if (AST11.unwrapTypeExpression(arg0) !== ietr) continue;
1130
+ for (const { arg0, call, iter } of O.toArray(entry)) {
1131
+ if (AST11.unwrapTypeExpression(arg0) !== iter) continue;
1134
1132
  keyedEntries.set(call, {
1135
1133
  hasDuplicate: node.value?.type === AST_NODE_TYPES.Literal,
1136
1134
  keys: [node],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-plugin-react-x",
3
- "version": "1.22.2-next.7",
3
+ "version": "1.22.2-next.8",
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",
@@ -49,13 +49,13 @@
49
49
  "string-ts": "^2.2.0",
50
50
  "ts-api-utils": "^2.0.0",
51
51
  "ts-pattern": "^5.6.0",
52
- "@eslint-react/ast": "1.22.2-next.7",
53
- "@eslint-react/core": "1.22.2-next.7",
54
- "@eslint-react/eff": "1.22.2-next.7",
55
- "@eslint-react/shared": "1.22.2-next.7",
56
- "@eslint-react/jsx": "1.22.2-next.7",
57
- "@eslint-react/types": "1.22.2-next.7",
58
- "@eslint-react/var": "1.22.2-next.7"
52
+ "@eslint-react/ast": "1.22.2-next.8",
53
+ "@eslint-react/core": "1.22.2-next.8",
54
+ "@eslint-react/jsx": "1.22.2-next.8",
55
+ "@eslint-react/eff": "1.22.2-next.8",
56
+ "@eslint-react/shared": "1.22.2-next.8",
57
+ "@eslint-react/types": "1.22.2-next.8",
58
+ "@eslint-react/var": "1.22.2-next.8"
59
59
  },
60
60
  "devDependencies": {
61
61
  "@types/react": "^19.0.2",