@atlaskit/eslint-plugin-design-system 13.14.2 → 13.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.
- package/CHANGELOG.md +24 -0
- package/README.md +2 -0
- package/dist/cjs/presets/all-flat.codegen.js +3 -1
- package/dist/cjs/presets/all.codegen.js +3 -1
- package/dist/cjs/presets/recommended-flat.codegen.js +2 -1
- package/dist/cjs/presets/recommended.codegen.js +2 -1
- package/dist/cjs/rules/ensure-proper-xcss-usage/index.js +157 -0
- package/dist/cjs/rules/index.codegen.js +5 -1
- package/dist/cjs/rules/no-legacy-icons/checks.js +22 -5
- package/dist/cjs/rules/no-legacy-icons/helpers.js +122 -46
- package/dist/cjs/rules/no-utility-icons/checks.js +233 -0
- package/dist/cjs/rules/no-utility-icons/index.js +40 -0
- package/dist/cjs/rules/utils/get-deprecated-config.js +1 -1
- package/dist/es2019/presets/all-flat.codegen.js +3 -1
- package/dist/es2019/presets/all.codegen.js +3 -1
- package/dist/es2019/presets/recommended-flat.codegen.js +2 -1
- package/dist/es2019/presets/recommended.codegen.js +2 -1
- package/dist/es2019/rules/ensure-proper-xcss-usage/index.js +149 -0
- package/dist/es2019/rules/index.codegen.js +5 -1
- package/dist/es2019/rules/no-legacy-icons/checks.js +22 -6
- package/dist/es2019/rules/no-legacy-icons/helpers.js +125 -44
- package/dist/es2019/rules/no-utility-icons/checks.js +164 -0
- package/dist/es2019/rules/no-utility-icons/index.js +35 -0
- package/dist/es2019/rules/utils/get-deprecated-config.js +3 -2
- package/dist/esm/presets/all-flat.codegen.js +3 -1
- package/dist/esm/presets/all.codegen.js +3 -1
- package/dist/esm/presets/recommended-flat.codegen.js +2 -1
- package/dist/esm/presets/recommended.codegen.js +2 -1
- package/dist/esm/rules/ensure-proper-xcss-usage/index.js +151 -0
- package/dist/esm/rules/index.codegen.js +5 -1
- package/dist/esm/rules/no-legacy-icons/checks.js +22 -5
- package/dist/esm/rules/no-legacy-icons/helpers.js +121 -45
- package/dist/esm/rules/no-utility-icons/checks.js +226 -0
- package/dist/esm/rules/no-utility-icons/index.js +34 -0
- package/dist/esm/rules/utils/get-deprecated-config.js +2 -2
- package/dist/types/index.codegen.d.ts +14 -0
- package/dist/types/presets/all-flat.codegen.d.ts +2 -0
- package/dist/types/presets/all.codegen.d.ts +2 -0
- package/dist/types/presets/recommended-flat.codegen.d.ts +1 -0
- package/dist/types/presets/recommended.codegen.d.ts +1 -0
- package/dist/types/rules/ensure-proper-xcss-usage/index.d.ts +3 -0
- package/dist/types/rules/index.codegen.d.ts +2 -0
- package/dist/types/rules/no-legacy-icons/helpers.d.ts +12 -4
- package/dist/types/rules/no-utility-icons/checks.d.ts +10 -0
- package/dist/types/rules/no-utility-icons/index.d.ts +3 -0
- package/dist/types/rules/use-tokens-typography/transformers/banned-properties.d.ts +1 -1
- package/dist/types/rules/use-tokens-typography/transformers/font-family.d.ts +1 -1
- package/dist/types/rules/use-tokens-typography/transformers/font-weight.d.ts +1 -1
- package/dist/types/rules/use-tokens-typography/transformers/restricted-capitalisation.d.ts +1 -1
- package/dist/types/rules/use-tokens-typography/transformers/untokenized-properties.d.ts +1 -1
- package/dist/types-ts4.5/index.codegen.d.ts +14 -0
- package/dist/types-ts4.5/presets/all-flat.codegen.d.ts +2 -0
- package/dist/types-ts4.5/presets/all.codegen.d.ts +2 -0
- package/dist/types-ts4.5/presets/recommended-flat.codegen.d.ts +1 -0
- package/dist/types-ts4.5/presets/recommended.codegen.d.ts +1 -0
- package/dist/types-ts4.5/rules/ensure-proper-xcss-usage/index.d.ts +3 -0
- package/dist/types-ts4.5/rules/index.codegen.d.ts +2 -0
- package/dist/types-ts4.5/rules/no-legacy-icons/helpers.d.ts +12 -4
- package/dist/types-ts4.5/rules/no-utility-icons/checks.d.ts +10 -0
- package/dist/types-ts4.5/rules/no-utility-icons/index.d.ts +3 -0
- package/dist/types-ts4.5/rules/use-tokens-typography/transformers/banned-properties.d.ts +1 -1
- package/dist/types-ts4.5/rules/use-tokens-typography/transformers/font-family.d.ts +1 -1
- package/dist/types-ts4.5/rules/use-tokens-typography/transformers/font-weight.d.ts +1 -1
- package/dist/types-ts4.5/rules/use-tokens-typography/transformers/restricted-capitalisation.d.ts +1 -1
- package/dist/types-ts4.5/rules/use-tokens-typography/transformers/untokenized-properties.d.ts +1 -1
- package/package.json +4 -4
|
@@ -19,6 +19,7 @@ export declare const plugin: {
|
|
|
19
19
|
'ensure-design-token-usage': import("eslint").Rule.RuleModule;
|
|
20
20
|
'ensure-design-token-usage/preview': import("eslint").Rule.RuleModule;
|
|
21
21
|
'ensure-icon-color': import("eslint").Rule.RuleModule;
|
|
22
|
+
'ensure-proper-xcss-usage': import("eslint").Rule.RuleModule;
|
|
22
23
|
'icon-label': import("eslint").Rule.RuleModule;
|
|
23
24
|
'no-banned-imports': import("eslint").Rule.RuleModule;
|
|
24
25
|
'no-boolean-autofocus-on-modal-dialog': import("eslint").Rule.RuleModule;
|
|
@@ -55,6 +56,7 @@ export declare const plugin: {
|
|
|
55
56
|
'no-unsafe-design-token-usage': import("eslint").Rule.RuleModule;
|
|
56
57
|
'no-unsafe-style-overrides': import("eslint").Rule.RuleModule;
|
|
57
58
|
'no-unsupported-drag-and-drop-libraries': import("eslint").Rule.RuleModule;
|
|
59
|
+
'no-utility-icons': import("eslint").Rule.RuleModule;
|
|
58
60
|
'prefer-primitives': import("eslint").Rule.RuleModule;
|
|
59
61
|
'use-button-group-label': import("eslint").Rule.RuleModule;
|
|
60
62
|
'use-cx-function-in-xcss': import("eslint").Rule.RuleModule;
|
|
@@ -85,6 +87,7 @@ export declare const plugin: {
|
|
|
85
87
|
'@atlaskit/design-system/ensure-design-token-usage': "error";
|
|
86
88
|
'@atlaskit/design-system/ensure-design-token-usage/preview': "warn";
|
|
87
89
|
'@atlaskit/design-system/ensure-icon-color': "error";
|
|
90
|
+
'@atlaskit/design-system/ensure-proper-xcss-usage': "error";
|
|
88
91
|
'@atlaskit/design-system/icon-label': "warn";
|
|
89
92
|
'@atlaskit/design-system/no-banned-imports': "error";
|
|
90
93
|
'@atlaskit/design-system/no-boolean-autofocus-on-modal-dialog': "warn";
|
|
@@ -120,6 +123,7 @@ export declare const plugin: {
|
|
|
120
123
|
'@atlaskit/design-system/no-unsafe-design-token-usage': "error";
|
|
121
124
|
'@atlaskit/design-system/no-unsafe-style-overrides': "warn";
|
|
122
125
|
'@atlaskit/design-system/no-unsupported-drag-and-drop-libraries': "error";
|
|
126
|
+
'@atlaskit/design-system/no-utility-icons': "warn";
|
|
123
127
|
'@atlaskit/design-system/prefer-primitives': "warn";
|
|
124
128
|
'@atlaskit/design-system/use-button-group-label': "warn";
|
|
125
129
|
'@atlaskit/design-system/use-cx-function-in-xcss': "error";
|
|
@@ -152,6 +156,7 @@ export declare const plugin: {
|
|
|
152
156
|
'@atlaskit/design-system/ensure-design-token-usage': "error";
|
|
153
157
|
'@atlaskit/design-system/ensure-design-token-usage/preview': "warn";
|
|
154
158
|
'@atlaskit/design-system/ensure-icon-color': "error";
|
|
159
|
+
'@atlaskit/design-system/ensure-proper-xcss-usage': "error";
|
|
155
160
|
'@atlaskit/design-system/icon-label': "warn";
|
|
156
161
|
'@atlaskit/design-system/no-banned-imports': "error";
|
|
157
162
|
'@atlaskit/design-system/no-boolean-autofocus-on-modal-dialog': "warn";
|
|
@@ -187,6 +192,7 @@ export declare const plugin: {
|
|
|
187
192
|
'@atlaskit/design-system/no-unsafe-design-token-usage': "error";
|
|
188
193
|
'@atlaskit/design-system/no-unsafe-style-overrides': "warn";
|
|
189
194
|
'@atlaskit/design-system/no-unsupported-drag-and-drop-libraries': "error";
|
|
195
|
+
'@atlaskit/design-system/no-utility-icons': "warn";
|
|
190
196
|
'@atlaskit/design-system/prefer-primitives': "warn";
|
|
191
197
|
'@atlaskit/design-system/use-button-group-label': "warn";
|
|
192
198
|
'@atlaskit/design-system/use-cx-function-in-xcss': "error";
|
|
@@ -241,6 +247,7 @@ export declare const plugin: {
|
|
|
241
247
|
'@atlaskit/design-system/no-unsafe-design-token-usage': "error";
|
|
242
248
|
'@atlaskit/design-system/no-unsafe-style-overrides': "warn";
|
|
243
249
|
'@atlaskit/design-system/no-unsupported-drag-and-drop-libraries': "error";
|
|
250
|
+
'@atlaskit/design-system/no-utility-icons': "warn";
|
|
244
251
|
'@atlaskit/design-system/use-button-group-label': "warn";
|
|
245
252
|
'@atlaskit/design-system/use-cx-function-in-xcss': "error";
|
|
246
253
|
'@atlaskit/design-system/use-datetime-picker-calendar-button': "warn";
|
|
@@ -291,6 +298,7 @@ export declare const plugin: {
|
|
|
291
298
|
'@atlaskit/design-system/no-unsafe-design-token-usage': "error";
|
|
292
299
|
'@atlaskit/design-system/no-unsafe-style-overrides': "warn";
|
|
293
300
|
'@atlaskit/design-system/no-unsupported-drag-and-drop-libraries': "error";
|
|
301
|
+
'@atlaskit/design-system/no-utility-icons': "warn";
|
|
294
302
|
'@atlaskit/design-system/use-button-group-label': "warn";
|
|
295
303
|
'@atlaskit/design-system/use-cx-function-in-xcss': "error";
|
|
296
304
|
'@atlaskit/design-system/use-datetime-picker-calendar-button': "warn";
|
|
@@ -318,6 +326,7 @@ declare const configs: {
|
|
|
318
326
|
'@atlaskit/design-system/ensure-design-token-usage': "error";
|
|
319
327
|
'@atlaskit/design-system/ensure-design-token-usage/preview': "warn";
|
|
320
328
|
'@atlaskit/design-system/ensure-icon-color': "error";
|
|
329
|
+
'@atlaskit/design-system/ensure-proper-xcss-usage': "error";
|
|
321
330
|
'@atlaskit/design-system/icon-label': "warn";
|
|
322
331
|
'@atlaskit/design-system/no-banned-imports': "error";
|
|
323
332
|
'@atlaskit/design-system/no-boolean-autofocus-on-modal-dialog': "warn";
|
|
@@ -353,6 +362,7 @@ declare const configs: {
|
|
|
353
362
|
'@atlaskit/design-system/no-unsafe-design-token-usage': "error";
|
|
354
363
|
'@atlaskit/design-system/no-unsafe-style-overrides': "warn";
|
|
355
364
|
'@atlaskit/design-system/no-unsupported-drag-and-drop-libraries': "error";
|
|
365
|
+
'@atlaskit/design-system/no-utility-icons': "warn";
|
|
356
366
|
'@atlaskit/design-system/prefer-primitives': "warn";
|
|
357
367
|
'@atlaskit/design-system/use-button-group-label': "warn";
|
|
358
368
|
'@atlaskit/design-system/use-cx-function-in-xcss': "error";
|
|
@@ -385,6 +395,7 @@ declare const configs: {
|
|
|
385
395
|
'@atlaskit/design-system/ensure-design-token-usage': "error";
|
|
386
396
|
'@atlaskit/design-system/ensure-design-token-usage/preview': "warn";
|
|
387
397
|
'@atlaskit/design-system/ensure-icon-color': "error";
|
|
398
|
+
'@atlaskit/design-system/ensure-proper-xcss-usage': "error";
|
|
388
399
|
'@atlaskit/design-system/icon-label': "warn";
|
|
389
400
|
'@atlaskit/design-system/no-banned-imports': "error";
|
|
390
401
|
'@atlaskit/design-system/no-boolean-autofocus-on-modal-dialog': "warn";
|
|
@@ -420,6 +431,7 @@ declare const configs: {
|
|
|
420
431
|
'@atlaskit/design-system/no-unsafe-design-token-usage': "error";
|
|
421
432
|
'@atlaskit/design-system/no-unsafe-style-overrides': "warn";
|
|
422
433
|
'@atlaskit/design-system/no-unsupported-drag-and-drop-libraries': "error";
|
|
434
|
+
'@atlaskit/design-system/no-utility-icons': "warn";
|
|
423
435
|
'@atlaskit/design-system/prefer-primitives': "warn";
|
|
424
436
|
'@atlaskit/design-system/use-button-group-label': "warn";
|
|
425
437
|
'@atlaskit/design-system/use-cx-function-in-xcss': "error";
|
|
@@ -474,6 +486,7 @@ declare const configs: {
|
|
|
474
486
|
'@atlaskit/design-system/no-unsafe-design-token-usage': "error";
|
|
475
487
|
'@atlaskit/design-system/no-unsafe-style-overrides': "warn";
|
|
476
488
|
'@atlaskit/design-system/no-unsupported-drag-and-drop-libraries': "error";
|
|
489
|
+
'@atlaskit/design-system/no-utility-icons': "warn";
|
|
477
490
|
'@atlaskit/design-system/use-button-group-label': "warn";
|
|
478
491
|
'@atlaskit/design-system/use-cx-function-in-xcss': "error";
|
|
479
492
|
'@atlaskit/design-system/use-datetime-picker-calendar-button': "warn";
|
|
@@ -524,6 +537,7 @@ declare const configs: {
|
|
|
524
537
|
'@atlaskit/design-system/no-unsafe-design-token-usage': "error";
|
|
525
538
|
'@atlaskit/design-system/no-unsafe-style-overrides': "warn";
|
|
526
539
|
'@atlaskit/design-system/no-unsupported-drag-and-drop-libraries': "error";
|
|
540
|
+
'@atlaskit/design-system/no-utility-icons': "warn";
|
|
527
541
|
'@atlaskit/design-system/use-button-group-label': "warn";
|
|
528
542
|
'@atlaskit/design-system/use-cx-function-in-xcss': "error";
|
|
529
543
|
'@atlaskit/design-system/use-datetime-picker-calendar-button': "warn";
|
|
@@ -5,6 +5,7 @@ declare const _default: {
|
|
|
5
5
|
'@atlaskit/design-system/ensure-design-token-usage': "error";
|
|
6
6
|
'@atlaskit/design-system/ensure-design-token-usage/preview': "warn";
|
|
7
7
|
'@atlaskit/design-system/ensure-icon-color': "error";
|
|
8
|
+
'@atlaskit/design-system/ensure-proper-xcss-usage': "error";
|
|
8
9
|
'@atlaskit/design-system/icon-label': "warn";
|
|
9
10
|
'@atlaskit/design-system/no-banned-imports': "error";
|
|
10
11
|
'@atlaskit/design-system/no-boolean-autofocus-on-modal-dialog': "warn";
|
|
@@ -40,6 +41,7 @@ declare const _default: {
|
|
|
40
41
|
'@atlaskit/design-system/no-unsafe-design-token-usage': "error";
|
|
41
42
|
'@atlaskit/design-system/no-unsafe-style-overrides': "warn";
|
|
42
43
|
'@atlaskit/design-system/no-unsupported-drag-and-drop-libraries': "error";
|
|
44
|
+
'@atlaskit/design-system/no-utility-icons': "warn";
|
|
43
45
|
'@atlaskit/design-system/prefer-primitives': "warn";
|
|
44
46
|
'@atlaskit/design-system/use-button-group-label': "warn";
|
|
45
47
|
'@atlaskit/design-system/use-cx-function-in-xcss': "error";
|
|
@@ -5,6 +5,7 @@ declare const _default: {
|
|
|
5
5
|
'@atlaskit/design-system/ensure-design-token-usage': "error";
|
|
6
6
|
'@atlaskit/design-system/ensure-design-token-usage/preview': "warn";
|
|
7
7
|
'@atlaskit/design-system/ensure-icon-color': "error";
|
|
8
|
+
'@atlaskit/design-system/ensure-proper-xcss-usage': "error";
|
|
8
9
|
'@atlaskit/design-system/icon-label': "warn";
|
|
9
10
|
'@atlaskit/design-system/no-banned-imports': "error";
|
|
10
11
|
'@atlaskit/design-system/no-boolean-autofocus-on-modal-dialog': "warn";
|
|
@@ -40,6 +41,7 @@ declare const _default: {
|
|
|
40
41
|
'@atlaskit/design-system/no-unsafe-design-token-usage': "error";
|
|
41
42
|
'@atlaskit/design-system/no-unsafe-style-overrides': "warn";
|
|
42
43
|
'@atlaskit/design-system/no-unsupported-drag-and-drop-libraries': "error";
|
|
44
|
+
'@atlaskit/design-system/no-utility-icons': "warn";
|
|
43
45
|
'@atlaskit/design-system/prefer-primitives': "warn";
|
|
44
46
|
'@atlaskit/design-system/use-button-group-label': "warn";
|
|
45
47
|
'@atlaskit/design-system/use-cx-function-in-xcss': "error";
|
|
@@ -29,6 +29,7 @@ declare const _default: {
|
|
|
29
29
|
'@atlaskit/design-system/no-unsafe-design-token-usage': "error";
|
|
30
30
|
'@atlaskit/design-system/no-unsafe-style-overrides': "warn";
|
|
31
31
|
'@atlaskit/design-system/no-unsupported-drag-and-drop-libraries': "error";
|
|
32
|
+
'@atlaskit/design-system/no-utility-icons': "warn";
|
|
32
33
|
'@atlaskit/design-system/use-button-group-label': "warn";
|
|
33
34
|
'@atlaskit/design-system/use-cx-function-in-xcss': "error";
|
|
34
35
|
'@atlaskit/design-system/use-datetime-picker-calendar-button': "warn";
|
|
@@ -29,6 +29,7 @@ declare const _default: {
|
|
|
29
29
|
'@atlaskit/design-system/no-unsafe-design-token-usage': "error";
|
|
30
30
|
'@atlaskit/design-system/no-unsafe-style-overrides': "warn";
|
|
31
31
|
'@atlaskit/design-system/no-unsupported-drag-and-drop-libraries': "error";
|
|
32
|
+
'@atlaskit/design-system/no-utility-icons': "warn";
|
|
32
33
|
'@atlaskit/design-system/use-button-group-label': "warn";
|
|
33
34
|
'@atlaskit/design-system/use-cx-function-in-xcss': "error";
|
|
34
35
|
'@atlaskit/design-system/use-datetime-picker-calendar-button': "warn";
|
|
@@ -3,6 +3,7 @@ export declare const rules: {
|
|
|
3
3
|
'ensure-design-token-usage': import("eslint").Rule.RuleModule;
|
|
4
4
|
'ensure-design-token-usage/preview': import("eslint").Rule.RuleModule;
|
|
5
5
|
'ensure-icon-color': import("eslint").Rule.RuleModule;
|
|
6
|
+
'ensure-proper-xcss-usage': import("eslint").Rule.RuleModule;
|
|
6
7
|
'icon-label': import("eslint").Rule.RuleModule;
|
|
7
8
|
'no-banned-imports': import("eslint").Rule.RuleModule;
|
|
8
9
|
'no-boolean-autofocus-on-modal-dialog': import("eslint").Rule.RuleModule;
|
|
@@ -39,6 +40,7 @@ export declare const rules: {
|
|
|
39
40
|
'no-unsafe-design-token-usage': import("eslint").Rule.RuleModule;
|
|
40
41
|
'no-unsafe-style-overrides': import("eslint").Rule.RuleModule;
|
|
41
42
|
'no-unsupported-drag-and-drop-libraries': import("eslint").Rule.RuleModule;
|
|
43
|
+
'no-utility-icons': import("eslint").Rule.RuleModule;
|
|
42
44
|
'prefer-primitives': import("eslint").Rule.RuleModule;
|
|
43
45
|
'use-button-group-label': import("eslint").Rule.RuleModule;
|
|
44
46
|
'use-cx-function-in-xcss': import("eslint").Rule.RuleModule;
|
|
@@ -49,6 +49,7 @@ export declare const getMigrationMapObject: (iconPackage: string) => {
|
|
|
49
49
|
type: string;
|
|
50
50
|
package: string;
|
|
51
51
|
isMigrationUnsafe?: boolean | undefined;
|
|
52
|
+
shouldForceSmallIcon?: boolean | undefined;
|
|
52
53
|
} | undefined;
|
|
53
54
|
additionalIcons?: {
|
|
54
55
|
name: string;
|
|
@@ -63,15 +64,16 @@ export declare const getUpcomingIcons: (iconPackage: string) => {
|
|
|
63
64
|
/**
|
|
64
65
|
* Checks if a new icon can be auto-migrated based on guidance from the migration map
|
|
65
66
|
*/
|
|
66
|
-
export declare const canAutoMigrateNewIconBasedOnSize: (guidance?:
|
|
67
|
+
export declare const canAutoMigrateNewIconBasedOnSize: (guidance?: IconMigrationSizeGuidance) => boolean;
|
|
67
68
|
/**
|
|
68
69
|
* Creates the written guidance for migrating a legacy icon to a new icon
|
|
69
70
|
*/
|
|
70
|
-
export declare const createGuidance: ({ iconPackage, insideNewButton, size, shouldUseMigrationPath, }: {
|
|
71
|
+
export declare const createGuidance: ({ iconPackage, insideNewButton, size: initialSize, shouldUseMigrationPath, shouldForceSmallIcon, }: {
|
|
71
72
|
iconPackage: string;
|
|
72
73
|
insideNewButton?: boolean | undefined;
|
|
73
74
|
size?: "small" | "medium" | "large" | "xlarge" | undefined;
|
|
74
75
|
shouldUseMigrationPath?: boolean | undefined;
|
|
76
|
+
shouldForceSmallIcon?: boolean | undefined;
|
|
75
77
|
}) => string;
|
|
76
78
|
/**
|
|
77
79
|
* Checks if the color can be migrated
|
|
@@ -88,13 +90,14 @@ export declare const createCantMigrateFunctionUnknownError: (node: Node, importS
|
|
|
88
90
|
export declare const createCantMigrateColorError: (node: Node, colorValue: string, errors: ErrorListManual, importSource: string, iconName: string) => void;
|
|
89
91
|
export declare const createCantMigrateSpreadPropsError: (node: Node, missingProps: string[], errors: ErrorListManual, importSource: string, iconName: string) => void;
|
|
90
92
|
export declare const createCantMigrateSizeUnknown: (node: Node, errors: ErrorListManual, importSource: string, iconName: string) => void;
|
|
91
|
-
export declare const createAutoMigrationError: ({ node, importSource, iconName, errors, spacing, insideNewButton, }: {
|
|
93
|
+
export declare const createAutoMigrationError: ({ node, importSource, iconName, errors, spacing, insideNewButton, shouldForceSmallIcon, }: {
|
|
92
94
|
node: Node;
|
|
93
95
|
importSource: string;
|
|
94
96
|
iconName: string;
|
|
95
97
|
errors: ErrorListAuto;
|
|
96
98
|
spacing?: string | undefined;
|
|
97
99
|
insideNewButton?: boolean | undefined;
|
|
100
|
+
shouldForceSmallIcon?: boolean | undefined;
|
|
98
101
|
}) => void;
|
|
99
102
|
export declare const createHelpers: (ctx: Rule.RuleContext) => {
|
|
100
103
|
/**
|
|
@@ -126,6 +129,7 @@ export declare const isInsideLegacyButton: (node: Rule.Node, legacyButtonImports
|
|
|
126
129
|
* @returns if Icon is inside a legacy button
|
|
127
130
|
*/
|
|
128
131
|
export declare const isInsideIconOnlyLegacyButton: (node: Rule.Node, legacyButtonImports: Set<string>) => boolean;
|
|
132
|
+
export declare const getComponentName: (name: string) => string;
|
|
129
133
|
export declare const throwManualErrors: ({ errorsManual, errorRanges, guidance, context, isQuietMode, }: {
|
|
130
134
|
errorsManual: ErrorListManual;
|
|
131
135
|
errorRanges: RangeList;
|
|
@@ -133,9 +137,13 @@ export declare const throwManualErrors: ({ errorsManual, errorRanges, guidance,
|
|
|
133
137
|
context: Rule.RuleContext;
|
|
134
138
|
isQuietMode: boolean;
|
|
135
139
|
}) => void;
|
|
136
|
-
export declare const throwAutoErrors: ({ errorsManual, errorsAuto, legacyIconImports, guidance, migrationIconImports, shouldUseMigrationPath, context, }: {
|
|
140
|
+
export declare const throwAutoErrors: ({ errorsManual, errorsAuto, iconSizesInfo, legacyIconImports, guidance, migrationIconImports, shouldUseMigrationPath, context, }: {
|
|
137
141
|
errorsManual: ErrorListManual;
|
|
138
142
|
errorsAuto: ErrorListAuto;
|
|
143
|
+
iconSizesInfo: Record<string, {
|
|
144
|
+
small: string[];
|
|
145
|
+
usageCount: number;
|
|
146
|
+
}>;
|
|
139
147
|
legacyIconImports: LegacyIconImportList;
|
|
140
148
|
guidance: GuidanceList;
|
|
141
149
|
migrationIconImports: MigrationIconImportList;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Rule } from 'eslint';
|
|
2
|
+
import { type Identifier, type ImportDeclaration } from 'eslint-codemod-utils';
|
|
3
|
+
type ReturnObject = {
|
|
4
|
+
checkImportDeclarations: (node: ImportDeclaration) => void;
|
|
5
|
+
checkJSXElement: (node: Rule.Node) => void;
|
|
6
|
+
checkIconReference: (node: Identifier & Rule.NodeParentExtension) => void;
|
|
7
|
+
throwErrors: () => void;
|
|
8
|
+
};
|
|
9
|
+
export declare const createChecks: (context: Rule.RuleContext) => ReturnObject;
|
|
10
|
+
export {};
|
|
@@ -19,6 +19,7 @@ export declare const plugin: {
|
|
|
19
19
|
'ensure-design-token-usage': import("eslint").Rule.RuleModule;
|
|
20
20
|
'ensure-design-token-usage/preview': import("eslint").Rule.RuleModule;
|
|
21
21
|
'ensure-icon-color': import("eslint").Rule.RuleModule;
|
|
22
|
+
'ensure-proper-xcss-usage': import("eslint").Rule.RuleModule;
|
|
22
23
|
'icon-label': import("eslint").Rule.RuleModule;
|
|
23
24
|
'no-banned-imports': import("eslint").Rule.RuleModule;
|
|
24
25
|
'no-boolean-autofocus-on-modal-dialog': import("eslint").Rule.RuleModule;
|
|
@@ -55,6 +56,7 @@ export declare const plugin: {
|
|
|
55
56
|
'no-unsafe-design-token-usage': import("eslint").Rule.RuleModule;
|
|
56
57
|
'no-unsafe-style-overrides': import("eslint").Rule.RuleModule;
|
|
57
58
|
'no-unsupported-drag-and-drop-libraries': import("eslint").Rule.RuleModule;
|
|
59
|
+
'no-utility-icons': import("eslint").Rule.RuleModule;
|
|
58
60
|
'prefer-primitives': import("eslint").Rule.RuleModule;
|
|
59
61
|
'use-button-group-label': import("eslint").Rule.RuleModule;
|
|
60
62
|
'use-cx-function-in-xcss': import("eslint").Rule.RuleModule;
|
|
@@ -85,6 +87,7 @@ export declare const plugin: {
|
|
|
85
87
|
'@atlaskit/design-system/ensure-design-token-usage': "error";
|
|
86
88
|
'@atlaskit/design-system/ensure-design-token-usage/preview': "warn";
|
|
87
89
|
'@atlaskit/design-system/ensure-icon-color': "error";
|
|
90
|
+
'@atlaskit/design-system/ensure-proper-xcss-usage': "error";
|
|
88
91
|
'@atlaskit/design-system/icon-label': "warn";
|
|
89
92
|
'@atlaskit/design-system/no-banned-imports': "error";
|
|
90
93
|
'@atlaskit/design-system/no-boolean-autofocus-on-modal-dialog': "warn";
|
|
@@ -123,6 +126,7 @@ export declare const plugin: {
|
|
|
123
126
|
'@atlaskit/design-system/no-unsafe-design-token-usage': "error";
|
|
124
127
|
'@atlaskit/design-system/no-unsafe-style-overrides': "warn";
|
|
125
128
|
'@atlaskit/design-system/no-unsupported-drag-and-drop-libraries': "error";
|
|
129
|
+
'@atlaskit/design-system/no-utility-icons': "warn";
|
|
126
130
|
'@atlaskit/design-system/prefer-primitives': "warn";
|
|
127
131
|
'@atlaskit/design-system/use-button-group-label': "warn";
|
|
128
132
|
'@atlaskit/design-system/use-cx-function-in-xcss': "error";
|
|
@@ -155,6 +159,7 @@ export declare const plugin: {
|
|
|
155
159
|
'@atlaskit/design-system/ensure-design-token-usage': "error";
|
|
156
160
|
'@atlaskit/design-system/ensure-design-token-usage/preview': "warn";
|
|
157
161
|
'@atlaskit/design-system/ensure-icon-color': "error";
|
|
162
|
+
'@atlaskit/design-system/ensure-proper-xcss-usage': "error";
|
|
158
163
|
'@atlaskit/design-system/icon-label': "warn";
|
|
159
164
|
'@atlaskit/design-system/no-banned-imports': "error";
|
|
160
165
|
'@atlaskit/design-system/no-boolean-autofocus-on-modal-dialog': "warn";
|
|
@@ -193,6 +198,7 @@ export declare const plugin: {
|
|
|
193
198
|
'@atlaskit/design-system/no-unsafe-design-token-usage': "error";
|
|
194
199
|
'@atlaskit/design-system/no-unsafe-style-overrides': "warn";
|
|
195
200
|
'@atlaskit/design-system/no-unsupported-drag-and-drop-libraries': "error";
|
|
201
|
+
'@atlaskit/design-system/no-utility-icons': "warn";
|
|
196
202
|
'@atlaskit/design-system/prefer-primitives': "warn";
|
|
197
203
|
'@atlaskit/design-system/use-button-group-label': "warn";
|
|
198
204
|
'@atlaskit/design-system/use-cx-function-in-xcss': "error";
|
|
@@ -250,6 +256,7 @@ export declare const plugin: {
|
|
|
250
256
|
'@atlaskit/design-system/no-unsafe-design-token-usage': "error";
|
|
251
257
|
'@atlaskit/design-system/no-unsafe-style-overrides': "warn";
|
|
252
258
|
'@atlaskit/design-system/no-unsupported-drag-and-drop-libraries': "error";
|
|
259
|
+
'@atlaskit/design-system/no-utility-icons': "warn";
|
|
253
260
|
'@atlaskit/design-system/use-button-group-label': "warn";
|
|
254
261
|
'@atlaskit/design-system/use-cx-function-in-xcss': "error";
|
|
255
262
|
'@atlaskit/design-system/use-datetime-picker-calendar-button': "warn";
|
|
@@ -303,6 +310,7 @@ export declare const plugin: {
|
|
|
303
310
|
'@atlaskit/design-system/no-unsafe-design-token-usage': "error";
|
|
304
311
|
'@atlaskit/design-system/no-unsafe-style-overrides': "warn";
|
|
305
312
|
'@atlaskit/design-system/no-unsupported-drag-and-drop-libraries': "error";
|
|
313
|
+
'@atlaskit/design-system/no-utility-icons': "warn";
|
|
306
314
|
'@atlaskit/design-system/use-button-group-label': "warn";
|
|
307
315
|
'@atlaskit/design-system/use-cx-function-in-xcss': "error";
|
|
308
316
|
'@atlaskit/design-system/use-datetime-picker-calendar-button': "warn";
|
|
@@ -330,6 +338,7 @@ declare const configs: {
|
|
|
330
338
|
'@atlaskit/design-system/ensure-design-token-usage': "error";
|
|
331
339
|
'@atlaskit/design-system/ensure-design-token-usage/preview': "warn";
|
|
332
340
|
'@atlaskit/design-system/ensure-icon-color': "error";
|
|
341
|
+
'@atlaskit/design-system/ensure-proper-xcss-usage': "error";
|
|
333
342
|
'@atlaskit/design-system/icon-label': "warn";
|
|
334
343
|
'@atlaskit/design-system/no-banned-imports': "error";
|
|
335
344
|
'@atlaskit/design-system/no-boolean-autofocus-on-modal-dialog': "warn";
|
|
@@ -368,6 +377,7 @@ declare const configs: {
|
|
|
368
377
|
'@atlaskit/design-system/no-unsafe-design-token-usage': "error";
|
|
369
378
|
'@atlaskit/design-system/no-unsafe-style-overrides': "warn";
|
|
370
379
|
'@atlaskit/design-system/no-unsupported-drag-and-drop-libraries': "error";
|
|
380
|
+
'@atlaskit/design-system/no-utility-icons': "warn";
|
|
371
381
|
'@atlaskit/design-system/prefer-primitives': "warn";
|
|
372
382
|
'@atlaskit/design-system/use-button-group-label': "warn";
|
|
373
383
|
'@atlaskit/design-system/use-cx-function-in-xcss': "error";
|
|
@@ -400,6 +410,7 @@ declare const configs: {
|
|
|
400
410
|
'@atlaskit/design-system/ensure-design-token-usage': "error";
|
|
401
411
|
'@atlaskit/design-system/ensure-design-token-usage/preview': "warn";
|
|
402
412
|
'@atlaskit/design-system/ensure-icon-color': "error";
|
|
413
|
+
'@atlaskit/design-system/ensure-proper-xcss-usage': "error";
|
|
403
414
|
'@atlaskit/design-system/icon-label': "warn";
|
|
404
415
|
'@atlaskit/design-system/no-banned-imports': "error";
|
|
405
416
|
'@atlaskit/design-system/no-boolean-autofocus-on-modal-dialog': "warn";
|
|
@@ -438,6 +449,7 @@ declare const configs: {
|
|
|
438
449
|
'@atlaskit/design-system/no-unsafe-design-token-usage': "error";
|
|
439
450
|
'@atlaskit/design-system/no-unsafe-style-overrides': "warn";
|
|
440
451
|
'@atlaskit/design-system/no-unsupported-drag-and-drop-libraries': "error";
|
|
452
|
+
'@atlaskit/design-system/no-utility-icons': "warn";
|
|
441
453
|
'@atlaskit/design-system/prefer-primitives': "warn";
|
|
442
454
|
'@atlaskit/design-system/use-button-group-label': "warn";
|
|
443
455
|
'@atlaskit/design-system/use-cx-function-in-xcss': "error";
|
|
@@ -495,6 +507,7 @@ declare const configs: {
|
|
|
495
507
|
'@atlaskit/design-system/no-unsafe-design-token-usage': "error";
|
|
496
508
|
'@atlaskit/design-system/no-unsafe-style-overrides': "warn";
|
|
497
509
|
'@atlaskit/design-system/no-unsupported-drag-and-drop-libraries': "error";
|
|
510
|
+
'@atlaskit/design-system/no-utility-icons': "warn";
|
|
498
511
|
'@atlaskit/design-system/use-button-group-label': "warn";
|
|
499
512
|
'@atlaskit/design-system/use-cx-function-in-xcss': "error";
|
|
500
513
|
'@atlaskit/design-system/use-datetime-picker-calendar-button': "warn";
|
|
@@ -548,6 +561,7 @@ declare const configs: {
|
|
|
548
561
|
'@atlaskit/design-system/no-unsafe-design-token-usage': "error";
|
|
549
562
|
'@atlaskit/design-system/no-unsafe-style-overrides': "warn";
|
|
550
563
|
'@atlaskit/design-system/no-unsupported-drag-and-drop-libraries': "error";
|
|
564
|
+
'@atlaskit/design-system/no-utility-icons': "warn";
|
|
551
565
|
'@atlaskit/design-system/use-button-group-label': "warn";
|
|
552
566
|
'@atlaskit/design-system/use-cx-function-in-xcss': "error";
|
|
553
567
|
'@atlaskit/design-system/use-datetime-picker-calendar-button': "warn";
|
|
@@ -5,6 +5,7 @@ declare const _default: {
|
|
|
5
5
|
'@atlaskit/design-system/ensure-design-token-usage': "error";
|
|
6
6
|
'@atlaskit/design-system/ensure-design-token-usage/preview': "warn";
|
|
7
7
|
'@atlaskit/design-system/ensure-icon-color': "error";
|
|
8
|
+
'@atlaskit/design-system/ensure-proper-xcss-usage': "error";
|
|
8
9
|
'@atlaskit/design-system/icon-label': "warn";
|
|
9
10
|
'@atlaskit/design-system/no-banned-imports': "error";
|
|
10
11
|
'@atlaskit/design-system/no-boolean-autofocus-on-modal-dialog': "warn";
|
|
@@ -43,6 +44,7 @@ declare const _default: {
|
|
|
43
44
|
'@atlaskit/design-system/no-unsafe-design-token-usage': "error";
|
|
44
45
|
'@atlaskit/design-system/no-unsafe-style-overrides': "warn";
|
|
45
46
|
'@atlaskit/design-system/no-unsupported-drag-and-drop-libraries': "error";
|
|
47
|
+
'@atlaskit/design-system/no-utility-icons': "warn";
|
|
46
48
|
'@atlaskit/design-system/prefer-primitives': "warn";
|
|
47
49
|
'@atlaskit/design-system/use-button-group-label': "warn";
|
|
48
50
|
'@atlaskit/design-system/use-cx-function-in-xcss': "error";
|
|
@@ -5,6 +5,7 @@ declare const _default: {
|
|
|
5
5
|
'@atlaskit/design-system/ensure-design-token-usage': "error";
|
|
6
6
|
'@atlaskit/design-system/ensure-design-token-usage/preview': "warn";
|
|
7
7
|
'@atlaskit/design-system/ensure-icon-color': "error";
|
|
8
|
+
'@atlaskit/design-system/ensure-proper-xcss-usage': "error";
|
|
8
9
|
'@atlaskit/design-system/icon-label': "warn";
|
|
9
10
|
'@atlaskit/design-system/no-banned-imports': "error";
|
|
10
11
|
'@atlaskit/design-system/no-boolean-autofocus-on-modal-dialog': "warn";
|
|
@@ -43,6 +44,7 @@ declare const _default: {
|
|
|
43
44
|
'@atlaskit/design-system/no-unsafe-design-token-usage': "error";
|
|
44
45
|
'@atlaskit/design-system/no-unsafe-style-overrides': "warn";
|
|
45
46
|
'@atlaskit/design-system/no-unsupported-drag-and-drop-libraries': "error";
|
|
47
|
+
'@atlaskit/design-system/no-utility-icons': "warn";
|
|
46
48
|
'@atlaskit/design-system/prefer-primitives': "warn";
|
|
47
49
|
'@atlaskit/design-system/use-button-group-label': "warn";
|
|
48
50
|
'@atlaskit/design-system/use-cx-function-in-xcss': "error";
|
|
@@ -32,6 +32,7 @@ declare const _default: {
|
|
|
32
32
|
'@atlaskit/design-system/no-unsafe-design-token-usage': "error";
|
|
33
33
|
'@atlaskit/design-system/no-unsafe-style-overrides': "warn";
|
|
34
34
|
'@atlaskit/design-system/no-unsupported-drag-and-drop-libraries': "error";
|
|
35
|
+
'@atlaskit/design-system/no-utility-icons': "warn";
|
|
35
36
|
'@atlaskit/design-system/use-button-group-label': "warn";
|
|
36
37
|
'@atlaskit/design-system/use-cx-function-in-xcss': "error";
|
|
37
38
|
'@atlaskit/design-system/use-datetime-picker-calendar-button': "warn";
|
|
@@ -32,6 +32,7 @@ declare const _default: {
|
|
|
32
32
|
'@atlaskit/design-system/no-unsafe-design-token-usage': "error";
|
|
33
33
|
'@atlaskit/design-system/no-unsafe-style-overrides': "warn";
|
|
34
34
|
'@atlaskit/design-system/no-unsupported-drag-and-drop-libraries': "error";
|
|
35
|
+
'@atlaskit/design-system/no-utility-icons': "warn";
|
|
35
36
|
'@atlaskit/design-system/use-button-group-label': "warn";
|
|
36
37
|
'@atlaskit/design-system/use-cx-function-in-xcss': "error";
|
|
37
38
|
'@atlaskit/design-system/use-datetime-picker-calendar-button': "warn";
|
|
@@ -3,6 +3,7 @@ export declare const rules: {
|
|
|
3
3
|
'ensure-design-token-usage': import("eslint").Rule.RuleModule;
|
|
4
4
|
'ensure-design-token-usage/preview': import("eslint").Rule.RuleModule;
|
|
5
5
|
'ensure-icon-color': import("eslint").Rule.RuleModule;
|
|
6
|
+
'ensure-proper-xcss-usage': import("eslint").Rule.RuleModule;
|
|
6
7
|
'icon-label': import("eslint").Rule.RuleModule;
|
|
7
8
|
'no-banned-imports': import("eslint").Rule.RuleModule;
|
|
8
9
|
'no-boolean-autofocus-on-modal-dialog': import("eslint").Rule.RuleModule;
|
|
@@ -39,6 +40,7 @@ export declare const rules: {
|
|
|
39
40
|
'no-unsafe-design-token-usage': import("eslint").Rule.RuleModule;
|
|
40
41
|
'no-unsafe-style-overrides': import("eslint").Rule.RuleModule;
|
|
41
42
|
'no-unsupported-drag-and-drop-libraries': import("eslint").Rule.RuleModule;
|
|
43
|
+
'no-utility-icons': import("eslint").Rule.RuleModule;
|
|
42
44
|
'prefer-primitives': import("eslint").Rule.RuleModule;
|
|
43
45
|
'use-button-group-label': import("eslint").Rule.RuleModule;
|
|
44
46
|
'use-cx-function-in-xcss': import("eslint").Rule.RuleModule;
|
|
@@ -54,6 +54,7 @@ export declare const getMigrationMapObject: (iconPackage: string) => {
|
|
|
54
54
|
type: string;
|
|
55
55
|
package: string;
|
|
56
56
|
isMigrationUnsafe?: boolean | undefined;
|
|
57
|
+
shouldForceSmallIcon?: boolean | undefined;
|
|
57
58
|
} | undefined;
|
|
58
59
|
additionalIcons?: {
|
|
59
60
|
name: string;
|
|
@@ -68,15 +69,16 @@ export declare const getUpcomingIcons: (iconPackage: string) => {
|
|
|
68
69
|
/**
|
|
69
70
|
* Checks if a new icon can be auto-migrated based on guidance from the migration map
|
|
70
71
|
*/
|
|
71
|
-
export declare const canAutoMigrateNewIconBasedOnSize: (guidance?:
|
|
72
|
+
export declare const canAutoMigrateNewIconBasedOnSize: (guidance?: IconMigrationSizeGuidance) => boolean;
|
|
72
73
|
/**
|
|
73
74
|
* Creates the written guidance for migrating a legacy icon to a new icon
|
|
74
75
|
*/
|
|
75
|
-
export declare const createGuidance: ({ iconPackage, insideNewButton, size, shouldUseMigrationPath, }: {
|
|
76
|
+
export declare const createGuidance: ({ iconPackage, insideNewButton, size: initialSize, shouldUseMigrationPath, shouldForceSmallIcon, }: {
|
|
76
77
|
iconPackage: string;
|
|
77
78
|
insideNewButton?: boolean | undefined;
|
|
78
79
|
size?: "small" | "medium" | "large" | "xlarge" | undefined;
|
|
79
80
|
shouldUseMigrationPath?: boolean | undefined;
|
|
81
|
+
shouldForceSmallIcon?: boolean | undefined;
|
|
80
82
|
}) => string;
|
|
81
83
|
/**
|
|
82
84
|
* Checks if the color can be migrated
|
|
@@ -93,13 +95,14 @@ export declare const createCantMigrateFunctionUnknownError: (node: Node, importS
|
|
|
93
95
|
export declare const createCantMigrateColorError: (node: Node, colorValue: string, errors: ErrorListManual, importSource: string, iconName: string) => void;
|
|
94
96
|
export declare const createCantMigrateSpreadPropsError: (node: Node, missingProps: string[], errors: ErrorListManual, importSource: string, iconName: string) => void;
|
|
95
97
|
export declare const createCantMigrateSizeUnknown: (node: Node, errors: ErrorListManual, importSource: string, iconName: string) => void;
|
|
96
|
-
export declare const createAutoMigrationError: ({ node, importSource, iconName, errors, spacing, insideNewButton, }: {
|
|
98
|
+
export declare const createAutoMigrationError: ({ node, importSource, iconName, errors, spacing, insideNewButton, shouldForceSmallIcon, }: {
|
|
97
99
|
node: Node;
|
|
98
100
|
importSource: string;
|
|
99
101
|
iconName: string;
|
|
100
102
|
errors: ErrorListAuto;
|
|
101
103
|
spacing?: string | undefined;
|
|
102
104
|
insideNewButton?: boolean | undefined;
|
|
105
|
+
shouldForceSmallIcon?: boolean | undefined;
|
|
103
106
|
}) => void;
|
|
104
107
|
export declare const createHelpers: (ctx: Rule.RuleContext) => {
|
|
105
108
|
/**
|
|
@@ -131,6 +134,7 @@ export declare const isInsideLegacyButton: (node: Rule.Node, legacyButtonImports
|
|
|
131
134
|
* @returns if Icon is inside a legacy button
|
|
132
135
|
*/
|
|
133
136
|
export declare const isInsideIconOnlyLegacyButton: (node: Rule.Node, legacyButtonImports: Set<string>) => boolean;
|
|
137
|
+
export declare const getComponentName: (name: string) => string;
|
|
134
138
|
export declare const throwManualErrors: ({ errorsManual, errorRanges, guidance, context, isQuietMode, }: {
|
|
135
139
|
errorsManual: ErrorListManual;
|
|
136
140
|
errorRanges: RangeList;
|
|
@@ -138,9 +142,13 @@ export declare const throwManualErrors: ({ errorsManual, errorRanges, guidance,
|
|
|
138
142
|
context: Rule.RuleContext;
|
|
139
143
|
isQuietMode: boolean;
|
|
140
144
|
}) => void;
|
|
141
|
-
export declare const throwAutoErrors: ({ errorsManual, errorsAuto, legacyIconImports, guidance, migrationIconImports, shouldUseMigrationPath, context, }: {
|
|
145
|
+
export declare const throwAutoErrors: ({ errorsManual, errorsAuto, iconSizesInfo, legacyIconImports, guidance, migrationIconImports, shouldUseMigrationPath, context, }: {
|
|
142
146
|
errorsManual: ErrorListManual;
|
|
143
147
|
errorsAuto: ErrorListAuto;
|
|
148
|
+
iconSizesInfo: Record<string, {
|
|
149
|
+
small: string[];
|
|
150
|
+
usageCount: number;
|
|
151
|
+
}>;
|
|
144
152
|
legacyIconImports: LegacyIconImportList;
|
|
145
153
|
guidance: GuidanceList;
|
|
146
154
|
migrationIconImports: MigrationIconImportList;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Rule } from 'eslint';
|
|
2
|
+
import { type Identifier, type ImportDeclaration } from 'eslint-codemod-utils';
|
|
3
|
+
type ReturnObject = {
|
|
4
|
+
checkImportDeclarations: (node: ImportDeclaration) => void;
|
|
5
|
+
checkJSXElement: (node: Rule.Node) => void;
|
|
6
|
+
checkIconReference: (node: Identifier & Rule.NodeParentExtension) => void;
|
|
7
|
+
throwErrors: () => void;
|
|
8
|
+
};
|
|
9
|
+
export declare const createChecks: (context: Rule.RuleContext) => ReturnObject;
|
|
10
|
+
export {};
|