Skip to content

Commit

Permalink
Update index.md
Browse files Browse the repository at this point in the history
no-unused-disable doesn't work in flat configs (eslint-community#133)
  • Loading branch information
niklasholm authored Jun 5, 2024
1 parent 617e7d8 commit 6fcde7e
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,19 @@ Either way, you can optionally configure individual rules:
// ...
comments.recommended,
{
"@eslint-community/eslint-comments/no-unused-disable": "error"
rules: {
"@eslint-community/eslint-comments/require-description": "warn",
},
linterOptions:
reportUnusedDisableDirectives: "error",
},
},
]
```

::: tip
The [`@eslint-community/eslint-comments/no-unused-disable`](./rules/no-unused-disable.html) rule has the same effect as [--report-unused-disable-directives](https://eslint.org/docs/user-guide/command-line-interface#--report-unused-disable-directives) option.
However, the `@eslint-community/eslint-comments/no-unused-disable` rule is relatively useful since it can be configured in shareable configs.
For legacy configs, the [`@eslint-community/eslint-comments/no-unused-disable`](./rules/no-unused-disable.html) rule has the same effect as [--report-unused-disable-directives](https://eslint.org/docs/user-guide/command-line-interface#--report-unused-disable-directives) option.
However, the `@eslint-community/eslint-comments/no-unused-disable` rule is relatively useful since it can be configured in shareable configs. For flat configs the rule has no effect, use `linterOptions.reportUnusedDisableDirectives` instead.
:::

### 📜 Legacy ESLint Configs
Expand All @@ -84,6 +89,7 @@ For example:
],
"rules": {
// Optional.
"@eslint-community/eslint-comments/require-description": "warn",
"@eslint-community/eslint-comments/no-unused-disable": "error"
}
}
Expand Down

0 comments on commit 6fcde7e

Please # to comment.