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

35 lines
740 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");
2020-05-15 05:33:08 +08:00
const { ESLint } = require("./eslint");
2020-03-31 20:40:00 +08:00
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,
2020-05-15 05:33:08 +08:00
ESLint,
2020-03-31 20:40:00 +08:00
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;
}
});