Skip to content

Commit 0b9c9f0

Browse files
authored
Docs: Clean up references to old settings/configs (marcoroth#943)
With the `.herb.yml` we combined the settings into a single configuration file, which refactored away the `.herb-lsp/config.json` and some of the VS Code-specific settings.
1 parent 2eb68cb commit 0b9c9f0

File tree

4 files changed

+22
-154
lines changed

4 files changed

+22
-154
lines changed

javascript/packages/language-server/README.md

Lines changed: 15 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -49,19 +49,10 @@ After installing the Herb Language Server (see below) and [Sublime LSP](http://l
4949
],
5050
"selector": "text.html.ruby | text.html.rails",
5151
"settings": {
52-
"languageServerHerb.linter": {
53-
"enabled": true,
54-
"excludedRules": ["parser-no-errors"]
55-
}
56-
},
57-
"initializationOptions": {
58-
"enabledFeatures": {
59-
"diagnostics": true,
60-
},
61-
"experimentalFeaturesEnabled": true
52+
"languageServerHerb.linter.enabled": true
6253
}
6354
}
64-
},
55+
}
6556
}
6657
```
6758

@@ -119,31 +110,21 @@ npx @herb-tools/language-server --stdio
119110

120111
## Configuration
121112

122-
The language server can be configured using a `.herb-lsp/config.json` file in your project root. This file is automatically created when the language server starts if it doesn't exist.
123-
124-
### Formatter Configuration
113+
The language server can be configured using a `.herb.yml` file in your project root. This configuration is shared across all Herb tools including the linter, formatter, and language server.
125114

126-
You can configure formatting behavior by adding a `formatter` section to your config:
115+
See the [Configuration documentation](https://herb-tools.dev/configuration) for full details.
127116

128-
```json
129-
{
130-
"version": "0.3.1",
131-
"createdAt": "2025-06-29T00:00:00.000Z",
132-
"updatedAt": "2025-06-29T00:00:00.000Z",
133-
"options": {
134-
"formatter": {
135-
"enabled": true,
136-
"indentWidth": 2,
137-
"maxLineLength": 80
138-
}
139-
}
140-
}
141-
```
117+
### Example Configuration
142118

143-
#### `formatter` Options
119+
```yaml
120+
# .herb.yml
121+
linter:
122+
enabled: true
144123

145-
- `enabled` (`boolean`): Enable or disable formatting for this project. Defaults to `false`.
146-
- `indentWidth` (`number`): Number of spaces for each indentation level. Defaults to `2`.
147-
- `maxLineLength` (`number`): Maximum line length before wrapping. Defaults to `80`.
124+
formatter:
125+
enabled: true
126+
indentWidth: 2
127+
maxLineLength: 80
128+
```
148129
149-
**Note**: VS Code users can also control formatting globally through the `languageServerHerb.formatter.enabled` setting in VS Code preferences. Formatting is currently in **Beta** and disabled by default.
130+
**Note**: VS Code users can also control settings through `languageServerHerb.*` settings in VS Code preferences. Project configuration in `.herb.yml` takes precedence over editor settings.

javascript/packages/language-server/src/config.ts

Lines changed: 0 additions & 109 deletions
This file was deleted.

javascript/packages/language-server/src/server.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@ export class Server {
8989
watchers: [
9090
...patterns,
9191
{ globPattern: `**/.herb.yml` },
92-
{ globPattern: `**/**/.herb-lsp/config.json` },
9392
{ globPattern: `**/.herb/rules/**/*.mjs` },
9493
{ globPattern: `**/.herb/rewriters/**/*.mjs` },
9594
],
@@ -119,7 +118,7 @@ export class Server {
119118

120119
this.connection.onDidChangeWatchedFiles(async (params) => {
121120
for (const event of params.changes) {
122-
const isConfigChange = event.uri.endsWith("/.herb.yml") || event.uri.endsWith("/.herb-lsp/config.json")
121+
const isConfigChange = event.uri.endsWith("/.herb.yml")
123122
const isCustomRuleChange = event.uri.includes("/.herb/rules/")
124123
const isCustomRewriterChange = event.uri.includes("/.herb/rewriters/")
125124

javascript/packages/vscode/README.md

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,27 +18,24 @@ If you are looking to use Herb in another editor, check out the instructions on
1818

1919
## Configuration
2020

21-
### Linter Settings
21+
The extension can be configured through VS Code settings or a `.herb.yml` file in your project root. Project configuration in `.herb.yml` takes precedence over VS Code settings.
2222

23-
You can configure the linter behavior through VS Code settings:
23+
See the [Configuration documentation](https://herb-tools.dev/configuration) for full details.
24+
25+
### VS Code Settings
2426

2527
* `languageServerHerb.linter.enabled` (boolean, default: `true`) - Enable/disable the linter
26-
* `languageServerHerb.linter.excludedRules` (string[], default: `["parser-no-errors"]`) - Array of linter rule names to exclude from diagnostics
28+
* `languageServerHerb.formatter.enabled` (boolean, default: `false`) - Enable/disable the formatter
2729

2830
#### Example configuration in `settings.json`:
2931

3032
```json
3133
{
3234
"languageServerHerb.linter.enabled": true,
33-
"languageServerHerb.linter.excludedRules": [
34-
"parser-no-errors",
35-
"html-tag-name-lowercase"
36-
]
35+
"languageServerHerb.formatter.enabled": true
3736
}
3837
```
3938

40-
**Note:** The `parser-no-errors` rule is excluded by default to prevent duplicate error reporting, since parser errors are already displayed through the language server's built-in diagnostics.
41-
4239
## Functionality
4340

4441
#### Diagnostics

0 commit comments

Comments
 (0)