# Configuration

HTML: [altophp.com/rst/linting/configuration](https://altophp.com/rst/linting/configuration/)

`LintConfig` is an immutable collection keyed by each rule's stable code.

```php
use Alto\Rst\Lint\LintConfig;
use Alto\Rst\Lint\Rule\IndentationRule;
use Alto\Rst\Lint\Rule\MaxLineLengthRule;

$config = LintConfig::recommended()
    ->withoutRule('lint/american-english')
    ->withRule(new IndentationRule(2))
    ->withRule(new MaxLineLengthRule(100));
```

`withRule()` adds or replaces a rule with the same code. `withoutRule()`
ignores an unknown code. This makes package and application policies easy to
derive without mutable global configuration.

Pass the active profile to `Linter::lint()` when profile extensions contribute
rules. An extension rule replaces a configured rule with the same code, making
the effective set deterministic.

See [Rules](https://altophp.com/rst/linting/rules.md) for built-in codes and [Custom rules](https://altophp.com/rst/linting/custom.md) for the
three rule contracts.

---

Previous: [Linting](https://altophp.com/rst/linting.md)
Next: [Fixes](https://altophp.com/rst/linting/fixes.md)

---

ALTO\RST: [altophp.com/rst](https://altophp.com/rst/)
ALTO(PHP): [altophp.com](https://altophp.com/)
