Created
November 26, 2021 07:04
-
-
Save vojty/8572bd78721381b1338df34bb6997540 to your computer and use it in GitHub Desktop.
Prettier node usage
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import prettierConfig from './.prettierrc' | |
const code = 'const foo = 1; const bar = 2;' | |
const out = prettier.format(code, { | |
...prettierConfig, | |
parser: 'typescript' | |
}) | |
console.log(out) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment