@savvy-web/lint-staged 0.1.0

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 (5) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +89 -0
  3. package/index.d.ts +1742 -0
  4. package/index.js +1182 -0
  5. package/package.json +79 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Savvy Web Strategy, LLC
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,89 @@
1
+ # @savvy-web/lint-staged
2
+
3
+ Composable, configurable lint-staged handlers for pre-commit hooks.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ # Install the package and required peer dependency
9
+ npm install -D @savvy-web/lint-staged lint-staged
10
+
11
+ # For Biome handler (recommended)
12
+ npm install -D @biomejs/biome
13
+
14
+ # For Markdown handler (optional)
15
+ npm install -D markdownlint-cli2
16
+ ```
17
+
18
+ ## Quick Start
19
+
20
+ Use a preset for instant setup:
21
+
22
+ ```typescript
23
+ // lint-staged.config.ts
24
+ import { Preset } from '@savvy-web/lint-staged';
25
+
26
+ export default Preset.standard();
27
+ ```
28
+
29
+ Or compose individual handlers:
30
+
31
+ ```typescript
32
+ // lint-staged.config.ts
33
+ import { PackageJson, Biome, Markdown, Yaml } from '@savvy-web/lint-staged';
34
+
35
+ export default {
36
+ [PackageJson.glob]: PackageJson.handler,
37
+ [Biome.glob]: Biome.handler,
38
+ [Markdown.glob]: Markdown.handler,
39
+ [Yaml.glob]: Yaml.handler,
40
+ };
41
+ ```
42
+
43
+ ## Presets
44
+
45
+ | Preset | Handlers |
46
+ | ------ | -------- |
47
+ | `minimal()` | PackageJson, Biome |
48
+ | `standard()` | + Markdown, Yaml, PnpmWorkspace, ShellScripts |
49
+ | `full()` | + TypeScript, DesignDocs |
50
+
51
+ Extend any preset with options:
52
+
53
+ ```typescript
54
+ import { Preset } from '@savvy-web/lint-staged';
55
+
56
+ export default Preset.standard({
57
+ biome: { exclude: ['vendor/'] },
58
+ typescript: {}, // Enable TypeScript in standard
59
+ });
60
+ ```
61
+
62
+ ## Available Handlers
63
+
64
+ | Handler | Files | Description |
65
+ | ------- | ----- | ----------- |
66
+ | `PackageJson` | `**/package.json` | Sort and format with Biome |
67
+ | `Biome` | `*.{js,ts,jsx,tsx,json}` | Format and lint |
68
+ | `Markdown` | `**/*.{md,mdx}` | Lint with markdownlint-cli2 |
69
+ | `Yaml` | `**/*.{yml,yaml}` | Format and validate |
70
+ | `PnpmWorkspace` | `pnpm-workspace.yaml` | Sort and format |
71
+ | `ShellScripts` | `**/*.sh` | Manage permissions |
72
+ | `TypeScript` | `*.{ts,tsx}` | TSDoc validation + typecheck |
73
+ | `DesignDocs` | `.claude/design/**/*.md` | Validate structure |
74
+
75
+ ## Documentation
76
+
77
+ - [Handler Configuration](./docs/handlers.md) - Detailed options for each handler
78
+ - [Utilities](./docs/utilities.md) - Command, Filter, and advanced utilities
79
+ - [Configuration API](./docs/configuration.md) - createConfig and Preset APIs
80
+ - [Migration Guide](./docs/migration.md) - Migrating from raw lint-staged configs
81
+
82
+ ## Contributing
83
+
84
+ Contributions welcome! See [CONTRIBUTING.md](./CONTRIBUTING.md) for setup
85
+ and guidelines.
86
+
87
+ ## License
88
+
89
+ [MIT](./LICENSE)