# Table of Contents - [Rslint](#rslint) - [defineConfig - Rslint](#defineconfig-rslint) - [globalIgnores - Rslint](#globalignores-rslint) - [globals - Rslint](#globals-rslint) - [API overview - Rslint](#api-overview-rslint) - [importPlugin - Rslint](#importplugin-rslint) - [jestPlugin - Rslint](#jestplugin-rslint) - [js - Rslint](#js-rslint) - [jsxA11yPlugin - Rslint](#jsxa11yplugin-rslint) - [promisePlugin - Rslint](#promiseplugin-rslint) - [reactPlugin - Rslint](#reactplugin-rslint) - [rstestPlugin - Rslint](#rstestplugin-rslint) - [reactHooksPlugin - Rslint](#reacthooksplugin-rslint) - [files - Rslint](#files-rslint) - [Configuration overview - Rslint](#configuration-overview-rslint) - [Configuration File - Rslint](#configuration-file-rslint) - [Rslint](#rslint) - [unicornPlugin - Rslint](#unicornplugin-rslint) - [plugins - Rslint](#plugins-rslint) - [ts - Rslint](#ts-rslint) - [ignores - Rslint](#ignores-rslint) - [languageOptions - Rslint](#languageoptions-rslint) - [Rslint - Rslint](#rslint-rslint) - [settings - Rslint](#settings-rslint) - [CI Integration - Rslint](#ci-integration-rslint) - [rules - Rslint](#rules-rslint) --- # Rslint Are you an LLM? View /llms.txt for optimized Markdown documentation, or /llms-full.txt for full documentation bundle. This page is also available as Markdown at /index.md ![background](https://assets.rspack.rs/rspack/assets/landingpage-background-compressed.png) ![logo](https://assets.rspack.rs/rslint/rslint-logo.svg) Rslint ====== The Linter for TypeScript Faster Linting. Type-Aware by Design Quick Start[GitHubGitHub](https://github.com/web-infra-dev/rslint) Rstack ====== The fast, unified JavaScript toolchain for developers and agents [![Rspack](https://assets.rspack.rs/rspack/rspack-logo.svg)\ \ Rspack\ \ A fast Rust-based bundler for the web, with a modernized webpack API\ \ rspack.rs](https://rspack.rs/) [![Rsbuild](https://assets.rspack.rs/rsbuild/rsbuild-logo.svg)\ \ Rsbuild\ \ A fast, extensible build tool for modern web development, powered by Rspack\ \ rsbuild.rs](https://rsbuild.rs/) [![Rslib](https://assets.rspack.rs/rslib/rslib-logo.svg)\ \ Rslib\ \ An Rsbuild-based library development tool for creating libraries and UI components\ \ rslib.rs](https://rslib.rs/) [![Rspress](https://assets.rspack.rs/rspress/rspress-logo-480x480.png)\ \ Rspress\ \ An Rsbuild-based static site generator for creating documentation sites\ \ rspress.rs](https://rspress.rs/) [![Rsdoctor](https://assets.rspack.rs/rsdoctor/rsdoctor-logo-480x480.png)\ \ Rsdoctor\ \ An AI-friendly build analyzer that makes the build process transparent\ \ rsdoctor.rs](https://rsdoctor.rs/) [![Rstest](https://assets.rspack.rs/rstest/rstest-logo.svg)\ \ Rstest\ \ A JavaScript testing framework powered by Rspack, with a Jest-compatible API\ \ rstest.rs](https://rstest.rs/) [![Rslint](https://assets.rspack.rs/rslint/rslint-logo.svg)\ \ Rslint\ \ A high-performance, ESLint-compatible linter for JavaScript and TypeScript\ \ rslint.rs](https://rslint.rs/) --- # defineConfig - Rslint Are you an LLM? View /llms.txt for optimized Markdown documentation, or /llms-full.txt for full documentation bundle. This page is also available as Markdown at /api/configuration/define-config.md MenuON THIS PAGE [#](https://rslint.rs/api/configuration/define-config#defineconfig) defineConfig ================================================================================ Copy Markdown `defineConfig` is the type-safe identity helper for an Rslint flat config. See the [Configuration overview](https://rslint.rs/config/) for the available configuration options and links to their detailed guides. [#](https://rslint.rs/api/configuration/define-config#example) 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',\ },\ },\ ]); [#](https://rslint.rs/api/configuration/define-config#behavior) 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. --- # globalIgnores - Rslint Are you an LLM? View /llms.txt for optimized Markdown documentation, or /llms-full.txt for full documentation bundle. This page is also available as Markdown at /api/configuration/global-ignores.md MenuON THIS PAGE [#](https://rslint.rs/api/configuration/global-ignores#globalignores) globalIgnores =================================================================================== Copy Markdown `globalIgnores` creates a flat-config entry whose patterns apply across the entire configuration. [#](https://rslint.rs/api/configuration/global-ignores#example) Example ----------------------------------------------------------------------- import { defineConfig, globalIgnores, js } from '@rslint/core'; export default defineConfig([\ globalIgnores(['**/dist/**', '**/coverage/**']),\ js.configs.recommended,\ ]); [#](https://rslint.rs/api/configuration/global-ignores#behavior) Behavior ------------------------------------------------------------------------- The returned entry contains only `ignores`, which makes it a global ignore rather than an entry-level ignore. The argument must be a non-empty array; passing another value or an empty array throws a `TypeError`. See the [`ignores`](https://rslint.rs/config/ignoring-files) reference for pattern and traversal semantics. --- # globals - Rslint Are you an LLM? View /llms.txt for optimized Markdown documentation, or /llms-full.txt for full documentation bundle. This page is also available as Markdown at /api/configuration/globals.md MenuON THIS PAGE [#](https://rslint.rs/api/configuration/globals#globals) globals ================================================================ Copy Markdown `globals` exposes the complete environment catalog from the pinned [`globals`](https://www.npmjs.com/package/globals) package. Each environment map is loaded and cached on first property access, so importing `@rslint/core` does not parse the entire catalog. [#](https://rslint.rs/api/configuration/globals#example) Example ---------------------------------------------------------------- import { defineConfig, globals } from '@rslint/core'; export default defineConfig([\ {\ files: ['src/client/**'],\ languageOptions: {\ globals: globals.browser,\ },\ },\ {\ files: ['scripts/**'],\ languageOptions: {\ globals: globals.node,\ },\ },\ ]); [#](https://rslint.rs/api/configuration/globals#composing-environments) Composing environments ---------------------------------------------------------------------------------------------- Compose environments and project-specific names with object spreads: languageOptions: { globals: { ...globals.browser, ...globals.worker, BUILD_ID: 'readonly', }, } Environment values follow the upstream catalog: `false` is read-only and `true` is writable. See [`languageOptions.globals`](https://rslint.rs/config/language-options#languageoptionsglobals) for access values, overrides, and TypeScript interactions. --- # API overview - Rslint Are you an LLM? View /llms.txt for optimized Markdown documentation, or /llms-full.txt for full documentation bundle. This page is also available as Markdown at /api/index.md MenuON THIS PAGE [#](https://rslint.rs/api/#api-overview) API overview ===================================================== Copy Markdown `@rslint/core` provides configuration helpers and presets for authoring flat configs, plus the `Rslint` class for programmatic linting: import { Rslint, defineConfig, globalIgnores, js, ts } from '@rslint/core'; [#](https://rslint.rs/api/#configuration-api) Configuration API --------------------------------------------------------------- Use the configuration exports to compose flat configs without constructing internal loader objects. | API | Description | | --- | --- | | [`defineConfig`](https://rslint.rs/api/configuration/define-config) | Type-safe identity helper for a flat config | | [`globalIgnores`](https://rslint.rs/api/configuration/global-ignores) | Creates a global ignore entry | | [`globals`](https://rslint.rs/api/configuration/globals) | Lazily loaded runtime-global catalog | [#](https://rslint.rs/api/#presets) Presets ------------------------------------------- | API | Presets | | --- | --- | | [`js`](https://rslint.rs/api/presets/js) | JavaScript | | [`ts`](https://rslint.rs/api/presets/ts) | TypeScript baseline, strict, and stylistic variants | | [`reactPlugin`](https://rslint.rs/api/presets/react-plugin) | React | | [`reactHooksPlugin`](https://rslint.rs/api/presets/react-hooks-plugin) | React Hooks | | [`importPlugin`](https://rslint.rs/api/presets/import-plugin) | Imports | | [`promisePlugin`](https://rslint.rs/api/presets/promise-plugin) | Promises | | [`jestPlugin`](https://rslint.rs/api/presets/jest-plugin) | Jest | | [`rstestPlugin`](https://rslint.rs/api/presets/rstest-plugin) | Rstest | | [`unicornPlugin`](https://rslint.rs/api/presets/unicorn-plugin) | Unicorn | | [`jsxA11yPlugin`](https://rslint.rs/api/presets/jsx-a11y-plugin) | JSX accessibility | [#](https://rslint.rs/api/#javascript-api) JavaScript API --------------------------------------------------------- Use the JavaScript API when a Node.js-compatible host needs to invoke Rslint directly. The [JavaScript API guide](https://rslint.rs/guide/js-api) covers common workflows; the reference below documents the complete class surface. | API | Description | | --- | --- | | [`Rslint`](https://rslint.rs/api/rslint) | ESLint-style class for linting files or in-memory source | --- # importPlugin - Rslint Are you an LLM? View /llms.txt for optimized Markdown documentation, or /llms-full.txt for full documentation bundle. This page is also available as Markdown at /api/presets/import-plugin.md MenuON THIS PAGE [#](https://rslint.rs/api/presets/import-plugin#importplugin) importPlugin ========================================================================== Copy Markdown `importPlugin` contains Rslint's bundled import/export preset. import { defineConfig, importPlugin } from '@rslint/core'; export default defineConfig([importPlugin.configs.recommended]); [#](https://rslint.rs/api/presets/import-plugin#presets) Presets ---------------------------------------------------------------- | Preset | Description | View rules | | --- | --- | --- | | `importPlugin.configs.recommended` | Import/export rules | [View rules →](https://rslint.rs/rules/?preset=importPlugin.configs.recommended) | See [Rules & Presets](https://rslint.rs/config/rules-and-presets) for guidance on choosing and layering presets. --- # jestPlugin - Rslint Are you an LLM? View /llms.txt for optimized Markdown documentation, or /llms-full.txt for full documentation bundle. This page is also available as Markdown at /api/presets/jest-plugin.md MenuON THIS PAGE [#](https://rslint.rs/api/presets/jest-plugin#jestplugin) jestPlugin ==================================================================== Copy Markdown `jestPlugin` contains Rslint's bundled Jest presets. import { defineConfig, jestPlugin } from '@rslint/core'; export default defineConfig([\ {\ ...jestPlugin.configs.recommended,\ files: ['**/*.{test,spec}.{js,mjs,jsx,ts,tsx,mts}'],\ },\ ]); `jestPlugin.configs.recommended` does not declare `files`; the example scopes it to test and spec files. [#](https://rslint.rs/api/presets/jest-plugin#presets) Presets -------------------------------------------------------------- | Preset | Description | View rules | | --- | --- | --- | | `jestPlugin.configs.recommended` | Jest rules | [View rules →](https://rslint.rs/rules/?preset=jestPlugin.configs.recommended) | | `jestPlugin.configs.style` | Jest style rules | [View rules →](https://rslint.rs/rules/?preset=jestPlugin.configs.style) | See [Rules & Presets](https://rslint.rs/config/rules-and-presets) for guidance on choosing and layering presets. --- # js - Rslint Are you an LLM? View /llms.txt for optimized Markdown documentation, or /llms-full.txt for full documentation bundle. This page is also available as Markdown at /api/presets/js.md MenuON THIS PAGE [#](https://rslint.rs/api/presets/js#js) js =========================================== Copy Markdown `js` contains Rslint's bundled JavaScript preset. import { defineConfig, js } from '@rslint/core'; export default defineConfig([js.configs.recommended]); [#](https://rslint.rs/api/presets/js#presets) Presets ----------------------------------------------------- | Preset | Description | View rules | | --- | --- | --- | | `js.configs.recommended` | JavaScript recommended rules | [View rules →](https://rslint.rs/rules/?preset=js.configs.recommended) | See [Rules & Presets](https://rslint.rs/config/rules-and-presets) for guidance on choosing and layering presets. --- # jsxA11yPlugin - Rslint Are you an LLM? View /llms.txt for optimized Markdown documentation, or /llms-full.txt for full documentation bundle. This page is also available as Markdown at /api/presets/jsx-a11y-plugin.md MenuON THIS PAGE [#](https://rslint.rs/api/presets/jsx-a11y-plugin#jsxa11yplugin) jsxA11yPlugin ============================================================================== Copy Markdown `jsxA11yPlugin` contains Rslint's bundled JSX accessibility preset. import { defineConfig, jsxA11yPlugin } from '@rslint/core'; export default defineConfig([jsxA11yPlugin.configs.recommended]); [#](https://rslint.rs/api/presets/jsx-a11y-plugin#presets) Presets ------------------------------------------------------------------ | Preset | Description | View rules | | --- | --- | --- | | `jsxA11yPlugin.configs.recommended` | JSX a11y rules | [View rules →](https://rslint.rs/rules/?preset=jsxA11yPlugin.configs.recommended) | See [Rules & Presets](https://rslint.rs/config/rules-and-presets) for guidance on choosing and layering presets. --- # promisePlugin - Rslint Are you an LLM? View /llms.txt for optimized Markdown documentation, or /llms-full.txt for full documentation bundle. This page is also available as Markdown at /api/presets/promise-plugin.md MenuON THIS PAGE [#](https://rslint.rs/api/presets/promise-plugin#promiseplugin) promisePlugin ============================================================================= Copy Markdown `promisePlugin` contains Rslint's bundled Promise preset. import { defineConfig, promisePlugin } from '@rslint/core'; export default defineConfig([promisePlugin.configs.recommended]); [#](https://rslint.rs/api/presets/promise-plugin#presets) Presets ----------------------------------------------------------------- | Preset | Description | View rules | | --- | --- | --- | | `promisePlugin.configs.recommended` | Promise rules | [View rules →](https://rslint.rs/rules/?preset=promisePlugin.configs.recommended) | See [Rules & Presets](https://rslint.rs/config/rules-and-presets) for guidance on choosing and layering presets. --- # reactPlugin - Rslint Are you an LLM? View /llms.txt for optimized Markdown documentation, or /llms-full.txt for full documentation bundle. This page is also available as Markdown at /api/presets/react-plugin.md MenuON THIS PAGE [#](https://rslint.rs/api/presets/react-plugin#reactplugin) reactPlugin ======================================================================= Copy Markdown `reactPlugin` contains Rslint's bundled React preset. import { defineConfig, reactPlugin } from '@rslint/core'; export default defineConfig([reactPlugin.configs.recommended]); [#](https://rslint.rs/api/presets/react-plugin#presets) Presets --------------------------------------------------------------- | Preset | Description | View rules | | --- | --- | --- | | `reactPlugin.configs.recommended` | React rules | [View rules →](https://rslint.rs/rules/?preset=reactPlugin.configs.recommended) | See [Rules & Presets](https://rslint.rs/config/rules-and-presets) for guidance on choosing and layering presets. --- # rstestPlugin - Rslint Are you an LLM? View /llms.txt for optimized Markdown documentation, or /llms-full.txt for full documentation bundle. This page is also available as Markdown at /api/presets/rstest-plugin.md MenuON THIS PAGE [#](https://rslint.rs/api/presets/rstest-plugin#rstestplugin) rstestPlugin ========================================================================== Copy Markdown `rstestPlugin` contains Rslint's bundled Rstest preset. import { defineConfig, rstestPlugin } from '@rslint/core'; export default defineConfig([\ {\ ...rstestPlugin.configs.recommended,\ files: ['**/*.{test,spec}.{js,mjs,jsx,ts,tsx,mts}'],\ },\ ]); `rstestPlugin.configs.recommended` does not declare `files`; the example scopes it to test and spec files. [#](https://rslint.rs/api/presets/rstest-plugin#presets) Presets ---------------------------------------------------------------- | Preset | Description | View rules | | --- | --- | --- | | `rstestPlugin.configs.recommended` | Rstest rules | [View rules →](https://rslint.rs/rules/?preset=rstestPlugin.configs.recommended) | See [Rules & Presets](https://rslint.rs/config/rules-and-presets) for guidance on choosing and layering presets. --- # reactHooksPlugin - Rslint Are you an LLM? View /llms.txt for optimized Markdown documentation, or /llms-full.txt for full documentation bundle. This page is also available as Markdown at /api/presets/react-hooks-plugin.md MenuON THIS PAGE [#](https://rslint.rs/api/presets/react-hooks-plugin#reacthooksplugin) reactHooksPlugin ======================================================================================= Copy Markdown `reactHooksPlugin` contains Rslint's bundled React Hooks preset. import { defineConfig, reactHooksPlugin } from '@rslint/core'; export default defineConfig([reactHooksPlugin.configs.recommended]); [#](https://rslint.rs/api/presets/react-hooks-plugin#presets) Presets --------------------------------------------------------------------- | Preset | Description | View rules | | --- | --- | --- | | `reactHooksPlugin.configs.recommended` | React Hooks rules | [View rules →](https://rslint.rs/rules/?preset=reactHooksPlugin.configs.recommended) | See [Rules & Presets](https://rslint.rs/config/rules-and-presets) for guidance on choosing and layering presets. --- # files - Rslint Are you an LLM? View /llms.txt for optimized Markdown documentation, or /llms-full.txt for full documentation bundle. This page is also available as Markdown at /config/files.md MenuON THIS PAGE [#](https://rslint.rs/config/files#files) files =============================================== Copy Markdown * **Type:** `(string | string[])[]` Glob selectors specifying which files a config entry applies to. Top-level selectors are ORed. Patterns in a nested array are ANDed, so `files: [['**/*.js', '!**/*.test.js']]` selects JavaScript files except test files. { files: ['**/*.ts', '**/*.tsx'], rules: { '@typescript-eslint/no-explicit-any': 'error', }, } If `files` is omitted, the entry cascades across files selected by the config's implicit or explicit selectors. If `files` is present, its outer array must be non-empty. Use an omitted `files` field for shared or default entries; `files: []` is invalid. A nested empty AND group (`files: [[]]`) is valid and matches vacuously. [#](https://rslint.rs/config/files#lint-target-selection) Lint target selection ------------------------------------------------------------------------------- Lint targets are selected from the CLI or API target range and are limited to Rslint's supported script extensions. Rslint always includes its default extension baseline and adds other supported candidates selected by explicit `files` entries unless the same entry's `ignores` excludes them. A `files` selector cannot make an unsupported source extension lintable. The implicit default baseline is: * `.js` * `.mjs` * `.cjs` * `.jsx` * `.ts` * `.tsx` * `.mts` * `.cts` Global ignores then remove targets; CLI and JavaScript API runs also apply `.gitignore`. An entry-level ignore cannot remove a path selected by the baseline or another entry. It only prevents its own selector and config contribution. See [`ignores`](https://rslint.rs/config/ignoring-files) for details. Every selected target is parsed even when no config entry contributes rules, so syntax diagnostics can still be reported. This includes default-baseline files found by a directory or no-argument scan and explicitly requested supported files that do not match a config entry's `files`. [#](https://rslint.rs/config/files#typescript-project-coverage) TypeScript project coverage ------------------------------------------------------------------------------------------- File selection is independent of a tsconfig's `include`. A file in tsconfig but outside Rslint's lint target set will not run lint rules. A selected file not covered by a tsconfig declared by its governing config still runs rules that do not require type information. Tip Selected files not covered by a tsconfig declared by their governing config automatically receive a reduced rule set: only rules that do not require type information run. To enable type-aware rules, add the file to one of that config's tsconfigs. See [`languageOptions.parserOptions.project`](https://rslint.rs/config/language-options#languageoptionsparseroptionsproject) . Relative patterns are resolved from the config file's directory for automatically discovered configs, or from the current working directory when the config is supplied with `--config`. --- # Configuration overview - Rslint Are you an LLM? View /llms.txt for optimized Markdown documentation, or /llms-full.txt for full documentation bundle. This page is also available as Markdown at /config/index.md MenuON THIS PAGE [#](https://rslint.rs/config/#configuration-overview) Configuration overview ============================================================================ Copy Markdown This page lists Rslint's user-facing configuration options. Rslint uses an ESLint-style flat config: the configuration exports an array, and later matching entries override earlier ones. See [Configuration File](https://rslint.rs/config/configuration-file) to create a config, understand config discovery, and learn how entries are merged. [#](https://rslint.rs/config/#configuration-options) Configuration options -------------------------------------------------------------------------- matching [`files`](https://rslint.rs/config/files) [`ignores`](https://rslint.rs/config/ignoring-files) linting [`rules`](https://rslint.rs/config/rules) [`plugins`](https://rslint.rs/config/plugins) [`settings`](https://rslint.rs/config/settings) [languageOptions](https://rslint.rs/config/language-options) [`languageOptions.ecmaVersion`](https://rslint.rs/config/language-options#languageoptionsecmaversion) [`languageOptions.parserOptions.projectService`](https://rslint.rs/config/language-options#languageoptionsparseroptionsprojectservice) [`languageOptions.parserOptions.project`](https://rslint.rs/config/language-options#languageoptionsparseroptionsproject) [`languageOptions.globals`](https://rslint.rs/config/language-options#languageoptionsglobals) --- # Configuration File - Rslint Are you an LLM? View /llms.txt for optimized Markdown documentation, or /llms-full.txt for full documentation bundle. This page is also available as Markdown at /config/configuration-file.md MenuON THIS PAGE [#](https://rslint.rs/config/configuration-file#configuration-file) Configuration File ====================================================================================== Copy Markdown Rslint uses a flat config format (an array of config entries), aligned with ESLint v10. JS/TS configuration files are the recommended approach. [#](https://rslint.rs/config/configuration-file#supported-filenames) Supported filenames ---------------------------------------------------------------------------------------- During automatic discovery, Rslint checks config files in the following order: 1. `rslint.config.js` 2. `rslint.config.mjs` 3. `rslint.config.ts` 4. `rslint.config.mts` Automatic discovery does not consider `.cjs` or `.cts` config files. They can still be selected explicitly with `--config` or API `overrideConfigFile`. [#](https://rslint.rs/config/configuration-file#config-discovery) Config discovery ---------------------------------------------------------------------------------- When you run `rslint`, it searches for a config file by walking **upward** from the target file or directory to the filesystem root. It uses the nearest candidate that loads successfully and falls back to an ancestor when a nearer candidate cannot be loaded. * `rslint src/foo.ts` — searches from `src/` upward * `rslint src/` — searches from `src/` upward * `rslint` (no args) — searches from the current working directory upward In a monorepo, different files can automatically use different config files based on their location: monorepo/ ├── rslint.config.ts ← root config ├── packages/ │ ├── foo/ │ │ ├── rslint.config.ts ← used for files under foo/ │ │ └── src/ │ └── bar/ │ └── src/ ← no config, inherits root When linting from the monorepo root, Rslint automatically discovers all nested configs and applies the nearest one to each file. ### [#](https://rslint.rs/config/configuration-file#global-ignores-and-nested-configs) Global ignores and nested configs For directory or no-argument lint runs, global ignores in a parent config prevent nested configs in ignored directories from contributing lint targets. // monorepo/rslint.config.ts export default defineConfig([\ // Global ignore — blocks directory target discovery in these directories\ { ignores: ['**/fixtures/**', 'e2e/**'] },\ js.configs.recommended,\ ts.configs.recommended,\ ]); With this config, a `rslint.config.ts` inside `e2e/` or any `fixtures/` directory is not used by a root directory traversal. An explicitly named file is still resolved from its nearest config. Tip Only **global ignore entries** (entries containing only `ignores`) block directory target discovery. Entry-level ignores do not affect config discovery. See [`ignores`](https://rslint.rs/config/ignoring-files) for the distinction. You can specify a config file explicitly, which overrides automatic discovery: rslint --config path/to/rslint.config.ts . For automatically discovered configs, relative `files`, `ignores`, and `languageOptions.parserOptions.project` patterns are resolved from the config file's directory. For a config supplied with `--config`, those patterns are resolved from the current working directory. To generate a default config, run: rslint --init [#](https://rslint.rs/config/configuration-file#basic-configuration) Basic configuration ---------------------------------------------------------------------------------------- A typical TypeScript project configuration: import { defineConfig, globalIgnores, js, ts } from '@rslint/core'; export default defineConfig([\ // Files excluded from all rules\ globalIgnores(['**/dist/**', '**/fixtures/**']),\ // Presets with recommended rules\ js.configs.recommended,\ ts.configs.recommended,\ // Custom rule overrides\ {\ rules: {\ '@typescript-eslint/no-unused-vars': 'error',\ '@typescript-eslint/array-type': ['warn', { default: 'array-simple' }],\ },\ },\ ]); Tip When using both JavaScript and TypeScript recommended presets, place `js.configs.recommended` before `ts.configs.recommended`. The TypeScript preset disables ESLint core rules that are handled by TypeScript-aware rules, and later config entries override earlier ones. See the [Configuration overview](https://rslint.rs/config/) for every available option and [Rules & Presets](https://rslint.rs/config/rules-and-presets) for the available presets. [#](https://rslint.rs/config/configuration-file#config-merging) Config merging ------------------------------------------------------------------------------ When multiple config entries match a file, they are merged in array order: 1. **Global ignores** — entries containing only `ignores` remove files from the target set 2. **Selector union** — the implicit default baseline and effective explicit `files` entries decide whether the config selects the file 3. **Files matching** — entries whose explicit `files` patterns don't match are skipped; entries without `files` cascade across the selector union 4. **Entry-level ignores** — matching entries do not select or configure the file, but cannot remove a target selected elsewhere 5. **Rules** — later entries override earlier ones; a severity-only value retains earlier options 6. **Plugins** — union from all matching entries 7. **Settings** — ordinary nested objects merge recursively; arrays and scalar values are replaced 8. **Language options** — ordinary nested objects merge recursively; arrays and scalar values are replaced If no entry matches a selected file, no lint rules run for it, but the file is still parsed and included in the result so parser diagnostics remain visible. This applies to default-baseline files found during directory discovery as well as explicitly requested supported files. Global ignores remove matching targets; CLI and JavaScript API runs apply `.gitignore` as an additional global ignore source. [#](https://rslint.rs/config/configuration-file#json-configuration-deprecated) JSON configuration (deprecated) -------------------------------------------------------------------------------------------------------------- JSON config files (`rslint.json`, `rslint.jsonc`) are deprecated and will be removed in a future version. Run `rslint --init` to automatically migrate your JSON config to a JS/TS config. The migration preserves your custom rules and settings while deduplicating rules already covered by recommended presets. The key difference is that JSON configs automatically enable all core rules and declared plugin rules as `"error"`. JS/TS configs only enable rules explicitly declared in presets or the [`rules`](https://rslint.rs/config/rules) field. --- # Rslint Are you an LLM? View /llms.txt for optimized Markdown documentation, or /llms-full.txt for full documentation bundle. This page is also available as Markdown at /playground/index.md --- # unicornPlugin - Rslint Are you an LLM? View /llms.txt for optimized Markdown documentation, or /llms-full.txt for full documentation bundle. This page is also available as Markdown at /api/presets/unicorn-plugin.md MenuON THIS PAGE [#](https://rslint.rs/api/presets/unicorn-plugin#unicornplugin) unicornPlugin ============================================================================= Copy Markdown `unicornPlugin` contains Rslint's bundled Unicorn preset. import { defineConfig, unicornPlugin } from '@rslint/core'; export default defineConfig([unicornPlugin.configs.recommended]); [#](https://rslint.rs/api/presets/unicorn-plugin#presets) Presets ----------------------------------------------------------------- | Preset | Description | View rules | | --- | --- | --- | | `unicornPlugin.configs.recommended` | Unicorn rules | [View rules →](https://rslint.rs/rules/?preset=unicornPlugin.configs.recommended) | See [Rules & Presets](https://rslint.rs/config/rules-and-presets) for guidance on choosing and layering presets. --- # plugins - Rslint Are you an LLM? View /llms.txt for optimized Markdown documentation, or /llms-full.txt for full documentation bundle. This page is also available as Markdown at /config/plugins.md MenuON THIS PAGE [#](https://rslint.rs/config/plugins#plugins) plugins ===================================================== Copy Markdown * **Type:** `string[] | Record` Enables plugins for a config entry. Rslint accepts either an array of built-in plugin names or an object containing third-party ESLint plugin instances. [#](https://rslint.rs/config/plugins#built-in-plugins) Built-in plugins ----------------------------------------------------------------------- Use the array form for plugins whose rules are implemented natively by Rslint. A name declares a rule namespace; its rules become available under the `/` prefix inside [`rules`](https://rslint.rs/config/rules) . | Plugin | Rules Prefix | | --- | --- | | `@typescript-eslint` | `@typescript-eslint/*` | | `react` | `react/*` | | `react-hooks` | `react-hooks/*` | | `import` | `import/*` | | `promise` | `promise/*` | | `jest` | `jest/*` | | `rstest` | `rstest/*` | | `unicorn` | `unicorn/*` | | `jsx-a11y` | `jsx-a11y/*` | { files: ['**/*.ts'], plugins: ['@typescript-eslint'], rules: { '@typescript-eslint/no-explicit-any': 'error', }, } ESLint core rules, such as `no-unused-vars` or `prefer-const`, are not part of a plugin. Enable them directly in `rules` without listing anything here. Presets such as `ts.configs.recommended` already include their own `plugins` entry, so this field is only needed when configuring plugin rules outside a preset. [#](https://rslint.rs/config/plugins#third-party-eslint-plugins) Third-party ESLint plugins ------------------------------------------------------------------------------------------- Use the object form to map a prefix to an imported plugin object. These JavaScript rules run in the Node plugin worker and are routed through the same per-file flat config as native rules. This form requires a JS/TS config because JSON cannot carry a live plugin object. import examplePlugin from 'eslint-plugin-example'; export default defineConfig([\ {\ files: ['**/*.ts'],\ plugins: { example: examplePlugin },\ rules: {\ 'example/some-rule': 'error',\ },\ },\ ]); A single entry uses one plugin form. To combine built-in and third-party plugins, declare them in separate config entries; matching entries are merged before linting. A third-party prefix may not collide with a built-in plugin name. See [ESLint plugin compatibility](https://rslint.rs/guide/eslint-plugins) for the supported and unsupported ESLint APIs. --- # ts - Rslint Are you an LLM? View /llms.txt for optimized Markdown documentation, or /llms-full.txt for full documentation bundle. This page is also available as Markdown at /api/presets/ts.md MenuON THIS PAGE [#](https://rslint.rs/api/presets/ts#ts) ts =========================================== Copy Markdown `ts` contains Rslint's bundled TypeScript baseline, type-checked, strict, and stylistic presets. import { defineConfig, ts } from '@rslint/core'; export default defineConfig([ts.configs.recommended]); `ts.configs.base` is setup-only, enables no rules, and is already included by every other TypeScript preset. [#](https://rslint.rs/api/presets/ts#presets) Presets ----------------------------------------------------- | Preset | Description | View rules | | --- | --- | --- | | `ts.configs.base` | Declares the TypeScript plugin and enables project service | — | | `ts.configs.recommended` | TypeScript recommended rules | [View rules →](https://rslint.rs/rules/?preset=ts.configs.recommended) | | `ts.configs.recommendedTypeChecked` | TypeScript recommended rules, including typed ones | [View rules →](https://rslint.rs/rules/?preset=ts.configs.recommendedTypeChecked) | | `ts.configs.strict` | TypeScript recommended rules plus opinionated extras | [View rules →](https://rslint.rs/rules/?preset=ts.configs.strict) | | `ts.configs.strictTypeChecked` | TypeScript strict rules, including typed ones | [View rules →](https://rslint.rs/rules/?preset=ts.configs.strictTypeChecked) | | `ts.configs.stylistic` | TypeScript consistency rules | [View rules →](https://rslint.rs/rules/?preset=ts.configs.stylistic) | | `ts.configs.stylisticTypeChecked` | TypeScript consistency rules, including typed ones | [View rules →](https://rslint.rs/rules/?preset=ts.configs.stylisticTypeChecked) | `ts.configs.base` has no filtered rules view. Add one baseline and optionally one stylistic layer; you normally do not need to add `ts.configs.base` separately. See [Rules & Presets](https://rslint.rs/config/rules-and-presets) for guidance on choosing and layering presets. --- # ignores - Rslint Are you an LLM? View /llms.txt for optimized Markdown documentation, or /llms-full.txt for full documentation bundle. This page is also available as Markdown at /config/ignoring-files.md MenuON THIS PAGE [#](https://rslint.rs/config/ignoring-files#ignores) ignores ============================================================ Copy Markdown * **Type:** `string[]` Glob patterns for files to exclude. The behavior depends on whether `ignores` appears in a global ignore entry or alongside other configuration fields. [#](https://rslint.rs/config/ignoring-files#global-and-entry-level-ignores) Global and entry-level ignores ---------------------------------------------------------------------------------------------------------- An entry containing **only** `ignores` acts as a global ignore: matching files are removed from the lint target set. An entry-level ignore prevents that entry's `files` selector, rules, and options from contributing. It cannot remove a path selected by the default extension baseline or another entry, so such a path may still receive configuration or a zero-rule syntax pass. // Global ignore entry { ignores: ['**/dist/**', '**/fixtures/**'], } // Entry-level ignore (only applies to this entry) { files: ['**/*.ts'], ignores: ['**/*.test.ts'], rules: { /* ... */ }, } [#](https://rslint.rs/config/ignoring-files#the-globalignores-helper) The `globalIgnores` helper ------------------------------------------------------------------------------------------------ Writing an entry with only `ignores` is common enough that `@rslint/core` exports a `globalIgnores` helper, mirroring ESLint v10. It returns a config entry containing just the given patterns, so the global-ignore intent is explicit: import { defineConfig, globalIgnores } from '@rslint/core'; export default defineConfig([\ globalIgnores(['**/dist/**', '**/fixtures/**']),\ // ... other entries\ ]); This is exactly equivalent to writing the entry by hand: { ignores: ['**/dist/**', '**/fixtures/**'], } `globalIgnores` throws a `TypeError` if it receives a non-array or an empty array. [#](https://rslint.rs/config/ignoring-files#pattern-types-in-global-ignores) Pattern types in global ignores ------------------------------------------------------------------------------------------------------------ Global ignore patterns affect both file matching and directory traversal (including config discovery in monorepos): | Pattern | Effect | | --- | --- | | `dir/**` | Ignores directory and all contents, blocks traversal | | `dir/**/*` | Ignores files inside, but allows directory traversal | | `dir/*` | Ignores direct children files only | Use `dir/**` to completely exclude a directory. Use `dir/**/*` when the walker must still enter the directory so later negations can make selected files or config candidates reachable. An automatically discovered `rslint.config.*` that still matches the file-cover ignore is not loaded; explicitly negate that candidate when you want it to become a config boundary. You can use `!` negation patterns to re-include specific files. Patterns are evaluated sequentially — later patterns override earlier ones: // Global ignore: re-include specific file { ignores: ['build/**/*', '!build/test.js'], } // Entry-level ignore: re-include a subdirectory { files: ['**/*.ts'], ignores: ['vendor/**/*', '!vendor/keep/**/*'], rules: { /* ... */ }, } // Across separate global ignore entries { ignores: ['build/**/*'] }, { ignores: ['!build/test.js'] }, Warning For directory-level patterns (`dir/**`), `!` negation cannot re-include files because the directory traversal is blocked entirely. Use `dir/**/*` instead if you need negation: // ✅ dir/**/* allows traversal — negation works { ignores: ['build/**/*', '!build/test.js'], } // ❌ dir/** blocks traversal — negation has no effect { ignores: ['build/**', '!build/test.js'], } Tip `node_modules` and `.git` are automatically excluded by rslint — you don't need to add them to ignores. [#](https://rslint.rs/config/ignoring-files#gitignore-integration) .gitignore integration ----------------------------------------------------------------------------------------- The CLI, JavaScript API, and LSP automatically read `.gitignore` files and treat their patterns as additional global ignores. Collection starts at the directory of the governing rslint config and never searches its parents. In a multi-config repository, a child config starts a new `.gitignore` scope, so put package-specific ignores beside that package's config. In the editor, saved `.gitignore` changes refresh diagnostics for open files. * **Nested `.gitignore` files** inside one config-owned tree are supported — each one only affects its own directory subtree * **Parent patterns cascade** to child directories within that tree (e.g., root `dist/` also ignores `packages/app/dist/` when both use the root config) * **Child `.gitignore` can override** parent patterns with `!` negation * **Child configs are boundaries** — they do not inherit `.gitignore` files from a parent config directory * Config `!` negation can also override `.gitignore` patterns (they are evaluated sequentially in the same global ignores list) # .gitignore dist/ coverage/ *.log # packages/app/.gitignore !dist/ # re-include dist/ under packages/app/ To make a lint target reachable, re-include it in the applicable `.gitignore` policy or with a later global ignore entry in `rslint.config.*`: # .gitignore dist/* !dist/important.ts Configuration discovery is independent of `.gitignore`: an automatically discovered or explicitly selected `rslint.config.*` is still loaded when its path matches an ignore rule. `.gitignore` is applied later, when Go selects lint targets inside that config's ownership scope. --- # languageOptions - Rslint Are you an LLM? View /llms.txt for optimized Markdown documentation, or /llms-full.txt for full documentation bundle. This page is also available as Markdown at /config/language-options.md MenuON THIS PAGE [#](https://rslint.rs/config/language-options#languageoptions) languageOptions ============================================================================== Copy Markdown * **Type:** `object` Configures the JavaScript language environment and TypeScript project information for matching files. Nested language options from matching entries merge recursively; later arrays and scalar values replace earlier values. [#](https://rslint.rs/config/language-options#languageoptionsecmaversion) languageOptions.ecmaVersion ----------------------------------------------------------------------------------------------------- * **Type:** `number | 'latest'` * **Default:** `'latest'` Selects the standard ECMAScript globals exposed to native rules. Accepted numbers match ESLint and Espree: `3`, `5`, edition aliases `6` through `17`, or years `2015` through `2026`. Edition aliases are normalized to their year (`6` is ES2015 and `17` is ES2026). The `'latest'` value remains semantic rather than being frozen into the config, so it follows the ESLint version targeted by Rslint. This option currently selects globals; it does not change TypeScript's parser target. { languageOptions: { ecmaVersion: 'latest', }, } [#](https://rslint.rs/config/language-options#languageoptionsparseroptionsprojectservice) languageOptions.parserOptions.projectService -------------------------------------------------------------------------------------------------------------------------------------- * **Type:** `boolean` Enables TypeScript's project service for automatic tsconfig discovery. This is the default in `ts.configs.recommended`. { languageOptions: { parserOptions: { projectService: true, }, }, } [#](https://rslint.rs/config/language-options#languageoptionsparseroptionsproject) languageOptions.parserOptions.project ------------------------------------------------------------------------------------------------------------------------ * **Type:** `string | string[]` Specifies explicit `tsconfig.json` paths. Glob patterns are supported for monorepos. Files included by these tsconfigs receive full type information, enabling type-aware rules such as `@typescript-eslint/no-floating-promises` and `@typescript-eslint/await-thenable`. Files outside all tsconfigs are still linted, but only rules that do not require type information run. { languageOptions: { parserOptions: { project: ['./tsconfig.json', './packages/*/tsconfig.json'], }, }, } Relative project patterns are resolved from the config file's directory for automatically discovered configs, or from the current working directory when the config is supplied with `--config`. [#](https://rslint.rs/config/language-options#languageoptionsglobals) languageOptions.globals --------------------------------------------------------------------------------------------- * **Type:** `Record` Declares globals available to matching files. Values are normalized before rules or third-party plugins receive the scope: * Writable: `true`, `'true'`, `'writable'`, `'writeable'` * Read-only: `false`, `null`, `'false'`, `'readonly'`, `'readable'` * Disabled: `'off'` A disabled value removes a declaration inherited from an earlier matching entry, including an ECMAScript built-in. The read-only and writable levels are distinct wherever a rule acts on assignment: `no-global-assign` reports writes to a read-only global and allows them on a writable one. { languageOptions: { globals: { BUILD_ID: 'readonly', testRuntime: 'writable', }, }, } ECMAScript built-ins are declared according to `languageOptions.ecmaVersion` (`Array` from ES3, `Promise` from ES2015, and so on). Globals added by a runtime — `window` and `document` in browsers, or `process` and `__dirname` in Node.js — are not enabled by default. `@rslint/core` includes the [`globals`](https://www.npmjs.com/package/globals) catalog and exports its environment maps directly, so no extra dependency is required: import { defineConfig, globals } from '@rslint/core'; export default defineConfig([\ {\ files: ['**/*.js'],\ languageOptions: {\ globals: {\ ...globals.browser,\ BUILD_ID: 'readonly',\ },\ },\ },\ ]); The export has the same set names, global names, and boolean access values as importing the npm package directly: `false` means read-only and `true` means writable. In the published package, each set is synchronously loaded and cached the first time its property is read, so importing `@rslint/core` does not parse the complete catalog. Compose multiple environments with ordinary object spreads; later spreads and explicit properties take precedence: languageOptions: { globals: { ...globals.browser, ...globals.worker, location: 'off', }, } `globals.node` includes the CommonJS globals (`require`, `module`, `exports`, `__dirname`, and `__filename`); use `globals.nodeBuiltin` for Node.js ESM files that should not receive them. The included catalog also exposes the upstream `builtin`, `es3`, `es5`, and `es20xx` maps for API parity, but `languageOptions.ecmaVersion` is the preferred way to select standard-language globals because it keeps parsing and both rule runtimes on the same edition. Every map is an explicit globals declaration. It does not change the parser edition, and it can intentionally override the edition-derived set. For example, an upstream host map containing `Temporal` declares that name even when `ecmaVersion` is `2025`. Loaded maps are shared and cached, so compose and override them with object spreads instead of mutating `globals.browser` or another map in place. Enumerating only `Object.keys(globals)` remains lazy; reading or spreading the complete `globals` object necessarily loads every map. Flat config continues to merge individual global names in matching-entry order. Scope environment maps with `files`, and use a later explicit `{ process: 'off' }` when one inherited global must be removed. Tip TypeScript's compiler and type-aware rules can resolve declarations from `lib.dom.d.ts`, `@types/node`, and project `.d.ts` files. ESLint-compatible global rules such as `no-undef` and `no-global-assign` intentionally use the flat config's globals instead of TypeScript ambient declarations. The TypeScript presets disable `no-undef`; if you enable such a global rule for TypeScript files, configure their runtime environments too. --- # Rslint - Rslint Are you an LLM? View /llms.txt for optimized Markdown documentation, or /llms-full.txt for full documentation bundle. This page is also available as Markdown at /api/rslint.md MenuON THIS PAGE [#](https://rslint.rs/api/rslint#rslint) Rslint =============================================== Copy Markdown The `Rslint` class is the ESLint-style programmatic API for linting files and in-memory source from a JavaScript host. class Rslint { constructor(options?: RslintOptions); lintFiles(patterns: string | string[]): Promise; lintText( code: string, options?: { filePath?: string }, ): Promise; static outputFixes(results: LintResult[]): Promise; close(): Promise; [Symbol.asyncDispose](): Promise; } It is designed for Node.js-compatible runtimes that can load npm packages and provide filesystem, process, and child-process APIs. [#](https://rslint.rs/api/rslint#getting-started) Getting started ----------------------------------------------------------------- import { Rslint } from '@rslint/core'; const rslint = new Rslint(); try { const results = await rslint.lintFiles(['src/**/*.ts']); for (const result of results) { console.log(result.filePath, result.errorCount, result.warningCount); } } finally { await rslint.close(); } Both `lintFiles` and `lintText` return ESLint-shaped `LintResult[]` values. [#](https://rslint.rs/api/rslint#constructor) Constructor --------------------------------------------------------- const rslint = new Rslint(options); | Option | Type | Default | Description | | --- | --- | --- | --- | | `cwd` | `string` | `process.cwd()` | Base directory for config discovery and relative path resolution | | `overrideConfig` | `RslintConfigEntry \| RslintConfig \| null` | — | Extra config appended after the discovered or explicitly selected config | | `overrideConfigFile` | `string \| true \| null` | `null` | A config path disables discovery; `true` uses only `overrideConfig`; `null` or omission enables automatic discovery | | `fix` | `boolean` | `false` | Applies auto-fixes and includes changed source in `result.output` | | `virtualFiles` | `Record` | — | In-memory path-to-content overlay for project inputs; unresolved reads may still fall back to disk | With automatic discovery, Go selects each file's nearest config and owns ignore and target-admission semantics. The JavaScript host evaluates and normalizes the JS or TS config modules selected for that run. Warning Object-form community plugins are not supported in `overrideConfig`, because a plugin worker cannot re-import an in-memory plugin object. Put community plugin declarations in a JS or TS config file. Array-form built-in plugins work in `overrideConfig`. See [Configuration File](https://rslint.rs/config/configuration-file) for config discovery and flat-config behavior. [#](https://rslint.rs/api/rslint#lintfiles) lintFiles ----------------------------------------------------- lintFiles(patterns: string | string[]): Promise Lints files matched by one or more glob patterns resolved against `cwd`. const results = await rslint.lintFiles([\ 'src/**/*.ts',\ 'test/**/*.ts',\ '!test/fixtures/**',\ ]); Supported files excluded by global config ignores or `.gitignore` are omitted. With automatic discovery, files in different monorepo packages can use different nearest configs. Results are ordered by file path rather than glob-walk order. If no file matches, `lintFiles` returns an empty array. This differs from ESLint v10's default `errorOnUnmatchedPattern` behavior, which throws for an unmatched glob. [#](https://rslint.rs/api/rslint#linttext) lintText --------------------------------------------------- lintText( code: string, options?: { filePath?: string }, ): Promise Lints an in-memory string as if it lived at `filePath`. const [result] = await rslint.lintText('const answer: number = 42;', { filePath: 'src/example.ts', }); The method returns the result for the supplied buffer. When `filePath` is omitted, Rslint uses a synthetic TypeScript path for matching and reports the result path as the `""` sentinel. A supplied path is resolved against `cwd` and returned as an absolute path. Line, column, and fix offsets match ESLint's byte-order-mark behavior: a leading byte order mark is not included in indexed source text, while fixed whole-file output preserves it unless a fix removes it. [#](https://rslint.rs/api/rslint#in-memory-projects) In-memory projects ----------------------------------------------------------------------- `lintText` normally discovers config and TypeScript project files from disk. To provide the config, tsconfig, and project files from memory, combine `overrideConfigFile: true`, `overrideConfig`, and `virtualFiles`: const rslint = new Rslint({ cwd: '/', overrideConfigFile: true, overrideConfig: [\ {\ files: ['**/*.ts'],\ languageOptions: {\ parserOptions: { project: ['./tsconfig.json'] },\ },\ plugins: ['@typescript-eslint'],\ rules: {\ '@typescript-eslint/no-for-in-array': 'error',\ },\ },\ ], virtualFiles: { 'tsconfig.json': JSON.stringify({ compilerOptions: { strict: true }, files: ['./a.ts'], }), }, }); const [result] = await rslint.lintText( 'const a = [1];\nfor (const key in a) {}\n', { filePath: 'a.ts' }, ); `virtualFiles` is an overlay, not a filesystem sandbox. Rslint can still read from disk for `.gitignore`, module resolution, and files absent from the map. Use relative `virtualFiles` keys and relative paths inside the tsconfig and `parserOptions.project`; they are resolved against `cwd` consistently across operating systems. Prefer an explicit tsconfig `files` list because a broad `include` glob is expanded against the real filesystem. TypeScript project data is only necessary for rules that require type information. A configuration containing only syntax-based rules does not need a tsconfig or `parserOptions.project`. [#](https://rslint.rs/api/rslint#outputfixes) outputFixes --------------------------------------------------------- static outputFixes(results: LintResult[]): Promise Writes the `output` of fixed results back to disk. const rslint = new Rslint({ fix: true }); const results = await rslint.lintFiles(['src/**/*.ts']); await Rslint.outputFixes(results); Only results with a string `output` and an absolute `filePath` are written. The non-absolute `""` result from `lintText` without a path is skipped automatically. To apply fixes in memory, read `result.output` and do not call `outputFixes`: const source = 'let value = input!!.name;'; const [result] = await rslint.lintText(source, { filePath: 'example.ts' }); const fixed = result.output ?? source; Individual auto-fix edits are available through `result.messages[].fix`. Suggestions are exposed separately in `result.messages[].suggestions` and are never applied by `fix: true`. [#](https://rslint.rs/api/rslint#close) close --------------------------------------------- close(): Promise Stops the long-lived Rslint engine process owned by this instance. One-off scripts can exit without calling `close()` because the idle child process does not keep the event loop alive. Long-running editors, build tools, and watch processes should close instances they no longer need. Calling `close()` more than once waits on the same shutdown operation. [#](https://rslint.rs/api/rslint#symbolasyncdispose) Symbol.asyncDispose ------------------------------------------------------------------------ `Rslint` implements the asynchronous disposable protocol, so a compatible toolchain can close it automatically: await using rslint = new Rslint(); await rslint.lintFiles(['src/**/*.ts']); Native `await using` requires runtime support for explicit resource management. TypeScript 5.2 or newer can transform the syntax for older runtimes; otherwise use `try` / `finally` and call `close()` directly. --- # settings - Rslint Are you an LLM? View /llms.txt for optimized Markdown documentation, or /llms-full.txt for full documentation bundle. This page is also available as Markdown at /config/settings.md MenuON THIS PAGE [#](https://rslint.rs/config/settings#settings) settings ======================================================== Copy Markdown * **Type:** `Record` Provides shared settings to all rules in a matching config entry. Native rules and compatible third-party ESLint rules can read these values from their rule context. { files: ['**/*.tsx'], settings: { react: { version: 'detect', }, 'jsx-a11y': { polymorphicPropName: 'as', }, }, } When multiple matching entries provide `settings`, ordinary nested objects are merged recursively. Later arrays and scalar values replace earlier values. export default defineConfig([\ {\ settings: {\ react: { version: 'detect', runtime: 'automatic' },\ },\ },\ {\ files: ['legacy/**'],\ settings: {\ // Keeps version and replaces runtime for matching files.\ react: { runtime: 'classic' },\ },\ },\ ]); --- # CI Integration - Rslint Are you an LLM? View /llms.txt for optimized Markdown documentation, or /llms-full.txt for full documentation bundle. This page is also available as Markdown at /guide/ci-integration.md MenuON THIS PAGE [#](https://rslint.rs/guide/ci-integration#ci-integration) CI Integration ========================================================================= Copy Markdown [#](https://rslint.rs/guide/ci-integration#github-actions) GitHub Actions ------------------------------------------------------------------------- Use `--format github` to get inline annotations on pull request diffs: name: Lint on: [push, pull_request] jobs: lint: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: node-version: 22 - run: npm ci - run: npx rslint --format github . Rslint auto-detects the `GITHUB_ACTIONS` environment variable and enables colored output in CI. [#](https://rslint.rs/guide/ci-integration#other-ci-environments) Other CI Environments --------------------------------------------------------------------------------------- # Fail on any error npx rslint . # Lint with type checking npx rslint --type-check . # Fail on errors or if warnings exceed threshold npx rslint --max-warnings 10 . # Report errors only (cleaner CI logs) npx rslint --quiet . --- # rules - Rslint Are you an LLM? View /llms.txt for optimized Markdown documentation, or /llms-full.txt for full documentation bundle. This page is also available as Markdown at /config/rules.md MenuON THIS PAGE [#](https://rslint.rs/config/rules#rules) rules =============================================== Copy Markdown * **Type:** `Record` * **RuleSeverity:** `'off' | 'warn' | 'error' | 0 | 1 | 2` Configures individual rules with a severity level and optional positional options. | Value | Description | | --- | --- | | `"error"`, `2` | Reports as an error; causes non-zero exit | | `"warn"`, `1` | Reports as a warning | | `"off"`, `0` | Disables the rule | Use a severity directly when a rule has no options to configure: { rules: { '@typescript-eslint/no-explicit-any': 'error', '@typescript-eslint/require-await': 'off', }, } Use an array to pass every item after the severity to the rule as a positional option: { rules: { '@typescript-eslint/array-type': ['warn', { default: 'array-simple' }], '@typescript-eslint/no-unused-vars': [\ 'error',\ {\ argsIgnorePattern: '^_',\ varsIgnorePattern: '^_',\ },\ ], }, } Invalid severities and rule value shapes are rejected while the configuration is loaded. [#](https://rslint.rs/config/rules#merging) Merging --------------------------------------------------- Later matching config entries override earlier entries. When a later entry changes only the severity, the rule keeps options from the earlier entry. Supplying any positional option in the later array replaces all earlier options. export default defineConfig([\ {\ rules: {\ '@typescript-eslint/no-unused-vars': ['error', { args: 'all' }],\ },\ },\ {\ files: ['tests/**'],\ rules: {\ // Keeps { args: 'all' } while changing the severity.\ '@typescript-eslint/no-unused-vars': 'warn',\ },\ },\ ]); See [Rules & Presets](https://rslint.rs/config/rules-and-presets) for preset selection, or browse the complete [Rules](https://rslint.rs/rules/) reference for rule-specific options. ---