startx 0.0.1 → 0.1.1
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/.prettierignore +0 -13
- package/.prettierrc.js +52 -52
- package/.vscode/launch.json +32 -0
- package/.vscode/settings.json +9 -3
- package/apps/core-server/.env.example +18 -24
- package/apps/core-server/Dockerfile +35 -61
- package/apps/core-server/eslint.config.ts +7 -0
- package/apps/core-server/package.json +41 -52
- package/apps/core-server/src/config/custom-type.ts +2 -40
- package/apps/core-server/src/events/index.ts +37 -37
- package/apps/core-server/src/index.ts +4 -13
- package/apps/core-server/src/middlewares/auth-middleware.ts +24 -7
- package/apps/core-server/src/middlewares/cors-middleware.ts +7 -6
- package/apps/core-server/src/middlewares/error-middleware.ts +7 -4
- package/apps/core-server/src/middlewares/logger-middleware.ts +81 -21
- package/apps/core-server/src/middlewares/notfound-middleware.ts +6 -14
- package/apps/core-server/src/middlewares/serve-static.ts +30 -24
- package/apps/core-server/src/routes/files/router.ts +9 -7
- package/apps/core-server/src/routes/server.ts +30 -36
- package/apps/core-server/tsdown.config.ts +4 -3
- package/biome.json +58 -60
- package/configs/eslint-config/package.json +16 -19
- package/configs/eslint-config/src/configs/base.ts +185 -225
- package/configs/eslint-config/src/configs/extend.ts +3 -0
- package/configs/eslint-config/src/configs/frontend.ts +81 -56
- package/configs/eslint-config/src/configs/node.ts +6 -6
- package/configs/eslint-config/src/plugin.ts +1 -0
- package/configs/eslint-config/src/rules/index.ts +8 -12
- package/configs/eslint-config/src/rules/no-json-parse-json-stringify.test.ts +30 -17
- package/configs/eslint-config/src/rules/no-json-parse-json-stringify.ts +52 -49
- package/configs/eslint-config/src/rules/no-uncaught-json-parse.ts +43 -45
- package/configs/tsdown-config/package.json +10 -3
- package/configs/typescript-config/package.json +10 -1
- package/configs/typescript-config/tsconfig.common.json +3 -3
- package/configs/vitest-config/dist/base.mjs +1 -0
- package/configs/vitest-config/dist/frontend.mjs +1 -0
- package/configs/vitest-config/dist/node.mjs +1 -0
- package/configs/vitest-config/package.json +12 -0
- package/configs/vitest-config/src/base.ts +17 -29
- package/configs/vitest-config/src/index.ts +1 -0
- package/package.json +15 -26
- package/packages/@repo/constants/eslint.config.ts +4 -0
- package/packages/@repo/constants/package.json +16 -0
- package/packages/@repo/constants/src/index.ts +8 -8
- package/packages/@repo/db/eslint.config.ts +4 -0
- package/packages/@repo/db/package.json +16 -8
- package/packages/@repo/db/src/index.ts +26 -20
- package/packages/@repo/db/src/schema/common.ts +45 -49
- package/packages/@repo/env/eslint.config.ts +4 -0
- package/packages/@repo/env/package.json +39 -0
- package/packages/@repo/env/src/default-env.ts +12 -0
- package/packages/@repo/env/src/define-env.ts +70 -0
- package/packages/@repo/env/src/index.ts +2 -0
- package/packages/@repo/env/src/utils.ts +52 -0
- package/packages/@repo/env/tsconfig.json +7 -0
- package/packages/@repo/lib/eslint.config.ts +4 -0
- package/packages/@repo/lib/package.json +34 -34
- package/packages/@repo/lib/src/bucket-module/file-storage.ts +50 -49
- package/packages/@repo/lib/src/bucket-module/index.ts +3 -0
- package/packages/@repo/lib/src/bucket-module/s3-storage.ts +120 -114
- package/packages/@repo/lib/src/bucket-module/utils.ts +10 -11
- package/packages/@repo/lib/src/{cookie-module.ts → cookie-module/cookie-module.ts} +48 -42
- package/packages/@repo/lib/src/cookie-module/index.ts +1 -0
- package/packages/@repo/lib/src/extra/index.ts +1 -0
- package/packages/@repo/lib/src/extra/pagination-module.ts +35 -0
- package/packages/@repo/lib/src/{token-module.ts → extra/token-module.ts} +12 -5
- package/packages/@repo/lib/src/file-system-module/index.ts +170 -0
- package/packages/@repo/lib/src/{hashing-module.ts → hashing-module/index.ts} +9 -9
- package/packages/@repo/lib/src/index.ts +0 -26
- package/packages/@repo/lib/src/mail-module/index.ts +2 -0
- package/packages/@repo/lib/src/mail-module/mock.ts +8 -8
- package/packages/@repo/lib/src/mail-module/nodemailer.ts +17 -7
- package/packages/@repo/lib/src/notification-module/index.ts +1 -172
- package/packages/@repo/lib/src/notification-module/push-notification.ts +97 -90
- package/packages/@repo/lib/src/{oauth2-client.ts → oauth2-module/index.ts} +107 -109
- package/packages/@repo/lib/src/otp-module/index.ts +91 -0
- package/packages/@repo/lib/src/session-module/index.ts +113 -0
- package/packages/@repo/lib/src/utils.ts +43 -42
- package/packages/@repo/lib/src/validation-module/index.ts +242 -0
- package/packages/@repo/logger/eslint.config.ts +4 -0
- package/packages/@repo/logger/package.json +40 -0
- package/packages/@repo/logger/src/index.ts +2 -0
- package/packages/@repo/logger/src/logger.ts +72 -0
- package/packages/@repo/{lib/src/logger-module → logger/src}/memory-profiler.ts +64 -65
- package/packages/@repo/logger/tsconfig.json +7 -0
- package/packages/@repo/mail/eslint.config.ts +4 -0
- package/packages/@repo/mail/package.json +10 -3
- package/packages/@repo/mail/src/emails/admin/OtpEmail.tsx +169 -168
- package/packages/@repo/mail/src/index.ts +1 -2
- package/packages/@repo/mail/tsconfig.json +3 -3
- package/packages/@repo/redis/dist/index.d.mts +3 -0
- package/packages/@repo/redis/dist/index.mjs +5 -0
- package/packages/@repo/redis/dist/lib/redis-client.d.mts +7 -0
- package/packages/@repo/redis/dist/lib/redis-client.mjs +25 -0
- package/packages/@repo/redis/dist/lib/redis-client.mjs.map +1 -0
- package/packages/@repo/redis/dist/lib/redis-module.d.mts +5 -0
- package/packages/@repo/redis/dist/lib/redis-module.mjs +6 -0
- package/packages/@repo/redis/dist/lib/redis-module.mjs.map +1 -0
- package/packages/@repo/redis/eslint.config.ts +4 -0
- package/packages/@repo/redis/package.json +13 -10
- package/packages/@repo/redis/src/index.ts +2 -2
- package/packages/@repo/redis/src/lib/redis-client.ts +36 -23
- package/packages/@repo/redis/src/lib/redis-module.ts +69 -3
- package/packages/cli/dist/index.mjs +203 -0
- package/packages/cli/eslint.config.ts +4 -0
- package/packages/cli/package.json +44 -0
- package/packages/cli/tsconfig.json +12 -0
- package/packages/cli/tsdown.config.ts +17 -0
- package/packages/ui/components.json +0 -1
- package/packages/ui/eslint.config.ts +4 -0
- package/packages/ui/package.json +16 -3
- package/packages/ui/postcss.config.mjs +9 -9
- package/packages/ui/src/components/lib/utils.ts +53 -53
- package/packages/ui/src/components/ui/alert-dialog.tsx +118 -116
- package/packages/ui/src/components/ui/avatar.tsx +52 -53
- package/packages/ui/src/components/ui/badge.tsx +45 -46
- package/packages/ui/src/components/ui/breadcrumb.tsx +108 -109
- package/packages/ui/src/components/ui/card.tsx +91 -92
- package/packages/ui/src/components/ui/carousel.tsx +243 -243
- package/packages/ui/src/components/ui/checkbox.tsx +32 -32
- package/packages/ui/src/components/ui/command.tsx +144 -155
- package/packages/ui/src/components/ui/dialog.tsx +124 -127
- package/packages/ui/src/components/ui/form.tsx +166 -165
- package/packages/ui/src/components/ui/input-otp.tsx +74 -76
- package/packages/ui/src/components/ui/input.tsx +19 -21
- package/packages/ui/src/components/ui/multiple-select.tsx +4 -4
- package/packages/ui/src/{components/lucide.tsx → lucide.ts} +3 -3
- package/packages/ui/tailwind.config.ts +94 -94
- package/packages/ui/tsconfig.json +7 -1
- package/pnpm-workspace.yaml +41 -1
- package/startx.json +22 -0
- package/turbo.json +20 -27
- package/apps/core-server/eslint.config.mjs +0 -47
- package/configs/eslint-config/src/rules/no-dynamic-import-template.ts +0 -32
- package/configs/eslint-config/src/rules/no-plain-errors.ts +0 -50
- package/configs/eslint-config/tsdown.config.ts +0 -11
- package/packages/@repo/constants/eslint.config.mjs +0 -21
- package/packages/@repo/db/eslint.config.mjs +0 -21
- package/packages/@repo/lib/eslint.config.mjs +0 -49
- package/packages/@repo/lib/src/command-module.ts +0 -77
- package/packages/@repo/lib/src/constants.ts +0 -3
- package/packages/@repo/lib/src/custom-type.ts +0 -54
- package/packages/@repo/lib/src/env.ts +0 -13
- package/packages/@repo/lib/src/file-system/index.ts +0 -90
- package/packages/@repo/lib/src/logger-module/log-config.ts +0 -16
- package/packages/@repo/lib/src/logger-module/logger.ts +0 -78
- package/packages/@repo/lib/src/mail-module/api.ts +0 -0
- package/packages/@repo/lib/src/otp-module.ts +0 -98
- package/packages/@repo/lib/src/pagination-module.ts +0 -49
- package/packages/@repo/lib/src/user-session.ts +0 -117
- package/packages/@repo/lib/src/validation-module.ts +0 -187
- package/packages/@repo/mail/tsconfig.build.json +0 -14
- package/packages/@repo/mail/tsdown.config.ts +0 -9
- package/packages/@repo/redis/eslint.config.mjs +0 -8
- package/packages/ui/eslint.config.mjs +0 -18
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
import js from "@eslint/js";
|
|
2
1
|
import { fixupPluginRules } from "@eslint/compat";
|
|
2
|
+
import js from "@eslint/js";
|
|
3
|
+
import stylisticPlugin from "@stylistic/eslint-plugin";
|
|
4
|
+
import { defineConfig } from "eslint/config";
|
|
5
|
+
import eslintConfigPrettier from "eslint-config-prettier";
|
|
3
6
|
import { createTypeScriptImportResolver } from "eslint-import-resolver-typescript";
|
|
4
7
|
import importPlugin from "eslint-plugin-import-x";
|
|
5
8
|
import lodashPlugin from "eslint-plugin-lodash";
|
|
@@ -9,229 +12,186 @@ import unicornPlugin from "eslint-plugin-unicorn";
|
|
|
9
12
|
import unusedImportsPlugin from "eslint-plugin-unused-imports";
|
|
10
13
|
import globals from "globals";
|
|
11
14
|
import tseslint from "typescript-eslint";
|
|
12
|
-
import
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
"vitest.config.ts",
|
|
15
|
+
import { localRulesPlugin } from "../plugin.js";
|
|
16
|
+
|
|
17
|
+
export const baseConfig = defineConfig(
|
|
18
|
+
// 1. Global Ignores
|
|
19
|
+
{
|
|
20
|
+
ignores: [
|
|
21
|
+
"**/node_modules/**",
|
|
22
|
+
"**/dist/**",
|
|
23
|
+
"**/build/**",
|
|
24
|
+
"**/.next/**",
|
|
25
|
+
"eslint.config.ts",
|
|
26
|
+
"tsup.config.ts",
|
|
27
|
+
"jest.config.js",
|
|
28
|
+
"cypress.config.js",
|
|
29
|
+
"vite.config.ts",
|
|
30
|
+
"vitest.config.ts",
|
|
29
31
|
"tsdown.config.ts",
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
// ******************************************************************
|
|
196
|
-
// Plugins
|
|
197
|
-
// ******************************************************************
|
|
198
|
-
"unused-imports/no-unused-imports":
|
|
199
|
-
process.env.NODE_ENV === "development" ? "warn" : "error",
|
|
200
|
-
|
|
201
|
-
"unicorn/no-unnecessary-await": "error",
|
|
202
|
-
"unicorn/no-useless-promise-resolve-reject": "error",
|
|
203
|
-
|
|
204
|
-
"lodash/path-style": ["error", "as-needed"],
|
|
205
|
-
"lodash/import-scope": ["error", "method"],
|
|
206
|
-
},
|
|
207
|
-
},
|
|
208
|
-
|
|
209
|
-
// 4. React Specific Overrides (Only for .tsx / .jsx files)
|
|
210
|
-
{
|
|
211
|
-
files: ["**/*.tsx", "**/*.jsx"],
|
|
212
|
-
...reactPlugin.configs.flat.recommended,
|
|
213
|
-
...reactPlugin.configs.flat["jsx-runtime"],
|
|
214
|
-
rules: {
|
|
215
|
-
...reactHooksPlugin.configs.recommended.rules,
|
|
216
|
-
"react/prop-types": "off", // Not needed with TypeScript
|
|
217
|
-
"react/react-in-jsx-scope": "off", // Not needed in modern React
|
|
218
|
-
"react/jsx-no-leaked-render": "error", // Security/Perf rule
|
|
219
|
-
},
|
|
220
|
-
},
|
|
221
|
-
|
|
222
|
-
// 5. Test Overrides
|
|
223
|
-
{
|
|
224
|
-
files: ["test/**/*.ts", "**/__tests__/*.ts", "**/*.test.ts", "**/*.cy.ts"],
|
|
225
|
-
rules: {
|
|
226
|
-
"local-rules/no-plain-errors": "off",
|
|
227
|
-
"@typescript-eslint/unbound-method": "off",
|
|
228
|
-
"import-x/no-default-export": "off", // Tests often need default export for config or simply don't care
|
|
229
|
-
},
|
|
230
|
-
},
|
|
231
|
-
|
|
232
|
-
// 6. Local Rules
|
|
233
|
-
localRulesPlugin.configs.recommended,
|
|
234
|
-
|
|
235
|
-
// 7. Prettier (Must be last to override stylistic rules)
|
|
236
|
-
eslintConfigPrettier
|
|
32
|
+
],
|
|
33
|
+
},
|
|
34
|
+
|
|
35
|
+
// 2. Base Configurations
|
|
36
|
+
js.configs.recommended,
|
|
37
|
+
...tseslint.configs.recommended,
|
|
38
|
+
...tseslint.configs.recommendedTypeChecked,
|
|
39
|
+
importPlugin.flatConfigs.recommended as any,
|
|
40
|
+
importPlugin.flatConfigs.typescript as any,
|
|
41
|
+
|
|
42
|
+
// 3. Main Configuration
|
|
43
|
+
{
|
|
44
|
+
plugins: {
|
|
45
|
+
"unused-imports": fixupPluginRules(unusedImportsPlugin),
|
|
46
|
+
"react-hooks": fixupPluginRules(reactHooksPlugin as any),
|
|
47
|
+
lodash: fixupPluginRules(lodashPlugin),
|
|
48
|
+
"@stylistic": stylisticPlugin as any,
|
|
49
|
+
unicorn: unicornPlugin,
|
|
50
|
+
react: reactPlugin,
|
|
51
|
+
},
|
|
52
|
+
languageOptions: {
|
|
53
|
+
ecmaVersion: 2022,
|
|
54
|
+
sourceType: "module",
|
|
55
|
+
globals: {
|
|
56
|
+
...globals.browser,
|
|
57
|
+
...globals.node,
|
|
58
|
+
...globals.es2021,
|
|
59
|
+
},
|
|
60
|
+
parserOptions: {
|
|
61
|
+
projectService: true,
|
|
62
|
+
tsconfigRootDir: import.meta.dirname,
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
settings: {
|
|
66
|
+
"import-x/resolver-next": [createTypeScriptImportResolver()],
|
|
67
|
+
react: {
|
|
68
|
+
version: "detect",
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
rules: {
|
|
72
|
+
// Core Rules
|
|
73
|
+
"no-void": ["error", { allowAsStatement: true }],
|
|
74
|
+
"no-constant-binary-expression": "error",
|
|
75
|
+
"no-console": ["warn", { allow: ["warn", "error"] }],
|
|
76
|
+
eqeqeq: "warn",
|
|
77
|
+
"object-shorthand": "warn",
|
|
78
|
+
"prefer-const": "warn",
|
|
79
|
+
|
|
80
|
+
"id-denylist": "off",
|
|
81
|
+
"import-x/no-named-as-default": "off",
|
|
82
|
+
|
|
83
|
+
// TypeScript
|
|
84
|
+
"@typescript-eslint/await-thenable": "error",
|
|
85
|
+
"@typescript-eslint/no-floating-promises": ["error", { ignoreVoid: true }],
|
|
86
|
+
"@typescript-eslint/no-misused-promises": ["error", { checksVoidReturn: false }],
|
|
87
|
+
"@typescript-eslint/only-throw-error": "error",
|
|
88
|
+
"@typescript-eslint/no-explicit-any": "warn",
|
|
89
|
+
"@typescript-eslint/no-unsafe-assignment": "warn",
|
|
90
|
+
"@typescript-eslint/no-unsafe-argument": "warn",
|
|
91
|
+
"@typescript-eslint/no-unsafe-call": "warn",
|
|
92
|
+
"@typescript-eslint/no-unsafe-return": "off",
|
|
93
|
+
"@typescript-eslint/no-unsafe-member-access": ["error", { "allowOptionalChaining": true }],
|
|
94
|
+
"@typescript-eslint/array-type": ["warn", { default: "array-simple" }],
|
|
95
|
+
"@typescript-eslint/consistent-type-assertions": "warn",
|
|
96
|
+
"@typescript-eslint/consistent-type-imports": "warn",
|
|
97
|
+
"@typescript-eslint/consistent-type-exports": "warn",
|
|
98
|
+
"@typescript-eslint/return-await": ["warn", "always"],
|
|
99
|
+
|
|
100
|
+
"@typescript-eslint/explicit-member-accessibility": "off",
|
|
101
|
+
|
|
102
|
+
"@typescript-eslint/naming-convention": [
|
|
103
|
+
"warn",
|
|
104
|
+
{ selector: "default", format: ["camelCase"] },
|
|
105
|
+
|
|
106
|
+
{ selector: "import", format: ["camelCase", "PascalCase"] },
|
|
107
|
+
|
|
108
|
+
{
|
|
109
|
+
selector: "variable",
|
|
110
|
+
format: ["camelCase", "snake_case", "UPPER_CASE", "PascalCase"],
|
|
111
|
+
leadingUnderscore: "allowSingleOrDouble",
|
|
112
|
+
trailingUnderscore: "allowSingleOrDouble",
|
|
113
|
+
},
|
|
114
|
+
|
|
115
|
+
{
|
|
116
|
+
selector: "parameter",
|
|
117
|
+
format: ["camelCase"],
|
|
118
|
+
leadingUnderscore: "allowSingleOrDouble",
|
|
119
|
+
},
|
|
120
|
+
|
|
121
|
+
{ selector: "typeLike", format: ["PascalCase"] },
|
|
122
|
+
{ selector: "enumMember", format: ["UPPER_CASE", "PascalCase"] },
|
|
123
|
+
],
|
|
124
|
+
"@typescript-eslint/no-restricted-types": [
|
|
125
|
+
"warn",
|
|
126
|
+
{
|
|
127
|
+
types: {
|
|
128
|
+
Object: { message: "Use object instead", fixWith: "object" },
|
|
129
|
+
String: { message: "Use string instead", fixWith: "string" },
|
|
130
|
+
Boolean: { message: "Use boolean instead", fixWith: "boolean" },
|
|
131
|
+
Number: { message: "Use number instead", fixWith: "number" },
|
|
132
|
+
Symbol: { message: "Use symbol instead", fixWith: "symbol" },
|
|
133
|
+
},
|
|
134
|
+
},
|
|
135
|
+
],
|
|
136
|
+
"@typescript-eslint/no-unused-vars": "warn",
|
|
137
|
+
"@typescript-eslint/no-empty-object-type": "warn",
|
|
138
|
+
// Stylistic
|
|
139
|
+
"@stylistic/member-delimiter-style": [
|
|
140
|
+
"warn",
|
|
141
|
+
{
|
|
142
|
+
multiline: { delimiter: "semi", requireLast: true },
|
|
143
|
+
singleline: { delimiter: "semi", requireLast: false },
|
|
144
|
+
},
|
|
145
|
+
],
|
|
146
|
+
|
|
147
|
+
"import-x/no-cycle": "off",
|
|
148
|
+
"import-x/no-default-export": "off",
|
|
149
|
+
|
|
150
|
+
"import-x/no-duplicates": "warn",
|
|
151
|
+
"import-x/order": [
|
|
152
|
+
"warn",
|
|
153
|
+
{
|
|
154
|
+
alphabetize: { order: "asc", caseInsensitive: true },
|
|
155
|
+
groups: [["builtin", "external"], "internal", ["parent", "index", "sibling"], "object"],
|
|
156
|
+
"newlines-between": "always",
|
|
157
|
+
},
|
|
158
|
+
],
|
|
159
|
+
|
|
160
|
+
// Plugins
|
|
161
|
+
"unused-imports/no-unused-imports": "warn",
|
|
162
|
+
"unicorn/no-unnecessary-await": "warn",
|
|
163
|
+
"unicorn/no-useless-promise-resolve-reject": "warn",
|
|
164
|
+
"lodash/path-style": ["warn", "as-needed"],
|
|
165
|
+
"lodash/import-scope": ["warn", "method"],
|
|
166
|
+
},
|
|
167
|
+
},
|
|
168
|
+
|
|
169
|
+
// 4. React Specific Overrides
|
|
170
|
+
{
|
|
171
|
+
files: ["**/*.tsx", "**/*.jsx"],
|
|
172
|
+
...reactPlugin.configs.flat.recommended,
|
|
173
|
+
...reactPlugin.configs.flat["jsx-runtime"],
|
|
174
|
+
rules: {
|
|
175
|
+
...reactHooksPlugin.configs.recommended.rules,
|
|
176
|
+
"react/prop-types": "off",
|
|
177
|
+
"react/react-in-jsx-scope": "off",
|
|
178
|
+
"react/jsx-no-leaked-render": "error", // Security/Perf rule (Keep as error)
|
|
179
|
+
},
|
|
180
|
+
},
|
|
181
|
+
|
|
182
|
+
// 5. Test Overrides
|
|
183
|
+
{
|
|
184
|
+
files: ["test/**/*.ts", "**/__tests__/*.ts", "**/*.test.ts", "**/*.cy.ts"],
|
|
185
|
+
rules: {
|
|
186
|
+
"local-rules/no-plain-errors": "off",
|
|
187
|
+
"@typescript-eslint/unbound-method": "off",
|
|
188
|
+
"import-x/no-default-export": "off",
|
|
189
|
+
},
|
|
190
|
+
},
|
|
191
|
+
|
|
192
|
+
// 6. Local Rules
|
|
193
|
+
localRulesPlugin.configs.recommended,
|
|
194
|
+
|
|
195
|
+
// 7. Prettier (Must be last to cleanly override stylistic rules)
|
|
196
|
+
eslintConfigPrettier
|
|
237
197
|
);
|
|
@@ -1,62 +1,87 @@
|
|
|
1
1
|
import { fixupPluginRules } from "@eslint/compat";
|
|
2
|
-
import {
|
|
2
|
+
import { defineConfig } from "eslint/config";
|
|
3
3
|
import jsxA11yPlugin from "eslint-plugin-jsx-a11y";
|
|
4
4
|
import reactPlugin from "eslint-plugin-react";
|
|
5
5
|
import reactHooksPlugin from "eslint-plugin-react-hooks";
|
|
6
6
|
import globals from "globals";
|
|
7
|
-
import
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
7
|
+
import { baseConfig } from "./base.js";
|
|
8
|
+
export const frontendConfig = defineConfig(
|
|
9
|
+
...baseConfig,
|
|
10
|
+
|
|
11
|
+
// 1. Frontend Ignores
|
|
12
|
+
{
|
|
13
|
+
ignores: [
|
|
14
|
+
"**/dist/**",
|
|
15
|
+
"**/coverage/**",
|
|
16
|
+
"**/storybook-static/**",
|
|
17
|
+
"**/*.snap",
|
|
18
|
+
"**/*.d.ts",
|
|
19
|
+
"vite.config.ts",
|
|
20
|
+
],
|
|
21
|
+
},
|
|
22
|
+
|
|
23
|
+
// 2. Browser/React Globals & Settings
|
|
24
|
+
{
|
|
25
|
+
files: ["**/*.ts", "**/*.tsx", "**/*.js", "**/*.jsx"],
|
|
26
|
+
languageOptions: {
|
|
27
|
+
globals: {
|
|
28
|
+
...globals.browser,
|
|
29
|
+
...globals.serviceworker,
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
settings: {
|
|
33
|
+
react: {
|
|
34
|
+
version: "detect",
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
|
|
39
|
+
// 3. React Recommended Configs
|
|
40
|
+
reactPlugin.configs.flat.recommended,
|
|
41
|
+
reactPlugin.configs.flat["jsx-runtime"],
|
|
42
|
+
|
|
43
|
+
// 4. React, Hooks, and Accessibility Rules
|
|
44
|
+
{
|
|
45
|
+
files: ["**/*.tsx", "**/*.jsx"],
|
|
46
|
+
plugins: {
|
|
47
|
+
"react-hooks": fixupPluginRules(reactHooksPlugin as any),
|
|
48
|
+
"jsx-a11y": fixupPluginRules(jsxA11yPlugin),
|
|
49
|
+
},
|
|
50
|
+
rules: {
|
|
51
|
+
...reactHooksPlugin.configs.recommended.rules,
|
|
52
|
+
...jsxA11yPlugin.configs.recommended.rules,
|
|
53
|
+
|
|
54
|
+
// --- Naming Convention Override for React ---
|
|
55
|
+
"@typescript-eslint/naming-convention": [
|
|
56
|
+
"warn",
|
|
57
|
+
{ selector: "default", format: ["camelCase"] },
|
|
58
|
+
{ selector: "function", format: ["camelCase", "PascalCase"] },
|
|
59
|
+
{ selector: "import", format: ["camelCase", "PascalCase"] },
|
|
60
|
+
{
|
|
61
|
+
selector: "variable",
|
|
62
|
+
format: ["camelCase", "snake_case", "UPPER_CASE", "PascalCase"],
|
|
63
|
+
leadingUnderscore: "allowSingleOrDouble",
|
|
64
|
+
trailingUnderscore: "allowSingleOrDouble",
|
|
65
|
+
},
|
|
66
|
+
{ selector: "typeLike", format: ["PascalCase"] },
|
|
67
|
+
{ selector: "enumMember", format: ["UPPER_CASE", "PascalCase"] },
|
|
68
|
+
],
|
|
69
|
+
|
|
70
|
+
// --- React Specifics ---
|
|
71
|
+
"react/prop-types": "off",
|
|
72
|
+
"react/display-name": "warn",
|
|
73
|
+
"react/no-unescaped-entities": "warn",
|
|
74
|
+
|
|
75
|
+
// --- React Hooks Specifics ---
|
|
76
|
+
"react-hooks/rules-of-hooks": "error",
|
|
77
|
+
"react-hooks/exhaustive-deps": "warn",
|
|
78
|
+
|
|
79
|
+
// --- Accessibility (a11y) Specifics ---
|
|
80
|
+
"jsx-a11y/no-autofocus": "warn",
|
|
81
|
+
"jsx-a11y/click-events-have-key-events": "warn",
|
|
82
|
+
"jsx-a11y/no-static-element-interactions": "warn",
|
|
83
|
+
"jsx-a11y/anchor-is-valid": "warn",
|
|
84
|
+
"jsx-a11y/no-onchange": "off",
|
|
85
|
+
},
|
|
86
|
+
}
|
|
62
87
|
);
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
+
import { defineConfig } from "eslint/config";
|
|
1
2
|
import globals from "globals";
|
|
2
|
-
import tseslint from "typescript-eslint";
|
|
3
3
|
import { baseConfig } from "./base.js";
|
|
4
4
|
|
|
5
|
-
export const nodeConfig =
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
export const nodeConfig = defineConfig(baseConfig, {
|
|
6
|
+
languageOptions: {
|
|
7
|
+
ecmaVersion: 2024,
|
|
8
|
+
globals: globals.node,
|
|
9
|
+
},
|
|
10
10
|
});
|
|
@@ -1,17 +1,15 @@
|
|
|
1
|
+
import type { AnyRuleModule } from "@typescript-eslint/utils/ts-eslint";
|
|
2
|
+
import { NoArgumentSpreadRule } from "./no-argument-spread.js";
|
|
3
|
+
import { NoInternalPackageImportRule } from "./no-internal-package-import.js";
|
|
4
|
+
import { NoInterpolationInRegularStringRule } from "./no-interpolation-in-regular-string.js";
|
|
1
5
|
import { NoJsonParseJsonStringifyRule } from "./no-json-parse-json-stringify.js";
|
|
2
|
-
import { NoUncaughtJsonParseRule } from "./no-uncaught-json-parse.js";
|
|
3
|
-
import { NoUnusedParamInCatchClauseRule } from "./no-unused-param-catch-clause.js";
|
|
4
|
-
import { NoUselessCatchThrowRule } from "./no-useless-catch-throw.js";
|
|
5
6
|
import { NoSkippedTestsRule } from "./no-skipped-tests.js";
|
|
6
|
-
import {
|
|
7
|
-
import { NoPlainErrorsRule } from "./no-plain-errors.js";
|
|
8
|
-
import { NoDynamicImportTemplateRule } from "./no-dynamic-import-template.js";
|
|
7
|
+
import { NoTopLevelRelativeImportsInBackendModuleRule } from "./no-top-level-relative-imports-in-backend-module.js";
|
|
9
8
|
import { NoTypeUnsafeEventEmitterRule } from "./no-type-unsafe-event-emitter.js";
|
|
9
|
+
import { NoUncaughtJsonParseRule } from "./no-uncaught-json-parse.js";
|
|
10
10
|
import { NoUntypedConfigClassFieldRule } from "./no-untyped-config-class-field.js";
|
|
11
|
-
import {
|
|
12
|
-
import
|
|
13
|
-
import { NoArgumentSpreadRule } from "./no-argument-spread.js";
|
|
14
|
-
import { NoInternalPackageImportRule } from "./no-internal-package-import.js";
|
|
11
|
+
import { NoUnusedParamInCatchClauseRule } from "./no-unused-param-catch-clause.js";
|
|
12
|
+
import { NoUselessCatchThrowRule } from "./no-useless-catch-throw.js";
|
|
15
13
|
|
|
16
14
|
export const rules = {
|
|
17
15
|
"no-uncaught-json-parse": NoUncaughtJsonParseRule,
|
|
@@ -20,8 +18,6 @@ export const rules = {
|
|
|
20
18
|
"no-useless-catch-throw": NoUselessCatchThrowRule,
|
|
21
19
|
"no-skipped-tests": NoSkippedTestsRule,
|
|
22
20
|
"no-interpolation-in-regular-string": NoInterpolationInRegularStringRule,
|
|
23
|
-
"no-plain-errors": NoPlainErrorsRule,
|
|
24
|
-
"no-dynamic-import-template": NoDynamicImportTemplateRule,
|
|
25
21
|
"no-type-unsafe-event-emitter": NoTypeUnsafeEventEmitterRule,
|
|
26
22
|
"no-untyped-config-class-field": NoUntypedConfigClassFieldRule,
|
|
27
23
|
"no-top-level-relative-imports-in-backend-module": NoTopLevelRelativeImportsInBackendModuleRule,
|