@vitnode/config 1.2.0-canary.78 → 2.0.0-canary.2
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 +15 -9
- package/eslint.react.config.mjs +20 -17
- package/package.json +1 -1
package/eslint.config.mjs
CHANGED
|
@@ -8,21 +8,12 @@ import tsEslint from "typescript-eslint";
|
|
|
8
8
|
export default [
|
|
9
9
|
{
|
|
10
10
|
ignores: [
|
|
11
|
-
"next-env.d.ts",
|
|
12
11
|
"dist",
|
|
13
|
-
"**/\\(main\\)/\\(plugins\\)/**",
|
|
14
|
-
"**/\\(auth\\)/\\(plugins\\)/**",
|
|
15
|
-
"**/\\(blank\\)/\\(plugins\\)/**",
|
|
16
|
-
"**/\\(main\\)/@breadcrumb/**",
|
|
17
|
-
"**/\\(auth\\)/@breadcrumb/**",
|
|
18
12
|
".prettierrc.mjs",
|
|
19
13
|
"node_modules",
|
|
20
14
|
"eslint.config.mjs",
|
|
21
|
-
"next.config.ts",
|
|
22
|
-
"config/next.config.ts",
|
|
23
15
|
"postcss.config.mjs",
|
|
24
16
|
".turbo",
|
|
25
|
-
".next",
|
|
26
17
|
"global.d.ts",
|
|
27
18
|
"tsup.config.ts",
|
|
28
19
|
"*.test.tsx",
|
|
@@ -115,4 +106,19 @@ export default [
|
|
|
115
106
|
],
|
|
116
107
|
},
|
|
117
108
|
},
|
|
109
|
+
{
|
|
110
|
+
// A plugin's route tree - and only that file - is one
|
|
111
|
+
// `lazy(() => import("./pages/my-page"))` per route, which is VitNode's
|
|
112
|
+
// documented API: the callback is *stored*, never called here, so
|
|
113
|
+
// `promise-function-async` would ask every plugin author to write
|
|
114
|
+
// `async () => await import(...)` for a promise nobody in the file awaits.
|
|
115
|
+
//
|
|
116
|
+
// `**/src/routes.ts` rather than `**/routes.ts`, because the parent
|
|
117
|
+
// directory is what makes it a route tree: a plugin's is `src/routes.ts`,
|
|
118
|
+
// which is what its `<plugin>/routes` export subpath resolves to. Any other
|
|
119
|
+
// `routes.ts` - `src/content/server/routes.ts`, an API module's - keeps the
|
|
120
|
+
// rule, and should.
|
|
121
|
+
files: ["**/src/routes.ts", "**/src/routes.tsx"],
|
|
122
|
+
rules: { "@typescript-eslint/promise-function-async": "off" },
|
|
123
|
+
},
|
|
118
124
|
];
|
package/eslint.react.config.mjs
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import eslintReact from "@eslint-react/eslint-plugin";
|
|
4
4
|
import hooksPlugin from "eslint-plugin-react-hooks";
|
|
5
5
|
import reactYouMightNotNeedAnEffect from "eslint-plugin-react-you-might-not-need-an-effect";
|
|
6
|
+
import jsxA11y from "eslint-plugin-jsx-a11y";
|
|
6
7
|
|
|
7
8
|
export default [
|
|
8
9
|
reactYouMightNotNeedAnEffect.configs.recommended,
|
|
@@ -25,6 +26,7 @@ export default [
|
|
|
25
26
|
{
|
|
26
27
|
plugins: {
|
|
27
28
|
"react-hooks": hooksPlugin,
|
|
29
|
+
"jsx-a11y": jsxA11y,
|
|
28
30
|
},
|
|
29
31
|
rules: {
|
|
30
32
|
"react/react-in-jsx-scope": "off",
|
|
@@ -34,30 +36,31 @@ export default [
|
|
|
34
36
|
{ files: ["**/*.{js,mjs,cjs,jsx,mjsx,ts,tsx,mtsx}"] },
|
|
35
37
|
{
|
|
36
38
|
rules: {
|
|
39
|
+
"@eslint-react/no-leaked-conditional-rendering": "error",
|
|
37
40
|
"react-hooks/exhaustive-deps": "off",
|
|
38
41
|
"@eslint-react/no-context-provider": "off",
|
|
39
42
|
"@eslint-react/no-unstable-default-props": "off",
|
|
40
43
|
"no-restricted-imports": [
|
|
41
44
|
"error",
|
|
42
45
|
{
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
46
|
+
patterns: [
|
|
47
|
+
{
|
|
48
|
+
// VitNode runs on TanStack Start. Next.js is not a dependency of
|
|
49
|
+
// any workspace package, so these resolve to nothing - the ban is
|
|
50
|
+
// here to fail the lint with an explanation rather than a
|
|
51
|
+
// "cannot find module".
|
|
52
|
+
group: ["next", "next/*", "next/**"],
|
|
53
|
+
message:
|
|
54
|
+
"VitNode no longer runs on Next.js. Use `@vitnode/core/tanstack/*` for routing and navigation.",
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
// `use-intl` is the framework-neutral half of next-intl and is a
|
|
58
|
+
// direct dependency of @vitnode/core. `next-intl` re-exports it
|
|
59
|
+
// plus Next server bindings that no longer have a runtime.
|
|
60
|
+
group: ["next-intl", "next-intl/*"],
|
|
61
|
+
message: "Import from `use-intl` instead of `next-intl`.",
|
|
62
|
+
},
|
|
53
63
|
],
|
|
54
|
-
message: "Please import from `vitnode-frontend/navigation` instead.",
|
|
55
|
-
},
|
|
56
|
-
{
|
|
57
|
-
name: "next/router",
|
|
58
|
-
importNames: ["useRouter"],
|
|
59
|
-
message:
|
|
60
|
-
"This import is from Page router. Please import from `vitnode-frontend/navigation` instead.",
|
|
61
64
|
},
|
|
62
65
|
],
|
|
63
66
|
},
|