@atlaskit/eslint-plugin-ui-styling-standard

中文文档
3.0.4发布于 2026/11/02Apache-2.0TypeScriptESM + CJS近 30 天下载 3576

The eslint plugin to enforce and educate on Atlassian's UI Styling Standard

原始使用文档

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 eslint.config.cjs 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 understand
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-atlaskit-themeDisallow imports from @atlaskit/themeYes
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-selectorsDisallows use of nested styles in css functions.YesYesYes
no-unsafe-valuesDisallows styles that are difficult/impossible to statically anaylze.Yes
no-unused-cssmap-propertiesDetects unused properties in cssMap style objects that are not exported. Helps maintain clean code by identifying style variants that are defined but never used.Yes
use-compiledEnsures usage of @compiled/react or @atlaskit/css 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
@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-invalid-css-mapChecks the validity of a CSS map created through cssMap. This is intended to be used alongside TypeScript's type-checking.Yes
@atlaskit/design-system/no-css-map-scopedDisallows usage of the experimental cssMapScoped API from @compiled/react. This API is internal and is not part of the public Compiled CSS-in-JS interface.Yes

版本与发布记录

@atlaskit/eslint-plugin-ui-styling-standard 共发布 101 个版本,首次发布于 2024/01/10;过去 12 个月发布了 29 个版本。

版本发布日期距今
3.0.4latest2026/11/025 天前
3.0.32026/10/299 天前
3.0.22026/10/1424 天前
3.0.12026/10/021 个月前
3.0.02026/10/021 个月前
2.4.12026/10/021 个月前

关于 @atlaskit/eslint-plugin-ui-styling-standard 的常见问题

@atlaskit/eslint-plugin-ui-styling-standard 是什么?

The eslint plugin to enforce and educate on Atlassian's UI Styling Standard

如何安装 @atlaskit/eslint-plugin-ui-styling-standard?

在项目目录运行 npm install @atlaskit/eslint-plugin-ui-styling-standard,或使用 pnpm add / yarn add / bun add。

@atlaskit/eslint-plugin-ui-styling-standard 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@atlaskit/eslint-plugin-ui-styling-standard 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@atlaskit/eslint-plugin-ui-styling-standard 可以商用吗?

@atlaskit/eslint-plugin-ui-styling-standard 使用 Apache-2.0 许可。宽松许可:允许商业使用、修改和再分发,并附带明确的专利授权;分发时需保留许可与 NOTICE 文件,修改过的文件要注明改动。以上为概括,不构成法律意见,请以许可原文为准。

@atlaskit/eslint-plugin-ui-styling-standard 的下载量有多少?

根据 npm 官方下载统计,@atlaskit/eslint-plugin-ui-styling-standard 在 2026/10/07 – 2026/11/05 这 30 天内被下载 3,576 次,日均约 119 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@atlaskit/eslint-plugin-ui-styling-standard 还在维护吗?

最新版本 3.0.4 发布于 2026/11/02(5 天前);至今共发布 101 个版本,其中过去 12 个月发布了 29 个;首次发布于 2024/01/10。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。