@conarti/eslint-plugin-feature-sliced 2.0.0-rc.2 → 2.0.0-rc.3
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 +9 -8
- package/dist/index.js +8 -7
- package/package.json +7 -6
package/dist/index.cjs
CHANGED
|
@@ -28,11 +28,11 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
29
|
|
|
30
30
|
// src/index.ts
|
|
31
|
-
var
|
|
32
|
-
__export(
|
|
33
|
-
default: () =>
|
|
31
|
+
var index_exports = {};
|
|
32
|
+
__export(index_exports, {
|
|
33
|
+
default: () => index_default
|
|
34
34
|
});
|
|
35
|
-
module.exports = __toCommonJS(
|
|
35
|
+
module.exports = __toCommonJS(index_exports);
|
|
36
36
|
|
|
37
37
|
// src/config.ts
|
|
38
38
|
var PLUGIN_NAME = "@conarti/feature-sliced";
|
|
@@ -67,7 +67,7 @@ var segments = [
|
|
|
67
67
|
var pathSeparator = "/";
|
|
68
68
|
|
|
69
69
|
// package.json
|
|
70
|
-
var version = "2.0.0-rc.
|
|
70
|
+
var version = "2.0.0-rc.3";
|
|
71
71
|
|
|
72
72
|
// src/rules/index.ts
|
|
73
73
|
var import_eslint_plugin_import_x = __toESM(require("eslint-plugin-import-x"), 1);
|
|
@@ -343,7 +343,7 @@ function compareFeatureSlicedParts(fsPartsToCompare) {
|
|
|
343
343
|
} = fsPartsToCompare;
|
|
344
344
|
const hasUnknownLayers = target.validatedFeatureSlicedParts.hasNotLayer || currentFile.validatedFeatureSlicedParts.hasNotLayer;
|
|
345
345
|
const isSameLayer = target.validatedFeatureSlicedParts.hasLayer && currentFile.validatedFeatureSlicedParts.hasLayer && target.fsdParts.layer === currentFile.fsdParts.layer;
|
|
346
|
-
const isSameSlice = target.validatedFeatureSlicedParts.hasSlice && currentFile.validatedFeatureSlicedParts.hasSlice && target.fsdParts.slice === currentFile.fsdParts.slice;
|
|
346
|
+
const isSameSlice = isSameLayer && target.validatedFeatureSlicedParts.hasSlice && currentFile.validatedFeatureSlicedParts.hasSlice && target.fsdParts.slice === currentFile.fsdParts.slice;
|
|
347
347
|
const isSameSegment = target.fsdParts.segment === currentFile.fsdParts.segment;
|
|
348
348
|
const isSameLayerWithoutSlices = isSameLayer && !target.validatedFeatureSlicedParts.canLayerContainSlices && !currentFile.validatedFeatureSlicedParts.canLayerContainSlices;
|
|
349
349
|
return {
|
|
@@ -724,7 +724,8 @@ function extractValueToRemove(pathsInfo) {
|
|
|
724
724
|
function convertToPublicApi(pathsInfo) {
|
|
725
725
|
const { normalizedTargetPath } = pathsInfo;
|
|
726
726
|
const valueToRemove = extractValueToRemove(pathsInfo);
|
|
727
|
-
|
|
727
|
+
let publicApiPath = normalizedTargetPath.replace(`/${valueToRemove}`, "");
|
|
728
|
+
publicApiPath = publicApiPath.replace(/\.\w+$/, "");
|
|
728
729
|
return [publicApiPath, valueToRemove];
|
|
729
730
|
}
|
|
730
731
|
|
|
@@ -1001,4 +1002,4 @@ function defineRules(options) {
|
|
|
1001
1002
|
}
|
|
1002
1003
|
|
|
1003
1004
|
// src/index.ts
|
|
1004
|
-
var
|
|
1005
|
+
var index_default = createPlugin;
|
package/dist/index.js
CHANGED
|
@@ -31,7 +31,7 @@ var segments = [
|
|
|
31
31
|
var pathSeparator = "/";
|
|
32
32
|
|
|
33
33
|
// package.json
|
|
34
|
-
var version = "2.0.0-rc.
|
|
34
|
+
var version = "2.0.0-rc.3";
|
|
35
35
|
|
|
36
36
|
// src/rules/index.ts
|
|
37
37
|
import pluginImport from "eslint-plugin-import-x";
|
|
@@ -49,10 +49,10 @@ function isPathRelative(path3) {
|
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
// src/lib/path/join-path.ts
|
|
52
|
-
import path2 from "
|
|
52
|
+
import path2 from "path";
|
|
53
53
|
|
|
54
54
|
// src/lib/path/normalize-path.ts
|
|
55
|
-
import path from "
|
|
55
|
+
import path from "path";
|
|
56
56
|
function normalizePath(targetPath) {
|
|
57
57
|
const winSepRegExp = /\\/g;
|
|
58
58
|
const withNormalizedSeparators = path.normalize(targetPath).replace(winSepRegExp, pathSeparator);
|
|
@@ -310,7 +310,7 @@ function compareFeatureSlicedParts(fsPartsToCompare) {
|
|
|
310
310
|
} = fsPartsToCompare;
|
|
311
311
|
const hasUnknownLayers = target.validatedFeatureSlicedParts.hasNotLayer || currentFile.validatedFeatureSlicedParts.hasNotLayer;
|
|
312
312
|
const isSameLayer = target.validatedFeatureSlicedParts.hasLayer && currentFile.validatedFeatureSlicedParts.hasLayer && target.fsdParts.layer === currentFile.fsdParts.layer;
|
|
313
|
-
const isSameSlice = target.validatedFeatureSlicedParts.hasSlice && currentFile.validatedFeatureSlicedParts.hasSlice && target.fsdParts.slice === currentFile.fsdParts.slice;
|
|
313
|
+
const isSameSlice = isSameLayer && target.validatedFeatureSlicedParts.hasSlice && currentFile.validatedFeatureSlicedParts.hasSlice && target.fsdParts.slice === currentFile.fsdParts.slice;
|
|
314
314
|
const isSameSegment = target.fsdParts.segment === currentFile.fsdParts.segment;
|
|
315
315
|
const isSameLayerWithoutSlices = isSameLayer && !target.validatedFeatureSlicedParts.canLayerContainSlices && !currentFile.validatedFeatureSlicedParts.canLayerContainSlices;
|
|
316
316
|
return {
|
|
@@ -698,7 +698,8 @@ function extractValueToRemove(pathsInfo) {
|
|
|
698
698
|
function convertToPublicApi(pathsInfo) {
|
|
699
699
|
const { normalizedTargetPath } = pathsInfo;
|
|
700
700
|
const valueToRemove = extractValueToRemove(pathsInfo);
|
|
701
|
-
|
|
701
|
+
let publicApiPath = normalizedTargetPath.replace(`/${valueToRemove}`, "");
|
|
702
|
+
publicApiPath = publicApiPath.replace(/\.\w+$/, "");
|
|
702
703
|
return [publicApiPath, valueToRemove];
|
|
703
704
|
}
|
|
704
705
|
|
|
@@ -975,7 +976,7 @@ function defineRules(options) {
|
|
|
975
976
|
}
|
|
976
977
|
|
|
977
978
|
// src/index.ts
|
|
978
|
-
var
|
|
979
|
+
var index_default = createPlugin;
|
|
979
980
|
export {
|
|
980
|
-
|
|
981
|
+
index_default as default
|
|
981
982
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@conarti/eslint-plugin-feature-sliced",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.0.0-rc.
|
|
4
|
+
"version": "2.0.0-rc.3",
|
|
5
5
|
"description": "Feature-sliced design methodology plugin",
|
|
6
6
|
"author": "Aleksandr Belous <abelous2009@gmail.com>",
|
|
7
7
|
"license": "ISC",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"stub": "tsup --format esm",
|
|
37
37
|
"dev": "npx @eslint/config-inspector --config eslint.config.ts",
|
|
38
38
|
"watch": "tsup --format esm,cjs --watch",
|
|
39
|
-
"
|
|
39
|
+
"type-check": "tsc --noEmit",
|
|
40
40
|
"lint": "eslint .",
|
|
41
41
|
"test": "vitest",
|
|
42
42
|
"test:ui": "vitest --ui --api 9527",
|
|
@@ -56,9 +56,9 @@
|
|
|
56
56
|
"eslint": ">=9"
|
|
57
57
|
},
|
|
58
58
|
"dependencies": {
|
|
59
|
-
"@typescript-eslint/utils": "^8.
|
|
59
|
+
"@typescript-eslint/utils": "^8.45.0",
|
|
60
60
|
"eslint-flat-config-utils": "^0.4.0",
|
|
61
|
-
"eslint-plugin-import-x": "^4.
|
|
61
|
+
"eslint-plugin-import-x": "^4.16.1",
|
|
62
62
|
"picomatch": "^2.3.1"
|
|
63
63
|
},
|
|
64
64
|
"devDependencies": {
|
|
@@ -67,7 +67,8 @@
|
|
|
67
67
|
"@types/eslint": "^9.6.1",
|
|
68
68
|
"@types/node": "^20.4.2",
|
|
69
69
|
"@types/picomatch": "^2.3.0",
|
|
70
|
-
"@typescript-eslint/parser": "^8.
|
|
70
|
+
"@typescript-eslint/parser": "^8.45.0",
|
|
71
|
+
"@typescript-eslint/rule-tester": "^8.45.0",
|
|
71
72
|
"@vitest/coverage-v8": "^0.33.0",
|
|
72
73
|
"@vitest/ui": "^0.33.0",
|
|
73
74
|
"conventional-changelog-cli": "^2.2.2",
|
|
@@ -78,7 +79,7 @@
|
|
|
78
79
|
"prompts": "^2.4.2",
|
|
79
80
|
"rimraf": "^5.0.1",
|
|
80
81
|
"semver": "^7.5.4",
|
|
81
|
-
"tsup": "^8.
|
|
82
|
+
"tsup": "^8.5.0",
|
|
82
83
|
"typescript": "^5.6.2",
|
|
83
84
|
"vitepress": "^1.0.0-alpha.64",
|
|
84
85
|
"vitest": "^0.33.0"
|