我正在为多语言项目中的几个钩子使用预提交。我所有现有的钩子都在工作。我现在正在尝试获取eslint
包含Vue 2
文件的挂钩设置。
这是我.pre-commit-config.yaml
的eslint
部分:
- repo: https://github.com/pre-commit/mirrors-eslint
rev: 'v7.18.0'
hooks:
- id: eslint
types_or: [javascript, jsx, ts, tsx, vue]
additional_dependencies:
- eslint-plugin-vue@v7.5.0
这适用于 javascript 文件,但完全忽略了 Vue 2 文件。我已经基于此设置了上述配置: Eslint for vue和pre-commit eslint。
我尝试.eslintrc
在项目的根目录中添加以下文件,但没有帮助:
module.exports = {
extends: [
'plugin:vue/recommended'
]
}
Vue 文件被完全忽略。