Commit 3ea51067 authored by afc163's avatar afc163

enable eslint import rules

parent a0da5078
......@@ -15,8 +15,8 @@ module.exports = {
'react/prop-types': 0,
'react/forbid-prop-types': 0,
'react/jsx-one-expression-per-line': 0,
'import/no-unresolved': 0,
'import/no-extraneous-dependencies': 0,
'import/no-unresolved': [2, { ignore: ['^@', '^umi/'] }],
'import/no-extraneous-dependencies': [2, { optionalDependencies: true }],
'jsx-a11y/no-noninteractive-element-interactions': 0,
'jsx-a11y/click-events-have-key-events': 0,
'jsx-a11y/no-static-element-interactions': 0,
......
......@@ -2,19 +2,14 @@ import React from 'react';
import { Route, Redirect } from 'react-router-dom';
import Authorized from './Authorized';
class AuthorizedRoute extends React.Component {
render() {
// TODO: umi只会返回render和rest
const { component: Component, render, authority, redirectPath, ...rest } = this.props;
return (
<Authorized
authority={authority}
noMatch={<Route {...rest} render={() => <Redirect to={{ pathname: redirectPath }} />} />}
>
<Route {...rest} render={props => (Component ? <Component {...props} /> : render(props))} />
</Authorized>
);
}
}
// TODO: umi只会返回render和rest
const AuthorizedRoute = ({ component: Component, render, authority, redirectPath, ...rest }) => (
<Authorized
authority={authority}
noMatch={<Route {...rest} render={() => <Redirect to={{ pathname: redirectPath }} />} />}
>
<Route {...rest} render={props => (Component ? <Component {...props} /> : render(props))} />
</Authorized>
);
export default AuthorizedRoute;
import React from 'react';
import { Layout } from 'antd';
import DocumentTitle from 'react-document-title';
import deepEqual from 'lodash.isequal';
import deepEqual from 'lodash/isEqual';
import memoizeOne from 'memoize-one';
import { connect } from 'dva';
import { ContainerQuery } from 'react-container-query';
......
import React, { PureComponent, Fragment } from 'react';
import { Table, Button, Input, message, Popconfirm, Divider } from 'antd';
import isEqual from 'lodash.isequal';
import isEqual from 'lodash/isEqual';
import styles from './style.less';
export default class TableForm extends PureComponent {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment