close

Rules & Presets

Available Presets

PresetDescription
js.configs.recommendedJavaScript recommended rulesView rules →
ts.configs.recommendedTypeScript recommended rules (includes ESLint core rules)View 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 →
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,
  unicornPlugin,
  jsxA11yPlugin,
} from '@rslint/core';

rules

  • Type: Record<string, RuleSeverity | [RuleSeverity, ...options]>

Configure individual rules with a severity level and optional options.

Severity levels:

ValueDescription
"error"Reports as error, causes non-zero exit code
"warn"Reports as warning
"off"Disables the rule

String format (severity only):

rules: {
  '@typescript-eslint/no-explicit-any': 'error',
  '@typescript-eslint/require-await': 'off',
}

Array format (severity + options):

rules: {
  '@typescript-eslint/array-type': ['warn', { default: 'array-simple' }],
  '@typescript-eslint/no-unused-vars': ['error', {
    argsIgnorePattern: '^_',
    varsIgnorePattern: '^_',
  }],
}

plugins

  • Type: string[]

Plugin names to enable. Available plugins:

PluginRules Prefix
@typescript-eslint@typescript-eslint/*
reactreact/*
react-hooksreact-hooks/*
importimport/*
promisepromise/*
jestjest/*
unicornunicorn/*
jsx-a11yjsx-a11y/*

ESLint core rules (e.g. no-unused-vars, prefer-const, no-var) have no prefix and do not belong to any plugin — they can be enabled directly in rules without listing anything in plugins.

Tip

When using JS/TS config with presets (e.g., ts.configs.recommended), plugins are declared within the preset — you don't need to specify them separately.

For a full list of available rules and their options, see the Rules reference.