解决方案是递归使用{}
,例如
"lint-staged": {
"{Gemfile,Rakefile,**/*.{js,rb,rake,ru}}": [
"./node_modules/prettier/bin-prettier.js --write"
],
"**/*.js": [
"node_modules/eslint/bin/eslint.js"
],
"{Gemfile,Rakefile,**/*.{rb,rake,ru}}": [
"bundle exec rubocop -a"
]
}