Ensure every rendering/utility path uses the correct configuration namespace and that config values are passed explicitly (not implicitly via global getters or captured/stale variables).
Practical rules:
config.flowchart.htmlLabels, the code that affects label sizing must read the same path (and the same key name).config/needed flags as parameters so helpers are deterministic and easy to test.const conf = getConfig().<section> once if it can be initialized later; fetch/use config at the correct lifecycle or keep the prior approach.config.block, not config.flowchart).Example pattern (config injection):
// Bad: internal utility reaches out to global config
import { getConfig } from '../config.js';
function preprocessMarkdown(markdown: string) {
const markdownAutoWrap = getConfig().markdownAutoWrap;
// ...
}
// Good: pass only what you need
function preprocessMarkdown(markdown: string, markdownAutoWrap: boolean) {
// ...
}
// Call site
const { markdownAutoWrap } = getConfig();
preprocessMarkdown(markdown, markdownAutoWrap);
Enter the URL of a public GitHub repository