@atlaskit/eslint-plugin-design-system 15.2.0 → 15.3.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 CHANGED
@@ -1,5 +1,12 @@
1
1
  # @atlaskit/eslint-plugin-design-system
2
2
 
3
+ ## 15.3.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`c012f03a95a5a`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/c012f03a95a5a) -
8
+ Remove modal `autoFocus` rule because type has been updated to remove unwanted case.
9
+
3
10
  ## 15.2.0
4
11
 
5
12
  ### Minor Changes
package/README.md CHANGED
@@ -59,7 +59,6 @@ module.exports = {
59
59
  | <a href="./src/rules/icon-label/README.md">icon-label</a> | Enforces accessible usage of icon labels when composed with Atlassian Design System components. | Yes | Yes | |
60
60
  | <a href="./src/rules/lozenge-badge-tag-labelling-system-migration/README.md">lozenge-badge-tag-labelling-system-migration</a> | Helps migrate Lozenge isBold prop, Badge appearance values, and SimpleTag/RemovableTag components as part of the Labelling System Phase 1 migration. | | Yes | |
61
61
  | <a href="./src/rules/no-banned-imports/README.md">no-banned-imports</a> | Disallow importing banned modules. | Yes | | |
62
- | <a href="./src/rules/no-boolean-autofocus-on-modal-dialog/README.md">no-boolean-autofocus-on-modal-dialog</a> | Encourages makers to not use boolean values for `autoFocus` on Atlassian Design System's modal dialog component. | Yes | | |
63
62
  | <a href="./src/rules/no-css-tagged-template-expression/README.md">no-css-tagged-template-expression</a> | Disallows any `css` tagged template expressions that originate from Emotion, Styled Components or Compiled | | Yes | |
64
63
  | <a href="./src/rules/no-dark-theme-vr-tests/README.md">no-dark-theme-vr-tests</a> | Disallow using dark colorScheme in VR tests. | | Yes | |
65
64
  | <a href="./src/rules/no-deprecated-apis/README.md">no-deprecated-apis</a> | Disallow using deprecated APIs. | Yes | | |
@@ -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::eb0cc6324a0dfa4a3a11b16ab0a6cd4f>>
9
+ * @codegen <<SignedSource::5a52fa9f987063b4d0d9e825b02a6067>>
10
10
  * @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system codegen
11
11
  */
12
12
 
@@ -24,7 +24,6 @@ var rules = {
24
24
  '@atlaskit/design-system/icon-label': 'warn',
25
25
  '@atlaskit/design-system/lozenge-badge-tag-labelling-system-migration': 'warn',
26
26
  '@atlaskit/design-system/no-banned-imports': 'error',
27
- '@atlaskit/design-system/no-boolean-autofocus-on-modal-dialog': 'warn',
28
27
  '@atlaskit/design-system/no-css-tagged-template-expression': 'error',
29
28
  '@atlaskit/design-system/no-dark-theme-vr-tests': 'error',
30
29
  '@atlaskit/design-system/no-deprecated-apis': 'error',
@@ -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::80cbd12c57061c4fb2660da2e808210f>>
9
+ * @codegen <<SignedSource::458994db7ee4b74c7fcbd2157dc4496e>>
10
10
  * @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system codegen
11
11
  */
12
12
 
@@ -23,7 +23,6 @@ var rules = {
23
23
  '@atlaskit/design-system/icon-label': 'warn',
24
24
  '@atlaskit/design-system/lozenge-badge-tag-labelling-system-migration': 'warn',
25
25
  '@atlaskit/design-system/no-banned-imports': 'error',
26
- '@atlaskit/design-system/no-boolean-autofocus-on-modal-dialog': 'warn',
27
26
  '@atlaskit/design-system/no-css-tagged-template-expression': 'error',
28
27
  '@atlaskit/design-system/no-dark-theme-vr-tests': 'error',
29
28
  '@atlaskit/design-system/no-deprecated-apis': 'error',
@@ -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::80b81104d52bdf5ca1b99e6265b83cef>>
9
+ * @codegen <<SignedSource::753093c364736633c291ea7cd16fbb92>>
10
10
  * @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system codegen
11
11
  */
12
12
 
@@ -19,7 +19,6 @@ var rules = {
19
19
  '@atlaskit/design-system/ensure-design-token-usage': 'error',
20
20
  '@atlaskit/design-system/icon-label': 'warn',
21
21
  '@atlaskit/design-system/no-banned-imports': 'error',
22
- '@atlaskit/design-system/no-boolean-autofocus-on-modal-dialog': 'warn',
23
22
  '@atlaskit/design-system/no-deprecated-apis': 'error',
24
23
  '@atlaskit/design-system/no-deprecated-design-token-usage': 'warn',
25
24
  '@atlaskit/design-system/no-deprecated-imports': 'error',
@@ -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::c7aa5d4ccdf62d54c12e1d5344a38fb8>>
9
+ * @codegen <<SignedSource::7cae0a4365766a3c1b06c8ab29cc7711>>
10
10
  * @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system codegen
11
11
  */
12
12
 
@@ -18,7 +18,6 @@ var rules = {
18
18
  '@atlaskit/design-system/ensure-design-token-usage': 'error',
19
19
  '@atlaskit/design-system/icon-label': 'warn',
20
20
  '@atlaskit/design-system/no-banned-imports': 'error',
21
- '@atlaskit/design-system/no-boolean-autofocus-on-modal-dialog': 'warn',
22
21
  '@atlaskit/design-system/no-deprecated-apis': 'error',
23
22
  '@atlaskit/design-system/no-deprecated-design-token-usage': 'warn',
24
23
  '@atlaskit/design-system/no-deprecated-imports': 'error',
@@ -15,7 +15,6 @@ var _ensureProperXcssUsage = _interopRequireDefault(require("./ensure-proper-xcs
15
15
  var _iconLabel = _interopRequireDefault(require("./icon-label"));
16
16
  var _lozengeBadgeTagLabellingSystemMigration = _interopRequireDefault(require("./lozenge-badge-tag-labelling-system-migration"));
17
17
  var _noBannedImports = _interopRequireDefault(require("./no-banned-imports"));
18
- var _noBooleanAutofocusOnModalDialog = _interopRequireDefault(require("./no-boolean-autofocus-on-modal-dialog"));
19
18
  var _noCssTaggedTemplateExpression = _interopRequireDefault(require("./no-css-tagged-template-expression"));
20
19
  var _noDarkThemeVrTests = _interopRequireDefault(require("./no-dark-theme-vr-tests"));
21
20
  var _noDeprecatedApis = _interopRequireDefault(require("./no-deprecated-apis"));
@@ -86,7 +85,7 @@ var _useTokensTypography = _interopRequireDefault(require("./use-tokens-typograp
86
85
  var _useVisuallyHidden = _interopRequireDefault(require("./use-visually-hidden"));
87
86
  /**
88
87
  * THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
89
- * @codegen <<SignedSource::d404a0bd62a78d4bad7ee376df0bd475>>
88
+ * @codegen <<SignedSource::d527850500d4518cc654415fd5f4fbc0>>
90
89
  * @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system codegen
91
90
  */
92
91
 
@@ -101,7 +100,6 @@ var rules = exports.rules = {
101
100
  'icon-label': _iconLabel.default,
102
101
  'lozenge-badge-tag-labelling-system-migration': _lozengeBadgeTagLabellingSystemMigration.default,
103
102
  'no-banned-imports': _noBannedImports.default,
104
- 'no-boolean-autofocus-on-modal-dialog': _noBooleanAutofocusOnModalDialog.default,
105
103
  'no-css-tagged-template-expression': _noCssTaggedTemplateExpression.default,
106
104
  'no-dark-theme-vr-tests': _noDarkThemeVrTests.default,
107
105
  'no-deprecated-apis': _noDeprecatedApis.default,
@@ -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::eb0cc6324a0dfa4a3a11b16ab0a6cd4f>>
3
+ * @codegen <<SignedSource::5a52fa9f987063b4d0d9e825b02a6067>>
4
4
  * @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system codegen
5
5
  */
6
6
 
@@ -18,7 +18,6 @@ const rules = {
18
18
  '@atlaskit/design-system/icon-label': 'warn',
19
19
  '@atlaskit/design-system/lozenge-badge-tag-labelling-system-migration': 'warn',
20
20
  '@atlaskit/design-system/no-banned-imports': 'error',
21
- '@atlaskit/design-system/no-boolean-autofocus-on-modal-dialog': 'warn',
22
21
  '@atlaskit/design-system/no-css-tagged-template-expression': 'error',
23
22
  '@atlaskit/design-system/no-dark-theme-vr-tests': 'error',
24
23
  '@atlaskit/design-system/no-deprecated-apis': 'error',
@@ -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::80cbd12c57061c4fb2660da2e808210f>>
3
+ * @codegen <<SignedSource::458994db7ee4b74c7fcbd2157dc4496e>>
4
4
  * @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system codegen
5
5
  */
6
6
 
@@ -17,7 +17,6 @@ const rules = {
17
17
  '@atlaskit/design-system/icon-label': 'warn',
18
18
  '@atlaskit/design-system/lozenge-badge-tag-labelling-system-migration': 'warn',
19
19
  '@atlaskit/design-system/no-banned-imports': 'error',
20
- '@atlaskit/design-system/no-boolean-autofocus-on-modal-dialog': 'warn',
21
20
  '@atlaskit/design-system/no-css-tagged-template-expression': 'error',
22
21
  '@atlaskit/design-system/no-dark-theme-vr-tests': 'error',
23
22
  '@atlaskit/design-system/no-deprecated-apis': 'error',
@@ -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::80b81104d52bdf5ca1b99e6265b83cef>>
3
+ * @codegen <<SignedSource::753093c364736633c291ea7cd16fbb92>>
4
4
  * @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system codegen
5
5
  */
6
6
 
@@ -13,7 +13,6 @@ const rules = {
13
13
  '@atlaskit/design-system/ensure-design-token-usage': 'error',
14
14
  '@atlaskit/design-system/icon-label': 'warn',
15
15
  '@atlaskit/design-system/no-banned-imports': 'error',
16
- '@atlaskit/design-system/no-boolean-autofocus-on-modal-dialog': 'warn',
17
16
  '@atlaskit/design-system/no-deprecated-apis': 'error',
18
17
  '@atlaskit/design-system/no-deprecated-design-token-usage': 'warn',
19
18
  '@atlaskit/design-system/no-deprecated-imports': 'error',
@@ -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::c7aa5d4ccdf62d54c12e1d5344a38fb8>>
3
+ * @codegen <<SignedSource::7cae0a4365766a3c1b06c8ab29cc7711>>
4
4
  * @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system codegen
5
5
  */
6
6
 
@@ -12,7 +12,6 @@ const rules = {
12
12
  '@atlaskit/design-system/ensure-design-token-usage': 'error',
13
13
  '@atlaskit/design-system/icon-label': 'warn',
14
14
  '@atlaskit/design-system/no-banned-imports': 'error',
15
- '@atlaskit/design-system/no-boolean-autofocus-on-modal-dialog': 'warn',
16
15
  '@atlaskit/design-system/no-deprecated-apis': 'error',
17
16
  '@atlaskit/design-system/no-deprecated-design-token-usage': 'warn',
18
17
  '@atlaskit/design-system/no-deprecated-imports': 'error',
@@ -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::d404a0bd62a78d4bad7ee376df0bd475>>
3
+ * @codegen <<SignedSource::d527850500d4518cc654415fd5f4fbc0>>
4
4
  * @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system codegen
5
5
  */
6
6
 
@@ -14,7 +14,6 @@ import ensureProperXcssUsage from './ensure-proper-xcss-usage';
14
14
  import iconLabel from './icon-label';
15
15
  import lozengeBadgeTagLabellingSystemMigration from './lozenge-badge-tag-labelling-system-migration';
16
16
  import noBannedImports from './no-banned-imports';
17
- import noBooleanAutofocusOnModalDialog from './no-boolean-autofocus-on-modal-dialog';
18
17
  import noCssTaggedTemplateExpression from './no-css-tagged-template-expression';
19
18
  import noDarkThemeVrTests from './no-dark-theme-vr-tests';
20
19
  import noDeprecatedApis from './no-deprecated-apis';
@@ -94,7 +93,6 @@ export const rules = {
94
93
  'icon-label': iconLabel,
95
94
  'lozenge-badge-tag-labelling-system-migration': lozengeBadgeTagLabellingSystemMigration,
96
95
  'no-banned-imports': noBannedImports,
97
- 'no-boolean-autofocus-on-modal-dialog': noBooleanAutofocusOnModalDialog,
98
96
  'no-css-tagged-template-expression': noCssTaggedTemplateExpression,
99
97
  'no-dark-theme-vr-tests': noDarkThemeVrTests,
100
98
  'no-deprecated-apis': noDeprecatedApis,
@@ -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::eb0cc6324a0dfa4a3a11b16ab0a6cd4f>>
3
+ * @codegen <<SignedSource::5a52fa9f987063b4d0d9e825b02a6067>>
4
4
  * @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system codegen
5
5
  */
6
6
 
@@ -18,7 +18,6 @@ var rules = {
18
18
  '@atlaskit/design-system/icon-label': 'warn',
19
19
  '@atlaskit/design-system/lozenge-badge-tag-labelling-system-migration': 'warn',
20
20
  '@atlaskit/design-system/no-banned-imports': 'error',
21
- '@atlaskit/design-system/no-boolean-autofocus-on-modal-dialog': 'warn',
22
21
  '@atlaskit/design-system/no-css-tagged-template-expression': 'error',
23
22
  '@atlaskit/design-system/no-dark-theme-vr-tests': 'error',
24
23
  '@atlaskit/design-system/no-deprecated-apis': 'error',
@@ -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::80cbd12c57061c4fb2660da2e808210f>>
3
+ * @codegen <<SignedSource::458994db7ee4b74c7fcbd2157dc4496e>>
4
4
  * @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system codegen
5
5
  */
6
6
 
@@ -17,7 +17,6 @@ var rules = {
17
17
  '@atlaskit/design-system/icon-label': 'warn',
18
18
  '@atlaskit/design-system/lozenge-badge-tag-labelling-system-migration': 'warn',
19
19
  '@atlaskit/design-system/no-banned-imports': 'error',
20
- '@atlaskit/design-system/no-boolean-autofocus-on-modal-dialog': 'warn',
21
20
  '@atlaskit/design-system/no-css-tagged-template-expression': 'error',
22
21
  '@atlaskit/design-system/no-dark-theme-vr-tests': 'error',
23
22
  '@atlaskit/design-system/no-deprecated-apis': 'error',
@@ -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::80b81104d52bdf5ca1b99e6265b83cef>>
3
+ * @codegen <<SignedSource::753093c364736633c291ea7cd16fbb92>>
4
4
  * @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system codegen
5
5
  */
6
6
 
@@ -13,7 +13,6 @@ var rules = {
13
13
  '@atlaskit/design-system/ensure-design-token-usage': 'error',
14
14
  '@atlaskit/design-system/icon-label': 'warn',
15
15
  '@atlaskit/design-system/no-banned-imports': 'error',
16
- '@atlaskit/design-system/no-boolean-autofocus-on-modal-dialog': 'warn',
17
16
  '@atlaskit/design-system/no-deprecated-apis': 'error',
18
17
  '@atlaskit/design-system/no-deprecated-design-token-usage': 'warn',
19
18
  '@atlaskit/design-system/no-deprecated-imports': 'error',
@@ -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::c7aa5d4ccdf62d54c12e1d5344a38fb8>>
3
+ * @codegen <<SignedSource::7cae0a4365766a3c1b06c8ab29cc7711>>
4
4
  * @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system codegen
5
5
  */
6
6
 
@@ -12,7 +12,6 @@ var rules = {
12
12
  '@atlaskit/design-system/ensure-design-token-usage': 'error',
13
13
  '@atlaskit/design-system/icon-label': 'warn',
14
14
  '@atlaskit/design-system/no-banned-imports': 'error',
15
- '@atlaskit/design-system/no-boolean-autofocus-on-modal-dialog': 'warn',
16
15
  '@atlaskit/design-system/no-deprecated-apis': 'error',
17
16
  '@atlaskit/design-system/no-deprecated-design-token-usage': 'warn',
18
17
  '@atlaskit/design-system/no-deprecated-imports': 'error',
@@ -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::d404a0bd62a78d4bad7ee376df0bd475>>
3
+ * @codegen <<SignedSource::d527850500d4518cc654415fd5f4fbc0>>
4
4
  * @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system codegen
5
5
  */
6
6
 
@@ -14,7 +14,6 @@ import ensureProperXcssUsage from './ensure-proper-xcss-usage';
14
14
  import iconLabel from './icon-label';
15
15
  import lozengeBadgeTagLabellingSystemMigration from './lozenge-badge-tag-labelling-system-migration';
16
16
  import noBannedImports from './no-banned-imports';
17
- import noBooleanAutofocusOnModalDialog from './no-boolean-autofocus-on-modal-dialog';
18
17
  import noCssTaggedTemplateExpression from './no-css-tagged-template-expression';
19
18
  import noDarkThemeVrTests from './no-dark-theme-vr-tests';
20
19
  import noDeprecatedApis from './no-deprecated-apis';
@@ -94,7 +93,6 @@ export var rules = {
94
93
  'icon-label': iconLabel,
95
94
  'lozenge-badge-tag-labelling-system-migration': lozengeBadgeTagLabellingSystemMigration,
96
95
  'no-banned-imports': noBannedImports,
97
- 'no-boolean-autofocus-on-modal-dialog': noBooleanAutofocusOnModalDialog,
98
96
  'no-css-tagged-template-expression': noCssTaggedTemplateExpression,
99
97
  'no-dark-theme-vr-tests': noDarkThemeVrTests,
100
98
  'no-deprecated-apis': noDeprecatedApis,
@@ -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::eb0cc6324a0dfa4a3a11b16ab0a6cd4f>>
3
+ * @codegen <<SignedSource::5a52fa9f987063b4d0d9e825b02a6067>>
4
4
  * @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system codegen
5
5
  */
6
6
  import type { Linter } from 'eslint';
@@ -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::80cbd12c57061c4fb2660da2e808210f>>
3
+ * @codegen <<SignedSource::458994db7ee4b74c7fcbd2157dc4496e>>
4
4
  * @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system codegen
5
5
  */
6
6
  import type { ESLint } from 'eslint';
@@ -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::80b81104d52bdf5ca1b99e6265b83cef>>
3
+ * @codegen <<SignedSource::753093c364736633c291ea7cd16fbb92>>
4
4
  * @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system codegen
5
5
  */
6
6
  import type { Linter } from 'eslint';
@@ -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::c7aa5d4ccdf62d54c12e1d5344a38fb8>>
3
+ * @codegen <<SignedSource::7cae0a4365766a3c1b06c8ab29cc7711>>
4
4
  * @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system codegen
5
5
  */
6
6
  import type { ESLint } from 'eslint';
@@ -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::d404a0bd62a78d4bad7ee376df0bd475>>
3
+ * @codegen <<SignedSource::d527850500d4518cc654415fd5f4fbc0>>
4
4
  * @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system codegen
5
5
  */
6
6
  import type { Rule } from 'eslint';
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": "15.2.0",
4
+ "version": "15.3.0",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
7
7
  "publishConfig": {
@@ -1,82 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.ruleName = exports.message = exports.default = void 0;
7
- var _eslintCodemodUtils = require("eslint-codemod-utils");
8
- var _jsxAttribute = require("../../ast-nodes/jsx-attribute");
9
- var _jsxElementHelper = require("../../ast-nodes/jsx-element-helper");
10
- var _createLintRule = require("../utils/create-lint-rule");
11
- var PROP_NAME = 'autoFocus';
12
-
13
- // Lint rule message
14
- var message = exports.message = "`autoFocus` should be set to a component's `ref` or left to resolve to the default value of `true`. It is recommended to leave it as is for a maximally accessible experience.";
15
- var ruleName = exports.ruleName = __dirname.split('/').slice(-1)[0];
16
- var rule = (0, _createLintRule.createLintRule)({
17
- meta: {
18
- name: ruleName,
19
- type: 'problem',
20
- docs: {
21
- description: "Encourages makers to not use boolean values for `autoFocus` on Atlassian Design System's modal dialog component.",
22
- recommended: true,
23
- severity: 'warn'
24
- },
25
- messages: {
26
- noBooleanForAutoFocus: message
27
- }
28
- },
29
- create: function create(context) {
30
- // List of component's locally imported names that match
31
- var defaultImportLocalName;
32
- return {
33
- // Only run rule in files where the package is imported
34
- ImportDeclaration: function ImportDeclaration(node) {
35
- // Ignore non-modal imports
36
- if (node.source.value !== '@atlaskit/modal-dialog') {
37
- return;
38
- }
39
- node.specifiers.filter(function (identifier) {
40
- return (0, _eslintCodemodUtils.isNodeOfType)(identifier, 'ImportDefaultSpecifier');
41
- }).forEach(function (identifier) {
42
- defaultImportLocalName = identifier.local.name;
43
- });
44
- },
45
- JSXElement: function JSXElement(node) {
46
- if (!(0, _eslintCodemodUtils.isNodeOfType)(node, 'JSXElement')) {
47
- return;
48
- }
49
- if (!(0, _eslintCodemodUtils.isNodeOfType)(node.openingElement.name, 'JSXIdentifier')) {
50
- return;
51
- }
52
- var name = node.openingElement.name.name;
53
- if (name !== defaultImportLocalName) {
54
- return;
55
- }
56
- var prop = _jsxElementHelper.JSXElementHelper.getAttributeByName(node, PROP_NAME);
57
-
58
- // if no autoFocus attribute exists, skip
59
- if (!prop) {
60
- return;
61
- }
62
- var attrValue = _jsxAttribute.JSXAttribute.getValue(prop);
63
- if (!attrValue) {
64
- return;
65
- }
66
- var type = attrValue.type,
67
- value = attrValue.value;
68
-
69
- // If the value is a boolean with value `false`
70
- if (type === 'ExpressionStatement Literal' && typeof value === 'boolean') {
71
- return context.report({
72
- node: node,
73
- messageId: 'noBooleanForAutoFocus'
74
- });
75
- }
76
- }
77
- };
78
- }
79
- });
80
-
81
- // eslint-disable-next-line @atlaskit/volt-strict-mode/no-multiple-exports
82
- var _default = exports.default = rule;
@@ -1,76 +0,0 @@
1
- import { isNodeOfType } from 'eslint-codemod-utils';
2
- import { JSXAttribute } from '../../ast-nodes/jsx-attribute';
3
- import { JSXElementHelper } from '../../ast-nodes/jsx-element-helper';
4
- import { createLintRule } from '../utils/create-lint-rule';
5
- const PROP_NAME = 'autoFocus';
6
-
7
- // Lint rule message
8
- export const message = "`autoFocus` should be set to a component's `ref` or left to resolve to the default value of `true`. It is recommended to leave it as is for a maximally accessible experience.";
9
- export const ruleName = __dirname.split('/').slice(-1)[0];
10
- const rule = createLintRule({
11
- meta: {
12
- name: ruleName,
13
- type: 'problem',
14
- docs: {
15
- description: "Encourages makers to not use boolean values for `autoFocus` on Atlassian Design System's modal dialog component.",
16
- recommended: true,
17
- severity: 'warn'
18
- },
19
- messages: {
20
- noBooleanForAutoFocus: message
21
- }
22
- },
23
- create(context) {
24
- // List of component's locally imported names that match
25
- let defaultImportLocalName;
26
- return {
27
- // Only run rule in files where the package is imported
28
- ImportDeclaration(node) {
29
- // Ignore non-modal imports
30
- if (node.source.value !== '@atlaskit/modal-dialog') {
31
- return;
32
- }
33
- node.specifiers.filter(identifier => isNodeOfType(identifier, 'ImportDefaultSpecifier')).forEach(identifier => {
34
- defaultImportLocalName = identifier.local.name;
35
- });
36
- },
37
- JSXElement(node) {
38
- if (!isNodeOfType(node, 'JSXElement')) {
39
- return;
40
- }
41
- if (!isNodeOfType(node.openingElement.name, 'JSXIdentifier')) {
42
- return;
43
- }
44
- const name = node.openingElement.name.name;
45
- if (name !== defaultImportLocalName) {
46
- return;
47
- }
48
- const prop = JSXElementHelper.getAttributeByName(node, PROP_NAME);
49
-
50
- // if no autoFocus attribute exists, skip
51
- if (!prop) {
52
- return;
53
- }
54
- const attrValue = JSXAttribute.getValue(prop);
55
- if (!attrValue) {
56
- return;
57
- }
58
- const {
59
- type,
60
- value
61
- } = attrValue;
62
-
63
- // If the value is a boolean with value `false`
64
- if (type === 'ExpressionStatement Literal' && typeof value === 'boolean') {
65
- return context.report({
66
- node,
67
- messageId: 'noBooleanForAutoFocus'
68
- });
69
- }
70
- }
71
- };
72
- }
73
- });
74
-
75
- // eslint-disable-next-line @atlaskit/volt-strict-mode/no-multiple-exports
76
- export default rule;
@@ -1,76 +0,0 @@
1
- import { isNodeOfType } from 'eslint-codemod-utils';
2
- import { JSXAttribute } from '../../ast-nodes/jsx-attribute';
3
- import { JSXElementHelper } from '../../ast-nodes/jsx-element-helper';
4
- import { createLintRule } from '../utils/create-lint-rule';
5
- var PROP_NAME = 'autoFocus';
6
-
7
- // Lint rule message
8
- export var message = "`autoFocus` should be set to a component's `ref` or left to resolve to the default value of `true`. It is recommended to leave it as is for a maximally accessible experience.";
9
- export var ruleName = __dirname.split('/').slice(-1)[0];
10
- var rule = createLintRule({
11
- meta: {
12
- name: ruleName,
13
- type: 'problem',
14
- docs: {
15
- description: "Encourages makers to not use boolean values for `autoFocus` on Atlassian Design System's modal dialog component.",
16
- recommended: true,
17
- severity: 'warn'
18
- },
19
- messages: {
20
- noBooleanForAutoFocus: message
21
- }
22
- },
23
- create: function create(context) {
24
- // List of component's locally imported names that match
25
- var defaultImportLocalName;
26
- return {
27
- // Only run rule in files where the package is imported
28
- ImportDeclaration: function ImportDeclaration(node) {
29
- // Ignore non-modal imports
30
- if (node.source.value !== '@atlaskit/modal-dialog') {
31
- return;
32
- }
33
- node.specifiers.filter(function (identifier) {
34
- return isNodeOfType(identifier, 'ImportDefaultSpecifier');
35
- }).forEach(function (identifier) {
36
- defaultImportLocalName = identifier.local.name;
37
- });
38
- },
39
- JSXElement: function JSXElement(node) {
40
- if (!isNodeOfType(node, 'JSXElement')) {
41
- return;
42
- }
43
- if (!isNodeOfType(node.openingElement.name, 'JSXIdentifier')) {
44
- return;
45
- }
46
- var name = node.openingElement.name.name;
47
- if (name !== defaultImportLocalName) {
48
- return;
49
- }
50
- var prop = JSXElementHelper.getAttributeByName(node, PROP_NAME);
51
-
52
- // if no autoFocus attribute exists, skip
53
- if (!prop) {
54
- return;
55
- }
56
- var attrValue = JSXAttribute.getValue(prop);
57
- if (!attrValue) {
58
- return;
59
- }
60
- var type = attrValue.type,
61
- value = attrValue.value;
62
-
63
- // If the value is a boolean with value `false`
64
- if (type === 'ExpressionStatement Literal' && typeof value === 'boolean') {
65
- return context.report({
66
- node: node,
67
- messageId: 'noBooleanForAutoFocus'
68
- });
69
- }
70
- }
71
- };
72
- }
73
- });
74
-
75
- // eslint-disable-next-line @atlaskit/volt-strict-mode/no-multiple-exports
76
- export default rule;
@@ -1,5 +0,0 @@
1
- import type { Rule } from 'eslint';
2
- export declare const message = "`autoFocus` should be set to a component's `ref` or left to resolve to the default value of `true`. It is recommended to leave it as is for a maximally accessible experience.";
3
- export declare const ruleName: string;
4
- declare const rule: Rule.RuleModule;
5
- export default rule;