Skip to content

Commit

Permalink
avoid extra newline
Browse files Browse the repository at this point in the history
  • Loading branch information
SimenB committed Sep 7, 2023
1 parent 9e3ddfa commit f24ea7f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/create-jest/src/generateConfigFile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,16 @@ const stringifyOption = (
): string => {
const description = descriptions[option];
const optionDescription =
description != null && description.length > 0 ? ` // ${description}` : '';
description != null && description.length > 0
? ` // ${description}\n`
: '';
const stringifiedObject = `${option}: ${JSON.stringify(
map[option],
null,
2,
)}`;

return `${optionDescription}\n${stringifiedObject
return `${optionDescription}${stringifiedObject
.split('\n')
.map(line => ` ${linePrefix}${line}`)
.join('\n')},`;
Expand Down

0 comments on commit f24ea7f

Please sign in to comment.