- 更新 ESLint 配置以忽略 vite.config.ts 文件。 - 在 package.json 中添加 pnpm 配置。 - 修改 tsconfig 文件以包含 vite.config.ts 和 eslint.config.ts。 - 在多个场景中添加引导对话,增强用户学习体验。 - 更新组件中的文本和描述,确保一致性和准确性。
34 lines
956 B
TypeScript
34 lines
956 B
TypeScript
import js from "@eslint/js";
|
|
import globals from "globals";
|
|
import reactHooks from "eslint-plugin-react-hooks";
|
|
import reactRefresh from "eslint-plugin-react-refresh";
|
|
import tseslint from "typescript-eslint";
|
|
|
|
export default tseslint.config(
|
|
{ ignores: ["dist", "node_modules", "vite.config.ts"] },
|
|
{
|
|
extends: [js.configs.recommended, ...tseslint.configs.recommended],
|
|
files: ["**/*.{ts,tsx}"],
|
|
languageOptions: {
|
|
ecmaVersion: 2020,
|
|
globals: globals.browser,
|
|
},
|
|
plugins: {
|
|
"react-hooks": reactHooks,
|
|
"react-refresh": reactRefresh,
|
|
},
|
|
rules: {
|
|
...reactHooks.configs.recommended.rules,
|
|
"react-refresh/only-export-components": [
|
|
"warn",
|
|
{ allowConstantExport: true },
|
|
],
|
|
"@typescript-eslint/no-unused-vars": [
|
|
"warn",
|
|
{ varsIgnorePattern: "^_", argsIgnorePattern: "^_" },
|
|
],
|
|
"@typescript-eslint/no-explicit-any": "off",
|
|
},
|
|
}
|
|
);
|