@trackunit/eslint-plugin-trackunit 0.6.60 → 0.6.62
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/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,24 @@
|
|
|
1
|
+
## 0.6.62 (2026-07-13)
|
|
2
|
+
|
|
3
|
+
### 🩹 Fixes
|
|
4
|
+
|
|
5
|
+
- **eslint-plugin-trackunit:** stop require-list-item-virtualization-props false-positiving on nested <li>s in JSX attributes ([5f5191845f1](https://github.com/Trackunit/manager/commit/5f5191845f1))
|
|
6
|
+
|
|
7
|
+
### 🧱 Updated Dependencies
|
|
8
|
+
|
|
9
|
+
- Updated shared-utils to 1.15.62
|
|
10
|
+
|
|
11
|
+
### ❤️ Thank You
|
|
12
|
+
|
|
13
|
+
- Cursor @cursoragent
|
|
14
|
+
- Michael Buss Rønne
|
|
15
|
+
|
|
16
|
+
## 0.6.61 (2026-07-10)
|
|
17
|
+
|
|
18
|
+
### 🧱 Updated Dependencies
|
|
19
|
+
|
|
20
|
+
- Updated shared-utils to 1.15.61
|
|
21
|
+
|
|
1
22
|
## 0.6.60 (2026-07-09)
|
|
2
23
|
|
|
3
24
|
### 🧱 Updated Dependencies
|
package/package.json
CHANGED
|
@@ -60,6 +60,12 @@ const hasRequiredVirtualizationProps = (element, context) => {
|
|
|
60
60
|
// Check if all required props are present
|
|
61
61
|
return requiredProps.every(prop => propNames.has(prop));
|
|
62
62
|
};
|
|
63
|
+
/**
|
|
64
|
+
* Check if a JSXElement is opened with the given tag name
|
|
65
|
+
*/
|
|
66
|
+
const isJSXElementNamed = (element, name) => element.type === utils_1.AST_NODE_TYPES.JSXElement &&
|
|
67
|
+
element.openingElement.name.type === utils_1.AST_NODE_TYPES.JSXIdentifier &&
|
|
68
|
+
element.openingElement.name.name === name;
|
|
63
69
|
/**
|
|
64
70
|
* Check if we're inside a List component's render function
|
|
65
71
|
*/
|
|
@@ -67,11 +73,21 @@ const isInsideListRenderFunction = (node) => {
|
|
|
67
73
|
let current = node.parent;
|
|
68
74
|
while (current) {
|
|
69
75
|
// Look for JSX element named "List"
|
|
70
|
-
if (current
|
|
71
|
-
current.openingElement.name.type === utils_1.AST_NODE_TYPES.JSXIdentifier &&
|
|
72
|
-
current.openingElement.name.name === "List") {
|
|
76
|
+
if (isJSXElementNamed(current, "List")) {
|
|
73
77
|
return true;
|
|
74
78
|
}
|
|
79
|
+
// Once the walk enters a JSX attribute value, we've left the "rendered output" path and
|
|
80
|
+
// stepped into some element's prop (e.g. a Tooltip's `label` or a ListItem's `description`).
|
|
81
|
+
// Only keep walking if that attribute belongs to the <List> itself (e.g. its `children`
|
|
82
|
+
// render-prop is authored as an explicit attribute rather than JSX children) - otherwise any
|
|
83
|
+
// unrelated <li> nested arbitrarily deep inside a row's props (tooltip content, a nested
|
|
84
|
+
// list, ...) would be misidentified as the row's own virtualized list item.
|
|
85
|
+
if (current.type === utils_1.AST_NODE_TYPES.JSXAttribute) {
|
|
86
|
+
const owningElement = current.parent.parent;
|
|
87
|
+
if (!isJSXElementNamed(owningElement, "List")) {
|
|
88
|
+
return false;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
75
91
|
current = current.parent;
|
|
76
92
|
}
|
|
77
93
|
return false;
|