@atlaskit/eslint-plugin-design-system 13.33.0 → 13.34.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/README.md +77 -76
  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/use-simple-form/index.js +162 -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/use-simple-form/index.js +150 -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/use-simple-form/index.js +156 -0
  21. package/dist/types/presets/all-flat.codegen.d.ts +1 -1
  22. package/dist/types/presets/all.codegen.d.ts +1 -1
  23. package/dist/types/presets/recommended-flat.codegen.d.ts +1 -1
  24. package/dist/types/presets/recommended.codegen.d.ts +1 -1
  25. package/dist/types/rules/index.codegen.d.ts +1 -1
  26. package/dist/types/rules/use-simple-form/index.d.ts +5 -0
  27. package/dist/types-ts4.5/presets/all-flat.codegen.d.ts +1 -1
  28. package/dist/types-ts4.5/presets/all.codegen.d.ts +1 -1
  29. package/dist/types-ts4.5/presets/recommended-flat.codegen.d.ts +1 -1
  30. package/dist/types-ts4.5/presets/recommended.codegen.d.ts +1 -1
  31. package/dist/types-ts4.5/rules/index.codegen.d.ts +1 -1
  32. package/dist/types-ts4.5/rules/use-simple-form/index.d.ts +5 -0
  33. package/package.json +2 -2
package/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # @atlaskit/eslint-plugin-design-system
2
2
 
3
+ ## 13.34.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 13.34.0
10
+
11
+ ### Minor Changes
12
+
13
+ - [`dd764a0fde24c`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/dd764a0fde24c) -
14
+ Add rule to enforce simple ADS forms.
15
+
3
16
  ## 13.33.0
4
17
 
5
18
  ### Minor Changes
