|
|
@@ -1,32 +1,22 @@
|
|
|
module.exports = {
|
|
|
- extends: [require.resolve('@umijs/fabric/dist/eslint')],
|
|
|
- globals: {
|
|
|
- ANT_DESIGN_PRO_ONLY_DO_NOT_USE_IN_YOUR_PRODUCTION: true,
|
|
|
- page: true,
|
|
|
- REACT_APP_ENV: true
|
|
|
- },
|
|
|
- rules: {
|
|
|
- semi: ['error', 'never'],
|
|
|
- 'no-multiple-empty-lines': [1, { max: 2 }],
|
|
|
- 'comma-dangle': [2, 'never'],
|
|
|
- 'react/prop-types': 0,
|
|
|
- 'spaced-comment': 'error',
|
|
|
- // 'array-bracket-spacing': ['error', 'always'], // 和prettier冲突
|
|
|
- 'object-curly-spacing': ['error', 'always'],
|
|
|
- 'no-use-before-define': ['error', { functions: false }], // 允许在未定义function前调用
|
|
|
- 'react/self-closing-comp': [
|
|
|
- 'error',
|
|
|
- {
|
|
|
- component: true,
|
|
|
- html: true
|
|
|
- }
|
|
|
+ "env": {
|
|
|
+ "browser": true,
|
|
|
+ "es2021": true
|
|
|
+ },
|
|
|
+ "extends": [
|
|
|
+ "eslint:recommended",
|
|
|
+ "plugin:react/recommended"
|
|
|
],
|
|
|
- 'react-hooks/exhaustive-deps': 0,
|
|
|
- 'no-unused-expressions': [
|
|
|
- 'error',
|
|
|
- {
|
|
|
- allowShortCircuit: true
|
|
|
- }
|
|
|
- ]
|
|
|
- }
|
|
|
-}
|
|
|
+ "parserOptions": {
|
|
|
+ "ecmaFeatures": {
|
|
|
+ "jsx": true
|
|
|
+ },
|
|
|
+ "ecmaVersion": 12,
|
|
|
+ "sourceType": "module"
|
|
|
+ },
|
|
|
+ "plugins": [
|
|
|
+ "react"
|
|
|
+ ],
|
|
|
+ "rules": {
|
|
|
+ }
|
|
|
+};
|