UNPKG

2.77 kBJavaScriptView Raw
1/**
2 * @fileoverview Options configuration for optionator.
3 * @author George Zahariev
4 */
5"use strict";
6
7//------------------------------------------------------------------------------
8// Requirements
9//------------------------------------------------------------------------------
10
11var optionator = require("optionator");
12
13//------------------------------------------------------------------------------
14// Initialization and Public Interface
15//------------------------------------------------------------------------------
16
17// exports "parse(args)", "generateHelp()", and "generateHelpForOption(optionName)"
18module.exports = optionator({
19 prepend: "eslint [options] file.js [file.js] [dir]",
20 concatRepeatedArrays: true,
21 mergeRepeatedObjects: true,
22 options: [{
23 heading: "Options"
24 }, {
25 option: "help",
26 alias: "h",
27 type: "Boolean",
28 description: "Show help."
29 }, {
30 option: "config",
31 alias: "c",
32 type: "path::String",
33 description: "Load configuration data from this file."
34 }, {
35 option: "rulesdir",
36 type: "[path::String]",
37 description: "Load additional rules from this directory."
38 }, {
39 option: "format",
40 alias: "f",
41 type: "String",
42 default: "stylish",
43 description: "Use a specific output format."
44 }, {
45 option: "version",
46 alias: "v",
47 type: "Boolean",
48 description: "Outputs the version number."
49 }, {
50 option: "reset",
51 type: "Boolean",
52 description: "Set all default rules to off."
53 }, {
54 option: "eslintrc",
55 type: "Boolean",
56 default: "true",
57 description: "Enable loading .eslintrc configuration."
58 }, {
59 option: "env",
60 type: "[String]",
61 description: "Specify environments."
62 }, {
63 option: "plugin",
64 type: "[String]",
65 description: "Specify plugins."
66 }, {
67 option: "global",
68 type: "[String]",
69 description: "Define global variables."
70 },{
71 option: "rule",
72 type: "Object",
73 description: "Specify rules."
74 },
75 {
76 option: "ignore-path",
77 type: "path::String",
78 description: "Specify the file that contains patterns of files to ignore."
79 },
80 {
81 option: "ignore",
82 type: "Boolean",
83 default: "true",
84 description: "Enable loading of .eslintignore."
85 },
86 {
87 option: "color",
88 type: "Boolean",
89 default: "true",
90 description: "Enable color in piped output."
91 },
92 {
93 option: "output-file",
94 alias: "o",
95 type: "path::String",
96 description: "Enable report to be written to a file."
97 }]
98});