Sha256: 767de46568db4c4c4c91d6cdaca95faa7d92cff2ffa357ec3afb2f075ed95897

Contents?: true

Size: 1.96 KB

Versions: 26

Compression:

Stored size: 1.96 KB

Contents

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getNewestEspreeKind = exports.getEspree = void 0;
const require_utils_1 = require("./require-utils");
const semver_1 = require("semver");
let espreeCache = null;
function getEspree() {
    if (!espreeCache) {
        espreeCache = (0, require_utils_1.loadNewest)([
            {
                getPkg() {
                    return (0, require_utils_1.requireFromCwd)("espree/package.json");
                },
                get() {
                    return (0, require_utils_1.requireFromCwd)("espree");
                },
            },
            {
                getPkg() {
                    return (0, require_utils_1.requireFromLinter)("espree/package.json");
                },
                get() {
                    return (0, require_utils_1.requireFromLinter)("espree");
                },
            },
            {
                getPkg() {
                    return require("espree/package.json");
                },
                get() {
                    return require("espree");
                },
            },
        ]);
    }
    return espreeCache;
}
exports.getEspree = getEspree;
let kindCache = null;
function getNewestEspreeKind() {
    if (kindCache) {
        return kindCache;
    }
    const cwdPkg = (0, require_utils_1.requireFromCwd)("espree/package.json");
    const linterPkg = (0, require_utils_1.requireFromLinter)("espree/package.json");
    const self = require("espree/package.json");
    let target = {
        kind: "self",
        version: self.version,
    };
    if (cwdPkg != null && (0, semver_1.lte)(target.version, cwdPkg.version)) {
        target = { kind: "cwd", version: cwdPkg.version };
    }
    if (linterPkg != null && (0, semver_1.lte)(target.version, linterPkg.version)) {
        target = { kind: "linter", version: linterPkg.version };
    }
    return (kindCache = target.kind);
}
exports.getNewestEspreeKind = getNewestEspreeKind;

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
immosquare-cleaner-0.1.32 node_modules/jsonc-eslint-parser/lib/parser/modules/espree.js
immosquare-cleaner-0.1.31 node_modules/jsonc-eslint-parser/lib/parser/modules/espree.js
immosquare-cleaner-0.1.30 node_modules/jsonc-eslint-parser/lib/parser/modules/espree.js
immosquare-cleaner-0.1.29 node_modules/jsonc-eslint-parser/lib/parser/modules/espree.js
immosquare-cleaner-0.1.28 node_modules/jsonc-eslint-parser/lib/parser/modules/espree.js
immosquare-cleaner-0.1.27 node_modules/jsonc-eslint-parser/lib/parser/modules/espree.js
immosquare-cleaner-0.1.26 node_modules/jsonc-eslint-parser/lib/parser/modules/espree.js
immosquare-cleaner-0.1.25 node_modules/jsonc-eslint-parser/lib/parser/modules/espree.js
immosquare-cleaner-0.1.24 node_modules/jsonc-eslint-parser/lib/parser/modules/espree.js
immosquare-cleaner-0.1.23 node_modules/jsonc-eslint-parser/lib/parser/modules/espree.js
immosquare-cleaner-0.1.22 node_modules/jsonc-eslint-parser/lib/parser/modules/espree.js
immosquare-cleaner-0.1.21 node_modules/jsonc-eslint-parser/lib/parser/modules/espree.js
immosquare-cleaner-0.1.20 node_modules/jsonc-eslint-parser/lib/parser/modules/espree.js
immosquare-cleaner-0.1.19 node_modules/jsonc-eslint-parser/lib/parser/modules/espree.js
immosquare-cleaner-0.1.18 node_modules/jsonc-eslint-parser/lib/parser/modules/espree.js
immosquare-cleaner-0.1.17 node_modules/jsonc-eslint-parser/lib/parser/modules/espree.js
immosquare-cleaner-0.1.16 node_modules/jsonc-eslint-parser/lib/parser/modules/espree.js
immosquare-cleaner-0.1.14 node_modules/jsonc-eslint-parser/lib/parser/modules/espree.js
immosquare-cleaner-0.1.13 node_modules/jsonc-eslint-parser/lib/parser/modules/espree.js
immosquare-cleaner-0.1.12 node_modules/jsonc-eslint-parser/lib/parser/modules/espree.js