2.0.3 • Published 1 year ago

@juyren/stylelint-config-less v2.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

Stylelint Less 配置集合

本项目,将所有依赖都安装在dependencies中,做一个集合操作。 在正式开发的项目中,无需再次安装其他依赖,只需要安装该仓库即可

安装

  yarn add @juyren/stylelint-config-less -D

  npm install @juyren/stylelint-config-less -D

使用

  # .stylelintrc.js

  module.exports = {
    "extends": ["@juyren/stylelint-config-less"]
  }

  # .vscode --> settings.json
  {
      "stylelint.validate": ["less"],

      "editor.codeActionsOnSave": {
        "source.fixAll.stylelint": "explicit"
      }
  }

集成功能

  1. 使用stylelint-config-standardstylelint-config-css-modules规则
  2. 自动排序 stylelint-config-recess-order
  3. 忽略与 prettier 冲突的规则 stylelint-config-prettier
  4. 检查可能存在冲突的属性值 stylelint-declaration-block-no-ignored-properties
  5. 预设rules

注意

  1. postcss-less在开发项目中,使用yarn会无法安装, 使用npm正常安装。如果使用yarn, 需要在开发项目中手动安装,版本需要跟本仓库一致 ^6.0.0