@yasainet/eslint 0.0.60 → 0.0.61

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/README.md CHANGED
@@ -25,7 +25,7 @@ Each entry point enforces a feature-based architecture. **Files do not carry rol
25
25
  ```text
26
26
  {featureRoot}/
27
27
  ├── {feature}/
28
- │ ├── interactors/ # entry points (server.ts / admin.ts / client.ts)
28
+ │ ├── entries/ # entry points called from page.tsx / route.ts / hooks (server.ts / admin.ts / client.ts)
29
29
  │ ├── services/ # business logic (server.ts ...)
30
30
  │ ├── queries/ # data access (one file per upstream lib: <lib-name>.ts)
31
31
  │ ├── types/ # type defs (one file per feature: <feature>.ts)
@@ -53,7 +53,7 @@ For single-client libs the prefix mapping registers only the directory name, aut
53
53
 
54
54
  ### File naming rules
55
55
 
56
- - **No multi-extension suffixes** (`.lib`, `.service`, `.query`, `.util`, `.type`, `.schema`, `.constant`, `.interactor` are forbidden). The directory carries the role.
56
+ - **No multi-extension suffixes** (`.lib`, `.service`, `.query`, `.util`, `.type`, `.schema`, `.constant`, `.entry` are forbidden). The directory carries the role.
57
57
  - `lib/<dir>/index.ts` for single-client lib entries (avoids `lib/<dir>/<dir>.ts` redundancy).
58
58
  - `lib/<dir>/types.ts` and `lib/<dir>/proxy.ts` are excluded from the prefix mapping so queries cannot directly depend on them.
59
59
  - `<feature>/{types,schemas,utils,constants}/<feature>.ts` — exactly one file per feature, named after the feature.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yasainet/eslint",
3
- "version": "0.0.60",
3
+ "version": "0.0.61",
4
4
  "description": "ESLint",
5
5
  "type": "module",
6
6
  "exports": {
@@ -5,8 +5,8 @@ const LAYER_PATTERNS = {
5
5
  message: "queries cannot import services (layer violation)",
6
6
  },
7
7
  {
8
- group: ["**/interactors/*", "**/interactors"],
9
- message: "queries cannot import interactors (layer violation)",
8
+ group: ["**/entries/*", "**/entries"],
9
+ message: "queries cannot import entries (layer violation)",
10
10
  },
11
11
  {
12
12
  group: ["**/hooks/*", "**/hooks"],
@@ -15,22 +15,22 @@ const LAYER_PATTERNS = {
15
15
  ],
16
16
  services: [
17
17
  {
18
- group: ["**/interactors/*", "**/interactors"],
19
- message: "services cannot import interactors (layer violation)",
18
+ group: ["**/entries/*", "**/entries"],
19
+ message: "services cannot import entries (layer violation)",
20
20
  },
21
21
  {
22
22
  group: ["**/hooks/*", "**/hooks"],
23
23
  message: "services cannot import hooks (layer violation)",
24
24
  },
25
25
  ],
26
- interactors: [
26
+ entries: [
27
27
  {
28
28
  group: ["**/queries/*", "**/queries"],
29
- message: "interactors cannot import queries (layer violation)",
29
+ message: "entries cannot import queries (layer violation)",
30
30
  },
31
31
  {
32
32
  group: ["**/hooks/*", "**/hooks"],
33
- message: "interactors cannot import hooks (layer violation)",
33
+ message: "entries cannot import hooks (layer violation)",
34
34
  },
35
35
  ],
36
36
  };
@@ -50,11 +50,11 @@ const LATERAL_PATTERNS = {
50
50
  "services cannot import other feature's services (lateral violation)",
51
51
  },
52
52
  ],
53
- interactors: [
53
+ entries: [
54
54
  {
55
- group: ["@/features/*/interactors/*", "@/features/*/interactors"],
55
+ group: ["@/features/*/entries/*", "@/features/*/entries"],
56
56
  message:
57
- "interactors cannot import other feature's interactors (lateral violation)",
57
+ "entries cannot import other feature's entries (lateral violation)",
58
58
  },
59
59
  ],
60
60
  };
@@ -64,21 +64,21 @@ const CARDINALITY_PATTERNS = {
64
64
  {
65
65
  group: ["**/services/client", "**/services/admin"],
66
66
  message:
67
- "server interactor can only import server service (cardinality violation)",
67
+ "server entry can only import server service (cardinality violation)",
68
68
  },
69
69
  ],
70
70
  client: [
71
71
  {
72
72
  group: ["**/services/server", "**/services/admin"],
73
73
  message:
74
- "client interactor can only import client service (cardinality violation)",
74
+ "client entry can only import client service (cardinality violation)",
75
75
  },
76
76
  ],
77
77
  admin: [
78
78
  {
79
79
  group: ["**/services/server", "**/services/client"],
80
80
  message:
81
- "admin interactor can only import admin service (cardinality violation)",
81
+ "admin entry can only import admin service (cardinality violation)",
82
82
  },
83
83
  ],
84
84
  };
@@ -115,12 +115,12 @@ const PAGE_BOUNDARY_PATTERNS = [
115
115
  {
116
116
  group: ["**/queries/*", "**/queries"],
117
117
  message:
118
- "page.tsx can only import interactors, not queries (page-boundary violation)",
118
+ "page.tsx can only import entries, not queries (page-boundary violation)",
119
119
  },
120
120
  {
121
121
  group: ["**/services/*", "**/services"],
122
122
  message:
123
- "page.tsx can only import interactors, not services (page-boundary violation)",
123
+ "page.tsx can only import entries, not services (page-boundary violation)",
124
124
  },
125
125
  ];
126
126
 
@@ -128,12 +128,12 @@ const ROUTE_BOUNDARY_PATTERNS = [
128
128
  {
129
129
  group: ["**/queries/*", "**/queries"],
130
130
  message:
131
- "route.ts can only import interactors, not queries (route-boundary violation)",
131
+ "route.ts can only import entries, not queries (route-boundary violation)",
132
132
  },
133
133
  {
134
134
  group: ["**/services/*", "**/services"],
135
135
  message:
136
- "route.ts can only import interactors, not services (route-boundary violation)",
136
+ "route.ts can only import entries, not services (route-boundary violation)",
137
137
  },
138
138
  ];
139
139
 
@@ -141,12 +141,12 @@ const HOOKS_BOUNDARY_PATTERNS = [
141
141
  {
142
142
  group: ["**/queries/*", "**/queries"],
143
143
  message:
144
- "hooks can only import interactors, not queries (hooks-boundary violation)",
144
+ "hooks can only import entries, not queries (hooks-boundary violation)",
145
145
  },
146
146
  {
147
147
  group: ["**/services/*", "**/services"],
148
148
  message:
149
- "hooks can only import interactors, not services (hooks-boundary violation)",
149
+ "hooks can only import entries, not services (hooks-boundary violation)",
150
150
  },
151
151
  ];
152
152
 
@@ -154,12 +154,12 @@ const COMPONENTS_BOUNDARY_PATTERNS = [
154
154
  {
155
155
  group: ["**/queries/*", "**/queries"],
156
156
  message:
157
- "components can only import interactors or hooks, not queries (components-boundary violation)",
157
+ "components can only import entries or hooks, not queries (components-boundary violation)",
158
158
  },
159
159
  {
160
160
  group: ["**/services/*", "**/services"],
161
161
  message:
162
- "components can only import interactors or hooks, not services (components-boundary violation)",
162
+ "components can only import entries or hooks, not services (components-boundary violation)",
163
163
  },
164
164
  ];
165
165
 
@@ -180,7 +180,7 @@ function makeConfig(name, files, ...patternArrays) {
180
180
  // ones — patterns are not merged. Page / hooks / components boundary configs
181
181
  // run after libBoundaryConfigs and would silently drop lib + mapping bans
182
182
  // unless we re-include those patterns explicitly.
183
- /** Next.js-only: restrict page.tsx to only import interactors. */
183
+ /** Next.js-only: restrict page.tsx to only import entries. */
184
184
  export const pageBoundaryConfigs = [
185
185
  {
186
186
  name: "imports/page-boundary",
@@ -200,7 +200,7 @@ export const pageBoundaryConfigs = [
200
200
  },
201
201
  ];
202
202
 
203
- /** Next.js-only: restrict route.ts to only import interactors. */
203
+ /** Next.js-only: restrict route.ts to only import entries. */
204
204
  export const routeBoundaryConfigs = [
205
205
  {
206
206
  name: "imports/route-boundary",
@@ -220,7 +220,7 @@ export const routeBoundaryConfigs = [
220
220
  },
221
221
  ];
222
222
 
223
- /** Next.js-only: restrict hooks to only import interactors (not queries or services). */
223
+ /** Next.js-only: restrict hooks to only import entries (not queries or services). */
224
224
  export const hooksBoundaryConfigs = [
225
225
  {
226
226
  name: "imports/hooks-boundary",
@@ -240,7 +240,7 @@ export const hooksBoundaryConfigs = [
240
240
  },
241
241
  ];
242
242
 
243
- /** Next.js-only: restrict components to only import interactors or hooks (not queries or services). */
243
+ /** Next.js-only: restrict components to only import entries or hooks (not queries or services). */
244
244
  export const componentsBoundaryConfigs = [
245
245
  {
246
246
  name: "imports/components-boundary",
@@ -350,10 +350,10 @@ export function createImportsConfigs(
350
350
 
351
351
  configs.push(
352
352
  makeConfig(
353
- "interactors",
354
- [`${featureRoot}/**/interactors/*.ts`],
355
- LAYER_PATTERNS.interactors,
356
- LATERAL_PATTERNS.interactors,
353
+ "entries",
354
+ [`${featureRoot}/**/entries/*.ts`],
355
+ LAYER_PATTERNS.entries,
356
+ LATERAL_PATTERNS.entries,
357
357
  LIB_BOUNDARY_PATTERNS,
358
358
  MAPPING_PATTERNS,
359
359
  ),
@@ -376,7 +376,7 @@ export function createImportsConfigs(
376
376
  ignores: [
377
377
  `${featureRoot}/**/services/*.ts`,
378
378
  `${featureRoot}/**/queries/*.ts`,
379
- `${featureRoot}/**/interactors/*.ts`,
379
+ `${featureRoot}/**/entries/*.ts`,
380
380
  `${featureRoot}/**/utils/*.ts`,
381
381
  `${featureRoot}/**/types/*.ts`,
382
382
  ],
@@ -400,10 +400,10 @@ export function createImportsConfigs(
400
400
  for (const prefix of ["server", "client", "admin"]) {
401
401
  configs.push(
402
402
  makeConfig(
403
- `interactors/${prefix}`,
404
- [`${featureRoot}/**/interactors/${prefix}.ts`],
405
- LAYER_PATTERNS.interactors,
406
- LATERAL_PATTERNS.interactors,
403
+ `entries/${prefix}`,
404
+ [`${featureRoot}/**/entries/${prefix}.ts`],
405
+ LAYER_PATTERNS.entries,
406
+ LATERAL_PATTERNS.entries,
407
407
  CARDINALITY_PATTERNS[prefix],
408
408
  LIB_BOUNDARY_PATTERNS,
409
409
  MAPPING_PATTERNS,
@@ -11,7 +11,7 @@ import { localPlugin } from "./local-plugins/index.mjs";
11
11
  export function createLayersConfigs(featureRoot, { typeAware = true } = {}) {
12
12
  const loggerSelector = "CallExpression[callee.object.name='logger']";
13
13
  const loggerMessage =
14
- "logger is not allowed outside interactors. Logging belongs in interactors.";
14
+ "logger is not allowed outside entries. Logging belongs in entries.";
15
15
 
16
16
  const noAnyReturnConfig = {
17
17
  name: "layers/no-any-return",
@@ -26,11 +26,11 @@ export function createLayersConfigs(featureRoot, { typeAware = true } = {}) {
26
26
  };
27
27
 
28
28
  return [
29
- // Logger/console: all features except interactors
29
+ // Logger/console: all features except entries
30
30
  {
31
31
  name: "layers/logger",
32
32
  files: [`${featureRoot}/**/*.ts`],
33
- ignores: [`${featureRoot}/**/interactors/*.ts`],
33
+ ignores: [`${featureRoot}/**/entries/*.ts`],
34
34
  rules: {
35
35
  "no-console": "error",
36
36
  "no-restricted-syntax": [
@@ -49,7 +49,7 @@ export function createLayersConfigs(featureRoot, { typeAware = true } = {}) {
49
49
  {
50
50
  selector: "TryStatement",
51
51
  message:
52
- "try-catch is not allowed in queries. Error handling belongs in interactors.",
52
+ "try-catch is not allowed in queries. Error handling belongs in entries.",
53
53
  },
54
54
  {
55
55
  selector: "IfStatement",
@@ -84,7 +84,7 @@ export function createLayersConfigs(featureRoot, { typeAware = true } = {}) {
84
84
  {
85
85
  selector: "ThrowStatement",
86
86
  message:
87
- "throw is not allowed in queries. Queries must return Supabase's { data, error } shape as-is. Error handling belongs in interactors.",
87
+ "throw is not allowed in queries. Queries must return Supabase's { data, error } shape as-is. Error handling belongs in entries.",
88
88
  },
89
89
  { selector: loggerSelector, message: loggerMessage },
90
90
  ],
@@ -104,20 +104,20 @@ export function createLayersConfigs(featureRoot, { typeAware = true } = {}) {
104
104
  {
105
105
  selector: "TryStatement",
106
106
  message:
107
- "try-catch is not allowed in services. Error handling belongs in interactors.",
107
+ "try-catch is not allowed in services. Error handling belongs in entries.",
108
108
  },
109
109
  { selector: loggerSelector, message: loggerMessage },
110
110
  {
111
111
  selector:
112
112
  "LogicalExpression[operator='??'][left.type='ChainExpression'][left.expression.property.name='message'][right.type='Literal']",
113
113
  message:
114
- "Dead fallback for error message. If you reached this branch the error is known — return the error directly. Unhandled exceptions belong in interactors.",
114
+ "Dead fallback for error message. If you reached this branch the error is known — return the error directly. Unhandled exceptions belong in entries.",
115
115
  },
116
116
  {
117
117
  selector:
118
118
  "LogicalExpression[operator='??'][left.type='MemberExpression'][left.property.name='error'][right.type='ObjectExpression']",
119
119
  message:
120
- "Dead fallback for nullable error. Check `if (error)` and return the error directly. Unhandled exceptions belong in interactors.",
120
+ "Dead fallback for nullable error. Check `if (error)` and return the error directly. Unhandled exceptions belong in entries.",
121
121
  },
122
122
  ],
123
123
  },
@@ -12,7 +12,7 @@ const LAYER_DIR_MAP = {
12
12
  queries: "Query",
13
13
  services: "Service",
14
14
  domains: "Domain",
15
- interactors: "Interactor",
15
+ entries: "Entry",
16
16
  utils: "Util",
17
17
  types: "Type",
18
18
  schemas: "Schema",
@@ -52,9 +52,9 @@ export function createUtilsNamingConfigs(featureRoot) {
52
52
  /**
53
53
  * Scope naming rules to the given feature root:
54
54
  *
55
- * - 全 layer (services / queries / interactors / utils / types / schemas / constants) で suffix を廃止
55
+ * - 全 layer (services / queries / entries / utils / types / schemas / constants) で suffix を廃止
56
56
  * - ファイル名 (basename) は単一トークン (`*` パターン) を強制し、role はディレクトリで宣言する
57
- * - queries / services / interactors のファイル名は prefixLibMapping のキー (lib name) と一致させ、どの lib を呼ぶか明示する
57
+ * - queries / services / entries のファイル名は prefixLibMapping のキー (lib name) と一致させ、どの lib を呼ぶか明示する
58
58
  * - shared/ 配下では feature 名でなく `shared` または lib name を allowed prefix として許可する
59
59
  */
