build: added basic husky + commitlint + lint-staged setup

This commit is contained in:
Ahmad 2025-03-17 21:05:32 -04:00
parent 0db2a4235f
commit f91ac5f04d
No known key found for this signature in database
GPG key ID: 8FD8A93530D182BF
7 changed files with 1095 additions and 11 deletions

5
.commitlintrc Normal file
View file

@ -0,0 +1,5 @@
{
"extends": [
"@commitlint/config-conventional"
]
}

1
.husky/commit-msg Normal file
View file

@ -0,0 +1 @@
yarn dlx commitlint --edit \

1
.husky/pre-commit Normal file
View file

@ -0,0 +1 @@
yarn lint-staged

1
.husky/pre-push Normal file
View file

@ -0,0 +1 @@
yarn compile

12
.lintstagedrc.mjs Normal file
View file

@ -0,0 +1,12 @@
import path from 'path';
import process from 'process';
const buildEslintCommand = (filenames) =>
`eslint ${filenames.map((f) => path.relative(process.cwd(), f))}`;
const prettierCommand = 'prettier --write';
export default {
'*.{js,mjs,ts,mts}': [prettierCommand, buildEslintCommand],
'*.{json}': [prettierCommand],
};

View file

@ -14,7 +14,8 @@
"restart": "pm2 restart poixpixel-discord-bot",
"lint": "npx eslint ./src && npx tsc --noEmit",
"format": "prettier --check --ignore-path .prettierignore .",
"format:fix": "prettier --write --ignore-path .prettierignore ."
"format:fix": "prettier --write --ignore-path .prettierignore .",
"prepare": "husky"
},
"dependencies": {
"@napi-rs/canvas": "^0.1.68",
@ -24,6 +25,8 @@
"pg": "^8.14.1"
},
"devDependencies": {
"@commitlint/cli": "^19.8.0",
"@commitlint/config-conventional": "^19.8.0",
"@eslint/eslintrc": "^3.3.0",
"@eslint/js": "^9.22.0",
"@microsoft/eslint-formatter-sarif": "^3.1.0",
@ -35,6 +38,8 @@
"eslint": "^9.22.0",
"eslint-config-prettier": "^10.1.1",
"globals": "^16.0.0",
"husky": "^9.1.7",
"lint-staged": "^15.5.0",
"prettier": "3.5.3",
"ts-node": "^10.9.2",
"tsx": "^4.19.3",

1079
yarn.lock

File diff suppressed because it is too large Load diff