@atlaskit/eslint-plugin-design-system 8.31.0 → 8.32.0
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 +6 -0
- package/README.md +1 -0
- package/constellation/consistent-css-prop-usage/usage.mdx +1 -1
- package/constellation/index/usage.mdx +1 -0
- package/constellation/no-css-tagged-template-expression/usage.mdx +1 -1
- package/constellation/no-empty-styled-expression/usage.mdx +1 -1
- package/constellation/no-exported-css/usage.mdx +2 -2
- package/constellation/no-exported-keyframes/usage.mdx +2 -2
- package/constellation/no-html-button-element/usage.mdx +26 -0
- package/constellation/no-keyframes-tagged-template-expression/usage.mdx +1 -3
- package/constellation/no-styled-tagged-template-expression/usage.mdx +2 -4
- package/dist/cjs/presets/all.codegen.js +2 -1
- package/dist/cjs/rules/index.codegen.js +3 -1
- package/dist/cjs/rules/no-html-button-element/index.js +107 -0
- package/dist/cjs/rules/no-html-button-element/utils.js +18 -0
- package/dist/cjs/rules/prefer-primitives/utils.js +1 -1
- package/dist/es2019/presets/all.codegen.js +2 -1
- package/dist/es2019/rules/index.codegen.js +3 -1
- package/dist/es2019/rules/no-html-button-element/index.js +101 -0
- package/dist/es2019/rules/no-html-button-element/utils.js +12 -0
- package/dist/es2019/rules/prefer-primitives/utils.js +1 -1
- package/dist/esm/presets/all.codegen.js +2 -1
- package/dist/esm/rules/index.codegen.js +3 -1
- package/dist/esm/rules/no-html-button-element/index.js +101 -0
- package/dist/esm/rules/no-html-button-element/utils.js +12 -0
- package/dist/esm/rules/prefer-primitives/utils.js +1 -1
- package/dist/types/index.codegen.d.ts +1 -0
- package/dist/types/presets/all.codegen.d.ts +2 -1
- package/dist/types/rules/index.codegen.d.ts +1 -0
- package/dist/types/rules/no-html-button-element/index.d.ts +3 -0
- package/dist/types/rules/no-html-button-element/utils.d.ts +2 -0
- package/dist/types-ts4.5/index.codegen.d.ts +1 -0
- package/dist/types-ts4.5/presets/all.codegen.d.ts +2 -1
- package/dist/types-ts4.5/rules/index.codegen.d.ts +1 -0
- package/dist/types-ts4.5/rules/no-html-button-element/index.d.ts +3 -0
- package/dist/types-ts4.5/rules/no-html-button-element/utils.d.ts +2 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @atlaskit/eslint-plugin-design-system
|
|
2
2
|
|
|
3
|
+
## 8.32.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#58240](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/58240) [`39f3c929f0c4`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/39f3c929f0c4) - Add new rule `no-html-button-element` to enforce usage of Pressable and Button
|
|
8
|
+
|
|
3
9
|
## 8.31.0
|
|
4
10
|
|
|
5
11
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -61,6 +61,7 @@ module.exports = {
|
|
|
61
61
|
| <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 | | |
|
|
62
62
|
| <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 | | |
|
|
63
63
|
| <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 | | |
|
|
64
|
+
| <a href="./src/rules/no-html-button-element/README.md">no-html-button-element</a> | Prevent direct usage of HTML button elements and enforce usage of Button and Pressable. | | | |
|
|
64
65
|
| <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 | | |
|
|
65
66
|
| <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 | |
|
|
66
67
|
| <a href="./src/rules/no-margin/README.md">no-margin</a> | Disallow using the margin CSS property. | | | |
|
|
@@ -165,7 +165,7 @@ Defaults to `top`.
|
|
|
165
165
|
|
|
166
166
|
### cssImportSource
|
|
167
167
|
|
|
168
|
-
When auto-fixing the contents of the `css` attribute, this rule will wrap CSS styles in a `css(...)` function call or `` css
|
|
168
|
+
When auto-fixing the contents of the `css` attribute, this rule will wrap CSS styles in a `css(...)` function call or `` css`...` `` template expression, and it will add an import declaration for the `css` function. `cssImportSource` is a string that determines what package `css` should be imported from.
|
|
169
169
|
|
|
170
170
|
This is `@compiled/react` by default.
|
|
171
171
|
|
|
@@ -23,6 +23,7 @@ This plugin contains rules that should be used when working with the [Atlassian
|
|
|
23
23
|
| <a href="no-empty-styled-expression/usage">no-empty-styled-expression</a> | Forbids any styled expression to be used when passing empty arguments to styled.div() (or other JSX elements). | Yes | | |
|
|
24
24
|
| <a href="no-exported-css/usage">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 | | |
|
|
25
25
|
| <a href="no-exported-keyframes/usage">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 | | |
|
|
26
|
+
| <a href="no-html-button-element/usage">no-html-button-element</a> | Prevent direct usage of HTML button elements and enforce usage of Button and Pressable. | | | |
|
|
26
27
|
| <a href="no-invalid-css-map/usage">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 | | |
|
|
27
28
|
| <a href="no-keyframes-tagged-template-expression/usage">no-keyframes-tagged-template-expression</a> | Disallows any `keyframe` tagged template expressions that originate from Emotion, Styled Components or Compiled | | Yes | |
|
|
28
29
|
| <a href="no-margin/usage">no-margin</a> | Disallow using the margin CSS property. | | | |
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# no-css-tagged-template-expression
|
|
2
2
|
|
|
3
|
-
Disallows any `css` tagged template expressions that originate from `@
|
|
3
|
+
Disallows any `css` tagged template expressions that originate from a CSS-in-JS library, including `@atlaskit/css`, `@compiled/react`, Emotion, and `styled-components`.
|
|
4
4
|
|
|
5
5
|
Tagged template expressions cannot be type safe and are difficult to parse correctly. Will auto fix ` css`` ` to the preferred `css({})` call expression syntax.
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# no-empty-styled-expression
|
|
2
2
|
|
|
3
|
-
Disallows/discourages passing empty arguments to any `styled` expression when using
|
|
3
|
+
Disallows/discourages passing empty arguments to any `styled` expression when using a CSS-in-JS library, including `@atlaskit/css`, `@compiled/react`, Emotion, and `styled-components`.
|
|
4
4
|
|
|
5
5
|
If Compiled is used in the file, passing an empty object or no object at all causes Compiled to build extra `div/span` elements, as opposed to simply using a `div`. This leads to reduced performance and is greatly discouraged. If a wrapper is necessary, opt to use a `div` or wrap it in the empty React fragment `<> <YourComponentHere></YourComponentHere> </>`.
|
|
6
6
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# no-exported-css
|
|
2
2
|
|
|
3
|
-
Disallows `css` export declarations that originate from
|
|
3
|
+
Disallows `css` export declarations that originate from a CSS-in-JS library, including `@atlaskit/css`, `@compiled/react`, Emotion, and `styled-components`.
|
|
4
4
|
|
|
5
|
-
In Compiled, exporting css declarations may result in unexpected errors when imported, because its value will be `null` at runtime. Additionally, co-locating css definitions with their usage is considered best practice in order to improve code readability and build performance.
|
|
5
|
+
In Compiled (`@atlaskit/css` and `@compiled/react`), exporting `css` declarations may result in unexpected errors when imported, because its value will be `null` at runtime. Additionally, co-locating `css` definitions with their usage is considered best practice in order to improve code readability and build performance.
|
|
6
6
|
|
|
7
7
|
## Examples
|
|
8
8
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# no-exported-keyframes
|
|
2
2
|
|
|
3
|
-
Disallows `keyframes` export declarations that originate from
|
|
3
|
+
Disallows `keyframes` export declarations that originate from a CSS-in-JS library, including `@atlaskit/css`, `@compiled/react`, Emotion, and `styled-components`.
|
|
4
4
|
|
|
5
|
-
In Compiled, exporting keyframes declarations may result in unexpected errors when imported, because its value will be `null` at runtime. Additionally, co-locating keyframes definitions with their usage is considered best practice in order to improve code readability and build performance.
|
|
5
|
+
In Compiled (`@atlaskit/css` and `@compiled/react`), exporting `keyframes` declarations may result in unexpected errors when imported, because its value will be `null` at runtime. Additionally, co-locating `keyframes` definitions with their usage is considered best practice in order to improve code readability and build performance.
|
|
6
6
|
|
|
7
7
|
## Examples
|
|
8
8
|
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# no-html-button-element
|
|
2
|
+
|
|
3
|
+
HTML `<button>` elements should not be used. They can be replaced using the Button component or the Pressable primitive, which are ready made solutions made by the Atlassian Design System Team. This benefits analytics as they are fitted with tracking by default and provide safe access to design tokens for styling.
|
|
4
|
+
|
|
5
|
+
## Examples
|
|
6
|
+
|
|
7
|
+
This rule marks code as violations when it can be replaced with either a Button component or a Pressable primitive.
|
|
8
|
+
|
|
9
|
+
### Incorrect
|
|
10
|
+
|
|
11
|
+
```js
|
|
12
|
+
<button>Click me</button>
|
|
13
|
+
^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
### Correct
|
|
17
|
+
|
|
18
|
+
```js
|
|
19
|
+
<Button>Click me</Button>
|
|
20
|
+
^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
```js
|
|
24
|
+
<Pressable>Click me</Pressable>
|
|
25
|
+
^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
26
|
+
```
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
# no-keyframes-tagged-template-expression
|
|
2
2
|
|
|
3
|
-
Disallows any `keyframes` tagged template expressions that originate from `@
|
|
3
|
+
Disallows any `keyframes` tagged template expressions that originate from a CSS-in-JS library, including `@atlaskit/css`, `@compiled/react`, Emotion, and `styled-components`.
|
|
4
4
|
|
|
5
5
|
Tagged template expressions are difficult to parse correctly (which can lead to more frequent build failures or invalid CSS generation), have limited type safety, and lack syntax highlighting. These problems can be avoided by using the preferred call expression syntax instead.
|
|
6
6
|
|
|
7
7
|
Thank you to the [Compiled team for their rule](https://github.com/atlassian-labs/compiled/tree/master/packages/eslint-plugin/src/rules/no-keyframes-tagged-template-expression) from which this was ported.
|
|
8
8
|
|
|
9
|
-
---
|
|
10
|
-
|
|
11
9
|
The `--fix` option on the command line automatically fixes problems reported by this rule.
|
|
12
10
|
|
|
13
11
|
## Examples
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
# no-styled-tagged-template-expression
|
|
2
2
|
|
|
3
|
-
Disallows any `styled` tagged template expressions that originate from `@
|
|
3
|
+
Disallows any `styled` tagged template expressions that originate from a CSS-in-JS library, including `@atlaskit/css`, `@compiled/react`, Emotion, and `styled-components`.
|
|
4
4
|
|
|
5
5
|
Tagged template expressions are difficult to parse correctly (which can lead to more frequent build failures or invalid CSS generation), have limited type safety, and lack syntax highlighting. These problems can be avoided by using the preferred call expression syntax instead.
|
|
6
6
|
|
|
7
|
-
---
|
|
8
|
-
|
|
9
7
|
The `--fix` option on the command line automatically fixes problems reported by this rule.
|
|
10
8
|
|
|
11
9
|
## Examples
|
|
@@ -87,4 +85,4 @@ export const Component = styled.div``;
|
|
|
87
85
|
|
|
88
86
|
## Limitations
|
|
89
87
|
|
|
90
|
-
- Comments are not fixable
|
|
88
|
+
- Comments are not fixable.
|
|
@@ -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::bcb633b9d5c2def00d43b11139433c5c>>
|
|
10
10
|
* @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system codegen
|
|
11
11
|
*/
|
|
12
12
|
var _default = exports.default = {
|
|
@@ -24,6 +24,7 @@ var _default = exports.default = {
|
|
|
24
24
|
'@atlaskit/design-system/no-empty-styled-expression': 'warn',
|
|
25
25
|
'@atlaskit/design-system/no-exported-css': 'warn',
|
|
26
26
|
'@atlaskit/design-system/no-exported-keyframes': 'warn',
|
|
27
|
+
'@atlaskit/design-system/no-html-button-element': 'warn',
|
|
27
28
|
'@atlaskit/design-system/no-invalid-css-map': 'error',
|
|
28
29
|
'@atlaskit/design-system/no-keyframes-tagged-template-expression': 'error',
|
|
29
30
|
'@atlaskit/design-system/no-margin': 'warn',
|
|
@@ -17,6 +17,7 @@ var _noDeprecatedImports = _interopRequireDefault(require("./no-deprecated-impor
|
|
|
17
17
|
var _noEmptyStyledExpression = _interopRequireDefault(require("./no-empty-styled-expression"));
|
|
18
18
|
var _noExportedCss = _interopRequireDefault(require("./no-exported-css"));
|
|
19
19
|
var _noExportedKeyframes = _interopRequireDefault(require("./no-exported-keyframes"));
|
|
20
|
+
var _noHtmlButtonElement = _interopRequireDefault(require("./no-html-button-element"));
|
|
20
21
|
var _noInvalidCssMap = _interopRequireDefault(require("./no-invalid-css-map"));
|
|
21
22
|
var _noKeyframesTaggedTemplateExpression = _interopRequireDefault(require("./no-keyframes-tagged-template-expression"));
|
|
22
23
|
var _noMargin = _interopRequireDefault(require("./no-margin"));
|
|
@@ -36,7 +37,7 @@ var _usePrimitivesText = _interopRequireDefault(require("./use-primitives-text")
|
|
|
36
37
|
var _useVisuallyHidden = _interopRequireDefault(require("./use-visually-hidden"));
|
|
37
38
|
/**
|
|
38
39
|
* THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
39
|
-
* @codegen <<SignedSource::
|
|
40
|
+
* @codegen <<SignedSource::23062a8759ba919facf30a402e5546bd>>
|
|
40
41
|
* @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system codegen
|
|
41
42
|
*/
|
|
42
43
|
var _default = exports.default = {
|
|
@@ -52,6 +53,7 @@ var _default = exports.default = {
|
|
|
52
53
|
'no-empty-styled-expression': _noEmptyStyledExpression.default,
|
|
53
54
|
'no-exported-css': _noExportedCss.default,
|
|
54
55
|
'no-exported-keyframes': _noExportedKeyframes.default,
|
|
56
|
+
'no-html-button-element': _noHtmlButtonElement.default,
|
|
55
57
|
'no-invalid-css-map': _noInvalidCssMap.default,
|
|
56
58
|
'no-keyframes-tagged-template-expression': _noKeyframesTaggedTemplateExpression.default,
|
|
57
59
|
'no-margin': _noMargin.default,
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _eslintCodemodUtils = require("eslint-codemod-utils");
|
|
8
|
+
var _createRule = require("../utils/create-rule");
|
|
9
|
+
var _utils = require("./utils");
|
|
10
|
+
// eslint-disable-next-line import/no-extraneous-dependencies
|
|
11
|
+
|
|
12
|
+
var buttonDocsUrl = 'https://atlassian.design/components/button';
|
|
13
|
+
var pressableDocsUrl = 'https://atlassian.design/components/primitives/pressable/';
|
|
14
|
+
var rule = (0, _createRule.createLintRule)({
|
|
15
|
+
meta: {
|
|
16
|
+
name: 'no-html-button-element',
|
|
17
|
+
type: 'suggestion',
|
|
18
|
+
hasSuggestions: false,
|
|
19
|
+
docs: {
|
|
20
|
+
description: 'Prevent direct usage of HTML button elements and enforce usage of Button and Pressable.',
|
|
21
|
+
recommended: false,
|
|
22
|
+
severity: 'warn'
|
|
23
|
+
},
|
|
24
|
+
messages: {
|
|
25
|
+
noHtmlButtonElement: "This \"{{element}}\" should be replaced with a Button component. If beyond the capabilities of the Button component, use the Pressable primitive. See ".concat(buttonDocsUrl, " and ").concat(pressableDocsUrl, " for guidance.")
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
create: function create(context) {
|
|
29
|
+
return {
|
|
30
|
+
// Look for <button> HTML elements
|
|
31
|
+
// Look for styled calls/templates - styled.button(...)
|
|
32
|
+
JSXOpeningElement: function JSXOpeningElement(node) {
|
|
33
|
+
if (!(0, _eslintCodemodUtils.isNodeOfType)(node, 'JSXOpeningElement')) {
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
if (!(0, _eslintCodemodUtils.isNodeOfType)(node.name, 'JSXIdentifier')) {
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
var suggest = (0, _utils.shouldSuggest)(node === null || node === void 0 ? void 0 : node.parent);
|
|
40
|
+
if (suggest) {
|
|
41
|
+
context.report({
|
|
42
|
+
node: node,
|
|
43
|
+
messageId: 'noHtmlButtonElement',
|
|
44
|
+
data: {
|
|
45
|
+
element: node.name.name
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
// styled.button`` | styled2.button`` | styled.button()
|
|
51
|
+
'MemberExpression[object.name="styled"],MemberExpression[object.name="styled2"]': function MemberExpressionObjectNameStyledMemberExpressionObjectNameStyled2(node) {
|
|
52
|
+
if (!(0, _eslintCodemodUtils.isNodeOfType)(node, 'MemberExpression')) {
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// styled.button``
|
|
57
|
+
if ((0, _eslintCodemodUtils.isNodeOfType)(node.property, 'Identifier')) {
|
|
58
|
+
if (node.property.name === 'button') {
|
|
59
|
+
var styledIdentifier = node.object.name;
|
|
60
|
+
var elementName = node.property.name;
|
|
61
|
+
|
|
62
|
+
// Including the `styled.` portion in the message to help makers understand it's not just the `button` element that should be replaced
|
|
63
|
+
var reportName = "".concat(styledIdentifier, ".").concat(elementName); // styled.button
|
|
64
|
+
|
|
65
|
+
context.report({
|
|
66
|
+
node: node,
|
|
67
|
+
messageId: 'noHtmlButtonElement',
|
|
68
|
+
data: {
|
|
69
|
+
element: reportName
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
// styled(X)``
|
|
76
|
+
'CallExpression[callee.name="styled"]': function CallExpressionCalleeNameStyled(node) {
|
|
77
|
+
if (!(0, _eslintCodemodUtils.isNodeOfType)(node, 'CallExpression')) {
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
// styled('button')`` - We only care about 'button', ignore extending other components
|
|
82
|
+
if ((0, _eslintCodemodUtils.isNodeOfType)(node.arguments[0], 'Literal')) {
|
|
83
|
+
var argValue = node.arguments[0].raw;
|
|
84
|
+
if (typeof argValue === 'string') {
|
|
85
|
+
var suggest = argValue.replaceAll("'", '') === 'button';
|
|
86
|
+
if (suggest) {
|
|
87
|
+
var styledIdentifier = node.callee.name;
|
|
88
|
+
var elementName = argValue;
|
|
89
|
+
|
|
90
|
+
// Including the `styled()` portion in the message to help makers understand it's not just the `button` element that should be replaced
|
|
91
|
+
var reportName = "".concat(styledIdentifier, "(").concat(elementName, ")"); // styled('button')
|
|
92
|
+
|
|
93
|
+
context.report({
|
|
94
|
+
node: node,
|
|
95
|
+
messageId: 'noHtmlButtonElement',
|
|
96
|
+
data: {
|
|
97
|
+
element: reportName
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
});
|
|
107
|
+
var _default = exports.default = rule;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.shouldSuggest = void 0;
|
|
7
|
+
var isButtonHtmlElement = function isButtonHtmlElement(node) {
|
|
8
|
+
return node.openingElement.name.name === 'button';
|
|
9
|
+
};
|
|
10
|
+
var shouldSuggest = exports.shouldSuggest = function shouldSuggest(node) {
|
|
11
|
+
if (!node) {
|
|
12
|
+
return false;
|
|
13
|
+
}
|
|
14
|
+
if (!isButtonHtmlElement(node)) {
|
|
15
|
+
return false;
|
|
16
|
+
}
|
|
17
|
+
return true;
|
|
18
|
+
};
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.validPrimitiveElements = exports.shouldSuggest = void 0;
|
|
7
7
|
var _eslintCodemodUtils = require("eslint-codemod-utils");
|
|
8
|
-
var validPrimitiveElements = exports.validPrimitiveElements = new Set(['div', 'span', 'article', 'aside', 'dialog', 'footer', 'header', 'li', 'main', 'nav', 'ol', 'section', 'ul']);
|
|
8
|
+
var validPrimitiveElements = exports.validPrimitiveElements = new Set(['div', 'span', 'article', 'aside', 'dialog', 'footer', 'header', 'li', 'main', 'nav', 'ol', 'section', 'ul', 'button']);
|
|
9
9
|
var getChildrenByType = function getChildrenByType(node, types) {
|
|
10
10
|
return node.children.filter(function (child) {
|
|
11
11
|
return types.find(function (type) {
|
|
@@ -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::bcb633b9d5c2def00d43b11139433c5c>>
|
|
4
4
|
* @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system codegen
|
|
5
5
|
*/
|
|
6
6
|
export default {
|
|
@@ -18,6 +18,7 @@ export default {
|
|
|
18
18
|
'@atlaskit/design-system/no-empty-styled-expression': 'warn',
|
|
19
19
|
'@atlaskit/design-system/no-exported-css': 'warn',
|
|
20
20
|
'@atlaskit/design-system/no-exported-keyframes': 'warn',
|
|
21
|
+
'@atlaskit/design-system/no-html-button-element': 'warn',
|
|
21
22
|
'@atlaskit/design-system/no-invalid-css-map': 'error',
|
|
22
23
|
'@atlaskit/design-system/no-keyframes-tagged-template-expression': 'error',
|
|
23
24
|
'@atlaskit/design-system/no-margin': 'warn',
|
|
@@ -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::23062a8759ba919facf30a402e5546bd>>
|
|
4
4
|
* @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system codegen
|
|
5
5
|
*/
|
|
6
6
|
import consistentCssPropUsage from './consistent-css-prop-usage';
|
|
@@ -15,6 +15,7 @@ import noDeprecatedImports from './no-deprecated-imports';
|
|
|
15
15
|
import noEmptyStyledExpression from './no-empty-styled-expression';
|
|
16
16
|
import noExportedCss from './no-exported-css';
|
|
17
17
|
import noExportedKeyframes from './no-exported-keyframes';
|
|
18
|
+
import noHtmlButtonElement from './no-html-button-element';
|
|
18
19
|
import noInvalidCssMap from './no-invalid-css-map';
|
|
19
20
|
import noKeyframesTaggedTemplateExpression from './no-keyframes-tagged-template-expression';
|
|
20
21
|
import noMargin from './no-margin';
|
|
@@ -45,6 +46,7 @@ export default {
|
|
|
45
46
|
'no-empty-styled-expression': noEmptyStyledExpression,
|
|
46
47
|
'no-exported-css': noExportedCss,
|
|
47
48
|
'no-exported-keyframes': noExportedKeyframes,
|
|
49
|
+
'no-html-button-element': noHtmlButtonElement,
|
|
48
50
|
'no-invalid-css-map': noInvalidCssMap,
|
|
49
51
|
'no-keyframes-tagged-template-expression': noKeyframesTaggedTemplateExpression,
|
|
50
52
|
'no-margin': noMargin,
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
// eslint-disable-next-line import/no-extraneous-dependencies
|
|
2
|
+
|
|
3
|
+
import { isNodeOfType } from 'eslint-codemod-utils';
|
|
4
|
+
import { createLintRule } from '../utils/create-rule';
|
|
5
|
+
import { shouldSuggest } from './utils';
|
|
6
|
+
const buttonDocsUrl = 'https://atlassian.design/components/button';
|
|
7
|
+
const pressableDocsUrl = 'https://atlassian.design/components/primitives/pressable/';
|
|
8
|
+
const rule = createLintRule({
|
|
9
|
+
meta: {
|
|
10
|
+
name: 'no-html-button-element',
|
|
11
|
+
type: 'suggestion',
|
|
12
|
+
hasSuggestions: false,
|
|
13
|
+
docs: {
|
|
14
|
+
description: 'Prevent direct usage of HTML button elements and enforce usage of Button and Pressable.',
|
|
15
|
+
recommended: false,
|
|
16
|
+
severity: 'warn'
|
|
17
|
+
},
|
|
18
|
+
messages: {
|
|
19
|
+
noHtmlButtonElement: `This "{{element}}" should be replaced with a Button component. If beyond the capabilities of the Button component, use the Pressable primitive. See ${buttonDocsUrl} and ${pressableDocsUrl} for guidance.`
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
create(context) {
|
|
23
|
+
return {
|
|
24
|
+
// Look for <button> HTML elements
|
|
25
|
+
// Look for styled calls/templates - styled.button(...)
|
|
26
|
+
JSXOpeningElement(node) {
|
|
27
|
+
if (!isNodeOfType(node, 'JSXOpeningElement')) {
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
if (!isNodeOfType(node.name, 'JSXIdentifier')) {
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
const suggest = shouldSuggest(node === null || node === void 0 ? void 0 : node.parent);
|
|
34
|
+
if (suggest) {
|
|
35
|
+
context.report({
|
|
36
|
+
node: node,
|
|
37
|
+
messageId: 'noHtmlButtonElement',
|
|
38
|
+
data: {
|
|
39
|
+
element: node.name.name
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
// styled.button`` | styled2.button`` | styled.button()
|
|
45
|
+
'MemberExpression[object.name="styled"],MemberExpression[object.name="styled2"]': node => {
|
|
46
|
+
if (!isNodeOfType(node, 'MemberExpression')) {
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// styled.button``
|
|
51
|
+
if (isNodeOfType(node.property, 'Identifier')) {
|
|
52
|
+
if (node.property.name === 'button') {
|
|
53
|
+
const styledIdentifier = node.object.name;
|
|
54
|
+
const elementName = node.property.name;
|
|
55
|
+
|
|
56
|
+
// Including the `styled.` portion in the message to help makers understand it's not just the `button` element that should be replaced
|
|
57
|
+
const reportName = `${styledIdentifier}.${elementName}`; // styled.button
|
|
58
|
+
|
|
59
|
+
context.report({
|
|
60
|
+
node: node,
|
|
61
|
+
messageId: 'noHtmlButtonElement',
|
|
62
|
+
data: {
|
|
63
|
+
element: reportName
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
// styled(X)``
|
|
70
|
+
'CallExpression[callee.name="styled"]': node => {
|
|
71
|
+
if (!isNodeOfType(node, 'CallExpression')) {
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// styled('button')`` - We only care about 'button', ignore extending other components
|
|
76
|
+
if (isNodeOfType(node.arguments[0], 'Literal')) {
|
|
77
|
+
const argValue = node.arguments[0].raw;
|
|
78
|
+
if (typeof argValue === 'string') {
|
|
79
|
+
const suggest = argValue.replaceAll(`'`, '') === 'button';
|
|
80
|
+
if (suggest) {
|
|
81
|
+
const styledIdentifier = node.callee.name;
|
|
82
|
+
const elementName = argValue;
|
|
83
|
+
|
|
84
|
+
// Including the `styled()` portion in the message to help makers understand it's not just the `button` element that should be replaced
|
|
85
|
+
const reportName = `${styledIdentifier}(${elementName})`; // styled('button')
|
|
86
|
+
|
|
87
|
+
context.report({
|
|
88
|
+
node: node,
|
|
89
|
+
messageId: 'noHtmlButtonElement',
|
|
90
|
+
data: {
|
|
91
|
+
element: reportName
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
export default rule;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { isNodeOfType } from 'eslint-codemod-utils';
|
|
2
|
-
export const validPrimitiveElements = new Set(['div', 'span', 'article', 'aside', 'dialog', 'footer', 'header', 'li', 'main', 'nav', 'ol', 'section', 'ul']);
|
|
2
|
+
export const validPrimitiveElements = new Set(['div', 'span', 'article', 'aside', 'dialog', 'footer', 'header', 'li', 'main', 'nav', 'ol', 'section', 'ul', 'button']);
|
|
3
3
|
const getChildrenByType = (node, types) => {
|
|
4
4
|
return node.children.filter(child => {
|
|
5
5
|
return types.find(type => isNodeOfType(child, type));
|
|
@@ -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::bcb633b9d5c2def00d43b11139433c5c>>
|
|
4
4
|
* @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system codegen
|
|
5
5
|
*/
|
|
6
6
|
export default {
|
|
@@ -18,6 +18,7 @@ export default {
|
|
|
18
18
|
'@atlaskit/design-system/no-empty-styled-expression': 'warn',
|
|
19
19
|
'@atlaskit/design-system/no-exported-css': 'warn',
|
|
20
20
|
'@atlaskit/design-system/no-exported-keyframes': 'warn',
|
|
21
|
+
'@atlaskit/design-system/no-html-button-element': 'warn',
|
|
21
22
|
'@atlaskit/design-system/no-invalid-css-map': 'error',
|
|
22
23
|
'@atlaskit/design-system/no-keyframes-tagged-template-expression': 'error',
|
|
23
24
|
'@atlaskit/design-system/no-margin': 'warn',
|
|
@@ -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::23062a8759ba919facf30a402e5546bd>>
|
|
4
4
|
* @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system codegen
|
|
5
5
|
*/
|
|
6
6
|
import consistentCssPropUsage from './consistent-css-prop-usage';
|
|
@@ -15,6 +15,7 @@ import noDeprecatedImports from './no-deprecated-imports';
|
|
|
15
15
|
import noEmptyStyledExpression from './no-empty-styled-expression';
|
|
16
16
|
import noExportedCss from './no-exported-css';
|
|
17
17
|
import noExportedKeyframes from './no-exported-keyframes';
|
|
18
|
+
import noHtmlButtonElement from './no-html-button-element';
|
|
18
19
|
import noInvalidCssMap from './no-invalid-css-map';
|
|
19
20
|
import noKeyframesTaggedTemplateExpression from './no-keyframes-tagged-template-expression';
|
|
20
21
|
import noMargin from './no-margin';
|
|
@@ -45,6 +46,7 @@ export default {
|
|
|
45
46
|
'no-empty-styled-expression': noEmptyStyledExpression,
|
|
46
47
|
'no-exported-css': noExportedCss,
|
|
47
48
|
'no-exported-keyframes': noExportedKeyframes,
|
|
49
|
+
'no-html-button-element': noHtmlButtonElement,
|
|
48
50
|
'no-invalid-css-map': noInvalidCssMap,
|
|
49
51
|
'no-keyframes-tagged-template-expression': noKeyframesTaggedTemplateExpression,
|
|
50
52
|
'no-margin': noMargin,
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
// eslint-disable-next-line import/no-extraneous-dependencies
|
|
2
|
+
|
|
3
|
+
import { isNodeOfType } from 'eslint-codemod-utils';
|
|
4
|
+
import { createLintRule } from '../utils/create-rule';
|
|
5
|
+
import { shouldSuggest } from './utils';
|
|
6
|
+
var buttonDocsUrl = 'https://atlassian.design/components/button';
|
|
7
|
+
var pressableDocsUrl = 'https://atlassian.design/components/primitives/pressable/';
|
|
8
|
+
var rule = createLintRule({
|
|
9
|
+
meta: {
|
|
10
|
+
name: 'no-html-button-element',
|
|
11
|
+
type: 'suggestion',
|
|
12
|
+
hasSuggestions: false,
|
|
13
|
+
docs: {
|
|
14
|
+
description: 'Prevent direct usage of HTML button elements and enforce usage of Button and Pressable.',
|
|
15
|
+
recommended: false,
|
|
16
|
+
severity: 'warn'
|
|
17
|
+
},
|
|
18
|
+
messages: {
|
|
19
|
+
noHtmlButtonElement: "This \"{{element}}\" should be replaced with a Button component. If beyond the capabilities of the Button component, use the Pressable primitive. See ".concat(buttonDocsUrl, " and ").concat(pressableDocsUrl, " for guidance.")
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
create: function create(context) {
|
|
23
|
+
return {
|
|
24
|
+
// Look for <button> HTML elements
|
|
25
|
+
// Look for styled calls/templates - styled.button(...)
|
|
26
|
+
JSXOpeningElement: function JSXOpeningElement(node) {
|
|
27
|
+
if (!isNodeOfType(node, 'JSXOpeningElement')) {
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
if (!isNodeOfType(node.name, 'JSXIdentifier')) {
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
var suggest = shouldSuggest(node === null || node === void 0 ? void 0 : node.parent);
|
|
34
|
+
if (suggest) {
|
|
35
|
+
context.report({
|
|
36
|
+
node: node,
|
|
37
|
+
messageId: 'noHtmlButtonElement',
|
|
38
|
+
data: {
|
|
39
|
+
element: node.name.name
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
// styled.button`` | styled2.button`` | styled.button()
|
|
45
|
+
'MemberExpression[object.name="styled"],MemberExpression[object.name="styled2"]': function MemberExpressionObjectNameStyledMemberExpressionObjectNameStyled2(node) {
|
|
46
|
+
if (!isNodeOfType(node, 'MemberExpression')) {
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// styled.button``
|
|
51
|
+
if (isNodeOfType(node.property, 'Identifier')) {
|
|
52
|
+
if (node.property.name === 'button') {
|
|
53
|
+
var styledIdentifier = node.object.name;
|
|
54
|
+
var elementName = node.property.name;
|
|
55
|
+
|
|
56
|
+
// Including the `styled.` portion in the message to help makers understand it's not just the `button` element that should be replaced
|
|
57
|
+
var reportName = "".concat(styledIdentifier, ".").concat(elementName); // styled.button
|
|
58
|
+
|
|
59
|
+
context.report({
|
|
60
|
+
node: node,
|
|
61
|
+
messageId: 'noHtmlButtonElement',
|
|
62
|
+
data: {
|
|
63
|
+
element: reportName
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
// styled(X)``
|
|
70
|
+
'CallExpression[callee.name="styled"]': function CallExpressionCalleeNameStyled(node) {
|
|
71
|
+
if (!isNodeOfType(node, 'CallExpression')) {
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// styled('button')`` - We only care about 'button', ignore extending other components
|
|
76
|
+
if (isNodeOfType(node.arguments[0], 'Literal')) {
|
|
77
|
+
var argValue = node.arguments[0].raw;
|
|
78
|
+
if (typeof argValue === 'string') {
|
|
79
|
+
var suggest = argValue.replaceAll("'", '') === 'button';
|
|
80
|
+
if (suggest) {
|
|
81
|
+
var styledIdentifier = node.callee.name;
|
|
82
|
+
var elementName = argValue;
|
|
83
|
+
|
|
84
|
+
// Including the `styled()` portion in the message to help makers understand it's not just the `button` element that should be replaced
|
|
85
|
+
var reportName = "".concat(styledIdentifier, "(").concat(elementName, ")"); // styled('button')
|
|
86
|
+
|
|
87
|
+
context.report({
|
|
88
|
+
node: node,
|
|
89
|
+
messageId: 'noHtmlButtonElement',
|
|
90
|
+
data: {
|
|
91
|
+
element: reportName
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
export default rule;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
var isButtonHtmlElement = function isButtonHtmlElement(node) {
|
|
2
|
+
return node.openingElement.name.name === 'button';
|
|
3
|
+
};
|
|
4
|
+
export var shouldSuggest = function shouldSuggest(node) {
|
|
5
|
+
if (!node) {
|
|
6
|
+
return false;
|
|
7
|
+
}
|
|
8
|
+
if (!isButtonHtmlElement(node)) {
|
|
9
|
+
return false;
|
|
10
|
+
}
|
|
11
|
+
return true;
|
|
12
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { isNodeOfType } from 'eslint-codemod-utils';
|
|
2
|
-
export var validPrimitiveElements = new Set(['div', 'span', 'article', 'aside', 'dialog', 'footer', 'header', 'li', 'main', 'nav', 'ol', 'section', 'ul']);
|
|
2
|
+
export var validPrimitiveElements = new Set(['div', 'span', 'article', 'aside', 'dialog', 'footer', 'header', 'li', 'main', 'nav', 'ol', 'section', 'ul', 'button']);
|
|
3
3
|
var getChildrenByType = function getChildrenByType(node, types) {
|
|
4
4
|
return node.children.filter(function (child) {
|
|
5
5
|
return types.find(function (type) {
|
|
@@ -15,6 +15,7 @@ export declare const configs: {
|
|
|
15
15
|
'@atlaskit/design-system/no-empty-styled-expression': string;
|
|
16
16
|
'@atlaskit/design-system/no-exported-css': string;
|
|
17
17
|
'@atlaskit/design-system/no-exported-keyframes': string;
|
|
18
|
+
'@atlaskit/design-system/no-html-button-element': string;
|
|
18
19
|
'@atlaskit/design-system/no-invalid-css-map': string;
|
|
19
20
|
'@atlaskit/design-system/no-keyframes-tagged-template-expression': string;
|
|
20
21
|
'@atlaskit/design-system/no-margin': 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::bcb633b9d5c2def00d43b11139433c5c>>
|
|
4
4
|
* @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system codegen
|
|
5
5
|
*/
|
|
6
6
|
declare const _default: {
|
|
@@ -18,6 +18,7 @@ declare const _default: {
|
|
|
18
18
|
'@atlaskit/design-system/no-empty-styled-expression': string;
|
|
19
19
|
'@atlaskit/design-system/no-exported-css': string;
|
|
20
20
|
'@atlaskit/design-system/no-exported-keyframes': string;
|
|
21
|
+
'@atlaskit/design-system/no-html-button-element': string;
|
|
21
22
|
'@atlaskit/design-system/no-invalid-css-map': string;
|
|
22
23
|
'@atlaskit/design-system/no-keyframes-tagged-template-expression': string;
|
|
23
24
|
'@atlaskit/design-system/no-margin': string;
|
|
@@ -15,6 +15,7 @@ declare const _default: {
|
|
|
15
15
|
'no-empty-styled-expression': import("eslint").Rule.RuleModule;
|
|
16
16
|
'no-exported-css': import("eslint").Rule.RuleModule;
|
|
17
17
|
'no-exported-keyframes': import("eslint").Rule.RuleModule;
|
|
18
|
+
'no-html-button-element': import("eslint").Rule.RuleModule;
|
|
18
19
|
'no-invalid-css-map': import("eslint").Rule.RuleModule;
|
|
19
20
|
'no-keyframes-tagged-template-expression': import("eslint").Rule.RuleModule;
|
|
20
21
|
'no-margin': import("eslint").Rule.RuleModule;
|
|
@@ -15,6 +15,7 @@ export declare const configs: {
|
|
|
15
15
|
'@atlaskit/design-system/no-empty-styled-expression': string;
|
|
16
16
|
'@atlaskit/design-system/no-exported-css': string;
|
|
17
17
|
'@atlaskit/design-system/no-exported-keyframes': string;
|
|
18
|
+
'@atlaskit/design-system/no-html-button-element': string;
|
|
18
19
|
'@atlaskit/design-system/no-invalid-css-map': string;
|
|
19
20
|
'@atlaskit/design-system/no-keyframes-tagged-template-expression': string;
|
|
20
21
|
'@atlaskit/design-system/no-margin': 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::bcb633b9d5c2def00d43b11139433c5c>>
|
|
4
4
|
* @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system codegen
|
|
5
5
|
*/
|
|
6
6
|
declare const _default: {
|
|
@@ -18,6 +18,7 @@ declare const _default: {
|
|
|
18
18
|
'@atlaskit/design-system/no-empty-styled-expression': string;
|
|
19
19
|
'@atlaskit/design-system/no-exported-css': string;
|
|
20
20
|
'@atlaskit/design-system/no-exported-keyframes': string;
|
|
21
|
+
'@atlaskit/design-system/no-html-button-element': string;
|
|
21
22
|
'@atlaskit/design-system/no-invalid-css-map': string;
|
|
22
23
|
'@atlaskit/design-system/no-keyframes-tagged-template-expression': string;
|
|
23
24
|
'@atlaskit/design-system/no-margin': string;
|
|
@@ -19,6 +19,7 @@ declare const _default: {
|
|
|
19
19
|
'no-empty-styled-expression': import("eslint").Rule.RuleModule;
|
|
20
20
|
'no-exported-css': import("eslint").Rule.RuleModule;
|
|
21
21
|
'no-exported-keyframes': import("eslint").Rule.RuleModule;
|
|
22
|
+
'no-html-button-element': import("eslint").Rule.RuleModule;
|
|
22
23
|
'no-invalid-css-map': import("eslint").Rule.RuleModule;
|
|
23
24
|
'no-keyframes-tagged-template-expression': import("eslint").Rule.RuleModule;
|
|
24
25
|
'no-margin': import("eslint").Rule.RuleModule;
|
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": "8.
|
|
4
|
+
"version": "8.32.0",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"registry": "https://registry.npmjs.org/"
|