Ohm-Management - Projektarbeit B-ME
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

options.js 6.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246
  1. /**
  2. * @fileoverview Options configuration for optionator.
  3. * @author George Zahariev
  4. */
  5. "use strict";
  6. //------------------------------------------------------------------------------
  7. // Requirements
  8. //------------------------------------------------------------------------------
  9. const optionator = require("optionator");
  10. //------------------------------------------------------------------------------
  11. // Initialization and Public Interface
  12. //------------------------------------------------------------------------------
  13. // exports "parse(args)", "generateHelp()", and "generateHelpForOption(optionName)"
  14. module.exports = optionator({
  15. prepend: "eslint [options] file.js [file.js] [dir]",
  16. defaults: {
  17. concatRepeatedArrays: true,
  18. mergeRepeatedObjects: true
  19. },
  20. options: [
  21. {
  22. heading: "Basic configuration"
  23. },
  24. {
  25. option: "eslintrc",
  26. type: "Boolean",
  27. default: "true",
  28. description: "Disable use of configuration from .eslintrc.*"
  29. },
  30. {
  31. option: "config",
  32. alias: "c",
  33. type: "path::String",
  34. description: "Use this configuration, overriding .eslintrc.* config options if present"
  35. },
  36. {
  37. option: "env",
  38. type: "[String]",
  39. description: "Specify environments"
  40. },
  41. {
  42. option: "ext",
  43. type: "[String]",
  44. default: ".js",
  45. description: "Specify JavaScript file extensions"
  46. },
  47. {
  48. option: "global",
  49. type: "[String]",
  50. description: "Define global variables"
  51. },
  52. {
  53. option: "parser",
  54. type: "String",
  55. description: "Specify the parser to be used"
  56. },
  57. {
  58. option: "parser-options",
  59. type: "Object",
  60. description: "Specify parser options"
  61. },
  62. {
  63. heading: "Specifying rules and plugins"
  64. },
  65. {
  66. option: "rulesdir",
  67. type: "[path::String]",
  68. description: "Use additional rules from this directory"
  69. },
  70. {
  71. option: "plugin",
  72. type: "[String]",
  73. description: "Specify plugins"
  74. },
  75. {
  76. option: "rule",
  77. type: "Object",
  78. description: "Specify rules"
  79. },
  80. {
  81. heading: "Fixing problems"
  82. },
  83. {
  84. option: "fix",
  85. type: "Boolean",
  86. default: false,
  87. description: "Automatically fix problems"
  88. },
  89. {
  90. option: "fix-dry-run",
  91. type: "Boolean",
  92. default: false,
  93. description: "Automatically fix problems without saving the changes to the file system"
  94. },
  95. {
  96. option: "fix-type",
  97. type: "Array",
  98. description: "Specify the types of fixes to apply (problem, suggestion, layout)"
  99. },
  100. {
  101. heading: "Ignoring files"
  102. },
  103. {
  104. option: "ignore-path",
  105. type: "path::String",
  106. description: "Specify path of ignore file"
  107. },
  108. {
  109. option: "ignore",
  110. type: "Boolean",
  111. default: "true",
  112. description: "Disable use of ignore files and patterns"
  113. },
  114. {
  115. option: "ignore-pattern",
  116. type: "[String]",
  117. description: "Pattern of files to ignore (in addition to those in .eslintignore)",
  118. concatRepeatedArrays: [true, {
  119. oneValuePerFlag: true
  120. }]
  121. },
  122. {
  123. heading: "Using stdin"
  124. },
  125. {
  126. option: "stdin",
  127. type: "Boolean",
  128. default: "false",
  129. description: "Lint code provided on <STDIN>"
  130. },
  131. {
  132. option: "stdin-filename",
  133. type: "String",
  134. description: "Specify filename to process STDIN as"
  135. },
  136. {
  137. heading: "Handling warnings"
  138. },
  139. {
  140. option: "quiet",
  141. type: "Boolean",
  142. default: "false",
  143. description: "Report errors only"
  144. },
  145. {
  146. option: "max-warnings",
  147. type: "Int",
  148. default: "-1",
  149. description: "Number of warnings to trigger nonzero exit code"
  150. },
  151. {
  152. heading: "Output"
  153. },
  154. {
  155. option: "output-file",
  156. alias: "o",
  157. type: "path::String",
  158. description: "Specify file to write report to"
  159. },
  160. {
  161. option: "format",
  162. alias: "f",
  163. type: "String",
  164. default: "stylish",
  165. description: "Use a specific output format"
  166. },
  167. {
  168. option: "color",
  169. type: "Boolean",
  170. alias: "no-color",
  171. description: "Force enabling/disabling of color"
  172. },
  173. {
  174. heading: "Inline configuration comments"
  175. },
  176. {
  177. option: "inline-config",
  178. type: "Boolean",
  179. default: "true",
  180. description: "Prevent comments from changing config or rules"
  181. },
  182. {
  183. option: "report-unused-disable-directives",
  184. type: "Boolean",
  185. default: false,
  186. description: "Adds reported errors for unused eslint-disable directives"
  187. },
  188. {
  189. heading: "Caching"
  190. },
  191. {
  192. option: "cache",
  193. type: "Boolean",
  194. default: "false",
  195. description: "Only check changed files"
  196. },
  197. {
  198. option: "cache-file",
  199. type: "path::String",
  200. default: ".eslintcache",
  201. description: "Path to the cache file. Deprecated: use --cache-location"
  202. },
  203. {
  204. option: "cache-location",
  205. type: "path::String",
  206. description: "Path to the cache file or directory"
  207. },
  208. {
  209. heading: "Miscellaneous"
  210. },
  211. {
  212. option: "init",
  213. type: "Boolean",
  214. default: "false",
  215. description: "Run config initialization wizard"
  216. },
  217. {
  218. option: "debug",
  219. type: "Boolean",
  220. default: false,
  221. description: "Output debugging information"
  222. },
  223. {
  224. option: "help",
  225. alias: "h",
  226. type: "Boolean",
  227. description: "Show help"
  228. },
  229. {
  230. option: "version",
  231. alias: "v",
  232. type: "Boolean",
  233. description: "Output the version number"
  234. },
  235. {
  236. option: "print-config",
  237. type: "path::String",
  238. description: "Print the configuration for the given file"
  239. }
  240. ]
  241. });