@yasainet/eslint 0.0.77 → 0.0.78

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yasainet/eslint",
3
- "version": "0.0.77",
3
+ "version": "0.0.78",
4
4
  "description": "ESLint",
5
5
  "type": "module",
6
6
  "exports": {
@@ -6,6 +6,23 @@ export const LIB_BOUNDARY_PATTERNS = [
6
6
  },
7
7
  ];
8
8
 
9
+ export const LIB_OUTBOUND_PATTERNS = [
10
+ {
11
+ regex: "^@/(?!lib/).+",
12
+ message:
13
+ "lib は app 内部 (@/features 等) を import 不可。lib は最下層の API 橋渡し。外部 SDK と @/lib/** のみ依存可。",
14
+ },
15
+ ];
16
+
17
+ export const LIB_UTILS_PURITY_PATTERNS = [
18
+ ...LIB_OUTBOUND_PATTERNS,
19
+ {
20
+ regex: "^@/lib/(?!.*/types$).+",
21
+ message:
22
+ "lib/**/utils.ts は純粋ヘルパー。client/index は import 不可、@/lib/**/types のみ可。",
23
+ },
24
+ ];
25
+
9
26
  export const MAPPING_PATTERNS = [
10
27
  {
11
28
  group: ["@/utils/mapping.util"],
@@ -1,3 +1,7 @@
1
+ import {
2
+ LIB_OUTBOUND_PATTERNS,
3
+ LIB_UTILS_PURITY_PATTERNS,
4
+ } from "../../_internal/import-patterns.mjs";
1
5
  import { checkFile } from "../../_internal/plugins.mjs";
2
6
 
3
7
  export function createTopLevelLibConfigs({ featureRoot }) {
@@ -14,5 +18,25 @@ export function createTopLevelLibConfigs({ featureRoot }) {
14
18
  ],
15
19
  },
16
20
  },
21
+ {
22
+ name: "imports/top-level-lib",
23
+ files: [`${libRoot}/**/*.ts`],
24
+ rules: {
25
+ "no-restricted-imports": [
26
+ "error",
27
+ { patterns: LIB_OUTBOUND_PATTERNS },
28
+ ],
29
+ },
30
+ },
31
+ {
32
+ name: "imports/top-level-lib-utils",
33
+ files: [`${libRoot}/**/utils.ts`],
34
+ rules: {
35
+ "no-restricted-imports": [
36
+ "error",
37
+ { patterns: LIB_UTILS_PURITY_PATTERNS },
38
+ ],
39
+ },
40
+ },
17
41
  ];
18
42
  }