@atlaskit/eslint-plugin-design-system 10.12.0 → 10.12.1
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,13 @@
|
|
|
1
1
|
# @atlaskit/eslint-plugin-design-system
|
|
2
2
|
|
|
3
|
+
## 10.12.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#124216](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/124216)
|
|
8
|
+
[`66f55374a6828`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/66f55374a6828) -
|
|
9
|
+
use-primitives-text bug fix for inline ESlint ignore statements.
|
|
10
|
+
|
|
3
11
|
## 10.12.0
|
|
4
12
|
|
|
5
13
|
### Minor Changes
|
|
@@ -63,12 +63,16 @@ var JSXElementHelper = exports.JSXElement = exports.JSXElementHelper = {
|
|
|
63
63
|
return fix;
|
|
64
64
|
},
|
|
65
65
|
getChildren: function getChildren(node) {
|
|
66
|
-
// Filter out text children with whitespace characters only as JSX removes whitespace used for intendation
|
|
67
66
|
var filteredChildren = node.children.filter(function (child) {
|
|
67
|
+
// Filter out text children with whitespace characters only as JSX removes whitespace used for intendation
|
|
68
68
|
if ((0, _eslintCodemodUtils.isNodeOfType)(child, 'JSXText')) {
|
|
69
69
|
var whiteSpaceChars = new RegExp('\\s', 'g');
|
|
70
70
|
return !whiteSpaceChars.test(child.value);
|
|
71
71
|
}
|
|
72
|
+
// Filter out empty JSX expressions, for example JSX expression containing comments only, including eslint ignore comments
|
|
73
|
+
if ((0, _eslintCodemodUtils.isNodeOfType)(child, 'JSXExpressionContainer')) {
|
|
74
|
+
return !(0, _eslintCodemodUtils.isNodeOfType)(child.expression, 'JSXEmptyExpression');
|
|
75
|
+
}
|
|
72
76
|
return true;
|
|
73
77
|
});
|
|
74
78
|
return filteredChildren;
|
|
@@ -57,12 +57,16 @@ export const JSXElementHelper = {
|
|
|
57
57
|
return fix;
|
|
58
58
|
},
|
|
59
59
|
getChildren(node) {
|
|
60
|
-
// Filter out text children with whitespace characters only as JSX removes whitespace used for intendation
|
|
61
60
|
const filteredChildren = node.children.filter(child => {
|
|
61
|
+
// Filter out text children with whitespace characters only as JSX removes whitespace used for intendation
|
|
62
62
|
if (isNodeOfType(child, 'JSXText')) {
|
|
63
63
|
const whiteSpaceChars = new RegExp('\\s', 'g');
|
|
64
64
|
return !whiteSpaceChars.test(child.value);
|
|
65
65
|
}
|
|
66
|
+
// Filter out empty JSX expressions, for example JSX expression containing comments only, including eslint ignore comments
|
|
67
|
+
if (isNodeOfType(child, 'JSXExpressionContainer')) {
|
|
68
|
+
return !isNodeOfType(child.expression, 'JSXEmptyExpression');
|
|
69
|
+
}
|
|
66
70
|
return true;
|
|
67
71
|
});
|
|
68
72
|
return filteredChildren;
|
|
@@ -57,12 +57,16 @@ export var JSXElementHelper = {
|
|
|
57
57
|
return fix;
|
|
58
58
|
},
|
|
59
59
|
getChildren: function getChildren(node) {
|
|
60
|
-
// Filter out text children with whitespace characters only as JSX removes whitespace used for intendation
|
|
61
60
|
var filteredChildren = node.children.filter(function (child) {
|
|
61
|
+
// Filter out text children with whitespace characters only as JSX removes whitespace used for intendation
|
|
62
62
|
if (isNodeOfType(child, 'JSXText')) {
|
|
63
63
|
var whiteSpaceChars = new RegExp('\\s', 'g');
|
|
64
64
|
return !whiteSpaceChars.test(child.value);
|
|
65
65
|
}
|
|
66
|
+
// Filter out empty JSX expressions, for example JSX expression containing comments only, including eslint ignore comments
|
|
67
|
+
if (isNodeOfType(child, 'JSXExpressionContainer')) {
|
|
68
|
+
return !isNodeOfType(child.expression, 'JSXEmptyExpression');
|
|
69
|
+
}
|
|
66
70
|
return true;
|
|
67
71
|
});
|
|
68
72
|
return filteredChildren;
|
package/package.json
CHANGED