@atlaskit/eslint-plugin-design-system
TypeScript icon, indicating that this package has built-in type declarations

10.23.2 • Public • Published

Design System ESLint Plugin

This plugin contains rules that should be used when working with the Atlassian Design System.

Installation

yarn add @atlaskit/eslint-plugin-design-system -D

Configuration

Use the recommended config to get reasonable defaults recommended by the Atlassian Design System:

module.exports = {
  extends: [
+    'plugin:@atlaskit/design-system/recommended',
  ],
};

We don't recommended maintaining your own configuration. If you do not use our config you will need to specify individual rules and configuration. Add the plugin to your eslint.config.cjs file.

module.exports = {
  plugins: [
+    '@atlaskit/design-system',
  ],
};

Enable the rules that you would like to use.

module.exports = {
  rules: [
+    '@atlaskit/design-system/no-deprecated-apis': 'error',
  ],
};

Rules

Rule Description Recommended Fixable Suggestions
consistent-css-prop-usage Ensures consistency with css and xcss prop usages Yes Yes
ensure-design-token-usage Enforces usage of design tokens rather than hard-coded values. Yes Yes Yes
ensure-design-token-usage/preview Enforces usage of pre-release design tokens rather than hard-coded values. Yes Yes
ensure-icon-color Enforces that upcoming icon components have a color prop set, to enable a migration of the default value.
icon-label Enforces accessible usage of icon labels when composed with Atlassian Design System components. Yes Yes
no-banned-imports Disallow importing banned modules. Yes
no-css-tagged-template-expression Disallows any css tagged template expressions that originate from Emotion, Styled Components or Compiled Yes
no-custom-icons Enforces custom glyph icons are used.
no-dark-theme-vr-tests Disallow using dark colorScheme in VR tests. Yes
no-deprecated-apis Disallow using deprecated APIs. Yes
no-deprecated-design-token-usage Disallow using deprecated design tokens. Yes Yes
no-deprecated-imports Disallow importing deprecated modules. Yes
no-direct-use-of-web-platform-drag-and-drop Disallow using direct use of native drag and drop (please use Pragmatic drag and drop) Yes
no-empty-styled-expression Forbids any styled expression to be used when passing empty arguments to styled.div() (or other JSX elements).
no-exported-css Forbid exporting css function calls. Exporting css function calls can result in unexpected behaviour at runtime, and is not statically analysable.
no-exported-keyframes Forbid exporting keyframes function calls. Exporting css function calls can result in unexpected behaviour at runtime, and is not statically analysable.
no-html-anchor Discourage direct usage of HTML anchor elements in favor of Atlassian Design System link components. Yes Yes
no-html-button Discourage direct usage of HTML button elements in favor of Atlassian Design System button components. Yes
no-invalid-css-map Checks the validity of a CSS map created through cssMap. This is intended to be used alongside TypeScript's type-checking. Yes
no-keyframes-tagged-template-expression Disallows any keyframe tagged template expressions that originate from Emotion, Styled Components or Compiled Yes
no-legacy-icons Enforces no legacy icons are used. Yes Yes
no-margin Disallow using the margin CSS property.
no-nested-styles Disallows use of nested styles in css functions. Yes
no-physical-properties Disallow physical properties and values in css function calls. Yes
no-separator-with-list-elements Warn when the separator prop is used with as="li", as="ol", or as="dl" in the Inline component. Yes
no-styled-tagged-template-expression Disallows any styled tagged template expressions that originate from Emotion, Styled Components or Compiled Yes
no-unsafe-design-token-usage Enforces design token usage is statically and locally analyzable. Yes Yes
no-unsafe-style-overrides Discourage usage of unsafe style overrides used against the Atlassian Design System. Yes
no-unsupported-drag-and-drop-libraries Disallow importing unsupported drag and drop modules. Yes
prefer-primitives 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.
use-button-group-label Ensures button groups are described to assistive technology by a direct label or by another element. Yes Yes
use-drawer-label Encourages to provide accessible name for Atlassian Design System Drawer component. Yes Yes
use-heading Encourage the usage of heading components. Yes Yes
use-heading-level-in-spotlight-card 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
use-href-in-link-item 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
use-latest-xcss-syntax Enforces usage of space design tokens rather than hard-coded values in xcss. Yes Yes
use-latest-xcss-syntax-typography Prohibits use of unsafe styling properties in xcss. Please use Text/Heading primitives instead. Yes Yes
use-menu-section-title Encourages makers to provide accessible title for Atlassian Design System Menu Section component. Yes Yes
use-popup-label Encourages to provide accessible name for Atlassian Design System Popup component. Yes Yes
use-primitives Encourage the usage of primitives components. Yes Yes
use-primitives-text Encourage the usage of text components. Yes Yes
use-tag-group-label Ensures tag groups are described to assistive technology by a direct label or by another element. Yes Yes
use-tokens-space Enforces usage of space design tokens rather than hard-coded values. Yes Yes
use-tokens-typography Enforces usage of design tokens for typography properties rather than hard-coded values. Yes Yes
use-visually-hidden Enforce usage of the visually hidden component. Yes Yes

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
10.23.2234next
10.23.2234latest

