diff --git a/.husky/.gitignore b/.husky/.gitignore new file mode 100644 index 0000000000..31354ec138 --- /dev/null +++ b/.husky/.gitignore @@ -0,0 +1 @@ +_ diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100755 index 0000000000..36af219892 --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1,4 @@ +#!/bin/sh +. "$(dirname "$0")/_/husky.sh" + +npx lint-staged diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 0000000000..0967ef424b --- /dev/null +++ b/.prettierrc @@ -0,0 +1 @@ +{} diff --git a/package.json b/package.json index 9906a09da7..baa46c9a15 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,8 @@ "main": "index.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1", - "dev": "babel-watch curve.js" + "dev": "babel-watch curve.js", + "prepare": "husky install" }, "author": "", "license": "ISC", @@ -36,5 +37,13 @@ "underscore": "^1.13.1", "web3": "^1.5.3" }, - "description": "" + "description": "", + "devDependencies": { + "husky": ">=6", + "lint-staged": ">=10", + "prettier": "^2.4.1" + }, + "lint-staged": { + "*.{js,css,md,json,yml,yaml}": "prettier --write" + } }