-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature : Husky & Prettier Addition - For formatting code (#25)
Co-authored-by: Pritish Budhiraja - Juspay <[email protected]> Co-authored-by: Jeeva Ramachandran <[email protected]> Co-authored-by: Jeeva Ramachandran <[email protected]>
- Loading branch information
1 parent
3b93b72
commit 9e2cb7b
Showing
42 changed files
with
82,550 additions
and
32,789 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,16 @@ | ||
{ | ||
"presets": [ | ||
"@babel/preset-env", | ||
"@babel/preset-react" | ||
"presets": ["@babel/preset-env", "@babel/preset-react"], | ||
"plugins": [ | ||
[ | ||
"module-resolver", | ||
{ | ||
"root": ["./src"], | ||
"alias": { | ||
"test": "./test", | ||
"underscore": "lodash" | ||
} | ||
} | ||
], | ||
"plugins": [ | ||
[ | ||
"module-resolver", | ||
{ | ||
"root": [ | ||
"./src" | ||
], | ||
"alias": { | ||
"test": "./test", | ||
"underscore": "lodash" | ||
} | ||
} | ||
], | ||
"@babel/plugin-transform-async-to-generator" | ||
] | ||
} | ||
"@babel/plugin-transform-async-to-generator" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/bin/sh | ||
|
||
echo "~~~~**** Commit hook started ****~~~~" | ||
|
||
commit_msg_file=$1 | ||
commit_msg=$(cat "$commit_msg_file") | ||
|
||
|
||
# For formatting your code | ||
npx prettier --write . | ||
npm run re:format | ||
|
||
# Define your commit message convention (e.g., starts with "feature:", "fix:", etc.) | ||
commit_regex="^(merge-commit|feature|bugfix|chore|docs|style|refactor|test|enhancement).+" | ||
|
||
if ! echo "$commit_msg" | grep -E "$commit_regex" ; then | ||
echo "Aborting commit. Your commit message does not follow the conventional format." | ||
echo "Example - <feature>: <subject> - <description>" | ||
exit 1 | ||
fi | ||
|
||
# If the commit message matches the convention, the script exits successfully. | ||
echo "~~~~**** Commit hook completed ****~~~~" | ||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,4 +22,4 @@ | |
"mixpanel": false, | ||
"business_profile": false, | ||
"generate_report": false | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
module.exports = { | ||
testEnvironment: "jsdom", | ||
moduleFileExtensions: ["js", "mjs"], | ||
testMatch: ["**/tests/**/*Test.bs.js"], | ||
testEnvironment: "jsdom", | ||
moduleFileExtensions: ["js", "mjs"], | ||
testMatch: ["**/tests/**/*Test.bs.js"], | ||
}; |
Oops, something went wrong.