source: frontend/node_modules/@rushstack/eslint-patch/lib-esm/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: 1.8 KB
Line 
1// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
2// See LICENSE in the project root for license information.
3import fs from 'node:fs';
4import os from 'node:os';
5import { eslintFolder, eslintPackageVersion } from '../_patch-base';
6import { ESLINT_BULK_DETECT_ENV_VAR_NAME, ESLINT_BULK_STDOUT_END_DELIMETER, ESLINT_BULK_STDOUT_START_DELIMETER } from './constants';
7import currentPackageJson from '../../package.json';
8const CURRENT_PACKAGE_VERSION = currentPackageJson.version;
9export function findAndConsoleLogPatchPathCli() {
10 const eslintBulkDetectEnvVarValue = process.env[ESLINT_BULK_DETECT_ENV_VAR_NAME];
11 if (eslintBulkDetectEnvVarValue !== 'true' && eslintBulkDetectEnvVarValue !== '1') {
12 return;
13 }
14 const configuration = {
15 /**
16 * `@rushstack/eslint-bulk` should report an error if its package.json is older than this number
17 */
18 minCliVersion: '0.0.0',
19 /**
20 * `@rushstack/eslint-bulk` will invoke this entry point
21 */
22 cliEntryPoint: require.resolve('../exports/eslint-bulk')
23 };
24 console.log(ESLINT_BULK_STDOUT_START_DELIMETER + JSON.stringify(configuration) + ESLINT_BULK_STDOUT_END_DELIMETER);
25}
26export function getPathToLinterJS() {
27 if (!eslintFolder) {
28 throw new Error('Cannot find ESLint installation to patch.');
29 }
30 return `${eslintFolder}/lib/linter/linter.js`;
31}
32export function ensurePathToGeneratedPatch() {
33 const patchesFolderPath = `${os.tmpdir()}/rushstack-eslint-bulk-${CURRENT_PACKAGE_VERSION}/patches`;
34 fs.mkdirSync(patchesFolderPath, { recursive: true });
35 const pathToGeneratedPatch = `${patchesFolderPath}/linter-patch-v${eslintPackageVersion}.js`;
36 return pathToGeneratedPatch;
37}
38//# sourceMappingURL=path-utils.js.map
Note: See TracBrowser for help on using the repository browser.