@atlaskit/eslint-plugin-design-system 4.13.7 → 4.13.9
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 +12 -0
- package/dist/cjs/rules/ensure-design-token-usage-spacing/index.js +9 -3
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/rules/ensure-design-token-usage-spacing/index.js +10 -3
- package/dist/es2019/version.json +1 -1
- package/dist/esm/rules/ensure-design-token-usage-spacing/index.js +10 -3
- package/dist/esm/version.json +1 -1
- package/package.json +2 -2
- package/report.api.md +15 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @atlaskit/eslint-plugin-design-system
|
|
2
2
|
|
|
3
|
+
## 4.13.9
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 4.13.8
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`f4c5d7db7aa`](https://bitbucket.org/atlassian/atlassian-frontend/commits/f4c5d7db7aa) - Updates fix for `ensure-design-token-usage-spacing` to ensure fixes are not applied erroneously.
|
|
14
|
+
|
|
3
15
|
## 4.13.7
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
|
@@ -110,7 +110,7 @@ var rule = {
|
|
|
110
110
|
|
|
111
111
|
return node.key.name === 'fontSize';
|
|
112
112
|
});
|
|
113
|
-
var fontSizeValue = (0, _utils.getValue)( // @ts-
|
|
113
|
+
var fontSizeValue = (0, _utils.getValue)( // @ts-expect-error
|
|
114
114
|
(0, _eslintCodemodUtils.isNodeOfType)(fontSizeNode, 'Property') && fontSizeNode.value, context);
|
|
115
115
|
var fontSize = Array.isArray(fontSizeValue) ? fontSizeValue[0] : fontSizeValue;
|
|
116
116
|
|
|
@@ -337,9 +337,15 @@ var rule = {
|
|
|
337
337
|
|
|
338
338
|
var textForSource = context.getSourceCode().getText(node.quasi); // find `<property>: ...;` in original
|
|
339
339
|
|
|
340
|
-
var searchRegExp = new RegExp(
|
|
340
|
+
var searchRegExp = new RegExp(style, 'g'); // replace property:val with new property:val
|
|
341
|
+
|
|
342
|
+
var replacement = textForSource.replace(searchRegExp, // padding: ${gridSize()}px;
|
|
343
|
+
"".concat(rawProperty, ": ").concat(replacementValue));
|
|
344
|
+
|
|
345
|
+
if (!replacement) {
|
|
346
|
+
return [];
|
|
347
|
+
}
|
|
341
348
|
|
|
342
|
-
var replacement = textForSource.replace(searchRegExp, "".concat(rawProperty, ": ").concat(replacementValue, ";"));
|
|
343
349
|
return [fixer.insertTextBefore(parentNode, "// TODO Delete this comment after verifying spacing token -> previous value `".concat(value.trim(), "`\n")), fixer.replaceText(node.quasi, replacement)];
|
|
344
350
|
} : undefined
|
|
345
351
|
});
|
package/dist/cjs/version.json
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* eslint-disable @atlassian/tangerine/import/entry-points */
|
|
1
2
|
import { callExpression, identifier, isNodeOfType, literal, node as nodeFn, property } from 'eslint-codemod-utils';
|
|
2
3
|
import spacingScale from '@atlaskit/tokens/spacing-raw';
|
|
3
4
|
import typographyTokens from '@atlaskit/tokens/typography-raw';
|
|
@@ -81,7 +82,7 @@ const rule = {
|
|
|
81
82
|
|
|
82
83
|
return node.key.name === 'fontSize';
|
|
83
84
|
});
|
|
84
|
-
const fontSizeValue = getValue( // @ts-
|
|
85
|
+
const fontSizeValue = getValue( // @ts-expect-error
|
|
85
86
|
isNodeOfType(fontSizeNode, 'Property') && fontSizeNode.value, context);
|
|
86
87
|
const fontSize = Array.isArray(fontSizeValue) ? fontSizeValue[0] : fontSizeValue;
|
|
87
88
|
|
|
@@ -290,9 +291,15 @@ const rule = {
|
|
|
290
291
|
|
|
291
292
|
const textForSource = context.getSourceCode().getText(node.quasi); // find `<property>: ...;` in original
|
|
292
293
|
|
|
293
|
-
const searchRegExp = new RegExp(
|
|
294
|
+
const searchRegExp = new RegExp(style, 'g'); // replace property:val with new property:val
|
|
295
|
+
|
|
296
|
+
const replacement = textForSource.replace(searchRegExp, // padding: ${gridSize()}px;
|
|
297
|
+
`${rawProperty}: ${replacementValue}`);
|
|
298
|
+
|
|
299
|
+
if (!replacement) {
|
|
300
|
+
return [];
|
|
301
|
+
}
|
|
294
302
|
|
|
295
|
-
const replacement = textForSource.replace(searchRegExp, `${rawProperty}: ${replacementValue};`);
|
|
296
303
|
return [fixer.insertTextBefore(parentNode, `// TODO Delete this comment after verifying spacing token -> previous value \`${value.trim()}\`\n`), fixer.replaceText(node.quasi, replacement)];
|
|
297
304
|
} : undefined
|
|
298
305
|
});
|
package/dist/es2019/version.json
CHANGED
|
@@ -5,6 +5,7 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
5
5
|
|
|
6
6
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
7
7
|
|
|
8
|
+
/* eslint-disable @atlassian/tangerine/import/entry-points */
|
|
8
9
|
import { callExpression, identifier, isNodeOfType, literal, node as nodeFn, property } from 'eslint-codemod-utils';
|
|
9
10
|
import spacingScale from '@atlaskit/tokens/spacing-raw';
|
|
10
11
|
import typographyTokens from '@atlaskit/tokens/typography-raw';
|
|
@@ -95,7 +96,7 @@ var rule = {
|
|
|
95
96
|
|
|
96
97
|
return node.key.name === 'fontSize';
|
|
97
98
|
});
|
|
98
|
-
var fontSizeValue = getValue( // @ts-
|
|
99
|
+
var fontSizeValue = getValue( // @ts-expect-error
|
|
99
100
|
isNodeOfType(fontSizeNode, 'Property') && fontSizeNode.value, context);
|
|
100
101
|
var fontSize = Array.isArray(fontSizeValue) ? fontSizeValue[0] : fontSizeValue;
|
|
101
102
|
|
|
@@ -322,9 +323,15 @@ var rule = {
|
|
|
322
323
|
|
|
323
324
|
var textForSource = context.getSourceCode().getText(node.quasi); // find `<property>: ...;` in original
|
|
324
325
|
|
|
325
|
-
var searchRegExp = new RegExp(
|
|
326
|
+
var searchRegExp = new RegExp(style, 'g'); // replace property:val with new property:val
|
|
327
|
+
|
|
328
|
+
var replacement = textForSource.replace(searchRegExp, // padding: ${gridSize()}px;
|
|
329
|
+
"".concat(rawProperty, ": ").concat(replacementValue));
|
|
330
|
+
|
|
331
|
+
if (!replacement) {
|
|
332
|
+
return [];
|
|
333
|
+
}
|
|
326
334
|
|
|
327
|
-
var replacement = textForSource.replace(searchRegExp, "".concat(rawProperty, ": ").concat(replacementValue, ";"));
|
|
328
335
|
return [fixer.insertTextBefore(parentNode, "// TODO Delete this comment after verifying spacing token -> previous value `".concat(value.trim(), "`\n")), fixer.replaceText(node.quasi, replacement)];
|
|
329
336
|
} : undefined
|
|
330
337
|
});
|
package/dist/esm/version.json
CHANGED
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": "4.13.
|
|
4
|
+
"version": "4.13.9",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
".": "./src/index.tsx"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@atlaskit/tokens": "^0.
|
|
36
|
+
"@atlaskit/tokens": "^0.12.0",
|
|
37
37
|
"@babel/runtime": "^7.0.0",
|
|
38
38
|
"eslint-codemod-utils": "^1.5.0"
|
|
39
39
|
},
|
package/report.api.md
CHANGED
|
@@ -1,12 +1,17 @@
|
|
|
1
|
+
<!-- API Report Version: 2.2 -->
|
|
2
|
+
|
|
1
3
|
## API Report File for "@atlaskit/eslint-plugin-design-system"
|
|
2
4
|
|
|
3
|
-
> Do not edit this file.
|
|
5
|
+
> Do not edit this file. This report is auto-generated using [API Extractor](https://api-extractor.com/).
|
|
6
|
+
> [Learn more about API reports](https://hello.atlassian.net/wiki/spaces/UR/pages/1825484529/Package+API+Reports)
|
|
7
|
+
|
|
8
|
+
### Table of contents
|
|
4
9
|
|
|
5
|
-
|
|
6
|
-
Generated API Report version: 2.0
|
|
7
|
-
-->
|
|
10
|
+
- [Main Entry Types](#main-entry-types)
|
|
8
11
|
|
|
9
|
-
|
|
12
|
+
### Main Entry Types
|
|
13
|
+
|
|
14
|
+
<!--SECTION START: Main Entry Types-->
|
|
10
15
|
|
|
11
16
|
```ts
|
|
12
17
|
import { Rule } from 'eslint';
|
|
@@ -32,7 +37,8 @@ export const configs: {
|
|
|
32
37
|
'@atlaskit/design-system/use-visually-hidden': string;
|
|
33
38
|
'@atlaskit/design-system/ensure-design-token-usage': string;
|
|
34
39
|
'@atlaskit/design-system/no-banned-imports': string;
|
|
35
|
-
'@atlaskit/design-system/no-
|
|
40
|
+
'@atlaskit/design-system/no-unsafe-design-token-usage': string;
|
|
41
|
+
'@atlaskit/design-system/ensure-design-token-usage-spacing': string;
|
|
36
42
|
};
|
|
37
43
|
};
|
|
38
44
|
};
|
|
@@ -47,8 +53,10 @@ export const rules: {
|
|
|
47
53
|
'no-banned-imports': Rule.RuleModule;
|
|
48
54
|
'no-unsafe-design-token-usage': Rule.RuleModule;
|
|
49
55
|
'use-visually-hidden': Rule.RuleModule;
|
|
50
|
-
'
|
|
56
|
+
'ensure-design-token-usage-spacing': Rule.RuleModule;
|
|
51
57
|
};
|
|
52
58
|
|
|
53
59
|
// (No @packageDocumentation comment for this package)
|
|
54
60
|
```
|
|
61
|
+
|
|
62
|
+
<!--SECTION END: Main Entry Types-->
|