2 * @fileoverview Options configuration for optionator.
3 * @author George Zahariev
8 //------------------------------------------------------------------------------
10 //------------------------------------------------------------------------------
12 const optionator = require("optionator");
14 //------------------------------------------------------------------------------
15 // Initialization and Public Interface
16 //------------------------------------------------------------------------------
18 // exports "parse(args)", "generateHelp()", and "generateHelpForOption(optionName)"
19 module.exports = optionator({
20 prepend: "eslint [options] file.js [file.js] [dir]",
22 concatRepeatedArrays: true,
23 mergeRepeatedObjects: true
27 heading: "Basic configuration"
33 description: "Disable use of configuration from .eslintrc.*"
39 description: "Use this configuration, overriding .eslintrc.* config options if present"
44 description: "Specify environments"
50 description: "Specify JavaScript file extensions"
55 description: "Define global variables"
60 description: "Specify the parser to be used"
63 option: "parser-options",
65 description: "Specify parser options"
68 option: "resolve-plugins-relative-to",
70 description: "A folder where plugins should be resolved from, CWD by default"
73 heading: "Specifying rules and plugins"
77 type: "[path::String]",
78 description: "Use additional rules from this directory"
83 description: "Specify plugins"
88 description: "Specify rules"
91 heading: "Fixing problems"
97 description: "Automatically fix problems"
100 option: "fix-dry-run",
103 description: "Automatically fix problems without saving the changes to the file system"
108 description: "Specify the types of fixes to apply (problem, suggestion, layout)"
111 heading: "Ignoring files"
114 option: "ignore-path",
115 type: "path::String",
116 description: "Specify path of ignore file"
122 description: "Disable use of ignore files and patterns"
125 option: "ignore-pattern",
127 description: "Pattern of files to ignore (in addition to those in .eslintignore)",
128 concatRepeatedArrays: [true, {
129 oneValuePerFlag: true
133 heading: "Using stdin"
139 description: "Lint code provided on <STDIN>"
142 option: "stdin-filename",
144 description: "Specify filename to process STDIN as"
147 heading: "Handling warnings"
153 description: "Report errors only"
156 option: "max-warnings",
159 description: "Number of warnings to trigger nonzero exit code"
165 option: "output-file",
167 type: "path::String",
168 description: "Specify file to write report to"
175 description: "Use a specific output format"
181 description: "Force enabling/disabling of color"
184 heading: "Inline configuration comments"
187 option: "inline-config",
190 description: "Prevent comments from changing config or rules"
193 option: "report-unused-disable-directives",
196 description: "Adds reported errors for unused eslint-disable directives"
205 description: "Only check changed files"
208 option: "cache-file",
209 type: "path::String",
210 default: ".eslintcache",
211 description: "Path to the cache file. Deprecated: use --cache-location"
214 option: "cache-location",
215 type: "path::String",
216 description: "Path to the cache file or directory"
219 heading: "Miscellaneous"
225 description: "Run config initialization wizard"
231 description: "Output execution environment information"
234 option: "error-on-unmatched-pattern",
237 description: "Prevent errors when pattern is unmatched"
243 description: "Output debugging information"
249 description: "Show help"
255 description: "Output the version number"
258 option: "print-config",
259 type: "path::String",
260 description: "Print the configuration for the given file"