diff --git a/lib/init.js b/lib/init.js index c0cbc500..43f049e6 100644 --- a/lib/init.js +++ b/lib/init.js @@ -49,7 +49,7 @@ const initCommand = (baseDir, logger) => { }); // update other keys - const keys = ["husky", "lint-staged", "remarkConfig"]; + const keys = ["husky", "lint-staged", "prettier", "remarkConfig"]; keys.forEach(key => { if (!(key in packageInfo)) { packageInfo[key] = {}; diff --git a/test/fixtures/package-empty_expected.json b/test/fixtures/package-empty_expected.json index 64ada26b..f01ae76a 100644 --- a/test/fixtures/package-empty_expected.json +++ b/test/fixtures/package-empty_expected.json @@ -29,6 +29,9 @@ }, "ignore": ["CHANGELOG.md"] }, + "prettier": { + "trailingComma": "es5" + }, "remarkConfig": { "plugins": [ "remark-preset-lint-markdown-style-guide", diff --git a/test/fixtures/package-normal_expected.json b/test/fixtures/package-normal_expected.json index 1d93034f..be88faad 100644 --- a/test/fixtures/package-normal_expected.json +++ b/test/fixtures/package-normal_expected.json @@ -30,6 +30,9 @@ }, "ignore": ["CHANGELOG.md"] }, + "prettier": { + "trailingComma": "es5" + }, "remarkConfig": { "plugins": [ "remark-preset-lint-markdown-style-guide",