Skip to content

Commit

Permalink
fix file.path when use in other process dir
Browse files Browse the repository at this point in the history
  • Loading branch information
gucong3000 committed Jun 26, 2018
1 parent 285ba32 commit 1692e93
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ function gulpEslint(options) {
const linter = new CLIEngine(options);

return util.transform((file, enc, cb) => {
const filePath = path.relative(process.cwd(), file.path);
const filePath = path.relative(file.cwd, file.path);

if (file.isNull()) {
cb(null, file);
Expand Down Expand Up @@ -47,7 +47,7 @@ function gulpEslint(options) {
let result;

try {
result = linter.executeOnText(file.contents.toString(), filePath).results[0];
result = linter.executeOnText(file.contents.toString(), file.path).results[0];
} catch (e) {
cb(new PluginError('gulp-eslint', e));
return;
Expand Down

0 comments on commit 1692e93

Please sign in to comment.