npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@solumon/stylelint-config

v0.0.2

Published

A shareable stylelint configuration with SCSS, Vue, Prettier, and property order support

Downloads

3

Readme

stylelint-config

一个可共享的 stylelint 配置包,集成了 SCSS、Vue、Prettier 和属性排序功能。

特性

  • ✅ 支持 CSS 和 SCSS/Sass 文件
  • ✅ 支持 Vue 单文件组件
  • ✅ 集成 Prettier 自动格式化
  • ✅ 自动属性排序(Recess 顺序)
  • ✅ 错误检测和潜在问题提示
  • ✅ 最小化配置,只包含必要规则

安装

pnpm add -D stylelint @solumon/stylelint-config

或使用 npm:

npm install --save-dev stylelint @solumon/stylelint-config

或使用 yarn:

yarn add -D stylelint @solumon/stylelint-config

前置依赖

确保你的项目中已安装以下 peer dependencies:

  • stylelint (^16.0.0)
  • prettier (^3.5.0)

其他依赖(stylelint-prettierstylelint-config-recommended-scssstylelint-config-recommended-vuestylelint-config-recess-orderpostcss-html)会作为 @solumon/stylelint-config 的直接依赖自动安装。

使用方法

在你的项目根目录创建或编辑 .stylelintrc.json 文件:

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

或者在 package.json 中添加:

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

配置说明

此配置包含 stylelint 推荐的规则集,并支持多种文件类型和功能:

  • CSS/SCSS 文件:继承自 stylelint-config-recommended-scss
  • Vue 文件:继承自 stylelint-config-recommended-vue
  • 属性排序:使用 stylelint-config-recess-order 自动检查并排序 CSS 属性,遵循 Recess 属性顺序规范
  • Prettier 集成:集成 stylelint-prettier,将 Prettier 作为 stylelint 规则运行,自动格式化代码并禁用冲突的规则
  • 错误检测:检测可能的 CSS/SCSS 错误和潜在问题
  • 最小化配置:只包含必要的规则,不会强制代码风格

支持的文件类型

  • .css - 标准 CSS 文件,使用推荐规则集
  • .scss / .sass - Sass/SCSS 文件,使用 SCSS 推荐规则集
  • .vue - Vue 单文件组件中的 <style> 标签,使用 Vue 推荐规则集

详细规则请参考:

配置示例

基础配置

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

自定义规则

你可以在配置中添加自定义规则:

{
  "extends": ["@solumon/stylelint-config"],
  "rules": {
    "color-hex-length": "long",
    "declaration-block-trailing-semicolon": "always"
  }
}

版本要求

  • Node.js >= 18.0.0
  • stylelint >= 16.0.0
  • prettier >= 3.5.0

开发

# 安装依赖
pnpm install

发布

# 构建和测试
pnpm test

# 发布到 npm(scoped 包需要添加 --access public)
npm publish --access public

贡献

欢迎提交 Issue 和 Pull Request!

License

ISC