package/README.md CHANGED
@@ -47,81 +47,82 @@ module.exports = {
47
47
  <!-- START_RULE_TABLE_CODEGEN -->
48
48
  <!-- @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system codegen -->
49
49
 
50
- | Rule | Description | Recommended | Fixable | Suggestions |
51
- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------- | ------- | ----------- |
52
- | <a href="./packages/design-system/eslint-plugin/src/rules/consistent-css-prop-usage/README.md">consistent-css-prop-usage</a> | Ensures consistency with `css` and `xcss` prop usages | Yes | Yes | |
53
- | <a href="./packages/design-system/eslint-plugin/src/rules/enforce-inline-styles-in-select/README.md">enforce-inline-styles-in-select</a> | Disallow unsupported CSS selectors in styles prop for @atlaskit/select and require inline styles only | | | |
54
- | <a href="./packages/design-system/eslint-plugin/src/rules/ensure-design-token-usage/README.md">ensure-design-token-usage</a> | Enforces usage of design tokens rather than hard-coded values. | Yes | Yes | Yes |
55
- | <a href="./packages/design-system/eslint-plugin/src/rules/ensure-design-token-usage-preview/README.md">ensure-design-token-usage/preview</a> | Enforces usage of pre-release design tokens rather than hard-coded values. | | Yes | Yes |
56
- | <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. | | | |
57
- | <a href="./packages/design-system/eslint-plugin/src/rules/ensure-proper-xcss-usage/README.md">ensure-proper-xcss-usage</a> | Enforces proper xcss usage: migrate from xcss() to cssMap() and use cssMap objects with specific keys. | | | |
58
- | <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 | |
59
- | <a href="./packages/design-system/eslint-plugin/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 | |
60
- | <a href="./packages/design-system/eslint-plugin/src/rules/no-banned-imports/README.md">no-banned-imports</a> | Disallow importing banned modules. | Yes | | |
61
- | <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 | | |
62
- | <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 | |
63
- | <a href="./packages/design-system/eslint-plugin/src/rules/no-custom-icons/README.md">no-custom-icons</a> | Enforces custom glyph icons are used. | | | |
64
- | <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 | |
65
- | <a href="./packages/design-system/eslint-plugin/src/rules/no-deprecated-apis/README.md">no-deprecated-apis</a> | Disallow using deprecated APIs. | Yes | | |
66
- | <a href="./packages/design-system/eslint-plugin/src/rules/no-deprecated-design-token-usage/README.md">no-deprecated-design-token-usage</a> | Disallow using deprecated design tokens. | Yes | Yes | |
67
- | <a href="./packages/design-system/eslint-plugin/src/rules/no-deprecated-imports/README.md">no-deprecated-imports</a> | Disallow importing deprecated modules. | Yes | Yes | Yes |
68
- | <a href="./packages/design-system/eslint-plugin/src/rules/no-direct-use-of-web-platform-drag-and-drop/README.md">no-direct-use-of-web-platform-drag-and-drop</a> | Disallow using direct use of native drag and drop (please use Pragmatic drag and drop) | Yes | | |
69
- | <a href="./packages/design-system/eslint-plugin/src/rules/no-emotion-primitives/README.md">no-emotion-primitives</a> | Ensures usage of Compiled Primitives import instead of Emotion entrypoint. | | Yes | |
70
- | <a href="./packages/design-system/eslint-plugin/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). | | | |
71
- | <a href="./packages/design-system/eslint-plugin/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. | | | |
72
- | <a href="./packages/design-system/eslint-plugin/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. | | | |
73
- | <a href="./packages/design-system/eslint-plugin/src/rules/no-html-anchor/README.md">no-html-anchor</a> | Discourage direct usage of HTML anchor elements in favor of Atlassian Design System link components. | Yes | | Yes |
74
- | <a href="./packages/design-system/eslint-plugin/src/rules/no-html-button/README.md">no-html-button</a> | Discourage direct usage of HTML button elements in favor of Atlassian Design System button components. | Yes | | |
75
- | <a href="./packages/design-system/eslint-plugin/src/rules/no-html-checkbox/README.md">no-html-checkbox</a> | Discourage direct usage of HTML checkbox elements in favor of the Atlassian Design System checkbox component. | Yes | | Yes |
76
- | <a href="./packages/design-system/eslint-plugin/src/rules/no-html-code/README.md">no-html-code</a> | Discourage direct usage of HTML code elements in favor of the Atlassian Design System code component. | Yes | | Yes |
77
- | <a href="./packages/design-system/eslint-plugin/src/rules/no-html-heading/README.md">no-html-heading</a> | Discourage direct usage of HTML heading elements in favor of Atlassian Design System heading components. | Yes | | Yes |
78
- | <a href="./packages/design-system/eslint-plugin/src/rules/no-html-image/README.md">no-html-image</a> | Discourage direct usage of HTML image elements in favor of the Atlassian Design System image component. | Yes | | Yes |
79
- | <a href="./packages/design-system/eslint-plugin/src/rules/no-html-radio/README.md">no-html-radio</a> | Discourage direct usage of HTML radio elements in favor of the Atlassian Design System radio component. | Yes | | Yes |
80
- | <a href="./packages/design-system/eslint-plugin/src/rules/no-html-range/README.md">no-html-range</a> | Discourage direct usage of HTML range elements in favor of the Atlassian Design System range component. | Yes | | Yes |
81
- | <a href="./packages/design-system/eslint-plugin/src/rules/no-html-select/README.md">no-html-select</a> | Discourage direct usage of HTML select elements in favor of the Atlassian Design System select component. | Yes | | Yes |
82
- | <a href="./packages/design-system/eslint-plugin/src/rules/no-html-text-input/README.md">no-html-text-input</a> | Discourage direct usage of HTML text input elements in favor of the Atlassian Design System textfield component. | Yes | | Yes |
83
- | <a href="./packages/design-system/eslint-plugin/src/rules/no-html-textarea/README.md">no-html-textarea</a> | Discourage direct usage of HTML textarea elements in favor of the Atlassian Design System textarea component. | Yes | | Yes |
84
- | <a href="./packages/design-system/eslint-plugin/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 | | |
85
- | <a href="./packages/design-system/eslint-plugin/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 | |
86
- | <a href="./packages/design-system/eslint-plugin/src/rules/no-legacy-icons/README.md">no-legacy-icons</a> | Enforces no legacy icons are used. | | Yes | Yes |
87
- | <a href="./packages/design-system/eslint-plugin/src/rules/no-margin/README.md">no-margin</a> | Disallow using the margin CSS property. | | | |
88
- | <a href="./packages/design-system/eslint-plugin/src/rules/no-nested-styles/README.md">no-nested-styles</a> | Disallows use of nested styles in `css` functions. | Yes | | |
89
- | <a href="./packages/design-system/eslint-plugin/src/rules/no-physical-properties/README.md">no-physical-properties</a> | Disallow physical properties and values in `css` and `cssMap` function calls. | | Yes | |
90
- | <a href="./packages/design-system/eslint-plugin/src/rules/no-placeholder/README.md">no-placeholder</a> | Placeholders should not be used. If information should be given to the user about the proper type or formatting of a value, this should be included using a helper message that is associated to the input instead. | Yes | | |
91
- | <a href="./packages/design-system/eslint-plugin/src/rules/no-separator-with-list-elements/README.md">no-separator-with-list-elements</a> | Warn when the `separator` prop is used with `as="li"`, `as="ol"`, or `as="dl"` in the Inline component. | Yes | | |
92
- | <a href="./packages/design-system/eslint-plugin/src/rules/no-styled-tagged-template-expression/README.md">no-styled-tagged-template-expression</a> | Disallows any `styled` tagged template expressions that originate from Emotion, Styled Components or Compiled | | Yes | |
93
- | <a href="./packages/design-system/eslint-plugin/src/rules/no-to-match-snapshot/README.md">no-to-match-snapshot</a> | Disallow using toMatchSnapshot() in favor of toMatchInlineSnapshot(). See https://hello.atlassian.net/wiki/spaces/DST/pages/6105892000/DSTRFC-038+-+Removal+of+.toMatchSnapshot for rationale. | | | |
94
- | <a href="./packages/design-system/eslint-plugin/src/rules/no-unsafe-design-token-usage/README.md">no-unsafe-design-token-usage</a> | Enforces design token usage is statically and locally analyzable. | Yes | Yes | |
95
- | <a href="./packages/design-system/eslint-plugin/src/rules/no-unsafe-inline-snapshot/README.md">no-unsafe-inline-snapshot</a> | Enforce guardrails on toMatchInlineSnapshot usage: snapshots must not exceed 100 lines and must not contain internal implementation details like className or style attributes. | | | |
96
- | <a href="./packages/design-system/eslint-plugin/src/rules/no-unsafe-style-overrides/README.md">no-unsafe-style-overrides</a> | Discourage usage of unsafe style overrides used against the Atlassian Design System. | Yes | | |
97
- | <a href="./packages/design-system/eslint-plugin/src/rules/no-unsupported-drag-and-drop-libraries/README.md">no-unsupported-drag-and-drop-libraries</a> | Disallow importing unsupported drag and drop modules. | Yes | | |
98
- | <a href="./packages/design-system/eslint-plugin/src/rules/no-unused-css-map/README.md">no-unused-css-map</a> | Detects unused styles in cssMap objects to help keep code clean. | Yes | | |
99
- | <a href="./packages/design-system/eslint-plugin/src/rules/prefer-primitives/README.md">prefer-primitives</a> | Increase awareness of primitive components via code hints. Strictly used for education purposes and discoverability. To enforce usage please refer to the `use-primitives` rule. | | | |
100
- | <a href="./packages/design-system/eslint-plugin/src/rules/use-button-group-label/README.md">use-button-group-label</a> | Ensures button groups are described to assistive technology by a direct label or by another element. | Yes | | Yes |
101
- | <a href="./packages/design-system/eslint-plugin/src/rules/use-character-counter-field/README.md">use-character-counter-field</a> | Suggests using CharacterCounterField or CharacterCounter when Textfield or Textarea components have maxLength or minLength props. | Yes | | |
102
- | <a href="./packages/design-system/eslint-plugin/src/rules/use-correct-field/README.md">use-correct-field</a> | Ensure makers use appropriate field component for their respective form elements. | Yes | Yes | Yes |
103
- | <a href="./packages/design-system/eslint-plugin/src/rules/use-cx-function-in-xcss/README.md">use-cx-function-in-xcss</a> | Enforces cx function use to combine styles in xcss. | Yes | Yes | Yes |
104
- | <a href="./packages/design-system/eslint-plugin/src/rules/use-datetime-picker-calendar-button/README.md">use-datetime-picker-calendar-button</a> | Encourages makers to use calendar button in Atlassian Design System's date picker and datetime picker components. | Yes | Yes | Yes |
105
- | <a href="./packages/design-system/eslint-plugin/src/rules/use-drawer-label/README.md">use-drawer-label</a> | Encourages to provide accessible name for Atlassian Design System Drawer component. | Yes | | Yes |
106
- | <a href="./packages/design-system/eslint-plugin/src/rules/use-field-message-wrapper/README.md">use-field-message-wrapper</a> | Encourage use of message wrapper component when using form message components. | Yes | | Yes |
107
- | <a href="./packages/design-system/eslint-plugin/src/rules/use-heading/README.md">use-heading</a> | Encourage the usage of heading components. | Yes | Yes | Yes |
108
- | <a href="./packages/design-system/eslint-plugin/src/rules/use-heading-level-in-spotlight-card/README.md">use-heading-level-in-spotlight-card</a> | Inform developers of eventual requirement of `headingLevel` prop in `SpotlightCard` component. The heading level should be the appropriate level according to the surrounding context. | Yes | Yes | |
109
- | <a href="./packages/design-system/eslint-plugin/src/rules/use-href-in-link-item/README.md">use-href-in-link-item</a> | Inform developers of eventual requirement of `href` prop in `LinkItem` component. Elements with a `link` role require an `href` attribute for users to properly navigate, particularly those using assistive technologies. If no valid `href` is required for your use case, consider using a `ButtonItem` instead. | Yes | Yes | Yes |
110
- | <a href="./packages/design-system/eslint-plugin/src/rules/use-latest-xcss-syntax/README.md">use-latest-xcss-syntax</a> | Enforces usage of space design tokens rather than hard-coded values in xcss. | Yes | Yes | |
111
- | <a href="./packages/design-system/eslint-plugin/src/rules/use-latest-xcss-syntax-typography/README.md">use-latest-xcss-syntax-typography</a> | Prohibits use of unsafe styling properties in xcss. Please use Text/Heading primitives instead. | Yes | Yes | |
112
- | <a href="./packages/design-system/eslint-plugin/src/rules/use-menu-section-title/README.md">use-menu-section-title</a> | Encourages makers to provide accessible title for Atlassian Design System Menu Section component. | Yes | | Yes |
113
- | <a href="./packages/design-system/eslint-plugin/src/rules/use-modal-dialog-close-button/README.md">use-modal-dialog-close-button</a> | Encourages makers to use close button in Atlassian Design System's modal dialog component. | Yes | Yes | Yes |
114
- | <a href="./packages/design-system/eslint-plugin/src/rules/use-onboarding-spotlight-label/README.md">use-onboarding-spotlight-label</a> | Ensures onboarding spotlight dialogs are described to assistive technology by a direct label or by another element. | Yes | | Yes |
115
- | <a href="./packages/design-system/eslint-plugin/src/rules/use-popup-label/README.md">use-popup-label</a> | Encourages to provide accessible name for Atlassian Design System Popup component. | Yes | | Yes |
116
- | <a href="./packages/design-system/eslint-plugin/src/rules/use-primitives/README.md">use-primitives</a> | Encourage the usage of primitives components. | | Yes | Yes |
117
- | <a href="./packages/design-system/eslint-plugin/src/rules/use-primitives-text/README.md">use-primitives-text</a> | Encourage the usage of text components. | Yes | Yes | Yes |
118
- | <a href="./packages/design-system/eslint-plugin/src/rules/use-should-render-to-parent/README.md">use-should-render-to-parent</a> | Encourages makers to use the `shouldRenderToParent` where possible in Atlassian Design System `Popup` and `DropdownMenu` components. | Yes | | Yes |
119
- | <a href="./packages/design-system/eslint-plugin/src/rules/use-simple-field/README.md">use-simple-field</a> | Encourage use of simple field for better developer experience and accessibility. | Yes | | Yes |
120
- | <a href="./packages/design-system/eslint-plugin/src/rules/use-spotlight-package/README.md">use-spotlight-package</a> | Discourage the use of @atlaskit/onboarding in favor of @atlaskit/spotlight. | | Yes | Yes |
121
- | <a href="./packages/design-system/eslint-plugin/src/rules/use-tag-group-label/README.md">use-tag-group-label</a> | Ensures tag groups are described to assistive technology by a direct label or by another element. | Yes | | Yes |
122
- | <a href="./packages/design-system/eslint-plugin/src/rules/use-tokens-shape/README.md">use-tokens-shape</a> | Enforces usage of shape design tokens rather than hard-coded values. | | Yes | Yes |
123
- | <a href="./packages/design-system/eslint-plugin/src/rules/use-tokens-space/README.md">use-tokens-space</a> | Enforces usage of space design tokens rather than hard-coded values. | | Yes | Yes |
124
- | <a href="./packages/design-system/eslint-plugin/src/rules/use-tokens-typography/README.md">use-tokens-typography</a> | Enforces usage of design tokens for typography properties rather than hard-coded values. | Yes | Yes | Yes |
125
- | <a href="./packages/design-system/eslint-plugin/src/rules/use-visually-hidden/README.md">use-visually-hidden</a> | Enforce usage of the visually hidden component. | Yes | Yes | |
50
+ | Rule | Description | Recommended | Fixable | Suggestions |
51
+ | ----------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------- | ------- | ----------- |
52
+ | <a href="./src/rules/consistent-css-prop-usage/README.md">consistent-css-prop-usage</a> | Ensures consistency with `css` and `xcss` prop usages | Yes | Yes | |
53
+ | <a href="./src/rules/enforce-inline-styles-in-select/README.md">enforce-inline-styles-in-select</a> | Disallow unsupported CSS selectors in styles prop for @atlaskit/select and require inline styles only | | | |
54
+ | <a href="./src/rules/ensure-design-token-usage/README.md">ensure-design-token-usage</a> | Enforces usage of design tokens rather than hard-coded values. | Yes | Yes | Yes |
55
+ | <a href="./src/rules/ensure-design-token-usage-preview/README.md">ensure-design-token-usage/preview</a> | Enforces usage of pre-release design tokens rather than hard-coded values. | | Yes | Yes |
56
+ | <a href="./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. | | | |
57
+ | <a href="./src/rules/ensure-proper-xcss-usage/README.md">ensure-proper-xcss-usage</a> | Enforces proper xcss usage: migrate from xcss() to cssMap() and use cssMap objects with specific keys. | | | |
58
+ | <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 | |
59
+ | <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 | |
60
+ | <a href="./src/rules/no-banned-imports/README.md">no-banned-imports</a> | Disallow importing banned modules. | Yes | | |
61
+ | <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 | | |
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 | |
63
+ | <a href="./src/rules/no-custom-icons/README.md">no-custom-icons</a> | Enforces custom glyph icons are used. | | | |
64
+ | <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
+ | <a href="./src/rules/no-deprecated-apis/README.md">no-deprecated-apis</a> | Disallow using deprecated APIs. | Yes | | |
66
+ | <a href="./src/rules/no-deprecated-design-token-usage/README.md">no-deprecated-design-token-usage</a> | Disallow using deprecated design tokens. | Yes | Yes | |
67
+ | <a href="./src/rules/no-deprecated-imports/README.md">no-deprecated-imports</a> | Disallow importing deprecated modules. | Yes | Yes | Yes |
68
+ | <a href="./src/rules/no-direct-use-of-web-platform-drag-and-drop/README.md">no-direct-use-of-web-platform-drag-and-drop</a> | Disallow using direct use of native drag and drop (please use Pragmatic drag and drop) | Yes | | |
69
+ | <a href="./src/rules/no-emotion-primitives/README.md">no-emotion-primitives</a> | Ensures usage of Compiled Primitives import instead of Emotion entrypoint. | | Yes | |
70
+ | <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). | | | |
71
+ | <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. | | | |
72
+ | <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. | | | |
73
+ | <a href="./src/rules/no-html-anchor/README.md">no-html-anchor</a> | Discourage direct usage of HTML anchor elements in favor of Atlassian Design System link components. | Yes | | Yes |
74
+ | <a href="./src/rules/no-html-button/README.md">no-html-button</a> | Discourage direct usage of HTML button elements in favor of Atlassian Design System button components. | Yes | | |
75
+ | <a href="./src/rules/no-html-checkbox/README.md">no-html-checkbox</a> | Discourage direct usage of HTML checkbox elements in favor of the Atlassian Design System checkbox component. | Yes | | Yes |
76
+ | <a href="./src/rules/no-html-code/README.md">no-html-code</a> | Discourage direct usage of HTML code elements in favor of the Atlassian Design System code component. | Yes | | Yes |
77
+ | <a href="./src/rules/no-html-heading/README.md">no-html-heading</a> | Discourage direct usage of HTML heading elements in favor of Atlassian Design System heading components. | Yes | | Yes |
78
+ | <a href="./src/rules/no-html-image/README.md">no-html-image</a> | Discourage direct usage of HTML image elements in favor of the Atlassian Design System image component. | Yes | | Yes |
79
+ | <a href="./src/rules/no-html-radio/README.md">no-html-radio</a> | Discourage direct usage of HTML radio elements in favor of the Atlassian Design System radio component. | Yes | | Yes |
80
+ | <a href="./src/rules/no-html-range/README.md">no-html-range</a> | Discourage direct usage of HTML range elements in favor of the Atlassian Design System range component. | Yes | | Yes |
81
+ | <a href="./src/rules/no-html-select/README.md">no-html-select</a> | Discourage direct usage of HTML select elements in favor of the Atlassian Design System select component. | Yes | | Yes |
82
+ | <a href="./src/rules/no-html-text-input/README.md">no-html-text-input</a> | Discourage direct usage of HTML text input elements in favor of the Atlassian Design System textfield component. | Yes | | Yes |
83
+ | <a href="./src/rules/no-html-textarea/README.md">no-html-textarea</a> | Discourage direct usage of HTML textarea elements in favor of the Atlassian Design System textarea component. | Yes | | Yes |
84
+ | <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 | | |
85
+ | <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 | |
86
+ | <a href="./src/rules/no-legacy-icons/README.md">no-legacy-icons</a> | Enforces no legacy icons are used. | | Yes | Yes |
87
+ | <a href="./src/rules/no-margin/README.md">no-margin</a> | Disallow using the margin CSS property. | | | |
88
+ | <a href="./src/rules/no-nested-styles/README.md">no-nested-styles</a> | Disallows use of nested styles in `css` functions. | Yes | | |
89
+ | <a href="./src/rules/no-physical-properties/README.md">no-physical-properties</a> | Disallow physical properties and values in `css` and `cssMap` function calls. | | Yes | |
90
+ | <a href="./src/rules/no-placeholder/README.md">no-placeholder</a> | Placeholders should not be used. If information should be given to the user about the proper type or formatting of a value, this should be included using a helper message that is associated to the input instead. | Yes | | |
91
+ | <a href="./src/rules/no-separator-with-list-elements/README.md">no-separator-with-list-elements</a> | Warn when the `separator` prop is used with `as="li"`, `as="ol"`, or `as="dl"` in the Inline component. | Yes | | |
92
+ | <a href="./src/rules/no-styled-tagged-template-expression/README.md">no-styled-tagged-template-expression</a> | Disallows any `styled` tagged template expressions that originate from Emotion, Styled Components or Compiled | | Yes | |
93
+ | <a href="./src/rules/no-to-match-snapshot/README.md">no-to-match-snapshot</a> | Disallow using toMatchSnapshot() in favor of toMatchInlineSnapshot(). See https://hello.atlassian.net/wiki/spaces/DST/pages/6105892000/DSTRFC-038+-+Removal+of+.toMatchSnapshot for rationale. | | | |
94
+ | <a href="./src/rules/no-unsafe-design-token-usage/README.md">no-unsafe-design-token-usage</a> | Enforces design token usage is statically and locally analyzable. | Yes | Yes | |
95
+ | <a href="./src/rules/no-unsafe-inline-snapshot/README.md">no-unsafe-inline-snapshot</a> | Enforce guardrails on toMatchInlineSnapshot usage: snapshots must not exceed 100 lines and must not contain internal implementation details like className or style attributes. | | | |
96
+ | <a href="./src/rules/no-unsafe-style-overrides/README.md">no-unsafe-style-overrides</a> | Discourage usage of unsafe style overrides used against the Atlassian Design System. | Yes | | |
97
+ | <a href="./src/rules/no-unsupported-drag-and-drop-libraries/README.md">no-unsupported-drag-and-drop-libraries</a> | Disallow importing unsupported drag and drop modules. | Yes | | |
98
+ | <a href="./src/rules/no-unused-css-map/README.md">no-unused-css-map</a> | Detects unused styles in cssMap objects to help keep code clean. | Yes | | |
99
+ | <a href="./src/rules/prefer-primitives/README.md">prefer-primitives</a> | Increase awareness of primitive components via code hints. Strictly used for education purposes and discoverability. To enforce usage please refer to the `use-primitives` rule. | | | |
100
+ | <a href="./src/rules/use-button-group-label/README.md">use-button-group-label</a> | Ensures button groups are described to assistive technology by a direct label or by another element. | Yes | | Yes |
101
+ | <a href="./src/rules/use-character-counter-field/README.md">use-character-counter-field</a> | Suggests using CharacterCounterField or CharacterCounter when Textfield or Textarea components have maxLength or minLength props. | Yes | | |
102
+ | <a href="./src/rules/use-correct-field/README.md">use-correct-field</a> | Ensure makers use appropriate field component for their respective form elements. | Yes | Yes | Yes |
103
+ | <a href="./src/rules/use-cx-function-in-xcss/README.md">use-cx-function-in-xcss</a> | Enforces cx function use to combine styles in xcss. | Yes | Yes | Yes |
104
+ | <a href="./src/rules/use-datetime-picker-calendar-button/README.md">use-datetime-picker-calendar-button</a> | Encourages makers to use calendar button in Atlassian Design System's date picker and datetime picker components. | Yes | Yes | Yes |
105
+ | <a href="./src/rules/use-drawer-label/README.md">use-drawer-label</a> | Encourages to provide accessible name for Atlassian Design System Drawer component. | Yes | | Yes |
106
+ | <a href="./src/rules/use-field-message-wrapper/README.md">use-field-message-wrapper</a> | Encourage use of message wrapper component when using form message components. | Yes | | Yes |
107
+ | <a href="./src/rules/use-heading/README.md">use-heading</a> | Encourage the usage of heading components. | Yes | Yes | Yes |
108
+ | <a href="./src/rules/use-heading-level-in-spotlight-card/README.md">use-heading-level-in-spotlight-card</a> | Inform developers of eventual requirement of `headingLevel` prop in `SpotlightCard` component. The heading level should be the appropriate level according to the surrounding context. | Yes | Yes | |
109
+ | <a href="./src/rules/use-href-in-link-item/README.md">use-href-in-link-item</a> | Inform developers of eventual requirement of `href` prop in `LinkItem` component. Elements with a `link` role require an `href` attribute for users to properly navigate, particularly those using assistive technologies. If no valid `href` is required for your use case, consider using a `ButtonItem` instead. | Yes | Yes | Yes |
110
+ | <a href="./src/rules/use-latest-xcss-syntax/README.md">use-latest-xcss-syntax</a> | Enforces usage of space design tokens rather than hard-coded values in xcss. | Yes | Yes | |
111
+ | <a href="./src/rules/use-latest-xcss-syntax-typography/README.md">use-latest-xcss-syntax-typography</a> | Prohibits use of unsafe styling properties in xcss. Please use Text/Heading primitives instead. | Yes | Yes | |
112
+ | <a href="./src/rules/use-menu-section-title/README.md">use-menu-section-title</a> | Encourages makers to provide accessible title for Atlassian Design System Menu Section component. | Yes | | Yes |
113
+ | <a href="./src/rules/use-modal-dialog-close-button/README.md">use-modal-dialog-close-button</a> | Encourages makers to use close button in Atlassian Design System's modal dialog component. | Yes | Yes | Yes |
114
+ | <a href="./src/rules/use-onboarding-spotlight-label/README.md">use-onboarding-spotlight-label</a> | Ensures onboarding spotlight dialogs are described to assistive technology by a direct label or by another element. | Yes | | Yes |
115
+ | <a href="./src/rules/use-popup-label/README.md">use-popup-label</a> | Encourages to provide accessible name for Atlassian Design System Popup component. | Yes | | Yes |
116
+ | <a href="./src/rules/use-primitives/README.md">use-primitives</a> | Encourage the usage of primitives components. | | Yes | Yes |
117
+ | <a href="./src/rules/use-primitives-text/README.md">use-primitives-text</a> | Encourage the usage of text components. | Yes | Yes | Yes |
118
+ | <a href="./src/rules/use-should-render-to-parent/README.md">use-should-render-to-parent</a> | Encourages makers to use the `shouldRenderToParent` where possible in Atlassian Design System `Popup` and `DropdownMenu` components. | Yes | | Yes |
119
+ | <a href="./src/rules/use-simple-field/README.md">use-simple-field</a> | Encourage use of simple field for better developer experience and accessibility. | Yes | | Yes |
120
+ | <a href="./src/rules/use-simple-form/README.md">use-simple-form</a> | Encourage use of simple form for better developer experience and accessibility. | Yes | | Yes |
121
+ | <a href="./src/rules/use-spotlight-package/README.md">use-spotlight-package</a> | Discourage the use of @atlaskit/onboarding in favor of @atlaskit/spotlight. | | Yes | Yes |
122
+ | <a href="./src/rules/use-tag-group-label/README.md">use-tag-group-label</a> | Ensures tag groups are described to assistive technology by a direct label or by another element. | Yes | | Yes |
123
+ | <a href="./src/rules/use-tokens-shape/README.md">use-tokens-shape</a> | Enforces usage of shape design tokens rather than hard-coded values. | | Yes | Yes |
124
+ | <a href="./src/rules/use-tokens-space/README.md">use-tokens-space</a> | Enforces usage of space design tokens rather than hard-coded values. | | Yes | Yes |
125
+ | <a href="./src/rules/use-tokens-typography/README.md">use-tokens-typography</a> | Enforces usage of design tokens for typography properties rather than hard-coded values. | Yes | Yes | Yes |
126
+ | <a href="./src/rules/use-visually-hidden/README.md">use-visually-hidden</a> | Enforce usage of the visually hidden component. | Yes | Yes | |
126
127
 
