@eslint-react/jsx 1.40.4-next.6 → 1.40.4

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.d.mts CHANGED
@@ -31,6 +31,10 @@ declare function getAttributeValue(node: TSESTree.JSXAttribute | TSESTree.JSXSpr
31
31
  kind: "lazy";
32
32
  }>;
33
33
 
34
+ declare function hasAttribute(name: string, attributes: TSESTree$1.JSXOpeningElement["attributes"], initialScope?: Scope): boolean;
35
+ declare function hasAnyAttribute(names: string[], attributes: TSESTree$1.JSXOpeningElement["attributes"], initialScope?: Scope): boolean;
36
+ declare function hasEveryAttribute(names: string[], attributes: TSESTree$1.JSXOpeningElement["attributes"], initialScope?: Scope): boolean;
37
+
34
38
  /**
35
39
  * Find the parent JSX attribute node of a node
36
40
  * @param node The node to find the parent attribute of
@@ -51,10 +55,6 @@ declare function isKeyedElement(node: TSESTree$1.Node, initialScope?: Scope): bo
51
55
  declare function isFragmentElement(node: TSESTree$1.Node | null | _, allowJSXFragment?: false): node is TSESTree$1.JSXElement;
52
56
  declare function isFragmentElement(node: TSESTree$1.Node | null | _, allowJSXFragment?: true): node is TSESTree$1.JSXElement | TSESTree$1.JSXFragment;
53
57
 
54
- declare function hasAttribute(name: string, attributes: TSESTree$1.JSXOpeningElement["attributes"], initialScope?: Scope): boolean;
55
- declare function hasAnyAttribute(names: string[], attributes: TSESTree$1.JSXOpeningElement["attributes"], initialScope?: Scope): boolean;
56
- declare function hasEveryAttribute(names: string[], attributes: TSESTree$1.JSXOpeningElement["attributes"], initialScope?: Scope): boolean;
57
-
58
58
  type JSXDetectionHint = bigint;
59
59
  declare const JSXDetectionHint: {
60
60
  readonly None: 0n;
package/dist/index.d.ts CHANGED
@@ -31,6 +31,10 @@ declare function getAttributeValue(node: TSESTree.JSXAttribute | TSESTree.JSXSpr
31
31
  kind: "lazy";
32
32
  }>;
33
33
 
34
+ declare function hasAttribute(name: string, attributes: TSESTree$1.JSXOpeningElement["attributes"], initialScope?: Scope): boolean;
35
+ declare function hasAnyAttribute(names: string[], attributes: TSESTree$1.JSXOpeningElement["attributes"], initialScope?: Scope): boolean;
36
+ declare function hasEveryAttribute(names: string[], attributes: TSESTree$1.JSXOpeningElement["attributes"], initialScope?: Scope): boolean;
37
+
34
38
  /**
35
39
  * Find the parent JSX attribute node of a node
36
40
  * @param node The node to find the parent attribute of
@@ -51,10 +55,6 @@ declare function isKeyedElement(node: TSESTree$1.Node, initialScope?: Scope): bo
51
55
  declare function isFragmentElement(node: TSESTree$1.Node | null | _, allowJSXFragment?: false): node is TSESTree$1.JSXElement;
52
56
  declare function isFragmentElement(node: TSESTree$1.Node | null | _, allowJSXFragment?: true): node is TSESTree$1.JSXElement | TSESTree$1.JSXFragment;
53
57
 
54
- declare function hasAttribute(name: string, attributes: TSESTree$1.JSXOpeningElement["attributes"], initialScope?: Scope): boolean;
55
- declare function hasAnyAttribute(names: string[], attributes: TSESTree$1.JSXOpeningElement["attributes"], initialScope?: Scope): boolean;
56
- declare function hasEveryAttribute(names: string[], attributes: TSESTree$1.JSXOpeningElement["attributes"], initialScope?: Scope): boolean;
57
-
58
58
  type JSXDetectionHint = bigint;
59
59
  declare const JSXDetectionHint: {
60
60
  readonly None: 0n;
package/dist/index.js CHANGED
@@ -115,6 +115,17 @@ function getAttributeValue(node, name, initialScope) {
115
115
  return { kind: "none", node, initialScope };
116
116
  }
117
117
  }
118
+
119
+ // src/attribute/has.ts
120
+ function hasAttribute(name, attributes, initialScope) {
121
+ return getAttribute(name, attributes, initialScope) != null;
122
+ }
123
+ function hasAnyAttribute(names, attributes, initialScope) {
124
+ return names.some((n) => hasAttribute(n, attributes, initialScope));
125
+ }
126
+ function hasEveryAttribute(names, attributes, initialScope) {
127
+ return names.every((n) => hasAttribute(n, attributes, initialScope));
128
+ }
118
129
  function findParentAttribute(node, test = eff.constTrue) {
119
130
  const guard = (node2) => {
120
131
  return node2.type === types.AST_NODE_TYPES.JSXAttribute && test(node2);
@@ -127,19 +138,6 @@ function getElementType(node) {
127
138
  }
128
139
  return toString(node.openingElement.name);
129
140
  }
130
-
131
- // src/has-attribute.ts
132
- function hasAttribute(name, attributes, initialScope) {
133
- return getAttribute(name, attributes, initialScope) != null;
134
- }
135
- function hasAnyAttribute(names, attributes, initialScope) {
136
- return names.some((n) => hasAttribute(n, attributes, initialScope));
137
- }
138
- function hasEveryAttribute(names, attributes, initialScope) {
139
- return names.every((n) => hasAttribute(n, attributes, initialScope));
140
- }
141
-
142
- // src/element/is.ts
143
141
  function isHostElement(node) {
144
142
  return node.type === types.AST_NODE_TYPES.JSXElement && node.openingElement.name.type === types.AST_NODE_TYPES.JSXIdentifier && /^[a-z]/u.test(node.openingElement.name.name);
145
143
  }
package/dist/index.mjs CHANGED
@@ -92,6 +92,17 @@ function getAttributeValue(node, name, initialScope) {
92
92
  return { kind: "none", node, initialScope };
93
93
  }
94
94
  }
95
+
96
+ // src/attribute/has.ts
97
+ function hasAttribute(name, attributes, initialScope) {
98
+ return getAttribute(name, attributes, initialScope) != null;
99
+ }
100
+ function hasAnyAttribute(names, attributes, initialScope) {
101
+ return names.some((n) => hasAttribute(n, attributes, initialScope));
102
+ }
103
+ function hasEveryAttribute(names, attributes, initialScope) {
104
+ return names.every((n) => hasAttribute(n, attributes, initialScope));
105
+ }
95
106
  function findParentAttribute(node, test = constTrue) {
96
107
  const guard = (node2) => {
97
108
  return node2.type === AST_NODE_TYPES.JSXAttribute && test(node2);
@@ -104,19 +115,6 @@ function getElementType(node) {
104
115
  }
105
116
  return toString(node.openingElement.name);
106
117
  }
107
-
108
- // src/has-attribute.ts
109
- function hasAttribute(name, attributes, initialScope) {
110
- return getAttribute(name, attributes, initialScope) != null;
111
- }
112
- function hasAnyAttribute(names, attributes, initialScope) {
113
- return names.some((n) => hasAttribute(n, attributes, initialScope));
114
- }
115
- function hasEveryAttribute(names, attributes, initialScope) {
116
- return names.every((n) => hasAttribute(n, attributes, initialScope));
117
- }
118
-
119
- // src/element/is.ts
120
118
  function isHostElement(node) {
121
119
  return node.type === AST_NODE_TYPES.JSXElement && node.openingElement.name.type === AST_NODE_TYPES.JSXIdentifier && /^[a-z]/u.test(node.openingElement.name.name);
122
120
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eslint-react/jsx",
3
- "version": "1.40.4-next.6",
3
+ "version": "1.40.4",
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": {
@@ -39,9 +39,9 @@
39
39
  "@typescript-eslint/types": "^8.29.0",
40
40
  "@typescript-eslint/utils": "^8.29.0",
41
41
  "ts-pattern": "^5.7.0",
42
- "@eslint-react/var": "1.40.4-next.6",
43
- "@eslint-react/ast": "1.40.4-next.6",
44
- "@eslint-react/eff": "1.40.4-next.6"
42
+ "@eslint-react/ast": "1.40.4",
43
+ "@eslint-react/eff": "1.40.4",
44
+ "@eslint-react/var": "1.40.4"
45
45
  },
46
46
  "devDependencies": {
47
47
  "tsup": "^8.4.0",