From 0ed5df04ad0e62ccdad9e44654bb4059c5b37f36 Mon Sep 17 00:00:00 2001 From: Naseem Date: Tue, 2 Jun 2020 22:27:52 -0400 Subject: [PATCH] fix: add empty line at end of generated .prettierrc.js Signed-off-by: Naseem --- src/init.ts | 3 ++- test/kitchen.ts | 7 ++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/init.ts b/src/init.ts index 1eaf5182..b7b5fa4f 100644 --- a/src/init.ts +++ b/src/init.ts @@ -245,7 +245,8 @@ async function generateTsConfig(options: Options): Promise { async function generatePrettierConfig(options: Options): Promise { const style = `module.exports = { ...require('gts/.prettierrc.json') -}`; +} +`; return generateConfigFile(options, './.prettierrc.js', style); } diff --git a/test/kitchen.ts b/test/kitchen.ts index c0bdcca9..c0d6dbe2 100644 --- a/test/kitchen.ts +++ b/test/kitchen.ts @@ -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( @@ -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 () => {