diff --git a/index.js b/index.js index 3802df93..8a4f541b 100644 --- a/index.js +++ b/index.js @@ -5,6 +5,7 @@ const globby = require('globby'); const isEqual = require('lodash.isequal'); const multimatch = require('multimatch'); const arrify = require('arrify'); +const slash = require('slash'); const optionsManager = require('./options-manager'); exports.lintText = (str, opts) => { @@ -30,7 +31,7 @@ exports.lintText = (str, opts) => { if (opts.filename) { const filename = path.relative(opts.cwd, opts.filename); const isIgnored = multimatch(filename, opts.ignores).length > 0; - const isGitIgnored = !optionsManager.getGitIgnoreFilter(opts)(opts.filename); + const isGitIgnored = !optionsManager.getGitIgnoreFilter(opts)(slash(opts.filename)); if (isIgnored || isGitIgnored) { return {