@vitnode/config 1.2.0-canary.60 → 1.2.0-canary.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/eslint.config.mjs +0 -60
- package/eslint.react.config.mjs +67 -0
- package/package.json +5 -1
package/eslint.config.mjs
CHANGED
|
@@ -1,21 +1,11 @@
|
|
|
1
1
|
// @ts-check
|
|
2
2
|
|
|
3
|
-
import { dirname } from "node:path";
|
|
4
|
-
import { fileURLToPath } from "node:url";
|
|
5
3
|
import eslint from "@eslint/js";
|
|
6
|
-
import eslintReact from "@eslint-react/eslint-plugin";
|
|
7
|
-
import jsxA11y from "eslint-plugin-jsx-a11y";
|
|
8
4
|
import perfectionist from "eslint-plugin-perfectionist";
|
|
9
5
|
import eslintPluginPrettierRecommended from "eslint-plugin-prettier/recommended";
|
|
10
|
-
import reactPlugin from "eslint-plugin-react";
|
|
11
|
-
import hooksPlugin from "eslint-plugin-react-hooks";
|
|
12
6
|
import tsEslint from "typescript-eslint";
|
|
13
|
-
import reactYouMightNotNeedAnEffect from "eslint-plugin-react-you-might-not-need-an-effect";
|
|
14
|
-
|
|
15
|
-
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
16
7
|
|
|
17
8
|
export default [
|
|
18
|
-
reactYouMightNotNeedAnEffect.configs.recommended,
|
|
19
9
|
{
|
|
20
10
|
ignores: [
|
|
21
11
|
"next-env.d.ts",
|
|
@@ -36,43 +26,13 @@ export default [
|
|
|
36
26
|
],
|
|
37
27
|
},
|
|
38
28
|
eslint.configs.recommended,
|
|
39
|
-
eslintReact.configs.recommended,
|
|
40
29
|
...tsEslint.configs.stylisticTypeChecked,
|
|
41
30
|
...tsEslint.configs.strictTypeChecked,
|
|
42
31
|
eslintPluginPrettierRecommended,
|
|
43
|
-
jsxA11y.flatConfigs.recommended,
|
|
44
|
-
reactPlugin.configs.flat.recommended,
|
|
45
32
|
perfectionist.configs["recommended-natural"],
|
|
46
|
-
{
|
|
47
|
-
files: ["**/*.{js,mjs,cjs,ts,jsx,tsx}"],
|
|
48
|
-
settings: {
|
|
49
|
-
react: {
|
|
50
|
-
version: "detect",
|
|
51
|
-
},
|
|
52
|
-
},
|
|
53
|
-
languageOptions: {
|
|
54
|
-
parserOptions: {
|
|
55
|
-
ecmaFeatures: {
|
|
56
|
-
jsx: true,
|
|
57
|
-
},
|
|
58
|
-
},
|
|
59
|
-
},
|
|
60
|
-
},
|
|
61
|
-
{
|
|
62
|
-
plugins: {
|
|
63
|
-
"react-hooks": hooksPlugin,
|
|
64
|
-
},
|
|
65
|
-
rules: {
|
|
66
|
-
"react/react-in-jsx-scope": "off",
|
|
67
|
-
...hooksPlugin.configs.recommended.rules,
|
|
68
|
-
},
|
|
69
|
-
},
|
|
70
33
|
{ files: ["**/*.{js,mjs,cjs,jsx,mjsx,ts,tsx,mtsx}"] },
|
|
71
34
|
{
|
|
72
35
|
rules: {
|
|
73
|
-
"react-hooks/exhaustive-deps": "off",
|
|
74
|
-
"@eslint-react/no-context-provider": "off",
|
|
75
|
-
"@eslint-react/no-unstable-default-props": "off",
|
|
76
36
|
"perfectionist/sort-array-includes": "warn",
|
|
77
37
|
"@typescript-eslint/consistent-type-imports": "error",
|
|
78
38
|
"@typescript-eslint/no-confusing-void-expression": "off",
|
|
@@ -143,30 +103,10 @@ export default [
|
|
|
143
103
|
"newline-before-return": "warn",
|
|
144
104
|
"no-restricted-imports": [
|
|
145
105
|
"error",
|
|
146
|
-
{
|
|
147
|
-
name: "next/link",
|
|
148
|
-
message: "Please import from `vitnode-frontend/navigation` instead.",
|
|
149
|
-
},
|
|
150
106
|
{
|
|
151
107
|
name: "drizzle-orm/mysql-core",
|
|
152
108
|
message: "Please import from `drizzle-orm/pg-core` instead.",
|
|
153
109
|
},
|
|
154
|
-
{
|
|
155
|
-
name: "next/navigation",
|
|
156
|
-
importNames: [
|
|
157
|
-
"redirect",
|
|
158
|
-
"permanentRedirect",
|
|
159
|
-
"useRouter",
|
|
160
|
-
"usePathname",
|
|
161
|
-
],
|
|
162
|
-
message: "Please import from `vitnode-frontend/navigation` instead.",
|
|
163
|
-
},
|
|
164
|
-
{
|
|
165
|
-
name: "next/router",
|
|
166
|
-
importNames: ["useRouter"],
|
|
167
|
-
message:
|
|
168
|
-
"This import is from Page router. Please import from `vitnode-frontend/navigation` instead.",
|
|
169
|
-
},
|
|
170
110
|
],
|
|
171
111
|
},
|
|
172
112
|
},
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
// @ts-check
|
|
2
|
+
|
|
3
|
+
import eslintReact from "@eslint-react/eslint-plugin";
|
|
4
|
+
import reactPlugin from "eslint-plugin-react";
|
|
5
|
+
import hooksPlugin from "eslint-plugin-react-hooks";
|
|
6
|
+
import reactYouMightNotNeedAnEffect from "eslint-plugin-react-you-might-not-need-an-effect";
|
|
7
|
+
|
|
8
|
+
export default [
|
|
9
|
+
reactYouMightNotNeedAnEffect.configs.recommended,
|
|
10
|
+
eslintReact.configs.recommended,
|
|
11
|
+
reactPlugin.configs.flat.recommended,
|
|
12
|
+
{
|
|
13
|
+
files: ["**/*.{js,mjs,cjs,ts,jsx,tsx}"],
|
|
14
|
+
settings: {
|
|
15
|
+
react: {
|
|
16
|
+
version: "detect",
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
languageOptions: {
|
|
20
|
+
parserOptions: {
|
|
21
|
+
ecmaFeatures: {
|
|
22
|
+
jsx: true,
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
plugins: {
|
|
29
|
+
"react-hooks": hooksPlugin,
|
|
30
|
+
},
|
|
31
|
+
rules: {
|
|
32
|
+
"react/react-in-jsx-scope": "off",
|
|
33
|
+
...hooksPlugin.configs.recommended.rules,
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
{ files: ["**/*.{js,mjs,cjs,jsx,mjsx,ts,tsx,mtsx}"] },
|
|
37
|
+
{
|
|
38
|
+
rules: {
|
|
39
|
+
"react-hooks/exhaustive-deps": "off",
|
|
40
|
+
"@eslint-react/no-context-provider": "off",
|
|
41
|
+
"@eslint-react/no-unstable-default-props": "off",
|
|
42
|
+
"no-restricted-imports": [
|
|
43
|
+
"error",
|
|
44
|
+
{
|
|
45
|
+
name: "next/link",
|
|
46
|
+
message: "Please import from `vitnode-frontend/navigation` instead.",
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
name: "next/navigation",
|
|
50
|
+
importNames: [
|
|
51
|
+
"redirect",
|
|
52
|
+
"permanentRedirect",
|
|
53
|
+
"useRouter",
|
|
54
|
+
"usePathname",
|
|
55
|
+
],
|
|
56
|
+
message: "Please import from `vitnode-frontend/navigation` instead.",
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
name: "next/router",
|
|
60
|
+
importNames: ["useRouter"],
|
|
61
|
+
message:
|
|
62
|
+
"This import is from Page router. Please import from `vitnode-frontend/navigation` instead.",
|
|
63
|
+
},
|
|
64
|
+
],
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vitnode/config",
|
|
3
|
-
"version": "1.2.0-canary.
|
|
3
|
+
"version": "1.2.0-canary.61",
|
|
4
4
|
"description": "ESLint, Prettier, TypeScript (TSConfig) config for VitNode",
|
|
5
5
|
"author": "VitNode Team",
|
|
6
6
|
"license": "MIT",
|
|
@@ -23,6 +23,10 @@
|
|
|
23
23
|
"import": "./eslint.config.mjs",
|
|
24
24
|
"default": "./eslint.config.mjs"
|
|
25
25
|
},
|
|
26
|
+
"./eslint.react": {
|
|
27
|
+
"import": "./eslint.react.config.mjs",
|
|
28
|
+
"default": "./eslint.react.config.mjs"
|
|
29
|
+
},
|
|
26
30
|
"./tsconfig": {
|
|
27
31
|
"import": "./tsconfig.json",
|
|
28
32
|
"default": "./tsconfig.json"
|