@atlaskit/eslint-plugin-design-system 13.1.2 → 13.2.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.
Files changed (35) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/README.md +1 -0
  3. package/dist/cjs/presets/all-flat.codegen.js +2 -1
  4. package/dist/cjs/presets/all.codegen.js +2 -1
  5. package/dist/cjs/presets/recommended-flat.codegen.js +2 -1
  6. package/dist/cjs/presets/recommended.codegen.js +2 -1
  7. package/dist/cjs/rules/index.codegen.js +3 -1
  8. package/dist/cjs/rules/no-boolean-autofocus-on-modal-dialog/index.js +82 -0
  9. package/dist/es2019/presets/all-flat.codegen.js +2 -1
  10. package/dist/es2019/presets/all.codegen.js +2 -1
  11. package/dist/es2019/presets/recommended-flat.codegen.js +2 -1
  12. package/dist/es2019/presets/recommended.codegen.js +2 -1
  13. package/dist/es2019/rules/index.codegen.js +3 -1
  14. package/dist/es2019/rules/no-boolean-autofocus-on-modal-dialog/index.js +76 -0
  15. package/dist/esm/presets/all-flat.codegen.js +2 -1
  16. package/dist/esm/presets/all.codegen.js +2 -1
  17. package/dist/esm/presets/recommended-flat.codegen.js +2 -1
  18. package/dist/esm/presets/recommended.codegen.js +2 -1
  19. package/dist/esm/rules/index.codegen.js +3 -1
  20. package/dist/esm/rules/no-boolean-autofocus-on-modal-dialog/index.js +76 -0
  21. package/dist/types/index.codegen.d.ts +9 -0
  22. package/dist/types/presets/all-flat.codegen.d.ts +1 -0
  23. package/dist/types/presets/all.codegen.d.ts +1 -0
  24. package/dist/types/presets/recommended-flat.codegen.d.ts +1 -0
  25. package/dist/types/presets/recommended.codegen.d.ts +1 -0
  26. package/dist/types/rules/index.codegen.d.ts +1 -0
  27. package/dist/types/rules/no-boolean-autofocus-on-modal-dialog/index.d.ts +5 -0
  28. package/dist/types-ts4.5/index.codegen.d.ts +9 -0
  29. package/dist/types-ts4.5/presets/all-flat.codegen.d.ts +1 -0
  30. package/dist/types-ts4.5/presets/all.codegen.d.ts +1 -0
  31. package/dist/types-ts4.5/presets/recommended-flat.codegen.d.ts +1 -0
  32. package/dist/types-ts4.5/presets/recommended.codegen.d.ts +1 -0
  33. package/dist/types-ts4.5/rules/index.codegen.d.ts +1 -0
  34. package/dist/types-ts4.5/rules/no-boolean-autofocus-on-modal-dialog/index.d.ts +5 -0
  35. package/package.json +3 -3
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @atlaskit/eslint-plugin-design-system
2
2
 
3
+ ## 13.2.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#132664](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/132664)
8
+ [`30cdea781a4b2`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/30cdea781a4b2) -
9
+ Add rule for booleans on `autoFocus` in modal dialog.
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies
14
+
3
15
  ## 13.1.2
4
16
 
5
17
  ### Patch Changes
