git: add husky & precommit hook

This commit is contained in:
Chika 2022-05-08 21:23:38 +03:00
parent 38c2356aca
commit ff6a669c1e
5 changed files with 14 additions and 1 deletions

4
.husky/pre-commit Normal file
View File

@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
yarn precommit

View File

@ -1,3 +1,4 @@
/* eslint-disable import/no-unresolved */
import styled from 'styled-components';
import { Flex } from 'UIKit/grid';
import { min } from 'UIKit/mq';

View File

@ -1,4 +1,5 @@
/* eslint-disable react/prop-types */
/* eslint-disable import/no-unresolved */
import styled from 'styled-components';
import { Flex } from 'UIKit/grid';
import { min } from 'UIKit/mq';

View File

@ -11,7 +11,8 @@
"prettier": "prettier --write .",
"precommit": "yarn prettier && yarn lint:fix",
"graphql:codegen": "apollo client:codegen --target typescript",
"graphql:schema": "apollo client:download-schema services/crm/graphql/schema.graphql"
"graphql:schema": "apollo client:download-schema services/crm/graphql/schema.graphql",
"prepare": "husky install"
},
"dependencies": {
"@ant-design/icons": "^4.7.0",
@ -50,6 +51,7 @@
"eslint-config-next": "12.1.5",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-prettier": "^4.0.0",
"husky": "^7.0.4",
"msw": "^0.39.2",
"prettier": "2.6.2",
"typescript": "4.6.3"

View File

@ -3259,6 +3259,11 @@ human-signals@^2.1.0:
resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-2.1.0.tgz#dc91fcba42e4d06e4abaed33b3e7a3c02f514ea0"
integrity sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==
husky@^7.0.4:
version "7.0.4"
resolved "https://registry.yarnpkg.com/husky/-/husky-7.0.4.tgz#242048245dc49c8fb1bf0cc7cfb98dd722531535"
integrity sha512-vbaCKN2QLtP/vD4yvs6iz6hBEo6wkSzs8HpRah1Z6aGmF2KW5PdYuAd7uX5a+OyBZHBhd+TFLqgjUgytQr4RvQ==
hyperlinker@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/hyperlinker/-/hyperlinker-1.0.0.tgz#23dc9e38a206b208ee49bc2d6c8ef47027df0c0e"