Skip to content

Commit a1b99c7

Browse files
authored
Merge pull request #233 from htmlhint/dev/coliff/add-config-file-path
feat: Add Config file path option
2 parents 546fec5 + 069f719 commit a1b99c7

File tree

4 files changed

+15
-3
lines changed

4 files changed

+15
-3
lines changed

htmlhint-server/src/server.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ interface Settings {
1414
configFile: string;
1515
enable: boolean;
1616
options: any;
17+
optionsFile: string;
1718
};
1819
[key: string]: any;
1920
}
@@ -109,6 +110,8 @@ function getConfiguration(filePath: string): any {
109110
Object.keys(settings.htmlhint.options).length > 0
110111
) {
111112
options = settings.htmlhint.options;
113+
} else if (settings.htmlhint && settings.htmlhint.optionsFile) {
114+
options = loadConfigurationFile(settings.htmlhint.optionsFile);
112115
} else {
113116
options = findConfigForHtmlFile(filePath);
114117
}

htmlhint/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
All notable changes to the "vscode-htmlhint" extension will be documented in this file.
44

5+
### v1.4.2 (2025-06-04)
6+
7+
- Fixes missing config file path option. You could now specify a custom path to your `.htmlhintrc` file in the extension settings. e.g. `"htmlhint.optionsFile": "your-project-subfolder/.htmlhintrc"`
8+
59
### v1.4.1 (2025-06-04)
610

711
- Minor optimizations and code cleanup

htmlhint/package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

htmlhint/package.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"displayName": "HTMLHint",
44
"description": "VS Code integration for HTMLHint - A Static Code Analysis Tool for HTML",
55
"icon": "images/icon.png",
6-
"version": "1.4.1",
6+
"version": "1.4.2",
77
"publisher": "HTMLHint",
88
"galleryBanner": {
99
"color": "#333333",
@@ -54,6 +54,11 @@
5454
"type": "object",
5555
"default": {},
5656
"description": "The HTMLHint options object to provide args to the HTMLHint command."
57+
},
58+
"htmlhint.optionsFile": {
59+
"type": "string",
60+
"default": null,
61+
"description": "The HTMLHint options config file path."
5762
}
5863
}
5964
},

0 commit comments

Comments
 (0)