Version History

VersionDownloads (Last 7 Days)Published
10.23.2234
10.23.120
10.23.061
10.22.147
10.22.0102
10.21.0167
10.20.00
10.19.00
10.18.239
10.18.10
10.18.00
10.17.313
10.17.20
10.17.10
10.17.00
10.16.00
10.15.01
10.14.00
10.13.01
10.12.50
10.12.40
10.12.30
10.12.228
10.12.10
10.12.00
10.11.245
10.11.111
10.11.00
10.10.21
10.10.10
10.10.04
10.9.00
10.8.20
10.8.12
10.8.00
10.7.20
10.7.1239
10.7.00
10.6.132
10.6.00
10.5.00
10.4.50
10.4.40
10.4.30
10.4.20
10.4.17
10.4.01
10.3.11
10.3.00
10.2.10
10.2.00
10.1.00
10.0.11
10.0.00
9.7.012
9.6.029
9.5.20
9.5.10
9.5.00
9.4.10
9.4.00
9.3.10
9.3.00
9.2.50
9.2.40
9.2.30
9.2.20
9.2.1872
9.2.00
9.1.00
9.0.07
8.38.0183
8.37.30
8.37.20
8.37.10
8.37.00
8.36.30
8.36.24
8.36.10
8.36.00
8.34.00
8.33.00
8.32.20
8.32.12
8.32.00
8.31.00
8.30.01
8.29.10
8.29.00
8.28.00
8.27.00
8.26.00
8.25.20
8.25.10
8.25.00
8.24.00
8.23.40
8.23.30
8.23.20
8.23.10
8.23.00
8.22.03
8.21.00
8.20.00
8.19.20
8.19.10
8.19.00
8.18.134
8.18.00
8.17.00
8.16.00
8.15.50
8.15.40
8.15.30
8.15.20
8.15.10
8.15.012
8.14.116
8.14.02
8.13.10
8.13.00
8.12.10
8.12.00
8.11.00
8.10.10
8.10.00
8.9.00
8.8.12
8.8.02,157
8.7.10
8.7.018
8.6.00
8.5.00
8.4.51
8.4.42
8.4.31
8.4.21
8.4.11
8.4.00
8.3.00
8.2.20
8.2.10
8.2.00
8.1.00
8.0.20
8.0.10
8.0.00
7.0.37
7.0.20
7.0.10
7.0.00
6.2.10
6.2.017
6.1.05
6.0.10
6.0.00
5.5.071
5.4.20
5.4.10
5.4.00
5.3.21
5.3.10
5.3.01
5.2.00
5.1.00
5.0.30
5.0.20
5.0.10
5.0.00
4.20.00
4.19.10
4.19.00
4.18.00
4.17.10
4.17.00
4.16.50
4.16.40
4.16.30
4.16.21
4.16.10
4.16.00
4.15.60
4.15.532
4.15.40
4.15.30
4.15.20
4.15.10
4.15.00
4.14.10
4.14.00
4.13.100
4.13.90
4.13.80
4.13.70
4.13.60
4.13.50
4.13.40
4.13.30
4.13.20
4.13.10
4.13.00
4.12.41
4.12.30
4.12.20
4.12.10
4.12.00
4.11.20
4.11.10
4.11.00
4.10.10
4.10.00
4.9.00
4.8.20
4.8.10
4.8.01
4.7.20
4.7.10
4.7.00
4.6.00
4.5.00
4.4.60
4.4.50
4.4.40
4.4.30
4.4.20
4.4.10
4.4.00
4.3.00
4.2.10
4.2.00
4.1.10
4.1.00
4.0.10
4.0.00
3.2.00
3.1.00
3.0.00
2.0.10
2.0.00
1.1.00
1.0.00
0.0.60
0.0.50
0.0.40
0.0.30
0.0.20

Package Sidebar

Install

npm i @atlaskit/eslint-plugin-design-system

Weekly Downloads

4,554

Version

10.23.2

License

Apache-2.0

Unpacked Size

2.01 MB

Total Files

907

Last publish

Collaborators

  • atlassianartifactteam
  • atlaskit-user