@vitnode/config 0.0.1-canary.0

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/LICENSE.md ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 aXenDev Maciej Balcerzak
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,50 @@
1
+ # (VitNode) ESLint Config
2
+
3
+ This package provides a default ESLint configuration, TypeScript configuration, and Prettier configuration for VitNode projects.
4
+
5
+ <p align="center">
6
+ <br>
7
+ <a href="https://vitnode.com/" target="_blank">
8
+ <picture>
9
+ <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/VitNode/vitnode/canary/assets/logo/vitnode_logo_dark.svg">
10
+ <source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/VitNode/vitnode/canary/assets/logo/vitnode_logo_light.svg">
11
+ <img alt="VitNode Logo" src="https://raw.githubusercontent.com/VitNode/vitnode/canary/assets/logo/vitnode_logo_light.svg" width="400">
12
+ </picture>
13
+ </a>
14
+ <br>
15
+ <br>
16
+ </p>
17
+
18
+ ## Usage
19
+
20
+ ### ESLint (eslint.config.mjs)
21
+
22
+ ```js
23
+ import eslintVitNode from "@vitnode/config/eslint";
24
+
25
+ export default [...eslintVitNode];
26
+ ```
27
+
28
+ ### TypeScript (tsconfig.json)
29
+
30
+ ```json
31
+ {
32
+ "extends": "@vitnode/config/tsconfig"
33
+ }
34
+ ```
35
+
36
+ ### Prettier (.prettierrc.mjs)
37
+
38
+ ```js
39
+ import vitnodePrettier from "@vitnode/config/prettierrc";
40
+
41
+ /**
42
+ * @see https://prettier.io/docs/en/configuration.html
43
+ * @type {import("prettier").Config}
44
+ */
45
+ const config = {
46
+ ...vitnodePrettier,
47
+ };
48
+
49
+ export default config;
50
+ ```
@@ -0,0 +1,124 @@
1
+ // @ts-check
2
+
3
+ import eslint from "@eslint/js";
4
+ import perfectionist from "eslint-plugin-perfectionist";
5
+ import eslintPluginPrettierRecommended from "eslint-plugin-prettier/recommended";
6
+ import tsEslint from "typescript-eslint";
7
+
8
+ export default [
9
+ {
10
+ ignores: [
11
+ "dist",
12
+ ".prettierrc.mjs",
13
+ "node_modules",
14
+ "eslint.config.mjs",
15
+ "postcss.config.mjs",
16
+ ".turbo",
17
+ "global.d.ts",
18
+ "tsup.config.ts",
19
+ "*.test.tsx",
20
+ "drizzle.config.ts",
21
+ "cli.mjs",
22
+ ],
23
+ },
24
+ eslint.configs.recommended,
25
+ ...tsEslint.configs.stylisticTypeChecked,
26
+ ...tsEslint.configs.strictTypeChecked,
27
+ eslintPluginPrettierRecommended,
28
+ perfectionist.configs["recommended-natural"],
29
+ { files: ["**/*.{js,mjs,cjs,jsx,mjsx,ts,tsx,mtsx}"] },
30
+ {
31
+ rules: {
32
+ "perfectionist/sort-array-includes": "warn",
33
+ "@typescript-eslint/consistent-type-imports": "error",
34
+ "@typescript-eslint/no-confusing-void-expression": "off",
35
+ "@typescript-eslint/no-unnecessary-type-parameters": "off",
36
+ "@typescript-eslint/no-misused-spread": "off",
37
+ "perfectionist/sort-decorators": "warn",
38
+ "perfectionist/sort-modules": "off",
39
+ "perfectionist/sort-switch-case": "warn",
40
+ "@typescript-eslint/no-unnecessary-condition": "off",
41
+ "perfectionist/sort-named-exports": "warn",
42
+ "perfectionist/sort-enums": "warn",
43
+ "perfectionist/sort-exports": "warn",
44
+ "@typescript-eslint/no-dynamic-delete": "off",
45
+ "perfectionist/sort-named-imports": "warn",
46
+ "perfectionist/sort-intersection-types": "warn",
47
+ "perfectionist/sort-interfaces": "warn",
48
+ "perfectionist/sort-union-types": "warn",
49
+ "perfectionist/sort-object-types": "warn",
50
+ "perfectionist/sort-jsx-props": "warn",
51
+ "perfectionist/sort-imports": "warn",
52
+ "@typescript-eslint/no-unsafe-call": "off",
53
+ "perfectionist/sort-objects": "off",
54
+ "perfectionist/sort-classes": [
55
+ "warn",
56
+ {
57
+ groups: [
58
+ "constructor",
59
+ "static-block",
60
+ "index-signature",
61
+ "static-property",
62
+ ["protected-property", "protected-accessor-property"],
63
+ ["private-property", "private-accessor-property"],
64
+ ["property", "accessor-property"],
65
+ "static-method",
66
+ "protected-method",
67
+ "private-method",
68
+ "method",
69
+ ["get-method", "set-method"],
70
+ "unknown",
71
+ ],
72
+ },
73
+ ],
74
+ "no-console": "error",
75
+ "consistent-return": "off",
76
+ "@typescript-eslint/no-unused-vars": [
77
+ "warn",
78
+ {
79
+ ignoreRestSiblings: false,
80
+ caughtErrorsIgnorePattern: "^_",
81
+ },
82
+ ],
83
+ "@typescript-eslint/no-empty-function": "off",
84
+ "@typescript-eslint/unbound-method": "off",
85
+ "@typescript-eslint/no-misused-promises": "off",
86
+ "@typescript-eslint/no-unsafe-return": "off",
87
+ "@typescript-eslint/no-unsafe-assignment": "off",
88
+ "@typescript-eslint/no-unsafe-member-access": "off",
89
+ "@typescript-eslint/no-useless-constructor": "off",
90
+ "@typescript-eslint/prefer-readonly": "warn",
91
+ "@typescript-eslint/require-array-sort-compare": "error",
92
+ "@typescript-eslint/promise-function-async": "error",
93
+ "@typescript-eslint/no-extraneous-class": "off",
94
+ "@typescript-eslint/restrict-template-expressions": "off",
95
+ "@typescript-eslint/consistent-type-exports": "error",
96
+ "@typescript-eslint/no-unnecessary-qualifier": "error",
97
+ "@typescript-eslint/no-useless-empty-export": "error",
98
+ "@typescript-eslint/method-signature-style": "warn",
99
+ "newline-before-return": "warn",
100
+ "no-restricted-imports": [
101
+ "error",
102
+ {
103
+ name: "drizzle-orm/mysql-core",
104
+ message: "Please import from `drizzle-orm/pg-core` instead.",
105
+ },
106
+ ],
107
+ },
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
+ },
124
+ ];
@@ -0,0 +1,68 @@
1
+ // @ts-check
2
+
3
+ import eslintReact from "@eslint-react/eslint-plugin";
4
+ import hooksPlugin from "eslint-plugin-react-hooks";
5
+ import reactYouMightNotNeedAnEffect from "eslint-plugin-react-you-might-not-need-an-effect";
6
+ import jsxA11y from "eslint-plugin-jsx-a11y";
7
+
8
+ export default [
9
+ reactYouMightNotNeedAnEffect.configs.recommended,
10
+ eslintReact.configs.recommended,
11
+ {
12
+ files: ["**/*.{js,mjs,cjs,ts,jsx,tsx}"],
13
+ settings: {
14
+ react: {
15
+ version: "detect",
16
+ },
17
+ },
18
+ languageOptions: {
19
+ parserOptions: {
20
+ ecmaFeatures: {
21
+ jsx: true,
22
+ },
23
+ },
24
+ },
25
+ },
26
+ {
27
+ plugins: {
28
+ "react-hooks": hooksPlugin,
29
+ "jsx-a11y": jsxA11y,
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
+ "@eslint-react/no-leaked-conditional-rendering": "error",
40
+ "react-hooks/exhaustive-deps": "off",
41
+ "@eslint-react/no-context-provider": "off",
42
+ "@eslint-react/no-unstable-default-props": "off",
43
+ "no-restricted-imports": [
44
+ "error",
45
+ {
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
+ },
63
+ ],
64
+ },
65
+ ],
66
+ },
67
+ },
68
+ ];
package/package.json ADDED
@@ -0,0 +1,60 @@
1
+ {
2
+ "name": "@vitnode/config",
3
+ "version": "0.0.1-canary.0",
4
+ "description": "ESLint, Prettier, TypeScript (TSConfig) config for VitNode",
5
+ "author": "VitNode Team",
6
+ "license": "MIT",
7
+ "homepage": "https://vitnode.com",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git+https://github.com/aXenDeveloper/vitnode.git",
11
+ "directory": "packages/config"
12
+ },
13
+ "keywords": [
14
+ "vitnode",
15
+ "typescript",
16
+ "tsconfig",
17
+ "eslint",
18
+ "prettier"
19
+ ],
20
+ "type": "module",
21
+ "exports": {
22
+ "./eslint": {
23
+ "import": "./eslint.config.mjs",
24
+ "default": "./eslint.config.mjs"
25
+ },
26
+ "./eslint.react": {
27
+ "import": "./eslint.react.config.mjs",
28
+ "default": "./eslint.react.config.mjs"
29
+ },
30
+ "./tsconfig": {
31
+ "import": "./tsconfig.json",
32
+ "default": "./tsconfig.json"
33
+ },
34
+ "./prettierrc": {
35
+ "import": "./prettierrc.mjs",
36
+ "default": "./prettierrc.mjs"
37
+ }
38
+ },
39
+ "peerDependencies": {
40
+ "eslint": "^10.0.0",
41
+ "prettier": "^3.x.x",
42
+ "typescript": "6.0.x"
43
+ },
44
+ "devDependencies": {
45
+ "eslint": "^10.7.0",
46
+ "typescript": "^6.0.3"
47
+ },
48
+ "dependencies": {
49
+ "@eslint-react/eslint-plugin": "^5.17.3",
50
+ "@eslint/js": "^10.0.1",
51
+ "eslint-config-prettier": "^10.1.8",
52
+ "eslint-plugin-jsx-a11y": "^6.10.2",
53
+ "eslint-plugin-perfectionist": "^5.10.0",
54
+ "eslint-plugin-prettier": "^5.5.6",
55
+ "eslint-plugin-react-hooks": "^7.1.1",
56
+ "eslint-plugin-react-you-might-not-need-an-effect": "^1.0.1",
57
+ "prettier-plugin-tailwindcss": "^0.8.1",
58
+ "typescript-eslint": "^8.65.0"
59
+ }
60
+ }
package/prettierrc.mjs ADDED
@@ -0,0 +1,14 @@
1
+ /**
2
+ * @see https://prettier.io/docs/en/configuration.html
3
+ * @type {import("prettier").Config}
4
+ */
5
+ const config = {
6
+ singleQuote: false,
7
+ arrowParens: "avoid",
8
+ trailingComma: "all",
9
+ printWidth: 80,
10
+ plugins: ["prettier-plugin-tailwindcss"],
11
+ tailwindFunctions: ["cn"],
12
+ };
13
+
14
+ export default config;
package/tsconfig.json ADDED
@@ -0,0 +1,24 @@
1
+ {
2
+ "$schema": "https://json.schemastore.org/tsconfig",
3
+ "compilerOptions": {
4
+ "lib": ["dom", "dom.iterable", "esnext"],
5
+ "allowJs": false,
6
+ "skipLibCheck": true,
7
+ "resolveJsonModule": true,
8
+ "strict": true,
9
+ "esModuleInterop": true,
10
+ "isolatedModules": true,
11
+ "jsx": "preserve",
12
+ "incremental": true,
13
+ "composite": false,
14
+ "removeComments": true,
15
+ "noImplicitAny": false,
16
+ "strictNullChecks": true,
17
+ "strictPropertyInitialization": false,
18
+ "strictBindCallApply": false,
19
+ "allowSyntheticDefaultImports": true,
20
+ "forceConsistentCasingInFileNames": true,
21
+ "erasableSyntaxOnly": true,
22
+ "verbatimModuleSyntax": true
23
+ }
24
+ }