# @devoxa/prettier-config 中文文档

规范地址：https://npmcn.com/package/%40devoxa/prettier-config/

版本：2\.0\.3
npm 元数据更新时间：2024-04-30T18:14:57.930Z
中文译文更新时间：2026-11-12T03:55:22.501Z
软件包许可：MIT

本文由上游 README 翻译，可能存在偏差，请结合原文核对 API、命令与配置。版权与许可归原作者所有。

原始 npm 页面：https://www.npmjs.com/package/%40devoxa/prettier-config
原文对照：https://npmcn.com/package/%40devoxa/prettier-config/?lang=original
源码仓库：https://github.com/devoxa/prettier-config

## 关键信息（来自 npm 元数据）

- 包体积（解压后）：6.7 kB，15 个文件
- 模块格式：CommonJS
- TypeScript 类型：未声明
- 运行依赖：1 个
- peer 依赖：prettier \>=2\.4，typescript \>=2\.9
- 首次发布：2020-06-11T18:00:10.000Z
- 最新版本发布：2024-04-30T18:14:57.745Z
- 近 30 天下载量：9710（2026-10-12 至 2026-11-10，npm 官方下载统计）
- 已发布版本数：7（近 12 个月 0 个）

## 中文简介

所有 Devoxa 项目使用的Pretier 可共享配置

## 安装

```sh
npm install @devoxa/prettier-config
```

也可以使用：`pnpm add @devoxa/prettier-config`、`yarn add @devoxa/prettier-config`、`bun add @devoxa/prettier-config`

## README

# 更漂亮的配置

#### 这个 [可共享配置](https://prettier.io/docs/en/configuration.html#sharing-configurations) 页:1 [高级](https://prettier.io/) 用于所有 Devoxa 项目

 [![Package Version](https://img.shields.io/npm/v/@devoxa/prettier-config?style=flat-square)](https://www.npmjs.com/package/@devoxa/prettier-config)[![Build Status](https://img.shields.io/github/actions/workflow/status/devoxa/prettier-config/push.yml?branch=master&style=flat-square)](https://github.com/devoxa/prettier-config/actions?query=branch%3Amaster+workflow%3A%22Continuous+Integration%22)

[安装](https://npmcn.com/package/%40devoxa/prettier-config/#readme-installation) 二. 支助 [使用量](https://npmcn.com/package/%40devoxa/prettier-config/#readme-usage) 二. 支助 [扩展](https://npmcn.com/package/%40devoxa/prettier-config/#readme-extending) 二. 支助 [贡献者](https://npmcn.com/package/%40devoxa/prettier-config/#readme-contributors) 二. 支助 [许可证](https://npmcn.com/package/%40devoxa/prettier-config/#readme-license)

  

## 安装

```bash
yarn add --dev @devoxa/prettier-config prettier typescript
```

## 使用量

为启用规则,增加: `prettier` 属性 `package.json`见 [Pretier 配置文件](https://prettier.io/docs/en/configuration.html) 更多细节.

```json
"prettier": "@devoxa/prettier-config"
```

也建议在您之前添加以下剧本: `package.json` 方便地使用.

```json
"format": "prettier --ignore-path='.gitignore' --list-different --write .",
"format:check": "prettier --ignore-path='.gitignore' --check .",
```

此外,建议安装 [VS 代码扩展](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode) 改为 获得编辑器格式化支持.

## 扩展

此配置无意被更改, 但如果您有修改所在的设置 要求,这是可能的。 要扩展配置, 您需要使用 `prettier.config.js` 文件 导出对象 :

```javascript
module.exports = {
  ...require('@devoxa/prettier-config'),
  semi: true,
}
```

## 贡献者

感谢这些伟大的人[emoji 密钥](https://allcontributors.org/docs/en/emoji-key):

<table><tbody><tr><td align="center"><a href="https://www.david-reess.de/" rel="nofollow noopener noreferrer"><img alt="" src="https://avatars3.githubusercontent.com/u/4615516?v=4" width="75px;" loading="lazy" decoding="async" referrerpolicy="no-referrer"><br><sub><b>大卫·瑞斯</b></sub></a><br><a href="https://github.com/devoxa/prettier-config/commits?author=queicherius" title="Code" rel="nofollow noopener noreferrer">💻</a> <a href="https://github.com/devoxa/prettier-config/commits?author=queicherius" title="Documentation" rel="nofollow noopener noreferrer">📖</a> <a href="https://github.com/devoxa/prettier-config/commits?author=queicherius" title="Tests" rel="nofollow noopener noreferrer">⚠️</a></td></tr></tbody></table>

本项目遵循 [全部贡献者](https://github.com/all-contributors/all-contributors) 规格。 任何捐款都欢迎!

## 许可证

麻省理工学院

## 常见问题

### @devoxa/prettier-config 是什么？

所有 Devoxa 项目使用的Pretier 可共享配置

### 如何安装 @devoxa/prettier-config？

在项目目录运行 npm install @devoxa/prettier-config，或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖：prettier（\>=2\.4）、typescript（\>=2\.9）。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖，Yarn 需要手动安装。

### @devoxa/prettier-config 支持 TypeScript 吗？

该包的 package\.json 没有声明类型入口。需要类型提示时，可以在 npm 上查找社区维护的 @types/devoxa\_\_prettier-config 是否存在。

### @devoxa/prettier-config 支持 ESM 还是 CommonJS？

以 CommonJS 形式发布，可以直接 require\(\)；在 ES Module 项目中也可以用 import 引入（Node\.js 会把 module\.exports 作为默认导出）。

### @devoxa/prettier-config 可以商用吗？

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

### @devoxa/prettier-config 的下载量有多少？

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

### @devoxa/prettier-config 还在维护吗？

最新版本 2\.0\.3 发布于 2024/05/01（2 年前）；至今共发布 7 个版本，其中过去 12 个月发布了 0 个；首次发布于 2020/06/12。发布频率只是参考信号：功能稳定的工具可能很少需要更新，建议结合源码仓库的 issue 和提交记录判断。

