@qlover/create-app 0.1.15 → 0.1.17

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 (115) hide show
  1. package/CHANGELOG.md +39 -27
  2. package/bin/create-app.js +0 -0
  3. package/configs/_common/package.json.template +11 -1
  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 +8 -8
  8. package/templates/node-lib/package.json +1 -1
  9. package/templates/pack-app/package.json +1 -1
  10. package/templates/react-app/.env +1 -0
  11. package/templates/react-app/README.md +0 -1
  12. package/templates/react-app/config/ErrorIdentifier.ts +27 -0
  13. package/templates/react-app/config/app.router.json +9 -0
  14. package/templates/react-app/config/common.ts +12 -0
  15. package/templates/react-app/config/feapi.mock.json +15 -2
  16. package/templates/react-app/config/i18n.ts +3 -11
  17. package/templates/react-app/package.json +7 -4
  18. package/templates/react-app/public/locales/en/common.json +6 -2
  19. package/templates/react-app/public/locales/zh/common.json +6 -3
  20. package/templates/react-app/src/App.tsx +8 -8
  21. package/templates/react-app/src/base/apis/AiApi.ts +55 -0
  22. package/templates/react-app/src/base/apis/feApi/FeApi.ts +13 -44
  23. package/templates/react-app/src/base/apis/feApi/FeApiAdapter.ts +14 -0
  24. package/templates/react-app/src/base/apis/feApi/FeApiBootstarp.ts +67 -0
  25. package/templates/react-app/src/base/apis/feApi/FeApiType.ts +2 -35
  26. package/templates/react-app/src/base/apis/userApi/UserApi.ts +64 -0
  27. package/templates/react-app/src/base/apis/userApi/UserApiAdapter.ts +14 -0
  28. package/templates/react-app/src/base/apis/userApi/UserApiBootstarp.ts +75 -0
  29. package/templates/react-app/src/base/apis/userApi/UserApiType.ts +52 -0
  30. package/templates/react-app/src/base/cases/RequestLogger.ts +71 -0
  31. package/templates/react-app/src/base/cases/RequestStatusCatcher.ts +41 -0
  32. package/templates/react-app/src/base/cases/appError/AppError.ts +13 -0
  33. package/templates/react-app/{lib/router-loader/RouterLoader.ts → src/base/cases/router-loader/index.ts} +1 -1
  34. package/templates/react-app/src/base/port/ApiTransactionInterface.ts +7 -0
  35. package/templates/react-app/src/base/port/InversifyIocInterface.ts +1 -1
  36. package/templates/react-app/src/base/port/LoginInterface.ts +4 -0
  37. package/templates/react-app/src/base/port/RequestCatcherInterface.ts +12 -0
  38. package/templates/react-app/src/{services → base/services}/I18nService.ts +7 -2
  39. package/templates/react-app/src/{services/processer → base/services}/ProcesserService.ts +10 -11
  40. package/templates/react-app/src/base/types/Page.ts +1 -13
  41. package/templates/react-app/src/core/AppConfig.ts +14 -5
  42. package/templates/react-app/src/core/IOC.ts +77 -37
  43. package/templates/react-app/src/core/bootstrap.ts +38 -25
  44. package/templates/react-app/src/core/bootstraps/BootstrapApp.ts +7 -0
  45. package/templates/react-app/src/core/bootstraps/index.ts +12 -0
  46. package/templates/react-app/src/core/globals.ts +7 -10
  47. package/templates/react-app/src/core/registers/RegisterApi.ts +1 -52
  48. package/templates/react-app/src/core/registers/RegisterCommon.ts +44 -6
  49. package/templates/react-app/src/core/registers/RegisterControllers.ts +5 -34
  50. package/templates/react-app/src/core/registers/RegisterGlobals.ts +8 -2
  51. package/templates/react-app/src/core/registers/index.ts +2 -1
  52. package/templates/react-app/src/main.tsx +4 -1
  53. package/templates/react-app/src/pages/auth/Layout.tsx +4 -3
  54. package/templates/react-app/src/pages/auth/Login.tsx +5 -3
  55. package/templates/react-app/src/pages/base/ErrorIdentifier.tsx +39 -0
  56. package/templates/react-app/src/pages/base/Executor.tsx +31 -10
  57. package/templates/react-app/src/pages/base/Home.tsx +58 -30
  58. package/templates/react-app/src/pages/base/JSONStorage.tsx +2 -4
  59. package/templates/react-app/src/pages/base/Request.tsx +318 -73
  60. package/templates/react-app/src/pages/base/components/BaseHeader.tsx +2 -2
  61. package/templates/react-app/src/{components → uikit/components}/RouterRenderComponent.tsx +1 -1
  62. package/templates/react-app/src/{components → uikit/components}/ThemeSwitcher.tsx +6 -6
  63. package/templates/react-app/src/uikit/contexts/BaseRouteContext.ts +6 -3
  64. package/templates/react-app/src/uikit/controllers/ExecutorController.ts +52 -22
  65. package/templates/react-app/src/uikit/controllers/JSONStorageController.ts +7 -3
  66. package/templates/react-app/src/uikit/controllers/RequestController.ts +65 -11
  67. package/templates/react-app/src/uikit/controllers/RouterController.ts +8 -7
  68. package/templates/react-app/src/uikit/controllers/UserController.ts +48 -54
  69. package/templates/react-app/src/uikit/hooks/useLanguageGuard.ts +1 -2
  70. package/templates/react-app/src/uikit/providers/ProcessProvider.tsx +4 -4
  71. package/templates/react-app/src/uikit/styles/css/index.css +1 -1
  72. package/templates/react-app/src/uikit/styles/css/page.css +1 -1
  73. package/templates/react-app/tailwind.config.js +2 -2
  74. package/templates/react-app/tsconfig.json +0 -1
  75. package/templates/react-app/tsconfig.node.json +1 -2
  76. package/templates/react-app/vite.config.ts +21 -26
  77. package/templates/react-app/.env.local +0 -24
  78. package/templates/react-app/lib/bootstrap/Bootstrap.ts +0 -36
  79. package/templates/react-app/lib/bootstrap/BootstrapExecutorPlugin.ts +0 -20
  80. package/templates/react-app/lib/bootstrap/IOCContainerInterface.ts +0 -33
  81. package/templates/react-app/lib/bootstrap/IOCManagerInterface.ts +0 -12
  82. package/templates/react-app/lib/bootstrap/index.ts +0 -7
  83. package/templates/react-app/lib/bootstrap/plugins/InjectEnv.ts +0 -61
  84. package/templates/react-app/lib/bootstrap/plugins/InjectGlobal.ts +0 -36
  85. package/templates/react-app/lib/bootstrap/plugins/InjectIOC.ts +0 -24
  86. package/templates/react-app/lib/env-config/injectPkgConfig.ts +0 -11
  87. package/templates/react-app/lib/fe-react-controller/FeController.ts +0 -19
  88. package/templates/react-app/lib/fe-react-controller/index.ts +0 -2
  89. package/templates/react-app/lib/fe-react-controller/useController.ts +0 -71
  90. package/templates/react-app/lib/fe-react-theme/ThemeController.ts +0 -40
  91. package/templates/react-app/lib/fe-react-theme/ThemeStateGetter.ts +0 -53
  92. package/templates/react-app/lib/fe-react-theme/index.ts +0 -3
  93. package/templates/react-app/lib/fe-react-theme/type.ts +0 -21
  94. package/templates/react-app/lib/openAiApi/OpenAIAuthPlugin.ts +0 -29
  95. package/templates/react-app/lib/openAiApi/OpenAIClient.ts +0 -51
  96. package/templates/react-app/lib/openAiApi/StreamProcessor.ts +0 -81
  97. package/templates/react-app/lib/openAiApi/index.ts +0 -3
  98. package/templates/react-app/lib/request-common-plugin/index.ts +0 -169
  99. package/templates/react-app/lib/router-loader/Page.ts +0 -68
  100. package/templates/react-app/lib/tw-root10px/index.css +0 -4
  101. package/templates/react-app/pnpm-lock.yaml +0 -5892
  102. package/templates/react-app/src/base/apis/feApi/FeApiMockPlugin.ts +0 -44
  103. package/templates/react-app/src/base/apis/feApi/index.ts +0 -2
  104. package/templates/react-app/src/base/cases/UserToken.ts +0 -47
  105. package/templates/react-app/src/base/consts/IOCIdentifier.ts +0 -16
  106. package/templates/react-app/src/base/port/IOCFunctionInterface.ts +0 -39
  107. package/templates/react-app/src/base/port/StorageTokenInterface.ts +0 -27
  108. package/templates/react-app/src/core/AppIOCContainer.ts +0 -30
  109. package/templates/react-app/src/uikit/utils/RequestLogger.ts +0 -37
  110. package/templates/react-app/src/uikit/utils/datetime.ts +0 -30
  111. package/templates/react-app/src/uikit/utils/thread.ts +0 -3
  112. /package/templates/react-app/lib/{tw-root10px/index.js → tailwind/root10px.js} +0 -0
  113. /package/templates/react-app/lib/{fe-react-theme/tw-generator.js → tailwind/theme-generator.js} +0 -0
  114. /package/templates/react-app/src/{components → uikit/components}/Loading.tsx +0 -0
  115. /package/templates/react-app/src/{components → uikit/components}/LocaleLink.tsx +0 -0
