create-secra 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -5
- package/README.zh-CN.md +15 -4
- package/bin/index.mjs +9 -15
- package/package.json +2 -2
- package/template/{apps/core/index.html → index.html} +2 -3
- package/template/package.json +11 -47
- package/template/src/App.tsx +48 -0
- package/template/src/main.tsx +36 -0
- package/template/src/styles.css +163 -0
- package/template/src/vite-env.d.ts +1 -0
- package/template/tsconfig.app.json +0 -5
- package/template/tsconfig.node.json +0 -5
- package/template/vite.config.ts +6 -0
- package/template/apps/core/package.json +0 -18
- package/template/apps/core/public/favicon.ico +0 -1
- package/template/apps/core/public/favicon.svg +0 -1
- package/template/apps/core/public/logo.svg +0 -1
- package/template/apps/core/src/assets/react.svg +0 -1
- package/template/apps/core/src/main.tsx +0 -35
- package/template/apps/core/src/pages/index.tsx +0 -84
- package/template/apps/core/src/router.ts +0 -19
- package/template/apps/core/src/types/auto-imports.d.ts +0 -130
- package/template/apps/core/tsconfig.app.json +0 -7
- package/template/apps/core/tsconfig.json +0 -7
- package/template/apps/core/tsconfig.node.json +0 -7
- package/template/apps/core/vite.config.ts +0 -86
- package/template/eslint.config.js +0 -23
- package/template/packages/sdk/.swcrc +0 -18
- package/template/packages/sdk/package-lock.json +0 -1621
- package/template/packages/sdk/package.json +0 -35
- package/template/packages/sdk/src/build/index.ts +0 -33
- package/template/packages/sdk/src/build/plugins/auto-import.ts +0 -47
- package/template/packages/sdk/src/build/plugins/bundle-analyzer.ts +0 -35
- package/template/packages/sdk/src/build/plugins/remove-console.ts +0 -21
- package/template/packages/sdk/src/build/plugins/unocss.ts +0 -113
- package/template/packages/sdk/src/build/plugins/unplugin-icon.ts +0 -43
- package/template/packages/sdk/src/index.ts +0 -1
- package/template/packages/sdk/src/request/index.ts +0 -341
- package/template/packages/sdk/src/styles/reset.css +0 -111
- package/template/packages/sdk/tsconfig.json +0 -16
- package/template/pnpm-lock.yaml +0 -8034
- package/template/pnpm-workspace.yaml +0 -3
- package/template/turbo.json +0 -17
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import '@vlian/sdk/reset.css';
|
|
2
|
-
import { kernelStartApp, type KernelRenderContext } from '@vlian/framework/kernel';
|
|
3
|
-
import { LogLevel } from "@vlian/logger";
|
|
4
|
-
import {StrictMode} from "react";
|
|
5
|
-
import { createRoot } from 'react-dom/client';
|
|
6
|
-
import App from "./pages/index.tsx"
|
|
7
|
-
const container = document.getElementById('root');
|
|
8
|
-
|
|
9
|
-
if (!container) {
|
|
10
|
-
throw new Error('Root container #root was not found.');
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
const rootContainer = container;
|
|
14
|
-
|
|
15
|
-
const startApp = async () => {
|
|
16
|
-
await kernelStartApp({
|
|
17
|
-
config: {
|
|
18
|
-
logger: {
|
|
19
|
-
level: import.meta.env.PROD ? LogLevel.INFO : LogLevel.DEBUG,
|
|
20
|
-
},
|
|
21
|
-
},
|
|
22
|
-
render: (_context: KernelRenderContext) => {
|
|
23
|
-
|
|
24
|
-
const root = createRoot(rootContainer);
|
|
25
|
-
|
|
26
|
-
root.render(
|
|
27
|
-
<StrictMode>
|
|
28
|
-
<App />
|
|
29
|
-
</StrictMode>,
|
|
30
|
-
);
|
|
31
|
-
}
|
|
32
|
-
})
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
void startApp();
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
import type { CSSProperties } from "react";
|
|
2
|
-
import reactLogo from "../assets/react.svg";
|
|
3
|
-
|
|
4
|
-
const cardStyle: CSSProperties = {
|
|
5
|
-
border: "1px solid #e5e7eb",
|
|
6
|
-
borderRadius: 12,
|
|
7
|
-
padding: 16,
|
|
8
|
-
background: "#ffffff",
|
|
9
|
-
boxShadow: "0 6px 24px rgba(15, 23, 42, 0.06)",
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
const Home = () => {
|
|
13
|
-
return (
|
|
14
|
-
<main
|
|
15
|
-
style={{
|
|
16
|
-
minHeight: "100vh",
|
|
17
|
-
padding: "48px 20px",
|
|
18
|
-
background: "linear-gradient(180deg, #f8fafc 0%, #ffffff 100%)",
|
|
19
|
-
color: "#0f172a",
|
|
20
|
-
}}
|
|
21
|
-
>
|
|
22
|
-
<section style={{ maxWidth: 920, margin: "0 auto" }}>
|
|
23
|
-
<header style={{ display: "flex", alignItems: "center", gap: 16, marginBottom: 24 }}>
|
|
24
|
-
<img src={reactLogo} alt="React Logo" width={48} height={48} />
|
|
25
|
-
<div>
|
|
26
|
-
<h1 style={{ fontSize: 34, lineHeight: 1.2, margin: 0 }}>
|
|
27
|
-
React + Vite + Secra
|
|
28
|
-
</h1>
|
|
29
|
-
<p style={{ margin: "8px 0 0", color: "#475569" }}>
|
|
30
|
-
A fast starter template for modern frontend projects.
|
|
31
|
-
</p>
|
|
32
|
-
</div>
|
|
33
|
-
</header>
|
|
34
|
-
|
|
35
|
-
<div
|
|
36
|
-
style={{
|
|
37
|
-
display: "grid",
|
|
38
|
-
gridTemplateColumns: "repeat(auto-fit, minmax(220px, 1fr))",
|
|
39
|
-
gap: 14,
|
|
40
|
-
}}
|
|
41
|
-
>
|
|
42
|
-
<article style={cardStyle}>
|
|
43
|
-
<h3 style={{ marginTop: 0 }}>React</h3>
|
|
44
|
-
<p style={{ margin: 0, color: "#475569" }}>
|
|
45
|
-
Build component-based UI with a clean and maintainable structure.
|
|
46
|
-
</p>
|
|
47
|
-
</article>
|
|
48
|
-
<article style={cardStyle}>
|
|
49
|
-
<h3 style={{ marginTop: 0 }}>Vite</h3>
|
|
50
|
-
<p style={{ margin: 0, color: "#475569" }}>
|
|
51
|
-
Enjoy instant startup and fast HMR for daily development.
|
|
52
|
-
</p>
|
|
53
|
-
</article>
|
|
54
|
-
<article style={cardStyle}>
|
|
55
|
-
<h3 style={{ marginTop: 0 }}>Secra</h3>
|
|
56
|
-
<p style={{ margin: 0, color: "#475569" }}>
|
|
57
|
-
Structured app bootstrap, routing and engineering defaults out of the box.
|
|
58
|
-
</p>
|
|
59
|
-
</article>
|
|
60
|
-
</div>
|
|
61
|
-
|
|
62
|
-
<section style={{ ...cardStyle, marginTop: 18 }}>
|
|
63
|
-
<h2 style={{ marginTop: 0, fontSize: 20 }}>Quick Start</h2>
|
|
64
|
-
<pre
|
|
65
|
-
style={{
|
|
66
|
-
margin: 0,
|
|
67
|
-
padding: 14,
|
|
68
|
-
borderRadius: 8,
|
|
69
|
-
background: "#0f172a",
|
|
70
|
-
color: "#e2e8f0",
|
|
71
|
-
overflowX: "auto",
|
|
72
|
-
}}
|
|
73
|
-
>
|
|
74
|
-
{`pnpm install
|
|
75
|
-
pnpm -r --filter "./packages/*" build
|
|
76
|
-
pnpm dev`}
|
|
77
|
-
</pre>
|
|
78
|
-
</section>
|
|
79
|
-
</section>
|
|
80
|
-
</main>
|
|
81
|
-
);
|
|
82
|
-
};
|
|
83
|
-
|
|
84
|
-
export default Home;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import type { RouteConfig } from "@vlian/framework/core"
|
|
2
|
-
|
|
3
|
-
const HomePage = lazy(() => import("./pages/index"));
|
|
4
|
-
|
|
5
|
-
export const getRoutes = async (): Promise<RouteConfig[]> => {
|
|
6
|
-
return [
|
|
7
|
-
{
|
|
8
|
-
path: "/",
|
|
9
|
-
name: "home",
|
|
10
|
-
page: async () => ({
|
|
11
|
-
default: HomePage,
|
|
12
|
-
}),
|
|
13
|
-
handle: {
|
|
14
|
-
title: "首页",
|
|
15
|
-
order: 1,
|
|
16
|
-
}
|
|
17
|
-
},
|
|
18
|
-
]
|
|
19
|
-
}
|
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
/* eslint-disable */
|
|
2
|
-
/* prettier-ignore */
|
|
3
|
-
// @ts-nocheck
|
|
4
|
-
// noinspection JSUnusedGlobalSymbols
|
|
5
|
-
// Generated by unplugin-auto-import
|
|
6
|
-
export {}
|
|
7
|
-
declare global {
|
|
8
|
-
const Link: typeof import('react-router-dom')['Link']
|
|
9
|
-
const NavLink: typeof import('react-router-dom')['NavLink']
|
|
10
|
-
const Navigate: typeof import('react-router-dom')['Navigate']
|
|
11
|
-
const Outlet: typeof import('react-router-dom')['Outlet']
|
|
12
|
-
const Route: typeof import('react-router-dom')['Route']
|
|
13
|
-
const Routes: typeof import('react-router-dom')['Routes']
|
|
14
|
-
const createRef: typeof import('react')['createRef']
|
|
15
|
-
const forwardRef: typeof import('react')['forwardRef']
|
|
16
|
-
const lazy: typeof import('react')['lazy']
|
|
17
|
-
const memo: typeof import('react')['memo']
|
|
18
|
-
const startTransition: typeof import('react')['startTransition']
|
|
19
|
-
const useAntdTable: typeof import('ahooks')['useAntdTable']
|
|
20
|
-
const useAsyncEffect: typeof import('ahooks')['useAsyncEffect']
|
|
21
|
-
const useBoolean: typeof import('ahooks')['useBoolean']
|
|
22
|
-
const useCallback: typeof import('react')['useCallback']
|
|
23
|
-
const useClickAway: typeof import('ahooks')['useClickAway']
|
|
24
|
-
const useContext: typeof import('react')['useContext']
|
|
25
|
-
const useControllableValue: typeof import('ahooks')['useControllableValue']
|
|
26
|
-
const useCookieState: typeof import('ahooks')['useCookieState']
|
|
27
|
-
const useCountDown: typeof import('ahooks')['useCountDown']
|
|
28
|
-
const useCounter: typeof import('ahooks')['useCounter']
|
|
29
|
-
const useCreation: typeof import('ahooks')['useCreation']
|
|
30
|
-
const useDebounce: typeof import('ahooks')['useDebounce']
|
|
31
|
-
const useDebounceEffect: typeof import('ahooks')['useDebounceEffect']
|
|
32
|
-
const useDebounceFn: typeof import('ahooks')['useDebounceFn']
|
|
33
|
-
const useDebugValue: typeof import('react')['useDebugValue']
|
|
34
|
-
const useDeepCompareEffect: typeof import('ahooks')['useDeepCompareEffect']
|
|
35
|
-
const useDeepCompareLayoutEffect: typeof import('ahooks')['useDeepCompareLayoutEffect']
|
|
36
|
-
const useDeferredValue: typeof import('react')['useDeferredValue']
|
|
37
|
-
const useDocumentVisibility: typeof import('ahooks')['useDocumentVisibility']
|
|
38
|
-
const useDrag: typeof import('ahooks')['useDrag']
|
|
39
|
-
const useDrop: typeof import('ahooks')['useDrop']
|
|
40
|
-
const useDynamicList: typeof import('ahooks')['useDynamicList']
|
|
41
|
-
const useEffect: typeof import('react')['useEffect']
|
|
42
|
-
const useEventEmitter: typeof import('ahooks')['useEventEmitter']
|
|
43
|
-
const useEventListener: typeof import('ahooks')['useEventListener']
|
|
44
|
-
const useEventTarget: typeof import('ahooks')['useEventTarget']
|
|
45
|
-
const useExternal: typeof import('ahooks')['useExternal']
|
|
46
|
-
const useFavicon: typeof import('ahooks')['useFavicon']
|
|
47
|
-
const useFocusWithin: typeof import('ahooks')['useFocusWithin']
|
|
48
|
-
const useFullscreen: typeof import('ahooks')['useFullscreen']
|
|
49
|
-
const useFusionTable: typeof import('ahooks')['useFusionTable']
|
|
50
|
-
const useGetState: typeof import('ahooks')['useGetState']
|
|
51
|
-
const useHistoryTravel: typeof import('ahooks')['useHistoryTravel']
|
|
52
|
-
const useHover: typeof import('ahooks')['useHover']
|
|
53
|
-
const useHref: typeof import('react-router-dom')['useHref']
|
|
54
|
-
const useId: typeof import('react')['useId']
|
|
55
|
-
const useImperativeHandle: typeof import('react')['useImperativeHandle']
|
|
56
|
-
const useInRouterContext: typeof import('react-router-dom')['useInRouterContext']
|
|
57
|
-
const useInViewport: typeof import('ahooks')['useInViewport']
|
|
58
|
-
const useInfiniteScroll: typeof import('ahooks')['useInfiniteScroll']
|
|
59
|
-
const useInsertionEffect: typeof import('react')['useInsertionEffect']
|
|
60
|
-
const useInterval: typeof import('ahooks')['useInterval']
|
|
61
|
-
const useIsomorphicLayoutEffect: typeof import('ahooks')['useIsomorphicLayoutEffect']
|
|
62
|
-
const useKeyPress: typeof import('ahooks')['useKeyPress']
|
|
63
|
-
const useLatest: typeof import('ahooks')['useLatest']
|
|
64
|
-
const useLayoutEffect: typeof import('react')['useLayoutEffect']
|
|
65
|
-
const useLinkClickHandler: typeof import('react-router-dom')['useLinkClickHandler']
|
|
66
|
-
const useLocalStorageState: typeof import('ahooks')['useLocalStorageState']
|
|
67
|
-
const useLocation: typeof import('react-router-dom')['useLocation']
|
|
68
|
-
const useLockFn: typeof import('ahooks')['useLockFn']
|
|
69
|
-
const useLongPress: typeof import('ahooks')['useLongPress']
|
|
70
|
-
const useMap: typeof import('ahooks')['useMap']
|
|
71
|
-
const useMemo: typeof import('react')['useMemo']
|
|
72
|
-
const useMemoizedFn: typeof import('ahooks')['useMemoizedFn']
|
|
73
|
-
const useMount: typeof import('ahooks')['useMount']
|
|
74
|
-
const useMouse: typeof import('ahooks')['useMouse']
|
|
75
|
-
const useMutationObserver: typeof import('ahooks')['useMutationObserver']
|
|
76
|
-
const useNavigate: typeof import('react-router-dom')['useNavigate']
|
|
77
|
-
const useNavigationType: typeof import('react-router-dom')['useNavigationType']
|
|
78
|
-
const useNetwork: typeof import('ahooks')['useNetwork']
|
|
79
|
-
const useOutlet: typeof import('react-router-dom')['useOutlet']
|
|
80
|
-
const useOutletContext: typeof import('react-router-dom')['useOutletContext']
|
|
81
|
-
const usePagination: typeof import('ahooks')['usePagination']
|
|
82
|
-
const useParams: typeof import('react-router-dom')['useParams']
|
|
83
|
-
const usePrevious: typeof import('ahooks')['usePrevious']
|
|
84
|
-
const useRafInterval: typeof import('ahooks')['useRafInterval']
|
|
85
|
-
const useRafState: typeof import('ahooks')['useRafState']
|
|
86
|
-
const useRafTimeout: typeof import('ahooks')['useRafTimeout']
|
|
87
|
-
const useReactive: typeof import('ahooks')['useReactive']
|
|
88
|
-
const useReducer: typeof import('react')['useReducer']
|
|
89
|
-
const useRef: typeof import('react')['useRef']
|
|
90
|
-
const useRequest: typeof import('ahooks')['useRequest']
|
|
91
|
-
const useResetState: typeof import('ahooks')['useResetState']
|
|
92
|
-
const useResolvedPath: typeof import('react-router-dom')['useResolvedPath']
|
|
93
|
-
const useResponsive: typeof import('ahooks')['useResponsive']
|
|
94
|
-
const useRoutes: typeof import('react-router-dom')['useRoutes']
|
|
95
|
-
const useSafeState: typeof import('ahooks')['useSafeState']
|
|
96
|
-
const useScroll: typeof import('ahooks')['useScroll']
|
|
97
|
-
const useSearchParams: typeof import('react-router-dom')['useSearchParams']
|
|
98
|
-
const useSelections: typeof import('ahooks')['useSelections']
|
|
99
|
-
const useSessionStorageState: typeof import('ahooks')['useSessionStorageState']
|
|
100
|
-
const useSet: typeof import('ahooks')['useSet']
|
|
101
|
-
const useSetState: typeof import('ahooks')['useSetState']
|
|
102
|
-
const useSize: typeof import('ahooks')['useSize']
|
|
103
|
-
const useState: typeof import('react')['useState']
|
|
104
|
-
const useSyncExternalStore: typeof import('react')['useSyncExternalStore']
|
|
105
|
-
const useTextSelection: typeof import('ahooks')['useTextSelection']
|
|
106
|
-
const useTheme: typeof import('ahooks')['useTheme']
|
|
107
|
-
const useThrottle: typeof import('ahooks')['useThrottle']
|
|
108
|
-
const useThrottleEffect: typeof import('ahooks')['useThrottleEffect']
|
|
109
|
-
const useThrottleFn: typeof import('ahooks')['useThrottleFn']
|
|
110
|
-
const useTimeout: typeof import('ahooks')['useTimeout']
|
|
111
|
-
const useTitle: typeof import('ahooks')['useTitle']
|
|
112
|
-
const useToggle: typeof import('ahooks')['useToggle']
|
|
113
|
-
const useTrackedEffect: typeof import('ahooks')['useTrackedEffect']
|
|
114
|
-
const useTransition: typeof import('react')['useTransition']
|
|
115
|
-
const useTranslation: typeof import('react-i18next')['useTranslation']
|
|
116
|
-
const useUnmount: typeof import('ahooks')['useUnmount']
|
|
117
|
-
const useUnmountedRef: typeof import('ahooks')['useUnmountedRef']
|
|
118
|
-
const useUpdate: typeof import('ahooks')['useUpdate']
|
|
119
|
-
const useUpdateEffect: typeof import('ahooks')['useUpdateEffect']
|
|
120
|
-
const useUpdateLayoutEffect: typeof import('ahooks')['useUpdateLayoutEffect']
|
|
121
|
-
const useVirtualList: typeof import('ahooks')['useVirtualList']
|
|
122
|
-
const useWebSocket: typeof import('ahooks')['useWebSocket']
|
|
123
|
-
const useWhyDidYouUpdate: typeof import('ahooks')['useWhyDidYouUpdate']
|
|
124
|
-
}
|
|
125
|
-
// for type re-export
|
|
126
|
-
declare global {
|
|
127
|
-
// @ts-ignore
|
|
128
|
-
export type { FC, ReactNode, ComponentType } from 'react'
|
|
129
|
-
import('react')
|
|
130
|
-
}
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
import { defineConfig } from 'vite'
|
|
2
|
-
import react from '@vitejs/plugin-react'
|
|
3
|
-
import path from 'node:path';
|
|
4
|
-
import {
|
|
5
|
-
setupAutoImport,
|
|
6
|
-
setupUnocss,
|
|
7
|
-
setupUnPluginIcon,
|
|
8
|
-
setupRemoveConsole,
|
|
9
|
-
Inspect,
|
|
10
|
-
include,
|
|
11
|
-
} from '@vlian/sdk';
|
|
12
|
-
|
|
13
|
-
const api_url = 'http://127.0.0.1:9010/api';
|
|
14
|
-
|
|
15
|
-
// https://vite.dev/config/
|
|
16
|
-
export default defineConfig({
|
|
17
|
-
plugins: [
|
|
18
|
-
react(),
|
|
19
|
-
// 开发环境:打包检查工具(可选,需要 vite@^6.0.0)
|
|
20
|
-
// 注意:vite-plugin-inspect 在某些情况下可能不兼容,如遇错误请注释掉
|
|
21
|
-
Inspect(),
|
|
22
|
-
|
|
23
|
-
// 生产环境:移除 console
|
|
24
|
-
setupRemoveConsole(),
|
|
25
|
-
|
|
26
|
-
// 自动导入
|
|
27
|
-
setupAutoImport(),
|
|
28
|
-
|
|
29
|
-
// UnoCSS(需要指定本地图标路径)
|
|
30
|
-
setupUnocss(
|
|
31
|
-
path.join(process.cwd(), 'src/assets/svg-icon'),
|
|
32
|
-
{
|
|
33
|
-
// 覆盖 content 配置,扫描主应用代码
|
|
34
|
-
content: {
|
|
35
|
-
filesystem: ['./src/**/*.{tsx,ts,jsx,js}'],
|
|
36
|
-
},
|
|
37
|
-
}
|
|
38
|
-
),
|
|
39
|
-
|
|
40
|
-
// 图标插件(SVG 支持)
|
|
41
|
-
...setupUnPluginIcon(
|
|
42
|
-
path.join(process.cwd(), 'src/assets/svg-icon')
|
|
43
|
-
),
|
|
44
|
-
|
|
45
|
-
// 打包分析(可选,建议仅在需要时启用)
|
|
46
|
-
// setupBundleAnalyzer({
|
|
47
|
-
// filename: '../../dist/main/stats.html',
|
|
48
|
-
// open: true,
|
|
49
|
-
// }),
|
|
50
|
-
],
|
|
51
|
-
resolve: {
|
|
52
|
-
alias: {
|
|
53
|
-
'@': path.resolve(__dirname, './src'),
|
|
54
|
-
'@vlian/sdk/reset.css': path.resolve(__dirname, '../../packages/sdk/src/styles/reset.css'),
|
|
55
|
-
'@vlian/sdk/request': path.resolve(__dirname, '../../packages/sdk/src/request/index.ts'),
|
|
56
|
-
'@vlian/sdk': path.resolve(__dirname, '../../packages/sdk/src/index.ts'),
|
|
57
|
-
},
|
|
58
|
-
preserveSymlinks: false,
|
|
59
|
-
},
|
|
60
|
-
// 依赖优化
|
|
61
|
-
optimizeDeps: {
|
|
62
|
-
include: [...include],
|
|
63
|
-
exclude: ["@vlian/sdk", "@vlian/sdk/request"],
|
|
64
|
-
},
|
|
65
|
-
server: {
|
|
66
|
-
host: '127.0.0.1',
|
|
67
|
-
port: 5173,
|
|
68
|
-
open: true,
|
|
69
|
-
// cors: true,
|
|
70
|
-
proxy: {
|
|
71
|
-
'/api': {
|
|
72
|
-
target: api_url,
|
|
73
|
-
changeOrigin: true,
|
|
74
|
-
rewrite: (path: string) => {
|
|
75
|
-
return path.replace(/^\/api/, '');
|
|
76
|
-
},
|
|
77
|
-
},
|
|
78
|
-
},
|
|
79
|
-
},
|
|
80
|
-
build: {
|
|
81
|
-
outDir: '../../dist/core',
|
|
82
|
-
sourcemap: true,
|
|
83
|
-
// 确保 CSS 被提取到单独文件
|
|
84
|
-
cssCodeSplit: false,
|
|
85
|
-
},
|
|
86
|
-
})
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import js from '@eslint/js'
|
|
2
|
-
import globals from 'globals'
|
|
3
|
-
import reactHooks from 'eslint-plugin-react-hooks'
|
|
4
|
-
import reactRefresh from 'eslint-plugin-react-refresh'
|
|
5
|
-
import tseslint from 'typescript-eslint'
|
|
6
|
-
import { defineConfig, globalIgnores } from 'eslint/config'
|
|
7
|
-
|
|
8
|
-
export default defineConfig([
|
|
9
|
-
globalIgnores(['dist']),
|
|
10
|
-
{
|
|
11
|
-
files: ['**/*.{ts,tsx}'],
|
|
12
|
-
extends: [
|
|
13
|
-
js.configs.recommended,
|
|
14
|
-
tseslint.configs.recommended,
|
|
15
|
-
reactHooks.configs.flat.recommended,
|
|
16
|
-
reactRefresh.configs.vite,
|
|
17
|
-
],
|
|
18
|
-
languageOptions: {
|
|
19
|
-
ecmaVersion: 2020,
|
|
20
|
-
globals: globals.browser,
|
|
21
|
-
},
|
|
22
|
-
},
|
|
23
|
-
])
|