# @cffnpwr/eslint-config 中文文档

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

版本：2\.1\.0
npm 元数据更新时间：2026-10-24T19:06:06.349Z
中文译文更新时间：2026-11-09T08:32:13.094Z
软件包许可：MIT

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

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

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

- 包体积（解压后）：49.5 kB，7 个文件
- 模块格式：ES Module
- TypeScript 类型：包内自带
- 运行依赖：11 个
- peer 依赖：eslint \>=9\.18\.0，typescript \>=5\.5\.0
- 首次发布：2026-01-14T01:00:12.847Z
- 最新版本发布：2026-10-24T19:06:05.984Z
- 近 30 天下载量：3693（2026-10-10 至 2026-11-08，npm 官方下载统计）
- 已发布版本数：11（近 12 个月 11 个）

## 中文简介

Cffnpwr 常见的 ESLint 配置

## 安装

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

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

## README

# @cffnpwr/ eslint- config

[![GitHub License](https://img.shields.io/github/license/cffnpwr/eslint-config?style=flat)](https://npmcn.com/package/%40cffnpwr/eslint-config/LICENSE) [![npm Version](https://img.shields.io/npm/v/%40cffnpwr%2Feslint-config?style=flat)](https://www.npmjs.com/package/@cffnpwr/eslint-config) [![JSR Version](https://jsr.io/badges/@cffnpwr/eslint-config)](https://jsr.io/@cffnpwr/eslint-config)

Cffnpwr 共享的 ESLint 配置 .

[\[ README \]](https://npmcn.com/package/%40cffnpwr/eslint-config/README-ja.md)

## 如何安装

### 无

```sh
npm install -D @cffnpwr/eslint-config
```

或者说

```sh
npx jsr add -D @cffnpwr/eslint-config
```

### 线条

```sh
yarn add -D @cffnpwr/eslint-config
```

或者说

```sh
yarn dlx jsr add -D @cffnpwr/eslint-config
```

### 小时

```sh
pnpm add -D @cffnpwr/eslint-config
```

或者说

```sh
pnpm dlx jsr add -D @cffnpwr/eslint-config
```

### 阿宝

```sh
bun add -D @cffnpwr/eslint-config
```

或者说

```sh
bunx jsr add -D @cffnpwr/eslint-config
```

### 德诺

```sh
deno add -D npm:@cffnpwr/eslint-config
```

或者说

```sh
deno add -D jsr:@cffnpwr/eslint-config
```

## 如何使用

创建一个 `eslint.config.ts` 文件并配置如下. 此共享配置不提供 `files`,所以需要单独配置它们. 您还需要安装 `@typescript-eslint/parser` 独立于此共享配置. 其他所需软件包必须额外安装.

```typescript
import cffnpwrConfig from "@cffnpwr/eslint-config";
import tsEslintParser from "@typescript-eslint/parser";
import { defineConfig } from "eslint/config";
import globals from "globals";

const files = ["**/*.{js,ts}"];

export default defineConfig([
  {
    files,
    languageOptions: {
      globals: {
        ...globals.node,
      },
      parser: tsEslintParser,
      parserOptions: {
        projectService: true,
        tsconfigRootDir: import.meta.dirname,
      },
    },
  },
  {
    files,
    extends: cffnpwrConfig(), // TypeScript recommended rules + TypeScript/JSX style rules
  },
]);
```

### 任择规则

React和Tailwind CSS规则可以选择添加. 以下是配置示例:

```typescript
// Enable React
cffnpwrConfig({ react: true });

// Enable Tailwind CSS
cffnpwrConfig({ tailwind: true });

// Enable React + Tailwind CSS
cffnpwrConfig({ react: true, tailwind: true });
```

## 许可证

[MIT 许可证](https://npmcn.com/package/%40cffnpwr/eslint-config/LICENSE)

## 常见问题

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

Cffnpwr 常见的 ESLint 配置

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

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

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

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

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

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

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

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

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

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

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

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

