WeChatWork / stylelint-wechat-work-css

Special stylelint rules for WeChat Work(企业微信)project css.
MIT License
2 stars 0 forks source link
css stylelint wechat

stylelint-wechat-work-css

Greenkeeper badge

Build Status npm version JavaScript Style Guide

Special stylelint rules for WeChat at Work project css. 企业微信项目 Stylelint 自定义规则

Install

npm i stylelint-wechat-work-css -D

Rules

Usege

Add stylelint-wechat-work-css to your stylelint config plugins array, then add rules you need to the rules object.

Example:

{
  'plugins': [
    'stylelint-wechat-work-css'
  ],
  'rules': {
    'wechat-work/unused-mixins':
      [
        '/^transition/',
        '/^transform/',
        '/^translate/',
        '/^scale/',
        '/^rotate/',
        '/^animation/',
        'box-sizing',
        'box_sizing',
        'inlineBlock',
        'box-shadow',
        'box_shadow',
        'opacity',
        'keyframes'
      ],
    'wechat-work/comments-in-header': true,
    'wechat-work/selector-namespace-follow-filename': [true, {
      'fileDirWhiteList': ['reg-word', 'ignore-filedir', 'mobile', '/^widget/', 'component'],
      'filenameWhitelist': ['/^reg-word/', 'ignore-filename']
    }
    ],
    'wechat-work/unused-nested-selector-namespace': true,
    'wechat-work/declaration-use-variable': true,
  }
}

Contributing

Inspired from stylelint-suitcss.

Issues and Pull requests are welcome.