Configuration
The main package composes the final config array from a small set of clear inputs:
- Framework packages passed through
frameworks. - Optional integrations passed through enums such as
Library,Testing,Format,Tool, andExtension. - Runtime and preset choices.
- Global settings such as
strictandsettings.
Mental Model
Section titled “Mental Model”Think of the config in three layers:
- Start with the main package and optional TypeScript support.
- Add explicit framework packages for the application stack.
- Add optional tooling through enums for libraries, testing, formats, tools, and extensions.
That keeps the final config readable while still giving you a broad feature set.
Core Composition Model
Section titled “Core Composition Model”import { eslintConfig, Extension, Format, Library, Runtime, Testing, Tool } from '@santi020k/eslint-config-basic'import react from '@santi020k/eslint-config-react'
export default eslintConfig({ extensions: [Extension.Unicorn, Extension.Security], formats: [Format.Markdown, Format.Mdx], frameworks: { react }, libraries: [Library.Tailwind, Library.I18next], runtime: Runtime.Browser, testing: [Testing.Vitest], tools: [Tool.Prettier], typescript: true})Presets
Section titled “Presets”The base package exposes named presets for common setups.
| Preset | Meaning |
|---|---|
Basic | Core JavaScript rules only. |
Node | Core + TypeScript + Node globals. |
Browser | Core + TypeScript + Browser globals. |
All | TypeScript plus all bundled optional integrations from the main package. |
Framework packages are still explicit even when you use a preset.
Minimal Config
Section titled “Minimal Config”import { eslintConfig } from '@santi020k/eslint-config-basic'
export default eslintConfig()Runtime and Framework Contracts
Section titled “Runtime and Framework Contracts”Runtime.Nodeenables Node.js globals.Runtime.Browserenables browser globals.Runtime.Universalkeeps both environments available.frameworks.reactis required whenframeworks.nextorframeworks.expois used.nextMode: NextMode.AppRouteradds the App Router override for Next.js.- This is auto-detected if an
app/orsrc/app/directory is present.
- This is auto-detected if an
- When you write the config manually, pass imported framework packages instead of booleans.
Configuration Priority
Section titled “Configuration Priority”The eslintConfig function uses a hierarchical merging strategy for its settings:
- User Options: Any field explicitly passed to
eslintConfig({})always takes the highest priority. - Preset Defaults: If a
presetis chosen, its default values are used for any fields not explicitly provided by the user. - Auto-Detection: If a field is still
undefined, it falls back to values detected from yourpackage.json,tsconfig.json, and project structure.
[!TIP] To disable a feature that is being auto-detected, explicitly set it to
falseor an empty array (e.g.,typescript: falseorlibraries: []).
Full Settings Example
Section titled “Full Settings Example”For large projects with multiple integrations, you can activate everything in a single call. Most of these will be auto-detected if the packages exist in your dependencies, but you can be explicit:
import { eslintConfig, Extension, Format, Library, Testing, Tool } from '@santi020k/eslint-config-basic'import next from '@santi020k/eslint-config-next'import react from '@santi020k/eslint-config-react'
export default eslintConfig({ // Specialized Extensions extensions: [ Extension.Unicorn, Extension.Sonarjs, Extension.Perfectionist, Extension.Security, Extension.Regexp, Extension.BestPractices ],
// File Formats formats: [ Format.Mdx, Format.Markdown, Format.Jsonc, Format.Graphql, Format.Yaml, Format.Toml ],
// Frameworks (imports are lazy-loaded) frameworks: { next, react },
// Libraries & Styling libraries: [ Library.Tailwind, Library.TanstackQuery, Library.TanstackRouter, Library.Storybook, Library.I18next ],
// Strict mode: all warnings become errors strict: true,
// Testing Frameworks testing: [ Testing.Vitest, Testing.Playwright, Testing.TestingLibrary, Testing.Cypress ],
// Standalone Tools tools: [ Tool.Prettier, Tool.Cspell, Tool.Jsdoc ],
// Enable TypeScript support (auto-detected if tsconfig.json exists) typescript: true})Framework Matrix
Section titled “Framework Matrix”| Framework | Package | Special Notes |
|---|---|---|
| TypeScript | typescript: true | Automatically detected from tsconfig.json. |
| React | @santi020k/eslint-config-react | Base for React, Next.js, Remix, and Expo. |
| Next.js | @santi020k/eslint-config-next | Dedicated Page. Requires react. |
| Astro | @santi020k/eslint-config-astro | Dedicated Page. |
| Vue | @santi020k/eslint-config-vue | Dedicated Page. |
| Svelte | @santi020k/eslint-config-svelte | Dedicated Page. |
| Solid | @santi020k/eslint-config-solid | Dedicated Page. |
| Qwik | @santi020k/eslint-config-qwik | Dedicated Page. |
| Remix | @santi020k/eslint-config-remix | Dedicated Page. Commonly paired with react in Remix apps. |
| Hono | @santi020k/eslint-config-hono | Dedicated Page. Optimized for Hono and edge runtimes. |
| Angular | @santi020k/eslint-config-angular | Dedicated Page. |
| NestJS | @santi020k/eslint-config-nest | Dedicated Page. |
| Expo | @santi020k/eslint-config-expo | Dedicated Page. Requires react. |
Integrations
Section titled “Integrations”The optional integrations are grouped into five categories:
- Libraries:
libraries - Testing:
testing - Formats:
formats - Tools:
tools - Extensions:
extensions
See the dedicated section for the full catalog: Tooling Overview
Optional integrations are evaluated lazily. You only need the peer packages for integrations you actually enable, so a base Node project does not need unrelated packages like Storybook or GraphQL.
Common Patterns
Section titled “Common Patterns”Fullstack Remix + Tailwind
Section titled “Fullstack Remix + Tailwind”import { eslintConfig, Library } from '@santi020k/eslint-config-basic'import react from '@santi020k/eslint-config-react'import remix from '@santi020k/eslint-config-remix'
export default eslintConfig({ frameworks: { react, remix }, libraries: [Library.Tailwind]})Astro + Svelte + Vitest
Section titled “Astro + Svelte + Vitest”import astro from '@santi020k/eslint-config-astro'import { eslintConfig, Testing } from '@santi020k/eslint-config-basic'import svelte from '@santi020k/eslint-config-svelte'
export default eslintConfig({ frameworks: { astro, svelte }, testing: [Testing.Vitest]})Strict Mode
Section titled “Strict Mode”Use strict mode when you want warnings promoted to errors.
import { eslintConfig } from '@santi020k/eslint-config-basic'
export default eslintConfig({ strict: true})Strict mode promotes warning severities to errors across the composed config, including array-style rule definitions.
Settings
Section titled “Settings”Gitignore integration is enabled by default.
import { eslintConfig, Setting } from '@santi020k/eslint-config-basic'
export default eslintConfig({ settings: [Setting.NoGitignore]})Recommended Workflow
Section titled “Recommended Workflow”- Start with
eslintConfig(). - Add framework packages explicitly.
- Add optional integrations through enums.
- Use the CLI if you want the first config file scaffolded for you.
- Use the inspector when the final config needs debugging.
Repository Links
Section titled “Repository Links”- Main Package Source: packages/basic
- Core Types And Detection: packages/core
Related Pages
Section titled “Related Pages”Did this page help?
One click helps us spot documentation that needs another pass. No personal data is sent.