npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@xfe-repo/eslint-config

v1.5.2

Published

仓库统一 ESLint 配置中心(支持 Legacy `.eslintrc.js` 与 Flat `eslint.config.mjs`)。

Downloads

331

Readme

@xfe-repo/eslint-config

仓库统一 ESLint 配置中心(支持 Legacy .eslintrc.js 与 Flat eslint.config.mjs)。

统一版本策略

  • ESLint 主版本统一为 8.57.1
  • TypeScript 规则统一为 @typescript-eslint/*@^8.54.0
  • Flat Config 相关插件统一在本包维护:
    • @eslint/js
    • typescript-eslint
    • eslint-plugin-prettier
    • eslint-plugin-simple-import-sort
    • globals

用法

1) Legacy(.eslintrc.js

module.exports = {
  root: true,
  extends: ['@xfe-repo/eslint-config/turbo.js'],
}

React 包可改为:

module.exports = {
  root: true,
  extends: ['@xfe-repo/eslint-config/react.js'],
}

2) Flat(eslint.config.mjs,推荐用于 Nest/BFF)

import { createNestjsConfig } from '@xfe-repo/eslint-config/nestjs.mjs'

export default createNestjsConfig(import.meta.dirname)

最佳实践

  • 单一规则源:规则定义集中在本包,业务包只做 extends 或函数调用。
  • 版本同源:避免在业务包重复声明 ESLint 插件版本,防止 peer mismatch。
  • 渐进迁移:旧包继续 .eslintrc.js,新包优先 Flat Config,逐步收敛。
  • 按项目根解析 TS:Flat Config 必须显式传入 tsconfigRootDir

packages 目录 ESLint 约定表

| 目录类型 | 包类型 | 配置文件 | 规则来源 | 说明 | | ---------------------------------------------- | --------------------- | ------------------- | ----------------------------------------- | ---------------------------------------------------------- | | packages/bff/* | Nest/BFF 服务包 | eslint.config.mjs | createNestjsConfig(import.meta.dirname) | 统一 Flat Config,启用 TypeScript Type-Aware + import 排序 | | packages/web/app | Web 应用脚手架 | .eslintrc.js | @xfe-repo/eslint-config/react.js | React 运行时相关,保留 Legacy 配置 | | packages/web/components | React 组件库 | .eslintrc.js | @xfe-repo/eslint-config/react.js | 组件/UI 包使用 React 规则 | | packages/web/micro | React 微前端容器 | .eslintrc.js | @xfe-repo/eslint-config/react.js | React 运行时包使用 React 规则 | | packages/web/redux | React 状态管理 | .eslintrc.js | @xfe-repo/eslint-config/react.js | 与 React 强绑定的状态层 | | packages/web/register | React 注册/容器层 | .eslintrc.js | @xfe-repo/eslint-config/react.js | 与 React 生命周期/渲染相关 | | packages/web/router | React 路由层 | .eslintrc.js | @xfe-repo/eslint-config/react.js | Router 与 React 绑定 | | packages/web/service | Web 通用服务层 | .eslintrc.js | @xfe-repo/eslint-config/turbo.js | 非 React 纯 TS 工具/服务包 | | packages/web/utils | Web 工具库 | .eslintrc.js | @xfe-repo/eslint-config/turbo.js | 非 React 纯 TS 工具包 | | packages/mini/app | Taro 小程序应用脚手架 | .eslintrc.js | taro/react | 遵循 Taro 官方规则集 | | packages/mini/components | 小程序 React 组件 | .eslintrc.js | @xfe-repo/eslint-config/react.js | React 组件模式 | | packages/mini/router | 小程序路由层 | .eslintrc.js | @xfe-repo/eslint-config/turbo.js | 非 UI 逻辑层 | | packages/mini/service | 小程序服务层 | .eslintrc.js | @xfe-repo/eslint-config/turbo.js | 非 UI 逻辑层 | | packages/mini/utils | 小程序工具层 | .eslintrc.js | @xfe-repo/eslint-config/turbo.js | 非 UI 逻辑层 | | packages/shared/routes-define-webpack-plugin | 构建插件 | .eslintrc.js | @xfe-repo/eslint-config/turbo.js | Node/构建工具包 |

新增包默认策略

  • 若为 Nest/BFF 服务包:优先使用 eslint.config.mjs + createNestjsConfig
  • 若为 React 运行时/组件包:使用 .eslintrc.js + @xfe-repo/eslint-config/react.js
  • 若为 纯 TS 工具/服务/构建包:使用 .eslintrc.js + @xfe-repo/eslint-config/turbo.js
  • 若为 Taro app 包:优先沿用 taro/react,避免与 Taro 生态规则冲突。