Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: adjust the prettier config #437

Merged
merged 1 commit into from
Feb 4, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
let isASample = true;
console.log(isASample);
2 changes: 1 addition & 1 deletion test/kitchen.ts
Original file line number Diff line number Diff line change
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