保誠-保戶業務員媒合平台
HelenHuang
2022-06-09 23b60dc1975db38c280d8a123aff97544d1673e0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
"use strict";
var __importStar = (this && this.__importStar) || function (mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
    result["default"] = mod;
    return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
const semver = __importStar(require("semver"));
function assertEsLintSupport(configuration) {
    if (semver.lt(process.version, '8.10.0')) {
        throw new Error(`To use 'eslint' option, please update to Node.js >= v8.10.0 ` +
            `(current version is ${process.version})`);
    }
    let eslintVersion;
    try {
        eslintVersion = require('eslint').Linter.version;
    }
    catch (error) {
        throw new Error(`When you use 'eslint' option, make sure to install 'eslint'.`);
    }
    if (semver.lt(eslintVersion, '6.0.0')) {
        throw new Error(`Cannot use current eslint version of ${eslintVersion}, the minimum required version is 6.0.0`);
    }
    if (!configuration.files) {
        throw new Error('The `eslint.files` settings is required for EsLint reporter to work.');
    }
}
exports.assertEsLintSupport = assertEsLintSupport;