From e826b0d1389392e2adc081434c5d7a8378f4cb44 Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Mon, 3 Feb 2020 20:20:52 -0800 Subject: [PATCH] fix: use .prettierrc.js --- prettier.config.js => .prettierrc.js | 0 package.json | 2 +- src/init.ts | 6 +++--- test/fixtures/kitchen/src/samples.js | 2 ++ test/kitchen.ts | 2 +- 5 files changed, 7 insertions(+), 5 deletions(-) rename prettier.config.js => .prettierrc.js (100%) create mode 100644 test/fixtures/kitchen/src/samples.js diff --git a/prettier.config.js b/.prettierrc.js similarity index 100% rename from prettier.config.js rename to .prettierrc.js diff --git a/package.json b/package.json index 3b6c3c94..fdeed196 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "CHANGELOG.md", "build/src", "build/template", - "prettier.config.js", + ".prettierrc.js", "tsconfig-google.json", "tsconfig.json", ".eslintrc.json" diff --git a/src/init.ts b/src/init.ts index 657c9989..9e41186d 100644 --- a/src/init.ts +++ b/src/init.ts @@ -179,7 +179,7 @@ async function writePackageJson( } export const ESLINT_CONFIG = { - extends: './node_modules/gts/build/src/index.js', + extends: './node_modules/gts/', }; async function generateConfigFile( @@ -239,10 +239,10 @@ async function generateTsConfig(options: Options): Promise { async function generatePrettierConfig(options: Options): Promise { const style = await read( - path.join(__dirname, '../../prettier.config.js'), + path.join(__dirname, '../../.prettierrc.js'), 'utf8' ); - return generateConfigFile(options, './prettier.config.js', style); + return generateConfigFile(options, './.prettierrc.js', style); } export async function installDefaultTemplate( diff --git a/test/fixtures/kitchen/src/samples.js b/test/fixtures/kitchen/src/samples.js new file mode 100644 index 00000000..0361cfc7 --- /dev/null +++ b/test/fixtures/kitchen/src/samples.js @@ -0,0 +1,2 @@ +let isASample = true; +console.log(isASample); diff --git a/test/kitchen.ts b/test/kitchen.ts index 10474e82..e0f3c34b 100644 --- a/test/kitchen.ts +++ b/test/kitchen.ts @@ -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, 'prettier.config.js')); + fs.accessSync(path.join(kitchenPath, '.prettierrc.js')); // Compilation shouldn't have happened. Hence no `build` directory. const dirContents = fs.readdirSync(kitchenPath);