close

Rules & Presets

Presets provide ready-to-use groups of rules. Add them directly to the flat config array, then use a later rules entry for project-specific overrides.

Available presets

PresetDescriptionView rules
js.configs.recommendedJavaScript recommended rulesView rules →
ts.configs.recommendedTypeScript recommended rulesView rules →
ts.configs.recommendedTypeCheckedTypeScript recommended rules, including typed onesView rules →
ts.configs.strictTypeScript recommended rules plus opinionated extrasView rules →
ts.configs.strictTypeCheckedTypeScript strict rules, including typed onesView rules →
ts.configs.stylisticTypeScript consistency rulesView rules →
ts.configs.stylisticTypeCheckedTypeScript consistency rules, including typed onesView rules →
reactPlugin.configs.recommendedReact rulesView rules →
reactHooksPlugin.configs.recommendedReact Hooks rulesView rules →
importPlugin.configs.recommendedImport/export rulesView rules →
promisePlugin.configs.recommendedPromise rulesView rules →
jestPlugin.configs.recommendedJest rulesView rules →
jestPlugin.configs.styleJest style rulesView rules →
rstestPlugin.configs.recommendedRstest rulesView rules →
unicornPlugin.configs.recommendedUnicorn rulesView rules →
jsxA11yPlugin.configs.recommendedJSX a11y rulesView rules →

Import presets from @rslint/core:

import {
  defineConfig,
  js,
  ts,
  reactPlugin,
  reactHooksPlugin,
  importPlugin,
  promisePlugin,
  jestPlugin,
  rstestPlugin,
  unicornPlugin,
  jsxA11yPlugin,
} from '@rslint/core';

Choosing a TypeScript preset

The ts.configs.* presets mirror typescript-eslint's own layering. Pick one baseline:

BaselineWhat it covers
recommendedRules that catch code likely to be buggy, using syntax alone
recommendedTypeCheckedrecommended plus the rules that read type information
strictrecommended plus opinionated rules that catch more bugs at the cost of more reports
strictTypeCheckedstrict plus the rules that read type information

stylistic and stylisticTypeChecked hold the consistency rules. Layer one after the baseline:

export default defineConfig([
  js.configs.recommended,
  ts.configs.strictTypeChecked,
  ts.configs.stylisticTypeChecked,
]);

Every ts.configs.* preset declares the @typescript-eslint plugin and enables parserOptions.projectService, so the type-checked variants run as-is.

To configure a rule manually, see rules. To enable rules outside a preset, see plugins. The complete Rules reference documents rule-specific options.