eslint-plugin-typefest
July 7, 2026 ยท View on GitHub
ESLint plugin for teams that want consistent TypeScript-first conventions based on:
The plugin ships focused rule sets for modern flat config usage, with parser setup included in each preset config.
Table of contents
- Installation
- Quick start (flat config)
- Presets
- Configuration examples by preset
- Global settings
- Rules
- Contributors โจ
Installation
npm install --save-dev eslint-plugin-typefest typescript
@typescript-eslint/parseris loaded automatically by plugin presets.
Compatibility
- Supported ESLint versions:
9.xand10.x - Config system: Flat Config only (
eslint.config.*) - Node.js runtime:
>=22.0.0
Quick start (flat config)
import typefest from "eslint-plugin-typefest";
export default [typefest.configs.recommended];
That is enough for TypeScript files (**/*.{ts,tsx,mts,cts}).
Presets
This plugin intentionally exports eight presets:
Configuration examples by preset
import typefest from "eslint-plugin-typefest";
export default [
// Smallest baseline footprint.
typefest.configs.minimal,
// Balanced default for most teams.
// typefest.configs.recommended,
// Recommended plus type-aware ts-extras helper rules.
// typefest.configs["recommended-type-checked"],
// Recommended plus additional stable runtime utilities.
// typefest.configs.strict,
// Every stable rule.
// typefest.configs.all,
// Every stable rule plus experimental candidate rules.
// typefest.configs.experimental,
// Focused subsets:
// typefest.configs["type-fest/types"],
// typefest.configs["ts-extras/type-guards"],
];
Parser setup behavior
Each preset already includes:
files: ["**/*.{ts,tsx,mts,cts}"]languageOptions.parser(@typescript-eslint/parser)languageOptions.parserOptions:ecmaVersion: "latest"projectService: true(for presets that include typed rules, such asrecommended-type-checked,strict,all, andexperimental)sourceType: "module"
End users usually do not need to wire parser config manually.
If you need custom parser options (for example tsconfigRootDir), extend a preset:
import typefest from "eslint-plugin-typefest";
const recommended = typefest.configs.recommended;
export default [
{
...recommended,
languageOptions: {
...recommended.languageOptions,
parserOptions: {
...recommended.languageOptions?.parserOptions,
// Add projectService only when you opt into a type-aware preset.
},
},
},
];
Global settings
You can globally disable autofixes that add missing imports while still keeping rule reports and non-import autofixes enabled.
import typefest from "eslint-plugin-typefest";
export default [
{
...typefest.configs.recommended,
settings: {
typefest: {
// Disable all autofixes while keeping suggestions enabled.
// disableAllAutofixes: true,
// Disable only autofixes that add missing imports.
disableImportInsertionFixes: true,
},
},
},
];
When settings.typefest.disableImportInsertionFixes is true, rules that
would normally add a missing type-fest or ts-extras import will report
without applying that import-adding autofix. Autofixes that do not require
inserting a new import (for example, when the replacement symbol is already in
scope) still apply.
When settings.typefest.disableAllAutofixes is true, all rule autofixes are
suppressed, but reports and suggestions remain available.
If both settings are enabled, disableAllAutofixes takes precedence for
autofix behavior.
Rules
Fixlegend:๐ง= autofixable๐ก= suggestions availableโ= report only
Preset keylegend:- ๐ข โ
typefest.configs.minimal - ๐ก โ
typefest.configs.recommended - ๐ โ
typefest.configs["recommended-type-checked"] - ๐ด โ
typefest.configs.strict - ๐ฃ โ
typefest.configs.all - ๐งช โ
typefest.configs.experimental - ๐ โ
typefest.configs["type-fest/types"] - โด๏ธ โ
typefest.configs["ts-extras/type-guards"]
- ๐ข โ
Contributors โจ
Thanks goes to these wonderful people (emoji key):
Nick2bad4u ๐ ๐ป ๐ ๐ค ๐ ๐ง ๐ โ ๏ธ ๐ง |
Snyk bot ๐ก๏ธ ๐ ๐ง ๐ |
StepSecurity Bot ๐ก๏ธ ๐ ๐ง |
dependabot[bot] ๐ ๐ก๏ธ |
github-actions[bot] ๐ป ๐ |