Files
ThriveX-Blog/eslint.config.mjs
宇阳 a0e790873e refactor(api): 更新API调用方式为GET并调整数据处理
- 将多个API方法的请求方式从POST改为GET,以提高一致性和性能。
- 更新相关组件以适应新的数据结构,确保从API响应中正确访问结果。
- 移除不必要的API调用,简化代码结构。
2026-05-13 20:09:50 +08:00

46 lines
1.6 KiB
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import js from '@eslint/js';
import globals from 'globals';
import tseslint from 'typescript-eslint';
import pluginReact from 'eslint-plugin-react';
import { defineConfig } from 'eslint/config';
import reactHooks from 'eslint-plugin-react-hooks';
import reactRefresh from 'eslint-plugin-react-refresh';
import nextPlugin from '@next/eslint-plugin-next';
export default defineConfig([
{
files: ['**/*.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
plugins: { js },
extends: ['js/recommended'],
},
{
files: ['**/*.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
languageOptions: { globals: globals.browser },
},
{
plugins: {
'react-hooks': reactHooks,
'react-refresh': reactRefresh,
},
},
tseslint.configs.recommended,
pluginReact.configs.flat.recommended,
nextPlugin.configs.recommended,
{
rules: {
// 禁止使用 any 类型
'@typescript-eslint/no-explicit-any': 'off', // 改为警告,鼓励使用具体类型
'no-unused-vars': 'off', // 改为警告,提醒未使用的变量
'react-refresh/only-export-components': 'off',
'react/display-name': 'off',
'react/prop-types': 'off', // TypeScript 项目不需要 prop-types 验证
// 约束js使用单引号允许jsx双引号
quotes: ['error', 'single', { avoidEscape: true, allowTemplateLiterals: true }],
'jsx-quotes': ['error', 'prefer-double'],
'react-hooks/exhaustive-deps': 'off', // 改为警告,提醒依赖数组
'react/react-in-jsx-scope': 'off',
// 约束使用 next/image 组件
'@next/next/no-img-element': 'off',
},
},
]);