spokecommunity / Spoke

mass-contact text/SMS distribution tool
MIT License
3 stars 1 forks source link

Enable PR linting with Danger #9

Open harpojaeger opened 5 years ago

harpojaeger commented 5 years ago

This PR enables automatic linting of the files that were changed in any given PR. On success, a message like this one is added by a bot:

Screen Shot 2019-03-20 at 20 21 01

On failure/warning, it looks like this:

Screen Shot 2019-03-20 at 20 21 10

After this is merged, some trivial Travis CI setup is necessary to complete the process (I'll handle that).

dangerfile.js is where the actual linting logic is performed (this can be used for lots of things besides linting). Updates to .travis.yml are necessary to actually run Danger as part of CI. It was necessary to make .eslintrc into a JSON file so it could be imported and parsed in the Dangerfile. Also, I disabled auto-fixing in the default npm run lint script.