@atlaskit/eslint-plugin-design-system 13.15.0 → 13.16.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 (45) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/README.md +65 -63
  3. package/dist/cjs/presets/all-flat.codegen.js +3 -1
  4. package/dist/cjs/presets/all.codegen.js +3 -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/ensure-proper-xcss-usage/index.js +157 -0
  8. package/dist/cjs/rules/index.codegen.js +5 -1
  9. package/dist/cjs/rules/no-utility-icons/checks.js +233 -0
  10. package/dist/cjs/rules/no-utility-icons/index.js +40 -0
  11. package/dist/es2019/presets/all-flat.codegen.js +3 -1
  12. package/dist/es2019/presets/all.codegen.js +3 -1
  13. package/dist/es2019/presets/recommended-flat.codegen.js +2 -1
  14. package/dist/es2019/presets/recommended.codegen.js +2 -1
  15. package/dist/es2019/rules/ensure-proper-xcss-usage/index.js +149 -0
  16. package/dist/es2019/rules/index.codegen.js +5 -1
  17. package/dist/es2019/rules/no-utility-icons/checks.js +164 -0
  18. package/dist/es2019/rules/no-utility-icons/index.js +35 -0
  19. package/dist/esm/presets/all-flat.codegen.js +3 -1
  20. package/dist/esm/presets/all.codegen.js +3 -1
  21. package/dist/esm/presets/recommended-flat.codegen.js +2 -1
  22. package/dist/esm/presets/recommended.codegen.js +2 -1
  23. package/dist/esm/rules/ensure-proper-xcss-usage/index.js +151 -0
  24. package/dist/esm/rules/index.codegen.js +5 -1
  25. package/dist/esm/rules/no-utility-icons/checks.js +226 -0
  26. package/dist/esm/rules/no-utility-icons/index.js +34 -0
  27. package/dist/types/index.codegen.d.ts +14 -0
  28. package/dist/types/presets/all-flat.codegen.d.ts +2 -0
  29. package/dist/types/presets/all.codegen.d.ts +2 -0
  30. package/dist/types/presets/recommended-flat.codegen.d.ts +1 -0
  31. package/dist/types/presets/recommended.codegen.d.ts +1 -0
  32. package/dist/types/rules/ensure-proper-xcss-usage/index.d.ts +3 -0
  33. package/dist/types/rules/index.codegen.d.ts +2 -0
  34. package/dist/types/rules/no-utility-icons/checks.d.ts +10 -0
  35. package/dist/types/rules/no-utility-icons/index.d.ts +3 -0
  36. package/dist/types-ts4.5/index.codegen.d.ts +14 -0
  37. package/dist/types-ts4.5/presets/all-flat.codegen.d.ts +2 -0
  38. package/dist/types-ts4.5/presets/all.codegen.d.ts +2 -0
  39. package/dist/types-ts4.5/presets/recommended-flat.codegen.d.ts +1 -0
  40. package/dist/types-ts4.5/presets/recommended.codegen.d.ts +1 -0
  41. package/dist/types-ts4.5/rules/ensure-proper-xcss-usage/index.d.ts +3 -0
  42. package/dist/types-ts4.5/rules/index.codegen.d.ts +2 -0
  43. package/dist/types-ts4.5/rules/no-utility-icons/checks.d.ts +10 -0
  44. package/dist/types-ts4.5/rules/no-utility-icons/index.d.ts +3 -0
  45. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,25 @@
1
1
  # @atlaskit/eslint-plugin-design-system
2
2
 
