eslint-plugin-react-x 2.11.0 → 2.11.1-beta.0

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 +11 -12
  2. package/package.json +6 -6
package/dist/index.js CHANGED
@@ -9,8 +9,8 @@ import { findEnclosingAssignmentTarget, findVariable, getChildScopes, getObjectT
9
9
  import { constFalse, constTrue, flow, getOrElseUpdate, identity, unit } from "@eslint-react/eff";
10
10
  import { compare } from "compare-versions";
11
11
  import { getConstrainedTypeAtLocation, isTypeReadonly } from "@typescript-eslint/type-utils";
12
- import { isPropertyReadonlyInType, unionConstituents } from "ts-api-utils";
13
12
  import { getStaticValue, isIdentifier, isVariableDeclarator } from "@typescript-eslint/utils/ast-utils";
13
+ import { isPropertyReadonlyInType, unionConstituents } from "ts-api-utils";
14
14
  import { getTypeImmutability, isImmutable, isReadonlyDeep, isReadonlyShallow, isUnknown } from "is-immutable-type";
15
15
 
16
16
  //#region \0rolldown/runtime.js
@@ -58,6 +58,7 @@ var disable_type_checked_exports = /* @__PURE__ */ __exportAll({
58
58
  });
59
59
  const name$7 = "react-x/disable-type-checked";
60
60
  const rules$7 = {
61
+ "react-x/no-implicit-key": "off",
61
62
  "react-x/no-leaked-conditional-rendering": "off",
62
63
  "react-x/no-unused-props": "off",
63
64
  "react-x/prefer-read-only-props": "off"
@@ -66,7 +67,7 @@ const rules$7 = {
66
67
  //#endregion
67
68
  //#region package.json
68
69
  var name$6 = "eslint-plugin-react-x";
69
- var version = "2.11.0";
70
+ var version = "2.11.1-beta.0";
70
71
 
71
72
  //#endregion
72
73
  //#region src/utils/create-rule.ts
@@ -1355,16 +1356,14 @@ function create$35(context) {
1355
1356
  const services = ESLintUtils.getParserServices(context, false);
1356
1357
  const checker = services.program.getTypeChecker();
1357
1358
  return { JSXSpreadAttribute(node) {
1358
- for (const type of unionConstituents(getConstrainedTypeAtLocation(services, node.argument))) {
1359
- const key = type.getProperty("key");
1360
- if (key == null) continue;
1361
- if (checker.getFullyQualifiedName(key) === "React.Attributes.key") continue;
1362
- context.report({
1363
- messageId: "default",
1364
- node
1365
- });
1366
- break;
1367
- }
1359
+ const key = getConstrainedTypeAtLocation(services, node.argument).getProperty("key");
1360
+ if (key == null) return;
1361
+ if (checker.getFullyQualifiedName(key) === "React.Attributes.key") return;
1362
+ if (key.declarations?.at(0)?.getText().trim().startsWith("key?: Key | null | undefined")) return;
1363
+ context.report({
1364
+ messageId: "default",
1365
+ node
1366
+ });
1368
1367
  } };
1369
1368
  }
1370
1369
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-plugin-react-x",
3
- "version": "2.11.0",
3
+ "version": "2.11.1-beta.0",
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
  "is-immutable-type": "^5.0.1",
46
46
  "ts-api-utils": "^2.4.0",
47
47
  "ts-pattern": "^5.9.0",
48
- "@eslint-react/ast": "2.11.0",
49
- "@eslint-react/eff": "2.11.0",
50
- "@eslint-react/shared": "2.11.0",
51
- "@eslint-react/core": "2.11.0",
52
- "@eslint-react/var": "2.11.0"
48
+ "@eslint-react/ast": "2.11.1-beta.0",
49
+ "@eslint-react/core": "2.11.1-beta.0",
50
+ "@eslint-react/var": "2.11.1-beta.0",
51
+ "@eslint-react/eff": "2.11.1-beta.0",
52
+ "@eslint-react/shared": "2.11.1-beta.0"
53
53
  },
54
54
  "devDependencies": {
55
55
  "@types/react": "^19.2.13",