diff --git a/config/grumphp.yml b/config/grumphp.yml index af397df..7ddc53d 100644 --- a/config/grumphp.yml +++ b/config/grumphp.yml @@ -13,7 +13,9 @@ grumphp: yaml_lint: ~ json_lint: ~ psalm: ~ - eslint: ~ + eslint: + bin: 'node_modules/.bin/eslint' + config: 'web/core/.eslintrc.passing.json' extensions: - Wunderio\GrumPHP\Task\PhpCompatibility\PhpCompatibilityExtensionLoader - Wunderio\GrumPHP\Task\PhpCheckSyntax\PhpCheckSyntaxExtensionLoader @@ -24,4 +26,3 @@ grumphp: - Wunderio\GrumPHP\Task\YamlLint\YamlLintExtensionLoader - Wunderio\GrumPHP\Task\JsonLint\JsonLintExtensionLoader - Wunderio\GrumPHP\Task\Psalm\PsalmExtensionLoader - - Wunderio\GrumPHP\Task\ESLint\EslintExtensionLoader diff --git a/src/Task/ESLint/EslintExtensionLoader.php b/src/Task/ESLint/EslintExtensionLoader.php deleted file mode 100644 index 416207e..0000000 --- a/src/Task/ESLint/EslintExtensionLoader.php +++ /dev/null @@ -1,14 +0,0 @@ -getConfig()->getOptions(); - $arguments = ProcessArgumentsCollection::forExecutable($config['bin']); - - $arguments->add('--config=' . $config['config']); - $arguments->addOptionalArgument('--debug', $config['debug']); - $arguments->addOptionalCommaSeparatedArgument('--ext=%s', (array) $config['extensions']); - $arguments->addOptionalArgument('--format=%s', $config['format']); - // @todo Not sure if this works. - $arguments->addOptionalIntegerArgument('--max-warnings=%d', $config['max_warnings']); - $arguments->addOptionalBooleanArgument('--no-eslintrc=%s', $config['no_eslintrc'], 'true', 'false'); - $arguments->addOptionalBooleanArgument('--quiet=%s', $config['quiet'], 'true', 'false'); - foreach ($config['ignore_patterns'] as $ignore_pattern) { - $arguments->add('--ignore-pattern=' . $ignore_pattern); - } - - foreach ($files as $file) { - $files_new[] = $file; - $arguments->add($file); - } - - return $arguments; - } - -} diff --git a/src/Task/ESLint/README.md b/src/Task/ESLint/README.md deleted file mode 100644 index 9de88f2..0000000 --- a/src/Task/ESLint/README.md +++ /dev/null @@ -1,29 +0,0 @@ -# ESLint - -Check js code against coding standards and security standards. By default Drupal rules are loaded. - -### grumphp.yml (with current defaults): -````yml -parameters: - tasks: - eslint: - ignore_patterns: - - '**/vendor/**' - - '**/node_modules/**' - - '**/core/**' - - '**/libraries/**' - - '**/contrib/**' - extensions: ['js', 'jsx', 'ts', 'tsx', 'vue'] - run_on: [ 'web/modules/custom', 'web/themes/custom' ] - bin: 'node_modules/.bin/eslint' - config: 'web/core/.eslintrc.passing.json' - debug: false - format: ~ - max_warnings: ~ - no_eslintrc: false - quiet: ~ - extensions: - - Wunderio\GrumPHP\Task\PhpCompatibilityTask\PhpCompatibilityExtensionLoader -```` - - diff --git a/src/Task/tasks.yml b/src/Task/tasks.yml index f935e8d..b5f4ee1 100644 --- a/src/Task/tasks.yml +++ b/src/Task/tasks.yml @@ -281,40 +281,3 @@ Wunderio\GrumPHP\Task\Psalm\PsalmTask: show_info: defaults: false allowed_types: ['bool'] -Wunderio\GrumPHP\Task\ESLint\EslintTask: - options: - ignore_patterns: - defaults: - - '**/vendor/**' - - '**/node_modules/**' - - '**/core/**' - - '**/libraries/**' - - '**/contrib/**' - allowed_types: ['array'] - extensions: - defaults: ['js', 'jsx', 'ts', 'tsx', 'vue'], - allowed_types: ['array'] - run_on: - defaults: ['web/modules/custom', 'web/themes/custom'] - allowed_types: ['array'] - bin: - defaults: 'node_modules/.bin/eslint' - allowed_types: ['string'] - config: - defaults: 'web/core/.eslintrc.passing.json' - allowed_types: ['string'] - debug: - defaults: false - allowed_types: ['bool'] - format: - defaults: null - allowed_types: ['string', 'null'] - max_warnings: - defaults: null - allowed_types: ['int', 'null'] - no_eslintrc: - defaults: false - allowed_types: ['bool'] - quiet: - defaults: null - allowed_types: ['bool', 'null']