@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/dist/main.js CHANGED
@@ -1,7 +1,7 @@
1
1
  // package.json
2
2
  var package_default = {
3
3
  name: "@morriconeluca/eslint-plugin-faf",
4
- version: "0.3.0",
4
+ version: "0.4.0",
5
5
  description: "An ESLint plugin for FAF projects.",
6
6
  repository: {
7
7
  type: "git",
@@ -1182,24 +1182,6 @@ function resolveHorizontalHierarchy(lcaPath, subA, subB, config) {
1182
1182
  }
1183
1183
 
1184
1184
  // src/_rules/no-peer-dependency/no-peer-dependency.rule.ts
1185
- function getDirectoryRole(dirPath, config) {
1186
- const folderName = path13.basename(dirPath);
1187
- if (folderName.startsWith("_")) {
1188
- return getRoleFromFolderName(folderName, config);
1189
- }
1190
- const contents = readDirCached(dirPath);
1191
- for (const file of contents.files) {
1192
- if (file.startsWith(folderName + ".")) {
1193
- const role = getFileRole(file, config);
1194
- if (role) return role;
1195
- }
1196
- }
1197
- return null;
1198
- }
1199
- function getRoleFromFolderName(name, config) {
1200
- const catConfig = config.categories?.find((c) => c.name === name);
1201
- return catConfig ? catConfig.role ?? null : null;
1202
- }
1203
1185
  function getRootNodeIndex(relPath, rfConfig, lcaPath) {
1204
1186
  const relToLca = path13.relative(lcaPath, relPath).replace(/\\/g, "/");
1205
1187
  for (let i = 0; i < rfConfig.rootNodes.length; i++) {
@@ -1341,23 +1323,10 @@ var rule6 = {
1341
1323
  });
1342
1324
  }
1343
1325
  } else {
1344
- const roleA = getDirectoryRole(path13.posix.join(lca, subA), config);
1345
- const roleB = getDirectoryRole(path13.posix.join(lca, subB), config);
1346
- const idxA = roleA ? getRoleHierarchyIndex(roleA, config) : -1;
1347
- const idxB = roleB ? getRoleHierarchyIndex(roleB, config) : -1;
1348
- if (idxA !== -1 && idxB !== -1) {
1349
- if (idxB >= idxA) {
1350
- context.report({
1351
- 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}".`,
1352
- node
1353
- });
1354
- }
1355
- } else {
1356
- context.report({
1357
- message: `Peer separation violation: sibling directories "${subA}" and "${subB}" cannot import each other because no horizontal hierarchy is defined under parent "${lca}".`,
1358
- node
1359
- });
1360
- }
1326
+ context.report({
1327
+ message: `Peer separation violation: sibling directories "${subA}" and "${subB}" cannot import each other because no horizontal hierarchy is defined under parent "${lca}".`,
1328
+ node
1329
+ });
1361
1330
  }
1362
1331
  }
1363
1332
  return {