@cffnpwr/eslint-config

中文文档
2.1.0发布于 2026/10/25MITTypeScriptES Module构建来源已验证近 30 天下载 3693

Common ESLint configuration for cffnpwr

原始使用文档
文档目录9 节
  1. How to Install
  2. npm
  3. yarn
  4. pnpm
  5. Bun
  6. Deno
  7. How to Use
  8. Optional Rules
  9. License

@cffnpwr/eslint-config

GitHub License npm Version JSR Version

A shared ESLint configuration for cffnpwr.

日本語のREADMEはこちら

How to Install

npm

npm install -D @cffnpwr/eslint-config

or

npx jsr add -D @cffnpwr/eslint-config

yarn

yarn add -D @cffnpwr/eslint-config

or

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

pnpm

pnpm add -D @cffnpwr/eslint-config

or

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

Bun

bun add -D @cffnpwr/eslint-config

or

bunx jsr add -D @cffnpwr/eslint-config

Deno

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

or

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

How to Use

Create an eslint.config.ts file and configure it as follows. This shared configuration does not provide files, so you need to configure them individually. You also need to install @typescript-eslint/parser separately from this shared configuration. Other required packages must be installed additionally.

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
  },
]);

Optional Rules

React and Tailwind CSS rules can be optionally added. Here are configuration examples:

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

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

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

License

MIT License

版本与发布记录

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

版本发布日期距今
2.1.0latest2026/10/2515 天前
2.0.12026/07/153 个月前
2.0.02026/07/123 个月前
1.2.02026/03/197 个月前
1.1.32026/02/218 个月前
1.1.22026/01/159 个月前

其他发布通道:beta → 1.0.0-beta。

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

@cffnpwr/eslint-config 是什么?

Common ESLint configuration for cffnpwr

如何安装 @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 和提交记录判断。