This is an automated email from the ASF dual-hosted git repository.
nicholasjiang pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/paimon-webui.git
The following commit(s) were added to refs/heads/main by this push:
new 6d252be2 [Featrue] Support frontend commit eslint checker (#273)
6d252be2 is described below
commit 6d252be204aa447d7f7a22bea8933ad6488cf785
Author: xiaomo <[email protected]>
AuthorDate: Sat Jun 1 00:34:59 2024 +0800
[Featrue] Support frontend commit eslint checker (#273)
---
paimon-web-ui/.husky/pre-commit | 5 +++++
paimon-web-ui/package.json | 4 +++-
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/paimon-web-ui/.husky/pre-commit b/paimon-web-ui/.husky/pre-commit
new file mode 100644
index 00000000..6b3ba595
--- /dev/null
+++ b/paimon-web-ui/.husky/pre-commit
@@ -0,0 +1,5 @@
+#!/usr/bin/env sh
+. "$(dirname -- "$0")/_/husky.sh"
+
+cd paimon-web-ui
+npm run lint
diff --git a/paimon-web-ui/package.json b/paimon-web-ui/package.json
index 5e132081..0a1f3bb6 100644
--- a/paimon-web-ui/package.json
+++ b/paimon-web-ui/package.json
@@ -3,6 +3,7 @@
"version": "0.0.0",
"private": true,
"scripts": {
+ "prepare": "cd .. && husky ./paimon-web-ui/.husky",
"dev": "vite",
"dev:mock": "vite --mode mock",
"mock": "mm --config=mock/mm.config.js",
@@ -10,8 +11,8 @@
"preview": "vite preview",
"build-only": "vite build",
"type-check": "vue-tsc --noEmit -p tsconfig.app.json --composite false",
- "lint": "eslint src --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts
--fix",
"gen:license": "node ./license.node.js",
+ "lint": "eslint ./src",
"format": "eslint ./src --fix"
},
"dependencies": {
@@ -48,6 +49,7 @@
"@vue/tsconfig": "^0.5.1",
"autoprefixer": "^10.4.15",
"eslint": "^9.3.0",
+ "husky": "^9.0.11",
"mockm": "1.1.27-alpha.2",
"naive-ui": "^2.36.0",
"npm-run-all": "^4.1.5",