1234567891011121314151617181920212223242526272829303132 |
- module.exports = {
- extends: [
- './base.js',
- 'plugin:react/recommended',
- 'plugin:react-hooks/recommended',
- 'plugin:jsx-a11y/recommended',
- ],
- settings: {
- react: {
- version: 'detect',
- },
- },
- rules: {
- // React 相关规则
- 'react/prop-types': 'off',
- 'react/react-in-jsx-scope': 'off',
- 'react/display-name': 'off',
- 'react/jsx-curly-brace-presence': ['error', { props: 'never', children: 'never' }],
- 'react/jsx-boolean-value': ['error', 'never'],
- 'react/self-closing-comp': 'error',
- 'react/jsx-no-useless-fragment': 'warn',
-
- // React Hooks 规则
- 'react-hooks/rules-of-hooks': 'error',
- 'react-hooks/exhaustive-deps': 'warn',
-
- // JSX 无障碍规则
- 'jsx-a11y/anchor-is-valid': 'warn',
- 'jsx-a11y/click-events-have-key-events': 'warn',
- 'jsx-a11y/no-static-element-interactions': 'warn',
- },
- };
|