@vitnode/config 1.2.0-canary.54 → 1.2.0-canary.56
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 +23 -9
- package/eslint.config.mjs +173 -0
- package/package.json +27 -9
- package/prettierrc.mjs +14 -0
- package/biome.json +0 -105
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
# (VitNode) Config
|
|
1
|
+
# (VitNode) ESLint Config
|
|
2
2
|
|
|
3
|
-
This package provides a default
|
|
3
|
+
This package provides a default ESLint configuration, TypeScript configuration, and Prettier configuration for VitNode projects.
|
|
4
4
|
|
|
5
5
|
<p align="center">
|
|
6
6
|
<br>
|
|
@@ -17,14 +17,12 @@ This package provides a default Biome configuration, TypeScript configuration fo
|
|
|
17
17
|
|
|
18
18
|
## Usage
|
|
19
19
|
|
|
20
|
-
###
|
|
20
|
+
### ESLint (eslint.config.mjs)
|
|
21
21
|
|
|
22
|
-
```
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
"root": true
|
|
27
|
-
}
|
|
22
|
+
```js
|
|
23
|
+
import eslintVitNode from "@vitnode/config/eslint";
|
|
24
|
+
|
|
25
|
+
export default [...eslintVitNode];
|
|
28
26
|
```
|
|
29
27
|
|
|
30
28
|
### TypeScript (tsconfig.json)
|
|
@@ -34,3 +32,19 @@ This package provides a default Biome configuration, TypeScript configuration fo
|
|
|
34
32
|
"extends": "@vitnode/config/tsconfig"
|
|
35
33
|
}
|
|
36
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,173 @@
|
|
|
1
|
+
// @ts-check
|
|
2
|
+
|
|
3
|
+
import { dirname } from "node:path";
|
|
4
|
+
import { fileURLToPath } from "node:url";
|
|
5
|
+
import eslint from "@eslint/js";
|
|
6
|
+
import eslintReact from "@eslint-react/eslint-plugin";
|
|
7
|
+
import jsxA11y from "eslint-plugin-jsx-a11y";
|
|
8
|
+
import perfectionist from "eslint-plugin-perfectionist";
|
|
9
|
+
import eslintPluginPrettierRecommended from "eslint-plugin-prettier/recommended";
|
|
10
|
+
import reactPlugin from "eslint-plugin-react";
|
|
11
|
+
import hooksPlugin from "eslint-plugin-react-hooks";
|
|
12
|
+
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
|
+
|
|
17
|
+
export default [
|
|
18
|
+
reactYouMightNotNeedAnEffect.configs.recommended,
|
|
19
|
+
{
|
|
20
|
+
ignores: [
|
|
21
|
+
"next-env.d.ts",
|
|
22
|
+
"dist",
|
|
23
|
+
"**/\\(main\\)/\\(plugins\\)/**",
|
|
24
|
+
"**/\\(auth\\)/\\(plugins\\)/**",
|
|
25
|
+
".prettierrc.mjs",
|
|
26
|
+
"node_modules",
|
|
27
|
+
"eslint.config.mjs",
|
|
28
|
+
"next.config.ts",
|
|
29
|
+
"config/next.config.ts",
|
|
30
|
+
"postcss.config.mjs",
|
|
31
|
+
".turbo",
|
|
32
|
+
".next",
|
|
33
|
+
"global.d.ts",
|
|
34
|
+
"tsup.config.ts",
|
|
35
|
+
"*.test.tsx",
|
|
36
|
+
],
|
|
37
|
+
},
|
|
38
|
+
eslint.configs.recommended,
|
|
39
|
+
eslintReact.configs.recommended,
|
|
40
|
+
...tsEslint.configs.stylisticTypeChecked,
|
|
41
|
+
...tsEslint.configs.strictTypeChecked,
|
|
42
|
+
eslintPluginPrettierRecommended,
|
|
43
|
+
jsxA11y.flatConfigs.recommended,
|
|
44
|
+
reactPlugin.configs.flat.recommended,
|
|
45
|
+
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
|
+
{ files: ["**/*.{js,mjs,cjs,jsx,mjsx,ts,tsx,mtsx}"] },
|
|
71
|
+
{
|
|
72
|
+
rules: {
|
|
73
|
+
"react-hooks/exhaustive-deps": "off",
|
|
74
|
+
"@eslint-react/no-context-provider": "off",
|
|
75
|
+
"@eslint-react/no-unstable-default-props": "off",
|
|
76
|
+
"perfectionist/sort-array-includes": "warn",
|
|
77
|
+
"@typescript-eslint/consistent-type-imports": "error",
|
|
78
|
+
"@typescript-eslint/no-confusing-void-expression": "off",
|
|
79
|
+
"@typescript-eslint/no-unnecessary-type-parameters": "off",
|
|
80
|
+
"@typescript-eslint/no-misused-spread": "off",
|
|
81
|
+
"perfectionist/sort-decorators": "warn",
|
|
82
|
+
"perfectionist/sort-modules": "off",
|
|
83
|
+
"perfectionist/sort-switch-case": "warn",
|
|
84
|
+
"@typescript-eslint/no-unnecessary-condition": "off",
|
|
85
|
+
"perfectionist/sort-named-exports": "warn",
|
|
86
|
+
"perfectionist/sort-enums": "warn",
|
|
87
|
+
"perfectionist/sort-exports": "warn",
|
|
88
|
+
"@typescript-eslint/no-dynamic-delete": "off",
|
|
89
|
+
"perfectionist/sort-named-imports": "warn",
|
|
90
|
+
"perfectionist/sort-intersection-types": "warn",
|
|
91
|
+
"perfectionist/sort-interfaces": "warn",
|
|
92
|
+
"perfectionist/sort-union-types": "warn",
|
|
93
|
+
"perfectionist/sort-object-types": "warn",
|
|
94
|
+
"perfectionist/sort-jsx-props": "warn",
|
|
95
|
+
"perfectionist/sort-imports": "warn",
|
|
96
|
+
"@typescript-eslint/no-unsafe-call": "off",
|
|
97
|
+
"perfectionist/sort-objects": "off",
|
|
98
|
+
"perfectionist/sort-classes": [
|
|
99
|
+
"warn",
|
|
100
|
+
{
|
|
101
|
+
groups: [
|
|
102
|
+
"constructor",
|
|
103
|
+
"static-block",
|
|
104
|
+
"index-signature",
|
|
105
|
+
"static-property",
|
|
106
|
+
["protected-property", "protected-accessor-property"],
|
|
107
|
+
["private-property", "private-accessor-property"],
|
|
108
|
+
["property", "accessor-property"],
|
|
109
|
+
"static-method",
|
|
110
|
+
"protected-method",
|
|
111
|
+
"private-method",
|
|
112
|
+
"method",
|
|
113
|
+
["get-method", "set-method"],
|
|
114
|
+
"unknown",
|
|
115
|
+
],
|
|
116
|
+
},
|
|
117
|
+
],
|
|
118
|
+
"no-console": "error",
|
|
119
|
+
"consistent-return": "off",
|
|
120
|
+
"@typescript-eslint/no-unused-vars": [
|
|
121
|
+
"warn",
|
|
122
|
+
{
|
|
123
|
+
ignoreRestSiblings: false,
|
|
124
|
+
caughtErrorsIgnorePattern: "^_",
|
|
125
|
+
},
|
|
126
|
+
],
|
|
127
|
+
"@typescript-eslint/no-empty-function": "off",
|
|
128
|
+
"@typescript-eslint/unbound-method": "off",
|
|
129
|
+
"@typescript-eslint/no-misused-promises": "off",
|
|
130
|
+
"@typescript-eslint/no-unsafe-return": "off",
|
|
131
|
+
"@typescript-eslint/no-unsafe-assignment": "off",
|
|
132
|
+
"@typescript-eslint/no-unsafe-member-access": "off",
|
|
133
|
+
"@typescript-eslint/no-useless-constructor": "off",
|
|
134
|
+
"@typescript-eslint/prefer-readonly": "warn",
|
|
135
|
+
"@typescript-eslint/require-array-sort-compare": "error",
|
|
136
|
+
"@typescript-eslint/promise-function-async": "error",
|
|
137
|
+
"@typescript-eslint/no-extraneous-class": "off",
|
|
138
|
+
"@typescript-eslint/restrict-template-expressions": "off",
|
|
139
|
+
"@typescript-eslint/consistent-type-exports": "error",
|
|
140
|
+
"@typescript-eslint/no-unnecessary-qualifier": "error",
|
|
141
|
+
"@typescript-eslint/no-useless-empty-export": "error",
|
|
142
|
+
"@typescript-eslint/method-signature-style": "warn",
|
|
143
|
+
"newline-before-return": "warn",
|
|
144
|
+
"no-restricted-imports": [
|
|
145
|
+
"error",
|
|
146
|
+
{
|
|
147
|
+
name: "next/link",
|
|
148
|
+
message: "Please import from `vitnode-frontend/navigation` instead.",
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
name: "drizzle-orm/mysql-core",
|
|
152
|
+
message: "Please import from `drizzle-orm/pg-core` instead.",
|
|
153
|
+
},
|
|
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
|
+
],
|
|
171
|
+
},
|
|
172
|
+
},
|
|
173
|
+
];
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vitnode/config",
|
|
3
|
-
"version": "1.2.0-canary.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "1.2.0-canary.56",
|
|
4
|
+
"description": "ESLint, Prettier, TypeScript (TSConfig) config for VitNode",
|
|
5
5
|
"author": "VitNode Team",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"homepage": "https://vitnode.com",
|
|
@@ -14,25 +14,43 @@
|
|
|
14
14
|
"vitnode",
|
|
15
15
|
"typescript",
|
|
16
16
|
"tsconfig",
|
|
17
|
-
"
|
|
17
|
+
"eslint",
|
|
18
|
+
"prettier"
|
|
18
19
|
],
|
|
19
20
|
"type": "module",
|
|
20
21
|
"exports": {
|
|
22
|
+
"./eslint": {
|
|
23
|
+
"import": "./eslint.config.mjs",
|
|
24
|
+
"default": "./eslint.config.mjs"
|
|
25
|
+
},
|
|
21
26
|
"./tsconfig": {
|
|
22
27
|
"import": "./tsconfig.json",
|
|
23
28
|
"default": "./tsconfig.json"
|
|
24
29
|
},
|
|
25
|
-
"./
|
|
26
|
-
"import": "./
|
|
27
|
-
"default": "./
|
|
30
|
+
"./prettierrc": {
|
|
31
|
+
"import": "./prettierrc.mjs",
|
|
32
|
+
"default": "./prettierrc.mjs"
|
|
28
33
|
}
|
|
29
34
|
},
|
|
30
35
|
"peerDependencies": {
|
|
31
|
-
"
|
|
36
|
+
"eslint": "^9.0.0",
|
|
37
|
+
"prettier": "^3.0.0",
|
|
32
38
|
"typescript": "5.9.x"
|
|
33
39
|
},
|
|
34
40
|
"devDependencies": {
|
|
35
|
-
"
|
|
36
|
-
|
|
41
|
+
"typescript": "^5.9.3"
|
|
42
|
+
},
|
|
43
|
+
"dependencies": {
|
|
44
|
+
"@eslint-react/eslint-plugin": "^2.0.6",
|
|
45
|
+
"@eslint/js": "^9.36.0",
|
|
46
|
+
"eslint-config-prettier": "^10.1.8",
|
|
47
|
+
"eslint-plugin-jsx-a11y": "^6.10.2",
|
|
48
|
+
"eslint-plugin-perfectionist": "^4.15.0",
|
|
49
|
+
"eslint-plugin-prettier": "^5.5.4",
|
|
50
|
+
"eslint-plugin-react": "^7.37.5",
|
|
51
|
+
"eslint-plugin-react-hooks": "^5.2.0",
|
|
52
|
+
"eslint-plugin-react-you-might-not-need-an-effect": "^0.5.5",
|
|
53
|
+
"prettier-plugin-tailwindcss": "^0.6.14",
|
|
54
|
+
"typescript-eslint": "^8.45.0"
|
|
37
55
|
}
|
|
38
56
|
}
|
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/biome.json
DELETED
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://biomejs.dev/schemas/2.2.3/schema.json",
|
|
3
|
-
"root": false,
|
|
4
|
-
"vcs": {
|
|
5
|
-
"enabled": true,
|
|
6
|
-
"clientKind": "git",
|
|
7
|
-
"useIgnoreFile": true
|
|
8
|
-
},
|
|
9
|
-
"files": {
|
|
10
|
-
"ignoreUnknown": true,
|
|
11
|
-
"includes": [
|
|
12
|
-
"**",
|
|
13
|
-
"!node_modules",
|
|
14
|
-
"!.next",
|
|
15
|
-
"!dist",
|
|
16
|
-
"!build",
|
|
17
|
-
"!.turbo",
|
|
18
|
-
"!.source",
|
|
19
|
-
"!docker",
|
|
20
|
-
"!**/(main)/(plugins)",
|
|
21
|
-
"!**/(auth)/(plugins)"
|
|
22
|
-
]
|
|
23
|
-
},
|
|
24
|
-
"formatter": {
|
|
25
|
-
"enabled": true,
|
|
26
|
-
"indentStyle": "space",
|
|
27
|
-
"indentWidth": 2,
|
|
28
|
-
"lineWidth": 80
|
|
29
|
-
},
|
|
30
|
-
"javascript": {
|
|
31
|
-
"formatter": {
|
|
32
|
-
"quoteStyle": "double",
|
|
33
|
-
"jsxQuoteStyle": "double",
|
|
34
|
-
"arrowParentheses": "asNeeded"
|
|
35
|
-
}
|
|
36
|
-
},
|
|
37
|
-
"linter": {
|
|
38
|
-
"enabled": true,
|
|
39
|
-
"rules": {
|
|
40
|
-
"recommended": true,
|
|
41
|
-
"complexity": {
|
|
42
|
-
"useLiteralKeys": "off",
|
|
43
|
-
"noExcessiveCognitiveComplexity": "warn",
|
|
44
|
-
"noExcessiveNestedTestSuites": "warn",
|
|
45
|
-
"noUselessStringConcat": "error",
|
|
46
|
-
"useSimplifiedLogicExpression": "warn"
|
|
47
|
-
},
|
|
48
|
-
"suspicious": {
|
|
49
|
-
"noConsole": "error",
|
|
50
|
-
"noAlert": "error",
|
|
51
|
-
"noSkippedTests": "warn",
|
|
52
|
-
"noVar": "error",
|
|
53
|
-
"useAwait": "error",
|
|
54
|
-
"useIterableCallbackReturn": "off"
|
|
55
|
-
},
|
|
56
|
-
"correctness": {
|
|
57
|
-
"noNestedComponentDefinitions": "error",
|
|
58
|
-
"noReactPropAssignments": "error",
|
|
59
|
-
"noRenderReturnValue": "error",
|
|
60
|
-
"useJsonImportAttributes": "warn",
|
|
61
|
-
"useUniqueElementIds": "off"
|
|
62
|
-
},
|
|
63
|
-
"performance": {
|
|
64
|
-
"noAwaitInLoops": "error",
|
|
65
|
-
"noDelete": "error",
|
|
66
|
-
"noNamespaceImport": "error"
|
|
67
|
-
},
|
|
68
|
-
"style": {
|
|
69
|
-
"noCommonJs": "error",
|
|
70
|
-
"noEnum": "error",
|
|
71
|
-
"noExportedImports": "warn",
|
|
72
|
-
"noInferrableTypes": "error",
|
|
73
|
-
"noNegationElse": "warn",
|
|
74
|
-
"noNestedTernary": "error",
|
|
75
|
-
"noSubstr": "error",
|
|
76
|
-
"noUnusedTemplateLiteral": "warn",
|
|
77
|
-
"noUselessElse": "warn",
|
|
78
|
-
"noYodaExpression": "warn",
|
|
79
|
-
"useAtIndex": "warn",
|
|
80
|
-
"useCollapsedIf": "warn",
|
|
81
|
-
"useConsistentArrayType": "warn",
|
|
82
|
-
"useConsistentBuiltinInstantiation": "error",
|
|
83
|
-
"useExportsLast": "warn",
|
|
84
|
-
"useObjectSpread": "warn",
|
|
85
|
-
"useSelfClosingElements": "warn",
|
|
86
|
-
"useShorthandAssign": "warn",
|
|
87
|
-
"useSingleVarDeclarator": "error",
|
|
88
|
-
"useThrowNewError": "error",
|
|
89
|
-
"useTrimStartEnd": "warn"
|
|
90
|
-
}
|
|
91
|
-
},
|
|
92
|
-
"domains": {
|
|
93
|
-
"next": "recommended",
|
|
94
|
-
"react": "recommended",
|
|
95
|
-
"test": "recommended"
|
|
96
|
-
}
|
|
97
|
-
},
|
|
98
|
-
"assist": {
|
|
99
|
-
"actions": {
|
|
100
|
-
"source": {
|
|
101
|
-
"organizeImports": "on"
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
}
|