Skip to content

Commit

Permalink
feat(prettier): format CHANGELOG.md (#274)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: remove `.prettierignore` file
  • Loading branch information
ybiquitous authored Nov 18, 2018
1 parent a89ba5d commit be9a697
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 15 deletions.
1 change: 0 additions & 1 deletion .prettierignore

This file was deleted.

3 changes: 1 addition & 2 deletions lib/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class Init {
});

// update other keys
const keys = ["husky", "lint-staged"];
const keys = ["husky", "lint-staged", "standard-version"];
keys.forEach(key => {
if (!(key in packageInfo)) {
packageInfo[key] = {};
Expand Down Expand Up @@ -83,7 +83,6 @@ module.exports = async function init({
const cmd = new Init(cwd, logger);
await cmd.updatePackageFile();
await cmd.writePackageFile(".editorconfig");
await cmd.writePackageFile(".prettierignore");
await cmd.writePackageFile(".markdownlint.json");
await cmd.writeTemplateFile(".eslintrc.js");
await cmd.writeTemplateFile(".commitlintrc.js");
Expand Down
12 changes: 7 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,20 +69,22 @@
"git add"
],
"*.md": [
"markdownlint"
"markdownlint --ignore CHANGELOG.md"
],
"*.{html,json,md,yaml,yml}": [
"prettier --write",
"git add"
]
},
"ignore": [
"CHANGELOG.md"
]
}
},
"prettier": {
"trailingComma": "es5"
},
"standard-version": {
"scripts": {
"postchangelog": "prettier --write CHANGELOG.md"
}
},
"browserslist": [
"> 1%",
"not ie 11",
Expand Down
10 changes: 7 additions & 3 deletions test/fixtures/package-empty_expected.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,13 @@
"lint-staged": {
"linters": {
"*.{js,jsx,mjs}": ["eslint --fix --no-ignore", "git add"],
"*.md": ["markdownlint"],
"*.md": ["markdownlint --ignore CHANGELOG.md"],
"*.{html,json,md,yaml,yml}": ["prettier --write", "git add"]
},
"ignore": ["CHANGELOG.md"]
}
},
"standard-version": {
"scripts": {
"postchangelog": "prettier --write CHANGELOG.md"
}
}
}
10 changes: 7 additions & 3 deletions test/fixtures/package-normal_expected.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,13 @@
"*.css": "xyz",
"linters": {
"*.{js,jsx,mjs}": ["eslint --fix --no-ignore", "git add"],
"*.md": ["markdownlint"],
"*.md": ["markdownlint --ignore CHANGELOG.md"],
"*.{html,json,md,yaml,yml}": ["prettier --write", "git add"]
},
"ignore": ["CHANGELOG.md"]
}
},
"standard-version": {
"scripts": {
"postchangelog": "prettier --write CHANGELOG.md"
}
}
}
2 changes: 1 addition & 1 deletion test/init.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ test("init", t => {
t.end();
});

[".editorconfig", ".prettierignore", ".markdownlint.json"].forEach(file => {
[".editorconfig", ".markdownlint.json"].forEach(file => {
testInSandbox(`write "${file}"`, async (t, ctx) => {
await ctx.fixture("package-normal.json");
await init(ctx.initArgs);
Expand Down

0 comments on commit be9a697

Please sign in to comment.