This repository has been archived on 2022-01-16. You can view files and clone it, but cannot push or open issues or pull requests.
irreligious/node_modules/eslint/lib/api.js

35 lines
740 B
JavaScript
Raw Normal View History

2021-09-04 22:21:14 -05:00
/**
* @fileoverview Expose out ESLint and CLI to require.
* @author Ian Christian Myers
*/
"use strict";
const { CLIEngine } = require("./cli-engine");
const { ESLint } = require("./eslint");
const { Linter } = require("./linter");
const { RuleTester } = require("./rule-tester");
const { SourceCode } = require("./source-code");
module.exports = {
Linter,
CLIEngine,
ESLint,
RuleTester,
SourceCode
};
// DOTO: remove deprecated API.
let deprecatedLinterInstance = null;
Object.defineProperty(module.exports, "linter", {
enumerable: false,
get() {
if (!deprecatedLinterInstance) {
deprecatedLinterInstance = new Linter();
}
return deprecatedLinterInstance;
}
});