Permalink
Browse files

fix paths to .jshintrc and parse option files as JSON

  • Loading branch information...
1 parent 1662e00 commit 19e1cc72c9f1157bd36f96adde31f6d6dd776364 @stepheneb stepheneb committed Sep 8, 2013
Showing with 4 additions and 5 deletions.
  1. +4 −5 Support/jshint_options.js
@@ -3,7 +3,6 @@ var env = process.env || process.ENV;
module.exports = function() {
var default_options = {
- "es5": true,
"forin": true,
"predef": [
// CommonJS
@@ -25,24 +24,24 @@ module.exports = function() {
function readCustomOptions(path) {
if (fs.existsSync(path)) {
- return fs.readFileSync(path, 'utf8');
+ return JSON.parse(fs.readFileSync(path, 'utf8'));
} else {
return false;
}
}
if (current_dir) {
- options = readCustomOptions(current_dir + '.jslintrc');
+ options = readCustomOptions(current_dir + '/.jshintrc');
if (options) return options;
}
if (project_dir) {
- options = readCustomOptions(project_dir + '.jslintrc');
+ options = readCustomOptions(project_dir + '/.jshintrc');
if (options) return options;
}
if (home_dir) {
- options = readCustomOptions(home_dir + '.jslintrc');
+ options = readCustomOptions(home_dir + '/.jshintrc');
if (options) return options;
}

0 comments on commit 19e1cc7

Please sign in to comment.