Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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();
}