@creedengo/eslint-plugin

中文文档
3.1.0发布于 2026/05/10GPL-3.0CommonJS零依赖构建来源已验证近 30 天下载 3500

JavaScript linter of creedengo project

原始使用文档
文档目录7 节
  1. 🚀 Getting started
  2. Installation
  3. Enable plugin with recommended configuration
  4. Enable specific rules
  5. ⚙ Configs
  6. 🔨 Rules
  7. 🛒 Distribution

Creedengo-JS

An ESLint plugin which provides JavaScript and TypeScript rules of the Creedengo project.

👉 See creedengo-javascript README to have more information.

🚀 Getting started

Installation

You'll need to install ESLint v10 or v9 and this plugin:

# yarn
yarn add -D eslint @creedengo/eslint-plugin
# npm
npm install -D eslint @creedengo/eslint-plugin

You are using TypeScript? You will also need to install typescript-eslint to enable our rules.
Follow this official guide to install it in a few steps.

Are you working with a GitHub Packages registry?

The plugin is also available from GitHub npm registry under "green-code-initiative" scope:

# yarn
yarn add -D eslint @green-code-initiative/creedengo-eslint-plugin
# npm
npm install -D eslint @green-code-initiative/creedengo-eslint-plugin

Add @creedengo "recommended" configuration to your eslint.config.js:

import creedengo from "@creedengo/eslint-plugin";

export default [
  /* other eslint configurations */
  creedengo.configs.recommended,
];

Enable specific rules

Add the creedengo plugin configuration to your eslint.config.js and select the rules to activate:

import creedengo from "@creedengo/eslint-plugin";

export default [
  /* other eslint configurations */
  {
    plugins: { "@creedengo": creedengo },
    rules: {
      "@creedengo/no-multiple-access-dom-element": "error",
    },
  },
];

⚙ Configs

Name
✅recommended

🔨 Rules

⚠️ Configurations set to warn in.
✅ Set in the recommended configuration.

NameDescription⚠️
avoid-autoplayAvoid autoplay for videos and audio content✅
avoid-brightness-overrideShould avoid to override brightness✅
avoid-css-animationsAvoid usage of CSS animations✅
avoid-high-accuracy-geolocationAvoid using high accuracy geolocation in web applications✅
avoid-keep-awakeAvoid screen keep awake✅
limit-db-query-resultsShould limit the number of returns for a SQL query✅
no-empty-image-src-attributeDisallow usage of image with empty source attribute✅
no-import-all-from-libraryShould not import all from library✅
no-multiple-access-dom-elementDisallow multiple access of same DOM element✅
no-multiple-style-changesDisallow multiple style changes at once✅
no-torchShould not programmatically enable torch mode✅
prefer-collections-with-paginationPrefer API collections with pagination✅
prefer-lighter-formats-for-image-filesPrefer lighter formats for image files✅
prefer-shorthand-css-notationsEncourage usage of shorthand CSS notations✅
provide-print-cssEnforce providing a print stylesheet✅

🛒 Distribution

You can follow changelog on GitHub Releases page.

版本与发布记录

@creedengo/eslint-plugin 共发布 5 个版本,首次发布于 2025/01/23;过去 12 个月发布了 3 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
3.1.0latest2026/05/106 个月前
3.0.02026/02/049 个月前
2.2.02026/01/169 个月前
2.1.02025/04/011.6 年前
2.0.02025/01/231.8 年前

关于 @creedengo/eslint-plugin 的常见问题

@creedengo/eslint-plugin 是什么?

JavaScript linter of creedengo project

如何安装 @creedengo/eslint-plugin?

在项目目录运行 npm install @creedengo/eslint-plugin,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:eslint(^9.0.0 || ^10.0.0)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@creedengo/eslint-plugin 支持 TypeScript 吗?

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

@creedengo/eslint-plugin 支持 ESM 还是 CommonJS?

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

@creedengo/eslint-plugin 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=22。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@creedengo/eslint-plugin 可以商用吗?

@creedengo/eslint-plugin 使用 GPL-3.0 许可。强 Copyleft:分发包含该代码的软件时,整个作品需以 GPL-3.0 兼容许可开源,并附带专利与反锁定条款。仅内部使用不触发此义务。以上为概括,不构成法律意见,请以许可原文为准。

@creedengo/eslint-plugin 的下载量有多少?

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

@creedengo/eslint-plugin 还在维护吗?

最新版本 3.1.0 发布于 2026/05/10(6 个月前);至今共发布 5 个版本,其中过去 12 个月发布了 3 个;首次发布于 2025/01/23。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。