diff --git a/.babelrc.js b/.babelrc.js
deleted file mode 100644
index 20a0892bb2d10d31f820b3f6e4b164a791aedc69..0000000000000000000000000000000000000000
--- a/.babelrc.js
+++ /dev/null
@@ -1,21 +0,0 @@
-const path = require('path');
-
-module.exports = {
- plugins: [
- [
- 'module-resolver',
- {
- alias: {
- components: path.join(__dirname, './src/components'),
- },
- },
- ],
- [
- 'import',
- {
- libraryName: 'antd',
- style: true, // or 'css'
- },
- ],
- ],
-};
diff --git a/.eslintrc.js b/.eslintrc.js
index 292b7e0608a754486dcc1f1519295ab775c5590b..faa6a366e2d35c87680259da9fa9c56a21f7c39b 100755
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -1,6 +1,6 @@
module.exports = {
parser: 'babel-eslint',
- extends: ['airbnb', 'prettier'],
+ extends: ['airbnb', 'prettier', 'plugin:compat/recommended'],
env: {
browser: true,
node: true,
@@ -13,7 +13,6 @@ module.exports = {
'react/jsx-filename-extension': [1, { extensions: ['.js'] }],
'react/jsx-wrap-multilines': 0,
'react/prop-types': 0,
- 'react/prefer-stateless-function': 0,
'react/forbid-prop-types': 0,
'react/jsx-one-expression-per-line': 0,
'import/no-unresolved': 0,
@@ -24,6 +23,6 @@ module.exports = {
'jsx-a11y/anchor-is-valid': 0,
},
settings: {
- polyfills: ['fetch', 'promises'],
+ polyfills: ['fetch', 'promises', 'url'],
},
};
diff --git a/package.json b/package.json
index 1ae0411fd9c8cadfaa0775c28a1ef939ae4c6da8..83d099977852f3d033ad0dfc569dd69e1705f988 100755
--- a/package.json
+++ b/package.json
@@ -50,7 +50,7 @@
"@types/react-dom": "^16.0.6",
"antd-pro-merge-less": "^0.0.9",
"antd-pro-theme-webpack-plugin": "^1.1.8",
- "babel-eslint": "^9.0.0",
+ "babel-eslint": "^8.2.6",
"cross-env": "^5.1.1",
"cross-port-killer": "^1.0.1",
"enzyme": "^3.4.4",
@@ -59,7 +59,6 @@
"eslint-config-prettier": "^3.0.1",
"eslint-plugin-babel": "^5.1.0",
"eslint-plugin-compat": "^2.5.1",
- "eslint-plugin-flowtype": "2.50.0",
"eslint-plugin-import": "^2.8.0",
"eslint-plugin-jsx-a11y": "^6.0.3",
"eslint-plugin-markdown": "^1.0.0-beta.6",
diff --git a/src/components/Authorized/Authorized.js b/src/components/Authorized/Authorized.js
index 8e7aacb21f921ccc31cf22c1d0d9af6a8459aa8d..75d57b88c20c285a188f5a9ef35adcd55146877e 100644
--- a/src/components/Authorized/Authorized.js
+++ b/src/components/Authorized/Authorized.js
@@ -1,12 +1,8 @@
-import React from 'react';
import CheckPermissions from './CheckPermissions';
-class Authorized extends React.Component {
- render() {
- const { children, authority, noMatch = null } = this.props;
- const childrenRender = typeof children === 'undefined' ? null : children;
- return CheckPermissions(authority, childrenRender, noMatch);
- }
-}
+const Authorized = ({ children, authority, noMatch = null }) => {
+ const childrenRender = typeof children === 'undefined' ? null : children;
+ return CheckPermissions(authority, childrenRender, noMatch);
+};
export default Authorized;
diff --git a/src/pages/Exception/403.js b/src/pages/Exception/403.js
index addd50eb5373843b8b800ec7110d01dd8e79cb6d..ab0341aaa09b745b899688707d316a82fc22b835 100644
--- a/src/pages/Exception/403.js
+++ b/src/pages/Exception/403.js
@@ -1,19 +1,16 @@
-import React, { Component } from 'react';
+import React from 'react';
import { formatMessage } from 'umi/locale';
import Link from 'umi/link';
import Exception from '@/components/Exception';
-class Exception403 extends Component {
- render() {
- return (
-
- );
- }
-}
+const Exception403 = () => (
+
+);
+
export default Exception403;
diff --git a/src/pages/Exception/404.js b/src/pages/Exception/404.js
index 813632c96238f36921738b50f1d4aeee63eb01e1..50d5bd9b4fa27dc62c488c821b229ea5f2ac8f2d 100644
--- a/src/pages/Exception/404.js
+++ b/src/pages/Exception/404.js
@@ -1,19 +1,16 @@
-import React, { Component } from 'react';
+import React from 'react';
import { formatMessage } from 'umi/locale';
import Link from 'umi/link';
import Exception from '@/components/Exception';
-class Exception404 extends Component {
- render() {
- return (
-
- );
- }
-}
+const Exception404 = () => (
+
+);
+
export default Exception404;
diff --git a/src/pages/Exception/500.js b/src/pages/Exception/500.js
index 72d3679d91d1247fcad1546b0b303f66040b4fdc..640f7a93195829f091ca45af7fbc508cb14a6236 100644
--- a/src/pages/Exception/500.js
+++ b/src/pages/Exception/500.js
@@ -1,19 +1,16 @@
-import React, { Component } from 'react';
+import React from 'react';
import { formatMessage } from 'umi/locale';
import Link from 'umi/link';
import Exception from '@/components/Exception';
-class Exception500 extends Component {
- render() {
- return (
-
- );
- }
-}
+const Exception500 = () => (
+
+);
+
export default Exception500;