@atlaskit/eslint-plugin-design-system 14.3.1 → 14.3.2
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 +8 -0
- package/README.md +79 -79
- package/dist/cjs/ast-nodes/jsx-element.js +3 -1
- package/dist/cjs/rules/ensure-design-token-usage/index.js +2 -0
- package/dist/cjs/rules/lozenge-badge-tag-labelling-system-migration/index.js +6 -2
- package/dist/cjs/rules/no-boolean-autofocus-on-modal-dialog/index.js +2 -0
- package/dist/cjs/rules/no-emotion-primitives/index.js +2 -0
- package/dist/cjs/rules/no-unused-css-map/utils.js +2 -0
- package/dist/cjs/rules/use-modal-dialog-close-button/index.js +2 -0
- package/dist/cjs/rules/use-primitives/config/index.js +2 -0
- package/dist/cjs/rules/use-textfield-autocomplete/index.js +2 -0
- package/dist/cjs/rules/use-visually-hidden/utils.js +2 -0
- package/dist/cjs/rules/utils/create-no-tagged-template-expression-rule/index.js +2 -0
- package/dist/cjs/rules/utils/is-node.js +4 -0
- package/dist/es2019/ast-nodes/jsx-element.js +2 -0
- package/dist/es2019/rules/ensure-design-token-usage/index.js +2 -0
- package/dist/es2019/rules/lozenge-badge-tag-labelling-system-migration/index.js +6 -2
- package/dist/es2019/rules/no-boolean-autofocus-on-modal-dialog/index.js +2 -0
- package/dist/es2019/rules/no-emotion-primitives/index.js +2 -0
- package/dist/es2019/rules/no-unused-css-map/utils.js +2 -0
- package/dist/es2019/rules/use-modal-dialog-close-button/index.js +2 -0
- package/dist/es2019/rules/use-primitives/config/index.js +2 -0
- package/dist/es2019/rules/use-textfield-autocomplete/index.js +2 -0
- package/dist/es2019/rules/use-visually-hidden/utils.js +2 -0
- package/dist/es2019/rules/utils/create-no-tagged-template-expression-rule/index.js +2 -0
- package/dist/es2019/rules/utils/is-node.js +4 -0
- package/dist/esm/ast-nodes/jsx-element.js +2 -0
- package/dist/esm/rules/ensure-design-token-usage/index.js +2 -0
- package/dist/esm/rules/lozenge-badge-tag-labelling-system-migration/index.js +6 -2
- package/dist/esm/rules/no-boolean-autofocus-on-modal-dialog/index.js +2 -0
- package/dist/esm/rules/no-emotion-primitives/index.js +2 -0
- package/dist/esm/rules/no-unused-css-map/utils.js +2 -0
- package/dist/esm/rules/use-modal-dialog-close-button/index.js +2 -0
- package/dist/esm/rules/use-primitives/config/index.js +2 -0
- package/dist/esm/rules/use-textfield-autocomplete/index.js +2 -0
- package/dist/esm/rules/use-visually-hidden/utils.js +2 -0
- package/dist/esm/rules/utils/create-no-tagged-template-expression-rule/index.js +2 -0
- package/dist/esm/rules/utils/is-node.js +4 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @atlaskit/eslint-plugin-design-system
|
|
2
2
|
|
|
3
|
+
## 14.3.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`7affa87ae5857`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/7affa87ae5857) -
|
|
8
|
+
Add ESLint v9/v10 RuleContext compatibility for platform ESLint packages consumed by Jira.
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
3
11
|
## 14.3.1
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -47,84 +47,84 @@ module.exports = {
|
|
|
47
47
|
<!-- START_RULE_TABLE_CODEGEN -->
|
|
48
48
|
<!-- @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system codegen -->
|
|
49
49
|
|
|
50
|
-
| Rule
|
|
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-avatar-tag-avatar-props/README.md">ensure-avatar-tag-avatar-props</a> | Ensures AvatarTag avatar prop does not include controlled props (size, borderColor, appearance) which are managed internally. | Yes | | |
|
|
55
|
-
| <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 |
|
|
56
|
-
| <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 |
|
|
57
|
-
| <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. | | | |
|
|
58
|
-
| <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. | | | |
|
|
59
|
-
| <a href="./src/rules/icon-label/README.md">icon-label</a> | Enforces accessible usage of icon labels when composed with Atlassian Design System components. | Yes | Yes | |
|
|
60
|
-
| <a href="./src/rules/lozenge-badge-tag-labelling-system-migration/README.md">lozenge-badge-tag-labelling-system-migration</a> | Helps migrate Lozenge isBold prop, Badge appearance values, and SimpleTag/RemovableTag components as part of the Labelling System Phase 1 migration. | | Yes | |
|
|
61
|
-
| <a href="./src/rules/no-banned-imports/README.md">no-banned-imports</a> | Disallow importing banned modules. | Yes | | |
|
|
62
|
-
| <a href="./src/rules/no-boolean-autofocus-on-modal-dialog/README.md">no-boolean-autofocus-on-modal-dialog</a> | Encourages makers to not use boolean values for `autoFocus` on Atlassian Design System's modal dialog component. | Yes | | |
|
|
63
|
-
| <a href="./src/rules/no-css-tagged-template-expression/README.md">no-css-tagged-template-expression</a> | Disallows any `css` tagged template expressions that originate from Emotion, Styled Components or Compiled | | Yes | |
|
|
64
|
-
| <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-icon-spacing-prop/README.md">no-icon-spacing-prop</a> | Disallows usage of the deprecated spacing prop on new icons. Use Flex with cssMap for spacing instead. | Yes | | Yes |
|
|
85
|
-
| <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 | | |
|
|
86
|
-
| <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 | |
|
|
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-readonly-or-disabled-inputs/README.md">no-readonly-or-disabled-inputs</a> | Inputs should almost always be interactive. Disabled and read-only inputs can usually be replaced by a more user-friendly design pattern. | Yes | | |
|
|
92
|
-
| <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 | | |
|
|
93
|
-
| <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 | |
|
|
94
|
-
| <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. | | | |
|
|
95
|
-
| <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 | |
|
|
96
|
-
| <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. | | | |
|
|
97
|
-
| <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 | | |
|
|
98
|
-
| <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 | | |
|
|
99
|
-
| <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 | | |
|
|
100
|
-
| <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. | | | |
|
|
101
|
-
| <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 |
|
|
102
|
-
| <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 | | |
|
|
103
|
-
| <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 |
|
|
104
|
-
| <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 |
|
|
105
|
-
| <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 |
|
|
106
|
-
| <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 |
|
|
107
|
-
| <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 |
|
|
108
|
-
| <a href="./src/rules/use-heading/README.md">use-heading</a> | Encourage the usage of heading components. | Yes | Yes | Yes |
|
|
109
|
-
| <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 | |
|
|
110
|
-
| <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 |
|
|
111
|
-
| <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 | |
|
|
112
|
-
| <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 | |
|
|
113
|
-
| <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 |
|
|
114
|
-
| <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 |
|
|
115
|
-
| <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 |
|
|
116
|
-
| <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 |
|
|
117
|
-
| <a href="./src/rules/use-primitives/README.md">use-primitives</a> | Encourage the usage of primitives components. | | Yes | Yes |
|
|
118
|
-
| <a href="./src/rules/use-primitives-text/README.md">use-primitives-text</a> | Encourage the usage of text components. | Yes | Yes | Yes |
|
|
119
|
-
| <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 |
|
|
120
|
-
| <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 |
|
|
121
|
-
| <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 |
|
|
122
|
-
| <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 |
|
|
123
|
-
| <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 |
|
|
124
|
-
| <a href="./src/rules/use-textfield-autocomplete/README.md">use-textfield-autocomplete</a> | Enforce that Textfield components with type="email", "tel", or "url" have an appropriate autocomplete value for WCAG 2.2 SC 1.3.5 compliance (Identify Input Purpose). | Yes | Yes | |
|
|
125
|
-
| <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 |
|
|
126
|
-
| <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 |
|
|
127
|
-
| <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 |
|
|
128
|
-
| <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-avatar-tag-avatar-props/README.md">ensure-avatar-tag-avatar-props</a> | Ensures AvatarTag avatar prop does not include controlled props (size, borderColor, appearance) which are managed internally. | Yes | | |
|
|
55
|
+
| <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 |
|
|
56
|
+
| <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 |
|
|
57
|
+
| <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. | | | |
|
|
58
|
+
| <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. | | | |
|
|
59
|
+
| <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 | |
|
|
60
|
+
| <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 | |
|
|
61
|
+
| <a href="./packages/design-system/eslint-plugin/src/rules/no-banned-imports/README.md">no-banned-imports</a> | Disallow importing banned modules. | Yes | | |
|
|
62
|
+
| <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 | | |
|
|
63
|
+
| <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 | |
|
|
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-icon-spacing-prop/README.md">no-icon-spacing-prop</a> | Disallows usage of the deprecated spacing prop on new icons. Use Flex with cssMap for spacing instead. | Yes | | Yes |
|
|
85
|
+
| <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 | | |
|
|
86
|
+
| <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 | |
|
|
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-readonly-or-disabled-inputs/README.md">no-readonly-or-disabled-inputs</a> | Inputs should almost always be interactive. Disabled and read-only inputs can usually be replaced by a more user-friendly design pattern. | Yes | | |
|
|
92
|
+
| <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 | | |
|
|
93
|
+
| <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 | |
|
|
94
|
+
| <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. | | | |
|
|
95
|
+
| <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 | |
|
|
96
|
+
| <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. | | | |
|
|
97
|
+
| <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 | | |
|
|
98
|
+
| <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 | | |
|
|
99
|
+
| <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 | | |
|
|
100
|
+
| <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. | | | |
|
|
101
|
+
| <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 |
|
|
102
|
+
| <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 | | |
|
|
103
|
+
| <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 |
|
|
104
|
+
| <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 |
|
|
105
|
+
| <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 |
|
|
106
|
+
| <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 |
|
|
107
|
+
| <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 |
|
|
108
|
+
| <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 |
|
|
109
|
+
| <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 | |
|
|
110
|
+
| <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 |
|
|
111
|
+
| <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 | |
|
|
112
|
+
| <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 | |
|
|
113
|
+
| <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 |
|
|
114
|
+
| <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 |
|
|
115
|
+
| <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 |
|
|
116
|
+
| <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 |
|
|
117
|
+
| <a href="./packages/design-system/eslint-plugin/src/rules/use-primitives/README.md">use-primitives</a> | Encourage the usage of primitives components. | | Yes | Yes |
|
|
118
|
+
| <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 |
|
|
119
|
+
| <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 |
|
|
120
|
+
| <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 |
|
|
121
|
+
| <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 |
|
|
122
|
+
| <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 |
|
|
123
|
+
| <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 |
|
|
124
|
+
| <a href="./packages/design-system/eslint-plugin/src/rules/use-textfield-autocomplete/README.md">use-textfield-autocomplete</a> | Enforce that Textfield components with type="email", "tel", or "url" have an appropriate autocomplete value for WCAG 2.2 SC 1.3.5 compliance (Identify Input Purpose). | Yes | Yes | |
|
|
125
|
+
| <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 |
|
|
126
|
+
| <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 |
|
|
127
|
+
| <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 |
|
|
128
|
+
| <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 | |
|
|
129
129
|
|
|
130
130
|
<!-- END_RULE_TABLE_CODEGEN -->
|
|
@@ -272,8 +272,10 @@ var rule = (0, _createLintRule.createLintRule)({
|
|
|
272
272
|
* Handles both regular Tag and avatarTag migrations
|
|
273
273
|
*/
|
|
274
274
|
function generateTagReplacement(node) {
|
|
275
|
+
var _context$sourceCode;
|
|
275
276
|
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
276
|
-
|
|
277
|
+
// @ts-ignore - Jira's ESLint v10 types expose sourceCode, platform still checks with ESLint v9.
|
|
278
|
+
var sourceCode = (_context$sourceCode = context.sourceCode) !== null && _context$sourceCode !== void 0 ? _context$sourceCode : context.getSourceCode();
|
|
277
279
|
var attributes = node.openingElement.attributes;
|
|
278
280
|
|
|
279
281
|
// Build new attributes array
|
|
@@ -550,7 +552,9 @@ var rule = (0, _createLintRule.createLintRule)({
|
|
|
550
552
|
var _tagImportInfo$node7;
|
|
551
553
|
var importNode = (_tagImportInfo$node7 = tagImportInfo.node) === null || _tagImportInfo$node7 === void 0 ? void 0 : _tagImportInfo$node7.parent;
|
|
552
554
|
if (importNode) {
|
|
553
|
-
var
|
|
555
|
+
var _context$sourceCode2;
|
|
556
|
+
// @ts-ignore - Jira's ESLint v10 types expose sourceCode, platform still checks with ESLint v9.
|
|
557
|
+
var sourceCode = (_context$sourceCode2 = context.sourceCode) !== null && _context$sourceCode2 !== void 0 ? _context$sourceCode2 : context.getSourceCode();
|
|
554
558
|
var mainModuleSource = '@atlaskit/tag';
|
|
555
559
|
|
|
556
560
|
// Get all other specifiers that are not SimpleTag or RemovableTag
|
|
@@ -25,6 +25,8 @@ var getCssMapObject = exports.getCssMapObject = function getCssMapObject(node) {
|
|
|
25
25
|
}
|
|
26
26
|
return node.arguments[0];
|
|
27
27
|
};
|
|
28
|
+
|
|
29
|
+
// eslint-disable-next-line @atlaskit/volt-strict-mode/no-multiple-exports
|
|
28
30
|
var UnusedCssMapChecker = exports.UnusedCssMapChecker = /*#__PURE__*/function () {
|
|
29
31
|
function UnusedCssMapChecker(cssMapObject, context, cssMapCallNode) {
|
|
30
32
|
(0, _classCallCheck2.default)(this, UnusedCssMapChecker);
|
|
@@ -47,6 +47,8 @@ var VALID_PATTERNS = exports.VALID_PATTERNS = [
|
|
|
47
47
|
var defaults = {
|
|
48
48
|
patterns: ['compiled-css-function']
|
|
49
49
|
};
|
|
50
|
+
|
|
51
|
+
// eslint-disable-next-line @atlaskit/volt-strict-mode/no-multiple-exports
|
|
50
52
|
var getConfig = exports.getConfig = function getConfig(overrides) {
|
|
51
53
|
return Object.assign({}, defaults, overrides);
|
|
52
54
|
};
|
|
@@ -40,6 +40,8 @@ var getObjectLikeness = exports.getObjectLikeness = function getObjectLikeness(n
|
|
|
40
40
|
});
|
|
41
41
|
return countMatchingKeyValues(styleEntries);
|
|
42
42
|
};
|
|
43
|
+
|
|
44
|
+
// eslint-disable-next-line @atlaskit/volt-strict-mode/no-multiple-exports
|
|
43
45
|
var countMatchingKeyValues = exports.countMatchingKeyValues = function countMatchingKeyValues(styleEntries) {
|
|
44
46
|
var matchingStyleEntries = styleEntries.filter(function (entry) {
|
|
45
47
|
return entry.key in referenceObject;
|
|
@@ -34,6 +34,8 @@ var noTaggedTemplateExpressionRuleSchema = exports.noTaggedTemplateExpressionRul
|
|
|
34
34
|
* but it would add a lot of complexity.
|
|
35
35
|
*/
|
|
36
36
|
var shouldSkipMultilineComments = false;
|
|
37
|
+
|
|
38
|
+
// eslint-disable-next-line @atlaskit/volt-strict-mode/no-multiple-exports
|
|
37
39
|
var createNoTaggedTemplateExpressionRule = exports.createNoTaggedTemplateExpressionRule = function createNoTaggedTemplateExpressionRule(isUsage, messageId) {
|
|
38
40
|
return function (context) {
|
|
39
41
|
var importSources = (0, _isSupportedImport.getImportSources)(context);
|
|
@@ -16,9 +16,13 @@ var cssInJsCallees = ['css', 'styled', 'styled2'];
|
|
|
16
16
|
var isCssInJsCallNode = exports.isCssInJsCallNode = function isCssInJsCallNode(node) {
|
|
17
17
|
return (node === null || node === void 0 ? void 0 : node.type) === 'CallExpression' && node.callee.type === 'Identifier' && cssInJsCallees.includes(node.callee.name);
|
|
18
18
|
};
|
|
19
|
+
|
|
20
|
+
// eslint-disable-next-line @atlaskit/volt-strict-mode/no-multiple-exports
|
|
19
21
|
var isCssInJsObjectNode = exports.isCssInJsObjectNode = function isCssInJsObjectNode(node) {
|
|
20
22
|
return (node === null || node === void 0 ? void 0 : node.type) === 'CallExpression' && node.callee.type === 'MemberExpression' && node.callee.object.type === 'Identifier' && cssInJsCallees.includes(node.callee.object.name);
|
|
21
23
|
};
|
|
24
|
+
|
|
25
|
+
// eslint-disable-next-line @atlaskit/volt-strict-mode/no-multiple-exports
|
|
22
26
|
var _isDecendantOfStyleBlock = exports.isDecendantOfStyleBlock = function isDecendantOfStyleBlock(node) {
|
|
23
27
|
if (node.type === 'VariableDeclarator') {
|
|
24
28
|
if (node.id.type !== 'Identifier') {
|
|
@@ -262,7 +262,9 @@ const rule = createLintRule({
|
|
|
262
262
|
* Handles both regular Tag and avatarTag migrations
|
|
263
263
|
*/
|
|
264
264
|
function generateTagReplacement(node, options = {}) {
|
|
265
|
-
|
|
265
|
+
var _context$sourceCode;
|
|
266
|
+
// @ts-ignore - Jira's ESLint v10 types expose sourceCode, platform still checks with ESLint v9.
|
|
267
|
+
const sourceCode = (_context$sourceCode = context.sourceCode) !== null && _context$sourceCode !== void 0 ? _context$sourceCode : context.getSourceCode();
|
|
266
268
|
const attributes = node.openingElement.attributes;
|
|
267
269
|
|
|
268
270
|
// Build new attributes array
|
|
@@ -544,7 +546,9 @@ const rule = createLintRule({
|
|
|
544
546
|
var _tagImportInfo$node7;
|
|
545
547
|
const importNode = (_tagImportInfo$node7 = tagImportInfo.node) === null || _tagImportInfo$node7 === void 0 ? void 0 : _tagImportInfo$node7.parent;
|
|
546
548
|
if (importNode) {
|
|
547
|
-
|
|
549
|
+
var _context$sourceCode2;
|
|
550
|
+
// @ts-ignore - Jira's ESLint v10 types expose sourceCode, platform still checks with ESLint v9.
|
|
551
|
+
const sourceCode = (_context$sourceCode2 = context.sourceCode) !== null && _context$sourceCode2 !== void 0 ? _context$sourceCode2 : context.getSourceCode();
|
|
548
552
|
const mainModuleSource = '@atlaskit/tag';
|
|
549
553
|
|
|
550
554
|
// Get all other specifiers that are not SimpleTag or RemovableTag
|
|
@@ -12,6 +12,8 @@ export const getCssMapObject = node => {
|
|
|
12
12
|
}
|
|
13
13
|
return node.arguments[0];
|
|
14
14
|
};
|
|
15
|
+
|
|
16
|
+
// eslint-disable-next-line @atlaskit/volt-strict-mode/no-multiple-exports
|
|
15
17
|
export class UnusedCssMapChecker {
|
|
16
18
|
constructor(cssMapObject, context, cssMapCallNode) {
|
|
17
19
|
this.cssMapObject = cssMapObject;
|
|
@@ -41,6 +41,8 @@ export const VALID_PATTERNS = [
|
|
|
41
41
|
const defaults = {
|
|
42
42
|
patterns: ['compiled-css-function']
|
|
43
43
|
};
|
|
44
|
+
|
|
45
|
+
// eslint-disable-next-line @atlaskit/volt-strict-mode/no-multiple-exports
|
|
44
46
|
export const getConfig = overrides => {
|
|
45
47
|
return Object.assign({}, defaults, overrides);
|
|
46
48
|
};
|
|
@@ -31,6 +31,8 @@ export const getObjectLikeness = node => {
|
|
|
31
31
|
}).filter(node => Boolean(node));
|
|
32
32
|
return countMatchingKeyValues(styleEntries);
|
|
33
33
|
};
|
|
34
|
+
|
|
35
|
+
// eslint-disable-next-line @atlaskit/volt-strict-mode/no-multiple-exports
|
|
34
36
|
export const countMatchingKeyValues = styleEntries => {
|
|
35
37
|
const matchingStyleEntries = styleEntries.filter(entry => {
|
|
36
38
|
return entry.key in referenceObject;
|
|
@@ -26,6 +26,8 @@ export const noTaggedTemplateExpressionRuleSchema = [{
|
|
|
26
26
|
* but it would add a lot of complexity.
|
|
27
27
|
*/
|
|
28
28
|
const shouldSkipMultilineComments = false;
|
|
29
|
+
|
|
30
|
+
// eslint-disable-next-line @atlaskit/volt-strict-mode/no-multiple-exports
|
|
29
31
|
export const createNoTaggedTemplateExpressionRule = (isUsage, messageId) => context => {
|
|
30
32
|
const importSources = getImportSources(context);
|
|
31
33
|
return {
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import { isCssInJsTemplateNode } from './is-css-in-js-template-node';
|
|
2
2
|
const cssInJsCallees = ['css', 'styled', 'styled2'];
|
|
3
3
|
export const isCssInJsCallNode = node => (node === null || node === void 0 ? void 0 : node.type) === 'CallExpression' && node.callee.type === 'Identifier' && cssInJsCallees.includes(node.callee.name);
|
|
4
|
+
|
|
5
|
+
// eslint-disable-next-line @atlaskit/volt-strict-mode/no-multiple-exports
|
|
4
6
|
export const isCssInJsObjectNode = node => (node === null || node === void 0 ? void 0 : node.type) === 'CallExpression' && node.callee.type === 'MemberExpression' && node.callee.object.type === 'Identifier' && cssInJsCallees.includes(node.callee.object.name);
|
|
7
|
+
|
|
8
|
+
// eslint-disable-next-line @atlaskit/volt-strict-mode/no-multiple-exports
|
|
5
9
|
export const isDecendantOfStyleBlock = node => {
|
|
6
10
|
if (node.type === 'VariableDeclarator') {
|
|
7
11
|
if (node.id.type !== 'Identifier') {
|
|
@@ -265,8 +265,10 @@ var rule = createLintRule({
|
|
|
265
265
|
* Handles both regular Tag and avatarTag migrations
|
|
266
266
|
*/
|
|
267
267
|
function generateTagReplacement(node) {
|
|
268
|
+
var _context$sourceCode;
|
|
268
269
|
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
269
|
-
|
|
270
|
+
// @ts-ignore - Jira's ESLint v10 types expose sourceCode, platform still checks with ESLint v9.
|
|
271
|
+
var sourceCode = (_context$sourceCode = context.sourceCode) !== null && _context$sourceCode !== void 0 ? _context$sourceCode : context.getSourceCode();
|
|
270
272
|
var attributes = node.openingElement.attributes;
|
|
271
273
|
|
|
272
274
|
// Build new attributes array
|
|
@@ -543,7 +545,9 @@ var rule = createLintRule({
|
|
|
543
545
|
var _tagImportInfo$node7;
|
|
544
546
|
var importNode = (_tagImportInfo$node7 = tagImportInfo.node) === null || _tagImportInfo$node7 === void 0 ? void 0 : _tagImportInfo$node7.parent;
|
|
545
547
|
if (importNode) {
|
|
546
|
-
var
|
|
548
|
+
var _context$sourceCode2;
|
|
549
|
+
// @ts-ignore - Jira's ESLint v10 types expose sourceCode, platform still checks with ESLint v9.
|
|
550
|
+
var sourceCode = (_context$sourceCode2 = context.sourceCode) !== null && _context$sourceCode2 !== void 0 ? _context$sourceCode2 : context.getSourceCode();
|
|
547
551
|
var mainModuleSource = '@atlaskit/tag';
|
|
548
552
|
|
|
549
553
|
// Get all other specifiers that are not SimpleTag or RemovableTag
|
|
@@ -18,6 +18,8 @@ export var getCssMapObject = function getCssMapObject(node) {
|
|
|
18
18
|
}
|
|
19
19
|
return node.arguments[0];
|
|
20
20
|
};
|
|
21
|
+
|
|
22
|
+
// eslint-disable-next-line @atlaskit/volt-strict-mode/no-multiple-exports
|
|
21
23
|
export var UnusedCssMapChecker = /*#__PURE__*/function () {
|
|
22
24
|
function UnusedCssMapChecker(cssMapObject, context, cssMapCallNode) {
|
|
23
25
|
_classCallCheck(this, UnusedCssMapChecker);
|
|
@@ -41,6 +41,8 @@ export var VALID_PATTERNS = [
|
|
|
41
41
|
var defaults = {
|
|
42
42
|
patterns: ['compiled-css-function']
|
|
43
43
|
};
|
|
44
|
+
|
|
45
|
+
// eslint-disable-next-line @atlaskit/volt-strict-mode/no-multiple-exports
|
|
44
46
|
export var getConfig = function getConfig(overrides) {
|
|
45
47
|
return Object.assign({}, defaults, overrides);
|
|
46
48
|
};
|
|
@@ -34,6 +34,8 @@ export var getObjectLikeness = function getObjectLikeness(node) {
|
|
|
34
34
|
});
|
|
35
35
|
return countMatchingKeyValues(styleEntries);
|
|
36
36
|
};
|
|
37
|
+
|
|
38
|
+
// eslint-disable-next-line @atlaskit/volt-strict-mode/no-multiple-exports
|
|
37
39
|
export var countMatchingKeyValues = function countMatchingKeyValues(styleEntries) {
|
|
38
40
|
var matchingStyleEntries = styleEntries.filter(function (entry) {
|
|
39
41
|
return entry.key in referenceObject;
|
|
@@ -27,6 +27,8 @@ export var noTaggedTemplateExpressionRuleSchema = [{
|
|
|
27
27
|
* but it would add a lot of complexity.
|
|
28
28
|
*/
|
|
29
29
|
var shouldSkipMultilineComments = false;
|
|
30
|
+
|
|
31
|
+
// eslint-disable-next-line @atlaskit/volt-strict-mode/no-multiple-exports
|
|
30
32
|
export var createNoTaggedTemplateExpressionRule = function createNoTaggedTemplateExpressionRule(isUsage, messageId) {
|
|
31
33
|
return function (context) {
|
|
32
34
|
var importSources = getImportSources(context);
|
|
@@ -3,9 +3,13 @@ var cssInJsCallees = ['css', 'styled', 'styled2'];
|
|
|
3
3
|
export var isCssInJsCallNode = function isCssInJsCallNode(node) {
|
|
4
4
|
return (node === null || node === void 0 ? void 0 : node.type) === 'CallExpression' && node.callee.type === 'Identifier' && cssInJsCallees.includes(node.callee.name);
|
|
5
5
|
};
|
|
6
|
+
|
|
7
|
+
// eslint-disable-next-line @atlaskit/volt-strict-mode/no-multiple-exports
|
|
6
8
|
export var isCssInJsObjectNode = function isCssInJsObjectNode(node) {
|
|
7
9
|
return (node === null || node === void 0 ? void 0 : node.type) === 'CallExpression' && node.callee.type === 'MemberExpression' && node.callee.object.type === 'Identifier' && cssInJsCallees.includes(node.callee.object.name);
|
|
8
10
|
};
|
|
11
|
+
|
|
12
|
+
// eslint-disable-next-line @atlaskit/volt-strict-mode/no-multiple-exports
|
|
9
13
|
var _isDecendantOfStyleBlock = function isDecendantOfStyleBlock(node) {
|
|
10
14
|
if (node.type === 'VariableDeclarator') {
|
|
11
15
|
if (node.id.type !== 'Identifier') {
|
package/package.json
CHANGED