@qlover/create-app 0.1.15 → 0.1.16

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 (112) hide show
  1. package/CHANGELOG.md +33 -27
  2. package/bin/create-app.js +0 -0
  3. package/configs/_common/package.json.template +10 -0
  4. package/configs/react-app/eslint.config.js +70 -42
  5. package/dist/index.cjs +1 -3631
  6. package/dist/index.js +1 -3625
  7. package/package.json +7 -7
  8. package/templates/react-app/.env +1 -0
  9. package/templates/react-app/config/ErrorIdentifier.ts +27 -0
  10. package/templates/react-app/config/app.router.json +9 -0
  11. package/templates/react-app/config/common.ts +12 -0
  12. package/templates/react-app/config/feapi.mock.json +15 -2
  13. package/templates/react-app/config/i18n.ts +3 -11
  14. package/templates/react-app/package.json +7 -4
  15. package/templates/react-app/pnpm-lock.yaml +176 -25
  16. package/templates/react-app/public/locales/en/common.json +6 -2
  17. package/templates/react-app/public/locales/zh/common.json +6 -3
  18. package/templates/react-app/src/App.tsx +8 -8
  19. package/templates/react-app/src/base/apis/AiApi.ts +55 -0
  20. package/templates/react-app/src/base/apis/feApi/FeApi.ts +13 -44
  21. package/templates/react-app/src/base/apis/feApi/FeApiAdapter.ts +14 -0
  22. package/templates/react-app/src/base/apis/feApi/FeApiBootstarp.ts +67 -0
  23. package/templates/react-app/src/base/apis/feApi/FeApiType.ts +2 -35
  24. package/templates/react-app/src/base/apis/userApi/UserApi.ts +64 -0
  25. package/templates/react-app/src/base/apis/userApi/UserApiAdapter.ts +14 -0
  26. package/templates/react-app/src/base/apis/userApi/UserApiBootstarp.ts +75 -0
  27. package/templates/react-app/src/base/apis/userApi/UserApiType.ts +52 -0
  28. package/templates/react-app/src/base/cases/RequestLogger.ts +71 -0
  29. package/templates/react-app/src/base/cases/RequestStatusCatcher.ts +41 -0
  30. package/templates/react-app/src/base/cases/appError/AppError.ts +13 -0
  31. package/templates/react-app/{lib/router-loader/RouterLoader.ts → src/base/cases/router-loader/index.ts} +1 -1
  32. package/templates/react-app/src/base/port/ApiTransactionInterface.ts +7 -0
  33. package/templates/react-app/src/base/port/InversifyIocInterface.ts +1 -1
  34. package/templates/react-app/src/base/port/LoginInterface.ts +4 -0
  35. package/templates/react-app/src/base/port/RequestCatcherInterface.ts +12 -0
  36. package/templates/react-app/src/{services → base/services}/I18nService.ts +7 -2
  37. package/templates/react-app/src/{services/processer → base/services}/ProcesserService.ts +10 -11
  38. package/templates/react-app/src/base/types/Page.ts +1 -13
  39. package/templates/react-app/src/core/AppConfig.ts +14 -5
  40. package/templates/react-app/src/core/IOC.ts +77 -37
  41. package/templates/react-app/src/core/bootstrap.ts +38 -25
  42. package/templates/react-app/src/core/bootstraps/BootstrapApp.ts +7 -0
  43. package/templates/react-app/src/core/bootstraps/index.ts +12 -0
  44. package/templates/react-app/src/core/globals.ts +7 -10
  45. package/templates/react-app/src/core/registers/RegisterApi.ts +1 -52
  46. package/templates/react-app/src/core/registers/RegisterCommon.ts +44 -6
  47. package/templates/react-app/src/core/registers/RegisterControllers.ts +5 -34
  48. package/templates/react-app/src/core/registers/RegisterGlobals.ts +8 -2
  49. package/templates/react-app/src/core/registers/index.ts +2 -1
  50. package/templates/react-app/src/main.tsx +4 -1
  51. package/templates/react-app/src/pages/auth/Layout.tsx +4 -3
  52. package/templates/react-app/src/pages/auth/Login.tsx +5 -3
  53. package/templates/react-app/src/pages/base/ErrorIdentifier.tsx +39 -0
  54. package/templates/react-app/src/pages/base/Executor.tsx +31 -10
  55. package/templates/react-app/src/pages/base/Home.tsx +58 -30
  56. package/templates/react-app/src/pages/base/JSONStorage.tsx +2 -4
  57. package/templates/react-app/src/pages/base/Request.tsx +318 -73
  58. package/templates/react-app/src/pages/base/components/BaseHeader.tsx +2 -2
  59. package/templates/react-app/src/{components → uikit/components}/RouterRenderComponent.tsx +1 -1
  60. package/templates/react-app/src/{components → uikit/components}/ThemeSwitcher.tsx +6 -6
  61. package/templates/react-app/src/uikit/contexts/BaseRouteContext.ts +6 -3
  62. package/templates/react-app/src/uikit/controllers/ExecutorController.ts +52 -22
  63. package/templates/react-app/src/uikit/controllers/JSONStorageController.ts +7 -3
  64. package/templates/react-app/src/uikit/controllers/RequestController.ts +65 -11
  65. package/templates/react-app/src/uikit/controllers/RouterController.ts +8 -7
  66. package/templates/react-app/src/uikit/controllers/UserController.ts +48 -54
  67. package/templates/react-app/src/uikit/hooks/useLanguageGuard.ts +1 -2
  68. package/templates/react-app/src/uikit/providers/ProcessProvider.tsx +4 -4
  69. package/templates/react-app/src/uikit/styles/css/index.css +1 -1
  70. package/templates/react-app/src/uikit/styles/css/page.css +1 -1
  71. package/templates/react-app/tailwind.config.js +2 -2
  72. package/templates/react-app/tsconfig.json +0 -1
  73. package/templates/react-app/tsconfig.node.json +1 -2
  74. package/templates/react-app/vite.config.ts +21 -26
  75. package/templates/react-app/.env.local +0 -24
  76. package/templates/react-app/lib/bootstrap/Bootstrap.ts +0 -36
  77. package/templates/react-app/lib/bootstrap/BootstrapExecutorPlugin.ts +0 -20
  78. package/templates/react-app/lib/bootstrap/IOCContainerInterface.ts +0 -33
  79. package/templates/react-app/lib/bootstrap/IOCManagerInterface.ts +0 -12
  80. package/templates/react-app/lib/bootstrap/index.ts +0 -7
  81. package/templates/react-app/lib/bootstrap/plugins/InjectEnv.ts +0 -61
  82. package/templates/react-app/lib/bootstrap/plugins/InjectGlobal.ts +0 -36
  83. package/templates/react-app/lib/bootstrap/plugins/InjectIOC.ts +0 -24
  84. package/templates/react-app/lib/env-config/injectPkgConfig.ts +0 -11
  85. package/templates/react-app/lib/fe-react-controller/FeController.ts +0 -19
  86. package/templates/react-app/lib/fe-react-controller/index.ts +0 -2
  87. package/templates/react-app/lib/fe-react-controller/useController.ts +0 -71
  88. package/templates/react-app/lib/fe-react-theme/ThemeController.ts +0 -40
  89. package/templates/react-app/lib/fe-react-theme/ThemeStateGetter.ts +0 -53
  90. package/templates/react-app/lib/fe-react-theme/index.ts +0 -3
  91. package/templates/react-app/lib/fe-react-theme/type.ts +0 -21
  92. package/templates/react-app/lib/openAiApi/OpenAIAuthPlugin.ts +0 -29
  93. package/templates/react-app/lib/openAiApi/OpenAIClient.ts +0 -51
  94. package/templates/react-app/lib/openAiApi/StreamProcessor.ts +0 -81
  95. package/templates/react-app/lib/openAiApi/index.ts +0 -3
  96. package/templates/react-app/lib/request-common-plugin/index.ts +0 -169
  97. package/templates/react-app/lib/router-loader/Page.ts +0 -68
  98. package/templates/react-app/lib/tw-root10px/index.css +0 -4
  99. package/templates/react-app/src/base/apis/feApi/FeApiMockPlugin.ts +0 -44
  100. package/templates/react-app/src/base/apis/feApi/index.ts +0 -2
  101. package/templates/react-app/src/base/cases/UserToken.ts +0 -47
  102. package/templates/react-app/src/base/consts/IOCIdentifier.ts +0 -16
  103. package/templates/react-app/src/base/port/IOCFunctionInterface.ts +0 -39
  104. package/templates/react-app/src/base/port/StorageTokenInterface.ts +0 -27
  105. package/templates/react-app/src/core/AppIOCContainer.ts +0 -30
  106. package/templates/react-app/src/uikit/utils/RequestLogger.ts +0 -37
  107. package/templates/react-app/src/uikit/utils/datetime.ts +0 -30
  108. package/templates/react-app/src/uikit/utils/thread.ts +0 -3
  109. /package/templates/react-app/lib/{tw-root10px/index.js → tailwind/root10px.js} +0 -0
  110. /package/templates/react-app/lib/{fe-react-theme/tw-generator.js → tailwind/theme-generator.js} +0 -0
  111. /package/templates/react-app/src/{components → uikit/components}/Loading.tsx +0 -0
  112. /package/templates/react-app/src/{components → uikit/components}/LocaleLink.tsx +0 -0
