Configure language-specific overrides in JavaScript
mainSettings in the JavaScript implementation can be structured as a shallow tree to allow language-specific overrides. Top-level settings apply to all languages unless overridden in a language-specific block (e.g., html, css, or js).
Example configuration structure:
{
"indent_size": 4,
"html": {
"end_with_newline": true,
"js": {
"indent_size": 2
}
}
}In this example, HTML files inherit an indent_size of 4 but set end_with_newline to true. JavaScript code embedded within HTML will inherit the HTML settings but override indent_size to 2.
{
"indent_size": 4,
"html": {
"end_with_newline": true,
"js": {
"indent_size": 2
},
"css": {
"indent_size": 2
}
},
"css": {
"indent_size": 1
},
"js": {
"preserve-newlines": true
}
}