@atlaskit/eslint-plugin-design-system 13.17.2 → 13.18.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 +18 -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/enforce-inline-styles-in-select/index.js +76 -0
- package/dist/cjs/rules/enforce-inline-styles-in-select/utils.js +231 -0
- package/dist/cjs/rules/index.codegen.js +5 -1
- package/dist/cjs/rules/no-nested-styles/index.js +27 -20
- package/dist/cjs/rules/no-utility-icons/checks.js +0 -1
- package/dist/cjs/rules/use-correct-field/index.js +167 -0
- 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/enforce-inline-styles-in-select/index.js +68 -0
- package/dist/es2019/rules/enforce-inline-styles-in-select/utils.js +217 -0
- package/dist/es2019/rules/index.codegen.js +5 -1
- package/dist/es2019/rules/no-nested-styles/index.js +27 -18
- package/dist/es2019/rules/no-utility-icons/checks.js +0 -1
- package/dist/es2019/rules/use-correct-field/index.js +153 -0
- 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/enforce-inline-styles-in-select/index.js +70 -0
- package/dist/esm/rules/enforce-inline-styles-in-select/utils.js +225 -0
- package/dist/esm/rules/index.codegen.js +5 -1
- package/dist/esm/rules/no-nested-styles/index.js +27 -20
- package/dist/esm/rules/no-utility-icons/checks.js +0 -1
- package/dist/esm/rules/use-correct-field/index.js +161 -0
- 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/enforce-inline-styles-in-select/index.d.ts +3 -0
- package/dist/types/rules/enforce-inline-styles-in-select/utils.d.ts +2 -0
- package/dist/types/rules/index.codegen.d.ts +2 -0
- package/dist/types/rules/use-correct-field/index.d.ts +5 -0
- 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/enforce-inline-styles-in-select/index.d.ts +3 -0
- package/dist/types-ts4.5/rules/enforce-inline-styles-in-select/utils.d.ts +2 -0
- package/dist/types-ts4.5/rules/index.codegen.d.ts +2 -0
- package/dist/types-ts4.5/rules/use-correct-field/index.d.ts +5 -0
- package/package.json +6 -7
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import { isNodeOfType } from 'eslint-codemod-utils';
|
|
2
|
+
import { createLintRule } from '../utils/create-rule';
|
|
3
|
+
var specialFieldsByImport = {
|
|
4
|
+
'@atlaskit/checkbox': {
|
|
5
|
+
component: 'Checkbox',
|
|
6
|
+
field: 'CheckboxField',
|
|
7
|
+
local: undefined
|
|
8
|
+
},
|
|
9
|
+
'@atlaskit/range': {
|
|
10
|
+
component: 'Range',
|
|
11
|
+
field: 'RangeField',
|
|
12
|
+
local: undefined
|
|
13
|
+
},
|
|
14
|
+
'@atlaskit/toggle': {
|
|
15
|
+
component: 'Toggle',
|
|
16
|
+
field: 'CheckboxField',
|
|
17
|
+
local: undefined
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
export var useCheckboxFieldMessage = 'Convert Field to CheckboxField';
|
|
21
|
+
export var useRangeFieldMessage = 'Convert Field to RangeField';
|
|
22
|
+
var rule = createLintRule({
|
|
23
|
+
meta: {
|
|
24
|
+
name: 'use-correct-field',
|
|
25
|
+
type: 'suggestion',
|
|
26
|
+
fixable: 'code',
|
|
27
|
+
hasSuggestions: true,
|
|
28
|
+
docs: {
|
|
29
|
+
description: 'Ensure makers use appropriate field component for their respective form elements.',
|
|
30
|
+
recommended: true,
|
|
31
|
+
severity: 'warn'
|
|
32
|
+
},
|
|
33
|
+
messages: {
|
|
34
|
+
useCheckboxField: 'Checkbox components should use the `CheckboxField` component',
|
|
35
|
+
useRangeField: 'Range components should use the `RangeField` component',
|
|
36
|
+
useCheckboxFieldForToggle: 'Toggle components should use the `CheckboxField` component'
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
create: function create(context) {
|
|
40
|
+
var fieldImport;
|
|
41
|
+
var allPackages = [];
|
|
42
|
+
return {
|
|
43
|
+
ImportDeclaration: function ImportDeclaration(node) {
|
|
44
|
+
var source = node.source.value;
|
|
45
|
+
if (typeof source !== 'string') {
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
if (!node.specifiers.length) {
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
var defaultImport = node.specifiers.filter(function (spec) {
|
|
52
|
+
return isNodeOfType(spec, 'ImportDefaultSpecifier');
|
|
53
|
+
});
|
|
54
|
+
if (source in specialFieldsByImport) {
|
|
55
|
+
allPackages.push(node);
|
|
56
|
+
// set local to local value
|
|
57
|
+
if (defaultImport.length && isNodeOfType(defaultImport[0], 'ImportDefaultSpecifier') && isNodeOfType(defaultImport[0].local, 'Identifier')) {
|
|
58
|
+
specialFieldsByImport[source].local = defaultImport[0].local.name;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
if ('@atlaskit/form' !== source) {
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
var namedImport = node.specifiers.filter(function (spec) {
|
|
65
|
+
return isNodeOfType(spec, 'ImportSpecifier');
|
|
66
|
+
});
|
|
67
|
+
if (namedImport.length && namedImport[0].type === 'ImportSpecifier' && namedImport[0].imported.name === 'Field') {
|
|
68
|
+
fieldImport = namedImport[0].local;
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
JSXElement: function JSXElement(node) {
|
|
72
|
+
if (!isNodeOfType(node, 'JSXElement')) {
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
if (!isNodeOfType(node.openingElement.name, 'JSXIdentifier')) {
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
var name = node.openingElement.name.name;
|
|
79
|
+
|
|
80
|
+
// if it's not a field import, skip
|
|
81
|
+
if (!fieldImport || name !== fieldImport.name) {
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
// If no imports are for the inputs that have special fields, exit early
|
|
86
|
+
if (allPackages.every(function (n) {
|
|
87
|
+
return typeof n.source.value !== 'string' || !Object.keys(specialFieldsByImport).includes(n.source.value);
|
|
88
|
+
})) {
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
var fieldRenderProp = node.children.find(function (c) {
|
|
92
|
+
return isNodeOfType(c, 'JSXExpressionContainer');
|
|
93
|
+
});
|
|
94
|
+
if (!fieldRenderProp) {
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
// I'm not early exiting because it doesn't work with ts for some reason
|
|
98
|
+
if (isNodeOfType(fieldRenderProp, 'JSXExpressionContainer')) {
|
|
99
|
+
if (!isNodeOfType(fieldRenderProp.expression, 'ArrowFunctionExpression')) {
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
var q = [fieldRenderProp.expression.body];
|
|
103
|
+
var found;
|
|
104
|
+
while (q.length > 0 && !found) {
|
|
105
|
+
var child = q.pop();
|
|
106
|
+
if (!isNodeOfType(child, 'JSXElement') || !isNodeOfType(child.openingElement.name, 'JSXIdentifier')) {
|
|
107
|
+
continue;
|
|
108
|
+
}
|
|
109
|
+
var elementName = child.openingElement.name.name;
|
|
110
|
+
for (var importName in specialFieldsByImport) {
|
|
111
|
+
// if this child is one of the found component names
|
|
112
|
+
// then break out of the while loop and use the found object
|
|
113
|
+
var localName = specialFieldsByImport[importName].local;
|
|
114
|
+
if (localName === elementName) {
|
|
115
|
+
found = specialFieldsByImport[importName].component;
|
|
116
|
+
break;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
if (!found) {
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
// if checkbox is inside of the field's render prop
|
|
125
|
+
if (found === 'Checkbox' || found === 'Toggle') {
|
|
126
|
+
context.report({
|
|
127
|
+
node: node,
|
|
128
|
+
messageId: found === 'Checkbox' ? 'useCheckboxField' : 'useCheckboxFieldForToggle',
|
|
129
|
+
suggest: [{
|
|
130
|
+
desc: useCheckboxFieldMessage,
|
|
131
|
+
fix: function fix(fixer) {
|
|
132
|
+
var fixes = [];
|
|
133
|
+
fixes.push(fixer.insertTextBefore(fieldImport, 'CheckboxField, '));
|
|
134
|
+
fixes.push(fixer.replaceText(node.openingElement.name, 'CheckboxField'));
|
|
135
|
+
node.closingElement && fixes.push(fixer.replaceText(node.closingElement.name, 'CheckboxField'));
|
|
136
|
+
return fixes;
|
|
137
|
+
}
|
|
138
|
+
}]
|
|
139
|
+
});
|
|
140
|
+
} else if (found === 'Range') {
|
|
141
|
+
context.report({
|
|
142
|
+
node: node,
|
|
143
|
+
messageId: 'useRangeField',
|
|
144
|
+
suggest: [{
|
|
145
|
+
desc: useRangeFieldMessage,
|
|
146
|
+
fix: function fix(fixer) {
|
|
147
|
+
var fixes = [];
|
|
148
|
+
fixes.push(fixer.insertTextBefore(fieldImport, 'RangeField, '));
|
|
149
|
+
fixes.push(fixer.replaceText(node.openingElement.name, 'RangeField'));
|
|
150
|
+
node.closingElement && fixes.push(fixer.replaceText(node.closingElement.name, 'RangeField'));
|
|
151
|
+
return fixes;
|
|
152
|
+
}
|
|
153
|
+
}]
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
});
|
|
161
|
+
export default rule;
|
|
@@ -16,6 +16,7 @@ export declare const plugin: {
|
|
|
16
16
|
};
|
|
17
17
|
rules: {
|
|
18
18
|
'consistent-css-prop-usage': import("eslint").Rule.RuleModule;
|
|
19
|
+
'enforce-inline-styles-in-select': import("eslint").Rule.RuleModule;
|
|
19
20
|
'ensure-design-token-usage': import("eslint").Rule.RuleModule;
|
|
20
21
|
'ensure-design-token-usage/preview': import("eslint").Rule.RuleModule;
|
|
21
22
|
'ensure-icon-color': import("eslint").Rule.RuleModule;
|
|
@@ -59,6 +60,7 @@ export declare const plugin: {
|
|
|
59
60
|
'no-utility-icons': import("eslint").Rule.RuleModule;
|
|
60
61
|
'prefer-primitives': import("eslint").Rule.RuleModule;
|
|
61
62
|
'use-button-group-label': import("eslint").Rule.RuleModule;
|
|
63
|
+
'use-correct-field': import("eslint").Rule.RuleModule;
|
|
62
64
|
'use-cx-function-in-xcss': import("eslint").Rule.RuleModule;
|
|
63
65
|
'use-datetime-picker-calendar-button': import("eslint").Rule.RuleModule;
|
|
64
66
|
'use-drawer-label': import("eslint").Rule.RuleModule;
|
|
@@ -84,6 +86,7 @@ export declare const plugin: {
|
|
|
84
86
|
plugins: string[];
|
|
85
87
|
rules: {
|
|
86
88
|
'@atlaskit/design-system/consistent-css-prop-usage': "error";
|
|
89
|
+
'@atlaskit/design-system/enforce-inline-styles-in-select': "error";
|
|
87
90
|
'@atlaskit/design-system/ensure-design-token-usage': "error";
|
|
88
91
|
'@atlaskit/design-system/ensure-design-token-usage/preview': "warn";
|
|
89
92
|
'@atlaskit/design-system/ensure-icon-color': "error";
|
|
@@ -126,6 +129,7 @@ export declare const plugin: {
|
|
|
126
129
|
'@atlaskit/design-system/no-utility-icons': "warn";
|
|
127
130
|
'@atlaskit/design-system/prefer-primitives': "warn";
|
|
128
131
|
'@atlaskit/design-system/use-button-group-label': "warn";
|
|
132
|
+
'@atlaskit/design-system/use-correct-field': "warn";
|
|
129
133
|
'@atlaskit/design-system/use-cx-function-in-xcss': "error";
|
|
130
134
|
'@atlaskit/design-system/use-datetime-picker-calendar-button': "warn";
|
|
131
135
|
'@atlaskit/design-system/use-drawer-label': "warn";
|
|
@@ -153,6 +157,7 @@ export declare const plugin: {
|
|
|
153
157
|
};
|
|
154
158
|
rules: {
|
|
155
159
|
'@atlaskit/design-system/consistent-css-prop-usage': "error";
|
|
160
|
+
'@atlaskit/design-system/enforce-inline-styles-in-select': "error";
|
|
156
161
|
'@atlaskit/design-system/ensure-design-token-usage': "error";
|
|
157
162
|
'@atlaskit/design-system/ensure-design-token-usage/preview': "warn";
|
|
158
163
|
'@atlaskit/design-system/ensure-icon-color': "error";
|
|
@@ -195,6 +200,7 @@ export declare const plugin: {
|
|
|
195
200
|
'@atlaskit/design-system/no-utility-icons': "warn";
|
|
196
201
|
'@atlaskit/design-system/prefer-primitives': "warn";
|
|
197
202
|
'@atlaskit/design-system/use-button-group-label': "warn";
|
|
203
|
+
'@atlaskit/design-system/use-correct-field': "warn";
|
|
198
204
|
'@atlaskit/design-system/use-cx-function-in-xcss': "error";
|
|
199
205
|
'@atlaskit/design-system/use-datetime-picker-calendar-button': "warn";
|
|
200
206
|
'@atlaskit/design-system/use-drawer-label': "warn";
|
|
@@ -249,6 +255,7 @@ export declare const plugin: {
|
|
|
249
255
|
'@atlaskit/design-system/no-unsupported-drag-and-drop-libraries': "error";
|
|
250
256
|
'@atlaskit/design-system/no-utility-icons': "warn";
|
|
251
257
|
'@atlaskit/design-system/use-button-group-label': "warn";
|
|
258
|
+
'@atlaskit/design-system/use-correct-field': "warn";
|
|
252
259
|
'@atlaskit/design-system/use-cx-function-in-xcss': "error";
|
|
253
260
|
'@atlaskit/design-system/use-datetime-picker-calendar-button': "warn";
|
|
254
261
|
'@atlaskit/design-system/use-drawer-label': "warn";
|
|
@@ -300,6 +307,7 @@ export declare const plugin: {
|
|
|
300
307
|
'@atlaskit/design-system/no-unsupported-drag-and-drop-libraries': "error";
|
|
301
308
|
'@atlaskit/design-system/no-utility-icons': "warn";
|
|
302
309
|
'@atlaskit/design-system/use-button-group-label': "warn";
|
|
310
|
+
'@atlaskit/design-system/use-correct-field': "warn";
|
|
303
311
|
'@atlaskit/design-system/use-cx-function-in-xcss': "error";
|
|
304
312
|
'@atlaskit/design-system/use-datetime-picker-calendar-button': "warn";
|
|
305
313
|
'@atlaskit/design-system/use-drawer-label': "warn";
|
|
@@ -323,6 +331,7 @@ declare const configs: {
|
|
|
323
331
|
plugins: string[];
|
|
324
332
|
rules: {
|
|
325
333
|
'@atlaskit/design-system/consistent-css-prop-usage': "error";
|
|
334
|
+
'@atlaskit/design-system/enforce-inline-styles-in-select': "error";
|
|
326
335
|
'@atlaskit/design-system/ensure-design-token-usage': "error";
|
|
327
336
|
'@atlaskit/design-system/ensure-design-token-usage/preview': "warn";
|
|
328
337
|
'@atlaskit/design-system/ensure-icon-color': "error";
|
|
@@ -365,6 +374,7 @@ declare const configs: {
|
|
|
365
374
|
'@atlaskit/design-system/no-utility-icons': "warn";
|
|
366
375
|
'@atlaskit/design-system/prefer-primitives': "warn";
|
|
367
376
|
'@atlaskit/design-system/use-button-group-label': "warn";
|
|
377
|
+
'@atlaskit/design-system/use-correct-field': "warn";
|
|
368
378
|
'@atlaskit/design-system/use-cx-function-in-xcss': "error";
|
|
369
379
|
'@atlaskit/design-system/use-datetime-picker-calendar-button': "warn";
|
|
370
380
|
'@atlaskit/design-system/use-drawer-label': "warn";
|
|
@@ -392,6 +402,7 @@ declare const configs: {
|
|
|
392
402
|
};
|
|
393
403
|
rules: {
|
|
394
404
|
'@atlaskit/design-system/consistent-css-prop-usage': "error";
|
|
405
|
+
'@atlaskit/design-system/enforce-inline-styles-in-select': "error";
|
|
395
406
|
'@atlaskit/design-system/ensure-design-token-usage': "error";
|
|
396
407
|
'@atlaskit/design-system/ensure-design-token-usage/preview': "warn";
|
|
397
408
|
'@atlaskit/design-system/ensure-icon-color': "error";
|
|
@@ -434,6 +445,7 @@ declare const configs: {
|
|
|
434
445
|
'@atlaskit/design-system/no-utility-icons': "warn";
|
|
435
446
|
'@atlaskit/design-system/prefer-primitives': "warn";
|
|
436
447
|
'@atlaskit/design-system/use-button-group-label': "warn";
|
|
448
|
+
'@atlaskit/design-system/use-correct-field': "warn";
|
|
437
449
|
'@atlaskit/design-system/use-cx-function-in-xcss': "error";
|
|
438
450
|
'@atlaskit/design-system/use-datetime-picker-calendar-button': "warn";
|
|
439
451
|
'@atlaskit/design-system/use-drawer-label': "warn";
|
|
@@ -488,6 +500,7 @@ declare const configs: {
|
|
|
488
500
|
'@atlaskit/design-system/no-unsupported-drag-and-drop-libraries': "error";
|
|
489
501
|
'@atlaskit/design-system/no-utility-icons': "warn";
|
|
490
502
|
'@atlaskit/design-system/use-button-group-label': "warn";
|
|
503
|
+
'@atlaskit/design-system/use-correct-field': "warn";
|
|
491
504
|
'@atlaskit/design-system/use-cx-function-in-xcss': "error";
|
|
492
505
|
'@atlaskit/design-system/use-datetime-picker-calendar-button': "warn";
|
|
493
506
|
'@atlaskit/design-system/use-drawer-label': "warn";
|
|
@@ -539,6 +552,7 @@ declare const configs: {
|
|
|
539
552
|
'@atlaskit/design-system/no-unsupported-drag-and-drop-libraries': "error";
|
|
540
553
|
'@atlaskit/design-system/no-utility-icons': "warn";
|
|
541
554
|
'@atlaskit/design-system/use-button-group-label': "warn";
|
|
555
|
+
'@atlaskit/design-system/use-correct-field': "warn";
|
|
542
556
|
'@atlaskit/design-system/use-cx-function-in-xcss': "error";
|
|
543
557
|
'@atlaskit/design-system/use-datetime-picker-calendar-button': "warn";
|
|
544
558
|
'@atlaskit/design-system/use-drawer-label': "warn";
|
|
@@ -2,6 +2,7 @@ declare const _default: {
|
|
|
2
2
|
plugins: {};
|
|
3
3
|
rules: {
|
|
4
4
|
'@atlaskit/design-system/consistent-css-prop-usage': "error";
|
|
5
|
+
'@atlaskit/design-system/enforce-inline-styles-in-select': "error";
|
|
5
6
|
'@atlaskit/design-system/ensure-design-token-usage': "error";
|
|
6
7
|
'@atlaskit/design-system/ensure-design-token-usage/preview': "warn";
|
|
7
8
|
'@atlaskit/design-system/ensure-icon-color': "error";
|
|
@@ -44,6 +45,7 @@ declare const _default: {
|
|
|
44
45
|
'@atlaskit/design-system/no-utility-icons': "warn";
|
|
45
46
|
'@atlaskit/design-system/prefer-primitives': "warn";
|
|
46
47
|
'@atlaskit/design-system/use-button-group-label': "warn";
|
|
48
|
+
'@atlaskit/design-system/use-correct-field': "warn";
|
|
47
49
|
'@atlaskit/design-system/use-cx-function-in-xcss': "error";
|
|
48
50
|
'@atlaskit/design-system/use-datetime-picker-calendar-button': "warn";
|
|
49
51
|
'@atlaskit/design-system/use-drawer-label': "warn";
|
|
@@ -2,6 +2,7 @@ declare const _default: {
|
|
|
2
2
|
plugins: string[];
|
|
3
3
|
rules: {
|
|
4
4
|
'@atlaskit/design-system/consistent-css-prop-usage': "error";
|
|
5
|
+
'@atlaskit/design-system/enforce-inline-styles-in-select': "error";
|
|
5
6
|
'@atlaskit/design-system/ensure-design-token-usage': "error";
|
|
6
7
|
'@atlaskit/design-system/ensure-design-token-usage/preview': "warn";
|
|
7
8
|
'@atlaskit/design-system/ensure-icon-color': "error";
|
|
@@ -44,6 +45,7 @@ declare const _default: {
|
|
|
44
45
|
'@atlaskit/design-system/no-utility-icons': "warn";
|
|
45
46
|
'@atlaskit/design-system/prefer-primitives': "warn";
|
|
46
47
|
'@atlaskit/design-system/use-button-group-label': "warn";
|
|
48
|
+
'@atlaskit/design-system/use-correct-field': "warn";
|
|
47
49
|
'@atlaskit/design-system/use-cx-function-in-xcss': "error";
|
|
48
50
|
'@atlaskit/design-system/use-datetime-picker-calendar-button': "warn";
|
|
49
51
|
'@atlaskit/design-system/use-drawer-label': "warn";
|
|
@@ -31,6 +31,7 @@ declare const _default: {
|
|
|
31
31
|
'@atlaskit/design-system/no-unsupported-drag-and-drop-libraries': "error";
|
|
32
32
|
'@atlaskit/design-system/no-utility-icons': "warn";
|
|
33
33
|
'@atlaskit/design-system/use-button-group-label': "warn";
|
|
34
|
+
'@atlaskit/design-system/use-correct-field': "warn";
|
|
34
35
|
'@atlaskit/design-system/use-cx-function-in-xcss': "error";
|
|
35
36
|
'@atlaskit/design-system/use-datetime-picker-calendar-button': "warn";
|
|
36
37
|
'@atlaskit/design-system/use-drawer-label': "warn";
|
|
@@ -31,6 +31,7 @@ declare const _default: {
|
|
|
31
31
|
'@atlaskit/design-system/no-unsupported-drag-and-drop-libraries': "error";
|
|
32
32
|
'@atlaskit/design-system/no-utility-icons': "warn";
|
|
33
33
|
'@atlaskit/design-system/use-button-group-label': "warn";
|
|
34
|
+
'@atlaskit/design-system/use-correct-field': "warn";
|
|
34
35
|
'@atlaskit/design-system/use-cx-function-in-xcss': "error";
|
|
35
36
|
'@atlaskit/design-system/use-datetime-picker-calendar-button': "warn";
|
|
36
37
|
'@atlaskit/design-system/use-drawer-label': "warn";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export declare const rules: {
|
|
2
2
|
'consistent-css-prop-usage': import("eslint").Rule.RuleModule;
|
|
3
|
+
'enforce-inline-styles-in-select': import("eslint").Rule.RuleModule;
|
|
3
4
|
'ensure-design-token-usage': import("eslint").Rule.RuleModule;
|
|
4
5
|
'ensure-design-token-usage/preview': import("eslint").Rule.RuleModule;
|
|
5
6
|
'ensure-icon-color': import("eslint").Rule.RuleModule;
|
|
@@ -43,6 +44,7 @@ export declare const rules: {
|
|
|
43
44
|
'no-utility-icons': import("eslint").Rule.RuleModule;
|
|
44
45
|
'prefer-primitives': import("eslint").Rule.RuleModule;
|
|
45
46
|
'use-button-group-label': import("eslint").Rule.RuleModule;
|
|
47
|
+
'use-correct-field': import("eslint").Rule.RuleModule;
|
|
46
48
|
'use-cx-function-in-xcss': import("eslint").Rule.RuleModule;
|
|
47
49
|
'use-datetime-picker-calendar-button': import("eslint").Rule.RuleModule;
|
|
48
50
|
'use-drawer-label': import("eslint").Rule.RuleModule;
|
|
@@ -16,6 +16,7 @@ export declare const plugin: {
|
|
|
16
16
|
};
|
|
17
17
|
rules: {
|
|
18
18
|
'consistent-css-prop-usage': import("eslint").Rule.RuleModule;
|
|
19
|
+
'enforce-inline-styles-in-select': import("eslint").Rule.RuleModule;
|
|
19
20
|
'ensure-design-token-usage': import("eslint").Rule.RuleModule;
|
|
20
21
|
'ensure-design-token-usage/preview': import("eslint").Rule.RuleModule;
|
|
21
22
|
'ensure-icon-color': import("eslint").Rule.RuleModule;
|
|
@@ -59,6 +60,7 @@ export declare const plugin: {
|
|
|
59
60
|
'no-utility-icons': import("eslint").Rule.RuleModule;
|
|
60
61
|
'prefer-primitives': import("eslint").Rule.RuleModule;
|
|
61
62
|
'use-button-group-label': import("eslint").Rule.RuleModule;
|
|
63
|
+
'use-correct-field': import("eslint").Rule.RuleModule;
|
|
62
64
|
'use-cx-function-in-xcss': import("eslint").Rule.RuleModule;
|
|
63
65
|
'use-datetime-picker-calendar-button': import("eslint").Rule.RuleModule;
|
|
64
66
|
'use-drawer-label': import("eslint").Rule.RuleModule;
|
|
@@ -84,6 +86,7 @@ export declare const plugin: {
|
|
|
84
86
|
plugins: string[];
|
|
85
87
|
rules: {
|
|
86
88
|
'@atlaskit/design-system/consistent-css-prop-usage': "error";
|
|
89
|
+
'@atlaskit/design-system/enforce-inline-styles-in-select': "error";
|
|
87
90
|
'@atlaskit/design-system/ensure-design-token-usage': "error";
|
|
88
91
|
'@atlaskit/design-system/ensure-design-token-usage/preview': "warn";
|
|
89
92
|
'@atlaskit/design-system/ensure-icon-color': "error";
|
|
@@ -129,6 +132,7 @@ export declare const plugin: {
|
|
|
129
132
|
'@atlaskit/design-system/no-utility-icons': "warn";
|
|
130
133
|
'@atlaskit/design-system/prefer-primitives': "warn";
|
|
131
134
|
'@atlaskit/design-system/use-button-group-label': "warn";
|
|
135
|
+
'@atlaskit/design-system/use-correct-field': "warn";
|
|
132
136
|
'@atlaskit/design-system/use-cx-function-in-xcss': "error";
|
|
133
137
|
'@atlaskit/design-system/use-datetime-picker-calendar-button': "warn";
|
|
134
138
|
'@atlaskit/design-system/use-drawer-label': "warn";
|
|
@@ -156,6 +160,7 @@ export declare const plugin: {
|
|
|
156
160
|
};
|
|
157
161
|
rules: {
|
|
158
162
|
'@atlaskit/design-system/consistent-css-prop-usage': "error";
|
|
163
|
+
'@atlaskit/design-system/enforce-inline-styles-in-select': "error";
|
|
159
164
|
'@atlaskit/design-system/ensure-design-token-usage': "error";
|
|
160
165
|
'@atlaskit/design-system/ensure-design-token-usage/preview': "warn";
|
|
161
166
|
'@atlaskit/design-system/ensure-icon-color': "error";
|
|
@@ -201,6 +206,7 @@ export declare const plugin: {
|
|
|
201
206
|
'@atlaskit/design-system/no-utility-icons': "warn";
|
|
202
207
|
'@atlaskit/design-system/prefer-primitives': "warn";
|
|
203
208
|
'@atlaskit/design-system/use-button-group-label': "warn";
|
|
209
|
+
'@atlaskit/design-system/use-correct-field': "warn";
|
|
204
210
|
'@atlaskit/design-system/use-cx-function-in-xcss': "error";
|
|
205
211
|
'@atlaskit/design-system/use-datetime-picker-calendar-button': "warn";
|
|
206
212
|
'@atlaskit/design-system/use-drawer-label': "warn";
|
|
@@ -258,6 +264,7 @@ export declare const plugin: {
|
|
|
258
264
|
'@atlaskit/design-system/no-unsupported-drag-and-drop-libraries': "error";
|
|
259
265
|
'@atlaskit/design-system/no-utility-icons': "warn";
|
|
260
266
|
'@atlaskit/design-system/use-button-group-label': "warn";
|
|
267
|
+
'@atlaskit/design-system/use-correct-field': "warn";
|
|
261
268
|
'@atlaskit/design-system/use-cx-function-in-xcss': "error";
|
|
262
269
|
'@atlaskit/design-system/use-datetime-picker-calendar-button': "warn";
|
|
263
270
|
'@atlaskit/design-system/use-drawer-label': "warn";
|
|
@@ -312,6 +319,7 @@ export declare const plugin: {
|
|
|
312
319
|
'@atlaskit/design-system/no-unsupported-drag-and-drop-libraries': "error";
|
|
313
320
|
'@atlaskit/design-system/no-utility-icons': "warn";
|
|
314
321
|
'@atlaskit/design-system/use-button-group-label': "warn";
|
|
322
|
+
'@atlaskit/design-system/use-correct-field': "warn";
|
|
315
323
|
'@atlaskit/design-system/use-cx-function-in-xcss': "error";
|
|
316
324
|
'@atlaskit/design-system/use-datetime-picker-calendar-button': "warn";
|
|
317
325
|
'@atlaskit/design-system/use-drawer-label': "warn";
|
|
@@ -335,6 +343,7 @@ declare const configs: {
|
|
|
335
343
|
plugins: string[];
|
|
336
344
|
rules: {
|
|
337
345
|
'@atlaskit/design-system/consistent-css-prop-usage': "error";
|
|
346
|
+
'@atlaskit/design-system/enforce-inline-styles-in-select': "error";
|
|
338
347
|
'@atlaskit/design-system/ensure-design-token-usage': "error";
|
|
339
348
|
'@atlaskit/design-system/ensure-design-token-usage/preview': "warn";
|
|
340
349
|
'@atlaskit/design-system/ensure-icon-color': "error";
|
|
@@ -380,6 +389,7 @@ declare const configs: {
|
|
|
380
389
|
'@atlaskit/design-system/no-utility-icons': "warn";
|
|
381
390
|
'@atlaskit/design-system/prefer-primitives': "warn";
|
|
382
391
|
'@atlaskit/design-system/use-button-group-label': "warn";
|
|
392
|
+
'@atlaskit/design-system/use-correct-field': "warn";
|
|
383
393
|
'@atlaskit/design-system/use-cx-function-in-xcss': "error";
|
|
384
394
|
'@atlaskit/design-system/use-datetime-picker-calendar-button': "warn";
|
|
385
395
|
'@atlaskit/design-system/use-drawer-label': "warn";
|
|
@@ -407,6 +417,7 @@ declare const configs: {
|
|
|
407
417
|
};
|
|
408
418
|
rules: {
|
|
409
419
|
'@atlaskit/design-system/consistent-css-prop-usage': "error";
|
|
420
|
+
'@atlaskit/design-system/enforce-inline-styles-in-select': "error";
|
|
410
421
|
'@atlaskit/design-system/ensure-design-token-usage': "error";
|
|
411
422
|
'@atlaskit/design-system/ensure-design-token-usage/preview': "warn";
|
|
412
423
|
'@atlaskit/design-system/ensure-icon-color': "error";
|
|
@@ -452,6 +463,7 @@ declare const configs: {
|
|
|
452
463
|
'@atlaskit/design-system/no-utility-icons': "warn";
|
|
453
464
|
'@atlaskit/design-system/prefer-primitives': "warn";
|
|
454
465
|
'@atlaskit/design-system/use-button-group-label': "warn";
|
|
466
|
+
'@atlaskit/design-system/use-correct-field': "warn";
|
|
455
467
|
'@atlaskit/design-system/use-cx-function-in-xcss': "error";
|
|
456
468
|
'@atlaskit/design-system/use-datetime-picker-calendar-button': "warn";
|
|
457
469
|
'@atlaskit/design-system/use-drawer-label': "warn";
|
|
@@ -509,6 +521,7 @@ declare const configs: {
|
|
|
509
521
|
'@atlaskit/design-system/no-unsupported-drag-and-drop-libraries': "error";
|
|
510
522
|
'@atlaskit/design-system/no-utility-icons': "warn";
|
|
511
523
|
'@atlaskit/design-system/use-button-group-label': "warn";
|
|
524
|
+
'@atlaskit/design-system/use-correct-field': "warn";
|
|
512
525
|
'@atlaskit/design-system/use-cx-function-in-xcss': "error";
|
|
513
526
|
'@atlaskit/design-system/use-datetime-picker-calendar-button': "warn";
|
|
514
527
|
'@atlaskit/design-system/use-drawer-label': "warn";
|
|
@@ -563,6 +576,7 @@ declare const configs: {
|
|
|
563
576
|
'@atlaskit/design-system/no-unsupported-drag-and-drop-libraries': "error";
|
|
564
577
|
'@atlaskit/design-system/no-utility-icons': "warn";
|
|
565
578
|
'@atlaskit/design-system/use-button-group-label': "warn";
|
|
579
|
+
'@atlaskit/design-system/use-correct-field': "warn";
|
|
566
580
|
'@atlaskit/design-system/use-cx-function-in-xcss': "error";
|
|
567
581
|
'@atlaskit/design-system/use-datetime-picker-calendar-button': "warn";
|
|
568
582
|
'@atlaskit/design-system/use-drawer-label': "warn";
|
|
@@ -2,6 +2,7 @@ declare const _default: {
|
|
|
2
2
|
plugins: {};
|
|
3
3
|
rules: {
|
|
4
4
|
'@atlaskit/design-system/consistent-css-prop-usage': "error";
|
|
5
|
+
'@atlaskit/design-system/enforce-inline-styles-in-select': "error";
|
|
5
6
|
'@atlaskit/design-system/ensure-design-token-usage': "error";
|
|
6
7
|
'@atlaskit/design-system/ensure-design-token-usage/preview': "warn";
|
|
7
8
|
'@atlaskit/design-system/ensure-icon-color': "error";
|
|
@@ -47,6 +48,7 @@ declare const _default: {
|
|
|
47
48
|
'@atlaskit/design-system/no-utility-icons': "warn";
|
|
48
49
|
'@atlaskit/design-system/prefer-primitives': "warn";
|
|
49
50
|
'@atlaskit/design-system/use-button-group-label': "warn";
|
|
51
|
+
'@atlaskit/design-system/use-correct-field': "warn";
|
|
50
52
|
'@atlaskit/design-system/use-cx-function-in-xcss': "error";
|
|
51
53
|
'@atlaskit/design-system/use-datetime-picker-calendar-button': "warn";
|
|
52
54
|
'@atlaskit/design-system/use-drawer-label': "warn";
|
|
@@ -2,6 +2,7 @@ declare const _default: {
|
|
|
2
2
|
plugins: string[];
|
|
3
3
|
rules: {
|
|
4
4
|
'@atlaskit/design-system/consistent-css-prop-usage': "error";
|
|
5
|
+
'@atlaskit/design-system/enforce-inline-styles-in-select': "error";
|
|
5
6
|
'@atlaskit/design-system/ensure-design-token-usage': "error";
|
|
6
7
|
'@atlaskit/design-system/ensure-design-token-usage/preview': "warn";
|
|
7
8
|
'@atlaskit/design-system/ensure-icon-color': "error";
|
|
@@ -47,6 +48,7 @@ declare const _default: {
|
|
|
47
48
|
'@atlaskit/design-system/no-utility-icons': "warn";
|
|
48
49
|
'@atlaskit/design-system/prefer-primitives': "warn";
|
|
49
50
|
'@atlaskit/design-system/use-button-group-label': "warn";
|
|
51
|
+
'@atlaskit/design-system/use-correct-field': "warn";
|
|
50
52
|
'@atlaskit/design-system/use-cx-function-in-xcss': "error";
|
|
51
53
|
'@atlaskit/design-system/use-datetime-picker-calendar-button': "warn";
|
|
52
54
|
'@atlaskit/design-system/use-drawer-label': "warn";
|
|
@@ -34,6 +34,7 @@ declare const _default: {
|
|
|
34
34
|
'@atlaskit/design-system/no-unsupported-drag-and-drop-libraries': "error";
|
|
35
35
|
'@atlaskit/design-system/no-utility-icons': "warn";
|
|
36
36
|
'@atlaskit/design-system/use-button-group-label': "warn";
|
|
37
|
+
'@atlaskit/design-system/use-correct-field': "warn";
|
|
37
38
|
'@atlaskit/design-system/use-cx-function-in-xcss': "error";
|
|
38
39
|
'@atlaskit/design-system/use-datetime-picker-calendar-button': "warn";
|
|
39
40
|
'@atlaskit/design-system/use-drawer-label': "warn";
|
|
@@ -34,6 +34,7 @@ declare const _default: {
|
|
|
34
34
|
'@atlaskit/design-system/no-unsupported-drag-and-drop-libraries': "error";
|
|
35
35
|
'@atlaskit/design-system/no-utility-icons': "warn";
|
|
36
36
|
'@atlaskit/design-system/use-button-group-label': "warn";
|
|
37
|
+
'@atlaskit/design-system/use-correct-field': "warn";
|
|
37
38
|
'@atlaskit/design-system/use-cx-function-in-xcss': "error";
|
|
38
39
|
'@atlaskit/design-system/use-datetime-picker-calendar-button': "warn";
|
|
39
40
|
'@atlaskit/design-system/use-drawer-label': "warn";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export declare const rules: {
|
|
2
2
|
'consistent-css-prop-usage': import("eslint").Rule.RuleModule;
|
|
3
|
+
'enforce-inline-styles-in-select': import("eslint").Rule.RuleModule;
|
|
3
4
|
'ensure-design-token-usage': import("eslint").Rule.RuleModule;
|
|
4
5
|
'ensure-design-token-usage/preview': import("eslint").Rule.RuleModule;
|
|
5
6
|
'ensure-icon-color': import("eslint").Rule.RuleModule;
|
|
@@ -43,6 +44,7 @@ export declare const rules: {
|
|
|
43
44
|
'no-utility-icons': import("eslint").Rule.RuleModule;
|
|
44
45
|
'prefer-primitives': import("eslint").Rule.RuleModule;
|
|
45
46
|
'use-button-group-label': import("eslint").Rule.RuleModule;
|
|
47
|
+
'use-correct-field': import("eslint").Rule.RuleModule;
|
|
46
48
|
'use-cx-function-in-xcss': import("eslint").Rule.RuleModule;
|
|
47
49
|
'use-datetime-picker-calendar-button': import("eslint").Rule.RuleModule;
|
|
48
50
|
'use-drawer-label': import("eslint").Rule.RuleModule;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/eslint-plugin-design-system",
|
|
3
3
|
"description": "The essential plugin for use with the Atlassian Design System.",
|
|
4
|
-
"version": "13.
|
|
4
|
+
"version": "13.18.0",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"publishConfig": {
|
|
@@ -13,7 +13,6 @@
|
|
|
13
13
|
"name": "ESLint plugin",
|
|
14
14
|
"category": "Tooling"
|
|
15
15
|
},
|
|
16
|
-
"runReact18": true,
|
|
17
16
|
"toolingLabels": [
|
|
18
17
|
"linting"
|
|
19
18
|
]
|
|
@@ -44,9 +43,9 @@
|
|
|
44
43
|
},
|
|
45
44
|
"dependencies": {
|
|
46
45
|
"@atlaskit/eslint-utils": "^2.0.0",
|
|
47
|
-
"@atlaskit/icon": "^
|
|
48
|
-
"@atlaskit/icon-lab": "^
|
|
49
|
-
"@atlaskit/tokens": "^5.
|
|
46
|
+
"@atlaskit/icon": "^27.3.0",
|
|
47
|
+
"@atlaskit/icon-lab": "^5.2.0",
|
|
48
|
+
"@atlaskit/tokens": "^5.5.0",
|
|
50
49
|
"@babel/runtime": "^7.0.0",
|
|
51
50
|
"@typescript-eslint/utils": "^7.1.0",
|
|
52
51
|
"ajv": "^6.12.6",
|
|
@@ -59,8 +58,8 @@
|
|
|
59
58
|
},
|
|
60
59
|
"devDependencies": {
|
|
61
60
|
"@af/formatting": "workspace:^",
|
|
62
|
-
"@atlaskit/ds-lib": "^4.
|
|
63
|
-
"@atlaskit/theme": "^
|
|
61
|
+
"@atlaskit/ds-lib": "^4.1.0",
|
|
62
|
+
"@atlaskit/theme": "^19.0.0",
|
|
64
63
|
"@atlassian/codegen": "^0.1.0",
|
|
65
64
|
"@atlassian/eslint-utils": "^0.5.0",
|
|
66
65
|
"@atlassian/ts-loader": "^0.1.0",
|