@eslint-react/jsx 5.27.4 → 5.28.1

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.d.ts +6 -1
  2. package/package.json +5 -5
package/dist/index.d.ts CHANGED
@@ -182,7 +182,11 @@ export declare function getAttributeStaticValue(context: RuleContext, element: T
182
182
  /**
183
183
  * Get the meaningful children of a JSX element or fragment.
184
184
  *
185
- * Mirrors Babel's `buildChildren` helper:
185
+ * Similar to Babel's `buildChildren` helper, with two differences: only padding
186
+ * whitespace (whitespace containing a newline) is skipped, whereas Babel's
187
+ * `cleanJSXElementLiteralChild` drops all whitespace-only `JSXText`; and empty
188
+ * string expressions (`{""}`) are skipped as well, which follows React's
189
+ * rendering behavior rather than Babel's:
186
190
  * 1. Iterate over `element.children`.
187
191
  * 2. Skip `JSXText` nodes that clean to nothing (padding whitespace).
188
192
  * 3. Skip `JSXExpressionContainer` nodes whose expression is empty.
@@ -247,6 +251,7 @@ export declare function isFragmentElement(node: TSESTree.Node, jsxFragmentFactor
247
251
  /**
248
252
  * Check if the node is a host (intrinsic / DOM) element, that is, a `JSXElement`
249
253
  * whose tag name starts with a lowercase letter (ex: `<div>` vs `<MyComponent>`).
254
+ * For namespaced names, the local part is checked (ex: `rect` in `<svg:rect>`).
250
255
  * @param node The node to check.
251
256
  * @returns `true` if the node is a `JSXElement` with a lowercase tag name.
252
257
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eslint-react/jsx",
3
- "version": "5.27.4",
3
+ "version": "5.28.1",
4
4
  "description": "ESLint React's TSESTree JSX utility module for static analysis of JSX patterns.",
5
5
  "homepage": "https://github.com/Rel1cx/eslint-react",
6
6
  "bugs": {
@@ -29,9 +29,9 @@
29
29
  "dist"
30
30
  ],
31
31
  "dependencies": {
32
- "@eslint-react/ast": "5.27.4",
33
- "@eslint-react/eslint": "5.27.4",
34
- "@eslint-react/var": "5.27.4",
32
+ "@eslint-react/ast": "5.28.1",
33
+ "@eslint-react/eslint": "5.28.1",
34
+ "@eslint-react/var": "5.28.1",
35
35
  "@typescript-eslint/types": "^8.71.2",
36
36
  "@typescript-eslint/utils": "^8.71.2",
37
37
  "ts-pattern": "^5.9.2"
@@ -42,7 +42,7 @@
42
42
  "@local/testkit": "0.0.0",
43
43
  "@tsconfig/node20": "^20.1.10",
44
44
  "@types/node": "^20.19.43",
45
- "eslint": "^10.12.0",
45
+ "eslint": "^10.13.0",
46
46
  "tsdown": "^0.23.1",
47
47
  "typescript": "6.0.3"
48
48
  },