@morriconeluca/eslint-plugin-faf 0.3.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -317,7 +317,7 @@ Applies **Peer Isolation**:
317
317
 
318
318
  - Prevents sibling files and folders from importing each other unless an explicit hierarchy is configured:
319
319
  - **Inside a Fragment**: Flow is governed by the `roles` array order.
320
- - **Between folders**: Flow is governed by `localHorizontalHierarchies` or `globalHorizontalHierarchies`. If undefined, the linter falls back to mapped roles. Otherwise, peer isolation is strictly enforced.
320
+ - **Between folders**: Flow is governed exclusively by `localHorizontalHierarchies` or `globalHorizontalHierarchies`; a sibling pair without a matching entry is denied in both directions.
321
321
  - **Root Nodes**: Flow is governed exclusively by the defined index order in `rootFragments.rootNodes`. Root Nodes are exempt from the Role naming convention, so relationships between them never fall back to the `roles` scale: any relationship without a matching `rootNodes` entry is denied.
322
322
 
323
323
  ### 7. `faf/category-mutually-exclusive`
package/dist/main.cjs CHANGED
@@ -39,7 +39,7 @@ module.exports = __toCommonJS(main_exports);
39
39
  // package.json
40
40
  var package_default = {
41
41
  name: "@morriconeluca/eslint-plugin-faf",
42
- version: "0.3.0",
42
+ version: "0.4.0",
43
43
  description: "An ESLint plugin for FAF projects.",
44
44
  repository: {
45
45
  type: "git",
@@ -1220,24 +1220,6 @@ function resolveHorizontalHierarchy(lcaPath, subA, subB, config) {
1220
1220
  }
1221
1221
 
1222
1222
  // src/_rules/no-peer-dependency/no-peer-dependency.rule.ts
1223
- function getDirectoryRole(dirPath, config) {
1224
- const folderName = import_path13.default.basename(dirPath);
1225
- if (folderName.startsWith("_")) {
1226
- return getRoleFromFolderName(folderName, config);
1227
- }
1228
- const contents = readDirCached(dirPath);
1229
- for (const file of contents.files) {
1230
- if (file.startsWith(folderName + ".")) {
1231
- const role = getFileRole(file, config);
1232
- if (role) return role;
1233
- }
1234
- }
1235
- return null;
1236
- }
1237
- function getRoleFromFolderName(name, config) {
1238
- const catConfig = config.categories?.find((c) => c.name === name);
1239
- return catConfig ? catConfig.role ?? null : null;
1240
- }
1241
1223
  function getRootNodeIndex(relPath, rfConfig, lcaPath) {
1242
1224
  const relToLca = import_path13.default.relative(lcaPath, relPath).replace(/\\/g, "/");
1243
1225
  for (let i = 0; i < rfConfig.rootNodes.length; i++) {
@@ -1379,23 +1361,10 @@ var rule6 = {
1379
1361
  });
1380
1362
  }
1381
1363
  } else {
1382
- const roleA = getDirectoryRole(import_path13.default.posix.join(lca, subA), config);
1383
- const roleB = getDirectoryRole(import_path13.default.posix.join(lca, subB), config);
1384
- const idxA = roleA ? getRoleHierarchyIndex(roleA, config) : -1;
1385
- const idxB = roleB ? getRoleHierarchyIndex(roleB, config) : -1;
1386
- if (idxA !== -1 && idxB !== -1) {
1387
- if (idxB >= idxA) {
1388
- context.report({
1389
- message: `Horizontal hierarchy violation (fallback to roles): sibling directory "${subA}" (mapped to role "${roleA}", level ${idxA}) cannot import from "${subB}" (mapped to role "${roleB}", level ${idxB}) under parent "${lca}".`,
1390
- node
1391
- });
1392
- }
1393
- } else {
1394
- context.report({
1395
- message: `Peer separation violation: sibling directories "${subA}" and "${subB}" cannot import each other because no horizontal hierarchy is defined under parent "${lca}".`,
1396
- node
1397
- });
1398
- }
1364
+ context.report({
1365
+ message: `Peer separation violation: sibling directories "${subA}" and "${subB}" cannot import each other because no horizontal hierarchy is defined under parent "${lca}".`,
1366
+ node
1367
+ });
1399
1368
  }
1400
1369
  }
1401
1370
  return {