0.14.2 • Published 5 days ago

@atlaskit/eslint-plugin-ui-styling-standard v0.14.2

Weekly downloads
-
License
Apache-2.0
Repository
bitbucket
Last release
5 days ago

UI Styling Standard ESLint Plugin

The UI Styling Standard is a set of principles to guide styling UI code across Atlassian's frontend codebases and ecosystem.

These are the current ESLint rules that enforce and help comply with the UI Styling Standard today, but more are planned to support the standard over time.

Installation

You must use the recommended config to follow the styling standards at Atlassian, which will ensure compatability and performance with the design system.

module.exports = {
  extends: [
+    'plugin:@atlaskit/ui-styling-standard/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 .eslintrc.js file and enable individual rules as you're ready to adopt.

module.exports = {
  plugins: [
+    '@atlaskit/ui-styling-standard',
  ],
  rules: [
+    '@atlaskit/ui-styling-standard/convert-props-syntax': 'warn',
+    '@atlaskit/design-system/local-cx-xcss': 'error',
  ],
};

Rules

RuleDescriptionRecommendedFixableSuggestions
atlaskit-themeBan certain usages of @atlaskit/theme that @compiled/react does not understandYes
convert-props-syntaxConvert props syntax that is unsupported by styled-components@<4 or @emotion/styled to props syntax that is supported. This is useful when used in conjunction with no-styled-tagged-template-expression, as output from the latter may use props syntax unsupported by those libraries.YesYes
enforce-style-propDisallows usage of static styles in the style attribute in componentsYes
local-cx-xcssEnsures the cx() function, which is part of the XCSS API, is only used within the xcss prop. This aids tracking what styles are applied to a jsx element.Yes
no-array-argumentsPrevents usage of array arguments to style declaration functionsYesYes
no-classname-propDisallows usage of the className prop in JSXYes
no-container-queriesPrevents usage of @container query within css stylingYes
no-dynamic-stylesDisallows use of dynamic styles in CSS-in-JS callsYes
no-exported-stylesDisallows exports of css, keyframes, styled and xcssYes
no-global-stylesPrevents global styles through CSS-in-JS or CSS module importsYes
no-important-stylesDisallows important style declarationsYes
no-imported-style-valuesDisallows imports of style valuesYes
no-nested-selectorsPrevents usage of nested selectors within css stylingYes
no-styledDisallows usage of the styled importsYes
no-unsafe-valuesDisallows styles that are difficult/impossible to statically anaylze.Yes
use-compiledEnsures usage of @compiled/react instead of other CSS-in-JS librariesYesYes
@atlaskit/design-system/consistent-css-prop-usageEnsures consistency with css and xcss prop usagesYesYes
@atlaskit/design-system/no-css-tagged-template-expressionDisallows any css tagged template expressions that originate from Emotion, Styled Components or CompiledYesYes
@atlaskit/design-system/no-keyframes-tagged-template-expressionDisallows any keyframe tagged template expressions that originate from Emotion, Styled Components or CompiledYesYes
@atlaskit/design-system/no-styled-tagged-template-expressionDisallows any styled tagged template expressions that originate from Emotion, Styled Components or CompiledYesYes
@compiled/no-suppress-xcssDisallows supressing type violations when using the xcss prop.Yes
@compiled/no-js-xcssDisallows using xcss prop inside JavaScript files.Yes
@atlaskit/design-system/no-empty-styled-expressionForbids any styled expression to be used when passing empty arguments to styled.div() (or other JSX elements).Yes
@atlaskit/design-system/no-exported-cssForbid exporting css function calls. Exporting css function calls can result in unexpected behaviour at runtime, and is not statically analysable.Yes
@atlaskit/design-system/no-exported-keyframesForbid exporting keyframes function calls. Exporting css function calls can result in unexpected behaviour at runtime, and is not statically analysable.Yes
@atlaskit/design-system/no-invalid-css-mapChecks the validity of a CSS map created through cssMap. This is intended to be used alongside TypeScript's type-checking.Yes
0.14.0

9 days ago

0.14.1

8 days ago

0.14.2

5 days ago

0.13.0

10 days ago

0.12.0

11 days ago

0.11.6

12 days ago

0.11.5

18 days ago

0.11.3

23 days ago

0.11.4

22 days ago

0.11.2

24 days ago

0.11.1

29 days ago

0.11.0

1 month ago

0.10.0

1 month ago

0.9.1

1 month ago

0.9.0

1 month ago

0.8.4

1 month ago

0.8.3

1 month ago

0.8.2

1 month ago

0.8.1

2 months ago

0.8.0

2 months ago

0.7.2

2 months ago

0.7.1

2 months ago

0.7.0

2 months ago

0.6.3

2 months ago

0.6.2

2 months ago

0.6.1

2 months ago

0.5.2

2 months ago

0.6.0

2 months ago

0.5.0

2 months ago

0.5.1

2 months ago

0.4.1

3 months ago

0.4.0

3 months ago

0.3.0

3 months ago

0.2.1

4 months ago

0.2.0

4 months ago

0.1.0

5 months ago