print-help.js 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. "use strict";
  2. // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
  3. // See LICENSE in the project root for license information.
  4. Object.defineProperty(exports, "__esModule", { value: true });
  5. exports.printPruneHelp = printPruneHelp;
  6. exports.printHelp = printHelp;
  7. exports.printSuppressHelp = printSuppressHelp;
  8. const wrap_words_to_lines_1 = require("./wrap-words-to-lines");
  9. function printPruneHelp() {
  10. const help = `eslint-bulk prune
  11. Usage:
  12. eslint-bulk prune
  13. This command is a thin wrapper around ESLint that communicates with @rushstack/eslint-patch to delete all unused suppression entries in all .eslint-bulk-suppressions.json files under the current working directory.`;
  14. const wrapped = (0, wrap_words_to_lines_1.wrapWordsToLines)(help);
  15. for (const line of wrapped) {
  16. console.log(line);
  17. }
  18. }
  19. function printHelp() {
  20. const help = `eslint-bulk <command>
  21. Usage:
  22. eslint-bulk suppress --rule RULENAME1 [--rule RULENAME2...] PATH1 [PATH2...]
  23. eslint-bulk suppress --all PATH1 [PATH2...]
  24. eslint-bulk suppress --help
  25. eslint-bulk prune
  26. eslint-bulk prune --help
  27. eslint-bulk --help
  28. This command line tool is a thin wrapper around ESLint that communicates with @rushstack/eslint-patch to suppress or prune unused suppressions in the local .eslint-bulk-suppressions.json file.
  29. Commands:
  30. eslint-bulk suppress [options] <path...>
  31. Use this command to generate a new .eslint-bulk-suppressions.json file or add suppression entries to the existing file. Specify the files and rules you want to suppress.
  32. Please run "eslint-bulk suppress --help" to learn more.
  33. eslint-bulk prune
  34. Use this command to delete all unused suppression entries in all .eslint-bulk-suppressions.json files under the current working directory.
  35. Please run "eslint-bulk prune --help" to learn more.
  36. `;
  37. const wrapped = (0, wrap_words_to_lines_1.wrapWordsToLines)(help);
  38. for (const line of wrapped) {
  39. console.log(line);
  40. }
  41. }
  42. function printSuppressHelp() {
  43. const help = `eslint-bulk suppress [options] <path...>
  44. Usage:
  45. eslint-bulk suppress --rule RULENAME1 [--rule RULENAME2...] PATH1 [PATH2...]
  46. eslint-bulk suppress --all PATH1 [PATH2...]
  47. eslint-bulk suppress --help
  48. This command is a thin wrapper around ESLint that communicates with @rushstack/eslint-patch to either generate a new .eslint-bulk-suppressions.json file or add suppression entries to the existing file. Specify the files and rules you want to suppress.
  49. Argument:
  50. <path...>
  51. Glob patterns for paths to suppress, same as eslint files argument. Should be relative to the project root.
  52. Options:
  53. -h, -H, --help
  54. Display this help message.
  55. -R, --rule
  56. The full name of the ESLint rule you want to bulk-suppress. Specify multiple rules with --rule NAME1 --rule RULENAME2.
  57. -A, --all
  58. Bulk-suppress all rules in the specified file patterns.`;
  59. const wrapped = (0, wrap_words_to_lines_1.wrapWordsToLines)(help);
  60. for (const line of wrapped) {
  61. console.log(line);
  62. }
  63. }
  64. //# sourceMappingURL=print-help.js.map