3
+ ## 13.16.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#159753](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/159753)
8
+ [`756c84e9b07d1`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/756c84e9b07d1) -
9
+ Update no-utility-icons rule to add more robust fixes for new buttons cases.
10
+
11
+ ## 13.16.0
12
+
13
+ ### Minor Changes
14
+
15
+ - [#157767](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/157767)
16
+ [`f3d552d85708a`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/f3d552d85708a) -
17
+ Introduces new ESLint rule to identify, discourage, and, where possible, fix use of utility icons.
18
+
19
+ ### Patch Changes
20
+
21
+ - Updated dependencies
22
+
3
23
  ## 13.15.0
4
24
 
5
25
  ### Minor Changes
package/README.md CHANGED
@@ -47,68 +47,70 @@ 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="./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/ensure-design-token-usage/README.md">ensure-design-token-usage</a> | Enforces usage of design tokens rather than hard-coded values. | Yes | Yes | Yes |
54
- | <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 |
55
- | <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. | | | |
56
- | <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 | |
57
- | <a href="./src/rules/no-banned-imports/README.md">no-banned-imports</a> | Disallow importing banned modules. | Yes | | |
58
- | <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 | | |
59
- | <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 | |
60
- | <a href="./src/rules/no-custom-icons/README.md">no-custom-icons</a> | Enforces custom glyph icons are used. | | | |
61
- | <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 | |
62
- | <a href="./src/rules/no-deprecated-apis/README.md">no-deprecated-apis</a> | Disallow using deprecated APIs. | Yes | | |
63
- | <a href="./src/rules/no-deprecated-design-token-usage/README.md">no-deprecated-design-token-usage</a> | Disallow using deprecated design tokens. | Yes | Yes | |
64
- | <a href="./src/rules/no-deprecated-imports/README.md">no-deprecated-imports</a> | Disallow importing deprecated modules. | Yes | Yes | Yes |
65
- | <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 | | |
66
- | <a href="./src/rules/no-emotion-primitives/README.md">no-emotion-primitives</a> | Ensures usage of Compiled Primitives import instead of Emotion entrypoint. | | Yes | |
67
- | <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). | | | |
68
- | <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. | | | |
69
- | <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. | | | |
70
- | <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 |
71
- | <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 | | |
72
- | <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 |
73
- | <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 |
74
- | <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 |
75
- | <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 |
76
- | <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 |
77
- | <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 |
78
- | <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 |
79
- | <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 |
80
- | <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 |
81
- | <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 | | |
82
- | <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 | |
83
- | <a href="./src/rules/no-legacy-icons/README.md">no-legacy-icons</a> | Enforces no legacy icons are used. | | Yes | Yes |
84
- | <a href="./src/rules/no-margin/README.md">no-margin</a> | Disallow using the margin CSS property. | | | |
85
- | <a href="./src/rules/no-nested-styles/README.md">no-nested-styles</a> | Disallows use of nested styles in `css` functions. | Yes | | |
86
- | <a href="./src/rules/no-physical-properties/README.md">no-physical-properties</a> | Disallow physical properties and values in `css` function calls. | | Yes | |
87
- | <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 | | |
88
- | <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 | |
89
- | <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 | |
90
- | <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 | | |
91
- | <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 | | |
92
- | <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. | | | |
93
- | <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 |
94
- | <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 |
95
- | <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 |
96
- | <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 |
97
- | <a href="./src/rules/use-heading/README.md">use-heading</a> | Encourage the usage of heading components. | | Yes | Yes |
98
- | <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 | |
99
- | <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 |
100
- | <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 | |
101
- | <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 | |
102
- | <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 |
103
- | <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 |
104
- | <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 |
105
- | <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 |
106
- | <a href="./src/rules/use-primitives/README.md">use-primitives</a> | Encourage the usage of primitives components. | | Yes | Yes |
107
- | <a href="./src/rules/use-primitives-text/README.md">use-primitives-text</a> | Encourage the usage of text components. | | Yes | Yes |
108
- | <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 |
109
- | <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 |
110
- | <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 |
111
- | <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 |
112
- | <a href="./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="./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/ensure-design-token-usage/README.md">ensure-design-token-usage</a> | Enforces usage of design tokens rather than hard-coded values. | Yes | Yes | Yes |
54
+ | <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 |
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
+ | <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. | | | |
57
+ | <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 | |
58
+ | <a href="./packages/design-system/eslint-plugin/src/rules/no-banned-imports/README.md">no-banned-imports</a> | Disallow importing banned modules. | Yes | | |
59
+ | <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 | | |
60
+ | <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 | |
61
+ | <a href="./packages/design-system/eslint-plugin/src/rules/no-custom-icons/README.md">no-custom-icons</a> | Enforces custom glyph icons are used. | | | |
62
+ | <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 | |
63
+ | <a href="./packages/design-system/eslint-plugin/src/rules/no-deprecated-apis/README.md">no-deprecated-apis</a> | Disallow using deprecated APIs. | Yes | | |
64
+ | <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 | |
65
+ | <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 |
66
+ | <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 | | |
67
+ | <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 | |
68
+ | <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). | | | |
69
+ | <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. | | | |
70
+ | <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. | | | |
71
+ | <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 |
72
+ | <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 | | |
73
+ | <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 |
74
+ | <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 |
75
+ | <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 |
76
+ | <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 |
77
+ | <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 |
78
+ | <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 |
79
+ | <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 |
80
+ | <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 |
81
+ | <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 |
82
+ | <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 | | |
83
+ | <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 | |
84
+ | <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 |
85
+ | <a href="./packages/design-system/eslint-plugin/src/rules/no-margin/README.md">no-margin</a> | Disallow using the margin CSS property. | | | |
86
+ | <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 | | |
87
+ | <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` function calls. | | Yes | |
88
+ | <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 | | |
89
+ | <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 | |
90
+ | <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 | |
91
+ | <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 | | |
92
+ | <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 | | |
93
+ | <a href="./packages/design-system/eslint-plugin/src/rules/no-utility-icons/README.md">no-utility-icons</a> | Disallow use of deprecated utility icons, in favor of core icons with `size="small"`. | Yes | Yes | Yes |
94
+ | <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. | | | |
95
+ | <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 |
96
+ | <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 |
97
+ | <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 |
98
+ | <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 |
99
+ | <a href="./packages/design-system/eslint-plugin/src/rules/use-heading/README.md">use-heading</a> | Encourage the usage of heading components. | | Yes | Yes |
100
+ | <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 | |
101
+ | <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 |
102
+ | <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 | |
103
+ | <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 | |
104
+ | <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 |
105
+ | <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 |
106
+ | <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 |
107
+ | <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 |
108
+ | <a href="./packages/design-system/eslint-plugin/src/rules/use-primitives/README.md">use-primitives</a> | Encourage the usage of primitives components. | | Yes | Yes |
109
+ | <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 |
110
+ | <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 |
111
+ | <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 |
112
+ | <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 |
113
+ | <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 |
114
+ | <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 | |
113
115
 
114
116
  <!-- 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::c6c896451f2be4d48f04068f5bbb85f1>>
9
+ * @codegen <<SignedSource::5ceb45b21744434ca96a850461a3c574>>
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/ensure-design-token-usage/preview': 'warn',
19
19
  '@atlaskit/design-system/ensure-icon-color': 'error',
20
+ '@atlaskit/design-system/ensure-proper-xcss-usage': 'error',
20
21
  '@atlaskit/design-system/icon-label': 'warn',
21
22
  '@atlaskit/design-system/no-banned-imports': 'error',
22
23
  '@atlaskit/design-system/no-boolean-autofocus-on-modal-dialog': 'warn',
@@ -52,6 +53,7 @@ var _default = exports.default = {
52
53
  '@atlaskit/design-system/no-unsafe-design-token-usage': 'error',
53
54
  '@atlaskit/design-system/no-unsafe-style-overrides': 'warn',
54
55
  '@atlaskit/design-system/no-unsupported-drag-and-drop-libraries': 'error',
56
+ '@atlaskit/design-system/no-utility-icons': 'warn',
55
57
  '@atlaskit/design-system/prefer-primitives': 'warn',
56
58
  '@atlaskit/design-system/use-button-group-label': 'warn',
57
59
  '@atlaskit/design-system/use-cx-function-in-xcss': '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::d4de619ac262298b2af11f905a02b0dd>>
9
+ * @codegen <<SignedSource::b96d8bb5115de6e0a230feef152a1365>>
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/ensure-design-token-usage/preview': 'warn',
18
18
  '@atlaskit/design-system/ensure-icon-color': 'error',
19
+ '@atlaskit/design-system/ensure-proper-xcss-usage': 'error',
19
20
  '@atlaskit/design-system/icon-label': 'warn',
20
21
  '@atlaskit/design-system/no-banned-imports': 'error',
21
22
  '@atlaskit/design-system/no-boolean-autofocus-on-modal-dialog': 'warn',
@@ -51,6 +52,7 @@ var _default = exports.default = {
51
52
  '@atlaskit/design-system/no-unsafe-design-token-usage': 'error',
52
53
  '@atlaskit/design-system/no-unsafe-style-overrides': 'warn',
53
54
  '@atlaskit/design-system/no-unsupported-drag-and-drop-libraries': 'error',
55
+ '@atlaskit/design-system/no-utility-icons': 'warn',
54
56
  '@atlaskit/design-system/prefer-primitives': 'warn',
55
57
  '@atlaskit/design-system/use-button-group-label': 'warn',
56
58
  '@atlaskit/design-system/use-cx-function-in-xcss': '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::af96131434aa77c7882ceb200e4e2cf1>>
9
+ * @codegen <<SignedSource::10f372e16c048db9bfb1bc36cf48421c>>
10
10
  * @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system codegen
11
11
  */
12
12
  var _default = exports.default = {
@@ -41,6 +41,7 @@ var _default = exports.default = {
41
41
  '@atlaskit/design-system/no-unsafe-design-token-usage': 'error',
42
42
  '@atlaskit/design-system/no-unsafe-style-overrides': 'warn',
43
43
  '@atlaskit/design-system/no-unsupported-drag-and-drop-libraries': 'error',
44
+ '@atlaskit/design-system/no-utility-icons': 'warn',
44
45
  '@atlaskit/design-system/use-button-group-label': 'warn',
45
46
  '@atlaskit/design-system/use-cx-function-in-xcss': 'error',
46
47
  '@atlaskit/design-system/use-datetime-picker-calendar-button': 'warn',
@@ -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::4bb65ab8e5c1cad968c6e74d7179e58b>>
9
+ * @codegen <<SignedSource::608f46f9cc8653226152a8edc34849d6>>
10
10
  * @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system codegen
11
11
  */
12
12
  var _default = exports.default = {
@@ -40,6 +40,7 @@ var _default = exports.default = {
40
40
  '@atlaskit/design-system/no-unsafe-design-token-usage': 'error',
41
41
  '@atlaskit/design-system/no-unsafe-style-overrides': 'warn',
42
42
  '@atlaskit/design-system/no-unsupported-drag-and-drop-libraries': 'error',
43
+ '@atlaskit/design-system/no-utility-icons': 'warn',
43
44
  '@atlaskit/design-system/use-button-group-label': 'warn',
44
45
  '@atlaskit/design-system/use-cx-function-in-xcss': 'error',
45
46
  '@atlaskit/design-system/use-datetime-picker-calendar-button': 'warn',
@@ -0,0 +1,157 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _eslintCodemodUtils = require("eslint-codemod-utils");
8
+ var _createRule = require("../utils/create-rule");
9
+ var _errorBoundary = require("../utils/error-boundary");
10
+ var rule = (0, _createRule.createLintRule)({
11
+ meta: {
12
+ name: 'ensure-proper-xcss-usage',
13
+ docs: {
14
+ description: 'Enforces proper xcss usage: migrate from xcss() to cssMap() and use cssMap objects with specific keys.',
15
+ recommended: false,
16
+ severity: 'error'
17
+ },
18
+ messages: {
19
+ missingCssMapKey: 'xcss prop should use a specific key from cssMap (e.g., {{identifier}}.root) instead of the entire cssMap object.',
20
+ noXcssWithCompiled: 'Cannot use `xcss()` function with `@atlaskit/primitives/compiled`. Use `cssMap()` from `@atlaskit/css or `@compiled/react` instead.'
21
+ }
22
+ },
23
+ create: function create(context) {
24
+ var tracker = {
25
+ // Components tracking
26
+ compiledComponents: new Set(),
27
+ // Function tracking
28
+ cssMapFunction: new Set(),
29
+ xcssFunction: new Set(),
30
+ // Variables tracking
31
+ cssMapVariables: new Map(),
32
+ xcssVariables: new Set()
33
+ };
34
+ return (0, _errorBoundary.errorBoundary)({
35
+ // Track all imports in a single handler
36
+ ImportDeclaration: function ImportDeclaration(node) {
37
+ var source = node.source.value;
38
+ node.specifiers.forEach(function (specifier) {
39
+ if (specifier.type !== 'ImportSpecifier') {
40
+ return;
41
+ }
42
+
43
+ // Handle different import sources
44
+ switch (source) {
45
+ case '@atlaskit/primitives/compiled':
46
+ tracker.compiledComponents.add(specifier.imported.name);
47
+ break;
48
+ case '@atlaskit/primitives':
49
+ if (specifier.imported.name === 'xcss') {
50
+ tracker.xcssFunction.add(specifier.local.name);
51
+ }
52
+ break;
53
+ case '@atlaskit/css':
54
+ case '@compiled/react':
55
+ if (specifier.imported.name === 'cssMap') {
56
+ tracker.cssMapFunction.add(specifier.local.name);
57
+ }
58
+ break;
59
+ }
60
+ });
61
+ },
62
+ // Track variable declarations
63
+ VariableDeclarator: function VariableDeclarator(node) {
64
+ if (!node.init || node.init.type !== 'CallExpression' || node.init.callee.type !== 'Identifier' || node.id.type !== 'Identifier') {
65
+ return;
66
+ }
67
+ var calleeName = node.init.callee.name;
68
+ var variableName = node.id.name;
69
+
70
+ // Track cssMap variables and extract their keys
71
+ if (tracker.cssMapFunction.has(calleeName)) {
72
+ var keys = new Set();
73
+
74
+ // Extract keys from the cssMap object argument
75
+ if (node.init.arguments.length > 0 && node.init.arguments[0].type === 'ObjectExpression') {
76
+ node.init.arguments[0].properties.forEach(function (prop) {
77
+ if (prop.type === 'Property' && prop.key.type === 'Identifier') {
78
+ keys.add(prop.key.name);
79
+ }
80
+ });
81
+ }
82
+ tracker.cssMapVariables.set(variableName, keys);
83
+ }
84
+
85
+ // Track xcss variables
86
+ if (tracker.xcssFunction.has(calleeName)) {
87
+ tracker.xcssVariables.add(variableName);
88
+ }
89
+ },
90
+ // Check JSX elements for xcss prop usage
91
+ JSXElement: function JSXElement(node) {
92
+ var _xcssAttribute$value;
93
+ if (!(0, _eslintCodemodUtils.isNodeOfType)(node, 'JSXElement')) {
94
+ return;
95
+ }
96
+ var elementName = node.openingElement.name;
97
+ if (elementName.type !== 'JSXIdentifier') {
98
+ return;
99
+ }
100
+ var componentName = elementName.name;
101
+ if (!tracker.compiledComponents.has(componentName)) {
102
+ return;
103
+ }
104
+
105
+ // Find xcss attribute
106
+ var xcssAttribute = node.openingElement.attributes.find(function (attr) {
107
+ return attr.type === 'JSXAttribute' && attr.name.name === 'xcss';
108
+ });
109
+ if ((xcssAttribute === null || xcssAttribute === void 0 || (_xcssAttribute$value = xcssAttribute.value) === null || _xcssAttribute$value === void 0 ? void 0 : _xcssAttribute$value.type) !== 'JSXExpressionContainer') {
110
+ return;
111
+ }
112
+ var expression = xcssAttribute.value.expression;
113
+
114
+ // Check for direct xcss function calls
115
+ if (expression.type === 'CallExpression' && expression.callee.type === 'Identifier' && tracker.xcssFunction.has(expression.callee.name)) {
116
+ context.report({
117
+ node: expression,
118
+ messageId: 'noXcssWithCompiled'
119
+ });
120
+ return;
121
+ }
122
+
123
+ // Check for variables
124
+ if (expression.type === 'Identifier') {
125
+ var identifierName = expression.name;
126
+ if (tracker.xcssVariables.has(identifierName)) {
127
+ context.report({
128
+ node: expression,
129
+ messageId: 'noXcssWithCompiled'
130
+ });
131
+ } else if (tracker.cssMapVariables.has(identifierName)) {
132
+ context.report({
133
+ node: expression,
134
+ messageId: 'missingCssMapKey',
135
+ data: {
136
+ identifier: identifierName
137
+ }
138
+ });
139
+ }
140
+ return;
141
+ }
142
+
143
+ // Check member expressions (e.g., styles.root)
144
+ if (expression.type === 'MemberExpression' && expression.object.type === 'Identifier') {
145
+ var objectName = expression.object.name;
146
+ if (tracker.xcssVariables.has(objectName)) {
147
+ context.report({
148
+ node: expression,
149
+ messageId: 'noXcssWithCompiled'
150
+ });
151
+ }
152
+ }
153
+ }
154
+ });
155
+ }
156
+ });
157
+ var _default = exports.default = rule;
@@ -9,6 +9,7 @@ var _consistentCssPropUsage = _interopRequireDefault(require("./consistent-css-p
9
9
  var _ensureDesignTokenUsage = _interopRequireDefault(require("./ensure-design-token-usage"));
10
10
  var _ensureDesignTokenUsagePreview = _interopRequireDefault(require("./ensure-design-token-usage-preview"));
11
11
  var _ensureIconColor = _interopRequireDefault(require("./ensure-icon-color"));
12
+ var _ensureProperXcssUsage = _interopRequireDefault(require("./ensure-proper-xcss-usage"));
12
13
  var _iconLabel = _interopRequireDefault(require("./icon-label"));
13
14
  var _noBannedImports = _interopRequireDefault(require("./no-banned-imports"));
14
15
  var _noBooleanAutofocusOnModalDialog = _interopRequireDefault(require("./no-boolean-autofocus-on-modal-dialog"));
@@ -45,6 +46,7 @@ var _noStyledTaggedTemplateExpression = _interopRequireDefault(require("./no-sty
45
46
  var _noUnsafeDesignTokenUsage = _interopRequireDefault(require("./no-unsafe-design-token-usage"));
46
47
  var _noUnsafeStyleOverrides = _interopRequireDefault(require("./no-unsafe-style-overrides"));
47
48
  var _noUnsupportedDragAndDropLibraries = _interopRequireDefault(require("./no-unsupported-drag-and-drop-libraries"));
49
+ var _noUtilityIcons = _interopRequireDefault(require("./no-utility-icons"));
48
50
  var _preferPrimitives = _interopRequireDefault(require("./prefer-primitives"));
49
51
  var _useButtonGroupLabel = _interopRequireDefault(require("./use-button-group-label"));
50
52
  var _useCxFunctionInXcss = _interopRequireDefault(require("./use-cx-function-in-xcss"));
@@ -68,7 +70,7 @@ var _useTokensTypography = _interopRequireDefault(require("./use-tokens-typograp
68
70
  var _useVisuallyHidden = _interopRequireDefault(require("./use-visually-hidden"));
69
71
  /**
70
72
  * THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
71
- * @codegen <<SignedSource::d42e0ce93d45d02a5c30dcfdb7110c17>>
73
+ * @codegen <<SignedSource::3de5d5b44aa01faabdb840bc7fb43d04>>
72
74
  * @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system codegen
73
75
  */
74
76
 
@@ -77,6 +79,7 @@ var rules = exports.rules = {
77
79
  'ensure-design-token-usage': _ensureDesignTokenUsage.default,
78
80
  'ensure-design-token-usage/preview': _ensureDesignTokenUsagePreview.default,
79
81
  'ensure-icon-color': _ensureIconColor.default,
82
+ 'ensure-proper-xcss-usage': _ensureProperXcssUsage.default,
80
83
  'icon-label': _iconLabel.default,
81
84
  'no-banned-imports': _noBannedImports.default,
82
85
  'no-boolean-autofocus-on-modal-dialog': _noBooleanAutofocusOnModalDialog.default,
@@ -113,6 +116,7 @@ var rules = exports.rules = {
113
116
  'no-unsafe-design-token-usage': _noUnsafeDesignTokenUsage.default,
114
117
  'no-unsafe-style-overrides': _noUnsafeStyleOverrides.default,
115
118
  'no-unsupported-drag-and-drop-libraries': _noUnsupportedDragAndDropLibraries.default,
119
+ 'no-utility-icons': _noUtilityIcons.default,
116
120
  'prefer-primitives': _preferPrimitives.default,
117
121
  'use-button-group-label': _useButtonGroupLabel.default,
118
122
  'use-cx-function-in-xcss': _useCxFunctionInXcss.default,