Skip to content

Commit

Permalink
chore: update website docs
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshuaKGoldberg committed Apr 8, 2022
1 parent 903247f commit b237870
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 6 deletions.
54 changes: 54 additions & 0 deletions docs/linting/PRESETS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
---
id: presets
sidebar_label: Presets
title: Presets
---

`@typescript-eslint/eslint-plugin` includes three rulesets you can extend from to pull in the recommended starting rules.

### `plugin:@typescript-eslint/recommended`

Recommended rules for code correctness that you can drop in without additional configuration.
We strongly recommend all TypeScript projects extend from this preset.

This preset is considered "stable": rule additions and removals will only be done in major version bumps.

```json
{
"extends": ["plugin:@typescript-eslint/recommended"]
}
```

### `plugin:@typescript-eslint/recommended-requiring-type-checking`

```json
{
"extends": [
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking"
]
}
```

Additional recommended rules that require type information.
We recommend all TypeScript projects extend from this preset, with the caveat that rules using type information take longer to run.
See [Linting with Type Information](/docs/linting/type-linting) for more details.

This preset is considered "stable": rule additions and removals will only be done in major version bumps.

### `plugin:@typescript-eslint/strict`

```json
{
"extends": [
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
"plugin:@typescript-eslint/strict"
]
}
```

Additional strict rules that can also catch bugs but are more opinionated than recommended rules.
If you are an experienced TypeScript user, you may find benefit from extending from this preset.

This preset is considered "unstable": rule additions and removals may be done in minor or even patch version bumps.
8 changes: 2 additions & 6 deletions packages/eslint-plugin/docs/rules/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,8 @@ pagination_prev: null
slug: /
---

`@typescript-eslint/eslint-plugin` comes with two rulesets you can extend from to pull in the recommended starting rules:

- `'plugin:@typescript-eslint/recommended'`: recommended rules for code correctness that you can drop in without additional configuration.
See [Linting](https://typescript-eslint.io/docs/linting) for more details.
- `'plugin:@typescript-eslint/recommended-requiring-type-checking'` additional recommended rules that require type information.
See [Linting](https://typescript-eslint.io/docs/linting/type-linting) for more details.
`@typescript-eslint/eslint-plugin` includes over 100 rules that detect best practice violations, bugs, and/or stylistic issues specifically for TypeScript code.
See [Presets](/docs/linting/presets) for how to enable recommended rules using presets.

## Supported Rules

Expand Down
1 change: 1 addition & 0 deletions packages/website/sidebars/sidebar.base.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ module.exports = {
items: [
'linting/linting',
'linting/type-linting',
'linting/presets',
'linting/monorepo',
'linting/troubleshooting',
'linting/tslint',
Expand Down

0 comments on commit b237870

Please sign in to comment.