From 28e2b9f6a60d8031372897510b5667cec96a6e96 Mon Sep 17 00:00:00 2001 From: Lei OT Date: Fri, 7 Jun 2024 14:47:50 +0800 Subject: [PATCH] =?UTF-8?q?conf:=20=E8=B0=83=E6=95=B4eslint,=20=E5=85=81?= =?UTF-8?q?=E8=AE=B8=E6=95=B0=E6=8D=AE=E5=B1=82=E4=BD=BF=E7=94=A8hooks?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .eslintrc.cjs | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/.eslintrc.cjs b/.eslintrc.cjs index bdbae1d..16779ae 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -1,22 +1,15 @@ module.exports = { root: true, env: { browser: true, es2020: true }, - extends: [ - 'eslint:recommended', - 'plugin:react/recommended', - 'plugin:react/jsx-runtime', - 'plugin:react-hooks/recommended', - ], + extends: ['eslint:recommended', 'plugin:react/recommended', 'plugin:react/jsx-runtime', 'plugin:react-hooks/recommended'], ignorePatterns: ['dist', '.eslintrc.cjs'], parserOptions: { ecmaVersion: 'latest', sourceType: 'module' }, settings: { react: { version: '18.2' } }, plugins: ['react-refresh'], rules: { - 'react-refresh/only-export-components': [ - 'warn', - { allowConstantExport: true }, - ], + 'react-refresh/only-export-components': ['warn', { allowConstantExport: true }], 'no-unused-vars': ['warn', { args: 'after-used', vars: 'all' }], - "react/prop-types": "off", + 'react/prop-types': 'off', + 'react-hooks/rules-of-hooks': 'warn', }, -} +};