Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions doc/tasks/eslint.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ grumphp:
- /^resources\/js\/(.*)/
config: .eslintrc.json
ignore_path: .eslintignore
cache: ~
cache_location: ~
debug: false
format: ~
max_warnings: ~
Expand Down Expand Up @@ -79,6 +81,18 @@ The path to your eslint's configuration file. Not necessary if using a standard

The path to your eslint's ignore file ([eslint.org](https://eslint.org/docs/user-guide/configuring/ignoring-code#using-an-alternate-file)). Not necessary if using standard .eslintignore name.

**cache**

*Default: null*

Store the results of processed files so that eslint only operates on the changed ones. By default, the cache is stored in `./.eslintcache ` in `process.cwd()`. ([eslint.org](https://eslint.org/docs/latest/use/command-line-interface#caching)).

**cache_location**

*Default: null*

Path to a file or directory for the cache location. ([eslint.org](https://eslint.org/docs/latest/use/command-line-interface#--cache-location)).

**debug**

*Default: false*
Expand Down
6 changes: 6 additions & 0 deletions src/Task/ESLint.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ public static function getConfigurableOptions(): ConfigOptionsResolver
// ESLint native config options
'config' => null,
'ignore_path' => null,
'cache' => null,
Comment thread
rodrigoaguilera marked this conversation as resolved.
'cache_location' => null,
'debug' => false,
'format' => null,
'max_warnings' => null,
Expand All @@ -49,6 +51,8 @@ public static function getConfigurableOptions(): ConfigOptionsResolver
// ESLint native config options
$resolver->addAllowedTypes('config', ['null', 'string']);
$resolver->addAllowedTypes('ignore_path', ['null', 'string']);
$resolver->addAllowedTypes('cache', ['null', 'bool']);
$resolver->addAllowedTypes('cache_location', ['null', 'string']);
$resolver->addAllowedTypes('debug', ['bool']);
$resolver->addAllowedTypes('format', ['null', 'string']);
$resolver->addAllowedTypes('max_warnings', ['null', 'integer']);
Expand Down Expand Up @@ -82,6 +86,8 @@ public function run(ContextInterface $context): TaskResultInterface

$arguments->addOptionalArgument('--config=%s', $config['config']);
$arguments->addOptionalArgument('--ignore-path=%s', $config['ignore_path']);
$arguments->addOptionalArgument('--cache', $config['cache']);
$arguments->addOptionalArgument('--cache-location=%s', $config['cache_location']);
$arguments->addOptionalArgument('--debug', $config['debug']);
$arguments->addOptionalArgument('--format=%s', $config['format']);
$arguments->addOptionalArgument('--no-eslintrc', $config['no_eslintrc']);
Expand Down
Loading