UNPKG

@uxd.wenge/stylelint-config-wg

Version:

CSS Style guide for uxd.wenge

59 lines (43 loc) 1.3 kB
# stylelint-config-wg 内部前端团队的stylelint配置 ## 安装 ```shell npm install --save-dev stylelint@13.13.1 stylelint-prettier stylelint-config-prettier @uxd.wenge/stylelint-config-wg@latest ``` ## 依赖版本 ```js stylelint ^13.13.1 stylelint-config-prettier ^8.0.2 stylelint-prettier ^1.2.0 ``` ## 使用 - 在你的项目的根目录下创建一个 `.stylelintrc.js` 文件,并将以下内容复制进去: ```javascript module.exports = { extends: [ '@uxd.wenge/stylelint-config-wg', 'stylelint-prettier/recommended' ], rules: {}, plugins: [], }; ``` - 项目目录下的 `package.json` 添加检测指令,举个例子 ```diff { ... "scripts": { + "lint:style": "stylelint \"src/**/*.{vue,less,postcss,css,scss}\" --fix --cache --cache-location node_modules/.cache/stylelint/", } ... } ``` ## 引用 - [https://stylelint.io/](https://stylelint.io/) - [http://stylelint.cn/user-guide/rules/](http://stylelint.cn/user-guide/rules/) - [stylelint-config-moresec](https://github.com/MoresecFE/stylelint-config-moresec) - [css-order](https://github.com/cklwblove/note-css-order) ## 环境 > Node.js >= 8 > stylelint >= 13.5.0 新增的规则同步到 stylelint 13.7.0版本