How to use the default function from prettier

Find comprehensive JavaScript prettier.default code examples handpicked from public code repositorys.

63
64
65
66
67
68
69
70
71
72
    .split("export type")
    .map(s => s.trim().split(" =")[0])
    .slice(1);
let guards = (0, utils_1.generateGuards)(typeNames, superstructNames);
console.log("\nFormatting files...");
guards = prettier_1.default.format(guards, { parser: "typescript" });
typescript = prettier_1.default.format(typescript, { parser: "typescript" });
superstruct = prettier_1.default.format(superstruct, { parser: "typescript" });
console.log("\nWriting files...");
yield fs.writeFile(outPathTS, typescript);
fork icon0
star icon0
watch icon1

+ 56 other calls in file

24
25
26
27
28
29
30
31
32
33
        return inner ? inner[1] : ascType;
    }))
        .filter(type => !type.startsWith('ethereum.') && !isNativeType(type));
    const importTypes = [...new Set(eventsTypes)].join(', ');
    return {
        [`${gluegun_1.strings.kebabCase(contract)}.test.ts`]: prettier_1.default.format(generateExampleTest(contract, events[0], indexEvents, importTypes), { parser: 'typescript', semi: false }),
        [`${gluegun_1.strings.kebabCase(contract)}-utils.ts`]: prettier_1.default.format(generateTestHelper(contract, events, importTypes), { parser: 'typescript', semi: false }),
    };
};
exports.generateTestsFiles = generateTestsFiles;
fork icon0
star icon0
watch icon0