houndci / hound

Automated code review for GitHub pull requests.
https://houndci.com
MIT License
1.95k stars 401 forks source link

Feature request: allow to install eslint plugins and config from .eslintrc #1857

Open leosuncin opened 2 years ago

leosuncin commented 2 years ago

I use this eslint config

{
  "extends": ["next"],
  "plugins": ["deprecation"],
  "overrides": [
    {
      "files": ["**/*.ts", "**/*.tsx"],
      "rules": {
        "deprecation/deprecation": "warn"
      }
    },
    {
      "files": ["**/*.spec.ts", "**/*.spec.tsx"],
      "plugins": ["jest", "jest-formatting", "testing-library"],
      "env": {
         "jest": true
      },
      "extends": [
        "plugin:jest/recommended",
        "plugin:jest/style",
        "plugin:jest-formatting/strict",
       "plugin:testing-library/react"
      ]
    }
  ]
}

and this .hound.yml

eslint:
  enabled: true
  version: 7.7.0
  config_file: .eslintrc.json
  ignore_file: .eslintignore

jshint:
  enabled: false

and I'm getting the following messages in the PR from Hound

Also there are some open issues related to missing plugins #1845 #1841 #1838 etc

This can be done by installing eslint's packages in package.json or add a setting to pass an array of packages to Hound  

eslint:
 enabled: true
 version: 7.7.0
 config_file: .eslintrc.json
 ignore_file: .eslintignore
 plugins:
     - eslint-config-next
     - eslint-plugin-deprecation
     - eslint-plugin-jest
     - eslint-plugin-jest-formatting
     - eslint-plugin-testing-library
jshint:
 enabled: false

This will be helpful for you because it will prevent that people open a new issue for every eslint plugin and config in NPM