@atlaskit/eslint-plugin-design-system 13.0.0 → 13.0.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 +20 -0
- package/dist/cjs/rules/no-custom-icons/index.js +1 -1
- package/dist/cjs/rules/no-unsafe-design-token-usage/index.js +6 -0
- package/dist/es2019/rules/no-custom-icons/index.js +1 -1
- package/dist/es2019/rules/no-unsafe-design-token-usage/index.js +6 -0
- package/dist/esm/rules/no-custom-icons/index.js +1 -1
- package/dist/esm/rules/no-unsafe-design-token-usage/index.js +6 -0
- package/package.json +8 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# @atlaskit/eslint-plugin-design-system
|
|
2
2
|
|
|
3
|
+
## 13.0.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#122856](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/122856)
|
|
8
|
+
[`24978014b9d89`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/24978014b9d89) -
|
|
9
|
+
Update messaging for no-custom-icons to provide guideance around third party logos.
|
|
10
|
+
|
|
11
|
+
## 13.0.1
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [#119942](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/119942)
|
|
16
|
+
[`d5163d608020e`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/d5163d608020e) -
|
|
17
|
+
"Modify the no-unsafe-design-token-usage rule to exclude the getTokenValue function when used in
|
|
18
|
+
'none' mode for fallbackUsage. This adjustment is necessary because the getTokenValue function is
|
|
19
|
+
not covered by the build-time @atlaskit/tokens/babel-plugin by design. As a result, using this
|
|
20
|
+
function without a fallback can be unsafe, as it defaults to a blank value if applied on a webpage
|
|
21
|
+
where the ADS theme is not enabled."
|
|
22
|
+
|
|
3
23
|
## 13.0.0
|
|
4
24
|
|
|
5
25
|
### Major Changes
|
|
@@ -43,7 +43,7 @@ var rule = (0, _createRule.createLintRule)({
|
|
|
43
43
|
centralLocation = _ref$centralLocation === void 0 ? '' : _ref$centralLocation,
|
|
44
44
|
_ref$failSilently = _ref.failSilently,
|
|
45
45
|
failSilently = _ref$failSilently === void 0 ? false : _ref$failSilently;
|
|
46
|
-
var locationMessage = centralLocation ? "
|
|
46
|
+
var locationMessage = centralLocation ? ", move the icon to '".concat(centralLocation, "', or, if it's a third party logo, migrate to a standard <svg> element with a `label`.") : '';
|
|
47
47
|
return (0, _errorBoundary.errorBoundary)({
|
|
48
48
|
JSXElement: function JSXElement(node) {
|
|
49
49
|
var _isIconBase$getImport;
|
|
@@ -109,6 +109,12 @@ var rule = (0, _createRule.createLintRule)({
|
|
|
109
109
|
if (!(0, _eslintCodemodUtils.isNodeOfType)(node, 'CallExpression')) {
|
|
110
110
|
return;
|
|
111
111
|
}
|
|
112
|
+
var isGetTokenValueCall = (0, _eslintCodemodUtils.isNodeOfType)(node.callee, 'Identifier') && node.callee.name === 'getTokenValue';
|
|
113
|
+
|
|
114
|
+
// Skip processing if it's a `getTokenValue` call and config.fallbackUsage is `none`
|
|
115
|
+
if (isGetTokenValueCall && config.fallbackUsage === 'none') {
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
112
118
|
if (node.arguments.length < 2 && config.fallbackUsage === 'forced') {
|
|
113
119
|
var fix;
|
|
114
120
|
if (node.arguments[0].type === 'Literal') {
|
|
@@ -37,7 +37,7 @@ const rule = createLintRule({
|
|
|
37
37
|
centralLocation = '',
|
|
38
38
|
failSilently = false
|
|
39
39
|
} = (_context$options$ = context.options[0]) !== null && _context$options$ !== void 0 ? _context$options$ : {};
|
|
40
|
-
const locationMessage = centralLocation ?
|
|
40
|
+
const locationMessage = centralLocation ? `, move the icon to '${centralLocation}', or, if it's a third party logo, migrate to a standard <svg> element with a \`label\`.` : '';
|
|
41
41
|
return errorBoundary({
|
|
42
42
|
JSXElement(node) {
|
|
43
43
|
var _isIconBase$getImport;
|
|
@@ -121,6 +121,12 @@ token('color.background.blanket');
|
|
|
121
121
|
if (!isNodeOfType(node, 'CallExpression')) {
|
|
122
122
|
return;
|
|
123
123
|
}
|
|
124
|
+
const isGetTokenValueCall = isNodeOfType(node.callee, 'Identifier') && node.callee.name === 'getTokenValue';
|
|
125
|
+
|
|
126
|
+
// Skip processing if it's a `getTokenValue` call and config.fallbackUsage is `none`
|
|
127
|
+
if (isGetTokenValueCall && config.fallbackUsage === 'none') {
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
124
130
|
if (node.arguments.length < 2 && config.fallbackUsage === 'forced') {
|
|
125
131
|
let fix;
|
|
126
132
|
if (node.arguments[0].type === 'Literal') {
|
|
@@ -37,7 +37,7 @@ var rule = createLintRule({
|
|
|
37
37
|
centralLocation = _ref$centralLocation === void 0 ? '' : _ref$centralLocation,
|
|
38
38
|
_ref$failSilently = _ref.failSilently,
|
|
39
39
|
failSilently = _ref$failSilently === void 0 ? false : _ref$failSilently;
|
|
40
|
-
var locationMessage = centralLocation ? "
|
|
40
|
+
var locationMessage = centralLocation ? ", move the icon to '".concat(centralLocation, "', or, if it's a third party logo, migrate to a standard <svg> element with a `label`.") : '';
|
|
41
41
|
return errorBoundary({
|
|
42
42
|
JSXElement: function JSXElement(node) {
|
|
43
43
|
var _isIconBase$getImport;
|
|
@@ -104,6 +104,12 @@ var rule = createLintRule({
|
|
|
104
104
|
if (!isNodeOfType(node, 'CallExpression')) {
|
|
105
105
|
return;
|
|
106
106
|
}
|
|
107
|
+
var isGetTokenValueCall = isNodeOfType(node.callee, 'Identifier') && node.callee.name === 'getTokenValue';
|
|
108
|
+
|
|
109
|
+
// Skip processing if it's a `getTokenValue` call and config.fallbackUsage is `none`
|
|
110
|
+
if (isGetTokenValueCall && config.fallbackUsage === 'none') {
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
107
113
|
if (node.arguments.length < 2 && config.fallbackUsage === 'forced') {
|
|
108
114
|
var fix;
|
|
109
115
|
if (node.arguments[0].type === 'Literal') {
|
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.0.
|
|
4
|
+
"version": "13.0.2",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"publishConfig": {
|
|
@@ -44,9 +44,9 @@
|
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
46
|
"@atlaskit/eslint-utils": "^2.0.0",
|
|
47
|
-
"@atlaskit/icon": "^24.
|
|
48
|
-
"@atlaskit/icon-lab": "^3.
|
|
49
|
-
"@atlaskit/tokens": "
|
|
47
|
+
"@atlaskit/icon": "^24.1.0",
|
|
48
|
+
"@atlaskit/icon-lab": "^3.4.0",
|
|
49
|
+
"@atlaskit/tokens": "^4.3.0",
|
|
50
50
|
"@babel/runtime": "^7.0.0",
|
|
51
51
|
"@typescript-eslint/utils": "^7.1.0",
|
|
52
52
|
"ajv": "^6.12.6",
|
|
@@ -57,12 +57,12 @@
|
|
|
57
57
|
"semver": "^7.5.2"
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
60
|
-
"@af/formatting": "
|
|
60
|
+
"@af/formatting": "^0.0.4",
|
|
61
61
|
"@atlaskit/ds-lib": "^4.0.0",
|
|
62
|
-
"@atlaskit/theme": "^
|
|
63
|
-
"@atlassian/codegen": "
|
|
62
|
+
"@atlaskit/theme": "^18.0.0",
|
|
63
|
+
"@atlassian/codegen": "^0.1.0",
|
|
64
64
|
"@atlassian/eslint-utils": "^0.5.0",
|
|
65
|
-
"@atlassian/ts-loader": "
|
|
65
|
+
"@atlassian/ts-loader": "^0.1.0",
|
|
66
66
|
"@emotion/react": "^11.7.1",
|
|
67
67
|
"@emotion/styled": "^11.0.0",
|
|
68
68
|
"@eslint/eslintrc": "^3.0.2",
|