Skip to content

Presets

Presets are named bundles of default options that give a project a sensible starting point without requiring every option to be listed explicitly. A preset sets defaults for typescript, runtime, tools, extensions, and strict — you can override any of those on top of it.

eslint.config.mjs
import { defineConfig, Preset } from '@santi020k/eslint-config-basic'
export default await defineConfig({
preset: Preset.App
})
PresetEnumBest For
BasicPreset.BasicPlain JavaScript projects with no TypeScript.
NodePreset.NodeTypeScript packages running in Node.js (CLIs, scripts, APIs).
BrowserPreset.BrowserTypeScript apps running in the browser without a meta-framework.
WorkerPreset.WorkerEdge runtimes, service workers, and Cloudflare Workers.
LibraryPreset.LibraryPublished npm packages — adds Prettier and tightens type-safety rules.
AppPreset.AppBrowser applications — TypeScript + Prettier + Vitest by default.
CIPreset.CIStricter severities for CI environments (warnings become errors).
MonorepoPreset.MonorepoRoot config for workspace repositories with mixed project types.
AllPreset.AllTypeScript + all bundled integrations. Useful for audits and evaluation.

The minimum viable config — core JavaScript rules only. No TypeScript, no runtime globals beyond ECMAScript standard. Use this as a base when you want full manual control over everything else.

import { defineConfig, Preset } from '@santi020k/eslint-config-basic'
export default await defineConfig({ preset: Preset.Basic })

TypeScript enabled, Node.js globals active (process, __dirname, Buffer, etc.). Suitable for CLIs, build scripts, and server-side packages that run directly in Node.

import { defineConfig, Preset } from '@santi020k/eslint-config-basic'
export default await defineConfig({ preset: Preset.Node })

TypeScript enabled, browser globals active (window, document, navigator, etc.). Use for front-end code that does not use a full meta-framework — for example a vanilla TypeScript library or a standalone Vite project.

import { defineConfig, Preset } from '@santi020k/eslint-config-basic'
export default await defineConfig({ preset: Preset.Browser })

TypeScript enabled, service worker and Fetch API globals active (self, fetch, Request, Response, caches, etc.). Use for Cloudflare Workers, edge functions, or any runtime that matches the WinterCG API surface.

import { defineConfig, Preset } from '@santi020k/eslint-config-basic'
export default await defineConfig({ preset: Preset.Worker })

TypeScript enabled, Prettier applied, strict type-safety rules tightened. Designed for packages you publish to npm where you want a consistent, well-typed public API and no leftover debug output.

import { defineConfig, Preset } from '@santi020k/eslint-config-basic'
export default await defineConfig({ preset: Preset.Library })

TypeScript enabled, browser globals, Prettier applied, Vitest included. The recommended starting point for any single-page application or web app — pair with a frameworks option to add React, Next.js, Vue, or another UI layer.

import { defineConfig, Preset } from '@santi020k/eslint-config-basic'
export default await defineConfig({
frameworks: { next: true },
preset: Preset.App
})

Same as the project’s detected/explicit defaults, but with all warnings promoted to errors. Drop this into a CI-specific config or use it as your single config if you prefer zero-warning builds everywhere.

import { defineConfig, Preset } from '@santi020k/eslint-config-basic'
export default await defineConfig({ preset: Preset.CI })

[!TIP] Preset.CI is equivalent to setting strict: true — but using the preset keeps the intent explicit and readable.

Universal TypeScript defaults for a workspace root that lints many packages at once. Works best with the projects option so individual workspace packages can narrow their own preset and runtime.

import { defineConfig, Preset, Runtime } from '@santi020k/eslint-config-basic'
export default await defineConfig({
preset: Preset.Monorepo,
projects: {
'apps/api': { preset: Preset.Node, runtime: Runtime.Node },
'apps/web': { frameworks: { next: true }, preset: Preset.App }
}
})

See the Monorepo guide for a full walk-through.

Enables TypeScript and every bundled optional integration (all tools, libraries, testing frameworks, formats, and extensions). Intended for exploration and auditing — not recommended as a long-term production config because it includes integrations your project may not actually use.

When using @santi020k/eslint-config-lite, Preset.All requires @santi020k/eslint-config-integrations because the preset selects integration configs. Lite projects usually get better dependency control by enabling only the specific integrations they need.

import { defineConfig, Preset } from '@santi020k/eslint-config-basic'
export default await defineConfig({ preset: Preset.All })

Presets do not activate framework configs. Frameworks come from auto-detection (enabled by default) or an explicit frameworks option. You can always add a frameworks key alongside any preset:

import { defineConfig, Preset } from '@santi020k/eslint-config-basic'
export default await defineConfig({
frameworks: { svelte: true },
preset: Preset.Browser
})

Any explicit option you pass overrides the preset default for that field. List options (libraries, testing, formats, tools, extensions) are merged with preset defaults under optionMergeStrategy: 'merge' (the default). Use optionMergeStrategy: 'replace' when you want your explicit lists to fully replace what the preset provides.

Optional configs can be enabled with enum values, matching strings, or the features map. A features value of false removes that optional config after detection and preset defaults are merged.

import { defineConfig, Preset } from '@santi020k/eslint-config-basic'
export default await defineConfig({
features: {
prettier: false,
zod: true
},
preset: Preset.App
})

Did this page help?

One click helps us spot documentation that needs another pass. No personal data is sent.