@conarti/eslint-plugin-feature-sliced
Version:
Feature-sliced design methodology plugin
17 lines (16 loc) • 598 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.shouldBeAbsolute = void 0;
const path_1 = require("../../../lib/path");
function shouldBeAbsolute(pathsInfo) {
const { normalizedTargetPath, fsdPartsOfTarget, fsdPartsOfCurrentFile, hasUnknownLayers, } = pathsInfo;
const isAbsolute = !(0, path_1.isPathRelative)(normalizedTargetPath);
if (isAbsolute) {
return false;
}
if (hasUnknownLayers) {
return false;
}
return fsdPartsOfCurrentFile.layer !== fsdPartsOfTarget.layer;
}
exports.shouldBeAbsolute = shouldBeAbsolute;