How to use the editorconfig/lib/ini.parseSync function in editorconfig

To help you get started, we’ve selected a few editorconfig examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github lesnitsky / editorconfig-cli / lib / ECFile.js View on Github external
ECFile.readSync = function (folder) {
	var sections = ecparser.parseSync(path.join(folder, '.editorconfig'));
	var config = {
		root: false,
		sections: []
	};

	sections.forEach(function (section) {
		var sectionName = section[0];
		var rules = section[1];

		if (!sectionName) {
			if (rules.root) {
				config.root = true;
			}
			return;
		}