From f7eaae2fb481daa84f6688b613cc8070c1ca7576 Mon Sep 17 00:00:00 2001 From: Minh Quy Date: Sun, 14 Jan 2018 22:24:02 +0100 Subject: [PATCH] fix: lintDirtyModulesOnly matching path on Windows (#124) * Add micromatch * Use micromatch to check changes * Remove matchbase in micromatch --- lib/lint-dirty-modules-plugin.js | 4 ++-- package.json | 2 +- yarn.lock | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/lint-dirty-modules-plugin.js b/lib/lint-dirty-modules-plugin.js index a7f1bbc..2cb4ae1 100644 --- a/lib/lint-dirty-modules-plugin.js +++ b/lib/lint-dirty-modules-plugin.js @@ -2,7 +2,7 @@ var assign = require('object-assign'); var defaultTo = require('ramda').defaultTo; -var minimatch = require('minimatch'); +var micromatch = require('micromatch'); var runCompilation = require('./run-compilation'); /** @@ -62,7 +62,7 @@ LintDirtyModulesPlugin.prototype.lint = function lint (compilation, callback) { */ LintDirtyModulesPlugin.prototype.getChangedFiles = function getChangedFiles (fileTimestamps, glob) { return Object.keys(fileTimestamps).filter(function (filename) { - return hasFileChanged.call(this, filename, fileTimestamps[filename]) && minimatch(filename, glob, {matchBase: true}); + return hasFileChanged.call(this, filename, fileTimestamps[filename]) && micromatch.isMatch(filename, glob); }.bind(this)); }; diff --git a/package.json b/package.json index 6b42c75..7e2ab87 100644 --- a/package.json +++ b/package.json @@ -35,7 +35,7 @@ }, "dependencies": { "arrify": "^1.0.1", - "minimatch": "^3.0.3", + "micromatch": "^2.3.0", "object-assign": "^4.1.0", "ramda": "^0.25.0" }, diff --git a/yarn.lock b/yarn.lock index 8f6a9dc..3ba0f37 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2717,7 +2717,7 @@ merge-source-map@^1.0.2: dependencies: source-map "^0.5.6" -micromatch@^2.3.11: +micromatch@^2.3.0, micromatch@^2.3.11: version "2.3.11" resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-2.3.11.tgz#86677c97d1720b363431d04d0d15293bd38c1565" dependencies: