@eslint-react/jsx 1.7.0 → 1.7.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.
package/dist/index.js CHANGED
@@ -72,7 +72,7 @@ function getPropValue(attribute, context) {
72
72
  function findPropInProperties(properties, context, initialScope, seenProps = []) {
73
73
  return (propName) => {
74
74
  return tools.O.fromNullable(
75
- properties.find((prop) => {
75
+ properties.findLast((prop) => {
76
76
  return tsPattern.match(prop).when(ast.is(ast.NodeType.Property), (prop2) => {
77
77
  return "name" in prop2.key && prop2.key.name === propName;
78
78
  }).when(ast.is(ast.NodeType.SpreadElement), (prop2) => {
@@ -104,7 +104,7 @@ function findPropInProperties(properties, context, initialScope, seenProps = [])
104
104
  function findPropInAttributes(attributes, context, initialScope) {
105
105
  return (propName) => {
106
106
  return tools.O.fromNullable(
107
- attributes.find((attr) => {
107
+ attributes.findLast((attr) => {
108
108
  return tsPattern.match(attr).when(ast.is(ast.NodeType.JSXAttribute), (attr2) => getPropName(attr2) === propName).when(ast.is(ast.NodeType.JSXSpreadAttribute), (attr2) => {
109
109
  return tsPattern.match(attr2.argument).with({ type: ast.NodeType.Identifier }, (argument) => {
110
110
  const { name } = argument;
package/dist/index.mjs CHANGED
@@ -50,7 +50,7 @@ function getPropValue(attribute, context) {
50
50
  function findPropInProperties(properties, context, initialScope, seenProps = []) {
51
51
  return (propName) => {
52
52
  return O.fromNullable(
53
- properties.find((prop) => {
53
+ properties.findLast((prop) => {
54
54
  return match(prop).when(is(NodeType.Property), (prop2) => {
55
55
  return "name" in prop2.key && prop2.key.name === propName;
56
56
  }).when(is(NodeType.SpreadElement), (prop2) => {
@@ -82,7 +82,7 @@ function findPropInProperties(properties, context, initialScope, seenProps = [])
82
82
  function findPropInAttributes(attributes, context, initialScope) {
83
83
  return (propName) => {
84
84
  return O.fromNullable(
85
- attributes.find((attr) => {
85
+ attributes.findLast((attr) => {
86
86
  return match(attr).when(is(NodeType.JSXAttribute), (attr2) => getPropName(attr2) === propName).when(is(NodeType.JSXSpreadAttribute), (attr2) => {
87
87
  return match(attr2.argument).with({ type: NodeType.Identifier }, (argument) => {
88
88
  const { name } = argument;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eslint-react/jsx",
3
- "version": "1.7.0",
3
+ "version": "1.7.1-beta.0",
4
4
  "description": "ESLint React's TSESTree AST utility module for static analysis of JSX.",
5
5
  "homepage": "https://github.com/rel1cx/eslint-react",
6
6
  "bugs": {
@@ -40,10 +40,10 @@
40
40
  "@typescript-eslint/utils": "^7.18.0",
41
41
  "remeda": "^2.6.0",
42
42
  "ts-pattern": "^5.2.0",
43
- "@eslint-react/ast": "1.7.0",
44
- "@eslint-react/tools": "1.7.0",
45
- "@eslint-react/types": "1.7.0",
46
- "@eslint-react/var": "1.7.0"
43
+ "@eslint-react/ast": "1.7.1-beta.0",
44
+ "@eslint-react/var": "1.7.1-beta.0",
45
+ "@eslint-react/tools": "1.7.1-beta.0",
46
+ "@eslint-react/types": "1.7.1-beta.0"
47
47
  },
48
48
  "devDependencies": {
49
49
  "tsup": "8.2.3"