From cbf117ec66c3bc23c1e29a7b7fdf728f0fcd0ea3 Mon Sep 17 00:00:00 2001 From: afc163 Date: Sun, 2 Sep 2018 16:36:49 +0800 Subject: [PATCH] upgrade babel-eslint version --- package.json | 2 +- src/components/Charts/Gauge/index.js | 3 ++- src/components/Charts/MiniArea/index.js | 3 ++- src/components/Charts/MiniBar/index.js | 3 ++- src/components/Charts/Pie/index.js | 3 ++- src/components/Charts/Radar/index.js | 3 ++- src/components/Charts/TimelineChart/index.js | 3 ++- src/components/Charts/WaterWave/index.js | 3 ++- src/pages/Account/Center/Applications.js | 3 ++- src/pages/Account/Center/Articles.js | 3 ++- src/pages/Account/Center/Center.js | 3 ++- src/pages/Account/Center/Projects.js | 3 ++- src/pages/Account/Settings/GeographicView.js | 3 ++- src/pages/Account/Settings/Info.js | 3 ++- src/pages/Dashboard/Monitor.js | 4 +++- src/pages/Dashboard/Workplace.js | 3 ++- src/pages/Exception/triggerException.js | 3 ++- src/pages/Forms/AdvancedForm.js | 3 ++- src/pages/Forms/BasicForm.js | 3 ++- src/pages/Forms/StepForm/Step1.js | 3 ++- src/pages/Forms/StepForm/Step3.js | 3 ++- src/pages/List/Applications.js | 3 ++- src/pages/List/Articles.js | 3 ++- src/pages/List/BasicList.js | 3 ++- src/pages/List/CardList.js | 3 ++- src/pages/List/List.js | 3 ++- src/pages/List/Projects.js | 3 ++- src/pages/List/TableList.js | 3 ++- src/pages/Profile/AdvancedProfile.js | 3 ++- src/pages/Profile/BasicProfile.js | 3 ++- src/pages/User/Login.js | 3 ++- src/pages/User/Register.js | 3 ++- 32 files changed, 64 insertions(+), 32 deletions(-) diff --git a/package.json b/package.json index 2a812fee..77d77194 100644 --- a/package.json +++ b/package.json @@ -57,7 +57,7 @@ "@types/react-dom": "^16.0.6", "antd-pro-merge-less": "^0.0.9", "antd-pro-theme-webpack-plugin": "^1.1.8", - "babel-eslint": "^8.2.6", + "babel-eslint": "^9.0.0", "cross-env": "^5.1.1", "cross-port-killer": "^1.0.1", "enzyme": "^3.4.4", diff --git a/src/components/Charts/Gauge/index.js b/src/components/Charts/Gauge/index.js index 093587d4..450de00c 100644 --- a/src/components/Charts/Gauge/index.js +++ b/src/components/Charts/Gauge/index.js @@ -51,8 +51,9 @@ Shape.registerShape('point', 'pointer', { }, }); +export default @autoHeight() -export default class Gauge extends React.Component { +class Gauge extends React.Component { render() { const { title, diff --git a/src/components/Charts/MiniArea/index.js b/src/components/Charts/MiniArea/index.js index 151fdd1c..77a19a6f 100644 --- a/src/components/Charts/MiniArea/index.js +++ b/src/components/Charts/MiniArea/index.js @@ -3,8 +3,9 @@ import { Chart, Axis, Tooltip, Geom } from 'bizcharts'; import autoHeight from '../autoHeight'; import styles from '../index.less'; +export default @autoHeight() -export default class MiniArea extends React.PureComponent { +class MiniArea extends React.PureComponent { render() { const { height, diff --git a/src/components/Charts/MiniBar/index.js b/src/components/Charts/MiniBar/index.js index 92ee6b51..c9b56101 100644 --- a/src/components/Charts/MiniBar/index.js +++ b/src/components/Charts/MiniBar/index.js @@ -3,8 +3,9 @@ import { Chart, Tooltip, Geom } from 'bizcharts'; import autoHeight from '../autoHeight'; import styles from '../index.less'; +export default @autoHeight() -export default class MiniBar extends React.Component { +class MiniBar extends React.Component { render() { const { height, forceFit = true, color = '#1890FF', data = [] } = this.props; diff --git a/src/components/Charts/Pie/index.js b/src/components/Charts/Pie/index.js index 1dc0e92f..124fb748 100644 --- a/src/components/Charts/Pie/index.js +++ b/src/components/Charts/Pie/index.js @@ -11,8 +11,9 @@ import autoHeight from '../autoHeight'; import styles from './index.less'; /* eslint react/no-danger:0 */ +export default @autoHeight() -export default class Pie extends Component { +class Pie extends Component { state = { legendData: [], legendBlock: false, diff --git a/src/components/Charts/Radar/index.js b/src/components/Charts/Radar/index.js index beb88b77..55137dc6 100644 --- a/src/components/Charts/Radar/index.js +++ b/src/components/Charts/Radar/index.js @@ -5,8 +5,9 @@ import autoHeight from '../autoHeight'; import styles from './index.less'; /* eslint react/no-danger:0 */ +export default @autoHeight() -export default class Radar extends Component { +class Radar extends Component { state = { legendData: [], }; diff --git a/src/components/Charts/TimelineChart/index.js b/src/components/Charts/TimelineChart/index.js index 018464da..1f7b43f7 100644 --- a/src/components/Charts/TimelineChart/index.js +++ b/src/components/Charts/TimelineChart/index.js @@ -5,8 +5,9 @@ import Slider from 'bizcharts-plugin-slider'; import autoHeight from '../autoHeight'; import styles from './index.less'; +export default @autoHeight() -export default class TimelineChart extends React.Component { +class TimelineChart extends React.Component { render() { const { title, diff --git a/src/components/Charts/WaterWave/index.js b/src/components/Charts/WaterWave/index.js index f25ef751..0fd61a95 100644 --- a/src/components/Charts/WaterWave/index.js +++ b/src/components/Charts/WaterWave/index.js @@ -6,8 +6,9 @@ import styles from './index.less'; /* eslint no-mixed-operators: 0 */ // riddle: https://riddle.alibaba-inc.com/riddles/2d9a4b90 +export default @autoHeight() -export default class WaterWave extends PureComponent { +class WaterWave extends PureComponent { state = { radio: 1, }; diff --git a/src/pages/Account/Center/Applications.js b/src/pages/Account/Center/Applications.js index 114325bb..54d1ff87 100644 --- a/src/pages/Account/Center/Applications.js +++ b/src/pages/Account/Center/Applications.js @@ -5,10 +5,11 @@ import { connect } from 'dva'; import { formatWan } from '@/utils/utils'; import stylesApplications from '../../List/Applications.less'; +export default @connect(({ list }) => ({ list, })) -export default class Center extends PureComponent { +class Center extends PureComponent { render() { const { list: { list }, diff --git a/src/pages/Account/Center/Articles.js b/src/pages/Account/Center/Articles.js index ece18617..fb42f2a9 100644 --- a/src/pages/Account/Center/Articles.js +++ b/src/pages/Account/Center/Articles.js @@ -5,10 +5,11 @@ import { connect } from 'dva'; import stylesArticles from '../../List/Articles.less'; import styles from './Articles.less'; +export default @connect(({ list }) => ({ list, })) -export default class Center extends PureComponent { +class Center extends PureComponent { render() { const { list: { list }, diff --git a/src/pages/Account/Center/Center.js b/src/pages/Account/Center/Center.js index 0d699ecb..786e0cd8 100644 --- a/src/pages/Account/Center/Center.js +++ b/src/pages/Account/Center/Center.js @@ -6,6 +6,7 @@ import { Card, Row, Col, Icon, Avatar, Tag, Divider, Spin, Input } from 'antd'; import GridContent from '@/components/PageHeaderWrapper/GridContent'; import styles from './Center.less'; +export default @connect(({ loading, user, project }) => ({ listLoading: loading.effects['list/fetch'], currentUser: user.currentUser, @@ -13,7 +14,7 @@ import styles from './Center.less'; project, projectLoading: loading.effects['project/fetchNotice'], })) -export default class Center extends PureComponent { +class Center extends PureComponent { state = { newTags: [], inputVisible: false, diff --git a/src/pages/Account/Center/Projects.js b/src/pages/Account/Center/Projects.js index 74af5e16..c4e389ab 100644 --- a/src/pages/Account/Center/Projects.js +++ b/src/pages/Account/Center/Projects.js @@ -5,10 +5,11 @@ import { connect } from 'dva'; import AvatarList from '@/components/AvatarList'; import stylesProjects from '../../List/Projects.less'; +export default @connect(({ list }) => ({ list, })) -export default class Center extends PureComponent { +class Center extends PureComponent { render() { const { list: { list }, diff --git a/src/pages/Account/Settings/GeographicView.js b/src/pages/Account/Settings/GeographicView.js index b4f7a99b..8d6925cd 100644 --- a/src/pages/Account/Settings/GeographicView.js +++ b/src/pages/Account/Settings/GeographicView.js @@ -10,6 +10,7 @@ const nullSlectItem = { key: '', }; +export default @connect(({ geographic }) => { const { province, isLoading, city } = geographic; return { @@ -18,7 +19,7 @@ const nullSlectItem = { isLoading, }; }) -export default class GeographicView extends PureComponent { +class GeographicView extends PureComponent { componentDidMount = () => { const { dispatch } = this.props; dispatch({ diff --git a/src/pages/Account/Settings/Info.js b/src/pages/Account/Settings/Info.js index 49fda8fe..ab7edaf9 100644 --- a/src/pages/Account/Settings/Info.js +++ b/src/pages/Account/Settings/Info.js @@ -8,10 +8,11 @@ import styles from './Info.less'; const { Item } = Menu; +export default @connect(({ user }) => ({ currentUser: user.currentUser, })) -export default class Info extends Component { +class Info extends Component { constructor(props) { super(props); const { match, location } = props; diff --git a/src/pages/Dashboard/Monitor.js b/src/pages/Dashboard/Monitor.js index 71fc6384..5ec0a260 100644 --- a/src/pages/Dashboard/Monitor.js +++ b/src/pages/Dashboard/Monitor.js @@ -20,12 +20,14 @@ const havePermissionAsync = new Promise(resolve => { // Call resolve on behalf of passed setTimeout(() => resolve(), 300); }); + +export default @Secured(havePermissionAsync) @connect(({ monitor, loading }) => ({ monitor, loading: loading.models.monitor, })) -export default class Monitor extends PureComponent { +class Monitor extends PureComponent { componentDidMount() { const { dispatch } = this.props; dispatch({ diff --git a/src/pages/Dashboard/Workplace.js b/src/pages/Dashboard/Workplace.js index 8826bb3f..c53ef469 100644 --- a/src/pages/Dashboard/Workplace.js +++ b/src/pages/Dashboard/Workplace.js @@ -37,6 +37,7 @@ const links = [ }, ]; +export default @connect(({ user, project, activities, chart, loading }) => ({ currentUser: user.currentUser, project, @@ -46,7 +47,7 @@ const links = [ projectLoading: loading.effects['project/fetchNotice'], activitiesLoading: loading.effects['activities/fetchList'], })) -export default class Workplace extends PureComponent { +class Workplace extends PureComponent { componentDidMount() { const { dispatch } = this.props; dispatch({ diff --git a/src/pages/Exception/triggerException.js b/src/pages/Exception/triggerException.js index 3daab286..1f561ee6 100644 --- a/src/pages/Exception/triggerException.js +++ b/src/pages/Exception/triggerException.js @@ -3,10 +3,11 @@ import { Button, Spin, Card } from 'antd'; import { connect } from 'dva'; import styles from './style.less'; +export default @connect(state => ({ isloading: state.error.isloading, })) -export default class TriggerException extends PureComponent { +class TriggerException extends PureComponent { state = { isloading: false, }; diff --git a/src/pages/Forms/AdvancedForm.js b/src/pages/Forms/AdvancedForm.js index 595d5222..a78afed8 100644 --- a/src/pages/Forms/AdvancedForm.js +++ b/src/pages/Forms/AdvancedForm.js @@ -57,11 +57,12 @@ const tableData = [ }, ]; +export default @connect(({ loading }) => ({ submitting: loading.effects['form/submitAdvancedForm'], })) @Form.create() -export default class AdvancedForm extends PureComponent { +class AdvancedForm extends PureComponent { state = { width: '100%', }; diff --git a/src/pages/Forms/BasicForm.js b/src/pages/Forms/BasicForm.js index 9c851533..9040ccea 100644 --- a/src/pages/Forms/BasicForm.js +++ b/src/pages/Forms/BasicForm.js @@ -20,11 +20,12 @@ const { Option } = Select; const { RangePicker } = DatePicker; const { TextArea } = Input; +export default @connect(({ loading }) => ({ submitting: loading.effects['form/submitRegularForm'], })) @Form.create() -export default class BasicForms extends PureComponent { +class BasicForms extends PureComponent { handleSubmit = e => { const { dispatch, form } = this.props; e.preventDefault(); diff --git a/src/pages/Forms/StepForm/Step1.js b/src/pages/Forms/StepForm/Step1.js index 07c3b02e..1be5d661 100644 --- a/src/pages/Forms/StepForm/Step1.js +++ b/src/pages/Forms/StepForm/Step1.js @@ -15,11 +15,12 @@ const formItemLayout = { }, }; +export default @connect(({ form }) => ({ data: form.step, })) @Form.create() -export default class Step1 extends React.PureComponent { +class Step1 extends React.PureComponent { render() { const { form, dispatch, data } = this.props; const { getFieldDecorator, validateFields } = form; diff --git a/src/pages/Forms/StepForm/Step3.js b/src/pages/Forms/StepForm/Step3.js index 5273a5d5..4004c399 100644 --- a/src/pages/Forms/StepForm/Step3.js +++ b/src/pages/Forms/StepForm/Step3.js @@ -5,10 +5,11 @@ import router from 'umi/router'; import Result from '@/components/Result'; import styles from './style.less'; +export default @connect(({ form }) => ({ data: form.step, })) -export default class Step3 extends React.PureComponent { +class Step3 extends React.PureComponent { render() { const { data } = this.props; const onFinish = () => { diff --git a/src/pages/List/Applications.js b/src/pages/List/Applications.js index 9bf1e42c..4d0871fe 100644 --- a/src/pages/List/Applications.js +++ b/src/pages/List/Applications.js @@ -12,12 +12,13 @@ import styles from './Applications.less'; const { Option } = Select; const FormItem = Form.Item; +export default @Form.create() @connect(({ list, loading }) => ({ list, loading: loading.models.list, })) -export default class FilterCardList extends PureComponent { +class FilterCardList extends PureComponent { componentDidMount() { const { dispatch } = this.props; dispatch({ diff --git a/src/pages/List/Articles.js b/src/pages/List/Articles.js index 9e90d02b..a9a8c0f5 100644 --- a/src/pages/List/Articles.js +++ b/src/pages/List/Articles.js @@ -12,12 +12,13 @@ const FormItem = Form.Item; const pageSize = 5; +export default @Form.create() @connect(({ list, loading }) => ({ list, loading: loading.models.list, })) -export default class SearchList extends Component { +class SearchList extends Component { componentDidMount() { this.fetchMore(); } diff --git a/src/pages/List/BasicList.js b/src/pages/List/BasicList.js index 9618db81..9e4e3ee2 100644 --- a/src/pages/List/BasicList.js +++ b/src/pages/List/BasicList.js @@ -32,12 +32,13 @@ const RadioGroup = Radio.Group; const SelectOption = Select.Option; const { Search, TextArea } = Input; +export default @connect(({ list, loading }) => ({ list, loading: loading.models.list, })) @Form.create() -export default class BasicList extends PureComponent { +class BasicList extends PureComponent { state = { visible: false, done: false }; formLayout = { diff --git a/src/pages/List/CardList.js b/src/pages/List/CardList.js index 72f14d38..f7a04ebf 100644 --- a/src/pages/List/CardList.js +++ b/src/pages/List/CardList.js @@ -7,11 +7,12 @@ import PageHeaderWrapper from '@/components/PageHeaderWrapper'; import styles from './CardList.less'; +export default @connect(({ list, loading }) => ({ list, loading: loading.models.list, })) -export default class CardList extends PureComponent { +class CardList extends PureComponent { componentDidMount() { const { dispatch } = this.props; dispatch({ diff --git a/src/pages/List/List.js b/src/pages/List/List.js index a747e5cb..9662df0a 100644 --- a/src/pages/List/List.js +++ b/src/pages/List/List.js @@ -4,8 +4,9 @@ import { connect } from 'dva'; import { Input } from 'antd'; import PageHeaderWrapper from '@/components/PageHeaderWrapper'; +export default @connect() -export default class SearchList extends Component { +class SearchList extends Component { handleTabChange = key => { const { match } = this.props; switch (key) { diff --git a/src/pages/List/Projects.js b/src/pages/List/Projects.js index 1b04eb62..e36cbdc2 100644 --- a/src/pages/List/Projects.js +++ b/src/pages/List/Projects.js @@ -14,12 +14,13 @@ const { Option } = Select; const FormItem = Form.Item; /* eslint react/no-array-index-key: 0 */ +export default @Form.create() @connect(({ list, loading }) => ({ list, loading: loading.models.list, })) -export default class CoverCardList extends PureComponent { +class CoverCardList extends PureComponent { componentDidMount() { const { dispatch } = this.props; dispatch({ diff --git a/src/pages/List/TableList.js b/src/pages/List/TableList.js index a5465d05..7e4d985d 100644 --- a/src/pages/List/TableList.js +++ b/src/pages/List/TableList.js @@ -266,12 +266,13 @@ class UpdateForm extends PureComponent { } /* eslint react/no-multi-comp:0 */ +export default @connect(({ rule, loading }) => ({ rule, loading: loading.models.rule, })) @Form.create() -export default class TableList extends PureComponent { +class TableList extends PureComponent { state = { modalVisible: false, updateModalVisible: false, diff --git a/src/pages/Profile/AdvancedProfile.js b/src/pages/Profile/AdvancedProfile.js index 711d2f4d..4ee9af2e 100644 --- a/src/pages/Profile/AdvancedProfile.js +++ b/src/pages/Profile/AdvancedProfile.js @@ -180,11 +180,12 @@ const columns = [ }, ]; +export default @connect(({ profile, loading }) => ({ profile, loading: loading.effects['profile/fetchAdvanced'], })) -export default class AdvancedProfile extends Component { +class AdvancedProfile extends Component { state = { operationkey: 'tab1', stepDirection: 'horizontal', diff --git a/src/pages/Profile/BasicProfile.js b/src/pages/Profile/BasicProfile.js index ff2c7bc1..fa342031 100644 --- a/src/pages/Profile/BasicProfile.js +++ b/src/pages/Profile/BasicProfile.js @@ -41,11 +41,12 @@ const progressColumns = [ }, ]; +export default @connect(({ profile, loading }) => ({ profile, loading: loading.effects['profile/fetchBasic'], })) -export default class BasicProfile extends Component { +class BasicProfile extends Component { componentDidMount() { const { dispatch } = this.props; dispatch({ diff --git a/src/pages/User/Login.js b/src/pages/User/Login.js index e0c9c1e8..4be60676 100644 --- a/src/pages/User/Login.js +++ b/src/pages/User/Login.js @@ -7,11 +7,12 @@ import styles from './Login.less'; const { Tab, UserName, Password, Mobile, Captcha, Submit } = Login; +export default @connect(({ login, loading }) => ({ login, submitting: loading.effects['login/login'], })) -export default class LoginPage extends Component { +class LoginPage extends Component { state = { type: 'account', autoLogin: true, diff --git a/src/pages/User/Register.js b/src/pages/User/Register.js index 7ea4c604..0c9aa0e3 100644 --- a/src/pages/User/Register.js +++ b/src/pages/User/Register.js @@ -21,12 +21,13 @@ const passwordProgressMap = { poor: 'exception', }; +export default @connect(({ register, loading }) => ({ register, submitting: loading.effects['register/submit'], })) @Form.create() -export default class Register extends Component { +class Register extends Component { state = { count: 0, confirmDirty: false, -- GitLab