@atlaskit/eslint-plugin-design-system 10.11.2 → 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 +17 -0
- package/README.md +1 -1
- package/dist/cjs/ast-nodes/jsx-element.js +5 -1
- package/dist/cjs/presets/recommended.codegen.js +2 -1
- package/dist/cjs/rules/no-html-anchor/index.js +1 -1
- package/dist/es2019/ast-nodes/jsx-element.js +5 -1
- package/dist/es2019/presets/recommended.codegen.js +2 -1
- package/dist/es2019/rules/no-html-anchor/index.js +1 -1
- package/dist/esm/ast-nodes/jsx-element.js +5 -1
- package/dist/esm/presets/recommended.codegen.js +2 -1
- package/dist/esm/rules/no-html-anchor/index.js +1 -1
- package/dist/types/index.codegen.d.ts +1 -0
- package/dist/types/presets/recommended.codegen.d.ts +2 -1
- package/dist/types-ts4.5/index.codegen.d.ts +1 -0
- package/dist/types-ts4.5/presets/recommended.codegen.d.ts +2 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
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
|
+
|
|
11
|
+
## 10.12.0
|
|
12
|
+
|
|
13
|
+
### Minor Changes
|
|
14
|
+
|
|
15
|
+
- [#123319](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/123319)
|
|
16
|
+
[`33c44e0d8f875`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/33c44e0d8f875) -
|
|
17
|
+
Enabled linting rule to discourage direct usage of HTML anchor elements in favor of Atlassian
|
|
18
|
+
Design System link components
|
|
19
|
+
|
|
3
20
|
## 10.11.2
|
|
4
21
|
|
|
5
22
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -63,7 +63,7 @@ module.exports = {
|
|
|
63
63
|
| <a href="./src/rules/no-empty-styled-expression/README.md">no-empty-styled-expression</a> | Forbids any styled expression to be used when passing empty arguments to styled.div() (or other JSX elements). | Yes | | |
|
|
64
64
|
| <a href="./src/rules/no-exported-css/README.md">no-exported-css</a> | Forbid exporting `css` function calls. Exporting `css` function calls can result in unexpected behaviour at runtime, and is not statically analysable. | Yes | | |
|
|
65
65
|
| <a href="./src/rules/no-exported-keyframes/README.md">no-exported-keyframes</a> | Forbid exporting `keyframes` function calls. Exporting `css` function calls can result in unexpected behaviour at runtime, and is not statically analysable. | Yes | | |
|
|
66
|
-
| <a href="./src/rules/no-html-anchor/README.md">no-html-anchor</a> | Discourage direct usage of HTML anchor elements in favor of Atlassian Design System link components. |
|
|
66
|
+
| <a href="./src/rules/no-html-anchor/README.md">no-html-anchor</a> | Discourage direct usage of HTML anchor elements in favor of Atlassian Design System link components. | Yes | | |
|
|
67
67
|
| <a href="./src/rules/no-html-button/README.md">no-html-button</a> | Discourage direct usage of HTML button elements in favor of Atlassian Design System button components. | Yes | | |
|
|
68
68
|
| <a href="./src/rules/no-invalid-css-map/README.md">no-invalid-css-map</a> | Checks the validity of a CSS map created through cssMap. This is intended to be used alongside TypeScript's type-checking. | Yes | | |
|
|
69
69
|
| <a href="./src/rules/no-keyframes-tagged-template-expression/README.md">no-keyframes-tagged-template-expression</a> | Disallows any `keyframe` tagged template expressions that originate from Emotion, Styled Components or Compiled | | Yes | |
|
|
@@ -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;
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
/**
|
|
8
8
|
* THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
9
|
-
* @codegen <<SignedSource::
|
|
9
|
+
* @codegen <<SignedSource::a620cfa5339ecfe9527af26afe5121e4>>
|
|
10
10
|
* @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system codegen
|
|
11
11
|
*/
|
|
12
12
|
var _default = exports.default = {
|
|
@@ -23,6 +23,7 @@ var _default = exports.default = {
|
|
|
23
23
|
'@atlaskit/design-system/no-empty-styled-expression': 'warn',
|
|
24
24
|
'@atlaskit/design-system/no-exported-css': 'warn',
|
|
25
25
|
'@atlaskit/design-system/no-exported-keyframes': 'warn',
|
|
26
|
+
'@atlaskit/design-system/no-html-anchor': 'warn',
|
|
26
27
|
'@atlaskit/design-system/no-html-button': 'warn',
|
|
27
28
|
'@atlaskit/design-system/no-invalid-css-map': 'error',
|
|
28
29
|
'@atlaskit/design-system/no-nested-styles': 'error',
|
|
@@ -12,7 +12,7 @@ var rule = (0, _createRule.createLintRule)({
|
|
|
12
12
|
type: 'suggestion',
|
|
13
13
|
docs: {
|
|
14
14
|
description: 'Discourage direct usage of HTML anchor elements in favor of Atlassian Design System link components.',
|
|
15
|
-
recommended:
|
|
15
|
+
recommended: true,
|
|
16
16
|
severity: 'warn'
|
|
17
17
|
},
|
|
18
18
|
messages: {
|
|
@@ -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;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
3
|
-
* @codegen <<SignedSource::
|
|
3
|
+
* @codegen <<SignedSource::a620cfa5339ecfe9527af26afe5121e4>>
|
|
4
4
|
* @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system codegen
|
|
5
5
|
*/
|
|
6
6
|
export default {
|
|
@@ -17,6 +17,7 @@ export default {
|
|
|
17
17
|
'@atlaskit/design-system/no-empty-styled-expression': 'warn',
|
|
18
18
|
'@atlaskit/design-system/no-exported-css': 'warn',
|
|
19
19
|
'@atlaskit/design-system/no-exported-keyframes': 'warn',
|
|
20
|
+
'@atlaskit/design-system/no-html-anchor': 'warn',
|
|
20
21
|
'@atlaskit/design-system/no-html-button': 'warn',
|
|
21
22
|
'@atlaskit/design-system/no-invalid-css-map': 'error',
|
|
22
23
|
'@atlaskit/design-system/no-nested-styles': 'error',
|
|
@@ -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;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
3
|
-
* @codegen <<SignedSource::
|
|
3
|
+
* @codegen <<SignedSource::a620cfa5339ecfe9527af26afe5121e4>>
|
|
4
4
|
* @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system codegen
|
|
5
5
|
*/
|
|
6
6
|
export default {
|
|
@@ -17,6 +17,7 @@ export default {
|
|
|
17
17
|
'@atlaskit/design-system/no-empty-styled-expression': 'warn',
|
|
18
18
|
'@atlaskit/design-system/no-exported-css': 'warn',
|
|
19
19
|
'@atlaskit/design-system/no-exported-keyframes': 'warn',
|
|
20
|
+
'@atlaskit/design-system/no-html-anchor': 'warn',
|
|
20
21
|
'@atlaskit/design-system/no-html-button': 'warn',
|
|
21
22
|
'@atlaskit/design-system/no-invalid-css-map': 'error',
|
|
22
23
|
'@atlaskit/design-system/no-nested-styles': 'error',
|
|
@@ -60,6 +60,7 @@ export declare const configs: {
|
|
|
60
60
|
'@atlaskit/design-system/no-empty-styled-expression': string;
|
|
61
61
|
'@atlaskit/design-system/no-exported-css': string;
|
|
62
62
|
'@atlaskit/design-system/no-exported-keyframes': string;
|
|
63
|
+
'@atlaskit/design-system/no-html-anchor': string;
|
|
63
64
|
'@atlaskit/design-system/no-html-button': string;
|
|
64
65
|
'@atlaskit/design-system/no-invalid-css-map': string;
|
|
65
66
|
'@atlaskit/design-system/no-nested-styles': string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
3
|
-
* @codegen <<SignedSource::
|
|
3
|
+
* @codegen <<SignedSource::a620cfa5339ecfe9527af26afe5121e4>>
|
|
4
4
|
* @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system codegen
|
|
5
5
|
*/
|
|
6
6
|
declare const _default: {
|
|
@@ -17,6 +17,7 @@ declare const _default: {
|
|
|
17
17
|
'@atlaskit/design-system/no-empty-styled-expression': string;
|
|
18
18
|
'@atlaskit/design-system/no-exported-css': string;
|
|
19
19
|
'@atlaskit/design-system/no-exported-keyframes': string;
|
|
20
|
+
'@atlaskit/design-system/no-html-anchor': string;
|
|
20
21
|
'@atlaskit/design-system/no-html-button': string;
|
|
21
22
|
'@atlaskit/design-system/no-invalid-css-map': string;
|
|
22
23
|
'@atlaskit/design-system/no-nested-styles': string;
|
|
@@ -60,6 +60,7 @@ export declare const configs: {
|
|
|
60
60
|
'@atlaskit/design-system/no-empty-styled-expression': string;
|
|
61
61
|
'@atlaskit/design-system/no-exported-css': string;
|
|
62
62
|
'@atlaskit/design-system/no-exported-keyframes': string;
|
|
63
|
+
'@atlaskit/design-system/no-html-anchor': string;
|
|
63
64
|
'@atlaskit/design-system/no-html-button': string;
|
|
64
65
|
'@atlaskit/design-system/no-invalid-css-map': string;
|
|
65
66
|
'@atlaskit/design-system/no-nested-styles': string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
3
|
-
* @codegen <<SignedSource::
|
|
3
|
+
* @codegen <<SignedSource::a620cfa5339ecfe9527af26afe5121e4>>
|
|
4
4
|
* @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system codegen
|
|
5
5
|
*/
|
|
6
6
|
declare const _default: {
|
|
@@ -17,6 +17,7 @@ declare const _default: {
|
|
|
17
17
|
'@atlaskit/design-system/no-empty-styled-expression': string;
|
|
18
18
|
'@atlaskit/design-system/no-exported-css': string;
|
|
19
19
|
'@atlaskit/design-system/no-exported-keyframes': string;
|
|
20
|
+
'@atlaskit/design-system/no-html-anchor': string;
|
|
20
21
|
'@atlaskit/design-system/no-html-button': string;
|
|
21
22
|
'@atlaskit/design-system/no-invalid-css-map': string;
|
|
22
23
|
'@atlaskit/design-system/no-nested-styles': string;
|
package/package.json
CHANGED