package/CHANGELOG.md CHANGED
@@ -1,32 +1,51 @@
1
+ ## 0.1.16
1
2
 
3
+ ## 0.1.17
2
4
 
3
- ## 0.1.15 (2025-04-17)
5
+ ### Patch Changes
4
6
 
7
+ -
5
8
 
6
- ### Features
9
+ ### Patch Changes
10
+
11
+ - ### Bug Fixes
12
+
13
+ - .gitignore no file ([#207](https://github.com/qlover/fe-base/issues/207)) ([e61d468](https://github.com/qlover/fe-base/commit/e61d4683a072048326205272d927e7e67b87ba70))
14
+ - add pnpm install ([#248](https://github.com/qlover/fe-base/issues/248)) ([e1e9f48](https://github.com/qlover/fe-base/commit/e1e9f4841365c51e9b8ea7b01ac6fc70e35eec37))
15
+ - release publish npm ([#327](https://github.com/qlover/fe-base/issues/327)) ([fa26d04](https://github.com/qlover/fe-base/commit/fa26d04eab2fa1ea4baa05c4d3502e5a873d5c8c))
16
+
17
+ ### Features
7
18
 
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))
19
+ - add inversify ioc ([#270](https://github.com/qlover/fe-base/issues/270)) ([8c7ba06](https://github.com/qlover/fe-base/commit/8c7ba06bc5bef63d85c59a94737afac9be59138f))
20
+ - add script-context ([#213](https://github.com/qlover/fe-base/issues/213)) ([e021441](https://github.com/qlover/fe-base/commit/e021441180d4c4bd89947b155d39224f89699fda))
21
+ - feature yarn to pnpm ([#297](https://github.com/qlover/fe-base/issues/297)) ([c3e13d5](https://github.com/qlover/fe-base/commit/c3e13d509a752267d9be29e7a5ed609d24c309ce))
22
+ - optz create-app deep ([#244](https://github.com/qlover/fe-base/issues/244)) ([c0a89ef](https://github.com/qlover/fe-base/commit/c0a89ef5dc2f3cc216b4fc1968b1b626c58947d5))
23
+ - template context ([#241](https://github.com/qlover/fe-base/issues/241)) ([9fb3046](https://github.com/qlover/fe-base/commit/9fb3046e3e67c02e5fe4fea81a9a3ef8422e3013))
24
+
25
+ ## 0.1.15 (2025-04-17)
26
+
27
+ ### Features
14
28
 
29
+ - add inversify ioc ([#270](https://github.com/qlover/fe-base/issues/270)) ([8c7ba06](https://github.com/qlover/fe-base/commit/8c7ba06bc5bef63d85c59a94737afac9be59138f))
30
+ - add script-context ([#213](https://github.com/qlover/fe-base/issues/213)) ([e021441](https://github.com/qlover/fe-base/commit/e021441180d4c4bd89947b155d39224f89699fda))
31
+ - create app v0.1 ([#209](https://github.com/qlover/fe-base/issues/209)) ([b730d76](https://github.com/qlover/fe-base/commit/b730d76512a9e1ce765ec77145abfe179b585178))
32
+ - feature yarn to pnpm ([#297](https://github.com/qlover/fe-base/issues/297)) ([c3e13d5](https://github.com/qlover/fe-base/commit/c3e13d509a752267d9be29e7a5ed609d24c309ce))
33
+ - optz create-app deep ([#244](https://github.com/qlover/fe-base/issues/244)) ([c0a89ef](https://github.com/qlover/fe-base/commit/c0a89ef5dc2f3cc216b4fc1968b1b626c58947d5))
34
+ - template context ([#241](https://github.com/qlover/fe-base/issues/241)) ([9fb3046](https://github.com/qlover/fe-base/commit/9fb3046e3e67c02e5fe4fea81a9a3ef8422e3013))
15
35
 
16
36
  ### Bug Fixes
17
37
 
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))
38
+ - .gitignore no file ([#207](https://github.com/qlover/fe-base/issues/207)) ([e61d468](https://github.com/qlover/fe-base/commit/e61d4683a072048326205272d927e7e67b87ba70))
39
+ - add pnpm install ([#248](https://github.com/qlover/fe-base/issues/248)) ([e1e9f48](https://github.com/qlover/fe-base/commit/e1e9f4841365c51e9b8ea7b01ac6fc70e35eec37))
40
+ - release publish npm ([#327](https://github.com/qlover/fe-base/issues/327)) ([fa26d04](https://github.com/qlover/fe-base/commit/fa26d04eab2fa1ea4baa05c4d3502e5a873d5c8c))
21
41
 
22
42
  ## 0.1.14 (2025-04-17)
23
43
 
24
44
  ## [0.1.12](https://github.com/qlover/fe-base/compare/create-app-v0.1.11...create-app-v0.1.12) (2025-03-18)
25
45
 
26
-
27
46
  ### Features
28
47
 
29
- * add inversify ioc ([#270](https://github.com/qlover/fe-base/issues/270)) ([8c7ba06](https://github.com/qlover/fe-base/commit/8c7ba06bc5bef63d85c59a94737afac9be59138f))
48
+ - add inversify ioc ([#270](https://github.com/qlover/fe-base/issues/270)) ([8c7ba06](https://github.com/qlover/fe-base/commit/8c7ba06bc5bef63d85c59a94737afac9be59138f))
30
49
 
31
50
  ## [0.1.11](https://github.com/qlover/fe-base/compare/create-app-v0.1.10...create-app-v0.1.11) (2025-03-12)
32
51
 
@@ -34,26 +53,23 @@
34
53
 
35
54
  ## [0.1.9](https://github.com/qlover/fe-base/compare/create-app-v0.1.8...create-app-v0.1.9) (2025-02-20)
36
55
 
37
-
38
56
  ### Bug Fixes
39
57
 
40
- * add pnpm install ([#248](https://github.com/qlover/fe-base/issues/248)) ([e1e9f48](https://github.com/qlover/fe-base/commit/e1e9f4841365c51e9b8ea7b01ac6fc70e35eec37))
58
+ - add pnpm install ([#248](https://github.com/qlover/fe-base/issues/248)) ([e1e9f48](https://github.com/qlover/fe-base/commit/e1e9f4841365c51e9b8ea7b01ac6fc70e35eec37))
41
59
 
42
60
  ## [0.1.8](https://github.com/qlover/fe-base/compare/create-app-v0.1.7...create-app-v0.1.8) (2025-02-19)
43
61
 
44
62
  ## [0.1.7](https://github.com/qlover/fe-base/compare/create-app-v0.1.6...create-app-v0.1.7) (2025-02-19)
45
63
 
46
-
47
64
  ### Features
48
65
 
49
- * optz create-app deep ([#244](https://github.com/qlover/fe-base/issues/244)) ([c0a89ef](https://github.com/qlover/fe-base/commit/c0a89ef5dc2f3cc216b4fc1968b1b626c58947d5))
66
+ - optz create-app deep ([#244](https://github.com/qlover/fe-base/issues/244)) ([c0a89ef](https://github.com/qlover/fe-base/commit/c0a89ef5dc2f3cc216b4fc1968b1b626c58947d5))
50
67
 
51
68
  ## [0.1.6](https://github.com/qlover/fe-base/compare/create-app-v0.1.5...create-app-v0.1.6) (2025-02-14)
52
69
 
53
-
54
70
  ### Features
55
71
 
56
- * template context ([#241](https://github.com/qlover/fe-base/issues/241)) ([9fb3046](https://github.com/qlover/fe-base/commit/9fb3046e3e67c02e5fe4fea81a9a3ef8422e3013))
72
+ - template context ([#241](https://github.com/qlover/fe-base/issues/241)) ([9fb3046](https://github.com/qlover/fe-base/commit/9fb3046e3e67c02e5fe4fea81a9a3ef8422e3013))
57
73
 
58
74
  ## [0.1.5](https://github.com/qlover/fe-base/compare/create-app-v0.1.4...create-app-v0.1.5) (2025-02-13)
59
75
 
@@ -63,30 +79,26 @@
63
79
 
64
80
  ## [0.1.2](https://github.com/qlover/fe-base/compare/create-app-v0.1.1...create-app-v0.1.2) (2025-01-17)
65
81
 
66
-
67
82
  ### Features
68
83
 
69
- * add script-context ([#213](https://github.com/qlover/fe-base/issues/213)) ([e021441](https://github.com/qlover/fe-base/commit/e021441180d4c4bd89947b155d39224f89699fda))
84
+ - add script-context ([#213](https://github.com/qlover/fe-base/issues/213)) ([e021441](https://github.com/qlover/fe-base/commit/e021441180d4c4bd89947b155d39224f89699fda))
70
85
 
71
86
  ## [0.1.1](https://github.com/qlover/fe-base/compare/create-app-v0.0.4...create-app-v0.1.1) (2025-01-15)
72
87
 
73
-
74
88
  ### Features
75
89
 
76
- * create app v0.1 ([#209](https://github.com/qlover/fe-base/issues/209)) ([b730d76](https://github.com/qlover/fe-base/commit/b730d76512a9e1ce765ec77145abfe179b585178))
90
+ - create app v0.1 ([#209](https://github.com/qlover/fe-base/issues/209)) ([b730d76](https://github.com/qlover/fe-base/commit/b730d76512a9e1ce765ec77145abfe179b585178))
77
91
 
78
92
  ## [0.0.4](https://github.com/qlover/fe-base/compare/create-app-v0.0.3...create-app-v0.0.4) (2025-01-15)
79
93
 
80
-
81
94
  ### Bug Fixes
82
95
 
83
- * .gitignore no file ([#207](https://github.com/qlover/fe-base/issues/207)) ([e61d468](https://github.com/qlover/fe-base/commit/e61d4683a072048326205272d927e7e67b87ba70))
96
+ - .gitignore no file ([#207](https://github.com/qlover/fe-base/issues/207)) ([e61d468](https://github.com/qlover/fe-base/commit/e61d4683a072048326205272d927e7e67b87ba70))
84
97
 
85
98
  ## 0.0.1 (2025-01-14)
86
99
 
87
100
  ## 0.0.2 (2025-01-14)
88
101
 
89
-
90
102
  ### Features
91
103
 
92
- * create fe app ([#200](https://github.com/qlover/fe-base/issues/200)) ([8d3668f](https://github.com/qlover/fe-base/commit/8d3668f0e69a579994a72fc7b36b5ba7d5633c70))
104
+ - 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,16 +50,26 @@
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
- "@qlover/fe-utils": "latest"
73
+ "@qlover/fe-corekit": "latest"
64
74
  }
65
75
  }
@@ -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
+ ]);