manually load commented JSON

This commit is contained in:
Jake Teton-Landis
2015-05-22 11:06:16 -07:00
parent 6b40c838fb
commit f2da99e058
2 changed files with 14 additions and 2 deletions

View File

@@ -1 +1,11 @@
module.exports = require('airbnb-style/linters/.eslintrc');
var resolve = require('resolve');
var stripComments = require('strip-json-comments');
var fs = require('fs');
// you could do this all at once if you wanted to look cool
var filename = resolve.sync('airbnb-style/linters/.eslintrc');
var data = fs.readFileSync(filename, {encoding: 'utf-8'});
var dataWithoutComments = stripComments(data);
var parsed = JSON.parse(dataWithoutComments);
module.exports = parsed;

View File

@@ -27,6 +27,8 @@
"airbnb-style": "2.0.0",
"babel-eslint": "3.1.7",
"eslint": "0.21.2",
"eslint-plugin-react": "2.3.0"
"eslint-plugin-react": "2.3.0",
"resolve": "1.1.6",
"strip-json-comments": "1.0.2"
}
}