| description | Modern alternatives to lint-staged for running commands on staged Git files |
|---|
nano-staged is a tiny pre-commit runner for staged (and more) files; much smaller and faster than lint-staged, with a simple config.
package.json config:
{
"lint-staged": { // [!code --]
"nano-staged": { // [!code ++]
"*.{js,ts}": ["prettier --write"]
},
}Note
Differences to be aware of:
lint-stagedhas advanced features like backup stashing, partial-staging handling, per-directory configs in monorepos, and detailed concurrency controls.nano-stagedfocuses on simplicity and speed. If you rely onlint-staged’s stash/partial-staging features, keep usinglint-staged.