Yuyz0112 / vue-type-check

a type checker for typescript written Vue components
http://www.myriptide.com/vue-type-check/
96 stars 19 forks source link

Add dkonchekov's file list cli params #9

Open poita66 opened 4 years ago

poita66 commented 4 years ago

This PR adds dkonchekov's changes to support specifying the files to be checked, instead of the whole folder. This is especially useful for pre-commit hooks, where you don't want all of the files checked, just those that have changed.

For those looking to set up their own pre-commit hooks, here's what I added to my package.json:

"husky": {
  "hooks": {
    "pre-commit": "lint-staged"
  }
},
"lint-staged": {
  "src/**/*.{js,ts,vue}": "eslint --cache --fix",
  "src/**/*.vue": "vue-type-check --onlyTemplate --workspace ."
}
poita66 commented 4 years ago

@dkonchekov I hope it's OK that I put this PR together, I couldn't figure out how to ask you first :sweat_smile: