Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#84 Add ESLint support and configure it to use Drupal standards. #85

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ composer require wunderio/code-quality --dev
cp vendor/wunderio/code-quality/config/grumphp.yml ./grumphp.yml
cp vendor/wunderio/code-quality/config/phpstan.neon ./phpstan.neon
cp vendor/wunderio/code-quality/config/psalm.xml ./psalm.xml
npm init # If you don't have package.json does not exist yet in your project.
npm i eslint@^8.9.0 eslint-config-airbnb@^19.0.4 eslint-config-prettier@^8.4.0 eslint-plugin-import@^2.25.4 eslint-plugin-jquery@^1.5.1 eslint-plugin-jsx-a11y@^6.5.1 eslint-plugin-prettier@^4.0.0 eslint-plugin-react@^7.28.0 eslint-plugin-yml@^0.14.0 prettier@^2.5.1
```

The commit hook for GrumPHP is automatically installed on composer require.
Expand Down
3 changes: 3 additions & 0 deletions config/grumphp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ grumphp:
yaml_lint: ~
json_lint: ~
psalm: ~
eslint:
bin: 'node_modules/.bin/eslint'
config: 'web/core/.eslintrc.passing.json'
extensions:
- Wunderio\GrumPHP\Task\PhpCompatibility\PhpCompatibilityExtensionLoader
- Wunderio\GrumPHP\Task\PhpCheckSyntax\PhpCheckSyntaxExtensionLoader
Expand Down
4 changes: 2 additions & 2 deletions src/Task/tasks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -271,10 +271,10 @@ Wunderio\GrumPHP\Task\Psalm\PsalmTask:
allowed_types: ['bool']
report:
defaults: ~
allowed_types: ['string', 'null' ]
allowed_types: ['string', 'null']
output_format:
defaults: null
allowed_types: ['string', 'null' ]
allowed_types: ['string', 'null']
threads:
defaults: 6
allowed_types: ['int']
Expand Down