@theholocron/lint-staged-config
v7.6.1
Published
A Lint Staged configuration for linting code that has been staged in Git within the Galaxy.
Maintainers
Readme
Lint Staged Config
A lint-staged configuration for running linters on Git-staged files.
Installation
npm install --save-dev @theholocron/lint-staged-config lint-staged huskyUsage
1. Set up Husky
npx husky init2. Wire lint-staged into the pre-commit hook
Replace the contents of .husky/pre-commit with:
pnpm exec lint-stagedThen create a lint-staged.config.js at your project root:
export { default } from "@theholocron/lint-staged-config";What runs on staged files
| File pattern | Commands |
| -------------- | ------------------------------- |
| *.{js,jsx} | prettier --write, eslint |
| *.{ts,tsx} | prettier --write, eslint |
| *.css | stylelint --fix |
| *.scss | stylelint --syntax=scss --fix |
| *.{md,mdx} | prettier --write |
| package.json | sort-package-json |
