Skip to content

Commit

Permalink
chore: set up git hooks (#4)
Browse files Browse the repository at this point in the history
# 🤖 Linear

Closes GRT-32

## Description
Configures `husky` with a `pre-commit` and `commit-msg` hooks to lint
staged files and to check for conventional commits respectively.
  • Loading branch information
0xyaco authored Jul 18, 2024
1 parent 851f98c commit 8c8a0ff
Show file tree
Hide file tree
Showing 7 changed files with 3,423 additions and 1,524 deletions.
3 changes: 3 additions & 0 deletions .commitlintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": ["@commitlint/config-conventional"]
}
45 changes: 21 additions & 24 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,26 +1,23 @@
/** @type {import('eslint').Linter.Config} */
module.exports = {
parser: '@typescript-eslint/parser',
parserOptions: {
project: 'tsconfig.json',
tsconfigRootDir: __dirname,
sourceType: 'module',
},
plugins: ['@typescript-eslint/eslint-plugin'],
extends: [
'plugin:@typescript-eslint/recommended',
'plugin:prettier/recommended',
],
root: true,
env: {
node: true,
},
ignorePatterns: ['.eslintrc.js'],
rules: {
'@typescript-eslint/interface-name-prefix': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-unused-vars': ["error", { argsIgnorePattern: "_+" }],
},
};
parser: "@typescript-eslint/parser",
parserOptions: {
project: "tsconfig.json",
tsconfigRootDir: __dirname,
sourceType: "module",
},
plugins: ["@typescript-eslint/eslint-plugin"],
extends: ["plugin:@typescript-eslint/recommended", "plugin:prettier/recommended"],
root: true,
env: {
node: true,
},
ignorePatterns: [".eslintrc.js"],
rules: {
"@typescript-eslint/interface-name-prefix": "off",
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-unused-vars": ["error", { argsIgnorePattern: "_+" }],
},
};
1 change: 1 addition & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pnpm exec commitlint --edit $1
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pnpm lint-staged
57 changes: 33 additions & 24 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,25 +1,34 @@
{
"name": "ebo-agent",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"lint": "turbo run lint",
"format": "turbo run format"
},
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
"@ianvs/prettier-plugin-sort-imports": "4.3.1",
"@typescript-eslint/eslint-plugin": "7.16.1",
"@typescript-eslint/parser": "7.16.1",
"eslint": "8.57.0",
"eslint-config-prettier": "9.1.0",
"eslint-plugin-prettier": "5.2.1",
"prettier": "3.3.3",
"turbo": "2.0.7"
},
"packageManager": "[email protected]+sha512.140036830124618d624a2187b50d04289d5a087f326c9edfc0ccd733d76c4f52c3a313d4fc148794a2a9d81553016004e6742e8cf850670268a7387fc220c903"
}
"name": "ebo-agent",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"prepare": "husky",
"lint": "turbo run lint",
"format": "turbo run format"
},
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
"@commitlint/cli": "19.3.0",
"@commitlint/config-conventional": "19.2.2",
"@ianvs/prettier-plugin-sort-imports": "4.3.1",
"@typescript-eslint/eslint-plugin": "7.16.1",
"@typescript-eslint/parser": "7.16.1",
"eslint": "8.57.0",
"eslint-config-prettier": "9.1.0",
"eslint-plugin-prettier": "5.2.1",
"husky": "9.1.0",
"lint-staged": "15.2.7",
"prettier": "3.3.3",
"turbo": "2.0.7"
},
"lint-staged": {
"*": "prettier --write --ignore-unknown",
"*.js,*.ts": "eslint --fix"
},
"packageManager": "[email protected]+sha512.140036830124618d624a2187b50d04289d5a087f326c9edfc0ccd733d76c4f52c3a313d4fc148794a2a9d81553016004e6742e8cf850670268a7387fc220c903"
}
Loading

0 comments on commit 8c8a0ff

Please sign in to comment.