How to use the mrm-core.ini function in mrm-core

To help you get started, we’ve selected a few mrm-core 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 sapegin / mrm / src / tasks / editorconfig / index.js View on Github external
indent_style: 'tab',
				}
			: {
					indent_style: 'space',
					indent_size: indent,
				},
		{
			end_of_line: 'lf',
			charset: 'utf-8',
			trim_trailing_whitespace: true,
			insert_final_newline: true,
		}
	);

	// .editorconfig
	const editorconfig = ini('.editorconfig', 'editorconfig.org');
	editorconfig.set('root', true).set('*', generalRules);

	// Set/update JSON-like section
	const jsonSection = editorconfig.get().find(section => /json/.test(section));
	if (jsonSection) {
		editorconfig.unset(jsonSection);
	}
	editorconfig.set('*.{' + jsonExtensions.join(',') + '}', jsonRules);

	editorconfig.save();
}