@conarti/eslint-plugin-feature-sliced 2.0.0-rc.13 → 2.0.0-rc.14
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/index.cjs +5 -2
- package/dist/index.js +5 -2
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -88,7 +88,7 @@ function canLayerContainSlices(layer, config) {
|
|
|
88
88
|
}
|
|
89
89
|
|
|
90
90
|
// package.json
|
|
91
|
-
var version = "2.0.0-rc.
|
|
91
|
+
var version = "2.0.0-rc.14";
|
|
92
92
|
|
|
93
93
|
// src/rules/index.ts
|
|
94
94
|
var _eslintpluginimportx = require('eslint-plugin-import-x'); var _eslintpluginimportx2 = _interopRequireDefault(_eslintpluginimportx);
|
|
@@ -411,6 +411,9 @@ function extractSlice(targetPath, layersConfig, segmentsConfig) {
|
|
|
411
411
|
return partsAfterLayer[segmentIndex - 1];
|
|
412
412
|
}
|
|
413
413
|
if (segmentIndex === 0) {
|
|
414
|
+
if (partsAfterLayer.length === 1) {
|
|
415
|
+
return null;
|
|
416
|
+
}
|
|
414
417
|
return partsAfterLayer[0];
|
|
415
418
|
}
|
|
416
419
|
return partsAfterLayer[partsAfterLayer.length - 1] || null;
|
|
@@ -482,7 +485,7 @@ function compareFeatureSlicedParts(fsPartsToCompare) {
|
|
|
482
485
|
} = fsPartsToCompare;
|
|
483
486
|
const hasUnknownLayers = target.validatedFeatureSlicedParts.hasNotLayer || currentFile.validatedFeatureSlicedParts.hasNotLayer;
|
|
484
487
|
const isSameLayer = target.validatedFeatureSlicedParts.hasLayer && currentFile.validatedFeatureSlicedParts.hasLayer && target.fsdParts.layer === currentFile.fsdParts.layer;
|
|
485
|
-
const isSameSlice = isSameLayer && target.validatedFeatureSlicedParts.hasSlice && currentFile.validatedFeatureSlicedParts.hasSlice && target.fsdParts.slice === currentFile.fsdParts.slice;
|
|
488
|
+
const isSameSlice = isSameLayer && (target.validatedFeatureSlicedParts.hasSlice && currentFile.validatedFeatureSlicedParts.hasSlice && target.fsdParts.slice === currentFile.fsdParts.slice || target.validatedFeatureSlicedParts.hasNotSlice && currentFile.validatedFeatureSlicedParts.hasNotSlice);
|
|
486
489
|
const isSameSegment = target.fsdParts.segment === currentFile.fsdParts.segment;
|
|
487
490
|
const isSameLayerWithoutSlices = isSameLayer && !target.validatedFeatureSlicedParts.canLayerContainSlices && !currentFile.validatedFeatureSlicedParts.canLayerContainSlices;
|
|
488
491
|
return {
|
package/dist/index.js
CHANGED
|
@@ -88,7 +88,7 @@ function canLayerContainSlices(layer, config) {
|
|
|
88
88
|
}
|
|
89
89
|
|
|
90
90
|
// package.json
|
|
91
|
-
var version = "2.0.0-rc.
|
|
91
|
+
var version = "2.0.0-rc.14";
|
|
92
92
|
|
|
93
93
|
// src/rules/index.ts
|
|
94
94
|
import pluginImport from "eslint-plugin-import-x";
|
|
@@ -411,6 +411,9 @@ function extractSlice(targetPath, layersConfig, segmentsConfig) {
|
|
|
411
411
|
return partsAfterLayer[segmentIndex - 1];
|
|
412
412
|
}
|
|
413
413
|
if (segmentIndex === 0) {
|
|
414
|
+
if (partsAfterLayer.length === 1) {
|
|
415
|
+
return null;
|
|
416
|
+
}
|
|
414
417
|
return partsAfterLayer[0];
|
|
415
418
|
}
|
|
416
419
|
return partsAfterLayer[partsAfterLayer.length - 1] || null;
|
|
@@ -482,7 +485,7 @@ function compareFeatureSlicedParts(fsPartsToCompare) {
|
|
|
482
485
|
} = fsPartsToCompare;
|
|
483
486
|
const hasUnknownLayers = target.validatedFeatureSlicedParts.hasNotLayer || currentFile.validatedFeatureSlicedParts.hasNotLayer;
|
|
484
487
|
const isSameLayer = target.validatedFeatureSlicedParts.hasLayer && currentFile.validatedFeatureSlicedParts.hasLayer && target.fsdParts.layer === currentFile.fsdParts.layer;
|
|
485
|
-
const isSameSlice = isSameLayer && target.validatedFeatureSlicedParts.hasSlice && currentFile.validatedFeatureSlicedParts.hasSlice && target.fsdParts.slice === currentFile.fsdParts.slice;
|
|
488
|
+
const isSameSlice = isSameLayer && (target.validatedFeatureSlicedParts.hasSlice && currentFile.validatedFeatureSlicedParts.hasSlice && target.fsdParts.slice === currentFile.fsdParts.slice || target.validatedFeatureSlicedParts.hasNotSlice && currentFile.validatedFeatureSlicedParts.hasNotSlice);
|
|
486
489
|
const isSameSegment = target.fsdParts.segment === currentFile.fsdParts.segment;
|
|
487
490
|
const isSameLayerWithoutSlices = isSameLayer && !target.validatedFeatureSlicedParts.canLayerContainSlices && !currentFile.validatedFeatureSlicedParts.canLayerContainSlices;
|
|
488
491
|
return {
|
package/package.json
CHANGED