> For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt.

# lint

The `rs lint` command uses [Rslint](https://rslint.rs/guide/) to lint source code.

## Usage

```bash
rs lint [options] [files...]
```

The command loads the lint configuration registered with [`define.lint()`](/guide/configuration.md#define-lint).

## Options

`rs lint` supports the same command-line options as Rslint. See the [Rslint CLI documentation](https://rslint.rs/guide/cli) for details.

Examples:

```bash
# Lint a specific directory
rs lint src

# Automatically fix problems
rs lint --fix

# Lint and run TypeScript type checking
rs lint --type-check
```

## Configuration

Configure linting through [`define.lint()`](/guide/configuration.md#define-lint) in the [Rstack configuration file](/guide/configuration.md#configuration-file). It accepts the standard [Rslint configuration](https://rslint.rs/config/). A configuration function receives all exports from `rstack/lint`, so presets and plugins do not need to be imported manually:

```ts title="rstack.config.ts"
import { define } from 'rstack';

define.lint(({ js, ts }) => [
  js.configs.recommended,
  ts.configs.recommendedTypeChecked,
]);
```

## Typed linting

Type-aware presets such as `ts.configs.recommendedTypeChecked` apply only to files included by a `tsconfig.json`. In a monorepo, list the project `tsconfig.json` files through Rslint's [`parserOptions.project`](https://rslint.rs/config/language-options#languageoptionsparseroptionsproject). See [Root configuration](/guide/monorepo.md#root-configuration) for an example.
