Skip to content

Commit

Permalink
Delegate getting the folder name to path module
Browse files Browse the repository at this point in the history
  • Loading branch information
daniilsapa committed Jul 15, 2024
1 parent e5acd3d commit 4f66a1e
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { sep } from 'node:path'
import { basename } from 'node:path'

import { getLayers, isSliced, conventionalSegmentNames } from '@feature-sliced/filesystem'
import type { Diagnostic, Rule } from '@steiger/types'
Expand All @@ -13,7 +13,7 @@ const noSegmentsOnSlicedLayers = {
if (isSliced(layer)) {
for (const directChild of layer.children) {
if (directChild.type === 'folder') {
const folderName = directChild.path.split(sep).pop()
const folderName = basename(directChild.path)
const isConventionalSegment = folderName && conventionalSegmentNames.includes(folderName)

if (isConventionalSegment) {
Expand Down

0 comments on commit 4f66a1e

Please sign in to comment.