From 9ec0fd807b6a22a306f464e03ab1dceb39b7e441 Mon Sep 17 00:00:00 2001 From: Bryan Mishkin <698306+bmish@users.noreply.github.com> Date: Thu, 12 Jan 2023 11:31:00 -0500 Subject: [PATCH] feat: add reportUnusedDisableDirectives to base config --- README.md | 5 ++--- lib/config/base.js | 1 + 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 7d2840c6..14ad9fd9 100644 --- a/README.md +++ b/README.md @@ -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 { diff --git a/lib/config/base.js b/lib/config/base.js index 922645f2..35c15f2b 100644 --- a/lib/config/base.js +++ b/lib/config/base.js @@ -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',