]>
git.proxmox.com Git - pve-eslint.git/blob - eslint/lib/options.js
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"
49 description
: "Specify JavaScript file extensions"
54 description
: "Define global variables"
59 description
: "Specify the parser to be used"
62 option
: "parser-options",
64 description
: "Specify parser options"
67 option
: "resolve-plugins-relative-to",
69 description
: "A folder where plugins should be resolved from, CWD by default"
72 heading
: "Specifying rules and plugins"
76 type
: "[path::String]",
77 description
: "Use additional rules from this directory"
82 description
: "Specify plugins"
87 description
: "Specify rules"
90 heading
: "Fixing problems"
96 description
: "Automatically fix problems"
99 option
: "fix-dry-run",
102 description
: "Automatically fix problems without saving the changes to the file system"
107 description
: "Specify the types of fixes to apply (problem, suggestion, layout)"
110 heading
: "Ignoring files"
113 option
: "ignore-path",
114 type
: "path::String",
115 description
: "Specify path of ignore file"
121 description
: "Disable use of ignore files and patterns"
124 option
: "ignore-pattern",
126 description
: "Pattern of files to ignore (in addition to those in .eslintignore)",
127 concatRepeatedArrays
: [true, {
128 oneValuePerFlag
: true
132 heading
: "Using stdin"
138 description
: "Lint code provided on <STDIN>"
141 option
: "stdin-filename",
143 description
: "Specify filename to process STDIN as"
146 heading
: "Handling warnings"
152 description
: "Report errors only"
155 option
: "max-warnings",
158 description
: "Number of warnings to trigger nonzero exit code"
164 option
: "output-file",
166 type
: "path::String",
167 description
: "Specify file to write report to"
174 description
: "Use a specific output format"
180 description
: "Force enabling/disabling of color"
183 heading
: "Inline configuration comments"
186 option
: "inline-config",
189 description
: "Prevent comments from changing config or rules"
192 option
: "report-unused-disable-directives",
195 description
: "Adds reported errors for unused eslint-disable directives"
204 description
: "Only check changed files"
207 option
: "cache-file",
208 type
: "path::String",
209 default: ".eslintcache",
210 description
: "Path to the cache file. Deprecated: use --cache-location"
213 option
: "cache-location",
214 type
: "path::String",
215 description
: "Path to the cache file or directory"
218 heading
: "Miscellaneous"
224 description
: "Run config initialization wizard"
230 description
: "Output execution environment information"
233 option
: "error-on-unmatched-pattern",
236 description
: "Prevent errors when pattern is unmatched"
242 description
: "Output debugging information"
248 description
: "Show help"
254 description
: "Output the version number"
257 option
: "print-config",
258 type
: "path::String",
259 description
: "Print the configuration for the given file"