feat(F-048): completed feature
This commit is contained in:
@@ -72,7 +72,12 @@ function checkFile(file, rootAbs, violations) {
|
||||
// R1: stay inside own module or go to shared
|
||||
const ownModule = relTarget.startsWith(path.join('modules', sourceInModule) + path.sep);
|
||||
const toShared = targetParts[0] === 'shared';
|
||||
if (!ownModule && !toShared) {
|
||||
const toOtherModulePublicIndex =
|
||||
targetInModule !== null &&
|
||||
targetInModule !== sourceInModule &&
|
||||
targetParts.length === 3 &&
|
||||
targetParts[2] === 'index';
|
||||
if (!ownModule && !toShared && !toOtherModulePublicIndex) {
|
||||
violations.push(
|
||||
`R1 violation: ${relFile} imports "${specifier}" (escapes module "${sourceInModule}")`,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user