feat: added commitlint and husky for linting commit messages

This commit is contained in:
Hackntosh 2023-09-30 14:31:02 -03:00
parent 119ab37daf
commit e31b7d083e
6 changed files with 2570 additions and 3 deletions

4
.husky/commit-msg Normal file
View file

@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"
npx --no -- commitlint --edit

3
commitlint.config.js Normal file
View file

@ -0,0 +1,3 @@
module.exports = {
extends: ['@commitlint/config-conventional'],
}

2554
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -13,6 +13,7 @@
"migrate:dev": "prisma migrate dev", "migrate:dev": "prisma migrate dev",
"migrate:dev:create": "prisma migrate dev --create-only", "migrate:dev:create": "prisma migrate dev --create-only",
"migrate:reset": "prisma migrate reset", "migrate:reset": "prisma migrate reset",
"prepare": "husky install",
"prisma:generate": "npx prisma generate", "prisma:generate": "npx prisma generate",
"prisma:seed": "prisma db seed", "prisma:seed": "prisma db seed",
"prisma:studio": "npx prisma studio", "prisma:studio": "npx prisma studio",
@ -28,6 +29,8 @@
"author": "Cookie", "author": "Cookie",
"license": "MIT", "license": "MIT",
"devDependencies": { "devDependencies": {
"@commitlint/cli": "^17.7.2",
"@commitlint/config-conventional": "^17.7.0",
"@faker-js/faker": "^8.0.2", "@faker-js/faker": "^8.0.2",
"@swc/cli": "^0.1.62", "@swc/cli": "^0.1.62",
"@swc/core": "^1.3.66", "@swc/core": "^1.3.66",
@ -51,6 +54,7 @@
"eslint-plugin-n": "^16.0.1", "eslint-plugin-n": "^16.0.1",
"eslint-plugin-prettier": "^5.0.0", "eslint-plugin-prettier": "^5.0.0",
"eslint-plugin-promise": "^6.1.1", "eslint-plugin-promise": "^6.1.1",
"husky": "^8.0.3",
"nodemon": "^3.0.1", "nodemon": "^3.0.1",
"pm2": "^4.2.3", "pm2": "^4.2.3",
"prettier": "^3.0.0", "prettier": "^3.0.0",

View file

@ -17,6 +17,7 @@ async function postFetchInfoService(
select: { select: {
displayName: true, displayName: true,
username: true, username: true,
profileImage: true,
}, },
}, },
}, },

View file

@ -15,6 +15,13 @@ async function userFetchPostsService(
content: true, content: true,
createdAt: true, createdAt: true,
updatedAt: true, updatedAt: true,
author: {
select: {
displayName: true,
username: true,
profileImage: true,
},
},
}, },
}) })
return posts return posts