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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # @atlaskit/eslint-plugin-design-system
2
2
 
3
+ ## 13.35.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`0a325377cc8bf`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/0a325377cc8bf) -
8
+ `use-primitives-text` will autofix `<Text size="UNSAFE_small">` to `<Text size="small">.
9
+
3
10
  ## 13.34.1
4
11
 
5
12
  ### Patch Changes
package/README.md CHANGED
@@ -47,82 +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="./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 | |
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-simple-form/README.md">use-simple-form</a> | Encourage use of simple form for better developer experience and accessibility. | Yes | | Yes |
121
+ | <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 |
122
+ | <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 |
123
+ | <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 |
124
+ | <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 |
125
+ | <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 |
126
+ | <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 | |
127
127
 
128
128
  <!-- END_RULE_TABLE_CODEGEN -->
@@ -12,10 +12,12 @@ var PATTERNS = exports.PATTERNS = [
12
12
  // <strong>text</strong>
13
13
  'strong-elements',
14
14
  // <em>text</em>
15
- 'emphasis-elements'];
15
+ 'emphasis-elements',
16
+ // <Text size="UNSAFE_small">text</Text>
17
+ 'unsafe-small-text'];
16
18
  var defaults = {
17
19
  failSilently: false,
18
- patterns: ['paragraph-elements', 'span-elements', 'strong-elements', 'emphasis-elements'],
20
+ patterns: ['paragraph-elements', 'span-elements', 'strong-elements', 'emphasis-elements', 'unsafe-small-text'],
19
21
  inheritColor: false,
20
22
  enableUnsafeAutofix: false,
21
23
  enableUnsafeReport: true
@@ -49,7 +49,8 @@ var rule = (0, _createRule.createLintRule)({
49
49
  },
50
50
  messages: {
51
51
  preferPrimitivesText: "This element can be replaced with a \"Text\" primitive. See ".concat(textDocsUrl, " for additional guidance."),
52
- preferPrimitivesStackedText: "These paragraphs can be replaced with a \"Text\" and \"Stack\" primitives. See ".concat(textDocsUrl, " for additional guidance.")
52
+ preferPrimitivesStackedText: "These paragraphs can be replaced with a \"Text\" and \"Stack\" primitives. See ".concat(textDocsUrl, " for additional guidance."),
53
+ noUnsafeSmallText: "Text size prop can be replaced with \"small\"."
53
54
  }
54
55
  },
55
56
  create: function create(context) {
@@ -79,6 +80,12 @@ var rule = (0, _createRule.createLintRule)({
79
80
  context: context,
80
81
  config: config
81
82
  });
83
+ },
84
+ 'JSXElement[openingElement.name.name=Text]': function JSXElementOpeningElementNameNameText(node) {
85
+ return _transformers.UnsafeSmallText.lint(node, {
86
+ context: context,
87
+ config: config
88
+ });
82
89
  }
83
90
  }, config);
84
91
  }
@@ -27,7 +27,14 @@ Object.defineProperty(exports, "StrongElements", {
27
27
  return _strongElements.StrongElements;
28
28
  }
29
29
  });
30
+ Object.defineProperty(exports, "UnsafeSmallText", {
31
+ enumerable: true,
32
+ get: function get() {
33
+ return _unsafeSmallText.UnsafeSmallText;
34
+ }
35
+ });
30
36
  var _emphasisElements = require("./emphasis-elements");
31
37
  var _spanElements = require("./span-elements");
32
38
  var _strongElements = require("./strong-elements");
33
- var _paragraphElements = require("./paragraph-elements");
39
+ var _paragraphElements = require("./paragraph-elements");
40
+ var _unsafeSmallText = require("./unsafe-small-text");
@@ -0,0 +1,61 @@
1
+ "use strict";
2
+
3
+ var _typeof = require("@babel/runtime/helpers/typeof");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.UnsafeSmallText = void 0;
8
+ var _eslintCodemodUtils = require("eslint-codemod-utils");
9
+ var ast = _interopRequireWildcard(require("../../../ast-nodes"));
10
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
11
+ /* eslint-disable @repo/internal/react/require-jsdoc */
12
+
13
+ var UnsafeSmallText = exports.UnsafeSmallText = {
14
+ lint: function lint(node, _ref) {
15
+ var context = _ref.context,
16
+ config = _ref.config;
17
+ if (!(0, _eslintCodemodUtils.isNodeOfType)(node, 'JSXElement')) {
18
+ return;
19
+ }
20
+
21
+ // Check whether all criteria needed to make a transformation are met
22
+ var success = UnsafeSmallText._check(node, {
23
+ context: context,
24
+ config: config
25
+ });
26
+ if (success) {
27
+ var fix = UnsafeSmallText._fix(node);
28
+ context.report({
29
+ node: node.openingElement,
30
+ messageId: 'noUnsafeSmallText',
31
+ fix: fix
32
+ });
33
+ }
34
+ },
35
+ _check: function _check(node, _ref2) {
36
+ var config = _ref2.config;
37
+ if (!config.patterns.includes('unsafe-small-text')) {
38
+ return false;
39
+ }
40
+ var elementName = ast.JSXElement.getName(node);
41
+ if (elementName !== 'Text') {
42
+ return false;
43
+ }
44
+ var sizeAttribute = ast.JSXElement.getAttributeByName(node, 'size');
45
+ if (sizeAttribute !== null && sizeAttribute !== void 0 && sizeAttribute.value && (0, _eslintCodemodUtils.isNodeOfType)(sizeAttribute.value, 'Literal')) {
46
+ return sizeAttribute.value.value === 'UNSAFE_small';
47
+ }
48
+ return false;
49
+ },
50
+ _fix: function _fix(node) {
51
+ return function (fixer) {
52
+ var sizeAttribute = ast.JSXElement.getAttributeByName(node, 'size');
53
+ if (sizeAttribute !== null && sizeAttribute !== void 0 && sizeAttribute.value && (0, _eslintCodemodUtils.isNodeOfType)(sizeAttribute.value, 'Literal')) {
54
+ var valueNode = sizeAttribute.value;
55
+ var valueFix = fixer.replaceText(valueNode, "\"small\"");
56
+ return [valueFix];
57
+ }
58
+ return [];
59
+ };
60
+ }
61
+ };
@@ -6,10 +6,12 @@ export const PATTERNS = [
6
6
  // <strong>text</strong>
7
7
  'strong-elements',
8
8
  // <em>text</em>
9
- 'emphasis-elements'];
9
+ 'emphasis-elements',
10
+ // <Text size="UNSAFE_small">text</Text>
11
+ 'unsafe-small-text'];
10
12
  const defaults = {
11
13
  failSilently: false,
12
- patterns: ['paragraph-elements', 'span-elements', 'strong-elements', 'emphasis-elements'],
14
+ patterns: ['paragraph-elements', 'span-elements', 'strong-elements', 'emphasis-elements', 'unsafe-small-text'],
13
15
  inheritColor: false,
14
16
  enableUnsafeAutofix: false,
15
17
  enableUnsafeReport: true
@@ -1,7 +1,7 @@
1
1
  import { createLintRule } from '../utils/create-rule';
2
2
  import { errorBoundary } from '../utils/error-boundary';
3
3
  import { getConfig, PATTERNS } from './config';
4
- import { EmphasisElements, ParagraphElements, SpanElements, StrongElements } from './transformers';
4
+ import { EmphasisElements, ParagraphElements, SpanElements, StrongElements, UnsafeSmallText } from './transformers';
5
5
  const textDocsUrl = 'https://atlassian.design/components/primitives/text';
6
6
  const rule = createLintRule({
7
7
  meta: {
@@ -43,7 +43,8 @@ const rule = createLintRule({
43
43
  },
44
44
  messages: {
45
45
  preferPrimitivesText: `This element can be replaced with a "Text" primitive. See ${textDocsUrl} for additional guidance.`,
46
- preferPrimitivesStackedText: `These paragraphs can be replaced with a "Text" and "Stack" primitives. See ${textDocsUrl} for additional guidance.`
46
+ preferPrimitivesStackedText: `These paragraphs can be replaced with a "Text" and "Stack" primitives. See ${textDocsUrl} for additional guidance.`,
47
+ noUnsafeSmallText: `Text size prop can be replaced with "small".`
47
48
  }
48
49
  },
49
50
  create(context) {
@@ -73,6 +74,12 @@ const rule = createLintRule({
73
74
  context,
74
75
  config
75
76
  });
77
+ },
78
+ 'JSXElement[openingElement.name.name=Text]': node => {
79
+ return UnsafeSmallText.lint(node, {
80
+ context,
81
+ config
82
+ });
76
83
  }
77
84
  }, config);
78
85
  }
@@ -1,4 +1,5 @@
1
1
  export { EmphasisElements } from './emphasis-elements';
2
2
  export { SpanElements } from './span-elements';
3
3
  export { StrongElements } from './strong-elements';
4
- export { ParagraphElements } from './paragraph-elements';
4
+ export { ParagraphElements } from './paragraph-elements';
5
+ export { UnsafeSmallText } from './unsafe-small-text';
@@ -0,0 +1,55 @@
1
+ /* eslint-disable @repo/internal/react/require-jsdoc */
2
+
3
+ import { isNodeOfType } from 'eslint-codemod-utils';
4
+ import * as ast from '../../../ast-nodes';
5
+ export const UnsafeSmallText = {
6
+ lint(node, {
7
+ context,
8
+ config
9
+ }) {
10
+ if (!isNodeOfType(node, 'JSXElement')) {
11
+ return;
12
+ }
13
+
14
+ // Check whether all criteria needed to make a transformation are met
15
+ const success = UnsafeSmallText._check(node, {
16
+ context,
17
+ config
18
+ });
19
+ if (success) {
20
+ const fix = UnsafeSmallText._fix(node);
21
+ context.report({
22
+ node: node.openingElement,
23
+ messageId: 'noUnsafeSmallText',
24
+ fix
25
+ });
26
+ }
27
+ },
28
+ _check(node, {
29
+ config
30
+ }) {
31
+ if (!config.patterns.includes('unsafe-small-text')) {
32
+ return false;
33
+ }
34
+ const elementName = ast.JSXElement.getName(node);
35
+ if (elementName !== 'Text') {
36
+ return false;
37
+ }
38
+ const sizeAttribute = ast.JSXElement.getAttributeByName(node, 'size');
39
+ if (sizeAttribute !== null && sizeAttribute !== void 0 && sizeAttribute.value && isNodeOfType(sizeAttribute.value, 'Literal')) {
40
+ return sizeAttribute.value.value === 'UNSAFE_small';
41
+ }
42
+ return false;
43
+ },
44
+ _fix(node) {
45
+ return fixer => {
46
+ const sizeAttribute = ast.JSXElement.getAttributeByName(node, 'size');
47
+ if (sizeAttribute !== null && sizeAttribute !== void 0 && sizeAttribute.value && isNodeOfType(sizeAttribute.value, 'Literal')) {
48
+ const valueNode = sizeAttribute.value;
49
+ const valueFix = fixer.replaceText(valueNode, `"small"`);
50
+ return [valueFix];
51
+ }
52
+ return [];
53
+ };
54
+ }
55
+ };
@@ -6,10 +6,12 @@ export var PATTERNS = [
6
6
  // <strong>text</strong>
7
7
  'strong-elements',
8
8
  // <em>text</em>
9
- 'emphasis-elements'];
9
+ 'emphasis-elements',
10
+ // <Text size="UNSAFE_small">text</Text>
11
+ 'unsafe-small-text'];
10
12
  var defaults = {
11
13
  failSilently: false,
12
- patterns: ['paragraph-elements', 'span-elements', 'strong-elements', 'emphasis-elements'],
14
+ patterns: ['paragraph-elements', 'span-elements', 'strong-elements', 'emphasis-elements', 'unsafe-small-text'],
13
15
  inheritColor: false,
14
16
  enableUnsafeAutofix: false,
15
17
  enableUnsafeReport: true
@@ -1,7 +1,7 @@
1
1
  import { createLintRule } from '../utils/create-rule';
2
2
  import { errorBoundary } from '../utils/error-boundary';
3
3
  import { getConfig, PATTERNS } from './config';
4
- import { EmphasisElements, ParagraphElements, SpanElements, StrongElements } from './transformers';
4
+ import { EmphasisElements, ParagraphElements, SpanElements, StrongElements, UnsafeSmallText } from './transformers';
5
5
  var textDocsUrl = 'https://atlassian.design/components/primitives/text';
6
6
  var rule = createLintRule({
7
7
  meta: {
@@ -43,7 +43,8 @@ var rule = createLintRule({
43
43
  },
44
44
  messages: {
45
45
  preferPrimitivesText: "This element can be replaced with a \"Text\" primitive. See ".concat(textDocsUrl, " for additional guidance."),
46
- preferPrimitivesStackedText: "These paragraphs can be replaced with a \"Text\" and \"Stack\" primitives. See ".concat(textDocsUrl, " for additional guidance.")
46
+ preferPrimitivesStackedText: "These paragraphs can be replaced with a \"Text\" and \"Stack\" primitives. See ".concat(textDocsUrl, " for additional guidance."),
47
+ noUnsafeSmallText: "Text size prop can be replaced with \"small\"."
47
48
  }
48
49
  },
49
50
  create: function create(context) {
@@ -73,6 +74,12 @@ var rule = createLintRule({
73
74
  context: context,
74
75
  config: config
75
76
  });
77
+ },
78
+ 'JSXElement[openingElement.name.name=Text]': function JSXElementOpeningElementNameNameText(node) {
79
+ return UnsafeSmallText.lint(node, {
80
+ context: context,
81
+ config: config
82
+ });
76
83
  }
77
84
  }, config);
78
85
  }
@@ -1,4 +1,5 @@
1
1
  export { EmphasisElements } from './emphasis-elements';
2
2
  export { SpanElements } from './span-elements';
3
3
  export { StrongElements } from './strong-elements';
4
- export { ParagraphElements } from './paragraph-elements';
4
+ export { ParagraphElements } from './paragraph-elements';
5
+ export { UnsafeSmallText } from './unsafe-small-text';
@@ -0,0 +1,53 @@
1
+ /* eslint-disable @repo/internal/react/require-jsdoc */
2
+
3
+ import { isNodeOfType } from 'eslint-codemod-utils';
4
+ import * as ast from '../../../ast-nodes';
5
+ export var UnsafeSmallText = {
6
+ lint: function lint(node, _ref) {
7
+ var context = _ref.context,
8
+ config = _ref.config;
9
+ if (!isNodeOfType(node, 'JSXElement')) {
10
+ return;
11
+ }
12
+
13
+ // Check whether all criteria needed to make a transformation are met
14
+ var success = UnsafeSmallText._check(node, {
15
+ context: context,
16
+ config: config
17
+ });
18
+ if (success) {
19
+ var fix = UnsafeSmallText._fix(node);
20
+ context.report({
21
+ node: node.openingElement,
22
+ messageId: 'noUnsafeSmallText',
23
+ fix: fix
24
+ });
25
+ }
26
+ },
27
+ _check: function _check(node, _ref2) {
28
+ var config = _ref2.config;
29
+ if (!config.patterns.includes('unsafe-small-text')) {
30
+ return false;
31
+ }
32
+ var elementName = ast.JSXElement.getName(node);
33
+ if (elementName !== 'Text') {
34
+ return false;
35
+ }
36
+ var sizeAttribute = ast.JSXElement.getAttributeByName(node, 'size');
37
+ if (sizeAttribute !== null && sizeAttribute !== void 0 && sizeAttribute.value && isNodeOfType(sizeAttribute.value, 'Literal')) {
38
+ return sizeAttribute.value.value === 'UNSAFE_small';
39
+ }
40
+ return false;
41
+ },
42
+ _fix: function _fix(node) {
43
+ return function (fixer) {
44
+ var sizeAttribute = ast.JSXElement.getAttributeByName(node, 'size');
45
+ if (sizeAttribute !== null && sizeAttribute !== void 0 && sizeAttribute.value && isNodeOfType(sizeAttribute.value, 'Literal')) {
46
+ var valueNode = sizeAttribute.value;
47
+ var valueFix = fixer.replaceText(valueNode, "\"small\"");
48
+ return [valueFix];
49
+ }
50
+ return [];
51
+ };
52
+ }
53
+ };
@@ -2,3 +2,4 @@ export { EmphasisElements } from './emphasis-elements';
2
2
  export { SpanElements } from './span-elements';
3
3
  export { StrongElements } from './strong-elements';
4
4
  export { ParagraphElements } from './paragraph-elements';
5
+ export { UnsafeSmallText } from './unsafe-small-text';
@@ -0,0 +1,8 @@
1
+ import type { Rule } from 'eslint';
2
+ import { type JSXElement } from 'eslint-codemod-utils';
3
+ import { type MetaData } from './common';
4
+ export declare const UnsafeSmallText: {
5
+ lint(node: Rule.Node, { context, config }: MetaData): void;
6
+ _check(node: JSXElement, { config }: MetaData): boolean;
7
+ _fix(node: JSXElement): Rule.ReportFixer;
8
+ };
@@ -2,3 +2,4 @@ export { EmphasisElements } from './emphasis-elements';
2
2
  export { SpanElements } from './span-elements';
3
3
  export { StrongElements } from './strong-elements';
4
4
  export { ParagraphElements } from './paragraph-elements';
5
+ export { UnsafeSmallText } from './unsafe-small-text';
@@ -0,0 +1,8 @@
1
+ import type { Rule } from 'eslint';
2
+ import { type JSXElement } from 'eslint-codemod-utils';
3
+ import { type MetaData } from './common';
4
+ export declare const UnsafeSmallText: {
5
+ lint(node: Rule.Node, { context, config }: MetaData): void;
6
+ _check(node: JSXElement, { config }: MetaData): boolean;
7
+ _fix(node: JSXElement): Rule.ReportFixer;
8
+ };
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.34.1",
4
+ "version": "13.35.0",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
7
7
  "publishConfig": {