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

@brandlen/prettier-config

v1.2.0

Published

Personal, all-in-one Prettier configuration for JS community projects.

Readme

@brandlen/prettier-config

English | 简体中文

带有个人意见偏好的项目共享 Prettier 配置。

它只使用 Prettier 3 的内置语言支持,因此可直接格式化 JavaScript、TypeScript、Vue SFC、JSON、CSS 与 Markdown;不为这些语言安装额外 parser 或插件。

安装

pnpm add -D prettier @brandlen/prettier-config

在项目的 package.json 中引用:

{
  "prettier": "@brandlen/prettier-config",
  "scripts": {
    "format": "prettier . --write",
    "format:check": "prettier . --check"
  }
}

若项目需要个别覆盖,使用 ESM 配置文件:

import base from '@brandlen/prettier-config'

/** @type {import('prettier').Config} */
export default {
  ...base,
  proseWrap: 'always',
}

格式化风格

  • Markdown 保留作者已有的段落换行;代码块仍按对应的内置 parser 格式化。
  • 不配置 parser,由 Prettier 按文件扩展名选择 parser。

共享配置将 printWidth 固定为 100;tabWidth、useTabs 与 endOfLine 有意不在本包定义,以便 Prettier 读取每个项目自己的 .editorconfig。

在项目根目录生成内置模板:

npx @brandlen/prettier-config init

命令会创建 .prettierignore 和 .editorconfig;若文件已存在则保留原内容,不会覆盖。

若要在 CI 中检查两个文件是否存在,且不创建或修改文件,可使用检查模式:

npx @brandlen/prettier-config init --check

两个文件均存在时,命令以状态码 0 退出;否则会列出缺失文件,并以状态码 1 退出。

忽略文件

Prettier 会自动读取项目根目录的 .gitignore 与 .prettierignore。模板默认忽略各包管理器 lockfile、依赖目录、构建产物、缓存、source map 和压缩文件;可按项目需要追加规则。

开发与发布

运行基于 Bumpp 的发布命令需要 Node 20.19 或更高版本。提交前运行:

corepack enable
pnpm install --frozen-lockfile
pnpm verify

pnpm install 会安装仓库本地的 commit-msg hook。提交信息必须遵循 Conventional Commits,例如 feat: add shared config;Pull Request 也会在 CI 中接受相同校验。

从最新且干净的 main 分支发布:

pnpm release

交互式命令会选择 SemVer 版本、根据 Conventional Commits 重建 CHANGELOG.md、执行 pnpm verify、创建一个发布提交和 vX.Y.Z tag,然后推送它们。不要手动运行 npm publish。