mirror of
https://github.com/vuejs/vue-cli.git
synced 2026-04-23 13:29:09 -05:00
fix(eslint-generator): add ts file check to lint-staged (#4347)
fix #3947
(cherry picked from commit 80c20db703)
This commit is contained in:
@@ -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']
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user