Skip to content

Commit

Permalink
feat: add reportUnusedDisableDirectives to base config
Browse files Browse the repository at this point in the history
  • Loading branch information
bmish committed Jan 12, 2023
1 parent a0111a3 commit 9ec0fd8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,15 @@ Install alongside ESLint via yarn (or npm):
yarn add --dev eslint eslint-plugin-square npm-run-all
```

Edit your `.eslintrc.js` configuration file to extend one of the available configurations from this plugin and [detect unused disable directives](https://eslint.org/docs/latest/user-guide/configuring/rules#report-unused-eslint-disable-comments):
Edit your `.eslintrc.js` configuration file to extend one of the available configurations from this plugin:

```js
module.exports = {
reportUnusedDisableDirectives: true,
extends: ['plugin:square/base'], // Or other configuration.
};
```

Add the relevant lint scripts in `package.json` with [npm-run-all](https://github.com/mysticatea/npm-run-all):
Add the relevant lint scripts in `package.json` with [npm-run-all](https://github.com/mysticatea/npm-run-all) and include detection for [unused disable directives](https://eslint.org/docs/latest/user-guide/configuring/rules#report-unused-eslint-disable-comments):

```json
{
Expand Down
1 change: 1 addition & 0 deletions lib/config/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// This configuration is intended for use with JavaScript applications.

module.exports = {
reportUnusedDisableDirectives: true, // Warn on unused disable directives: https://eslint.org/docs/latest/user-guide/command-line-interface#--report-unused-disable-directives
extends: [
'eslint:recommended',
'plugin:eslint-comments/recommended',
Expand Down

0 comments on commit 9ec0fd8

Please sign in to comment.