eslint-config-eslint
Advanced tools
Comparing version 1.0.0 to 1.0.1
27
index.js
@@ -14,20 +14,25 @@ /** | ||
var fs = require("fs"), | ||
path = require("path"), | ||
yaml = require("js-yaml"); | ||
//------------------------------------------------------------------------------ | ||
// Public Interface | ||
// Bootstrapping | ||
//------------------------------------------------------------------------------ | ||
module.exports = (function() { | ||
var filePath = path.resolve(__dirname, "./default.yml"), | ||
config; | ||
var filePath = "./default.yml"; | ||
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; | ||
} | ||
try { | ||
return 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; |
{ | ||
"name": "eslint-config-eslint", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"author": "Nicholas C. Zakas <nicholas+npm@nczconsulting.com>", | ||
@@ -5,0 +5,0 @@ "description": "Default ESLint configuration for ESLint projects.", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6523
29