prettier-plugin-solidity
Version:
A Prettier Plugin for automatically formatting your Solidity code.
10 lines • 534 B
JavaScript
import { doc } from 'prettier';
const { group, indent, softline } = doc.builders;
// This function will add an indentation to the `item` and separate it from the
// rest of the `doc` in most cases by a `softline`.
export function printSeparatedItem(item, { firstSeparator = softline, lastSeparator = firstSeparator, grouped = true } = {}) {
return grouped
? group([indent([firstSeparator, item]), lastSeparator])
: [indent([firstSeparator, item]), lastSeparator];
}
//# sourceMappingURL=print-separated-item.js.map