Skip to content

Commit

Permalink
chore: add husky, lint-staged, commitlint (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
leohxj authored Aug 27, 2019
1 parent 3352389 commit 77054fb
Show file tree
Hide file tree
Showing 9 changed files with 923 additions and 50 deletions.
3 changes: 3 additions & 0 deletions .commitlintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
extends: ['@commitlint/config-conventional']
};
3 changes: 1 addition & 2 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@ root = true
[*]
indent_style = space
indent_size = 2
tab_width = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false
7 changes: 7 additions & 0 deletions .huskyrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module.exports = {
$schema: 'http://json.schemastore.org/huskyrc',
hooks: {
'pre-commit': 'lint-staged',
'commit-msg': 'commitlint -E HUSKY_GIT_PARAMS'
}
};
4 changes: 4 additions & 0 deletions .lintstagedrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module.exports = {
$schema: 'http://json.schemastore.org/lintstagedrc.schema',
'**/*.{js, ts}': ['prettier --write', 'eslint --fix', 'git add']
};
5 changes: 0 additions & 5 deletions .prettierignore

This file was deleted.

5 changes: 0 additions & 5 deletions .prettierrc

This file was deleted.

6 changes: 6 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
$schema: 'http://json.schemastore.org/prettierrc',
printWidth: 80,
singleQuote: true,
arrowParens: 'always'
};
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,18 @@
"devDependencies": {
"@babel/cli": "^7.5.5",
"@babel/core": "^7.5.5",
"@commitlint/cli": "^8.1.0",
"@commitlint/config-conventional": "^8.1.0",
"@mjolnir/babel-preset": "link:packages/babel-preset",
"@mjolnir/eslint-config": "link:packages/eslint-config",
"cross-env": "^5.2.0",
"eslint": "^6.1.0",
"eslint-config-prettier": "^6.0.0",
"eslint-plugin-prettier": "^3.1.0",
"husky": "^3.0.4",
"lerna": "^3.15.0",
"lerna-changelog": "^0.8.2",
"lint-staged": "^9.2.4",
"prettier": "^1.17.1",
"typescript": "^3.5.3"
},
Expand Down
Loading

0 comments on commit 77054fb

Please sign in to comment.