@hankliu/stylelint

1.0.1 • Public • Published

HankLiu Stylelint Base

提供基础的stylelint规则和插件

安装

npm install @hankliu/stylelint -D

or

yarn add @hankliu/stylelint -D

使用

  • in .stylelintrc.js
const stylelint = require('@hankliu/stylelint');

// 修改规则

// stylelint.extends = 'stylelint-config-recommended';
// stylelint.rules = Object.assign(stylelint.rules, {
//   'block-no-empty': null,
//   'color-no-invalid-hex': true,
//   'comment-empty-line-before': [
//     'always', {
//     'ignore': ['stylelint-commands', 'after-comment']
//     }
//   ],
//   'declaration-colon-space-after': 'always',
//   'indentation': [
//     'tab',
//     { 'except': ['value'] }
//   ],
//   'max-empty-lines': 2,
//   'rule-empty-line-before': [
//     'always',
//     {
//       'except': ['first-nested'],
//       'ignore': ['after-comment']
//     }
//   ],
//   'unit-whitelist': ['em', 'rem', '%', 's']
// });

module.exports = stylelint;

注意

我们使用的是 peerDependencies 管理依赖,如果是在npm2中使用该插件,不许需要在自己项目中额外安装下列依赖,npm2会自行强制安装peerDependencies所要求指定的依赖包;如果是在npm3+中使用该插件,npm3中不会再要求peerDependencies所指定的依赖包被强制安装,相反npm3会在安装结束后检查本次安装是否正确,如果不正确会给用户打印警告提示。

"peerDependencies": {
  "stylelint": "^9.x",
  "stylelint-config-standard": "^18.x",
  "stylelint-order": "^2.x"
}

Package Sidebar

Install

npm i @hankliu/stylelint

Weekly Downloads

3

Version

1.0.1

License

ISC

Unpacked Size

4.54 kB

Total Files

5

Last publish

Collaborators

  • hank.liu