Skip to content

Commit 70dea29

Browse files
Merge pull request #54 from leandrosimoes/chore/add-pre-commit-linting
chore(): added husky config to lint and commit lint
2 parents 9b4ced1 + b3983fa commit 70dea29

File tree

5 files changed

+889
-22
lines changed

5 files changed

+889
-22
lines changed

.husky/commit-msg

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/usr/bin/env sh
2+
. "$(dirname -- "$0")/_/husky.sh"
3+
4+
cd package
5+
yarn commitlint --edit $1

.husky/pre-commit

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/usr/bin/env sh
2+
. "$(dirname -- "$0")/_/husky.sh"
3+
4+
cd package
5+
yarn lint

package/.commitlintrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"extends": ["@commitlint/config-conventional"]
3+
}

package/package.json

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
"typings": "index.d.ts",
88
"scripts": {
99
"lint": "eslint . --ext .js,.jsx,.ts,.tsx",
10-
"lint:fix": "eslint . --ext .js,.jsx,.ts,.tsx --fix"
10+
"lint:fix": "eslint . --ext .js,.jsx,.ts,.tsx --fix",
11+
"prepare": "cd .. && husky install && cd package"
1112
},
1213
"repository": {
1314
"type": "git",
@@ -32,20 +33,23 @@
3233
"react-native": ">=0.69.0"
3334
},
3435
"devDependencies": {
35-
"react": "^18.0.0",
36-
"react-native": "^0.69.0",
36+
"@commitlint/cli": "^17.3.0",
37+
"@commitlint/config-conventional": "^17.3.0",
38+
"@react-native-community/eslint-config": "^3.0.3",
3739
"@types/react-native": "^0.69.0",
3840
"@types/react-redux": "^7.1.24",
3941
"eslint": "^8.18.0",
4042
"eslint-config-airbnb": "^19.0.4",
4143
"eslint-config-prettier": "^8.5.0",
4244
"eslint-import-resolver-node": "^0.3.6",
43-
"@react-native-community/eslint-config": "^3.0.3",
4445
"eslint-plugin-import": "^2.26.0",
4546
"eslint-plugin-jsx-a11y": "^6.6.0",
47+
"eslint-plugin-prettier": "^4.0.0",
4648
"eslint-plugin-react": "^7.30.1",
4749
"eslint-plugin-react-hooks": "^4.6.0",
48-
"eslint-plugin-prettier": "^4.0.0",
49-
"prettier": "^2.7.1"
50+
"husky": "^8.0.2",
51+
"prettier": "^2.7.1",
52+
"react": "^18.0.0",
53+
"react-native": "^0.69.0"
5054
}
5155
}

0 commit comments

Comments
 (0)