UNPKG

@conarti/eslint-plugin-feature-sliced

Version:
23 lines (22 loc) 807 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.reportCanNotImportLayer = void 0; const utils_1 = require("@typescript-eslint/utils"); function reportCanNotImportLayer(context, node, pathsInfo) { function getReportPosition(validatedNode) { const isSpecifier = validatedNode.type === utils_1.AST_NODE_TYPES.ImportSpecifier; if (isSpecifier) { return validatedNode; } return validatedNode.source; } context.report({ node: getReportPosition(node), messageId: "can-not-import", data: { importLayer: pathsInfo.fsdPartsOfTarget.layer, currentFileLayer: pathsInfo.fsdPartsOfCurrentFile.layer, }, }); } exports.reportCanNotImportLayer = reportCanNotImportLayer;