@elastic/eslint-plugin-eui 2.15.0 → 2.16.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.
Files changed (59) hide show
  1. package/README.md +125 -0
  2. package/lib/cjs/index.js +10 -1
  3. package/lib/cjs/rules/a11y/no_nested_copy_tooltip.d.ts +3 -0
  4. package/lib/cjs/rules/a11y/no_nested_copy_tooltip.d.ts.map +1 -0
  5. package/lib/cjs/rules/a11y/no_nested_copy_tooltip.js +84 -0
  6. package/lib/cjs/rules/a11y/tooltip_button_icon_wrap.d.ts.map +1 -1
  7. package/lib/cjs/rules/a11y/tooltip_button_icon_wrap.js +29 -1
  8. package/lib/cjs/rules/a11y/tooltip_no_interactive_content.d.ts.map +1 -1
  9. package/lib/cjs/rules/a11y/tooltip_no_interactive_content.js +17 -45
  10. package/lib/cjs/rules/button_group_no_invalid_children.d.ts +3 -0
  11. package/lib/cjs/rules/button_group_no_invalid_children.d.ts.map +1 -0
  12. package/lib/cjs/rules/button_group_no_invalid_children.js +159 -0
  13. package/lib/cjs/rules/callout_prefer_props_for_content.d.ts.map +1 -1
  14. package/lib/cjs/rules/callout_prefer_props_for_content.js +93 -156
  15. package/lib/cjs/rules/no_deprecated_icon_aliases.d.ts +174 -0
  16. package/lib/cjs/rules/no_deprecated_icon_aliases.d.ts.map +1 -0
  17. package/lib/cjs/rules/no_deprecated_icon_aliases.js +302 -0
  18. package/lib/cjs/utils/flat_map.d.ts +2 -0
  19. package/lib/cjs/utils/flat_map.d.ts.map +1 -0
  20. package/lib/cjs/utils/flat_map.js +24 -0
  21. package/lib/cjs/utils/has_meaningful_attr.d.ts +20 -0
  22. package/lib/cjs/utils/has_meaningful_attr.d.ts.map +1 -0
  23. package/lib/cjs/utils/has_meaningful_attr.js +61 -0
  24. package/lib/cjs/utils/is_fragment.d.ts +8 -0
  25. package/lib/cjs/utils/is_fragment.d.ts.map +1 -0
  26. package/lib/cjs/utils/is_fragment.js +26 -0
  27. package/lib/cjs/utils/walk_jsx_children.d.ts +30 -0
  28. package/lib/cjs/utils/walk_jsx_children.d.ts.map +1 -0
  29. package/lib/cjs/utils/walk_jsx_children.js +210 -0
  30. package/lib/esm/index.js +9 -0
  31. package/lib/esm/index.js.map +1 -1
  32. package/lib/esm/rules/a11y/no_nested_copy_tooltip.d.ts +2 -0
  33. package/lib/esm/rules/a11y/no_nested_copy_tooltip.js +84 -0
  34. package/lib/esm/rules/a11y/no_nested_copy_tooltip.js.map +1 -0
  35. package/lib/esm/rules/a11y/tooltip_button_icon_wrap.js +31 -0
  36. package/lib/esm/rules/a11y/tooltip_button_icon_wrap.js.map +1 -1
  37. package/lib/esm/rules/a11y/tooltip_no_interactive_content.js +19 -42
  38. package/lib/esm/rules/a11y/tooltip_no_interactive_content.js.map +1 -1
  39. package/lib/esm/rules/button_group_no_invalid_children.d.ts +2 -0
  40. package/lib/esm/rules/button_group_no_invalid_children.js +198 -0
  41. package/lib/esm/rules/button_group_no_invalid_children.js.map +1 -0
  42. package/lib/esm/rules/callout_prefer_props_for_content.js +75 -112
  43. package/lib/esm/rules/callout_prefer_props_for_content.js.map +1 -1
  44. package/lib/esm/rules/no_deprecated_icon_aliases.d.ts +173 -0
  45. package/lib/esm/rules/no_deprecated_icon_aliases.js +307 -0
  46. package/lib/esm/rules/no_deprecated_icon_aliases.js.map +1 -0
  47. package/lib/esm/utils/flat_map.d.ts +1 -0
  48. package/lib/esm/utils/flat_map.js +22 -0
  49. package/lib/esm/utils/flat_map.js.map +1 -0
  50. package/lib/esm/utils/has_meaningful_attr.d.ts +19 -0
  51. package/lib/esm/utils/has_meaningful_attr.js +55 -0
  52. package/lib/esm/utils/has_meaningful_attr.js.map +1 -0
  53. package/lib/esm/utils/is_fragment.d.ts +7 -0
  54. package/lib/esm/utils/is_fragment.js +26 -0
  55. package/lib/esm/utils/is_fragment.js.map +1 -0
  56. package/lib/esm/utils/walk_jsx_children.d.ts +29 -0
  57. package/lib/esm/utils/walk_jsx_children.js +213 -0
  58. package/lib/esm/utils/walk_jsx_children.js.map +1 -0
  59. package/package.json +1 -1
