Skip to content

Commit

Permalink
Fix slashes in paths on Windows (#201)
Browse files Browse the repository at this point in the history
Co-authored-by: tclindner <tclindner@users.noreply.github.com>
  • Loading branch information
michaelmior and tclindner committed Jan 30, 2020
1 parent 907679f commit 7034270
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
"meow": "^6.0.0",
"plur": "^3.1.1",
"semver": "^7.0.0",
"slash": "^3.0.0",
"strip-json-comments": "^3.0.1"
},
"devDependencies": {
Expand Down
5 changes: 3 additions & 2 deletions src/NpmPackageJsonLint.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

const debug = require('debug')('npm-package-json-lint:NpmPackageJsonLint');
const isPlainObj = require('is-plain-obj');
const slash = require('slash');
const Config = require('./Config');
const pkg = require('../package.json');
const Rules = require('./Rules');
Expand Down Expand Up @@ -89,10 +90,10 @@ class NpmPackageJsonLint {
ignorePath,
fix
}) {
this.cwd = cwd || process.cwd();
this.cwd = slash(cwd || process.cwd());

this.packageJsonObject = packageJsonObject;
this.packageJsonFilePath = packageJsonFilePath;
this.packageJsonFilePath = packageJsonFilePath ? slash(packageJsonFilePath) : packageJsonFilePath;
this.patterns = patterns;
this.quiet = quiet || false;
this.ignorePath = ignorePath || '';
Expand Down

0 comments on commit 7034270

Please sign in to comment.