diff --git a/README.md b/README.md index 7d2840c6..a737d133 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/command-line-interface#--report-unused-disable-directives): ```json { diff --git a/lib/config/base.js b/lib/config/base.js index 922645f2..f3c6de9a 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/configuring/rules#report-unused-eslint-disable-comments extends: [ 'eslint:recommended', 'plugin:eslint-comments/recommended', diff --git a/package.json b/package.json index fd4b86e3..3879ca9d 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,7 @@ "lint": "npm-run-all --continue-on-error --aggregate-output --parallel lint:*", "lint:docs": "markdownlint \"**/*.md\"", "lint:eslint-docs": "npm-run-all \"update:eslint-docs -- --check\"", - "lint:js": "eslint --cache .", + "lint:js": "eslint --report-unused-disable-directives --cache .", "lint:package-json": "npmPkgJsonLint .", "lint:package-json-sorting": "sort-package-json --check", "lint:package-json-sorting:fix": "sort-package-json package.json",