@yasainet/eslint 0.0.4 → 0.0.6

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
@@ -1,22 +1,22 @@
1
1
  # @yasainet/eslint
2
2
 
3
- Shared ESLint configuration for feature-based architecture.
3
+ Shared ESLint configuration for Next.js, Node.js and Deno.
4
4
 
5
- ## Install
5
+ ## Entry Points
6
6
 
7
- ```sh
8
- npm install -D @yasainet/eslint eslint
9
- ```
7
+ | Entry | Feature Root | Description |
8
+ | ----------------------- | ------------------------------ | ----------------------- |
9
+ | `@yasainet/eslint/next` | `src/features/` | Common rules + Next.js |
10
+ | `@yasainet/eslint/node` | `scripts/features/` | Common rules only (WIP) |
11
+ | `@yasainet/eslint/deno` | `supabase/functions/features/` | Common rules only (WIP) |
10
12
 
11
- ## Entry Points
13
+ ## Setup
12
14
 
13
- | Entry | Feature Root | Description |
14
- | ----------------------- | ------------------------------ | ----------------------------------------------------------------------------------- |
15
- | `@yasainet/eslint/next` | `src/features/` | Common rules + Next.js-specific rules (hooks, components, directives, lib-boundary) |
16
- | `@yasainet/eslint/node` | `scripts/features/` | Common rules only |
17
- | `@yasainet/eslint/deno` | `supabase/functions/features/` | Common rules only |
15
+ ### Next.js + Node.js + Deno
18
16
 
19
- ## Usage
17
+ ```sh
18
+ npm install -D @yasainet/eslint
19
+ ```
20
20
 
21
21
  ```js
22
22
  // eslint.config.mjs
@@ -44,6 +44,60 @@ export default defineConfig([
44
44
  ]);
45
45
  ```
46
46
 
47
+ ### Next.js
48
+
49
+ ```sh
50
+ npm install -D @yasainet/eslint
51
+ ```
52
+
53
+ ```js
54
+ // eslint.config.mjs
55
+ import { eslintConfig } from "@yasainet/eslint/next";
56
+ import { defineConfig, globalIgnores } from "eslint/config";
57
+ import nextVitals from "eslint-config-next/core-web-vitals";
58
+ import nextTs from "eslint-config-next/typescript";
59
+
60
+ export default defineConfig([
61
+ ...nextVitals,
62
+ ...nextTs,
63
+ // Override default ignores of eslint-config-next.
64
+ globalIgnores([
65
+ // Default ignores of eslint-config-next:
66
+ ".next/**",
67
+ "out/**",
68
+ "build/**",
69
+ "next-env.d.ts",
70
+ ]),
71
+ ...eslintConfig,
72
+ ]);
73
+ ```
74
+
75
+ ### Node.js
76
+
77
+ ```sh
78
+ npm install -D @yasainet/eslint eslint typescript-eslint
79
+ ```
80
+
81
+ ```js
82
+ // eslint.config.mjs
83
+ import { eslintConfig } from "@yasainet/eslint/node";
84
+
85
+ export default [...eslintConfig];
86
+ ```
87
+
88
+ ### Deno
89
+
90
+ ```sh
91
+ npm install -D @yasainet/eslint eslint typescript-eslint
92
+ ```
93
+
94
+ ```js
95
+ // eslint.config.mjs
96
+ import { eslintConfig } from "@yasainet/eslint/deno";
97
+
98
+ export default [...eslintConfig];
99
+ ```
100
+
47
101
  ## Release
48
102
 
49
103
  1. Update `version` in `package.json`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yasainet/eslint",
3
- "version": "0.0.4",
3
+ "version": "0.0.6",
4
4
  "description": "ESLint",
5
5
  "type": "module",
6
6
  "exports": {
@@ -39,6 +39,7 @@
39
39
  "eslint-plugin-simple-import-sort": "^12.1.1"
40
40
  },
41
41
  "peerDependencies": {
42
- "eslint": "^9"
42
+ "eslint": "^9",
43
+ "typescript-eslint": "^8"
43
44
  }
44
45
  }
@@ -117,7 +117,12 @@ export const libBoundaryConfigs = [
117
117
  {
118
118
  name: "imports/lib-boundary",
119
119
  files: ["src/**/*.{ts,tsx}"],
120
- ignores: ["src/lib/**", "src/proxy.ts", "src/app/sitemap.ts"],
120
+ ignores: [
121
+ "src/lib/**",
122
+ "src/proxy.ts",
123
+ "src/app/sitemap.ts",
124
+ "src/features/**/repositories/**",
125
+ ],
121
126
  rules: {
122
127
  "no-restricted-imports": ["error", { patterns: LIB_BOUNDARY_PATTERNS }],
123
128
  },
@@ -1,3 +1,5 @@
1
+ import tseslint from "typescript-eslint";
2
+
1
3
  import { simpleImportSortPlugin, stylistic } from "./plugins.mjs";
2
4
 
3
5
  export const rulesConfigs = [
@@ -5,6 +7,7 @@ export const rulesConfigs = [
5
7
  name: "rules/shared",
6
8
  plugins: {
7
9
  "@stylistic": stylistic,
10
+ "@typescript-eslint": tseslint.plugin,
8
11
  "simple-import-sort": simpleImportSortPlugin,
9
12
  },
10
13
  rules: {