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.
Files changed (155) hide show
  1. package/.prettierignore +0 -13
  2. package/.prettierrc.js +52 -52
  3. package/.vscode/launch.json +32 -0
  4. package/.vscode/settings.json +9 -3
  5. package/apps/core-server/.env.example +18 -24
  6. package/apps/core-server/Dockerfile +35 -61
  7. package/apps/core-server/eslint.config.ts +7 -0
  8. package/apps/core-server/package.json +41 -52
  9. package/apps/core-server/src/config/custom-type.ts +2 -40
  10. package/apps/core-server/src/events/index.ts +37 -37
  11. package/apps/core-server/src/index.ts +4 -13
  12. package/apps/core-server/src/middlewares/auth-middleware.ts +24 -7
  13. package/apps/core-server/src/middlewares/cors-middleware.ts +7 -6
  14. package/apps/core-server/src/middlewares/error-middleware.ts +7 -4
  15. package/apps/core-server/src/middlewares/logger-middleware.ts +81 -21
  16. package/apps/core-server/src/middlewares/notfound-middleware.ts +6 -14
  17. package/apps/core-server/src/middlewares/serve-static.ts +30 -24
  18. package/apps/core-server/src/routes/files/router.ts +9 -7
  19. package/apps/core-server/src/routes/server.ts +30 -36
  20. package/apps/core-server/tsdown.config.ts +4 -3
  21. package/biome.json +58 -60
  22. package/configs/eslint-config/package.json +16 -19
  23. package/configs/eslint-config/src/configs/base.ts +185 -225
  24. package/configs/eslint-config/src/configs/extend.ts +3 -0
  25. package/configs/eslint-config/src/configs/frontend.ts +81 -56
  26. package/configs/eslint-config/src/configs/node.ts +6 -6
  27. package/configs/eslint-config/src/plugin.ts +1 -0
  28. package/configs/eslint-config/src/rules/index.ts +8 -12
  29. package/configs/eslint-config/src/rules/no-json-parse-json-stringify.test.ts +30 -17
  30. package/configs/eslint-config/src/rules/no-json-parse-json-stringify.ts +52 -49
  31. package/configs/eslint-config/src/rules/no-uncaught-json-parse.ts +43 -45
  32. package/configs/tsdown-config/package.json +10 -3
  33. package/configs/typescript-config/package.json +10 -1
  34. package/configs/typescript-config/tsconfig.common.json +3 -3
  35. package/configs/vitest-config/dist/base.mjs +1 -0
  36. package/configs/vitest-config/dist/frontend.mjs +1 -0
  37. package/configs/vitest-config/dist/node.mjs +1 -0
  38. package/configs/vitest-config/package.json +12 -0
  39. package/configs/vitest-config/src/base.ts +17 -29
  40. package/configs/vitest-config/src/index.ts +1 -0
  41. package/package.json +15 -26
  42. package/packages/@repo/constants/eslint.config.ts +4 -0
  43. package/packages/@repo/constants/package.json +16 -0
  44. package/packages/@repo/constants/src/index.ts +8 -8
  45. package/packages/@repo/db/eslint.config.ts +4 -0
  46. package/packages/@repo/db/package.json +16 -8
  47. package/packages/@repo/db/src/index.ts +26 -20
  48. package/packages/@repo/db/src/schema/common.ts +45 -49
  49. package/packages/@repo/env/eslint.config.ts +4 -0
  50. package/packages/@repo/env/package.json +39 -0
  51. package/packages/@repo/env/src/default-env.ts +12 -0
  52. package/packages/@repo/env/src/define-env.ts +70 -0
  53. package/packages/@repo/env/src/index.ts +2 -0
  54. package/packages/@repo/env/src/utils.ts +52 -0
  55. package/packages/@repo/env/tsconfig.json +7 -0
  56. package/packages/@repo/lib/eslint.config.ts +4 -0
  57. package/packages/@repo/lib/package.json +34 -34
  58. package/packages/@repo/lib/src/bucket-module/file-storage.ts +50 -49
  59. package/packages/@repo/lib/src/bucket-module/index.ts +3 -0
  60. package/packages/@repo/lib/src/bucket-module/s3-storage.ts +120 -114
  61. package/packages/@repo/lib/src/bucket-module/utils.ts +10 -11
  62. package/packages/@repo/lib/src/{cookie-module.ts → cookie-module/cookie-module.ts} +48 -42
  63. package/packages/@repo/lib/src/cookie-module/index.ts +1 -0
  64. package/packages/@repo/lib/src/extra/index.ts +1 -0
  65. package/packages/@repo/lib/src/extra/pagination-module.ts +35 -0
  66. package/packages/@repo/lib/src/{token-module.ts → extra/token-module.ts} +12 -5
  67. package/packages/@repo/lib/src/file-system-module/index.ts +170 -0
  68. package/packages/@repo/lib/src/{hashing-module.ts → hashing-module/index.ts} +9 -9
  69. package/packages/@repo/lib/src/index.ts +0 -26
  70. package/packages/@repo/lib/src/mail-module/index.ts +2 -0
  71. package/packages/@repo/lib/src/mail-module/mock.ts +8 -8
  72. package/packages/@repo/lib/src/mail-module/nodemailer.ts +17 -7
  73. package/packages/@repo/lib/src/notification-module/index.ts +1 -172
  74. package/packages/@repo/lib/src/notification-module/push-notification.ts +97 -90
  75. package/packages/@repo/lib/src/{oauth2-client.ts → oauth2-module/index.ts} +107 -109
  76. package/packages/@repo/lib/src/otp-module/index.ts +91 -0
  77. package/packages/@repo/lib/src/session-module/index.ts +113 -0
  78. package/packages/@repo/lib/src/utils.ts +43 -42
  79. package/packages/@repo/lib/src/validation-module/index.ts +242 -0
  80. package/packages/@repo/logger/eslint.config.ts +4 -0
  81. package/packages/@repo/logger/package.json +40 -0
  82. package/packages/@repo/logger/src/index.ts +2 -0
  83. package/packages/@repo/logger/src/logger.ts +72 -0
  84. package/packages/@repo/{lib/src/logger-module → logger/src}/memory-profiler.ts +64 -65
  85. package/packages/@repo/logger/tsconfig.json +7 -0
  86. package/packages/@repo/mail/eslint.config.ts +4 -0
  87. package/packages/@repo/mail/package.json +10 -3
  88. package/packages/@repo/mail/src/emails/admin/OtpEmail.tsx +169 -168
  89. package/packages/@repo/mail/src/index.ts +1 -2
  90. package/packages/@repo/mail/tsconfig.json +3 -3
  91. package/packages/@repo/redis/dist/index.d.mts +3 -0
  92. package/packages/@repo/redis/dist/index.mjs +5 -0
  93. package/packages/@repo/redis/dist/lib/redis-client.d.mts +7 -0
  94. package/packages/@repo/redis/dist/lib/redis-client.mjs +25 -0
  95. package/packages/@repo/redis/dist/lib/redis-client.mjs.map +1 -0
  96. package/packages/@repo/redis/dist/lib/redis-module.d.mts +5 -0
  97. package/packages/@repo/redis/dist/lib/redis-module.mjs +6 -0
  98. package/packages/@repo/redis/dist/lib/redis-module.mjs.map +1 -0
  99. package/packages/@repo/redis/eslint.config.ts +4 -0
  100. package/packages/@repo/redis/package.json +13 -10
  101. package/packages/@repo/redis/src/index.ts +2 -2
  102. package/packages/@repo/redis/src/lib/redis-client.ts +36 -23
  103. package/packages/@repo/redis/src/lib/redis-module.ts +69 -3
  104. package/packages/cli/dist/index.mjs +203 -0
  105. package/packages/cli/eslint.config.ts +4 -0
  106. package/packages/cli/package.json +44 -0
  107. package/packages/cli/tsconfig.json +12 -0
  108. package/packages/cli/tsdown.config.ts +17 -0
  109. package/packages/ui/components.json +0 -1
  110. package/packages/ui/eslint.config.ts +4 -0
  111. package/packages/ui/package.json +16 -3
  112. package/packages/ui/postcss.config.mjs +9 -9
  113. package/packages/ui/src/components/lib/utils.ts +53 -53
  114. package/packages/ui/src/components/ui/alert-dialog.tsx +118 -116
  115. package/packages/ui/src/components/ui/avatar.tsx +52 -53
  116. package/packages/ui/src/components/ui/badge.tsx +45 -46
  117. package/packages/ui/src/components/ui/breadcrumb.tsx +108 -109
  118. package/packages/ui/src/components/ui/card.tsx +91 -92
  119. package/packages/ui/src/components/ui/carousel.tsx +243 -243
  120. package/packages/ui/src/components/ui/checkbox.tsx +32 -32
  121. package/packages/ui/src/components/ui/command.tsx +144 -155
  122. package/packages/ui/src/components/ui/dialog.tsx +124 -127
  123. package/packages/ui/src/components/ui/form.tsx +166 -165
  124. package/packages/ui/src/components/ui/input-otp.tsx +74 -76
  125. package/packages/ui/src/components/ui/input.tsx +19 -21
  126. package/packages/ui/src/components/ui/multiple-select.tsx +4 -4
  127. package/packages/ui/src/{components/lucide.tsx → lucide.ts} +3 -3
  128. package/packages/ui/tailwind.config.ts +94 -94
  129. package/packages/ui/tsconfig.json +7 -1
  130. package/pnpm-workspace.yaml +41 -1
  131. package/startx.json +22 -0
  132. package/turbo.json +20 -27
  133. package/apps/core-server/eslint.config.mjs +0 -47
  134. package/configs/eslint-config/src/rules/no-dynamic-import-template.ts +0 -32
  135. package/configs/eslint-config/src/rules/no-plain-errors.ts +0 -50
  136. package/configs/eslint-config/tsdown.config.ts +0 -11
  137. package/packages/@repo/constants/eslint.config.mjs +0 -21
  138. package/packages/@repo/db/eslint.config.mjs +0 -21
  139. package/packages/@repo/lib/eslint.config.mjs +0 -49
  140. package/packages/@repo/lib/src/command-module.ts +0 -77
  141. package/packages/@repo/lib/src/constants.ts +0 -3
  142. package/packages/@repo/lib/src/custom-type.ts +0 -54
  143. package/packages/@repo/lib/src/env.ts +0 -13
  144. package/packages/@repo/lib/src/file-system/index.ts +0 -90
  145. package/packages/@repo/lib/src/logger-module/log-config.ts +0 -16
  146. package/packages/@repo/lib/src/logger-module/logger.ts +0 -78
  147. package/packages/@repo/lib/src/mail-module/api.ts +0 -0
  148. package/packages/@repo/lib/src/otp-module.ts +0 -98
  149. package/packages/@repo/lib/src/pagination-module.ts +0 -49
  150. package/packages/@repo/lib/src/user-session.ts +0 -117
  151. package/packages/@repo/lib/src/validation-module.ts +0 -187
  152. package/packages/@repo/mail/tsconfig.build.json +0 -14
  153. package/packages/@repo/mail/tsdown.config.ts +0 -9
  154. package/packages/@repo/redis/eslint.config.mjs +0 -8
  155. 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 stylisticPlugin from "@stylistic/eslint-plugin";
