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

@icebreakers/eslint-config

v1.6.19

Published

ESLint preset from Icebreaker's dev-configs

Readme

@icebreakers/eslint-config

简介

@icebreakers/eslint-config 基于 @antfu/eslint-config 的 flat config 预设,额外补充了 Tailwind CSS、MDX、Vue 无障碍以及 Icebreaker 团队常用的 TypeScript 默认规则。它返回一个 FlatConfigComposer,可以按需启用不同预设,并继续追加工作区特定的覆盖项。

环境要求

  • Node.js 18 或更高版本
  • 支持 Flat Config 的 ESLint 9
  • 如需启用 Tailwind、MDX、UnoCSS 等,可安装对应的可选依赖:eslint-plugin-tailwindcss / eslint-plugin-better-tailwindcsseslint-plugin-mdx@unocss/eslint-plugin

安装

pnpm add -D eslint @icebreakers/eslint-config

快速上手

在项目根目录创建 eslint.config.ts(或 .mjs):

import { icebreaker } from '@icebreakers/eslint-config'

export default icebreaker()

使用包管理器运行 ESLint:

pnpm eslint "src/**/*.ts"

如果仍需兼容旧的 .eslintrc 流程,可改用 icebreakerLegacy()

启用可选预设

所有可选项与 @antfu/eslint-config 保持一致,并叠加 Icebreaker 的调整:

import { icebreaker } from '@icebreakers/eslint-config'

export default icebreaker({
  vue: true, // 或 { vueVersion: 2 }
  react: true,
  query: true,
  typescript: true,
  test: true,
  tailwindcss: {
    tailwindConfig: './tailwind.config.ts',
  },
  mdx: process.env.LINT_MDX === 'true',
  a11y: true,
  nestjs: true,
  ionic: true,
  weapp: true,
  formatters: true,
})
  • vue:启用 Vue 规则,可根据 Vue 2/3 自动切换,并在 ionicweapp 选项开启时追加对应覆盖。
  • react:复用上游 React 预设,配合 a11y 注入无障碍插件。
  • query:按需启用 TanStack Query 插件(@tanstack/eslint-plugin-query)及其推荐规则。
  • tailwindcss:传入 true 使用内置 Tailwind flat 配置,或通过对象指定 Tailwind v4 的入口文件 / v3 的配置文件路径。
  • mdx:激活 eslint-plugin-mdx 处理 .mdx 文件。
  • a11y:按需引入 JSX 与 Vue 的无障碍规则。
  • typescript:开启 TypeScript 预设,加强未使用诊断,可与 nestjs 搭配使用以获得 Nest 专属优化。
  • nestjs:针对 NestJS 场景做 TypeScript 调整(允许带装饰器的空构造函数、依赖注入参数属性、声明合并等)。
  • formatters:默认启用格式化辅助规则。
  • test:放宽 Vitest / Jest 常见规则,例如关闭 test/prefer-lowercase-title

NestJS 项目

建议在 Nest 项目中同时开启 typescriptnestjs,以便应用以下定制:

  • 允许常见的空装饰器类(如 @Controller()@Module())以及生命周期钩子占位实现。
  • 放宽依赖注入常用的构造函数参数属性、 ambient 模块扩展等约束。
  • 针对 Functionany 等在注入令牌或元数据中常见的类型用法做精确豁免,同时保留其他严格检查。

追加自定义配置

icebreaker() 返回的 composer 支持继续拼接 Flat Config:

import { icebreaker } from '@icebreakers/eslint-config'

export default icebreaker(
  { typescript: true },
  {
    files: ['*.vue'],
    rules: {
      'vue/no-undef-components': 'off',
    },
  },
)

亦可追加其它第三方或内部预设,统一合并。

IDE 集成

  • VS Code 安装 ESLint 扩展(版本需 ≥ 3.0.10)。
  • 老版本 VS Code 需在设置中启用 "eslint.experimental.useFlatConfig": true
  • 在 Git 钩子或 CI 中执行 pnpm lint -- --fix 确保格式一致。

常见问题

  • 如果提示缺少插件,说明当前工作区未安装对应可选依赖,可通过 pnpm add -D 补齐。
  • 与旧版 .eslintrc 混用时建议先改用 icebreakerLegacy(),逐步迁移至 Flat Config。
  • Tailwind 校验依赖 tailwind.config.*,Monorepo 或自定义构建路径时请确认配置文件位置。