@elastic/eslint-plugin-eui 3.3.0 → 4.0.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.
- package/README.md +25 -5
- package/lib/cjs/index.js +3 -0
- package/lib/cjs/rules/no_deprecated_icon_aliases.d.ts +0 -137
- package/lib/cjs/rules/no_deprecated_icon_aliases.d.ts.map +1 -1
- package/lib/cjs/rules/no_deprecated_icon_aliases.js +35 -245
- package/lib/cjs/rules/no_removed_icons.d.ts +142 -0
- package/lib/cjs/rules/no_removed_icons.d.ts.map +1 -0
- package/lib/cjs/rules/no_removed_icons.js +189 -0
- package/lib/cjs/utils/icon_props.d.ts +10 -0
- package/lib/cjs/utils/icon_props.d.ts.map +1 -0
- package/lib/cjs/utils/icon_props.js +121 -0
- package/lib/esm/index.js +3 -0
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/rules/no_deprecated_icon_aliases.d.ts +0 -137
- package/lib/esm/rules/no_deprecated_icon_aliases.js +31 -254
- package/lib/esm/rules/no_deprecated_icon_aliases.js.map +1 -1
- package/lib/esm/rules/no_removed_icons.d.ts +141 -0
- package/lib/esm/rules/no_removed_icons.js +183 -0
- package/lib/esm/rules/no_removed_icons.js.map +1 -0
- package/lib/esm/utils/icon_props.d.ts +9 -0
- package/lib/esm/utils/icon_props.js +140 -0
- package/lib/esm/utils/icon_props.js.map +1 -0
- package/package.json +1 -1
|
@@ -2,88 +2,21 @@ import { ESLintUtils } from '@typescript-eslint/utils';
|
|
|
2
2
|
export declare const DEPRECATED_ICON_ALIASES: {
|
|
3
3
|
readonly alert: "warning";
|
|
4
4
|
readonly analyzeEvent: "cube";
|
|
5
|
-
readonly anomalyChart: "chartAnomaly";
|
|
6
5
|
readonly anomalySwimLane: "chartHeatmap";
|
|
7
6
|
readonly annotation: "flag";
|
|
8
7
|
readonly apps: "grid";
|
|
9
|
-
readonly apmTrace: "chartWaterfall";
|
|
10
|
-
readonly arrowDown: "chevronSingleDown";
|
|
11
|
-
readonly arrowEnd: "chevronLimitRight";
|
|
12
|
-
readonly arrowLeft: "chevronSingleLeft";
|
|
13
|
-
readonly arrowRight: "chevronSingleRight";
|
|
14
|
-
readonly arrowStart: "chevronLimitLeft";
|
|
15
|
-
readonly arrowUp: "chevronSingleUp";
|
|
16
|
-
readonly beaker: "flask";
|
|
17
|
-
readonly boxesHorizontal: "ellipsis";
|
|
18
8
|
readonly boxesVertical: "ellipsis";
|
|
19
|
-
readonly changePointDetection: "chartChangePoint";
|
|
20
|
-
readonly checkInCircleFilled: "checkCircleFill";
|
|
21
|
-
readonly cheer: "popper";
|
|
22
9
|
readonly cloudDrizzle: "cloudRain";
|
|
23
10
|
readonly cloudStormy: "cloudBolt";
|
|
24
11
|
readonly cloudSunny: "cloudSun";
|
|
25
|
-
readonly color: "paintBucket";
|
|
26
12
|
readonly compute: "processor";
|
|
27
|
-
readonly console: "commandLine";
|
|
28
13
|
readonly container: "package";
|
|
29
14
|
readonly continuityAbove: "upload";
|
|
30
15
|
readonly continuityWithin: "maximize";
|
|
31
|
-
readonly contrastHigh: "contrastFill";
|
|
32
|
-
readonly controlsHorizontal: "controls";
|
|
33
|
-
readonly controlsVertical: "controls";
|
|
34
|
-
readonly copyClipboard: "copy";
|
|
35
|
-
readonly crossInCircle: "crossCircle";
|
|
36
|
-
readonly crosshairs: "crosshair";
|
|
37
|
-
readonly currency: "money";
|
|
38
|
-
readonly cut: "scissors";
|
|
39
|
-
readonly desktop: "display";
|
|
40
|
-
readonly diff: "compare";
|
|
41
|
-
readonly discuss: "comment";
|
|
42
|
-
readonly documentEdit: "pencil";
|
|
43
16
|
readonly documents: "document";
|
|
44
|
-
readonly doubleArrowLeft: "chevronDoubleLeft";
|
|
45
|
-
readonly doubleArrowRight: "chevronDoubleRight";
|
|
46
|
-
readonly editorAlignCenter: "textAlignCenter";
|
|
47
|
-
readonly editorAlignLeft: "textAlignLeft";
|
|
48
|
-
readonly editorAlignRight: "textAlignRight";
|
|
49
|
-
readonly editorBold: "textBold";
|
|
50
|
-
readonly editorChecklist: "listCheck";
|
|
51
|
-
readonly editorCodeBlock: "code";
|
|
52
17
|
readonly editorComment: "comment";
|
|
53
|
-
readonly editorDistributeHorizontal: "distributeHorizontal";
|
|
54
|
-
readonly editorDistributeVertical: "distributeVertical";
|
|
55
|
-
readonly editorHeading: "textHeading";
|
|
56
|
-
readonly editorItalic: "textItalic";
|
|
57
|
-
readonly editorItemAlignBottom: "alignBottom";
|
|
58
|
-
readonly editorItemAlignCenter: "alignCenterHorizontal";
|
|
59
|
-
readonly editorItemAlignLeft: "alignLeft";
|
|
60
|
-
readonly editorItemAlignMiddle: "alignCenterVertical";
|
|
61
|
-
readonly editorItemAlignRight: "alignRight";
|
|
62
|
-
readonly editorItemAlignTop: "alignTop";
|
|
63
|
-
readonly editorLink: "link";
|
|
64
|
-
readonly editorOrderedList: "listNumber";
|
|
65
|
-
readonly editorPositionBottomLeft: "alignBottomLeft";
|
|
66
|
-
readonly editorPositionBottomRight: "alignBottomRight";
|
|
67
|
-
readonly editorPositionTopLeft: "alignTopLeft";
|
|
68
|
-
readonly editorPositionTopRight: "alignTopRight";
|
|
69
|
-
readonly editorRedo: "redo";
|
|
70
|
-
readonly editorStrike: "textStrike";
|
|
71
|
-
readonly editorTable: "table";
|
|
72
|
-
readonly editorUnderline: "textUnderline";
|
|
73
|
-
readonly editorUndo: "undo";
|
|
74
|
-
readonly editorUnorderedList: "listBullet";
|
|
75
|
-
readonly email: "mail";
|
|
76
|
-
readonly eql: "query";
|
|
77
18
|
readonly esqlVis: "query";
|
|
78
|
-
readonly errorFilled: "errorFill";
|
|
79
|
-
readonly exit: "logOut";
|
|
80
|
-
readonly expand: "maximize";
|
|
81
|
-
readonly expandMini: "maximize";
|
|
82
19
|
readonly export: "upload";
|
|
83
|
-
readonly exportAction: "upload";
|
|
84
|
-
readonly eyeClosed: "eyeSlash";
|
|
85
|
-
readonly fieldStatistics: "tableInfo";
|
|
86
|
-
readonly filterInCircle: "filter";
|
|
87
20
|
readonly fold: "minimize";
|
|
88
21
|
readonly folderCheck: "check";
|
|
89
22
|
readonly folderClose: "folder";
|
|
@@ -91,71 +24,29 @@ export declare const DEPRECATED_ICON_ALIASES: {
|
|
|
91
24
|
readonly folderOpened: "folderOpen";
|
|
92
25
|
readonly frameNext: "chevronSingleRight";
|
|
93
26
|
readonly framePrevious: "chevronSingleLeft";
|
|
94
|
-
readonly glasses: "readOnly";
|
|
95
27
|
readonly help: "question";
|
|
96
|
-
readonly grab: "dragVertical";
|
|
97
|
-
readonly grabHorizontal: "dragHorizontal";
|
|
98
|
-
readonly grabOmnidirectional: "drag";
|
|
99
|
-
readonly heatmap: "chartHeatmap";
|
|
100
|
-
readonly importAction: "download";
|
|
101
28
|
readonly index: "table";
|
|
102
29
|
readonly indexClose: "tableCross";
|
|
103
30
|
readonly ip: "tokenIP";
|
|
104
31
|
readonly indexEdit: "tablePencil";
|
|
105
|
-
readonly indexFlush: "chartThreshold";
|
|
106
|
-
readonly indexMapping: "mapping";
|
|
107
32
|
readonly indexOpen: "tablePlus";
|
|
108
33
|
readonly indexRuntime: "tablePlay";
|
|
109
34
|
readonly indexSettings: "tableGear";
|
|
110
|
-
readonly indexTemporary: "tableTime";
|
|
111
|
-
readonly invert: "contrast";
|
|
112
|
-
readonly kqlField: "queryField";
|
|
113
35
|
readonly kqlFunction: "push";
|
|
114
|
-
readonly kqlOperand: "queryOperand";
|
|
115
|
-
readonly kqlSelector: "querySelector";
|
|
116
|
-
readonly kqlValue: "queryValue";
|
|
117
36
|
readonly kubernetesPod: "cube";
|
|
118
|
-
readonly launch: "rocket";
|
|
119
|
-
readonly lettering: "text";
|
|
120
|
-
readonly lineDashed: "lineDash";
|
|
121
|
-
readonly lineDotted: "lineDot";
|
|
122
37
|
readonly list: "listBullet";
|
|
123
|
-
readonly listAdd: "plusCircle";
|
|
124
|
-
readonly logPatternAnalysis: "pattern";
|
|
125
38
|
readonly logRateAnalysis: "chartBarVertical";
|
|
126
39
|
readonly logstashFilter: "filter";
|
|
127
|
-
readonly logstashIf: "if";
|
|
128
40
|
readonly logstashInput: "download";
|
|
129
41
|
readonly logstashOutput: "upload";
|
|
130
|
-
readonly logstashQueue: "queue";
|
|
131
|
-
readonly magnifyWithExclamation: "magnifyExclamation";
|
|
132
|
-
readonly magnifyWithMinus: "magnifyMinus";
|
|
133
|
-
readonly magnifyWithPlus: "magnifyPlus";
|
|
134
42
|
readonly mapMarker: "waypoint";
|
|
135
43
|
readonly menuDown: "transitionBottomOut";
|
|
136
44
|
readonly menuUp: "transitionTopOut";
|
|
137
|
-
readonly minusInCircle: "minusCircle";
|
|
138
|
-
readonly minusInCircleFilled: "minusCircle";
|
|
139
|
-
readonly minusInSquare: "minusSquare";
|
|
140
45
|
readonly namespace: "kubernetesNamespace";
|
|
141
|
-
readonly newChat: "plusCircle";
|
|
142
|
-
readonly node: "vectorTriangle";
|
|
143
|
-
readonly offline: "wifiSlash";
|
|
144
|
-
readonly online: "wifi";
|
|
145
46
|
readonly pagesSelect: "documentsCheck";
|
|
146
47
|
readonly payment: "money";
|
|
147
48
|
readonly pinFilled: "pinFill";
|
|
148
|
-
readonly pipeBreaks: "lineBreak";
|
|
149
|
-
readonly pipeNoBreaks: "lineBreakSlash";
|
|
150
|
-
readonly playFilled: "play";
|
|
151
|
-
readonly plusInCircle: "plusCircle";
|
|
152
|
-
readonly plusInCircleFilled: "plusCircle";
|
|
153
|
-
readonly plusInSquare: "plusSquare";
|
|
154
|
-
readonly popout: "external";
|
|
155
|
-
readonly productRobot: "productAgent";
|
|
156
|
-
readonly returnKey: "return";
|
|
157
49
|
readonly search: "magnify";
|
|
158
|
-
readonly securitySignal: "radar";
|
|
159
50
|
readonly sessionViewer: "commandLine";
|
|
160
51
|
readonly singleMetricViewer: "chartArea";
|
|
161
52
|
readonly spaces: "grid";
|
|
@@ -163,53 +54,25 @@ export declare const DEPRECATED_ICON_ALIASES: {
|
|
|
163
54
|
readonly starEmptySpace: "star";
|
|
164
55
|
readonly starFillSpace: "starFill";
|
|
165
56
|
readonly starFilled: "starFill";
|
|
166
|
-
readonly starFilledSpace: "starFill";
|
|
167
57
|
readonly starMinusEmpty: "star";
|
|
168
58
|
readonly starMinusFill: "starFill";
|
|
169
|
-
readonly starMinusFilled: "starFill";
|
|
170
59
|
readonly starPlusEmpty: "star";
|
|
171
60
|
readonly starPlusFill: "starFill";
|
|
172
|
-
readonly starPlusFilled: "starFill";
|
|
173
|
-
readonly stopFilled: "stopFill";
|
|
174
61
|
readonly stats: "chartLine";
|
|
175
|
-
readonly streamsClassic: "productStreamsClassic";
|
|
176
|
-
readonly streamsWired: "productStreamsWired";
|
|
177
62
|
readonly string: "tokenString";
|
|
178
|
-
readonly submodule: "merge";
|
|
179
63
|
readonly tableOfContents: "listBullet";
|
|
180
|
-
readonly tableDensityCompact: "tableDensityHigh";
|
|
181
|
-
readonly tableDensityExpanded: "tableDensityLow";
|
|
182
|
-
readonly tableDensityNormal: "table";
|
|
183
64
|
readonly temperature: "thermometer";
|
|
184
|
-
readonly timeRefresh: "refreshTime";
|
|
185
65
|
readonly timelineWithArrow: "timelinePointer";
|
|
186
|
-
readonly timeslider: "clockControl";
|
|
187
|
-
readonly tokenDenseVector: "tokenVectorDense";
|
|
188
|
-
readonly training: "presentation";
|
|
189
66
|
readonly unfold: "maximize";
|
|
190
|
-
readonly unlink: "linkSlash";
|
|
191
|
-
readonly userAvatar: "user";
|
|
192
|
-
readonly vector: "vectorSquare";
|
|
193
67
|
readonly visArea: "chartArea";
|
|
194
|
-
readonly visAreaStacked: "chartAreaStack";
|
|
195
|
-
readonly visBarHorizontal: "chartBarHorizontal";
|
|
196
|
-
readonly visBarHorizontalStacked: "chartBarHorizontalStack";
|
|
197
68
|
readonly visBarVertical: "chartBarVertical";
|
|
198
|
-
readonly visBarVerticalStacked: "chartBarVerticalStack";
|
|
199
69
|
readonly visGauge: "chartGauge";
|
|
200
70
|
readonly visGoal: "chartGauge";
|
|
201
71
|
readonly visLine: "chartLine";
|
|
202
|
-
readonly visMapCoordinate: "waypoint";
|
|
203
|
-
readonly visMapRegion: "map";
|
|
204
|
-
readonly visMetric: "chartMetric";
|
|
205
72
|
readonly visPie: "chartPie";
|
|
206
73
|
readonly visTable: "table";
|
|
207
|
-
readonly visTagCloud: "chartTagCloud";
|
|
208
|
-
readonly visText: "text";
|
|
209
74
|
readonly visTimelion: "productTimelion";
|
|
210
|
-
readonly visVega: "code";
|
|
211
75
|
readonly visVisualBuilder: "productTSVB";
|
|
212
|
-
readonly warningFilled: "warningFill";
|
|
213
76
|
readonly wordWrap: "lineBreak";
|
|
214
77
|
readonly wordWrapDisabled: "lineBreakSlash";
|
|
215
78
|
};
|
|
@@ -9,91 +9,25 @@
|
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
10
|
exports.NoDeprecatedIconAliases = exports.DEPRECATED_ICONS_WITH_GUIDANCE = exports.DEPRECATED_ICONS_WITHOUT_REPLACEMENT = exports.DEPRECATED_ICON_ALIASES = void 0;
|
|
11
11
|
const utils_1 = require("@typescript-eslint/utils");
|
|
12
|
+
const icon_props_1 = require("../utils/icon_props");
|
|
12
13
|
exports.DEPRECATED_ICON_ALIASES = {
|
|
13
14
|
alert: 'warning',
|
|
14
15
|
analyzeEvent: 'cube',
|
|
15
|
-
anomalyChart: 'chartAnomaly',
|
|
16
16
|
anomalySwimLane: 'chartHeatmap',
|
|
17
17
|
annotation: 'flag',
|
|
18
18
|
apps: 'grid',
|
|
19
|
-
apmTrace: 'chartWaterfall',
|
|
20
|
-
arrowDown: 'chevronSingleDown',
|
|
21
|
-
arrowEnd: 'chevronLimitRight',
|
|
22
|
-
arrowLeft: 'chevronSingleLeft',
|
|
23
|
-
arrowRight: 'chevronSingleRight',
|
|
24
|
-
arrowStart: 'chevronLimitLeft',
|
|
25
|
-
arrowUp: 'chevronSingleUp',
|
|
26
|
-
beaker: 'flask',
|
|
27
|
-
boxesHorizontal: 'ellipsis',
|
|
28
19
|
boxesVertical: 'ellipsis',
|
|
29
|
-
changePointDetection: 'chartChangePoint',
|
|
30
|
-
checkInCircleFilled: 'checkCircleFill',
|
|
31
|
-
cheer: 'popper',
|
|
32
20
|
cloudDrizzle: 'cloudRain',
|
|
33
21
|
cloudStormy: 'cloudBolt',
|
|
34
22
|
cloudSunny: 'cloudSun',
|
|
35
|
-
color: 'paintBucket',
|
|
36
23
|
compute: 'processor',
|
|
37
|
-
console: 'commandLine',
|
|
38
24
|
container: 'package',
|
|
39
25
|
continuityAbove: 'upload',
|
|
40
26
|
continuityWithin: 'maximize',
|
|
41
|
-
contrastHigh: 'contrastFill',
|
|
42
|
-
controlsHorizontal: 'controls',
|
|
43
|
-
controlsVertical: 'controls',
|
|
44
|
-
copyClipboard: 'copy',
|
|
45
|
-
crossInCircle: 'crossCircle',
|
|
46
|
-
crosshairs: 'crosshair',
|
|
47
|
-
currency: 'money',
|
|
48
|
-
cut: 'scissors',
|
|
49
|
-
desktop: 'display',
|
|
50
|
-
diff: 'compare',
|
|
51
|
-
discuss: 'comment',
|
|
52
|
-
documentEdit: 'pencil',
|
|
53
27
|
documents: 'document',
|
|
54
|
-
doubleArrowLeft: 'chevronDoubleLeft',
|
|
55
|
-
doubleArrowRight: 'chevronDoubleRight',
|
|
56
|
-
editorAlignCenter: 'textAlignCenter',
|
|
57
|
-
editorAlignLeft: 'textAlignLeft',
|
|
58
|
-
editorAlignRight: 'textAlignRight',
|
|
59
|
-
editorBold: 'textBold',
|
|
60
|
-
editorChecklist: 'listCheck',
|
|
61
|
-
editorCodeBlock: 'code',
|
|
62
28
|
editorComment: 'comment',
|
|
63
|
-
editorDistributeHorizontal: 'distributeHorizontal',
|
|
64
|
-
editorDistributeVertical: 'distributeVertical',
|
|
65
|
-
editorHeading: 'textHeading',
|
|
66
|
-
editorItalic: 'textItalic',
|
|
67
|
-
editorItemAlignBottom: 'alignBottom',
|
|
68
|
-
editorItemAlignCenter: 'alignCenterHorizontal',
|
|
69
|
-
editorItemAlignLeft: 'alignLeft',
|
|
70
|
-
editorItemAlignMiddle: 'alignCenterVertical',
|
|
71
|
-
editorItemAlignRight: 'alignRight',
|
|
72
|
-
editorItemAlignTop: 'alignTop',
|
|
73
|
-
editorLink: 'link',
|
|
74
|
-
editorOrderedList: 'listNumber',
|
|
75
|
-
editorPositionBottomLeft: 'alignBottomLeft',
|
|
76
|
-
editorPositionBottomRight: 'alignBottomRight',
|
|
77
|
-
editorPositionTopLeft: 'alignTopLeft',
|
|
78
|
-
editorPositionTopRight: 'alignTopRight',
|
|
79
|
-
editorRedo: 'redo',
|
|
80
|
-
editorStrike: 'textStrike',
|
|
81
|
-
editorTable: 'table',
|
|
82
|
-
editorUnderline: 'textUnderline',
|
|
83
|
-
editorUndo: 'undo',
|
|
84
|
-
editorUnorderedList: 'listBullet',
|
|
85
|
-
email: 'mail',
|
|
86
|
-
eql: 'query',
|
|
87
29
|
esqlVis: 'query',
|
|
88
|
-
errorFilled: 'errorFill',
|
|
89
|
-
exit: 'logOut',
|
|
90
|
-
expand: 'maximize',
|
|
91
|
-
expandMini: 'maximize',
|
|
92
30
|
export: 'upload',
|
|
93
|
-
exportAction: 'upload',
|
|
94
|
-
eyeClosed: 'eyeSlash',
|
|
95
|
-
fieldStatistics: 'tableInfo',
|
|
96
|
-
filterInCircle: 'filter',
|
|
97
31
|
fold: 'minimize',
|
|
98
32
|
folderCheck: 'check',
|
|
99
33
|
folderClose: 'folder',
|
|
@@ -101,71 +35,29 @@ exports.DEPRECATED_ICON_ALIASES = {
|
|
|
101
35
|
folderOpened: 'folderOpen',
|
|
102
36
|
frameNext: 'chevronSingleRight',
|
|
103
37
|
framePrevious: 'chevronSingleLeft',
|
|
104
|
-
glasses: 'readOnly',
|
|
105
38
|
help: 'question',
|
|
106
|
-
grab: 'dragVertical',
|
|
107
|
-
grabHorizontal: 'dragHorizontal',
|
|
108
|
-
grabOmnidirectional: 'drag',
|
|
109
|
-
heatmap: 'chartHeatmap',
|
|
110
|
-
importAction: 'download',
|
|
111
39
|
index: 'table',
|
|
112
40
|
indexClose: 'tableCross',
|
|
113
41
|
ip: 'tokenIP',
|
|
114
42
|
indexEdit: 'tablePencil',
|
|
115
|
-
indexFlush: 'chartThreshold',
|
|
116
|
-
indexMapping: 'mapping',
|
|
117
43
|
indexOpen: 'tablePlus',
|
|
118
44
|
indexRuntime: 'tablePlay',
|
|
119
45
|
indexSettings: 'tableGear',
|
|
120
|
-
indexTemporary: 'tableTime',
|
|
121
|
-
invert: 'contrast',
|
|
122
|
-
kqlField: 'queryField',
|
|
123
46
|
kqlFunction: 'push',
|
|
124
|
-
kqlOperand: 'queryOperand',
|
|
125
|
-
kqlSelector: 'querySelector',
|
|
126
|
-
kqlValue: 'queryValue',
|
|
127
47
|
kubernetesPod: 'cube',
|
|
128
|
-
launch: 'rocket',
|
|
129
|
-
lettering: 'text',
|
|
130
|
-
lineDashed: 'lineDash',
|
|
131
|
-
lineDotted: 'lineDot',
|
|
132
48
|
list: 'listBullet',
|
|
133
|
-
listAdd: 'plusCircle',
|
|
134
|
-
logPatternAnalysis: 'pattern',
|
|
135
49
|
logRateAnalysis: 'chartBarVertical',
|
|
136
50
|
logstashFilter: 'filter',
|
|
137
|
-
logstashIf: 'if',
|
|
138
51
|
logstashInput: 'download',
|
|
139
52
|
logstashOutput: 'upload',
|
|
140
|
-
logstashQueue: 'queue',
|
|
141
|
-
magnifyWithExclamation: 'magnifyExclamation',
|
|
142
|
-
magnifyWithMinus: 'magnifyMinus',
|
|
143
|
-
magnifyWithPlus: 'magnifyPlus',
|
|
144
53
|
mapMarker: 'waypoint',
|
|
145
54
|
menuDown: 'transitionBottomOut',
|
|
146
55
|
menuUp: 'transitionTopOut',
|
|
147
|
-
minusInCircle: 'minusCircle',
|
|
148
|
-
minusInCircleFilled: 'minusCircle',
|
|
149
|
-
minusInSquare: 'minusSquare',
|
|
150
56
|
namespace: 'kubernetesNamespace',
|
|
151
|
-
newChat: 'plusCircle',
|
|
152
|
-
node: 'vectorTriangle',
|
|
153
|
-
offline: 'wifiSlash',
|
|
154
|
-
online: 'wifi',
|
|
155
57
|
pagesSelect: 'documentsCheck',
|
|
156
58
|
payment: 'money',
|
|
157
59
|
pinFilled: 'pinFill',
|
|
158
|
-
pipeBreaks: 'lineBreak',
|
|
159
|
-
pipeNoBreaks: 'lineBreakSlash',
|
|
160
|
-
playFilled: 'play',
|
|
161
|
-
plusInCircle: 'plusCircle',
|
|
162
|
-
plusInCircleFilled: 'plusCircle',
|
|
163
|
-
plusInSquare: 'plusSquare',
|
|
164
|
-
popout: 'external',
|
|
165
|
-
productRobot: 'productAgent',
|
|
166
|
-
returnKey: 'return',
|
|
167
60
|
search: 'magnify',
|
|
168
|
-
securitySignal: 'radar',
|
|
169
61
|
sessionViewer: 'commandLine',
|
|
170
62
|
singleMetricViewer: 'chartArea',
|
|
171
63
|
spaces: 'grid',
|
|
@@ -173,53 +65,25 @@ exports.DEPRECATED_ICON_ALIASES = {
|
|
|
173
65
|
starEmptySpace: 'star',
|
|
174
66
|
starFillSpace: 'starFill',
|
|
175
67
|
starFilled: 'starFill',
|
|
176
|
-
starFilledSpace: 'starFill',
|
|
177
68
|
starMinusEmpty: 'star',
|
|
178
69
|
starMinusFill: 'starFill',
|
|
179
|
-
starMinusFilled: 'starFill',
|
|
180
70
|
starPlusEmpty: 'star',
|
|
181
71
|
starPlusFill: 'starFill',
|
|
182
|
-
starPlusFilled: 'starFill',
|
|
183
|
-
stopFilled: 'stopFill',
|
|
184
72
|
stats: 'chartLine',
|
|
185
|
-
streamsClassic: 'productStreamsClassic',
|
|
186
|
-
streamsWired: 'productStreamsWired',
|
|
187
73
|
string: 'tokenString',
|
|
188
|
-
submodule: 'merge',
|
|
189
74
|
tableOfContents: 'listBullet',
|
|
190
|
-
tableDensityCompact: 'tableDensityHigh',
|
|
191
|
-
tableDensityExpanded: 'tableDensityLow',
|
|
192
|
-
tableDensityNormal: 'table',
|
|
193
75
|
temperature: 'thermometer',
|
|
194
|
-
timeRefresh: 'refreshTime',
|
|
195
76
|
timelineWithArrow: 'timelinePointer',
|
|
196
|
-
timeslider: 'clockControl',
|
|
197
|
-
tokenDenseVector: 'tokenVectorDense',
|
|
198
|
-
training: 'presentation',
|
|
199
77
|
unfold: 'maximize',
|
|
200
|
-
unlink: 'linkSlash',
|
|
201
|
-
userAvatar: 'user',
|
|
202
|
-
vector: 'vectorSquare',
|
|
203
78
|
visArea: 'chartArea',
|
|
204
|
-
visAreaStacked: 'chartAreaStack',
|
|
205
|
-
visBarHorizontal: 'chartBarHorizontal',
|
|
206
|
-
visBarHorizontalStacked: 'chartBarHorizontalStack',
|
|
207
79
|
visBarVertical: 'chartBarVertical',
|
|
208
|
-
visBarVerticalStacked: 'chartBarVerticalStack',
|
|
209
80
|
visGauge: 'chartGauge',
|
|
210
81
|
visGoal: 'chartGauge',
|
|
211
82
|
visLine: 'chartLine',
|
|
212
|
-
visMapCoordinate: 'waypoint',
|
|
213
|
-
visMapRegion: 'map',
|
|
214
|
-
visMetric: 'chartMetric',
|
|
215
83
|
visPie: 'chartPie',
|
|
216
84
|
visTable: 'table',
|
|
217
|
-
visTagCloud: 'chartTagCloud',
|
|
218
|
-
visText: 'text',
|
|
219
85
|
visTimelion: 'productTimelion',
|
|
220
|
-
visVega: 'code',
|
|
221
86
|
visVisualBuilder: 'productTSVB',
|
|
222
|
-
warningFilled: 'warningFill',
|
|
223
87
|
wordWrap: 'lineBreak',
|
|
224
88
|
wordWrapDisabled: 'lineBreakSlash',
|
|
225
89
|
};
|
|
@@ -236,132 +100,45 @@ exports.DEPRECATED_ICONS_WITH_GUIDANCE = {
|
|
|
236
100
|
stopFill: 'Use `EuiColorPickerSwatch` for a color chip or `stop` otherwise.',
|
|
237
101
|
stopSlash: 'Use `EuiColorPickerSwatch` for no/transparent color or `stop` otherwise.',
|
|
238
102
|
};
|
|
239
|
-
const isDeprecatedIconWithGuidance = (value) =>
|
|
240
|
-
const
|
|
241
|
-
const COMPONENT_ICON_ATTRIBUTES = {
|
|
242
|
-
EuiCommentTimeline: new Set(['timelineAvatar']),
|
|
243
|
-
EuiFormAppend: new Set(['iconLeft', 'iconRight']),
|
|
244
|
-
EuiFormAppendPrepend: new Set(['iconLeft', 'iconRight']),
|
|
245
|
-
EuiFormPrepend: new Set(['iconLeft', 'iconRight']),
|
|
246
|
-
EuiLoadingLogo: new Set(['logo']),
|
|
247
|
-
EuiTimelineItem: new Set(['icon']),
|
|
248
|
-
};
|
|
249
|
-
const isIconAttribute = (attributeName, importedComponentName) => {
|
|
250
|
-
const normalizedName = attributeName.toLowerCase();
|
|
251
|
-
return (normalizedName.endsWith('icontype') ||
|
|
252
|
-
COMPONENT_ICON_ATTRIBUTES[importedComponentName]?.has(attributeName) ===
|
|
253
|
-
true ||
|
|
254
|
-
(normalizedName === 'type' &&
|
|
255
|
-
(importedComponentName === 'EuiIcon' ||
|
|
256
|
-
importedComponentName === 'EuiIconTip')));
|
|
257
|
-
};
|
|
258
|
-
const getStaticStringNode = (node) => {
|
|
259
|
-
if (node.value?.type === 'Literal' && typeof node.value.value === 'string') {
|
|
260
|
-
return node.value;
|
|
261
|
-
}
|
|
262
|
-
if (node.value?.type !== 'JSXExpressionContainer') {
|
|
263
|
-
return;
|
|
264
|
-
}
|
|
265
|
-
const { expression } = node.value;
|
|
266
|
-
if (expression.type === 'Literal' && typeof expression.value === 'string') {
|
|
267
|
-
return expression;
|
|
268
|
-
}
|
|
269
|
-
if (expression.type === 'TemplateLiteral' &&
|
|
270
|
-
expression.expressions.length === 0) {
|
|
271
|
-
return expression;
|
|
272
|
-
}
|
|
273
|
-
};
|
|
274
|
-
const getStaticStringValue = (node) => {
|
|
275
|
-
if (node.type === 'Literal') {
|
|
276
|
-
return typeof node.value === 'string' ? node.value : undefined;
|
|
277
|
-
}
|
|
278
|
-
return node.quasis[0]?.value.cooked ?? undefined;
|
|
279
|
-
};
|
|
280
|
-
const isDeprecatedIconAlias = (value) => value in exports.DEPRECATED_ICON_ALIASES;
|
|
103
|
+
const isDeprecatedIconWithGuidance = (value) => Object.prototype.hasOwnProperty.call(exports.DEPRECATED_ICONS_WITH_GUIDANCE, value);
|
|
104
|
+
const isDeprecatedIconAlias = (value) => Object.prototype.hasOwnProperty.call(exports.DEPRECATED_ICON_ALIASES, value);
|
|
281
105
|
exports.NoDeprecatedIconAliases = utils_1.ESLintUtils.RuleCreator.withoutDocs({
|
|
282
106
|
create(context) {
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
}
|
|
295
|
-
const importedName = specifier.imported.type === 'Identifier'
|
|
296
|
-
? specifier.imported.name
|
|
297
|
-
: specifier.imported.value;
|
|
298
|
-
if (importedName.startsWith('Eui')) {
|
|
299
|
-
euiComponentImports.set(specifier.local.name, importedName);
|
|
300
|
-
}
|
|
301
|
-
}
|
|
302
|
-
},
|
|
303
|
-
JSXAttribute(node) {
|
|
304
|
-
if (node.name.type !== 'JSXIdentifier') {
|
|
107
|
+
return (0, icon_props_1.createIconPropVisitors)((node, iconType) => {
|
|
108
|
+
if (!isDeprecatedIconAlias(iconType)) {
|
|
109
|
+
if (isDeprecatedIconWithGuidance(iconType)) {
|
|
110
|
+
context.report({
|
|
111
|
+
node,
|
|
112
|
+
messageId: 'deprecatedIconGuidance',
|
|
113
|
+
data: {
|
|
114
|
+
iconType,
|
|
115
|
+
guidance: exports.DEPRECATED_ICONS_WITH_GUIDANCE[iconType],
|
|
116
|
+
},
|
|
117
|
+
});
|
|
305
118
|
return;
|
|
306
119
|
}
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
: undefined;
|
|
314
|
-
if (!importedComponentName ||
|
|
315
|
-
!isIconAttribute(node.name.name, importedComponentName)) {
|
|
316
|
-
return;
|
|
317
|
-
}
|
|
318
|
-
const staticStringNode = getStaticStringNode(node);
|
|
319
|
-
if (!staticStringNode) {
|
|
320
|
-
return;
|
|
321
|
-
}
|
|
322
|
-
const iconType = getStaticStringValue(staticStringNode);
|
|
323
|
-
if (!iconType) {
|
|
324
|
-
return;
|
|
325
|
-
}
|
|
326
|
-
if (!isDeprecatedIconAlias(iconType)) {
|
|
327
|
-
if (isDeprecatedIconWithGuidance(iconType)) {
|
|
328
|
-
context.report({
|
|
329
|
-
node: staticStringNode,
|
|
330
|
-
messageId: 'deprecatedIconGuidance',
|
|
331
|
-
data: {
|
|
332
|
-
iconType,
|
|
333
|
-
guidance: exports.DEPRECATED_ICONS_WITH_GUIDANCE[iconType],
|
|
334
|
-
},
|
|
335
|
-
});
|
|
336
|
-
return;
|
|
337
|
-
}
|
|
338
|
-
if (exports.DEPRECATED_ICONS_WITHOUT_REPLACEMENT.has(iconType)) {
|
|
339
|
-
context.report({
|
|
340
|
-
node: staticStringNode,
|
|
341
|
-
messageId: 'deprecatedIcon',
|
|
342
|
-
data: { iconType },
|
|
343
|
-
});
|
|
344
|
-
}
|
|
345
|
-
return;
|
|
120
|
+
if (exports.DEPRECATED_ICONS_WITHOUT_REPLACEMENT.has(iconType)) {
|
|
121
|
+
context.report({
|
|
122
|
+
node,
|
|
123
|
+
messageId: 'deprecatedIcon',
|
|
124
|
+
data: { iconType },
|
|
125
|
+
});
|
|
346
126
|
}
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
});
|
|
358
|
-
},
|
|
359
|
-
};
|
|
127
|
+
return;
|
|
128
|
+
}
|
|
129
|
+
const replacement = exports.DEPRECATED_ICON_ALIASES[iconType];
|
|
130
|
+
context.report({
|
|
131
|
+
node,
|
|
132
|
+
messageId: 'deprecatedIconAlias',
|
|
133
|
+
data: { alias: iconType, replacement },
|
|
134
|
+
fix: (fixer) => (0, icon_props_1.replaceIconString)(fixer, node, replacement),
|
|
135
|
+
});
|
|
136
|
+
});
|
|
360
137
|
},
|
|
361
138
|
meta: {
|
|
362
139
|
type: 'suggestion',
|
|
363
140
|
docs: {
|
|
364
|
-
description: 'Disallow deprecated EUI icons in
|
|
141
|
+
description: 'Disallow deprecated EUI icons in icon props.',
|
|
365
142
|
},
|
|
366
143
|
fixable: 'code',
|
|
367
144
|
schema: [],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"no_deprecated_icon_aliases.js","sourceRoot":"","sources":["../../../src/rules/no_deprecated_icon_aliases.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAEH,
|
|
1
|
+
{"version":3,"file":"no_deprecated_icon_aliases.js","sourceRoot":"","sources":["../../../src/rules/no_deprecated_icon_aliases.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAEH,oDAAuD;AACvD,oDAAgF;AAEnE,QAAA,uBAAuB,GAAG;IACrC,KAAK,EAAE,SAAS;IAChB,YAAY,EAAE,MAAM;IACpB,eAAe,EAAE,cAAc;IAC/B,UAAU,EAAE,MAAM;IAClB,IAAI,EAAE,MAAM;IACZ,aAAa,EAAE,UAAU;IACzB,YAAY,EAAE,WAAW;IACzB,WAAW,EAAE,WAAW;IACxB,UAAU,EAAE,UAAU;IACtB,OAAO,EAAE,WAAW;IACpB,SAAS,EAAE,SAAS;IACpB,eAAe,EAAE,QAAQ;IACzB,gBAAgB,EAAE,UAAU;IAC5B,SAAS,EAAE,UAAU;IACrB,aAAa,EAAE,SAAS;IACxB,OAAO,EAAE,OAAO;IAChB,MAAM,EAAE,QAAQ;IAChB,IAAI,EAAE,UAAU;IAChB,WAAW,EAAE,OAAO;IACpB,WAAW,EAAE,QAAQ;IACrB,YAAY,EAAE,QAAQ;IACtB,YAAY,EAAE,YAAY;IAC1B,SAAS,EAAE,oBAAoB;IAC/B,aAAa,EAAE,mBAAmB;IAClC,IAAI,EAAE,UAAU;IAChB,KAAK,EAAE,OAAO;IACd,UAA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