13
- import eslintConfigPrettier from "eslint-config-prettier";
14
- import { localRulesPlugin } from "../plugin.js"; // Assuming this exists
15
-
16
- export const baseConfig = tseslint.config(
17
- {
18
- ignores: [
19
- "**/node_modules/**",
20
- "**/dist/**",
21
- "**/build/**",
22
- "**/.next/**",
23
- "eslint.config.mjs",
24
- "tsup.config.ts",
25
- "jest.config.js",
26
- "cypress.config.js",
27
- "vite.config.ts",
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
- // 2. Base Configurations (Order matters)
34
- js.configs.recommended,
35
- ...tseslint.configs.recommended,
36
- ...tseslint.configs.recommendedTypeChecked,
37
- importPlugin.flatConfigs.recommended,
38
- importPlugin.flatConfigs.typescript,
39
-
40
- // 3. Main Configuration (Node, Express, Shared Logic)
41
- {
42
- plugins: {
43
- // Compatibility fixups for plugins not yet strictly flat-config ready
44
- "unused-imports": fixupPluginRules(unusedImportsPlugin),
45
- "react-hooks": fixupPluginRules(reactHooksPlugin as any),
46
- lodash: fixupPluginRules(lodashPlugin),
47
-
48
- "@stylistic": stylisticPlugin as any,
49
- unicorn: unicornPlugin,
50
- react: reactPlugin,
51
- },
52
- languageOptions: {
53
- ecmaVersion: 2022,
54
- sourceType: "module",
55
- // Combine globals for Monorepo (Node + Browser)
56
- globals: {
57
- ...globals.browser,
58
- ...globals.node,
59
- ...globals.es2021,
60
- },
61
- parserOptions: {
62
- projectService: true, // Faster than 'project: true' for monorepos
63
- tsconfigRootDir: import.meta.dirname,
64
- },
65
- },
66
- settings: {
67
- "import-x/resolver-next": [createTypeScriptImportResolver()],
68
- react: {
69
- version: "detect",
70
- },
71
- },
72
- rules: {
73
- // ******************************************************************
74
- // Core Rules
75
- // ******************************************************************
76
- "no-void": ["error", { allowAsStatement: true }],
77
- "no-constant-binary-expression": "error",
78
- "no-console": ["warn", { allow: ["warn", "error"] }],
79
- eqeqeq: "error",
80
- "object-shorthand": "error",
81
- "prefer-const": "error",
82
-
83
- // ID Denylist
84
- "id-denylist": [
85
- "error",
86
- "err",
87
- "cb",
88
- "callback",
89
- "any",
90
- "Number",
91
- "number",
92
- "String",
93
- "string",
94
- "Boolean",
95
- "boolean",
96
- "Undefined",
97
- "undefined",
98
- ],
99
-
100
- // ******************************************************************
101
- // TypeScript
102
- // ******************************************************************
103
- "@typescript-eslint/array-type": ["error", { default: "array-simple" }],
104
- "@typescript-eslint/await-thenable": "error",
105
- "@typescript-eslint/consistent-type-assertions": "error",
106
- "@typescript-eslint/consistent-type-imports": "error",
107
- "@typescript-eslint/consistent-type-exports": "error",
108
- "@typescript-eslint/no-floating-promises": [
109
- "error",
110
- { ignoreVoid: true },
111
- ],
112
- "@typescript-eslint/no-misused-promises": [
113
- "error",
114
- { checksVoidReturn: false },
115
- ],
116
- "@typescript-eslint/only-throw-error": "error",
117
- "@typescript-eslint/return-await": ["error", "always"],
118
- "@typescript-eslint/explicit-member-accessibility": [
119
- "error",
120
- { accessibility: "no-public" },
121
- ],
122
- "@typescript-eslint/naming-convention": [
123
- "error",
124
- {
125
- selector: "default",
126
- format: ["camelCase"],
127
- },
128
- {
129
- selector: "import",
130
- format: ["camelCase", "PascalCase"],
131
- },
132
- {
133
- selector: "variable",
134
- format: ["camelCase", "snake_case", "UPPER_CASE", "PascalCase"],
135
- leadingUnderscore: "allowSingleOrDouble",
136
- trailingUnderscore: "allowSingleOrDouble",
137
- },
138
- {
139
- selector: "typeLike",
140
- format: ["PascalCase"],
141
- },
142
- {
143
- selector: "enumMember",
144
- format: ["UPPER_CASE", "PascalCase"],
145
- },
146
- ],
147
- "@typescript-eslint/no-restricted-types": [
148
- "error",
149
- {
150
- types: {
151
- Object: { message: "Use object instead", fixWith: "object" },
152
- String: { message: "Use string instead", fixWith: "string" },
153
- Boolean: { message: "Use boolean instead", fixWith: "boolean" },
154
- Number: { message: "Use number instead", fixWith: "number" },
155
- Symbol: { message: "Use symbol instead", fixWith: "symbol" },
156
- Function: {
157
- message:
158
- "The `Function` type accepts any function-like value. Define the explicit function shape.",
159
- },
160
- },
161
- },
162
- ],
163
-
164
- // ******************************************************************
165
- // Stylistic
166
- // ******************************************************************
167
- "@stylistic/member-delimiter-style": [
168
- "error",
169
- {
170
- multiline: { delimiter: "semi", requireLast: true },
171
- singleline: { delimiter: "semi", requireLast: false },
172
- },
173
- ],
174
-
175
- // ******************************************************************
176
- // Import X
177
- // ******************************************************************
178
- "import-x/no-cycle": ["error", { ignoreExternal: false, maxDepth: 3 }],
179
- "import-x/no-default-export": "warn",
180
- "import-x/no-duplicates": "error",
181
- "import-x/order": [
182
- "error",
183
- {
184
- alphabetize: { order: "asc", caseInsensitive: true },
185
- groups: [
186
- ["builtin", "external"],
187
- "internal",
188
- ["parent", "index", "sibling"],
189
- "object",
190
- ],
191
- "newlines-between": "always",
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
  );
@@ -0,0 +1,3 @@
1
+ import { defineConfig } from "eslint/config";
2
+
3
+ export const extend = defineConfig;
@@ -1,62 +1,87 @@
1
1
  import { fixupPluginRules } from "@eslint/compat";
2
- import { baseConfig } from "./base.js";
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 tseslint from "typescript-eslint";
8
-
9
- export const frontendConfig = tseslint.config(
10
- ...baseConfig,
11
-
12
- {
13
- ignores: [
14
- "**/dist/**",
15
- "**/coverage/**",
16
- "**/storybook-static/**",
17
- "**/*.snap",
18
- "**/*.d.ts",
19
- "vite.config.ts",
20
- ],
21
- },
22
-
23
- {
24
- files: ["**/*.ts", "**/*.tsx", "**/*.js", "**/*.jsx"],
25
- languageOptions: {
26
- globals: {
27
- ...globals.browser,
28
- ...globals.serviceworker,
29
- },
30
- },
31
- settings: {
32
- react: {
33
- version: "detect",
34
- },
35
- },
36
- },
37
- reactPlugin.configs.flat.recommended,
38
- reactPlugin.configs.flat["jsx-runtime"],
39
-
40
- {
41
- files: ["**/*.tsx", "**/*.jsx"],
42
- plugins: {
43
- "react-hooks": fixupPluginRules(reactHooksPlugin as any),
44
- "jsx-a11y": fixupPluginRules(jsxA11yPlugin),
45
- },
46
- rules: {
47
- ...reactHooksPlugin.configs.recommended.rules,
48
- ...jsxA11yPlugin.configs.recommended.rules,
49
-
50
- // --- React Hooks Specifics ---
51
- "react-hooks/rules-of-hooks": "error",
52
- "react-hooks/exhaustive-deps": "warn",
53
-
54
- // --- Accessibility Specifics ---
55
- "jsx-a11y/no-autofocus": "warn",
56
- "jsx-a11y/click-events-have-key-events": "warn",
57
- "jsx-a11y/no-static-element-interactions": "warn",
58
- // Disable legacy rule that conflicts with modern HTML5
59
- "jsx-a11y/no-onchange": "off",
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 = tseslint.config(baseConfig, {
6
- languageOptions: {
7
- ecmaVersion: 2024,
8
- globals: globals.node,
9
- },
5
+ export const nodeConfig = defineConfig(baseConfig, {
6
+ languageOptions: {
7
+ ecmaVersion: 2024,
8
+ globals: globals.node,
9
+ },
10
10
  });
@@ -1,5 +1,6 @@
1
1
  import type { ESLint } from "eslint";
2
2
  import { rules } from "./rules/index.js";
3
+
3
4
  const plugin = {
4
5
  configs: {},
5
6
  // @ts-expect-error Rules type does not match for typescript-eslint and eslint
@@ -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 { NoInterpolationInRegularStringRule } from "./no-interpolation-in-regular-string.js";
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 { NoTopLevelRelativeImportsInBackendModuleRule } from "./no-top-level-relative-imports-in-backend-module.js";
12
- import type { AnyRuleModule } from "@typescript-eslint/utils/ts-eslint";
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,