Skip to content

Commit a41ad61

Browse files
committed
chore; add pre-commit hook linting
1 parent 68547f5 commit a41ad61

File tree

5 files changed

+231
-12
lines changed

5 files changed

+231
-12
lines changed

.husky/pre-commit

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env sh
2+
. "$(dirname -- "$0")/_/husky.sh"
3+
4+
npx lint-staged

.lintstagedrc.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"*.ts": [
3+
"npm run fix"
4+
]
5+
}

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
18

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,9 @@
4343
"flatten": "^1.0.2",
4444
"github-markdown-css": "^3.0.1",
4545
"html-webpack-plugin": "^5.5.3",
46+
"husky": "^8.0.3",
4647
"is-empty-object": "^1.1.1",
48+
"lint-staged": "^15.0.2",
4749
"lz-string": "^1.4.4",
4850
"markdown-it": "^12.3.2",
4951
"markdown-it-highlightjs": "^3.0.0",
@@ -79,9 +81,9 @@
7981
"start": "webpack-dev-server --port 9002",
8082
"lint": "eslint . --ext .ts",
8183
"fix": "eslint --fix --ext .ts .",
82-
"prettier": "npm run fix",
8384
"test": "npm run build:all && npm run test:run",
8485
"test:run": "playwright test",
85-
"test:server": "node tests/utlis/server/index.js"
86+
"test:server": "node tests/utlis/server/index.js",
87+
"prepare": "husky install"
8688
}
8789
}

0 commit comments

Comments
 (0)