Skip to content

Commit 95c4c48

Browse files
committed
chore: 初始化根目录文件 && commitlint
0 parents  commit 95c4c48

File tree

8 files changed

+1641
-0
lines changed

8 files changed

+1641
-0
lines changed

.commitlintrc.js

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
module.exports = {
2+
extends: ['@commitlint/config-conventional'],
3+
rules: {
4+
'type-enum': [
5+
2,
6+
'always',
7+
[
8+
'feat', //新功能(feature)
9+
'fix', //修补bug
10+
'docs', //文档(documentation)
11+
'style', // 格式(不影响代码运行的变动)
12+
'refactor', //重构(即不是新增功能,也不是修改bug的代码变动)
13+
'test', //增加测试
14+
'chore', //构建过程或辅助工具的变动
15+
'revert', //回滚
16+
'temp' //临时保存
17+
]
18+
],
19+
'type-case': [0],
20+
'subject-case': [0],
21+
'subject-max-length': [2, 'always', 255]
22+
}
23+
}

.gitignore

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
2+
# Dependency directories
3+
node_modules/
4+
5+
# Optional npm cache directory
6+
.npm

.prettierrc.js

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
module.exports = {
2+
tabWidth: 2,
3+
semi: true,
4+
singleQuote: true,
5+
trailingComma: 'none',
6+
endOfLine: 'lf',
7+
vueIndentScriptAndStyle: true,
8+
arrowParens: "always"
9+
};

backend/.gitignore

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
2+
# Dependency directories
3+
node_modules/
4+
5+
# Optional npm cache directory
6+
.npm

backend/package.json

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
"name": "bd7",
3+
"version": "1.0.0",
4+
"description": "BD7",
5+
"author": "techtrainingcamp-frontend-7",
6+
"private": true,
7+
"scripts": {
8+
"test": "echo \"Error: no test specified\" && exit 1"
9+
},
10+
"repository": {
11+
"type": "git",
12+
"url": "git+https://github.com/techtrainingcamp-frontend-7/BD7.git"
13+
},
14+
"keywords": [],
15+
"license": "ISC",
16+
"bugs": {
17+
"url": "https://github.com/techtrainingcamp-frontend-7/BD7/issues"
18+
},
19+
"homepage": "https://github.com/techtrainingcamp-frontend-7/BD7#readme",
20+
"dependencies": {},
21+
"devDependencies": {},
22+
"husky": {
23+
"hooks": {
24+
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS || (node ../deploy_scripts/pre_commit.js && exit 8)"
25+
}
26+
},
27+
"browserslist": [
28+
"> 1%",
29+
"last 2 versions"
30+
]
31+
}

deploy_scripts/pre_commit.js

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
const chalk = require('chalk');
2+
console.log(
3+
chalk.red(`Error: commit格式错误\n\n`),
4+
chalk.green(`正确示例:
5+
eg1: git commit -m 'fix: 修正xxx'
6+
eg2: git commit -m 'feat: 1 实现xxx功能 2 ....'
7+
`),
8+
chalk.green(`
9+
type (只允许下列7个标识):
10+
feat:新功能(feature)
11+
fix:修补bug
12+
docs:文档(documentation)
13+
style: 格式(不影响代码运行的变动)
14+
refactor:重构(即不是新增功能,也不是修改bug的代码变动)
15+
test:增加测试
16+
chore:构建过程或辅助工具的变动
17+
revert: 回滚
18+
temp: 临时保存a
19+
`)
20+
);

0 commit comments

Comments
 (0)