github-pages-deploy-action/node_modules/eslint/lib/api.js

33 lines
688 B
JavaScript
Raw Normal View History

2020-03-07 11:45:40 +08:00
/**
* @fileoverview Expose out ESLint and CLI to require.
* @author Ian Christian Myers
*/
"use strict";
2020-03-31 20:40:00 +08:00
const { CLIEngine } = require("./cli-engine");
const { Linter } = require("./linter");
const { RuleTester } = require("./rule-tester");
const { SourceCode } = require("./source-code");
2020-03-07 11:45:40 +08:00
module.exports = {
Linter,
2020-03-31 20:40:00 +08:00
CLIEngine,
RuleTester,
SourceCode
2020-03-07 11:45:40 +08:00
};
2020-03-31 20:40:00 +08:00
// DOTO: remove deprecated API.
2020-03-07 11:45:40 +08:00
let deprecatedLinterInstance = null;
Object.defineProperty(module.exports, "linter", {
enumerable: false,
get() {
if (!deprecatedLinterInstance) {
deprecatedLinterInstance = new Linter();
}
return deprecatedLinterInstance;
}
});