@anolilab/prettier-config

中文文档
11.0.0发布于 2026/10/22MITTypeScriptESM + CJS零依赖构建来源已验证近 30 天下载 8.1万

Prettier shareable config for Anolilab.

原始使用文档
文档目录9 节
  1. Prettier shareable config for Anolilab.
  2. Install
  3. Usage
  4. Related
  5. Supported Node.js Versions
  6. Contributing
  7. Credits
  8. Made with ❤️ at Anolilab
  9. License
prettier-config

Prettier shareable config for Anolilab.


typescript-image mit licence npm downloads Chat PRs Welcome


Daniel Bannert's open source work is supported by the community on GitHub Sponsors


Install

npm install @anolilab/prettier-config
yarn add @anolilab/prettier-config
pnpm add @anolilab/prettier-config

Usage

If you don’t have a .prettierrc.js or the other supported filenames and .prettierignore, we can create the file for you after installing @anolilab/prettier-config, call pnpm prettier-config:install.

Note: If the script detects an existing .prettierrc.js file, it will not overwrite it.

File content of the `.prettierrc.js`
module.exports = {
    // brackets are required for arrow function parameter, even when there is only one parameter
    arrowParens: "always",
    // spaces are required at the beginning and end of the braces
    bracketSpacing: true,
    // formats quoted code embedded
    embeddedLanguageFormatting: "auto",
    // lf for newline
    endOfLine: "lf",
    // decide whether to break the html according to the display style
    htmlWhitespaceSensitivity: "css",
    // No need to automatically insert @prettier at the beginning of the file
    insertPragma: false,
    // use double quotes instead of single quotes in jsx
    jsxSingleQuote: false,
    // max 160 characters per line
    printWidth: 160,
    // use default break criteria
    proseWrap: "preserve",
    // object's key is quoted only when necessary
    quoteProps: "as-needed",
    rangeEnd: Number.POSITIVE_INFINITY,
    // format the entire contents of the file
    rangeStart: 0,
    // no need to write the beginning @prettier of the file
    requirePragma: false,
    // semicolon at the end of the line
    semi: true,
    // use single quotes
    singleQuote: false,
    // use 4 spaces for indentation
    tabWidth: 4,
    // all comma at the end
    trailingComma: "all",
    // use spaces instead of indentations
    useTabs: false,
    // vue files script and style tags indentation
    vueIndentScriptAndStyle: false,
};

Supported Node.js Versions

Libraries in this ecosystem make the best effort to track Node.js’ release schedule.

Here’s a post on why we think this is important.

Contributing

If you would like to help take a look at the list of issues and check our Contributing guidelines.

Note: please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.

Credits

Made with ❤️ at Anolilab

This is an open source project and will always remain free to use. If you think it’s cool, please star it 🌟. Anolilab is a Development and AI Studio. Contact at [email protected] if you need any help with these technologies or want to say hi!

License

The anolilab prettier-config is open-sourced software licensed under the MIT

版本与发布记录

@anolilab/prettier-config 共发布 68 个版本,首次发布于 2021/02/15;过去 12 个月发布了 13 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
11.0.0latest2026/10/2215 天前
10.0.42026/10/1423 天前
10.0.32026/08/112 个月前
10.0.22026/07/213 个月前
10.0.12026/05/046 个月前
10.0.02026/04/076 个月前

其他发布通道:next → 2.0.0。

关于 @anolilab/prettier-config 的常见问题

@anolilab/prettier-config 是什么?

Prettier shareable config for Anolilab.

如何安装 @anolilab/prettier-config?

在项目目录运行 npm install @anolilab/prettier-config,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:prettier(3.9.10)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@anolilab/prettier-config 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@anolilab/prettier-config 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@anolilab/prettier-config 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=22.12.0 <=25.*。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@anolilab/prettier-config 可以商用吗?

@anolilab/prettier-config 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@anolilab/prettier-config 的下载量有多少?

根据 npm 官方下载统计,@anolilab/prettier-config 在 2026/10/06 – 2026/11/04 这 30 天内被下载 81,448 次,日均约 2,715 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@anolilab/prettier-config 还在维护吗?

最新版本 11.0.0 发布于 2026/10/22(15 天前);至今共发布 68 个版本,其中过去 12 个月发布了 13 个;首次发布于 2021/02/15。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。