@atlaskit/eslint-plugin-platform 2.1.1 → 2.1.2
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 +8 -0
- package/dist/cjs/rules/compiled/expand-spacing-shorthand/index.js +6 -5
- package/dist/es2019/rules/compiled/expand-spacing-shorthand/index.js +6 -3
- package/dist/esm/rules/compiled/expand-spacing-shorthand/index.js +6 -5
- package/package.json +1 -1
- package/src/rules/compiled/expand-spacing-shorthand/__tests__/rule.test.ts +17 -1
- package/src/rules/compiled/expand-spacing-shorthand/index.ts +6 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @atlaskit/eslint-plugin-platform
|
|
2
2
|
|
|
3
|
+
## 2.1.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#102248](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/102248)
|
|
8
|
+
[`05acb13c43541`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/05acb13c43541) -
|
|
9
|
+
AFB-825 Fixing edge case of expand-spacing-shorthand rule
|
|
10
|
+
|
|
3
11
|
## 2.1.1
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
|
@@ -30,11 +30,12 @@ var parseTemplateLiteral = function parseTemplateLiteral(templateLiteral, contex
|
|
|
30
30
|
if (i < quasis.length) {
|
|
31
31
|
var cookedQuasi = quasis[i].value.cooked;
|
|
32
32
|
if (cookedQuasi) {
|
|
33
|
-
var
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
33
|
+
var splitQuasis = cookedQuasi.split(' ');
|
|
34
|
+
splitQuasis.forEach(function (str) {
|
|
35
|
+
str = str.trim().replace("\'", "");
|
|
36
|
+
if (str.length > 0) {
|
|
37
|
+
propertyValues.push(isNaN(Number(str)) ? "'".concat(str, "'") : str);
|
|
38
|
+
}
|
|
38
39
|
});
|
|
39
40
|
}
|
|
40
41
|
}
|
|
@@ -19,9 +19,12 @@ const parseTemplateLiteral = (templateLiteral, context) => {
|
|
|
19
19
|
if (i < quasis.length) {
|
|
20
20
|
const cookedQuasi = quasis[i].value.cooked;
|
|
21
21
|
if (cookedQuasi) {
|
|
22
|
-
const
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
const splitQuasis = cookedQuasi.split(' ');
|
|
23
|
+
splitQuasis.forEach(str => {
|
|
24
|
+
str = str.trim().replace("\'", "");
|
|
25
|
+
if (str.length > 0) {
|
|
26
|
+
propertyValues.push(isNaN(Number(str)) ? `'${str}'` : str);
|
|
27
|
+
}
|
|
25
28
|
});
|
|
26
29
|
}
|
|
27
30
|
}
|
|
@@ -23,11 +23,12 @@ var parseTemplateLiteral = function parseTemplateLiteral(templateLiteral, contex
|
|
|
23
23
|
if (i < quasis.length) {
|
|
24
24
|
var cookedQuasi = quasis[i].value.cooked;
|
|
25
25
|
if (cookedQuasi) {
|
|
26
|
-
var
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
26
|
+
var splitQuasis = cookedQuasi.split(' ');
|
|
27
|
+
splitQuasis.forEach(function (str) {
|
|
28
|
+
str = str.trim().replace("\'", "");
|
|
29
|
+
if (str.length > 0) {
|
|
30
|
+
propertyValues.push(isNaN(Number(str)) ? "'".concat(str, "'") : str);
|
|
31
|
+
}
|
|
31
32
|
});
|
|
32
33
|
}
|
|
33
34
|
}
|
package/package.json
CHANGED
|
@@ -355,6 +355,13 @@ const invalidTestCases = (property: string) => {
|
|
|
355
355
|
${property}: \`\${token('space.100')} \${token('space.200')}
|
|
356
356
|
\${token('space.300')} \${token('space.400')}\`,
|
|
357
357
|
});
|
|
358
|
+
const styles2 = css({
|
|
359
|
+
paddingBottom: token('space.050', '4px'),
|
|
360
|
+
'&& > span': {
|
|
361
|
+
padding: \`\${token('space.100', '8px')} \${token('space.150', '12px')} 7px
|
|
362
|
+
\${token('space.150', '12px')}\`,
|
|
363
|
+
},
|
|
364
|
+
});
|
|
358
365
|
`,
|
|
359
366
|
output: outdent`
|
|
360
367
|
import {css} from '@compiled/react';
|
|
@@ -364,8 +371,17 @@ const invalidTestCases = (property: string) => {
|
|
|
364
371
|
${property}Bottom: token('space.300'),
|
|
365
372
|
${property}Left: token('space.400'),
|
|
366
373
|
});
|
|
374
|
+
const styles2 = css({
|
|
375
|
+
paddingBottom: token('space.050', '4px'),
|
|
376
|
+
'&& > span': {
|
|
377
|
+
paddingTop: token('space.100', '8px'),
|
|
378
|
+
paddingRight: token('space.150', '12px'),
|
|
379
|
+
paddingBottom: '7px',
|
|
380
|
+
paddingLeft: token('space.150', '12px'),
|
|
381
|
+
},
|
|
382
|
+
});
|
|
367
383
|
`,
|
|
368
|
-
errors:
|
|
384
|
+
errors: Array.from(Array(2), () => ({ messageId: 'expandSpacingShorthand' })),
|
|
369
385
|
},
|
|
370
386
|
// TODO (AFB-1022): Resolve this failing test
|
|
371
387
|
// {
|
|
@@ -32,9 +32,12 @@ const parseTemplateLiteral = (templateLiteral: TemplateLiteral, context: Rule.Ru
|
|
|
32
32
|
if (i < quasis.length) {
|
|
33
33
|
const cookedQuasi = quasis[i].value.cooked;
|
|
34
34
|
if (cookedQuasi) {
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
const splitQuasis = cookedQuasi.split(' ');
|
|
36
|
+
splitQuasis.forEach((str) => {
|
|
37
|
+
str = str.trim().replace("\'", "");
|
|
38
|
+
if (str.length > 0) {
|
|
39
|
+
propertyValues.push(isNaN(Number(str)) ? `'${str}'` : str);
|
|
40
|
+
}
|
|
38
41
|
});
|
|
39
42
|
}
|
|
40
43
|
}
|