0.2.0 • Published 5 years ago

lint-my-pr v0.2.0

Weekly downloads
29
License
ISC
Repository
github
Last release
5 years ago

Lint My PR

This automates the process of linting pull requests and adds comments to the lines with problems. There are other linters available for Travis, but none of them create comments to mark problem lines, and others require way too much configuration.

Setup is simple.

npm install --save-dev lint-my-pr

Create a new personal Github token, then set up your Travis environment with that token set to GITHUB_TOKEN. See Travis docs for help on that (you can add it either via the command line or via their website).

Then add the script to your .travis.yml file. I'd suggest using the "stages" feature:

- jobs
  include:
    - stage: linting
      if: type = pull_request
      script: lint-my-pr --slug="${TRAVIS_PULL_REQUEST_SLUG}" --pr="${TRAVIS_PULL_REQUEST}"

Using if: type = pull_request ensures that the linter only runs on PR commits.

There are other configuration options available. Here is the complete list.

ArgumentDescription
--slugThe slug (:owner/:repo) for the pull request
--prThe issue number of the PR
--dryGo through the process of linting, but don't create comments on the PR
--tokenManually set a token instead of using the environment variable
--configSpecify the path to your .eslintrc config you want to use
--pathThe path you want to lint. This defaults to the root path of the repo
0.2.0

5 years ago

0.1.5

5 years ago

0.1.4

5 years ago

0.1.3

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago