@devoxa/prettier-config

中文文档
2.0.3发布于 2024/05/01MITCommonJS近 30 天下载 9710

The shareable configuration for Prettier used in all Devoxa projects

原始使用文档
文档目录5 节
  1. Installation
  2. Usage
  3. Extending
  4. Contributors
  5. License

prettier-config

The shareable configuration for Prettier used in all Devoxa projects

Package Version Build Status

Installation • Usage • Extending • Contributors • License


Installation

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

Usage

To enable the rules, add a prettier property in your package.json. See the Prettier configuration docs for more details.

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

It is also recommended to add the following scripts to your package.json for easy usage.

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

Additionally, it is recommended to install the VS Code Extension to get in-editor formatting support.

Extending

This configuration is not intended to be changed, but if you have a setup where modification is required, it is possible. To extend a configuration you will need to use a prettier.config.js file that exports an object:

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

Contributors

Thanks goes to these wonderful people (emoji key):


David Reeß

💻 📖 ⚠️

This project follows the all-contributors specification. Contributions of any kind welcome!

License

MIT

版本与发布记录

@devoxa/prettier-config 共发布 7 个版本,首次发布于 2020/06/12;过去 12 个月发布了 0 个版本。

版本发布日期距今
2.0.3latest2024/05/012 年前
2.0.22023/07/133 年前
2.0.12023/01/143 年前
2.0.02023/01/143 年前
1.0.22021/09/235 年前
1.0.12021/09/155 年前

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

@devoxa/prettier-config 是什么?

The shareable configuration for Prettier used in all Devoxa projects

如何安装 @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 和提交记录判断。