# lint-my-pr

> Add comments to your PR where there are linting issues.

Latest version **0.2.0** (published 2018-12-14) · ISC license · 0 weekly downloads

## Install

```sh
npm install lint-my-pr
pnpm add lint-my-pr
yarn add lint-my-pr
bun add lint-my-pr
```

Provides the command `lint-my-pr`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.0 |
| Published | 2018-12-14 |
| First published | 2018-12-13 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 6 |
| Unpacked size | 18.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Kelly Martin |
| Maintainers | kellym |

## Links

- npm: https://www.npmjs.com/package/lint-my-pr
- Repository: https://github.com/kellym/lint-my-pr
- Homepage: https://github.com/kellym/lint-my-pr#readme
- Issues: https://github.com/kellym/lint-my-pr/issues
- npm.io page: https://npm.io/package/lint-my-pr

## Dependencies (6)

- [async](https://npm.io/package/async.md) ^2.6.1
- [debug](https://npm.io/package/debug.md) ^4.1.0
- [yargs](https://npm.io/package/yargs.md) ^12.0.5
- [eslint](https://npm.io/package/eslint.md) ^5.10.0
- [parse-diff](https://npm.io/package/parse-diff.md) ^0.5.1
- [@octokit/rest](https://npm.io/package/@octokit/rest.md) ^16.2.0

## Recent versions

- 0.2.0 (latest) — 2018-12-14
- 0.1.5 — 2018-12-13
- 0.1.4 — 2018-12-13
- 0.1.3 — 2018-12-13
- 0.1.2 — 2018-12-13
- 0.1.1 — 2018-12-13
- 0.1.0 — 2018-12-13

## README

# 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](https://github.com/settings/tokens), 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:

```yaml
- 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.

| Argument | Description |
| -------- | ----------- |
| `--slug` | The slug (`:owner/:repo`) for the pull request
| `--pr` | The issue number of the PR
| `--dry` | Go through the process of linting, but don't create comments on the PR
| `--token` | Manually set a token instead of using the environment variable 
| `--config` | Specify the path to your `.eslintrc` config you want to use
| `--path` | The path you want to lint. This defaults to the root path of the repo

---
_Source: https://npm.io/package/lint-my-pr · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
