diff --git a/.env.local b/.env.local index 3a71b8f1..352497a7 100644 --- a/.env.local +++ b/.env.local @@ -1,5 +1,5 @@ # 环境变量 @see https://www.nextjs.cn/docs/basic-features/environment-variables -NEXT_PUBLIC_VERSION=4.7.2 +NEXT_PUBLIC_VERSION=4.7.3 # 可在此添加环境变量,去掉最左边的(# )注释即可 diff --git a/.eslintrc.js b/.eslintrc.js index c6fbb20a..e2a5efe4 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -4,15 +4,30 @@ module.exports = { es2021: true, node: true }, - extends: ['plugin:react/recommended', 'plugin:@next/next/recommended', 'standard', 'prettier'], + extends: [ + 'plugin:react/jsx-runtime', + 'plugin:react/recommended', + 'plugin:@next/next/recommended', + 'standard', + 'prettier', + 'plugin:@typescript-eslint/recommended', // 添加 TypeScript 推荐规则 + 'plugin:@typescript-eslint/recommended-requiring-type-checking' // 添加需要类型检查的规则 + ], + parser: '@typescript-eslint/parser', // 使用 TypeScript 解析器 parserOptions: { ecmaFeatures: { jsx: true }, ecmaVersion: 12, - sourceType: 'module' + sourceType: 'module', + project: './tsconfig.json' // 指定 tsconfig.json 的路径 }, - plugins: ['react', 'react-hooks', 'prettier'], + plugins: [ + 'react', + 'react-hooks', + 'prettier', + '@typescript-eslint' // 添加 TypeScript 插件 + ], settings: { react: { version: 'detect' @@ -23,7 +38,9 @@ module.exports = { 'react/no-unknown-property': 'off', //