@yasainet/eslint 0.0.30 → 0.0.31

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
@@ -10,6 +10,34 @@ Shared ESLint configuration for Next.js, Node.js and Deno.
10
10
  | `@yasainet/eslint/node` | `scripts/features/` | Common rules only (WIP) |
11
11
  | `@yasainet/eslint/deno` | `supabase/functions/features/` | Common rules only (WIP) |
12
12
 
13
+ ## Directory Structure
14
+
15
+ ```text
16
+ src/
17
+ ├── common/ # Shared rules for all environments
18
+ ├── next/ # Next.js-specific rules (hooks, components, directives)
19
+ ├── node/ # Node.js entry point (common rules only)
20
+ └── deno/ # Deno entry point (entry-point boundary, _utils boundary, _lib boundary)
21
+ ```
22
+
23
+ Each entry point enforces a feature-based architecture with the following convention in consuming projects:
24
+
25
+ ```text
26
+ {featureRoot}/
27
+ ├── {feature}/
28
+ │ ├── actions/ # *.action.ts — entry points (handleXxx)
29
+ │ ├── services/ # *.service.ts — business logic
30
+ │ ├── repositories/ # *.repo.ts — data access
31
+ │ ├── types/ # *.type.ts
32
+ │ ├── schemas/ # *.schema.ts
33
+ │ ├── utils/ # *.util.ts
34
+ │ └── constants/ # *.constant.ts
35
+ ├── shared/ # Cross-feature shared modules
36
+ ├── ...
37
+ {libRoot}/ # *.lib.ts — library wrappers (e.g., supabase.lib.ts)
38
+ {utilsRoot}/ # *.util.ts — top-level utilities
39
+ ```
40
+
13
41
  ## Setup
14
42
 
15
43
  ### Next.js + Node.js + Deno
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yasainet/eslint",
3
- "version": "0.0.30",
3
+ "version": "0.0.31",
4
4
  "description": "ESLint",
5
5
  "type": "module",
6
6
  "exports": {
@@ -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 { createLibNamingConfigs, createNamingConfigs } from "./naming.mjs";
5
+ import { createLibNamingConfigs, createNamingConfigs, createUtilsNamingConfigs } from "./naming.mjs";
6
6
  import { rulesConfigs } from "./rules.mjs";
7
7
 
8
8
  /** Build common configs scoped to the given feature root. */
@@ -15,6 +15,7 @@ export function createCommonConfigs(
15
15
  ...rulesConfigs,
16
16
  ...createNamingConfigs(featureRoot, prefixLibMapping),
17
17
  ...createLibNamingConfigs(featureRoot),
18
+ ...createUtilsNamingConfigs(featureRoot),
18
19
  ...createLayersConfigs(featureRoot),
19
20
  ...createImportsConfigs(featureRoot, prefixLibMapping, { banAliasImports }),
20
21
  ...createJsdocConfigs(featureRoot),
@@ -21,6 +21,25 @@ export function createLibNamingConfigs(featureRoot) {
21
21
  ];
22
22
  }
23
23
 
24
+ /** Scope utils naming rules to the utils root derived from the given feature root. */
25
+ export function createUtilsNamingConfigs(featureRoot) {
26
+ const utilsRoot = featureRoot.replace(/features$/, "utils");
27
+ return [
28
+ {
29
+ name: "naming/top-level-utils",
30
+ files: [`${utilsRoot}/**/*.ts`],
31
+ ignores: [`${utilsRoot}/**/*.type.ts`],
32
+ plugins: { "check-file": checkFile },
33
+ rules: {
34
+ "check-file/filename-naming-convention": [
35
+ "error",
36
+ { "**/*.ts": "*.util" },
37
+ ],
38
+ },
39
+ },
40
+ ];
41
+ }
42
+
24
43
  /** Scope naming rules to the given feature root. */
25
44
  export function createNamingConfigs(featureRoot, prefixLibMapping) {
26
45
  const prefixes = Object.keys(prefixLibMapping);