UNPKG

eslint-plugin-conarti-fsd

Version:
35 lines (28 loc) 686 B
module.exports.shouldBeRelative = (pathsInfo) => { const { isRelative, importLayer, importSlice, currentFileLayer, currentFileSlice, } = pathsInfo; if (isRelative) { return false; } if (!importLayer || !importSlice) { return false; } if (!currentFileLayer && !currentFileSlice) { return false; } if (!currentFileSlice && importSlice && currentFileLayer === importLayer) { return true; } if ( currentFileLayer === 'shared' && importLayer === 'shared' || currentFileLayer === 'app' && importLayer === 'app' ) { return true; } return currentFileSlice === importSlice && currentFileLayer === importLayer; };