127
128
  <!-- END_RULE_TABLE_CODEGEN -->
@@ -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::05e8a8ff80cb4a88a89ccd31570686f6>>
9
+ * @codegen <<SignedSource::1e1e5efbb1ffcefdebdd86064e50fd4a>>
10
10
  * @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system codegen
11
11
  */
12
12
 
@@ -81,6 +81,7 @@ var rules = {
81
81
  '@atlaskit/design-system/use-primitives-text': 'warn',
82
82
  '@atlaskit/design-system/use-should-render-to-parent': 'warn',
83
83
  '@atlaskit/design-system/use-simple-field': 'warn',
84
+ '@atlaskit/design-system/use-simple-form': 'warn',
84
85
  '@atlaskit/design-system/use-spotlight-package': 'warn',
85
86
  '@atlaskit/design-system/use-tag-group-label': 'warn',
86
87
  '@atlaskit/design-system/use-tokens-shape': '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::f2a8bbab8acdaf84ca6e295124378517>>
9
+ * @codegen <<SignedSource::474fa7fcdd540003aa6622a9e52497fa>>
10
10
  * @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system codegen
11
11
  */
12
12
 
@@ -80,6 +80,7 @@ var rules = {
80
80
  '@atlaskit/design-system/use-primitives-text': 'warn',
81
81
  '@atlaskit/design-system/use-should-render-to-parent': 'warn',
82
82
  '@atlaskit/design-system/use-simple-field': 'warn',
83
+ '@atlaskit/design-system/use-simple-form': 'warn',
83
84
  '@atlaskit/design-system/use-spotlight-package': 'warn',
84
85
  '@atlaskit/design-system/use-tag-group-label': 'warn',
85
86
  '@atlaskit/design-system/use-tokens-shape': '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::2ca5e0a897270a5cfe3e234d7948ed0f>>
9
+ * @codegen <<SignedSource::cb96c76e14fd1bfeec1ecf16f2787d10>>
10
10
  * @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system codegen
11
11
  */
12
12
 
@@ -63,6 +63,7 @@ var rules = {
63
63
  '@atlaskit/design-system/use-primitives-text': 'warn',
64
64
  '@atlaskit/design-system/use-should-render-to-parent': 'warn',
65
65
  '@atlaskit/design-system/use-simple-field': 'warn',
66
+ '@atlaskit/design-system/use-simple-form': 'warn',
66
67
  '@atlaskit/design-system/use-tag-group-label': 'warn',
67
68
  '@atlaskit/design-system/use-tokens-typography': 'warn',
68
69
  '@atlaskit/design-system/use-visually-hidden': '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::aee2986e6e48e70acef7dfa4ba53747d>>
9
+ * @codegen <<SignedSource::7d6723309ffe428e466de19a384d02c9>>
10
10
  * @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system codegen
11
11
  */
12
12
 
@@ -62,6 +62,7 @@ var rules = {
62
62
  '@atlaskit/design-system/use-primitives-text': 'warn',
63
63
  '@atlaskit/design-system/use-should-render-to-parent': 'warn',
64
64
  '@atlaskit/design-system/use-simple-field': 'warn',
65
+ '@atlaskit/design-system/use-simple-form': 'warn',
65
66
  '@atlaskit/design-system/use-tag-group-label': 'warn',
66
67
  '@atlaskit/design-system/use-tokens-typography': 'warn',
67
68
  '@atlaskit/design-system/use-visually-hidden': 'error'
@@ -73,6 +73,7 @@ var _usePrimitives = _interopRequireDefault(require("./use-primitives"));
73
73
  var _usePrimitivesText = _interopRequireDefault(require("./use-primitives-text"));
74
74
  var _useShouldRenderToParent = _interopRequireDefault(require("./use-should-render-to-parent"));
75
75
  var _useSimpleField = _interopRequireDefault(require("./use-simple-field"));
76
+ var _useSimpleForm = _interopRequireDefault(require("./use-simple-form"));
76
77
  var _useSpotlightPackage = _interopRequireDefault(require("./use-spotlight-package"));
77
78
  var _useTagGroupLabel = _interopRequireDefault(require("./use-tag-group-label"));
78
79
  var _useTokensShape = _interopRequireDefault(require("./use-tokens-shape"));
@@ -81,7 +82,7 @@ var _useTokensTypography = _interopRequireDefault(require("./use-tokens-typograp
81
82
  var _useVisuallyHidden = _interopRequireDefault(require("./use-visually-hidden"));
82
83
  /**
83
84
  * THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
84
- * @codegen <<SignedSource::030718cab57dce4d3b39031485e53af4>>
85
+ * @codegen <<SignedSource::f9f7263c6ed88b95a13cbfbe56cfc380>>
85
86
  * @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system codegen
86
87
  */
87
88
 
@@ -154,6 +155,7 @@ var rules = exports.rules = {
154
155
  'use-primitives-text': _usePrimitivesText.default,
155
156
  'use-should-render-to-parent': _useShouldRenderToParent.default,
156
157
  'use-simple-field': _useSimpleField.default,
158
+ 'use-simple-form': _useSimpleForm.default,
157
159
  'use-spotlight-package': _useSpotlightPackage.default,
158
160
  'use-tag-group-label': _useTagGroupLabel.default,
159
161
  'use-tokens-shape': _useTokensShape.default,
@@ -0,0 +1,162 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.topLevelAttributeNames = exports.default = exports.convertForm = void 0;
7
+ var _eslintCodemodUtils = require("eslint-codemod-utils");
8
+ var _createRule = require("../utils/create-rule");
9
+ var FORM_PACKAGE = '@atlaskit/form';
10
+ var topLevelAttributeNames = exports.topLevelAttributeNames = ['autocomplete', 'id', 'label', 'labelId', 'onKeyDown', 'onSubmit', 'name', 'noValidate', 'ref', 'xcss'];
11
+ var convertForm = exports.convertForm = 'Convert form to simple form';
12
+ var rule = (0, _createRule.createLintRule)({
13
+ meta: {
14
+ name: 'use-simple-form',
15
+ type: 'suggestion',
16
+ hasSuggestions: true,
17
+ docs: {
18
+ description: 'Encourage use of simple form for better developer experience and accessibility.',
19
+ recommended: true,
20
+ severity: 'warn'
21
+ },
22
+ messages: {
23
+ useSimpleForm: 'The simplified form implementation can be used here.'
24
+ }
25
+ },
26
+ create: function create(context) {
27
+ var formImport;
28
+ return {
29
+ ImportDeclaration: function ImportDeclaration(node) {
30
+ var source = node.source.value;
31
+
32
+ // Ignore anomalies
33
+ if (typeof source !== 'string') {
34
+ return;
35
+ }
36
+ if (!node.specifiers.length) {
37
+ return;
38
+ }
39
+
40
+ // If it's not from our package, ignore.
41
+ if (source !== FORM_PACKAGE) {
42
+ return;
43
+ }
44
+ var defaultImportSpecifiers = node.specifiers.filter(function (spec) {
45
+ return (0, _eslintCodemodUtils.isNodeOfType)(spec, 'ImportDefaultSpecifier');
46
+ });
47
+ if (defaultImportSpecifiers.length > 0) {
48
+ formImport = defaultImportSpecifiers[0].local.name;
49
+ }
50
+ },
51
+ JSXElement: function JSXElement(node) {
52
+ if (!(0, _eslintCodemodUtils.isNodeOfType)(node, 'JSXElement')) {
53
+ return;
54
+ }
55
+ if (!(0, _eslintCodemodUtils.isNodeOfType)(node.openingElement.name, 'JSXIdentifier')) {
56
+ return;
57
+ }
58
+
59
+ // if no form import exists, skip
60
+ if (!formImport) {
61
+ return;
62
+ }
63
+
64
+ // if component is not field, skip
65
+ if (node.openingElement.name.name !== formImport) {
66
+ return;
67
+ }
68
+
69
+ // if children is not a render prop, skip
70
+ var renderProps = node.children.find(function (child) {
71
+ return (0, _eslintCodemodUtils.isNodeOfType)(child, 'JSXExpressionContainer');
72
+ });
73
+ if (!renderProps) {
74
+ return;
75
+ }
76
+ var renderPropExpression = renderProps.expression;
77
+ // If not an arrow func, ignore
78
+ if (!(0, _eslintCodemodUtils.isNodeOfType)(renderPropExpression, 'ArrowFunctionExpression')) {
79
+ return;
80
+ }
81
+ var renderPropParams = renderPropExpression.params;
82
+ // if it is not an object pattern, skip
83
+ if (!(0, _eslintCodemodUtils.isNodeOfType)(renderPropParams[0], 'ObjectPattern')) {
84
+ return;
85
+ }
86
+ // if component uses more than just formProps in render props, skip
87
+ var renderPropArgProperties = renderPropParams[0].properties;
88
+ var formPropsProp = renderPropArgProperties.find(function (property) {
89
+ return (0, _eslintCodemodUtils.isNodeOfType)(property, 'Property') && (0, _eslintCodemodUtils.isNodeOfType)(property.key, 'Identifier') && property.key.name === 'formProps';
90
+ });
91
+ if (renderPropArgProperties.length > 1 || !formPropsProp) {
92
+ return;
93
+ }
94
+ var attributes = node.openingElement.attributes;
95
+ var lastProp = attributes.slice(-1)[0] || node.openingElement.name;
96
+ var sourceCode = context.sourceCode;
97
+
98
+ // if html form is not first child, don't give a fix
99
+ var renderPropBody = renderPropExpression.body;
100
+ var firstChildIsHTMLForm = (0, _eslintCodemodUtils.isNodeOfType)(renderPropBody, 'JSXElement') && (0, _eslintCodemodUtils.isNodeOfType)(renderPropBody.openingElement.name, 'JSXIdentifier') && renderPropBody.openingElement.name.name === 'form';
101
+
102
+ // If this is not an HTML form. skip because we can't convert
103
+ if (!firstChildIsHTMLForm) {
104
+ return;
105
+ }
106
+ context.report({
107
+ node: node,
108
+ messageId: 'useSimpleForm',
109
+ suggest: [{
110
+ desc: convertForm,
111
+ fix: function fix(fixer) {
112
+ var fixes = [];
113
+
114
+ // add each attribute in the HTML form inside to the AK form
115
+ var attrs = {
116
+ topLevel: [],
117
+ formProps: []
118
+ };
119
+ var htmlFormAttributes = renderPropBody.openingElement.attributes;
120
+ htmlFormAttributes.forEach(function (attr) {
121
+ if ((0, _eslintCodemodUtils.isNodeOfType)(attr, 'JSXAttribute') && (0, _eslintCodemodUtils.isNodeOfType)(attr.name, 'JSXIdentifier')) {
122
+ if (topLevelAttributeNames.includes(attr.name.name)) {
123
+ attrs.topLevel.push(attr);
124
+ } else {
125
+ attrs.formProps.push(attr);
126
+ }
127
+ }
128
+ });
129
+ attrs.topLevel.forEach(function (attr) {
130
+ fixes.push(fixer.insertTextAfter(lastProp, " ".concat(sourceCode.getText(attr))));
131
+ });
132
+ if (attrs.formProps.length > 0) {
133
+ var formPropsText = attrs.formProps.map(function (attr) {
134
+ return sourceCode.getText(attr).replace(/^([^=]*)/, "'$1'").replace('=', ': ');
135
+ }).join(',\n');
136
+ fixes.push(fixer.insertTextAfter(lastProp, " formProps={{\n".concat(formPropsText, "\n}} ")));
137
+ }
138
+
139
+ // remove the body of the AK form
140
+ fixes.push(fixer.remove(renderProps));
141
+
142
+ // Get all children text of HTML form to be added to AK form
143
+ var childrenText = '<>';
144
+ renderPropBody.children.forEach(function (child) {
145
+ // Doing `as any` because it doesn't like spread props. I
146
+ // added a test that verifies that this does indeed work,
147
+ // though, so it's fine.
148
+ childrenText += sourceCode.getText(child);
149
+ });
150
+ childrenText += '</>';
151
+
152
+ // Add the children of the HTML form to the children of the AK form
153
+ node.closingElement && fixes.push(fixer.insertTextBefore(node.closingElement, childrenText));
154
+ return fixes;
155
+ }
156
+ }]
157
+ });
158
+ }
159
+ };
160
+ }
161
+ });
162
+ 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::05e8a8ff80cb4a88a89ccd31570686f6>>
3
+ * @codegen <<SignedSource::1e1e5efbb1ffcefdebdd86064e50fd4a>>
4
4
  * @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system codegen
5
5
  */
6
6
 
@@ -75,6 +75,7 @@ const rules = {
75
75
  '@atlaskit/design-system/use-primitives-text': 'warn',
76
76
  '@atlaskit/design-system/use-should-render-to-parent': 'warn',
77
77
  '@atlaskit/design-system/use-simple-field': 'warn',
78
+ '@atlaskit/design-system/use-simple-form': 'warn',
78
79
  '@atlaskit/design-system/use-spotlight-package': 'warn',
79
80
  '@atlaskit/design-system/use-tag-group-label': 'warn',
80
81
  '@atlaskit/design-system/use-tokens-shape': '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::f2a8bbab8acdaf84ca6e295124378517>>
3
+ * @codegen <<SignedSource::474fa7fcdd540003aa6622a9e52497fa>>
4
4
  * @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system codegen
5
5
  */
6
6
 
@@ -74,6 +74,7 @@ const rules = {
74
74
  '@atlaskit/design-system/use-primitives-text': 'warn',
75
75
  '@atlaskit/design-system/use-should-render-to-parent': 'warn',
76
76
  '@atlaskit/design-system/use-simple-field': 'warn',
77
+ '@atlaskit/design-system/use-simple-form': 'warn',
77
78
  '@atlaskit/design-system/use-spotlight-package': 'warn',
78
79
  '@atlaskit/design-system/use-tag-group-label': 'warn',
79
80
  '@atlaskit/design-system/use-tokens-shape': '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::2ca5e0a897270a5cfe3e234d7948ed0f>>
3
+ * @codegen <<SignedSource::cb96c76e14fd1bfeec1ecf16f2787d10>>
4
4
  * @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system codegen
5
5
  */
6
6
 
@@ -57,6 +57,7 @@ const rules = {
57
57
  '@atlaskit/design-system/use-primitives-text': 'warn',
58
58
  '@atlaskit/design-system/use-should-render-to-parent': 'warn',
59
59
  '@atlaskit/design-system/use-simple-field': 'warn',
60
+ '@atlaskit/design-system/use-simple-form': 'warn',
60
61
  '@atlaskit/design-system/use-tag-group-label': 'warn',
61
62
  '@atlaskit/design-system/use-tokens-typography': 'warn',
62
63
  '@atlaskit/design-system/use-visually-hidden': '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::aee2986e6e48e70acef7dfa4ba53747d>>
3
+ * @codegen <<SignedSource::7d6723309ffe428e466de19a384d02c9>>
4
4
  * @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system codegen
5
5
  */
6
6
 
@@ -56,6 +56,7 @@ const rules = {
56
56
  '@atlaskit/design-system/use-primitives-text': 'warn',
57
57
  '@atlaskit/design-system/use-should-render-to-parent': 'warn',
58
58
  '@atlaskit/design-system/use-simple-field': 'warn',
59
+ '@atlaskit/design-system/use-simple-form': 'warn',
59
60
  '@atlaskit/design-system/use-tag-group-label': 'warn',
60
61
  '@atlaskit/design-system/use-tokens-typography': 'warn',
61
62
  '@atlaskit/design-system/use-visually-hidden': '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::030718cab57dce4d3b39031485e53af4>>
3
+ * @codegen <<SignedSource::f9f7263c6ed88b95a13cbfbe56cfc380>>
4
4
  * @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system codegen
5
5
  */
6
6
 
@@ -72,6 +72,7 @@ import usePrimitives from './use-primitives';
72
72
  import usePrimitivesText from './use-primitives-text';
73
73
  import useShouldRenderToParent from './use-should-render-to-parent';
74
74
  import useSimpleField from './use-simple-field';
75
+ import useSimpleForm from './use-simple-form';
75
76
  import useSpotlightPackage from './use-spotlight-package';
76
77
  import useTagGroupLabel from './use-tag-group-label';
77
78
  import useTokensShape from './use-tokens-shape';
@@ -147,6 +148,7 @@ export const rules = {
147
148
  'use-primitives-text': usePrimitivesText,
148
149
  'use-should-render-to-parent': useShouldRenderToParent,
149
150
  'use-simple-field': useSimpleField,
151
+ 'use-simple-form': useSimpleForm,
150
152
  'use-spotlight-package': useSpotlightPackage,
151
153
  'use-tag-group-label': useTagGroupLabel,
152
154
  'use-tokens-shape': useTokensShape,
@@ -0,0 +1,150 @@
1
+ import { isNodeOfType } from 'eslint-codemod-utils';
2
+ import { createLintRule } from '../utils/create-rule';
3
+ const FORM_PACKAGE = '@atlaskit/form';
4
+ export const topLevelAttributeNames = ['autocomplete', 'id', 'label', 'labelId', 'onKeyDown', 'onSubmit', 'name', 'noValidate', 'ref', 'xcss'];
5
+ export const convertForm = 'Convert form to simple form';
6
+ const rule = createLintRule({
7
+ meta: {
8
+ name: 'use-simple-form',
9
+ type: 'suggestion',
10
+ hasSuggestions: true,
11
+ docs: {
12
+ description: 'Encourage use of simple form for better developer experience and accessibility.',
13
+ recommended: true,
14
+ severity: 'warn'
15
+ },
16
+ messages: {
17
+ useSimpleForm: 'The simplified form implementation can be used here.'
18
+ }
19
+ },
20
+ create(context) {
21
+ let formImport;
22
+ return {
23
+ ImportDeclaration(node) {
24
+ const source = node.source.value;
25
+
26
+ // Ignore anomalies
27
+ if (typeof source !== 'string') {
28
+ return;
29
+ }
30
+ if (!node.specifiers.length) {
31
+ return;
32
+ }
33
+
34
+ // If it's not from our package, ignore.
35
+ if (source !== FORM_PACKAGE) {
36
+ return;
37
+ }
38
+ const defaultImportSpecifiers = node.specifiers.filter(spec => isNodeOfType(spec, 'ImportDefaultSpecifier'));
39
+ if (defaultImportSpecifiers.length > 0) {
40
+ formImport = defaultImportSpecifiers[0].local.name;
41
+ }
42
+ },
43
+ JSXElement(node) {
44
+ if (!isNodeOfType(node, 'JSXElement')) {
45
+ return;
46
+ }
47
+ if (!isNodeOfType(node.openingElement.name, 'JSXIdentifier')) {
48
+ return;
49
+ }
50
+
51
+ // if no form import exists, skip
52
+ if (!formImport) {
53
+ return;
54
+ }
55
+
56
+ // if component is not field, skip
57
+ if (node.openingElement.name.name !== formImport) {
58
+ return;
59
+ }
60
+
61
+ // if children is not a render prop, skip
62
+ const renderProps = node.children.find(child => isNodeOfType(child, 'JSXExpressionContainer'));
63
+ if (!renderProps) {
64
+ return;
65
+ }
66
+ const renderPropExpression = renderProps.expression;
67
+ // If not an arrow func, ignore
68
+ if (!isNodeOfType(renderPropExpression, 'ArrowFunctionExpression')) {
69
+ return;
70
+ }
71
+ const renderPropParams = renderPropExpression.params;
72
+ // if it is not an object pattern, skip
73
+ if (!isNodeOfType(renderPropParams[0], 'ObjectPattern')) {
74
+ return;
75
+ }
76
+ // if component uses more than just formProps in render props, skip
77
+ const renderPropArgProperties = renderPropParams[0].properties;
78
+ const formPropsProp = renderPropArgProperties.find(property => isNodeOfType(property, 'Property') && isNodeOfType(property.key, 'Identifier') && property.key.name === 'formProps');
79
+ if (renderPropArgProperties.length > 1 || !formPropsProp) {
80
+ return;
81
+ }
82
+ const attributes = node.openingElement.attributes;
83
+ const lastProp = attributes.slice(-1)[0] || node.openingElement.name;
84
+ const sourceCode = context.sourceCode;
85
+
86
+ // if html form is not first child, don't give a fix
87
+ const renderPropBody = renderPropExpression.body;
88
+ const firstChildIsHTMLForm = isNodeOfType(renderPropBody, 'JSXElement') && isNodeOfType(renderPropBody.openingElement.name, 'JSXIdentifier') && renderPropBody.openingElement.name.name === 'form';
89
+
90
+ // If this is not an HTML form. skip because we can't convert
91
+ if (!firstChildIsHTMLForm) {
92
+ return;
93
+ }
94
+ context.report({
95
+ node: node,
96
+ messageId: 'useSimpleForm',
97
+ suggest: [{
98
+ desc: convertForm,
99
+ fix: fixer => {
100
+ const fixes = [];
101
+
102
+ // add each attribute in the HTML form inside to the AK form
103
+ const attrs = {
104
+ topLevel: [],
105
+ formProps: []
106
+ };
107
+ const htmlFormAttributes = renderPropBody.openingElement.attributes;
108
+ htmlFormAttributes.forEach(attr => {
109
+ if (isNodeOfType(attr, 'JSXAttribute') && isNodeOfType(attr.name, 'JSXIdentifier')) {
110
+ if (topLevelAttributeNames.includes(attr.name.name)) {
111
+ attrs.topLevel.push(attr);
112
+ } else {
113
+ attrs.formProps.push(attr);
114
+ }
115
+ }
116
+ });
117
+ attrs.topLevel.forEach(attr => {
118
+ fixes.push(fixer.insertTextAfter(lastProp, ` ${sourceCode.getText(attr)}`));
119
+ });
120
+ if (attrs.formProps.length > 0) {
121
+ const formPropsText = attrs.formProps.map(attr => {
122
+ return sourceCode.getText(attr).replace(/^([^=]*)/, "'$1'").replace('=', ': ');
123
+ }).join(',\n');
124
+ fixes.push(fixer.insertTextAfter(lastProp, ` formProps={{\n${formPropsText}\n}} `));
125
+ }
126
+
127
+ // remove the body of the AK form
128
+ fixes.push(fixer.remove(renderProps));
129
+
130
+ // Get all children text of HTML form to be added to AK form
131
+ let childrenText = '<>';
132
+ renderPropBody.children.forEach(child => {
133
+ // Doing `as any` because it doesn't like spread props. I
134
+ // added a test that verifies that this does indeed work,
135
+ // though, so it's fine.
136
+ childrenText += sourceCode.getText(child);
137
+ });
138
+ childrenText += '</>';
139
+
140
+ // Add the children of the HTML form to the children of the AK form
141
+ node.closingElement && fixes.push(fixer.insertTextBefore(node.closingElement, childrenText));
142
+ return fixes;
143
+ }
144
+ }]
145
+ });
146
+ }
147
+ };
148
+ }
149
+ });
150
+ 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::05e8a8ff80cb4a88a89ccd31570686f6>>
3
+ * @codegen <<SignedSource::1e1e5efbb1ffcefdebdd86064e50fd4a>>
4
4
  * @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system codegen
5
5
  */
6
6
 
@@ -75,6 +75,7 @@ var rules = {
75
75
  '@atlaskit/design-system/use-primitives-text': 'warn',
76
76
  '@atlaskit/design-system/use-should-render-to-parent': 'warn',
77
77
  '@atlaskit/design-system/use-simple-field': 'warn',
78
+ '@atlaskit/design-system/use-simple-form': 'warn',
78
79
  '@atlaskit/design-system/use-spotlight-package': 'warn',
79
80
  '@atlaskit/design-system/use-tag-group-label': 'warn',
80
81
  '@atlaskit/design-system/use-tokens-shape': '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::f2a8bbab8acdaf84ca6e295124378517>>
3
+ * @codegen <<SignedSource::474fa7fcdd540003aa6622a9e52497fa>>
4
4
  * @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system codegen
5
5
  */
6
6
 
@@ -74,6 +74,7 @@ var rules = {
74
74
  '@atlaskit/design-system/use-primitives-text': 'warn',
75
75
  '@atlaskit/design-system/use-should-render-to-parent': 'warn',
76
76
  '@atlaskit/design-system/use-simple-field': 'warn',
77
+ '@atlaskit/design-system/use-simple-form': 'warn',
77
78
  '@atlaskit/design-system/use-spotlight-package': 'warn',
78
79
  '@atlaskit/design-system/use-tag-group-label': 'warn',
79
80
  '@atlaskit/design-system/use-tokens-shape': '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::2ca5e0a897270a5cfe3e234d7948ed0f>>
3
+ * @codegen <<SignedSource::cb96c76e14fd1bfeec1ecf16f2787d10>>
4
4
  * @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system codegen
5
5
  */
6
6
 
@@ -57,6 +57,7 @@ var rules = {
57
57
  '@atlaskit/design-system/use-primitives-text': 'warn',
58
58
  '@atlaskit/design-system/use-should-render-to-parent': 'warn',
59
59
  '@atlaskit/design-system/use-simple-field': 'warn',
60
+ '@atlaskit/design-system/use-simple-form': 'warn',
60
61
  '@atlaskit/design-system/use-tag-group-label': 'warn',
61
62
  '@atlaskit/design-system/use-tokens-typography': 'warn',
62
63
  '@atlaskit/design-system/use-visually-hidden': '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::aee2986e6e48e70acef7dfa4ba53747d>>
3
+ * @codegen <<SignedSource::7d6723309ffe428e466de19a384d02c9>>
4
4
  * @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system codegen
5
5
  */
6
6
 
@@ -56,6 +56,7 @@ var rules = {
56
56
  '@atlaskit/design-system/use-primitives-text': 'warn',
57
57
  '@atlaskit/design-system/use-should-render-to-parent': 'warn',
58
58
  '@atlaskit/design-system/use-simple-field': 'warn',
59
+ '@atlaskit/design-system/use-simple-form': 'warn',
59
60
  '@atlaskit/design-system/use-tag-group-label': 'warn',
60
61
  '@atlaskit/design-system/use-tokens-typography': 'warn',
61
62
  '@atlaskit/design-system/use-visually-hidden': '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::030718cab57dce4d3b39031485e53af4>>
3
+ * @codegen <<SignedSource::f9f7263c6ed88b95a13cbfbe56cfc380>>
4
4
  * @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system codegen
5
5
  */
6
6
 
@@ -72,6 +72,7 @@ import usePrimitives from './use-primitives';
72
72
  import usePrimitivesText from './use-primitives-text';
73
73
  import useShouldRenderToParent from './use-should-render-to-parent';
74
74
  import useSimpleField from './use-simple-field';
75
+ import useSimpleForm from './use-simple-form';
75
76
  import useSpotlightPackage from './use-spotlight-package';
76
77
  import useTagGroupLabel from './use-tag-group-label';
77
78
  import useTokensShape from './use-tokens-shape';
@@ -147,6 +148,7 @@ export var rules = {
147
148
  'use-primitives-text': usePrimitivesText,
148
149
  'use-should-render-to-parent': useShouldRenderToParent,
149
150
  'use-simple-field': useSimpleField,
151
+ 'use-simple-form': useSimpleForm,
150
152
  'use-spotlight-package': useSpotlightPackage,
151
153
  'use-tag-group-label': useTagGroupLabel,
152
154
  'use-tokens-shape': useTokensShape,
@@ -0,0 +1,156 @@
1
+ import { isNodeOfType } from 'eslint-codemod-utils';
2
+ import { createLintRule } from '../utils/create-rule';
3
+ var FORM_PACKAGE = '@atlaskit/form';
4
+ export var topLevelAttributeNames = ['autocomplete', 'id', 'label', 'labelId', 'onKeyDown', 'onSubmit', 'name', 'noValidate', 'ref', 'xcss'];
5
+ export var convertForm = 'Convert form to simple form';
6
+ var rule = createLintRule({
7
+ meta: {
8
+ name: 'use-simple-form',
9
+ type: 'suggestion',
10
+ hasSuggestions: true,
11
+ docs: {
12
+ description: 'Encourage use of simple form for better developer experience and accessibility.',
13
+ recommended: true,
14
+ severity: 'warn'
15
+ },
16
+ messages: {
17
+ useSimpleForm: 'The simplified form implementation can be used here.'
18
+ }
19
+ },
20
+ create: function create(context) {
21
+ var formImport;
22
+ return {
23
+ ImportDeclaration: function ImportDeclaration(node) {
24
+ var source = node.source.value;
25
+
26
+ // Ignore anomalies
27
+ if (typeof source !== 'string') {
28
+ return;
29
+ }
30
+ if (!node.specifiers.length) {
31
+ return;
32
+ }
33
+
34
+ // If it's not from our package, ignore.
35
+ if (source !== FORM_PACKAGE) {
36
+ return;
37
+ }
38
+ var defaultImportSpecifiers = node.specifiers.filter(function (spec) {
39
+ return isNodeOfType(spec, 'ImportDefaultSpecifier');
40
+ });
41
+ if (defaultImportSpecifiers.length > 0) {
42
+ formImport = defaultImportSpecifiers[0].local.name;
43
+ }
44
+ },
45
+ JSXElement: function JSXElement(node) {
46
+ if (!isNodeOfType(node, 'JSXElement')) {
47
+ return;
48
+ }
49
+ if (!isNodeOfType(node.openingElement.name, 'JSXIdentifier')) {
50
+ return;
51
+ }
52
+
53
+ // if no form import exists, skip
54
+ if (!formImport) {
55
+ return;
56
+ }
57
+
58
+ // if component is not field, skip
59
+ if (node.openingElement.name.name !== formImport) {
60
+ return;
61
+ }
62
+
63
+ // if children is not a render prop, skip
64
+ var renderProps = node.children.find(function (child) {
65
+ return isNodeOfType(child, 'JSXExpressionContainer');
66
+ });
67
+ if (!renderProps) {
68
+ return;
69
+ }
70
+ var renderPropExpression = renderProps.expression;
71
+ // If not an arrow func, ignore
72
+ if (!isNodeOfType(renderPropExpression, 'ArrowFunctionExpression')) {
73
+ return;
74
+ }
75
+ var renderPropParams = renderPropExpression.params;
76
+ // if it is not an object pattern, skip
77
+ if (!isNodeOfType(renderPropParams[0], 'ObjectPattern')) {
78
+ return;
79
+ }
80
+ // if component uses more than just formProps in render props, skip
81
+ var renderPropArgProperties = renderPropParams[0].properties;
82
+ var formPropsProp = renderPropArgProperties.find(function (property) {
83
+ return isNodeOfType(property, 'Property') && isNodeOfType(property.key, 'Identifier') && property.key.name === 'formProps';
84
+ });
85
+ if (renderPropArgProperties.length > 1 || !formPropsProp) {
86
+ return;
87
+ }
88
+ var attributes = node.openingElement.attributes;
89
+ var lastProp = attributes.slice(-1)[0] || node.openingElement.name;
90
+ var sourceCode = context.sourceCode;
91
+
92
+ // if html form is not first child, don't give a fix
93
+ var renderPropBody = renderPropExpression.body;
94
+ var firstChildIsHTMLForm = isNodeOfType(renderPropBody, 'JSXElement') && isNodeOfType(renderPropBody.openingElement.name, 'JSXIdentifier') && renderPropBody.openingElement.name.name === 'form';
95
+
96
+ // If this is not an HTML form. skip because we can't convert
97
+ if (!firstChildIsHTMLForm) {
98
+ return;
99
+ }
100
+ context.report({
101
+ node: node,
102
+ messageId: 'useSimpleForm',
103
+ suggest: [{
104
+ desc: convertForm,
105
+ fix: function fix(fixer) {
106
+ var fixes = [];
107
+
108
+ // add each attribute in the HTML form inside to the AK form
109
+ var attrs = {
110
+ topLevel: [],
111
+ formProps: []
112
+ };
113
+ var htmlFormAttributes = renderPropBody.openingElement.attributes;
114
+ htmlFormAttributes.forEach(function (attr) {
115
+ if (isNodeOfType(attr, 'JSXAttribute') && isNodeOfType(attr.name, 'JSXIdentifier')) {
116
+ if (topLevelAttributeNames.includes(attr.name.name)) {
117
+ attrs.topLevel.push(attr);
118
+ } else {
119
+ attrs.formProps.push(attr);
120
+ }
121
+ }
122
+ });
123
+ attrs.topLevel.forEach(function (attr) {
124
+ fixes.push(fixer.insertTextAfter(lastProp, " ".concat(sourceCode.getText(attr))));
125
+ });
126
+ if (attrs.formProps.length > 0) {
127
+ var formPropsText = attrs.formProps.map(function (attr) {
128
+ return sourceCode.getText(attr).replace(/^([^=]*)/, "'$1'").replace('=', ': ');
129
+ }).join(',\n');
130
+ fixes.push(fixer.insertTextAfter(lastProp, " formProps={{\n".concat(formPropsText, "\n}} ")));
131
+ }
132
+
133
+ // remove the body of the AK form
134
+ fixes.push(fixer.remove(renderProps));
135
+
136
+ // Get all children text of HTML form to be added to AK form
137
+ var childrenText = '<>';
138
+ renderPropBody.children.forEach(function (child) {
139
+ // Doing `as any` because it doesn't like spread props. I
140
+ // added a test that verifies that this does indeed work,
141
+ // though, so it's fine.
142
+ childrenText += sourceCode.getText(child);
143
+ });
144
+ childrenText += '</>';
145
+
146
+ // Add the children of the HTML form to the children of the AK form
147
+ node.closingElement && fixes.push(fixer.insertTextBefore(node.closingElement, childrenText));
148
+ return fixes;
149
+ }
150
+ }]
151
+ });
152
+ }
153
+ };
154
+ }
155
+ });
156
+ 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::05e8a8ff80cb4a88a89ccd31570686f6>>
3
+ * @codegen <<SignedSource::1e1e5efbb1ffcefdebdd86064e50fd4a>>
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::f2a8bbab8acdaf84ca6e295124378517>>
3
+ * @codegen <<SignedSource::474fa7fcdd540003aa6622a9e52497fa>>
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::2ca5e0a897270a5cfe3e234d7948ed0f>>
3
+ * @codegen <<SignedSource::cb96c76e14fd1bfeec1ecf16f2787d10>>
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::aee2986e6e48e70acef7dfa4ba53747d>>
3
+ * @codegen <<SignedSource::7d6723309ffe428e466de19a384d02c9>>
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::030718cab57dce4d3b39031485e53af4>>
3
+ * @codegen <<SignedSource::f9f7263c6ed88b95a13cbfbe56cfc380>>
4
4
  * @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system codegen
5
5
  */
6
6
  import type { Rule } from 'eslint';
@@ -0,0 +1,5 @@
1
+ import type { Rule } from 'eslint';
2
+ export declare const topLevelAttributeNames: string[];
3
+ export declare const convertForm = "Convert form to simple form";
4
+ declare const rule: Rule.RuleModule;
5
+ 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::05e8a8ff80cb4a88a89ccd31570686f6>>
3
+ * @codegen <<SignedSource::1e1e5efbb1ffcefdebdd86064e50fd4a>>
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::f2a8bbab8acdaf84ca6e295124378517>>
3
+ * @codegen <<SignedSource::474fa7fcdd540003aa6622a9e52497fa>>
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::2ca5e0a897270a5cfe3e234d7948ed0f>>
3
+ * @codegen <<SignedSource::cb96c76e14fd1bfeec1ecf16f2787d10>>
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::aee2986e6e48e70acef7dfa4ba53747d>>
3
+ * @codegen <<SignedSource::7d6723309ffe428e466de19a384d02c9>>
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::030718cab57dce4d3b39031485e53af4>>
3
+ * @codegen <<SignedSource::f9f7263c6ed88b95a13cbfbe56cfc380>>
4
4
  * @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system codegen
5
5
  */
6
6
  import type { Rule } from 'eslint';
@@ -0,0 +1,5 @@
1
+ import type { Rule } from 'eslint';
2
+ export declare const topLevelAttributeNames: string[];
3
+ export declare const convertForm = "Convert form to simple form";
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.33.0",
4
+ "version": "13.34.1",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
7
7
  "publishConfig": {
@@ -41,7 +41,7 @@
41
41
  "@atlaskit/eslint-utils": "^2.0.0",
42
42
  "@atlaskit/icon": "^29.4.0",
43
43
  "@atlaskit/icon-lab": "^5.14.0",
44
- "@atlaskit/tokens": "^9.1.0",
44
+ "@atlaskit/tokens": "^10.0.0",
45
45
  "@babel/runtime": "^7.0.0",
46
46
  "@typescript-eslint/utils": "^7.1.0",
47
47
  "ajv": "^6.12.6",