Skip to content

Commit

Permalink
feat: update husky and husky scripts (#127)
Browse files Browse the repository at this point in the history
* feat: Add devDependencies for commitlint and husky

Added "@commitlint/cli": "^19.3.0" and "@commitlint/config-conventional": "^19.2.2"
as devDependencies to enforce conventional commit messages and hook for git actions.

* refactor(vscode): Update default formatter to dbaeumer.vscode-eslint

Remove unnecessary configurations and update the default formatter setting in
the vscode settings file to dbaeumer.vscode-eslint for better code formatting.

* feat: Add linting fix and typechecking to pre-commit hook.
  • Loading branch information
nexmoe authored May 7, 2024
1 parent dac5391 commit 878b2d4
Show file tree
Hide file tree
Showing 7 changed files with 453 additions and 106 deletions.
1 change: 1 addition & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pnpm dlx commitlint --edit \
2 changes: 2 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
pnpm lint:fix
pnpm typecheck
38 changes: 1 addition & 37 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"[vue]": {
"editor.defaultFormatter": "Vue.volar"
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
},
"[js]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
Expand All @@ -14,47 +14,11 @@
"editor.quickSuggestions": {
"strings": true
},
"volar.autoCompleteRefs": true,
"prisma.fileWatcher": true,
// Enable the ESlint flat config support
"eslint.experimental.useFlatConfig": true,

// Disable the default formatter, use eslint instead
"prettier.enable": false,
"editor.formatOnSave": false,

// Auto fix
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit",
"source.organizeImports": "never"
},

// Silent the stylistic rules in you IDE, but still auto fix them
"eslint.rules.customizations": [
{ "rule": "style/*", "severity": "off" },
{ "rule": "format/*", "severity": "off" },
{ "rule": "*-indent", "severity": "off" },
{ "rule": "*-spacing", "severity": "off" },
{ "rule": "*-spaces", "severity": "off" },
{ "rule": "*-order", "severity": "off" },
{ "rule": "*-dangle", "severity": "off" },
{ "rule": "*-newline", "severity": "off" },
{ "rule": "*quotes", "severity": "off" },
{ "rule": "*semi", "severity": "off" }
],

// Enable eslint for all supported languages
"eslint.validate": [
"javascript",
"javascriptreact",
"typescript",
"typescriptreact",
"vue",
"html",
"markdown",
"json",
"jsonc",
"yaml",
"toml"
]
}
10 changes: 0 additions & 10 deletions app.config.ts

This file was deleted.

1 change: 1 addition & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export default { extends: ['@commitlint/config-conventional'] }
7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"build": "prisma generate && nuxt build",
"start": "NODE_ENV=production node .output/server/index.mjs",
"lint": "eslint .",
"lint:fix": "eslint . --fix",
"test": "vitest --run",
"test:components": "vitest --run components/",
"test:watch": "vitest",
Expand All @@ -13,7 +14,8 @@
"generate": "nuxt generate",
"preview": "DATABASE_URL=file:./db.sqlite nuxt preview",
"typecheck": "nuxt typecheck",
"studio": "prisma studio"
"studio": "prisma studio",
"prepare": "husky"
},
"dependencies": {
"@aws-sdk/client-s3": "^3.568.0",
Expand All @@ -37,6 +39,8 @@
"zod": "^3.22.4"
},
"devDependencies": {
"@commitlint/cli": "^19.3.0",
"@commitlint/config-conventional": "^19.2.2",
"@faker-js/faker": "^8.4.1",
"@nuxt/eslint": "^0.3.10",
"@nuxt/test-utils": "^3.12.0",
Expand All @@ -52,6 +56,7 @@
"dayjs": "^1.11.10",
"eslint": "^8.57.0",
"h3": "^1.11.1",
"husky": "^9.0.11",
"nuxt": "3.11.2",
"nuxt-gtag": "^2.0.5",
"nuxt-icon": "^0.6.10",
Expand Down
500 changes: 442 additions & 58 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

0 comments on commit 878b2d4

Please sign in to comment.