@freckle/eslint-config

中文文档
1.3.4发布于 2026/10/26MITES Module近 30 天下载 3161

Shared ESLint flat config for Freckle TypeScript and JavaScript repositories

原始使用文档
文档目录4 节
  1. What it does
  2. Install
  3. Use
  4. Changing the config

@freckle/eslint-config

The shared ESLint flat config for Freckle TypeScript and JavaScript repositories.

What it does

Applies @eslint/js recommended and typescript-eslint recommended to **/*.{ts,tsx,js,jsx}, ignores dist/, lib/ and coverage/, and relaxes @typescript-eslint/no-unused-vars so a leading underscore marks an intentionally unused argument or variable.

no-undef is on for .js and .jsx. typescript-eslint turns it off because tsc reports undefined names, but nothing type-checks JavaScript. It does not know your runtime, so a JavaScript repo declares its globals itself (see below).

lib/ is in there because the Action repos emit tsc output to it before ncc bundles to dist/. No repo in either archetype keeps source under lib/, so ignoring it fleet-wide is safe.

Install

pnpm add -D @freckle/eslint-config

eslint is a peer dependency — keep it in your own devDependencies.

Remove @eslint/js and typescript-eslint from your devDependencies when you adopt this. They come in through this package, and leaving them declared means two places to bump.

Use

// eslint.config.mjs
import freckle from '@freckle/eslint-config'

export default freckle

The default export is a config array, so anything repo-specific composes onto it:

import freckle from '@freckle/eslint-config'

export default [...freckle, {ignores: ['generated/']}]

A config object containing only ignores sets global ignores, and ESLint merges those across objects — so the example above ignores dist/, lib/, coverage/ and generated/.

The same shape covers a documented rule waiver:

import freckle from '@freckle/eslint-config'

export default [
  ...freckle,
  {
    files: ['**/*.ts'],
    rules: {
      // Why this repo needs the exception.
      '@typescript-eslint/no-explicit-any': 'off'
    }
  }
]

Changing the config

Edit index.js here. Every consumer picks it up on its next dependency bump, which is the point of the package — do not fix a shared-style question by editing a consumer.

版本与发布记录

@freckle/eslint-config 共发布 9 个版本,首次发布于 2026/09/18;过去 12 个月发布了 9 个版本。

版本发布日期距今
1.3.4latest2026/10/2621 天前
1.3.32026/10/1828 天前
1.3.22026/10/111 个月前
1.3.12026/10/041 个月前
1.3.02026/10/031 个月前
1.2.02026/09/291 个月前

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

@freckle/eslint-config 是什么?

Shared ESLint flat config for Freckle TypeScript and JavaScript repositories

如何安装 @freckle/eslint-config?

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

@freckle/eslint-config 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/freckle__eslint-config 是否存在。

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

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

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

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

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

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

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

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