From 96eec35df192229f8c5f2983b98c4830a24d2094 Mon Sep 17 00:00:00 2001 From: Mario Nebl Date: Sun, 2 Apr 2017 18:05:40 +0200 Subject: [PATCH] fix: normalize opts.filename to posix --- index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 {