@anolilab/prettier-config

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

Anolilab 的可共享配置 .

中文使用文档
文档目录9 节
  1. Anolilab 的可共享配置 .
  2. 安装
  3. 使用量
  4. 相关
  5. 支持的节点.js版本
  6. 捐款
  7. 贷项
  8. 在阿诺利拉布制造的
  9. 许可证
prettier-config

Anolilab 的可共享配置 .


typescript-image mit licence npm downloads Chat PRs Welcome


Daniel Bannert的开源工作得到了社区的支持 GitHub 赞助商


安装

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

使用量

如果你没有 .prettierrc.js 或支持的其他文件名和 .prettierignore,我们可以在安装后为您创建文件 @anolilab/prettier-config电话 pnpm prettier-config:install。 。 。 .

注意: 如果脚本检测到已有的 .prettierrc.js 文件,它不会覆盖它.

`.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,
};

支持的节点.js版本

这一生态系统中的图书馆尽最大努力追踪 Node.js的释放时间表。 。 。 .

这里 关于为什么我们认为这很重要的文章。 。 。 .

捐款

如果你愿意帮忙看看 问题清单 看看我们 捐款 准则.

说明: 请注意,该项目已连同《协助者行为守则》一起公布。 通过参加这个项目,你同意遵守其条款.

贷项

在阿诺利拉布制造的

这是一个开源项目,将永远可以自由使用。 如果你觉得很酷. 阿诺利拉布 是一个开发与AI工作室。 联系时间: 你好@anolilab.com 如果你需要帮助 这些技术 或者想打个招呼!

许可证

Anolilab 更漂亮的配置是开源软件,许可使用 麻省理工学院

版本与发布记录

@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 是什么?

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 和提交记录判断。