Skip to content

Commit

Permalink
Merge pull request #32 from inove-jr/husky
Browse files Browse the repository at this point in the history
Configura o Husky
  • Loading branch information
paulohebert authored Jul 11, 2024
2 parents 2ba2b23 + 8fecb6a commit 443d425
Show file tree
Hide file tree
Showing 10 changed files with 2,689 additions and 66 deletions.
4 changes: 4 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx commitlint --edit $1
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname "$0")/_/husky.sh"

npx lint-staged
4 changes: 4 additions & 0 deletions .husky/prepare-commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

(exec < /dev/tty && npx cz --hook) || true
11 changes: 11 additions & 0 deletions .lintstagedrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
const path = require("path");

const buildEslintCommand = (filenames) =>
`next lint --fix --file ${filenames
.map((f) => path.relative(process.cwd(), f))
.join(" --file ")}`;

module.exports = {
"*.{js,jsx,ts,tsx}": ["prettier --write", buildEslintCommand],
"*.{json,mjs,md,css,yml}": "prettier --write",
};
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package-lock.json
yarn.lock
node_modules
2 changes: 1 addition & 1 deletion .prettierrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
"semi": true,
"tabWidth": 2,
"singleQuote": false,
"jsxSingleQuote": true,
"jsxSingleQuote": false,
"plugins": ["prettier-plugin-tailwindcss"]
}
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,17 @@ npm run dev
#### Realizar a tarefa

- Realize os commits necessários na branch da tarefa

```bash
git commit
```

- Envie as modificações para o GitHub

```bash
git push
```

#### Criar um Pull Request

1. Selecione a branch da tarefa
Expand Down
1 change: 1 addition & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = { extends: ["@commitlint/config-conventional"] };
Loading

0 comments on commit 443d425

Please sign in to comment.