Skip to content

Commit

Permalink
fix: check if glob patterns matches any files before linting
Browse files Browse the repository at this point in the history
closes #2854
closes #2860
  • Loading branch information
sodatea committed Oct 31, 2018
1 parent 387c826 commit ccc146b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion packages/@vue/cli-plugin-eslint/lint.js
@@ -1,3 +1,5 @@
const globby = require('globby')

const renamedArrayArgs = {
ext: 'extensions',
env: 'envs',
Expand All @@ -23,7 +25,7 @@ const defaultFilesToLint = [
// .eslintrc files (ignored by default)
'.*.js',
'{src,tests}/**/.*.js'
]
].filter(pattern => globby.sync(pattern).length)

module.exports = function lint (args = {}, api) {
const path = require('path')
Expand Down
3 changes: 2 additions & 1 deletion packages/@vue/cli-plugin-eslint/package.json
Expand Up @@ -26,6 +26,7 @@
"babel-eslint": "^10.0.1",
"eslint": "^4.19.1",
"eslint-loader": "^2.1.1",
"eslint-plugin-vue": "^4.7.1"
"eslint-plugin-vue": "^4.7.1",
"globby": "^8.0.1"
}
}

0 comments on commit ccc146b

Please sign in to comment.