no-unused-disable.js 953 B

12345678910111213141516171819202122232425262728293031323334
  1. /**
  2. * @author Toru Nagashima <https://github.com/mysticatea>
  3. * See LICENSE file in root directory for full license.
  4. */
  5. "use strict"
  6. // Patch `Linter#verify` to work.
  7. require("../utils/patch")()
  8. module.exports = {
  9. meta: {
  10. docs: {
  11. description: "disallow unused `eslint-disable` comments",
  12. category: "Best Practices",
  13. recommended: false,
  14. url:
  15. "https://mysticatea.github.io/eslint-plugin-eslint-comments/rules/no-unused-disable.html",
  16. },
  17. fixable: null,
  18. schema: [],
  19. type: "problem",
  20. },
  21. create() {
  22. // This rule patches `Linter#verify` method and:
  23. //
  24. // 1. enables `reportUnusedDisableDirectives` option.
  25. // 2. verifies the code.
  26. // 3. converts `reportUnusedDisableDirectives` errors to `no-unused-disable` errors.
  27. //
  28. // So this rule itself does nothing.
  29. return {}
  30. },
  31. }