Skip to content

Commit

Permalink
fix: add empty line at end of generated .prettierrc.js
Browse files Browse the repository at this point in the history
Signed-off-by: Naseem <naseem@transit.app>
  • Loading branch information
Naseem committed Jun 3, 2020
1 parent 6424eba commit 0ed5df0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/init.ts
Expand Up @@ -245,7 +245,8 @@ async function generateTsConfig(options: Options): Promise<void> {
async function generatePrettierConfig(options: Options): Promise<void> {
const style = `module.exports = {
...require('gts/.prettierrc.json')
}`;
}
`;
return generateConfigFile(options, './.prettierrc.js', style);
}

Expand Down
7 changes: 6 additions & 1 deletion test/kitchen.ts
Expand Up @@ -105,7 +105,7 @@ describe('🚰 kitchen sink', () => {
}
});

it('should terminate generated json files with newline', () => {
it('should terminate generated files with newline', () => {
const GTS = path.resolve(stagingPath, gtsPath);
spawn.sync(GTS, ['init', '-y'], execOpts);
assert.ok(
Expand All @@ -128,6 +128,11 @@ describe('🚰 kitchen sink', () => {
.readFileSync(path.join(kitchenPath, '.eslintignore'), 'utf8')
.endsWith('\n')
);
assert.ok(
fs
.readFileSync(path.join(kitchenPath, '.prettierrc.js'), 'utf8')
.endsWith('\n')
);
});

it('should check before fix', async () => {
Expand Down

0 comments on commit 0ed5df0

Please sign in to comment.