Commit 41a1d5ef authored by 曾沂轮's avatar 曾沂轮

Feat: add commit lint optional

parent c4a8467f
module.exports = {
renderFiles: [
'package.json',
'README.md'
],
renderFiles: ['package.json', 'README.md'],
filters: {
commitValid: [
'.husky'
]
},
prompts: {
commitValid: {
type: 'confirm',
default: false,
message: 'Add git commit valid to you project',
},
name: {
type: 'string',
required: true,
message: 'Project name'
message: 'Project name',
},
description: {
type: 'string',
......@@ -19,7 +24,7 @@ module.exports = {
},
author: {
type: 'string',
message: 'Author'
}
}
}
\ No newline at end of file
message: 'Author',
},
},
};
\ No newline at end of file
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
npx --no-install commitlint --edit $1
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
npx --no-install lint-staged
npx --no-install pretty-quick --staged
......@@ -7,12 +7,18 @@
"dev": "vite",
"build": "vue-tsc --noEmit && vite build",
"serve": "vite preview",
"lint": "eslint \"src/*.ts\" \"src/**\" --fix"
"lint": "eslint \"src/*.ts\" \"src/**\" --fix"{{#commitValid}},
"prepare": "husky install"{{/commitValid}}
},
"dependencies": {
"vue": "^3.2.13"
},
"devDependencies": {
{{#commitValid}}
"@commitlint/cli": "^16.2.3",
"@smart/commitlint-config": "^0.1.2",
"@smart/conventional-changelog-smart": "^1.0.6",
{{/commitValid}}
"@smart/eslint-config-typescript": "^2.0.0",
"@typescript-eslint/eslint-plugin": "^5.21.0",
"@typescript-eslint/parser": "^5.21.0",
......@@ -22,9 +28,19 @@
"@vue/eslint-config-typescript": "^10.0.0",
"eslint": "^8.14.0",
"eslint-plugin-vue": "^8.7.1",
"prettier": "^2.4.1",
{{#commitValid}}
"husky": "^7.0.4",
"lint-staged": "^12.4.1",
{{/commitValid}}
"prettier": "2.6.2",
{{#commitValid}}
"pretty-quick": "3.1.3",
{{/commitValid}}
"typescript": "^4.6.3",
"vite": "^2.9.6",
"vue-tsc": "^0.34"
}
}{{#commitValid}},
"lint-staged": {
"*.{vue,js,ts,jsx,tsx}": "eslint --fix"
}{{/commitValid}}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment