Skip to content

Commit

Permalink
fix: limit code block line formatting to 80 chars
Browse files Browse the repository at this point in the history
  • Loading branch information
a-hariti committed May 27, 2024
1 parent 74c358b commit 7e3ec09
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/remark-format-code.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,11 @@ async function formatCode(node) {
}

try {
const formattedCode = await format(node.value, {...prettierConfig, ...parserConfig});
const formattedCode = await format(node.value, {
...prettierConfig,
...parserConfig,
printWidth: 80,
});
// get rid of the trailing newline
node.value = formattedCode.trimEnd();
} catch (e) {
Expand Down

0 comments on commit 7e3ec09

Please sign in to comment.