source: frontend/node_modules/@rushstack/eslint-patch/lib-commonjs/eslint-bulk-suppressions/path-utils.js

Last change on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 12 days ago

Fix frontend appearance

  • Property mode set to 100644
File size: 2.2 KB
Line 
1"use strict";
2// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
3// See LICENSE in the project root for license information.
4var __importDefault = (this && this.__importDefault) || function (mod) {
5 return (mod && mod.__esModule) ? mod : { "default": mod };
6};
7Object.defineProperty(exports, "__esModule", { value: true });
8exports.findAndConsoleLogPatchPathCli = findAndConsoleLogPatchPathCli;
9exports.getPathToLinterJS = getPathToLinterJS;
10exports.ensurePathToGeneratedPatch = ensurePathToGeneratedPatch;
11const node_fs_1 = __importDefault(require("node:fs"));
12const node_os_1 = __importDefault(require("node:os"));
13const _patch_base_1 = require("../_patch-base");
14const constants_1 = require("./constants");
15const package_json_1 = __importDefault(require("../../package.json"));
16const CURRENT_PACKAGE_VERSION = package_json_1.default.version;
17function findAndConsoleLogPatchPathCli() {
18 const eslintBulkDetectEnvVarValue = process.env[constants_1.ESLINT_BULK_DETECT_ENV_VAR_NAME];
19 if (eslintBulkDetectEnvVarValue !== 'true' && eslintBulkDetectEnvVarValue !== '1') {
20 return;
21 }
22 const configuration = {
23 /**
24 * `@rushstack/eslint-bulk` should report an error if its package.json is older than this number
25 */
26 minCliVersion: '0.0.0',
27 /**
28 * `@rushstack/eslint-bulk` will invoke this entry point
29 */
30 cliEntryPoint: require.resolve('../exports/eslint-bulk')
31 };
32 console.log(constants_1.ESLINT_BULK_STDOUT_START_DELIMETER + JSON.stringify(configuration) + constants_1.ESLINT_BULK_STDOUT_END_DELIMETER);
33}
34function getPathToLinterJS() {
35 if (!_patch_base_1.eslintFolder) {
36 throw new Error('Cannot find ESLint installation to patch.');
37 }
38 return `${_patch_base_1.eslintFolder}/lib/linter/linter.js`;
39}
40function ensurePathToGeneratedPatch() {
41 const patchesFolderPath = `${node_os_1.default.tmpdir()}/rushstack-eslint-bulk-${CURRENT_PACKAGE_VERSION}/patches`;
42 node_fs_1.default.mkdirSync(patchesFolderPath, { recursive: true });
43 const pathToGeneratedPatch = `${patchesFolderPath}/linter-patch-v${_patch_base_1.eslintPackageVersion}.js`;
44 return pathToGeneratedPatch;
45}
46//# sourceMappingURL=path-utils.js.map
Note: See TracBrowser for help on using the repository browser.