@helderberto/lefthook-config 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +39 -2
  3. package/package.json +1 -1
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2026 Helder Burato Berto
3
+ Copyright (c) 2026 Helder Berto
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -1,5 +1,42 @@
1
1
  # @helderberto/lefthook-config
2
2
 
3
- Pre-commit hooks that format and lint staged files, for npm and pnpm projects.
3
+ [![npm](https://img.shields.io/npm/v/@helderberto/lefthook-config)](https://www.npmjs.com/package/@helderberto/lefthook-config)
4
4
 
5
- Setup, profile by profile: [docs/usage.md](https://github.com/helderberto/coding-standards/blob/main/docs/usage.md).
5
+ Pre-commit hooks for npm and pnpm projects: Prettier formats staged files, and ESLint lints staged TypeScript. Nothing checks commit messages.
6
+
7
+ ## Install
8
+
9
+ ```sh
10
+ npm install -D @helderberto/lefthook-config lefthook
11
+ ```
12
+
13
+ ## Use
14
+
15
+ ```yaml
16
+ # lefthook.yml
17
+ extends:
18
+ - node_modules/@helderberto/lefthook-config/lefthook.yml
19
+ ```
20
+
21
+ The hooks call these scripts through `npm run`, which works whichever package manager installed them:
22
+
23
+ ```json
24
+ // package.json
25
+ {
26
+ "scripts": {
27
+ "prepare": "lefthook install",
28
+ "format:staged": "prettier --write --ignore-unknown",
29
+ "lint:staged": "eslint --no-warn-ignored"
30
+ }
31
+ }
32
+ ```
33
+
34
+ ## Moving from husky
35
+
36
+ Husky sets `core.hooksPath` in each clone's git config, and `lefthook install` refuses to run while it's set, so `npm install` fails at `prepare`. Run this once in every existing clone:
37
+
38
+ ```sh
39
+ git config --unset core.hooksPath
40
+ ```
41
+
42
+ Fresh clones and CI aren't affected.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@helderberto/lefthook-config",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "repository": {