Skip to content

Commit

Permalink
build(lint-staged): added lint-staged
Browse files Browse the repository at this point in the history
On commit eslint was run with --fix. This would change files and these files would not be part of
the commit. Switched to lint-staged to only lint staged files and commit them, so that they are part
of the commit. Non staged files and untracked files are stashed before linting and unstaged ones
completed.
  • Loading branch information
nidkil committed Jan 19, 2019
1 parent 5aad68c commit 41ad049
Show file tree
Hide file tree
Showing 4 changed files with 476 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .huskyrc.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"hooks": {
"pre-commit": "npm run lint:fix && npm run test:unit",
"pre-commit": "lint-staged && npm run test:unit",
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
}
}
3 changes: 3 additions & 0 deletions .lintstagedrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"*.{js,vue}": ["npm run lint:fix --", "git add"]
}
Loading

0 comments on commit 41ad049

Please sign in to comment.