We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6bd9970 commit 4908a91Copy full SHA for 4908a91
index.js
@@ -24,11 +24,15 @@ module.exports = function (options) {
24
delete options.configPath;
25
26
if (configPath) {
27
- if (Object.keys(options).length) {
+ if (typeof options === 'object' && Object.keys(options).length) {
28
throw new Error('configPath option is not compatible with code style options');
29
}
30
31
- checker.configure(loadConfigFile.load(configPath));
+ try {
32
+ checker.configure(loadConfigFile.load(configPath));
33
+ } catch (error) {
34
+ throw new Error('Unable to load JSCS config file at ' + path.join(process.cwd(), configPath));
35
+ }
36
} else {
37
checker.configure(options);
38
0 commit comments