Skip to content

Commit

Permalink
chore: add eslint, prettier, commitizen, standard-version, and husky
Browse files Browse the repository at this point in the history
  • Loading branch information
wd-David committed Jun 18, 2022
1 parent a56c484 commit 968e93d
Show file tree
Hide file tree
Showing 11 changed files with 3,645 additions and 518 deletions.
3 changes: 3 additions & 0 deletions .czrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"path": "cz-conventional-changelog"
}
11 changes: 11 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"root": true,
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint", "prettier"],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"prettier"
]
}
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 --no -- commitlint --edit
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

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

pnpm test
7 changes: 7 additions & 0 deletions .lintstagedrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"*.{js,ts,md,json}": [
"prettier --write",
"prettier --check"
],
"src/**/*.{js,ts}": "eslint"
}
6 changes: 6 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"semi": false,
"trailingComma": "none",
"singleQuote": true,
"printWidth": 80
}
47 changes: 47 additions & 0 deletions .versionrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
"types": [
{
"type": "feat",
"section": "✨ Features"
},
{
"type": "fix",
"section": "🐛 Bug Fixes"
},
{
"type": "chore",
"hidden": false,
"section": "🚚 Chores"
},
{
"type": "docs",
"hidden": false,
"section": "📝 Documentation"
},
{
"type": "style",
"hidden": false,
"section": "💄 Styling"
},
{
"type": "refactor",
"hidden": false,
"section": "♻️ Code Refactoring"
},
{
"type": "perf",
"hidden": false,
"section": "⚡️ Performance Improvements"
},
{
"type": "test",
"hidden": false,
"section": "✅ Testing"
},
{
"type": "build",
"hidden": false,
"section": "🔨 Build System"
}
]
}
2 changes: 2 additions & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// eslint-disable-next-line no-undef
module.exports = { extends: ['@commitlint/config-conventional'] }
21 changes: 20 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,13 @@
"repository": "https://github.com/davipon/esbuild-plugin-pino",
"bugs": "https://github.com/davipon/esbuild-plugin-pino/issues",
"scripts": {
"prepare": "husky install",
"build": "tsc",
"test": "rm -rf dist && tsc && vitest run"
"test": "rm -rf dist && tsc && vitest run",
"format": "prettier --write 'src/**/*.{js,ts,json,md}'",
"lint": "prettier --check 'src/**/*.{js,ts,json,md}' && eslint --ignore-path .gitignore .",
"cz": "cz",
"release": "standard-version --no-verify"
},
"keywords": [
"pino",
Expand All @@ -19,12 +24,26 @@
"author": "David Peng <[email protected]>",
"license": "MIT",
"devDependencies": {
"@commitlint/cli": "^17.0.2",
"@commitlint/config-conventional": "^17.0.2",
"@commitlint/cz-commitlint": "^17.0.0",
"@types/node": "^18.0.0",
"@typescript-eslint/eslint-plugin": "^5.28.0",
"@typescript-eslint/parser": "^5.28.0",
"commitizen": "^4.2.4",
"esbuild": "^0.14.45",
"eslint": "^8.18.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-prettier": "^4.0.0",
"execa": "^6.1.0",
"husky": "^8.0.1",
"inquirer": "^8.2.4",
"lint-staged": "^13.0.2",
"pino": "^8.0.0",
"pino-loki": "^2.0.0",
"pino-pretty": "^8.0.0",
"prettier": "^2.7.1",
"standard-version": "^9.5.0",
"thread-stream": "^1.0.0",
"tsx": "^3.4.3",
"typescript": "^4.7.3",
Expand Down
Loading

0 comments on commit 968e93d

Please sign in to comment.