Skip to content

Commit f2da99e

Browse files
author
Jake Teton-Landis
committed
manually load commented JSON
1 parent 6b40c83 commit f2da99e

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed
Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,11 @@
1-
module.exports = require('airbnb-style/linters/.eslintrc');
1+
var resolve = require('resolve');
2+
var stripComments = require('strip-json-comments');
3+
var fs = require('fs');
4+
5+
// you could do this all at once if you wanted to look cool
6+
var filename = resolve.sync('airbnb-style/linters/.eslintrc');
7+
var data = fs.readFileSync(filename, {encoding: 'utf-8'});
8+
var dataWithoutComments = stripComments(data);
9+
var parsed = JSON.parse(dataWithoutComments);
10+
11+
module.exports = parsed;

packages/eslint-config-airbnb/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@
2727
"airbnb-style": "2.0.0",
2828
"babel-eslint": "3.1.7",
2929
"eslint": "0.21.2",
30-
"eslint-plugin-react": "2.3.0"
30+
"eslint-plugin-react": "2.3.0",
31+
"resolve": "1.1.6",
32+
"strip-json-comments": "1.0.2"
3133
}
3234
}

0 commit comments

Comments
 (0)