chore: add pre commit hook (#479)

Signed-off-by: Ryan Wang <i@ryanc.cc>
pull/494/head
Ryan Wang 3 years ago committed by GitHub
parent 020db1422e
commit 9cf97b9d3c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -2,24 +2,20 @@
require("@rushstack/eslint-patch/modern-module-resolution");
module.exports = {
"root": true,
"extends": [
root: true,
extends: [
"plugin:vue/vue3-essential",
"eslint:recommended",
"@vue/eslint-config-typescript/recommended",
"@vue/eslint-config-prettier"
"@vue/eslint-config-prettier",
],
"env": {
"vue/setup-compiler-macros": true
env: {
"vue/setup-compiler-macros": true,
},
"overrides": [
overrides: [
{
"files": [
"cypress/integration/**.spec.{js,ts,jsx,tsx}"
files: ["cypress/integration/**.spec.{js,ts,jsx,tsx}"],
extends: ["plugin:cypress/recommended"],
},
],
"extends": [
"plugin:cypress/recommended"
]
}
]
};

@ -0,0 +1,6 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
pnpm test:unit
pnpm typecheck
pnpm lint

@ -2,10 +2,11 @@
"name": "halo-admin-next",
"version": "0.0.0",
"scripts": {
"prepare": "husky install",
"dev": "vite",
"build": "vue-tsc --noEmit && vite build",
"preview": "vite preview --port 5050",
"test:unit": "vitest --environment jsdom",
"test:unit": "vitest --environment jsdom --run",
"test:e2e": "start-server-and-test preview http://127.0.0.1:5050/ 'cypress open'",
"test:e2e:ci": "start-server-and-test preview http://127.0.0.1:5050/ 'cypress run'",
"typecheck": "vue-tsc --noEmit -p tsconfig.vitest.json --composite false",
@ -30,6 +31,7 @@
"eslint": "^8.5.0",
"eslint-plugin-cypress": "^2.12.1",
"eslint-plugin-vue": "^8.2.0",
"husky": "^7.0.4",
"jsdom": "^19.0.0",
"prettier": "^2.5.1",
"start-server-and-test": "^1.14.0",

@ -14,6 +14,7 @@ specifiers:
eslint: ^8.5.0
eslint-plugin-cypress: ^2.12.1
eslint-plugin-vue: ^8.2.0
husky: ^7.0.4
jsdom: ^19.0.0
pinia: ^2.0.11
prettier: ^2.5.1
@ -44,6 +45,7 @@ devDependencies:
eslint: 8.10.0
eslint-plugin-cypress: 2.12.1_eslint@8.10.0
eslint-plugin-vue: 8.5.0_eslint@8.10.0
husky: 7.0.4
jsdom: 19.0.0
prettier: 2.5.1
start-server-and-test: 1.14.0
@ -2427,6 +2429,12 @@ packages:
engines: {node: '>=10.17.0'}
dev: true
/husky/7.0.4:
resolution: {integrity: sha512-vbaCKN2QLtP/vD4yvs6iz6hBEo6wkSzs8HpRah1Z6aGmF2KW5PdYuAd7uX5a+OyBZHBhd+TFLqgjUgytQr4RvQ==}
engines: {node: '>=12'}
hasBin: true
dev: true
/iconv-lite/0.6.3:
resolution: {integrity: sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==}
engines: {node: '>=0.10.0'}

Loading…
Cancel
Save