@herb-tools/config 0.8.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.
- package/README.md +58 -0
- package/dist/herb-config.cjs +12736 -0
- package/dist/herb-config.cjs.map +1 -0
- package/dist/herb-config.esm.js +12712 -0
- package/dist/herb-config.esm.js.map +1 -0
- package/dist/package.json +49 -0
- package/dist/src/config-schema.js +39 -0
- package/dist/src/config-schema.js.map +1 -0
- package/dist/src/config.js +856 -0
- package/dist/src/config.js.map +1 -0
- package/dist/src/index.js +4 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/merge.js +41 -0
- package/dist/src/merge.js.map +1 -0
- package/dist/src/vscode.js +73 -0
- package/dist/src/vscode.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/dist/types/config-schema.d.ts +90 -0
- package/dist/types/config.d.ts +348 -0
- package/dist/types/index.d.ts +5 -0
- package/dist/types/merge.d.ts +11 -0
- package/dist/types/src/config-schema.d.ts +90 -0
- package/dist/types/src/config.d.ts +348 -0
- package/dist/types/src/index.d.ts +5 -0
- package/dist/types/src/merge.d.ts +11 -0
- package/dist/types/src/vscode.d.ts +13 -0
- package/dist/types/vscode.d.ts +13 -0
- package/package.json +49 -0
- package/src/config-schema.ts +51 -0
- package/src/config-template.yml +78 -0
- package/src/config.ts +1105 -0
- package/src/index.ts +17 -0
- package/src/merge.ts +47 -0
- package/src/vscode.ts +96 -0
- package/src/yaml.d.ts +9 -0
package/README.md
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# Herb Configuration
|
|
2
|
+
|
|
3
|
+
**Package**: [`@herb-tools/config`](https://www.npmjs.com/package/@herb-tools/config)
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
Shared configuration utilities for Herb. Provides a unified way to load, validate, and manage configuration across the Herb ecosystem including the linter, formatter, and language server.
|
|
8
|
+
|
|
9
|
+
## Installation
|
|
10
|
+
|
|
11
|
+
:::code-group
|
|
12
|
+
```shell [npm]
|
|
13
|
+
npm add @herb-tools/config
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
```shell [pnpm]
|
|
17
|
+
pnpm add @herb-tools/config
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
```shell [yarn]
|
|
21
|
+
yarn add @herb-tools/config
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
```shell [bun]
|
|
25
|
+
bun add @herb-tools/config
|
|
26
|
+
```
|
|
27
|
+
:::
|
|
28
|
+
|
|
29
|
+
## Usage
|
|
30
|
+
|
|
31
|
+
### `.herb.yml`
|
|
32
|
+
|
|
33
|
+
The configuration is stored in a `.herb.yml` file in the project root:
|
|
34
|
+
|
|
35
|
+
```yaml [.herb.yml]
|
|
36
|
+
version: 0.8.0
|
|
37
|
+
|
|
38
|
+
linter:
|
|
39
|
+
enabled: true
|
|
40
|
+
rules:
|
|
41
|
+
erb-no-extra-newline:
|
|
42
|
+
enabled: false
|
|
43
|
+
|
|
44
|
+
formatter:
|
|
45
|
+
enabled: true
|
|
46
|
+
indentWidth: 2
|
|
47
|
+
maxLineLength: 120
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Configuration Hierarchy
|
|
51
|
+
|
|
52
|
+
The Herb tools follow this configuration priority:
|
|
53
|
+
|
|
54
|
+
1. **Project configuration** (`.herb.yml` file) - Highest priority
|
|
55
|
+
2. **Editor settings** (VS Code workspace/user settings)
|
|
56
|
+
3. **Default settings** - Fallback when no other configuration exists
|
|
57
|
+
|
|
58
|
+
This allows teams to share consistent settings via `.herb.yml` while still allowing individual developer preferences when no project configuration exists.
|