conf: 调整eslint, 允许数据层使用hooks

feature/price_manager
Lei OT 1 year ago
parent e31a20e92d
commit 28e2b9f6a6

@ -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',
},
}
};

Loading…
Cancel
Save