R

@robonen/eslint

Composable ESLint flat-config presets — assemble a linting setup from small, focused building blocks instead of one monolithic config.

Modern ESLint flat config is just an ordered array of config objects, but wiring up plugins, parsers, and rule sets by hand is repetitive and easy to get wrong. @robonen/eslint ships a curated set of presets — base, typescript, vue, vitest, imports, node, regexp, and stylistic — and a single compose() helper that flattens them into one config array. Pick the presets your project needs, layer your own overrides on top, and you have a consistent, type-safe lint setup in a few lines.

Composable presets

Mix and match focused presets per language and tool. Each preset is a plain flat-config array — no magic, no hidden state.

Override-friendly

Append inline config objects after presets. Later entries win, exactly as ESLint flat-config semantics intend.

Conditional by design

compose() skips false/null/undefined entries, so feature flags and conditional spreads just work.

Typed flat config

Exported FlatConfig and Rules types give you editor autocomplete and type-checked overrides in eslint.config.ts.

Install

Install the package alongside ESLint and jiti (so ESLint can load a TypeScript eslint.config.ts).

sh
pnpm add -D @robonen/eslint eslint jiti

Usage

Create eslint.config.ts in your project root and compose the presets you want:

ts
import { compose, base, typescript, vue, vitest, imports } from '@robonen/eslint';

// eslint.config.ts
export default compose(base, typescript, vue, vitest, imports);

Add inline config objects after the presets to tweak rules — later entries override earlier ones:

ts
import { compose, base, typescript } from '@robonen/eslint';

export default compose(base, typescript, {
  // later entries override earlier ones
  rules: { 'no-console': 'off' },
});

Where to next

  • compose — flatten presets and overrides into one config array.
  • base — core ESLint, unicorn, regexp rules and global ignores.
  • typescript and vue — language presets for TS and Vue 3 SFCs.
  • Read the guide sections below for the full preset table and migration notes from @robonen/oxlint.

@robonen/eslint

Composable ESLint flat-config presets.

Install

pnpm install -D @robonen/eslint eslint jiti

jiti lets ESLint load a TypeScript eslint.config.ts.

Usage

Create eslint.config.ts in your project root:

import { compose, base, typescript, vue, vitest, imports } from '@robonen/eslint';

export default compose(base, typescript, vue, vitest, imports);

Append custom config objects after presets to override them:

import { compose, base, typescript } from '@robonen/eslint';

export default compose(base, typescript, {
  rules: { 'no-console': 'off' },
}, {
  files: ['**/*.vue'],
  rules: { '@stylistic/no-multiple-empty-lines': 'off' },
});

Presets

Preset Plugin(s) Description
base @eslint/js, eslint-plugin-unicorn Core eslint + unicorn rules, global ignores
typescript typescript-eslint TypeScript rules (**/*.ts, **/*.vue)
vue eslint-plugin-vue Vue 3 Composition API / <script setup> rules
vitest @vitest/eslint-plugin Test file rules
imports eslint-plugin-import-x Import rules (cycles, duplicates, ordering)
node eslint-plugin-n Node.js-specific rules
stylistic @stylistic/eslint-plugin Formatting rules

ignores is also exported on its own if you only want the global ignore list.

Migrating from @robonen/oxlint

This package replaces @robonen/oxlint. The preset names and intent are preserved, with these mapping notes:

  • eslint/* rules → ESLint core rules (no prefix), e.g. eslint/no-consoleno-console.
  • typescript/*@typescript-eslint/*.
  • import/*import-x/* (via eslint-plugin-import-x).
  • node/*n/* (via eslint-plugin-n).
  • @stylistic/* and unicorn/* are unchanged.
  • oxc/* rules are oxc-exclusive and have no ESLint equivalent; they are dropped. Their intent is largely covered by @eslint/js recommended and unicorn.
  • categories/env/ignorePatterns (oxlint config keys) are replaced by flat config equivalents: @eslint/js recommended, languageOptions.globals, and the ignores preset.

API

compose(...configs): FlatConfigArray

Flattens presets (arrays) and inline overrides (single objects) into one ordered flat config array. Later entries override earlier ones — ESLint flat-config semantics. Falsy entries (false/null/undefined) are skipped, enabling conditional composition.

Sections