Skip to content

Commit

Permalink
integrated prettier / pretty-quick
Browse files Browse the repository at this point in the history
  • Loading branch information
claasahl committed Jan 13, 2019
1 parent 6c720f0 commit 37c6f24
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 1 deletion.
35 changes: 35 additions & 0 deletions build/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion build/index.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import execa from "execa";
import init from "init-package-json";
import path from "path";
import fs from "fs";

const HOME = process.env.HOME || ".";
// a path to a promzard module. In the event that this file is
Expand All @@ -26,8 +27,23 @@ const configData = { yes: true, silent: true };
init(dir, initFile, configData, function(_er, _data) {
// the data's already been written to {dir}/package.json
// now you can do stuff with it
const packageFile = path.resolve(dir, "package.json");
const husky = {
hooks: {
"pre-commit": "pretty-quick --staged"
}
};
fs.writeFileSync(packageFile, { husky, ..._data });

(async () => {
await execa("npm", ["install", "typescript", "@types/node", "--save-dev"]);
await execa("tsc", ["--init"]);
await execa("npm", [
"install",
"prettier",
"pretty-quick",
"husky",
"--save-dev"
]);
})();
});

0 comments on commit 37c6f24

Please sign in to comment.