Skip to content

Commit

Permalink
fix(eslint-generator): add ts file check to lint-staged (#4347)
Browse files Browse the repository at this point in the history
fix #3947

(cherry picked from commit 80c20db)
  • Loading branch information
李瑞丰 authored and haoqunjiang committed Aug 2, 2019
1 parent 470c94e commit 66c410b
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions packages/@vue/cli-plugin-eslint/generator/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,14 @@ module.exports = (api, { config, lintOn = [] }, _, invoking) => {
pkg.gitHooks = {
'pre-commit': 'lint-staged'
}
pkg['lint-staged'] = {
'*.{js,vue}': ['vue-cli-service lint', 'git add']
if (api.hasPlugin('typescript')) {
pkg['lint-staged'] = {
'*.{js,vue,ts}': ['vue-cli-service lint', 'git add']
}
} else {
pkg['lint-staged'] = {
'*.{js,vue}': ['vue-cli-service lint', 'git add']
}
}
}

Expand Down

0 comments on commit 66c410b

Please sign in to comment.