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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@saco/web-lint

v1.0.0

Published

Shareable ESLint / Prettier / Stylelint / Commitlint config for Vue + TypeScript

Readme

@saco/web-lint

把各项目里重复的 ESLint / Prettier / Stylelint / Commitlint 配置收成一个包。规则、忽略名单、以及 Vue 模板里保留 (x as Type) 括号的 Prettier 插件都在这里。

业务项目不再需要自己维护:

  • .prettierrc.json / .prettierignore
  • .stylelintignore
  • eslint.config.mjs
  • stylelint.config.mjs
  • commitlint.config.mjs
  • prettier-plugin-vue-as-parens.mjs

安装

pnpm add -D @saco/web-lint

插件(typescript-eslintstylelint-config-* 等)随本包安装。ESLint / Prettier 编辑器扩展要从项目根解析到对应包,pnpm 隔离依赖时再加直依即可:

pnpm add -D eslint prettier stylelint

最小接入(推荐)

Prettier / Stylelint / Commitlint 可以只写在 package.json 里,不用再建配置文件

ESLint 9/10 不行:flat config 已去掉 package.jsoneslintConfig,编辑器要生效就必须有一个 eslint.config.*

eslint.config.mjs(唯一必须留下的文件):

export { default } from '@saco/web-lint/eslint'

package.json

{
	"prettier": "@saco/web-lint/prettier",
	"stylelint": {
		"extends": ["@saco/web-lint/stylelint"]
	},
	"commitlint": {
		"extends": ["@saco/web-lint/commitlint"]
	},
	"scripts": {
		"lint": "eslint . --fix",
		"format": "web-lint prettier --write .",
		"stylelint": "web-lint stylelint --fix"
	}
}

web-lint prettier / web-lint stylelint 会带上本包 ignore(node_modulesdist、生成的 .types/*.d.ts 等)。Stylelint 的 ignoreFiles 不会extends 继承,所以脚本请走 CLI,不要只靠 "stylelint": { "extends": "…" } 扫全仓库。

若还要在项目里改 Stylelint 规则,再加一行 stylelint.config.mjsexport { default } from '@saco/web-lint/stylelint'(这时才是完整配置,ignoreFiles 会生效)。

Commitlint + Husky:

echo 'npx --no -- commitlint --edit "$1"' > .husky/commit-msg

需要改规则时

// eslint.config.mjs
import { defineEslint } from '@saco/web-lint'

export default defineEslint({
	ignores: ['legacy/**'],
	rules: {
		'vue/multi-word-component-names': 'error',
	},
})
// stylelint.config.mjs
import { defineStylelint } from '@saco/web-lint'

export default defineStylelint({
	ignoreFiles: ['legacy/**/*.scss'],
	rules: {
		'no-empty-source': true,
	},
})

零配置文件(只用 CLI)

不写 eslint.config.mjs 时,编辑器扩展找不到配置,只适合 CI / 脚本:

{
	"scripts": {
		"lint": "web-lint eslint . --fix",
		"format": "web-lint prettier --write .",
		"stylelint": "web-lint stylelint --fix"
	}
}

web-lint <tool> 在未传 --config 时自动指向本包配置。

导出

| 路径 | 用途 | | ---------------------------------------------- | --------------------------------------------------------------------------------------------------- | | @saco/web-lint | eslint / prettier / stylelint / commitlintdefineEslint / defineStylelint、ignore 路径 | | @saco/web-lint/eslint | ESLint flat config(默认导出) | | @saco/web-lint/prettier | Prettier 配置(已带 Vue as 括号插件) | | @saco/web-lint/stylelint | Stylelint 配置 | | @saco/web-lint/commitlint | Commitlint 配置 | | @saco/web-lint/prettier-plugin-vue-as-parens | 单独引用该 Prettier 插件 |

默认约定与原先业务项目一致:无分号、单引号、Tab 缩进、对象形状用 interface、Vue 模板组件名 PascalCase。