Skip to content

Commit

Permalink
Chore: Reorganize CLI options and associated docs (#9758)
Browse files Browse the repository at this point in the history
* Chore: Moved cache options below some more important option sets

* Chore: Created "Inline configuration comments" option section

* Chore: Created "Fixing problems" option section
  • Loading branch information
platinumazure authored and ilyavolodin committed Dec 23, 2017
1 parent 75c7419 commit 8196c45
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 50 deletions.
22 changes: 13 additions & 9 deletions docs/user-guide/command-line-interface.md
Expand Up @@ -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
Expand All @@ -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
```

Expand Down
88 changes: 47 additions & 41 deletions lib/options.js
Expand Up @@ -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"
},
Expand All @@ -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"
},
Expand Down Expand Up @@ -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",
Expand All @@ -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",
Expand Down

0 comments on commit 8196c45

Please sign in to comment.