60
60
  export function createNamingConfigs(featureRoot, prefixLibMapping) {
@@ -284,9 +284,9 @@ export function createNamingConfigs(featureRoot, prefixLibMapping) {
284
284
  );
285
285
 
286
286
  configs.push({
287
- name: "naming/interactors",
288
- files: featuresGlob(featureRoot, "**/interactors/*.ts"),
289
- ignores: featuresGlob(featureRoot, "shared/interactors/*.ts"),
287
+ name: "naming/entries",
288
+ files: featuresGlob(featureRoot, "**/entries/*.ts"),
289
+ ignores: featuresGlob(featureRoot, "shared/entries/*.ts"),
290
290
  plugins: { "check-file": checkFile },
291
291
  rules: {
292
292
  "check-file/filename-naming-convention": [
@@ -298,8 +298,8 @@ export function createNamingConfigs(featureRoot, prefixLibMapping) {
298
298
 
299
299
  configs.push(
300
300
  {
301
- name: "naming/interactors-shared",
302
- files: featuresGlob(featureRoot, "shared/interactors/*.ts"),
301
+ name: "naming/entries-shared",
302
+ files: featuresGlob(featureRoot, "shared/entries/*.ts"),
303
303
  plugins: { "check-file": checkFile },
304
304
  rules: {
305
305
  "check-file/filename-naming-convention": [
@@ -40,17 +40,17 @@ export const denoImportsConfigs = [
40
40
  {
41
41
  group: ["**/services/*", "**/services"],
42
42
  message:
43
- "Entry points must not import services directly. Import from interactors instead.",
43
+ "Top-level files must not import services directly. Import from entries instead.",
44
44
  },
45
45
  {
46
46
  group: ["**/queries/*", "**/queries"],
47
47
  message:
48
- "Entry points must not import queries directly. Import from interactors instead.",
48
+ "Top-level files must not import queries directly. Import from entries instead.",
49
49
  },
50
50
  {
51
51
  group: ["*/_lib/*", "*/_lib/**"],
52
52
  message:
53
- "Entry points must not import _lib/ directly. Import from interactors instead.",
53
+ "Top-level files must not import _lib/ directly. Import from entries instead.",
54
54
  },
55
55
  ],
56
56
  },
@@ -1,8 +1,8 @@
1
1
  /** Enforce "use server" / "use client" directives per file convention. */
2
2
  export const directivesConfigs = [
3
3
  {
4
- name: "directives/server-interactor",
5
- files: ["src/features/**/interactors/server.ts"],
4
+ name: "directives/server-entry",
5
+ files: ["src/features/**/entries/server.ts"],
6
6
  rules: {
7
7
  "no-restricted-syntax": [
8
8
  "error",
@@ -10,14 +10,14 @@ export const directivesConfigs = [
10
10
  selector:
11
11
  "Program > :first-child:not(ExpressionStatement[expression.value='use server'])",
12
12
  message:
13
- 'interactors/server.ts must start with "use server" directive.',
13
+ 'entries/server.ts must start with "use server" directive.',
14
14
  },
15
15
  ],
16
16
  },
17
17
  },
18
18
  {
19
- name: "directives/admin-interactor",
20
- files: ["src/features/**/interactors/admin.ts"],
19
+ name: "directives/admin-entry",
20
+ files: ["src/features/**/entries/admin.ts"],
21
21
  rules: {
22
22
  "no-restricted-syntax": [
23
23
  "error",
@@ -25,21 +25,21 @@ export const directivesConfigs = [
25
25
  selector:
26
26
  "Program > :first-child:not(ExpressionStatement[expression.value='use server'])",
27
27
  message:
28
- 'interactors/admin.ts must start with "use server" directive.',
28
+ 'entries/admin.ts must start with "use server" directive.',
29
29
  },
30
30
  ],
31
31
  },
32
32
  },
33
33
  {
34
- name: "directives/client-interactor",
35
- files: ["src/features/**/interactors/client.ts"],
34
+ name: "directives/client-entry",
35
+ files: ["src/features/**/entries/client.ts"],
36
36
  rules: {
37
37
  "no-restricted-syntax": [
38
38
  "error",
39
39
  {
40
40
  selector: "ExpressionStatement[expression.value='use server']",
41
41
  message:
42
- 'interactors/client.ts must NOT have "use server" directive. It uses @/lib/supabase/client.',
42
+ 'entries/client.ts must NOT have "use server" directive. It uses @/lib/supabase/client.',
43
43
  },
44
44
  ],
45
45
  },