Skip to content

Commit 8dc3cf3

Browse files
committed
improve error output when config file can't be loaded
1 parent 7bc610a commit 8dc3cf3

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
'use strict';
2-
var gutil = require('gulp-util');
32
var path = require('path');
3+
var gutil = require('gulp-util');
44
var through = require('through2');
55
var Checker = require('jscs');
66
var loadConfigFile = require('jscs/lib/cli-config');
77
var assign = require('object-assign');
8+
var tildify = require('tildify');
89

910
module.exports = function (options) {
1011
options = options || '.jscsrc';
@@ -32,7 +33,7 @@ module.exports = function (options) {
3233
try {
3334
checker.configure(loadConfigFile.load(configPath));
3435
} catch (error) {
35-
throw new Error('Unable to load JSCS config file at ' + path.join(process.cwd(), configPath));
36+
throw new Error('Unable to load JSCS config file at ' + tildify(path.resolve(configPath)));
3637
}
3738
} else {
3839
checker.configure(options);

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@
3737
"gulp-util": "^3.0.0",
3838
"jscs": "^1.8.0",
3939
"object-assign": "^2.0.0",
40-
"through2": "^0.6.1"
40+
"through2": "^0.6.1",
41+
"tildify": "^1.0.0"
4142
},
4243
"devDependencies": {
4344
"mocha": "*"

0 commit comments

Comments
 (0)