Skip to content

Commit 3688d08

Browse files
MQuyJaKXz
authored andcommitted
fix: lintDirtyModulesOnly matching path on Windows (#124)
* Add micromatch * Use micromatch to check changes * Remove matchbase in micromatch
1 parent 2096f35 commit 3688d08

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

lib/lint-dirty-modules-plugin.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
var assign = require('object-assign');
44
var defaultTo = require('ramda').defaultTo;
5-
var minimatch = require('minimatch');
5+
var micromatch = require('micromatch');
66
var runCompilation = require('./run-compilation');
77

88
/**
@@ -62,7 +62,7 @@ LintDirtyModulesPlugin.prototype.lint = function lint (compilation, callback) {
6262
*/
6363
LintDirtyModulesPlugin.prototype.getChangedFiles = function getChangedFiles (fileTimestamps, glob) {
6464
return Object.keys(fileTimestamps).filter(function (filename) {
65-
return hasFileChanged.call(this, filename, fileTimestamps[filename]) && minimatch(filename, glob, {matchBase: true});
65+
return hasFileChanged.call(this, filename, fileTimestamps[filename]) && micromatch.isMatch(filename, glob);
6666
}.bind(this));
6767
};
6868

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
},
3636
"dependencies": {
3737
"arrify": "^1.0.1",
38-
"minimatch": "^3.0.3",
38+
"micromatch": "^2.3.0",
3939
"object-assign": "^4.1.0",
4040
"ramda": "^0.25.0"
4141
},

yarn.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2717,7 +2717,7 @@ merge-source-map@^1.0.2:
27172717
dependencies:
27182718
source-map "^0.5.6"
27192719

2720-
micromatch@^2.3.11:
2720+
micromatch@^2.3.0, micromatch@^2.3.11:
27212721
version "2.3.11"
27222722
resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-2.3.11.tgz#86677c97d1720b363431d04d0d15293bd38c1565"
27232723
dependencies:

0 commit comments

Comments
 (0)