summaryrefslogtreecommitdiff
path: root/tools/eslint/lib/options.js
diff options
context:
space:
mode:
Diffstat (limited to 'tools/eslint/lib/options.js')
-rw-r--r--tools/eslint/lib/options.js121
1 files changed, 121 insertions, 0 deletions
diff --git a/tools/eslint/lib/options.js b/tools/eslint/lib/options.js
new file mode 100644
index 0000000000..4b5803c115
--- /dev/null
+++ b/tools/eslint/lib/options.js
@@ -0,0 +1,121 @@
+/**
+ * @fileoverview Options configuration for optionator.
+ * @author George Zahariev
+ */
+"use strict";
+
+//------------------------------------------------------------------------------
+// Requirements
+//------------------------------------------------------------------------------
+
+var optionator = require("optionator");
+
+//------------------------------------------------------------------------------
+// Initialization and Public Interface
+//------------------------------------------------------------------------------
+
+// exports "parse(args)", "generateHelp()", and "generateHelpForOption(optionName)"
+module.exports = optionator({
+ prepend: "eslint [options] file.js [file.js] [dir]",
+ concatRepeatedArrays: true,
+ mergeRepeatedObjects: true,
+ options: [{
+ heading: "Options"
+ }, {
+ option: "help",
+ alias: "h",
+ type: "Boolean",
+ description: "Show help"
+ }, {
+ option: "config",
+ alias: "c",
+ type: "path::String",
+ description: "Use configuration from this file"
+ }, {
+ option: "rulesdir",
+ type: "[path::String]",
+ description: "Use additional rules from this directory"
+ }, {
+ option: "format",
+ alias: "f",
+ type: "String",
+ default: "stylish",
+ description: "Use a specific output format"
+ }, {
+ option: "version",
+ alias: "v",
+ type: "Boolean",
+ description: "Outputs the version number"
+ }, {
+ option: "reset",
+ type: "Boolean",
+ default: "false",
+ description: "Set all default rules to off"
+ }, {
+ option: "eslintrc",
+ type: "Boolean",
+ default: "true",
+ description: "Disable use of configuration from .eslintrc"
+ }, {
+ option: "env",
+ type: "[String]",
+ description: "Specify environments"
+ }, {
+ option: "ext",
+ type: "[String]",
+ default: ".js",
+ description: "Specify JavaScript file extensions"
+ }, {
+ option: "plugin",
+ type: "[String]",
+ description: "Specify plugins"
+ }, {
+ option: "global",
+ type: "[String]",
+ description: "Define global variables"
+ }, {
+ option: "rule",
+ type: "Object",
+ description: "Specify rules"
+ },
+ {
+ option: "ignore-path",
+ type: "path::String",
+ description: "Specify path of ignore file"
+ },
+ {
+ option: "ignore",
+ type: "Boolean",
+ default: "true",
+ description: "Disable use of .eslintignore"
+ },
+ {
+ option: "color",
+ type: "Boolean",
+ default: "true",
+ description: "Disable color in piped output"
+ },
+ {
+ option: "output-file",
+ alias: "o",
+ type: "path::String",
+ description: "Specify file to write report to"
+ },
+ {
+ option: "quiet",
+ type: "Boolean",
+ default: "false",
+ description: "Report errors only"
+ },
+ {
+ option: "stdin",
+ type: "Boolean",
+ default: "false",
+ description: "Lint code provided on <STDIN>"
+ },
+ {
+ option: "stdin-filename",
+ type: "String",
+ description: "Specify filename to process STDIN as"
+ }]
+});