humanmade / linter-bot

Automatically run the HM Coding Standards on any repository.
https://github.com/apps/hm-linter
16 stars 3 forks source link

Add ability to use versions from composer.json and package.json #145

Open johnbillion opened 4 years ago

johnbillion commented 4 years ago

In the Configuration section of the readme it's documented that the version for HM Coding Standards, phpcs, eslint, and stylelint can all be configured.

When I'm using a project that already specifies these versions in composer.json and package.json, I don't want to specify them again here and risk that the versions diverge. This can result in one of the most frustrating types of problems with linting which is when one linting tool displays an error and another doesn't.

It should be possible to instruct linter bot to use the version from these files. An example hmlinter.yml using a mixture of config could look like this:

# GLOBAL SETTINGS

version: 1.1.1

# PER-STANDARD SETTINGS
phpcs:
  enabled: true
  version: composer.json

eslint:
  enabled: true
  version: package.json

stylelint:
  enabled: true
  version: 13.7.2