@blumintinc/eslint-plugin-blumint 1.19.3 → 1.19.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/lib/index.js +1 -1
- package/lib/rules/require-props-composition.js +15 -1
- package/package.json +1 -1
- package/release-manifest.json +14 -0
package/lib/index.js
CHANGED
|
@@ -46,6 +46,18 @@ const DEFAULT_EXCLUDED_COMPONENTS = new Set([
|
|
|
46
46
|
'React.StrictMode',
|
|
47
47
|
]);
|
|
48
48
|
const DEFAULT_TARGET_PATHS = ['src/components/**/*.tsx'];
|
|
49
|
+
/**
|
|
50
|
+
* Icon components (e.g. CheckIcon, RefreshIcon from @mui/icons-material) are
|
|
51
|
+
* decorative leaf elements — the same category as the layout/decorative
|
|
52
|
+
* primitives in DEFAULT_EXCLUDED_COMPONENTS. They expose no composable
|
|
53
|
+
* customization surface a parent should re-expose, so rendering one is never a
|
|
54
|
+
* composition dependency. Matched by the conventional `*Icon` suffix, which
|
|
55
|
+
* excludes CheckIcon/LinkIcon/RefreshIcon without touching interactive
|
|
56
|
+
* components like IconButton (issue #1307).
|
|
57
|
+
*/
|
|
58
|
+
function isDecorativeIcon(name) {
|
|
59
|
+
return /Icon$/.test(name);
|
|
60
|
+
}
|
|
49
61
|
/**
|
|
50
62
|
* Derives the expected Props type name for a JSX element name.
|
|
51
63
|
* e.g. "LoadingButton" → "LoadingButtonProps"
|
|
@@ -432,7 +444,9 @@ exports.requirePropsComposition = (0, createRule_1.createRule)({
|
|
|
432
444
|
const body = funcNode.body ?? funcNode;
|
|
433
445
|
const allJsxNames = collectJsxElementNames(body);
|
|
434
446
|
// Filter to non-excluded custom components
|
|
435
|
-
const depComponents = Array.from(allJsxNames).filter((name) => !excludeComponents.has(name) &&
|
|
447
|
+
const depComponents = Array.from(allJsxNames).filter((name) => !excludeComponents.has(name) &&
|
|
448
|
+
!isDecorativeIcon(name) &&
|
|
449
|
+
name !== componentName);
|
|
436
450
|
if (depComponents.length < minDependencyCount) {
|
|
437
451
|
return;
|
|
438
452
|
}
|
package/package.json
CHANGED
package/release-manifest.json
CHANGED
|
@@ -1,4 +1,18 @@
|
|
|
1
1
|
[
|
|
2
|
+
{
|
|
3
|
+
"version": "1.19.4",
|
|
4
|
+
"date": "2026-07-14T18:24:36.895Z",
|
|
5
|
+
"rules": [
|
|
6
|
+
{
|
|
7
|
+
"name": "require-props-composition",
|
|
8
|
+
"changeType": "fix",
|
|
9
|
+
"issues": [
|
|
10
|
+
1307
|
|
11
|
+
],
|
|
12
|
+
"summary": "exclude decorative *Icon leaf components (closes #1307)"
|
|
13
|
+
}
|
|
14
|
+
]
|
|
15
|
+
},
|
|
2
16
|
{
|
|
3
17
|
"version": "1.19.3",
|
|
4
18
|
"date": "2026-07-14T11:28:07.708Z",
|