@yasainet/eslint 0.0.5 → 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 +66 -12
- package/package.json +3 -2
- package/src/common/rules.mjs +3 -0
package/README.md
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
# @yasainet/eslint
|
|
2
2
|
|
|
3
|
-
Shared ESLint configuration for
|
|
3
|
+
Shared ESLint configuration for Next.js, Node.js and Deno.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Entry Points
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
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
|
-
##
|
|
13
|
+
## Setup
|
|
12
14
|
|
|
13
|
-
|
|
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
|
-
|
|
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.
|
|
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
|
}
|
package/src/common/rules.mjs
CHANGED
|
@@ -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: {
|