@frabbit/eslint-config

中文文档
9.0.0发布于 2026/10/23MITTypeScriptES Module近 30 天下载 2443

ESLint config for @frabbit.

原始使用文档
文档目录6 节
  1. Features
  2. Install
  3. Usage
  4. Presets
  5. Comparing to @antfu/eslint-config
  6. TypeScript compatibility

@frabbit/eslint-config npm

Flat ESLint config for JavaScript, TypeScript, Vue 2, Vue 3, Prettier. based on https://github.com/sxzz/eslint-config

A opinionated ESLint config preset for JavaScript, TypeScript, Vue, and Prettier.

Features

  • Format with Prettier.
  • Designed to work with TypeScript, Vue out-of-box.
  • Support JSON(5), YAML, Markdown...
  • Sort imports, package.json, tsconfig.json...
  • ESLint Flat config, compose easily!
  • Ignores common files like dist, node_modules, coverage, and files in .gitignore.
  • Reasonable defaults, best practices, only one-line of config
  • Reasonable strict, but with better code quality.

Install

npm i -D @frabbit/eslint-config

Require Node.js >= 20.0.0, and ESLint >= 9.5.0.

Usage

import { frabbit } from '@frabbit/eslint-config'

export default frabbit(
  // Features: it'll detect installed dependency and enable necessary features automatically
  {
    prettier: true,
    markdown: true,
    vue: true, // auto detection
    unocss: false, // auto detection
  },
  [
    /* your custom config */
  ]
).removeRules('foo/bar') // see more in https://github.com/antfu/eslint-flat-config-utils

Presets

// eslint.config.js
import {
  presetJavaScript, // Ignore common files and include javascript support
  presetJsonc, // Includes basic json(c) file support and sorting json keys
  presetLangsExtensions, // Includes markdown, yaml + `presetJsonc` support
  presetBasic, // Includes `presetJavaScript` and typescript support

  // Includes
  // - `presetBasic` (JS+TS) support
  // - `presetLangsExtensions` (markdown, yaml, jsonc) support
  // - Vue support
  // - UnoCSS support (`uno.config.ts` is required)
  // - Prettier support
  presetAll,
} from '@frabbit/eslint-config'

export default presetAll

See preset.ts for more details.

Comparing to @antfu/eslint-config

Most of the rules are the same, but there are some differences:

TypeScript compatibility

Requires ESLint 10 and Node.js ^22.18.0, ^24.11.0, or >=26.0.0. The current typescript-eslint 8.72 supports TypeScript >=4.8.4 <6.1.0. Use TypeScript 6.0.x for linting; TypeScript 7 is not yet supported upstream.

版本与发布记录

@frabbit/eslint-config 共发布 26 个版本,首次发布于 2023/09/25;过去 12 个月发布了 9 个版本。

版本发布日期距今
9.0.0latest2026/10/2323 天前
8.0.12026/04/117 个月前
7.9.02026/04/117 个月前
7.8.22026/02/129 个月前
7.8.02026/02/129 个月前
7.6.02026/01/319 个月前

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

@frabbit/eslint-config 是什么?

ESLint config for @frabbit.

如何安装 @frabbit/eslint-config?

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

@frabbit/eslint-config 支持 TypeScript 吗?

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

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

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

@frabbit/eslint-config 需要什么版本的 Node.js?

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

@frabbit/eslint-config 可以商用吗?

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

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

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

@frabbit/eslint-config 还在维护吗?

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