@atlaskit/eslint-plugin-design-system 13.19.2 → 13.19.4
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,19 @@
|
|
|
1
1
|
# @atlaskit/eslint-plugin-design-system
|
|
2
2
|
|
|
3
|
+
## 13.19.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#198800](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/198800)
|
|
8
|
+
[`b57fbbece226f`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/b57fbbece226f) -
|
|
9
|
+
Fixed some false positives in @atlaskit/design-system/use-modal-dialog-close-button ESLint rule
|
|
10
|
+
|
|
11
|
+
## 13.19.3
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- Updated dependencies
|
|
16
|
+
|
|
3
17
|
## 13.19.2
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
|
@@ -82,20 +82,29 @@ var rule = (0, _createRule.createLintRule)({
|
|
|
82
82
|
return;
|
|
83
83
|
}
|
|
84
84
|
|
|
85
|
-
// Add expression
|
|
85
|
+
// Add expression container's body if an expression container
|
|
86
86
|
if ((0, _eslintCodemodUtils.isNodeOfType)(node, 'JSXExpressionContainer')) {
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
87
|
+
var expression = node.expression;
|
|
88
|
+
if ((0, _eslintCodemodUtils.isNodeOfType)(expression, 'ArrowFunctionExpression') || (0, _eslintCodemodUtils.isNodeOfType)(expression, 'FunctionExpression')) {
|
|
89
|
+
if ((0, _eslintCodemodUtils.isNodeOfType)(expression.body, 'JSXElement') || (0, _eslintCodemodUtils.isNodeOfType)(expression.body, 'JSXFragment')) {
|
|
90
|
+
searchExpression(expression.body);
|
|
91
|
+
} else if ((0, _eslintCodemodUtils.isNodeOfType)(expression.body, 'BlockStatement')) {
|
|
92
|
+
expression.body.body.forEach(function (statement) {
|
|
93
|
+
if ((0, _eslintCodemodUtils.isNodeOfType)(statement, 'ReturnStatement') && statement.argument) {
|
|
94
|
+
searchExpression(statement.argument);
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
} else if ((0, _eslintCodemodUtils.isNodeOfType)(expression, 'LogicalExpression')) {
|
|
99
|
+
var left = expression.left,
|
|
100
|
+
right = expression.right;
|
|
93
101
|
[left, right].forEach(function (e) {
|
|
94
|
-
|
|
95
|
-
searchNode(e, true);
|
|
96
|
-
}
|
|
102
|
+
searchExpression(e);
|
|
97
103
|
});
|
|
104
|
+
} else {
|
|
105
|
+
searchExpression(expression);
|
|
98
106
|
}
|
|
107
|
+
return;
|
|
99
108
|
}
|
|
100
109
|
|
|
101
110
|
// Skip if not a JSX Element
|
|
@@ -118,6 +127,13 @@ var rule = (0, _createRule.createLintRule)({
|
|
|
118
127
|
searchNode(node);
|
|
119
128
|
}
|
|
120
129
|
};
|
|
130
|
+
var searchExpression = function searchExpression(expression) {
|
|
131
|
+
if ((0, _eslintCodemodUtils.isNodeOfType)(expression, 'JSXElement')) {
|
|
132
|
+
searchNode(expression, true);
|
|
133
|
+
} else if ((0, _eslintCodemodUtils.isNodeOfType)(expression, 'JSXFragment')) {
|
|
134
|
+
searchJSXFragment(expression);
|
|
135
|
+
}
|
|
136
|
+
};
|
|
121
137
|
var searchNode = function searchNode(node) {
|
|
122
138
|
var searchSelf = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
123
139
|
if (searchSelf) {
|
|
@@ -136,6 +152,22 @@ var rule = (0, _createRule.createLintRule)({
|
|
|
136
152
|
_iterator.f();
|
|
137
153
|
}
|
|
138
154
|
};
|
|
155
|
+
var searchJSXFragment = function searchJSXFragment(node) {
|
|
156
|
+
if ((0, _eslintCodemodUtils.isNodeOfType)(node, 'JSXFragment')) {
|
|
157
|
+
var _iterator2 = _createForOfIteratorHelper(node.children),
|
|
158
|
+
_step2;
|
|
159
|
+
try {
|
|
160
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
161
|
+
var child = _step2.value;
|
|
162
|
+
checkNode(child);
|
|
163
|
+
}
|
|
164
|
+
} catch (err) {
|
|
165
|
+
_iterator2.e(err);
|
|
166
|
+
} finally {
|
|
167
|
+
_iterator2.f();
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
};
|
|
139
171
|
if (name === defaultImportLocalName) {
|
|
140
172
|
searchNode(node);
|
|
141
173
|
|
|
@@ -73,21 +73,31 @@ const rule = createLintRule({
|
|
|
73
73
|
return;
|
|
74
74
|
}
|
|
75
75
|
|
|
76
|
-
// Add expression
|
|
76
|
+
// Add expression container's body if an expression container
|
|
77
77
|
if (isNodeOfType(node, 'JSXExpressionContainer')) {
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
78
|
+
const expression = node.expression;
|
|
79
|
+
if (isNodeOfType(expression, 'ArrowFunctionExpression') || isNodeOfType(expression, 'FunctionExpression')) {
|
|
80
|
+
if (isNodeOfType(expression.body, 'JSXElement') || isNodeOfType(expression.body, 'JSXFragment')) {
|
|
81
|
+
searchExpression(expression.body);
|
|
82
|
+
} else if (isNodeOfType(expression.body, 'BlockStatement')) {
|
|
83
|
+
expression.body.body.forEach(statement => {
|
|
84
|
+
if (isNodeOfType(statement, 'ReturnStatement') && statement.argument) {
|
|
85
|
+
searchExpression(statement.argument);
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
} else if (isNodeOfType(expression, 'LogicalExpression')) {
|
|
81
90
|
const {
|
|
82
91
|
left,
|
|
83
92
|
right
|
|
84
|
-
} =
|
|
93
|
+
} = expression;
|
|
85
94
|
[left, right].forEach(e => {
|
|
86
|
-
|
|
87
|
-
searchNode(e, true);
|
|
88
|
-
}
|
|
95
|
+
searchExpression(e);
|
|
89
96
|
});
|
|
97
|
+
} else {
|
|
98
|
+
searchExpression(expression);
|
|
90
99
|
}
|
|
100
|
+
return;
|
|
91
101
|
}
|
|
92
102
|
|
|
93
103
|
// Skip if not a JSX Element
|
|
@@ -110,6 +120,13 @@ const rule = createLintRule({
|
|
|
110
120
|
searchNode(node);
|
|
111
121
|
}
|
|
112
122
|
};
|
|
123
|
+
const searchExpression = expression => {
|
|
124
|
+
if (isNodeOfType(expression, 'JSXElement')) {
|
|
125
|
+
searchNode(expression, true);
|
|
126
|
+
} else if (isNodeOfType(expression, 'JSXFragment')) {
|
|
127
|
+
searchJSXFragment(expression);
|
|
128
|
+
}
|
|
129
|
+
};
|
|
113
130
|
const searchNode = (node, searchSelf = false) => {
|
|
114
131
|
if (searchSelf) {
|
|
115
132
|
checkNode(node);
|
|
@@ -118,6 +135,13 @@ const rule = createLintRule({
|
|
|
118
135
|
checkNode(child);
|
|
119
136
|
}
|
|
120
137
|
};
|
|
138
|
+
const searchJSXFragment = node => {
|
|
139
|
+
if (isNodeOfType(node, 'JSXFragment')) {
|
|
140
|
+
for (let child of node.children) {
|
|
141
|
+
checkNode(child);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
};
|
|
121
145
|
if (name === defaultImportLocalName) {
|
|
122
146
|
searchNode(node);
|
|
123
147
|
|
|
@@ -76,20 +76,29 @@ var rule = createLintRule({
|
|
|
76
76
|
return;
|
|
77
77
|
}
|
|
78
78
|
|
|
79
|
-
// Add expression
|
|
79
|
+
// Add expression container's body if an expression container
|
|
80
80
|
if (isNodeOfType(node, 'JSXExpressionContainer')) {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
81
|
+
var expression = node.expression;
|
|
82
|
+
if (isNodeOfType(expression, 'ArrowFunctionExpression') || isNodeOfType(expression, 'FunctionExpression')) {
|
|
83
|
+
if (isNodeOfType(expression.body, 'JSXElement') || isNodeOfType(expression.body, 'JSXFragment')) {
|
|
84
|
+
searchExpression(expression.body);
|
|
85
|
+
} else if (isNodeOfType(expression.body, 'BlockStatement')) {
|
|
86
|
+
expression.body.body.forEach(function (statement) {
|
|
87
|
+
if (isNodeOfType(statement, 'ReturnStatement') && statement.argument) {
|
|
88
|
+
searchExpression(statement.argument);
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
} else if (isNodeOfType(expression, 'LogicalExpression')) {
|
|
93
|
+
var left = expression.left,
|
|
94
|
+
right = expression.right;
|
|
87
95
|
[left, right].forEach(function (e) {
|
|
88
|
-
|
|
89
|
-
searchNode(e, true);
|
|
90
|
-
}
|
|
96
|
+
searchExpression(e);
|
|
91
97
|
});
|
|
98
|
+
} else {
|
|
99
|
+
searchExpression(expression);
|
|
92
100
|
}
|
|
101
|
+
return;
|
|
93
102
|
}
|
|
94
103
|
|
|
95
104
|
// Skip if not a JSX Element
|
|
@@ -112,6 +121,13 @@ var rule = createLintRule({
|
|
|
112
121
|
searchNode(node);
|
|
113
122
|
}
|
|
114
123
|
};
|
|
124
|
+
var searchExpression = function searchExpression(expression) {
|
|
125
|
+
if (isNodeOfType(expression, 'JSXElement')) {
|
|
126
|
+
searchNode(expression, true);
|
|
127
|
+
} else if (isNodeOfType(expression, 'JSXFragment')) {
|
|
128
|
+
searchJSXFragment(expression);
|
|
129
|
+
}
|
|
130
|
+
};
|
|
115
131
|
var searchNode = function searchNode(node) {
|
|
116
132
|
var searchSelf = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
117
133
|
if (searchSelf) {
|
|
@@ -130,6 +146,22 @@ var rule = createLintRule({
|
|
|
130
146
|
_iterator.f();
|
|
131
147
|
}
|
|
132
148
|
};
|
|
149
|
+
var searchJSXFragment = function searchJSXFragment(node) {
|
|
150
|
+
if (isNodeOfType(node, 'JSXFragment')) {
|
|
151
|
+
var _iterator2 = _createForOfIteratorHelper(node.children),
|
|
152
|
+
_step2;
|
|
153
|
+
try {
|
|
154
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
155
|
+
var child = _step2.value;
|
|
156
|
+
checkNode(child);
|
|
157
|
+
}
|
|
158
|
+
} catch (err) {
|
|
159
|
+
_iterator2.e(err);
|
|
160
|
+
} finally {
|
|
161
|
+
_iterator2.f();
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
};
|
|
133
165
|
if (name === defaultImportLocalName) {
|
|
134
166
|
searchNode(node);
|
|
135
167
|
|
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.19.
|
|
4
|
+
"version": "13.19.4",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"publishConfig": {
|
|
@@ -43,9 +43,9 @@
|
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"@atlaskit/eslint-utils": "^2.0.0",
|
|
46
|
-
"@atlaskit/icon": "^27.
|
|
47
|
-
"@atlaskit/icon-lab": "^5.
|
|
48
|
-
"@atlaskit/tokens": "^
|
|
46
|
+
"@atlaskit/icon": "^27.11.0",
|
|
47
|
+
"@atlaskit/icon-lab": "^5.4.0",
|
|
48
|
+
"@atlaskit/tokens": "^6.0.0",
|
|
49
49
|
"@babel/runtime": "^7.0.0",
|
|
50
50
|
"@typescript-eslint/utils": "^7.1.0",
|
|
51
51
|
"ajv": "^6.12.6",
|
|
@@ -75,8 +75,7 @@
|
|
|
75
75
|
"jscodeshift": "^17.0.0",
|
|
76
76
|
"outdent": "^0.5.0",
|
|
77
77
|
"react": "^18.2.0",
|
|
78
|
-
"ts-jest": "^29.2.2"
|
|
79
|
-
"typescript": "~5.4.2"
|
|
78
|
+
"ts-jest": "^29.2.2"
|
|
80
79
|
},
|
|
81
80
|
"scripts": {
|
|
82
81
|
"ak-postbuild": "cp -r configs dist",
|