mirror of
https://github.com/ahmadk953/poixpixel-discord-bot.git
synced 2025-04-02 09:44:14 +00:00
build: added basic husky + commitlint + lint-staged setup
This commit is contained in:
parent
0db2a4235f
commit
f91ac5f04d
7 changed files with 1095 additions and 11 deletions
5
.commitlintrc
Normal file
5
.commitlintrc
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
{
|
||||||
|
"extends": [
|
||||||
|
"@commitlint/config-conventional"
|
||||||
|
]
|
||||||
|
}
|
1
.husky/commit-msg
Normal file
1
.husky/commit-msg
Normal file
|
@ -0,0 +1 @@
|
||||||
|
yarn dlx commitlint --edit \
|
1
.husky/pre-commit
Normal file
1
.husky/pre-commit
Normal file
|
@ -0,0 +1 @@
|
||||||
|
yarn lint-staged
|
1
.husky/pre-push
Normal file
1
.husky/pre-push
Normal file
|
@ -0,0 +1 @@
|
||||||
|
yarn compile
|
12
.lintstagedrc.mjs
Normal file
12
.lintstagedrc.mjs
Normal 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],
|
||||||
|
};
|
|
@ -14,7 +14,8 @@
|
||||||
"restart": "pm2 restart poixpixel-discord-bot",
|
"restart": "pm2 restart poixpixel-discord-bot",
|
||||||
"lint": "npx eslint ./src && npx tsc --noEmit",
|
"lint": "npx eslint ./src && npx tsc --noEmit",
|
||||||
"format": "prettier --check --ignore-path .prettierignore .",
|
"format": "prettier --check --ignore-path .prettierignore .",
|
||||||
"format:fix": "prettier --write --ignore-path .prettierignore ."
|
"format:fix": "prettier --write --ignore-path .prettierignore .",
|
||||||
|
"prepare": "husky"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@napi-rs/canvas": "^0.1.68",
|
"@napi-rs/canvas": "^0.1.68",
|
||||||
|
@ -24,6 +25,8 @@
|
||||||
"pg": "^8.14.1"
|
"pg": "^8.14.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"@commitlint/cli": "^19.8.0",
|
||||||
|
"@commitlint/config-conventional": "^19.8.0",
|
||||||
"@eslint/eslintrc": "^3.3.0",
|
"@eslint/eslintrc": "^3.3.0",
|
||||||
"@eslint/js": "^9.22.0",
|
"@eslint/js": "^9.22.0",
|
||||||
"@microsoft/eslint-formatter-sarif": "^3.1.0",
|
"@microsoft/eslint-formatter-sarif": "^3.1.0",
|
||||||
|
@ -35,6 +38,8 @@
|
||||||
"eslint": "^9.22.0",
|
"eslint": "^9.22.0",
|
||||||
"eslint-config-prettier": "^10.1.1",
|
"eslint-config-prettier": "^10.1.1",
|
||||||
"globals": "^16.0.0",
|
"globals": "^16.0.0",
|
||||||
|
"husky": "^9.1.7",
|
||||||
|
"lint-staged": "^15.5.0",
|
||||||
"prettier": "3.5.3",
|
"prettier": "3.5.3",
|
||||||
"ts-node": "^10.9.2",
|
"ts-node": "^10.9.2",
|
||||||
"tsx": "^4.19.3",
|
"tsx": "^4.19.3",
|
||||||
|
|
Loading…
Add table
Reference in a new issue