@epic-web/config

中文文档
3.2.1发布于 2026/08/04MITTypeScriptES Module构建来源已验证近 30 天下载 10.2万

Reasonable Oxlint, Oxfmt, and TypeScript configs for epic web devs

原始使用文档
文档目录8 节
  1. The problem
  2. This solution
  3. Decisions
  4. Usage
  5. Oxfmt (formatter)
  6. TypeScript
  7. Oxlint
  8. License

👮 @epic-web/config

Reasonable Oxlint, Oxfmt, and TypeScript configs for epic web devs

This makes assumptions about the way you prefer to develop software and gives you configurations that will actually help you in your development.

npm install @epic-web/config

Build Status MIT License Code of Conduct

The problem

You're a professional, but you're mature enough to know that even professionals can make mistakes, and you value your time enough to not want to waste time configuring code quality tools or babysitting them.

This solution

This package provides shared defaults for the tools this repo currently ships:

  • Oxlint
  • Oxfmt
  • TypeScript

Decisions

You can learn about the different decisions made for this project in the decision docs.

Usage

Technically you configure everything yourself, but you can use the configs in this project as a starter for your projects (and in some cases you don't need to configure anything more than the defaults).

Oxfmt (formatter)

Install Oxfmt alongside this package (it is listed in peerDependencies).

The @epic-web/config/oxfmt entry resolves to a plain .js preset (this package uses "type": "module") so Node does not need to strip TypeScript from files under node_modules when you extend it.

Create an oxfmt.config.ts file in your project root:

import epicOxfmt from '@epic-web/config/oxfmt'
import { defineConfig } from 'oxfmt'

export default defineConfig({
    ...epicOxfmt,
    printWidth: 100,
})

Oxfmt does not have an extends field; spreading the preset and setting any top-level option afterward is how you override it (same idea for ignorePatterns: spread epicOxfmt.ignorePatterns and append paths).

Add scripts (see the migration guide):

{
    "scripts": {
        "format": "oxfmt",
        "format:check": "oxfmt --check"
    }
}

The shared config sets 80 printWidth, tabs (spaces only in package.json overrides), no semicolons, single quotes, trailingComma: "all", Tailwind class sorting via native sortTailwindcss, and MDX overrides for proseWrap / htmlWhitespaceSensitivity. Options that Oxfmt does not support (insertPragma, requirePragma) are omitted.

ignorePatterns covers common build, cache, Playwright, Prisma, and lockfile paths used across Epic projects. Adjust in your defineConfig if your layout differs.

Customizing Oxfmt

If you want to customize things heavily, you can copy the options from oxfmt-preset.js into your own config. For small tweaks, keep spreading epicOxfmt and override or extend fields as in the example above.

Use "type": "module" in your package.json when your oxfmt.config.ts uses import / export syntax (same as for other ESM tooling).

TypeScript

Create a tsconfig.json file in your project root with the following content:

{
    "extends": ["@epic-web/config/typescript"],
    "include": ["**/*.ts", "**/*.tsx", "**/*.js", "**/*.jsx"],
    "compilerOptions": {
        "paths": {
            "#app/*": ["./app/*"],
            "#tests/*": ["./tests/*"]
        }
    }
}

Create a reset.d.ts file in your project with these contents:

import '@epic-web/config/reset.d.ts'
Customizing TypeScript

Learn more from the TypeScript docs here.

Oxlint

Create a .oxlintrc.json file in your project root with the following content:

{
    "extends": ["./node_modules/@epic-web/config/oxlint-config.json"]
}

This config includes the custom epic-web/* rules documented in lint-rules/index.md.

Note: typescript/no-misused-promises and typescript/no-floating-promises are type-aware in Oxlint and require the type-aware setup described in the Oxlint docs.

Some Oxlint rule IDs still use the eslint/ namespace because that is how Oxlint exposes those compatibility rules. You do not need to install ESLint to use them.

The epic-web/no-prettier-ignore rule warns on prettier-ignore in JavaScript and TypeScript comments and can auto-fix them to oxfmt-ignore for Oxfmt. Keep prettier-ignore where Oxfmt still recommends it (for example non-JS regions in Vue); see the inline ignore comments docs.

Not yet covered

The following rule families are intentionally omitted because they are not yet part of the Oxlint config this package ships:

  • import/order
  • react-hooks/rules-of-hooks
  • react-hooks/exhaustive-deps
  • testing-library/*
  • jest-dom/*
  • most vitest/* rules
  • playwright/*

License

MIT

版本与发布记录

@epic-web/config 共发布 74 个版本,首次发布于 2024/05/25;过去 12 个月发布了 9 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
3.2.1latest2026/08/043 个月前
3.2.02026/07/094 个月前
3.1.02026/04/156 个月前
3.0.02026/04/156 个月前
2.0.02026/03/277 个月前
1.24.12026/03/018 个月前

关于 @epic-web/config 的常见问题

@epic-web/config 是什么?

Reasonable Oxlint, Oxfmt, and TypeScript configs for epic web devs

如何安装 @epic-web/config?

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

@epic-web/config 支持 TypeScript 吗?

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

@epic-web/config 支持 ESM 还是 CommonJS?

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

@epic-web/config 可以商用吗?

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

@epic-web/config 的下载量有多少?

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

@epic-web/config 还在维护吗?

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