Skip to content

Commit

Permalink
fix: emit .prettierrc.js with init (#462)
Browse files Browse the repository at this point in the history
  • Loading branch information
JustinBeckwith committed Mar 21, 2020
1 parent 9b2247a commit b114614
Show file tree
Hide file tree
Showing 3 changed files with 82 additions and 83 deletions.
154 changes: 77 additions & 77 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 4 additions & 5 deletions src/init.ts
Expand Up @@ -237,11 +237,10 @@ async function generateTsConfig(options: Options): Promise<void> {
}

async function generatePrettierConfig(options: Options): Promise<void> {
const style = await read(
path.join(__dirname, '../../.prettierrc.json'),
'utf8'
);
return generateConfigFile(options, './.prettierrc.json', style);
const style = `module.exports = {
...require('gts/.prettierrc.json')
}`;
return generateConfigFile(options, './.prettierrc.js', style);
}

export async function installDefaultTemplate(
Expand Down
2 changes: 1 addition & 1 deletion test/kitchen.ts
Expand Up @@ -60,7 +60,7 @@ describe('🚰 kitchen sink', () => {
// Ensure config files got generated.
fs.accessSync(path.join(kitchenPath, 'tsconfig.json'));
fs.accessSync(path.join(kitchenPath, '.eslintrc.json'));
fs.accessSync(path.join(kitchenPath, '.prettierrc.json'));
fs.accessSync(path.join(kitchenPath, '.prettierrc.js'));

// Compilation shouldn't have happened. Hence no `build` directory.
const dirContents = fs.readdirSync(kitchenPath);
Expand Down

0 comments on commit b114614

Please sign in to comment.