package/CHANGELOG.md CHANGED
@@ -1,32 +1,45 @@
1
+ ## 0.1.16
1
2
 
3
+ ### Patch Changes
2
4
 
3
- ## 0.1.15 (2025-04-17)
5
+ - ### Bug Fixes
4
6
 
7
+ - .gitignore no file ([#207](https://github.com/qlover/fe-base/issues/207)) ([e61d468](https://github.com/qlover/fe-base/commit/e61d4683a072048326205272d927e7e67b87ba70))
8
+ - add pnpm install ([#248](https://github.com/qlover/fe-base/issues/248)) ([e1e9f48](https://github.com/qlover/fe-base/commit/e1e9f4841365c51e9b8ea7b01ac6fc70e35eec37))
9
+ - release publish npm ([#327](https://github.com/qlover/fe-base/issues/327)) ([fa26d04](https://github.com/qlover/fe-base/commit/fa26d04eab2fa1ea4baa05c4d3502e5a873d5c8c))
5
10
 
6
- ### Features
11
+ ### Features
7
12
 
8
- * add inversify ioc ([#270](https://github.com/qlover/fe-base/issues/270)) ([8c7ba06](https://github.com/qlover/fe-base/commit/8c7ba06bc5bef63d85c59a94737afac9be59138f))
9
- * add script-context ([#213](https://github.com/qlover/fe-base/issues/213)) ([e021441](https://github.com/qlover/fe-base/commit/e021441180d4c4bd89947b155d39224f89699fda))
10
- * create app v0.1 ([#209](https://github.com/qlover/fe-base/issues/209)) ([b730d76](https://github.com/qlover/fe-base/commit/b730d76512a9e1ce765ec77145abfe179b585178))
11
- * feature yarn to pnpm ([#297](https://github.com/qlover/fe-base/issues/297)) ([c3e13d5](https://github.com/qlover/fe-base/commit/c3e13d509a752267d9be29e7a5ed609d24c309ce))
12
- * optz create-app deep ([#244](https://github.com/qlover/fe-base/issues/244)) ([c0a89ef](https://github.com/qlover/fe-base/commit/c0a89ef5dc2f3cc216b4fc1968b1b626c58947d5))
13
- * template context ([#241](https://github.com/qlover/fe-base/issues/241)) ([9fb3046](https://github.com/qlover/fe-base/commit/9fb3046e3e67c02e5fe4fea81a9a3ef8422e3013))
13
+ - add inversify ioc ([#270](https://github.com/qlover/fe-base/issues/270)) ([8c7ba06](https://github.com/qlover/fe-base/commit/8c7ba06bc5bef63d85c59a94737afac9be59138f))
14
+ - add script-context ([#213](https://github.com/qlover/fe-base/issues/213)) ([e021441](https://github.com/qlover/fe-base/commit/e021441180d4c4bd89947b155d39224f89699fda))
15
+ - feature yarn to pnpm ([#297](https://github.com/qlover/fe-base/issues/297)) ([c3e13d5](https://github.com/qlover/fe-base/commit/c3e13d509a752267d9be29e7a5ed609d24c309ce))
16
+ - optz create-app deep ([#244](https://github.com/qlover/fe-base/issues/244)) ([c0a89ef](https://github.com/qlover/fe-base/commit/c0a89ef5dc2f3cc216b4fc1968b1b626c58947d5))
17
+ - template context ([#241](https://github.com/qlover/fe-base/issues/241)) ([9fb3046](https://github.com/qlover/fe-base/commit/9fb3046e3e67c02e5fe4fea81a9a3ef8422e3013))
14
18
 
19
+ ## 0.1.15 (2025-04-17)
20
+
21
+ ### Features
22
+
23
+ - add inversify ioc ([#270](https://github.com/qlover/fe-base/issues/270)) ([8c7ba06](https://github.com/qlover/fe-base/commit/8c7ba06bc5bef63d85c59a94737afac9be59138f))
24
+ - add script-context ([#213](https://github.com/qlover/fe-base/issues/213)) ([e021441](https://github.com/qlover/fe-base/commit/e021441180d4c4bd89947b155d39224f89699fda))
25
+ - create app v0.1 ([#209](https://github.com/qlover/fe-base/issues/209)) ([b730d76](https://github.com/qlover/fe-base/commit/b730d76512a9e1ce765ec77145abfe179b585178))
26
+ - feature yarn to pnpm ([#297](https://github.com/qlover/fe-base/issues/297)) ([c3e13d5](https://github.com/qlover/fe-base/commit/c3e13d509a752267d9be29e7a5ed609d24c309ce))
27
+ - optz create-app deep ([#244](https://github.com/qlover/fe-base/issues/244)) ([c0a89ef](https://github.com/qlover/fe-base/commit/c0a89ef5dc2f3cc216b4fc1968b1b626c58947d5))
28
+ - template context ([#241](https://github.com/qlover/fe-base/issues/241)) ([9fb3046](https://github.com/qlover/fe-base/commit/9fb3046e3e67c02e5fe4fea81a9a3ef8422e3013))
15
29
 
16
30
  ### Bug Fixes
17
31
 
18
- * .gitignore no file ([#207](https://github.com/qlover/fe-base/issues/207)) ([e61d468](https://github.com/qlover/fe-base/commit/e61d4683a072048326205272d927e7e67b87ba70))
19
- * add pnpm install ([#248](https://github.com/qlover/fe-base/issues/248)) ([e1e9f48](https://github.com/qlover/fe-base/commit/e1e9f4841365c51e9b8ea7b01ac6fc70e35eec37))
20
- * release publish npm ([#327](https://github.com/qlover/fe-base/issues/327)) ([fa26d04](https://github.com/qlover/fe-base/commit/fa26d04eab2fa1ea4baa05c4d3502e5a873d5c8c))
32
+ - .gitignore no file ([#207](https://github.com/qlover/fe-base/issues/207)) ([e61d468](https://github.com/qlover/fe-base/commit/e61d4683a072048326205272d927e7e67b87ba70))
33
+ - add pnpm install ([#248](https://github.com/qlover/fe-base/issues/248)) ([e1e9f48](https://github.com/qlover/fe-base/commit/e1e9f4841365c51e9b8ea7b01ac6fc70e35eec37))
34
+ - release publish npm ([#327](https://github.com/qlover/fe-base/issues/327)) ([fa26d04](https://github.com/qlover/fe-base/commit/fa26d04eab2fa1ea4baa05c4d3502e5a873d5c8c))
21
35
 
22
36
  ## 0.1.14 (2025-04-17)
23
37
 
24
38
  ## [0.1.12](https://github.com/qlover/fe-base/compare/create-app-v0.1.11...create-app-v0.1.12) (2025-03-18)
25
39
 
26
-
27
40
  ### Features
28
41
 
29
- * add inversify ioc ([#270](https://github.com/qlover/fe-base/issues/270)) ([8c7ba06](https://github.com/qlover/fe-base/commit/8c7ba06bc5bef63d85c59a94737afac9be59138f))
42
+ - add inversify ioc ([#270](https://github.com/qlover/fe-base/issues/270)) ([8c7ba06](https://github.com/qlover/fe-base/commit/8c7ba06bc5bef63d85c59a94737afac9be59138f))
30
43
 
31
44
  ## [0.1.11](https://github.com/qlover/fe-base/compare/create-app-v0.1.10...create-app-v0.1.11) (2025-03-12)
32
45
 
@@ -34,26 +47,23 @@
34
47
 
35
48
  ## [0.1.9](https://github.com/qlover/fe-base/compare/create-app-v0.1.8...create-app-v0.1.9) (2025-02-20)
36
49
 
37
-
38
50
  ### Bug Fixes
39
51
 
40
- * add pnpm install ([#248](https://github.com/qlover/fe-base/issues/248)) ([e1e9f48](https://github.com/qlover/fe-base/commit/e1e9f4841365c51e9b8ea7b01ac6fc70e35eec37))
52
+ - add pnpm install ([#248](https://github.com/qlover/fe-base/issues/248)) ([e1e9f48](https://github.com/qlover/fe-base/commit/e1e9f4841365c51e9b8ea7b01ac6fc70e35eec37))
41
53
 
42
54
  ## [0.1.8](https://github.com/qlover/fe-base/compare/create-app-v0.1.7...create-app-v0.1.8) (2025-02-19)
43
55
 
44
56
  ## [0.1.7](https://github.com/qlover/fe-base/compare/create-app-v0.1.6...create-app-v0.1.7) (2025-02-19)
45
57
 
46
-
47
58
  ### Features
48
59
 
49
- * optz create-app deep ([#244](https://github.com/qlover/fe-base/issues/244)) ([c0a89ef](https://github.com/qlover/fe-base/commit/c0a89ef5dc2f3cc216b4fc1968b1b626c58947d5))
60
+ - optz create-app deep ([#244](https://github.com/qlover/fe-base/issues/244)) ([c0a89ef](https://github.com/qlover/fe-base/commit/c0a89ef5dc2f3cc216b4fc1968b1b626c58947d5))
50
61
 
51
62
  ## [0.1.6](https://github.com/qlover/fe-base/compare/create-app-v0.1.5...create-app-v0.1.6) (2025-02-14)
52
63
 
53
-
54
64
  ### Features
55
65
 
56
- * template context ([#241](https://github.com/qlover/fe-base/issues/241)) ([9fb3046](https://github.com/qlover/fe-base/commit/9fb3046e3e67c02e5fe4fea81a9a3ef8422e3013))
66
+ - template context ([#241](https://github.com/qlover/fe-base/issues/241)) ([9fb3046](https://github.com/qlover/fe-base/commit/9fb3046e3e67c02e5fe4fea81a9a3ef8422e3013))
57
67
 
58
68
  ## [0.1.5](https://github.com/qlover/fe-base/compare/create-app-v0.1.4...create-app-v0.1.5) (2025-02-13)
59
69
 
@@ -63,30 +73,26 @@
63
73
 
64
74
  ## [0.1.2](https://github.com/qlover/fe-base/compare/create-app-v0.1.1...create-app-v0.1.2) (2025-01-17)
65
75
 
66
-
67
76
  ### Features
68
77
 
69
- * add script-context ([#213](https://github.com/qlover/fe-base/issues/213)) ([e021441](https://github.com/qlover/fe-base/commit/e021441180d4c4bd89947b155d39224f89699fda))
78
+ - add script-context ([#213](https://github.com/qlover/fe-base/issues/213)) ([e021441](https://github.com/qlover/fe-base/commit/e021441180d4c4bd89947b155d39224f89699fda))
70
79
 
71
80
  ## [0.1.1](https://github.com/qlover/fe-base/compare/create-app-v0.0.4...create-app-v0.1.1) (2025-01-15)
72
81
 
73
-
74
82
  ### Features
75
83
 
76
- * create app v0.1 ([#209](https://github.com/qlover/fe-base/issues/209)) ([b730d76](https://github.com/qlover/fe-base/commit/b730d76512a9e1ce765ec77145abfe179b585178))
84
+ - create app v0.1 ([#209](https://github.com/qlover/fe-base/issues/209)) ([b730d76](https://github.com/qlover/fe-base/commit/b730d76512a9e1ce765ec77145abfe179b585178))
77
85
 
78
86
  ## [0.0.4](https://github.com/qlover/fe-base/compare/create-app-v0.0.3...create-app-v0.0.4) (2025-01-15)
79
87
 
80
-
81
88
  ### Bug Fixes
82
89
 
83
- * .gitignore no file ([#207](https://github.com/qlover/fe-base/issues/207)) ([e61d468](https://github.com/qlover/fe-base/commit/e61d4683a072048326205272d927e7e67b87ba70))
90
+ - .gitignore no file ([#207](https://github.com/qlover/fe-base/issues/207)) ([e61d468](https://github.com/qlover/fe-base/commit/e61d4683a072048326205272d927e7e67b87ba70))
84
91
 
85
92
  ## 0.0.1 (2025-01-14)
86
93
 
87
94
  ## 0.0.2 (2025-01-14)
88
95
 
89
-
90
96
  ### Features
91
97
 
92
- * create fe app ([#200](https://github.com/qlover/fe-base/issues/200)) ([8d3668f](https://github.com/qlover/fe-base/commit/8d3668f0e69a579994a72fc7b36b5ba7d5633c70))
98
+ - create fe app ([#200](https://github.com/qlover/fe-base/issues/200)) ([8d3668f](https://github.com/qlover/fe-base/commit/8d3668f0e69a579994a72fc7b36b5ba7d5633c70))
package/bin/create-app.js CHANGED
File without changes
@@ -50,14 +50,24 @@
50
50
  "release:[TPL:projectName]": "release-it"
51
51
  },
52
52
  "devDependencies": {
53
+ "@eslint/js": "^9.11.1",
53
54
  "@qlover/env-loader": "latest",
54
55
  "@qlover/fe-standard": "latest",
55
56
  "@qlover/fe-scripts": "latest",
56
57
  "@qlover/scripts-context": "latest",
57
58
  "@commitlint/cli": "^19.7.1",
58
59
  "@commitlint/config-conventional": "^19.7.1",
60
+ "eslint": "^9.15.0",
61
+ "eslint-plugin-prettier": "^5.2.3",
62
+ "eslint-plugin-react": "^7.37.4",
63
+ "eslint-plugin-react-hooks": "^5.0.0",
64
+ "eslint-plugin-react-refresh": "^0.4.14",
65
+ "eslint-plugin-vitest": "^0.5.4",
66
+ "globals": "^15.12.0",
59
67
  "husky": "^9.1.7",
60
68
  "lint-staged": "^15.0.0",
69
+ "postcss": "^8.4.49",
70
+ "prettier": "^3.5.3",
61
71
  },
62
72
  "dependencies": {
63
73
  "@qlover/fe-utils": "latest"
@@ -1,66 +1,94 @@
1
1
  import js from '@eslint/js';
2
2
  import globals from 'globals';
3
- import react from 'eslint-plugin-react';
3
+ import vitest from 'eslint-plugin-vitest';
4
+ import * as eslintChain from '@qlover/fe-standard/eslint/index.js';
5
+ import * as feDev from '@qlover/eslint-plugin-fe-dev';
4
6
  import reactHooks from 'eslint-plugin-react-hooks';
5
7
  import reactRefresh from 'eslint-plugin-react-refresh';
6
8
  import tseslint from 'typescript-eslint';
7
- import tsparser from '@typescript-eslint/parser';
8
- import * as feDev from '@qlover/eslint-plugin-fe-dev';
9
9
  import prettier from 'eslint-plugin-prettier';
10
10
  import prettierConfig from './.prettierrc.js';
11
11
 
12
- export default tseslint.config(
13
- { ignores: ['dist', 'node_modules'] },
14
- {
15
- extends: [js.configs.recommended, ...tseslint.configs.recommended],
16
- files: ['src/**/*.{ts,tsx}'],
12
+ const { createCommon, chainEnv } = eslintChain;
13
+ const allGlobals = {
14
+ ...globals.browser,
15
+ ...globals.vitest,
16
+ ...vitest.environments.env.globals
17
+ };
18
+
19
+ function createVitestConfig() {
20
+ const config = chainEnv({
21
+ allGlobals,
22
+ files: [
23
+ 'packages/**/__tests__/**/*.test.ts',
24
+ 'packages/**/__tests__/**/*.test.tsx'
25
+ ],
26
+ plugins: {
27
+ vitest
28
+ },
17
29
  languageOptions: {
18
- parser: tsparser,
19
- ecmaVersion: 2020,
20
30
  globals: {
21
31
  ...globals.browser,
22
- ...globals.node
23
- },
24
- parserOptions: {
25
- ecmaVersion: 'latest',
26
- ecmaFeatures: { jsx: true },
27
- sourceType: 'module',
28
- project: './tsconfig.json'
32
+ ...globals.node,
33
+ ...vitest.environments.env.globals
29
34
  }
35
+ }
36
+ });
37
+ return config;
38
+ }
39
+
40
+ const commonConfig = createCommon();
41
+
42
+ /**
43
+ * @type {import('eslint').Linter.Config[]}
44
+ */
45
+ export default tseslint.config([
46
+ {
47
+ ignores: ['**/dist/**', '**/build/**', '**/node_modules/**']
48
+ },
49
+
50
+ {
51
+ files: ['**/*.{js,jsx}'],
52
+ extends: [js.configs.recommended, commonConfig],
53
+ plugins: {
54
+ prettier: prettier
55
+ },
56
+ rules: {
57
+ ...js.configs.recommended.rules,
58
+ 'prettier/prettier': ['error', prettierConfig],
59
+ 'spaced-comment': 'error'
60
+ }
61
+ },
62
+
63
+ {
64
+ files: ['**/*.{ts,tsx}'],
65
+ extends: [...tseslint.configs.recommended],
66
+
67
+ languageOptions: {
68
+ ecmaVersion: 2020,
69
+ globals: globals.browser
30
70
  },
31
- settings: { react: { version: '18.3' } },
32
71
  plugins: {
33
- react,
34
72
  'react-hooks': reactHooks,
35
73
  'react-refresh': reactRefresh,
36
- prettier,
37
- '@typescript-eslint': tseslint,
38
74
  'fe-dev': feDev
39
75
  },
40
76
  rules: {
41
- ...js.configs.recommended.rules,
42
- ...react.configs.recommended.rules,
43
- ...react.configs['jsx-runtime'].rules,
77
+ 'fe-dev/ts-class-method-return': 'error',
78
+ '@typescript-eslint/explicit-function-return-type': 'off',
79
+ '@typescript-eslint/no-empty-object-type': 'off',
80
+ '@typescript-eslint/no-unused-vars': [
81
+ 'error',
82
+ { argsIgnorePattern: '^_' }
83
+ ],
84
+ '@typescript-eslint/ban-ts-comment': 'off',
44
85
  ...reactHooks.configs.recommended.rules,
45
- ...tseslint.configs.recommended.rules,
46
- 'react/jsx-no-target-blank': 'off',
47
- 'react/prefer-stateless-function': 'error',
48
86
  'react-refresh/only-export-components': [
49
87
  'warn',
50
88
  { allowConstantExport: true }
51
- ],
52
- '@typescript-eslint/no-explicit-any': 'error',
53
- 'prettier/prettier': ['error', prettierConfig],
54
- '@typescript-eslint/ban-ts-comment': [
55
- 'off',
56
- {
57
- 'ts-expect-error': {
58
- descriptionFormat: '^.*$'
59
- }
60
- }
61
- ],
62
- 'react-hooks/exhaustive-deps': 'off',
63
- 'fe-dev/ts-class-method-return': 'error'
89
+ ]
64
90
  }
65
- }
66
- );
91
+ },
92
+
93
+ createVitestConfig()
94
+ ]);