-
Notifications
You must be signed in to change notification settings - Fork 114
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
前端项目工程化与团队代码规范的相关实践与工具 #278
Comments
你在意到了这些问题,点个赞!
…On Tue, Nov 7, 2017 at 3:36 PM, 吕立青 ***@***.***> wrote:
项目纵向拆分
TypeScript,TSLint,SnapshotTesting,CommitLint,GitHook
⓵ 定义目标和原则 ⓶ 展望结果(OKRs) ⓷ 头脑风暴(发散) ⓸ 组织整理(收敛) ⓹ 明确「下一步行动」
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#278>, or mute the
thread
<https://github.com/notifications/unsubscribe-auth/ALWBn5dBp0Gj3_lxnCIzUgJO4zw_GUx5ks5s0AhrgaJpZM4QUXyM>
.
--
Regards,
Congyu Lin*Developer, Chengdu, China*
Githubhttps://*github*.com/linesh-simplicity
<https://github.com/linesh-simplicity>
Websitehttp://linesh.tw
[image: ThoughtWorks]
<http://www.thoughtworks.com/?utm_campaign=congyu-lin%20(linesh/%20%E6%9E%97%E4%BB%8E%E7%BE%BD)-signature&utm_medium=email&utm_source=thoughtworks-email-signature-generator>
|
React 简单版:
|
Vue 稍复杂版:
"devDependencies": {
"@commitlint/cli": "^7.2.1",
"@commitlint/config-conventional": "^7.1.2",
"conventional-changelog-cli": "^2.0.11",
"cross-env": "^5.1.1",
"cz-lerna-changelog": "^2.0.0",
"husky": "^1.3.1",
"lint-staged": "^7.3.0",
"stylelint": "^9.6.0",
"stylelint-config-standard": "^18.2.0",
"stylelint-scss": "^3.3.1"
},
"lint-staged": {
"*.{js,vue}": [
"prettier --write",
"cross-env CI=true eslint --fix",
"git add"
],
"*.{css,scss,less,vue}": [
"stylelint --fix",
"git add"
],
"*.ts": [
"tslint --fix",
"git add"
]
},
"husky": {
"hooks": {
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS",
"post-commit": "git update-index --again",
"pre-commit": "lint-staged",
"pre-push": "yarn lint && yarn test && yarn coverage"
}
},
"config": {
"commitizen": {
"path": "./node_modules/cz-lerna-changelog"
}
}
module.exports = {
root: true,
env: {
browser: true,
node: true,
jest: true,
},
globals: {
FB: true,
},
parserOptions: {
parser: 'babel-eslint',
},
extends: ['@vue/airbnb', 'plugin:vue/recommended', 'prettier' ],
plugins: ['vue'],
rules: {
// allow debugger during development
'no-console': process.env.CI === 'true' ? 'error' : 'off',
'no-debugger': process.env.CI === 'true' ? 'error' : 'off',
// vue disable rules
// airbnb-base disable rules
// jsx and react rule
},
settings: {
'polyfills': ['fetch', 'promises', 'url'],
},
}
module.exports = {
extends: ['@commitlint/config-conventional'],
rules: {
'header-max-length': [0, 'always', 100],
},
} |
测试奖杯 🏆
|
可直接在commit时压缩图片: "*.{png,jpeg,jpg,gif,svg}": ["imagemin-lint-staged", "git add"] 修改 WebStorm 默认format快捷键到 prettier |
项目纵向拆分
语言层面:
TypeScript
代码风格:
TSLint/ESLint
Prettier
提交规范:
CommitLint
GitHook (Husky)
Changelog (semantic release)
测试相关:
Jest/Mocha
Snapshot Testing
代码仓库:
Lerna
Yarn/NPM
⓵ 定义目标和原则
⓶ 展望结果(OKRs)
⓷ 头脑风暴(发散)
⓸ 组织整理(收敛)
⓹ 明确「下一步行动」
The text was updated successfully, but these errors were encountered: