-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: 添加“commitizen => husky => lint-staged => prettier”工具链
TODO: 目前 madge 只能检测 JS 循环依赖,因此需要先执行 `npm run build_cjs` 再执行 `npm run check_circular_dependencies`,期待以后能够直接对 TS 文件做检测
- Loading branch information
Showing
7 changed files
with
1,660 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
[*] | ||
charset = utf-8 | ||
indent_size = 2 | ||
indent_style = space | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"hooks": { | ||
"pre-commit": "lint-staged", | ||
"pre-push": "npm test" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"*.{js,json,md}": ["prettier --write", "git add"], | ||
"*.ts": ["prettier --write", "tslint --fix", "git add"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"arrowParens": "always", | ||
"semi": false, | ||
"singleQuote": true, | ||
"overrides": [ | ||
{ | ||
"files": "{tslint.json,package.json}", | ||
"options": { | ||
"printWidth": 1e3 | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,7 +19,7 @@ | |
"lint": "tslint ./src/**/*.ts ./mock/**/*.ts ./test/*.ts ./test/apis/**/*.ts ./test/mock/**/*.ts ./test/utils/**/*.ts", | ||
"publish_sdk": "npm run build_all && npm run copy_files && npm publish ./dist/cjs", | ||
"publish_all": "npm run publish_sdk && ts-node --type-check ./tools/tasks/publish.ts && cp -r ./dist/mock-cjs/** ./.tmp/mock && cp -r ./dist/socket/** ./.tmp/socket && npm publish .tmp/mock/ && npm publish .tmp/socket/", | ||
"test": "npm run lint && npm run cover", | ||
"test": "npm run lint && npm run build_cjs && npm run check_circular_dependencies && npm run cover", | ||
"version": "ts-node tools/tasks/version.ts && git add .", | ||
"watch": "export TZ=\"EST+5\"; npm run watch_test & ts-node ./tools/tasks/test.ts $!", | ||
"watch_cjs": "tsc src/index.ts -m commonjs --outDir dist/cjs --sourcemap --inlineSources --target ES5 -d --diagnostics --pretty --experimentalDecorators --strict --noUnusedLocals --noUnusedParameters --suppressImplicitAnyIndexErrors --moduleResolution node --skipLibCheck -w --lib es5,es2015.iterable,es2015.collection,es2015.promise,es2015.core,dom", | ||
|
@@ -29,17 +29,18 @@ | |
"type": "git", | ||
"url": "git+ssh://[email protected]/teambition/teambition-sdk.git" | ||
}, | ||
"keywords": [ | ||
"teambition", | ||
"sdk", | ||
"teambition-sdk" | ||
], | ||
"keywords": ["teambition", "sdk", "teambition-sdk"], | ||
"author": "[email protected]", | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/teambition/teambition-sdk/issues" | ||
}, | ||
"homepage": "https://github.com/teambition/teambition-sdk#readme", | ||
"config": { | ||
"commitizen": { | ||
"path": "cz-conventional-changelog" | ||
} | ||
}, | ||
"peerDependencies": { | ||
"reactivedb": "~0.9.13", | ||
"rrule": "2.2.0", | ||
|
@@ -55,16 +56,21 @@ | |
"@types/sinon": "^4.0.0", | ||
"@types/sinon-chai": "^2.7.29", | ||
"chai": "^4.1.2", | ||
"commitizen": "^2.9.6", | ||
"coveralls": "^3.0.0", | ||
"cz-conventional-changelog": "^2.1.0", | ||
"engine.io-client": "^3.1.0", | ||
"fetch-mock": "^5.12.2", | ||
"google-closure-compiler-js": "^20180101.0.0", | ||
"husky": "^0.15.0-rc.8", | ||
"isomorphic-fetch": "^2.2.1", | ||
"jsonrpc-lite": "^1.3.0", | ||
"lint-staged": "^7.0.0", | ||
"madge": "^1.6.0", | ||
"moment": "^2.18.1", | ||
"node-watch": "^0.5.5", | ||
"nyc": "^11.2.1", | ||
"prettier": "^1.11.1", | ||
"reactivedb": "~0.9.13", | ||
"rollup": "^0.54.0", | ||
"rollup-plugin-alias": "^1.3.1", | ||
|
@@ -80,6 +86,7 @@ | |
"ts-node": "^4.0.0", | ||
"tslib": "^1.7.1", | ||
"tslint": "^5.7.0", | ||
"tslint-config-prettier": "^1.9.0", | ||
"tslint-eslint-rules": "^4.1.1", | ||
"typescript": "^2.6.2" | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.