@@ -0,0 +1,307 @@
1
+ "use strict";
2
+ /*
3
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
4
+ * or more contributor license agreements. Licensed under the Elastic License
5
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
6
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
7
+ * Side Public License, v 1.
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.NoDeprecatedIconAliases = exports.DEPRECATED_ICONS_WITHOUT_REPLACEMENT = exports.DEPRECATED_ICON_ALIASES = void 0;
11
+ const utils_1 = require("@typescript-eslint/utils");
12
+ exports.DEPRECATED_ICON_ALIASES = {
13
+ alert: 'warning',
14
+ anomalyChart: 'chartAnomaly',
15
+ apmTrace: 'chartWaterfall',
16
+ arrowDown: 'chevronSingleDown',
17
+ arrowEnd: 'chevronLimitRight',
18
+ arrowLeft: 'chevronSingleLeft',
19
+ arrowRight: 'chevronSingleRight',
20
+ arrowStart: 'chevronLimitLeft',
21
+ arrowUp: 'chevronSingleUp',
22
+ beaker: 'flask',
23
+ boxesHorizontal: 'ellipsis',
24
+ boxesVertical: 'ellipsis',
25
+ changePointDetection: 'chartChangePoint',
26
+ checkInCircleFilled: 'checkCircleFill',
27
+ cheer: 'popper',
28
+ color: 'paintBucket',
29
+ compute: 'processor',
30
+ console: 'commandLine',
31
+ contrastHigh: 'contrastFill',
32
+ controlsHorizontal: 'controls',
33
+ controlsVertical: 'controls',
34
+ copyClipboard: 'copy',
35
+ crossInCircle: 'crossCircle',
36
+ crosshairs: 'crosshair',
37
+ currency: 'money',
38
+ cut: 'scissors',
39
+ desktop: 'display',
40
+ diff: 'compare',
41
+ discuss: 'comment',
42
+ documentEdit: 'pencil',
43
+ documents: 'document',
44
+ doubleArrowLeft: 'chevronDoubleLeft',
45
+ doubleArrowRight: 'chevronDoubleRight',
46
+ editorAlignCenter: 'textAlignCenter',
47
+ editorAlignLeft: 'textAlignLeft',
48
+ editorAlignRight: 'textAlignRight',
49
+ editorBold: 'textBold',
50
+ editorChecklist: 'listCheck',
51
+ editorCodeBlock: 'code',
52
+ editorComment: 'comment',
53
+ editorDistributeHorizontal: 'distributeHorizontal',
54
+ editorDistributeVertical: 'distributeVertical',
55
+ editorHeading: 'textHeading',
56
+ editorItalic: 'textItalic',
57
+ editorItemAlignBottom: 'alignBottom',
58
+ editorItemAlignCenter: 'alignCenterHorizontal',
59
+ editorItemAlignLeft: 'alignLeft',
60
+ editorItemAlignMiddle: 'alignCenterVertical',
61
+ editorItemAlignRight: 'alignRight',
62
+ editorItemAlignTop: 'alignTop',
63
+ editorLink: 'link',
64
+ editorOrderedList: 'listNumber',
65
+ editorPositionBottomLeft: 'alignBottomLeft',
66
+ editorPositionBottomRight: 'alignBottomRight',
67
+ editorPositionTopLeft: 'alignTopLeft',
68
+ editorPositionTopRight: 'alignTopRight',
69
+ editorRedo: 'redo',
70
+ editorStrike: 'textStrike',
71
+ editorTable: 'table',
72
+ editorUnderline: 'textUnderline',
73
+ editorUndo: 'undo',
74
+ editorUnorderedList: 'listBullet',
75
+ email: 'mail',
76
+ eql: 'query',
77
+ errorFilled: 'errorFill',
78
+ exit: 'logOut',
79
+ expand: 'maximize',
80
+ expandMini: 'maximize',
81
+ export: 'upload',
82
+ exportAction: 'upload',
83
+ eyeClosed: 'eyeSlash',
84
+ fieldStatistics: 'tableInfo',
85
+ filterInCircle: 'filter',
86
+ folderCheck: 'check',
87
+ folderOpened: 'folderOpen',
88
+ glasses: 'readOnly',
89
+ grab: 'dragVertical',
90
+ grabHorizontal: 'dragHorizontal',
91
+ grabOmnidirectional: 'drag',
92
+ heatmap: 'chartHeatmap',
93
+ importAction: 'download',
94
+ indexClose: 'tableCross',
95
+ indexEdit: 'tablePencil',
96
+ indexFlush: 'chartThreshold',
97
+ indexMapping: 'mapping',
98
+ indexOpen: 'tablePlus',
99
+ indexRuntime: 'tablePlay',
100
+ indexSettings: 'tableGear',
101
+ indexTemporary: 'tableTime',
102
+ invert: 'contrast',
103
+ kqlField: 'queryField',
104
+ kqlOperand: 'queryOperand',
105
+ kqlSelector: 'querySelector',
106
+ kqlValue: 'queryValue',
107
+ kubernetesPod: 'cube',
108
+ launch: 'rocket',
109
+ lettering: 'text',
110
+ lineDashed: 'lineDash',
111
+ lineDotted: 'lineDot',
112
+ list: 'listBullet',
113
+ listAdd: 'plusCircle',
114
+ logPatternAnalysis: 'pattern',
115
+ logRateAnalysis: 'chartBarVertical',
116
+ logstashIf: 'if',
117
+ logstashQueue: 'queue',
118
+ magnifyWithExclamation: 'magnifyExclamation',
119
+ magnifyWithMinus: 'magnifyMinus',
120
+ magnifyWithPlus: 'magnifyPlus',
121
+ mapMarker: 'waypoint',
122
+ minusInCircle: 'minusCircle',
123
+ minusInCircleFilled: 'minusCircle',
124
+ minusInSquare: 'minusSquare',
125
+ newChat: 'plusCircle',
126
+ node: 'vectorTriangle',
127
+ offline: 'wifiSlash',
128
+ online: 'wifi',
129
+ pagesSelect: 'documentsCheck',
130
+ pinFilled: 'pinFill',
131
+ pipeBreaks: 'lineBreak',
132
+ pipeNoBreaks: 'lineBreakSlash',
133
+ playFilled: 'play',
134
+ plusInCircle: 'plusCircle',
135
+ plusInCircleFilled: 'plusCircle',
136
+ plusInSquare: 'plusSquare',
137
+ popout: 'external',
138
+ productRobot: 'productAgent',
139
+ push: 'send',
140
+ returnKey: 'return',
141
+ search: 'magnify',
142
+ securitySignal: 'radar',
143
+ starEmpty: 'star',
144
+ starFilled: 'starFill',
145
+ starFilledSpace: 'starFillSpace',
146
+ starMinusFilled: 'starMinusFill',
147
+ starPlusFilled: 'starPlusFill',
148
+ stopFilled: 'stopFill',
149
+ streamsClassic: 'productStreamsClassic',
150
+ streamsWired: 'productStreamsWired',
151
+ submodule: 'merge',
152
+ tableDensityCompact: 'tableDensityHigh',
153
+ tableDensityExpanded: 'tableDensityLow',
154
+ tableDensityNormal: 'table',
155
+ temperature: 'thermometer',
156
+ timeRefresh: 'refreshTime',
157
+ timelineWithArrow: 'timelinePointer',
158
+ timeslider: 'clockControl',
159
+ tokenDenseVector: 'tokenVectorDense',
160
+ training: 'presentation',
161
+ unlink: 'linkSlash',
162
+ userAvatar: 'user',
163
+ vector: 'vectorSquare',
164
+ visArea: 'chartArea',
165
+ visAreaStacked: 'chartAreaStack',
166
+ visBarHorizontal: 'chartBarHorizontal',
167
+ visBarHorizontalStacked: 'chartBarHorizontalStack',
168
+ visBarVertical: 'chartBarVertical',
169
+ visBarVerticalStacked: 'chartBarVerticalStack',
170
+ visGauge: 'chartGauge',
171
+ visLine: 'chartLine',
172
+ visMapCoordinate: 'waypoint',
173
+ visMapRegion: 'map',
174
+ visMetric: 'chartMetric',
175
+ visPie: 'chartPie',
176
+ visTable: 'table',
177
+ visTagCloud: 'chartTagCloud',
178
+ visText: 'text',
179
+ visVega: 'code',
180
+ warningFilled: 'warningFill',
181
+ };
182
+ exports.DEPRECATED_ICONS_WITHOUT_REPLACEMENT = new Set(['mobile']);
183
+ const getComponentName = (node) => node.name.type === 'JSXIdentifier' ? node.name.name : undefined;
184
+ const COMPONENT_ICON_ATTRIBUTES = {
185
+ EuiCommentTimeline: new Set(['timelineAvatar']),
186
+ EuiFormAppend: new Set(['iconLeft', 'iconRight']),
187
+ EuiFormAppendPrepend: new Set(['iconLeft', 'iconRight']),
188
+ EuiFormPrepend: new Set(['iconLeft', 'iconRight']),
189
+ EuiLoadingLogo: new Set(['logo']),
190
+ EuiTimelineItem: new Set(['icon']),
191
+ };
192
+ const isIconAttribute = (attributeName, importedComponentName) => {
193
+ const normalizedName = attributeName.toLowerCase();
194
+ return (normalizedName.endsWith('icontype') ||
195
+ COMPONENT_ICON_ATTRIBUTES[importedComponentName]?.has(attributeName) ===
196
+ true ||
197
+ (normalizedName === 'type' &&
198
+ (importedComponentName === 'EuiIcon' ||
199
+ importedComponentName === 'EuiIconTip')));
200
+ };
201
+ const getStaticStringNode = (node) => {
202
+ if (node.value?.type === 'Literal' && typeof node.value.value === 'string') {
203
+ return node.value;
204
+ }
205
+ if (node.value?.type !== 'JSXExpressionContainer') {
206
+ return;
207
+ }
208
+ const { expression } = node.value;
209
+ if (expression.type === 'Literal' && typeof expression.value === 'string') {
210
+ return expression;
211
+ }
212
+ if (expression.type === 'TemplateLiteral' &&
213
+ expression.expressions.length === 0) {
214
+ return expression;
215
+ }
216
+ };
217
+ const getStaticStringValue = (node) => {
218
+ if (node.type === 'Literal') {
219
+ return typeof node.value === 'string' ? node.value : undefined;
220
+ }
221
+ return node.quasis[0]?.value.cooked ?? undefined;
222
+ };
223
+ const isDeprecatedIconAlias = (value) => value in exports.DEPRECATED_ICON_ALIASES;
224
+ exports.NoDeprecatedIconAliases = utils_1.ESLintUtils.RuleCreator.withoutDocs({
225
+ create(context) {
226
+ const euiComponentImports = new Map();
227
+ return {
228
+ ImportDeclaration(node) {
229
+ if (typeof node.source.value !== 'string' ||
230
+ (node.source.value !== '@elastic/eui' &&
231
+ !node.source.value.startsWith('@elastic/eui/'))) {
232
+ return;
233
+ }
234
+ for (const specifier of node.specifiers) {
235
+ if (specifier.type !== 'ImportSpecifier') {
236
+ continue;
237
+ }
238
+ const importedName = specifier.imported.type === 'Identifier'
239
+ ? specifier.imported.name
240
+ : specifier.imported.value;
241
+ if (importedName.startsWith('Eui')) {
242
+ euiComponentImports.set(specifier.local.name, importedName);
243
+ }
244
+ }
245
+ },
246
+ JSXAttribute(node) {
247
+ if (node.name.type !== 'JSXIdentifier') {
248
+ return;
249
+ }
250
+ const openingElement = node.parent;
251
+ const localComponentName = openingElement.type === 'JSXOpeningElement'
252
+ ? getComponentName(openingElement)
253
+ : undefined;
254
+ const importedComponentName = localComponentName
255
+ ? euiComponentImports.get(localComponentName)
256
+ : undefined;
257
+ if (!importedComponentName ||
258
+ !isIconAttribute(node.name.name, importedComponentName)) {
259
+ return;
260
+ }
261
+ const staticStringNode = getStaticStringNode(node);
262
+ if (!staticStringNode) {
263
+ return;
264
+ }
265
+ const iconType = getStaticStringValue(staticStringNode);
266
+ if (!iconType) {
267
+ return;
268
+ }
269
+ if (!isDeprecatedIconAlias(iconType)) {
270
+ if (exports.DEPRECATED_ICONS_WITHOUT_REPLACEMENT.has(iconType)) {
271
+ context.report({
272
+ node: staticStringNode,
273
+ messageId: 'deprecatedIcon',
274
+ data: { iconType },
275
+ });
276
+ }
277
+ return;
278
+ }
279
+ const replacement = exports.DEPRECATED_ICON_ALIASES[iconType];
280
+ context.report({
281
+ node: staticStringNode,
282
+ messageId: 'deprecatedIconAlias',
283
+ data: { alias: iconType, replacement },
284
+ fix(fixer) {
285
+ const sourceText = context.sourceCode.getText(staticStringNode);
286
+ const quote = sourceText[0];
287
+ return fixer.replaceText(staticStringNode, `${quote}${replacement}${quote}`);
288
+ },
289
+ });
290
+ },
291
+ };
292
+ },
293
+ meta: {
294
+ type: 'suggestion',
295
+ docs: {
296
+ description: 'Disallow deprecated EUI icons in JSX icon props.',
297
+ },
298
+ fixable: 'code',
299
+ schema: [],
300
+ messages: {
301
+ deprecatedIcon: 'Icon `{{iconType}}` is deprecated and has no direct replacement.',
302
+ deprecatedIconAlias: 'Icon alias `{{alias}}` is deprecated. Use `{{replacement}}` instead.',
303
+ },
304
+ },
305
+ defaultOptions: [],
306
+ });
307
+ //# sourceMappingURL=no_deprecated_icon_aliases.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"no_deprecated_icon_aliases.js","sourceRoot":"","sources":["../../../src/rules/no_deprecated_icon_aliases.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAEH,oDAAiE;AAEpD,QAAA,uBAAuB,GAAG;IACrC,KAAK,EAAE,SAAS;IAChB,YAAY,EAAE,cAAc;IAC5B,QAAQ,EAAE,gBAAgB;IAC1B,SAAS,EAAE,mBAAmB;IAC9B,QAAQ,EAAE,mBAAmB;IAC7B,SAAS,EAAE,mBAAmB;IAC9B,UAAU,EAAE,oBAAoB;IAChC,U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;wBAChE,MAAM,KAAK,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC;wBAE5B,OAAO,KAAK,CAAC,WAAW,CACtB,gBAAgB,EAChB,GAAG,KAAK,GAAG,WAAW,GAAG,KAAK,EAAE,CACjC,CAAC;oBACJ,CAAC;iBACF,CAAC,CAAC;YACL,CAAC;SACF,CAAC;IACJ,CAAC;IACD,IAAI,EAAE;QACJ,IAAI,EAAE,YAAY;QAClB,IAAI,EAAE;YACJ,WAAW,EAAE,kDAAkD;SAChE;QACD,OAAO,EAAE,MAAM;QACf,MAAM,EAAE,EAAE;QACV,QAAQ,EAAE;YACR,cAAc,EACZ,kEAAkE;YACpE,mBAAmB,EACjB,sEAAsE;SACzE;KACF;IACD,cAAc,EAAE,EAAE;CACnB,CAAC,CAAC"}
@@ -0,0 +1 @@
1
+ export declare function flatMap<T, U>(arr: readonly T[], fn: (item: T) => U[]): U[];
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ /*
3
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
4
+ * or more contributor license agreements. Licensed under the Elastic License
5
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
6
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
7
+ * Side Public License, v 1.
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.flatMap = flatMap;
11
+ // `Array.prototype.flatMap` requires ES2019 lib; this shim keeps rules that
12
+ // need it within the package's es5 lib setting without widening it for others.
13
+ function flatMap(arr, fn) {
14
+ const out = [];
15
+ for (const item of arr) {
16
+ const items = fn(item);
17
+ for (const i of items)
18
+ out.push(i);
19
+ }
20
+ return out;
21
+ }
22
+ //# sourceMappingURL=flat_map.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"flat_map.js","sourceRoot":"","sources":["../../../src/utils/flat_map.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;AAIH,0BAOC;AATD,4EAA4E;AAC5E,+EAA+E;AAC/E,SAAgB,OAAO,CAAO,GAAiB,EAAE,EAAoB;IACnE,MAAM,GAAG,GAAQ,EAAE,CAAC;IACpB,KAAK,MAAM,IAAI,IAAI,GAAG,EAAE,CAAC;QACvB,MAAM,KAAK,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC;QACvB,KAAK,MAAM,CAAC,IAAI,KAAK;YAAE,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACrC,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
@@ -0,0 +1,19 @@
1
+ import type { TSESTree } from '@typescript-eslint/utils';
2
+ /**
3
+ * Checks whether a JSX opening element has an attribute whose value is
4
+ * statically "meaningful" — present and not a statically-known empty/falsy
5
+ * value (`""`, `{''}`, `{0}`, `{false}`, `{null}`, `{undefined}`).
6
+ *
7
+ * Dynamic or otherwise non-statically-analyzable values (variables, JSX,
8
+ * template literals, calls, …) are treated as meaningful, since their runtime
9
+ * value is unknown. Boolean shorthand (`<El attr />`) is also meaningful.
10
+ *
11
+ * Useful for rules that must distinguish an attribute that actually renders
12
+ * something from one that is present but effectively empty.
13
+ *
14
+ * @param openingElement - The `JSXOpeningElement` node (ESTree).
15
+ * @param attrName - The attribute name to look up.
16
+ * @returns `true` if the attribute is present with a non-empty/non-falsy or
17
+ * dynamic value; otherwise `false`.
18
+ */
19
+ export declare function hasMeaningfulAttr(openingElement: TSESTree.JSXOpeningElement, attrName: string): boolean;
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+ /*
3
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
4
+ * or more contributor license agreements. Licensed under the Elastic License
5
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
6
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
7
+ * Side Public License, v 1.
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.hasMeaningfulAttr = hasMeaningfulAttr;
11
+ /**
12
+ * Checks whether a JSX opening element has an attribute whose value is
13
+ * statically "meaningful" — present and not a statically-known empty/falsy
14
+ * value (`""`, `{''}`, `{0}`, `{false}`, `{null}`, `{undefined}`).
15
+ *
16
+ * Dynamic or otherwise non-statically-analyzable values (variables, JSX,
17
+ * template literals, calls, …) are treated as meaningful, since their runtime
18
+ * value is unknown. Boolean shorthand (`<El attr />`) is also meaningful.
19
+ *
20
+ * Useful for rules that must distinguish an attribute that actually renders
21
+ * something from one that is present but effectively empty.
22
+ *
23
+ * @param openingElement - The `JSXOpeningElement` node (ESTree).
24
+ * @param attrName - The attribute name to look up.
25
+ * @returns `true` if the attribute is present with a non-empty/non-falsy or
26
+ * dynamic value; otherwise `false`.
27
+ */
28
+ function hasMeaningfulAttr(openingElement, attrName) {
29
+ const attr = openingElement.attributes.find((a) => a.type === 'JSXAttribute' &&
30
+ a.name.type === 'JSXIdentifier' &&
31
+ a.name.name === attrName);
32
+ if (!attr)
33
+ return false;
34
+ // Boolean shorthand: `<El attr />` → present and truthy.
35
+ if (attr.value == null)
36
+ return true;
37
+ // String literal: `attr="…"`.
38
+ if (attr.value.type === 'Literal') {
39
+ return Boolean(attr.value.value);
40
+ }
41
+ if (attr.value.type === 'JSXExpressionContainer') {
42
+ const { expression } = attr.value;
43
+ // Statically-known literals: `{''}`, `{0}`, `{false}`, `{null}`.
44
+ if (expression.type === 'Literal') {
45
+ return Boolean(expression.value);
46
+ }
47
+ // `{undefined}` (an identifier, not a literal).
48
+ if (expression.type === 'Identifier' && expression.name === 'undefined') {
49
+ return false;
50
+ }
51
+ }
52
+ // Dynamic / unknown value → treat as present.
53
+ return true;
54
+ }
55
+ //# sourceMappingURL=has_meaningful_attr.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"has_meaningful_attr.js","sourceRoot":"","sources":["../../../src/utils/has_meaningful_attr.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;AAqBH,8CAqCC;AAtDD;;;;;;;;;;;;;;;;GAgBG;AACH,SAAgB,iBAAiB,CAC/B,cAA0C,EAC1C,QAAgB;IAEhB,MAAM,IAAI,GAAG,cAAc,CAAC,UAAU,CAAC,IAAI,CACzC,CAAC,CAAC,EAA8B,EAAE,CAChC,CAAC,CAAC,IAAI,KAAK,cAAc;QACzB,CAAC,CAAC,IAAI,CAAC,IAAI,KAAK,eAAe;QAC/B,CAAC,CAAC,IAAI,CAAC,IAAI,KAAK,QAAQ,CAC3B,CAAC;IAEF,IAAI,CAAC,IAAI;QAAE,OAAO,KAAK,CAAC;IAExB,yDAAyD;IACzD,IAAI,IAAI,CAAC,KAAK,IAAI,IAAI;QAAE,OAAO,IAAI,CAAC;IAEpC,8BAA8B;IAC9B,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;QAClC,OAAO,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IACnC,CAAC;IAED,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,KAAK,wBAAwB,EAAE,CAAC;QACjD,MAAM,EAAE,UAAU,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC;QAElC,iEAAiE;QACjE,IAAI,UAAU,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;YAClC,OAAO,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;QACnC,CAAC;QAED,gDAAgD;QAChD,IAAI,UAAU,CAAC,IAAI,KAAK,YAAY,IAAI,UAAU,CAAC,IAAI,KAAK,WAAW,EAAE,CAAC;YACxE,OAAO,KAAK,CAAC;QACf,CAAC;IACH,CAAC;IAED,8CAA8C;IAC9C,OAAO,IAAI,CAAC;AACd,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { type TSESTree } from '@typescript-eslint/utils';
2
+ /**
3
+ * Returns true if the opening element is a React fragment: `<Fragment>` or
4
+ * `<React.Fragment>`. The `<>` shorthand is represented as a `JSXFragment`
5
+ * node (not a `JSXOpeningElement`) and is handled separately by callers.
6
+ */
7
+ export declare function isFragment(opening: TSESTree.JSXOpeningElement): boolean;
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ /*
3
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
4
+ * or more contributor license agreements. Licensed under the Elastic License
5
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
6
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
7
+ * Side Public License, v 1.
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.isFragment = isFragment;
11
+ /**
12
+ * Returns true if the opening element is a React fragment: `<Fragment>` or
13
+ * `<React.Fragment>`. The `<>` shorthand is represented as a `JSXFragment`
14
+ * node (not a `JSXOpeningElement`) and is handled separately by callers.
15
+ */
16
+ function isFragment(opening) {
17
+ const { name } = opening;
18
+ if (name.type === 'JSXIdentifier' && name.name === 'Fragment')
19
+ return true;
20
+ return (name.type === 'JSXMemberExpression' &&
21
+ name.object.type === 'JSXIdentifier' &&
22
+ name.object.name === 'React' &&
23
+ name.property.type === 'JSXIdentifier' &&
24
+ name.property.name === 'Fragment');
25
+ }
26
+ //# sourceMappingURL=is_fragment.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"is_fragment.js","sourceRoot":"","sources":["../../../src/utils/is_fragment.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;AASH,gCAUC;AAfD;;;;GAIG;AACH,SAAgB,UAAU,CAAC,OAAmC;IAC5D,MAAM,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC;IACzB,IAAI,IAAI,CAAC,IAAI,KAAK,eAAe,IAAI,IAAI,CAAC,IAAI,KAAK,UAAU;QAAE,OAAO,IAAI,CAAC;IAC3E,OAAO,CACL,IAAI,CAAC,IAAI,KAAK,qBAAqB;QACnC,IAAI,CAAC,MAAM,CAAC,IAAI,KAAK,eAAe;QACpC,IAAI,CAAC,MAAM,CAAC,IAAI,KAAK,OAAO;QAC5B,IAAI,CAAC,QAAQ,CAAC,IAAI,KAAK,eAAe;QACtC,IAAI,CAAC,QAAQ,CAAC,IAAI,KAAK,UAAU,CAClC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,29 @@
1
+ import { type TSESTree, type TSESLint } from '@typescript-eslint/utils';
2
+ /**
3
+ * Recursively walks JSX children, expanding structural nodes transparently
4
+ * and calling `visit` for each content node.
5
+ *
6
+ * Always expanded (structural nodes):
7
+ * - `<>...</>`, `<Fragment>`, `<React.Fragment>` (transparent grouping)
8
+ * - `{expr}` (JSXExpressionContainer)
9
+ * - `{a && b}`, `{a || b}`, `{a ?? b}` (LogicalExpression → both sides)
10
+ * - `{c ? a : b}` (ConditionalExpression → both branches)
11
+ * - `{[a, b]}` (ArrayExpression → each element)
12
+ * - `{(arg) => <El />}` (ArrowFunctionExpression)
13
+ * - `{arr.map(fn)}` (CallExpression `.map()` with arrow-fn callback)
14
+ *
15
+ * With `options.sourceCode`: Identifiers and local arrow-fn components are
16
+ * also expanded via scope lookup when resolvable.
17
+ *
18
+ * `options.shouldSkip` - when provided, called for each JSXElement reached
19
+ * (after fragment and local-component checks). Returning true skips the
20
+ * element itself and recurses into its children instead. Use this to make
21
+ * layout wrappers or non-interactive shells transparent to the visitor.
22
+ *
23
+ * `visit` is called for leaf nodes: JSXElement, JSXText, Literal,
24
+ * TemplateLiteral, MemberExpression.
25
+ */
26
+ export declare function walkJsxChildren(node: TSESTree.Node, visit: (node: TSESTree.Node) => void, options?: {
27
+ sourceCode?: TSESLint.SourceCode;
28
+ shouldSkip?: (el: TSESTree.JSXElement) => boolean;
29
+ }): void;