package/README.md CHANGED
@@ -55,6 +55,7 @@ module.exports = {
55
55
  | <a href="./packages/design-system/eslint-plugin/src/rules/ensure-icon-color/README.md">ensure-icon-color</a> | Enforces that upcoming icon components have a color prop set, to enable a migration of the default value. | | | |
56
56
  | <a href="./packages/design-system/eslint-plugin/src/rules/icon-label/README.md">icon-label</a> | Enforces accessible usage of icon labels when composed with Atlassian Design System components. | Yes | Yes | |
57
57
  | <a href="./packages/design-system/eslint-plugin/src/rules/no-banned-imports/README.md">no-banned-imports</a> | Disallow importing banned modules. | Yes | | |
58
+ | <a href="./packages/design-system/eslint-plugin/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 | | |
58
59
  | <a href="./packages/design-system/eslint-plugin/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 | |
59
60
  | <a href="./packages/design-system/eslint-plugin/src/rules/no-custom-icons/README.md">no-custom-icons</a> | Enforces custom glyph icons are used. | | | |
60
61
  | <a href="./packages/design-system/eslint-plugin/src/rules/no-dark-theme-vr-tests/README.md">no-dark-theme-vr-tests</a> | Disallow using dark colorScheme in VR tests. | | 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::f4b6800bf45a85f5c3acea28681b1cbc>>
9
+ * @codegen <<SignedSource::f468eaa1b0e61e0eba404cafc58f6977>>
10
10
  * @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system codegen
11
11
  */
12
12
  var _default = exports.default = {
@@ -19,6 +19,7 @@ var _default = exports.default = {
19
19
  '@atlaskit/design-system/ensure-icon-color': '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',
22
23
  '@atlaskit/design-system/no-css-tagged-template-expression': 'error',
23
24
  '@atlaskit/design-system/no-custom-icons': 'warn',
24
25
  '@atlaskit/design-system/no-dark-theme-vr-tests': '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::d9b89cc91a0359b1083c0020c56e1e7f>>
9
+ * @codegen <<SignedSource::29cc321a798c65c8464afd9e46366540>>
10
10
  * @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system codegen
11
11
  */
12
12
  var _default = exports.default = {
@@ -18,6 +18,7 @@ var _default = exports.default = {
18
18
  '@atlaskit/design-system/ensure-icon-color': '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',
21
22
  '@atlaskit/design-system/no-css-tagged-template-expression': 'error',
22
23
  '@atlaskit/design-system/no-custom-icons': 'warn',
23
24
  '@atlaskit/design-system/no-dark-theme-vr-tests': '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::f697bb4e7d6f53db6d4d1f522ae0ba43>>
9
+ * @codegen <<SignedSource::76f6f7b7602ea240cbcfc6bc98a781af>>
10
10
  * @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system codegen
11
11
  */
12
12
  var _default = exports.default = {
@@ -17,6 +17,7 @@ var _default = exports.default = {
17
17
  '@atlaskit/design-system/ensure-design-token-usage': 'error',
18
18
  '@atlaskit/design-system/icon-label': 'warn',
19
19
  '@atlaskit/design-system/no-banned-imports': 'error',
20
+ '@atlaskit/design-system/no-boolean-autofocus-on-modal-dialog': 'warn',
20
21
  '@atlaskit/design-system/no-deprecated-apis': 'error',
21
22
  '@atlaskit/design-system/no-deprecated-design-token-usage': 'warn',
22
23
  '@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::c593f40801552ec33891506bcba81689>>
9
+ * @codegen <<SignedSource::98f3a7e3c7f8f8532248994786f11c98>>
10
10
  * @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system codegen
11
11
  */
12
12
  var _default = exports.default = {
@@ -16,6 +16,7 @@ var _default = exports.default = {
16
16
  '@atlaskit/design-system/ensure-design-token-usage': 'error',
17
17
  '@atlaskit/design-system/icon-label': 'warn',
18
18
  '@atlaskit/design-system/no-banned-imports': 'error',
19
+ '@atlaskit/design-system/no-boolean-autofocus-on-modal-dialog': 'warn',
19
20
  '@atlaskit/design-system/no-deprecated-apis': 'error',
20
21
  '@atlaskit/design-system/no-deprecated-design-token-usage': 'warn',
21
22
  '@atlaskit/design-system/no-deprecated-imports': 'error',
@@ -11,6 +11,7 @@ var _ensureDesignTokenUsagePreview = _interopRequireDefault(require("./ensure-de
11
11
  var _ensureIconColor = _interopRequireDefault(require("./ensure-icon-color"));
12
12
  var _iconLabel = _interopRequireDefault(require("./icon-label"));
13
13
  var _noBannedImports = _interopRequireDefault(require("./no-banned-imports"));
14
+ var _noBooleanAutofocusOnModalDialog = _interopRequireDefault(require("./no-boolean-autofocus-on-modal-dialog"));
14
15
  var _noCssTaggedTemplateExpression = _interopRequireDefault(require("./no-css-tagged-template-expression"));
15
16
  var _noCustomIcons = _interopRequireDefault(require("./no-custom-icons"));
16
17
  var _noDarkThemeVrTests = _interopRequireDefault(require("./no-dark-theme-vr-tests"));
@@ -55,7 +56,7 @@ var _useTokensTypography = _interopRequireDefault(require("./use-tokens-typograp
55
56
  var _useVisuallyHidden = _interopRequireDefault(require("./use-visually-hidden"));
56
57
  /**
57
58
  * THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
58
- * @codegen <<SignedSource::4655f06909a45281bdcc9780314776c5>>
59
+ * @codegen <<SignedSource::551d1887446166d5a78fc51663d43e9c>>
59
60
  * @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system codegen
60
61
  */
61
62
 
@@ -66,6 +67,7 @@ var rules = exports.rules = {
66
67
  'ensure-icon-color': _ensureIconColor.default,
67
68
  'icon-label': _iconLabel.default,
68
69
  'no-banned-imports': _noBannedImports.default,
70
+ 'no-boolean-autofocus-on-modal-dialog': _noBooleanAutofocusOnModalDialog.default,
69
71
  'no-css-tagged-template-expression': _noCssTaggedTemplateExpression.default,
70
72
  'no-custom-icons': _noCustomIcons.default,
71
73
  'no-dark-theme-vr-tests': _noDarkThemeVrTests.default,
@@ -0,0 +1,82 @@
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 _jsxElement = require("../../ast-nodes/jsx-element");
10
+ var _createRule = require("../utils/create-rule");
11
+ // eslint-disable-next-line import/no-extraneous-dependencies
12
+
13
+ var PROP_NAME = 'autoFocus';
14
+
15
+ // Lint rule message
16
+ 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.";
17
+ var ruleName = exports.ruleName = __dirname.split('/').slice(-1)[0];
18
+ var rule = (0, _createRule.createLintRule)({
19
+ meta: {
20
+ name: ruleName,
21
+ type: 'problem',
22
+ docs: {
23
+ description: "Encourages makers to not use boolean values for `autoFocus` on Atlassian Design System's modal dialog component.",
24
+ recommended: true,
25
+ severity: 'warn'
26
+ },
27
+ messages: {
28
+ noBooleanForAutoFocus: message
29
+ }
30
+ },
31
+ create: function create(context) {
32
+ // List of component's locally imported names that match
33
+ var defaultImportLocalName;
34
+ return {
35
+ // Only run rule in files where the package is imported
36
+ ImportDeclaration: function ImportDeclaration(node) {
37
+ // Ignore non-modal imports
38
+ if (node.source.value !== '@atlaskit/modal-dialog') {
39
+ return;
40
+ }
41
+ node.specifiers.filter(function (identifier) {
42
+ return (0, _eslintCodemodUtils.isNodeOfType)(identifier, 'ImportDefaultSpecifier');
43
+ }).forEach(function (identifier) {
44
+ defaultImportLocalName = identifier.local.name;
45
+ });
46
+ },
47
+ JSXElement: function JSXElement(node) {
48
+ if (!(0, _eslintCodemodUtils.isNodeOfType)(node, 'JSXElement')) {
49
+ return;
50
+ }
51
+ if (!(0, _eslintCodemodUtils.isNodeOfType)(node.openingElement.name, 'JSXIdentifier')) {
52
+ return;
53
+ }
54
+ var name = node.openingElement.name.name;
55
+ if (name !== defaultImportLocalName) {
56
+ return;
57
+ }
58
+ var prop = _jsxElement.JSXElementHelper.getAttributeByName(node, PROP_NAME);
59
+
60
+ // if no autoFocus attribute exists, skip
61
+ if (!prop) {
62
+ return;
63
+ }
64
+ var attrValue = _jsxAttribute.JSXAttribute.getValue(prop);
65
+ if (!attrValue) {
66
+ return;
67
+ }
68
+ var type = attrValue.type,
69
+ value = attrValue.value;
70
+
71
+ // If the value is a boolean with value `false`
72
+ if (type === 'ExpressionStatement Literal' && typeof value === 'boolean') {
73
+ return context.report({
74
+ node: node,
75
+ messageId: 'noBooleanForAutoFocus'
76
+ });
77
+ }
78
+ }
79
+ };
80
+ }
81
+ });
82
+ var _default = exports.default = rule;
@@ -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::f4b6800bf45a85f5c3acea28681b1cbc>>
3
+ * @codegen <<SignedSource::f468eaa1b0e61e0eba404cafc58f6977>>
4
4
  * @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system codegen
5
5
  */
6
6
 
@@ -14,6 +14,7 @@ export default {
14
14
  '@atlaskit/design-system/ensure-icon-color': 'error',
15
15
  '@atlaskit/design-system/icon-label': 'warn',
16
16
  '@atlaskit/design-system/no-banned-imports': 'error',
17
+ '@atlaskit/design-system/no-boolean-autofocus-on-modal-dialog': 'warn',
17
18
  '@atlaskit/design-system/no-css-tagged-template-expression': 'error',
18
19
  '@atlaskit/design-system/no-custom-icons': 'warn',
19
20
  '@atlaskit/design-system/no-dark-theme-vr-tests': '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::d9b89cc91a0359b1083c0020c56e1e7f>>
3
+ * @codegen <<SignedSource::29cc321a798c65c8464afd9e46366540>>
4
4
  * @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system codegen
5
5
  */
6
6
 
@@ -13,6 +13,7 @@ export default {
13
13
  '@atlaskit/design-system/ensure-icon-color': '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',
16
17
  '@atlaskit/design-system/no-css-tagged-template-expression': 'error',
17
18
  '@atlaskit/design-system/no-custom-icons': 'warn',
18
19
  '@atlaskit/design-system/no-dark-theme-vr-tests': '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::f697bb4e7d6f53db6d4d1f522ae0ba43>>
3
+ * @codegen <<SignedSource::76f6f7b7602ea240cbcfc6bc98a781af>>
4
4
  * @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system codegen
5
5
  */
6
6
 
@@ -12,6 +12,7 @@ export default {
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',
15
16
  '@atlaskit/design-system/no-deprecated-apis': 'error',
16
17
  '@atlaskit/design-system/no-deprecated-design-token-usage': 'warn',
17
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::c593f40801552ec33891506bcba81689>>
3
+ * @codegen <<SignedSource::98f3a7e3c7f8f8532248994786f11c98>>
4
4
  * @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system codegen
5
5
  */
6
6
 
@@ -11,6 +11,7 @@ export default {
11
11
  '@atlaskit/design-system/ensure-design-token-usage': 'error',
12
12
  '@atlaskit/design-system/icon-label': 'warn',
13
13
  '@atlaskit/design-system/no-banned-imports': 'error',
14
+ '@atlaskit/design-system/no-boolean-autofocus-on-modal-dialog': 'warn',
14
15
  '@atlaskit/design-system/no-deprecated-apis': 'error',
15
16
  '@atlaskit/design-system/no-deprecated-design-token-usage': 'warn',
16
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::4655f06909a45281bdcc9780314776c5>>
3
+ * @codegen <<SignedSource::551d1887446166d5a78fc51663d43e9c>>
4
4
  * @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system codegen
5
5
  */
6
6
  import consistentCssPropUsage from './consistent-css-prop-usage';
@@ -9,6 +9,7 @@ import ensureDesignTokenUsagePreview from './ensure-design-token-usage-preview';
9
9
  import ensureIconColor from './ensure-icon-color';
10
10
  import iconLabel from './icon-label';
11
11
  import noBannedImports from './no-banned-imports';
12
+ import noBooleanAutofocusOnModalDialog from './no-boolean-autofocus-on-modal-dialog';
12
13
  import noCssTaggedTemplateExpression from './no-css-tagged-template-expression';
13
14
  import noCustomIcons from './no-custom-icons';
14
15
  import noDarkThemeVrTests from './no-dark-theme-vr-tests';
@@ -58,6 +59,7 @@ export const rules = {
58
59
  'ensure-icon-color': ensureIconColor,
59
60
  'icon-label': iconLabel,
60
61
  'no-banned-imports': noBannedImports,
62
+ 'no-boolean-autofocus-on-modal-dialog': noBooleanAutofocusOnModalDialog,
61
63
  'no-css-tagged-template-expression': noCssTaggedTemplateExpression,
62
64
  'no-custom-icons': noCustomIcons,
63
65
  'no-dark-theme-vr-tests': noDarkThemeVrTests,
@@ -0,0 +1,76 @@
1
+ // eslint-disable-next-line import/no-extraneous-dependencies
2
+
3
+ import { isNodeOfType } from 'eslint-codemod-utils';
4
+ import { JSXAttribute } from '../../ast-nodes/jsx-attribute';
5
+ import { JSXElementHelper } from '../../ast-nodes/jsx-element';
6
+ import { createLintRule } from '../utils/create-rule';
7
+ const PROP_NAME = 'autoFocus';
8
+
9
+ // Lint rule message
10
+ 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.";
11
+ export const ruleName = __dirname.split('/').slice(-1)[0];
12
+ const rule = createLintRule({
13
+ meta: {
14
+ name: ruleName,
15
+ type: 'problem',
16
+ docs: {
17
+ description: "Encourages makers to not use boolean values for `autoFocus` on Atlassian Design System's modal dialog component.",
18
+ recommended: true,
19
+ severity: 'warn'
20
+ },
21
+ messages: {
22
+ noBooleanForAutoFocus: message
23
+ }
24
+ },
25
+ create(context) {
26
+ // List of component's locally imported names that match
27
+ let defaultImportLocalName;
28
+ return {
29
+ // Only run rule in files where the package is imported
30
+ ImportDeclaration(node) {
31
+ // Ignore non-modal imports
32
+ if (node.source.value !== '@atlaskit/modal-dialog') {
33
+ return;
34
+ }
35
+ node.specifiers.filter(identifier => isNodeOfType(identifier, 'ImportDefaultSpecifier')).forEach(identifier => {
36
+ defaultImportLocalName = identifier.local.name;
37
+ });
38
+ },
39
+ JSXElement(node) {
40
+ if (!isNodeOfType(node, 'JSXElement')) {
41
+ return;
42
+ }
43
+ if (!isNodeOfType(node.openingElement.name, 'JSXIdentifier')) {
44
+ return;
45
+ }
46
+ const name = node.openingElement.name.name;
47
+ if (name !== defaultImportLocalName) {
48
+ return;
49
+ }
50
+ const prop = JSXElementHelper.getAttributeByName(node, PROP_NAME);
51
+
52
+ // if no autoFocus attribute exists, skip
53
+ if (!prop) {
54
+ return;
55
+ }
56
+ const attrValue = JSXAttribute.getValue(prop);
57
+ if (!attrValue) {
58
+ return;
59
+ }
60
+ const {
61
+ type,
62
+ value
63
+ } = attrValue;
64
+
65
+ // If the value is a boolean with value `false`
66
+ if (type === 'ExpressionStatement Literal' && typeof value === 'boolean') {
67
+ return context.report({
68
+ node,
69
+ messageId: 'noBooleanForAutoFocus'
70
+ });
71
+ }
72
+ }
73
+ };
74
+ }
75
+ });
76
+ export default rule;
@@ -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::f4b6800bf45a85f5c3acea28681b1cbc>>
3
+ * @codegen <<SignedSource::f468eaa1b0e61e0eba404cafc58f6977>>
4
4
  * @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system codegen
5
5
  */
6
6
 
@@ -14,6 +14,7 @@ export default {
14
14
  '@atlaskit/design-system/ensure-icon-color': 'error',
15
15
  '@atlaskit/design-system/icon-label': 'warn',
16
16
  '@atlaskit/design-system/no-banned-imports': 'error',
17
+ '@atlaskit/design-system/no-boolean-autofocus-on-modal-dialog': 'warn',
17
18
  '@atlaskit/design-system/no-css-tagged-template-expression': 'error',
18
19
  '@atlaskit/design-system/no-custom-icons': 'warn',
19
20
  '@atlaskit/design-system/no-dark-theme-vr-tests': '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::d9b89cc91a0359b1083c0020c56e1e7f>>
3
+ * @codegen <<SignedSource::29cc321a798c65c8464afd9e46366540>>
4
4
  * @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system codegen
5
5
  */
6
6
 
@@ -13,6 +13,7 @@ export default {
13
13
  '@atlaskit/design-system/ensure-icon-color': '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',
16
17
  '@atlaskit/design-system/no-css-tagged-template-expression': 'error',
17
18
  '@atlaskit/design-system/no-custom-icons': 'warn',
18
19
  '@atlaskit/design-system/no-dark-theme-vr-tests': '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::f697bb4e7d6f53db6d4d1f522ae0ba43>>
3
+ * @codegen <<SignedSource::76f6f7b7602ea240cbcfc6bc98a781af>>
4
4
  * @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system codegen
5
5
  */
6
6
 
@@ -12,6 +12,7 @@ export default {
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',
15
16
  '@atlaskit/design-system/no-deprecated-apis': 'error',
16
17
  '@atlaskit/design-system/no-deprecated-design-token-usage': 'warn',
17
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::c593f40801552ec33891506bcba81689>>
3
+ * @codegen <<SignedSource::98f3a7e3c7f8f8532248994786f11c98>>
4
4
  * @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system codegen
5
5
  */
6
6
 
@@ -11,6 +11,7 @@ export default {
11
11
  '@atlaskit/design-system/ensure-design-token-usage': 'error',
12
12
  '@atlaskit/design-system/icon-label': 'warn',
13
13
  '@atlaskit/design-system/no-banned-imports': 'error',
14
+ '@atlaskit/design-system/no-boolean-autofocus-on-modal-dialog': 'warn',
14
15
  '@atlaskit/design-system/no-deprecated-apis': 'error',
15
16
  '@atlaskit/design-system/no-deprecated-design-token-usage': 'warn',
16
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::4655f06909a45281bdcc9780314776c5>>
3
+ * @codegen <<SignedSource::551d1887446166d5a78fc51663d43e9c>>
4
4
  * @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system codegen
5
5
  */
6
6
  import consistentCssPropUsage from './consistent-css-prop-usage';
@@ -9,6 +9,7 @@ import ensureDesignTokenUsagePreview from './ensure-design-token-usage-preview';
9
9
  import ensureIconColor from './ensure-icon-color';
10
10
  import iconLabel from './icon-label';
11
11
  import noBannedImports from './no-banned-imports';
12
+ import noBooleanAutofocusOnModalDialog from './no-boolean-autofocus-on-modal-dialog';
12
13
  import noCssTaggedTemplateExpression from './no-css-tagged-template-expression';
13
14
  import noCustomIcons from './no-custom-icons';
14
15
  import noDarkThemeVrTests from './no-dark-theme-vr-tests';
@@ -58,6 +59,7 @@ export var rules = {
58
59
  'ensure-icon-color': ensureIconColor,
59
60
  'icon-label': iconLabel,
60
61
  'no-banned-imports': noBannedImports,
62
+ 'no-boolean-autofocus-on-modal-dialog': noBooleanAutofocusOnModalDialog,
61
63
  'no-css-tagged-template-expression': noCssTaggedTemplateExpression,
62
64
  'no-custom-icons': noCustomIcons,
63
65
  'no-dark-theme-vr-tests': noDarkThemeVrTests,
@@ -0,0 +1,76 @@
1
+ // eslint-disable-next-line import/no-extraneous-dependencies
2
+
3
+ import { isNodeOfType } from 'eslint-codemod-utils';
4
+ import { JSXAttribute } from '../../ast-nodes/jsx-attribute';
5
+ import { JSXElementHelper } from '../../ast-nodes/jsx-element';
6
+ import { createLintRule } from '../utils/create-rule';
7
+ var PROP_NAME = 'autoFocus';
8
+
9
+ // Lint rule message
10
+ 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.";
11
+ export var ruleName = __dirname.split('/').slice(-1)[0];
12
+ var rule = createLintRule({
13
+ meta: {
14
+ name: ruleName,
15
+ type: 'problem',
16
+ docs: {
17
+ description: "Encourages makers to not use boolean values for `autoFocus` on Atlassian Design System's modal dialog component.",
18
+ recommended: true,
19
+ severity: 'warn'
20
+ },
21
+ messages: {
22
+ noBooleanForAutoFocus: message
23
+ }
24
+ },
25
+ create: function create(context) {
26
+ // List of component's locally imported names that match
27
+ var defaultImportLocalName;
28
+ return {
29
+ // Only run rule in files where the package is imported
30
+ ImportDeclaration: function ImportDeclaration(node) {
31
+ // Ignore non-modal imports
32
+ if (node.source.value !== '@atlaskit/modal-dialog') {
33
+ return;
34
+ }
35
+ node.specifiers.filter(function (identifier) {
36
+ return isNodeOfType(identifier, 'ImportDefaultSpecifier');
37
+ }).forEach(function (identifier) {
38
+ defaultImportLocalName = identifier.local.name;
39
+ });
40
+ },
41
+ JSXElement: function JSXElement(node) {
42
+ if (!isNodeOfType(node, 'JSXElement')) {
43
+ return;
44
+ }
45
+ if (!isNodeOfType(node.openingElement.name, 'JSXIdentifier')) {
46
+ return;
47
+ }
48
+ var name = node.openingElement.name.name;
49
+ if (name !== defaultImportLocalName) {
50
+ return;
51
+ }
52
+ var prop = JSXElementHelper.getAttributeByName(node, PROP_NAME);
53
+
54
+ // if no autoFocus attribute exists, skip
55
+ if (!prop) {
56
+ return;
57
+ }
58
+ var attrValue = JSXAttribute.getValue(prop);
59
+ if (!attrValue) {
60
+ return;
61
+ }
62
+ var type = attrValue.type,
63
+ value = attrValue.value;
64
+
65
+ // If the value is a boolean with value `false`
66
+ if (type === 'ExpressionStatement Literal' && typeof value === 'boolean') {
67
+ return context.report({
68
+ node: node,
69
+ messageId: 'noBooleanForAutoFocus'
70
+ });
71
+ }
72
+ }
73
+ };
74
+ }
75
+ });
76
+ export default rule;
@@ -21,6 +21,7 @@ export declare const plugin: {
21
21
  'ensure-icon-color': import("eslint").Rule.RuleModule;
22
22
  'icon-label': import("eslint").Rule.RuleModule;
23
23
  'no-banned-imports': import("eslint").Rule.RuleModule;
24
+ 'no-boolean-autofocus-on-modal-dialog': import("eslint").Rule.RuleModule;
24
25
  'no-css-tagged-template-expression': import("eslint").Rule.RuleModule;
25
26
  'no-custom-icons': import("eslint").Rule.RuleModule;
26
27
  'no-dark-theme-vr-tests': import("eslint").Rule.RuleModule;
@@ -74,6 +75,7 @@ export declare const plugin: {
74
75
  '@atlaskit/design-system/ensure-icon-color': "error";
75
76
  '@atlaskit/design-system/icon-label': "warn";
76
77
  '@atlaskit/design-system/no-banned-imports': "error";
78
+ '@atlaskit/design-system/no-boolean-autofocus-on-modal-dialog': "warn";
77
79
  '@atlaskit/design-system/no-css-tagged-template-expression': "error";
78
80
  '@atlaskit/design-system/no-custom-icons': "warn";
79
81
  '@atlaskit/design-system/no-dark-theme-vr-tests': "error";
@@ -128,6 +130,7 @@ export declare const plugin: {
128
130
  '@atlaskit/design-system/ensure-icon-color': "error";
129
131
  '@atlaskit/design-system/icon-label': "warn";
130
132
  '@atlaskit/design-system/no-banned-imports': "error";
133
+ '@atlaskit/design-system/no-boolean-autofocus-on-modal-dialog': "warn";
131
134
  '@atlaskit/design-system/no-css-tagged-template-expression': "error";
132
135
  '@atlaskit/design-system/no-custom-icons': "warn";
133
136
  '@atlaskit/design-system/no-dark-theme-vr-tests': "error";
@@ -178,6 +181,7 @@ export declare const plugin: {
178
181
  '@atlaskit/design-system/ensure-design-token-usage': "error";
179
182
  '@atlaskit/design-system/icon-label': "warn";
180
183
  '@atlaskit/design-system/no-banned-imports': "error";
184
+ '@atlaskit/design-system/no-boolean-autofocus-on-modal-dialog': "warn";
181
185
  '@atlaskit/design-system/no-deprecated-apis': "error";
182
186
  '@atlaskit/design-system/no-deprecated-design-token-usage': "warn";
183
187
  '@atlaskit/design-system/no-deprecated-imports': "error";
@@ -216,6 +220,7 @@ export declare const plugin: {
216
220
  '@atlaskit/design-system/ensure-design-token-usage': "error";
217
221
  '@atlaskit/design-system/icon-label': "warn";
218
222
  '@atlaskit/design-system/no-banned-imports': "error";
223
+ '@atlaskit/design-system/no-boolean-autofocus-on-modal-dialog': "warn";
219
224
  '@atlaskit/design-system/no-deprecated-apis': "error";
220
225
  '@atlaskit/design-system/no-deprecated-design-token-usage': "warn";
221
226
  '@atlaskit/design-system/no-deprecated-imports': "error";
@@ -257,6 +262,7 @@ declare const configs: {
257
262
  '@atlaskit/design-system/ensure-icon-color': "error";
258
263
  '@atlaskit/design-system/icon-label': "warn";
259
264
  '@atlaskit/design-system/no-banned-imports': "error";
265
+ '@atlaskit/design-system/no-boolean-autofocus-on-modal-dialog': "warn";
260
266
  '@atlaskit/design-system/no-css-tagged-template-expression': "error";
261
267
  '@atlaskit/design-system/no-custom-icons': "warn";
262
268
  '@atlaskit/design-system/no-dark-theme-vr-tests': "error";
@@ -311,6 +317,7 @@ declare const configs: {
311
317
  '@atlaskit/design-system/ensure-icon-color': "error";
312
318
  '@atlaskit/design-system/icon-label': "warn";
313
319
  '@atlaskit/design-system/no-banned-imports': "error";
320
+ '@atlaskit/design-system/no-boolean-autofocus-on-modal-dialog': "warn";
314
321
  '@atlaskit/design-system/no-css-tagged-template-expression': "error";
315
322
  '@atlaskit/design-system/no-custom-icons': "warn";
316
323
  '@atlaskit/design-system/no-dark-theme-vr-tests': "error";
@@ -361,6 +368,7 @@ declare const configs: {
361
368
  '@atlaskit/design-system/ensure-design-token-usage': "error";
362
369
  '@atlaskit/design-system/icon-label': "warn";
363
370
  '@atlaskit/design-system/no-banned-imports': "error";
371
+ '@atlaskit/design-system/no-boolean-autofocus-on-modal-dialog': "warn";
364
372
  '@atlaskit/design-system/no-deprecated-apis': "error";
365
373
  '@atlaskit/design-system/no-deprecated-design-token-usage': "warn";
366
374
  '@atlaskit/design-system/no-deprecated-imports': "error";
@@ -399,6 +407,7 @@ declare const configs: {
399
407
  '@atlaskit/design-system/ensure-design-token-usage': "error";
400
408
  '@atlaskit/design-system/icon-label': "warn";
401
409
  '@atlaskit/design-system/no-banned-imports': "error";
410
+ '@atlaskit/design-system/no-boolean-autofocus-on-modal-dialog': "warn";
402
411
  '@atlaskit/design-system/no-deprecated-apis': "error";
403
412
  '@atlaskit/design-system/no-deprecated-design-token-usage': "warn";
404
413
  '@atlaskit/design-system/no-deprecated-imports': "error";
@@ -7,6 +7,7 @@ declare const _default: {
7
7
  '@atlaskit/design-system/ensure-icon-color': "error";
8
8
  '@atlaskit/design-system/icon-label': "warn";
9
9
  '@atlaskit/design-system/no-banned-imports': "error";
10
+ '@atlaskit/design-system/no-boolean-autofocus-on-modal-dialog': "warn";
10
11
  '@atlaskit/design-system/no-css-tagged-template-expression': "error";
11
12
  '@atlaskit/design-system/no-custom-icons': "warn";
12
13
  '@atlaskit/design-system/no-dark-theme-vr-tests': "error";
@@ -7,6 +7,7 @@ declare const _default: {
7
7
  '@atlaskit/design-system/ensure-icon-color': "error";
8
8
  '@atlaskit/design-system/icon-label': "warn";
9
9
  '@atlaskit/design-system/no-banned-imports': "error";
10
+ '@atlaskit/design-system/no-boolean-autofocus-on-modal-dialog': "warn";
10
11
  '@atlaskit/design-system/no-css-tagged-template-expression': "error";
11
12
  '@atlaskit/design-system/no-custom-icons': "warn";
12
13
  '@atlaskit/design-system/no-dark-theme-vr-tests': "error";
@@ -5,6 +5,7 @@ declare const _default: {
5
5
  '@atlaskit/design-system/ensure-design-token-usage': "error";
6
6
  '@atlaskit/design-system/icon-label': "warn";
7
7
  '@atlaskit/design-system/no-banned-imports': "error";
8
+ '@atlaskit/design-system/no-boolean-autofocus-on-modal-dialog': "warn";
8
9
  '@atlaskit/design-system/no-deprecated-apis': "error";
9
10
  '@atlaskit/design-system/no-deprecated-design-token-usage': "warn";
10
11
  '@atlaskit/design-system/no-deprecated-imports': "error";
@@ -5,6 +5,7 @@ declare const _default: {
5
5
  '@atlaskit/design-system/ensure-design-token-usage': "error";
6
6
  '@atlaskit/design-system/icon-label': "warn";
7
7
  '@atlaskit/design-system/no-banned-imports': "error";
8
+ '@atlaskit/design-system/no-boolean-autofocus-on-modal-dialog': "warn";
8
9
  '@atlaskit/design-system/no-deprecated-apis': "error";
9
10
  '@atlaskit/design-system/no-deprecated-design-token-usage': "warn";
10
11
  '@atlaskit/design-system/no-deprecated-imports': "error";
@@ -5,6 +5,7 @@ export declare const rules: {
5
5
  'ensure-icon-color': import("eslint").Rule.RuleModule;
6
6
  'icon-label': import("eslint").Rule.RuleModule;
7
7
  'no-banned-imports': import("eslint").Rule.RuleModule;
8
+ 'no-boolean-autofocus-on-modal-dialog': import("eslint").Rule.RuleModule;
8
9
  'no-css-tagged-template-expression': import("eslint").Rule.RuleModule;
9
10
  'no-custom-icons': import("eslint").Rule.RuleModule;
10
11
  'no-dark-theme-vr-tests': import("eslint").Rule.RuleModule;
@@ -0,0 +1,5 @@
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;
@@ -21,6 +21,7 @@ export declare const plugin: {
21
21
  'ensure-icon-color': import("eslint").Rule.RuleModule;
22
22
  'icon-label': import("eslint").Rule.RuleModule;
23
23
  'no-banned-imports': import("eslint").Rule.RuleModule;
24
+ 'no-boolean-autofocus-on-modal-dialog': import("eslint").Rule.RuleModule;
24
25
  'no-css-tagged-template-expression': import("eslint").Rule.RuleModule;
25
26
  'no-custom-icons': import("eslint").Rule.RuleModule;
26
27
  'no-dark-theme-vr-tests': import("eslint").Rule.RuleModule;
@@ -74,6 +75,7 @@ export declare const plugin: {
74
75
  '@atlaskit/design-system/ensure-icon-color': "error";
75
76
  '@atlaskit/design-system/icon-label': "warn";
76
77
  '@atlaskit/design-system/no-banned-imports': "error";
78
+ '@atlaskit/design-system/no-boolean-autofocus-on-modal-dialog': "warn";
77
79
  '@atlaskit/design-system/no-css-tagged-template-expression': "error";
78
80
  '@atlaskit/design-system/no-custom-icons': "warn";
79
81
  '@atlaskit/design-system/no-dark-theme-vr-tests': "error";
@@ -131,6 +133,7 @@ export declare const plugin: {
131
133
  '@atlaskit/design-system/ensure-icon-color': "error";
132
134
  '@atlaskit/design-system/icon-label': "warn";
133
135
  '@atlaskit/design-system/no-banned-imports': "error";
136
+ '@atlaskit/design-system/no-boolean-autofocus-on-modal-dialog': "warn";
134
137
  '@atlaskit/design-system/no-css-tagged-template-expression': "error";
135
138
  '@atlaskit/design-system/no-custom-icons': "warn";
136
139
  '@atlaskit/design-system/no-dark-theme-vr-tests': "error";
@@ -184,6 +187,7 @@ export declare const plugin: {
184
187
  '@atlaskit/design-system/ensure-design-token-usage': "error";
185
188
  '@atlaskit/design-system/icon-label': "warn";
186
189
  '@atlaskit/design-system/no-banned-imports': "error";
190
+ '@atlaskit/design-system/no-boolean-autofocus-on-modal-dialog': "warn";
187
191
  '@atlaskit/design-system/no-deprecated-apis': "error";
188
192
  '@atlaskit/design-system/no-deprecated-design-token-usage': "warn";
189
193
  '@atlaskit/design-system/no-deprecated-imports': "error";
@@ -225,6 +229,7 @@ export declare const plugin: {
225
229
  '@atlaskit/design-system/ensure-design-token-usage': "error";
226
230
  '@atlaskit/design-system/icon-label': "warn";
227
231
  '@atlaskit/design-system/no-banned-imports': "error";
232
+ '@atlaskit/design-system/no-boolean-autofocus-on-modal-dialog': "warn";
228
233
  '@atlaskit/design-system/no-deprecated-apis': "error";
229
234
  '@atlaskit/design-system/no-deprecated-design-token-usage': "warn";
230
235
  '@atlaskit/design-system/no-deprecated-imports': "error";
@@ -269,6 +274,7 @@ declare const configs: {
269
274
  '@atlaskit/design-system/ensure-icon-color': "error";
270
275
  '@atlaskit/design-system/icon-label': "warn";
271
276
  '@atlaskit/design-system/no-banned-imports': "error";
277
+ '@atlaskit/design-system/no-boolean-autofocus-on-modal-dialog': "warn";
272
278
  '@atlaskit/design-system/no-css-tagged-template-expression': "error";
273
279
  '@atlaskit/design-system/no-custom-icons': "warn";
274
280
  '@atlaskit/design-system/no-dark-theme-vr-tests': "error";
@@ -326,6 +332,7 @@ declare const configs: {
326
332
  '@atlaskit/design-system/ensure-icon-color': "error";
327
333
  '@atlaskit/design-system/icon-label': "warn";
328
334
  '@atlaskit/design-system/no-banned-imports': "error";
335
+ '@atlaskit/design-system/no-boolean-autofocus-on-modal-dialog': "warn";
329
336
  '@atlaskit/design-system/no-css-tagged-template-expression': "error";
330
337
  '@atlaskit/design-system/no-custom-icons': "warn";
331
338
  '@atlaskit/design-system/no-dark-theme-vr-tests': "error";
@@ -379,6 +386,7 @@ declare const configs: {
379
386
  '@atlaskit/design-system/ensure-design-token-usage': "error";
380
387
  '@atlaskit/design-system/icon-label': "warn";
381
388
  '@atlaskit/design-system/no-banned-imports': "error";
389
+ '@atlaskit/design-system/no-boolean-autofocus-on-modal-dialog': "warn";
382
390
  '@atlaskit/design-system/no-deprecated-apis': "error";
383
391
  '@atlaskit/design-system/no-deprecated-design-token-usage': "warn";
384
392
  '@atlaskit/design-system/no-deprecated-imports': "error";
@@ -420,6 +428,7 @@ declare const configs: {
420
428
  '@atlaskit/design-system/ensure-design-token-usage': "error";
421
429
  '@atlaskit/design-system/icon-label': "warn";
422
430
  '@atlaskit/design-system/no-banned-imports': "error";
431
+ '@atlaskit/design-system/no-boolean-autofocus-on-modal-dialog': "warn";
423
432
  '@atlaskit/design-system/no-deprecated-apis': "error";
424
433
  '@atlaskit/design-system/no-deprecated-design-token-usage': "warn";
425
434
  '@atlaskit/design-system/no-deprecated-imports': "error";
@@ -7,6 +7,7 @@ declare const _default: {
7
7
  '@atlaskit/design-system/ensure-icon-color': "error";
8
8
  '@atlaskit/design-system/icon-label': "warn";
9
9
  '@atlaskit/design-system/no-banned-imports': "error";
10
+ '@atlaskit/design-system/no-boolean-autofocus-on-modal-dialog': "warn";
10
11
  '@atlaskit/design-system/no-css-tagged-template-expression': "error";
11
12
  '@atlaskit/design-system/no-custom-icons': "warn";
12
13
  '@atlaskit/design-system/no-dark-theme-vr-tests': "error";
@@ -7,6 +7,7 @@ declare const _default: {
7
7
  '@atlaskit/design-system/ensure-icon-color': "error";
8
8
  '@atlaskit/design-system/icon-label': "warn";
9
9
  '@atlaskit/design-system/no-banned-imports': "error";
10
+ '@atlaskit/design-system/no-boolean-autofocus-on-modal-dialog': "warn";
10
11
  '@atlaskit/design-system/no-css-tagged-template-expression': "error";
11
12
  '@atlaskit/design-system/no-custom-icons': "warn";
12
13
  '@atlaskit/design-system/no-dark-theme-vr-tests': "error";
@@ -5,6 +5,7 @@ declare const _default: {
5
5
  '@atlaskit/design-system/ensure-design-token-usage': "error";
6
6
  '@atlaskit/design-system/icon-label': "warn";
7
7
  '@atlaskit/design-system/no-banned-imports': "error";
8
+ '@atlaskit/design-system/no-boolean-autofocus-on-modal-dialog': "warn";
8
9
  '@atlaskit/design-system/no-deprecated-apis': "error";
9
10
  '@atlaskit/design-system/no-deprecated-design-token-usage': "warn";
10
11
  '@atlaskit/design-system/no-deprecated-imports': "error";
@@ -5,6 +5,7 @@ declare const _default: {
5
5
  '@atlaskit/design-system/ensure-design-token-usage': "error";
6
6
  '@atlaskit/design-system/icon-label': "warn";
7
7
  '@atlaskit/design-system/no-banned-imports': "error";
8
+ '@atlaskit/design-system/no-boolean-autofocus-on-modal-dialog': "warn";
8
9
  '@atlaskit/design-system/no-deprecated-apis': "error";
9
10
  '@atlaskit/design-system/no-deprecated-design-token-usage': "warn";
10
11
  '@atlaskit/design-system/no-deprecated-imports': "error";
@@ -5,6 +5,7 @@ export declare const rules: {
5
5
  'ensure-icon-color': import("eslint").Rule.RuleModule;
6
6
  'icon-label': import("eslint").Rule.RuleModule;
7
7
  'no-banned-imports': import("eslint").Rule.RuleModule;
8
+ 'no-boolean-autofocus-on-modal-dialog': import("eslint").Rule.RuleModule;
8
9
  'no-css-tagged-template-expression': import("eslint").Rule.RuleModule;
9
10
  'no-custom-icons': import("eslint").Rule.RuleModule;
10
11
  'no-dark-theme-vr-tests': import("eslint").Rule.RuleModule;
@@ -0,0 +1,5 @@
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;
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.1.2",
4
+ "version": "13.2.0",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
7
7
  "publishConfig": {
@@ -44,8 +44,8 @@
44
44
  },
45
45
  "dependencies": {
46
46
  "@atlaskit/eslint-utils": "^2.0.0",
47
- "@atlaskit/icon": "^25.0.0",
48
- "@atlaskit/icon-lab": "^4.3.0",
47
+ "@atlaskit/icon": "^25.2.0",
48
+ "@atlaskit/icon-lab": "^4.5.0",
49
49
  "@atlaskit/tokens": "^4.5.0",
50
50
  "@babel/runtime": "^7.0.0",
51
51
  "@typescript-eslint/utils": "^7.1.0",