{"data":{"slug":"lint-staged-lint-staged","name":"lint-staged","tagline":"Run tasks like formatters and linters against staged git files","github_url":"https://github.com/lint-staged/lint-staged","owner":"lint-staged","repo":"lint-staged","owner_avatar_url":"https://avatars.githubusercontent.com/u/142687600?v=4","primary_language":"JavaScript","stars":14731,"forks":473,"topics":["developer-experience","eslint","git","linter","stage-files","stylelint","workflow"],"archived":false,"github_pushed_at":"2026-09-12T18:34:33+00:00","maintenance_label":"Very active","stars_delta_30d":24,"url":"https://www.graphcanon.com/tools/lint-staged-lint-staged","markdown_url":"https://www.graphcanon.com/tools/lint-staged-lint-staged.md","api_url":"https://www.graphcanon.com/api/graphcanon/tools/lint-staged-lint-staged","graph_url":"https://www.graphcanon.com/api/graphcanon/graph?tool=lint-staged-lint-staged","description":"🚫💩 — Run tasks like formatters and linters against staged git files","homepage_url":"https://www.npmjs.com/package/lint-staged","license":"MIT","open_issues":6,"watchers":39,"ai_summary":"Lint-staged executes code formatters and linters on the Git staged files, ensuring consistent coding styles.","readme_excerpt":"## Installation and setup\n\nTo install _lint-staged_ in the recommended way, you need to:\n\n1. Install _lint-staged_ itself:\n   - `npm install --save-dev lint-staged`\n1. Set up the `pre-commit` git hook to run _lint-staged_\n   - [Husky](https://github.com/typicode/husky) is a popular choice for configuring git hooks\n   - Read more about git hooks [here](https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks)\n1. Install some tools like [ESLint](https://eslint.org) or [Prettier](https://prettier.io)\n1. Configure _lint-staged_ to run code checkers and other tasks:\n   - for example: `{ \"*.js\": \"eslint\" }` to run ESLint for all staged JS files\n   - See [Configuration](#configuration) for more info\n\nDon't forget to commit changes to `package.json` and `.husky` to share this setup with your team!\n\nNow change a few files, `git add` or `git add --patch` some of them to your commit, and try to `git commit` them.\n\nSee [examples](#examples) and [configuration](#configuration) for more information.\n\n> [!CAUTION]  \n> _Lint-staged_ runs `git` operations affecting the files in your repository. By default _lint-staged_ creates a `git stash` as a backup of the original state before running any configured tasks to help prevent data loss.","github_created_at":"2016-01-15T07:51:21+00:00","created_at":"2026-07-15T10:45:57.645494+00:00","updated_at":"2026-09-20T04:26:47.94822+00:00","categories":[{"slug":"developer-tools","name":"Developer Tools","url":"https://www.graphcanon.com/categories/developer-tools","markdown_url":"https://www.graphcanon.com/categories/developer-tools.md","api_url":"https://www.graphcanon.com/api/graphcanon/categories/developer-tools"}],"tags":[{"slug":"eslint","name":"eslint"},{"slug":"git","name":"git"},{"slug":"linter","name":"linter"},{"slug":"stage-files","name":"stage-files"},{"slug":"stylelint","name":"stylelint"},{"slug":"workflow","name":"workflow"}],"trust":{"provenance":{"is_fork":false,"github_id":49704723,"owner_type":"Organization","methodology":"github_public_v1","parent_repo":null,"near_duplicate_slugs":[]},"computed_at":"2026-09-14T06:00:38.225Z","maintenance":{"label":"Very active","score":96,"methodology":"github_public_v1","releases_90d":8,"days_since_push":1,"last_release_at":"2026-09-10T11:30:01Z","stars_delta_30d":24,"open_issues_delta_30d":-2},"security_summary":{"status":"ok","scanner":"osv@v1","low_count":0,"high_count":0,"last_scan_at":"2026-07-15T10:45:59.117Z","medium_count":0,"scan_profile":"deps","critical_count":0}},"capability_facts":{"mcp":{"source":"repo_scan","observed_at":"2026-09-14T06:00:38.689Z","server_manifest":false},"scan":{"source":"repo_scan","observed_at":"2026-09-14T06:00:38.689Z"},"has_cli":{"value":true,"source":"package.json:bin|scripts","observed_at":"2026-09-14T06:00:38.689Z"},"languages":{"value":["javascript"],"source":"github.language+package.json","observed_at":"2026-09-14T06:00:38.689Z"},"license_spdx":{"value":"MIT","source":"github.license","observed_at":"2026-09-14T06:00:38.689Z"}},"decision_facts":{"hosting":null,"pricing":null,"requirements":{"notes":["Requires installation via npm --save-dev lint-staged","Setting up a pre-commit Git hook, preferably with Husky, is essential for this tool's operation"],"requires_docker":false},"constraints":{"requires_docker":false},"when_to_use":["When you want automated linting and formatting of only the staged git files before they are committed, ensuring consistent code practices across a team","If your workflow involves the use of tools such as ESLint or Prettier for maintaining code quality and style standards"],"when_not_to_use":["When you need to lint or format all modified files in the project regardless of their staging status, as lint-staged operates exclusively on staged Git files","If your team's development practices do not include using Git hooks extensively since lint-staged relies on pre-commit git hooks for its functionality"],"source":"enrich:decision_facts","observed_at":"2026-07-16T19:19:35.057Z"},"constraint_facets":{"requires_docker":false},"decision_summary":[{"label":"Requirements","value":"Requires installation via npm --save-dev lint-staged; Setting up a pre-commit Git hook, preferably with Husky, is essential for this tool's operation"},{"label":"Adopt for","value":"Lint-staged executes tasks like formatters and linters on Git staged files to enforce coding style consistency."},{"label":"License detail","value":"MIT License"}]}}