stock/frontend/eslint.config.js
ZhangPeng 9aecdd036c Initial commit: OpenClaw Trading - AI多智能体量化交易系统
- 添加项目核心代码和配置
- 添加前端界面 (Next.js)
- 添加单元测试
- 更新 .gitignore 排除缓存和依赖
2026-02-27 03:47:40 +08:00

55 lines
1.6 KiB
JavaScript

// For more info, see https://github.com/storybookjs/eslint-plugin-storybook#configuration-flat-config-format
import storybook from "eslint-plugin-storybook";
import js from "@eslint/js";
import globals from "globals";
import react from "eslint-plugin-react";
import reactHooks from "eslint-plugin-react-hooks";
import reactRefresh from "eslint-plugin-react-refresh";
import tseslint from "typescript-eslint";
import { defineConfig, globalIgnores } from "eslint/config";
export default defineConfig([globalIgnores(["dist"]), {
files: ["**/*.{ts,tsx}"],
ignores: ["vite.config.ts"],
extends: [
js.configs.recommended,
tseslint.configs.recommended,
react.configs.flat.recommended,
reactHooks.configs.flat.recommended,
reactRefresh.configs.vite,
],
languageOptions: {
ecmaVersion: 2020,
globals: globals.browser,
parserOptions: {
project: ["./tsconfig.app.json"],
tsconfigRootDir: import.meta.dirname,
},
},
rules: {
// React 17+ uses the new JSX transform, no need to import React
"react/react-in-jsx-scope": "off",
"react/jsx-uses-react": "off",
},
settings: {
react: {
version: "detect",
runtime: "automatic",
},
"import/resolver": {
typescript: {
project: "./tsconfig.app.json",
},
},
},
}, // Separate config for vite.config.ts to avoid tsconfig project restriction
{
files: ["vite.config.ts"],
extends: [js.configs.recommended, tseslint.configs.recommended],
languageOptions: {
ecmaVersion: 2020,
globals: globals.node,
},
}, ...storybook.configs["flat/recommended"]]);