@atlaskit/eslint-plugin-design-system 9.2.4 → 9.2.5
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
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @atlaskit/eslint-plugin-design-system
|
|
2
2
|
|
|
3
|
+
## 9.2.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#87434](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/87434) [`dda5ca94da13`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/dda5ca94da13) - `use-primitives` - bail on dimension properties that have token call values.
|
|
8
|
+
|
|
3
9
|
## 9.2.4
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
|
@@ -46,6 +46,7 @@ var validateStyles = exports.validateStyles = function validateStyles(node, conf
|
|
|
46
46
|
if (!property) {
|
|
47
47
|
return false;
|
|
48
48
|
}
|
|
49
|
+
var isDimensionProperty = !!_cssToXcss.supportedDimensionAttributesMap[property];
|
|
49
50
|
|
|
50
51
|
// Currently, we handle values like `'8px'` (a 'Literal') or `token('space.100')` (a 'CallExpression')
|
|
51
52
|
if ((0, _eslintCodemodUtils.isNodeOfType)(value, 'Literal')) {
|
|
@@ -60,8 +61,15 @@ var validateStyles = exports.validateStyles = function validateStyles(node, conf
|
|
|
60
61
|
// If it's a function call, then make sure it's the `token` function (and we have `css-property-with-tokens` enabled)
|
|
61
62
|
|
|
62
63
|
// Short-circuit when token calls are found but pattern is not enabled in config
|
|
63
|
-
if (isTokenCall(value)
|
|
64
|
-
|
|
64
|
+
if (isTokenCall(value)) {
|
|
65
|
+
if (!config.patterns.includes('css-property-with-tokens')) {
|
|
66
|
+
return false;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// Don't attempt to convert `width: token('space.100') -> width: 'size.100'`
|
|
70
|
+
if (isDimensionProperty) {
|
|
71
|
+
return false;
|
|
72
|
+
}
|
|
65
73
|
}
|
|
66
74
|
|
|
67
75
|
// Bail if it's a function, but that function call is not `tokens('<token>')`
|
|
@@ -75,7 +83,6 @@ var validateStyles = exports.validateStyles = function validateStyles(node, conf
|
|
|
75
83
|
// Bail if dimension property is found but pattern is not enabled in config
|
|
76
84
|
// Note: We don't need to exhaustively re-check the key/value pair here. That's already been done above.
|
|
77
85
|
// This is just to check wether 'dimension-properties' pattern is enabled and can be removed when the pattern is completely rolled out
|
|
78
|
-
var isDimensionProperty = !!_cssToXcss.supportedDimensionAttributesMap[property];
|
|
79
86
|
if (isDimensionProperty && !config.patterns.includes('dimension-properties')) {
|
|
80
87
|
return false;
|
|
81
88
|
}
|
|
@@ -39,6 +39,7 @@ export const validateStyles = (node, config) => {
|
|
|
39
39
|
if (!property) {
|
|
40
40
|
return false;
|
|
41
41
|
}
|
|
42
|
+
const isDimensionProperty = !!supportedDimensionAttributesMap[property];
|
|
42
43
|
|
|
43
44
|
// Currently, we handle values like `'8px'` (a 'Literal') or `token('space.100')` (a 'CallExpression')
|
|
44
45
|
if (isNodeOfType(value, 'Literal')) {
|
|
@@ -53,8 +54,15 @@ export const validateStyles = (node, config) => {
|
|
|
53
54
|
// If it's a function call, then make sure it's the `token` function (and we have `css-property-with-tokens` enabled)
|
|
54
55
|
|
|
55
56
|
// Short-circuit when token calls are found but pattern is not enabled in config
|
|
56
|
-
if (isTokenCall(value)
|
|
57
|
-
|
|
57
|
+
if (isTokenCall(value)) {
|
|
58
|
+
if (!config.patterns.includes('css-property-with-tokens')) {
|
|
59
|
+
return false;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// Don't attempt to convert `width: token('space.100') -> width: 'size.100'`
|
|
63
|
+
if (isDimensionProperty) {
|
|
64
|
+
return false;
|
|
65
|
+
}
|
|
58
66
|
}
|
|
59
67
|
|
|
60
68
|
// Bail if it's a function, but that function call is not `tokens('<token>')`
|
|
@@ -68,7 +76,6 @@ export const validateStyles = (node, config) => {
|
|
|
68
76
|
// Bail if dimension property is found but pattern is not enabled in config
|
|
69
77
|
// Note: We don't need to exhaustively re-check the key/value pair here. That's already been done above.
|
|
70
78
|
// This is just to check wether 'dimension-properties' pattern is enabled and can be removed when the pattern is completely rolled out
|
|
71
|
-
const isDimensionProperty = !!supportedDimensionAttributesMap[property];
|
|
72
79
|
if (isDimensionProperty && !config.patterns.includes('dimension-properties')) {
|
|
73
80
|
return false;
|
|
74
81
|
}
|
|
@@ -37,6 +37,7 @@ export var validateStyles = function validateStyles(node, config) {
|
|
|
37
37
|
if (!property) {
|
|
38
38
|
return false;
|
|
39
39
|
}
|
|
40
|
+
var isDimensionProperty = !!supportedDimensionAttributesMap[property];
|
|
40
41
|
|
|
41
42
|
// Currently, we handle values like `'8px'` (a 'Literal') or `token('space.100')` (a 'CallExpression')
|
|
42
43
|
if (isNodeOfType(value, 'Literal')) {
|
|
@@ -51,8 +52,15 @@ export var validateStyles = function validateStyles(node, config) {
|
|
|
51
52
|
// If it's a function call, then make sure it's the `token` function (and we have `css-property-with-tokens` enabled)
|
|
52
53
|
|
|
53
54
|
// Short-circuit when token calls are found but pattern is not enabled in config
|
|
54
|
-
if (isTokenCall(value)
|
|
55
|
-
|
|
55
|
+
if (isTokenCall(value)) {
|
|
56
|
+
if (!config.patterns.includes('css-property-with-tokens')) {
|
|
57
|
+
return false;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
// Don't attempt to convert `width: token('space.100') -> width: 'size.100'`
|
|
61
|
+
if (isDimensionProperty) {
|
|
62
|
+
return false;
|
|
63
|
+
}
|
|
56
64
|
}
|
|
57
65
|
|
|
58
66
|
// Bail if it's a function, but that function call is not `tokens('<token>')`
|
|
@@ -66,7 +74,6 @@ export var validateStyles = function validateStyles(node, config) {
|
|
|
66
74
|
// Bail if dimension property is found but pattern is not enabled in config
|
|
67
75
|
// Note: We don't need to exhaustively re-check the key/value pair here. That's already been done above.
|
|
68
76
|
// This is just to check wether 'dimension-properties' pattern is enabled and can be removed when the pattern is completely rolled out
|
|
69
|
-
var isDimensionProperty = !!supportedDimensionAttributesMap[property];
|
|
70
77
|
if (isDimensionProperty && !config.patterns.includes('dimension-properties')) {
|
|
71
78
|
return false;
|
|
72
79
|
}
|
package/package.json
CHANGED