# @discourse/lint-configs 中文文档

规范地址：https://npmcn.com/package/%40discourse/lint-configs/

版本：3\.9\.1
npm 元数据更新时间：2026-10-28T20:08:15.682Z
中文译文更新时间：2026-11-12T11:11:29.037Z
软件包许可：MIT

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

原始 npm 页面：https://www.npmjs.com/package/%40discourse/lint-configs
原文对照：https://npmcn.com/package/%40discourse/lint-configs/?lang=original
项目主页：https://github.com/discourse/lint-configs#readme
源码仓库：https://github.com/discourse/lint-configs

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

- 包体积（解压后）：324 kB，59 个文件
- 模块格式：ESM + CJS
- TypeScript 类型：未声明
- 运行依赖：18 个
- peer 依赖：eslint 10\.6\.0，prettier 3\.8\.1，stylelint 17\.5\.0
- 首次发布：2023-10-20T12:22:57.761Z
- 最新版本发布：2026-10-28T20:08:11.679Z
- 近 30 天下载量：157099（2026-10-13 至 2026-11-11，npm 官方下载统计）
- 已发布版本数：102（近 12 个月 35 个）

## 中文简介

用于对话核心、插件和主题的可共享插件配置

## 安装

```sh
npm install @discourse/lint-configs
```

也可以使用：`pnpm add @discourse/lint-configs`、`yarn add @discourse/lint-configs`、`bun add @discourse/lint-configs`

## README

# @ discour/ lint- configs

用于对话核心、插件和主题的可共享插件配置

## 使用量

添加 `@discourse/lint-configs` 至 package.json,并创建这三个文件:

### 互联网档案馆的存檔,存档日期2013-12-02

```js
import DiscourseRecommended from "@discourse/lint-configs/eslint";
export default [...DiscourseRecommended];
```

或主题/主题组成部分:

```js
import DiscourseThemeRecommended from "@discourse/lint-configs/eslint-theme";
export default [...DiscourseThemeRecommended];
```

### . prettierrc.cjs (英语)

```js
module.exports = require("@discourse/lint-configs/prettier");
```

### 样式lint.config.mjs

```js
export default {
  extends: ["@discourse/lint-configs/stylelint"],
};
```

## 常见问题

### @discourse/lint-configs 是什么？

用于对话核心、插件和主题的可共享插件配置

### 如何安装 @discourse/lint-configs？

在项目目录运行 npm install @discourse/lint-configs，或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖：eslint（10\.6\.0）、prettier（3\.8\.1）、stylelint（17\.5\.0）。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖，Yarn 需要手动安装。

### @discourse/lint-configs 支持 TypeScript 吗？

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

### @discourse/lint-configs 支持 ESM 还是 CommonJS？

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

### @discourse/lint-configs 可以商用吗？

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

### @discourse/lint-configs 的下载量有多少？

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

### @discourse/lint-configs 还在维护吗？

最新版本 3\.9\.1 发布于 2026/10/29（14 天前）；至今共发布 102 个版本，其中过去 12 个月发布了 35 个；首次发布于 2023/10/20。发布频率只是参考信号：功能稳定的工具可能很少需要更新，建议结合源码仓库的 issue 和提交记录判断。

