@colony/eslint-config-colony

中文文档
10.0.0发布于 2024/03/13MITCommonJS零依赖近 30 天下载 7594

eslint configuration for Colony projects

原始使用文档

eslint-config-colony

The eslint configuration used for Colony OSS projects. Instructions copied from eslint-config-airbnb

Usage

Our default export contains all of our ESLint rules.

Requirements

  • eslint
  • babel-eslint
  • eslint-config-airbnb-base
  • eslint-config-prettier
  • eslint-plugin-import
  • eslint-plugin-prettier
  • prettier

If you use yarn, run npm info "@colony/eslint-config-colony@latest" peerDependencies to list the peer dependencies and versions, then run yarn add --dev <dependency>@<version> for each listed peer dependency. See below for npm instructions.

  1. Install the correct versions of each package, which are listed by the command:
npm info "@colony/eslint-config-colony@latest" peerDependencies

If using npm 5+, use this shortcut

npx install-peerdeps --dev @colony/eslint-config-colony

If using yarn, you can also use the shortcut described above if you have npm 5+ installed on your machine, as the command will detect that you are using yarn and will act accordingly. Otherwise, run npm info "@colony/eslint-config-colony@latest" peerDependencies to list the peer dependencies and versions, then run yarn add --dev <dependency>@<version> for each listed peer dependency.

If using npm < 5, Linux/OSX users can run

(
  export PKG=@colony/eslint-config-colony;
  npm info "$PKG@latest" peerDependencies --json | command sed 's/[\{\},]//g ; s/: /@/g' | xargs npm install --save-dev "$PKG@latest"
)

Which produces and runs a command like:

npm install --save-dev @colony/eslint-config-colony eslint@^#.#.# eslint-plugin-import@^#.#.#

If using npm < 5, Windows users can either install all the peer dependencies manually, or use the install-peerdeps cli tool.

npm install -g install-peerdeps
install-peerdeps --dev @colony/eslint-config-colony

The cli will produce and run a command like:

npm install --save-dev @colony/eslint-config-colony eslint@^#.#.# eslint-plugin-import@^#.#.#
  1. Add "extends": "@colony/eslint-config-colony" to your .eslintrc

版本与发布记录

@colony/eslint-config-colony 共发布 29 个版本,首次发布于 2017/11/26;过去 12 个月发布了 0 个版本。

版本发布日期距今
10.0.0latest2024/03/132 年前
9.2.02023/04/253 年前
9.1.02022/11/293 年前
9.0.22022/02/164 年前
9.0.12022/02/164 年前
9.0.02022/02/164 年前

其他发布通道:next → 8.0.0-beta.3。

关于 @colony/eslint-config-colony 的常见问题

@colony/eslint-config-colony 是什么?

eslint configuration for Colony projects

如何安装 @colony/eslint-config-colony?

在项目目录运行 npm install @colony/eslint-config-colony,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:eslint(^8.57.0)、eslint-config-airbnb-base(^15.0.0)、eslint-config-prettier(^9.1.0)、eslint-plugin-eslint-comments(^3.2.0)、eslint-plugin-import(^2.29.1)、eslint-plugin-prettier(^5.1.3)、prettier(^3.2.5)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@colony/eslint-config-colony 支持 TypeScript 吗?

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

@colony/eslint-config-colony 支持 ESM 还是 CommonJS?

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

@colony/eslint-config-colony 可以商用吗?

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

@colony/eslint-config-colony 的下载量有多少?

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

@colony/eslint-config-colony 还在维护吗?

最新版本 10.0.0 发布于 2024/03/13(2 年前);至今共发布 29 个版本,其中过去 12 个月发布了 0 个;首次发布于 2017/11/26。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。