diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100755 index 0000000..ff28b2e --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1,5 @@ +#!/usr/bin/env sh +. "$(dirname -- "$0")/_/husky.sh" + +npm test +npm run lint diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 0000000..c9d8250 --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +v14.17.0 \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 186fcf8..84409a0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6286,6 +6286,12 @@ "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==" }, + "husky": { + "version": "8.0.3", + "resolved": "https://registry.npmjs.org/husky/-/husky-8.0.3.tgz", + "integrity": "sha512-+dQSyqPh4x1hlO1swXBiNb2HzTDN1I2IGLQx1GrBuiqFJfoMrnZWwVmatvSiO+Iz8fBUnf+lekwNo4c2LlXItg==", + "dev": true + }, "iconv-lite": { "version": "0.4.24", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", diff --git a/package.json b/package.json index d609497..05f199a 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,9 @@ "test:cov": "env CI=true react-scripts test --coverage", "eject": "react-scripts eject", "lint": "eslint .", - "lint:fix": "eslint . --fix" + "lint:fix": "eslint . --fix", + "prepare": "husky install", + "postinstall": "husky install" }, "eslintConfig": { "extends": [ @@ -58,6 +60,7 @@ "@types/react-syntax-highlighter": "^15.5.5", "eslint-config-prettier": "^8.5.0", "eslint-plugin-prettier": "^4.2.1", - "prettier": "^2.7.1" + "prettier": "^2.7.1", + "husky": "^8.0.0" } }