@yasainet/eslint 0.0.28 → 0.0.29
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/package.json +1 -1
- package/src/common/index.mjs +2 -1
- package/src/common/naming.mjs +19 -0
package/package.json
CHANGED
package/src/common/index.mjs
CHANGED
|
@@ -2,7 +2,7 @@ import { generatePrefixLibMapping } from "./constants.mjs";
|
|
|
2
2
|
import { createImportsConfigs } from "./imports.mjs";
|
|
3
3
|
import { createJsdocConfigs } from "./jsdoc.mjs";
|
|
4
4
|
import { createLayersConfigs } from "./layers.mjs";
|
|
5
|
-
import { createNamingConfigs } from "./naming.mjs";
|
|
5
|
+
import { createLibNamingConfigs, createNamingConfigs } from "./naming.mjs";
|
|
6
6
|
import { rulesConfigs } from "./rules.mjs";
|
|
7
7
|
|
|
8
8
|
/** Build common configs scoped to the given feature root. */
|
|
@@ -14,6 +14,7 @@ export function createCommonConfigs(
|
|
|
14
14
|
return [
|
|
15
15
|
...rulesConfigs,
|
|
16
16
|
...createNamingConfigs(featureRoot, prefixLibMapping),
|
|
17
|
+
...createLibNamingConfigs(featureRoot),
|
|
17
18
|
...createLayersConfigs(featureRoot),
|
|
18
19
|
...createImportsConfigs(featureRoot, prefixLibMapping, { banAliasImports }),
|
|
19
20
|
...createJsdocConfigs(featureRoot),
|
package/src/common/naming.mjs
CHANGED
|
@@ -2,6 +2,25 @@ import { featuresGlob } from "./constants.mjs";
|
|
|
2
2
|
import { localPlugin } from "./local-plugins/index.mjs";
|
|
3
3
|
import { checkFile } from "./plugins.mjs";
|
|
4
4
|
|
|
5
|
+
/** Scope lib naming rules to the lib root derived from the given feature root. */
|
|
6
|
+
export function createLibNamingConfigs(featureRoot) {
|
|
7
|
+
const libRoot = featureRoot.replace(/features$/, "lib");
|
|
8
|
+
return [
|
|
9
|
+
{
|
|
10
|
+
name: "naming/lib",
|
|
11
|
+
files: [`${libRoot}/**/*.ts`],
|
|
12
|
+
ignores: [`${libRoot}/**/*.type.ts`],
|
|
13
|
+
plugins: { "check-file": checkFile },
|
|
14
|
+
rules: {
|
|
15
|
+
"check-file/filename-naming-convention": [
|
|
16
|
+
"error",
|
|
17
|
+
{ "**/*.ts": "*.lib" },
|
|
18
|
+
],
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
];
|
|
22
|
+
}
|
|
23
|
+
|
|
5
24
|
/** Scope naming rules to the given feature root. */
|
|
6
25
|
export function createNamingConfigs(featureRoot, prefixLibMapping) {
|
|
7
26
|
const prefixes = Object.keys(prefixLibMapping);
|