diff --git a/.eslintrc.js b/.eslintrc.js index a255138957075be25d94ee9dd7451155f39ff285..929f3ee8b30d04716bd3fde7473d4e9b46f2e70d 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,10 +1,7 @@ -const fabric = require('@umijs/fabric'); +const { strictEslint } = require('@umijs/fabric'); module.exports = { - ...fabric.default, - rules: { - ...fabric.default.rules, - }, + ...strictEslint, globals: { ANT_DESIGN_PRO_ONLY_DO_NOT_USE_IN_YOUR_PRODUCTION: true, page: true, diff --git a/package.json b/package.json index 36d0bfae43c6b3da9b3475179b72fcfd7dbfd37b..2679827b6d92cbed09da98fdef1f0e6f734e223f 100644 --- a/package.json +++ b/package.json @@ -54,7 +54,7 @@ "not ie <= 10" ], "dependencies": { - "@ant-design/pro-layout": "^4.5.0", + "@ant-design/pro-layout": "^4.5.7", "@antv/data-set": "^0.10.2", "antd": "^3.19.1", "classnames": "^2.2.6", @@ -67,7 +67,6 @@ "path-to-regexp": "^3.0.0", "prop-types": "^15.7.2", "qs": "^6.7.0", - "rc-animate": "^2.8.3", "react": "^16.8.6", "react-container-query": "^0.11.0", "react-copy-to-clipboard": "^5.0.1", @@ -76,10 +75,10 @@ "react-media": "^1.9.2", "react-media-hook2": "^1.0.5", "redux": "^4.0.1", - "umi": "^2.7.2", + "umi": "^2.8.7", "umi-plugin-pro-block": "^1.3.2", - "umi-plugin-react": "^1.8.2", - "umi-request": "^1.0.7" + "umi-plugin-react": "^1.9.5", + "umi-request": "^1.0.8" }, "devDependencies": { "@ant-design/colors": "^3.1.0", @@ -91,8 +90,7 @@ "@types/react": "^16.8.19", "@types/react-document-title": "^2.0.3", "@types/react-dom": "^16.8.4", - "@umijs/fabric": "^1.0.4", - "babel-eslint": "^10.0.1", + "@umijs/fabric": "^1.1.0", "chalk": "^2.4.2", "check-prettier": "^1.0.3", "cross-env": "^5.2.0", diff --git a/src/components/GlobalHeader/AvatarDropdown.tsx b/src/components/GlobalHeader/AvatarDropdown.tsx index d23380434a8d2f300a38d6ebf8974ec2df063626..ccdb7494f4497fe5020a2c0eb7fb34aec76ddc9a 100644 --- a/src/components/GlobalHeader/AvatarDropdown.tsx +++ b/src/components/GlobalHeader/AvatarDropdown.tsx @@ -1,12 +1,12 @@ import { Avatar, Icon, Menu, Spin } from 'antd'; -import { ConnectProps, ConnectState } from '@/models/connect'; - import { ClickParam } from 'antd/es/menu'; -import { CurrentUser } from '@/models/user'; import { FormattedMessage } from 'umi-plugin-react/locale'; import React from 'react'; import { connect } from 'dva'; import router from 'umi/router'; + +import { ConnectProps, ConnectState } from '@/models/connect'; +import { CurrentUser } from '@/models/user'; import HeaderDropdown from '../HeaderDropdown'; import styles from './index.less'; diff --git a/src/components/GlobalHeader/NoticeIconView.tsx b/src/components/GlobalHeader/NoticeIconView.tsx index 52a26e8a0a97e006522304cba34d1812aaab3caa..0f019060fbe43f40267caf18426013a88c408446 100644 --- a/src/components/GlobalHeader/NoticeIconView.tsx +++ b/src/components/GlobalHeader/NoticeIconView.tsx @@ -1,14 +1,14 @@ -import { ConnectProps, ConnectState } from '@/models/connect'; import React, { Component } from 'react'; import { Tag, message } from 'antd'; - -import { CurrentUser } from '@/models/user'; -import NoticeIcon from '../NoticeIcon'; -import { NoticeItem } from '@/models/global'; import { connect } from 'dva'; import { formatMessage } from 'umi-plugin-react/locale'; import groupBy from 'lodash/groupBy'; import moment from 'moment'; + +import { NoticeItem } from '@/models/global'; +import NoticeIcon from '../NoticeIcon'; +import { CurrentUser } from '@/models/user'; +import { ConnectProps, ConnectState } from '@/models/connect'; import styles from './index.less'; export interface GlobalHeaderRightProps extends ConnectProps { diff --git a/src/components/GlobalHeader/RightContent.tsx b/src/components/GlobalHeader/RightContent.tsx index 9200785daf02123b233d95550d9e224b0a83b4c4..3516fc568d98225f0885d781e21a493868912400 100644 --- a/src/components/GlobalHeader/RightContent.tsx +++ b/src/components/GlobalHeader/RightContent.tsx @@ -1,12 +1,12 @@ -import { ConnectProps, ConnectState } from '@/models/connect'; import { Icon, Tooltip } from 'antd'; +import React from 'react'; +import { connect } from 'dva'; +import { formatMessage } from 'umi-plugin-react/locale'; +import { ConnectProps, ConnectState } from '@/models/connect'; import Avatar from './AvatarDropdown'; import HeaderSearch from '../HeaderSearch'; -import React from 'react'; import SelectLang from '../SelectLang'; -import { connect } from 'dva'; -import { formatMessage } from 'umi-plugin-react/locale'; import styles from './index.less'; export type SiderTheme = 'light' | 'dark'; diff --git a/src/layouts/UserLayout.tsx b/src/layouts/UserLayout.tsx index 30397dd3f2a4a78a385f86b45a6d67f56b2ee888..6a792ff2dc7ed02cbf4d254dd6b965018703fdd4 100644 --- a/src/layouts/UserLayout.tsx +++ b/src/layouts/UserLayout.tsx @@ -1,12 +1,12 @@ -import { ConnectProps, ConnectState } from '@/models/connect'; import { DefaultFooter, MenuDataItem, getMenuData, getPageTitle } from '@ant-design/pro-layout'; - import DocumentTitle from 'react-document-title'; import Link from 'umi/link'; import React from 'react'; -import SelectLang from '@/components/SelectLang'; import { connect } from 'dva'; import { formatMessage } from 'umi-plugin-react/locale'; + +import SelectLang from '@/components/SelectLang'; +import { ConnectProps, ConnectState } from '@/models/connect'; import logo from '../assets/logo.svg'; import styles from './UserLayout.less'; diff --git a/src/models/global.ts b/src/models/global.ts index a79cac67d800178bde088e6440556bcfb25f42a2..0142139dc3b1dde732850eeb72e2bb8c6381a9ac 100644 --- a/src/models/global.ts +++ b/src/models/global.ts @@ -1,7 +1,8 @@ -import { Effect } from './connect.d'; -import { NoticeIconData } from '@/components/NoticeIcon'; import { Reducer } from 'redux'; import { Subscription } from 'dva'; + +import { Effect } from './connect.d'; +import { NoticeIconData } from '@/components/NoticeIcon'; import { queryNotices } from '@/services/user'; export interface NoticeItem extends NoticeIconData { diff --git a/src/models/setting.ts b/src/models/setting.ts index 2e52eb54f11cbee5efde3a6ecafae3532b78c570..860b9dd625d162953e508870c6affe2771a2e789 100644 --- a/src/models/setting.ts +++ b/src/models/setting.ts @@ -1,6 +1,4 @@ import { Reducer } from 'redux'; -// eslint-disable-next-line eslint-comments/disable-enable-pair -/* eslint-disable promise/catch-or-return */ import { message } from 'antd'; import defaultSettings, { DefaultSettings } from '../../config/defaultSettings'; import themeColorClient from '../components/SettingDrawer/themeColorClient'; diff --git a/src/models/user.ts b/src/models/user.ts index 426ff9aa5d14cb9c766c1dc83c26e7c66022878a..54bde7a53abd02c0a998054ead957a2248260085 100644 --- a/src/models/user.ts +++ b/src/models/user.ts @@ -1,8 +1,8 @@ -import { queryCurrent, query as queryUsers } from '@/services/user'; - import { Effect } from 'dva'; import { Reducer } from 'redux'; +import { queryCurrent, query as queryUsers } from '@/services/user'; + export interface CurrentUser { avatar?: string; name?: string; diff --git a/src/pages/Authorized.tsx b/src/pages/Authorized.tsx index 1bfd82670bf4c1a9fcdfb249b3b9654b479c057f..5497611172770021cf59cb1e50be6f0683f6bc3b 100644 --- a/src/pages/Authorized.tsx +++ b/src/pages/Authorized.tsx @@ -1,10 +1,9 @@ -import { ConnectProps, ConnectState, Route, UserModelState } from '@/models/connect'; - -import Authorized from '@/utils/Authorized'; import React from 'react'; import Redirect from 'umi/redirect'; import { connect } from 'dva'; import pathToRegexp from 'path-to-regexp'; +import Authorized from '@/utils/Authorized'; +import { ConnectProps, ConnectState, Route, UserModelState } from '@/models/connect'; interface AuthComponentProps extends ConnectProps { user: UserModelState; diff --git a/src/typings.d.ts b/src/typings.d.ts index fff79b4347eb239612e60fb3129d76ad766f1722..1815fe620eb69141aeaea9789aef7ee875f53504 100644 --- a/src/typings.d.ts +++ b/src/typings.d.ts @@ -12,7 +12,6 @@ declare module '*.jpeg'; declare module '*.gif'; declare module '*.bmp'; declare module '*.tiff'; -declare module 'rc-animate'; declare module 'omit.js'; declare module 'react-copy-to-clipboard'; declare module 'react-fittext';