@genie-solutions/eslint-config-genie

中文文档
1.3.0发布于 2022/08/04ISCCommonJS近 30 天下载 4658

Standard eslint config for Genie Solutions projects

原始使用文档
文档目录4 节
  1. How to Use
  2. Contributing
  3. Examples
  4. Test Suite

ESLINT CONFIG GENIE

This is our shareable eslint configuration to be used for all JavaScript and TypeScript projects.

It enforces some sensible code styling guidelines and encourages consistency across our projects.

How to Use

run: npm install @genie-solutions/eslint-config-genie --save-dev

then create .eslintrc.js:

module.exports = {
  extends: [ "@genie-solutions/eslint-config-genie" ]
}

Contributing

Start by socialising the change you would like to make with other developers, and when it seems like the general consensus is that it would be a positive one, continue with this process.

  • Add an example file showcasing the practical implications of the change you would like to make. See the "Examples" section below for more details.
  • Make the necessary changes to the .eslintrc.js file.
  • Run the test suite to ensure your config changes have the desired effect. See the "Test Suite" section below for more details.
  • Open a merge request and get it merged.

Examples

The examples directory contains examples of good and bad code according to the eslint config.

It is intended to serve as a showcase of the practical application of the rules being enforced.

Try to keep the files related to a single rule or concept.

Sometimes there are errors or warnings which get in the way of simplicity, for example in the following code eslint will complain if you do not assign the array to a variable, and if you do assign it to a variable then it will complain that the variable is not used anywhere. It is obviously necessary to disable this warning to prevent writing a whole bunch of code which is not useful here.

// This allows expressions (like arrays and hashes / objects) without assigning or returning.
/* eslint-disable no-unused-expressions */
[{
    message1: 'hi',
    message2: 'bye',
}];
/* eslint-enable no-unused-expressions */

Test Suite

The test framework for this project is a bash script which runs the examples (in "examples" dir) through eslint. The "good" examples pass if no errors are raised, and the "bad" examples pass if errors are raised.

Simply execute test.sh to run the tests.

Deploying

TODO

版本与发布记录

@genie-solutions/eslint-config-genie 共发布 12 个版本,首次发布于 2021/06/11;过去 12 个月发布了 0 个版本。

版本发布日期距今
1.3.0latest2022/08/044 年前
1.2.02022/08/034 年前
1.1.02022/08/034 年前
1.0.22022/06/304 年前
1.0.12022/02/154 年前
1.0.02022/02/144 年前

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

@genie-solutions/eslint-config-genie 是什么?

Standard eslint config for Genie Solutions projects

如何安装 @genie-solutions/eslint-config-genie?

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

@genie-solutions/eslint-config-genie 支持 TypeScript 吗?

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

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

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

@genie-solutions/eslint-config-genie 可以商用吗?

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

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

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

@genie-solutions/eslint-config-genie 还在维护吗?

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