1.4.6 • Published 9 days ago

@denaro-config/stylelint-scss v1.4.6

Weekly downloads
-
License
MIT
Repository
github
Last release
9 days ago

@denaro-config/stylelint-scss

:tada: 前端工程化中的 stylelint 通用配置, 用于规范 sass、scss 代码质量。

npm (scoped) NPM

GitHub repo size GitHub Repo stars GitHub issues GitHub top language

npm jsDelivr hits (npm scoped)

参考官网地址

stylelint

安装至您的项目

npm install -D @denaro-config/stylelint-scss
# or
pnpm install -D @denaro-config/stylelint-scss
# or
yarn add -D @denaro-config/stylelint-scss

使用

在项目根目录下创建 .stylelintrc 文件, 参考配置内容如下:

{
  "extends": ["@denaro-config/stylelint-scss"]
}

忽略检查

在项目根目录下创建 .stylelintignore 文件, 参考配置内容如下:

node_modules
dist
lib

结合 lint-staged、husky 使用

package.json 中添加以下内容

{
  "scripts": {
    "stylelint": "stylelint \"./**/*.{css,scss,sass,vue,html}\" --fix"
  },
  "lint-staged": {
    "*.{css,scss,sass,vue,html}": "stylelint --write --ignore-unknown"
  }
}