Skip to content

Commit

Permalink
fix: use .prettierrc.js (#437)
Browse files Browse the repository at this point in the history
  • Loading branch information
JustinBeckwith committed Feb 4, 2020
1 parent fe3a5b4 commit 06efa84
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 5 deletions.
File renamed without changes.
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -11,7 +11,7 @@
"CHANGELOG.md",
"build/src",
"build/template",
"prettier.config.js",
".prettierrc.js",
"tsconfig-google.json",
"tsconfig.json",
".eslintrc.json"
Expand Down
6 changes: 3 additions & 3 deletions src/init.ts
Expand Up @@ -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(
Expand Down Expand Up @@ -239,10 +239,10 @@ async function generateTsConfig(options: Options): Promise<void> {

async function generatePrettierConfig(options: Options): Promise<void> {
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(
Expand Down
2 changes: 2 additions & 0 deletions test/fixtures/kitchen/src/samples.js
@@ -0,0 +1,2 @@
let isASample = true;
console.log(isASample);
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, 'prettier.config.js'));
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 06efa84

Please sign in to comment.