-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.js
31 lines (23 loc) · 985 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
"use strict";
//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------
var fs = require("fs"),
path = require("path"),
yaml = require("js-yaml");
//------------------------------------------------------------------------------
// Bootstrapping
//------------------------------------------------------------------------------
var filePath = path.resolve(__dirname, "./.eslintrc.yml"),
config;
try {
config = yaml.safeLoad(fs.readFileSync(filePath, "utf8")) || {};
} catch (e) {
console.error("Error reading YAML file: " + filePath);
e.message = "Cannot read config file: " + filePath + "\nError: " + e.message;
throw e;
}
//------------------------------------------------------------------------------
// Public Interface
//------------------------------------------------------------------------------
module.exports = config;