Skip to content

Commit

Permalink
fix: lintDirtyModulesOnly matching path on Windows (#124)
Browse files Browse the repository at this point in the history
* Add micromatch

* Use micromatch to check changes

* Remove matchbase in micromatch
  • Loading branch information
MQuy authored and joshwiens committed Mar 31, 2018
1 parent 939f983 commit f7eaae2
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/lint-dirty-modules-plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');

/**
Expand Down Expand Up @@ -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));
};

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand Down
2 changes: 1 addition & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit f7eaae2

Please sign in to comment.