# @echristian/eslint-config 中文文档

规范地址：https://npmcn.com/package/%40echristian/eslint-config/

版本：0\.0\.54
npm 元数据更新时间：2025-08-28T20:21:11.250Z
中文译文更新时间：2026-11-13T05:07:38.832Z
软件包许可：未声明

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

原始 npm 页面：https://www.npmjs.com/package/%40echristian/eslint-config
原文对照：https://npmcn.com/package/%40echristian/eslint-config/?lang=original
项目主页：https://github.com/ericc-ch/eslint-config
源码仓库：https://github.com/ericc-ch/eslint-config

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

- 包体积（解压后）：43.7 kB，6 个文件
- 模块格式：ES Module
- TypeScript 类型：包内自带
- 运行依赖：19 个
- peer 依赖：eslint \>=9\.0\.0
- 首次发布：2024-11-26T15:32:33.203Z
- 最新版本发布：2025-08-28T20:21:11.042Z
- 近 30 天下载量：3090（2026-10-13 至 2026-11-11，npm 官方下载统计）
- 已发布版本数：44（近 12 个月 0 个）

## 中文简介

ericc-ch ESLint 配置

## 安装

```sh
npm install @echristian/eslint-config
```

也可以使用：`pnpm add @echristian/eslint-config`、`yarn add @echristian/eslint-config`、`bun add @echristian/eslint-config`

## README

# @echristian/slint-config (英语)

由TypeScript,JSX,CSS,和Markdown支持的现代和有舆论的ESLint配置.

## 安装

使用 npm :

```bash
npm install -D @echristian/eslint-config eslint
```

使用线条 :

```bash
yarn add -D @echristian/eslint-config eslint
```

使用 pnpm :

```bash
pnpm add -D @echristian/eslint-config eslint
```

## 使用量

创建一个 `eslint.config.js` 在工程根中的文件 :

```javascript
import eslintConfig from "@echristian/eslint-config";

export default eslintConfig({
  // Configuration options here
});
```

## 配置选项

配置函数接受一个选项对象,其结构如下:

```typescript
interface ESLintConfigOptions {
  // Glob patterns to ignore
  ignores?: Array<string>;

  // TypeScript configuration
  typescript?: {
    options?: {
      typeChecked?: boolean; // defaults to true
    };
  };

  // React configuration
  react?: {
    enabled?: boolean; // defaults to false
    options?: {
      typeChecked?: boolean; // defaults to true
    };
  };

  // React Hooks configuration
  reactHooks?: {
    enabled: boolean; // defaults to false
  };

  // JSX configuration
  jsx?: {
    enabled?: boolean; // defaults to false
    a11y?: boolean; // defaults to true
  };

  // Markdown configuration
  markdown?: {
    enabled?: boolean; // defaults to false
    options?: {
      language?: "commonmark" | "gfm"; // defaults to "gfm"
      frontMatter?: "yaml" | "toml" | "json" | false; // defaults to false
    };
  };

  // Prettier configuration
  prettier?: {
    experimentalOperatorPosition?: "start" | "end";
    experimentalTernaries?: boolean;
    semi?: boolean;
    // More prettier config
  };

  // Package.json rules configuration
  packageJson?: {
    package?: boolean; // defaults to false
  };
}
```

## 示例配置

### 基本类型脚本工程

```javascript
import eslintConfig from "@echristian/eslint-config";

export default eslintConfig({
  ignores: ["dist/"],
});
```

### 类型脚本项目不检查类型

```javascript
import eslintConfig from "@echristian/eslint-config";

export default eslintConfig({
  typescript: {
    options: {
      typeChecked: false,
    },
  },
});
```

### 用钩子反应工程

```javascript
import eslintConfig from "@echristian/eslint-config";

export default eslintConfig({
  react: {
    enabled: true,
  },
  reactHooks: {
    enabled: true,
  },
  jsx: {
    enabled: true,
  },
});
```

### 带有 CSS 的全层项目

```javascript
import eslintConfig from "@echristian/eslint-config";

export default eslintConfig({
  ignores: ["dist/", "build/"],
  react: {
    enabled: true,
  },
  reactHooks: {
    enabled: true,
  },
  jsx: {
    enabled: true,
  },
  css: {
    enabled: true,
  },
});
```

### 带有 Markdown 的文档工程

```javascript
import eslintConfig from "@echristian/eslint-config";

export default eslintConfig({
  markdown: {
    enabled: true,
    options: {
      language: "gfm", // GitHub Flavored Markdown
      frontMatter: "yaml", // Enable YAML frontmatter support
    },
  },
});
```

### 完成带有全部特性的工程

```javascript
import eslintConfig from "@echristian/eslint-config";

export default eslintConfig({
  ignores: ["dist/", "build/"],
  react: {
    enabled: true,
  },
  reactHooks: {
    enabled: true,
  },
  jsx: {
    enabled: true,
  },
  markdown: {
    enabled: true,
    options: {
      language: "gfm",
      frontMatter: "yaml",
    },
  },
});
```

## 依赖关系

此配置包括以下主要依赖性:

-   `@eslint/js`: ESLint核心规则
-   `@eslint/json`JSON 支持 :
-   `@eslint/css`: CSS 支持
-   `@eslint/markdown`: 下调支持
-   `typescript-eslint`: 类型脚本支持
-   `@stylistic/eslint-plugin`: 样式相关规则
-   `eslint-plugin-unused-imports`: 未用进口管理
-   `eslint-plugin-perfectionist`: 其他最佳做法
-   `eslint-plugin-prettier`: 初步整合
-   `eslint-plugin-regexp`: 正则表达式
-   `eslint-plugin-de-morgan`: 逻辑表达式优化
-   `eslint-plugin-package-json`: package.json 验证
-   `eslint-plugin-react-hooks`: 反钩出放规则
-   `@eslint-react/eslint-plugin`: 反应组件内嵌

## 许可证

麻省理工学院-见 [自由主义](https://npmcn.com/package/%40echristian/eslint-config/LICENSE) 更多信息.

## 常见问题

### @echristian/eslint-config 是什么？

ericc-ch ESLint 配置

### 如何安装 @echristian/eslint-config？

在项目目录运行 npm install @echristian/eslint-config，或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖：eslint（\>=9\.0\.0）。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖，Yarn 需要手动安装。

### @echristian/eslint-config 支持 TypeScript 吗？

支持。包内自带 TypeScript 类型声明（package\.json 声明了 types 入口），安装后即可获得类型提示，无需再安装 @types 包。

### @echristian/eslint-config 支持 ESM 还是 CommonJS？

以 ES Module 形式发布，推荐使用 import 引入。在 CommonJS 项目中，Node\.js 20\.19\+ / 22\.12\+ 可以直接 require\(\) 不含顶层 await 的 ES Module，更早的版本需要改用动态 import\(\)。

### @echristian/eslint-config 可以商用吗？

@echristian/eslint-config 使用 未声明 许可。package\.json 没有声明许可证。没有许可证的代码默认保留全部权利，商用前请联系作者或查看仓库中的 LICENSE 文件。以上为概括，不构成法律意见，请以许可原文为准。

### @echristian/eslint-config 的下载量有多少？

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

### @echristian/eslint-config 还在维护吗？

最新版本 0\.0\.54 发布于 2025/08/29（1\.2 年前）；至今共发布 44 个版本，其中过去 12 个月发布了 0 个；首次发布于 2024/11/26。发布频率只是参考信号：功能稳定的工具可能很少需要更新，建议结合源码仓库的 issue 和提交记录判断。

