summaryrefslogtreecommitdiff
path: root/tools/eslint/lib/options.js
diff options
context:
space:
mode:
authorYosuke Furukawa <yosuke.furukawa@gmail.com>2015-04-29 02:03:05 +0900
committerYosuke Furukawa <yosuke.furukawa@gmail.com>2015-05-09 12:09:52 +0900
commitf9dd34d301ab385ae316769b85ef916f9b70b6f6 (patch)
tree9ce5db7bdff46e587535de5549eef7e02656f5d8 /tools/eslint/lib/options.js
parent5883a59b21a97e8b7339f435c977155a2c29ba8d (diff)
downloadnode-new-f9dd34d301ab385ae316769b85ef916f9b70b6f6.tar.gz
tools: replace closure-linter with eslint
PR-URL: https://github.com/iojs/io.js/pull/1539 Fixes: https://github.com/iojs/io.js/issues/1253 Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Trevor Norris <trev.norris@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io> Reviewed-By: Chris Dickinson <christopher.s.dickinson@gmail.com> Reviewed-By: Johan Bergström <bugs@bergstroem.nu> Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
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"
+ }]
+});