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

@hootool/prettier-config

v0.1.0

Published

统一 Prettier 格式化配置

Readme

@hootool/prettier-config

统一 Prettier 格式化配置,适用于 Prettier 3.x。

安装

pnpm add -D @hootool/prettier-config prettier

使用

在项目根目录创建 .prettierrc.json

"@hootool/prettier-config"

或在 package.json 中:

{
  "prettier": "@hootool/prettier-config"
}

配置项

| 选项 | 值 | 说明 | |------|-----|------| | semi | true | 语句末尾加分号 | | singleQuote | true | JS/TS 使用单引号 | | jsxSingleQuote | false | JSX 使用双引号 | | trailingComma | all | 尾随逗号 | | printWidth | 80 | 每行最大宽度 | | tabWidth | 2 | 缩进 2 空格 | | arrowParens | always | 箭头函数参数始终加括号 | | endOfLine | lf | 统一 LF 换行 | | bracketSpacing | true | 对象字面量花括号内加空格 | | bracketSameLine | false | JSX 闭合括号不换行 | | quoteProps | as-needed | 对象属性按需加引号 | | proseWrap | preserve | Markdown 保持原样 | | htmlWhitespaceSensitivity | ignore | HTML 忽略空白敏感性 | | embeddedLanguageFormatting | auto | 自动格式化嵌入代码 |

与 ESLint 配合

本配置已通过 eslint-config-prettier(包含在 @hootool/eslint-config 中)自动关闭所有与 Prettier 冲突的 ESLint 规则,无需额外配置。

建议配合 lint-staged + husky 在提交前自动格式化:

pnpm add -D husky lint-staged
// package.json
{
  "lint-staged": {
    "*.{js,jsx,ts,tsx}": ["eslint --fix", "prettier --write"],
    "*.{css,scss,less}": ["stylelint --fix", "prettier --write"],
    "*.{json,md}": ["prettier --write"]
  }
}