-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Configure Husky and Prettier formatting
- Loading branch information
Showing
14 changed files
with
1,168 additions
and
299 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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
build | ||
dist/* | ||
.idea/* | ||
.vscode | ||
node_modules/* |
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,25 @@ | ||
{ | ||
"env": { | ||
"es2021": true, | ||
"node": true | ||
}, | ||
"extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended"], | ||
"parser": "@typescript-eslint/parser", | ||
"parserOptions": { | ||
"sourceType": "module" | ||
}, | ||
"plugins": ["@typescript-eslint"], | ||
"rules": { | ||
"indent": ["error", "tab"], | ||
"linebreak-style": ["error", "windows"], | ||
"quotes": ["error", "double"], | ||
"semi": ["error", "always"], | ||
"@typescript-eslint/no-explicit-any": "off", | ||
"no-const-assign": "error", | ||
"max-len": ["warn", { "code": 120, "ignoreUrls": true, "ignoreRegExpLiterals": true }], | ||
"no-unused-vars": "error", | ||
"no-console": "error", | ||
"no-duplicate-imports": ["error", { "includeExports": true }], | ||
"default-case": "error" | ||
} | ||
} |
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,38 @@ | ||
#!/bin/sh | ||
. "$(dirname "$0")/_/husky.sh" | ||
|
||
echo '๐๏ธ๐ท Hi, my name is Bob. I am responsible for styling, testing and building your project before commit' | ||
|
||
# Check Prettier standards | ||
npm run check-format || | ||
( | ||
echo '๐คข๐คฎ Prettier Check Failed. Your code styling not looking good. ๐คข๐คฎ Run npm run format, add changes and try commit again.'; | ||
false; | ||
) | ||
|
||
# Check ESLint Standards | ||
npm run check-lint || | ||
( | ||
echo '๐ค๐ ESLint Check Failed. Your code may have some linting issues. ๐๐ค Make the required changes listed above, add changes and try to commit again.' | ||
false; | ||
) | ||
|
||
# Check tsconfig standards | ||
npm run check-types || | ||
( | ||
echo 'โโ Failed Type check. โโ Are you seriously trying to write that? Make the changes required above.' | ||
false; | ||
) | ||
|
||
# If everything passes... Now we can commit | ||
echo '๐ค๐ค Alright.... Code looks good to me... Trying to build now. ๐ค๐ค' | ||
|
||
npm run build || | ||
( | ||
echo '๐จโ Better call Bob... Because your build failed ๐จโ Next build failed: View the errors above to see why.' | ||
false; | ||
) | ||
|
||
# If everything passes... Now we can commit | ||
echo 'โ โ You win this time... I am committing this now. โ โ ' | ||
|
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,5 @@ | ||
build | ||
dist/* | ||
.idea/* | ||
.vscode | ||
node_modules/* |
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,9 @@ | ||
{ | ||
"trailingComma": "es5", | ||
"tabWidth": 2, | ||
"useTabs": true, | ||
"semi": true, | ||
"singleQuote": false, | ||
"printWidth": 120, | ||
"arrowParens": "always" | ||
} |
Oops, something went wrong.