{"id":23505888,"url":"https://github.com/grvcoelho/lint-diff","last_synced_at":"2025-04-07T11:04:42.622Z","repository":{"id":51141659,"uuid":"129232427","full_name":"grvcoelho/lint-diff","owner":"grvcoelho","description":":nail_care: Run eslint only in the changed parts of the code","archived":false,"fork":false,"pushed_at":"2023-03-01T20:12:00.000Z","size":411,"stargazers_count":114,"open_issues_count":13,"forks_count":23,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-31T10:05:38.078Z","etag":null,"topics":["ci","lint","travis"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/grvcoelho.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-04-12T10:11:46.000Z","updated_at":"2023-09-14T19:14:34.000Z","dependencies_parsed_at":"2024-06-18T15:25:50.335Z","dependency_job_id":"9b690d5c-0c00-46bf-8495-95b5f5470a5e","html_url":"https://github.com/grvcoelho/lint-diff","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grvcoelho%2Flint-diff","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grvcoelho%2Flint-diff/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grvcoelho%2Flint-diff/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grvcoelho%2Flint-diff/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/grvcoelho","download_url":"https://codeload.github.com/grvcoelho/lint-diff/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247495570,"owners_count":20948076,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ci","lint","travis"],"created_at":"2024-12-25T09:46:19.744Z","updated_at":"2025-04-07T11:04:42.587Z","avatar_url":"https://github.com/grvcoelho.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# lint-diff\n\n[![Build Status](https://travis-ci.org/grvcoelho/lint-diff.svg?branch=master)](https://travis-ci.org/grvcoelho/lint-diff)\n\n:nail_care: Run eslint only in the changed parts of the code\n\n## Why\n\n[ESLint](https://github.com/eslint/eslint) is a great tool to enforce code\nstyle in your code, but it has some limitations: it can only lint entire files.\nWhen working with legacy code, we often have to make changes to very large\nfiles (which would be too troublesome to fix all lint errors)and thus it would\nbe good to lint only the lines changed and not the entire file.\n\n[lint-diff](https://github.com/grvcoelho/lint-diff) receives a commit range and\nuses [ESLint](https://github.com/eslint/eslint)  to lint the changed files and\nfilter only the errors introduced in the commit range (and nothing more).\n\n### State of the art\n\n* [lint-staged](https://github.com/okonet/lint-staged) is a similar tool that lints only the staged changes. It's very helpful for adding a precommit hook, but it cannot be used to enforce the styleguide on a Continuous Integration service like Travis, because the changes are already commited.\n\n## Usage\n\n1. Install it:\n\n  ```sh\n  $ npm install lint-diff\n  ```\n\n2. Install `eslint` and add your eslint configuration file.\n\n3. Use it:\n\n  ```sh\n  # This will lint the last commit\n  $ lint-diff HEAD^..HEAD\n  ```\n\n## Examples\n\n1. Lint the last 3 commits:\n\n  ```sh\n  $ lint-diff HEAD~3..HEAD\n  ```\n\n2. Lint local changes that are not yet commited (similar to what [lint-staged](https://github.com/okonet/lint-staged) do):\n\n  ```sh\n  $ lint-diff HEAD\n  # or\n  $ lint-diff\n  ```\n\n3. Lint all commits from a build in [Travis](https://travis-ci.org):\n\n  ```sh\n  # This environment variable will be available in any Travis build\n  $ lint-diff $TRAVIS_COMMIT_RANGE\n  ```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrvcoelho%2Flint-diff","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgrvcoelho%2Flint-diff","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrvcoelho%2Flint-diff/lists"}