diff --git a/docs/user-guide/command-line-interface.md b/docs/user-guide/command-line-interface.md index a8f51cf6129..8235f7b6cb0 100644 --- a/docs/user-guide/command-line-interface.md +++ b/docs/user-guide/command-line-interface.md @@ -38,16 +38,15 @@ Basic configuration: --parser String Specify the parser to be used --parser-options Object Specify parser options -Caching: - --cache Only check changed files - default: false - --cache-file path::String Path to the cache file. Deprecated: use --cache-location - default: .eslintcache - --cache-location path::String Path to the cache file or directory - Specifying rules and plugins: --rulesdir [path::String] Use additional rules from this directory --plugin [String] Specify plugins --rule Object Specify rules +Fixing problems: + --fix Automatically fix problems + --fix-dry-run Automatically fix problems without saving the changes to the file system + Ignoring files: --ignore-path path::String Specify path of ignore file --no-ignore Disable use of ignore files and patterns @@ -66,15 +65,20 @@ Output: -f, --format String Use a specific output format - default: stylish --color, --no-color Force enabling/disabling of color +Inline configuration comments: + --no-inline-config Prevent comments from changing config or rules + --report-unused-disable-directives Adds reported errors for unused eslint-disable directives + +Caching: + --cache Only check changed files - default: false + --cache-file path::String Path to the cache file. Deprecated: use --cache-location - default: .eslintcache + --cache-location path::String Path to the cache file or directory + Miscellaneous: --init Run config initialization wizard - default: false - --fix Automatically fix problems - --fix-dry-run Automatically fix problems without saving the changes to the file system --debug Output debugging information -h, --help Show help -v, --version Output the version number - --no-inline-config Prevent comments from changing config or rules - --report-unused-disable-directives Adds reported errors for unused eslint-disable directives --print-config path::String Print the configuration for the given file ``` diff --git a/lib/options.js b/lib/options.js index ee1d3369cec..c8005d44451 100644 --- a/lib/options.js +++ b/lib/options.js @@ -64,26 +64,6 @@ module.exports = optionator({ type: "Object", description: "Specify parser options" }, - { - heading: "Caching" - }, - { - option: "cache", - type: "Boolean", - default: "false", - description: "Only check changed files" - }, - { - option: "cache-file", - type: "path::String", - default: ".eslintcache", - description: "Path to the cache file. Deprecated: use --cache-location" - }, - { - option: "cache-location", - type: "path::String", - description: "Path to the cache file or directory" - }, { heading: "Specifying rules and plugins" }, @@ -102,6 +82,21 @@ module.exports = optionator({ type: "Object", description: "Specify rules" }, + { + heading: "Fixing problems" + }, + { + option: "fix", + type: "Boolean", + default: false, + description: "Automatically fix problems" + }, + { + option: "fix-dry-run", + type: "Boolean", + default: false, + description: "Automatically fix problems without saving the changes to the file system" + }, { heading: "Ignoring files" }, @@ -176,25 +171,48 @@ module.exports = optionator({ description: "Force enabling/disabling of color" }, { - heading: "Miscellaneous" + heading: "Inline configuration comments" }, { - option: "init", + option: "inline-config", type: "Boolean", - default: "false", - description: "Run config initialization wizard" + default: "true", + description: "Prevent comments from changing config or rules" }, { - option: "fix", + option: "report-unused-disable-directives", type: "Boolean", default: false, - description: "Automatically fix problems" + description: "Adds reported errors for unused eslint-disable directives" }, { - option: "fix-dry-run", + heading: "Caching" + }, + { + option: "cache", type: "Boolean", - default: false, - description: "Automatically fix problems without saving the changes to the file system" + default: "false", + description: "Only check changed files" + }, + { + option: "cache-file", + type: "path::String", + default: ".eslintcache", + description: "Path to the cache file. Deprecated: use --cache-location" + }, + { + option: "cache-location", + type: "path::String", + description: "Path to the cache file or directory" + }, + { + heading: "Miscellaneous" + }, + { + option: "init", + type: "Boolean", + default: "false", + description: "Run config initialization wizard" }, { option: "debug", @@ -214,18 +232,6 @@ module.exports = optionator({ type: "Boolean", description: "Output the version number" }, - { - option: "inline-config", - type: "Boolean", - default: "true", - description: "Prevent comments from changing config or rules" - }, - { - option: "report-unused-disable-directives", - type: "Boolean", - default: false, - description: "Adds reported errors for unused eslint-disable directives" - }, { option: "print-config", type: "path::String",