{"id":13801499,"url":"https://github.com/paleite/eslint-plugin-diff","last_synced_at":"2026-03-03T13:02:28.566Z","repository":{"id":38378867,"uuid":"284860029","full_name":"paleite/eslint-plugin-diff","owner":"paleite","description":"Run ESLint on your changes only","archived":false,"fork":false,"pushed_at":"2026-02-28T16:46:01.000Z","size":1137,"stargazers_count":209,"open_issues_count":6,"forks_count":19,"subscribers_count":3,"default_branch":"main","last_synced_at":"2026-02-28T19:44:37.878Z","etag":null,"topics":["diff","eslint","eslint-plugin","eslint-plugin-diff","git"],"latest_commit_sha":null,"homepage":"https://npm.im/eslint-plugin-diff","language":"TypeScript","has_issues":true,"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/paleite.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2020-08-04T02:45:30.000Z","updated_at":"2026-02-28T16:46:04.000Z","dependencies_parsed_at":"2023-10-10T14:43:51.817Z","dependency_job_id":"8ce2072a-dfec-4a6a-a83c-aef0ff4a0a8f","html_url":"https://github.com/paleite/eslint-plugin-diff","commit_stats":{"total_commits":205,"total_committers":10,"mean_commits":20.5,"dds":"0.14146341463414636","last_synced_commit":"6f4dc2c9f3d6d5a5530d3d0053148646b90c6757"},"previous_names":[],"tags_count":60,"template":false,"template_full_name":null,"purl":"pkg:github/paleite/eslint-plugin-diff","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paleite%2Feslint-plugin-diff","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paleite%2Feslint-plugin-diff/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paleite%2Feslint-plugin-diff/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paleite%2Feslint-plugin-diff/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/paleite","download_url":"https://codeload.github.com/paleite/eslint-plugin-diff/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paleite%2Feslint-plugin-diff/sbom","scorecard":{"id":718296,"data":{"date":"2025-08-11","repo":{"name":"github.com/paleite/eslint-plugin-diff","commit":"1e4fa827441512947085e3ad3b4ad18d82ffe38b"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.7,"checks":[{"name":"Code-Review","score":0,"reason":"Found 1/11 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Security-Policy","score":4,"reason":"security policy file detected","details":["Info: security policy file detected: SECURITY.md:1","Warn: no linked content found","Info: Found disclosure, vulnerability, and/or timelines in security policy: SECURITY.md:1","Info: Found text in security policy: SECURITY.md:1"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: third-party GitHubAction not pinned by hash: .github/workflows/auto-merge.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/paleite/eslint-plugin-diff/auto-merge.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:41: update your workflow using https://app.stepsecurity.io/secureworkflow/paleite/eslint-plugin-diff/codeql-analysis.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:45: update your workflow using https://app.stepsecurity.io/secureworkflow/paleite/eslint-plugin-diff/codeql-analysis.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:56: update your workflow using https://app.stepsecurity.io/secureworkflow/paleite/eslint-plugin-diff/codeql-analysis.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:70: update your workflow using https://app.stepsecurity.io/secureworkflow/paleite/eslint-plugin-diff/codeql-analysis.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/eslint-plugin-diff.yml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/paleite/eslint-plugin-diff/eslint-plugin-diff.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/eslint-plugin-diff.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/paleite/eslint-plugin-diff/eslint-plugin-diff.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/nodejs-ci.yml:20: update your workflow using https://app.stepsecurity.io/secureworkflow/paleite/eslint-plugin-diff/nodejs-ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/nodejs-ci.yml:23: update your workflow using https://app.stepsecurity.io/secureworkflow/paleite/eslint-plugin-diff/nodejs-ci.yml/main?enable=pin","Info:   0 out of   8 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 third-party GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Info: jobLevel 'contents' permission set to 'read': .github/workflows/codeql-analysis.yml:29","Info: jobLevel 'actions' permission set to 'read': .github/workflows/codeql-analysis.yml:28","Warn: topLevel 'contents' permission set to 'write': .github/workflows/auto-merge.yml:5","Warn: no topLevel permission defined: .github/workflows/codeql-analysis.yml:1","Warn: no topLevel permission defined: .github/workflows/eslint-plugin-diff.yml:1","Warn: no topLevel permission defined: .github/workflows/nodejs-ci.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE.md:0","Info: FSF or OSI recognized license: MIT License: LICENSE.md:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":7,"reason":"SAST tool detected but not run on all commits","details":["Info: SAST configuration detected: CodeQL","Warn: 4 commits out of 22 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":5,"reason":"5 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-pfrx-2q88-qq97","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-52f5-9888-hmc6"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-22T10:25:29.641Z","repository_id":38378867,"created_at":"2025-08-22T10:25:29.642Z","updated_at":"2025-08-22T10:25:29.642Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30046325,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-03T10:53:31.691Z","status":"ssl_error","status_checked_at":"2026-03-03T10:53:22.041Z","response_time":61,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["diff","eslint","eslint-plugin","eslint-plugin-diff","git"],"created_at":"2024-08-04T00:01:23.508Z","updated_at":"2026-03-03T13:02:28.547Z","avatar_url":"https://github.com/paleite.png","language":"TypeScript","funding_links":[],"categories":["Plugins","TypeScript"],"sub_categories":["Misc"],"readme":"# eslint-plugin-diff\n\n![](https://img.shields.io/npm/dt/eslint-plugin-diff?style=flat-square\u0026logo=npm\u0026logoColor=white)\n[![codecov](https://codecov.io/gh/paleite/eslint-plugin-diff/branch/main/graph/badge.svg?token=W0LPKHZCF5)](https://codecov.io/gh/paleite/eslint-plugin-diff)\n\nLint what changed, not the entire codebase. `eslint-plugin-diff` keeps feedback focused by filtering ESLint output to changed lines.\n\n## Why this matters\n\n- Focused feedback: keep lint output tied to changed code.\n- Safer lint upgrades: avoid being blocked by legacy violations in untouched files.\n- Better developer flow: reduce noise while enforcing existing lint rules.\n\n## Quick start\n\n### Install\n\n```sh\nnpm install --save-dev eslint eslint-plugin-diff\n```\n\n### Flat config (ESLint 9+)\n\n```js\nimport diff from \"eslint-plugin-diff\";\n\nexport default [\n  // ...your existing config\n  ...diff.configs[\"flat/diff\"],\n];\n```\n\n### Legacy config (`.eslintrc.*`)\n\n```json\n{\n  \"extends\": [\"plugin:diff/diff\"]\n}\n```\n\n## What it does and how it works\n\nThis plugin does not provide lint rules. It provides ESLint processors and preset configs.\n\nBehavior:\n\n1. It computes changed files from `git diff --name-only`.\n2. It skips unchanged files in processor `preprocess` (performance optimization).\n3. It filters lint messages in `postprocess` to changed line ranges from diff hunks.\n4. Untracked files are treated as changed, so their messages are not filtered out.\n\n## Modes\n\n| Mode     | Legacy config        | Flat config              | Typical use                              |\n| -------- | -------------------- | ------------------------ | ---------------------------------------- |\n| `diff`   | `plugin:diff/diff`   | `configs[\"flat/diff\"]`   | Local dev against working tree changes   |\n| `ci`     | `plugin:diff/ci`     | `configs[\"flat/ci\"]`     | PR CI diff-only in CI, full lint locally |\n| `staged` | `plugin:diff/staged` | `configs[\"flat/staged\"]` | Pre-commit staged-only workflows         |\n\nImportant `staged` caveat: if a file has unstaged changes, the plugin emits a fatal message:\n`\u003cfile\u003e has unstaged changes. Please stage or remove the changes.`\n\n## Environment variables and CI autodetection\n\n### `ESLINT_PLUGIN_DIFF_COMMIT`\n\nSets diff base commit-ish. Default: `HEAD`.\n\n```sh\nESLINT_PLUGIN_DIFF_COMMIT=\"origin/main\" npx eslint --max-warnings=0 .\n```\n\n### `CI`\n\n`ci` mode behavior:\n\n- `CI` set: active diff filtering.\n- `CI` not set: no-op processor (lint everything).\n\nIf `CI` is set and `ESLINT_PLUGIN_DIFF_COMMIT` is not set, the plugin attempts provider-based target branch detection and fetches from `origin` before diffing.\n\n### `VSCODE_PID`\n\nWhen set, the plugin can refresh the initial diff snapshot once to avoid delayed diagnostics in editor workflows.\n\n## Recipes\n\n### Local diff vs default base (`HEAD`)\n\n```sh\nnpx eslint --max-warnings=0 .\n```\n\n### Local diff vs main\n\n```sh\nESLINT_PLUGIN_DIFF_COMMIT=\"origin/main\" npx eslint --max-warnings=0 .\n```\n\n### Pre-commit staged-only\n\nUse `plugin:diff/staged` or `configs[\"flat/staged\"]`.\n\n### PR CI with autodetect (`ci` mode)\n\nUse `plugin:diff/ci` or `configs[\"flat/ci\"]` and run ESLint normally in CI.\n\n### PR CI with explicit base\n\n```sh\ngit fetch --quiet origin main\nESLINT_PLUGIN_DIFF_COMMIT=\"main\" npx eslint --max-warnings=0 .\n```\n\n### Compose with another processor (for example Vue)\n\nWhen a file type needs another processor, compose it with `diff` instead of\noverriding one processor with another.\n\n```js\nimport diffPlugin from \"eslint-plugin-diff\";\nimport vuePlugin from \"eslint-plugin-vue\";\n\nconst vueProcessor = vuePlugin.processors.vue ?? vuePlugin.processors[\".vue\"];\n\nexport default [\n  ...vuePlugin.configs[\"flat/recommended\"],\n  ...diffPlugin.configs[\"flat/diff\"].map((config) =\u003e ({\n    ...config,\n    ignores: [\"**/*.vue\"],\n  })),\n  {\n    files: [\"**/*.vue\"],\n    processor: diffPlugin.composeProcessor(vueProcessor, \"diff\"),\n  },\n];\n```\n\n## Compatibility and trade-offs\n\n- ESLint allows one processor per file. If another integration requires a\n  processor for the same files, compose processors (see recipe above) or scope\n  one of them by file patterns.\n- Diff-only linting is a signal-over-completeness strategy. It can miss issues outside changed lines. Many teams run full lint in scheduled jobs or on protected branches.\n\n## Troubleshooting\n\n### “Too many CI providers found (...)”\n\nSet `ESLINT_PLUGIN_DIFF_COMMIT` explicitly.\n\n### “`\u003cfile\u003e has unstaged changes. Please stage or remove the changes.`”\n\nThis comes from `staged` mode with partially staged files.\n\n### Editor diagnostics appear late\n\n`VSCODE_PID` enables a one-time diff refresh path intended to reduce this.\n\n## FAQ\n\n### Does this replace ESLint rules?\n\nNo. Your normal rules stay the same. This plugin changes which files/lines can surface diagnostics.\n\n### Does `ci` mode always filter diffs?\n\nNo. Outside CI it is intentionally a no-op so local linting stays complete.\n\n## License\n\nMIT. See `LICENSE.md`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpaleite%2Feslint-plugin-diff","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpaleite%2Feslint-plugin-diff","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpaleite%2Feslint-plugin-diff/lists"}