我想在lint阶段使用正则表达式,该正则表达式列出了文件中图像标签的所有缺少的alt属性。
package.json
"scripts": {
"postinstall": "find node_modules/ -name \"*.info\" -type f -delete",
"img-altchk": "gulp img-altchk",
"regex": "grep -rl /<img(\s*(?!alt)([\w\-])+=([\"\'])[^\"\']+\3)*\s*\/?>/"
},
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
},
"lint-staged": {
"**/*.mustache": [
"npm run regex",
"git add"
]
},
我没有得到清单。有什么建议。谢谢。