@discourse/lint-configs

中文文档
3.9.1发布于 2026/10/29MITESM + CJS构建来源已验证近 30 天下载 15.7万

Shareable lint configs for Discourse core, plugins, and themes

原始使用文档
文档目录4 节
  1. Usage
  2. eslint.config.mjs
  3. .prettierrc.cjs
  4. stylelint.config.mjs

@discourse/lint-configs

Shareable lint configs for Discourse core, plugins, and themes

Usage

Add @discourse/lint-configs to package.json, and create these three files:

eslint.config.mjs

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

or in themes/theme components:

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

.prettierrc.cjs

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

stylelint.config.mjs

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

版本与发布记录

@discourse/lint-configs 共发布 102 个版本,首次发布于 2023/10/20;过去 12 个月发布了 35 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
3.9.1latest2026/10/2914 天前
3.9.02026/10/2320 天前
3.8.22026/10/1627 天前
3.8.12026/10/1627 天前
3.8.02026/10/1528 天前
3.7.02026/09/092 个月前

关于 @discourse/lint-configs 的常见问题

@discourse/lint-configs 是什么?

Shareable lint configs for Discourse core, plugins, and themes

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