@flexifin/eslint-config

中文文档
2.7.6发布于 2026/05/18UNLICENSEDTypeScriptES Module近 30 天下载 1.2万

Code service level repo for sharing common sources through several FF projects.

原始使用文档
文档目录4 节
  1. Usage
  2. Migration to FlexiFin code standard
  3. Silencing peer-dependency warnings
  4. Contributors

flexifin/eslint-config

Code service level repo for sharing common sources through several FF projects.

Usage

Update ESlint to version 10:

npm install eslint@^10

Remove these packages from your project:

npm remove prettier \
  @typescript-eslint/parser \
  @typescript-eslint/eslint-plugin \
  eslint-plugin-prefer-arrow-functions \
  eslint-plugin-unused-imports \
  eslint-config-prettier \
  eslint-plugin-prettier \
  eslint-plugin-react \
  eslint-plugin-unicorn

Install package:

# npm
npm install -D @flexifin/eslint-config

# yarn
yarn add -D @flexifin/eslint-config

# pnpm
pnpm add -D @flexifin/eslint-config

# bun
bun install -D @flexifin/eslint-config

# deno
deno install --dev npm:@flexifin/eslint-config

Migration to FlexiFin code standard

Rename your project root ESLint config file to eslint.config.mjs and modify content to extend FlexiFin preset:

import flexiFin from '@flexifin/eslint-config';

export default flexiFin(
  {
    tsconfigRootDir: import.meta.dirname,
    strict: true, // optional (enables type-aware lint: recommendedTypeChecked + stylisticTypeChecked)
    nestSupport: true, // backend (NestJS, Swagger, Node plugin)
    nextSupport: true, // frontend (Next.js, React, Storybook, Playwright, i18next, TanStack Query, a11y)
    plugins: {
      // Every plugin defaults to true EXCEPT `jest` (off — Vitest is the default test runner).
      // Set false to opt out individually. Jest projects opt in:
      // jest: true, vitest: false,
      //
      // Note: TypeScript support (parser + @typescript-eslint plugin) is always on — it is
      // infrastructure, not a toggleable opinion. Override individual TS rules via userConfigs.
    },
    ignores: [
      // ignore paths
    ],
  },
  // Rule overrides go in subsequent userConfig arguments — they apply at the end of the
  // chain and override every preset rule. Add as many as you need; scope by `files` when needed.
  {
    rules: {
      'unicorn/no-array-reduce': 'off',
    },
  }
);

Real world example:

import flexiFin from '@flexifin/eslint-config';

export default flexiFin(
  {
    nextSupport: true,
    ignores: ['src/_api'],
  },
  {
    rules: {
      'unicorn/no-array-reduce': 'off',
    },
  },
  {
    files: ['**/*.spec.ts'],
    rules: {
      '@typescript-eslint/no-explicit-any': 'off',
    },
  }
);

Rename your project root Prettier config file to prettier.config.mjs and modify content to extend FlexiFin preset:

import flexiFin from '@flexifin/eslint-config/prettier';

export default flexiFin();

Silencing peer-dependency warnings

Some bundled plugins declare peers that don't apply to every project: @darraghor/eslint-plugin-nestjs-typed peer-deps on class-validator (relevant only for NestJS apps), eslint-plugin-jsx-a11y is still pinned to ESLint ≤9, and eslint-plugin-storybook requires Storybook 10.3.6+. Add the following to your monorepo root package.json to silence the noise:

{
  "pnpm": {
    "peerDependencyRules": {
      "allowedVersions": {
        "eslint-plugin-jsx-a11y>eslint": "10",
        "eslint-plugin-storybook>storybook": ">=10.3.5"
      },
      "ignoreMissing": ["class-validator"]
    }
  }
}

NestJS apps already use class-validator at runtime, so the ignoreMissing entry only matters for front-end / non-Nest packages — keep it monorepo-wide and the warning disappears regardless of project type.

To approve native build scripts (unrs-resolver etc.), run pnpm approve-builds once.

Contributors


🤖 auto updated with automd

版本与发布记录

@flexifin/eslint-config 共发布 38 个版本,首次发布于 2024/09/27;过去 12 个月发布了 19 个版本。

版本发布日期距今
2.7.6latest2026/05/185 个月前
2.6.232026/05/146 个月前
2.5.212026/05/146 个月前
2.5.152026/05/066 个月前
2.5.102026/05/066 个月前
2.5.62026/05/066 个月前

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

@flexifin/eslint-config 是什么?

Code service level repo for sharing common sources through several FF projects.

如何安装 @flexifin/eslint-config?

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

@flexifin/eslint-config 支持 TypeScript 吗?

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

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

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

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

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

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

@flexifin/eslint-config 使用 UNLICENSED 许可。作者声明为 UNLICENSED,即不授予公开使用许可(与公共领域的 Unlicense 不同)。使用前需获得作者授权。以上为概括,不构成法律意见,请以许可原文为准。

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

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

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

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