For AI agents: the complete documentation index is available at https://rslint.rs/llms.txt, the full documentation bundle is available at https://rslint.rs/llms-full.txt, and this page is available as Markdown at https://rslint.rs/api/configuration/define-config.md.
close

defineConfig

defineConfig is the type-safe identity helper for an Rslint flat config.

See the Configuration overview for the available configuration options and links to their detailed guides.

Example

import { defineConfig, js, ts } from '@rslint/core';

export default defineConfig([
  js.configs.recommended,
  ts.configs.recommended,
  {
    files: ['src/**/*.ts'],
    rules: {
      '@typescript-eslint/no-explicit-any': 'error',
    },
  },
]);

Behavior

The function returns the supplied config unchanged while providing TypeScript autocomplete and validation. A config is an array of entries; a preset that expands to multiple entries can be listed directly.

defineConfig does not load, normalize, flatten, or merge the config. Those operations happen when Rslint loads the exported array.