{"repo":"lint-staged/lint-staged","free":true,"listed":false,"github":"https://github.com/lint-staged/lint-staged","clone":"git clone https://github.com/lint-staged/lint-staged.git","description":"🚫💩 — Run tasks like formatters and linters against staged git files","language":"JavaScript","stars":14710,"topics":["stage-files","linter","stylelint","eslint","git","developer-experience","workflow"],"license":"MIT","category":"dev-tools","readme_excerpt":"🚫💩 lint-staged Run tasks like formatters and linters against staged git files and don't let :poop: slip into your code base! [!Tip] Do you only want to check staged files for errors, but not edit them automatically? You might be interested in this simpler shell script: lint-staged.sh . Table of Contents - Why - Installation and setup - Changelog - Command line flags - Configuration - Filtering files - What commands are supported? - Running multiple commands in a sequence - Using JS configuration files - Reformatting the code - Examples - Frequently Asked Questions Why Code quality tasks like formatters and linters make more sense when run before committing your code. By doing so you can ensure no errors go into the repository and enforce code style. But running a task on a whole project can be slow, and opinionated tasks such as linting can sometimes produce irrelevant results. Ultimately you only want to check files that will be committed. This project contains a script that will run arbitrary shell tasks with a list of staged files as an argument, filtered by a specified glob pattern. Related blog posts and talks - Introductory Medium post - Andrey Okonetchnikov, 2016 - Running Jest Tests Before Each Git Commit - Ben McCormick, 2017 - AgentConf presentation - Andrey Okonetchnikov, 2018 - SurviveJS interview - Juho Vepsäläinen and Andrey Okonetchnikov, 2018 - Prettier your CSharp with dotnet-format and lint-staged Installation and setup To install lint-staged in the recomm","default_branch":null,"files":null,"tree":[],"storefront":"/r/lint-staged","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/lint-staged/lint-staged/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}