Skip to content

Commit

Permalink
added debug log when a file is ignored (#306)
Browse files Browse the repository at this point in the history
  • Loading branch information
benmosher committed Jul 4, 2016
1 parent 4f1da9a commit 45eab4f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
7 changes: 6 additions & 1 deletion utils/ignore.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ exports.__esModule = true

const extname = require('path').extname

const log = require('debug')('eslint-plugin-import:utils:ignore')

// one-shot memoized
let cachedSet, lastSettings
function validExtensions(context) {
Expand All @@ -24,7 +26,10 @@ exports.default = function ignore(path, context) {

for (let i = 0; i < ignoreStrings.length; i++) {
const regex = new RegExp(ignoreStrings[i])
if (regex.test(path)) return true
if (regex.test(path)) {
log(`ignoring ${path}, matched pattern /${ignoreStrings[i]}/`)
return true
}
}

return false
Expand Down
1 change: 1 addition & 0 deletions utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
},
"homepage": "https://github.com/benmosher/eslint-plugin-import#readme",
"dependencies": {
"debug": "2.2.0",
"pkg-dir": "^1.0.0"
}
}

0 comments on commit 45eab4f

Please sign in to comment.