Permalink
Browse files

Breaking: Make require('eslint').linter non-enumerable (fixes #9270) (#…

  • Loading branch information...
j-f1 authored and not-an-aardvark committed Mar 22, 2018
1 parent 4eaebe5 commit c383bc57f49c3f9f5a263fcc3feb3609e787021f
Showing with 13 additions and 1 deletion.
  1. +13 −1 lib/api.js
View
@@ -8,9 +8,21 @@
const Linter = require("./linter");
module.exports = {
linter: new Linter(),
Linter,
CLIEngine: require("./cli-engine"),
RuleTester: require("./testers/rule-tester"),
SourceCode: require("./util/source-code")
};
let deprecatedLinterInstance = null;
Object.defineProperty(module.exports, "linter", {
enumerable: false,
get() {
if (!deprecatedLinterInstance) {
deprecatedLinterInstance = new Linter();
}
return deprecatedLinterInstance;
}
});

0 comments on commit c383bc5

Please sign in to comment.