persona-community-5/.pnpm-store/v3/files/94/e76c72936acc68d1f1c7bfc70e6a0bc856f00997daf000b12dd8084bad9258c20a0a987bffca729fadbb4c3bad7f6b4ed2884a5c7d2bb30e2392ee859f5f5a
rdev-worker a1d0d1bf1c
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
build: /implement-feature community-ui --requirements 'Build the React commu...
2026-02-24 08:22:30 +00:00

31 lines
1.5 KiB
Plaintext

"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.describeFilePath = describeFilePath;
const path_1 = __importDefault(require("path"));
function describeFilePath(filePath, tsconfigRootDir) {
// If the TSConfig root dir is a parent of the filePath, use
// `<tsconfigRootDir>` as a prefix for the path.
const relative = path_1.default.relative(tsconfigRootDir, filePath);
if (relative && !relative.startsWith('..') && !path_1.default.isAbsolute(relative)) {
return `<tsconfigRootDir>/${relative}`;
}
// Root-like Mac/Linux (~/*, ~*) or Windows (C:/*, /) paths that aren't
// relative to the TSConfig root dir should be fully described.
// This avoids strings like <tsconfigRootDir>/../../../../repo/file.ts.
// https://github.com/typescript-eslint/typescript-eslint/issues/6289
if (/^[(\w+:)\\/~]/.test(filePath)) {
return filePath;
}
// Similarly, if the relative path would contain a lot of ../.., then
// ignore it and print the file path directly.
if (/\.\.[/\\]\.\./.test(relative)) {
return filePath;
}
// Lastly, since we've eliminated all special cases, we know the cleanest
// path to print is probably the prefixed relative one.
return `<tsconfigRootDir>/${relative}`;
}
//# sourceMappingURL=describeFilePath.js.map